aptechka 0.61.7 → 0.61.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/morph/index.cjs +1 -1
- package/lib/morph/index.js +70 -69
- package/lib/popover/index.cjs +1 -1
- package/lib/popover/index.js +13 -13
- package/lib/scroll/index.cjs +1 -1
- package/lib/scroll/index.js +58 -58
- package/package.json +1 -1
package/lib/morph/index.cjs
CHANGED
|
@@ -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})}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&<.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 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&<.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;
|
package/lib/morph/index.js
CHANGED
|
@@ -2,24 +2,24 @@ var Lt = (n, t) => (t = Symbol[n]) ? t : Symbol.for("Symbol." + n), bt = (n) =>
|
|
|
2
2
|
throw TypeError(n);
|
|
3
3
|
};
|
|
4
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)),
|
|
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
6
|
var q = (n, t, s) => new Promise((i, u) => {
|
|
7
|
-
var
|
|
7
|
+
var v = (S) => {
|
|
8
8
|
try {
|
|
9
|
-
g(s.next(
|
|
9
|
+
g(s.next(S));
|
|
10
10
|
} catch (A) {
|
|
11
11
|
u(A);
|
|
12
12
|
}
|
|
13
|
-
}, L = (
|
|
13
|
+
}, L = (S) => {
|
|
14
14
|
try {
|
|
15
|
-
g(s.throw(
|
|
15
|
+
g(s.throw(S));
|
|
16
16
|
} catch (A) {
|
|
17
17
|
u(A);
|
|
18
18
|
}
|
|
19
|
-
}, g = (
|
|
19
|
+
}, g = (S) => S.done ? i(S.value) : Promise.resolve(S.value).then(v, L);
|
|
20
20
|
g((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] = (
|
|
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
23
|
import { i as Tt } from "../index-euf5anj6.js";
|
|
24
24
|
import { d as $ } from "../events-CsVF98U6.js";
|
|
25
25
|
import { r as zt } from "../polyfills-DJrTJQky.js";
|
|
@@ -41,34 +41,34 @@ Tt && !customElements.get("morph-announcer") && customElements.define("morph-ann
|
|
|
41
41
|
var C, l, z, Z, j;
|
|
42
42
|
class ht {
|
|
43
43
|
constructor(t, s) {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
a(this, C);
|
|
45
|
+
a(this, l);
|
|
46
|
+
a(this, z);
|
|
47
|
+
a(this, Z, (t) => {
|
|
48
48
|
var i;
|
|
49
49
|
if (t.preventDefault(), e(this, l).hasAttribute("data-back") && e(this, C).previousPathname)
|
|
50
50
|
history.back();
|
|
51
51
|
else {
|
|
52
52
|
const u = e(this, l).getAttribute(
|
|
53
53
|
"data-history-action"
|
|
54
|
-
) || "push",
|
|
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(
|
|
55
55
|
"data-keep-search-parameters"
|
|
56
56
|
), m = (i = e(this, l).getAttribute("data-submorph")) == null ? void 0 : i.split(",").map((V) => V.trim());
|
|
57
57
|
e(this, C).navigate(e(this, z), {
|
|
58
58
|
historyAction: u,
|
|
59
|
-
centerScroll:
|
|
59
|
+
centerScroll: v,
|
|
60
60
|
offsetScroll: g,
|
|
61
|
-
revalidate:
|
|
61
|
+
revalidate: S,
|
|
62
62
|
keepSearchParameters: A,
|
|
63
63
|
submorph: m
|
|
64
64
|
});
|
|
65
65
|
}
|
|
66
66
|
});
|
|
67
|
-
|
|
67
|
+
a(this, j, () => {
|
|
68
68
|
const t = e(this, l).hasAttribute("data-revalidate");
|
|
69
69
|
e(this, C).prefetch(e(this, z), t), e(this, l).removeEventListener("pointerenter", e(this, j));
|
|
70
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
72
|
}
|
|
73
73
|
get element() {
|
|
74
74
|
return e(this, l);
|
|
@@ -85,13 +85,13 @@ C = new WeakMap(), l = new WeakMap(), z = new WeakMap(), Z = new WeakMap(), j =
|
|
|
85
85
|
var N, K, w, I, F, x;
|
|
86
86
|
class kt {
|
|
87
87
|
constructor(t, s, i) {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
88
|
+
a(this, N);
|
|
89
|
+
a(this, K);
|
|
90
|
+
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));
|
|
95
95
|
}
|
|
96
96
|
get pathname() {
|
|
97
97
|
return e(this, K);
|
|
@@ -103,7 +103,7 @@ class kt {
|
|
|
103
103
|
return e(this, x);
|
|
104
104
|
}
|
|
105
105
|
cloneDocument() {
|
|
106
|
-
|
|
106
|
+
o(this, x, (e(this, F) || e(this, I)).cloneNode(!0));
|
|
107
107
|
}
|
|
108
108
|
get title() {
|
|
109
109
|
let t = "";
|
|
@@ -119,7 +119,7 @@ class kt {
|
|
|
119
119
|
e(this, w).x = 0, e(this, w).y = 0;
|
|
120
120
|
}
|
|
121
121
|
clearDocumentState() {
|
|
122
|
-
|
|
122
|
+
o(this, F, null);
|
|
123
123
|
}
|
|
124
124
|
saveScrollState() {
|
|
125
125
|
e(this, I).documentElement.hasAttribute(
|
|
@@ -129,12 +129,13 @@ class kt {
|
|
|
129
129
|
saveDocumentState() {
|
|
130
130
|
e(this, I).documentElement.hasAttribute(
|
|
131
131
|
"data-no-page-restoration"
|
|
132
|
-
) ?
|
|
132
|
+
) ? o(this, F, null) : o(this, F, document.cloneNode(!0));
|
|
133
133
|
}
|
|
134
134
|
restoreScrollPosition() {
|
|
135
135
|
e(this, N).scrollElement.scroll({
|
|
136
136
|
top: e(this, w).y,
|
|
137
|
-
left: e(this, w).x
|
|
137
|
+
left: e(this, w).x,
|
|
138
|
+
behavior: "instant"
|
|
138
139
|
});
|
|
139
140
|
}
|
|
140
141
|
renewScrollPosition() {
|
|
@@ -149,28 +150,28 @@ N = new WeakMap(), K = new WeakMap(), w = new WeakMap(), I = new WeakMap(), F =
|
|
|
149
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;
|
|
150
151
|
const X = class X {
|
|
151
152
|
constructor(t) {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
153
|
+
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, P, null);
|
|
164
|
+
a(this, G, /* @__PURE__ */ new Map());
|
|
165
|
+
a(this, B, null);
|
|
166
|
+
a(this, tt, (t) => {
|
|
166
167
|
var s;
|
|
167
168
|
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";
|
|
168
169
|
});
|
|
169
|
-
|
|
170
|
+
a(this, nt, (t) => q(this, null, function* () {
|
|
170
171
|
var s;
|
|
171
|
-
(s = t.state) != null && s.path && (t.preventDefault(),
|
|
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));
|
|
172
173
|
}));
|
|
173
|
-
|
|
174
|
+
a(this, J, () => {
|
|
174
175
|
const t = e(this, P).scrollTop, s = e(this, P).scrollLeft;
|
|
175
176
|
document.documentElement.classList.toggle("top-scrolled", t > 0), document.documentElement.classList.toggle("left-scrolled", s > 0), $(document, "morphScroll", {
|
|
176
177
|
detail: {
|
|
@@ -180,18 +181,18 @@ const X = class X {
|
|
|
180
181
|
});
|
|
181
182
|
});
|
|
182
183
|
if (Tt && !X.instance) {
|
|
183
|
-
X.instance = this,
|
|
184
|
+
X.instance = this, o(this, T, {
|
|
184
185
|
base: Ot(t == null ? void 0 : t.base),
|
|
185
186
|
waitForHeadToLoad: (t == null ? void 0 : t.waitForHeadToLoad) !== !1,
|
|
186
187
|
cachePages: (t == null ? void 0 : t.cachePages) !== !1,
|
|
187
188
|
trailingSlash: (t == null ? void 0 : t.trailingSlash) || !1,
|
|
188
189
|
scrollSelector: (t == null ? void 0 : t.scrollSelector) || "body",
|
|
189
190
|
morphInsideScrollContainer: (t == null ? void 0 : t.morphInsideScrollContainer) || !1
|
|
190
|
-
}),
|
|
191
|
+
}), o(this, Y, d(this, h, ct).call(this, document.body));
|
|
191
192
|
const s = this.normalizePath(
|
|
192
193
|
location.pathname + location.hash
|
|
193
194
|
);
|
|
194
|
-
|
|
195
|
+
o(this, p, s.pathname), e(this, G).set(
|
|
195
196
|
e(this, p),
|
|
196
197
|
new kt(this, e(this, p), document)
|
|
197
198
|
), document.documentElement.setAttribute(
|
|
@@ -205,7 +206,7 @@ const X = class X {
|
|
|
205
206
|
pathname: e(this, p),
|
|
206
207
|
searchParameters: s.parameters || location.search,
|
|
207
208
|
hash: s.hash
|
|
208
|
-
}),
|
|
209
|
+
}), o(this, B, new Mt()), d(this, h, mt).call(this, document);
|
|
209
210
|
}
|
|
210
211
|
}
|
|
211
212
|
get currentPathname() {
|
|
@@ -238,12 +239,12 @@ const X = class X {
|
|
|
238
239
|
});
|
|
239
240
|
});
|
|
240
241
|
}
|
|
241
|
-
navigate(
|
|
242
|
+
navigate(S) {
|
|
242
243
|
return q(this, arguments, function* (t, {
|
|
243
244
|
historyAction: s = "push",
|
|
244
245
|
centerScroll: i,
|
|
245
246
|
offsetScroll: u,
|
|
246
|
-
revalidate:
|
|
247
|
+
revalidate: v,
|
|
247
248
|
keepSearchParameters: L,
|
|
248
249
|
submorph: g
|
|
249
250
|
} = {}) {
|
|
@@ -260,7 +261,7 @@ const X = class X {
|
|
|
260
261
|
});
|
|
261
262
|
return;
|
|
262
263
|
}
|
|
263
|
-
|
|
264
|
+
o(this, D, m), e(this, f).forEach((W) => {
|
|
264
265
|
W.checkCurrent(m);
|
|
265
266
|
});
|
|
266
267
|
try {
|
|
@@ -285,16 +286,16 @@ const X = class X {
|
|
|
285
286
|
});
|
|
286
287
|
return;
|
|
287
288
|
}
|
|
288
|
-
const
|
|
289
|
+
const at = {
|
|
289
290
|
pathname: m,
|
|
290
291
|
submorph: g
|
|
291
292
|
};
|
|
292
293
|
$(document, "morphNavigation", {
|
|
293
|
-
detail:
|
|
294
|
+
detail: at
|
|
294
295
|
});
|
|
295
296
|
const gt = yield d(this, h, it).call(this, e(this, p)), b = yield d(this, h, it).call(this, m, {
|
|
296
297
|
searchParameters: pt,
|
|
297
|
-
revalidate:
|
|
298
|
+
revalidate: v
|
|
298
299
|
});
|
|
299
300
|
if (e(this, D) !== m) {
|
|
300
301
|
e(this, f).forEach((r) => {
|
|
@@ -303,9 +304,9 @@ const X = class X {
|
|
|
303
304
|
return;
|
|
304
305
|
}
|
|
305
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", {
|
|
306
|
-
detail:
|
|
307
|
+
detail: at
|
|
307
308
|
});
|
|
308
|
-
const
|
|
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);
|
|
309
310
|
et.forEach((r, k) => {
|
|
310
311
|
if (r.tagName === "SCRIPT" && r.getAttribute("src")) {
|
|
311
312
|
const y = document.createElement("script");
|
|
@@ -314,19 +315,19 @@ const X = class X {
|
|
|
314
315
|
}), et.forEach((r) => {
|
|
315
316
|
document.head.appendChild(r);
|
|
316
317
|
});
|
|
317
|
-
const
|
|
318
|
+
const ot = et.filter((r) => {
|
|
318
319
|
if (r.hasAttribute("data-no-waiting"))
|
|
319
320
|
return !1;
|
|
320
321
|
if (d(this, h, dt).call(this, r))
|
|
321
322
|
return !0;
|
|
322
323
|
});
|
|
323
|
-
e(this, T).waitForHeadToLoad &&
|
|
324
|
+
e(this, T).waitForHeadToLoad && ot.length && (yield new Promise((r) => q(this, null, function* () {
|
|
324
325
|
let k = 0;
|
|
325
326
|
try {
|
|
326
|
-
for (var y = Pt(
|
|
327
|
+
for (var y = Pt(ot), Q, R, U; Q = !(R = yield y.next()).done; Q = !1) {
|
|
327
328
|
const st = R.value;
|
|
328
329
|
st.onload = () => {
|
|
329
|
-
k++, k ===
|
|
330
|
+
k++, k === ot.length && r();
|
|
330
331
|
};
|
|
331
332
|
}
|
|
332
333
|
} catch (R) {
|
|
@@ -350,7 +351,7 @@ const X = class X {
|
|
|
350
351
|
pathname: m,
|
|
351
352
|
searchParameters: pt || (L ? location.search : ""),
|
|
352
353
|
hash: V
|
|
353
|
-
}), e(this, B).remove(),
|
|
354
|
+
}), e(this, B).remove(), o(this, _, e(this, p)), o(this, p, m), e(this, Y).forEach((r, k) => {
|
|
354
355
|
const y = Rt[k], Q = getComputedStyle(r).getPropertyValue("--morph-duration");
|
|
355
356
|
let R = [], U = [];
|
|
356
357
|
g ? g.forEach((c) => {
|
|
@@ -395,18 +396,18 @@ const X = class X {
|
|
|
395
396
|
}, (parseFloat(Q) || 0) * 1e3 + 10);
|
|
396
397
|
});
|
|
397
398
|
e(this, O).push(qt);
|
|
398
|
-
}), 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()),
|
|
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) => {
|
|
399
400
|
r.querySelectorAll("script").forEach((y) => {
|
|
400
401
|
const Q = document.createElement("script");
|
|
401
402
|
Q.type = "module", Q.src = y.getAttribute("src"), y.replaceWith(Q);
|
|
402
403
|
});
|
|
403
404
|
}), $(document, "morphComplete", {
|
|
404
|
-
detail:
|
|
405
|
+
detail: at
|
|
405
406
|
}), window.dispatchEvent(new Event("resize"));
|
|
406
407
|
} catch (W) {
|
|
407
408
|
console.error(W);
|
|
408
409
|
}
|
|
409
|
-
|
|
410
|
+
o(this, D, void 0);
|
|
410
411
|
});
|
|
411
412
|
}
|
|
412
413
|
addLink(t) {
|
|
@@ -418,10 +419,10 @@ const X = class X {
|
|
|
418
419
|
});
|
|
419
420
|
}
|
|
420
421
|
removeLink(t) {
|
|
421
|
-
|
|
422
|
+
o(this, f, e(this, f).filter((s) => s.element === t ? (s.destroy(), !1) : !0));
|
|
422
423
|
}
|
|
423
424
|
destroyOldLinks(t) {
|
|
424
|
-
|
|
425
|
+
o(this, f, e(this, f).filter((s) => t.contains(s.element) ? (s.destroy(), !1) : !0));
|
|
425
426
|
}
|
|
426
427
|
findNewLinks(t) {
|
|
427
428
|
const s = [...t.querySelectorAll("a")].filter(
|
|
@@ -435,7 +436,7 @@ const X = class X {
|
|
|
435
436
|
const t = [
|
|
436
437
|
...document.documentElement.querySelectorAll("a")
|
|
437
438
|
].filter(e(this, tt));
|
|
438
|
-
e(this, f).forEach((s) => s.destroy()),
|
|
439
|
+
e(this, f).forEach((s) => s.destroy()), o(this, f, t.map((s) => new ht(s, this)));
|
|
439
440
|
}
|
|
440
441
|
};
|
|
441
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) {
|
|
@@ -447,7 +448,7 @@ T = new WeakMap(), Y = new WeakMap(), f = new WeakMap(), rt = new WeakMap(), D =
|
|
|
447
448
|
return q(this, null, function* () {
|
|
448
449
|
const u = yield (yield fetch(
|
|
449
450
|
`${t}${s ? "?" + s : ""}`
|
|
450
|
-
)).text(),
|
|
451
|
+
)).text(), v = e(this, rt).parseFromString(u, "text/html"), L = new kt(this, t, v);
|
|
451
452
|
return e(this, G).set(t, L), L;
|
|
452
453
|
});
|
|
453
454
|
}, ct = function(t) {
|
|
@@ -472,7 +473,7 @@ T = new WeakMap(), Y = new WeakMap(), f = new WeakMap(), rt = new WeakMap(), D =
|
|
|
472
473
|
(s = e(this, P)) == null || s.removeEventListener(
|
|
473
474
|
"scroll",
|
|
474
475
|
e(this, J)
|
|
475
|
-
),
|
|
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);
|
|
476
477
|
}, ft = function(t, s) {
|
|
477
478
|
const i = typeof t == "string" ? document.getElementById(t) : t;
|
|
478
479
|
(typeof i == "number" || i) && Ft(i, {
|
package/lib/popover/index.cjs
CHANGED
|
@@ -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()}});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=>{t.code==="Space"&&t.currentTarget.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"),y=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,m,J,K;class le{constructor(){r(this,u,new Map);r(this,m,[]);r(this,J,o=>{var s;const t=[...e(this,m)].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,m)].reverse().find(s=>s.escape.current);console.log(e(this,m)),t&&t.close()}});addEventListener("click",e(this,J)),addEventListener("keydown",e(this,K))}get groups(){return e(this,u)}get stack(){return e(this,m)}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,m).push(t),s.push(t)}remove(o,t){if(n(this,m,e(this,m).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,m=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 y.CSSProperty(this,"--history",!1)),n(this,w,new y.CSSProperty(this,"--restore",!1)),n(this,x,new y.CSSProperty(this,"--close-rest",!1)),n(this,A,new y.CSSProperty(this,"--close-rest-in-group",!1)),n(this,g,new y.CSSProperty(this,"--group","")),n(this,R,new y.CSSProperty(this,"--click-outside",!1)),n(this,q,new y.CSSProperty(this,"--escape",!1)),n(this,L,new y.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 y.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=>{t.code==="Space"&&t.currentTarget.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;
|
package/lib/popover/index.js
CHANGED
|
@@ -4,7 +4,7 @@ var et = (c) => {
|
|
|
4
4
|
var Q = (c, o, e) => o.has(c) || et("Cannot " + e);
|
|
5
5
|
var t = (c, o, e) => (Q(c, o, "read from private field"), e ? e.call(c) : o.get(c)), r = (c, o, e) => o.has(c) ? et("Cannot add the same private member more than once") : o instanceof WeakSet ? o.add(c) : o.set(c, e), h = (c, o, e, s) => (Q(c, o, "write to private field"), s ? s.call(c, e) : o.set(c, e), e), y = (c, o, e) => (Q(c, o, "access private method"), e);
|
|
6
6
|
import { ElementLinkedStore as ot } from "../element-linked-store/index.js";
|
|
7
|
-
import { CSSProperty as
|
|
7
|
+
import { CSSProperty as b } from "../css-property/index.js";
|
|
8
8
|
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";
|
|
@@ -12,14 +12,14 @@ import { g as st } from "../style-j2TwriJ_.js";
|
|
|
12
12
|
import { u as nt, p as ct } from "../url-B6BNcw6_.js";
|
|
13
13
|
import { windowResizer as it } from "../window-resizer/index.js";
|
|
14
14
|
import { viewport as j } from "../device/index.js";
|
|
15
|
-
var u,
|
|
15
|
+
var u, v, J, K;
|
|
16
16
|
class lt {
|
|
17
17
|
constructor() {
|
|
18
18
|
r(this, u, /* @__PURE__ */ new Map());
|
|
19
|
-
r(this,
|
|
19
|
+
r(this, v, []);
|
|
20
20
|
r(this, J, (o) => {
|
|
21
21
|
var s;
|
|
22
|
-
const e = [...t(this,
|
|
22
|
+
const e = [...t(this, v)].reverse().find((i) => i.clickOutside.current);
|
|
23
23
|
if (e) {
|
|
24
24
|
const i = o.composedPath();
|
|
25
25
|
if (i.find(
|
|
@@ -32,8 +32,8 @@ class lt {
|
|
|
32
32
|
});
|
|
33
33
|
r(this, K, (o) => {
|
|
34
34
|
if (o.code === "Escape") {
|
|
35
|
-
const e = [...t(this,
|
|
36
|
-
e && e.close();
|
|
35
|
+
const e = [...t(this, v)].reverse().find((s) => s.escape.current);
|
|
36
|
+
console.log(t(this, v)), e && e.close();
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
39
|
addEventListener("click", t(this, J)), addEventListener("keydown", t(this, K));
|
|
@@ -42,7 +42,7 @@ class lt {
|
|
|
42
42
|
return t(this, u);
|
|
43
43
|
}
|
|
44
44
|
get stack() {
|
|
45
|
-
return t(this,
|
|
45
|
+
return t(this, v);
|
|
46
46
|
}
|
|
47
47
|
add(o, e) {
|
|
48
48
|
if (e.closeRest.current)
|
|
@@ -58,10 +58,10 @@ class lt {
|
|
|
58
58
|
});
|
|
59
59
|
}
|
|
60
60
|
let s = t(this, u).get(o);
|
|
61
|
-
s != null && s.length || (s = [], t(this, u).set(o, s)), t(this,
|
|
61
|
+
s != null && s.length || (s = [], t(this, u).set(o, s)), t(this, v).push(e), s.push(e);
|
|
62
62
|
}
|
|
63
63
|
remove(o, e) {
|
|
64
|
-
if (h(this,
|
|
64
|
+
if (h(this, v, t(this, v).filter((s) => s !== e)), e.closeRest.current) {
|
|
65
65
|
let s = [];
|
|
66
66
|
t(this, u).forEach((i) => {
|
|
67
67
|
i.forEach((l) => s.push(l));
|
|
@@ -77,7 +77,7 @@ class lt {
|
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
|
-
u = new WeakMap(),
|
|
80
|
+
u = new WeakMap(), v = new WeakMap(), J = new WeakMap(), K = new WeakMap();
|
|
81
81
|
var f, M, H, A, W, g, w, S, C, m, R, $, L, T, O, a, P, rt, F, V, k, q, z;
|
|
82
82
|
const E = class E extends HTMLElement {
|
|
83
83
|
constructor() {
|
|
@@ -103,11 +103,11 @@ const E = class E extends HTMLElement {
|
|
|
103
103
|
r(this, k);
|
|
104
104
|
r(this, q);
|
|
105
105
|
r(this, z);
|
|
106
|
-
this.urlValue = "", h(this, f, !1), h(this, g, new
|
|
106
|
+
this.urlValue = "", h(this, f, !1), h(this, g, new b(this, "--history", !1)), h(this, w, new b(this, "--restore", !1)), h(this, S, new b(this, "--close-rest", !1)), h(this, C, new b(
|
|
107
107
|
this,
|
|
108
108
|
"--close-rest-in-group",
|
|
109
109
|
!1
|
|
110
|
-
)), h(this, m, new
|
|
110
|
+
)), h(this, m, new b(this, "--group", "")), h(this, R, new b(this, "--click-outside", !1)), h(this, $, new b(this, "--escape", !1)), h(this, L, new b(this, "--check-viewport-bounds", !1)), h(this, T, !1), h(this, a, new ot(this, {
|
|
111
111
|
opened: !1,
|
|
112
112
|
closing: !1,
|
|
113
113
|
triggered: !1,
|
|
@@ -236,7 +236,7 @@ class at extends HTMLElement {
|
|
|
236
236
|
super();
|
|
237
237
|
r(this, x);
|
|
238
238
|
r(this, n);
|
|
239
|
-
r(this, d, new
|
|
239
|
+
r(this, d, new b(this, "--type", "open"));
|
|
240
240
|
r(this, B, () => {
|
|
241
241
|
t(this, d).current !== "close" && this.classList.add("triggered");
|
|
242
242
|
});
|
package/lib/scroll/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var ts=Object.defineProperty;var Oe=Object.getOwnPropertySymbols;var es=Object.prototype.hasOwnProperty,ss=Object.prototype.propertyIsEnumerable;var He=S=>{throw TypeError(S)};var Ve=(S,n,e)=>n in S?ts(S,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):S[n]=e,_e=(S,n)=>{for(var e in n||(n={}))es.call(n,e)&&Ve(S,e,n[e]);if(Oe)for(var e of Oe(n))ss.call(n,e)&&Ve(S,e,n[e]);return S};var ke=(S,n,e)=>n.has(S)||He("Cannot "+e);var t=(S,n,e)=>(ke(S,n,"read from private field"),e?e.call(S):n.get(S)),s=(S,n,e)=>n.has(S)?He("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(S):n.set(S,e),h=(S,n,e,i)=>(ke(S,n,"write to private field"),i?i.call(S,e):n.set(S,e),e),c=(S,n,e)=>(ke(S,n,"access private method"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const is=require("../Store-GokLe_g-.cjs"),O=require("../index-Cqw2NKev.cjs"),rs=require("../easings-GegIwET5.cjs"),he=require("../events-KVanG9sR.cjs"),Ae=require("../function-MthRj-GJ.cjs"),We=require("../jss-CRBgdvJ3.cjs"),Vt=require("../layout-Ctc2p3uz.cjs"),Fe=require("../math-GDWEqu7y.cjs"),Ne=require("../number-DyefJ5a1.cjs");require("../ticker/index.cjs");const xe=require("../order/index.cjs"),ns=require("../Damped-B8bmTxAr.cjs"),hs=require("../Tweened-BsL9FamJ.cjs"),Ee=require("../controls/index.cjs"),Ht=require("../window-resizer/index.cjs"),yt=require("../scroll-entries/index.cjs"),$e=require("../css-unit-parser/index.cjs"),d=require("../css-property/index.cjs"),os=require("../device/index.cjs"),ue=require("../element-resizer/index.cjs"),ls=require("../gestures-C7gbKx11.cjs"),Ue=require("../dom-JBOkFLTh.cjs"),cs=require("../scroll-segment/index.cjs");var p,_t,g,ae,de,Ct,V,et,vt,Pt,oe;class us{constructor(n,e,i){s(this,Pt);s(this,p);s(this,_t);s(this,g);s(this,ae,0);s(this,de,0);s(this,Ct,0);s(this,V,0);s(this,et,null);s(this,vt,0);h(this,p,n),h(this,_t,e),h(this,g,i),yt.scrollEntries.register(t(this,p)),this.setIndex(t(this,_t))}get element(){return t(this,p)}get index(){return t(this,_t)}get size(){return t(this,Ct)}get width(){return t(this,ae)}get height(){return t(this,de)}get position(){return t(this,V)}get transformPosition(){return t(this,vt)}destroy(){yt.scrollEntries.unregister(t(this,p)),this.unsetTransform()}unsetTransform(){t(this,p).style.transform="",this.setMark(null),this.setIndex(null),this.setCurrentIndex(null),this.setCurrentIndexArc(null),this.setCurrentIndexArcAbs(null),this.setMiddle(!1),this.setSize()}setSize(n){n?(t(this,p).style.setProperty("--size",n+"px"),t(this,g).axisCSSProperty.current==="x"?(t(this,p).style.width=n+"px",t(this,p).style.height=""):(t(this,p).style.height=n+"px",t(this,p).style.width="")):(t(this,p).style.width="",t(this,p).style.height="",t(this,p).style.removeProperty("--size"))}resize(){h(this,ae,t(this,p).offsetWidth),h(this,de,t(this,p).offsetHeight),h(this,Ct,t(this,g).vertical?t(this,p).offsetHeight:t(this,p).offsetWidth),h(this,V,t(this,g).vertical?Vt.getCumulativeOffsetTop(t(this,p)):Vt.getCumulativeOffsetLeft(t(this,p))),h(this,V,t(this,V)-t(this,g).contentPosition)}transform(){const n=t(this,g).shiftSectionPositionCSSProperty.current;let e=n;const i=t(this,g).viewportSize*t(this,g).sectionDistanceScaleCSSProperty.current;t(this,g).loopCSSProperty.current&&t(this,V)+t(this,Ct)<=t(this,g).currentScrollValue-n/2&&(e=(t(this,g).distance-n)*-1-t(this,g).gap),yt.scrollEntries.update(t(this,p),t(this,g).axisCSSProperty.current,e);const r=t(this,g).currentScrollValue+e,u=t(this,V)-t(this,g).viewportSize-i,b=t(this,V)+t(this,Ct)+i,y=Ne.preciseNumber(Fe.clamp(r,u,b),3);h(this,vt,y*-1),t(this,g).vertical?t(this,p).style.transform=`translate3d(0px, ${t(this,vt)}px, 0px)`:t(this,p).style.transform=`translate3d(${t(this,vt)}px, 0px, 0px)`}setMark(n){t(this,et)!==n&&(t(this,et)&&t(this,p).classList.remove(t(this,et)),n&&t(this,p).classList.add(n),h(this,et,n),he.dispatchEvent(t(this,p),"scrollSectionMarkChange",{composed:!0,detail:{mark:t(this,et)},custom:!0}))}setMiddle(n){t(this,p).classList.toggle("middle",n)}setIndex(n){c(this,Pt,oe).call(this,"index",n)}setCurrentIndex(n){c(this,Pt,oe).call(this,"current-index",n)}setCurrentIndexArc(n){c(this,Pt,oe).call(this,"current-index-arc",n)}setCurrentIndexArcAbs(n){c(this,Pt,oe).call(this,"current-index-arc-abs",n)}}p=new WeakMap,_t=new WeakMap,g=new WeakMap,ae=new WeakMap,de=new WeakMap,Ct=new WeakMap,V=new WeakMap,et=new WeakMap,vt=new WeakMap,Pt=new WeakSet,oe=function(n,e){e!==null?(t(this,p).style.setProperty(`--${n}`,e.toString()),t(this,p).setAttribute(`data-${n}`,e.toString())):(t(this,p).style.removeProperty(`--${n}`),t(this,p).removeAttribute(`data-${n}`))};const as=We.createStylesheet({":host":{position:"relative",width:"100%",height:"100%",display:"block",outline:"none"},".static":{position:"var(--static-position, absolute)",top:"var(--static-top, 0)",left:"var(--static-left, 0)",width:"var(--static-width, 100%)",height:"var(--static-height, 100%)"},".content-wrapper":{width:"var(--content-wrapper-width, 100%)",height:"var(--content-wrapper-height, 100%)",overflow:"var(--overflow, initial)",borderRadius:"var(--border-radius, unset)"},".content":{position:"relative",display:"flex",width:"100%",height:"100%",gap:"var(--gap, 0px)",willChange:"var(--will-change, transform)"},":host(.hibernated) .content-wrapper":{display:"contents"},":host(.hibernated) .content":{display:"contents"},"::slotted(*)":{flexShrink:"0"}});var a,wt,E,st,H,_,$,M,it,rt,W,nt,Et,T,v,xt,zt,Lt,It,$t,kt,A,At,ht,R,ot,F,Rt,lt,Mt,ct,ut,at,f,Wt,l,Se,pe,C,m,k,q,dt,D,w,x,Ft,N,U,G,Z,Nt,St,j,Ut,B,P,Gt,K,Tt,Zt,o,Re,le,Ot,ze,Le,Me,Te,z,fe,Ge,jt,be,qe,De,gt,Ze,me,ce,ge;class Dt extends HTMLElement{constructor(){super();s(this,o);s(this,a,null);s(this,wt,new d.CSSProperty(this,"--controls",!0));s(this,E,new d.CSSProperty(this,"--axis","y"));s(this,st,new d.CSSProperty(this,"--reverse",!1));s(this,H,new d.CSSProperty(this,"--direction",0));s(this,_,new d.CSSProperty(this,"--pages",0,{validate:e=>Math.max(0,e-1)}));s(this,$,new d.CSSProperty(this,"--split",!1));s(this,M,new d.CSSProperty(this,"--sectional",!1));s(this,it,new d.CSSProperty(this,"--tween-easing",!1));s(this,rt,new d.CSSProperty(this,"--tween-duration",!1));s(this,W,new d.CSSProperty(this,"--auto-size",!1));s(this,nt,new d.CSSProperty(this,"--wheel-max-delta",!1));s(this,Et,new d.CSSProperty(this,"--drag-inertion",1));s(this,T,new d.CSSProperty(this,"--sections-in-view",1));s(this,v,new d.CSSProperty(this,"--loop",!1));s(this,xt,new d.CSSProperty(this,"--damping",20));s(this,zt,new d.CSSProperty(this,"--mass",0));s(this,Lt,new d.CSSProperty(this,"--stiffness",0));s(this,It,new d.CSSProperty(this,"--mouse-drag",!1));s(this,$t,new d.CSSProperty(this,"--section-distance-scale",.5));s(this,kt,new d.CSSProperty(this,"--start-section",0));s(this,A,new d.CSSProperty(this,"--autoplay",0));s(this,At,new d.CSSProperty(this,"--autoplay-pause-duration",0));s(this,ht,new d.CSSProperty(this,"--autoplay-user-direction",!1));s(this,R,new d.CSSProperty(this,"--classes",!1));s(this,ot,new d.CSSProperty(this,"--current-index-start-offset",0));s(this,F,new d.CSSProperty(this,"--current-index-end-offset",0));s(this,Rt,new d.CSSProperty(this,"--shift-section-position",0,{rawValueCheck:!1}));s(this,lt,new d.CSSProperty(this,"--focus-delay",0));s(this,Mt,new d.CSSProperty(this,"--focus-duration",3e3));s(this,ct,new d.CSSProperty(this,"--disabled",!1));s(this,ut,new d.CSSProperty(this,"--hibernate",!1));s(this,at,null);s(this,f,null);s(this,Wt,null);s(this,l,[]);s(this,Se,0);s(this,pe,0);s(this,C,0);s(this,m,0);s(this,k,0);s(this,q,null);s(this,dt,null);s(this,D,null);s(this,w,null);s(this,x,new is.Store(0));s(this,Ft,0);s(this,N,0);s(this,U,!1);s(this,G,!0);s(this,Z,!0);s(this,Nt);s(this,St);s(this,j,new hs.Tweened);s(this,Ut,!1);s(this,B,null);s(this,P,!1);s(this,Gt,null);s(this,K,[]);s(this,Tt,!1);s(this,Zt);s(this,z,e=>{if(e&&t(this,Tt)){h(this,Tt,!1);return}this.resize()});s(this,fe,()=>{if(!t(this,U)||t(this,Z)||t(this,G))return;const e=this.currentScrollValue;if(h(this,Ft,Math.max(0,e-t(this,m))),t(this,l).length){for(let i=0;i<t(this,l).length;i++)t(this,l)[i].transform();t(this,x).current=c(this,o,ce).call(this)}else this.vertical?t(this,f).style.transform=`translate3d(0px, ${e*-1}px, 0px)`:t(this,f).style.transform=`translate3d(${e*-1}px, 0px, 0px)`;c(this,o,Ze).call(this),yt.scrollEntries.update(this,t(this,E).current,e)});s(this,jt,(e,i)=>{t(this,wt).current&&(c(this,o,qe).call(this,Math.sign(i)||1),t(this,be).call(this,e,i))});s(this,be,(e,i)=>{if(t(this,H).current){if(t(this,H).current<0&&i>0)return;if(t(this,H).current>0&&i<0)return}if(t(this,St)||t(this,j).unlistenAnimationFrame(),!t(this,A).current&&t(this,lt).current&&(clearInterval(t(this,Nt)),h(this,Nt,setTimeout(()=>{const r=t(this,l)[c(this,o,ce).call(this)];r&&this.scrollToSection(r.index,{tween:{duration:t(this,Mt).current,easing:rs.easeInOutExpo}})},t(this,lt).current))),!(e.includes("drag")&&!os.device.isTouch&&!t(this,It).current)){if(t(this,M).current&&e!=="drag"){const r=Math.sign(i);if(t(this,l).length){const u={tween:t(this,it).current||t(this,rt).current?{easing:t(this,it).current||"easeInOutCubic",duration:t(this,rt).current||500}:void 0};t(this,Ut)?this.scrollToSection(c(this,o,ce).call(this,!0),u):this.shiftSections(r,u)}else t(this,a).shift(r*t(this,C))}else t(this,a).shift(i);h(this,Ut,e==="drag")}});s(this,me,Ae.debounce(()=>{const e=t(this,K).reduce((i,r)=>{const u=this.vertical?r.width:r.height;return u>i?u:i},0);clearTimeout(t(this,Zt)),h(this,Tt,!0),this.style.setProperty("--max-section-size",""),h(this,Zt,setTimeout(()=>{h(this,Tt,!0),this.style.setProperty("--max-section-size",e+"px")},10))},20));s(this,ge,()=>{h(this,P,!0),this.hibernatedCSSProperty.current||c(this,o,Te).call(this)});if(O.isBrowser){const e=this.attachShadow({mode:"open"});e.adoptedStyleSheets=[as];const i=document.createElement("div");i.className="static",i.innerHTML='<slot name="static"></slot>',e.appendChild(i),h(this,at,document.createElement("div")),t(this,at).className="content-wrapper",h(this,f,document.createElement("div")),t(this,f).className="content",h(this,Wt,document.createElement("slot")),t(this,f).appendChild(t(this,Wt)),t(this,at).appendChild(t(this,f)),e.appendChild(t(this,at)),h(this,Gt,new MutationObserver(Ae.debounce(()=>{this.tryResplit()},10)))}}get damped(){return t(this,a)}get controlsCSSProperty(){return t(this,wt)}get axisCSSProperty(){return t(this,E)}get reverseCSSProperty(){return t(this,st)}get directionCSSProperty(){return t(this,H)}get pagesCSSProperty(){return t(this,_)}get splitCSSProperty(){return t(this,$)}get sectionalCSSProperty(){return t(this,M)}get easingCSSProperty(){return t(this,it)}get durationCSSProperty(){return t(this,rt)}get autoSizeCSSProperty(){return t(this,W)}get wheelMaxDeltaCSSProperty(){return t(this,nt)}get dragInertionCSSProperty(){return t(this,Et)}get sectionsInViewCSSProperty(){return t(this,T)}get loopCSSProperty(){return t(this,v)}get dampingCSSProperty(){return t(this,xt)}get massCSSProperty(){return t(this,zt)}get stiffnessCSSProperty(){return t(this,Lt)}get mouseDragCSSProperty(){return t(this,It)}get sectionDistanceScaleCSSProperty(){return t(this,$t)}get startSectionCSSProperty(){return t(this,kt)}get autoplayCSSProperty(){return t(this,A)}get autoplayPauseDurationCSSProperty(){return t(this,At)}get autoplayUserDirectionCSSProperty(){return t(this,ht)}get classesCSSProperty(){return t(this,R)}get currentIndexStartOffsetCSSProperty(){return t(this,ot)}get currentIndexEndOffsetCSSProperty(){return t(this,F)}get shiftSectionPositionCSSProperty(){return t(this,Rt)}get focusDelayCSSProperty(){return t(this,lt)}get focusDurationCSSProperty(){return t(this,Mt)}get disabledCSSProperty(){return t(this,ct)}get hibernatedCSSProperty(){return t(this,ut)}get currentScrollValue(){return c(this,o,De).call(this,"current")}get targetScrollValue(){return c(this,o,De).call(this,"target")}get contentWrapperElement(){return t(this,at)}get contentElement(){return t(this,f)}get sections(){return t(this,l)}get position(){return t(this,Se)}get contentPosition(){return t(this,pe)}get viewportSize(){return t(this,C)}get scrollSize(){return t(this,m)}get gap(){return t(this,k)}get counter(){return t(this,x)}get limit(){return Math.ceil(t(this,l).length-t(this,T).current)}get distance(){return t(this,N)}get loopDistance(){return t(this,v).current?t(this,N)+t(this,k):t(this,N)}get hasOverflow(){return t(this,U)}get overscroll(){return t(this,Ft)}get scrollLine(){return t(this,B)}get vertical(){return t(this,E).current==="y"}get currentProgress(){return this.currentScrollValue/this.loopDistance||0}get targetProgress(){return this.targetScrollValue/this.loopDistance||0}get scrollWidth(){return t(this,E).current==="y"?0:t(this,a).distance}get scrollHeight(){return t(this,E).current==="x"?0:t(this,a).distance}tryResplit(){!t(this,Z)&&(t(this,v).current||t(this,$).current||t(this,v).current||t(this,W).current||t(this,M).current)&&c(this,o,le).call(this)}onScroll(...e){return t(this,a).subscribe(...e)}offScroll(...e){t(this,a).unsubscribe(...e)}range(e,i,r=0){const u=e-r,b=u+i+r*2;return this.currentProgress<u?0:this.currentProgress>b?1:(this.currentProgress-u)/(b-u)}curve(e,i,r=0){return Math.sin(this.range(e,i,r)*Math.PI)}visible(e,i,r=0){const u=e-r,b=u+i+r*2;return this.currentProgress>=u&&this.currentProgress<=b}scrollToSection(e,i){if(!t(this,l).length)return;const r=t(this,x).current,u=c(this,o,Ge).call(this,e),b=t(this,l)[r],y=t(this,l)[u];if(b&&y){let I=0;const Ie=c(this,o,ce).call(this),Bt=t(this,l)[Ie];let ne=Bt?this.targetScrollValue-Bt.position:0;t(this,v).current?u===0&&r===t(this,l).length-1?(I=t(this,m)+t(this,C)-b.position+t(this,k),ne=0):u===t(this,l).length-1&&r===0?I=y.position-(t(this,m)+t(this,C)+t(this,k)):I=y.position-b.position:I=y.position-b.position,this.shiftPosition(I-ne,i)}}shiftSections(e,i){t(this,l).length&&this.scrollToSection(t(this,x).current+e,i)}setPosition(e,i){c(this,o,qe).call(this,Math.sign(e)||1),i!=null&&i.tween?t(this,St)||(t(this,j).set(t(this,a).current,{equalize:!0}),t(this,j).set(e,_e({},i.tween)),h(this,St,setTimeout(()=>{h(this,St,void 0)},i.tween.duration||0))):t(this,a).set(e,{equalize:(i==null?void 0:i.behaviour)==="instant"})}shiftPosition(e,i){this.setPosition(t(this,a).target+e,i)}resize(){if(t(this,ut).current)return;t(this,a).unlistenAnimationFrame();const e=this.currentScrollValue/t(this,m)||0,i=t(this,x).current;if(h(this,Se,this.vertical?Vt.getCumulativeOffsetTop(this):Vt.getCumulativeOffsetLeft(this)),h(this,pe,this.vertical?Vt.getCumulativeOffsetTop(t(this,f)):Vt.getCumulativeOffsetLeft(t(this,f))),h(this,C,this.vertical?this.offsetHeight:this.offsetWidth),this.vertical?h(this,k,$e.cssUnitParser.parse(getComputedStyle(t(this,f)).rowGap)):h(this,k,$e.cssUnitParser.parse(getComputedStyle(t(this,f)).columnGap)),t(this,W).current&&t(this,l).length){const r=t(this,T).current,u=(t(this,C)-t(this,k)*(r-1))/r;t(this,l).forEach(b=>{b.setSize(u)})}else t(this,l).forEach(r=>{r.setSize()});if(t(this,l).forEach(r=>{r.resize()}),t(this,_).current){h(this,m,t(this,C)*t(this,_).current);const r=t(this,m)+t(this,C);this.vertical?(t(this,f).style.width=r+"px",t(this,f).style.height="100%"):(t(this,f).style.height=r+"px",t(this,f).style.width="100%")}else this.vertical?(t(this,f).style.width="100%",t(this,f).style.height="max-content",h(this,m,t(this,f).offsetHeight-t(this,C))):(t(this,f).style.width="max-content",t(this,f).style.height="100%",h(this,m,t(this,f).offsetWidth-t(this,C)));if(!t(this,v).current){const r=getComputedStyle(this),u=this.vertical?parseFloat(r.paddingBlockStart)+parseFloat(r.paddingBlockEnd):parseFloat(r.paddingInlineStart)+parseFloat(r.paddingInlineEnd);h(this,m,t(this,m)+u),t(this,a).max=t(this,m)}if(t(this,v).current&&t(this,l).length){const r=t(this,l)[t(this,l).length-1],u=r.position+r.size-t(this,C),b=t(this,m)-u;h(this,N,r.position+r.size+b)}else h(this,N,t(this,m));if(t(this,M).current&&t(this,l).length){const r=t(this,l)[i];t(this,a).set(r.position,{equalize:!0})}else t(this,a).set(e*t(this,m),{equalize:!0});h(this,U,(this.vertical?t(this,f).offsetHeight:t(this,f).offsetWidth)>t(this,C)),this.classList.toggle("has-overflow",t(this,U)),t(this,U)?t(this,ct).current||c(this,o,Le).call(this):c(this,o,ze).call(this),t(this,me).call(this),he.dispatchEvent(this,"scrollResize",{custom:!0}),t(this,a).notify()}connectedCallback(){yt.scrollEntries.register(this),h(this,a,new ns.Damped(0,{damping:.01,min:0,order:xe.TICK_ORDER.SCROLL})),this.setAttribute("tabindex","0"),h(this,q,new Ee.WheelControls({element:t(this,f)})),t(this,q).changeEvent.subscribe(t(this,jt)),h(this,dt,new Ee.KeyboardControls({element:this})),t(this,dt).changeEvent.subscribe(t(this,jt)),h(this,D,new Ee.DragControls({element:t(this,f),rootElement:this})),t(this,D).changeEvent.subscribe(t(this,jt)),h(this,w,new Ee.AutoplayControls({culling:this})),t(this,w).changeEvent.subscribe(t(this,be)),t(this,E).subscribe(()=>{c(this,o,Re).call(this)}),t(this,st).subscribe(()=>{c(this,o,Re).call(this)}),t(this,nt).subscribe(e=>{t(this,q).axis=e.current?"max":t(this,E).current}),t(this,Et).subscribe(e=>{t(this,D).inertion=typeof e.current=="number"?e.current:1}),t(this,_).subscribe(()=>{t(this,P)&&t(this,z).call(this)}),t(this,$).subscribe(({current:e})=>{t(this,P)&&(e?c(this,o,le).call(this):c(this,o,Ot).call(this))}),t(this,M).subscribe(e=>{t(this,q).debounce=e.current,t(this,D).swipe=e.current,t(this,w).interval=e.current,t(this,P)&&(e.current&&!e.previous&&!t(this,l).length?c(this,o,le).call(this):!e.current&&e.previous&&t(this,l).length&&c(this,o,Ot).call(this))}),t(this,W).subscribe(e=>{t(this,P)&&(t(this,z).call(this),e.current&&!e.previous&&!t(this,l).length?c(this,o,le).call(this):!e.current&&e.previous&&t(this,l).length&&c(this,o,Ot).call(this))}),t(this,T).subscribe(e=>{t(this,P)&&(t(this,z).call(this),c(this,o,gt).call(this))}),t(this,v).subscribe(e=>{e.current?(t(this,P)&&(t(this,l).length||(t(this,$).current=!0)),t(this,a).max=1/0,t(this,a).min=-1/0):(h(this,Ft,0),t(this,a).max=t(this,m),t(this,a).min=0)}),t(this,xt).subscribe(e=>{t(this,a).damping=e.current}),t(this,zt).subscribe(e=>{t(this,a).mass=e.current}),t(this,Lt).subscribe(e=>{t(this,a).stiffness=e.current}),t(this,A).subscribe(e=>{t(this,w).speed=e.current,!t(this,G)&&e.current&&!e.previous?t(this,w).connect():!e.current&&e.previous&&t(this,w).disconnect()}),t(this,ht).subscribe(e=>{e.current||(t(this,w).direction=1)}),t(this,R).subscribe(e=>{t(this,P)&&c(this,o,gt).call(this)}),t(this,ot).subscribe(e=>{t(this,P)&&t(this,R).current&&c(this,o,gt).call(this)}),t(this,F).subscribe(e=>{t(this,P)&&t(this,R).current&&c(this,o,gt).call(this)}),t(this,Rt).subscribe(e=>{t(this,P)&&t(this,a).notify()}),t(this,a).isRunning.subscribe(e=>{this.classList.toggle("active",e.current)}),t(this,x).subscribe(e=>{t(this,l).length&&c(this,o,gt).call(this),this.style.setProperty("--counter",e.current+"")}),t(this,j).subscribe(e=>{t(this,j).isRunning.current&&t(this,a).set(e.current,{equalize:!0})}),t(this,ct).subscribe(e=>{e.current&&!e.previous?(this.classList.add("disabled"),c(this,o,ze).call(this)):!e.current&&e.previous&&(this.classList.remove("disabled"),c(this,o,Le).call(this))}),t(this,ut).subscribe(e=>{e.current&&!e.previous?(this.classList.add("hibernated"),c(this,o,Me).call(this)):!e.current&&e.previous&&(this.classList.remove("hibernated"),c(this,o,Te).call(this))}),t(this,wt).observe(),t(this,E).observe(),t(this,st).observe(),t(this,H).observe(),t(this,_).observe(),t(this,$).observe(),t(this,M).observe(),t(this,it).observe(),t(this,rt).observe(),t(this,W).observe(),t(this,nt).observe(),t(this,Et).observe(),t(this,T).observe(),t(this,v).observe(),t(this,xt).observe(),t(this,zt).observe(),t(this,Lt).observe(),t(this,It).observe(),t(this,$t).observe(),t(this,kt).observe(),t(this,A).observe(),t(this,A).observe(),t(this,At).observe(),t(this,ht).observe(),t(this,R).observe(),t(this,ot).observe(),t(this,F).observe(),t(this,Rt).observe(),t(this,lt).observe(),t(this,Mt).observe(),t(this,ct).observe(),t(this,ut).observe(),Ht.windowResizer.subscribe(t(this,ge),xe.RESIZE_ORDER.LAST),ue.elementResizer.subscribe(this,t(this,z)),t(this,Gt).observe(this,{childList:!0})}disconnectedCallback(){this.removeAttribute("tabindex"),this.classList.remove("disabled"),this.classList.remove("hibernated"),t(this,wt).unobserve(),t(this,E).unobserve(),t(this,st).unobserve(),t(this,H).unobserve(),t(this,_).unobserve(),t(this,$).unobserve(),t(this,M).unobserve(),t(this,it).unobserve(),t(this,rt).unobserve(),t(this,W).unobserve(),t(this,nt).unobserve(),t(this,Et).unobserve(),t(this,T).unobserve(),t(this,v).unobserve(),t(this,xt).unobserve(),t(this,zt).unobserve(),t(this,Lt).unobserve(),t(this,It).unobserve(),t(this,$t).unobserve(),t(this,kt).unobserve(),t(this,A).unobserve(),t(this,At).unobserve(),t(this,ht).unobserve(),t(this,R).unobserve(),t(this,ot).unobserve(),t(this,F).unobserve(),t(this,Rt).unobserve(),t(this,lt).unobserve(),t(this,Mt).unobserve(),t(this,ct).unobserve(),t(this,ut).unobserve(),Ht.windowResizer.unsubscribe(t(this,ge)),ue.elementResizer.unsubscribe(t(this,z)),c(this,o,Me).call(this),t(this,Gt).disconnect()}}a=new WeakMap,wt=new WeakMap,E=new WeakMap,st=new WeakMap,H=new WeakMap,_=new WeakMap,$=new WeakMap,M=new WeakMap,it=new WeakMap,rt=new WeakMap,W=new WeakMap,nt=new WeakMap,Et=new WeakMap,T=new WeakMap,v=new WeakMap,xt=new WeakMap,zt=new WeakMap,Lt=new WeakMap,It=new WeakMap,$t=new WeakMap,kt=new WeakMap,A=new WeakMap,At=new WeakMap,ht=new WeakMap,R=new WeakMap,ot=new WeakMap,F=new WeakMap,Rt=new WeakMap,lt=new WeakMap,Mt=new WeakMap,ct=new WeakMap,ut=new WeakMap,at=new WeakMap,f=new WeakMap,Wt=new WeakMap,l=new WeakMap,Se=new WeakMap,pe=new WeakMap,C=new WeakMap,m=new WeakMap,k=new WeakMap,q=new WeakMap,dt=new WeakMap,D=new WeakMap,w=new WeakMap,x=new WeakMap,Ft=new WeakMap,N=new WeakMap,U=new WeakMap,G=new WeakMap,Z=new WeakMap,Nt=new WeakMap,St=new WeakMap,j=new WeakMap,Ut=new WeakMap,B=new WeakMap,P=new WeakMap,Gt=new WeakMap,K=new WeakMap,Tt=new WeakMap,Zt=new WeakMap,o=new WeakSet,Re=function(){const e=t(this,E).current,i=t(this,st).current?"-reverse":"";t(this,f).style.flexDirection=e==="x"?`row${i}`:`column${i}`,t(this,q).axis=t(this,nt).current?"max":e,t(this,dt).dimension=e==="x"?"width":"height",t(this,D).axis=e,e==="x"?this.style.touchAction="pan-y":e==="y"&&(this.style.touchAction="pan-x"),t(this,P)&&t(this,z).call(this)},le=function(){c(this,o,Ot).call(this),t(this,Wt).assignedElements().forEach((e,i)=>{e instanceof HTMLElement&&t(this,l).push(new us(e,i,this))}),t(this,f).style.transform="",this.style.setProperty("--sections",t(this,l).length.toString()),he.dispatchEvent(this,"scrollSectionsChange",{custom:!0,composed:!0}),t(this,z).call(this),c(this,o,gt).call(this)},Ot=function(){t(this,l).forEach(e=>{e.destroy()}),h(this,l,[]),t(this,x).reset(),t(this,a).reset(),this.style.removeProperty("--max-section-size"),he.dispatchEvent(this,"scrollSectionsChange",{custom:!0,composed:!0})},ze=function(){t(this,G)||(h(this,G,!0),t(this,a).unsubscribe(t(this,fe)),t(this,a).unlistenAnimationFrame(),clearInterval(t(this,Nt)),clearInterval(t(this,St)),t(this,j).unlistenAnimationFrame(),t(this,q).disconnect(),t(this,dt).disconnect(),t(this,D).disconnect(),t(this,w).disconnect(),t(this,U)||(this.sections.forEach(e=>{e.unsetTransform()}),t(this,z).call(this)))},Le=function(){t(this,G)&&(h(this,G,!1),t(this,a).subscribe(t(this,fe),-1e4),t(this,a).notify(),t(this,q).connect(),t(this,dt).connect(),t(this,D).connect(),t(this,A).current&&t(this,w).connect())},Me=function(){t(this,Z)||(h(this,Z,!0),clearTimeout(t(this,Zt)),Ht.windowResizer.unsubscribe(t(this,z)),c(this,o,ze).call(this),t(this,f).style.transform="",t(this,f).style.height="",t(this,f).style.width="",this.classList.remove("has-overflow","start","end"),t(this,l).length?c(this,o,Ot).call(this):(t(this,x).reset(),t(this,a).reset()),yt.scrollEntries.unregister(this))},Te=function(){t(this,Z)&&(h(this,Z,!1),yt.scrollEntries.register(this),this.tryResplit(),c(this,o,Le).call(this),this.scrollToSection(t(this,kt).current,{behaviour:"instant"}),Ht.windowResizer.subscribe(t(this,z),xe.RESIZE_ORDER.SCROLL))},z=new WeakMap,fe=new WeakMap,Ge=function(e){let i=t(this,x).current;return t(this,v).current?i=Ne.loopNumber(e,t(this,l).length):i=Fe.clamp(e,0,this.limit),i},jt=new WeakMap,be=new WeakMap,qe=function(e=1){t(this,ht).current&&(t(this,w).direction=e),t(this,A).current&&t(this,w).pauseAndContinue(t(this,At).current,this.sectionalCSSProperty.current)},De=function(e="current"){if(t(this,v).current&&t(this,l).length){const i=t(this,a)[e]%Math.round(t(this,m)+t(this,C)+t(this,k));return i<0?t(this,m)+i+t(this,C)+t(this,k):i}else return t(this,a)[e]},gt=function(){if(t(this,l).length){const e=t(this,x).current+t(this,ot).current;if(e===0?h(this,B,"start"):e===this.limit?h(this,B,"end"):h(this,B,null),he.dispatchEvent(this,"scrollLine",{detail:{line:t(this,B)}}),t(this,R).current){this.classList.remove("end","start"),t(this,B)&&this.classList.add(t(this,B));const i=t(this,T).current+t(this,F).current;h(this,K,[]),t(this,l).forEach((r,u)=>{r.setCurrentIndex(null),r.setCurrentIndexArc(null),r.setCurrentIndexArcAbs(null),r.setMiddle(!1);const b=e-this.limit-1+t(this,F).current,y=e+i,I=this.sections.length-y;u>=e&&u<y||u<=b?(r.setMark("current"),t(this,K).push(r)):u>=y&&u<y+I/2||u<=b+i?r.setMark("next"):r.setMark("previous")}),t(this,me).call(this)}}},Ze=function(){if(t(this,R).current){const e=Math.floor(t(this,K).length/2);t(this,K).sort((i,r)=>i.element.getBoundingClientRect().left-r.element.getBoundingClientRect().left),t(this,K).forEach((i,r)=>{const u=r-e;i.setCurrentIndex(r),i.setCurrentIndexArc(u),i.setCurrentIndexArcAbs(Math.abs(u)),i.setMiddle(r===e)})}},me=new WeakMap,ce=function(e=!1){let i=this.targetScrollValue,r=1/0,u=0;const b=t(this,a).direction;for(let y=0;y<t(this,l).length;y++){const I=t(this,l)[y];let Ie=t(this,Ut)?I.size*b*-1*.4:0,Bt=I.position;this.overscroll&&Bt===0&&e&&(Bt=t(this,N));let ne=Math.abs(Bt+Ie-i);ne<=r&&(r=ne,u=y)}return u},ge=new WeakMap;O.isBrowser&&!customElements.get("e-scroll")&&customElements.define("e-scroll",Dt);var ye;class Be extends HTMLElement{constructor(){super(...arguments);s(this,ye,null)}get scrollElement(){return t(this,ye)}connectedCallback(){const e=Ue.findParentElement(this,Dt);e instanceof Dt?h(this,ye,e):console.error(this,"e-scroll not found")}}ye=new WeakMap;var pt,L,J,Q,Kt,Jt,ft,Qt,Ce,ve;class je extends Be{constructor(){super();s(this,pt,null);s(this,L,null);s(this,J,!1);s(this,Q,0);s(this,Kt,0);s(this,Jt,0);s(this,ft,()=>{h(this,J,this.offsetWidth>this.offsetHeight);const e=t(this,J)?this.offsetWidth:this.offsetHeight;h(this,Q,e/((this.scrollElement.scrollSize+this.scrollElement.viewportSize)/e)),h(this,Q,Math.max(t(this,Q),30)),t(this,J)?(t(this,L).style.width=t(this,Q)+"px",t(this,L).style.height="100%"):(t(this,L).style.width="100%",t(this,L).style.height=t(this,Q)+"px"),h(this,Kt,e-t(this,Q)),this.scrollElement.scrollSize<=0?this.style.display="none":this.style.display="",t(this,Qt).call(this)});s(this,Qt,()=>{h(this,Jt,this.scrollElement.currentProgress*t(this,Kt)),t(this,J)?t(this,L).style.transform=`translate3d(${t(this,Jt)}px, 0px, 0px)`:t(this,L).style.transform=`translate3d(0px, ${t(this,Jt)}px, 0px)`});s(this,Ce,()=>{this.setAttribute("axis",this.scrollElement.axisCSSProperty.current)});s(this,ve,e=>{document.documentElement.classList.add("grabbing"),ls.setupDrag(u=>{const b=t(this,J)?u.x:u.y,y=this.scrollElement.distance/t(this,Kt),I=(b-r)*y;this.scrollElement.setPosition(i+I)},()=>{document.documentElement.classList.remove("grabbing")});const i=this.scrollElement.damped.target,r=t(this,J)?e.x:e.y});if(O.isBrowser){const e=this.attachShadow({mode:"open"});e.adoptedStyleSheets=[We.createStylesheet({":host":{display:"inline-block",zIndex:"1",backgroundColor:"#ebebeb"},':host([axis="y"])':{position:"absolute",right:"0",top:"0",width:"1vmin",height:"100%"},':host([axis="x"])':{position:"absolute",left:"0",bottom:"0",width:"100%",height:"1vmin"},".default-thumb":{backgroundColor:"var(--thumb-color, black)",borderRadius:"var(--thumb-radius, 0px)",touchAction:"none"},"::slotted(*)":{touchAction:"none"}})],h(this,pt,document.createElement("slot")),t(this,pt).innerHTML='<div class="default-thumb"></div>',e.appendChild(t(this,pt))}}get thumbElement(){return t(this,L)}connectedCallback(){super.connectedCallback(),this.setAttribute("drag-dead-zone","");const e=t(this,pt).assignedElements()[0]||t(this,pt).firstElementChild;h(this,L,e),t(this,L).addEventListener("pointerdown",t(this,ve)),Ht.windowResizer.subscribe(t(this,ft),xe.RESIZE_ORDER.SCROLL),ue.elementResizer.subscribe(this,t(this,ft)),ue.elementResizer.subscribe(this.scrollElement,t(this,ft)),this.scrollElement.onScroll(t(this,Qt)),this.scrollElement.axisCSSProperty.subscribe(t(this,Ce))}disconnectedCallback(){this.removeAttribute("drag-dead-zone"),this.style.display="",t(this,L).removeEventListener("pointerdown",t(this,ve)),Ht.windowResizer.unsubscribe(t(this,ft)),ue.elementResizer.unsubscribe(t(this,ft)),this.scrollElement.offScroll(t(this,Qt)),this.scrollElement.axisCSSProperty.unsubscribe(t(this,Ce))}}pt=new WeakMap,L=new WeakMap,J=new WeakMap,Q=new WeakMap,Kt=new WeakMap,Jt=new WeakMap,ft=new WeakMap,Qt=new WeakMap,Ce=new WeakMap,ve=new WeakMap;O.isBrowser&&!customElements.get("e-scrollbar")&&customElements.define("e-scrollbar",je);var Xt,Yt,te;class Ke extends Be{constructor(){super();s(this,Xt,new d.CSSProperty(this,"--behaviour","smooth"));s(this,Yt,new d.CSSProperty(this,"--tween-easing",!1));s(this,te,new d.CSSProperty(this,"--tween-duration",0));O.isBrowser&&this.addEventListener("click",()=>{const e=t(this,Xt).current,i=t(this,Yt).current,r=t(this,te).current;this.handleClick({behaviour:e,tween:i||r?{easing:i,duration:r}:void 0})})}connectedCallback(){super.connectedCallback(),t(this,Xt).observe(),t(this,Yt).observe(),t(this,te).observe()}disconnectedCallback(){t(this,Xt).close(),t(this,Yt).close(),t(this,te).close()}}Xt=new WeakMap,Yt=new WeakMap,te=new WeakMap;var ee;class Je extends Ke{constructor(){super(...arguments);s(this,ee,new d.CSSProperty(this,"--set",1))}handleClick(e){this.scrollElement.scrollToSection(t(this,ee).current,e)}connectedCallback(){super.connectedCallback(),t(this,ee).observe()}disconnectedCallback(){super.disconnectedCallback(),t(this,ee).close()}}ee=new WeakMap;O.isBrowser&&!customElements.get("e-scroll-set-button")&&customElements.define("e-scroll-set-button",Je);var X,se;class Qe extends Ke{constructor(){super(...arguments);s(this,X,new d.CSSProperty(this,"--step",1));s(this,se,()=>{this.scrollElement.loopCSSProperty.current?this.removeAttribute("disabled"):t(this,X).current>0&&this.scrollElement.scrollLine==="end"||t(this,X).current<0&&this.scrollElement.scrollLine==="start"?this.setAttribute("disabled",""):this.removeAttribute("disabled")})}handleClick(e){this.scrollElement.shiftSections(t(this,X).current,e)}connectedCallback(){super.connectedCallback(),this.scrollElement&&(t(this,X).subscribe(()=>{t(this,se).call(this)}),t(this,X).observe(),this.scrollElement.addEventListener("scrollLine",t(this,se)),t(this,se).call(this))}disconnectedCallback(){super.disconnectedCallback(),t(this,X).close(),this.removeAttribute("disabled")}}X=new WeakMap,se=new WeakMap;O.isBrowser&&!customElements.get("e-scroll-step-button")&&customElements.define("e-scroll-step-button",Qe);var Y,bt,ie,Pe,we,re;class ds{constructor(n,e,i){s(this,Y,null);s(this,bt,null);s(this,ie,null);s(this,Pe,null);s(this,we,()=>{t(this,bt).scrollToSection(t(this,ie),{behaviour:t(this,Pe)})});s(this,re,()=>{t(this,Y).classList.toggle("current",t(this,bt).counter.current===t(this,ie))});O.isBrowser&&(h(this,Y,document.createElement("button")),h(this,bt,n),h(this,Pe,i),h(this,ie,e),t(this,Y).addEventListener("click",t(this,we)),t(this,bt).counter.subscribe(t(this,re)),t(this,re).call(this))}get element(){return t(this,Y)}destroy(){t(this,Y).removeEventListener("click",t(this,we)),t(this,bt).counter.unsubscribe(t(this,re)),t(this,Y).remove()}}Y=new WeakMap,bt=new WeakMap,ie=new WeakMap,Pe=new WeakMap,we=new WeakMap,re=new WeakMap;var qt,mt,tt;class Xe extends Be{constructor(){super(...arguments);s(this,qt,null);s(this,mt,[]);s(this,tt,Ae.debounce(()=>{t(this,mt).forEach(i=>i.destroy()),h(this,mt,[]);let e=0;this.scrollElement.loopCSSProperty.current?e=this.scrollElement.sections.length:e=this.scrollElement.sections.length-Math.max(this.scrollElement.sectionsInViewCSSProperty.current-1,0);for(let i=0;i<e;i++){const r=new ds(this.scrollElement,i,this.getAttribute("behaviour")||"smooth");t(this,qt).appendChild(r.element),t(this,mt).push(r)}},0))}connectedCallback(){super.connectedCallback(),this.innerHTML="",this.scrollElement.addEventListener("scrollSectionsChange",t(this,tt)),this.scrollElement.sectionsInViewCSSProperty.subscribe(t(this,tt)),this.scrollElement.loopCSSProperty.subscribe(t(this,tt)),h(this,qt,document.createElement("div")),this.appendChild(t(this,qt))}disconnectedCallback(){this.scrollElement.removeEventListener("scrollSectionsChange",t(this,tt)),this.scrollElement.sectionsInViewCSSProperty.unsubscribe(t(this,tt)),this.scrollElement.loopCSSProperty.unsubscribe(t(this,tt)),t(this,mt).forEach(e=>e.destroy()),h(this,mt,[]),t(this,qt).remove()}}qt=new WeakMap,mt=new WeakMap,tt=new WeakMap;O.isBrowser&&!customElements.get("e-scroll-bullet-buttons")&&customElements.define("e-scroll-bullet-buttons",Xe);class Ye extends cs.ScrollSegmentElement{connectedCallback(){const n=Ue.findParentElement(this,Dt);n instanceof Dt?(this.scrollContainer=n,this.scrollContainer.addEventListener("scrollSectionsChange",this.findAnotherScrollEntries),this.scrollContainer.addEventListener("scrollResize",this.resize),this.resize()):console.error(this,"e-scroll not found")}disconnectedCallback(){super.disconnectedCallback(),this.scrollContainer instanceof Dt&&(this.scrollContainer.removeEventListener("scrollSectionsChange",this.findAnotherScrollEntries),this.scrollContainer.removeEventListener("scrollResize",this.resize))}}O.isBrowser&&!customElements.get("e-scroll-segment")&&customElements.define("e-scroll-segment",Ye);exports.ScrollBulletButtonsElement=Xe;exports.ScrollElement=Dt;exports.ScrollSegmentElement=Ye;exports.ScrollSetButtonElement=Je;exports.ScrollStepButtonElement=Qe;exports.ScrollbarElement=je;
|
|
1
|
+
"use strict";var ts=Object.defineProperty;var Oe=Object.getOwnPropertySymbols;var es=Object.prototype.hasOwnProperty,ss=Object.prototype.propertyIsEnumerable;var He=S=>{throw TypeError(S)};var Ve=(S,n,e)=>n in S?ts(S,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):S[n]=e,_e=(S,n)=>{for(var e in n||(n={}))es.call(n,e)&&Ve(S,e,n[e]);if(Oe)for(var e of Oe(n))ss.call(n,e)&&Ve(S,e,n[e]);return S};var ke=(S,n,e)=>n.has(S)||He("Cannot "+e);var t=(S,n,e)=>(ke(S,n,"read from private field"),e?e.call(S):n.get(S)),s=(S,n,e)=>n.has(S)?He("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(S):n.set(S,e),h=(S,n,e,i)=>(ke(S,n,"write to private field"),i?i.call(S,e):n.set(S,e),e),c=(S,n,e)=>(ke(S,n,"access private method"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const is=require("../Store-GokLe_g-.cjs"),O=require("../index-Cqw2NKev.cjs"),rs=require("../easings-GegIwET5.cjs"),he=require("../events-KVanG9sR.cjs"),Ae=require("../function-MthRj-GJ.cjs"),We=require("../jss-CRBgdvJ3.cjs"),Ht=require("../layout-Ctc2p3uz.cjs"),Fe=require("../math-GDWEqu7y.cjs"),Ne=require("../number-DyefJ5a1.cjs");require("../ticker/index.cjs");const xe=require("../order/index.cjs"),ns=require("../Damped-B8bmTxAr.cjs"),hs=require("../Tweened-BsL9FamJ.cjs"),Ee=require("../controls/index.cjs"),_t=require("../window-resizer/index.cjs"),yt=require("../scroll-entries/index.cjs"),$e=require("../css-unit-parser/index.cjs"),d=require("../css-property/index.cjs"),os=require("../device/index.cjs"),ue=require("../element-resizer/index.cjs"),ls=require("../gestures-C7gbKx11.cjs"),Ue=require("../dom-JBOkFLTh.cjs"),cs=require("../scroll-segment/index.cjs");var p,$t,g,ae,de,Ct,V,et,vt,Pt,oe;class us{constructor(n,e,i){s(this,Pt);s(this,p);s(this,$t);s(this,g);s(this,ae,0);s(this,de,0);s(this,Ct,0);s(this,V,0);s(this,et,null);s(this,vt,0);h(this,p,n),h(this,$t,e),h(this,g,i),yt.scrollEntries.register(t(this,p)),this.setIndex(t(this,$t))}get element(){return t(this,p)}get index(){return t(this,$t)}get size(){return t(this,Ct)}get width(){return t(this,ae)}get height(){return t(this,de)}get position(){return t(this,V)}get transformPosition(){return t(this,vt)}destroy(){yt.scrollEntries.unregister(t(this,p)),this.unsetTransform()}unsetTransform(){t(this,p).style.transform="",this.setMark(null),this.setIndex(null),this.setCurrentIndex(null),this.setCurrentIndexArc(null),this.setCurrentIndexArcAbs(null),this.setMiddle(!1),this.setSize()}setSize(n){n?(t(this,p).style.setProperty("--size",n+"px"),t(this,g).axisCSSProperty.current==="x"?(t(this,p).style.width=n+"px",t(this,p).style.height=""):(t(this,p).style.height=n+"px",t(this,p).style.width="")):(t(this,p).style.width="",t(this,p).style.height="",t(this,p).style.removeProperty("--size"))}resize(){h(this,ae,t(this,p).offsetWidth),h(this,de,t(this,p).offsetHeight),h(this,Ct,t(this,g).vertical?t(this,p).offsetHeight:t(this,p).offsetWidth),h(this,V,t(this,g).vertical?Ht.getCumulativeOffsetTop(t(this,p)):Ht.getCumulativeOffsetLeft(t(this,p))),h(this,V,t(this,V)-t(this,g).contentPosition)}transform(){const n=t(this,g).shiftSectionPositionCSSProperty.current;let e=n;const i=t(this,g).viewportSize*t(this,g).sectionDistanceScaleCSSProperty.current;t(this,g).loopCSSProperty.current&&t(this,V)+t(this,Ct)<=t(this,g).currentScrollValue-n/2&&(e=(t(this,g).distance-n)*-1-t(this,g).gap),yt.scrollEntries.update(t(this,p),t(this,g).axisCSSProperty.current,e);const r=t(this,g).currentScrollValue+e,u=t(this,V)-t(this,g).viewportSize-i,b=t(this,V)+t(this,Ct)+i,y=Ne.preciseNumber(Fe.clamp(r,u,b),3);h(this,vt,y*-1),t(this,g).vertical?t(this,p).style.transform=`translate3d(0px, ${t(this,vt)}px, 0px)`:t(this,p).style.transform=`translate3d(${t(this,vt)}px, 0px, 0px)`}setMark(n){t(this,et)!==n&&(t(this,et)&&t(this,p).classList.remove(t(this,et)),n&&t(this,p).classList.add(n),h(this,et,n),he.dispatchEvent(t(this,p),"scrollSectionMarkChange",{composed:!0,detail:{mark:t(this,et)},custom:!0}))}setMiddle(n){t(this,p).classList.toggle("middle",n)}setIndex(n){c(this,Pt,oe).call(this,"index",n)}setCurrentIndex(n){c(this,Pt,oe).call(this,"current-index",n)}setCurrentIndexArc(n){c(this,Pt,oe).call(this,"current-index-arc",n)}setCurrentIndexArcAbs(n){c(this,Pt,oe).call(this,"current-index-arc-abs",n)}}p=new WeakMap,$t=new WeakMap,g=new WeakMap,ae=new WeakMap,de=new WeakMap,Ct=new WeakMap,V=new WeakMap,et=new WeakMap,vt=new WeakMap,Pt=new WeakSet,oe=function(n,e){e!==null?(t(this,p).style.setProperty(`--${n}`,e.toString()),t(this,p).setAttribute(`data-${n}`,e.toString())):(t(this,p).style.removeProperty(`--${n}`),t(this,p).removeAttribute(`data-${n}`))};const as=We.createStylesheet({":host":{position:"relative",width:"100%",height:"100%",display:"block",outline:"none"},".static":{position:"var(--static-position, absolute)",top:"var(--static-top, 0)",left:"var(--static-left, 0)",width:"var(--static-width, 100%)",height:"var(--static-height, 100%)"},".content-wrapper":{width:"var(--content-wrapper-width, 100%)",height:"var(--content-wrapper-height, 100%)",overflow:"var(--overflow, initial)",borderRadius:"var(--border-radius, unset)"},".content":{position:"relative",display:"flex",width:"100%",height:"100%",gap:"var(--gap, 0px)",willChange:"var(--will-change, transform)"},":host(.hibernated) .content-wrapper":{display:"contents"},":host(.hibernated) .content":{display:"contents"},"::slotted(*)":{flexShrink:"0"}});var a,wt,E,st,H,_,$,M,it,rt,W,nt,Et,T,v,xt,zt,Lt,It,Wt,kt,A,At,ht,R,ot,F,Rt,lt,Mt,ct,ut,at,f,Ft,l,Se,pe,C,m,k,q,dt,D,w,x,Nt,N,U,G,Z,Ut,St,j,Tt,B,P,Gt,K,qt,Zt,o,Re,le,Vt,ze,Le,Me,Te,z,fe,Ge,jt,be,qe,De,gt,Ze,me,ce,ge;class Bt extends HTMLElement{constructor(){super();s(this,o);s(this,a,null);s(this,wt,new d.CSSProperty(this,"--controls",!0));s(this,E,new d.CSSProperty(this,"--axis","y"));s(this,st,new d.CSSProperty(this,"--reverse",!1));s(this,H,new d.CSSProperty(this,"--direction",0));s(this,_,new d.CSSProperty(this,"--pages",0,{validate:e=>Math.max(0,e-1)}));s(this,$,new d.CSSProperty(this,"--split",!1));s(this,M,new d.CSSProperty(this,"--sectional",!1));s(this,it,new d.CSSProperty(this,"--tween-easing",!1));s(this,rt,new d.CSSProperty(this,"--tween-duration",!1));s(this,W,new d.CSSProperty(this,"--auto-size",!1));s(this,nt,new d.CSSProperty(this,"--wheel-max-delta",!1));s(this,Et,new d.CSSProperty(this,"--drag-inertion",1));s(this,T,new d.CSSProperty(this,"--sections-in-view",1));s(this,v,new d.CSSProperty(this,"--loop",!1));s(this,xt,new d.CSSProperty(this,"--damping",20));s(this,zt,new d.CSSProperty(this,"--mass",0));s(this,Lt,new d.CSSProperty(this,"--stiffness",0));s(this,It,new d.CSSProperty(this,"--mouse-drag",!1));s(this,Wt,new d.CSSProperty(this,"--section-distance-scale",.5));s(this,kt,new d.CSSProperty(this,"--start-section",0));s(this,A,new d.CSSProperty(this,"--autoplay",0));s(this,At,new d.CSSProperty(this,"--autoplay-pause-duration",0));s(this,ht,new d.CSSProperty(this,"--autoplay-user-direction",!1));s(this,R,new d.CSSProperty(this,"--classes",!1));s(this,ot,new d.CSSProperty(this,"--current-index-start-offset",0));s(this,F,new d.CSSProperty(this,"--current-index-end-offset",0));s(this,Rt,new d.CSSProperty(this,"--shift-section-position",0,{rawValueCheck:!1}));s(this,lt,new d.CSSProperty(this,"--focus-delay",0));s(this,Mt,new d.CSSProperty(this,"--focus-duration",3e3));s(this,ct,new d.CSSProperty(this,"--disabled",!1));s(this,ut,new d.CSSProperty(this,"--hibernate",!1));s(this,at,null);s(this,f,null);s(this,Ft,null);s(this,l,[]);s(this,Se,0);s(this,pe,0);s(this,C,0);s(this,m,0);s(this,k,0);s(this,q,null);s(this,dt,null);s(this,D,null);s(this,w,null);s(this,x,new is.Store(0));s(this,Nt,0);s(this,N,0);s(this,U,!1);s(this,G,!0);s(this,Z,!0);s(this,Ut);s(this,St);s(this,j,new hs.Tweened);s(this,Tt,!1);s(this,B,null);s(this,P,!1);s(this,Gt,null);s(this,K,[]);s(this,qt,!1);s(this,Zt);s(this,z,e=>{if(e&&t(this,qt)){h(this,qt,!1);return}this.resize()});s(this,fe,()=>{if(!t(this,U)||t(this,Z)||t(this,G))return;const e=this.currentScrollValue;if(h(this,Nt,Math.max(0,e-t(this,m))),t(this,l).length){for(let i=0;i<t(this,l).length;i++)t(this,l)[i].transform();t(this,x).current=c(this,o,ce).call(this)}else this.vertical?t(this,f).style.transform=`translate3d(0px, ${e*-1}px, 0px)`:t(this,f).style.transform=`translate3d(${e*-1}px, 0px, 0px)`;c(this,o,Ze).call(this),yt.scrollEntries.update(this,t(this,E).current,e)});s(this,jt,(e,i)=>{t(this,wt).current&&(c(this,o,qe).call(this,Math.sign(i)||1),t(this,be).call(this,e,i))});s(this,be,(e,i)=>{if(t(this,H).current){if(t(this,H).current<0&&i>0)return;if(t(this,H).current>0&&i<0)return}if(t(this,St)||t(this,j).unlistenAnimationFrame(),!t(this,A).current&&t(this,lt).current&&(clearInterval(t(this,Ut)),h(this,Ut,setTimeout(()=>{const r=t(this,l)[c(this,o,ce).call(this)];r&&this.scrollToSection(r.index,{tween:{duration:t(this,Mt).current,easing:rs.easeInOutExpo}})},t(this,lt).current))),!(e.includes("drag")&&!os.device.isTouch&&!t(this,It).current)){if(t(this,M).current&&e!=="drag"){const r=Math.sign(i);if(t(this,l).length){const u={tween:t(this,it).current||t(this,rt).current?{easing:t(this,it).current||"easeInOutCubic",duration:t(this,rt).current||500}:void 0};t(this,Tt)?this.scrollToSection(c(this,o,ce).call(this,!0),u):this.shiftSections(r,u)}else t(this,a).shift(r*t(this,C))}else t(this,a).shift(i);h(this,Tt,e==="drag")}});s(this,me,Ae.debounce(()=>{const e=t(this,K).reduce((i,r)=>{const u=this.vertical?r.width:r.height;return u>i?u:i},0);clearTimeout(t(this,Zt)),h(this,qt,!0),this.style.setProperty("--max-section-size",""),h(this,Zt,setTimeout(()=>{h(this,qt,!0),this.style.setProperty("--max-section-size",e+"px")},10))},20));s(this,ge,()=>{h(this,P,!0),this.hibernatedCSSProperty.current||c(this,o,Te).call(this)});if(O.isBrowser){const e=this.attachShadow({mode:"open"});e.adoptedStyleSheets=[as];const i=document.createElement("div");i.className="static",i.innerHTML='<slot name="static"></slot>',e.appendChild(i),h(this,at,document.createElement("div")),t(this,at).className="content-wrapper",h(this,f,document.createElement("div")),t(this,f).className="content",h(this,Ft,document.createElement("slot")),t(this,f).appendChild(t(this,Ft)),t(this,at).appendChild(t(this,f)),e.appendChild(t(this,at)),h(this,Gt,new MutationObserver(Ae.debounce(()=>{this.tryResplit()},10)))}}get damped(){return t(this,a)}get controlsCSSProperty(){return t(this,wt)}get axisCSSProperty(){return t(this,E)}get reverseCSSProperty(){return t(this,st)}get directionCSSProperty(){return t(this,H)}get pagesCSSProperty(){return t(this,_)}get splitCSSProperty(){return t(this,$)}get sectionalCSSProperty(){return t(this,M)}get easingCSSProperty(){return t(this,it)}get durationCSSProperty(){return t(this,rt)}get autoSizeCSSProperty(){return t(this,W)}get wheelMaxDeltaCSSProperty(){return t(this,nt)}get dragInertionCSSProperty(){return t(this,Et)}get sectionsInViewCSSProperty(){return t(this,T)}get loopCSSProperty(){return t(this,v)}get dampingCSSProperty(){return t(this,xt)}get massCSSProperty(){return t(this,zt)}get stiffnessCSSProperty(){return t(this,Lt)}get mouseDragCSSProperty(){return t(this,It)}get sectionDistanceScaleCSSProperty(){return t(this,Wt)}get startSectionCSSProperty(){return t(this,kt)}get autoplayCSSProperty(){return t(this,A)}get autoplayPauseDurationCSSProperty(){return t(this,At)}get autoplayUserDirectionCSSProperty(){return t(this,ht)}get classesCSSProperty(){return t(this,R)}get currentIndexStartOffsetCSSProperty(){return t(this,ot)}get currentIndexEndOffsetCSSProperty(){return t(this,F)}get shiftSectionPositionCSSProperty(){return t(this,Rt)}get focusDelayCSSProperty(){return t(this,lt)}get focusDurationCSSProperty(){return t(this,Mt)}get disabledCSSProperty(){return t(this,ct)}get hibernatedCSSProperty(){return t(this,ut)}get currentScrollValue(){return c(this,o,De).call(this,"current")}get targetScrollValue(){return c(this,o,De).call(this,"target")}get contentWrapperElement(){return t(this,at)}get contentElement(){return t(this,f)}get sections(){return t(this,l)}get position(){return t(this,Se)}get contentPosition(){return t(this,pe)}get viewportSize(){return t(this,C)}get scrollSize(){return t(this,m)}get gap(){return t(this,k)}get counter(){return t(this,x)}get limit(){return Math.ceil(t(this,l).length-t(this,T).current)}get distance(){return t(this,N)}get loopDistance(){return t(this,v).current?t(this,N)+t(this,k):t(this,N)}get hasOverflow(){return t(this,U)}get overscroll(){return t(this,Nt)}get scrollLine(){return t(this,B)}get vertical(){return t(this,E).current==="y"}get currentProgress(){return this.currentScrollValue/this.loopDistance||0}get targetProgress(){return this.targetScrollValue/this.loopDistance||0}get scrollWidth(){return t(this,E).current==="y"?0:t(this,a).distance}get scrollHeight(){return t(this,E).current==="x"?0:t(this,a).distance}tryResplit(){!t(this,Z)&&(t(this,v).current||t(this,$).current||t(this,v).current||t(this,W).current||t(this,M).current)&&c(this,o,le).call(this)}onScroll(...e){return t(this,a).subscribe(...e)}offScroll(...e){t(this,a).unsubscribe(...e)}range(e,i,r=0){const u=e-r,b=u+i+r*2;return this.currentProgress<u?0:this.currentProgress>b?1:(this.currentProgress-u)/(b-u)}curve(e,i,r=0){return Math.sin(this.range(e,i,r)*Math.PI)}visible(e,i,r=0){const u=e-r,b=u+i+r*2;return this.currentProgress>=u&&this.currentProgress<=b}scrollToSection(e,i){if(!t(this,l).length)return;const r=t(this,x).current,u=c(this,o,Ge).call(this,e),b=t(this,l)[r],y=t(this,l)[u];if(b&&y){let I=0;const Ie=c(this,o,ce).call(this),Ot=t(this,l)[Ie];let ne=Ot?this.targetScrollValue-Ot.position:0;t(this,v).current?u===0&&r===t(this,l).length-1?(I=t(this,m)+t(this,C)-b.position+t(this,k),t(this,Tt)||(ne=0)):u===t(this,l).length-1&&r===0?I=y.position-(t(this,m)+t(this,C)+t(this,k)):I=y.position-b.position:I=y.position-b.position,this.shiftPosition(I-ne,i)}}shiftSections(e,i){t(this,l).length&&this.scrollToSection(t(this,x).current+e,i)}setPosition(e,i){c(this,o,qe).call(this,Math.sign(e)||1),i!=null&&i.tween?t(this,St)||(t(this,j).set(t(this,a).current,{equalize:!0}),t(this,j).set(e,_e({},i.tween)),h(this,St,setTimeout(()=>{h(this,St,void 0)},i.tween.duration||0))):t(this,a).set(e,{equalize:(i==null?void 0:i.behaviour)==="instant"})}shiftPosition(e,i){this.setPosition(t(this,a).target+e,i)}resize(){if(t(this,ut).current)return;t(this,a).unlistenAnimationFrame();const e=this.currentScrollValue/t(this,m)||0,i=t(this,x).current;if(h(this,Se,this.vertical?Ht.getCumulativeOffsetTop(this):Ht.getCumulativeOffsetLeft(this)),h(this,pe,this.vertical?Ht.getCumulativeOffsetTop(t(this,f)):Ht.getCumulativeOffsetLeft(t(this,f))),h(this,C,this.vertical?this.offsetHeight:this.offsetWidth),this.vertical?h(this,k,$e.cssUnitParser.parse(getComputedStyle(t(this,f)).rowGap)):h(this,k,$e.cssUnitParser.parse(getComputedStyle(t(this,f)).columnGap)),t(this,W).current&&t(this,l).length){const r=t(this,T).current,u=(t(this,C)-t(this,k)*(r-1))/r;t(this,l).forEach(b=>{b.setSize(u)})}else t(this,l).forEach(r=>{r.setSize()});if(t(this,l).forEach(r=>{r.resize()}),t(this,_).current){h(this,m,t(this,C)*t(this,_).current);const r=t(this,m)+t(this,C);this.vertical?(t(this,f).style.width=r+"px",t(this,f).style.height="100%"):(t(this,f).style.height=r+"px",t(this,f).style.width="100%")}else this.vertical?(t(this,f).style.width="100%",t(this,f).style.height="max-content",h(this,m,t(this,f).offsetHeight-t(this,C))):(t(this,f).style.width="max-content",t(this,f).style.height="100%",h(this,m,t(this,f).offsetWidth-t(this,C)));if(!t(this,v).current){const r=getComputedStyle(this),u=this.vertical?parseFloat(r.paddingBlockStart)+parseFloat(r.paddingBlockEnd):parseFloat(r.paddingInlineStart)+parseFloat(r.paddingInlineEnd);h(this,m,t(this,m)+u),t(this,a).max=t(this,m)}if(t(this,v).current&&t(this,l).length){const r=t(this,l)[t(this,l).length-1],u=r.position+r.size-t(this,C),b=t(this,m)-u;h(this,N,r.position+r.size+b)}else h(this,N,t(this,m));if(t(this,M).current&&t(this,l).length){const r=t(this,l)[i];t(this,a).set(r.position,{equalize:!0})}else t(this,a).set(e*t(this,m),{equalize:!0});h(this,U,(this.vertical?t(this,f).offsetHeight:t(this,f).offsetWidth)>t(this,C)),this.classList.toggle("has-overflow",t(this,U)),t(this,U)?t(this,ct).current||c(this,o,Le).call(this):c(this,o,ze).call(this),t(this,me).call(this),he.dispatchEvent(this,"scrollResize",{custom:!0}),t(this,a).notify()}connectedCallback(){yt.scrollEntries.register(this),h(this,a,new ns.Damped(0,{damping:.01,min:0,order:xe.TICK_ORDER.SCROLL})),this.setAttribute("tabindex","0"),h(this,q,new Ee.WheelControls({element:t(this,f)})),t(this,q).changeEvent.subscribe(t(this,jt)),h(this,dt,new Ee.KeyboardControls({element:this})),t(this,dt).changeEvent.subscribe(t(this,jt)),h(this,D,new Ee.DragControls({element:t(this,f),rootElement:this})),t(this,D).changeEvent.subscribe(t(this,jt)),h(this,w,new Ee.AutoplayControls({culling:this})),t(this,w).changeEvent.subscribe(t(this,be)),t(this,E).subscribe(()=>{c(this,o,Re).call(this)}),t(this,st).subscribe(()=>{c(this,o,Re).call(this)}),t(this,nt).subscribe(e=>{t(this,q).axis=e.current?"max":t(this,E).current}),t(this,Et).subscribe(e=>{t(this,D).inertion=typeof e.current=="number"?e.current:1}),t(this,_).subscribe(()=>{t(this,P)&&t(this,z).call(this)}),t(this,$).subscribe(({current:e})=>{t(this,P)&&(e?c(this,o,le).call(this):c(this,o,Vt).call(this))}),t(this,M).subscribe(e=>{t(this,q).debounce=e.current,t(this,D).swipe=e.current,t(this,w).interval=e.current,t(this,P)&&(e.current&&!e.previous&&!t(this,l).length?c(this,o,le).call(this):!e.current&&e.previous&&t(this,l).length&&c(this,o,Vt).call(this))}),t(this,W).subscribe(e=>{t(this,P)&&(t(this,z).call(this),e.current&&!e.previous&&!t(this,l).length?c(this,o,le).call(this):!e.current&&e.previous&&t(this,l).length&&c(this,o,Vt).call(this))}),t(this,T).subscribe(e=>{t(this,P)&&(t(this,z).call(this),c(this,o,gt).call(this))}),t(this,v).subscribe(e=>{e.current?(t(this,P)&&(t(this,l).length||(t(this,$).current=!0)),t(this,a).max=1/0,t(this,a).min=-1/0):(h(this,Nt,0),t(this,a).max=t(this,m),t(this,a).min=0)}),t(this,xt).subscribe(e=>{t(this,a).damping=e.current}),t(this,zt).subscribe(e=>{t(this,a).mass=e.current}),t(this,Lt).subscribe(e=>{t(this,a).stiffness=e.current}),t(this,A).subscribe(e=>{t(this,w).speed=e.current,!t(this,G)&&e.current&&!e.previous?t(this,w).connect():!e.current&&e.previous&&t(this,w).disconnect()}),t(this,ht).subscribe(e=>{e.current||(t(this,w).direction=1)}),t(this,R).subscribe(e=>{t(this,P)&&c(this,o,gt).call(this)}),t(this,ot).subscribe(e=>{t(this,P)&&t(this,R).current&&c(this,o,gt).call(this)}),t(this,F).subscribe(e=>{t(this,P)&&t(this,R).current&&c(this,o,gt).call(this)}),t(this,Rt).subscribe(e=>{t(this,P)&&t(this,a).notify()}),t(this,a).isRunning.subscribe(e=>{this.classList.toggle("active",e.current)}),t(this,x).subscribe(e=>{t(this,l).length&&c(this,o,gt).call(this),this.style.setProperty("--counter",e.current+"")}),t(this,j).subscribe(e=>{t(this,j).isRunning.current&&t(this,a).set(e.current,{equalize:!0})}),t(this,ct).subscribe(e=>{e.current&&!e.previous?(this.classList.add("disabled"),c(this,o,ze).call(this)):!e.current&&e.previous&&(this.classList.remove("disabled"),c(this,o,Le).call(this))}),t(this,ut).subscribe(e=>{e.current&&!e.previous?(this.classList.add("hibernated"),c(this,o,Me).call(this)):!e.current&&e.previous&&(this.classList.remove("hibernated"),c(this,o,Te).call(this))}),t(this,wt).observe(),t(this,E).observe(),t(this,st).observe(),t(this,H).observe(),t(this,_).observe(),t(this,$).observe(),t(this,M).observe(),t(this,it).observe(),t(this,rt).observe(),t(this,W).observe(),t(this,nt).observe(),t(this,Et).observe(),t(this,T).observe(),t(this,v).observe(),t(this,xt).observe(),t(this,zt).observe(),t(this,Lt).observe(),t(this,It).observe(),t(this,Wt).observe(),t(this,kt).observe(),t(this,A).observe(),t(this,A).observe(),t(this,At).observe(),t(this,ht).observe(),t(this,R).observe(),t(this,ot).observe(),t(this,F).observe(),t(this,Rt).observe(),t(this,lt).observe(),t(this,Mt).observe(),t(this,ct).observe(),t(this,ut).observe(),_t.windowResizer.subscribe(t(this,ge),xe.RESIZE_ORDER.LAST),ue.elementResizer.subscribe(this,t(this,z)),t(this,Gt).observe(this,{childList:!0})}disconnectedCallback(){this.removeAttribute("tabindex"),this.classList.remove("disabled"),this.classList.remove("hibernated"),t(this,wt).unobserve(),t(this,E).unobserve(),t(this,st).unobserve(),t(this,H).unobserve(),t(this,_).unobserve(),t(this,$).unobserve(),t(this,M).unobserve(),t(this,it).unobserve(),t(this,rt).unobserve(),t(this,W).unobserve(),t(this,nt).unobserve(),t(this,Et).unobserve(),t(this,T).unobserve(),t(this,v).unobserve(),t(this,xt).unobserve(),t(this,zt).unobserve(),t(this,Lt).unobserve(),t(this,It).unobserve(),t(this,Wt).unobserve(),t(this,kt).unobserve(),t(this,A).unobserve(),t(this,At).unobserve(),t(this,ht).unobserve(),t(this,R).unobserve(),t(this,ot).unobserve(),t(this,F).unobserve(),t(this,Rt).unobserve(),t(this,lt).unobserve(),t(this,Mt).unobserve(),t(this,ct).unobserve(),t(this,ut).unobserve(),_t.windowResizer.unsubscribe(t(this,ge)),ue.elementResizer.unsubscribe(t(this,z)),c(this,o,Me).call(this),t(this,Gt).disconnect()}}a=new WeakMap,wt=new WeakMap,E=new WeakMap,st=new WeakMap,H=new WeakMap,_=new WeakMap,$=new WeakMap,M=new WeakMap,it=new WeakMap,rt=new WeakMap,W=new WeakMap,nt=new WeakMap,Et=new WeakMap,T=new WeakMap,v=new WeakMap,xt=new WeakMap,zt=new WeakMap,Lt=new WeakMap,It=new WeakMap,Wt=new WeakMap,kt=new WeakMap,A=new WeakMap,At=new WeakMap,ht=new WeakMap,R=new WeakMap,ot=new WeakMap,F=new WeakMap,Rt=new WeakMap,lt=new WeakMap,Mt=new WeakMap,ct=new WeakMap,ut=new WeakMap,at=new WeakMap,f=new WeakMap,Ft=new WeakMap,l=new WeakMap,Se=new WeakMap,pe=new WeakMap,C=new WeakMap,m=new WeakMap,k=new WeakMap,q=new WeakMap,dt=new WeakMap,D=new WeakMap,w=new WeakMap,x=new WeakMap,Nt=new WeakMap,N=new WeakMap,U=new WeakMap,G=new WeakMap,Z=new WeakMap,Ut=new WeakMap,St=new WeakMap,j=new WeakMap,Tt=new WeakMap,B=new WeakMap,P=new WeakMap,Gt=new WeakMap,K=new WeakMap,qt=new WeakMap,Zt=new WeakMap,o=new WeakSet,Re=function(){const e=t(this,E).current,i=t(this,st).current?"-reverse":"";t(this,f).style.flexDirection=e==="x"?`row${i}`:`column${i}`,t(this,q).axis=t(this,nt).current?"max":e,t(this,dt).dimension=e==="x"?"width":"height",t(this,D).axis=e,e==="x"?this.style.touchAction="pan-y":e==="y"&&(this.style.touchAction="pan-x"),t(this,P)&&t(this,z).call(this)},le=function(){c(this,o,Vt).call(this),t(this,Ft).assignedElements().forEach((e,i)=>{e instanceof HTMLElement&&t(this,l).push(new us(e,i,this))}),t(this,f).style.transform="",this.style.setProperty("--sections",t(this,l).length.toString()),he.dispatchEvent(this,"scrollSectionsChange",{custom:!0,composed:!0}),t(this,z).call(this),c(this,o,gt).call(this)},Vt=function(){t(this,l).forEach(e=>{e.destroy()}),h(this,l,[]),t(this,x).reset(),t(this,a).reset(),this.style.removeProperty("--max-section-size"),he.dispatchEvent(this,"scrollSectionsChange",{custom:!0,composed:!0})},ze=function(){t(this,G)||(h(this,G,!0),t(this,a).unsubscribe(t(this,fe)),t(this,a).unlistenAnimationFrame(),clearInterval(t(this,Ut)),clearInterval(t(this,St)),t(this,j).unlistenAnimationFrame(),t(this,q).disconnect(),t(this,dt).disconnect(),t(this,D).disconnect(),t(this,w).disconnect(),t(this,U)||(this.sections.forEach(e=>{e.unsetTransform()}),t(this,z).call(this)))},Le=function(){t(this,G)&&(h(this,G,!1),t(this,a).subscribe(t(this,fe),-1e4),t(this,a).notify(),t(this,q).connect(),t(this,dt).connect(),t(this,D).connect(),t(this,A).current&&t(this,w).connect())},Me=function(){t(this,Z)||(h(this,Z,!0),clearTimeout(t(this,Zt)),_t.windowResizer.unsubscribe(t(this,z)),c(this,o,ze).call(this),t(this,f).style.transform="",t(this,f).style.height="",t(this,f).style.width="",this.classList.remove("has-overflow","start","end"),t(this,l).length?c(this,o,Vt).call(this):(t(this,x).reset(),t(this,a).reset()),yt.scrollEntries.unregister(this))},Te=function(){t(this,Z)&&(h(this,Z,!1),yt.scrollEntries.register(this),this.tryResplit(),c(this,o,Le).call(this),this.scrollToSection(t(this,kt).current,{behaviour:"instant"}),_t.windowResizer.subscribe(t(this,z),xe.RESIZE_ORDER.SCROLL))},z=new WeakMap,fe=new WeakMap,Ge=function(e){let i=t(this,x).current;return t(this,v).current?i=Ne.loopNumber(e,t(this,l).length):i=Fe.clamp(e,0,this.limit),i},jt=new WeakMap,be=new WeakMap,qe=function(e=1){t(this,ht).current&&(t(this,w).direction=e),t(this,A).current&&t(this,w).pauseAndContinue(t(this,At).current,this.sectionalCSSProperty.current)},De=function(e="current"){if(t(this,v).current&&t(this,l).length){const i=t(this,a)[e]%Math.round(t(this,m)+t(this,C)+t(this,k));return i<0?t(this,m)+i+t(this,C)+t(this,k):i}else return t(this,a)[e]},gt=function(){if(t(this,l).length){const e=t(this,x).current+t(this,ot).current;if(e===0?h(this,B,"start"):e===this.limit?h(this,B,"end"):h(this,B,null),he.dispatchEvent(this,"scrollLine",{detail:{line:t(this,B)}}),t(this,R).current){this.classList.remove("end","start"),t(this,B)&&this.classList.add(t(this,B));const i=t(this,T).current+t(this,F).current;h(this,K,[]),t(this,l).forEach((r,u)=>{r.setCurrentIndex(null),r.setCurrentIndexArc(null),r.setCurrentIndexArcAbs(null),r.setMiddle(!1);const b=e-this.limit-1+t(this,F).current,y=e+i,I=this.sections.length-y;u>=e&&u<y||u<=b?(r.setMark("current"),t(this,K).push(r)):u>=y&&u<y+I/2||u<=b+i?r.setMark("next"):r.setMark("previous")}),t(this,me).call(this)}}},Ze=function(){if(t(this,R).current){const e=Math.floor(t(this,K).length/2);t(this,K).sort((i,r)=>i.element.getBoundingClientRect().left-r.element.getBoundingClientRect().left),t(this,K).forEach((i,r)=>{const u=r-e;i.setCurrentIndex(r),i.setCurrentIndexArc(u),i.setCurrentIndexArcAbs(Math.abs(u)),i.setMiddle(r===e)})}},me=new WeakMap,ce=function(e=!1){let i=this.targetScrollValue,r=1/0,u=0;const b=t(this,a).direction;for(let y=0;y<t(this,l).length;y++){const I=t(this,l)[y];let Ie=t(this,Tt)?I.size*b*-1*.4:0,Ot=I.position;this.overscroll&&Ot===0&&e&&(Ot=t(this,N));let ne=Math.abs(Ot+Ie-i);ne<=r&&(r=ne,u=y)}return u},ge=new WeakMap;O.isBrowser&&!customElements.get("e-scroll")&&customElements.define("e-scroll",Bt);var ye;class Be extends HTMLElement{constructor(){super(...arguments);s(this,ye,null)}get scrollElement(){return t(this,ye)}connectedCallback(){const e=Ue.findParentElement(this,Bt);e instanceof Bt?h(this,ye,e):console.error(this,"e-scroll not found")}}ye=new WeakMap;var pt,L,J,Q,Kt,Jt,ft,Qt,Ce,ve;class je extends Be{constructor(){super();s(this,pt,null);s(this,L,null);s(this,J,!1);s(this,Q,0);s(this,Kt,0);s(this,Jt,0);s(this,ft,()=>{h(this,J,this.offsetWidth>this.offsetHeight);const e=t(this,J)?this.offsetWidth:this.offsetHeight;h(this,Q,e/((this.scrollElement.scrollSize+this.scrollElement.viewportSize)/e)),h(this,Q,Math.max(t(this,Q),30)),t(this,J)?(t(this,L).style.width=t(this,Q)+"px",t(this,L).style.height="100%"):(t(this,L).style.width="100%",t(this,L).style.height=t(this,Q)+"px"),h(this,Kt,e-t(this,Q)),this.scrollElement.scrollSize<=0?this.style.display="none":this.style.display="",t(this,Qt).call(this)});s(this,Qt,()=>{h(this,Jt,this.scrollElement.currentProgress*t(this,Kt)),t(this,J)?t(this,L).style.transform=`translate3d(${t(this,Jt)}px, 0px, 0px)`:t(this,L).style.transform=`translate3d(0px, ${t(this,Jt)}px, 0px)`});s(this,Ce,()=>{this.setAttribute("axis",this.scrollElement.axisCSSProperty.current)});s(this,ve,e=>{document.documentElement.classList.add("grabbing"),ls.setupDrag(u=>{const b=t(this,J)?u.x:u.y,y=this.scrollElement.distance/t(this,Kt),I=(b-r)*y;this.scrollElement.setPosition(i+I)},()=>{document.documentElement.classList.remove("grabbing")});const i=this.scrollElement.damped.target,r=t(this,J)?e.x:e.y});if(O.isBrowser){const e=this.attachShadow({mode:"open"});e.adoptedStyleSheets=[We.createStylesheet({":host":{display:"inline-block",zIndex:"1",backgroundColor:"#ebebeb"},':host([axis="y"])':{position:"absolute",right:"0",top:"0",width:"1vmin",height:"100%"},':host([axis="x"])':{position:"absolute",left:"0",bottom:"0",width:"100%",height:"1vmin"},".default-thumb":{backgroundColor:"var(--thumb-color, black)",borderRadius:"var(--thumb-radius, 0px)",touchAction:"none"},"::slotted(*)":{touchAction:"none"}})],h(this,pt,document.createElement("slot")),t(this,pt).innerHTML='<div class="default-thumb"></div>',e.appendChild(t(this,pt))}}get thumbElement(){return t(this,L)}connectedCallback(){super.connectedCallback(),this.setAttribute("drag-dead-zone","");const e=t(this,pt).assignedElements()[0]||t(this,pt).firstElementChild;h(this,L,e),t(this,L).addEventListener("pointerdown",t(this,ve)),_t.windowResizer.subscribe(t(this,ft),xe.RESIZE_ORDER.SCROLL),ue.elementResizer.subscribe(this,t(this,ft)),ue.elementResizer.subscribe(this.scrollElement,t(this,ft)),this.scrollElement.onScroll(t(this,Qt)),this.scrollElement.axisCSSProperty.subscribe(t(this,Ce))}disconnectedCallback(){this.removeAttribute("drag-dead-zone"),this.style.display="",t(this,L).removeEventListener("pointerdown",t(this,ve)),_t.windowResizer.unsubscribe(t(this,ft)),ue.elementResizer.unsubscribe(t(this,ft)),this.scrollElement.offScroll(t(this,Qt)),this.scrollElement.axisCSSProperty.unsubscribe(t(this,Ce))}}pt=new WeakMap,L=new WeakMap,J=new WeakMap,Q=new WeakMap,Kt=new WeakMap,Jt=new WeakMap,ft=new WeakMap,Qt=new WeakMap,Ce=new WeakMap,ve=new WeakMap;O.isBrowser&&!customElements.get("e-scrollbar")&&customElements.define("e-scrollbar",je);var Xt,Yt,te;class Ke extends Be{constructor(){super();s(this,Xt,new d.CSSProperty(this,"--behaviour","smooth"));s(this,Yt,new d.CSSProperty(this,"--tween-easing",!1));s(this,te,new d.CSSProperty(this,"--tween-duration",0));O.isBrowser&&this.addEventListener("click",()=>{const e=t(this,Xt).current,i=t(this,Yt).current,r=t(this,te).current;this.handleClick({behaviour:e,tween:i||r?{easing:i,duration:r}:void 0})})}connectedCallback(){super.connectedCallback(),t(this,Xt).observe(),t(this,Yt).observe(),t(this,te).observe()}disconnectedCallback(){t(this,Xt).close(),t(this,Yt).close(),t(this,te).close()}}Xt=new WeakMap,Yt=new WeakMap,te=new WeakMap;var ee;class Je extends Ke{constructor(){super(...arguments);s(this,ee,new d.CSSProperty(this,"--set",1))}handleClick(e){this.scrollElement.scrollToSection(t(this,ee).current,e)}connectedCallback(){super.connectedCallback(),t(this,ee).observe()}disconnectedCallback(){super.disconnectedCallback(),t(this,ee).close()}}ee=new WeakMap;O.isBrowser&&!customElements.get("e-scroll-set-button")&&customElements.define("e-scroll-set-button",Je);var X,se;class Qe extends Ke{constructor(){super(...arguments);s(this,X,new d.CSSProperty(this,"--step",1));s(this,se,()=>{this.scrollElement.loopCSSProperty.current?this.removeAttribute("disabled"):t(this,X).current>0&&this.scrollElement.scrollLine==="end"||t(this,X).current<0&&this.scrollElement.scrollLine==="start"?this.setAttribute("disabled",""):this.removeAttribute("disabled")})}handleClick(e){this.scrollElement.shiftSections(t(this,X).current,e)}connectedCallback(){super.connectedCallback(),this.scrollElement&&(t(this,X).subscribe(()=>{t(this,se).call(this)}),t(this,X).observe(),this.scrollElement.addEventListener("scrollLine",t(this,se)),t(this,se).call(this))}disconnectedCallback(){super.disconnectedCallback(),t(this,X).close(),this.removeAttribute("disabled")}}X=new WeakMap,se=new WeakMap;O.isBrowser&&!customElements.get("e-scroll-step-button")&&customElements.define("e-scroll-step-button",Qe);var Y,bt,ie,Pe,we,re;class ds{constructor(n,e,i){s(this,Y,null);s(this,bt,null);s(this,ie,null);s(this,Pe,null);s(this,we,()=>{t(this,bt).scrollToSection(t(this,ie),{behaviour:t(this,Pe)})});s(this,re,()=>{t(this,Y).classList.toggle("current",t(this,bt).counter.current===t(this,ie))});O.isBrowser&&(h(this,Y,document.createElement("button")),h(this,bt,n),h(this,Pe,i),h(this,ie,e),t(this,Y).addEventListener("click",t(this,we)),t(this,bt).counter.subscribe(t(this,re)),t(this,re).call(this))}get element(){return t(this,Y)}destroy(){t(this,Y).removeEventListener("click",t(this,we)),t(this,bt).counter.unsubscribe(t(this,re)),t(this,Y).remove()}}Y=new WeakMap,bt=new WeakMap,ie=new WeakMap,Pe=new WeakMap,we=new WeakMap,re=new WeakMap;var Dt,mt,tt;class Xe extends Be{constructor(){super(...arguments);s(this,Dt,null);s(this,mt,[]);s(this,tt,Ae.debounce(()=>{t(this,mt).forEach(i=>i.destroy()),h(this,mt,[]);let e=0;this.scrollElement.loopCSSProperty.current?e=this.scrollElement.sections.length:e=this.scrollElement.sections.length-Math.max(this.scrollElement.sectionsInViewCSSProperty.current-1,0);for(let i=0;i<e;i++){const r=new ds(this.scrollElement,i,this.getAttribute("behaviour")||"smooth");t(this,Dt).appendChild(r.element),t(this,mt).push(r)}},0))}connectedCallback(){super.connectedCallback(),this.innerHTML="",this.scrollElement.addEventListener("scrollSectionsChange",t(this,tt)),this.scrollElement.sectionsInViewCSSProperty.subscribe(t(this,tt)),this.scrollElement.loopCSSProperty.subscribe(t(this,tt)),h(this,Dt,document.createElement("div")),this.appendChild(t(this,Dt))}disconnectedCallback(){this.scrollElement.removeEventListener("scrollSectionsChange",t(this,tt)),this.scrollElement.sectionsInViewCSSProperty.unsubscribe(t(this,tt)),this.scrollElement.loopCSSProperty.unsubscribe(t(this,tt)),t(this,mt).forEach(e=>e.destroy()),h(this,mt,[]),t(this,Dt).remove()}}Dt=new WeakMap,mt=new WeakMap,tt=new WeakMap;O.isBrowser&&!customElements.get("e-scroll-bullet-buttons")&&customElements.define("e-scroll-bullet-buttons",Xe);class Ye extends cs.ScrollSegmentElement{connectedCallback(){const n=Ue.findParentElement(this,Bt);n instanceof Bt?(this.scrollContainer=n,this.scrollContainer.addEventListener("scrollSectionsChange",this.findAnotherScrollEntries),this.scrollContainer.addEventListener("scrollResize",this.resize),this.resize()):console.error(this,"e-scroll not found")}disconnectedCallback(){super.disconnectedCallback(),this.scrollContainer instanceof Bt&&(this.scrollContainer.removeEventListener("scrollSectionsChange",this.findAnotherScrollEntries),this.scrollContainer.removeEventListener("scrollResize",this.resize))}}O.isBrowser&&!customElements.get("e-scroll-segment")&&customElements.define("e-scroll-segment",Ye);exports.ScrollBulletButtonsElement=Xe;exports.ScrollElement=Bt;exports.ScrollSegmentElement=Ye;exports.ScrollSetButtonElement=Je;exports.ScrollStepButtonElement=Qe;exports.ScrollbarElement=je;
|
package/lib/scroll/index.js
CHANGED
|
@@ -28,7 +28,7 @@ import { TICK_ORDER as es, RESIZE_ORDER as Ae } from "../order/index.js";
|
|
|
28
28
|
import { D as ss } from "../Damped-ByZFbNSt.js";
|
|
29
29
|
import { T as is } from "../Tweened-C4xgzPkR.js";
|
|
30
30
|
import { WheelControls as rs, KeyboardControls as ns, DragControls as hs, AutoplayControls as os } from "../controls/index.js";
|
|
31
|
-
import { windowResizer as
|
|
31
|
+
import { windowResizer as $t } from "../window-resizer/index.js";
|
|
32
32
|
import { scrollEntries as vt } from "../scroll-entries/index.js";
|
|
33
33
|
import { cssUnitParser as Fe } from "../css-unit-parser/index.js";
|
|
34
34
|
import { CSSProperty as d } from "../css-property/index.js";
|
|
@@ -37,12 +37,12 @@ import { elementResizer as ce } from "../element-resizer/index.js";
|
|
|
37
37
|
import { s as cs } from "../gestures-CcXV6fCp.js";
|
|
38
38
|
import { b as Ue } from "../dom-CVWzyXPH.js";
|
|
39
39
|
import { ScrollSegmentElement as as } from "../scroll-segment/index.js";
|
|
40
|
-
var f,
|
|
40
|
+
var f, Wt, g, ae, ue, yt, $, et, Ct, wt, he;
|
|
41
41
|
class us {
|
|
42
42
|
constructor(n, e, i) {
|
|
43
43
|
s(this, wt);
|
|
44
44
|
s(this, f);
|
|
45
|
-
s(this,
|
|
45
|
+
s(this, Wt);
|
|
46
46
|
s(this, g);
|
|
47
47
|
s(this, ae, 0);
|
|
48
48
|
s(this, ue, 0);
|
|
@@ -50,13 +50,13 @@ class us {
|
|
|
50
50
|
s(this, $, 0);
|
|
51
51
|
s(this, et, null);
|
|
52
52
|
s(this, Ct, 0);
|
|
53
|
-
h(this, f, n), h(this,
|
|
53
|
+
h(this, f, n), h(this, Wt, e), h(this, g, i), vt.register(t(this, f)), this.setIndex(t(this, Wt));
|
|
54
54
|
}
|
|
55
55
|
get element() {
|
|
56
56
|
return t(this, f);
|
|
57
57
|
}
|
|
58
58
|
get index() {
|
|
59
|
-
return t(this,
|
|
59
|
+
return t(this, Wt);
|
|
60
60
|
}
|
|
61
61
|
get size() {
|
|
62
62
|
return t(this, yt);
|
|
@@ -122,7 +122,7 @@ class us {
|
|
|
122
122
|
c(this, wt, he).call(this, "current-index-arc-abs", n);
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
|
-
f = new WeakMap(),
|
|
125
|
+
f = new WeakMap(), Wt = new WeakMap(), g = new WeakMap(), ae = new WeakMap(), ue = new WeakMap(), yt = new WeakMap(), $ = new WeakMap(), et = new WeakMap(), Ct = new WeakMap(), wt = new WeakSet(), he = function(n, e) {
|
|
126
126
|
e !== null ? (t(this, f).style.setProperty(`--${n}`, e.toString()), t(this, f).setAttribute(`data-${n}`, e.toString())) : (t(this, f).style.removeProperty(`--${n}`), t(this, f).removeAttribute(`data-${n}`));
|
|
127
127
|
};
|
|
128
128
|
const ds = Ne({
|
|
@@ -164,8 +164,8 @@ const ds = Ne({
|
|
|
164
164
|
flexShrink: "0"
|
|
165
165
|
}
|
|
166
166
|
});
|
|
167
|
-
var u, xt, E, st, B, W, F, T, it, rt, N, nt, Et, D, C, Pt, Lt, zt, It,
|
|
168
|
-
class
|
|
167
|
+
var u, xt, E, st, B, W, F, T, it, rt, N, nt, Et, D, C, Pt, Lt, zt, It, Ft, kt, A, At, ht, M, ot, q, Mt, lt, Tt, ct, at, ut, m, Nt, l, de, pe, y, S, k, R, dt, V, x, P, qt, U, G, K, _, Ut, pt, Z, Dt, O, w, Gt, j, Rt, Kt, o, Me, oe, Ht, xe, Ee, Te, De, L, fe, Ge, _t, me, Re, Ve, gt, Ke, be, le, Se;
|
|
168
|
+
class Bt extends HTMLElement {
|
|
169
169
|
constructor() {
|
|
170
170
|
super();
|
|
171
171
|
s(this, o);
|
|
@@ -206,7 +206,7 @@ class $t extends HTMLElement {
|
|
|
206
206
|
s(this, Lt, new d(this, "--mass", 0));
|
|
207
207
|
s(this, zt, new d(this, "--stiffness", 0));
|
|
208
208
|
s(this, It, new d(this, "--mouse-drag", !1));
|
|
209
|
-
s(this,
|
|
209
|
+
s(this, Ft, new d(
|
|
210
210
|
this,
|
|
211
211
|
"--section-distance-scale",
|
|
212
212
|
0.5
|
|
@@ -250,7 +250,7 @@ class $t extends HTMLElement {
|
|
|
250
250
|
s(this, at, new d(this, "--hibernate", !1));
|
|
251
251
|
s(this, ut, null);
|
|
252
252
|
s(this, m, null);
|
|
253
|
-
s(this,
|
|
253
|
+
s(this, Nt, null);
|
|
254
254
|
s(this, l, []);
|
|
255
255
|
s(this, de, 0);
|
|
256
256
|
s(this, pe, 0);
|
|
@@ -262,24 +262,24 @@ class $t extends HTMLElement {
|
|
|
262
262
|
s(this, V, null);
|
|
263
263
|
s(this, x, null);
|
|
264
264
|
s(this, P, new Qe(0));
|
|
265
|
-
s(this,
|
|
265
|
+
s(this, qt, 0);
|
|
266
266
|
s(this, U, 0);
|
|
267
267
|
s(this, G, !1);
|
|
268
268
|
s(this, K, !0);
|
|
269
269
|
s(this, _, !0);
|
|
270
|
-
s(this,
|
|
270
|
+
s(this, Ut);
|
|
271
271
|
s(this, pt);
|
|
272
272
|
s(this, Z, new is());
|
|
273
|
-
s(this,
|
|
273
|
+
s(this, Dt, !1);
|
|
274
274
|
s(this, O, null);
|
|
275
275
|
s(this, w, !1);
|
|
276
276
|
s(this, Gt, null);
|
|
277
277
|
s(this, j, []);
|
|
278
|
-
s(this,
|
|
278
|
+
s(this, Rt, !1);
|
|
279
279
|
s(this, Kt);
|
|
280
280
|
s(this, L, (e) => {
|
|
281
|
-
if (e && t(this,
|
|
282
|
-
h(this,
|
|
281
|
+
if (e && t(this, Rt)) {
|
|
282
|
+
h(this, Rt, !1);
|
|
283
283
|
return;
|
|
284
284
|
}
|
|
285
285
|
this.resize();
|
|
@@ -288,7 +288,7 @@ class $t extends HTMLElement {
|
|
|
288
288
|
if (!t(this, G) || t(this, _) || t(this, K))
|
|
289
289
|
return;
|
|
290
290
|
const e = this.currentScrollValue;
|
|
291
|
-
if (h(this,
|
|
291
|
+
if (h(this, qt, Math.max(0, e - t(this, S))), t(this, l).length) {
|
|
292
292
|
for (let i = 0; i < t(this, l).length; i++)
|
|
293
293
|
t(this, l)[i].transform();
|
|
294
294
|
t(this, P).current = c(this, o, le).call(this);
|
|
@@ -310,7 +310,7 @@ class $t extends HTMLElement {
|
|
|
310
310
|
if (t(this, B).current > 0 && i < 0)
|
|
311
311
|
return;
|
|
312
312
|
}
|
|
313
|
-
if (t(this, pt) || t(this, Z).unlistenAnimationFrame(), !t(this, A).current && t(this, lt).current && (clearInterval(t(this,
|
|
313
|
+
if (t(this, pt) || t(this, Z).unlistenAnimationFrame(), !t(this, A).current && t(this, lt).current && (clearInterval(t(this, Ut)), h(this, Ut, setTimeout(() => {
|
|
314
314
|
const r = t(this, l)[c(this, o, le).call(this)];
|
|
315
315
|
r && this.scrollToSection(r.index, {
|
|
316
316
|
tween: {
|
|
@@ -328,12 +328,12 @@ class $t extends HTMLElement {
|
|
|
328
328
|
duration: t(this, rt).current || 500
|
|
329
329
|
} : void 0
|
|
330
330
|
};
|
|
331
|
-
t(this,
|
|
331
|
+
t(this, Dt) ? this.scrollToSection(c(this, o, le).call(this, !0), a) : this.shiftSections(r, a);
|
|
332
332
|
} else
|
|
333
333
|
t(this, u).shift(r * t(this, y));
|
|
334
334
|
} else
|
|
335
335
|
t(this, u).shift(i);
|
|
336
|
-
h(this,
|
|
336
|
+
h(this, Dt, e === "drag");
|
|
337
337
|
}
|
|
338
338
|
});
|
|
339
339
|
s(this, be, ze(() => {
|
|
@@ -341,8 +341,8 @@ class $t extends HTMLElement {
|
|
|
341
341
|
const a = this.vertical ? r.width : r.height;
|
|
342
342
|
return a > i ? a : i;
|
|
343
343
|
}, 0);
|
|
344
|
-
clearTimeout(t(this, Kt)), h(this,
|
|
345
|
-
h(this,
|
|
344
|
+
clearTimeout(t(this, Kt)), h(this, Rt, !0), this.style.setProperty("--max-section-size", ""), h(this, Kt, setTimeout(() => {
|
|
345
|
+
h(this, Rt, !0), this.style.setProperty("--max-section-size", e + "px");
|
|
346
346
|
}, 10));
|
|
347
347
|
}, 20));
|
|
348
348
|
s(this, Se, () => {
|
|
@@ -352,7 +352,7 @@ class $t extends HTMLElement {
|
|
|
352
352
|
const e = this.attachShadow({ mode: "open" });
|
|
353
353
|
e.adoptedStyleSheets = [ds];
|
|
354
354
|
const i = document.createElement("div");
|
|
355
|
-
i.className = "static", i.innerHTML = '<slot name="static"></slot>', e.appendChild(i), h(this, ut, document.createElement("div")), t(this, ut).className = "content-wrapper", h(this, m, document.createElement("div")), t(this, m).className = "content", h(this,
|
|
355
|
+
i.className = "static", i.innerHTML = '<slot name="static"></slot>', e.appendChild(i), h(this, ut, document.createElement("div")), t(this, ut).className = "content-wrapper", h(this, m, document.createElement("div")), t(this, m).className = "content", h(this, Nt, document.createElement("slot")), t(this, m).appendChild(t(this, Nt)), t(this, ut).appendChild(t(this, m)), e.appendChild(t(this, ut)), h(this, Gt, new MutationObserver(
|
|
356
356
|
ze(() => {
|
|
357
357
|
this.tryResplit();
|
|
358
358
|
}, 10)
|
|
@@ -417,7 +417,7 @@ class $t extends HTMLElement {
|
|
|
417
417
|
return t(this, It);
|
|
418
418
|
}
|
|
419
419
|
get sectionDistanceScaleCSSProperty() {
|
|
420
|
-
return t(this,
|
|
420
|
+
return t(this, Ft);
|
|
421
421
|
}
|
|
422
422
|
get startSectionCSSProperty() {
|
|
423
423
|
return t(this, kt);
|
|
@@ -503,7 +503,7 @@ class $t extends HTMLElement {
|
|
|
503
503
|
return t(this, G);
|
|
504
504
|
}
|
|
505
505
|
get overscroll() {
|
|
506
|
-
return t(this,
|
|
506
|
+
return t(this, qt);
|
|
507
507
|
}
|
|
508
508
|
get scrollLine() {
|
|
509
509
|
return t(this, O);
|
|
@@ -550,9 +550,9 @@ class $t extends HTMLElement {
|
|
|
550
550
|
const r = t(this, P).current, a = c(this, o, Ge).call(this, e), b = t(this, l)[r], v = t(this, l)[a];
|
|
551
551
|
if (b && v) {
|
|
552
552
|
let I = 0;
|
|
553
|
-
const Pe = c(this, o, le).call(this),
|
|
554
|
-
let re =
|
|
555
|
-
t(this, C).current ? a === 0 && r === t(this, l).length - 1 ? (I = t(this, S) + t(this, y) - b.position + t(this, k), re = 0) : a === t(this, l).length - 1 && r === 0 ? I = v.position - (t(this, S) + t(this, y) + t(this, k)) : I = v.position - b.position : I = v.position - b.position, this.shiftPosition(I - re, i);
|
|
553
|
+
const Pe = c(this, o, le).call(this), Ot = t(this, l)[Pe];
|
|
554
|
+
let re = Ot ? this.targetScrollValue - Ot.position : 0;
|
|
555
|
+
t(this, C).current ? a === 0 && r === t(this, l).length - 1 ? (I = t(this, S) + t(this, y) - b.position + t(this, k), t(this, Dt) || (re = 0)) : a === t(this, l).length - 1 && r === 0 ? I = v.position - (t(this, S) + t(this, y) + t(this, k)) : I = v.position - b.position : I = v.position - b.position, this.shiftPosition(I - re, i);
|
|
556
556
|
}
|
|
557
557
|
}
|
|
558
558
|
shiftSections(e, i) {
|
|
@@ -639,15 +639,15 @@ class $t extends HTMLElement {
|
|
|
639
639
|
}), t(this, W).subscribe(() => {
|
|
640
640
|
t(this, w) && t(this, L).call(this);
|
|
641
641
|
}), t(this, F).subscribe(({ current: e }) => {
|
|
642
|
-
t(this, w) && (e ? c(this, o, oe).call(this) : c(this, o,
|
|
642
|
+
t(this, w) && (e ? c(this, o, oe).call(this) : c(this, o, Ht).call(this));
|
|
643
643
|
}), t(this, T).subscribe((e) => {
|
|
644
|
-
t(this, R).debounce = e.current, t(this, V).swipe = e.current, t(this, x).interval = e.current, t(this, w) && (e.current && !e.previous && !t(this, l).length ? c(this, o, oe).call(this) : !e.current && e.previous && t(this, l).length && c(this, o,
|
|
644
|
+
t(this, R).debounce = e.current, t(this, V).swipe = e.current, t(this, x).interval = e.current, t(this, w) && (e.current && !e.previous && !t(this, l).length ? c(this, o, oe).call(this) : !e.current && e.previous && t(this, l).length && c(this, o, Ht).call(this));
|
|
645
645
|
}), t(this, N).subscribe((e) => {
|
|
646
|
-
t(this, w) && (t(this, L).call(this), e.current && !e.previous && !t(this, l).length ? c(this, o, oe).call(this) : !e.current && e.previous && t(this, l).length && c(this, o,
|
|
646
|
+
t(this, w) && (t(this, L).call(this), e.current && !e.previous && !t(this, l).length ? c(this, o, oe).call(this) : !e.current && e.previous && t(this, l).length && c(this, o, Ht).call(this));
|
|
647
647
|
}), t(this, D).subscribe((e) => {
|
|
648
648
|
t(this, w) && (t(this, L).call(this), c(this, o, gt).call(this));
|
|
649
649
|
}), t(this, C).subscribe((e) => {
|
|
650
|
-
e.current ? (t(this, w) && (t(this, l).length || (t(this, F).current = !0)), t(this, u).max = 1 / 0, t(this, u).min = -1 / 0) : (h(this,
|
|
650
|
+
e.current ? (t(this, w) && (t(this, l).length || (t(this, F).current = !0)), t(this, u).max = 1 / 0, t(this, u).min = -1 / 0) : (h(this, qt, 0), t(this, u).max = t(this, S), t(this, u).min = 0);
|
|
651
651
|
}), t(this, Pt).subscribe((e) => {
|
|
652
652
|
t(this, u).damping = e.current;
|
|
653
653
|
}), t(this, Lt).subscribe((e) => {
|
|
@@ -676,23 +676,23 @@ class $t extends HTMLElement {
|
|
|
676
676
|
e.current && !e.previous ? (this.classList.add("disabled"), c(this, o, xe).call(this)) : !e.current && e.previous && (this.classList.remove("disabled"), c(this, o, Ee).call(this));
|
|
677
677
|
}), t(this, at).subscribe((e) => {
|
|
678
678
|
e.current && !e.previous ? (this.classList.add("hibernated"), c(this, o, Te).call(this)) : !e.current && e.previous && (this.classList.remove("hibernated"), c(this, o, De).call(this));
|
|
679
|
-
}), t(this, xt).observe(), t(this, E).observe(), t(this, st).observe(), t(this, B).observe(), t(this, W).observe(), t(this, F).observe(), t(this, T).observe(), t(this, it).observe(), t(this, rt).observe(), t(this, N).observe(), t(this, nt).observe(), t(this, Et).observe(), t(this, D).observe(), t(this, C).observe(), t(this, Pt).observe(), t(this, Lt).observe(), t(this, zt).observe(), t(this, It).observe(), t(this,
|
|
679
|
+
}), t(this, xt).observe(), t(this, E).observe(), t(this, st).observe(), t(this, B).observe(), t(this, W).observe(), t(this, F).observe(), t(this, T).observe(), t(this, it).observe(), t(this, rt).observe(), t(this, N).observe(), t(this, nt).observe(), t(this, Et).observe(), t(this, D).observe(), t(this, C).observe(), t(this, Pt).observe(), t(this, Lt).observe(), t(this, zt).observe(), t(this, It).observe(), t(this, Ft).observe(), t(this, kt).observe(), t(this, A).observe(), t(this, A).observe(), t(this, At).observe(), t(this, ht).observe(), t(this, M).observe(), t(this, ot).observe(), t(this, q).observe(), t(this, Mt).observe(), t(this, lt).observe(), t(this, Tt).observe(), t(this, ct).observe(), t(this, at).observe(), $t.subscribe(t(this, Se), Ae.LAST), ce.subscribe(this, t(this, L)), t(this, Gt).observe(this, { childList: !0 });
|
|
680
680
|
}
|
|
681
681
|
disconnectedCallback() {
|
|
682
|
-
this.removeAttribute("tabindex"), this.classList.remove("disabled"), this.classList.remove("hibernated"), t(this, xt).unobserve(), t(this, E).unobserve(), t(this, st).unobserve(), t(this, B).unobserve(), t(this, W).unobserve(), t(this, F).unobserve(), t(this, T).unobserve(), t(this, it).unobserve(), t(this, rt).unobserve(), t(this, N).unobserve(), t(this, nt).unobserve(), t(this, Et).unobserve(), t(this, D).unobserve(), t(this, C).unobserve(), t(this, Pt).unobserve(), t(this, Lt).unobserve(), t(this, zt).unobserve(), t(this, It).unobserve(), t(this,
|
|
682
|
+
this.removeAttribute("tabindex"), this.classList.remove("disabled"), this.classList.remove("hibernated"), t(this, xt).unobserve(), t(this, E).unobserve(), t(this, st).unobserve(), t(this, B).unobserve(), t(this, W).unobserve(), t(this, F).unobserve(), t(this, T).unobserve(), t(this, it).unobserve(), t(this, rt).unobserve(), t(this, N).unobserve(), t(this, nt).unobserve(), t(this, Et).unobserve(), t(this, D).unobserve(), t(this, C).unobserve(), t(this, Pt).unobserve(), t(this, Lt).unobserve(), t(this, zt).unobserve(), t(this, It).unobserve(), t(this, Ft).unobserve(), t(this, kt).unobserve(), t(this, A).unobserve(), t(this, At).unobserve(), t(this, ht).unobserve(), t(this, M).unobserve(), t(this, ot).unobserve(), t(this, q).unobserve(), t(this, Mt).unobserve(), t(this, lt).unobserve(), t(this, Tt).unobserve(), t(this, ct).unobserve(), t(this, at).unobserve(), $t.unsubscribe(t(this, Se)), ce.unsubscribe(t(this, L)), c(this, o, Te).call(this), t(this, Gt).disconnect();
|
|
683
683
|
}
|
|
684
684
|
}
|
|
685
|
-
u = new WeakMap(), xt = new WeakMap(), E = new WeakMap(), st = new WeakMap(), B = new WeakMap(), W = new WeakMap(), F = new WeakMap(), T = new WeakMap(), it = new WeakMap(), rt = new WeakMap(), N = new WeakMap(), nt = new WeakMap(), Et = new WeakMap(), D = new WeakMap(), C = new WeakMap(), Pt = new WeakMap(), Lt = new WeakMap(), zt = new WeakMap(), It = new WeakMap(),
|
|
685
|
+
u = new WeakMap(), xt = new WeakMap(), E = new WeakMap(), st = new WeakMap(), B = new WeakMap(), W = new WeakMap(), F = new WeakMap(), T = new WeakMap(), it = new WeakMap(), rt = new WeakMap(), N = new WeakMap(), nt = new WeakMap(), Et = new WeakMap(), D = new WeakMap(), C = new WeakMap(), Pt = new WeakMap(), Lt = new WeakMap(), zt = new WeakMap(), It = new WeakMap(), Ft = new WeakMap(), kt = new WeakMap(), A = new WeakMap(), At = new WeakMap(), ht = new WeakMap(), M = new WeakMap(), ot = new WeakMap(), q = new WeakMap(), Mt = new WeakMap(), lt = new WeakMap(), Tt = new WeakMap(), ct = new WeakMap(), at = new WeakMap(), ut = new WeakMap(), m = new WeakMap(), Nt = new WeakMap(), l = new WeakMap(), de = new WeakMap(), pe = new WeakMap(), y = new WeakMap(), S = new WeakMap(), k = new WeakMap(), R = new WeakMap(), dt = new WeakMap(), V = new WeakMap(), x = new WeakMap(), P = new WeakMap(), qt = new WeakMap(), U = new WeakMap(), G = new WeakMap(), K = new WeakMap(), _ = new WeakMap(), Ut = new WeakMap(), pt = new WeakMap(), Z = new WeakMap(), Dt = new WeakMap(), O = new WeakMap(), w = new WeakMap(), Gt = new WeakMap(), j = new WeakMap(), Rt = new WeakMap(), Kt = new WeakMap(), o = new WeakSet(), Me = function() {
|
|
686
686
|
const e = t(this, E).current, i = t(this, st).current ? "-reverse" : "";
|
|
687
687
|
t(this, m).style.flexDirection = e === "x" ? `row${i}` : `column${i}`, t(this, R).axis = t(this, nt).current ? "max" : e, t(this, dt).dimension = e === "x" ? "width" : "height", t(this, V).axis = e, e === "x" ? this.style.touchAction = "pan-y" : e === "y" && (this.style.touchAction = "pan-x"), t(this, w) && t(this, L).call(this);
|
|
688
688
|
}, oe = function() {
|
|
689
|
-
c(this, o,
|
|
689
|
+
c(this, o, Ht).call(this), t(this, Nt).assignedElements().forEach((e, i) => {
|
|
690
690
|
e instanceof HTMLElement && t(this, l).push(new us(e, i, this));
|
|
691
691
|
}), t(this, m).style.transform = "", this.style.setProperty("--sections", t(this, l).length.toString()), ne(this, "scrollSectionsChange", {
|
|
692
692
|
custom: !0,
|
|
693
693
|
composed: !0
|
|
694
694
|
}), t(this, L).call(this), c(this, o, gt).call(this);
|
|
695
|
-
},
|
|
695
|
+
}, Ht = function() {
|
|
696
696
|
t(this, l).forEach((e) => {
|
|
697
697
|
e.destroy();
|
|
698
698
|
}), h(this, l, []), t(this, P).reset(), t(this, u).reset(), this.style.removeProperty("--max-section-size"), ne(this, "scrollSectionsChange", {
|
|
@@ -700,17 +700,17 @@ u = new WeakMap(), xt = new WeakMap(), E = new WeakMap(), st = new WeakMap(), B
|
|
|
700
700
|
composed: !0
|
|
701
701
|
});
|
|
702
702
|
}, xe = function() {
|
|
703
|
-
t(this, K) || (h(this, K, !0), t(this, u).unsubscribe(t(this, fe)), t(this, u).unlistenAnimationFrame(), clearInterval(t(this,
|
|
703
|
+
t(this, K) || (h(this, K, !0), t(this, u).unsubscribe(t(this, fe)), t(this, u).unlistenAnimationFrame(), clearInterval(t(this, Ut)), clearInterval(t(this, pt)), t(this, Z).unlistenAnimationFrame(), t(this, R).disconnect(), t(this, dt).disconnect(), t(this, V).disconnect(), t(this, x).disconnect(), t(this, G) || (this.sections.forEach((e) => {
|
|
704
704
|
e.unsetTransform();
|
|
705
705
|
}), t(this, L).call(this)));
|
|
706
706
|
}, Ee = function() {
|
|
707
707
|
t(this, K) && (h(this, K, !1), t(this, u).subscribe(t(this, fe), -1e4), t(this, u).notify(), t(this, R).connect(), t(this, dt).connect(), t(this, V).connect(), t(this, A).current && t(this, x).connect());
|
|
708
708
|
}, Te = function() {
|
|
709
|
-
t(this, _) || (h(this, _, !0), clearTimeout(t(this, Kt)),
|
|
709
|
+
t(this, _) || (h(this, _, !0), clearTimeout(t(this, Kt)), $t.unsubscribe(t(this, L)), c(this, o, xe).call(this), t(this, m).style.transform = "", t(this, m).style.height = "", t(this, m).style.width = "", this.classList.remove("has-overflow", "start", "end"), t(this, l).length ? c(this, o, Ht).call(this) : (t(this, P).reset(), t(this, u).reset()), vt.unregister(this));
|
|
710
710
|
}, De = function() {
|
|
711
711
|
t(this, _) && (h(this, _, !1), vt.register(this), this.tryResplit(), c(this, o, Ee).call(this), this.scrollToSection(t(this, kt).current, {
|
|
712
712
|
behaviour: "instant"
|
|
713
|
-
}),
|
|
713
|
+
}), $t.subscribe(t(this, L), Ae.SCROLL));
|
|
714
714
|
}, L = new WeakMap(), fe = new WeakMap(), Ge = function(e) {
|
|
715
715
|
let i = t(this, P).current;
|
|
716
716
|
return t(this, C).current ? i = ts(e, t(this, l).length) : i = qe(e, 0, this.limit), i;
|
|
@@ -753,14 +753,14 @@ u = new WeakMap(), xt = new WeakMap(), E = new WeakMap(), st = new WeakMap(), B
|
|
|
753
753
|
const b = t(this, u).direction;
|
|
754
754
|
for (let v = 0; v < t(this, l).length; v++) {
|
|
755
755
|
const I = t(this, l)[v];
|
|
756
|
-
let Pe = t(this,
|
|
757
|
-
this.overscroll &&
|
|
758
|
-
let re = Math.abs(
|
|
756
|
+
let Pe = t(this, Dt) ? I.size * b * -1 * 0.4 : 0, Ot = I.position;
|
|
757
|
+
this.overscroll && Ot === 0 && e && (Ot = t(this, U));
|
|
758
|
+
let re = Math.abs(Ot + Pe - i);
|
|
759
759
|
re <= r && (r = re, a = v);
|
|
760
760
|
}
|
|
761
761
|
return a;
|
|
762
762
|
}, Se = new WeakMap();
|
|
763
|
-
H && !customElements.get("e-scroll") && customElements.define("e-scroll",
|
|
763
|
+
H && !customElements.get("e-scroll") && customElements.define("e-scroll", Bt);
|
|
764
764
|
var ge;
|
|
765
765
|
class Oe extends HTMLElement {
|
|
766
766
|
constructor() {
|
|
@@ -771,8 +771,8 @@ class Oe extends HTMLElement {
|
|
|
771
771
|
return t(this, ge);
|
|
772
772
|
}
|
|
773
773
|
connectedCallback() {
|
|
774
|
-
const e = Ue(this,
|
|
775
|
-
e instanceof
|
|
774
|
+
const e = Ue(this, Bt);
|
|
775
|
+
e instanceof Bt ? h(this, ge, e) : console.error(this, "e-scroll not found");
|
|
776
776
|
}
|
|
777
777
|
}
|
|
778
778
|
ge = new WeakMap();
|
|
@@ -850,10 +850,10 @@ class ps extends Oe {
|
|
|
850
850
|
connectedCallback() {
|
|
851
851
|
super.connectedCallback(), this.setAttribute("drag-dead-zone", "");
|
|
852
852
|
const e = t(this, ft).assignedElements()[0] || t(this, ft).firstElementChild;
|
|
853
|
-
h(this, z, e), t(this, z).addEventListener("pointerdown", t(this, ye)),
|
|
853
|
+
h(this, z, e), t(this, z).addEventListener("pointerdown", t(this, ye)), $t.subscribe(t(this, mt), Ae.SCROLL), ce.subscribe(this, t(this, mt)), ce.subscribe(this.scrollElement, t(this, mt)), this.scrollElement.onScroll(t(this, Jt)), this.scrollElement.axisCSSProperty.subscribe(t(this, ve));
|
|
854
854
|
}
|
|
855
855
|
disconnectedCallback() {
|
|
856
|
-
this.removeAttribute("drag-dead-zone"), this.style.display = "", t(this, z).removeEventListener("pointerdown", t(this, ye)),
|
|
856
|
+
this.removeAttribute("drag-dead-zone"), this.style.display = "", t(this, z).removeEventListener("pointerdown", t(this, ye)), $t.unsubscribe(t(this, mt)), ce.unsubscribe(t(this, mt)), this.scrollElement.offScroll(t(this, Jt)), this.scrollElement.axisCSSProperty.unsubscribe(t(this, ve));
|
|
857
857
|
}
|
|
858
858
|
}
|
|
859
859
|
ft = new WeakMap(), z = new WeakMap(), J = new WeakMap(), Q = new WeakMap(), Zt = new WeakMap(), jt = new WeakMap(), mt = new WeakMap(), Jt = new WeakMap(), ve = new WeakMap(), ye = new WeakMap();
|
|
@@ -957,11 +957,11 @@ class bs {
|
|
|
957
957
|
}
|
|
958
958
|
}
|
|
959
959
|
Y = new WeakMap(), bt = new WeakMap(), se = new WeakMap(), Ce = new WeakMap(), we = new WeakMap(), ie = new WeakMap();
|
|
960
|
-
var
|
|
960
|
+
var Vt, St, tt;
|
|
961
961
|
class Ss extends Oe {
|
|
962
962
|
constructor() {
|
|
963
963
|
super(...arguments);
|
|
964
|
-
s(this,
|
|
964
|
+
s(this, Vt, null);
|
|
965
965
|
s(this, St, []);
|
|
966
966
|
s(this, tt, ze(() => {
|
|
967
967
|
t(this, St).forEach((i) => i.destroy()), h(this, St, []);
|
|
@@ -973,7 +973,7 @@ class Ss extends Oe {
|
|
|
973
973
|
i,
|
|
974
974
|
this.getAttribute("behaviour") || "smooth"
|
|
975
975
|
);
|
|
976
|
-
t(this,
|
|
976
|
+
t(this, Vt).appendChild(r.element), t(this, St).push(r);
|
|
977
977
|
}
|
|
978
978
|
}, 0));
|
|
979
979
|
}
|
|
@@ -983,7 +983,7 @@ class Ss extends Oe {
|
|
|
983
983
|
t(this, tt)
|
|
984
984
|
), this.scrollElement.sectionsInViewCSSProperty.subscribe(
|
|
985
985
|
t(this, tt)
|
|
986
|
-
), this.scrollElement.loopCSSProperty.subscribe(t(this, tt)), h(this,
|
|
986
|
+
), this.scrollElement.loopCSSProperty.subscribe(t(this, tt)), h(this, Vt, document.createElement("div")), this.appendChild(t(this, Vt));
|
|
987
987
|
}
|
|
988
988
|
disconnectedCallback() {
|
|
989
989
|
this.scrollElement.removeEventListener(
|
|
@@ -991,21 +991,21 @@ class Ss extends Oe {
|
|
|
991
991
|
t(this, tt)
|
|
992
992
|
), this.scrollElement.sectionsInViewCSSProperty.unsubscribe(
|
|
993
993
|
t(this, tt)
|
|
994
|
-
), this.scrollElement.loopCSSProperty.unsubscribe(t(this, tt)), t(this, St).forEach((e) => e.destroy()), h(this, St, []), t(this,
|
|
994
|
+
), this.scrollElement.loopCSSProperty.unsubscribe(t(this, tt)), t(this, St).forEach((e) => e.destroy()), h(this, St, []), t(this, Vt).remove();
|
|
995
995
|
}
|
|
996
996
|
}
|
|
997
|
-
|
|
997
|
+
Vt = new WeakMap(), St = new WeakMap(), tt = new WeakMap();
|
|
998
998
|
H && !customElements.get("e-scroll-bullet-buttons") && customElements.define("e-scroll-bullet-buttons", Ss);
|
|
999
999
|
class gs extends as {
|
|
1000
1000
|
connectedCallback() {
|
|
1001
|
-
const n = Ue(this,
|
|
1002
|
-
n instanceof
|
|
1001
|
+
const n = Ue(this, Bt);
|
|
1002
|
+
n instanceof Bt ? (this.scrollContainer = n, this.scrollContainer.addEventListener(
|
|
1003
1003
|
"scrollSectionsChange",
|
|
1004
1004
|
this.findAnotherScrollEntries
|
|
1005
1005
|
), this.scrollContainer.addEventListener("scrollResize", this.resize), this.resize()) : console.error(this, "e-scroll not found");
|
|
1006
1006
|
}
|
|
1007
1007
|
disconnectedCallback() {
|
|
1008
|
-
super.disconnectedCallback(), this.scrollContainer instanceof
|
|
1008
|
+
super.disconnectedCallback(), this.scrollContainer instanceof Bt && (this.scrollContainer.removeEventListener(
|
|
1009
1009
|
"scrollSectionsChange",
|
|
1010
1010
|
this.findAnotherScrollEntries
|
|
1011
1011
|
), this.scrollContainer.removeEventListener("scrollResize", this.resize));
|
|
@@ -1014,7 +1014,7 @@ class gs extends as {
|
|
|
1014
1014
|
H && !customElements.get("e-scroll-segment") && customElements.define("e-scroll-segment", gs);
|
|
1015
1015
|
export {
|
|
1016
1016
|
Ss as ScrollBulletButtonsElement,
|
|
1017
|
-
|
|
1017
|
+
Bt as ScrollElement,
|
|
1018
1018
|
gs as ScrollSegmentElement,
|
|
1019
1019
|
fs as ScrollSetButtonElement,
|
|
1020
1020
|
ms as ScrollStepButtonElement,
|