aptechka 0.56.9 → 0.56.11
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/scroll/index.cjs +1 -1
- package/lib/scroll/index.js +91 -89
- package/package.json +1 -1
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 _e=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,He=(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)||_e("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)?_e("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"),ne=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"),we=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"),ce=require("../element-resizer/index.cjs"),ls=require("../gestures-C7gbKx11.cjs"),Ue=require("../dom-JBOkFLTh.cjs"),cs=require("../scroll-segment/index.cjs");var p,Ht,g,ue,ae,Ct,V,et,vt,Pt,he;class us{constructor(n,e,i){s(this,Pt);s(this,p);s(this,Ht);s(this,g);s(this,ue,0);s(this,ae,0);s(this,Ct,0);s(this,V,0);s(this,et,null);s(this,vt,0);h(this,p,n),h(this,Ht,e),h(this,g,i),yt.scrollEntries.register(t(this,p)),this.setIndex(t(this,Ht))}get element(){return t(this,p)}get index(){return t(this,Ht)}get size(){return t(this,Ct)}get width(){return t(this,ue)}get height(){return t(this,ae)}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,ue,t(this,p).offsetWidth),h(this,ae,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),ne.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,he).call(this,"index",n)}setCurrentIndex(n){c(this,Pt,he).call(this,"current-index",n)}setCurrentIndexArc(n){c(this,Pt,he).call(this,"current-index-arc",n)}setCurrentIndexArcAbs(n){c(this,Pt,he).call(this,"current-index-arc-abs",n)}}p=new WeakMap,Ht=new WeakMap,g=new WeakMap,ue=new WeakMap,ae=new WeakMap,Ct=new WeakMap,V=new WeakMap,et=new WeakMap,vt=new WeakMap,Pt=new WeakSet,he=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:"100%",height:"100%",overflow:"var(--overflow, initial)"},".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,Et,w,st,_,H,$,M,it,rt,W,nt,wt,T,v,xt,zt,Lt,It,$t,kt,A,At,ht,R,ot,F,Rt,lt,Mt,ct,ut,at,f,Wt,l,de,Se,C,m,k,q,dt,D,E,x,Ft,N,U,G,Z,Nt,St,j,Ut,B,P,Gt,K,Tt,Zt,o,Re,oe,Ot,ze,Le,Me,Te,z,pe,Ge,jt,fe,qe,De,gt,Ze,be,le,me;class Dt extends HTMLElement{constructor(){super();s(this,o);s(this,a,null);s(this,Et,new d.CSSProperty(this,"--controls",!0));s(this,w,new d.CSSProperty(this,"--axis","y"));s(this,st,new d.CSSProperty(this,"--reverse",!1));s(this,_,new d.CSSProperty(this,"--direction",0));s(this,H,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,wt,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,de,0);s(this,Se,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,E,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,pe,()=>{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,le).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,w).current,e)});s(this,jt,(e,i)=>{t(this,Et).current&&(c(this,o,qe).call(this,Math.sign(i)||1),t(this,fe).call(this,e,i))});s(this,fe,(e,i)=>{if(t(this,_).current){if(t(this,_).current<0&&i>0)return;if(t(this,_).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,le).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,le).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,be,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,me,()=>{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,Et)}get axisCSSProperty(){return t(this,w)}get reverseCSSProperty(){return t(this,st)}get directionCSSProperty(){return t(this,_)}get pagesCSSProperty(){return t(this,H)}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,wt)}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,de)}get contentPosition(){return t(this,Se)}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,w).current==="y"}get currentProgress(){return this.currentScrollValue/this.loopDistance||0}get targetProgress(){return this.targetScrollValue/this.loopDistance||0}get scrollWidth(){return t(this,w).current==="y"?0:t(this,a).distance}get scrollHeight(){return t(this,w).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,oe).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,le).call(this),Bt=t(this,l)[Ie],Ee=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):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-Ee,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,He({},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,de,this.vertical?Vt.getCumulativeOffsetTop(this):Vt.getCumulativeOffsetLeft(this)),h(this,Se,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,H).current){h(this,m,t(this,C)*t(this,H).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,be).call(this),ne.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 we.WheelControls({element:t(this,f)})),t(this,q).changeEvent.subscribe(t(this,jt)),h(this,dt,new we.KeyboardControls({element:this})),t(this,dt).changeEvent.subscribe(t(this,jt)),h(this,D,new we.DragControls({element:t(this,f),rootElement:this})),t(this,D).changeEvent.subscribe(t(this,jt)),h(this,E,new we.AutoplayControls({culling:this})),t(this,E).changeEvent.subscribe(t(this,fe)),t(this,w).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,w).current}),t(this,wt).subscribe(e=>{t(this,D).inertion=typeof e.current=="number"?e.current:1}),t(this,H).subscribe(()=>{t(this,P)&&t(this,z).call(this)}),t(this,$).subscribe(({current:e})=>{t(this,P)&&(e?c(this,o,oe).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,E).interval=e.current,t(this,P)&&(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,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,oe).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,E).speed=e.current,!t(this,G)&&e.current&&!e.previous?t(this,E).connect():!e.current&&e.previous&&t(this,E).disconnect()}),t(this,ht).subscribe(e=>{e.current||(t(this,E).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,Et).observe(),t(this,w).observe(),t(this,st).observe(),t(this,_).observe(),t(this,H).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,wt).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(),_t.windowResizer.subscribe(t(this,me),xe.RESIZE_ORDER.LAST),ce.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,Et).unobserve(),t(this,w).unobserve(),t(this,st).unobserve(),t(this,_).unobserve(),t(this,H).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,wt).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(),_t.windowResizer.unsubscribe(t(this,me)),ce.elementResizer.unsubscribe(t(this,z)),c(this,o,Me).call(this),t(this,Gt).disconnect()}}a=new WeakMap,Et=new WeakMap,w=new WeakMap,st=new WeakMap,_=new WeakMap,H=new WeakMap,$=new WeakMap,M=new WeakMap,it=new WeakMap,rt=new WeakMap,W=new WeakMap,nt=new WeakMap,wt=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,de=new WeakMap,Se=new WeakMap,C=new WeakMap,m=new WeakMap,k=new WeakMap,q=new WeakMap,dt=new WeakMap,D=new WeakMap,E=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,w).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)},oe=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()),ne.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"),ne.dispatchEvent(this,"scrollSectionsChange",{custom:!0,composed:!0})},ze=function(){t(this,G)||(h(this,G,!0),t(this,a).unsubscribe(t(this,pe)),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,E).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,pe),-1e4),t(this,a).notify(),t(this,q).connect(),t(this,dt).connect(),t(this,D).connect(),t(this,A).current&&t(this,E).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,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"}),_t.windowResizer.subscribe(t(this,z),xe.RESIZE_ORDER.SCROLL))},z=new WeakMap,pe=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,fe=new WeakMap,qe=function(e=1){t(this,ht).current&&(t(this,E).direction=e),t(this,A).current&&t(this,E).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),ne.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,be).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)})}},be=new WeakMap,le=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 Ee=Math.abs(Bt+Ie-i);Ee<=r&&(r=Ee,u=y)}return u},me=new WeakMap;O.isBrowser&&!customElements.get("e-scroll")&&customElements.define("e-scroll",Dt);var ge;class Be extends HTMLElement{constructor(){super(...arguments);s(this,ge,null)}get scrollElement(){return t(this,ge)}connectedCallback(){const e=Ue.findParentElement(this,Dt);e instanceof Dt?h(this,ge,e):console.error(this,"e-scroll not found")}}ge=new WeakMap;var pt,L,J,Q,Kt,Jt,ft,Qt,ye,Ce;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,ye,()=>{this.setAttribute("axis",this.scrollElement.axisCSSProperty.current)});s(this,Ce,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,Ce)),_t.windowResizer.subscribe(t(this,ft),xe.RESIZE_ORDER.SCROLL),ce.elementResizer.subscribe(this,t(this,ft)),ce.elementResizer.subscribe(this.scrollElement,t(this,ft)),this.scrollElement.onScroll(t(this,Qt)),this.scrollElement.axisCSSProperty.subscribe(t(this,ye))}disconnectedCallback(){this.removeAttribute("drag-dead-zone"),this.style.display="",t(this,L).removeEventListener("pointerdown",t(this,Ce)),_t.windowResizer.unsubscribe(t(this,ft)),ce.elementResizer.unsubscribe(t(this,ft)),this.scrollElement.offScroll(t(this,Qt)),this.scrollElement.axisCSSProperty.unsubscribe(t(this,ye))}}pt=new WeakMap,L=new WeakMap,J=new WeakMap,Q=new WeakMap,Kt=new WeakMap,Jt=new WeakMap,ft=new WeakMap,Qt=new WeakMap,ye=new WeakMap,Ce=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,ve,Pe,re;class ds{constructor(n,e,i){s(this,Y,null);s(this,bt,null);s(this,ie,null);s(this,ve,null);s(this,Pe,()=>{t(this,bt).scrollToSection(t(this,ie),{behaviour:t(this,ve)})});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,ve,i),h(this,ie,e),t(this,Y).addEventListener("click",t(this,Pe)),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,Pe)),t(this,bt).counter.unsubscribe(t(this,re)),t(this,Y).remove()}}Y=new WeakMap,bt=new WeakMap,ie=new WeakMap,ve=new WeakMap,Pe=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.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 _e=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,He=(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)||_e("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)?_e("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"),we=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,Ht,g,ae,de,Ct,V,et,vt,Pt,oe;class us{constructor(n,e,i){s(this,Pt);s(this,p);s(this,Ht);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,Ht,e),h(this,g,i),yt.scrollEntries.register(t(this,p)),this.setIndex(t(this,Ht))}get element(){return t(this,p)}get index(){return t(this,Ht)}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,Ht=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:"100%",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,Et,w,st,_,H,$,M,it,rt,W,nt,wt,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,E,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,Et,new d.CSSProperty(this,"--controls",!0));s(this,w,new d.CSSProperty(this,"--axis","y"));s(this,st,new d.CSSProperty(this,"--reverse",!1));s(this,_,new d.CSSProperty(this,"--direction",0));s(this,H,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,wt,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,E,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,w).current,e)});s(this,jt,(e,i)=>{t(this,Et).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,_).current){if(t(this,_).current<0&&i>0)return;if(t(this,_).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,Et)}get axisCSSProperty(){return t(this,w)}get reverseCSSProperty(){return t(this,st)}get directionCSSProperty(){return t(this,_)}get pagesCSSProperty(){return t(this,H)}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,wt)}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,w).current==="y"}get currentProgress(){return this.currentScrollValue/this.loopDistance||0}get targetProgress(){return this.targetScrollValue/this.loopDistance||0}get scrollWidth(){return t(this,w).current==="y"?0:t(this,a).distance}get scrollHeight(){return t(this,w).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,He({},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,H).current){h(this,m,t(this,C)*t(this,H).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 we.WheelControls({element:t(this,f)})),t(this,q).changeEvent.subscribe(t(this,jt)),h(this,dt,new we.KeyboardControls({element:this})),t(this,dt).changeEvent.subscribe(t(this,jt)),h(this,D,new we.DragControls({element:t(this,f),rootElement:this})),t(this,D).changeEvent.subscribe(t(this,jt)),h(this,E,new we.AutoplayControls({culling:this})),t(this,E).changeEvent.subscribe(t(this,be)),t(this,w).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,w).current}),t(this,wt).subscribe(e=>{t(this,D).inertion=typeof e.current=="number"?e.current:1}),t(this,H).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,E).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,E).speed=e.current,!t(this,G)&&e.current&&!e.previous?t(this,E).connect():!e.current&&e.previous&&t(this,E).disconnect()}),t(this,ht).subscribe(e=>{e.current||(t(this,E).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,Et).observe(),t(this,w).observe(),t(this,st).observe(),t(this,_).observe(),t(this,H).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,wt).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(),_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,Et).unobserve(),t(this,w).unobserve(),t(this,st).unobserve(),t(this,_).unobserve(),t(this,H).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,wt).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(),_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,Et=new WeakMap,w=new WeakMap,st=new WeakMap,_=new WeakMap,H=new WeakMap,$=new WeakMap,M=new WeakMap,it=new WeakMap,rt=new WeakMap,W=new WeakMap,nt=new WeakMap,wt=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,E=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,w).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,E).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,E).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,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"}),_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,E).direction=e),t(this,A).current&&t(this,E).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)),_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,Ee,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,Ee,()=>{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,Ee)),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,Ee)),t(this,bt).counter.unsubscribe(t(this,re)),t(this,Y).remove()}}Y=new WeakMap,bt=new WeakMap,ie=new WeakMap,Pe=new WeakMap,Ee=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.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;
|
package/lib/scroll/index.js
CHANGED
|
@@ -17,7 +17,7 @@ var t = (p, n, e) => (Le(p, n, "read from private field"), e ? e.call(p) : n.get
|
|
|
17
17
|
import { S as Qe } from "../Store-swP_0ymB.js";
|
|
18
18
|
import { i as H } from "../index-euf5anj6.js";
|
|
19
19
|
import { a as Xe } from "../easings-Bni3YAAW.js";
|
|
20
|
-
import { d as
|
|
20
|
+
import { d as ne } from "../events-CsVF98U6.js";
|
|
21
21
|
import { d as ze } from "../function-C10DGppn.js";
|
|
22
22
|
import { c as Ne } from "../jss-DtnXPEnq.js";
|
|
23
23
|
import { a as Ie, g as ke } from "../layout-DpZo-I0y.js";
|
|
@@ -33,19 +33,19 @@ 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";
|
|
35
35
|
import { device as ls } from "../device/index.js";
|
|
36
|
-
import { elementResizer as
|
|
36
|
+
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, Bt, g,
|
|
40
|
+
var f, Bt, g, ae, ue, yt, $, et, Ct, xt, he;
|
|
41
41
|
class us {
|
|
42
42
|
constructor(n, e, i) {
|
|
43
43
|
s(this, xt);
|
|
44
44
|
s(this, f);
|
|
45
45
|
s(this, Bt);
|
|
46
46
|
s(this, g);
|
|
47
|
-
s(this, ce, 0);
|
|
48
47
|
s(this, ae, 0);
|
|
48
|
+
s(this, ue, 0);
|
|
49
49
|
s(this, yt, 0);
|
|
50
50
|
s(this, $, 0);
|
|
51
51
|
s(this, et, null);
|
|
@@ -62,10 +62,10 @@ class us {
|
|
|
62
62
|
return t(this, yt);
|
|
63
63
|
}
|
|
64
64
|
get width() {
|
|
65
|
-
return t(this,
|
|
65
|
+
return t(this, ae);
|
|
66
66
|
}
|
|
67
67
|
get height() {
|
|
68
|
-
return t(this,
|
|
68
|
+
return t(this, ue);
|
|
69
69
|
}
|
|
70
70
|
get position() {
|
|
71
71
|
return t(this, $);
|
|
@@ -83,7 +83,7 @@ class us {
|
|
|
83
83
|
n ? (t(this, f).style.setProperty("--size", n + "px"), t(this, g).axisCSSProperty.current === "x" ? (t(this, f).style.width = n + "px", t(this, f).style.height = "") : (t(this, f).style.height = n + "px", t(this, f).style.width = "")) : (t(this, f).style.width = "", t(this, f).style.height = "", t(this, f).style.removeProperty("--size"));
|
|
84
84
|
}
|
|
85
85
|
resize() {
|
|
86
|
-
h(this,
|
|
86
|
+
h(this, ae, t(this, f).offsetWidth), h(this, ue, t(this, f).offsetHeight), h(this, yt, t(this, g).vertical ? t(this, f).offsetHeight : t(this, f).offsetWidth), h(this, $, t(this, g).vertical ? Ie(t(this, f)) : ke(t(this, f))), h(this, $, t(this, $) - t(this, g).contentPosition);
|
|
87
87
|
}
|
|
88
88
|
transform() {
|
|
89
89
|
const n = t(this, g).shiftSectionPositionCSSProperty.current;
|
|
@@ -98,7 +98,7 @@ class us {
|
|
|
98
98
|
h(this, Ct, v * -1), t(this, g).vertical ? t(this, f).style.transform = `translate3d(0px, ${t(this, Ct)}px, 0px)` : t(this, f).style.transform = `translate3d(${t(this, Ct)}px, 0px, 0px)`;
|
|
99
99
|
}
|
|
100
100
|
setMark(n) {
|
|
101
|
-
t(this, et) !== n && (t(this, et) && t(this, f).classList.remove(t(this, et)), n && t(this, f).classList.add(n), h(this, et, n),
|
|
101
|
+
t(this, et) !== n && (t(this, et) && t(this, f).classList.remove(t(this, et)), n && t(this, f).classList.add(n), h(this, et, n), ne(t(this, f), "scrollSectionMarkChange", {
|
|
102
102
|
composed: !0,
|
|
103
103
|
detail: {
|
|
104
104
|
mark: t(this, et)
|
|
@@ -110,19 +110,19 @@ class us {
|
|
|
110
110
|
t(this, f).classList.toggle("middle", n);
|
|
111
111
|
}
|
|
112
112
|
setIndex(n) {
|
|
113
|
-
c(this, xt,
|
|
113
|
+
c(this, xt, he).call(this, "index", n);
|
|
114
114
|
}
|
|
115
115
|
setCurrentIndex(n) {
|
|
116
|
-
c(this, xt,
|
|
116
|
+
c(this, xt, he).call(this, "current-index", n);
|
|
117
117
|
}
|
|
118
118
|
setCurrentIndexArc(n) {
|
|
119
|
-
c(this, xt,
|
|
119
|
+
c(this, xt, he).call(this, "current-index-arc", n);
|
|
120
120
|
}
|
|
121
121
|
setCurrentIndexArcAbs(n) {
|
|
122
|
-
c(this, xt,
|
|
122
|
+
c(this, xt, he).call(this, "current-index-arc-abs", n);
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
|
-
f = new WeakMap(), Bt = new WeakMap(), g = new WeakMap(),
|
|
125
|
+
f = new WeakMap(), Bt = new WeakMap(), g = new WeakMap(), ae = new WeakMap(), ue = new WeakMap(), yt = new WeakMap(), $ = new WeakMap(), et = new WeakMap(), Ct = new WeakMap(), xt = 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({
|
|
@@ -143,7 +143,8 @@ const ds = Ne({
|
|
|
143
143
|
".content-wrapper": {
|
|
144
144
|
width: "100%",
|
|
145
145
|
height: "100%",
|
|
146
|
-
overflow: "var(--overflow, initial)"
|
|
146
|
+
overflow: "var(--overflow, initial)",
|
|
147
|
+
borderRadius: "var(--border-radius, unset)"
|
|
147
148
|
},
|
|
148
149
|
".content": {
|
|
149
150
|
position: "relative",
|
|
@@ -163,7 +164,7 @@ const ds = Ne({
|
|
|
163
164
|
flexShrink: "0"
|
|
164
165
|
}
|
|
165
166
|
});
|
|
166
|
-
var u, wt, E, st, B, W, F, T, it, rt, N, nt, Et, D, C, Pt, Lt, zt, It, Wt, kt, A, At, ht, M, ot, q, Mt, lt, Tt, ct, at, ut, m, Ft, l,
|
|
167
|
+
var u, wt, E, st, B, W, F, T, it, rt, N, nt, Et, D, C, Pt, Lt, zt, It, Wt, kt, A, At, ht, M, ot, q, Mt, lt, Tt, ct, at, ut, m, Ft, l, de, pe, y, S, k, R, dt, V, w, P, Nt, U, G, K, _, qt, pt, Z, Ut, O, x, Gt, j, Dt, Kt, o, Me, oe, Ot, we, Ee, Te, De, L, fe, Ge, _t, me, Re, Ve, gt, Ke, be, le, Se;
|
|
167
168
|
class $t extends HTMLElement {
|
|
168
169
|
constructor() {
|
|
169
170
|
super();
|
|
@@ -251,14 +252,14 @@ class $t extends HTMLElement {
|
|
|
251
252
|
s(this, m, null);
|
|
252
253
|
s(this, Ft, null);
|
|
253
254
|
s(this, l, []);
|
|
254
|
-
s(this, ue, 0);
|
|
255
255
|
s(this, de, 0);
|
|
256
|
+
s(this, pe, 0);
|
|
256
257
|
s(this, y, 0);
|
|
257
258
|
s(this, S, 0);
|
|
258
259
|
s(this, k, 0);
|
|
259
|
-
s(this, V, null);
|
|
260
|
-
s(this, dt, null);
|
|
261
260
|
s(this, R, null);
|
|
261
|
+
s(this, dt, null);
|
|
262
|
+
s(this, V, null);
|
|
262
263
|
s(this, w, null);
|
|
263
264
|
s(this, P, new Qe(0));
|
|
264
265
|
s(this, Nt, 0);
|
|
@@ -283,14 +284,14 @@ class $t extends HTMLElement {
|
|
|
283
284
|
}
|
|
284
285
|
this.resize();
|
|
285
286
|
});
|
|
286
|
-
s(this,
|
|
287
|
+
s(this, fe, () => {
|
|
287
288
|
if (!t(this, G) || t(this, _) || t(this, K))
|
|
288
289
|
return;
|
|
289
290
|
const e = this.currentScrollValue;
|
|
290
291
|
if (h(this, Nt, Math.max(0, e - t(this, S))), t(this, l).length) {
|
|
291
292
|
for (let i = 0; i < t(this, l).length; i++)
|
|
292
293
|
t(this, l)[i].transform();
|
|
293
|
-
t(this, P).current = c(this, o,
|
|
294
|
+
t(this, P).current = c(this, o, le).call(this);
|
|
294
295
|
} else
|
|
295
296
|
this.vertical ? t(this, m).style.transform = `translate3d(0px, ${e * -1}px, 0px)` : t(this, m).style.transform = `translate3d(${e * -1}px, 0px, 0px)`;
|
|
296
297
|
c(this, o, Ke).call(this), vt.update(
|
|
@@ -300,9 +301,9 @@ class $t extends HTMLElement {
|
|
|
300
301
|
);
|
|
301
302
|
});
|
|
302
303
|
s(this, _t, (e, i) => {
|
|
303
|
-
t(this, wt).current && (c(this, o,
|
|
304
|
+
t(this, wt).current && (c(this, o, Re).call(this, Math.sign(i) || 1), t(this, me).call(this, e, i));
|
|
304
305
|
});
|
|
305
|
-
s(this,
|
|
306
|
+
s(this, me, (e, i) => {
|
|
306
307
|
if (t(this, B).current) {
|
|
307
308
|
if (t(this, B).current < 0 && i > 0)
|
|
308
309
|
return;
|
|
@@ -310,7 +311,7 @@ class $t extends HTMLElement {
|
|
|
310
311
|
return;
|
|
311
312
|
}
|
|
312
313
|
if (t(this, pt) || t(this, Z).unlistenAnimationFrame(), !t(this, A).current && t(this, lt).current && (clearInterval(t(this, qt)), h(this, qt, setTimeout(() => {
|
|
313
|
-
const r = t(this, l)[c(this, o,
|
|
314
|
+
const r = t(this, l)[c(this, o, le).call(this)];
|
|
314
315
|
r && this.scrollToSection(r.index, {
|
|
315
316
|
tween: {
|
|
316
317
|
duration: t(this, Tt).current,
|
|
@@ -327,7 +328,7 @@ class $t extends HTMLElement {
|
|
|
327
328
|
duration: t(this, rt).current || 500
|
|
328
329
|
} : void 0
|
|
329
330
|
};
|
|
330
|
-
t(this, Ut) ? this.scrollToSection(c(this, o,
|
|
331
|
+
t(this, Ut) ? this.scrollToSection(c(this, o, le).call(this, !0), a) : this.shiftSections(r, a);
|
|
331
332
|
} else
|
|
332
333
|
t(this, u).shift(r * t(this, y));
|
|
333
334
|
} else
|
|
@@ -335,7 +336,7 @@ class $t extends HTMLElement {
|
|
|
335
336
|
h(this, Ut, e === "drag");
|
|
336
337
|
}
|
|
337
338
|
});
|
|
338
|
-
s(this,
|
|
339
|
+
s(this, be, ze(() => {
|
|
339
340
|
const e = t(this, j).reduce((i, r) => {
|
|
340
341
|
const a = this.vertical ? r.width : r.height;
|
|
341
342
|
return a > i ? a : i;
|
|
@@ -344,7 +345,7 @@ class $t extends HTMLElement {
|
|
|
344
345
|
h(this, Dt, !0), this.style.setProperty("--max-section-size", e + "px");
|
|
345
346
|
}, 10));
|
|
346
347
|
}, 20));
|
|
347
|
-
s(this,
|
|
348
|
+
s(this, Se, () => {
|
|
348
349
|
h(this, x, !0), this.hibernatedCSSProperty.current || c(this, o, De).call(this);
|
|
349
350
|
});
|
|
350
351
|
if (H) {
|
|
@@ -455,10 +456,10 @@ class $t extends HTMLElement {
|
|
|
455
456
|
return t(this, at);
|
|
456
457
|
}
|
|
457
458
|
get currentScrollValue() {
|
|
458
|
-
return c(this, o,
|
|
459
|
+
return c(this, o, Ve).call(this, "current");
|
|
459
460
|
}
|
|
460
461
|
get targetScrollValue() {
|
|
461
|
-
return c(this, o,
|
|
462
|
+
return c(this, o, Ve).call(this, "target");
|
|
462
463
|
}
|
|
463
464
|
get contentWrapperElement() {
|
|
464
465
|
return t(this, ut);
|
|
@@ -470,10 +471,10 @@ class $t extends HTMLElement {
|
|
|
470
471
|
return t(this, l);
|
|
471
472
|
}
|
|
472
473
|
get position() {
|
|
473
|
-
return t(this,
|
|
474
|
+
return t(this, de);
|
|
474
475
|
}
|
|
475
476
|
get contentPosition() {
|
|
476
|
-
return t(this,
|
|
477
|
+
return t(this, pe);
|
|
477
478
|
}
|
|
478
479
|
get viewportSize() {
|
|
479
480
|
return t(this, y);
|
|
@@ -523,7 +524,7 @@ class $t extends HTMLElement {
|
|
|
523
524
|
return t(this, E).current === "x" ? 0 : t(this, u).distance;
|
|
524
525
|
}
|
|
525
526
|
tryResplit() {
|
|
526
|
-
!t(this, _) && (t(this, C).current || t(this, F).current || t(this, C).current || t(this, N).current || t(this, T).current) && c(this, o,
|
|
527
|
+
!t(this, _) && (t(this, C).current || t(this, F).current || t(this, C).current || t(this, N).current || t(this, T).current) && c(this, o, oe).call(this);
|
|
527
528
|
}
|
|
528
529
|
onScroll(...e) {
|
|
529
530
|
return t(this, u).subscribe(...e);
|
|
@@ -549,15 +550,16 @@ class $t extends HTMLElement {
|
|
|
549
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];
|
|
550
551
|
if (b && v) {
|
|
551
552
|
let I = 0;
|
|
552
|
-
const Pe = c(this, o,
|
|
553
|
-
|
|
553
|
+
const Pe = c(this, o, le).call(this), Vt = t(this, l)[Pe];
|
|
554
|
+
let re = Vt ? this.targetScrollValue - Vt.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), 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);
|
|
554
556
|
}
|
|
555
557
|
}
|
|
556
558
|
shiftSections(e, i) {
|
|
557
559
|
t(this, l).length && this.scrollToSection(t(this, P).current + e, i);
|
|
558
560
|
}
|
|
559
561
|
setPosition(e, i) {
|
|
560
|
-
c(this, o,
|
|
562
|
+
c(this, o, Re).call(this, Math.sign(e) || 1), i != null && i.tween ? t(this, pt) || (t(this, Z).set(t(this, u).current, { equalize: !0 }), t(this, Z).set(e, We({}, i.tween)), h(this, pt, setTimeout(() => {
|
|
561
563
|
h(this, pt, void 0);
|
|
562
564
|
}, i.tween.duration || 0))) : t(this, u).set(e, {
|
|
563
565
|
equalize: (i == null ? void 0 : i.behaviour) === "instant"
|
|
@@ -571,7 +573,7 @@ class $t extends HTMLElement {
|
|
|
571
573
|
return;
|
|
572
574
|
t(this, u).unlistenAnimationFrame();
|
|
573
575
|
const e = this.currentScrollValue / t(this, S) || 0, i = t(this, P).current;
|
|
574
|
-
if (h(this,
|
|
576
|
+
if (h(this, de, this.vertical ? Ie(this) : ke(this)), h(this, pe, this.vertical ? Ie(t(this, m)) : ke(t(this, m))), h(this, y, this.vertical ? this.offsetHeight : this.offsetWidth), this.vertical ? h(this, k, Fe.parse(
|
|
575
577
|
getComputedStyle(t(this, m)).rowGap
|
|
576
578
|
)) : h(this, k, Fe.parse(
|
|
577
579
|
getComputedStyle(t(this, m)).columnGap
|
|
@@ -610,38 +612,38 @@ class $t extends HTMLElement {
|
|
|
610
612
|
t(this, u).set(e * t(this, S), {
|
|
611
613
|
equalize: !0
|
|
612
614
|
});
|
|
613
|
-
h(this, G, (this.vertical ? t(this, m).offsetHeight : t(this, m).offsetWidth) > t(this, y)), this.classList.toggle("has-overflow", t(this, G)), t(this, G) ? t(this, ct).current || c(this, o, Ee).call(this) : c(this, o, we).call(this), t(this,
|
|
615
|
+
h(this, G, (this.vertical ? t(this, m).offsetHeight : t(this, m).offsetWidth) > t(this, y)), this.classList.toggle("has-overflow", t(this, G)), t(this, G) ? t(this, ct).current || c(this, o, Ee).call(this) : c(this, o, we).call(this), t(this, be).call(this), ne(this, "scrollResize", { custom: !0 }), t(this, u).notify();
|
|
614
616
|
}
|
|
615
617
|
connectedCallback() {
|
|
616
618
|
vt.register(this), h(this, u, new ss(0, {
|
|
617
619
|
damping: 0.01,
|
|
618
620
|
min: 0,
|
|
619
621
|
order: es.SCROLL
|
|
620
|
-
})), this.setAttribute("tabindex", "0"), h(this,
|
|
622
|
+
})), this.setAttribute("tabindex", "0"), h(this, R, new rs({ element: t(this, m) })), t(this, R).changeEvent.subscribe(t(this, _t)), h(this, dt, new ns({
|
|
621
623
|
element: this
|
|
622
624
|
})), t(this, dt).changeEvent.subscribe(
|
|
623
625
|
t(this, _t)
|
|
624
|
-
), h(this,
|
|
626
|
+
), h(this, V, new hs({
|
|
625
627
|
element: t(this, m),
|
|
626
628
|
rootElement: this
|
|
627
|
-
})), t(this,
|
|
629
|
+
})), t(this, V).changeEvent.subscribe(t(this, _t)), h(this, w, new os({
|
|
628
630
|
culling: this
|
|
629
|
-
})), t(this, w).changeEvent.subscribe(t(this,
|
|
631
|
+
})), t(this, w).changeEvent.subscribe(t(this, me)), t(this, E).subscribe(() => {
|
|
630
632
|
c(this, o, Me).call(this);
|
|
631
633
|
}), t(this, st).subscribe(() => {
|
|
632
634
|
c(this, o, Me).call(this);
|
|
633
635
|
}), t(this, nt).subscribe((e) => {
|
|
634
|
-
t(this,
|
|
636
|
+
t(this, R).axis = e.current ? "max" : t(this, E).current;
|
|
635
637
|
}), t(this, Et).subscribe((e) => {
|
|
636
|
-
t(this,
|
|
638
|
+
t(this, V).inertion = typeof e.current == "number" ? e.current : 1;
|
|
637
639
|
}), t(this, W).subscribe(() => {
|
|
638
640
|
t(this, x) && t(this, L).call(this);
|
|
639
641
|
}), t(this, F).subscribe(({ current: e }) => {
|
|
640
|
-
t(this, x) && (e ? c(this, o,
|
|
642
|
+
t(this, x) && (e ? c(this, o, oe).call(this) : c(this, o, Ot).call(this));
|
|
641
643
|
}), t(this, T).subscribe((e) => {
|
|
642
|
-
t(this,
|
|
644
|
+
t(this, R).debounce = e.current, t(this, V).swipe = e.current, t(this, w).interval = e.current, t(this, x) && (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, Ot).call(this));
|
|
643
645
|
}), t(this, N).subscribe((e) => {
|
|
644
|
-
t(this, x) && (t(this, L).call(this), e.current && !e.previous && !t(this, l).length ? c(this, o,
|
|
646
|
+
t(this, x) && (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, Ot).call(this));
|
|
645
647
|
}), t(this, D).subscribe((e) => {
|
|
646
648
|
t(this, x) && (t(this, L).call(this), c(this, o, gt).call(this));
|
|
647
649
|
}), t(this, C).subscribe((e) => {
|
|
@@ -674,50 +676,50 @@ class $t extends HTMLElement {
|
|
|
674
676
|
e.current && !e.previous ? (this.classList.add("disabled"), c(this, o, we).call(this)) : !e.current && e.previous && (this.classList.remove("disabled"), c(this, o, Ee).call(this));
|
|
675
677
|
}), t(this, at).subscribe((e) => {
|
|
676
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));
|
|
677
|
-
}), t(this, wt).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, Wt).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(), Ht.subscribe(t(this,
|
|
679
|
+
}), t(this, wt).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, Wt).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(), Ht.subscribe(t(this, Se), Ae.LAST), ce.subscribe(this, t(this, L)), t(this, Gt).observe(this, { childList: !0 });
|
|
678
680
|
}
|
|
679
681
|
disconnectedCallback() {
|
|
680
|
-
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, 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, Wt).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(), Ht.unsubscribe(t(this,
|
|
682
|
+
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, 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, Wt).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(), Ht.unsubscribe(t(this, Se)), ce.unsubscribe(t(this, L)), c(this, o, Te).call(this), t(this, Gt).disconnect();
|
|
681
683
|
}
|
|
682
684
|
}
|
|
683
|
-
u = new WeakMap(), wt = 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(), Wt = 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(), Ft = new WeakMap(), l = new WeakMap(),
|
|
685
|
+
u = new WeakMap(), wt = 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(), Wt = 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(), Ft = 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(), w = new WeakMap(), P = new WeakMap(), Nt = new WeakMap(), U = new WeakMap(), G = new WeakMap(), K = new WeakMap(), _ = new WeakMap(), qt = new WeakMap(), pt = new WeakMap(), Z = new WeakMap(), Ut = new WeakMap(), O = new WeakMap(), x = new WeakMap(), Gt = new WeakMap(), j = new WeakMap(), Dt = new WeakMap(), Kt = new WeakMap(), o = new WeakSet(), Me = function() {
|
|
684
686
|
const e = t(this, E).current, i = t(this, st).current ? "-reverse" : "";
|
|
685
|
-
t(this, m).style.flexDirection = e === "x" ? `row${i}` : `column${i}`, t(this,
|
|
686
|
-
},
|
|
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, x) && t(this, L).call(this);
|
|
688
|
+
}, oe = function() {
|
|
687
689
|
c(this, o, Ot).call(this), t(this, Ft).assignedElements().forEach((e, i) => {
|
|
688
690
|
e instanceof HTMLElement && t(this, l).push(new us(e, i, this));
|
|
689
|
-
}), t(this, m).style.transform = "", this.style.setProperty("--sections", t(this, l).length.toString()),
|
|
691
|
+
}), t(this, m).style.transform = "", this.style.setProperty("--sections", t(this, l).length.toString()), ne(this, "scrollSectionsChange", {
|
|
690
692
|
custom: !0,
|
|
691
693
|
composed: !0
|
|
692
694
|
}), t(this, L).call(this), c(this, o, gt).call(this);
|
|
693
695
|
}, Ot = function() {
|
|
694
696
|
t(this, l).forEach((e) => {
|
|
695
697
|
e.destroy();
|
|
696
|
-
}), h(this, l, []), t(this, P).reset(), t(this, u).reset(), this.style.removeProperty("--max-section-size"),
|
|
698
|
+
}), h(this, l, []), t(this, P).reset(), t(this, u).reset(), this.style.removeProperty("--max-section-size"), ne(this, "scrollSectionsChange", {
|
|
697
699
|
custom: !0,
|
|
698
700
|
composed: !0
|
|
699
701
|
});
|
|
700
702
|
}, we = function() {
|
|
701
|
-
t(this, K) || (h(this, K, !0), t(this, u).unsubscribe(t(this,
|
|
703
|
+
t(this, K) || (h(this, K, !0), t(this, u).unsubscribe(t(this, fe)), t(this, u).unlistenAnimationFrame(), clearInterval(t(this, qt)), clearInterval(t(this, pt)), t(this, Z).unlistenAnimationFrame(), t(this, R).disconnect(), t(this, dt).disconnect(), t(this, V).disconnect(), t(this, w).disconnect(), t(this, G) || (this.sections.forEach((e) => {
|
|
702
704
|
e.unsetTransform();
|
|
703
705
|
}), t(this, L).call(this)));
|
|
704
706
|
}, Ee = function() {
|
|
705
|
-
t(this, K) && (h(this, K, !1), t(this, u).subscribe(t(this,
|
|
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, w).connect());
|
|
706
708
|
}, Te = function() {
|
|
707
709
|
t(this, _) || (h(this, _, !0), clearTimeout(t(this, Kt)), Ht.unsubscribe(t(this, L)), c(this, o, we).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, Ot).call(this) : (t(this, P).reset(), t(this, u).reset()), vt.unregister(this));
|
|
708
710
|
}, De = function() {
|
|
709
711
|
t(this, _) && (h(this, _, !1), vt.register(this), this.tryResplit(), c(this, o, Ee).call(this), this.scrollToSection(t(this, kt).current, {
|
|
710
712
|
behaviour: "instant"
|
|
711
713
|
}), Ht.subscribe(t(this, L), Ae.SCROLL));
|
|
712
|
-
}, L = new WeakMap(),
|
|
714
|
+
}, L = new WeakMap(), fe = new WeakMap(), Ge = function(e) {
|
|
713
715
|
let i = t(this, P).current;
|
|
714
716
|
return t(this, C).current ? i = ts(e, t(this, l).length) : i = qe(e, 0, this.limit), i;
|
|
715
|
-
}, _t = new WeakMap(),
|
|
717
|
+
}, _t = new WeakMap(), me = new WeakMap(), Re = function(e = 1) {
|
|
716
718
|
t(this, ht).current && (t(this, w).direction = e), t(this, A).current && t(this, w).pauseAndContinue(
|
|
717
719
|
t(this, At).current,
|
|
718
720
|
this.sectionalCSSProperty.current
|
|
719
721
|
);
|
|
720
|
-
},
|
|
722
|
+
}, Ve = function(e = "current") {
|
|
721
723
|
if (t(this, C).current && t(this, l).length) {
|
|
722
724
|
const i = t(this, u)[e] % Math.round(t(this, S) + t(this, y) + t(this, k));
|
|
723
725
|
return i < 0 ? t(this, S) + i + t(this, y) + t(this, k) : i;
|
|
@@ -726,7 +728,7 @@ u = new WeakMap(), wt = new WeakMap(), E = new WeakMap(), st = new WeakMap(), B
|
|
|
726
728
|
}, gt = function() {
|
|
727
729
|
if (t(this, l).length) {
|
|
728
730
|
const e = t(this, P).current + t(this, ot).current;
|
|
729
|
-
if (e === 0 ? h(this, O, "start") : e === this.limit ? h(this, O, "end") : h(this, O, null),
|
|
731
|
+
if (e === 0 ? h(this, O, "start") : e === this.limit ? h(this, O, "end") : h(this, O, null), ne(this, "scrollLine", {
|
|
730
732
|
detail: { line: t(this, O) }
|
|
731
733
|
}), t(this, M).current) {
|
|
732
734
|
this.classList.remove("end", "start"), t(this, O) && this.classList.add(t(this, O));
|
|
@@ -735,7 +737,7 @@ u = new WeakMap(), wt = new WeakMap(), E = new WeakMap(), st = new WeakMap(), B
|
|
|
735
737
|
r.setCurrentIndex(null), r.setCurrentIndexArc(null), r.setCurrentIndexArcAbs(null), r.setMiddle(!1);
|
|
736
738
|
const b = e - this.limit - 1 + t(this, q).current, v = e + i, I = this.sections.length - v;
|
|
737
739
|
a >= e && a < v || a <= b ? (r.setMark("current"), t(this, j).push(r)) : a >= v && a < v + I / 2 || a <= b + i ? r.setMark("next") : r.setMark("previous");
|
|
738
|
-
}), t(this,
|
|
740
|
+
}), t(this, be).call(this);
|
|
739
741
|
}
|
|
740
742
|
}
|
|
741
743
|
}, Ke = function() {
|
|
@@ -746,35 +748,35 @@ u = new WeakMap(), wt = new WeakMap(), E = new WeakMap(), st = new WeakMap(), B
|
|
|
746
748
|
i.setCurrentIndex(r), i.setCurrentIndexArc(a), i.setCurrentIndexArcAbs(Math.abs(a)), i.setMiddle(r === e);
|
|
747
749
|
});
|
|
748
750
|
}
|
|
749
|
-
},
|
|
751
|
+
}, be = new WeakMap(), le = function(e = !1) {
|
|
750
752
|
let i = this.targetScrollValue, r = 1 / 0, a = 0;
|
|
751
753
|
const b = t(this, u).direction;
|
|
752
754
|
for (let v = 0; v < t(this, l).length; v++) {
|
|
753
755
|
const I = t(this, l)[v];
|
|
754
|
-
let Pe = t(this, Ut) ? I.size * b * -1 * 0.4 : 0,
|
|
755
|
-
this.overscroll &&
|
|
756
|
-
let
|
|
757
|
-
|
|
756
|
+
let Pe = t(this, Ut) ? I.size * b * -1 * 0.4 : 0, Vt = I.position;
|
|
757
|
+
this.overscroll && Vt === 0 && e && (Vt = t(this, U));
|
|
758
|
+
let re = Math.abs(Vt + Pe - i);
|
|
759
|
+
re <= r && (r = re, a = v);
|
|
758
760
|
}
|
|
759
761
|
return a;
|
|
760
|
-
},
|
|
762
|
+
}, Se = new WeakMap();
|
|
761
763
|
H && !customElements.get("e-scroll") && customElements.define("e-scroll", $t);
|
|
762
|
-
var
|
|
764
|
+
var ge;
|
|
763
765
|
class Oe extends HTMLElement {
|
|
764
766
|
constructor() {
|
|
765
767
|
super(...arguments);
|
|
766
|
-
s(this,
|
|
768
|
+
s(this, ge, null);
|
|
767
769
|
}
|
|
768
770
|
get scrollElement() {
|
|
769
|
-
return t(this,
|
|
771
|
+
return t(this, ge);
|
|
770
772
|
}
|
|
771
773
|
connectedCallback() {
|
|
772
774
|
const e = Ue(this, $t);
|
|
773
|
-
e instanceof $t ? h(this,
|
|
775
|
+
e instanceof $t ? h(this, ge, e) : console.error(this, "e-scroll not found");
|
|
774
776
|
}
|
|
775
777
|
}
|
|
776
|
-
|
|
777
|
-
var ft, z, J, Q, Zt, jt, mt, Jt,
|
|
778
|
+
ge = new WeakMap();
|
|
779
|
+
var ft, z, J, Q, Zt, jt, mt, Jt, ve, ye;
|
|
778
780
|
class ps extends Oe {
|
|
779
781
|
constructor() {
|
|
780
782
|
super();
|
|
@@ -792,10 +794,10 @@ class ps extends Oe {
|
|
|
792
794
|
s(this, Jt, () => {
|
|
793
795
|
h(this, jt, this.scrollElement.currentProgress * t(this, Zt)), t(this, J) ? t(this, z).style.transform = `translate3d(${t(this, jt)}px, 0px, 0px)` : t(this, z).style.transform = `translate3d(0px, ${t(this, jt)}px, 0px)`;
|
|
794
796
|
});
|
|
795
|
-
s(this,
|
|
797
|
+
s(this, ve, () => {
|
|
796
798
|
this.setAttribute("axis", this.scrollElement.axisCSSProperty.current);
|
|
797
799
|
});
|
|
798
|
-
s(this,
|
|
800
|
+
s(this, ye, (e) => {
|
|
799
801
|
document.documentElement.classList.add("grabbing"), cs(
|
|
800
802
|
(a) => {
|
|
801
803
|
const b = t(this, J) ? a.x : a.y, v = this.scrollElement.distance / t(this, Zt), I = (b - r) * v;
|
|
@@ -848,13 +850,13 @@ class ps extends Oe {
|
|
|
848
850
|
connectedCallback() {
|
|
849
851
|
super.connectedCallback(), this.setAttribute("drag-dead-zone", "");
|
|
850
852
|
const e = t(this, ft).assignedElements()[0] || t(this, ft).firstElementChild;
|
|
851
|
-
h(this, z, e), t(this, z).addEventListener("pointerdown", t(this,
|
|
853
|
+
h(this, z, e), t(this, z).addEventListener("pointerdown", t(this, ye)), Ht.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));
|
|
852
854
|
}
|
|
853
855
|
disconnectedCallback() {
|
|
854
|
-
this.removeAttribute("drag-dead-zone"), this.style.display = "", t(this, z).removeEventListener("pointerdown", t(this,
|
|
856
|
+
this.removeAttribute("drag-dead-zone"), this.style.display = "", t(this, z).removeEventListener("pointerdown", t(this, ye)), Ht.unsubscribe(t(this, mt)), ce.unsubscribe(t(this, mt)), this.scrollElement.offScroll(t(this, Jt)), this.scrollElement.axisCSSProperty.unsubscribe(t(this, ve));
|
|
855
857
|
}
|
|
856
858
|
}
|
|
857
|
-
ft = new WeakMap(), z = new WeakMap(), J = new WeakMap(), Q = new WeakMap(), Zt = new WeakMap(), jt = new WeakMap(), mt = new WeakMap(), Jt = new WeakMap(),
|
|
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();
|
|
858
860
|
H && !customElements.get("e-scrollbar") && customElements.define("e-scrollbar", ps);
|
|
859
861
|
var Qt, Xt, Yt;
|
|
860
862
|
class _e extends Oe {
|
|
@@ -927,16 +929,16 @@ class ms extends _e {
|
|
|
927
929
|
}
|
|
928
930
|
X = new WeakMap(), ee = new WeakMap();
|
|
929
931
|
H && !customElements.get("e-scroll-step-button") && customElements.define("e-scroll-step-button", ms);
|
|
930
|
-
var Y, bt, se,
|
|
932
|
+
var Y, bt, se, Ce, xe, ie;
|
|
931
933
|
class bs {
|
|
932
934
|
constructor(n, e, i) {
|
|
933
935
|
s(this, Y, null);
|
|
934
936
|
s(this, bt, null);
|
|
935
937
|
s(this, se, null);
|
|
936
|
-
s(this,
|
|
937
|
-
s(this,
|
|
938
|
+
s(this, Ce, null);
|
|
939
|
+
s(this, xe, () => {
|
|
938
940
|
t(this, bt).scrollToSection(t(this, se), {
|
|
939
|
-
behaviour: t(this,
|
|
941
|
+
behaviour: t(this, Ce)
|
|
940
942
|
});
|
|
941
943
|
});
|
|
942
944
|
s(this, ie, () => {
|
|
@@ -945,21 +947,21 @@ class bs {
|
|
|
945
947
|
t(this, bt).counter.current === t(this, se)
|
|
946
948
|
);
|
|
947
949
|
});
|
|
948
|
-
H && (h(this, Y, document.createElement("button")), h(this, bt, n), h(this,
|
|
950
|
+
H && (h(this, Y, document.createElement("button")), h(this, bt, n), h(this, Ce, i), h(this, se, e), t(this, Y).addEventListener("click", t(this, xe)), t(this, bt).counter.subscribe(t(this, ie)), t(this, ie).call(this));
|
|
949
951
|
}
|
|
950
952
|
get element() {
|
|
951
953
|
return t(this, Y);
|
|
952
954
|
}
|
|
953
955
|
destroy() {
|
|
954
|
-
t(this, Y).removeEventListener("click", t(this,
|
|
956
|
+
t(this, Y).removeEventListener("click", t(this, xe)), t(this, bt).counter.unsubscribe(t(this, ie)), t(this, Y).remove();
|
|
955
957
|
}
|
|
956
958
|
}
|
|
957
|
-
Y = new WeakMap(), bt = new WeakMap(), se = new WeakMap(),
|
|
958
|
-
var
|
|
959
|
+
Y = new WeakMap(), bt = new WeakMap(), se = new WeakMap(), Ce = new WeakMap(), xe = new WeakMap(), ie = new WeakMap();
|
|
960
|
+
var Rt, St, tt;
|
|
959
961
|
class Ss extends Oe {
|
|
960
962
|
constructor() {
|
|
961
963
|
super(...arguments);
|
|
962
|
-
s(this,
|
|
964
|
+
s(this, Rt, null);
|
|
963
965
|
s(this, St, []);
|
|
964
966
|
s(this, tt, ze(() => {
|
|
965
967
|
t(this, St).forEach((i) => i.destroy()), h(this, St, []);
|
|
@@ -971,7 +973,7 @@ class Ss extends Oe {
|
|
|
971
973
|
i,
|
|
972
974
|
this.getAttribute("behaviour") || "smooth"
|
|
973
975
|
);
|
|
974
|
-
t(this,
|
|
976
|
+
t(this, Rt).appendChild(r.element), t(this, St).push(r);
|
|
975
977
|
}
|
|
976
978
|
}, 0));
|
|
977
979
|
}
|
|
@@ -981,7 +983,7 @@ class Ss extends Oe {
|
|
|
981
983
|
t(this, tt)
|
|
982
984
|
), this.scrollElement.sectionsInViewCSSProperty.subscribe(
|
|
983
985
|
t(this, tt)
|
|
984
|
-
), this.scrollElement.loopCSSProperty.subscribe(t(this, tt)), h(this,
|
|
986
|
+
), this.scrollElement.loopCSSProperty.subscribe(t(this, tt)), h(this, Rt, document.createElement("div")), this.appendChild(t(this, Rt));
|
|
985
987
|
}
|
|
986
988
|
disconnectedCallback() {
|
|
987
989
|
this.scrollElement.removeEventListener(
|
|
@@ -989,10 +991,10 @@ class Ss extends Oe {
|
|
|
989
991
|
t(this, tt)
|
|
990
992
|
), this.scrollElement.sectionsInViewCSSProperty.unsubscribe(
|
|
991
993
|
t(this, tt)
|
|
992
|
-
), 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, Rt).remove();
|
|
993
995
|
}
|
|
994
996
|
}
|
|
995
|
-
|
|
997
|
+
Rt = new WeakMap(), St = new WeakMap(), tt = new WeakMap();
|
|
996
998
|
H && !customElements.get("e-scroll-bullet-buttons") && customElements.define("e-scroll-bullet-buttons", Ss);
|
|
997
999
|
class gs extends as {
|
|
998
1000
|
connectedCallback() {
|