aptechka 0.51.1 → 0.51.2
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 +120 -118
- package/package.json +1 -1
package/lib/scroll/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var Ue=Object.defineProperty;var ke=Object.getOwnPropertySymbols;var Ge=Object.prototype.hasOwnProperty,Ze=Object.prototype.propertyIsEnumerable;var Re=d=>{throw TypeError(d)};var Ae=(d,n,e)=>n in d?Ue(d,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):d[n]=e,Me=(d,n)=>{for(var e in n||(n={}))Ge.call(n,e)&&Ae(d,e,n[e]);if(ke)for(var e of ke(n))Ze.call(n,e)&&Ae(d,e,n[e]);return d};var Pe=(d,n,e)=>n.has(d)||Re("Cannot "+e);var t=(d,n,e)=>(Pe(d,n,"read from private field"),e?e.call(d):n.get(d)),s=(d,n,e)=>n.has(d)?Re("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(d):n.set(d,e),h=(d,n,e,i)=>(Pe(d,n,"write to private field"),i?i.call(d,e):n.set(d,e),e),l=(d,n,e)=>(Pe(d,n,"access private method"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const je=require("../Store-GokLe_g-.cjs"),O=require("../index-Cqw2NKev.cjs"),Ke=require("../easings-GegIwET5.cjs"),te=require("../events-KVanG9sR.cjs"),qe=require("../jss-CRBgdvJ3.cjs"),Dt=require("../layout-Ctc2p3uz.cjs"),De=require("../math-GDWEqu7y.cjs"),Je=require("../number-0243DApo.cjs");require("../ticker/index.cjs");const ge=require("../order/index.cjs"),Qe=require("../Damped-DgAIjXp3.cjs"),Xe=require("../Tweened-DpJDlbj9.cjs"),me=require("../controls/index.cjs"),Bt=require("../window-resizer/index.cjs"),gt=require("../scroll-entries/index.cjs"),Te=require("../css-unit-parser/index.cjs"),S=require("../css-property/index.cjs"),Ye=require("../device/index.cjs"),re=require("../element-resizer/index.cjs"),ts=require("../gestures-C7gbKx11.cjs"),Be=require("../dom-JBOkFLTh.cjs"),es=require("../function-MthRj-GJ.cjs"),ss=require("../scroll-segment/index.cjs");var f,Ot,g,yt,V,Y,Ct,vt,ee;class is{constructor(n,e,i){s(this,vt);s(this,f);s(this,Ot);s(this,g);s(this,yt,0);s(this,V,0);s(this,Y,null);s(this,Ct,0);h(this,f,n),h(this,Ot,e),h(this,g,i),gt.scrollEntries.register(t(this,f)),this.setIndex(t(this,Ot))}get element(){return t(this,f)}get index(){return t(this,Ot)}get size(){return t(this,yt)}get position(){return t(this,V)}get transformPosition(){return t(this,Ct)}destroy(){gt.scrollEntries.unregister(t(this,f)),this.unsetTransform()}unsetTransform(){t(this,f).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,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"))}resize(){h(this,yt,t(this,g).vertical?t(this,f).offsetHeight:t(this,f).offsetWidth),h(this,V,t(this,g).vertical?Dt.getCumulativeOffsetTop(t(this,f)):Dt.getCumulativeOffsetLeft(t(this,f))),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,yt)<t(this,g).currentScrollValue-n&&(e=(t(this,g).distance-n)*-1-t(this,g).gap),gt.scrollEntries.update(t(this,f),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,yt)+i,y=De.clamp(r,u,b);h(this,Ct,y*-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)`}setMark(n){t(this,Y)!==n&&(t(this,Y)&&t(this,f).classList.remove(t(this,Y)),n&&t(this,f).classList.add(n),h(this,Y,n),te.dispatchEvent(t(this,f),"scrollSectionMarkChange",{composed:!0,detail:{mark:t(this,Y)},custom:!0}))}setMiddle(n){t(this,f).classList.toggle("middle",n)}setIndex(n){l(this,vt,ee).call(this,"index",n)}setCurrentIndex(n){l(this,vt,ee).call(this,"current-index",n)}setCurrentIndexArc(n){l(this,vt,ee).call(this,"current-index-arc",n)}setCurrentIndexArcAbs(n){l(this,vt,ee).call(this,"current-index-arc-abs",n)}}f=new WeakMap,Ot=new WeakMap,g=new WeakMap,yt=new WeakMap,V=new WeakMap,Y=new WeakMap,Ct=new WeakMap,vt=new WeakSet,ee=function(n,e){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}`))};const rs=qe.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,Pt,E,tt,_,H,$,M,et,st,W,it,wt,T,v,Et,xt,Lt,zt,Vt,A,It,rt,R,nt,F,kt,ht,At,ot,lt,ct,p,_t,c,ne,he,C,m,k,q,ut,D,w,x,Ht,N,U,G,Z,$t,at,j,Wt,B,P,oe,dt,o,we,se,qt,ye,Ce,Ee,xe,L,le,Oe,Ft,ce,Le,ze,mt,Ve,ie,ue;class Mt extends HTMLElement{constructor(){super();s(this,o);s(this,a,null);s(this,Pt,new S.CSSProperty(this,"--controls",!0));s(this,E,new S.CSSProperty(this,"--axis","y"));s(this,tt,new S.CSSProperty(this,"--reverse",!1));s(this,_,new S.CSSProperty(this,"--direction",0));s(this,H,new S.CSSProperty(this,"--pages",0,{validate:e=>Math.max(0,e-1)}));s(this,$,new S.CSSProperty(this,"--split",!1));s(this,M,new S.CSSProperty(this,"--sectional",!1));s(this,et,new S.CSSProperty(this,"--tween-easing",!1));s(this,st,new S.CSSProperty(this,"--tween-duration",!1));s(this,W,new S.CSSProperty(this,"--auto-size",!1));s(this,it,new S.CSSProperty(this,"--wheel-max-delta",!1));s(this,wt,new S.CSSProperty(this,"--drag-inertion",1));s(this,T,new S.CSSProperty(this,"--sections-in-view",1));s(this,v,new S.CSSProperty(this,"--loop",!1));s(this,Et,new S.CSSProperty(this,"--damping",20));s(this,xt,new S.CSSProperty(this,"--mass",0));s(this,Lt,new S.CSSProperty(this,"--stiffness",0));s(this,zt,new S.CSSProperty(this,"--mouse-drag",!1));s(this,Vt,new S.CSSProperty(this,"--section-distance-scale",.5));s(this,A,new S.CSSProperty(this,"--autoplay",0));s(this,It,new S.CSSProperty(this,"--autoplay-pause-duration",0));s(this,rt,new S.CSSProperty(this,"--autoplay-user-direction",!1));s(this,R,new S.CSSProperty(this,"--classes",!1));s(this,nt,new S.CSSProperty(this,"--current-index-start-offset",0));s(this,F,new S.CSSProperty(this,"--current-index-end-offset",0));s(this,kt,new S.CSSProperty(this,"--shift-section-position",0,{rawValueCheck:!1}));s(this,ht,new S.CSSProperty(this,"--focus-delay",0));s(this,At,new S.CSSProperty(this,"--focus-duration",3e3));s(this,ot,new S.CSSProperty(this,"--disabled",!1));s(this,lt,new S.CSSProperty(this,"--hibernate",!1));s(this,ct,null);s(this,p,null);s(this,_t,null);s(this,c,[]);s(this,ne,0);s(this,he,0);s(this,C,0);s(this,m,0);s(this,k,0);s(this,q,null);s(this,ut,null);s(this,D,null);s(this,w,null);s(this,x,new je.Store(0));s(this,Ht,0);s(this,N,0);s(this,U,!1);s(this,G,!0);s(this,Z,!0);s(this,$t);s(this,at);s(this,j,new Xe.Tweened);s(this,Wt,!1);s(this,B,null);s(this,P,!1);s(this,oe,null);s(this,dt,[]);s(this,L,()=>{if(t(this,lt).current)return;t(this,a).unlistenAnimationFrame();const e=this.currentScrollValue/t(this,m)||0,i=t(this,x).current;if(h(this,ne,this.vertical?Dt.getCumulativeOffsetTop(this):Dt.getCumulativeOffsetLeft(this)),h(this,he,this.vertical?Dt.getCumulativeOffsetTop(t(this,p)):Dt.getCumulativeOffsetLeft(t(this,p))),h(this,C,this.vertical?this.offsetHeight:this.offsetWidth),this.vertical?h(this,k,Te.cssUnitParser.parse(getComputedStyle(t(this,p)).rowGap)):h(this,k,Te.cssUnitParser.parse(getComputedStyle(t(this,p)).columnGap)),t(this,W).current&&t(this,c).length){const r=t(this,T).current,u=(t(this,C)-t(this,k)*(r-1))/r;t(this,c).forEach(b=>{b.setSize(u)})}else t(this,c).forEach(r=>{r.setSize()});if(t(this,c).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,p).style.width=r+"px",t(this,p).style.height="100%"):(t(this,p).style.height=r+"px",t(this,p).style.width="100%")}else this.vertical?(t(this,p).style.width="100%",t(this,p).style.height="max-content",h(this,m,t(this,p).offsetHeight-t(this,C))):(t(this,p).style.width="max-content",t(this,p).style.height="100%",h(this,m,t(this,p).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,c).length){const r=t(this,c)[t(this,c).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,c).length){const r=t(this,c)[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,p).offsetHeight:t(this,p).offsetWidth)>t(this,C)),this.classList.toggle("has-overflow",t(this,U)),t(this,U)?t(this,ot).current||l(this,o,Ce).call(this):l(this,o,ye).call(this),te.dispatchEvent(this,"scrollResize",{custom:!0}),t(this,a).notify()});s(this,le,()=>{if(!t(this,U)||t(this,Z)||t(this,G))return;const e=this.currentScrollValue;if(h(this,Ht,Math.max(0,e-t(this,m))),t(this,c).length){for(let i=0;i<t(this,c).length;i++)t(this,c)[i].transform();t(this,x).current=l(this,o,ie).call(this)}else this.vertical?t(this,p).style.transform=`translate3d(0px, ${e*-1}px, 0px)`:t(this,p).style.transform=`translate3d(${e*-1}px, 0px, 0px)`;l(this,o,Ve).call(this),gt.scrollEntries.update(this,t(this,E).current,e)});s(this,Ft,(e,i)=>{t(this,Pt).current&&(l(this,o,Le).call(this,Math.sign(i)||1),t(this,ce).call(this,e,i))});s(this,ce,(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,at)||t(this,j).unlistenAnimationFrame(),!t(this,A).current&&t(this,ht).current&&(clearInterval(t(this,$t)),h(this,$t,setTimeout(()=>{const r=t(this,c)[l(this,o,ie).call(this)];r&&this.scrollToSection(r.index,{tween:{duration:t(this,At).current,easing:Ke.easeInOutExpo}})},t(this,ht).current))),!(e.includes("drag")&&!Ye.device.isTouch&&!t(this,zt).current)){if(t(this,M).current&&e!=="drag"){const r=Math.sign(i);if(t(this,c).length){const u={tween:t(this,et).current||t(this,st).current?{easing:t(this,et).current||"easeInOutCubic",duration:t(this,st).current||500}:void 0};t(this,Wt)?this.scrollToSection(l(this,o,ie).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,Wt,e==="drag")}});s(this,ue,()=>{h(this,P,!0),this.hibernatedCSSProperty.current||l(this,o,xe).call(this)});if(O.isBrowser){const e=this.attachShadow({mode:"open"});e.adoptedStyleSheets=[rs];const i=document.createElement("div");i.className="static",i.innerHTML='<slot name="static"></slot>',e.appendChild(i),h(this,ct,document.createElement("div")),t(this,ct).className="content-wrapper",h(this,p,document.createElement("div")),t(this,p).className="content",h(this,_t,document.createElement("slot")),t(this,p).appendChild(t(this,_t)),t(this,ct).appendChild(t(this,p)),e.appendChild(t(this,ct)),h(this,oe,new MutationObserver(r=>{this.tryResplit()}))}}get damped(){return t(this,a)}get controlsCSSProperty(){return t(this,Pt)}get axisCSSProperty(){return t(this,E)}get reverseCSSProperty(){return t(this,tt)}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,et)}get durationCSSProperty(){return t(this,st)}get autoSizeCSSProperty(){return t(this,W)}get wheelMaxDeltaCSSProperty(){return t(this,it)}get dragInertionCSSProperty(){return t(this,wt)}get sectionsInViewCSSProperty(){return t(this,T)}get loopCSSProperty(){return t(this,v)}get dampingCSSProperty(){return t(this,Et)}get massCSSProperty(){return t(this,xt)}get stiffnessCSSProperty(){return t(this,Lt)}get mouseDragCSSProperty(){return t(this,zt)}get sectionDistanceScaleCSSProperty(){return t(this,Vt)}get autoplayCSSProperty(){return t(this,A)}get autoplayPauseDurationCSSProperty(){return t(this,It)}get autoplayUserDirectionCSSProperty(){return t(this,rt)}get classesCSSProperty(){return t(this,R)}get currentIndexStartOffsetCSSProperty(){return t(this,nt)}get currentIndexEndOffsetCSSProperty(){return t(this,F)}get shiftSectionPositionCSSProperty(){return t(this,kt)}get focusDelayCSSProperty(){return t(this,ht)}get focusDurationCSSProperty(){return t(this,At)}get disabledCSSProperty(){return t(this,ot)}get hibernatedCSSProperty(){return t(this,lt)}get currentScrollValue(){return l(this,o,ze).call(this,"current")}get targetScrollValue(){return l(this,o,ze).call(this,"target")}get contentWrapperElement(){return t(this,ct)}get contentElement(){return t(this,p)}get sections(){return t(this,c)}get position(){return t(this,ne)}get contentPosition(){return t(this,he)}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,c).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,Ht)}get scrollLine(){return t(this,B)}get vertical(){return t(this,E).current==="y"}get currentProgress(){return this.currentScrollValue/this.loopDistance||0}get targetProgress(){return this.targetScrollValue/this.loopDistance||0}get scrollWidth(){return t(this,E).current==="y"?0:t(this,a).distance}get scrollHeight(){return t(this,E).current==="x"?0:t(this,a).distance}tryResplit(){!t(this,Z)&&(t(this,v).current||t(this,$).current||t(this,v).current||t(this,W).current||t(this,M).current)&&l(this,o,se).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,c).length)return;const r=t(this,x).current,u=l(this,o,Oe).call(this,e),b=t(this,c)[r],y=t(this,c)[u];if(b&&y){let I=0;const ve=l(this,o,ie).call(this),Tt=t(this,c)[ve],be=Tt?this.targetScrollValue-Tt.position:0;t(this,v).current?u===0&&r===t(this,c).length-1?I=t(this,m)+t(this,C)-b.position+t(this,k):u===t(this,c).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-be,i)}}shiftSections(e,i){t(this,c).length&&this.scrollToSection(t(this,x).current+e,i)}setPosition(e,i){l(this,o,Le).call(this,Math.sign(e)||1),i!=null&&i.tween?t(this,at)||(t(this,j).set(t(this,a).current,{equalize:!0}),t(this,j).set(e,Me({},i.tween)),h(this,at,setTimeout(()=>{h(this,at,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)}connectedCallback(){gt.scrollEntries.register(this),h(this,a,new Qe.Damped(0,{damping:.01,min:0,order:ge.TICK_ORDER.SCROLL})),this.setAttribute("tabindex","0"),h(this,q,new me.WheelControls({element:t(this,p)})),t(this,q).changeEvent.subscribe(t(this,Ft)),h(this,ut,new me.KeyboardControls({element:this})),t(this,ut).changeEvent.subscribe(t(this,Ft)),h(this,D,new me.DragControls({element:t(this,p)})),t(this,D).changeEvent.subscribe(t(this,Ft)),h(this,w,new me.AutoplayControls({culling:this})),t(this,w).changeEvent.subscribe(t(this,ce)),t(this,E).subscribe(()=>{l(this,o,we).call(this)}),t(this,tt).subscribe(()=>{l(this,o,we).call(this)}),t(this,it).subscribe(e=>{t(this,q).axis=e.current?"max":t(this,E).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,L).call(this)}),t(this,$).subscribe(({current:e})=>{t(this,P)&&(e?l(this,o,se).call(this):l(this,o,qt).call(this))}),t(this,M).subscribe(e=>{t(this,q).debounce=e.current,t(this,D).swipe=e.current,t(this,w).interval=e.current,t(this,P)&&(e.current&&!e.previous&&!t(this,c).length?l(this,o,se).call(this):!e.current&&e.previous&&t(this,c).length&&l(this,o,qt).call(this))}),t(this,W).subscribe(e=>{t(this,P)&&(t(this,L).call(this),e.current&&!e.previous&&!t(this,c).length?l(this,o,se).call(this):!e.current&&e.previous&&t(this,c).length&&l(this,o,qt).call(this))}),t(this,T).subscribe(e=>{t(this,P)&&(t(this,L).call(this),l(this,o,mt).call(this))}),t(this,v).subscribe(e=>{e.current?(t(this,P)&&(t(this,c).length||(t(this,$).current=!0)),t(this,a).max=1/0,t(this,a).min=-1/0):(h(this,Ht,0),t(this,a).max=t(this,m),t(this,a).min=0)}),t(this,Et).subscribe(e=>{t(this,a).damping=e.current}),t(this,xt).subscribe(e=>{t(this,a).mass=e.current}),t(this,Lt).subscribe(e=>{t(this,a).stiffness=e.current}),t(this,A).subscribe(e=>{t(this,w).speed=e.current,!t(this,G)&&e.current&&!e.previous?t(this,w).connect():!e.current&&e.previous&&t(this,w).disconnect()}),t(this,rt).subscribe(e=>{e.current||(t(this,w).direction=1)}),t(this,R).subscribe(e=>{t(this,P)&&l(this,o,mt).call(this)}),t(this,nt).subscribe(e=>{t(this,P)&&t(this,R).current&&l(this,o,mt).call(this)}),t(this,F).subscribe(e=>{t(this,P)&&t(this,R).current&&l(this,o,mt).call(this)}),t(this,kt).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,c).length&&l(this,o,mt).call(this)}),t(this,j).subscribe(e=>{t(this,j).isRunning.current&&t(this,a).set(e.current,{equalize:!0})}),t(this,ot).subscribe(e=>{e.current&&!e.previous?(this.classList.add("disabled"),l(this,o,ye).call(this)):!e.current&&e.previous&&(this.classList.remove("disabled"),l(this,o,Ce).call(this))}),t(this,lt).subscribe(e=>{e.current&&!e.previous?(this.classList.add("hibernated"),l(this,o,Ee).call(this)):!e.current&&e.previous&&(this.classList.remove("hibernated"),l(this,o,xe).call(this))}),t(this,Pt).observe(),t(this,E).observe(),t(this,tt).observe(),t(this,_).observe(),t(this,H).observe(),t(this,$).observe(),t(this,M).observe(),t(this,et).observe(),t(this,st).observe(),t(this,W).observe(),t(this,it).observe(),t(this,wt).observe(),t(this,T).observe(),t(this,v).observe(),t(this,Et).observe(),t(this,xt).observe(),t(this,Lt).observe(),t(this,zt).observe(),t(this,Vt).observe(),t(this,A).observe(),t(this,A).observe(),t(this,It).observe(),t(this,rt).observe(),t(this,R).observe(),t(this,nt).observe(),t(this,F).observe(),t(this,kt).observe(),t(this,ht).observe(),t(this,At).observe(),t(this,ot).observe(),t(this,lt).observe(),Bt.windowResizer.subscribe(t(this,ue),ge.RESIZE_ORDER.LAST)}disconnectedCallback(){this.removeAttribute("tabindex"),this.classList.remove("disabled"),this.classList.remove("hibernated"),t(this,Pt).unobserve(),t(this,E).unobserve(),t(this,tt).unobserve(),t(this,_).unobserve(),t(this,H).unobserve(),t(this,$).unobserve(),t(this,M).unobserve(),t(this,et).unobserve(),t(this,st).unobserve(),t(this,W).unobserve(),t(this,it).unobserve(),t(this,wt).unobserve(),t(this,T).unobserve(),t(this,v).unobserve(),t(this,Et).unobserve(),t(this,xt).unobserve(),t(this,Lt).unobserve(),t(this,zt).unobserve(),t(this,Vt).unobserve(),t(this,A).unobserve(),t(this,It).unobserve(),t(this,rt).unobserve(),t(this,R).unobserve(),t(this,nt).unobserve(),t(this,F).unobserve(),t(this,kt).unobserve(),t(this,ht).unobserve(),t(this,At).unobserve(),t(this,ot).unobserve(),t(this,lt).unobserve(),Bt.windowResizer.unsubscribe(t(this,ue)),l(this,o,Ee).call(this),t(this,oe).disconnect()}}a=new WeakMap,Pt=new WeakMap,E=new WeakMap,tt=new WeakMap,_=new WeakMap,H=new WeakMap,$=new WeakMap,M=new WeakMap,et=new WeakMap,st=new WeakMap,W=new WeakMap,it=new WeakMap,wt=new WeakMap,T=new WeakMap,v=new WeakMap,Et=new WeakMap,xt=new WeakMap,Lt=new WeakMap,zt=new WeakMap,Vt=new WeakMap,A=new WeakMap,It=new WeakMap,rt=new WeakMap,R=new WeakMap,nt=new WeakMap,F=new WeakMap,kt=new WeakMap,ht=new WeakMap,At=new WeakMap,ot=new WeakMap,lt=new WeakMap,ct=new WeakMap,p=new WeakMap,_t=new WeakMap,c=new WeakMap,ne=new WeakMap,he=new WeakMap,C=new WeakMap,m=new WeakMap,k=new WeakMap,q=new WeakMap,ut=new WeakMap,D=new WeakMap,w=new WeakMap,x=new WeakMap,Ht=new WeakMap,N=new WeakMap,U=new WeakMap,G=new WeakMap,Z=new WeakMap,$t=new WeakMap,at=new WeakMap,j=new WeakMap,Wt=new WeakMap,B=new WeakMap,P=new WeakMap,oe=new WeakMap,dt=new WeakMap,o=new WeakSet,we=function(){const e=t(this,E).current,i=t(this,tt).current?"-reverse":"";t(this,p).style.flexDirection=e==="x"?`row${i}`:`column${i}`,t(this,q).axis=t(this,it).current?"max":e,t(this,ut).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,L).call(this)},se=function(){l(this,o,qt).call(this),t(this,_t).assignedElements().forEach((e,i)=>{e instanceof HTMLElement&&t(this,c).push(new is(e,i,this))}),t(this,p).style.transform="",te.dispatchEvent(this,"scrollSectionsChange",{custom:!0,composed:!0}),t(this,L).call(this),l(this,o,mt).call(this)},qt=function(){t(this,c).forEach(e=>{e.destroy()}),h(this,c,[]),t(this,x).reset(),t(this,a).reset(),te.dispatchEvent(this,"scrollSectionsChange",{custom:!0,composed:!0})},ye=function(){t(this,G)||(h(this,G,!0),t(this,a).unsubscribe(t(this,le)),t(this,a).unlistenAnimationFrame(),clearInterval(t(this,$t)),clearInterval(t(this,at)),t(this,j).unlistenAnimationFrame(),t(this,q).disconnect(),t(this,ut).disconnect(),t(this,D).disconnect(),t(this,w).disconnect(),t(this,U)||(this.sections.forEach(e=>{e.unsetTransform()}),t(this,L).call(this)))},Ce=function(){t(this,G)&&(h(this,G,!1),t(this,a).subscribe(t(this,le),-1e4),t(this,a).notify(),t(this,q).connect(),t(this,ut).connect(),t(this,D).connect(),t(this,A).current&&t(this,w).connect())},Ee=function(){t(this,Z)||(h(this,Z,!0),Bt.windowResizer.unsubscribe(t(this,L)),re.elementResizer.unsubscribe(t(this,L)),l(this,o,ye).call(this),t(this,p).style.transform="",t(this,p).style.height="",t(this,p).style.width="",this.classList.remove("has-overflow","start","end"),t(this,c).length?l(this,o,qt).call(this):(t(this,x).reset(),t(this,a).reset()),gt.scrollEntries.unregister(this))},xe=function(){t(this,Z)&&(h(this,Z,!1),gt.scrollEntries.register(this),this.tryResplit(),l(this,o,Ce).call(this),Bt.windowResizer.subscribe(t(this,L),ge.RESIZE_ORDER.SCROLL),re.elementResizer.subscribe(this,t(this,L)))},L=new WeakMap,le=new WeakMap,Oe=function(e){let i=t(this,x).current;return t(this,v).current?i=Je.loopNumber(e,t(this,c).length):i=De.clamp(e,0,this.limit),i},Ft=new WeakMap,ce=new WeakMap,Le=function(e=1){t(this,rt).current&&(t(this,w).direction=e),t(this,A).current&&t(this,w).pauseAndContinue(t(this,It).current,this.sectionalCSSProperty.current)},ze=function(e="current"){if(t(this,v).current&&t(this,c).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]},mt=function(){if(t(this,c).length){const e=t(this,x).current+t(this,nt).current;if(e===0?h(this,B,"start"):e===this.limit?h(this,B,"end"):h(this,B,null),te.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,dt,[]),t(this,c).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,dt).push(r)):u>=y&&u<y+I/2||u<=b+i?r.setMark("next"):r.setMark("previous")})}}},Ve=function(){if(t(this,R).current){const e=Math.floor(t(this,dt).length/2);t(this,dt).sort((i,r)=>i.element.getBoundingClientRect().left-r.element.getBoundingClientRect().left),t(this,dt).forEach((i,r)=>{const u=r-e;i.setCurrentIndex(r),i.setCurrentIndexArc(u),i.setCurrentIndexArcAbs(Math.abs(u)),i.setMiddle(r===e)})}},ie=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,c).length;y++){const I=t(this,c)[y];let ve=t(this,Wt)?I.size*b*-1*.4:0,Tt=I.position;this.overscroll&&Tt===0&&e&&(Tt=t(this,N));let be=Math.abs(Tt+ve-i);be<=r&&(r=be,u=y)}return u},ue=new WeakMap;O.isBrowser&&!customElements.get("e-scroll")&&customElements.define("e-scroll",Mt);var ae;class Ie extends HTMLElement{constructor(){super(...arguments);s(this,ae,null)}get scrollElement(){return t(this,ae)}connectedCallback(){const e=Be.findParentElement(this,Mt);e instanceof Mt?h(this,ae,e):console.error(this,"e-scroll not found")}}ae=new WeakMap;var St,z,K,J,Nt,Ut,pt,Gt,de,Se;class _e extends Ie{constructor(){super();s(this,St,null);s(this,z,null);s(this,K,!1);s(this,J,0);s(this,Nt,0);s(this,Ut,0);s(this,pt,()=>{h(this,K,this.offsetWidth>this.offsetHeight);const e=t(this,K)?this.offsetWidth:this.offsetHeight;h(this,J,e/((this.scrollElement.scrollSize+this.scrollElement.viewportSize)/e)),h(this,J,Math.max(t(this,J),30)),t(this,K)?(t(this,z).style.width=t(this,J)+"px",t(this,z).style.height="100%"):(t(this,z).style.width="100%",t(this,z).style.height=t(this,J)+"px"),h(this,Nt,e-t(this,J)),this.scrollElement.scrollSize<=0?this.style.display="none":this.style.display="",t(this,Gt).call(this)});s(this,Gt,()=>{h(this,Ut,this.scrollElement.currentProgress*t(this,Nt)),t(this,K)?t(this,z).style.transform=`translate3d(${t(this,Ut)}px, 0px, 0px)`:t(this,z).style.transform=`translate3d(0px, ${t(this,Ut)}px, 0px)`});s(this,de,()=>{this.setAttribute("axis",this.scrollElement.axisCSSProperty.current)});s(this,Se,e=>{document.documentElement.classList.add("grabbing"),ts.setupDrag(u=>{const b=t(this,K)?u.x:u.y,y=this.scrollElement.distance/t(this,Nt),I=(b-r)*y;this.scrollElement.setPosition(i+I)},()=>{document.documentElement.classList.remove("grabbing")});const i=this.scrollElement.damped.target,r=t(this,K)?e.x:e.y});if(O.isBrowser){const e=this.attachShadow({mode:"open"});e.adoptedStyleSheets=[qe.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,St,document.createElement("slot")),t(this,St).innerHTML='<div class="default-thumb"></div>',e.appendChild(t(this,St))}}get thumbElement(){return t(this,z)}connectedCallback(){super.connectedCallback(),this.setAttribute("drag-dead-zone","");const e=t(this,St).assignedElements()[0]||t(this,St).firstElementChild;h(this,z,e),t(this,z).addEventListener("pointerdown",t(this,Se)),Bt.windowResizer.subscribe(t(this,pt),ge.RESIZE_ORDER.SCROLL),re.elementResizer.subscribe(this,t(this,pt)),re.elementResizer.subscribe(this.scrollElement,t(this,pt)),this.scrollElement.onScroll(t(this,Gt)),this.scrollElement.axisCSSProperty.subscribe(t(this,de))}disconnectedCallback(){this.removeAttribute("drag-dead-zone"),this.style.display="",t(this,z).removeEventListener("pointerdown",t(this,Se)),Bt.windowResizer.unsubscribe(t(this,pt)),re.elementResizer.unsubscribe(t(this,pt)),this.scrollElement.offScroll(t(this,Gt)),this.scrollElement.axisCSSProperty.unsubscribe(t(this,de))}}St=new WeakMap,z=new WeakMap,K=new WeakMap,J=new WeakMap,Nt=new WeakMap,Ut=new WeakMap,pt=new WeakMap,Gt=new WeakMap,de=new WeakMap,Se=new WeakMap;O.isBrowser&&!customElements.get("e-scrollbar")&&customElements.define("e-scrollbar",_e);var Zt,jt,Kt;class He extends Ie{constructor(){super();s(this,Zt,new S.CSSProperty(this,"--behaviour","smooth"));s(this,jt,new S.CSSProperty(this,"--tween-easing",!1));s(this,Kt,new S.CSSProperty(this,"--tween-duration",0));O.isBrowser&&this.addEventListener("click",()=>{const e=t(this,Zt).current,i=t(this,jt).current,r=t(this,Kt).current;this.handleClick({behaviour:e,tween:i||r?{easing:i,duration:r}:void 0})})}connectedCallback(){super.connectedCallback(),t(this,Zt).observe(),t(this,jt).observe(),t(this,Kt).observe()}disconnectedCallback(){t(this,Zt).close(),t(this,jt).close(),t(this,Kt).close()}}Zt=new WeakMap,jt=new WeakMap,Kt=new WeakMap;var Jt;class $e extends He{constructor(){super(...arguments);s(this,Jt,new S.CSSProperty(this,"--set",1))}handleClick(e){this.scrollElement.scrollToSection(t(this,Jt).current,e)}connectedCallback(){super.connectedCallback(),t(this,Jt).observe()}disconnectedCallback(){super.disconnectedCallback(),t(this,Jt).close()}}Jt=new WeakMap;O.isBrowser&&!customElements.get("e-scroll-set-button")&&customElements.define("e-scroll-set-button",$e);var Q,Qt;class We extends He{constructor(){super(...arguments);s(this,Q,new S.CSSProperty(this,"--step",1));s(this,Qt,()=>{this.scrollElement.loopCSSProperty.current?this.removeAttribute("disabled"):t(this,Q).current>0&&this.scrollElement.scrollLine==="end"||t(this,Q).current<0&&this.scrollElement.scrollLine==="start"?this.setAttribute("disabled",""):this.removeAttribute("disabled")})}handleClick(e){this.scrollElement.shiftSections(t(this,Q).current,e)}connectedCallback(){super.connectedCallback(),this.scrollElement&&(t(this,Q).subscribe(()=>{t(this,Qt).call(this)}),t(this,Q).observe(),this.scrollElement.addEventListener("scrollLine",t(this,Qt)),t(this,Qt).call(this))}disconnectedCallback(){super.disconnectedCallback(),t(this,Q).close(),this.removeAttribute("disabled")}}Q=new WeakMap,Qt=new WeakMap;O.isBrowser&&!customElements.get("e-scroll-step-button")&&customElements.define("e-scroll-step-button",We);var X,ft,Xt,pe,fe,Yt;class ns{constructor(n,e,i){s(this,X,null);s(this,ft,null);s(this,Xt,null);s(this,pe,null);s(this,fe,()=>{t(this,ft).scrollToSection(t(this,Xt),{behaviour:t(this,pe)})});s(this,Yt,()=>{t(this,X).classList.toggle("current",t(this,ft).counter.current===t(this,Xt))});O.isBrowser&&(h(this,X,document.createElement("button")),h(this,ft,n),h(this,pe,i),h(this,Xt,e),t(this,X).addEventListener("click",t(this,fe)),t(this,ft).counter.subscribe(t(this,Yt)),t(this,Yt).call(this))}get element(){return t(this,X)}destroy(){t(this,X).removeEventListener("click",t(this,fe)),t(this,ft).counter.unsubscribe(t(this,Yt)),t(this,X).remove()}}X=new WeakMap,ft=new WeakMap,Xt=new WeakMap,pe=new WeakMap,fe=new WeakMap,Yt=new WeakMap;var bt,Rt;class Fe extends Ie{constructor(){super(...arguments);s(this,bt,[]);s(this,Rt,es.debounce(()=>{t(this,bt).forEach(i=>i.destroy()),h(this,bt,[]);const e=this.scrollElement.sections.length-Math.max(this.scrollElement.sectionsInViewCSSProperty.current-1,0);for(let i=0;i<e;i++){const r=new ns(this.scrollElement,i,this.getAttribute("behaviour")||"smooth");this.appendChild(r.element),t(this,bt).push(r)}},0))}connectedCallback(){super.connectedCallback(),this.scrollElement.addEventListener("sectionsChange",t(this,Rt)),this.scrollElement.sectionsInViewCSSProperty.subscribe(t(this,Rt))}disconnectedCallback(){this.scrollElement.removeEventListener("sectionsChange",t(this,Rt)),this.scrollElement.sectionsInViewCSSProperty.unsubscribe(t(this,Rt)),t(this,bt).forEach(e=>e.destroy()),h(this,bt,[])}}bt=new WeakMap,Rt=new WeakMap;O.isBrowser&&!customElements.get("e-scroll-bullet-buttons")&&customElements.define("e-scroll-bullet-buttons",Fe);class Ne extends ss.ScrollSegmentElement{connectedCallback(){const n=Be.findParentElement(this,Mt);n instanceof Mt?(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 Mt&&(this.scrollContainer.removeEventListener("scrollSectionsChange",this.findAnotherScrollEntries),this.scrollContainer.removeEventListener("scrollResize",this.resize))}}O.isBrowser&&!customElements.get("e-scroll-segment")&&customElements.define("e-scroll-segment",Ne);exports.ScrollBulletButtonsElement=Fe;exports.ScrollElement=Mt;exports.ScrollSegmentElement=Ne;exports.ScrollSetButtonElement=$e;exports.ScrollStepButtonElement=We;exports.ScrollbarElement=_e;
|
|
1
|
+
"use strict";var Ge=Object.defineProperty;var ke=Object.getOwnPropertySymbols;var Ze=Object.prototype.hasOwnProperty,je=Object.prototype.propertyIsEnumerable;var Re=d=>{throw TypeError(d)};var Ae=(d,n,e)=>n in d?Ge(d,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):d[n]=e,Me=(d,n)=>{for(var e in n||(n={}))Ze.call(n,e)&&Ae(d,e,n[e]);if(ke)for(var e of ke(n))je.call(n,e)&&Ae(d,e,n[e]);return d};var Pe=(d,n,e)=>n.has(d)||Re("Cannot "+e);var t=(d,n,e)=>(Pe(d,n,"read from private field"),e?e.call(d):n.get(d)),s=(d,n,e)=>n.has(d)?Re("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(d):n.set(d,e),h=(d,n,e,i)=>(Pe(d,n,"write to private field"),i?i.call(d,e):n.set(d,e),e),l=(d,n,e)=>(Pe(d,n,"access private method"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ke=require("../Store-GokLe_g-.cjs"),O=require("../index-Cqw2NKev.cjs"),Je=require("../easings-GegIwET5.cjs"),ee=require("../events-KVanG9sR.cjs"),qe=require("../function-MthRj-GJ.cjs"),De=require("../jss-CRBgdvJ3.cjs"),Dt=require("../layout-Ctc2p3uz.cjs"),Be=require("../math-GDWEqu7y.cjs"),Qe=require("../number-0243DApo.cjs");require("../ticker/index.cjs");const ge=require("../order/index.cjs"),Xe=require("../Damped-DgAIjXp3.cjs"),Ye=require("../Tweened-DpJDlbj9.cjs"),me=require("../controls/index.cjs"),Bt=require("../window-resizer/index.cjs"),gt=require("../scroll-entries/index.cjs"),Te=require("../css-unit-parser/index.cjs"),S=require("../css-property/index.cjs"),ts=require("../device/index.cjs"),ne=require("../element-resizer/index.cjs"),es=require("../gestures-C7gbKx11.cjs"),Oe=require("../dom-JBOkFLTh.cjs"),ss=require("../scroll-segment/index.cjs");var f,Ot,g,yt,V,Y,Ct,vt,se;class is{constructor(n,e,i){s(this,vt);s(this,f);s(this,Ot);s(this,g);s(this,yt,0);s(this,V,0);s(this,Y,null);s(this,Ct,0);h(this,f,n),h(this,Ot,e),h(this,g,i),gt.scrollEntries.register(t(this,f)),this.setIndex(t(this,Ot))}get element(){return t(this,f)}get index(){return t(this,Ot)}get size(){return t(this,yt)}get position(){return t(this,V)}get transformPosition(){return t(this,Ct)}destroy(){gt.scrollEntries.unregister(t(this,f)),this.unsetTransform()}unsetTransform(){t(this,f).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,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"))}resize(){h(this,yt,t(this,g).vertical?t(this,f).offsetHeight:t(this,f).offsetWidth),h(this,V,t(this,g).vertical?Dt.getCumulativeOffsetTop(t(this,f)):Dt.getCumulativeOffsetLeft(t(this,f))),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,yt)<t(this,g).currentScrollValue-n&&(e=(t(this,g).distance-n)*-1-t(this,g).gap),gt.scrollEntries.update(t(this,f),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,yt)+i,y=Be.clamp(r,u,b);h(this,Ct,y*-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)`}setMark(n){t(this,Y)!==n&&(t(this,Y)&&t(this,f).classList.remove(t(this,Y)),n&&t(this,f).classList.add(n),h(this,Y,n),ee.dispatchEvent(t(this,f),"scrollSectionMarkChange",{composed:!0,detail:{mark:t(this,Y)},custom:!0}))}setMiddle(n){t(this,f).classList.toggle("middle",n)}setIndex(n){l(this,vt,se).call(this,"index",n)}setCurrentIndex(n){l(this,vt,se).call(this,"current-index",n)}setCurrentIndexArc(n){l(this,vt,se).call(this,"current-index-arc",n)}setCurrentIndexArcAbs(n){l(this,vt,se).call(this,"current-index-arc-abs",n)}}f=new WeakMap,Ot=new WeakMap,g=new WeakMap,yt=new WeakMap,V=new WeakMap,Y=new WeakMap,Ct=new WeakMap,vt=new WeakSet,se=function(n,e){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}`))};const rs=De.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,Pt,E,tt,_,H,$,M,et,st,W,it,wt,T,v,Et,xt,Lt,zt,Vt,A,It,rt,R,nt,F,kt,ht,At,ot,lt,ct,p,_t,c,he,oe,C,m,k,q,ut,D,w,x,Ht,N,U,G,Z,$t,at,j,Wt,B,P,Ft,dt,o,we,ie,qt,ye,Ce,Ee,xe,L,le,Ve,Nt,ce,Le,ze,mt,_e,re,ue;class Mt extends HTMLElement{constructor(){super();s(this,o);s(this,a,null);s(this,Pt,new S.CSSProperty(this,"--controls",!0));s(this,E,new S.CSSProperty(this,"--axis","y"));s(this,tt,new S.CSSProperty(this,"--reverse",!1));s(this,_,new S.CSSProperty(this,"--direction",0));s(this,H,new S.CSSProperty(this,"--pages",0,{validate:e=>Math.max(0,e-1)}));s(this,$,new S.CSSProperty(this,"--split",!1));s(this,M,new S.CSSProperty(this,"--sectional",!1));s(this,et,new S.CSSProperty(this,"--tween-easing",!1));s(this,st,new S.CSSProperty(this,"--tween-duration",!1));s(this,W,new S.CSSProperty(this,"--auto-size",!1));s(this,it,new S.CSSProperty(this,"--wheel-max-delta",!1));s(this,wt,new S.CSSProperty(this,"--drag-inertion",1));s(this,T,new S.CSSProperty(this,"--sections-in-view",1));s(this,v,new S.CSSProperty(this,"--loop",!1));s(this,Et,new S.CSSProperty(this,"--damping",20));s(this,xt,new S.CSSProperty(this,"--mass",0));s(this,Lt,new S.CSSProperty(this,"--stiffness",0));s(this,zt,new S.CSSProperty(this,"--mouse-drag",!1));s(this,Vt,new S.CSSProperty(this,"--section-distance-scale",.5));s(this,A,new S.CSSProperty(this,"--autoplay",0));s(this,It,new S.CSSProperty(this,"--autoplay-pause-duration",0));s(this,rt,new S.CSSProperty(this,"--autoplay-user-direction",!1));s(this,R,new S.CSSProperty(this,"--classes",!1));s(this,nt,new S.CSSProperty(this,"--current-index-start-offset",0));s(this,F,new S.CSSProperty(this,"--current-index-end-offset",0));s(this,kt,new S.CSSProperty(this,"--shift-section-position",0,{rawValueCheck:!1}));s(this,ht,new S.CSSProperty(this,"--focus-delay",0));s(this,At,new S.CSSProperty(this,"--focus-duration",3e3));s(this,ot,new S.CSSProperty(this,"--disabled",!1));s(this,lt,new S.CSSProperty(this,"--hibernate",!1));s(this,ct,null);s(this,p,null);s(this,_t,null);s(this,c,[]);s(this,he,0);s(this,oe,0);s(this,C,0);s(this,m,0);s(this,k,0);s(this,q,null);s(this,ut,null);s(this,D,null);s(this,w,null);s(this,x,new Ke.Store(0));s(this,Ht,0);s(this,N,0);s(this,U,!1);s(this,G,!0);s(this,Z,!0);s(this,$t);s(this,at);s(this,j,new Ye.Tweened);s(this,Wt,!1);s(this,B,null);s(this,P,!1);s(this,Ft,null);s(this,dt,[]);s(this,L,()=>{if(t(this,lt).current)return;t(this,a).unlistenAnimationFrame();const e=this.currentScrollValue/t(this,m)||0,i=t(this,x).current;if(h(this,he,this.vertical?Dt.getCumulativeOffsetTop(this):Dt.getCumulativeOffsetLeft(this)),h(this,oe,this.vertical?Dt.getCumulativeOffsetTop(t(this,p)):Dt.getCumulativeOffsetLeft(t(this,p))),h(this,C,this.vertical?this.offsetHeight:this.offsetWidth),this.vertical?h(this,k,Te.cssUnitParser.parse(getComputedStyle(t(this,p)).rowGap)):h(this,k,Te.cssUnitParser.parse(getComputedStyle(t(this,p)).columnGap)),t(this,W).current&&t(this,c).length){const r=t(this,T).current,u=(t(this,C)-t(this,k)*(r-1))/r;t(this,c).forEach(b=>{b.setSize(u)})}else t(this,c).forEach(r=>{r.setSize()});if(t(this,c).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,p).style.width=r+"px",t(this,p).style.height="100%"):(t(this,p).style.height=r+"px",t(this,p).style.width="100%")}else this.vertical?(t(this,p).style.width="100%",t(this,p).style.height="max-content",h(this,m,t(this,p).offsetHeight-t(this,C))):(t(this,p).style.width="max-content",t(this,p).style.height="100%",h(this,m,t(this,p).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,c).length){const r=t(this,c)[t(this,c).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,c).length){const r=t(this,c)[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,p).offsetHeight:t(this,p).offsetWidth)>t(this,C)),this.classList.toggle("has-overflow",t(this,U)),t(this,U)?t(this,ot).current||l(this,o,Ce).call(this):l(this,o,ye).call(this),ee.dispatchEvent(this,"scrollResize",{custom:!0}),t(this,a).notify()});s(this,le,()=>{if(!t(this,U)||t(this,Z)||t(this,G))return;const e=this.currentScrollValue;if(h(this,Ht,Math.max(0,e-t(this,m))),t(this,c).length){for(let i=0;i<t(this,c).length;i++)t(this,c)[i].transform();t(this,x).current=l(this,o,re).call(this)}else this.vertical?t(this,p).style.transform=`translate3d(0px, ${e*-1}px, 0px)`:t(this,p).style.transform=`translate3d(${e*-1}px, 0px, 0px)`;l(this,o,_e).call(this),gt.scrollEntries.update(this,t(this,E).current,e)});s(this,Nt,(e,i)=>{t(this,Pt).current&&(l(this,o,Le).call(this,Math.sign(i)||1),t(this,ce).call(this,e,i))});s(this,ce,(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,at)||t(this,j).unlistenAnimationFrame(),!t(this,A).current&&t(this,ht).current&&(clearInterval(t(this,$t)),h(this,$t,setTimeout(()=>{const r=t(this,c)[l(this,o,re).call(this)];r&&this.scrollToSection(r.index,{tween:{duration:t(this,At).current,easing:Je.easeInOutExpo}})},t(this,ht).current))),!(e.includes("drag")&&!ts.device.isTouch&&!t(this,zt).current)){if(t(this,M).current&&e!=="drag"){const r=Math.sign(i);if(t(this,c).length){const u={tween:t(this,et).current||t(this,st).current?{easing:t(this,et).current||"easeInOutCubic",duration:t(this,st).current||500}:void 0};t(this,Wt)?this.scrollToSection(l(this,o,re).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,Wt,e==="drag")}});s(this,ue,()=>{h(this,P,!0),this.hibernatedCSSProperty.current||l(this,o,xe).call(this)});if(O.isBrowser){const e=this.attachShadow({mode:"open"});e.adoptedStyleSheets=[rs];const i=document.createElement("div");i.className="static",i.innerHTML='<slot name="static"></slot>',e.appendChild(i),h(this,ct,document.createElement("div")),t(this,ct).className="content-wrapper",h(this,p,document.createElement("div")),t(this,p).className="content",h(this,_t,document.createElement("slot")),t(this,p).appendChild(t(this,_t)),t(this,ct).appendChild(t(this,p)),e.appendChild(t(this,ct)),h(this,Ft,new MutationObserver(qe.debounce(()=>{this.tryResplit()},10)))}}get damped(){return t(this,a)}get controlsCSSProperty(){return t(this,Pt)}get axisCSSProperty(){return t(this,E)}get reverseCSSProperty(){return t(this,tt)}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,et)}get durationCSSProperty(){return t(this,st)}get autoSizeCSSProperty(){return t(this,W)}get wheelMaxDeltaCSSProperty(){return t(this,it)}get dragInertionCSSProperty(){return t(this,wt)}get sectionsInViewCSSProperty(){return t(this,T)}get loopCSSProperty(){return t(this,v)}get dampingCSSProperty(){return t(this,Et)}get massCSSProperty(){return t(this,xt)}get stiffnessCSSProperty(){return t(this,Lt)}get mouseDragCSSProperty(){return t(this,zt)}get sectionDistanceScaleCSSProperty(){return t(this,Vt)}get autoplayCSSProperty(){return t(this,A)}get autoplayPauseDurationCSSProperty(){return t(this,It)}get autoplayUserDirectionCSSProperty(){return t(this,rt)}get classesCSSProperty(){return t(this,R)}get currentIndexStartOffsetCSSProperty(){return t(this,nt)}get currentIndexEndOffsetCSSProperty(){return t(this,F)}get shiftSectionPositionCSSProperty(){return t(this,kt)}get focusDelayCSSProperty(){return t(this,ht)}get focusDurationCSSProperty(){return t(this,At)}get disabledCSSProperty(){return t(this,ot)}get hibernatedCSSProperty(){return t(this,lt)}get currentScrollValue(){return l(this,o,ze).call(this,"current")}get targetScrollValue(){return l(this,o,ze).call(this,"target")}get contentWrapperElement(){return t(this,ct)}get contentElement(){return t(this,p)}get sections(){return t(this,c)}get position(){return t(this,he)}get contentPosition(){return t(this,oe)}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,c).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,Ht)}get scrollLine(){return t(this,B)}get vertical(){return t(this,E).current==="y"}get currentProgress(){return this.currentScrollValue/this.loopDistance||0}get targetProgress(){return this.targetScrollValue/this.loopDistance||0}get scrollWidth(){return t(this,E).current==="y"?0:t(this,a).distance}get scrollHeight(){return t(this,E).current==="x"?0:t(this,a).distance}tryResplit(){!t(this,Z)&&(t(this,v).current||t(this,$).current||t(this,v).current||t(this,W).current||t(this,M).current)&&l(this,o,ie).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,c).length)return;const r=t(this,x).current,u=l(this,o,Ve).call(this,e),b=t(this,c)[r],y=t(this,c)[u];if(b&&y){let I=0;const ve=l(this,o,re).call(this),Tt=t(this,c)[ve],be=Tt?this.targetScrollValue-Tt.position:0;t(this,v).current?u===0&&r===t(this,c).length-1?I=t(this,m)+t(this,C)-b.position+t(this,k):u===t(this,c).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-be,i)}}shiftSections(e,i){t(this,c).length&&this.scrollToSection(t(this,x).current+e,i)}setPosition(e,i){l(this,o,Le).call(this,Math.sign(e)||1),i!=null&&i.tween?t(this,at)||(t(this,j).set(t(this,a).current,{equalize:!0}),t(this,j).set(e,Me({},i.tween)),h(this,at,setTimeout(()=>{h(this,at,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)}connectedCallback(){gt.scrollEntries.register(this),h(this,a,new Xe.Damped(0,{damping:.01,min:0,order:ge.TICK_ORDER.SCROLL})),this.setAttribute("tabindex","0"),h(this,q,new me.WheelControls({element:t(this,p)})),t(this,q).changeEvent.subscribe(t(this,Nt)),h(this,ut,new me.KeyboardControls({element:this})),t(this,ut).changeEvent.subscribe(t(this,Nt)),h(this,D,new me.DragControls({element:t(this,p)})),t(this,D).changeEvent.subscribe(t(this,Nt)),h(this,w,new me.AutoplayControls({culling:this})),t(this,w).changeEvent.subscribe(t(this,ce)),t(this,E).subscribe(()=>{l(this,o,we).call(this)}),t(this,tt).subscribe(()=>{l(this,o,we).call(this)}),t(this,it).subscribe(e=>{t(this,q).axis=e.current?"max":t(this,E).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,L).call(this)}),t(this,$).subscribe(({current:e})=>{t(this,P)&&(e?l(this,o,ie).call(this):l(this,o,qt).call(this))}),t(this,M).subscribe(e=>{t(this,q).debounce=e.current,t(this,D).swipe=e.current,t(this,w).interval=e.current,t(this,P)&&(e.current&&!e.previous&&!t(this,c).length?l(this,o,ie).call(this):!e.current&&e.previous&&t(this,c).length&&l(this,o,qt).call(this))}),t(this,W).subscribe(e=>{t(this,P)&&(t(this,L).call(this),e.current&&!e.previous&&!t(this,c).length?l(this,o,ie).call(this):!e.current&&e.previous&&t(this,c).length&&l(this,o,qt).call(this))}),t(this,T).subscribe(e=>{t(this,P)&&(t(this,L).call(this),l(this,o,mt).call(this))}),t(this,v).subscribe(e=>{e.current?(t(this,P)&&(t(this,c).length||(t(this,$).current=!0)),t(this,a).max=1/0,t(this,a).min=-1/0):(h(this,Ht,0),t(this,a).max=t(this,m),t(this,a).min=0)}),t(this,Et).subscribe(e=>{t(this,a).damping=e.current}),t(this,xt).subscribe(e=>{t(this,a).mass=e.current}),t(this,Lt).subscribe(e=>{t(this,a).stiffness=e.current}),t(this,A).subscribe(e=>{t(this,w).speed=e.current,!t(this,G)&&e.current&&!e.previous?t(this,w).connect():!e.current&&e.previous&&t(this,w).disconnect()}),t(this,rt).subscribe(e=>{e.current||(t(this,w).direction=1)}),t(this,R).subscribe(e=>{t(this,P)&&l(this,o,mt).call(this)}),t(this,nt).subscribe(e=>{t(this,P)&&t(this,R).current&&l(this,o,mt).call(this)}),t(this,F).subscribe(e=>{t(this,P)&&t(this,R).current&&l(this,o,mt).call(this)}),t(this,kt).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,c).length&&l(this,o,mt).call(this)}),t(this,j).subscribe(e=>{t(this,j).isRunning.current&&t(this,a).set(e.current,{equalize:!0})}),t(this,ot).subscribe(e=>{e.current&&!e.previous?(this.classList.add("disabled"),l(this,o,ye).call(this)):!e.current&&e.previous&&(this.classList.remove("disabled"),l(this,o,Ce).call(this))}),t(this,lt).subscribe(e=>{e.current&&!e.previous?(this.classList.add("hibernated"),l(this,o,Ee).call(this)):!e.current&&e.previous&&(this.classList.remove("hibernated"),l(this,o,xe).call(this))}),t(this,Pt).observe(),t(this,E).observe(),t(this,tt).observe(),t(this,_).observe(),t(this,H).observe(),t(this,$).observe(),t(this,M).observe(),t(this,et).observe(),t(this,st).observe(),t(this,W).observe(),t(this,it).observe(),t(this,wt).observe(),t(this,T).observe(),t(this,v).observe(),t(this,Et).observe(),t(this,xt).observe(),t(this,Lt).observe(),t(this,zt).observe(),t(this,Vt).observe(),t(this,A).observe(),t(this,A).observe(),t(this,It).observe(),t(this,rt).observe(),t(this,R).observe(),t(this,nt).observe(),t(this,F).observe(),t(this,kt).observe(),t(this,ht).observe(),t(this,At).observe(),t(this,ot).observe(),t(this,lt).observe(),Bt.windowResizer.subscribe(t(this,ue),ge.RESIZE_ORDER.LAST),t(this,Ft).observe(this,{childList:!0})}disconnectedCallback(){this.removeAttribute("tabindex"),this.classList.remove("disabled"),this.classList.remove("hibernated"),t(this,Pt).unobserve(),t(this,E).unobserve(),t(this,tt).unobserve(),t(this,_).unobserve(),t(this,H).unobserve(),t(this,$).unobserve(),t(this,M).unobserve(),t(this,et).unobserve(),t(this,st).unobserve(),t(this,W).unobserve(),t(this,it).unobserve(),t(this,wt).unobserve(),t(this,T).unobserve(),t(this,v).unobserve(),t(this,Et).unobserve(),t(this,xt).unobserve(),t(this,Lt).unobserve(),t(this,zt).unobserve(),t(this,Vt).unobserve(),t(this,A).unobserve(),t(this,It).unobserve(),t(this,rt).unobserve(),t(this,R).unobserve(),t(this,nt).unobserve(),t(this,F).unobserve(),t(this,kt).unobserve(),t(this,ht).unobserve(),t(this,At).unobserve(),t(this,ot).unobserve(),t(this,lt).unobserve(),Bt.windowResizer.unsubscribe(t(this,ue)),l(this,o,Ee).call(this),t(this,Ft).disconnect()}}a=new WeakMap,Pt=new WeakMap,E=new WeakMap,tt=new WeakMap,_=new WeakMap,H=new WeakMap,$=new WeakMap,M=new WeakMap,et=new WeakMap,st=new WeakMap,W=new WeakMap,it=new WeakMap,wt=new WeakMap,T=new WeakMap,v=new WeakMap,Et=new WeakMap,xt=new WeakMap,Lt=new WeakMap,zt=new WeakMap,Vt=new WeakMap,A=new WeakMap,It=new WeakMap,rt=new WeakMap,R=new WeakMap,nt=new WeakMap,F=new WeakMap,kt=new WeakMap,ht=new WeakMap,At=new WeakMap,ot=new WeakMap,lt=new WeakMap,ct=new WeakMap,p=new WeakMap,_t=new WeakMap,c=new WeakMap,he=new WeakMap,oe=new WeakMap,C=new WeakMap,m=new WeakMap,k=new WeakMap,q=new WeakMap,ut=new WeakMap,D=new WeakMap,w=new WeakMap,x=new WeakMap,Ht=new WeakMap,N=new WeakMap,U=new WeakMap,G=new WeakMap,Z=new WeakMap,$t=new WeakMap,at=new WeakMap,j=new WeakMap,Wt=new WeakMap,B=new WeakMap,P=new WeakMap,Ft=new WeakMap,dt=new WeakMap,o=new WeakSet,we=function(){const e=t(this,E).current,i=t(this,tt).current?"-reverse":"";t(this,p).style.flexDirection=e==="x"?`row${i}`:`column${i}`,t(this,q).axis=t(this,it).current?"max":e,t(this,ut).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,L).call(this)},ie=function(){l(this,o,qt).call(this),t(this,_t).assignedElements().forEach((e,i)=>{e instanceof HTMLElement&&t(this,c).push(new is(e,i,this))}),t(this,p).style.transform="",ee.dispatchEvent(this,"scrollSectionsChange",{custom:!0,composed:!0}),t(this,L).call(this),l(this,o,mt).call(this)},qt=function(){t(this,c).forEach(e=>{e.destroy()}),h(this,c,[]),t(this,x).reset(),t(this,a).reset(),ee.dispatchEvent(this,"scrollSectionsChange",{custom:!0,composed:!0})},ye=function(){t(this,G)||(h(this,G,!0),t(this,a).unsubscribe(t(this,le)),t(this,a).unlistenAnimationFrame(),clearInterval(t(this,$t)),clearInterval(t(this,at)),t(this,j).unlistenAnimationFrame(),t(this,q).disconnect(),t(this,ut).disconnect(),t(this,D).disconnect(),t(this,w).disconnect(),t(this,U)||(this.sections.forEach(e=>{e.unsetTransform()}),t(this,L).call(this)))},Ce=function(){t(this,G)&&(h(this,G,!1),t(this,a).subscribe(t(this,le),-1e4),t(this,a).notify(),t(this,q).connect(),t(this,ut).connect(),t(this,D).connect(),t(this,A).current&&t(this,w).connect())},Ee=function(){t(this,Z)||(h(this,Z,!0),Bt.windowResizer.unsubscribe(t(this,L)),ne.elementResizer.unsubscribe(t(this,L)),l(this,o,ye).call(this),t(this,p).style.transform="",t(this,p).style.height="",t(this,p).style.width="",this.classList.remove("has-overflow","start","end"),t(this,c).length?l(this,o,qt).call(this):(t(this,x).reset(),t(this,a).reset()),gt.scrollEntries.unregister(this))},xe=function(){t(this,Z)&&(h(this,Z,!1),gt.scrollEntries.register(this),this.tryResplit(),l(this,o,Ce).call(this),Bt.windowResizer.subscribe(t(this,L),ge.RESIZE_ORDER.SCROLL),ne.elementResizer.subscribe(this,t(this,L)))},L=new WeakMap,le=new WeakMap,Ve=function(e){let i=t(this,x).current;return t(this,v).current?i=Qe.loopNumber(e,t(this,c).length):i=Be.clamp(e,0,this.limit),i},Nt=new WeakMap,ce=new WeakMap,Le=function(e=1){t(this,rt).current&&(t(this,w).direction=e),t(this,A).current&&t(this,w).pauseAndContinue(t(this,It).current,this.sectionalCSSProperty.current)},ze=function(e="current"){if(t(this,v).current&&t(this,c).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]},mt=function(){if(t(this,c).length){const e=t(this,x).current+t(this,nt).current;if(e===0?h(this,B,"start"):e===this.limit?h(this,B,"end"):h(this,B,null),ee.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,dt,[]),t(this,c).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,dt).push(r)):u>=y&&u<y+I/2||u<=b+i?r.setMark("next"):r.setMark("previous")})}}},_e=function(){if(t(this,R).current){const e=Math.floor(t(this,dt).length/2);t(this,dt).sort((i,r)=>i.element.getBoundingClientRect().left-r.element.getBoundingClientRect().left),t(this,dt).forEach((i,r)=>{const u=r-e;i.setCurrentIndex(r),i.setCurrentIndexArc(u),i.setCurrentIndexArcAbs(Math.abs(u)),i.setMiddle(r===e)})}},re=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,c).length;y++){const I=t(this,c)[y];let ve=t(this,Wt)?I.size*b*-1*.4:0,Tt=I.position;this.overscroll&&Tt===0&&e&&(Tt=t(this,N));let be=Math.abs(Tt+ve-i);be<=r&&(r=be,u=y)}return u},ue=new WeakMap;O.isBrowser&&!customElements.get("e-scroll")&&customElements.define("e-scroll",Mt);var ae;class Ie extends HTMLElement{constructor(){super(...arguments);s(this,ae,null)}get scrollElement(){return t(this,ae)}connectedCallback(){const e=Oe.findParentElement(this,Mt);e instanceof Mt?h(this,ae,e):console.error(this,"e-scroll not found")}}ae=new WeakMap;var St,z,K,J,Ut,Gt,pt,Zt,de,Se;class He extends Ie{constructor(){super();s(this,St,null);s(this,z,null);s(this,K,!1);s(this,J,0);s(this,Ut,0);s(this,Gt,0);s(this,pt,()=>{h(this,K,this.offsetWidth>this.offsetHeight);const e=t(this,K)?this.offsetWidth:this.offsetHeight;h(this,J,e/((this.scrollElement.scrollSize+this.scrollElement.viewportSize)/e)),h(this,J,Math.max(t(this,J),30)),t(this,K)?(t(this,z).style.width=t(this,J)+"px",t(this,z).style.height="100%"):(t(this,z).style.width="100%",t(this,z).style.height=t(this,J)+"px"),h(this,Ut,e-t(this,J)),this.scrollElement.scrollSize<=0?this.style.display="none":this.style.display="",t(this,Zt).call(this)});s(this,Zt,()=>{h(this,Gt,this.scrollElement.currentProgress*t(this,Ut)),t(this,K)?t(this,z).style.transform=`translate3d(${t(this,Gt)}px, 0px, 0px)`:t(this,z).style.transform=`translate3d(0px, ${t(this,Gt)}px, 0px)`});s(this,de,()=>{this.setAttribute("axis",this.scrollElement.axisCSSProperty.current)});s(this,Se,e=>{document.documentElement.classList.add("grabbing"),es.setupDrag(u=>{const b=t(this,K)?u.x:u.y,y=this.scrollElement.distance/t(this,Ut),I=(b-r)*y;this.scrollElement.setPosition(i+I)},()=>{document.documentElement.classList.remove("grabbing")});const i=this.scrollElement.damped.target,r=t(this,K)?e.x:e.y});if(O.isBrowser){const e=this.attachShadow({mode:"open"});e.adoptedStyleSheets=[De.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,St,document.createElement("slot")),t(this,St).innerHTML='<div class="default-thumb"></div>',e.appendChild(t(this,St))}}get thumbElement(){return t(this,z)}connectedCallback(){super.connectedCallback(),this.setAttribute("drag-dead-zone","");const e=t(this,St).assignedElements()[0]||t(this,St).firstElementChild;h(this,z,e),t(this,z).addEventListener("pointerdown",t(this,Se)),Bt.windowResizer.subscribe(t(this,pt),ge.RESIZE_ORDER.SCROLL),ne.elementResizer.subscribe(this,t(this,pt)),ne.elementResizer.subscribe(this.scrollElement,t(this,pt)),this.scrollElement.onScroll(t(this,Zt)),this.scrollElement.axisCSSProperty.subscribe(t(this,de))}disconnectedCallback(){this.removeAttribute("drag-dead-zone"),this.style.display="",t(this,z).removeEventListener("pointerdown",t(this,Se)),Bt.windowResizer.unsubscribe(t(this,pt)),ne.elementResizer.unsubscribe(t(this,pt)),this.scrollElement.offScroll(t(this,Zt)),this.scrollElement.axisCSSProperty.unsubscribe(t(this,de))}}St=new WeakMap,z=new WeakMap,K=new WeakMap,J=new WeakMap,Ut=new WeakMap,Gt=new WeakMap,pt=new WeakMap,Zt=new WeakMap,de=new WeakMap,Se=new WeakMap;O.isBrowser&&!customElements.get("e-scrollbar")&&customElements.define("e-scrollbar",He);var jt,Kt,Jt;class $e extends Ie{constructor(){super();s(this,jt,new S.CSSProperty(this,"--behaviour","smooth"));s(this,Kt,new S.CSSProperty(this,"--tween-easing",!1));s(this,Jt,new S.CSSProperty(this,"--tween-duration",0));O.isBrowser&&this.addEventListener("click",()=>{const e=t(this,jt).current,i=t(this,Kt).current,r=t(this,Jt).current;this.handleClick({behaviour:e,tween:i||r?{easing:i,duration:r}:void 0})})}connectedCallback(){super.connectedCallback(),t(this,jt).observe(),t(this,Kt).observe(),t(this,Jt).observe()}disconnectedCallback(){t(this,jt).close(),t(this,Kt).close(),t(this,Jt).close()}}jt=new WeakMap,Kt=new WeakMap,Jt=new WeakMap;var Qt;class We extends $e{constructor(){super(...arguments);s(this,Qt,new S.CSSProperty(this,"--set",1))}handleClick(e){this.scrollElement.scrollToSection(t(this,Qt).current,e)}connectedCallback(){super.connectedCallback(),t(this,Qt).observe()}disconnectedCallback(){super.disconnectedCallback(),t(this,Qt).close()}}Qt=new WeakMap;O.isBrowser&&!customElements.get("e-scroll-set-button")&&customElements.define("e-scroll-set-button",We);var Q,Xt;class Fe extends $e{constructor(){super(...arguments);s(this,Q,new S.CSSProperty(this,"--step",1));s(this,Xt,()=>{this.scrollElement.loopCSSProperty.current?this.removeAttribute("disabled"):t(this,Q).current>0&&this.scrollElement.scrollLine==="end"||t(this,Q).current<0&&this.scrollElement.scrollLine==="start"?this.setAttribute("disabled",""):this.removeAttribute("disabled")})}handleClick(e){this.scrollElement.shiftSections(t(this,Q).current,e)}connectedCallback(){super.connectedCallback(),this.scrollElement&&(t(this,Q).subscribe(()=>{t(this,Xt).call(this)}),t(this,Q).observe(),this.scrollElement.addEventListener("scrollLine",t(this,Xt)),t(this,Xt).call(this))}disconnectedCallback(){super.disconnectedCallback(),t(this,Q).close(),this.removeAttribute("disabled")}}Q=new WeakMap,Xt=new WeakMap;O.isBrowser&&!customElements.get("e-scroll-step-button")&&customElements.define("e-scroll-step-button",Fe);var X,ft,Yt,pe,fe,te;class ns{constructor(n,e,i){s(this,X,null);s(this,ft,null);s(this,Yt,null);s(this,pe,null);s(this,fe,()=>{t(this,ft).scrollToSection(t(this,Yt),{behaviour:t(this,pe)})});s(this,te,()=>{t(this,X).classList.toggle("current",t(this,ft).counter.current===t(this,Yt))});O.isBrowser&&(h(this,X,document.createElement("button")),h(this,ft,n),h(this,pe,i),h(this,Yt,e),t(this,X).addEventListener("click",t(this,fe)),t(this,ft).counter.subscribe(t(this,te)),t(this,te).call(this))}get element(){return t(this,X)}destroy(){t(this,X).removeEventListener("click",t(this,fe)),t(this,ft).counter.unsubscribe(t(this,te)),t(this,X).remove()}}X=new WeakMap,ft=new WeakMap,Yt=new WeakMap,pe=new WeakMap,fe=new WeakMap,te=new WeakMap;var bt,Rt;class Ne extends Ie{constructor(){super(...arguments);s(this,bt,[]);s(this,Rt,qe.debounce(()=>{t(this,bt).forEach(i=>i.destroy()),h(this,bt,[]);const e=this.scrollElement.sections.length-Math.max(this.scrollElement.sectionsInViewCSSProperty.current-1,0);for(let i=0;i<e;i++){const r=new ns(this.scrollElement,i,this.getAttribute("behaviour")||"smooth");this.appendChild(r.element),t(this,bt).push(r)}},0))}connectedCallback(){super.connectedCallback(),this.scrollElement.addEventListener("sectionsChange",t(this,Rt)),this.scrollElement.sectionsInViewCSSProperty.subscribe(t(this,Rt))}disconnectedCallback(){this.scrollElement.removeEventListener("sectionsChange",t(this,Rt)),this.scrollElement.sectionsInViewCSSProperty.unsubscribe(t(this,Rt)),t(this,bt).forEach(e=>e.destroy()),h(this,bt,[])}}bt=new WeakMap,Rt=new WeakMap;O.isBrowser&&!customElements.get("e-scroll-bullet-buttons")&&customElements.define("e-scroll-bullet-buttons",Ne);class Ue extends ss.ScrollSegmentElement{connectedCallback(){const n=Oe.findParentElement(this,Mt);n instanceof Mt?(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 Mt&&(this.scrollContainer.removeEventListener("scrollSectionsChange",this.findAnotherScrollEntries),this.scrollContainer.removeEventListener("scrollResize",this.resize))}}O.isBrowser&&!customElements.get("e-scroll-segment")&&customElements.define("e-scroll-segment",Ue);exports.ScrollBulletButtonsElement=Ne;exports.ScrollElement=Mt;exports.ScrollSegmentElement=Ue;exports.ScrollSetButtonElement=We;exports.ScrollStepButtonElement=Fe;exports.ScrollbarElement=He;
|
package/lib/scroll/index.js
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
var
|
|
1
|
+
var Fe = Object.defineProperty;
|
|
2
2
|
var ke = Object.getOwnPropertySymbols;
|
|
3
|
-
var
|
|
3
|
+
var Ne = Object.prototype.hasOwnProperty, qe = Object.prototype.propertyIsEnumerable;
|
|
4
4
|
var Me = (d) => {
|
|
5
5
|
throw TypeError(d);
|
|
6
6
|
};
|
|
7
|
-
var Ae = (d, n, e) => n in d ?
|
|
7
|
+
var Ae = (d, n, e) => n in d ? Fe(d, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : d[n] = e, Te = (d, n) => {
|
|
8
8
|
for (var e in n || (n = {}))
|
|
9
|
-
|
|
9
|
+
Ne.call(n, e) && Ae(d, e, n[e]);
|
|
10
10
|
if (ke)
|
|
11
11
|
for (var e of ke(n))
|
|
12
|
-
|
|
12
|
+
qe.call(n, e) && Ae(d, e, n[e]);
|
|
13
13
|
return d;
|
|
14
14
|
};
|
|
15
15
|
var ve = (d, n, e) => n.has(d) || Me("Cannot " + e);
|
|
16
16
|
var t = (d, n, e) => (ve(d, n, "read from private field"), e ? e.call(d) : n.get(d)), s = (d, n, e) => n.has(d) ? Me("Cannot add the same private member more than once") : n instanceof WeakSet ? n.add(d) : n.set(d, e), h = (d, n, e, i) => (ve(d, n, "write to private field"), i ? i.call(d, e) : n.set(d, e), e), l = (d, n, e) => (ve(d, n, "access private method"), e);
|
|
17
|
-
import { S as
|
|
17
|
+
import { S as Ue } from "../Store-swP_0ymB.js";
|
|
18
18
|
import { i as H } from "../index-euf5anj6.js";
|
|
19
|
-
import { a as
|
|
20
|
-
import { d as
|
|
21
|
-
import {
|
|
19
|
+
import { a as Ge } from "../easings-Bni3YAAW.js";
|
|
20
|
+
import { d as te } from "../events-CsVF98U6.js";
|
|
21
|
+
import { d as Ve } from "../function-C10DGppn.js";
|
|
22
|
+
import { c as Re } from "../jss-DtnXPEnq.js";
|
|
22
23
|
import { a as ye, g as Ce } from "../layout-DpZo-I0y.js";
|
|
23
|
-
import { c as
|
|
24
|
-
import { l as
|
|
24
|
+
import { c as Oe } from "../math-BOBiC4TN.js";
|
|
25
|
+
import { l as Ke } from "../number-DwCxt_Ck.js";
|
|
25
26
|
import "../ticker/index.js";
|
|
26
|
-
import { TICK_ORDER as
|
|
27
|
-
import { D as
|
|
28
|
-
import { T as
|
|
29
|
-
import { WheelControls as
|
|
27
|
+
import { TICK_ORDER as _e, RESIZE_ORDER as we } from "../order/index.js";
|
|
28
|
+
import { D as Ze } from "../Damped-GyAS-U-z.js";
|
|
29
|
+
import { T as je } from "../Tweened-BSC-evuL.js";
|
|
30
|
+
import { WheelControls as Je, KeyboardControls as Qe, DragControls as Xe, AutoplayControls as Ye } from "../controls/index.js";
|
|
30
31
|
import { windowResizer as Vt } from "../window-resizer/index.js";
|
|
31
32
|
import { scrollEntries as gt } from "../scroll-entries/index.js";
|
|
32
33
|
import { cssUnitParser as De } from "../css-unit-parser/index.js";
|
|
33
34
|
import { CSSProperty as f } from "../css-property/index.js";
|
|
34
|
-
import { device as
|
|
35
|
-
import { elementResizer as
|
|
36
|
-
import { s as
|
|
37
|
-
import { b as
|
|
38
|
-
import { d as es } from "../function-C10DGppn.js";
|
|
35
|
+
import { device as ts } from "../device/index.js";
|
|
36
|
+
import { elementResizer as re } from "../element-resizer/index.js";
|
|
37
|
+
import { s as es } from "../gestures-CcXV6fCp.js";
|
|
38
|
+
import { b as He } from "../dom-CVWzyXPH.js";
|
|
39
39
|
import { ScrollSegmentElement as ss } from "../scroll-segment/index.js";
|
|
40
|
-
var b, Ot, g, vt, $, Y, yt, Ct,
|
|
40
|
+
var b, Ot, g, vt, $, Y, yt, Ct, ee;
|
|
41
41
|
class is {
|
|
42
42
|
constructor(n, e, i) {
|
|
43
43
|
s(this, Ct);
|
|
@@ -86,11 +86,11 @@ class is {
|
|
|
86
86
|
t(this, g).axisCSSProperty.current,
|
|
87
87
|
e
|
|
88
88
|
);
|
|
89
|
-
const r = t(this, g).currentScrollValue + e, a = t(this, $) - t(this, g).viewportSize - i, m = t(this, $) + t(this, vt) + i, v =
|
|
89
|
+
const r = t(this, g).currentScrollValue + e, a = t(this, $) - t(this, g).viewportSize - i, m = t(this, $) + t(this, vt) + i, v = Oe(r, a, m);
|
|
90
90
|
h(this, yt, v * -1), t(this, g).vertical ? t(this, b).style.transform = `translate3d(0px, ${t(this, yt)}px, 0px)` : t(this, b).style.transform = `translate3d(${t(this, yt)}px, 0px, 0px)`;
|
|
91
91
|
}
|
|
92
92
|
setMark(n) {
|
|
93
|
-
t(this, Y) !== n && (t(this, Y) && t(this, b).classList.remove(t(this, Y)), n && t(this, b).classList.add(n), h(this, Y, n),
|
|
93
|
+
t(this, Y) !== n && (t(this, Y) && t(this, b).classList.remove(t(this, Y)), n && t(this, b).classList.add(n), h(this, Y, n), te(t(this, b), "scrollSectionMarkChange", {
|
|
94
94
|
composed: !0,
|
|
95
95
|
detail: {
|
|
96
96
|
mark: t(this, Y)
|
|
@@ -102,22 +102,22 @@ class is {
|
|
|
102
102
|
t(this, b).classList.toggle("middle", n);
|
|
103
103
|
}
|
|
104
104
|
setIndex(n) {
|
|
105
|
-
l(this, Ct,
|
|
105
|
+
l(this, Ct, ee).call(this, "index", n);
|
|
106
106
|
}
|
|
107
107
|
setCurrentIndex(n) {
|
|
108
|
-
l(this, Ct,
|
|
108
|
+
l(this, Ct, ee).call(this, "current-index", n);
|
|
109
109
|
}
|
|
110
110
|
setCurrentIndexArc(n) {
|
|
111
|
-
l(this, Ct,
|
|
111
|
+
l(this, Ct, ee).call(this, "current-index-arc", n);
|
|
112
112
|
}
|
|
113
113
|
setCurrentIndexArcAbs(n) {
|
|
114
|
-
l(this, Ct,
|
|
114
|
+
l(this, Ct, ee).call(this, "current-index-arc-abs", n);
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
|
-
b = new WeakMap(), Ot = new WeakMap(), g = new WeakMap(), vt = new WeakMap(), $ = new WeakMap(), Y = new WeakMap(), yt = new WeakMap(), Ct = new WeakSet(),
|
|
117
|
+
b = new WeakMap(), Ot = new WeakMap(), g = new WeakMap(), vt = new WeakMap(), $ = new WeakMap(), Y = new WeakMap(), yt = new WeakMap(), Ct = new WeakSet(), ee = function(n, e) {
|
|
118
118
|
e !== null ? (t(this, b).style.setProperty(`--${n}`, e.toString()), t(this, b).setAttribute(`data-${n}`, e.toString())) : (t(this, b).style.removeProperty(`--${n}`), t(this, b).removeAttribute(`data-${n}`));
|
|
119
119
|
};
|
|
120
|
-
const rs =
|
|
120
|
+
const rs = Re({
|
|
121
121
|
":host": {
|
|
122
122
|
position: "relative",
|
|
123
123
|
width: "100%",
|
|
@@ -155,7 +155,7 @@ const rs = Ve({
|
|
|
155
155
|
flexShrink: "0"
|
|
156
156
|
}
|
|
157
157
|
});
|
|
158
|
-
var u, wt, E, tt, B, W, F, T, et, st, N, it, xt, D, C, Et, Pt, Lt, zt, Ht, A, It, rt, M, nt, q, kt, ht, At, ot, lt, ct, p, $t, c,
|
|
158
|
+
var u, wt, E, tt, B, W, F, T, et, st, N, it, xt, D, C, Et, Pt, Lt, zt, Ht, A, It, rt, M, nt, q, kt, ht, At, ot, lt, ct, p, $t, c, ne, he, y, S, k, V, at, R, x, P, Bt, U, G, K, _, Wt, ut, Z, Ft, O, w, Nt, dt, o, xe, se, Dt, me, Se, Ee, Pe, L, oe, $e, qt, le, Le, ze, St, Be, ie, ce;
|
|
159
159
|
class Rt extends HTMLElement {
|
|
160
160
|
constructor() {
|
|
161
161
|
super();
|
|
@@ -242,8 +242,8 @@ class Rt extends HTMLElement {
|
|
|
242
242
|
s(this, p, null);
|
|
243
243
|
s(this, $t, null);
|
|
244
244
|
s(this, c, []);
|
|
245
|
-
s(this, re, 0);
|
|
246
245
|
s(this, ne, 0);
|
|
246
|
+
s(this, he, 0);
|
|
247
247
|
s(this, y, 0);
|
|
248
248
|
s(this, S, 0);
|
|
249
249
|
s(this, k, 0);
|
|
@@ -251,7 +251,7 @@ class Rt extends HTMLElement {
|
|
|
251
251
|
s(this, at, null);
|
|
252
252
|
s(this, R, null);
|
|
253
253
|
s(this, x, null);
|
|
254
|
-
s(this, P, new
|
|
254
|
+
s(this, P, new Ue(0));
|
|
255
255
|
s(this, Bt, 0);
|
|
256
256
|
s(this, U, 0);
|
|
257
257
|
s(this, G, !1);
|
|
@@ -259,18 +259,18 @@ class Rt extends HTMLElement {
|
|
|
259
259
|
s(this, _, !0);
|
|
260
260
|
s(this, Wt);
|
|
261
261
|
s(this, ut);
|
|
262
|
-
s(this, Z, new
|
|
262
|
+
s(this, Z, new je());
|
|
263
263
|
s(this, Ft, !1);
|
|
264
264
|
s(this, O, null);
|
|
265
265
|
s(this, w, !1);
|
|
266
|
-
s(this,
|
|
266
|
+
s(this, Nt, null);
|
|
267
267
|
s(this, dt, []);
|
|
268
268
|
s(this, L, () => {
|
|
269
269
|
if (t(this, lt).current)
|
|
270
270
|
return;
|
|
271
271
|
t(this, u).unlistenAnimationFrame();
|
|
272
272
|
const e = this.currentScrollValue / t(this, S) || 0, i = t(this, P).current;
|
|
273
|
-
if (h(this,
|
|
273
|
+
if (h(this, ne, this.vertical ? ye(this) : Ce(this)), h(this, he, this.vertical ? ye(t(this, p)) : Ce(t(this, p))), h(this, y, this.vertical ? this.offsetHeight : this.offsetWidth), this.vertical ? h(this, k, De.parse(
|
|
274
274
|
getComputedStyle(t(this, p)).rowGap
|
|
275
275
|
)) : h(this, k, De.parse(
|
|
276
276
|
getComputedStyle(t(this, p)).columnGap
|
|
@@ -309,7 +309,7 @@ class Rt extends HTMLElement {
|
|
|
309
309
|
t(this, u).set(e * t(this, S), {
|
|
310
310
|
equalize: !0
|
|
311
311
|
});
|
|
312
|
-
h(this, G, (this.vertical ? t(this, p).offsetHeight : t(this, p).offsetWidth) > t(this, y)), this.classList.toggle("has-overflow", t(this, G)), t(this, G) ? t(this, ot).current || l(this, o, Se).call(this) : l(this, o, me).call(this),
|
|
312
|
+
h(this, G, (this.vertical ? t(this, p).offsetHeight : t(this, p).offsetWidth) > t(this, y)), this.classList.toggle("has-overflow", t(this, G)), t(this, G) ? t(this, ot).current || l(this, o, Se).call(this) : l(this, o, me).call(this), te(this, "scrollResize", { custom: !0 }), t(this, u).notify();
|
|
313
313
|
});
|
|
314
314
|
s(this, oe, () => {
|
|
315
315
|
if (!t(this, G) || t(this, _) || t(this, K))
|
|
@@ -318,16 +318,16 @@ class Rt extends HTMLElement {
|
|
|
318
318
|
if (h(this, Bt, Math.max(0, e - t(this, S))), t(this, c).length) {
|
|
319
319
|
for (let i = 0; i < t(this, c).length; i++)
|
|
320
320
|
t(this, c)[i].transform();
|
|
321
|
-
t(this, P).current = l(this, o,
|
|
321
|
+
t(this, P).current = l(this, o, ie).call(this);
|
|
322
322
|
} else
|
|
323
323
|
this.vertical ? t(this, p).style.transform = `translate3d(0px, ${e * -1}px, 0px)` : t(this, p).style.transform = `translate3d(${e * -1}px, 0px, 0px)`;
|
|
324
|
-
l(this, o,
|
|
324
|
+
l(this, o, Be).call(this), gt.update(
|
|
325
325
|
this,
|
|
326
326
|
t(this, E).current,
|
|
327
327
|
e
|
|
328
328
|
);
|
|
329
329
|
});
|
|
330
|
-
s(this,
|
|
330
|
+
s(this, qt, (e, i) => {
|
|
331
331
|
t(this, wt).current && (l(this, o, Le).call(this, Math.sign(i) || 1), t(this, le).call(this, e, i));
|
|
332
332
|
});
|
|
333
333
|
s(this, le, (e, i) => {
|
|
@@ -338,14 +338,14 @@ class Rt extends HTMLElement {
|
|
|
338
338
|
return;
|
|
339
339
|
}
|
|
340
340
|
if (t(this, ut) || t(this, Z).unlistenAnimationFrame(), !t(this, A).current && t(this, ht).current && (clearInterval(t(this, Wt)), h(this, Wt, setTimeout(() => {
|
|
341
|
-
const r = t(this, c)[l(this, o,
|
|
341
|
+
const r = t(this, c)[l(this, o, ie).call(this)];
|
|
342
342
|
r && this.scrollToSection(r.index, {
|
|
343
343
|
tween: {
|
|
344
344
|
duration: t(this, At).current,
|
|
345
|
-
easing:
|
|
345
|
+
easing: Ge
|
|
346
346
|
}
|
|
347
347
|
});
|
|
348
|
-
}, t(this, ht).current))), !(e.includes("drag") && !
|
|
348
|
+
}, t(this, ht).current))), !(e.includes("drag") && !ts.isTouch && !t(this, zt).current)) {
|
|
349
349
|
if (t(this, T).current && e !== "drag") {
|
|
350
350
|
const r = Math.sign(i);
|
|
351
351
|
if (t(this, c).length) {
|
|
@@ -355,7 +355,7 @@ class Rt extends HTMLElement {
|
|
|
355
355
|
duration: t(this, st).current || 500
|
|
356
356
|
} : void 0
|
|
357
357
|
};
|
|
358
|
-
t(this, Ft) ? this.scrollToSection(l(this, o,
|
|
358
|
+
t(this, Ft) ? this.scrollToSection(l(this, o, ie).call(this, !0), a) : this.shiftSections(r, a);
|
|
359
359
|
} else
|
|
360
360
|
t(this, u).shift(r * t(this, y));
|
|
361
361
|
} else
|
|
@@ -370,9 +370,11 @@ class Rt extends HTMLElement {
|
|
|
370
370
|
const e = this.attachShadow({ mode: "open" });
|
|
371
371
|
e.adoptedStyleSheets = [rs];
|
|
372
372
|
const i = document.createElement("div");
|
|
373
|
-
i.className = "static", i.innerHTML = '<slot name="static"></slot>', e.appendChild(i), h(this, ct, document.createElement("div")), t(this, ct).className = "content-wrapper", h(this, p, document.createElement("div")), t(this, p).className = "content", h(this, $t, document.createElement("slot")), t(this, p).appendChild(t(this, $t)), t(this, ct).appendChild(t(this, p)), e.appendChild(t(this, ct)), h(this,
|
|
374
|
-
|
|
375
|
-
|
|
373
|
+
i.className = "static", i.innerHTML = '<slot name="static"></slot>', e.appendChild(i), h(this, ct, document.createElement("div")), t(this, ct).className = "content-wrapper", h(this, p, document.createElement("div")), t(this, p).className = "content", h(this, $t, document.createElement("slot")), t(this, p).appendChild(t(this, $t)), t(this, ct).appendChild(t(this, p)), e.appendChild(t(this, ct)), h(this, Nt, new MutationObserver(
|
|
374
|
+
Ve(() => {
|
|
375
|
+
this.tryResplit();
|
|
376
|
+
}, 10)
|
|
377
|
+
));
|
|
376
378
|
}
|
|
377
379
|
}
|
|
378
380
|
get damped() {
|
|
@@ -484,10 +486,10 @@ class Rt extends HTMLElement {
|
|
|
484
486
|
return t(this, c);
|
|
485
487
|
}
|
|
486
488
|
get position() {
|
|
487
|
-
return t(this,
|
|
489
|
+
return t(this, ne);
|
|
488
490
|
}
|
|
489
491
|
get contentPosition() {
|
|
490
|
-
return t(this,
|
|
492
|
+
return t(this, he);
|
|
491
493
|
}
|
|
492
494
|
get viewportSize() {
|
|
493
495
|
return t(this, y);
|
|
@@ -537,7 +539,7 @@ class Rt extends HTMLElement {
|
|
|
537
539
|
return t(this, E).current === "x" ? 0 : t(this, u).distance;
|
|
538
540
|
}
|
|
539
541
|
tryResplit() {
|
|
540
|
-
!t(this, _) && (t(this, C).current || t(this, F).current || t(this, C).current || t(this, N).current || t(this, T).current) && l(this, o,
|
|
542
|
+
!t(this, _) && (t(this, C).current || t(this, F).current || t(this, C).current || t(this, N).current || t(this, T).current) && l(this, o, se).call(this);
|
|
541
543
|
}
|
|
542
544
|
onScroll(...e) {
|
|
543
545
|
return t(this, u).subscribe(...e);
|
|
@@ -560,10 +562,10 @@ class Rt extends HTMLElement {
|
|
|
560
562
|
scrollToSection(e, i) {
|
|
561
563
|
if (!t(this, c).length)
|
|
562
564
|
return;
|
|
563
|
-
const r = t(this, P).current, a = l(this, o,
|
|
565
|
+
const r = t(this, P).current, a = l(this, o, $e).call(this, e), m = t(this, c)[r], v = t(this, c)[a];
|
|
564
566
|
if (m && v) {
|
|
565
567
|
let I = 0;
|
|
566
|
-
const ge = l(this, o,
|
|
568
|
+
const ge = l(this, o, ie).call(this), Tt = t(this, c)[ge], be = Tt ? this.targetScrollValue - Tt.position : 0;
|
|
567
569
|
t(this, C).current ? a === 0 && r === t(this, c).length - 1 ? I = t(this, S) + t(this, y) - m.position + t(this, k) : a === t(this, c).length - 1 && r === 0 ? I = v.position - (t(this, S) + t(this, y) + t(this, k)) : I = v.position - m.position : I = v.position - m.position, this.shiftPosition(I - be, i);
|
|
568
570
|
}
|
|
569
571
|
}
|
|
@@ -581,15 +583,15 @@ class Rt extends HTMLElement {
|
|
|
581
583
|
this.setPosition(t(this, u).target + e, i);
|
|
582
584
|
}
|
|
583
585
|
connectedCallback() {
|
|
584
|
-
gt.register(this), h(this, u, new
|
|
586
|
+
gt.register(this), h(this, u, new Ze(0, {
|
|
585
587
|
damping: 0.01,
|
|
586
588
|
min: 0,
|
|
587
|
-
order:
|
|
588
|
-
})), this.setAttribute("tabindex", "0"), h(this, V, new
|
|
589
|
+
order: _e.SCROLL
|
|
590
|
+
})), this.setAttribute("tabindex", "0"), h(this, V, new Je({ element: t(this, p) })), t(this, V).changeEvent.subscribe(t(this, qt)), h(this, at, new Qe({
|
|
589
591
|
element: this
|
|
590
592
|
})), t(this, at).changeEvent.subscribe(
|
|
591
|
-
t(this,
|
|
592
|
-
), h(this, R, new
|
|
593
|
+
t(this, qt)
|
|
594
|
+
), h(this, R, new Xe({ element: t(this, p) })), t(this, R).changeEvent.subscribe(t(this, qt)), h(this, x, new Ye({
|
|
593
595
|
culling: this
|
|
594
596
|
})), t(this, x).changeEvent.subscribe(t(this, le)), t(this, E).subscribe(() => {
|
|
595
597
|
l(this, o, xe).call(this);
|
|
@@ -602,11 +604,11 @@ class Rt extends HTMLElement {
|
|
|
602
604
|
}), t(this, W).subscribe(() => {
|
|
603
605
|
t(this, w) && t(this, L).call(this);
|
|
604
606
|
}), t(this, F).subscribe(({ current: e }) => {
|
|
605
|
-
t(this, w) && (e ? l(this, o,
|
|
607
|
+
t(this, w) && (e ? l(this, o, se).call(this) : l(this, o, Dt).call(this));
|
|
606
608
|
}), t(this, T).subscribe((e) => {
|
|
607
|
-
t(this, V).debounce = e.current, t(this, R).swipe = e.current, t(this, x).interval = e.current, t(this, w) && (e.current && !e.previous && !t(this, c).length ? l(this, o,
|
|
609
|
+
t(this, V).debounce = e.current, t(this, R).swipe = e.current, t(this, x).interval = e.current, t(this, w) && (e.current && !e.previous && !t(this, c).length ? l(this, o, se).call(this) : !e.current && e.previous && t(this, c).length && l(this, o, Dt).call(this));
|
|
608
610
|
}), t(this, N).subscribe((e) => {
|
|
609
|
-
t(this, w) && (t(this, L).call(this), e.current && !e.previous && !t(this, c).length ? l(this, o,
|
|
611
|
+
t(this, w) && (t(this, L).call(this), e.current && !e.previous && !t(this, c).length ? l(this, o, se).call(this) : !e.current && e.previous && t(this, c).length && l(this, o, Dt).call(this));
|
|
610
612
|
}), t(this, D).subscribe((e) => {
|
|
611
613
|
t(this, w) && (t(this, L).call(this), l(this, o, St).call(this));
|
|
612
614
|
}), t(this, C).subscribe((e) => {
|
|
@@ -639,26 +641,26 @@ class Rt extends HTMLElement {
|
|
|
639
641
|
e.current && !e.previous ? (this.classList.add("disabled"), l(this, o, me).call(this)) : !e.current && e.previous && (this.classList.remove("disabled"), l(this, o, Se).call(this));
|
|
640
642
|
}), t(this, lt).subscribe((e) => {
|
|
641
643
|
e.current && !e.previous ? (this.classList.add("hibernated"), l(this, o, Ee).call(this)) : !e.current && e.previous && (this.classList.remove("hibernated"), l(this, o, Pe).call(this));
|
|
642
|
-
}), t(this, wt).observe(), t(this, E).observe(), t(this, tt).observe(), t(this, B).observe(), t(this, W).observe(), t(this, F).observe(), t(this, T).observe(), t(this, et).observe(), t(this, st).observe(), t(this, N).observe(), t(this, it).observe(), t(this, xt).observe(), t(this, D).observe(), t(this, C).observe(), t(this, Et).observe(), t(this, Pt).observe(), t(this, Lt).observe(), t(this, zt).observe(), t(this, Ht).observe(), t(this, A).observe(), t(this, A).observe(), t(this, It).observe(), t(this, rt).observe(), t(this, M).observe(), t(this, nt).observe(), t(this, q).observe(), t(this, kt).observe(), t(this, ht).observe(), t(this, At).observe(), t(this, ot).observe(), t(this, lt).observe(), Vt.subscribe(t(this, ce), we.LAST);
|
|
644
|
+
}), t(this, wt).observe(), t(this, E).observe(), t(this, tt).observe(), t(this, B).observe(), t(this, W).observe(), t(this, F).observe(), t(this, T).observe(), t(this, et).observe(), t(this, st).observe(), t(this, N).observe(), t(this, it).observe(), t(this, xt).observe(), t(this, D).observe(), t(this, C).observe(), t(this, Et).observe(), t(this, Pt).observe(), t(this, Lt).observe(), t(this, zt).observe(), t(this, Ht).observe(), t(this, A).observe(), t(this, A).observe(), t(this, It).observe(), t(this, rt).observe(), t(this, M).observe(), t(this, nt).observe(), t(this, q).observe(), t(this, kt).observe(), t(this, ht).observe(), t(this, At).observe(), t(this, ot).observe(), t(this, lt).observe(), Vt.subscribe(t(this, ce), we.LAST), t(this, Nt).observe(this, { childList: !0 });
|
|
643
645
|
}
|
|
644
646
|
disconnectedCallback() {
|
|
645
|
-
this.removeAttribute("tabindex"), this.classList.remove("disabled"), this.classList.remove("hibernated"), t(this, wt).unobserve(), t(this, E).unobserve(), t(this, tt).unobserve(), t(this, B).unobserve(), t(this, W).unobserve(), t(this, F).unobserve(), t(this, T).unobserve(), t(this, et).unobserve(), t(this, st).unobserve(), t(this, N).unobserve(), t(this, it).unobserve(), t(this, xt).unobserve(), t(this, D).unobserve(), t(this, C).unobserve(), t(this, Et).unobserve(), t(this, Pt).unobserve(), t(this, Lt).unobserve(), t(this, zt).unobserve(), t(this, Ht).unobserve(), t(this, A).unobserve(), t(this, It).unobserve(), t(this, rt).unobserve(), t(this, M).unobserve(), t(this, nt).unobserve(), t(this, q).unobserve(), t(this, kt).unobserve(), t(this, ht).unobserve(), t(this, At).unobserve(), t(this, ot).unobserve(), t(this, lt).unobserve(), Vt.unsubscribe(t(this, ce)), l(this, o, Ee).call(this), t(this,
|
|
647
|
+
this.removeAttribute("tabindex"), this.classList.remove("disabled"), this.classList.remove("hibernated"), t(this, wt).unobserve(), t(this, E).unobserve(), t(this, tt).unobserve(), t(this, B).unobserve(), t(this, W).unobserve(), t(this, F).unobserve(), t(this, T).unobserve(), t(this, et).unobserve(), t(this, st).unobserve(), t(this, N).unobserve(), t(this, it).unobserve(), t(this, xt).unobserve(), t(this, D).unobserve(), t(this, C).unobserve(), t(this, Et).unobserve(), t(this, Pt).unobserve(), t(this, Lt).unobserve(), t(this, zt).unobserve(), t(this, Ht).unobserve(), t(this, A).unobserve(), t(this, It).unobserve(), t(this, rt).unobserve(), t(this, M).unobserve(), t(this, nt).unobserve(), t(this, q).unobserve(), t(this, kt).unobserve(), t(this, ht).unobserve(), t(this, At).unobserve(), t(this, ot).unobserve(), t(this, lt).unobserve(), Vt.unsubscribe(t(this, ce)), l(this, o, Ee).call(this), t(this, Nt).disconnect();
|
|
646
648
|
}
|
|
647
649
|
}
|
|
648
|
-
u = new WeakMap(), wt = new WeakMap(), E = new WeakMap(), tt = new WeakMap(), B = new WeakMap(), W = new WeakMap(), F = new WeakMap(), T = new WeakMap(), et = new WeakMap(), st = new WeakMap(), N = new WeakMap(), it = new WeakMap(), xt = new WeakMap(), D = new WeakMap(), C = new WeakMap(), Et = new WeakMap(), Pt = new WeakMap(), Lt = new WeakMap(), zt = new WeakMap(), Ht = new WeakMap(), A = new WeakMap(), It = new WeakMap(), rt = new WeakMap(), M = new WeakMap(), nt = new WeakMap(), q = new WeakMap(), kt = new WeakMap(), ht = new WeakMap(), At = new WeakMap(), ot = new WeakMap(), lt = new WeakMap(), ct = new WeakMap(), p = new WeakMap(), $t = new WeakMap(), c = new WeakMap(),
|
|
650
|
+
u = new WeakMap(), wt = new WeakMap(), E = new WeakMap(), tt = new WeakMap(), B = new WeakMap(), W = new WeakMap(), F = new WeakMap(), T = new WeakMap(), et = new WeakMap(), st = new WeakMap(), N = new WeakMap(), it = new WeakMap(), xt = new WeakMap(), D = new WeakMap(), C = new WeakMap(), Et = new WeakMap(), Pt = new WeakMap(), Lt = new WeakMap(), zt = new WeakMap(), Ht = new WeakMap(), A = new WeakMap(), It = new WeakMap(), rt = new WeakMap(), M = new WeakMap(), nt = new WeakMap(), q = new WeakMap(), kt = new WeakMap(), ht = new WeakMap(), At = new WeakMap(), ot = new WeakMap(), lt = new WeakMap(), ct = new WeakMap(), p = new WeakMap(), $t = new WeakMap(), c = new WeakMap(), ne = new WeakMap(), he = new WeakMap(), y = new WeakMap(), S = new WeakMap(), k = new WeakMap(), V = new WeakMap(), at = new WeakMap(), R = new WeakMap(), x = new WeakMap(), P = new WeakMap(), Bt = new WeakMap(), U = new WeakMap(), G = new WeakMap(), K = new WeakMap(), _ = new WeakMap(), Wt = new WeakMap(), ut = new WeakMap(), Z = new WeakMap(), Ft = new WeakMap(), O = new WeakMap(), w = new WeakMap(), Nt = new WeakMap(), dt = new WeakMap(), o = new WeakSet(), xe = function() {
|
|
649
651
|
const e = t(this, E).current, i = t(this, tt).current ? "-reverse" : "";
|
|
650
652
|
t(this, p).style.flexDirection = e === "x" ? `row${i}` : `column${i}`, t(this, V).axis = t(this, it).current ? "max" : e, t(this, at).dimension = e === "x" ? "width" : "height", t(this, R).axis = e, e === "x" ? this.style.touchAction = "pan-y" : e === "y" && (this.style.touchAction = "pan-x"), t(this, w) && t(this, L).call(this);
|
|
651
|
-
},
|
|
653
|
+
}, se = function() {
|
|
652
654
|
l(this, o, Dt).call(this), t(this, $t).assignedElements().forEach((e, i) => {
|
|
653
655
|
e instanceof HTMLElement && t(this, c).push(new is(e, i, this));
|
|
654
|
-
}), t(this, p).style.transform = "",
|
|
656
|
+
}), t(this, p).style.transform = "", te(this, "scrollSectionsChange", {
|
|
655
657
|
custom: !0,
|
|
656
658
|
composed: !0
|
|
657
659
|
}), t(this, L).call(this), l(this, o, St).call(this);
|
|
658
660
|
}, Dt = function() {
|
|
659
661
|
t(this, c).forEach((e) => {
|
|
660
662
|
e.destroy();
|
|
661
|
-
}), h(this, c, []), t(this, P).reset(), t(this, u).reset(),
|
|
663
|
+
}), h(this, c, []), t(this, P).reset(), t(this, u).reset(), te(this, "scrollSectionsChange", {
|
|
662
664
|
custom: !0,
|
|
663
665
|
composed: !0
|
|
664
666
|
});
|
|
@@ -669,13 +671,13 @@ u = new WeakMap(), wt = new WeakMap(), E = new WeakMap(), tt = new WeakMap(), B
|
|
|
669
671
|
}, Se = function() {
|
|
670
672
|
t(this, K) && (h(this, K, !1), t(this, u).subscribe(t(this, oe), -1e4), t(this, u).notify(), t(this, V).connect(), t(this, at).connect(), t(this, R).connect(), t(this, A).current && t(this, x).connect());
|
|
671
673
|
}, Ee = function() {
|
|
672
|
-
t(this, _) || (h(this, _, !0), Vt.unsubscribe(t(this, L)),
|
|
674
|
+
t(this, _) || (h(this, _, !0), Vt.unsubscribe(t(this, L)), re.unsubscribe(t(this, L)), l(this, o, me).call(this), t(this, p).style.transform = "", t(this, p).style.height = "", t(this, p).style.width = "", this.classList.remove("has-overflow", "start", "end"), t(this, c).length ? l(this, o, Dt).call(this) : (t(this, P).reset(), t(this, u).reset()), gt.unregister(this));
|
|
673
675
|
}, Pe = function() {
|
|
674
|
-
t(this, _) && (h(this, _, !1), gt.register(this), this.tryResplit(), l(this, o, Se).call(this), Vt.subscribe(t(this, L), we.SCROLL),
|
|
675
|
-
}, L = new WeakMap(), oe = new WeakMap(),
|
|
676
|
+
t(this, _) && (h(this, _, !1), gt.register(this), this.tryResplit(), l(this, o, Se).call(this), Vt.subscribe(t(this, L), we.SCROLL), re.subscribe(this, t(this, L)));
|
|
677
|
+
}, L = new WeakMap(), oe = new WeakMap(), $e = function(e) {
|
|
676
678
|
let i = t(this, P).current;
|
|
677
|
-
return t(this, C).current ? i =
|
|
678
|
-
},
|
|
679
|
+
return t(this, C).current ? i = Ke(e, t(this, c).length) : i = Oe(e, 0, this.limit), i;
|
|
680
|
+
}, qt = new WeakMap(), le = new WeakMap(), Le = function(e = 1) {
|
|
679
681
|
t(this, rt).current && (t(this, x).direction = e), t(this, A).current && t(this, x).pauseAndContinue(
|
|
680
682
|
t(this, It).current,
|
|
681
683
|
this.sectionalCSSProperty.current
|
|
@@ -689,7 +691,7 @@ u = new WeakMap(), wt = new WeakMap(), E = new WeakMap(), tt = new WeakMap(), B
|
|
|
689
691
|
}, St = function() {
|
|
690
692
|
if (t(this, c).length) {
|
|
691
693
|
const e = t(this, P).current + t(this, nt).current;
|
|
692
|
-
if (e === 0 ? h(this, O, "start") : e === this.limit ? h(this, O, "end") : h(this, O, null),
|
|
694
|
+
if (e === 0 ? h(this, O, "start") : e === this.limit ? h(this, O, "end") : h(this, O, null), te(this, "scrollLine", {
|
|
693
695
|
detail: { line: t(this, O) }
|
|
694
696
|
}), t(this, M).current) {
|
|
695
697
|
this.classList.remove("end", "start"), t(this, O) && this.classList.add(t(this, O));
|
|
@@ -701,7 +703,7 @@ u = new WeakMap(), wt = new WeakMap(), E = new WeakMap(), tt = new WeakMap(), B
|
|
|
701
703
|
});
|
|
702
704
|
}
|
|
703
705
|
}
|
|
704
|
-
},
|
|
706
|
+
}, Be = function() {
|
|
705
707
|
if (t(this, M).current) {
|
|
706
708
|
const e = Math.floor(t(this, dt).length / 2);
|
|
707
709
|
t(this, dt).sort((i, r) => i.element.getBoundingClientRect().left - r.element.getBoundingClientRect().left), t(this, dt).forEach((i, r) => {
|
|
@@ -709,7 +711,7 @@ u = new WeakMap(), wt = new WeakMap(), E = new WeakMap(), tt = new WeakMap(), B
|
|
|
709
711
|
i.setCurrentIndex(r), i.setCurrentIndexArc(a), i.setCurrentIndexArcAbs(Math.abs(a)), i.setMiddle(r === e);
|
|
710
712
|
});
|
|
711
713
|
}
|
|
712
|
-
},
|
|
714
|
+
}, ie = function(e = !1) {
|
|
713
715
|
let i = this.targetScrollValue, r = 1 / 0, a = 0;
|
|
714
716
|
const m = t(this, u).direction;
|
|
715
717
|
for (let v = 0; v < t(this, c).length; v++) {
|
|
@@ -732,12 +734,12 @@ class Ie extends HTMLElement {
|
|
|
732
734
|
return t(this, ae);
|
|
733
735
|
}
|
|
734
736
|
connectedCallback() {
|
|
735
|
-
const e =
|
|
737
|
+
const e = He(this, Rt);
|
|
736
738
|
e instanceof Rt ? h(this, ae, e) : console.error(this, "e-scroll not found");
|
|
737
739
|
}
|
|
738
740
|
}
|
|
739
741
|
ae = new WeakMap();
|
|
740
|
-
var ft, z, j, J,
|
|
742
|
+
var ft, z, j, J, Ut, Gt, pt, Kt, ue, de;
|
|
741
743
|
class ns extends Ie {
|
|
742
744
|
constructor() {
|
|
743
745
|
super();
|
|
@@ -745,23 +747,23 @@ class ns extends Ie {
|
|
|
745
747
|
s(this, z, null);
|
|
746
748
|
s(this, j, !1);
|
|
747
749
|
s(this, J, 0);
|
|
748
|
-
s(this, qt, 0);
|
|
749
750
|
s(this, Ut, 0);
|
|
751
|
+
s(this, Gt, 0);
|
|
750
752
|
s(this, pt, () => {
|
|
751
753
|
h(this, j, this.offsetWidth > this.offsetHeight);
|
|
752
754
|
const e = t(this, j) ? this.offsetWidth : this.offsetHeight;
|
|
753
|
-
h(this, J, e / ((this.scrollElement.scrollSize + this.scrollElement.viewportSize) / e)), h(this, J, Math.max(t(this, J), 30)), t(this, j) ? (t(this, z).style.width = t(this, J) + "px", t(this, z).style.height = "100%") : (t(this, z).style.width = "100%", t(this, z).style.height = t(this, J) + "px"), h(this,
|
|
755
|
+
h(this, J, e / ((this.scrollElement.scrollSize + this.scrollElement.viewportSize) / e)), h(this, J, Math.max(t(this, J), 30)), t(this, j) ? (t(this, z).style.width = t(this, J) + "px", t(this, z).style.height = "100%") : (t(this, z).style.width = "100%", t(this, z).style.height = t(this, J) + "px"), h(this, Ut, e - t(this, J)), this.scrollElement.scrollSize <= 0 ? this.style.display = "none" : this.style.display = "", t(this, Kt).call(this);
|
|
754
756
|
});
|
|
755
|
-
s(this,
|
|
756
|
-
h(this,
|
|
757
|
+
s(this, Kt, () => {
|
|
758
|
+
h(this, Gt, this.scrollElement.currentProgress * t(this, Ut)), t(this, j) ? t(this, z).style.transform = `translate3d(${t(this, Gt)}px, 0px, 0px)` : t(this, z).style.transform = `translate3d(0px, ${t(this, Gt)}px, 0px)`;
|
|
757
759
|
});
|
|
758
760
|
s(this, ue, () => {
|
|
759
761
|
this.setAttribute("axis", this.scrollElement.axisCSSProperty.current);
|
|
760
762
|
});
|
|
761
763
|
s(this, de, (e) => {
|
|
762
|
-
document.documentElement.classList.add("grabbing"),
|
|
764
|
+
document.documentElement.classList.add("grabbing"), es(
|
|
763
765
|
(a) => {
|
|
764
|
-
const m = t(this, j) ? a.x : a.y, v = this.scrollElement.distance / t(this,
|
|
766
|
+
const m = t(this, j) ? a.x : a.y, v = this.scrollElement.distance / t(this, Ut), I = (m - r) * v;
|
|
765
767
|
this.scrollElement.setPosition(i + I);
|
|
766
768
|
},
|
|
767
769
|
() => {
|
|
@@ -773,7 +775,7 @@ class ns extends Ie {
|
|
|
773
775
|
if (H) {
|
|
774
776
|
const e = this.attachShadow({ mode: "open" });
|
|
775
777
|
e.adoptedStyleSheets = [
|
|
776
|
-
|
|
778
|
+
Re({
|
|
777
779
|
":host": {
|
|
778
780
|
display: "inline-block",
|
|
779
781
|
zIndex: "1",
|
|
@@ -811,27 +813,27 @@ class ns extends Ie {
|
|
|
811
813
|
connectedCallback() {
|
|
812
814
|
super.connectedCallback(), this.setAttribute("drag-dead-zone", "");
|
|
813
815
|
const e = t(this, ft).assignedElements()[0] || t(this, ft).firstElementChild;
|
|
814
|
-
h(this, z, e), t(this, z).addEventListener("pointerdown", t(this, de)), Vt.subscribe(t(this, pt), we.SCROLL),
|
|
816
|
+
h(this, z, e), t(this, z).addEventListener("pointerdown", t(this, de)), Vt.subscribe(t(this, pt), we.SCROLL), re.subscribe(this, t(this, pt)), re.subscribe(this.scrollElement, t(this, pt)), this.scrollElement.onScroll(t(this, Kt)), this.scrollElement.axisCSSProperty.subscribe(t(this, ue));
|
|
815
817
|
}
|
|
816
818
|
disconnectedCallback() {
|
|
817
|
-
this.removeAttribute("drag-dead-zone"), this.style.display = "", t(this, z).removeEventListener("pointerdown", t(this, de)), Vt.unsubscribe(t(this, pt)),
|
|
819
|
+
this.removeAttribute("drag-dead-zone"), this.style.display = "", t(this, z).removeEventListener("pointerdown", t(this, de)), Vt.unsubscribe(t(this, pt)), re.unsubscribe(t(this, pt)), this.scrollElement.offScroll(t(this, Kt)), this.scrollElement.axisCSSProperty.unsubscribe(t(this, ue));
|
|
818
820
|
}
|
|
819
821
|
}
|
|
820
|
-
ft = new WeakMap(), z = new WeakMap(), j = new WeakMap(), J = new WeakMap(),
|
|
822
|
+
ft = new WeakMap(), z = new WeakMap(), j = new WeakMap(), J = new WeakMap(), Ut = new WeakMap(), Gt = new WeakMap(), pt = new WeakMap(), Kt = new WeakMap(), ue = new WeakMap(), de = new WeakMap();
|
|
821
823
|
H && !customElements.get("e-scrollbar") && customElements.define("e-scrollbar", ns);
|
|
822
|
-
var
|
|
823
|
-
class
|
|
824
|
+
var _t, Zt, jt;
|
|
825
|
+
class We extends Ie {
|
|
824
826
|
constructor() {
|
|
825
827
|
super();
|
|
826
|
-
s(this,
|
|
827
|
-
s(this,
|
|
828
|
+
s(this, _t, new f(this, "--behaviour", "smooth"));
|
|
829
|
+
s(this, Zt, new f(
|
|
828
830
|
this,
|
|
829
831
|
"--tween-easing",
|
|
830
832
|
!1
|
|
831
833
|
));
|
|
832
|
-
s(this,
|
|
834
|
+
s(this, jt, new f(this, "--tween-duration", 0));
|
|
833
835
|
H && this.addEventListener("click", () => {
|
|
834
|
-
const e = t(this,
|
|
836
|
+
const e = t(this, _t).current, i = t(this, Zt).current, r = t(this, jt).current;
|
|
835
837
|
this.handleClick({
|
|
836
838
|
behaviour: e,
|
|
837
839
|
tween: i || r ? { easing: i, duration: r } : void 0
|
|
@@ -839,37 +841,37 @@ class Be extends Ie {
|
|
|
839
841
|
});
|
|
840
842
|
}
|
|
841
843
|
connectedCallback() {
|
|
842
|
-
super.connectedCallback(), t(this,
|
|
844
|
+
super.connectedCallback(), t(this, _t).observe(), t(this, Zt).observe(), t(this, jt).observe();
|
|
843
845
|
}
|
|
844
846
|
disconnectedCallback() {
|
|
845
|
-
t(this,
|
|
847
|
+
t(this, _t).close(), t(this, Zt).close(), t(this, jt).close();
|
|
846
848
|
}
|
|
847
849
|
}
|
|
848
|
-
|
|
849
|
-
var
|
|
850
|
-
class hs extends
|
|
850
|
+
_t = new WeakMap(), Zt = new WeakMap(), jt = new WeakMap();
|
|
851
|
+
var Jt;
|
|
852
|
+
class hs extends We {
|
|
851
853
|
constructor() {
|
|
852
854
|
super(...arguments);
|
|
853
|
-
s(this,
|
|
855
|
+
s(this, Jt, new f(this, "--set", 1));
|
|
854
856
|
}
|
|
855
857
|
handleClick(e) {
|
|
856
|
-
this.scrollElement.scrollToSection(t(this,
|
|
858
|
+
this.scrollElement.scrollToSection(t(this, Jt).current, e);
|
|
857
859
|
}
|
|
858
860
|
connectedCallback() {
|
|
859
|
-
super.connectedCallback(), t(this,
|
|
861
|
+
super.connectedCallback(), t(this, Jt).observe();
|
|
860
862
|
}
|
|
861
863
|
disconnectedCallback() {
|
|
862
|
-
super.disconnectedCallback(), t(this,
|
|
864
|
+
super.disconnectedCallback(), t(this, Jt).close();
|
|
863
865
|
}
|
|
864
866
|
}
|
|
865
|
-
|
|
867
|
+
Jt = new WeakMap();
|
|
866
868
|
H && !customElements.get("e-scroll-set-button") && customElements.define("e-scroll-set-button", hs);
|
|
867
|
-
var Q,
|
|
868
|
-
class os extends
|
|
869
|
+
var Q, Qt;
|
|
870
|
+
class os extends We {
|
|
869
871
|
constructor() {
|
|
870
872
|
super(...arguments);
|
|
871
873
|
s(this, Q, new f(this, "--step", 1));
|
|
872
|
-
s(this,
|
|
874
|
+
s(this, Qt, () => {
|
|
873
875
|
this.scrollElement.loopCSSProperty.current ? this.removeAttribute("disabled") : t(this, Q).current > 0 && this.scrollElement.scrollLine === "end" || t(this, Q).current < 0 && this.scrollElement.scrollLine === "start" ? this.setAttribute("disabled", "") : this.removeAttribute("disabled");
|
|
874
876
|
});
|
|
875
877
|
}
|
|
@@ -878,52 +880,52 @@ class os extends Be {
|
|
|
878
880
|
}
|
|
879
881
|
connectedCallback() {
|
|
880
882
|
super.connectedCallback(), this.scrollElement && (t(this, Q).subscribe(() => {
|
|
881
|
-
t(this,
|
|
883
|
+
t(this, Qt).call(this);
|
|
882
884
|
}), t(this, Q).observe(), this.scrollElement.addEventListener(
|
|
883
885
|
"scrollLine",
|
|
884
|
-
t(this,
|
|
885
|
-
), t(this,
|
|
886
|
+
t(this, Qt)
|
|
887
|
+
), t(this, Qt).call(this));
|
|
886
888
|
}
|
|
887
889
|
disconnectedCallback() {
|
|
888
890
|
super.disconnectedCallback(), t(this, Q).close(), this.removeAttribute("disabled");
|
|
889
891
|
}
|
|
890
892
|
}
|
|
891
|
-
Q = new WeakMap(),
|
|
893
|
+
Q = new WeakMap(), Qt = new WeakMap();
|
|
892
894
|
H && !customElements.get("e-scroll-step-button") && customElements.define("e-scroll-step-button", os);
|
|
893
|
-
var X, bt,
|
|
895
|
+
var X, bt, Xt, fe, pe, Yt;
|
|
894
896
|
class ls {
|
|
895
897
|
constructor(n, e, i) {
|
|
896
898
|
s(this, X, null);
|
|
897
899
|
s(this, bt, null);
|
|
898
|
-
s(this,
|
|
900
|
+
s(this, Xt, null);
|
|
899
901
|
s(this, fe, null);
|
|
900
902
|
s(this, pe, () => {
|
|
901
|
-
t(this, bt).scrollToSection(t(this,
|
|
903
|
+
t(this, bt).scrollToSection(t(this, Xt), {
|
|
902
904
|
behaviour: t(this, fe)
|
|
903
905
|
});
|
|
904
906
|
});
|
|
905
|
-
s(this,
|
|
907
|
+
s(this, Yt, () => {
|
|
906
908
|
t(this, X).classList.toggle(
|
|
907
909
|
"current",
|
|
908
|
-
t(this, bt).counter.current === t(this,
|
|
910
|
+
t(this, bt).counter.current === t(this, Xt)
|
|
909
911
|
);
|
|
910
912
|
});
|
|
911
|
-
H && (h(this, X, document.createElement("button")), h(this, bt, n), h(this, fe, i), h(this,
|
|
913
|
+
H && (h(this, X, document.createElement("button")), h(this, bt, n), h(this, fe, i), h(this, Xt, e), t(this, X).addEventListener("click", t(this, pe)), t(this, bt).counter.subscribe(t(this, Yt)), t(this, Yt).call(this));
|
|
912
914
|
}
|
|
913
915
|
get element() {
|
|
914
916
|
return t(this, X);
|
|
915
917
|
}
|
|
916
918
|
destroy() {
|
|
917
|
-
t(this, X).removeEventListener("click", t(this, pe)), t(this, bt).counter.unsubscribe(t(this,
|
|
919
|
+
t(this, X).removeEventListener("click", t(this, pe)), t(this, bt).counter.unsubscribe(t(this, Yt)), t(this, X).remove();
|
|
918
920
|
}
|
|
919
921
|
}
|
|
920
|
-
X = new WeakMap(), bt = new WeakMap(),
|
|
922
|
+
X = new WeakMap(), bt = new WeakMap(), Xt = new WeakMap(), fe = new WeakMap(), pe = new WeakMap(), Yt = new WeakMap();
|
|
921
923
|
var mt, Mt;
|
|
922
924
|
class cs extends Ie {
|
|
923
925
|
constructor() {
|
|
924
926
|
super(...arguments);
|
|
925
927
|
s(this, mt, []);
|
|
926
|
-
s(this, Mt,
|
|
928
|
+
s(this, Mt, Ve(() => {
|
|
927
929
|
t(this, mt).forEach((i) => i.destroy()), h(this, mt, []);
|
|
928
930
|
const e = this.scrollElement.sections.length - Math.max(this.scrollElement.sectionsInViewCSSProperty.current - 1, 0);
|
|
929
931
|
for (let i = 0; i < e; i++) {
|
|
@@ -957,7 +959,7 @@ mt = new WeakMap(), Mt = new WeakMap();
|
|
|
957
959
|
H && !customElements.get("e-scroll-bullet-buttons") && customElements.define("e-scroll-bullet-buttons", cs);
|
|
958
960
|
class as extends ss {
|
|
959
961
|
connectedCallback() {
|
|
960
|
-
const n =
|
|
962
|
+
const n = He(this, Rt);
|
|
961
963
|
n instanceof Rt ? (this.scrollContainer = n, this.scrollContainer.addEventListener(
|
|
962
964
|
"scrollSectionsChange",
|
|
963
965
|
this.findAnotherScrollEntries
|