aptechka 0.62.4 → 0.63.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.
@@ -29,6 +29,7 @@ export interface MorphNavigateOptions {
29
29
  revalidate?: boolean;
30
30
  keepSearchParameters?: boolean;
31
31
  submorph?: Array<string>;
32
+ clearState?: boolean;
32
33
  }
33
34
  export interface MorphScrollDetail {
34
35
  left: number;
@@ -57,6 +58,8 @@ export declare class Morph {
57
58
  get links(): MorphLink[];
58
59
  get scrollElement(): HTMLElement;
59
60
  get isPopstateNavigation(): boolean;
61
+ saveState(state: any): void;
62
+ getState(): any;
60
63
  normalizePath(path: string): {
61
64
  leaf: string;
62
65
  pathname: string;
@@ -64,7 +67,7 @@ export declare class Morph {
64
67
  hash: string;
65
68
  };
66
69
  prefetch(path: string, revalidate?: boolean): Promise<void>;
67
- navigate(path: string, { historyAction, centerScroll, offsetScroll, revalidate, keepSearchParameters, submorph, }?: MorphNavigateOptions): Promise<void>;
70
+ navigate(path: string, { historyAction, centerScroll, offsetScroll, revalidate, keepSearchParameters, submorph, clearState, }?: MorphNavigateOptions): Promise<void>;
68
71
  addLink(element: HTMLAnchorElement): void;
69
72
  addLinks(elements: Array<HTMLAnchorElement>): void;
70
73
  removeLink(element: HTMLAnchorElement): void;
@@ -7,6 +7,7 @@ export interface MorphRouteSaveState {
7
7
  scroll?: MorphRouteScrollState | undefined;
8
8
  document?: Document | undefined;
9
9
  }
10
+ export type MorpRouteSaveParametersArg = string | object | URLSearchParams;
10
11
  export declare class MorphRoute {
11
12
  #private;
12
13
  constructor(morph: Morph, pathname: string, initialDocument: Document);
@@ -18,7 +19,9 @@ export declare class MorphRoute {
18
19
  clearScrollState(): void;
19
20
  clearDocumentState(): void;
20
21
  saveScrollState(): void;
21
- saveDocumentState(): void;
22
22
  restoreScrollPosition(): void;
23
+ saveDocumentState(): void;
23
24
  renewScrollPosition(): void;
25
+ saveState(state: any): void;
26
+ clearState(): any;
24
27
  }
@@ -1 +1 @@
1
- "use strict";var Pt=(n,t)=>(t=Symbol[n])?t:Symbol.for("Symbol."+n),At=n=>{throw TypeError(n)};var ct=(n,t,s)=>t.has(n)||At("Cannot "+s);var e=(n,t,s)=>(ct(n,t,"read from private field"),s?s.call(n):t.get(n)),o=(n,t,s)=>t.has(n)?At("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(n):t.set(n,s),a=(n,t,s,i)=>(ct(n,t,"write to private field"),i?i.call(n,s):t.set(n,s),s),d=(n,t,s)=>(ct(n,t,"access private method"),s);var R=(n,t,s)=>new Promise((i,u)=>{var v=S=>{try{g(s.next(S))}catch(A){u(A)}},L=S=>{try{g(s.throw(S))}catch(A){u(A)}},g=S=>S.done?i(S.value):Promise.resolve(S.value).then(v,L);g((s=s.apply(n,t)).next())});var kt=(n,t,s)=>(t=n[Pt("asyncIterator")])?t.call(n):(n=n[Pt("iterator")](),t={},s=(i,u)=>(u=n[i])&&(t[i]=v=>new Promise((L,g,S)=>(v=u.call(n,v),S=v.done,Promise.resolve(v.value).then(A=>L({value:A,done:S}),g)))),s("next"),s("return"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Mt=require("../index-Cqw2NKev.cjs"),U=require("../events-KVanG9sR.cjs"),It=require("../polyfills-Df4r-ETT.cjs"),Ct=require("../scroll-DAhSpkhR.cjs"),it=require("../url-D1CgmwZ_.cjs"),Ot=require("../css-value-parser/index.cjs");class Ht 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)}}Mt.isBrowser&&!customElements.get("morph-announcer")&&customElements.define("morph-announcer",Ht);var C,l,z,Z,$;class ht{constructor(t,s){o(this,C);o(this,l);o(this,z);o(this,Z,t=>{var i;if(t.preventDefault(),e(this,l).hasAttribute("data-back")&&e(this,C).previousPathname)history.back();else{const u=e(this,l).getAttribute("data-history-action")||"push",v=e(this,l).hasAttribute("data-center-scroll"),L=getComputedStyle(e(this,l)).getPropertyValue("--offset-scroll").trim(),g=L?Ot.cssValueParser.parse(L):void 0,S=e(this,l).hasAttribute("data-revalidate"),A=e(this,l).hasAttribute("data-keep-search-parameters"),m=(i=e(this,l).getAttribute("data-submorph"))==null?void 0:i.split(",").map(V=>V.trim());e(this,C).navigate(e(this,z),{historyAction:u,centerScroll:v,offsetScroll:g,revalidate:S,keepSearchParameters:A,submorph:m})}});o(this,$,()=>{const t=e(this,l).hasAttribute("data-revalidate");e(this,C).prefetch(e(this,z),t),e(this,l).removeEventListener("pointerenter",e(this,$))});a(this,C,s),a(this,l,t),a(this,z,e(this,l).getAttribute("href")||"/"),e(this,l).addEventListener("click",e(this,Z)),this.checkCurrent(location.pathname),e(this,l).hasAttribute("data-prefetch")&&e(this,l).addEventListener("pointerenter",e(this,$))}get element(){return e(this,l)}checkCurrent(t){const s=e(this,C).normalizePath(t),i=e(this,C).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,Z)),e(this,l).removeEventListener("pointerenter",e(this,$)),e(this,l).classList.remove("current")}}C=new WeakMap,l=new WeakMap,z=new WeakMap,Z=new WeakMap,$=new WeakMap;var x,K,w,I,O,N;class Tt{constructor(t,s,i){o(this,x);o(this,K);o(this,w,{x:0,y:0});o(this,I);o(this,O,null);o(this,N,null);a(this,x,t),a(this,K,s),a(this,I,i.cloneNode(!0))}get pathname(){return e(this,K)}get scrollState(){return e(this,w)}get document(){return e(this,N)}cloneDocument(){a(this,N,(e(this,O)||e(this,I)).cloneNode(!0))}get title(){let t="";if(e(this,N).title)t=e(this,N).title;else{const s=e(this,N).querySelector("h1");t=(s==null?void 0:s.innerText)||(s==null?void 0:s.textContent)||e(this,K)}return t}clearScrollState(){e(this,w).x=0,e(this,w).y=0}clearDocumentState(){a(this,O,null)}saveScrollState(){e(this,I).documentElement.hasAttribute("data-no-scroll-restoration")?(e(this,w).x=0,e(this,w).y=0):(e(this,w).x=e(this,x).scrollElement.scrollLeft,e(this,w).y=e(this,x).scrollElement.scrollTop)}saveDocumentState(){e(this,I).documentElement.hasAttribute("data-no-page-restoration")?a(this,O,null):a(this,O,document.cloneNode(!0))}restoreScrollPosition(){e(this,x).scrollElement.scroll({top:e(this,w).y,left:e(this,w).x,behavior:"instant"})}renewScrollPosition(){e(this,x).scrollElement.scroll({top:0,left:0,behavior:"instant"})}}x=new WeakMap,K=new WeakMap,w=new WeakMap,I=new WeakMap,O=new WeakMap,N=new WeakMap;var T,Y,f,nt,q,p,_,B,M,P,G,F,tt,c,rt,xt,dt,Nt,mt,ft,pt,Et,ot,J;const X=class X{constructor(t){o(this,c);o(this,T,null);o(this,Y,null);o(this,f,[]);o(this,nt,new DOMParser);o(this,q);o(this,p,null);o(this,_);o(this,B,[]);o(this,M,!1);o(this,P,null);o(this,G,new Map);o(this,F,null);o(this,tt,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,ot,t=>R(this,null,function*(){var s;(s=t.state)!=null&&s.path&&(t.preventDefault(),a(this,M,!0),yield this.navigate(t.state.path,{historyAction:"none"}),a(this,M,!1))}));o(this,J,()=>{const t=e(this,P).scrollTop,s=e(this,P).scrollLeft;document.documentElement.classList.toggle("top-scrolled",t>0),document.documentElement.classList.toggle("left-scrolled",s>0),U.dispatchEvent(document,"morphScroll",{detail:{left:s,top:t}})});if(Mt.isBrowser&&!X.instance){X.instance=this,a(this,T,{base:it.normalizeBase(t==null?void 0:t.base),waitForHeadToLoad:(t==null?void 0:t.waitForHeadToLoad)!==!1,cachePages:(t==null?void 0:t.cachePages)!==!1,trailingSlash:(t==null?void 0:t.trailingSlash)||!1,scrollSelector:(t==null?void 0:t.scrollSelector)||"body",morphInsideScrollContainer:(t==null?void 0:t.morphInsideScrollContainer)||!1}),a(this,Y,d(this,c,dt).call(this,document.body));const s=this.normalizePath(location.pathname+location.hash);a(this,p,s.pathname),e(this,G).set(e(this,p),new Tt(this,e(this,p),document)),document.documentElement.setAttribute("data-current-pathname",e(this,p)),document.documentElement.setAttribute("data-current-leaf",s.leaf),this.findLinks(),addEventListener("popstate",e(this,ot)),it.changeHistory({action:"replace",pathname:e(this,p),searchParameters:s.parameters||location.search,hash:s.hash}),a(this,F,new Ht),d(this,c,pt).call(this,document)}}get currentPathname(){return e(this,p)}get previousPathname(){return e(this,_)}get links(){return e(this,f)}get scrollElement(){return e(this,P)}get isPopstateNavigation(){return e(this,M)}normalizePath(t){return it.splitPath(t,{base:e(this,T).base,trailingSlash:e(this,T).trailingSlash})}prefetch(t,s){return R(this,null,function*(){const i=this.normalizePath(t);d(this,c,rt).call(this,i.pathname,{searchParameters:i.parameters,revalidate:s})})}navigate(S){return R(this,arguments,function*(t,{historyAction:s="push",centerScroll:i,offsetScroll:u,revalidate:v,keepSearchParameters:L,submorph:g}={}){var vt;if(e(this,B).length)return;const A=this.normalizePath(((vt=this.pathnameModifier)==null?void 0:vt.call(this,t))||t);let{pathname:m,hash:V,parameters:gt,leaf:qt}=A;if(e(this,q)===m||e(this,p)===m){e(this,M)||d(this,c,Et).call(this,V||0,{centerScroll:i,offsetScroll:u,behavior:"smooth"});return}a(this,q,m),e(this,f).forEach(W=>{W.checkCurrent(m)});try{let W=!0;if(this.preprocessor)try{yield new Promise((r,k)=>{var y;(y=this.preprocessor)==null||y.call(this,{pathname:m,resolve:r,reject:k,submorph:g})})}catch(r){r?console.error(r):console.log("Route change canceled"),W=!1}if(!W||e(this,q)!==m){e(this,f).forEach(r=>{r.checkCurrent(e(this,p))});return}const at={pathname:m,submorph:g};U.dispatchEvent(document,"morphNavigation",{detail:at});const St=yield d(this,c,rt).call(this,e(this,p)),b=yield d(this,c,rt).call(this,m,{searchParameters:gt,revalidate:v});if(e(this,q)!==m){e(this,f).forEach(r=>{r.checkCurrent(e(this,p))});return}St.saveScrollState(),St.saveDocumentState(),e(this,M)||(b.clearScrollState(),b.clearDocumentState()),b.cloneDocument(),e(this,F).textContent=b.title,document.body.appendChild(e(this,F)),U.dispatchEvent(document,"morphStart",{detail:at});const yt=Array.from(document.head.children),wt=Array.from(b.document.head.children),Lt=d(this,c,Nt).call(this,yt,wt),Dt=d(this,c,mt).call(this,yt,Lt),et=d(this,c,mt).call(this,wt,Lt);et.forEach((r,k)=>{if(r.tagName==="SCRIPT"&&r.getAttribute("src")){const y=document.createElement("script");y.type="module",y.src=r.getAttribute("src"),et[k]=y}}),et.forEach(r=>{document.head.appendChild(r)});const lt=et.filter(r=>{if(r.hasAttribute("data-no-waiting"))return!1;if(d(this,c,ft).call(this,r))return!0});e(this,T).waitForHeadToLoad&&lt.length&&(yield new Promise(r=>R(this,null,function*(){let k=0;try{for(var y=kt(lt),Q,D,j;Q=!(D=yield y.next()).done;Q=!1){const st=D.value;st.onload=()=>{k++,k===lt.length&&r()}}}catch(D){j=[D]}finally{try{Q&&(D=y.return)&&(yield D.call(y))}finally{if(j)throw j[0]}}}))),yield Ct.wait(10);const bt=[];Dt.forEach(r=>{r.hasAttribute("data-permanent")||(d(this,c,ft).call(this,r)?bt.push(r):r.remove())});const Rt=d(this,c,dt).call(this,b.document.body);e(this,T).morphInsideScrollContainer||d(this,c,pt).call(this,b.document),document.documentElement.setAttribute("data-current-pathname",m),document.documentElement.setAttribute("data-current-leaf",qt),it.changeHistory({action:s,pathname:m,searchParameters:gt||(L?location.search:""),hash:V}),e(this,F).remove(),a(this,_,e(this,p)),a(this,p,m),e(this,Y).forEach((r,k)=>{const y=Rt[k],Q=getComputedStyle(r).getPropertyValue("--morph-duration");let D=[],j=[];g?g.forEach(h=>{const E=r.querySelector(h),H=y.querySelector(h);E&&H&&(j.push(E),D.push(H))}):(D.push(...y.childNodes),j.push(...r.childNodes)),j.forEach(h=>{h instanceof HTMLElement&&(this.destroyOldLinks(h),h.classList.add("old"))}),D.forEach(h=>{h instanceof HTMLElement&&(this.findNewLinks(h),h.classList.add("new"))}),g?D.forEach((h,E)=>{var H;(H=j[E].parentElement)==null||H.insertBefore(h,j[E])}):r.prepend(...D),It.requestIdleCallback(()=>{D.forEach(h=>{var E;h instanceof HTMLElement&&((E=h.parentElement)==null||E.style.setProperty("--new-content-height",h.offsetHeight+"px"),h.classList.add("in"))})});const st={morphElement:r,pathname:m};U.dispatchEvent(document,"morphNewChildrenAdded",{detail:st});const zt=new Promise(h=>{setTimeout(()=>{j.forEach(E=>E.remove()),D.forEach(E=>{var H;E instanceof HTMLElement&&((H=E.parentElement)==null||H.style.removeProperty("--new-content-height"),E.classList.remove("in","new"))}),U.dispatchEvent(document,"morphOldChildrenRemoved",{detail:st}),h()},(parseFloat(Q)||0)*1e3+10)});e(this,B).push(zt)}),V?(b.clearScrollState(),d(this,c,Et).call(this,V,{centerScroll:i,offsetScroll:u})):e(this,M)?b.restoreScrollPosition():b.renewScrollPosition(),yield Promise.all(e(this,B)),bt.forEach(r=>r.remove()),a(this,B,[]),e(this,Y).forEach(r=>{r.querySelectorAll("script").forEach(y=>{const Q=document.createElement("script");Q.type="module",Q.src=y.getAttribute("src"),y.replaceWith(Q)})}),U.dispatchEvent(document,"morphComplete",{detail:at}),window.dispatchEvent(new Event("resize"))}catch(W){console.error(W)}a(this,q,void 0)})}addLink(t){e(this,f).push(new ht(t,this))}addLinks(t){t.forEach(s=>{this.addLink(s)})}removeLink(t){a(this,f,e(this,f).filter(s=>s.element===t?(s.destroy(),!1):!0))}destroyOldLinks(t){a(this,f,e(this,f).filter(s=>t.contains(s.element)?(s.destroy(),!1):!0))}findNewLinks(t){const s=[...t.querySelectorAll("a")].filter(e(this,tt));e(this,f).push(...s.map(i=>new ht(i,this)))}findLinks(){const t=[...document.documentElement.querySelectorAll("a")].filter(e(this,tt));e(this,f).forEach(s=>s.destroy()),a(this,f,t.map(s=>new ht(s,this)))}};T=new WeakMap,Y=new WeakMap,f=new WeakMap,nt=new WeakMap,q=new WeakMap,p=new WeakMap,_=new WeakMap,B=new WeakMap,M=new WeakMap,P=new WeakMap,G=new WeakMap,F=new WeakMap,tt=new WeakMap,c=new WeakSet,rt=function(t,s){return R(this,null,function*(){let i=e(this,G).get(t);return(!i||s!=null&&s.revalidate)&&(i=yield d(this,c,xt).call(this,t,s==null?void 0:s.searchParameters)),i})},xt=function(t,s){return R(this,null,function*(){const u=yield(yield fetch(`${t}${s?"?"+s:""}`)).text(),v=e(this,nt).parseFromString(u,"text/html"),L=new Tt(this,t,v);return e(this,G).set(t,L),L})},dt=function(t){const s=[...t.querySelectorAll("[data-morph]")];return s.length?s:[t]},Nt=function(t,s){return t.filter(i=>s.find(u=>u.outerHTML===i.outerHTML))},mt=function(t,s){return t.filter(i=>!s.find(u=>u.outerHTML===i.outerHTML))},ft=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,P))==null||s.removeEventListener("scroll",e(this,J)),a(this,P,t.querySelector(e(this,T).scrollSelector)||t.documentElement),(i=e(this,P))==null||i.addEventListener("scroll",e(this,J)),e(this,J).call(this)},Et=function(t,s){const i=typeof t=="string"?document.getElementById(t):t;(typeof i=="number"||i)&&Ct.scrollToElement(i,{scrollElement:e(this,P),behavior:(s==null?void 0:s.behavior)||"instant",center:s==null?void 0:s.centerScroll,offset:s==null?void 0:s.offsetScroll})},ot=new WeakMap,J=new WeakMap,X.instance=null;let ut=X;exports.Morph=ut;
1
+ "use strict";var kt=(n,t)=>(t=Symbol[n])?t:Symbol.for("Symbol."+n),Ct=n=>{throw TypeError(n)};var dt=(n,t,s)=>t.has(n)||Ct("Cannot "+s);var e=(n,t,s)=>(dt(n,t,"read from private field"),s?s.call(n):t.get(n)),a=(n,t,s)=>t.has(n)?Ct("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(n):t.set(n,s),o=(n,t,s,i)=>(dt(n,t,"write to private field"),i?i.call(n,s):t.set(n,s),s),m=(n,t,s)=>(dt(n,t,"access private method"),s);var z=(n,t,s)=>new Promise((i,d)=>{var v=E=>{try{S(s.next(E))}catch(D){d(D)}},b=E=>{try{S(s.throw(E))}catch(D){d(D)}},S=E=>E.done?i(E.value):Promise.resolve(E.value).then(v,b);S((s=s.apply(n,t)).next())});var Tt=(n,t,s)=>(t=n[kt("asyncIterator")])?t.call(n):(n=n[kt("iterator")](),t={},s=(i,d)=>(d=n[i])&&(t[i]=v=>new Promise((b,S,E)=>(v=d.call(n,v),E=v.done,Promise.resolve(v.value).then(D=>b({value:D,done:E}),S)))),s("next"),s("return"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const xt=require("../index-Cqw2NKev.cjs"),$=require("../events-KVanG9sR.cjs"),Bt=require("../polyfills-Df4r-ETT.cjs"),Mt=require("../scroll-DAhSpkhR.cjs"),rt=require("../url-lnBE_6yf.cjs"),Ft=require("../css-value-parser/index.cjs");class Nt 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)}}xt.isBrowser&&!customElements.get("morph-announcer")&&customElements.define("morph-announcer",Nt);var k,l,I,_,K;class mt{constructor(t,s){a(this,k);a(this,l);a(this,I);a(this,_,t=>{var i;if(t.preventDefault(),e(this,l).hasAttribute("data-back")&&e(this,k).previousPathname)history.back();else{const d=e(this,l).getAttribute("data-history-action")||"push",v=e(this,l).hasAttribute("data-center-scroll"),b=getComputedStyle(e(this,l)).getPropertyValue("--offset-scroll").trim(),S=b?Ft.cssValueParser.parse(b):void 0,E=e(this,l).hasAttribute("data-revalidate"),D=e(this,l).hasAttribute("data-keep-search-parameters"),lt=(i=e(this,l).getAttribute("data-submorph"))==null?void 0:i.split(",").map(W=>W.trim()),f=e(this,l).hasAttribute("data-clear-state");e(this,k).navigate(e(this,I),{historyAction:d,centerScroll:v,offsetScroll:S,revalidate:E,keepSearchParameters:D,submorph:lt,clearState:f})}});a(this,K,()=>{const t=e(this,l).hasAttribute("data-revalidate");e(this,k).prefetch(e(this,I),t),e(this,l).removeEventListener("pointerenter",e(this,K))});o(this,k,s),o(this,l,t),o(this,I,e(this,l).getAttribute("href")||"/"),e(this,l).addEventListener("click",e(this,_)),this.checkCurrent(location.pathname),e(this,l).hasAttribute("data-prefetch")&&e(this,l).addEventListener("pointerenter",e(this,K))}get element(){return e(this,l)}checkCurrent(t){const s=e(this,k).normalizePath(t),i=e(this,k).normalizePath(e(this,I));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,_)),e(this,l).removeEventListener("pointerenter",e(this,K)),e(this,l).classList.remove("current")}}k=new WeakMap,l=new WeakMap,I=new WeakMap,_=new WeakMap,K=new WeakMap;var H,Y,w,O,B,x,G;class Ht{constructor(t,s,i){a(this,H);a(this,Y);a(this,w,{x:0,y:0});a(this,O);a(this,B,null);a(this,x,null);a(this,G,null);o(this,H,t),o(this,Y,s),o(this,O,i.cloneNode(!0))}get pathname(){return e(this,Y)}get scrollState(){return e(this,w)}get document(){return e(this,x)}cloneDocument(){o(this,x,(e(this,B)||e(this,O)).cloneNode(!0))}get title(){let t="";if(e(this,x).title)t=e(this,x).title;else{const s=e(this,x).querySelector("h1");t=(s==null?void 0:s.innerText)||(s==null?void 0:s.textContent)||e(this,Y)}return t}clearScrollState(){e(this,w).x=0,e(this,w).y=0}clearDocumentState(){o(this,B,null)}saveScrollState(){e(this,O).documentElement.hasAttribute("data-no-scroll-restoration")?(e(this,w).x=0,e(this,w).y=0):(e(this,w).x=e(this,H).scrollElement.scrollLeft,e(this,w).y=e(this,H).scrollElement.scrollTop)}restoreScrollPosition(){e(this,H).scrollElement.scroll({top:e(this,w).y,left:e(this,w).x,behavior:"instant"})}saveDocumentState(){e(this,O).documentElement.hasAttribute("data-no-page-restoration")?o(this,B,null):o(this,B,document.cloneNode(!0))}renewScrollPosition(){e(this,H).scrollElement.scroll({top:0,left:0,behavior:"instant"})}saveState(t){o(this,G,t)}clearState(){const t=e(this,G);return o(this,G,null),t}}H=new WeakMap,Y=new WeakMap,w=new WeakMap,O=new WeakMap,B=new WeakMap,x=new WeakMap,G=new WeakMap;var C,J,p,at,N,u,tt,F,T,P,q,V,et,c,nt,qt,pt,Dt,Et,gt,St,vt,ot,Q;const Z=class Z{constructor(t){a(this,c);a(this,C,null);a(this,J,null);a(this,p,[]);a(this,at,new DOMParser);a(this,N);a(this,u,null);a(this,tt);a(this,F,[]);a(this,T,!1);a(this,P,null);a(this,q,new Map);a(this,V,null);a(this,et,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,ot,t=>z(this,null,function*(){var s;(s=t.state)!=null&&s.path&&(t.preventDefault(),o(this,T,!0),yield this.navigate(t.state.path,{historyAction:"none"}),o(this,T,!1))}));a(this,Q,()=>{const t=e(this,P).scrollTop,s=e(this,P).scrollLeft;document.documentElement.classList.toggle("top-scrolled",t>0),document.documentElement.classList.toggle("left-scrolled",s>0),$.dispatchEvent(document,"morphScroll",{detail:{left:s,top:t}})});if(xt.isBrowser&&!Z.instance){Z.instance=this,o(this,C,{base:rt.normalizeBase(t==null?void 0:t.base),waitForHeadToLoad:(t==null?void 0:t.waitForHeadToLoad)!==!1,cachePages:(t==null?void 0:t.cachePages)!==!1,trailingSlash:(t==null?void 0:t.trailingSlash)||!1,scrollSelector:(t==null?void 0:t.scrollSelector)||"body",morphInsideScrollContainer:(t==null?void 0:t.morphInsideScrollContainer)||!1}),o(this,J,m(this,c,pt).call(this,document.body));const s=this.normalizePath(location.pathname+location.hash);o(this,u,s.pathname),e(this,q).set(e(this,u),new Ht(this,e(this,u),document)),document.documentElement.setAttribute("data-current-pathname",e(this,u)),document.documentElement.setAttribute("data-current-leaf",s.leaf),this.findLinks(),addEventListener("popstate",e(this,ot)),rt.changeHistory({action:"replace",pathname:e(this,u),searchParameters:s.parameters||location.search,hash:s.hash}),o(this,V,new Nt),m(this,c,St).call(this,document)}}get currentPathname(){return e(this,u)}get previousPathname(){return e(this,tt)}get links(){return e(this,p)}get scrollElement(){return e(this,P)}get isPopstateNavigation(){return e(this,T)}saveState(t){const s=e(this,q).get(e(this,u));s&&s.saveState(t)}getState(){const t=e(this,q).get(e(this,u));return t==null?void 0:t.clearState()}normalizePath(t){return rt.splitPath(t,{base:e(this,C).base,trailingSlash:e(this,C).trailingSlash})}prefetch(t,s){return z(this,null,function*(){const i=this.normalizePath(t);m(this,c,nt).call(this,i.pathname,{searchParameters:i.parameters,revalidate:s})})}navigate(D){return z(this,arguments,function*(t,{historyAction:s="push",centerScroll:i,offsetScroll:d,revalidate:v,keepSearchParameters:b,submorph:S,clearState:E}={}){var wt;if(e(this,F).length)return;const lt=this.normalizePath(((wt=this.pathnameModifier)==null?void 0:wt.call(this,t))||t);let{pathname:f,hash:W,parameters:yt,leaf:Rt}=lt;if(e(this,N)===f||e(this,u)===f){e(this,T)||m(this,c,vt).call(this,W||0,{centerScroll:i,offsetScroll:d,behavior:"smooth"});return}o(this,N,f),e(this,p).forEach(j=>{j.checkCurrent(f)});try{let j=!0;if(this.preprocessor)try{yield new Promise((r,A)=>{var y;(y=this.preprocessor)==null||y.call(this,{pathname:f,resolve:r,reject:A,submorph:S})})}catch(r){r?console.error(r):console.log("Route change canceled"),j=!1}if(!j||e(this,N)!==f){e(this,p).forEach(r=>{r.checkCurrent(e(this,u))});return}const ct={pathname:f,submorph:S};$.dispatchEvent(document,"morphNavigation",{detail:ct});const ht=yield m(this,c,nt).call(this,e(this,u)),L=yield m(this,c,nt).call(this,f,{searchParameters:yt,revalidate:v});if(e(this,N)!==f){e(this,p).forEach(r=>{r.checkCurrent(e(this,u))});return}ht.clearState(),ht.saveScrollState(),ht.saveDocumentState(),e(this,T)||(L.clearScrollState(),L.clearDocumentState()),E&&L.clearState(),L.cloneDocument(),e(this,V).textContent=L.title,document.body.appendChild(e(this,V)),$.dispatchEvent(document,"morphStart",{detail:ct});const bt=Array.from(document.head.children),Lt=Array.from(L.document.head.children),Pt=m(this,c,Dt).call(this,bt,Lt),zt=m(this,c,Et).call(this,bt,Pt),st=m(this,c,Et).call(this,Lt,Pt);st.forEach((r,A)=>{if(r.tagName==="SCRIPT"&&r.getAttribute("src")){const y=document.createElement("script");y.type="module",y.src=r.getAttribute("src"),st[A]=y}}),st.forEach(r=>{document.head.appendChild(r)});const ut=st.filter(r=>{if(r.hasAttribute("data-no-waiting"))return!1;if(m(this,c,gt).call(this,r))return!0});e(this,C).waitForHeadToLoad&&ut.length&&(yield new Promise(r=>z(this,null,function*(){let A=0;try{for(var y=Tt(ut),X,R,U;X=!(R=yield y.next()).done;X=!1){const it=R.value;it.onload=()=>{A++,A===ut.length&&r()}}}catch(R){U=[R]}finally{try{X&&(R=y.return)&&(yield R.call(y))}finally{if(U)throw U[0]}}}))),yield Mt.wait(10);const At=[];zt.forEach(r=>{r.hasAttribute("data-permanent")||(m(this,c,gt).call(this,r)?At.push(r):r.remove())});const It=m(this,c,pt).call(this,L.document.body);e(this,C).morphInsideScrollContainer||m(this,c,St).call(this,L.document),document.documentElement.setAttribute("data-current-pathname",f),document.documentElement.setAttribute("data-current-leaf",Rt),rt.changeHistory({action:s,pathname:f,searchParameters:yt||(b?location.search:""),hash:W}),e(this,V).remove(),o(this,tt,e(this,u)),o(this,u,f),e(this,J).forEach((r,A)=>{const y=It[A],X=getComputedStyle(r).getPropertyValue("--morph-duration");let R=[],U=[];S?S.forEach(h=>{const g=r.querySelector(h),M=y.querySelector(h);g&&M&&(U.push(g),R.push(M))}):(R.push(...y.childNodes),U.push(...r.childNodes)),U.forEach(h=>{h instanceof HTMLElement&&(this.destroyOldLinks(h),h.classList.add("old"))}),R.forEach(h=>{h instanceof HTMLElement&&(this.findNewLinks(h),h.classList.add("new"))}),S?R.forEach((h,g)=>{var M;(M=U[g].parentElement)==null||M.insertBefore(h,U[g])}):r.prepend(...R),Bt.requestIdleCallback(()=>{R.forEach(h=>{var g;h instanceof HTMLElement&&((g=h.parentElement)==null||g.style.setProperty("--new-content-height",h.offsetHeight+"px"),h.classList.add("in"))})});const it={morphElement:r,pathname:f};$.dispatchEvent(document,"morphNewChildrenAdded",{detail:it});const Ot=new Promise(h=>{setTimeout(()=>{U.forEach(g=>g.remove()),R.forEach(g=>{var M;g instanceof HTMLElement&&((M=g.parentElement)==null||M.style.removeProperty("--new-content-height"),g.classList.remove("in","new"))}),$.dispatchEvent(document,"morphOldChildrenRemoved",{detail:it}),h()},(parseFloat(X)||0)*1e3+10)});e(this,F).push(Ot)}),W?(L.clearScrollState(),m(this,c,vt).call(this,W,{centerScroll:i,offsetScroll:d})):e(this,T)?L.restoreScrollPosition():L.renewScrollPosition(),yield Promise.all(e(this,F)),At.forEach(r=>r.remove()),o(this,F,[]),e(this,J).forEach(r=>{r.querySelectorAll("script").forEach(y=>{const X=document.createElement("script");X.type="module",X.src=y.getAttribute("src"),y.replaceWith(X)})}),$.dispatchEvent(document,"morphComplete",{detail:ct}),window.dispatchEvent(new Event("resize"))}catch(j){console.error(j)}o(this,N,void 0)})}addLink(t){e(this,p).push(new mt(t,this))}addLinks(t){t.forEach(s=>{this.addLink(s)})}removeLink(t){o(this,p,e(this,p).filter(s=>s.element===t?(s.destroy(),!1):!0))}destroyOldLinks(t){o(this,p,e(this,p).filter(s=>t.contains(s.element)?(s.destroy(),!1):!0))}findNewLinks(t){const s=[...t.querySelectorAll("a")].filter(e(this,et));e(this,p).push(...s.map(i=>new mt(i,this)))}findLinks(){const t=[...document.documentElement.querySelectorAll("a")].filter(e(this,et));e(this,p).forEach(s=>s.destroy()),o(this,p,t.map(s=>new mt(s,this)))}};C=new WeakMap,J=new WeakMap,p=new WeakMap,at=new WeakMap,N=new WeakMap,u=new WeakMap,tt=new WeakMap,F=new WeakMap,T=new WeakMap,P=new WeakMap,q=new WeakMap,V=new WeakMap,et=new WeakMap,c=new WeakSet,nt=function(t,s){return z(this,null,function*(){let i=e(this,q).get(t);return(!i||s!=null&&s.revalidate)&&(i=yield m(this,c,qt).call(this,t,s==null?void 0:s.searchParameters)),i})},qt=function(t,s){return z(this,null,function*(){const d=yield(yield fetch(`${t}${s?"?"+s:""}`)).text(),v=e(this,at).parseFromString(d,"text/html"),b=new Ht(this,t,v);return e(this,q).set(t,b),b})},pt=function(t){const s=[...t.querySelectorAll("[data-morph]")];return s.length?s:[t]},Dt=function(t,s){return t.filter(i=>s.find(d=>d.outerHTML===i.outerHTML))},Et=function(t,s){return t.filter(i=>!s.find(d=>d.outerHTML===i.outerHTML))},gt=function(t){return t.tagName==="SCRIPT"||t.tagName==="STYLE"||t.tagName==="LINK"&&t.getAttribute("rel")==="stylesheet"},St=function(t){var s,i;(s=e(this,P))==null||s.removeEventListener("scroll",e(this,Q)),o(this,P,t.querySelector(e(this,C).scrollSelector)||t.documentElement),(i=e(this,P))==null||i.addEventListener("scroll",e(this,Q)),e(this,Q).call(this)},vt=function(t,s){const i=typeof t=="string"?document.getElementById(t):t;(typeof i=="number"||i)&&Mt.scrollToElement(i,{scrollElement:e(this,P),behavior:(s==null?void 0:s.behavior)||"instant",center:s==null?void 0:s.centerScroll,offset:s==null?void 0:s.offsetScroll})},ot=new WeakMap,Q=new WeakMap,Z.instance=null;let ft=Z;exports.Morph=ft;
@@ -1,32 +1,32 @@
1
- var Lt = (n, t) => (t = Symbol[n]) ? t : Symbol.for("Symbol." + n), bt = (n) => {
1
+ var Pt = (n, t) => (t = Symbol[n]) ? t : Symbol.for("Symbol." + n), At = (n) => {
2
2
  throw TypeError(n);
3
3
  };
4
- var lt = (n, t, s) => t.has(n) || bt("Cannot " + s);
5
- var e = (n, t, s) => (lt(n, t, "read from private field"), s ? s.call(n) : t.get(n)), a = (n, t, s) => t.has(n) ? bt("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(n) : t.set(n, s), o = (n, t, s, i) => (lt(n, t, "write to private field"), i ? i.call(n, s) : t.set(n, s), s), d = (n, t, s) => (lt(n, t, "access private method"), s);
6
- var q = (n, t, s) => new Promise((i, u) => {
7
- var v = (S) => {
4
+ var ut = (n, t, s) => t.has(n) || At("Cannot " + s);
5
+ var e = (n, t, s) => (ut(n, t, "read from private field"), s ? s.call(n) : t.get(n)), a = (n, t, s) => t.has(n) ? At("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(n) : t.set(n, s), o = (n, t, s, i) => (ut(n, t, "write to private field"), i ? i.call(n, s) : t.set(n, s), s), m = (n, t, s) => (ut(n, t, "access private method"), s);
6
+ var z = (n, t, s) => new Promise((i, d) => {
7
+ var v = (E) => {
8
8
  try {
9
- g(s.next(S));
10
- } catch (A) {
11
- u(A);
9
+ S(s.next(E));
10
+ } catch (R) {
11
+ d(R);
12
12
  }
13
- }, L = (S) => {
13
+ }, L = (E) => {
14
14
  try {
15
- g(s.throw(S));
16
- } catch (A) {
17
- u(A);
15
+ S(s.throw(E));
16
+ } catch (R) {
17
+ d(R);
18
18
  }
19
- }, g = (S) => S.done ? i(S.value) : Promise.resolve(S.value).then(v, L);
20
- g((s = s.apply(n, t)).next());
19
+ }, S = (E) => E.done ? i(E.value) : Promise.resolve(E.value).then(v, L);
20
+ S((s = s.apply(n, t)).next());
21
21
  });
22
- var Pt = (n, t, s) => (t = n[Lt("asyncIterator")]) ? t.call(n) : (n = n[Lt("iterator")](), t = {}, s = (i, u) => (u = n[i]) && (t[i] = (v) => new Promise((L, g, S) => (v = u.call(n, v), S = v.done, Promise.resolve(v.value).then((A) => L({ value: A, done: S }), g)))), s("next"), s("return"), t);
23
- import { i as Tt } from "../index-euf5anj6.js";
24
- import { d as $ } from "../events-CsVF98U6.js";
25
- import { r as zt } from "../polyfills-DJrTJQky.js";
26
- import { w as It, s as Ft } from "../scroll-Benkuq-t.js";
27
- import { n as Ot, c as At, s as Bt } from "../url-B6BNcw6_.js";
28
- import { cssValueParser as Vt } from "../css-value-parser/index.js";
29
- class Mt extends HTMLElement {
22
+ var kt = (n, t, s) => (t = n[Pt("asyncIterator")]) ? t.call(n) : (n = n[Pt("iterator")](), t = {}, s = (i, d) => (d = n[i]) && (t[i] = (v) => new Promise((L, S, E) => (v = d.call(n, v), E = v.done, Promise.resolve(v.value).then((R) => L({ value: R, done: E }), S)))), s("next"), s("return"), t);
23
+ import { i as Ht } from "../index-euf5anj6.js";
24
+ import { d as j } from "../events-CsVF98U6.js";
25
+ import { r as Ft } from "../polyfills-DJrTJQky.js";
26
+ import { w as Ot, s as Bt } from "../scroll-Benkuq-t.js";
27
+ import { n as Vt, c as Ct, s as Wt } from "../url-Cc-RVfii.js";
28
+ import { cssValueParser as Ut } from "../css-value-parser/index.js";
29
+ class Nt extends HTMLElement {
30
30
  connectedCallback() {
31
31
  const t = {
32
32
  "aria-live": "assertive",
@@ -37,81 +37,83 @@ class Mt extends HTMLElement {
37
37
  this.setAttribute(s, i);
38
38
  }
39
39
  }
40
- Tt && !customElements.get("morph-announcer") && customElements.define("morph-announcer", Mt);
41
- var C, l, z, Z, j;
42
- class ht {
40
+ Ht && !customElements.get("morph-announcer") && customElements.define("morph-announcer", Nt);
41
+ var k, l, I, _, K;
42
+ class dt {
43
43
  constructor(t, s) {
44
- a(this, C);
44
+ a(this, k);
45
45
  a(this, l);
46
- a(this, z);
47
- a(this, Z, (t) => {
46
+ a(this, I);
47
+ a(this, _, (t) => {
48
48
  var i;
49
- if (t.preventDefault(), e(this, l).hasAttribute("data-back") && e(this, C).previousPathname)
49
+ if (t.preventDefault(), e(this, l).hasAttribute("data-back") && e(this, k).previousPathname)
50
50
  history.back();
51
51
  else {
52
- const u = e(this, l).getAttribute(
52
+ const d = e(this, l).getAttribute(
53
53
  "data-history-action"
54
- ) || "push", v = e(this, l).hasAttribute("data-center-scroll"), L = getComputedStyle(e(this, l)).getPropertyValue("--offset-scroll").trim(), g = L ? Vt.parse(L) : void 0, S = e(this, l).hasAttribute("data-revalidate"), A = e(this, l).hasAttribute(
54
+ ) || "push", v = e(this, l).hasAttribute("data-center-scroll"), L = getComputedStyle(e(this, l)).getPropertyValue("--offset-scroll").trim(), S = L ? Ut.parse(L) : void 0, E = e(this, l).hasAttribute("data-revalidate"), R = e(this, l).hasAttribute(
55
55
  "data-keep-search-parameters"
56
- ), m = (i = e(this, l).getAttribute("data-submorph")) == null ? void 0 : i.split(",").map((V) => V.trim());
57
- e(this, C).navigate(e(this, z), {
58
- historyAction: u,
56
+ ), ot = (i = e(this, l).getAttribute("data-submorph")) == null ? void 0 : i.split(",").map((W) => W.trim()), f = e(this, l).hasAttribute("data-clear-state");
57
+ e(this, k).navigate(e(this, I), {
58
+ historyAction: d,
59
59
  centerScroll: v,
60
- offsetScroll: g,
61
- revalidate: S,
62
- keepSearchParameters: A,
63
- submorph: m
60
+ offsetScroll: S,
61
+ revalidate: E,
62
+ keepSearchParameters: R,
63
+ submorph: ot,
64
+ clearState: f
64
65
  });
65
66
  }
66
67
  });
67
- a(this, j, () => {
68
+ a(this, K, () => {
68
69
  const t = e(this, l).hasAttribute("data-revalidate");
69
- e(this, C).prefetch(e(this, z), t), e(this, l).removeEventListener("pointerenter", e(this, j));
70
+ e(this, k).prefetch(e(this, I), t), e(this, l).removeEventListener("pointerenter", e(this, K));
70
71
  });
71
- o(this, C, s), o(this, l, t), o(this, z, e(this, l).getAttribute("href") || "/"), e(this, l).addEventListener("click", e(this, Z)), this.checkCurrent(location.pathname), e(this, l).hasAttribute("data-prefetch") && e(this, l).addEventListener("pointerenter", e(this, j));
72
+ o(this, k, s), o(this, l, t), o(this, I, e(this, l).getAttribute("href") || "/"), e(this, l).addEventListener("click", e(this, _)), this.checkCurrent(location.pathname), e(this, l).hasAttribute("data-prefetch") && e(this, l).addEventListener("pointerenter", e(this, K));
72
73
  }
73
74
  get element() {
74
75
  return e(this, l);
75
76
  }
76
77
  checkCurrent(t) {
77
- const s = e(this, C).normalizePath(t), i = e(this, C).normalizePath(e(this, z));
78
+ const s = e(this, k).normalizePath(t), i = e(this, k).normalizePath(e(this, I));
78
79
  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");
79
80
  }
80
81
  destroy() {
81
- e(this, l).removeEventListener("click", e(this, Z)), e(this, l).removeEventListener("pointerenter", e(this, j)), e(this, l).classList.remove("current");
82
+ e(this, l).removeEventListener("click", e(this, _)), e(this, l).removeEventListener("pointerenter", e(this, K)), e(this, l).classList.remove("current");
82
83
  }
83
84
  }
84
- C = new WeakMap(), l = new WeakMap(), z = new WeakMap(), Z = new WeakMap(), j = new WeakMap();
85
- var N, K, w, I, F, x;
86
- class kt {
85
+ k = new WeakMap(), l = new WeakMap(), I = new WeakMap(), _ = new WeakMap(), K = new WeakMap();
86
+ var H, Y, w, F, O, N, G;
87
+ class Tt {
87
88
  constructor(t, s, i) {
88
- a(this, N);
89
- a(this, K);
89
+ a(this, H);
90
+ a(this, Y);
90
91
  a(this, w, { x: 0, y: 0 });
91
- a(this, I);
92
- a(this, F, null);
93
- a(this, x, null);
94
- o(this, N, t), o(this, K, s), o(this, I, i.cloneNode(!0));
92
+ a(this, F);
93
+ a(this, O, null);
94
+ a(this, N, null);
95
+ a(this, G, null);
96
+ o(this, H, t), o(this, Y, s), o(this, F, i.cloneNode(!0));
95
97
  }
96
98
  get pathname() {
97
- return e(this, K);
99
+ return e(this, Y);
98
100
  }
99
101
  get scrollState() {
100
102
  return e(this, w);
101
103
  }
102
104
  get document() {
103
- return e(this, x);
105
+ return e(this, N);
104
106
  }
105
107
  cloneDocument() {
106
- o(this, x, (e(this, F) || e(this, I)).cloneNode(!0));
108
+ o(this, N, (e(this, O) || e(this, F)).cloneNode(!0));
107
109
  }
108
110
  get title() {
109
111
  let t = "";
110
- if (e(this, x).title)
111
- t = e(this, x).title;
112
+ if (e(this, N).title)
113
+ t = e(this, N).title;
112
114
  else {
113
- const s = e(this, x).querySelector("h1");
114
- t = (s == null ? void 0 : s.innerText) || (s == null ? void 0 : s.textContent) || e(this, K);
115
+ const s = e(this, N).querySelector("h1");
116
+ t = (s == null ? void 0 : s.innerText) || (s == null ? void 0 : s.textContent) || e(this, Y);
115
117
  }
116
118
  return t;
117
119
  }
@@ -119,299 +121,315 @@ class kt {
119
121
  e(this, w).x = 0, e(this, w).y = 0;
120
122
  }
121
123
  clearDocumentState() {
122
- o(this, F, null);
124
+ o(this, O, null);
123
125
  }
124
126
  saveScrollState() {
125
- e(this, I).documentElement.hasAttribute(
127
+ e(this, F).documentElement.hasAttribute(
126
128
  "data-no-scroll-restoration"
127
- ) ? (e(this, w).x = 0, e(this, w).y = 0) : (e(this, w).x = e(this, N).scrollElement.scrollLeft, e(this, w).y = e(this, N).scrollElement.scrollTop);
128
- }
129
- saveDocumentState() {
130
- e(this, I).documentElement.hasAttribute(
131
- "data-no-page-restoration"
132
- ) ? o(this, F, null) : o(this, F, document.cloneNode(!0));
129
+ ) ? (e(this, w).x = 0, e(this, w).y = 0) : (e(this, w).x = e(this, H).scrollElement.scrollLeft, e(this, w).y = e(this, H).scrollElement.scrollTop);
133
130
  }
134
131
  restoreScrollPosition() {
135
- e(this, N).scrollElement.scroll({
132
+ e(this, H).scrollElement.scroll({
136
133
  top: e(this, w).y,
137
134
  left: e(this, w).x,
138
135
  behavior: "instant"
139
136
  });
140
137
  }
138
+ saveDocumentState() {
139
+ e(this, F).documentElement.hasAttribute(
140
+ "data-no-page-restoration"
141
+ ) ? o(this, O, null) : o(this, O, document.cloneNode(!0));
142
+ }
141
143
  renewScrollPosition() {
142
- e(this, N).scrollElement.scroll({
144
+ e(this, H).scrollElement.scroll({
143
145
  top: 0,
144
146
  left: 0,
145
147
  behavior: "instant"
146
148
  });
147
149
  }
150
+ saveState(t) {
151
+ o(this, G, t);
152
+ }
153
+ clearState() {
154
+ const t = e(this, G);
155
+ return o(this, G, null), t;
156
+ }
148
157
  }
149
- N = new WeakMap(), K = new WeakMap(), w = new WeakMap(), I = new WeakMap(), F = new WeakMap(), x = new WeakMap();
150
- var T, Y, f, rt, D, p, _, O, M, P, G, B, tt, h, it, Ht, ct, Nt, ut, dt, mt, ft, nt, J;
151
- const X = class X {
158
+ H = new WeakMap(), Y = new WeakMap(), w = new WeakMap(), F = new WeakMap(), O = new WeakMap(), N = new WeakMap(), G = new WeakMap();
159
+ var C, J, p, nt, x, u, tt, B, T, P, D, V, et, h, rt, xt, mt, Dt, ft, pt, Et, gt, at, Q;
160
+ const Z = class Z {
152
161
  constructor(t) {
153
162
  a(this, h);
154
- a(this, T, null);
155
- a(this, Y, null);
156
- a(this, f, []);
157
- a(this, rt, new DOMParser());
158
- a(this, D);
159
- a(this, p, null);
160
- a(this, _);
161
- a(this, O, []);
162
- a(this, M, !1);
163
+ a(this, C, null);
164
+ a(this, J, null);
165
+ a(this, p, []);
166
+ a(this, nt, new DOMParser());
167
+ a(this, x);
168
+ a(this, u, null);
169
+ a(this, tt);
170
+ a(this, B, []);
171
+ a(this, T, !1);
163
172
  a(this, P, null);
164
- a(this, G, /* @__PURE__ */ new Map());
165
- a(this, B, null);
166
- a(this, tt, (t) => {
173
+ a(this, D, /* @__PURE__ */ new Map());
174
+ a(this, V, null);
175
+ a(this, et, (t) => {
167
176
  var s;
168
177
  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";
169
178
  });
170
- a(this, nt, (t) => q(this, null, function* () {
179
+ a(this, at, (t) => z(this, null, function* () {
171
180
  var s;
172
- (s = t.state) != null && s.path && (t.preventDefault(), o(this, M, !0), yield this.navigate(t.state.path, { historyAction: "none" }), o(this, M, !1));
181
+ (s = t.state) != null && s.path && (t.preventDefault(), o(this, T, !0), yield this.navigate(t.state.path, { historyAction: "none" }), o(this, T, !1));
173
182
  }));
174
- a(this, J, () => {
183
+ a(this, Q, () => {
175
184
  const t = e(this, P).scrollTop, s = e(this, P).scrollLeft;
176
- document.documentElement.classList.toggle("top-scrolled", t > 0), document.documentElement.classList.toggle("left-scrolled", s > 0), $(document, "morphScroll", {
185
+ document.documentElement.classList.toggle("top-scrolled", t > 0), document.documentElement.classList.toggle("left-scrolled", s > 0), j(document, "morphScroll", {
177
186
  detail: {
178
187
  left: s,
179
188
  top: t
180
189
  }
181
190
  });
182
191
  });
183
- if (Tt && !X.instance) {
184
- X.instance = this, o(this, T, {
185
- base: Ot(t == null ? void 0 : t.base),
192
+ if (Ht && !Z.instance) {
193
+ Z.instance = this, o(this, C, {
194
+ base: Vt(t == null ? void 0 : t.base),
186
195
  waitForHeadToLoad: (t == null ? void 0 : t.waitForHeadToLoad) !== !1,
187
196
  cachePages: (t == null ? void 0 : t.cachePages) !== !1,
188
197
  trailingSlash: (t == null ? void 0 : t.trailingSlash) || !1,
189
198
  scrollSelector: (t == null ? void 0 : t.scrollSelector) || "body",
190
199
  morphInsideScrollContainer: (t == null ? void 0 : t.morphInsideScrollContainer) || !1
191
- }), o(this, Y, d(this, h, ct).call(this, document.body));
200
+ }), o(this, J, m(this, h, mt).call(this, document.body));
192
201
  const s = this.normalizePath(
193
202
  location.pathname + location.hash
194
203
  );
195
- o(this, p, s.pathname), e(this, G).set(
196
- e(this, p),
197
- new kt(this, e(this, p), document)
204
+ o(this, u, s.pathname), e(this, D).set(
205
+ e(this, u),
206
+ new Tt(this, e(this, u), document)
198
207
  ), document.documentElement.setAttribute(
199
208
  "data-current-pathname",
200
- e(this, p)
209
+ e(this, u)
201
210
  ), document.documentElement.setAttribute(
202
211
  "data-current-leaf",
203
212
  s.leaf
204
- ), this.findLinks(), addEventListener("popstate", e(this, nt)), At({
213
+ ), this.findLinks(), addEventListener("popstate", e(this, at)), Ct({
205
214
  action: "replace",
206
- pathname: e(this, p),
215
+ pathname: e(this, u),
207
216
  searchParameters: s.parameters || location.search,
208
217
  hash: s.hash
209
- }), o(this, B, new Mt()), d(this, h, mt).call(this, document);
218
+ }), o(this, V, new Nt()), m(this, h, Et).call(this, document);
210
219
  }
211
220
  }
212
221
  get currentPathname() {
213
- return e(this, p);
222
+ return e(this, u);
214
223
  }
215
224
  get previousPathname() {
216
- return e(this, _);
225
+ return e(this, tt);
217
226
  }
218
227
  get links() {
219
- return e(this, f);
228
+ return e(this, p);
220
229
  }
221
230
  get scrollElement() {
222
231
  return e(this, P);
223
232
  }
224
233
  get isPopstateNavigation() {
225
- return e(this, M);
234
+ return e(this, T);
235
+ }
236
+ saveState(t) {
237
+ const s = e(this, D).get(e(this, u));
238
+ s && s.saveState(t);
239
+ }
240
+ getState() {
241
+ const t = e(this, D).get(e(this, u));
242
+ return t == null ? void 0 : t.clearState();
226
243
  }
227
244
  normalizePath(t) {
228
- return Bt(t, {
229
- base: e(this, T).base,
230
- trailingSlash: e(this, T).trailingSlash
245
+ return Wt(t, {
246
+ base: e(this, C).base,
247
+ trailingSlash: e(this, C).trailingSlash
231
248
  });
232
249
  }
233
250
  prefetch(t, s) {
234
- return q(this, null, function* () {
251
+ return z(this, null, function* () {
235
252
  const i = this.normalizePath(t);
236
- d(this, h, it).call(this, i.pathname, {
253
+ m(this, h, rt).call(this, i.pathname, {
237
254
  searchParameters: i.parameters,
238
255
  revalidate: s
239
256
  });
240
257
  });
241
258
  }
242
- navigate(S) {
243
- return q(this, arguments, function* (t, {
259
+ navigate(R) {
260
+ return z(this, arguments, function* (t, {
244
261
  historyAction: s = "push",
245
262
  centerScroll: i,
246
- offsetScroll: u,
263
+ offsetScroll: d,
247
264
  revalidate: v,
248
265
  keepSearchParameters: L,
249
- submorph: g
266
+ submorph: S,
267
+ clearState: E
250
268
  } = {}) {
251
- var Et;
252
- if (e(this, O).length)
269
+ var vt;
270
+ if (e(this, B).length)
253
271
  return;
254
- const A = this.normalizePath(((Et = this.pathnameModifier) == null ? void 0 : Et.call(this, t)) || t);
255
- let { pathname: m, hash: V, parameters: pt, leaf: xt } = A;
256
- if (e(this, D) === m || e(this, p) === m) {
257
- e(this, M) || d(this, h, ft).call(this, V || 0, {
272
+ const ot = this.normalizePath(((vt = this.pathnameModifier) == null ? void 0 : vt.call(this, t)) || t);
273
+ let { pathname: f, hash: W, parameters: St, leaf: Rt } = ot;
274
+ if (e(this, x) === f || e(this, u) === f) {
275
+ e(this, T) || m(this, h, gt).call(this, W || 0, {
258
276
  centerScroll: i,
259
- offsetScroll: u,
277
+ offsetScroll: d,
260
278
  behavior: "smooth"
261
279
  });
262
280
  return;
263
281
  }
264
- o(this, D, m), e(this, f).forEach((W) => {
265
- W.checkCurrent(m);
282
+ o(this, x, f), e(this, p).forEach((U) => {
283
+ U.checkCurrent(f);
266
284
  });
267
285
  try {
268
- let W = !0;
286
+ let U = !0;
269
287
  if (this.preprocessor)
270
288
  try {
271
- yield new Promise((r, k) => {
289
+ yield new Promise((r, A) => {
272
290
  var y;
273
291
  (y = this.preprocessor) == null || y.call(this, {
274
- pathname: m,
292
+ pathname: f,
275
293
  resolve: r,
276
- reject: k,
277
- submorph: g
294
+ reject: A,
295
+ submorph: S
278
296
  });
279
297
  });
280
298
  } catch (r) {
281
- r ? console.error(r) : console.log("Route change canceled"), W = !1;
299
+ r ? console.error(r) : console.log("Route change canceled"), U = !1;
282
300
  }
283
- if (!W || e(this, D) !== m) {
284
- e(this, f).forEach((r) => {
285
- r.checkCurrent(e(this, p));
301
+ if (!U || e(this, x) !== f) {
302
+ e(this, p).forEach((r) => {
303
+ r.checkCurrent(e(this, u));
286
304
  });
287
305
  return;
288
306
  }
289
- const at = {
290
- pathname: m,
291
- submorph: g
307
+ const lt = {
308
+ pathname: f,
309
+ submorph: S
292
310
  };
293
- $(document, "morphNavigation", {
294
- detail: at
311
+ j(document, "morphNavigation", {
312
+ detail: lt
295
313
  });
296
- const gt = yield d(this, h, it).call(this, e(this, p)), b = yield d(this, h, it).call(this, m, {
297
- searchParameters: pt,
314
+ const ht = yield m(this, h, rt).call(this, e(this, u)), b = yield m(this, h, rt).call(this, f, {
315
+ searchParameters: St,
298
316
  revalidate: v
299
317
  });
300
- if (e(this, D) !== m) {
301
- e(this, f).forEach((r) => {
302
- r.checkCurrent(e(this, p));
318
+ if (e(this, x) !== f) {
319
+ e(this, p).forEach((r) => {
320
+ r.checkCurrent(e(this, u));
303
321
  });
304
322
  return;
305
323
  }
306
- gt.saveScrollState(), gt.saveDocumentState(), e(this, M) || (b.clearScrollState(), b.clearDocumentState()), b.cloneDocument(), e(this, B).textContent = b.title, document.body.appendChild(e(this, B)), $(document, "morphStart", {
307
- detail: at
324
+ ht.clearState(), ht.saveScrollState(), ht.saveDocumentState(), e(this, T) || (b.clearScrollState(), b.clearDocumentState()), E && b.clearState(), b.cloneDocument(), e(this, V).textContent = b.title, document.body.appendChild(e(this, V)), j(document, "morphStart", {
325
+ detail: lt
308
326
  });
309
- const vt = Array.from(document.head.children), St = Array.from(b.document.head.children), yt = d(this, h, Nt).call(this, vt, St), Dt = d(this, h, ut).call(this, vt, yt), et = d(this, h, ut).call(this, St, yt);
310
- et.forEach((r, k) => {
327
+ const yt = Array.from(document.head.children), wt = Array.from(b.document.head.children), Lt = m(this, h, Dt).call(this, yt, wt), qt = m(this, h, ft).call(this, yt, Lt), st = m(this, h, ft).call(this, wt, Lt);
328
+ st.forEach((r, A) => {
311
329
  if (r.tagName === "SCRIPT" && r.getAttribute("src")) {
312
330
  const y = document.createElement("script");
313
- y.type = "module", y.src = r.getAttribute("src"), et[k] = y;
331
+ y.type = "module", y.src = r.getAttribute("src"), st[A] = y;
314
332
  }
315
- }), et.forEach((r) => {
333
+ }), st.forEach((r) => {
316
334
  document.head.appendChild(r);
317
335
  });
318
- const ot = et.filter((r) => {
336
+ const ct = st.filter((r) => {
319
337
  if (r.hasAttribute("data-no-waiting"))
320
338
  return !1;
321
- if (d(this, h, dt).call(this, r))
339
+ if (m(this, h, pt).call(this, r))
322
340
  return !0;
323
341
  });
324
- e(this, T).waitForHeadToLoad && ot.length && (yield new Promise((r) => q(this, null, function* () {
325
- let k = 0;
342
+ e(this, C).waitForHeadToLoad && ct.length && (yield new Promise((r) => z(this, null, function* () {
343
+ let A = 0;
326
344
  try {
327
- for (var y = Pt(ot), Q, R, U; Q = !(R = yield y.next()).done; Q = !1) {
328
- const st = R.value;
329
- st.onload = () => {
330
- k++, k === ot.length && r();
345
+ for (var y = kt(ct), X, q, $; X = !(q = yield y.next()).done; X = !1) {
346
+ const it = q.value;
347
+ it.onload = () => {
348
+ A++, A === ct.length && r();
331
349
  };
332
350
  }
333
- } catch (R) {
334
- U = [R];
351
+ } catch (q) {
352
+ $ = [q];
335
353
  } finally {
336
354
  try {
337
- Q && (R = y.return) && (yield R.call(y));
355
+ X && (q = y.return) && (yield q.call(y));
338
356
  } finally {
339
- if (U)
340
- throw U[0];
357
+ if ($)
358
+ throw $[0];
341
359
  }
342
360
  }
343
- }))), yield It(10);
344
- const wt = [];
345
- Dt.forEach((r) => {
346
- r.hasAttribute("data-permanent") || (d(this, h, dt).call(this, r) ? wt.push(r) : r.remove());
361
+ }))), yield Ot(10);
362
+ const bt = [];
363
+ qt.forEach((r) => {
364
+ r.hasAttribute("data-permanent") || (m(this, h, pt).call(this, r) ? bt.push(r) : r.remove());
347
365
  });
348
- const Rt = d(this, h, ct).call(this, b.document.body);
349
- e(this, T).morphInsideScrollContainer || d(this, h, mt).call(this, b.document), document.documentElement.setAttribute("data-current-pathname", m), document.documentElement.setAttribute("data-current-leaf", xt), At({
366
+ const zt = m(this, h, mt).call(this, b.document.body);
367
+ e(this, C).morphInsideScrollContainer || m(this, h, Et).call(this, b.document), document.documentElement.setAttribute("data-current-pathname", f), document.documentElement.setAttribute("data-current-leaf", Rt), Ct({
350
368
  action: s,
351
- pathname: m,
352
- searchParameters: pt || (L ? location.search : ""),
353
- hash: V
354
- }), e(this, B).remove(), o(this, _, e(this, p)), o(this, p, m), e(this, Y).forEach((r, k) => {
355
- const y = Rt[k], Q = getComputedStyle(r).getPropertyValue("--morph-duration");
356
- let R = [], U = [];
357
- g ? g.forEach((c) => {
358
- const E = r.querySelector(c), H = y.querySelector(c);
359
- E && H && (U.push(E), R.push(H));
360
- }) : (R.push(...y.childNodes), U.push(...r.childNodes)), U.forEach((c) => {
369
+ pathname: f,
370
+ searchParameters: St || (L ? location.search : ""),
371
+ hash: W
372
+ }), e(this, V).remove(), o(this, tt, e(this, u)), o(this, u, f), e(this, J).forEach((r, A) => {
373
+ const y = zt[A], X = getComputedStyle(r).getPropertyValue("--morph-duration");
374
+ let q = [], $ = [];
375
+ S ? S.forEach((c) => {
376
+ const g = r.querySelector(c), M = y.querySelector(c);
377
+ g && M && ($.push(g), q.push(M));
378
+ }) : (q.push(...y.childNodes), $.push(...r.childNodes)), $.forEach((c) => {
361
379
  c instanceof HTMLElement && (this.destroyOldLinks(c), c.classList.add("old"));
362
- }), R.forEach((c) => {
380
+ }), q.forEach((c) => {
363
381
  c instanceof HTMLElement && (this.findNewLinks(c), c.classList.add("new"));
364
- }), g ? R.forEach((c, E) => {
365
- var H;
366
- (H = U[E].parentElement) == null || H.insertBefore(
382
+ }), S ? q.forEach((c, g) => {
383
+ var M;
384
+ (M = $[g].parentElement) == null || M.insertBefore(
367
385
  c,
368
- U[E]
386
+ $[g]
369
387
  );
370
- }) : r.prepend(...R), zt(() => {
371
- R.forEach((c) => {
372
- var E;
373
- c instanceof HTMLElement && ((E = c.parentElement) == null || E.style.setProperty(
388
+ }) : r.prepend(...q), Ft(() => {
389
+ q.forEach((c) => {
390
+ var g;
391
+ c instanceof HTMLElement && ((g = c.parentElement) == null || g.style.setProperty(
374
392
  "--new-content-height",
375
393
  c.offsetHeight + "px"
376
394
  ), c.classList.add("in"));
377
395
  });
378
396
  });
379
- const st = {
397
+ const it = {
380
398
  morphElement: r,
381
- pathname: m
399
+ pathname: f
382
400
  };
383
- $(document, "morphNewChildrenAdded", {
384
- detail: st
401
+ j(document, "morphNewChildrenAdded", {
402
+ detail: it
385
403
  });
386
- const qt = new Promise((c) => {
404
+ const It = new Promise((c) => {
387
405
  setTimeout(() => {
388
- U.forEach((E) => E.remove()), R.forEach((E) => {
389
- var H;
390
- E instanceof HTMLElement && ((H = E.parentElement) == null || H.style.removeProperty(
406
+ $.forEach((g) => g.remove()), q.forEach((g) => {
407
+ var M;
408
+ g instanceof HTMLElement && ((M = g.parentElement) == null || M.style.removeProperty(
391
409
  "--new-content-height"
392
- ), E.classList.remove("in", "new"));
393
- }), $(document, "morphOldChildrenRemoved", {
394
- detail: st
410
+ ), g.classList.remove("in", "new"));
411
+ }), j(document, "morphOldChildrenRemoved", {
412
+ detail: it
395
413
  }), c();
396
- }, (parseFloat(Q) || 0) * 1e3 + 10);
414
+ }, (parseFloat(X) || 0) * 1e3 + 10);
397
415
  });
398
- e(this, O).push(qt);
399
- }), V ? (b.clearScrollState(), d(this, h, ft).call(this, V, { centerScroll: i, offsetScroll: u })) : e(this, M) ? b.restoreScrollPosition() : b.renewScrollPosition(), yield Promise.all(e(this, O)), wt.forEach((r) => r.remove()), o(this, O, []), e(this, Y).forEach((r) => {
416
+ e(this, B).push(It);
417
+ }), W ? (b.clearScrollState(), m(this, h, gt).call(this, W, { centerScroll: i, offsetScroll: d })) : e(this, T) ? b.restoreScrollPosition() : b.renewScrollPosition(), yield Promise.all(e(this, B)), bt.forEach((r) => r.remove()), o(this, B, []), e(this, J).forEach((r) => {
400
418
  r.querySelectorAll("script").forEach((y) => {
401
- const Q = document.createElement("script");
402
- Q.type = "module", Q.src = y.getAttribute("src"), y.replaceWith(Q);
419
+ const X = document.createElement("script");
420
+ X.type = "module", X.src = y.getAttribute("src"), y.replaceWith(X);
403
421
  });
404
- }), $(document, "morphComplete", {
405
- detail: at
422
+ }), j(document, "morphComplete", {
423
+ detail: lt
406
424
  }), window.dispatchEvent(new Event("resize"));
407
- } catch (W) {
408
- console.error(W);
425
+ } catch (U) {
426
+ console.error(U);
409
427
  }
410
- o(this, D, void 0);
428
+ o(this, x, void 0);
411
429
  });
412
430
  }
413
431
  addLink(t) {
414
- e(this, f).push(new ht(t, this));
432
+ e(this, p).push(new dt(t, this));
415
433
  }
416
434
  addLinks(t) {
417
435
  t.forEach((s) => {
@@ -419,71 +437,71 @@ const X = class X {
419
437
  });
420
438
  }
421
439
  removeLink(t) {
422
- o(this, f, e(this, f).filter((s) => s.element === t ? (s.destroy(), !1) : !0));
440
+ o(this, p, e(this, p).filter((s) => s.element === t ? (s.destroy(), !1) : !0));
423
441
  }
424
442
  destroyOldLinks(t) {
425
- o(this, f, e(this, f).filter((s) => t.contains(s.element) ? (s.destroy(), !1) : !0));
443
+ o(this, p, e(this, p).filter((s) => t.contains(s.element) ? (s.destroy(), !1) : !0));
426
444
  }
427
445
  findNewLinks(t) {
428
446
  const s = [...t.querySelectorAll("a")].filter(
429
- e(this, tt)
447
+ e(this, et)
430
448
  );
431
- e(this, f).push(
432
- ...s.map((i) => new ht(i, this))
449
+ e(this, p).push(
450
+ ...s.map((i) => new dt(i, this))
433
451
  );
434
452
  }
435
453
  findLinks() {
436
454
  const t = [
437
455
  ...document.documentElement.querySelectorAll("a")
438
- ].filter(e(this, tt));
439
- e(this, f).forEach((s) => s.destroy()), o(this, f, t.map((s) => new ht(s, this)));
456
+ ].filter(e(this, et));
457
+ e(this, p).forEach((s) => s.destroy()), o(this, p, t.map((s) => new dt(s, this)));
440
458
  }
441
459
  };
442
- T = new WeakMap(), Y = new WeakMap(), f = new WeakMap(), rt = new WeakMap(), D = new WeakMap(), p = new WeakMap(), _ = new WeakMap(), O = new WeakMap(), M = new WeakMap(), P = new WeakMap(), G = new WeakMap(), B = new WeakMap(), tt = new WeakMap(), h = new WeakSet(), it = function(t, s) {
443
- return q(this, null, function* () {
444
- let i = e(this, G).get(t);
445
- return (!i || s != null && s.revalidate) && (i = yield d(this, h, Ht).call(this, t, s == null ? void 0 : s.searchParameters)), i;
460
+ C = new WeakMap(), J = new WeakMap(), p = new WeakMap(), nt = new WeakMap(), x = new WeakMap(), u = new WeakMap(), tt = new WeakMap(), B = new WeakMap(), T = new WeakMap(), P = new WeakMap(), D = new WeakMap(), V = new WeakMap(), et = new WeakMap(), h = new WeakSet(), rt = function(t, s) {
461
+ return z(this, null, function* () {
462
+ let i = e(this, D).get(t);
463
+ return (!i || s != null && s.revalidate) && (i = yield m(this, h, xt).call(this, t, s == null ? void 0 : s.searchParameters)), i;
446
464
  });
447
- }, Ht = function(t, s) {
448
- return q(this, null, function* () {
449
- const u = yield (yield fetch(
465
+ }, xt = function(t, s) {
466
+ return z(this, null, function* () {
467
+ const d = yield (yield fetch(
450
468
  `${t}${s ? "?" + s : ""}`
451
- )).text(), v = e(this, rt).parseFromString(u, "text/html"), L = new kt(this, t, v);
452
- return e(this, G).set(t, L), L;
469
+ )).text(), v = e(this, nt).parseFromString(d, "text/html"), L = new Tt(this, t, v);
470
+ return e(this, D).set(t, L), L;
453
471
  });
454
- }, ct = function(t) {
472
+ }, mt = function(t) {
455
473
  const s = [...t.querySelectorAll("[data-morph]")];
456
474
  return s.length ? s : [t];
457
- }, Nt = function(t, s) {
475
+ }, Dt = function(t, s) {
458
476
  return t.filter(
459
477
  (i) => s.find(
460
- (u) => u.outerHTML === i.outerHTML
478
+ (d) => d.outerHTML === i.outerHTML
461
479
  )
462
480
  );
463
- }, ut = function(t, s) {
481
+ }, ft = function(t, s) {
464
482
  return t.filter(
465
483
  (i) => !s.find(
466
- (u) => u.outerHTML === i.outerHTML
484
+ (d) => d.outerHTML === i.outerHTML
467
485
  )
468
486
  );
469
- }, dt = function(t) {
487
+ }, pt = function(t) {
470
488
  return t.tagName === "SCRIPT" || t.tagName === "STYLE" || t.tagName === "LINK" && t.getAttribute("rel") === "stylesheet";
471
- }, mt = function(t) {
489
+ }, Et = function(t) {
472
490
  var s, i;
473
491
  (s = e(this, P)) == null || s.removeEventListener(
474
492
  "scroll",
475
- e(this, J)
476
- ), o(this, P, t.querySelector(e(this, T).scrollSelector) || t.documentElement), (i = e(this, P)) == null || i.addEventListener("scroll", e(this, J)), e(this, J).call(this);
477
- }, ft = function(t, s) {
493
+ e(this, Q)
494
+ ), o(this, P, t.querySelector(e(this, C).scrollSelector) || t.documentElement), (i = e(this, P)) == null || i.addEventListener("scroll", e(this, Q)), e(this, Q).call(this);
495
+ }, gt = function(t, s) {
478
496
  const i = typeof t == "string" ? document.getElementById(t) : t;
479
- (typeof i == "number" || i) && Ft(i, {
497
+ (typeof i == "number" || i) && Bt(i, {
480
498
  scrollElement: e(this, P),
481
499
  behavior: (s == null ? void 0 : s.behavior) || "instant",
482
500
  center: s == null ? void 0 : s.centerScroll,
483
501
  offset: s == null ? void 0 : s.offsetScroll
484
502
  });
485
- }, nt = new WeakMap(), J = new WeakMap(), X.instance = null;
486
- let Ct = X;
503
+ }, at = new WeakMap(), Q = new WeakMap(), Z.instance = null;
504
+ let Mt = Z;
487
505
  export {
488
- Ct as Morph
506
+ Mt as Morph
489
507
  };
@@ -1 +1 @@
1
- "use strict";var te=c=>{throw TypeError(c)};var Q=(c,o,t)=>o.has(c)||te("Cannot "+t);var e=(c,o,t)=>(Q(c,o,"read from private field"),t?t.call(c):o.get(c)),r=(c,o,t)=>o.has(c)?te("Cannot add the same private member more than once"):o instanceof WeakSet?o.add(c):o.set(c,t),n=(c,o,t,s)=>(Q(c,o,"write to private field"),s?s.call(c,t):o.set(c,t),t),b=(c,o,t)=>(Q(c,o,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const he=require("../element-linked-store/index.cjs"),m=require("../css-property/index.cjs"),N=require("../index-Cqw2NKev.cjs"),Y=require("../events-KVanG9sR.cjs"),ce=require("../function-MthRj-GJ.cjs"),se=require("../style-At6aDoqG.cjs"),ie=require("../url-D1CgmwZ_.cjs"),re=require("../window-resizer/index.cjs"),F=require("../device/index.cjs");var u,y,J,K;class le{constructor(){r(this,u,new Map);r(this,y,[]);r(this,J,o=>{var s;const t=[...e(this,y)].reverse().find(i=>i.clickOutside.current);if(t){const i=o.composedPath();if(i.find(ee=>ee instanceof HTMLElement&&ee.hasAttribute("data-popover-content")))return;const l=i[0],p=l instanceof Node&&(t.contains(l)||((s=t.shadowRoot)==null?void 0:s.contains(l))),H=l instanceof HTMLElement&&l.hasAttribute("data-outside");(!p||H)&&t.close()}});r(this,K,o=>{if(o.code==="Escape"){const t=[...e(this,y)].reverse().find(s=>s.escape.current);t&&t.close()}});document.documentElement.addEventListener("click",e(this,J)),addEventListener("keydown",e(this,K))}get groups(){return e(this,u)}get stack(){return e(this,y)}add(o,t){if(t.closeRest.current)e(this,u).forEach(i=>{i.forEach(l=>{l.close()})});else if(t.closeRestInGroup.current){let i=e(this,u).get(o);i==null||i.forEach(l=>{l.close()})}let s=e(this,u).get(o);s!=null&&s.length||(s=[],e(this,u).set(o,s)),e(this,y).push(t),s.push(t)}remove(o,t){if(n(this,y,e(this,y).filter(s=>s!==t)),t.closeRest.current){let s=[];e(this,u).forEach(i=>{i.forEach(l=>s.push(l))}),e(this,u).clear(),s.forEach(i=>i.close())}else if(t.closeRestInGroup.current){const s=e(this,u).get(o);e(this,u).delete(o),s==null||s.forEach(i=>{i.close()})}else{let s=e(this,u).get(o);s&&(s=s.filter(i=>i!==t),e(this,u).set(o,s))}}}u=new WeakMap,y=new WeakMap,J=new WeakMap,K=new WeakMap;var f,M,V,C,B,v,w,x,A,g,R,q,L,T,O,a,P,oe,I,$,S,W,G;const E=class E extends HTMLElement{constructor(){super();r(this,P);r(this,f);r(this,M);r(this,V);r(this,C);r(this,B);r(this,v);r(this,w);r(this,x);r(this,A);r(this,g);r(this,R);r(this,q);r(this,L);r(this,T);r(this,O);r(this,a);r(this,$);r(this,S);r(this,W);r(this,G);this.urlValue="",n(this,f,!1),n(this,v,new m.CSSProperty(this,"--history",!1)),n(this,w,new m.CSSProperty(this,"--restore",!1)),n(this,x,new m.CSSProperty(this,"--close-rest",!1)),n(this,A,new m.CSSProperty(this,"--close-rest-in-group",!1)),n(this,g,new m.CSSProperty(this,"--group","")),n(this,R,new m.CSSProperty(this,"--click-outside",!1)),n(this,q,new m.CSSProperty(this,"--escape",!1)),n(this,L,new m.CSSProperty(this,"--check-viewport-bounds",!1)),n(this,T,!1),n(this,a,new he.ElementLinkedStore(this,{opened:!1,closing:!1,triggered:!1,transitionend:!1})),n(this,$,()=>{n(this,T,!1),e(this,f)&&e(this,v).current&&!location.search.includes(this.id)?this.close():!e(this,f)&&e(this,v).current&&location.search.includes(this.id)&&this.open({trigger:this.idWithValue}),n(this,T,!0)}),n(this,S,()=>{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,W).call(this)}),n(this,W,ce.debounce(()=>{e(this,G).call(this)},10)),n(this,G,()=>{if(this.style.setProperty("--content-width",this.scrollWidth+"px"),this.style.setProperty("--content-height",this.scrollHeight+"px"),e(this,L).current){const t=this.getBoundingClientRect();let s=0,i=0;t.right>F.viewport.width?s=F.viewport.width-t.right:t.left<0&&(s=t.left*-1),t.bottom>F.viewport.height?i=F.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")}}),e(this,g).subscribe(t=>{t.previous&&(E.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=E.stack.groups.get(this.group.current),i=s==null?void 0:s.find(l=>l.opened);document.documentElement.classList.toggle(`${this.group.current}-opened`,!!i)}})}get history(){return e(this,v)}get restore(){return e(this,w)}get closeRest(){return e(this,x)}get closeRestInGroup(){return e(this,A)}get group(){return e(this,g)}get clickOutside(){return e(this,R)}get escape(){return e(this,q)}get opened(){return e(this,f)}get lastTrigger(){return e(this,O)}get idWithValue(){return`${this.id}${this.urlValue?"="+this.urlValue:""}`}updateUrlValue(t){this.urlValue=(t==null?void 0:t.toString())||"",e(this,f)&&ie.updateSearchParameter(this.id,t)}open(t){if(e(this,f))return;n(this,O,t==null?void 0:t.trigger),clearTimeout(e(this,M)),clearTimeout(e(this,V)),e(this,a).set("closing",!1),e(this,a).set("triggered",!0),Y.dispatchEvent(this,"popoverTriggered",{custom:!0,detail:{trigger:e(this,O)}}),e(this,v).current&&e(this,T)&&history.pushState(history.state,"",e(this,P,oe)),n(this,f,!0);const s=()=>{E.stack.add(e(this,g).current,this),e(this,S).call(this),e(this,a).set("opened",!0),Y.dispatchEvent(this,"popoverOpened",{custom:!0,detail:{trigger:e(this,O)}}),n(this,C,void 0),n(this,B,setTimeout(()=>{e(this,a).set("transitionend",!0)},se.getElementTransitionDurationMS(this)+10))};t!=null&&t.skipTransition?s():n(this,C,setTimeout(s,10))}close(){e(this,f)&&(clearTimeout(e(this,C)),clearTimeout(e(this,B)),E.stack.remove(e(this,g).current,this),n(this,f,!1),b(this,P,I).call(this),e(this,a).set("transitionend",!1),n(this,M,setTimeout(()=>{e(this,a).set("opened",!1),e(this,a).set("closing",!0),Y.dispatchEvent(this,"popoverClosing",{custom:!0}),n(this,V,setTimeout(()=>{e(this,a).set("triggered",!1),e(this,a).set("closing",!1),Y.dispatchEvent(this,"popoverClosed",{custom:!0})},se.getElementTransitionDurationMS(this)+10))},10)))}connectedCallback(){e(this,v).observe(),e(this,w).observe(),e(this,x).observe(),e(this,A).observe(),e(this,g).observe(),e(this,R).observe(),e(this,q).observe(),e(this,L).observe(),this.setAttribute("role","dialog"),addEventListener("popstate",e(this,$)),setTimeout(()=>{e(this,w).current?(this.urlValue=ie.parseSearchParameters(location.search)[this.id],e(this,$).call(this)):(b(this,P,I).call(this),n(this,T,!0))},0),e(this,L).subscribe(()=>{e(this,S).call(this)}),re.windowResizer.subscribe(e(this,S))}disconnectedCallback(){E.stack.remove(e(this,g).current,this),re.windowResizer.unsubscribe(e(this,S)),e(this,a).close(),e(this,v).close(),e(this,w).close(),e(this,x).close(),e(this,A).close(),e(this,g).close(),e(this,R).close(),e(this,q).close(),e(this,L).close(),this.removeAttribute("role"),clearTimeout(e(this,M)),clearTimeout(e(this,V)),clearTimeout(e(this,C)),clearTimeout(e(this,B)),removeEventListener("popstate",e(this,$)),this.style.removeProperty("--content-width"),this.style.removeProperty("--content-height"),this.style.removeProperty("--viewport-offset-x"),this.style.removeProperty("--viewport-offset-y"),b(this,P,I).call(this)}};f=new WeakMap,M=new WeakMap,V=new WeakMap,C=new WeakMap,B=new WeakMap,v=new WeakMap,w=new WeakMap,x=new WeakMap,A=new WeakMap,g=new WeakMap,R=new WeakMap,q=new WeakMap,L=new WeakMap,T=new WeakMap,O=new WeakMap,a=new WeakMap,P=new WeakSet,oe=function(){return`${location.pathname}${location.search?location.search+"&":"?"}${this.idWithValue}`},I=function(){if(e(this,v).current){const t=new URL(location.href);t.searchParams.delete(this.id),history.replaceState(history.state,"",t.href)}},$=new WeakMap,S=new WeakMap,W=new WeakMap,G=new WeakMap,E.stack=new le;let z=E;N.isBrowser&&!customElements.get("e-popover")&&customElements.define("e-popover",z);var h,d,k,Z,D,U,j,X,_;class ne extends HTMLElement{constructor(){super();r(this,k);r(this,h);r(this,d,new m.CSSProperty(this,"--type","open"));r(this,D,()=>{e(this,d).current!=="close"&&this.classList.add("triggered")});r(this,U,()=>{e(this,d).current!=="close"&&(this.classList.add("opened"),this.setAttribute("aria-expanded","true"))});r(this,j,()=>{e(this,d).current!=="close"&&this.classList.remove("opened")});r(this,X,()=>{e(this,d).current!=="close"&&(this.classList.remove("triggered"),this.setAttribute("aria-expanded","false"))});N.isBrowser&&(this.addEventListener("click",()=>{if(e(this,h)){const t=e(this,d).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=>{console.log(this.hasAttribute("keydown-disabled")),t.code==="Space"&&!this.hasAttribute("keydown-disabled")&&(t.preventDefault(),this.click())}))}get type(){return e(this,d)}get popoverElement(){return e(this,h)}changePopover(t){var s;if(b(this,k,Z).call(this),t){let i=null;if(t==="parent"){const l=this.closest("[data-popover]");if(l)i=l;else{const p=this.getRootNode();p instanceof ShadowRoot?i=p.host.closest("[data-popover]"):p instanceof HTMLElement&&(i=p.closest("[data-popover]"))}}else if(t==="sibling")i=(s=this.parentElement)==null?void 0:s.querySelector("[data-popover]");else if(t==="ancestor-child"){const l=p=>{if(!p)return null;let H=p.querySelector("[data-popover]");return!H&&(p!=null&&p.parentElement)&&(H=l(p.parentElement)),H};i=l(this.parentElement)||null}else!t.startsWith(".")&&!t.startsWith("[")&&(t=`#${t}`),i=document.querySelector(t)||this.getRootNode().querySelector(t);i instanceof HTMLElement?(n(this,h,i),e(this,h).addEventListener("popoverTriggered",e(this,D)),e(this,h).addEventListener("popoverOpened",e(this,U)),e(this,h).addEventListener("popoverClosing",e(this,j)),e(this,h).addEventListener("popoverClosed",e(this,X))):console.warn(this,`target ${t} not found`)}b(this,k,_).call(this,e(this,d).current)}connectedCallback(){e(this,d).subscribe(s=>{b(this,k,_).call(this,s.current)}),this.hasAttribute("tabindex")||(this.tabIndex=0);const t=this.getAttribute("target");t&&this.changePopover(t),this.isConnected&&e(this,d).observe()}disconnectedCallback(){e(this,d).unobserve(),this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.removeAttribute("aria-controls"),b(this,k,Z).call(this)}}h=new WeakMap,d=new WeakMap,k=new WeakSet,Z=function(){e(this,h)&&(e(this,h).removeEventListener("popoverTriggered",e(this,D)),e(this,h).removeEventListener("popoverOpened",e(this,U)),e(this,h).removeEventListener("popoverClosing",e(this,j)),e(this,h).removeEventListener("popoverClosed",e(this,X)))},D=new WeakMap,U=new WeakMap,j=new WeakMap,X=new WeakMap,_=function(t){e(this,h)instanceof z&&(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")))};N.isBrowser&&!customElements.get("e-popover-button")&&customElements.define("e-popover-button",ne);exports.PopoverButtonElement=ne;exports.PopoverElement=z;
1
+ "use strict";var te=c=>{throw TypeError(c)};var Q=(c,o,t)=>o.has(c)||te("Cannot "+t);var e=(c,o,t)=>(Q(c,o,"read from private field"),t?t.call(c):o.get(c)),r=(c,o,t)=>o.has(c)?te("Cannot add the same private member more than once"):o instanceof WeakSet?o.add(c):o.set(c,t),n=(c,o,t,s)=>(Q(c,o,"write to private field"),s?s.call(c,t):o.set(c,t),t),b=(c,o,t)=>(Q(c,o,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const he=require("../element-linked-store/index.cjs"),m=require("../css-property/index.cjs"),N=require("../index-Cqw2NKev.cjs"),Y=require("../events-KVanG9sR.cjs"),ce=require("../function-MthRj-GJ.cjs"),se=require("../style-At6aDoqG.cjs"),ie=require("../url-lnBE_6yf.cjs"),re=require("../window-resizer/index.cjs"),F=require("../device/index.cjs");var u,y,J,K;class le{constructor(){r(this,u,new Map);r(this,y,[]);r(this,J,o=>{var s;const t=[...e(this,y)].reverse().find(i=>i.clickOutside.current);if(t){const i=o.composedPath();if(i.find(ee=>ee instanceof HTMLElement&&ee.hasAttribute("data-popover-content")))return;const l=i[0],p=l instanceof Node&&(t.contains(l)||((s=t.shadowRoot)==null?void 0:s.contains(l))),H=l instanceof HTMLElement&&l.hasAttribute("data-outside");(!p||H)&&t.close()}});r(this,K,o=>{if(o.code==="Escape"){const t=[...e(this,y)].reverse().find(s=>s.escape.current);t&&t.close()}});document.documentElement.addEventListener("click",e(this,J)),addEventListener("keydown",e(this,K))}get groups(){return e(this,u)}get stack(){return e(this,y)}add(o,t){if(t.closeRest.current)e(this,u).forEach(i=>{i.forEach(l=>{l.close()})});else if(t.closeRestInGroup.current){let i=e(this,u).get(o);i==null||i.forEach(l=>{l.close()})}let s=e(this,u).get(o);s!=null&&s.length||(s=[],e(this,u).set(o,s)),e(this,y).push(t),s.push(t)}remove(o,t){if(n(this,y,e(this,y).filter(s=>s!==t)),t.closeRest.current){let s=[];e(this,u).forEach(i=>{i.forEach(l=>s.push(l))}),e(this,u).clear(),s.forEach(i=>i.close())}else if(t.closeRestInGroup.current){const s=e(this,u).get(o);e(this,u).delete(o),s==null||s.forEach(i=>{i.close()})}else{let s=e(this,u).get(o);s&&(s=s.filter(i=>i!==t),e(this,u).set(o,s))}}}u=new WeakMap,y=new WeakMap,J=new WeakMap,K=new WeakMap;var f,M,V,C,B,v,w,x,A,g,R,q,L,T,O,a,P,oe,I,$,S,W,G;const E=class E extends HTMLElement{constructor(){super();r(this,P);r(this,f);r(this,M);r(this,V);r(this,C);r(this,B);r(this,v);r(this,w);r(this,x);r(this,A);r(this,g);r(this,R);r(this,q);r(this,L);r(this,T);r(this,O);r(this,a);r(this,$);r(this,S);r(this,W);r(this,G);this.urlValue="",n(this,f,!1),n(this,v,new m.CSSProperty(this,"--history",!1)),n(this,w,new m.CSSProperty(this,"--restore",!1)),n(this,x,new m.CSSProperty(this,"--close-rest",!1)),n(this,A,new m.CSSProperty(this,"--close-rest-in-group",!1)),n(this,g,new m.CSSProperty(this,"--group","")),n(this,R,new m.CSSProperty(this,"--click-outside",!1)),n(this,q,new m.CSSProperty(this,"--escape",!1)),n(this,L,new m.CSSProperty(this,"--check-viewport-bounds",!1)),n(this,T,!1),n(this,a,new he.ElementLinkedStore(this,{opened:!1,closing:!1,triggered:!1,transitionend:!1})),n(this,$,()=>{n(this,T,!1),e(this,f)&&e(this,v).current&&!location.search.includes(this.id)?this.close():!e(this,f)&&e(this,v).current&&location.search.includes(this.id)&&this.open({trigger:this.idWithValue}),n(this,T,!0)}),n(this,S,()=>{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,W).call(this)}),n(this,W,ce.debounce(()=>{e(this,G).call(this)},10)),n(this,G,()=>{if(this.style.setProperty("--content-width",this.scrollWidth+"px"),this.style.setProperty("--content-height",this.scrollHeight+"px"),e(this,L).current){const t=this.getBoundingClientRect();let s=0,i=0;t.right>F.viewport.width?s=F.viewport.width-t.right:t.left<0&&(s=t.left*-1),t.bottom>F.viewport.height?i=F.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")}}),e(this,g).subscribe(t=>{t.previous&&(E.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=E.stack.groups.get(this.group.current),i=s==null?void 0:s.find(l=>l.opened);document.documentElement.classList.toggle(`${this.group.current}-opened`,!!i)}})}get history(){return e(this,v)}get restore(){return e(this,w)}get closeRest(){return e(this,x)}get closeRestInGroup(){return e(this,A)}get group(){return e(this,g)}get clickOutside(){return e(this,R)}get escape(){return e(this,q)}get opened(){return e(this,f)}get lastTrigger(){return e(this,O)}get idWithValue(){return`${this.id}${this.urlValue?"="+this.urlValue:""}`}updateUrlValue(t){this.urlValue=(t==null?void 0:t.toString())||"",e(this,f)&&ie.updateSearchParameter(this.id,t)}open(t){if(e(this,f))return;n(this,O,t==null?void 0:t.trigger),clearTimeout(e(this,M)),clearTimeout(e(this,V)),e(this,a).set("closing",!1),e(this,a).set("triggered",!0),Y.dispatchEvent(this,"popoverTriggered",{custom:!0,detail:{trigger:e(this,O)}}),e(this,v).current&&e(this,T)&&history.pushState(history.state,"",e(this,P,oe)),n(this,f,!0);const s=()=>{E.stack.add(e(this,g).current,this),e(this,S).call(this),e(this,a).set("opened",!0),Y.dispatchEvent(this,"popoverOpened",{custom:!0,detail:{trigger:e(this,O)}}),n(this,C,void 0),n(this,B,setTimeout(()=>{e(this,a).set("transitionend",!0)},se.getElementTransitionDurationMS(this)+10))};t!=null&&t.skipTransition?s():n(this,C,setTimeout(s,10))}close(){e(this,f)&&(clearTimeout(e(this,C)),clearTimeout(e(this,B)),E.stack.remove(e(this,g).current,this),n(this,f,!1),b(this,P,I).call(this),e(this,a).set("transitionend",!1),n(this,M,setTimeout(()=>{e(this,a).set("opened",!1),e(this,a).set("closing",!0),Y.dispatchEvent(this,"popoverClosing",{custom:!0}),n(this,V,setTimeout(()=>{e(this,a).set("triggered",!1),e(this,a).set("closing",!1),Y.dispatchEvent(this,"popoverClosed",{custom:!0})},se.getElementTransitionDurationMS(this)+10))},10)))}connectedCallback(){e(this,v).observe(),e(this,w).observe(),e(this,x).observe(),e(this,A).observe(),e(this,g).observe(),e(this,R).observe(),e(this,q).observe(),e(this,L).observe(),this.setAttribute("role","dialog"),addEventListener("popstate",e(this,$)),setTimeout(()=>{e(this,w).current?(this.urlValue=ie.parseSearchParameters(location.search)[this.id],e(this,$).call(this)):(b(this,P,I).call(this),n(this,T,!0))},0),e(this,L).subscribe(()=>{e(this,S).call(this)}),re.windowResizer.subscribe(e(this,S))}disconnectedCallback(){E.stack.remove(e(this,g).current,this),re.windowResizer.unsubscribe(e(this,S)),e(this,a).close(),e(this,v).close(),e(this,w).close(),e(this,x).close(),e(this,A).close(),e(this,g).close(),e(this,R).close(),e(this,q).close(),e(this,L).close(),this.removeAttribute("role"),clearTimeout(e(this,M)),clearTimeout(e(this,V)),clearTimeout(e(this,C)),clearTimeout(e(this,B)),removeEventListener("popstate",e(this,$)),this.style.removeProperty("--content-width"),this.style.removeProperty("--content-height"),this.style.removeProperty("--viewport-offset-x"),this.style.removeProperty("--viewport-offset-y"),b(this,P,I).call(this)}};f=new WeakMap,M=new WeakMap,V=new WeakMap,C=new WeakMap,B=new WeakMap,v=new WeakMap,w=new WeakMap,x=new WeakMap,A=new WeakMap,g=new WeakMap,R=new WeakMap,q=new WeakMap,L=new WeakMap,T=new WeakMap,O=new WeakMap,a=new WeakMap,P=new WeakSet,oe=function(){return`${location.pathname}${location.search?location.search+"&":"?"}${this.idWithValue}`},I=function(){if(e(this,v).current){const t=new URL(location.href);t.searchParams.delete(this.id),history.replaceState(history.state,"",t.href)}},$=new WeakMap,S=new WeakMap,W=new WeakMap,G=new WeakMap,E.stack=new le;let z=E;N.isBrowser&&!customElements.get("e-popover")&&customElements.define("e-popover",z);var h,d,k,Z,D,U,j,X,_;class ne extends HTMLElement{constructor(){super();r(this,k);r(this,h);r(this,d,new m.CSSProperty(this,"--type","open"));r(this,D,()=>{e(this,d).current!=="close"&&this.classList.add("triggered")});r(this,U,()=>{e(this,d).current!=="close"&&(this.classList.add("opened"),this.setAttribute("aria-expanded","true"))});r(this,j,()=>{e(this,d).current!=="close"&&this.classList.remove("opened")});r(this,X,()=>{e(this,d).current!=="close"&&(this.classList.remove("triggered"),this.setAttribute("aria-expanded","false"))});N.isBrowser&&(this.addEventListener("click",()=>{if(e(this,h)){const t=e(this,d).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=>{console.log(this.hasAttribute("keydown-disabled")),t.code==="Space"&&!this.hasAttribute("keydown-disabled")&&(t.preventDefault(),this.click())}))}get type(){return e(this,d)}get popoverElement(){return e(this,h)}changePopover(t){var s;if(b(this,k,Z).call(this),t){let i=null;if(t==="parent"){const l=this.closest("[data-popover]");if(l)i=l;else{const p=this.getRootNode();p instanceof ShadowRoot?i=p.host.closest("[data-popover]"):p instanceof HTMLElement&&(i=p.closest("[data-popover]"))}}else if(t==="sibling")i=(s=this.parentElement)==null?void 0:s.querySelector("[data-popover]");else if(t==="ancestor-child"){const l=p=>{if(!p)return null;let H=p.querySelector("[data-popover]");return!H&&(p!=null&&p.parentElement)&&(H=l(p.parentElement)),H};i=l(this.parentElement)||null}else!t.startsWith(".")&&!t.startsWith("[")&&(t=`#${t}`),i=document.querySelector(t)||this.getRootNode().querySelector(t);i instanceof HTMLElement?(n(this,h,i),e(this,h).addEventListener("popoverTriggered",e(this,D)),e(this,h).addEventListener("popoverOpened",e(this,U)),e(this,h).addEventListener("popoverClosing",e(this,j)),e(this,h).addEventListener("popoverClosed",e(this,X))):console.warn(this,`target ${t} not found`)}b(this,k,_).call(this,e(this,d).current)}connectedCallback(){e(this,d).subscribe(s=>{b(this,k,_).call(this,s.current)}),this.hasAttribute("tabindex")||(this.tabIndex=0);const t=this.getAttribute("target");t&&this.changePopover(t),this.isConnected&&e(this,d).observe()}disconnectedCallback(){e(this,d).unobserve(),this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.removeAttribute("aria-controls"),b(this,k,Z).call(this)}}h=new WeakMap,d=new WeakMap,k=new WeakSet,Z=function(){e(this,h)&&(e(this,h).removeEventListener("popoverTriggered",e(this,D)),e(this,h).removeEventListener("popoverOpened",e(this,U)),e(this,h).removeEventListener("popoverClosing",e(this,j)),e(this,h).removeEventListener("popoverClosed",e(this,X)))},D=new WeakMap,U=new WeakMap,j=new WeakMap,X=new WeakMap,_=function(t){e(this,h)instanceof z&&(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")))};N.isBrowser&&!customElements.get("e-popover-button")&&customElements.define("e-popover-button",ne);exports.PopoverButtonElement=ne;exports.PopoverElement=z;
@@ -9,7 +9,7 @@ import { i as _ } from "../index-euf5anj6.js";
9
9
  import { d as Y } from "../events-CsVF98U6.js";
10
10
  import { d as ht } from "../function-C10DGppn.js";
11
11
  import { g as st } from "../style-j2TwriJ_.js";
12
- import { u as nt, p as ct } from "../url-B6BNcw6_.js";
12
+ import { u as nt, p as ct } from "../url-Cc-RVfii.js";
13
13
  import { windowResizer as it } from "../window-resizer/index.js";
14
14
  import { viewport as j } from "../device/index.js";
15
15
  var u, b, J, K;
@@ -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-Cqw2NKev.cjs"),ht=require("../function-MthRj-GJ.cjs"),F=require("../url-D1CgmwZ_.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-Cqw2NKev.cjs"),ht=require("../function-MthRj-GJ.cjs"),F=require("../url-lnBE_6yf.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;
@@ -24,7 +24,7 @@ import { URLPattern as at } from "urlpattern-polyfill";
24
24
  import { Notifier as nt } from "../notifier/index.js";
25
25
  import { i as _ } from "../index-euf5anj6.js";
26
26
  import { d as ht } from "../function-C10DGppn.js";
27
- import { n as rt, c as ot, s as ct } from "../url-B6BNcw6_.js";
27
+ import { n as rt, c as ot, s as ct } from "../url-Cc-RVfii.js";
28
28
  import { i as lt } from "../object-D6MVWB4l.js";
29
29
  var y, U, A, p, d, L, k, v, E, R, M, tt;
30
30
  class ut {
@@ -1,16 +1,16 @@
1
- var W = Object.defineProperty, P = Object.defineProperties;
2
- var u = Object.getOwnPropertyDescriptors;
1
+ var W = Object.defineProperty, u = Object.defineProperties;
2
+ var P = Object.getOwnPropertyDescriptors;
3
3
  var h = Object.getOwnPropertySymbols;
4
- var S = Object.prototype.hasOwnProperty, p = Object.prototype.propertyIsEnumerable;
4
+ var S = Object.prototype.hasOwnProperty, y = Object.prototype.propertyIsEnumerable;
5
5
  var c = (t, s, a) => s in t ? W(t, s, { enumerable: !0, configurable: !0, writable: !0, value: a }) : t[s] = a, o = (t, s) => {
6
6
  for (var a in s || (s = {}))
7
7
  S.call(s, a) && c(t, a, s[a]);
8
8
  if (h)
9
9
  for (var a of h(s))
10
- p.call(s, a) && c(t, a, s[a]);
10
+ y.call(s, a) && c(t, a, s[a]);
11
11
  return t;
12
- }, i = (t, s) => P(t, u(s));
13
- function d(t, { base: s = "", trailingSlash: a = !1 } = {}) {
12
+ }, i = (t, s) => u(t, P(s));
13
+ function p(t, { base: s = "", trailingSlash: a = !1 } = {}) {
14
14
  s = s.endsWith("/") ? s.slice(0, -1) : s, t = t.replace(s, ""), t.startsWith("/") && (t = t.slice(1));
15
15
  const n = t.split("#"), e = n[0].split("?");
16
16
  let r = e[0].startsWith("/") ? e[0] : "/" + e[0];
@@ -27,6 +27,8 @@ function $(t = "/") {
27
27
  return t.endsWith("/") || (t += "/"), t.startsWith("/") || (t += "/"), t;
28
28
  }
29
29
  function g(t) {
30
+ if (t.action === "none")
31
+ return;
30
32
  const s = t == null ? void 0 : t.searchParameters, a = t.hash ? t.hash.startsWith("#") ? t.hash : "#" + t.hash : "", n = s ? s.startsWith("?") ? s : "?" + s : "", e = `${t.pathname}${a}${n}`, r = i(o({}, t.state), { path: e });
31
33
  t.action === "push" ? history.pushState(r, "", e) : t.action === "replace" && history.replaceState(r, "", e);
32
34
  }
@@ -44,6 +46,6 @@ export {
44
46
  g as c,
45
47
  $ as n,
46
48
  w as p,
47
- d as s,
49
+ p as s,
48
50
  L as u
49
51
  };
@@ -0,0 +1 @@
1
+ "use strict";var P=Object.defineProperty,u=Object.defineProperties;var S=Object.getOwnPropertyDescriptors;var h=Object.getOwnPropertySymbols;var W=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable;var c=(t,s,r)=>s in t?P(t,s,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[s]=r,i=(t,s)=>{for(var r in s||(s={}))W.call(s,r)&&c(t,r,s[r]);if(h)for(var r of h(s))y.call(s,r)&&c(t,r,s[r]);return t},o=(t,s)=>u(t,S(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("#"),a=n[0].split("?");let e=a[0].startsWith("/")?a[0]:"/"+a[0];r?e=!e.endsWith("/")&&e!=="/"?e+"/":e:e=e.endsWith("/")&&e!=="/"?e.slice(0,-1):e;const f=s+e,m=a==null?void 0:a[1],l=n==null?void 0:n[1];return{leaf:e,pathname:f,parameters:m,hash:l}}function p(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:"",a=`${t.pathname}${r}${n}`,e=o(i({},t.state),{path:a});t.action==="push"?history.pushState(e,"",a):t.action==="replace"&&history.replaceState(e,"",a)}function $(t){const s=new URLSearchParams(t),r={};for(const[n,a]of s)r[n]=a;return r}function w(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=p;exports.parseSearchParameters=$;exports.splitPath=d;exports.updateSearchParameter=w;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("../attributes-Bf2svn4j.cjs"),O=require("../index-Cqw2NKev.cjs"),b=require("../canvas-CU5Xjahf.cjs"),C=require("../coordinates-D8Np3cPD.cjs"),g=require("../dom-JBOkFLTh.cjs"),i=require("../easings-GegIwET5.cjs"),Q=require("../events-KVanG9sR.cjs"),E=require("../file-DSpfWdd9.cjs"),S=require("../function-MthRj-GJ.cjs"),A=require("../gestures-C7gbKx11.cjs"),T=require("../jss-CRBgdvJ3.cjs"),h=require("../layout-Ctc2p3uz.cjs"),a=require("../math-GDWEqu7y.cjs"),m=require("../number-DyefJ5a1.cjs"),c=require("../object-CCiXnER2.cjs"),v=require("../polyfills-Df4r-ETT.cjs"),P=require("../scroll-DAhSpkhR.cjs"),l=require("../string-DUXXtU8v.cjs"),w=require("../style-At6aDoqG.cjs"),p=require("../url-D1CgmwZ_.cjs");function B(t,e,...n){return[...t.slice(0,e),...n,...t.slice(e)]}function D(t,e){const n=t.length;e=e%n;const o=new Array(n);for(let s=0;s<n;s++){const r=(s+e)%n;o[r]=t[s]}return o}function R(t,e=2){if(!+t)return"0 Bytes";const n=1024,o=e<0?0:e,s=["Bytes","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],r=Math.floor(Math.log(t)/Math.log(n));return`${parseFloat((t/Math.pow(n,r)).toFixed(o))} ${s[r]}`}function N(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 j(t,e){return t.x<e.x+e.width&&t.x>e.x&&t.y<e.y+e.height&&t.y>e.y}function z(t,e){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)<e.radius}function M(t,e){let n=!1;const{x:o,y:s}=t;for(let r=0,u=e.length-1;r<e.length;u=r++){const f=e[r].x,d=e[r].y,y=e[u].x,I=e[u].y;d>s!=I>s&&o<(y-f)*(s-d)/(I-d)+f&&(n=!n)}return n}function q(t,e){const n=t.style.getPropertyValue(e);if(n){const o=n.toString();return o.startsWith("var")?q(t,o.slice(4,-1)):o}}function V(...t){const e={};return Array.from(document.styleSheets).forEach(n=>{Array.from(n.cssRules).forEach(o=>{o instanceof CSSStyleRule&&o.selectorText===":root"&&t.forEach(s=>{const r=q(o,s);r&&(e[s]=r)})})}),t.forEach(n=>{e[n]||console.warn(`variable named ${n} not found`)}),e}function k(t){const e=window.atob(t);return decodeURIComponent(window.escape(e))}function F(t){const e=window.unescape(encodeURIComponent(t));return window.btoa(e)}function $(t){const e=window.getComputedStyle(t);return e.width!=="0"&&e.height!=="0"&&e.opacity!=="0"&&e.display!=="none"&&e.visibility!=="hidden"}const H=/^(\+?\d{1,3}[-.\s]?)?(\(?\d{3}\)?[-.\s]?)?\d{1,4}[-.\s]?\d{2,4}[-.\s]?\d{2,4}$/,U=/^[\w.-]+@[a-zA-Z\d.-]+\.[a-zA-Z]{2,}$/;function K(t){let e,n;return U.test(t)?(e=`mailto:${t.trim()}`,n="email"):H.test(t)&&(e=`tel:${t.replace(/[^0-9\\.\\+]+/g,"")}`,n="phone"),{href:e,type:n,contact:t}}function W(t,e){if(t){const o=t.content.cloneNode(!0).firstElementChild;return o&&(e==null||e(o)),o}return null}function Z(t,e,n,o){let s,r=!1,u=0;const f=()=>{clearInterval(s),o!=null&&o.restartCounter&&(u=0),r&&(s=setInterval(()=>{n(u++)},e))},d=O.intersector.subscribe(t,y=>{r=y.isIntersecting,f()});return()=>{d(),clearInterval(s)}}exports.parseAttribute=x.parseAttribute;exports.parseAttributeValue=x.parseAttributeValue;exports.isBrowser=O.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.findParentElement=g.findParentElement;exports.findScrollParentElement=g.findScrollParentElement;exports.getAllParentElements=g.getAllParentElements;exports.getElement=g.getElement;exports.easeInCubic=i.easeInCubic;exports.easeInExpo=i.easeInExpo;exports.easeInOutCubic=i.easeInOutCubic;exports.easeInOutExpo=i.easeInOutExpo;exports.easeInOutQuad=i.easeInOutQuad;exports.easeInOutQuart=i.easeInOutQuart;exports.easeInOutQuint=i.easeInOutQuint;exports.easeInQuad=i.easeInQuad;exports.easeInQuart=i.easeInQuart;exports.easeInQuint=i.easeInQuint;exports.easeOutCubic=i.easeOutCubic;exports.easeOutExpo=i.easeOutExpo;exports.easeOutQuad=i.easeOutQuad;exports.easeOutQuart=i.easeOutQuart;exports.easeOutQuint=i.easeOutQuint;exports.linear=i.linear;exports.dispatchEvent=Q.dispatchEvent;exports.createJSONAndSave=E.createJSONAndSave;exports.downloadURI=E.downloadURI;exports.debounce=S.debounce;exports.throttle=S.throttle;exports.setupDrag=A.setupDrag;exports.createStylesheet=T.createStylesheet;exports.styleToString=T.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=w.getElementTransitionDurationMS;exports.getElementTransitionDurationS=w.getElementTransitionDurationS;exports.changeHistory=p.changeHistory;exports.normalizeBase=p.normalizeBase;exports.parseSearchParameters=p.parseSearchParameters;exports.splitPath=p.splitPath;exports.updateSearchParameter=p.updateSearchParameter;exports.cloneTemplateContent=W;exports.copyTextToClipboard=N;exports.decode=F;exports.dotCircleCollision=z;exports.dotPolygonCollision=M;exports.dotRectCollision=j;exports.encode=k;exports.formatBytes=R;exports.getRootVariables=V;exports.insert=B;exports.isElementVisible=$;exports.setIntervalOnIntersection=Z;exports.shiftArray=D;exports.tryCreateHrefFromContact=K;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("../attributes-Bf2svn4j.cjs"),O=require("../index-Cqw2NKev.cjs"),b=require("../canvas-CU5Xjahf.cjs"),C=require("../coordinates-D8Np3cPD.cjs"),g=require("../dom-JBOkFLTh.cjs"),i=require("../easings-GegIwET5.cjs"),Q=require("../events-KVanG9sR.cjs"),E=require("../file-DSpfWdd9.cjs"),S=require("../function-MthRj-GJ.cjs"),A=require("../gestures-C7gbKx11.cjs"),T=require("../jss-CRBgdvJ3.cjs"),h=require("../layout-Ctc2p3uz.cjs"),a=require("../math-GDWEqu7y.cjs"),m=require("../number-DyefJ5a1.cjs"),c=require("../object-CCiXnER2.cjs"),v=require("../polyfills-Df4r-ETT.cjs"),P=require("../scroll-DAhSpkhR.cjs"),l=require("../string-DUXXtU8v.cjs"),w=require("../style-At6aDoqG.cjs"),p=require("../url-lnBE_6yf.cjs");function B(t,e,...n){return[...t.slice(0,e),...n,...t.slice(e)]}function D(t,e){const n=t.length;e=e%n;const o=new Array(n);for(let s=0;s<n;s++){const r=(s+e)%n;o[r]=t[s]}return o}function R(t,e=2){if(!+t)return"0 Bytes";const n=1024,o=e<0?0:e,s=["Bytes","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],r=Math.floor(Math.log(t)/Math.log(n));return`${parseFloat((t/Math.pow(n,r)).toFixed(o))} ${s[r]}`}function N(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 j(t,e){return t.x<e.x+e.width&&t.x>e.x&&t.y<e.y+e.height&&t.y>e.y}function z(t,e){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)<e.radius}function M(t,e){let n=!1;const{x:o,y:s}=t;for(let r=0,u=e.length-1;r<e.length;u=r++){const f=e[r].x,d=e[r].y,y=e[u].x,I=e[u].y;d>s!=I>s&&o<(y-f)*(s-d)/(I-d)+f&&(n=!n)}return n}function q(t,e){const n=t.style.getPropertyValue(e);if(n){const o=n.toString();return o.startsWith("var")?q(t,o.slice(4,-1)):o}}function V(...t){const e={};return Array.from(document.styleSheets).forEach(n=>{Array.from(n.cssRules).forEach(o=>{o instanceof CSSStyleRule&&o.selectorText===":root"&&t.forEach(s=>{const r=q(o,s);r&&(e[s]=r)})})}),t.forEach(n=>{e[n]||console.warn(`variable named ${n} not found`)}),e}function k(t){const e=window.atob(t);return decodeURIComponent(window.escape(e))}function F(t){const e=window.unescape(encodeURIComponent(t));return window.btoa(e)}function $(t){const e=window.getComputedStyle(t);return e.width!=="0"&&e.height!=="0"&&e.opacity!=="0"&&e.display!=="none"&&e.visibility!=="hidden"}const H=/^(\+?\d{1,3}[-.\s]?)?(\(?\d{3}\)?[-.\s]?)?\d{1,4}[-.\s]?\d{2,4}[-.\s]?\d{2,4}$/,U=/^[\w.-]+@[a-zA-Z\d.-]+\.[a-zA-Z]{2,}$/;function K(t){let e,n;return U.test(t)?(e=`mailto:${t.trim()}`,n="email"):H.test(t)&&(e=`tel:${t.replace(/[^0-9\\.\\+]+/g,"")}`,n="phone"),{href:e,type:n,contact:t}}function W(t,e){if(t){const o=t.content.cloneNode(!0).firstElementChild;return o&&(e==null||e(o)),o}return null}function Z(t,e,n,o){let s,r=!1,u=0;const f=()=>{clearInterval(s),o!=null&&o.restartCounter&&(u=0),r&&(s=setInterval(()=>{n(u++)},e))},d=O.intersector.subscribe(t,y=>{r=y.isIntersecting,f()});return()=>{d(),clearInterval(s)}}exports.parseAttribute=x.parseAttribute;exports.parseAttributeValue=x.parseAttributeValue;exports.isBrowser=O.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.findParentElement=g.findParentElement;exports.findScrollParentElement=g.findScrollParentElement;exports.getAllParentElements=g.getAllParentElements;exports.getElement=g.getElement;exports.easeInCubic=i.easeInCubic;exports.easeInExpo=i.easeInExpo;exports.easeInOutCubic=i.easeInOutCubic;exports.easeInOutExpo=i.easeInOutExpo;exports.easeInOutQuad=i.easeInOutQuad;exports.easeInOutQuart=i.easeInOutQuart;exports.easeInOutQuint=i.easeInOutQuint;exports.easeInQuad=i.easeInQuad;exports.easeInQuart=i.easeInQuart;exports.easeInQuint=i.easeInQuint;exports.easeOutCubic=i.easeOutCubic;exports.easeOutExpo=i.easeOutExpo;exports.easeOutQuad=i.easeOutQuad;exports.easeOutQuart=i.easeOutQuart;exports.easeOutQuint=i.easeOutQuint;exports.linear=i.linear;exports.dispatchEvent=Q.dispatchEvent;exports.createJSONAndSave=E.createJSONAndSave;exports.downloadURI=E.downloadURI;exports.debounce=S.debounce;exports.throttle=S.throttle;exports.setupDrag=A.setupDrag;exports.createStylesheet=T.createStylesheet;exports.styleToString=T.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=w.getElementTransitionDurationMS;exports.getElementTransitionDurationS=w.getElementTransitionDurationS;exports.changeHistory=p.changeHistory;exports.normalizeBase=p.normalizeBase;exports.parseSearchParameters=p.parseSearchParameters;exports.splitPath=p.splitPath;exports.updateSearchParameter=p.updateSearchParameter;exports.cloneTemplateContent=W;exports.copyTextToClipboard=N;exports.decode=F;exports.dotCircleCollision=z;exports.dotPolygonCollision=M;exports.dotRectCollision=j;exports.encode=k;exports.formatBytes=R;exports.getRootVariables=V;exports.insert=B;exports.isElementVisible=$;exports.setIntervalOnIntersection=Z;exports.shiftArray=D;exports.tryCreateHrefFromContact=K;
@@ -18,7 +18,7 @@ import { n as nt, r as it } from "../polyfills-DJrTJQky.js";
18
18
  import { s as lt, w as ut } from "../scroll-Benkuq-t.js";
19
19
  import { c as dt, a as pt, b as mt, d as xt, g as ht, i as gt, k as bt, s as yt, t as Ct, u as It } from "../string-BlMQbe8b.js";
20
20
  import { g as vt, a as Et } from "../style-j2TwriJ_.js";
21
- import { c as Tt, n as Ot, p as Pt, s as Bt, u as At } from "../url-B6BNcw6_.js";
21
+ import { c as Tt, n as Ot, p as Pt, s as Bt, u as At } from "../url-Cc-RVfii.js";
22
22
  function g(t, e, ...s) {
23
23
  return [...t.slice(0, e), ...s, ...t.slice(e)];
24
24
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aptechka",
3
- "version": "0.62.4",
3
+ "version": "0.63.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 P=Object.defineProperty,S=Object.defineProperties;var W=Object.getOwnPropertyDescriptors;var n=Object.getOwnPropertySymbols;var u=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable;var c=(t,s,r)=>s in t?P(t,s,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[s]=r,i=(t,s)=>{for(var r in s||(s={}))u.call(s,r)&&c(t,r,s[r]);if(n)for(var r of n(s))p.call(s,r)&&c(t,r,s[r]);return t},o=(t,s)=>S(t,W(s));function y(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 h=t.split("#"),e=h[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 f=s+a,m=e==null?void 0:e[1],l=h==null?void 0:h[1];return{leaf:a,pathname:f,parameters:m,hash:l}}function d(t="/"){return t.endsWith("/")||(t+="/"),t.startsWith("/")||(t+="/"),t}function g(t){const s=t==null?void 0:t.searchParameters,r=t.hash?t.hash.startsWith("#")?t.hash:"#"+t.hash:"",h=s?s.startsWith("?")?s:"?"+s:"",e=`${t.pathname}${r}${h}`,a=o(i({},t.state),{path:e});t.action==="push"?history.pushState(a,"",e):t.action==="replace"&&history.replaceState(a,"",e)}function $(t){const s=new URLSearchParams(t),r={};for(const[h,e]of s)r[h]=e;return r}function w(t,s){const r=new URL(location.href),h=(s==null?void 0:s.toString())||"";r.searchParams.set(t,h),history.replaceState(history.state,"",r.href)}exports.changeHistory=g;exports.normalizeBase=d;exports.parseSearchParameters=$;exports.splitPath=y;exports.updateSearchParameter=w;