aptechka 0.50.26 → 0.50.28
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/ScrollElement.d.ts +1 -0
- package/lib/scroll/index.cjs +1 -1
- package/lib/scroll/index.js +302 -291
- package/package.json +1 -1
|
@@ -48,6 +48,7 @@ export declare class ScrollElement extends HTMLElement {
|
|
|
48
48
|
get classesCSSProperty(): CSSProperty<boolean>;
|
|
49
49
|
get currentIndexStartOffsetCSSProperty(): CSSProperty<number>;
|
|
50
50
|
get currentIndexEndOffsetCSSProperty(): CSSProperty<number>;
|
|
51
|
+
get shiftSectionPositionCSSProperty(): CSSProperty<number>;
|
|
51
52
|
get focusDelayCSSProperty(): CSSProperty<number>;
|
|
52
53
|
get focusDurationCSSProperty(): CSSProperty<number>;
|
|
53
54
|
get disabledCSSProperty(): CSSProperty<boolean>;
|
package/lib/scroll/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var Ne=Object.defineProperty;var Ie=Object.getOwnPropertySymbols;var Ue=Object.prototype.hasOwnProperty,Ge=Object.prototype.propertyIsEnumerable;var Ae=a=>{throw TypeError(a)};var ke=(a,n,e)=>n in a?Ne(a,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[n]=e,Re=(a,n)=>{for(var e in n||(n={}))Ue.call(n,e)&&ke(a,e,n[e]);if(Ie)for(var e of Ie(n))Ge.call(n,e)&&ke(a,e,n[e]);return a};var ve=(a,n,e)=>n.has(a)||Ae("Cannot "+e);var t=(a,n,e)=>(ve(a,n,"read from private field"),e?e.call(a):n.get(a)),s=(a,n,e)=>n.has(a)?Ae("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(a):n.set(a,e),h=(a,n,e,i)=>(ve(a,n,"write to private field"),i?i.call(a,e):n.set(a,e),e),l=(a,n,e)=>(ve(a,n,"access private method"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ze=require("../Store-DRp_K37w.cjs"),O=require("../index-Cqw2NKev.cjs"),je=require("../easings-GegIwET5.cjs"),te=require("../events-KVanG9sR.cjs"),Te=require("../jss-CRBgdvJ3.cjs"),qt=require("../layout-Ctc2p3uz.cjs"),qe=require("../math-GDWEqu7y.cjs"),Ke=require("../number-0243DApo.cjs");require("../ticker/index.cjs");const me=require("../order/index.cjs"),Je=require("../Damped-B1lXa9nb.cjs"),Qe=require("../Tweened-cJ36zq1A.cjs"),fe=require("../controls/index.cjs"),Dt=require("../window-resizer/index.cjs"),gt=require("../scroll-entries/index.cjs"),Me=require("../css-unit-parser/index.cjs"),S=require("../css-property/index.cjs"),Xe=require("../device/index.cjs"),re=require("../element-resizer/index.cjs"),Ye=require("../gestures-C7gbKx11.cjs"),De=require("../dom-JBOkFLTh.cjs"),ts=require("../function-MthRj-GJ.cjs"),es=require("../scroll-segment/index.cjs");var b,Bt,g,yt,V,Y,Ct,vt,ee;class ss{constructor(n,e,i){s(this,vt);s(this,b);s(this,Bt);s(this,g);s(this,yt,0);s(this,V,0);s(this,Y,null);s(this,Ct,0);h(this,b,n),h(this,Bt,e),h(this,g,i),gt.scrollEntries.register(t(this,b)),this.setIndex(t(this,Bt))}get element(){return t(this,b)}get index(){return t(this,Bt)}get size(){return t(this,yt)}get position(){return t(this,V)}get transformPosition(){return t(this,Ct)}destroy(){gt.scrollEntries.unregister(t(this,b)),this.unsetTransform()}unsetTransform(){t(this,b).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,b).style.setProperty("--size",n+"px"),t(this,g).axisCSSProperty.current==="x"?(t(this,b).style.width=n+"px",t(this,b).style.height=""):(t(this,b).style.height=n+"px",t(this,b).style.width="")):(t(this,b).style.width="",t(this,b).style.height="",t(this,b).style.removeProperty("--size"))}resize(){h(this,yt,t(this,g).vertical?t(this,b).offsetHeight:t(this,b).offsetWidth),h(this,V,t(this,g).vertical?qt.getCumulativeOffsetTop(t(this,b)):qt.getCumulativeOffsetLeft(t(this,b))),h(this,V,t(this,V)-t(this,g).contentPosition)}transform(){let n=0;const e=t(this,g).viewportSize*t(this,g).sectionDistanceScaleCSSProperty.current;t(this,g).loopCSSProperty.current&&t(this,g).overscroll&&t(this,V)+t(this,yt)<t(this,g).currentScrollValue&&(n=t(this,g).distance*-1-t(this,g).gap),gt.scrollEntries.update(t(this,b),t(this,g).axisCSSProperty.current,n);const i=t(this,g).currentScrollValue+n,r=t(this,V)-t(this,g).viewportSize-e,u=t(this,V)+t(this,yt)+e,f=qe.clamp(i,r,u);h(this,Ct,f*-1),t(this,g).vertical?t(this,b).style.transform=`translate3d(0px, ${t(this,Ct)}px, 0px)`:t(this,b).style.transform=`translate3d(${t(this,Ct)}px, 0px, 0px)`}setMark(n){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.dispatchEvent(t(this,b),"scrollSectionMarkChange",{composed:!0,detail:{mark:t(this,Y)},custom:!0}))}setMiddle(n){t(this,b).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)}}b=new WeakMap,Bt=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,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}`))};const is=Te.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 d,wt,P,tt,_,H,$,M,et,st,W,it,Et,T,v,Pt,xt,Lt,zt,Ot,A,It,rt,R,nt,F,ht,kt,ot,lt,ct,p,Vt,c,ne,he,y,m,k,q,ut,D,w,x,_t,N,U,G,Z,Ht,at,j,$t,B,E,oe,dt,o,we,se,Tt,ge,ye,Ee,Pe,L,Wt,Be,Ft,le,xe,Le,mt,Oe,ie,ce;class Rt extends HTMLElement{constructor(){super();s(this,o);s(this,d,null);s(this,wt,new S.CSSProperty(this,"--controls",!0));s(this,P,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,Et,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,Pt,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,Ot,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,ht,new S.CSSProperty(this,"--focus-delay",0));s(this,kt,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,Vt,null);s(this,c,[]);s(this,ne,0);s(this,he,0);s(this,y,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 Ze.Store(0));s(this,_t,0);s(this,N,0);s(this,U,!1);s(this,G,!0);s(this,Z,!0);s(this,Ht);s(this,at);s(this,j,new Qe.Tweened);s(this,$t,!1);s(this,B,null);s(this,E,!1);s(this,oe,null);s(this,dt,[]);s(this,L,()=>{if(t(this,lt).current)return;t(this,d).unlistenAnimationFrame();const e=this.currentScrollValue/t(this,m)||0,i=t(this,x).current;if(h(this,ne,this.vertical?qt.getCumulativeOffsetTop(this):qt.getCumulativeOffsetLeft(this)),h(this,he,this.vertical?qt.getCumulativeOffsetTop(t(this,p)):qt.getCumulativeOffsetLeft(t(this,p))),h(this,y,this.vertical?this.offsetHeight:this.offsetWidth),this.vertical?h(this,k,Me.cssUnitParser.parse(getComputedStyle(t(this,p)).rowGap)):h(this,k,Me.cssUnitParser.parse(getComputedStyle(t(this,p)).columnGap)),t(this,W).current&&t(this,c).length){const r=t(this,T).current,u=(t(this,y)-t(this,k)*(r-1))/r;t(this,c).forEach(f=>{f.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,y)*t(this,H).current);const r=t(this,m)+t(this,y);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,y))):(t(this,p).style.width="max-content",t(this,p).style.height="100%",h(this,m,t(this,p).offsetWidth-t(this,y)));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,d).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,y),f=t(this,m)-u;h(this,N,r.position+r.size+f)}else h(this,N,t(this,m));if(t(this,M).current&&t(this,c).length){const r=t(this,c)[i];t(this,d).set(r.position,{equalize:!0})}else t(this,d).set(e*t(this,m),{equalize:!0});h(this,U,(this.vertical?t(this,p).offsetHeight:t(this,p).offsetWidth)>t(this,y)),this.classList.toggle("has-overflow",t(this,U)),t(this,U)?t(this,ot).current||l(this,o,ye).call(this):l(this,o,ge).call(this),te.dispatchEvent(this,"scrollResize",{custom:!0}),t(this,Wt).call(this)});s(this,Wt,()=>{if(!t(this,U)||t(this,Z)||t(this,G))return;const e=this.currentScrollValue;if(h(this,_t,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,Oe).call(this),gt.scrollEntries.update(this,t(this,P).current,e)});s(this,Ft,(e,i)=>{t(this,wt).current&&(l(this,o,xe).call(this,Math.sign(i)||1),t(this,le).call(this,e,i))});s(this,le,(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,Ht)),h(this,Ht,setTimeout(()=>{const r=t(this,c)[l(this,o,ie).call(this)];r&&this.scrollToSection(r.index,{tween:{duration:t(this,kt).current,easing:je.easeInOutExpo}})},t(this,ht).current))),!(e.includes("drag")&&!Xe.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,$t)?this.scrollToSection(l(this,o,ie).call(this,!0),u):this.shiftSections(r,u)}else t(this,d).shift(r*t(this,y))}else t(this,d).shift(i);h(this,$t,e==="drag")}});s(this,ce,()=>{h(this,E,!0),this.hibernatedCSSProperty.current||l(this,o,Pe).call(this)});if(O.isBrowser){const e=this.attachShadow({mode:"open"});e.adoptedStyleSheets=[is];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,Vt,document.createElement("slot")),t(this,p).appendChild(t(this,Vt)),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,d)}get controlsCSSProperty(){return t(this,wt)}get axisCSSProperty(){return t(this,P)}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,Et)}get sectionsInViewCSSProperty(){return t(this,T)}get loopCSSProperty(){return t(this,v)}get dampingCSSProperty(){return t(this,Pt)}get massCSSProperty(){return t(this,xt)}get stiffnessCSSProperty(){return t(this,Lt)}get mouseDragCSSProperty(){return t(this,zt)}get sectionDistanceScaleCSSProperty(){return t(this,Ot)}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 focusDelayCSSProperty(){return t(this,ht)}get focusDurationCSSProperty(){return t(this,kt)}get disabledCSSProperty(){return t(this,ot)}get hibernatedCSSProperty(){return t(this,lt)}get currentScrollValue(){return l(this,o,Le).call(this,"current")}get targetScrollValue(){return l(this,o,Le).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,y)}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,_t)}get scrollLine(){return t(this,B)}get vertical(){return t(this,P).current==="y"}get currentProgress(){return this.currentScrollValue/this.loopDistance||0}get targetProgress(){return this.targetScrollValue/this.loopDistance||0}get scrollWidth(){return t(this,P).current==="y"?0:t(this,d).distance}get scrollHeight(){return t(this,P).current==="x"?0:t(this,d).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,d).subscribe(...e)}offScroll(...e){t(this,d).unsubscribe(...e)}range(e,i,r=0){const u=e-r,f=u+i+r*2;return this.currentProgress<u?0:this.currentProgress>f?1:(this.currentProgress-u)/(f-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,f=u+i+r*2;return this.currentProgress>=u&&this.currentProgress<=f}scrollToSection(e,i){if(!t(this,c).length)return;const r=t(this,x).current,u=l(this,o,Be).call(this,e),f=t(this,c)[r],C=t(this,c)[u];if(f&&C){let I=0;const Ce=l(this,o,ie).call(this),Mt=t(this,c)[Ce],be=Mt?this.targetScrollValue-Mt.position:0;t(this,v).current?u===0&&r===t(this,c).length-1?I=t(this,m)+t(this,y)-f.position+t(this,k):u===t(this,c).length-1&&r===0?I=C.position-(t(this,m)+t(this,y)+t(this,k)):I=C.position-f.position:I=C.position-f.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,xe).call(this,Math.sign(e)||1),i!=null&&i.tween?t(this,at)||(t(this,j).set(t(this,d).current,{equalize:!0}),t(this,j).set(e,Re({},i.tween)),h(this,at,setTimeout(()=>{h(this,at,void 0)},i.tween.duration||0))):t(this,d).set(e,{equalize:(i==null?void 0:i.behaviour)==="instant"})}shiftPosition(e,i){this.setPosition(t(this,d).target+e,i)}connectedCallback(){gt.scrollEntries.register(this),h(this,d,new Je.Damped(0,{damping:.01,min:0,order:me.TICK_ORDER.SCROLL})),this.setAttribute("tabindex","0"),h(this,q,new fe.WheelControls({element:t(this,p)})),t(this,q).changeEvent.subscribe(t(this,Ft)),h(this,ut,new fe.KeyboardControls({element:this})),t(this,ut).changeEvent.subscribe(t(this,Ft)),h(this,D,new fe.DragControls({element:t(this,p)})),t(this,D).changeEvent.subscribe(t(this,Ft)),h(this,w,new fe.AutoplayControls({culling:this})),t(this,w).changeEvent.subscribe(t(this,le)),t(this,P).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,P).current}),t(this,Et).subscribe(e=>{t(this,D).inertion=typeof e.current=="number"?e.current:1}),t(this,H).subscribe(()=>{t(this,E)&&t(this,L).call(this)}),t(this,$).subscribe(({current:e})=>{t(this,E)&&(e?l(this,o,se).call(this):l(this,o,Tt).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,E)&&(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,Tt).call(this))}),t(this,W).subscribe(e=>{t(this,E)&&(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,Tt).call(this))}),t(this,T).subscribe(e=>{t(this,E)&&(t(this,L).call(this),l(this,o,mt).call(this))}),t(this,v).subscribe(e=>{e.current?(t(this,E)&&(t(this,c).length||(t(this,$).current=!0)),t(this,d).max=1/0,t(this,d).min=-1/0):(h(this,_t,0),t(this,d).max=t(this,m),t(this,d).min=0)}),t(this,Pt).subscribe(e=>{t(this,d).damping=e.current}),t(this,xt).subscribe(e=>{t(this,d).mass=e.current}),t(this,Lt).subscribe(e=>{t(this,d).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,E)&&l(this,o,mt).call(this)}),t(this,nt).subscribe(e=>{t(this,E)&&t(this,R).current&&l(this,o,mt).call(this)}),t(this,F).subscribe(e=>{t(this,E)&&t(this,R).current&&l(this,o,mt).call(this)}),t(this,d).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,d).set(e.current,{equalize:!0})}),t(this,ot).subscribe(e=>{e.current&&!e.previous?(this.classList.add("disabled"),l(this,o,ge).call(this)):!e.current&&e.previous&&(this.classList.remove("disabled"),l(this,o,ye).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,Pe).call(this))}),t(this,wt).observe(),t(this,P).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,Et).observe(),t(this,T).observe(),t(this,v).observe(),t(this,Pt).observe(),t(this,xt).observe(),t(this,Lt).observe(),t(this,zt).observe(),t(this,Ot).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,ht).observe(),t(this,kt).observe(),t(this,ot).observe(),t(this,lt).observe(),Dt.windowResizer.subscribe(t(this,ce),me.RESIZE_ORDER.LAST)}disconnectedCallback(){this.removeAttribute("tabindex"),this.classList.remove("disabled"),this.classList.remove("hibernated"),t(this,wt).unobserve(),t(this,P).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,Et).unobserve(),t(this,T).unobserve(),t(this,v).unobserve(),t(this,Pt).unobserve(),t(this,xt).unobserve(),t(this,Lt).unobserve(),t(this,zt).unobserve(),t(this,Ot).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,ht).unobserve(),t(this,kt).unobserve(),t(this,ot).unobserve(),t(this,lt).unobserve(),Dt.windowResizer.unsubscribe(t(this,ce)),l(this,o,Ee).call(this),t(this,oe).disconnect()}}d=new WeakMap,wt=new WeakMap,P=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,Et=new WeakMap,T=new WeakMap,v=new WeakMap,Pt=new WeakMap,xt=new WeakMap,Lt=new WeakMap,zt=new WeakMap,Ot=new WeakMap,A=new WeakMap,It=new WeakMap,rt=new WeakMap,R=new WeakMap,nt=new WeakMap,F=new WeakMap,ht=new WeakMap,kt=new WeakMap,ot=new WeakMap,lt=new WeakMap,ct=new WeakMap,p=new WeakMap,Vt=new WeakMap,c=new WeakMap,ne=new WeakMap,he=new WeakMap,y=new WeakMap,m=new WeakMap,k=new WeakMap,q=new WeakMap,ut=new WeakMap,D=new WeakMap,w=new WeakMap,x=new WeakMap,_t=new WeakMap,N=new WeakMap,U=new WeakMap,G=new WeakMap,Z=new WeakMap,Ht=new WeakMap,at=new WeakMap,j=new WeakMap,$t=new WeakMap,B=new WeakMap,E=new WeakMap,oe=new WeakMap,dt=new WeakMap,o=new WeakSet,we=function(){const e=t(this,P).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,E)&&t(this,L).call(this)},se=function(){l(this,o,Tt).call(this),t(this,Vt).assignedElements().forEach((e,i)=>{e instanceof HTMLElement&&t(this,c).push(new ss(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)},Tt=function(){t(this,c).forEach(e=>{e.destroy()}),h(this,c,[]),t(this,x).reset(),t(this,d).reset(),te.dispatchEvent(this,"scrollSectionsChange",{custom:!0,composed:!0})},ge=function(){t(this,G)||(h(this,G,!0),t(this,d).unsubscribe(t(this,Wt)),t(this,d).unlistenAnimationFrame(),clearInterval(t(this,Ht)),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)))},ye=function(){t(this,G)&&(h(this,G,!1),t(this,d).subscribe(t(this,Wt)),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),Dt.windowResizer.unsubscribe(t(this,L)),re.elementResizer.unsubscribe(t(this,L)),l(this,o,ge).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,Tt).call(this):(t(this,x).reset(),t(this,d).reset()),gt.scrollEntries.unregister(this))},Pe=function(){t(this,Z)&&(h(this,Z,!1),gt.scrollEntries.register(this),this.tryResplit(),l(this,o,ye).call(this),Dt.windowResizer.subscribe(t(this,L),me.RESIZE_ORDER.SCROLL),re.elementResizer.subscribe(this,t(this,L)))},L=new WeakMap,Wt=new WeakMap,Be=function(e){let i=t(this,x).current;return t(this,v).current?i=Ke.loopNumber(e,t(this,c).length):i=qe.clamp(e,0,this.limit),i},Ft=new WeakMap,le=new WeakMap,xe=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)},Le=function(e="current"){if(t(this,v).current&&t(this,c).length){const i=t(this,d)[e]%(t(this,m)+t(this,y)+t(this,k));return i<0?t(this,m)+i+t(this,y)+t(this,k):i}else return t(this,d)[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);const f=e-this.limit-1+t(this,F).current,C=e+i,I=this.sections.length-C;u>=e&&u<C||u<=f?(r.setMark("current"),t(this,dt).push(r)):u>=C&&u<C+I/2||u<=f+i?r.setMark("next"):r.setMark("previous")})}}},Oe=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 f=t(this,d).direction;for(let C=0;C<t(this,c).length;C++){const I=t(this,c)[C];let Ce=t(this,$t)?I.size*f*-1*.4:0,Mt=I.position;this.overscroll&&Mt===0&&e&&(Mt=t(this,N));let be=Math.abs(Mt+Ce-i);be<r&&(r=be,u=C)}return u},ce=new WeakMap;O.isBrowser&&!customElements.get("e-scroll")&&customElements.define("e-scroll",Rt);var ue;class ze extends HTMLElement{constructor(){super(...arguments);s(this,ue,null)}get scrollElement(){return t(this,ue)}connectedCallback(){const e=De.findParentElement(this,Rt);e instanceof Rt?h(this,ue,e):console.error(this,"e-scroll not found")}}ue=new WeakMap;var St,z,K,J,Nt,Ut,pt,Gt,ae,de;class Ve extends ze{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,ae,()=>{this.setAttribute("axis",this.scrollElement.axisCSSProperty.current)});s(this,de,e=>{document.documentElement.classList.add("grabbing"),Ye.setupDrag(u=>{const f=t(this,K)?u.x:u.y,C=this.scrollElement.distance/t(this,Nt),I=(f-r)*C;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=[Te.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,de)),Dt.windowResizer.subscribe(t(this,pt),me.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,ae))}disconnectedCallback(){this.removeAttribute("drag-dead-zone"),this.style.display="",t(this,z).removeEventListener("pointerdown",t(this,de)),Dt.windowResizer.unsubscribe(t(this,pt)),re.elementResizer.unsubscribe(t(this,pt)),this.scrollElement.offScroll(t(this,Gt)),this.scrollElement.axisCSSProperty.unsubscribe(t(this,ae))}}St=new WeakMap,z=new WeakMap,K=new WeakMap,J=new WeakMap,Nt=new WeakMap,Ut=new WeakMap,pt=new WeakMap,Gt=new WeakMap,ae=new WeakMap,de=new WeakMap;O.isBrowser&&!customElements.get("e-scrollbar")&&customElements.define("e-scrollbar",Ve);var Zt,jt,Kt;class _e extends ze{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 He extends _e{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",He);var Q,Qt;class $e extends _e{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",$e);var X,bt,Xt,Se,pe,Yt;class rs{constructor(n,e,i){s(this,X,null);s(this,bt,null);s(this,Xt,null);s(this,Se,null);s(this,pe,()=>{t(this,bt).scrollToSection(t(this,Xt),{behaviour:t(this,Se)})});s(this,Yt,()=>{t(this,X).classList.toggle("current",t(this,bt).counter.current===t(this,Xt))});O.isBrowser&&(h(this,X,document.createElement("button")),h(this,bt,n),h(this,Se,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))}get element(){return t(this,X)}destroy(){t(this,X).removeEventListener("click",t(this,pe)),t(this,bt).counter.unsubscribe(t(this,Yt)),t(this,X).remove()}}X=new WeakMap,bt=new WeakMap,Xt=new WeakMap,Se=new WeakMap,pe=new WeakMap,Yt=new WeakMap;var ft,At;class We extends ze{constructor(){super(...arguments);s(this,ft,[]);s(this,At,ts.debounce(()=>{t(this,ft).forEach(i=>i.destroy()),h(this,ft,[]);const e=this.scrollElement.sections.length-Math.max(this.scrollElement.sectionsInViewCSSProperty.current-1,0);for(let i=0;i<e;i++){const r=new rs(this.scrollElement,i,this.getAttribute("behaviour")||"smooth");this.appendChild(r.element),t(this,ft).push(r)}},0))}connectedCallback(){super.connectedCallback(),this.scrollElement.addEventListener("sectionsChange",t(this,At)),this.scrollElement.sectionsInViewCSSProperty.subscribe(t(this,At))}disconnectedCallback(){this.scrollElement.removeEventListener("sectionsChange",t(this,At)),this.scrollElement.sectionsInViewCSSProperty.unsubscribe(t(this,At)),t(this,ft).forEach(e=>e.destroy()),h(this,ft,[])}}ft=new WeakMap,At=new WeakMap;O.isBrowser&&!customElements.get("e-scroll-bullet-buttons")&&customElements.define("e-scroll-bullet-buttons",We);class Fe extends es.ScrollSegmentElement{connectedCallback(){const n=De.findParentElement(this,Rt);n instanceof Rt?(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 Rt&&(this.scrollContainer.removeEventListener("scrollSectionsChange",this.findAnotherScrollEntries),this.scrollContainer.removeEventListener("scrollResize",this.resize))}}O.isBrowser&&!customElements.get("e-scroll-segment")&&customElements.define("e-scroll-segment",Fe);exports.ScrollBulletButtonsElement=We;exports.ScrollElement=Rt;exports.ScrollSegmentElement=Fe;exports.ScrollSetButtonElement=He;exports.ScrollStepButtonElement=$e;exports.ScrollbarElement=Ve;
|
|
1
|
+
"use strict";var Ue=Object.defineProperty;var ke=Object.getOwnPropertySymbols;var Ge=Object.prototype.hasOwnProperty,Ze=Object.prototype.propertyIsEnumerable;var Re=a=>{throw TypeError(a)};var Ae=(a,r,e)=>r in a?Ue(a,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[r]=e,Me=(a,r)=>{for(var e in r||(r={}))Ge.call(r,e)&&Ae(a,e,r[e]);if(ke)for(var e of ke(r))Ze.call(r,e)&&Ae(a,e,r[e]);return a};var Pe=(a,r,e)=>r.has(a)||Re("Cannot "+e);var t=(a,r,e)=>(Pe(a,r,"read from private field"),e?e.call(a):r.get(a)),s=(a,r,e)=>r.has(a)?Re("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(a):r.set(a,e),h=(a,r,e,i)=>(Pe(a,r,"write to private field"),i?i.call(a,e):r.set(a,e),e),l=(a,r,e)=>(Pe(a,r,"access private method"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const je=require("../Store-DRp_K37w.cjs"),O=require("../index-Cqw2NKev.cjs"),Ke=require("../easings-GegIwET5.cjs"),ee=require("../events-KVanG9sR.cjs"),qe=require("../jss-CRBgdvJ3.cjs"),qt=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-B1lXa9nb.cjs"),Xe=require("../Tweened-cJ36zq1A.cjs"),me=require("../controls/index.cjs"),Dt=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"),ne=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,Bt,g,Ct,V,Y,yt,vt,se;class is{constructor(r,e,i){s(this,vt);s(this,f);s(this,Bt);s(this,g);s(this,Ct,0);s(this,V,0);s(this,Y,null);s(this,yt,0);h(this,f,r),h(this,Bt,e),h(this,g,i),gt.scrollEntries.register(t(this,f)),this.setIndex(t(this,Bt))}get element(){return t(this,f)}get index(){return t(this,Bt)}get size(){return t(this,Ct)}get position(){return t(this,V)}get transformPosition(){return t(this,yt)}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(r){r?(t(this,f).style.setProperty("--size",r+"px"),t(this,g).axisCSSProperty.current==="x"?(t(this,f).style.width=r+"px",t(this,f).style.height=""):(t(this,f).style.height=r+"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,Ct,t(this,g).vertical?t(this,f).offsetHeight:t(this,f).offsetWidth),h(this,V,t(this,g).vertical?qt.getCumulativeOffsetTop(t(this,f)):qt.getCumulativeOffsetLeft(t(this,f))),h(this,V,t(this,V)-t(this,g).contentPosition)}transform(){const r=t(this,g).shiftSectionPositionCSSProperty.current;console.log(r);let e=r;const i=t(this,g).viewportSize*t(this,g).sectionDistanceScaleCSSProperty.current;t(this,g).loopCSSProperty.current&&t(this,V)+t(this,Ct)<t(this,g).currentScrollValue-r&&(e=(t(this,g).distance-r)*-1-t(this,g).gap),gt.scrollEntries.update(t(this,f),t(this,g).axisCSSProperty.current,e);const n=t(this,g).currentScrollValue+e,u=t(this,V)-t(this,g).viewportSize-i,b=t(this,V)+t(this,Ct)+i,C=De.clamp(n,u,b);h(this,yt,C*-1),t(this,g).vertical?t(this,f).style.transform=`translate3d(0px, ${t(this,yt)}px, 0px)`:t(this,f).style.transform=`translate3d(${t(this,yt)}px, 0px, 0px)`}setMark(r){t(this,Y)!==r&&(t(this,Y)&&t(this,f).classList.remove(t(this,Y)),r&&t(this,f).classList.add(r),h(this,Y,r),ee.dispatchEvent(t(this,f),"scrollSectionMarkChange",{composed:!0,detail:{mark:t(this,Y)},custom:!0}))}setMiddle(r){t(this,f).classList.toggle("middle",r)}setIndex(r){l(this,vt,se).call(this,"index",r)}setCurrentIndex(r){l(this,vt,se).call(this,"current-index",r)}setCurrentIndexArc(r){l(this,vt,se).call(this,"current-index-arc",r)}setCurrentIndexArcAbs(r){l(this,vt,se).call(this,"current-index-arc-abs",r)}}f=new WeakMap,Bt=new WeakMap,g=new WeakMap,Ct=new WeakMap,V=new WeakMap,Y=new WeakMap,yt=new WeakMap,vt=new WeakSet,se=function(r,e){e!==null?(t(this,f).style.setProperty(`--${r}`,e.toString()),t(this,f).setAttribute(`data-${r}`,e.toString())):(t(this,f).style.removeProperty(`--${r}`),t(this,f).removeAttribute(`data-${r}`))};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 d,Pt,E,tt,_,H,$,M,et,st,W,it,wt,T,v,Et,xt,Lt,zt,Ot,A,It,rt,R,nt,F,Vt,ht,kt,ot,lt,ct,p,_t,c,he,oe,y,m,k,q,ut,D,P,x,Ht,N,U,G,Z,$t,at,j,Wt,B,w,le,dt,o,we,ie,Tt,Ce,ye,Ee,xe,L,Ft,Oe,Nt,ce,Le,ze,mt,Ve,re,ue;class Rt extends HTMLElement{constructor(){super();s(this,o);s(this,d,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,Ot,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,Vt,new S.CSSProperty(this,"--shift-section-position",0,{rawValueCheck:!1}));s(this,ht,new S.CSSProperty(this,"--focus-delay",0));s(this,kt,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,y,0);s(this,m,0);s(this,k,0);s(this,q,null);s(this,ut,null);s(this,D,null);s(this,P,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,w,!1);s(this,le,null);s(this,dt,[]);s(this,L,()=>{if(t(this,lt).current)return;t(this,d).unlistenAnimationFrame();const e=this.currentScrollValue/t(this,m)||0,i=t(this,x).current;if(h(this,he,this.vertical?qt.getCumulativeOffsetTop(this):qt.getCumulativeOffsetLeft(this)),h(this,oe,this.vertical?qt.getCumulativeOffsetTop(t(this,p)):qt.getCumulativeOffsetLeft(t(this,p))),h(this,y,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 n=t(this,T).current,u=(t(this,y)-t(this,k)*(n-1))/n;t(this,c).forEach(b=>{b.setSize(u)})}else t(this,c).forEach(n=>{n.setSize()});if(t(this,c).forEach(n=>{n.resize()}),t(this,H).current){h(this,m,t(this,y)*t(this,H).current);const n=t(this,m)+t(this,y);this.vertical?(t(this,p).style.width=n+"px",t(this,p).style.height="100%"):(t(this,p).style.height=n+"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,y))):(t(this,p).style.width="max-content",t(this,p).style.height="100%",h(this,m,t(this,p).offsetWidth-t(this,y)));if(!t(this,v).current){const n=getComputedStyle(this),u=this.vertical?parseFloat(n.paddingBlockStart)+parseFloat(n.paddingBlockEnd):parseFloat(n.paddingInlineStart)+parseFloat(n.paddingInlineEnd);h(this,m,t(this,m)+u),t(this,d).max=t(this,m)}if(t(this,v).current&&t(this,c).length){const n=t(this,c)[t(this,c).length-1],u=n.position+n.size-t(this,y),b=t(this,m)-u;h(this,N,n.position+n.size+b)}else h(this,N,t(this,m));if(t(this,M).current&&t(this,c).length){const n=t(this,c)[i];t(this,d).set(n.position,{equalize:!0})}else t(this,d).set(e*t(this,m),{equalize:!0});h(this,U,(this.vertical?t(this,p).offsetHeight:t(this,p).offsetWidth)>t(this,y)),this.classList.toggle("has-overflow",t(this,U)),t(this,U)?t(this,ot).current||l(this,o,ye).call(this):l(this,o,Ce).call(this),ee.dispatchEvent(this,"scrollResize",{custom:!0}),t(this,Ft).call(this)});s(this,Ft,()=>{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,Ve).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 n=t(this,c)[l(this,o,re).call(this)];n&&this.scrollToSection(n.index,{tween:{duration:t(this,kt).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 n=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(n,u)}else t(this,d).shift(n*t(this,y))}else t(this,d).shift(i);h(this,Wt,e==="drag")}});s(this,ue,()=>{h(this,w,!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,le,new MutationObserver(n=>{this.tryResplit()}))}}get damped(){return t(this,d)}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,Ot)}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,Vt)}get focusDelayCSSProperty(){return t(this,ht)}get focusDurationCSSProperty(){return t(this,kt)}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,y)}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,d).distance}get scrollHeight(){return t(this,E).current==="x"?0:t(this,d).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,d).subscribe(...e)}offScroll(...e){t(this,d).unsubscribe(...e)}range(e,i,n=0){const u=e-n,b=u+i+n*2;return this.currentProgress<u?0:this.currentProgress>b?1:(this.currentProgress-u)/(b-u)}curve(e,i,n=0){return Math.sin(this.range(e,i,n)*Math.PI)}visible(e,i,n=0){const u=e-n,b=u+i+n*2;return this.currentProgress>=u&&this.currentProgress<=b}scrollToSection(e,i){if(!t(this,c).length)return;const n=t(this,x).current,u=l(this,o,Oe).call(this,e),b=t(this,c)[n],C=t(this,c)[u];if(b&&C){let I=0;const ve=l(this,o,re).call(this),Mt=t(this,c)[ve],be=Mt?this.targetScrollValue-Mt.position:0;t(this,v).current?u===0&&n===t(this,c).length-1?I=t(this,m)+t(this,y)-b.position+t(this,k):u===t(this,c).length-1&&n===0?I=C.position-(t(this,m)+t(this,y)+t(this,k)):I=C.position-b.position:I=C.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,d).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,d).set(e,{equalize:(i==null?void 0:i.behaviour)==="instant"})}shiftPosition(e,i){this.setPosition(t(this,d).target+e,i)}connectedCallback(){gt.scrollEntries.register(this),h(this,d,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,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,P,new me.AutoplayControls({culling:this})),t(this,P).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,w)&&t(this,L).call(this)}),t(this,$).subscribe(({current:e})=>{t(this,w)&&(e?l(this,o,ie).call(this):l(this,o,Tt).call(this))}),t(this,M).subscribe(e=>{t(this,q).debounce=e.current,t(this,D).swipe=e.current,t(this,P).interval=e.current,t(this,w)&&(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,Tt).call(this))}),t(this,W).subscribe(e=>{t(this,w)&&(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,Tt).call(this))}),t(this,T).subscribe(e=>{t(this,w)&&(t(this,L).call(this),l(this,o,mt).call(this))}),t(this,v).subscribe(e=>{e.current?(t(this,w)&&(t(this,c).length||(t(this,$).current=!0)),t(this,d).max=1/0,t(this,d).min=-1/0):(h(this,Ht,0),t(this,d).max=t(this,m),t(this,d).min=0)}),t(this,Et).subscribe(e=>{t(this,d).damping=e.current}),t(this,xt).subscribe(e=>{t(this,d).mass=e.current}),t(this,Lt).subscribe(e=>{t(this,d).stiffness=e.current}),t(this,A).subscribe(e=>{t(this,P).speed=e.current,!t(this,G)&&e.current&&!e.previous?t(this,P).connect():!e.current&&e.previous&&t(this,P).disconnect()}),t(this,rt).subscribe(e=>{e.current||(t(this,P).direction=1)}),t(this,R).subscribe(e=>{t(this,w)&&l(this,o,mt).call(this)}),t(this,nt).subscribe(e=>{t(this,w)&&t(this,R).current&&l(this,o,mt).call(this)}),t(this,F).subscribe(e=>{t(this,w)&&t(this,R).current&&l(this,o,mt).call(this)}),t(this,d).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,d).set(e.current,{equalize:!0})}),t(this,ot).subscribe(e=>{e.current&&!e.previous?(this.classList.add("disabled"),l(this,o,Ce).call(this)):!e.current&&e.previous&&(this.classList.remove("disabled"),l(this,o,ye).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,Ot).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,Vt).observe(),t(this,ht).observe(),t(this,kt).observe(),t(this,ot).observe(),t(this,lt).observe(),Dt.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,Ot).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,Vt).unobserve(),t(this,ht).unobserve(),t(this,kt).unobserve(),t(this,ot).unobserve(),t(this,lt).unobserve(),Dt.windowResizer.unsubscribe(t(this,ue)),l(this,o,Ee).call(this),t(this,le).disconnect()}}d=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,Ot=new WeakMap,A=new WeakMap,It=new WeakMap,rt=new WeakMap,R=new WeakMap,nt=new WeakMap,F=new WeakMap,Vt=new WeakMap,ht=new WeakMap,kt=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,y=new WeakMap,m=new WeakMap,k=new WeakMap,q=new WeakMap,ut=new WeakMap,D=new WeakMap,P=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,w=new WeakMap,le=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,w)&&t(this,L).call(this)},ie=function(){l(this,o,Tt).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)},Tt=function(){t(this,c).forEach(e=>{e.destroy()}),h(this,c,[]),t(this,x).reset(),t(this,d).reset(),ee.dispatchEvent(this,"scrollSectionsChange",{custom:!0,composed:!0})},Ce=function(){t(this,G)||(h(this,G,!0),t(this,d).unsubscribe(t(this,Ft)),t(this,d).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,P).disconnect(),t(this,U)||(this.sections.forEach(e=>{e.unsetTransform()}),t(this,L).call(this)))},ye=function(){t(this,G)&&(h(this,G,!1),t(this,d).subscribe(t(this,Ft)),t(this,q).connect(),t(this,ut).connect(),t(this,D).connect(),t(this,A).current&&t(this,P).connect())},Ee=function(){t(this,Z)||(h(this,Z,!0),Dt.windowResizer.unsubscribe(t(this,L)),ne.elementResizer.unsubscribe(t(this,L)),l(this,o,Ce).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,Tt).call(this):(t(this,x).reset(),t(this,d).reset()),gt.scrollEntries.unregister(this))},xe=function(){t(this,Z)&&(h(this,Z,!1),gt.scrollEntries.register(this),this.tryResplit(),l(this,o,ye).call(this),Dt.windowResizer.subscribe(t(this,L),ge.RESIZE_ORDER.SCROLL),ne.elementResizer.subscribe(this,t(this,L)))},L=new WeakMap,Ft=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},Nt=new WeakMap,ce=new WeakMap,Le=function(e=1){t(this,rt).current&&(t(this,P).direction=e),t(this,A).current&&t(this,P).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,d)[e]%Math.round(t(this,m)+t(this,y)+t(this,k));return i<0?t(this,m)+i+t(this,y)+t(this,k):i}else return t(this,d)[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((n,u)=>{n.setCurrentIndex(null),n.setCurrentIndexArc(null),n.setCurrentIndexArcAbs(null);const b=e-this.limit-1+t(this,F).current,C=e+i,I=this.sections.length-C;u>=e&&u<C||u<=b?(n.setMark("current"),t(this,dt).push(n)):u>=C&&u<C+I/2||u<=b+i?n.setMark("next"):n.setMark("previous")})}}},Ve=function(){if(t(this,R).current){const e=Math.floor(t(this,dt).length/2);t(this,dt).sort((i,n)=>i.element.getBoundingClientRect().left-n.element.getBoundingClientRect().left),t(this,dt).forEach((i,n)=>{const u=n-e;i.setCurrentIndex(n),i.setCurrentIndexArc(u),i.setCurrentIndexArcAbs(Math.abs(u)),i.setMiddle(n===e)})}},re=function(e=!1){let i=this.targetScrollValue,n=1/0,u=0;const b=t(this,d).direction;for(let C=0;C<t(this,c).length;C++){const I=t(this,c)[C];let ve=t(this,Wt)?I.size*b*-1*.4:0,Mt=I.position;this.overscroll&&Mt===0&&e&&(Mt=t(this,N));let be=Math.abs(Mt+ve-i);be<=n&&(n=be,u=C)}return u},ue=new WeakMap;O.isBrowser&&!customElements.get("e-scroll")&&customElements.define("e-scroll",Rt);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,Rt);e instanceof Rt?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 _e 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"),ts.setupDrag(u=>{const b=t(this,K)?u.x:u.y,C=this.scrollElement.distance/t(this,Ut),I=(b-n)*C;this.scrollElement.setPosition(i+I)},()=>{document.documentElement.classList.remove("grabbing")});const i=this.scrollElement.damped.target,n=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)),Dt.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)),Dt.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",_e);var jt,Kt,Jt;class He 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,n=t(this,Jt).current;this.handleClick({behaviour:e,tween:i||n?{easing:i,duration:n}: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 $e extends He{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",$e);var Q,Xt;class We extends He{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",We);var X,ft,Yt,pe,fe,te;class ns{constructor(r,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,r),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,At;class Fe extends Ie{constructor(){super(...arguments);s(this,bt,[]);s(this,At,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 n=new ns(this.scrollElement,i,this.getAttribute("behaviour")||"smooth");this.appendChild(n.element),t(this,bt).push(n)}},0))}connectedCallback(){super.connectedCallback(),this.scrollElement.addEventListener("sectionsChange",t(this,At)),this.scrollElement.sectionsInViewCSSProperty.subscribe(t(this,At))}disconnectedCallback(){this.scrollElement.removeEventListener("sectionsChange",t(this,At)),this.scrollElement.sectionsInViewCSSProperty.unsubscribe(t(this,At)),t(this,bt).forEach(e=>e.destroy()),h(this,bt,[])}}bt=new WeakMap,At=new WeakMap;O.isBrowser&&!customElements.get("e-scroll-bullet-buttons")&&customElements.define("e-scroll-bullet-buttons",Fe);class Ne extends ss.ScrollSegmentElement{connectedCallback(){const r=Be.findParentElement(this,Rt);r instanceof Rt?(this.scrollContainer=r,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 Rt&&(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=Rt;exports.ScrollSegmentElement=Ne;exports.ScrollSetButtonElement=$e;exports.ScrollStepButtonElement=We;exports.ScrollbarElement=_e;
|
package/lib/scroll/index.js
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
1
|
+
var We = Object.defineProperty;
|
|
2
|
+
var ke = Object.getOwnPropertySymbols;
|
|
3
|
+
var Fe = Object.prototype.hasOwnProperty, Ne = Object.prototype.propertyIsEnumerable;
|
|
4
|
+
var Me = (u) => {
|
|
5
5
|
throw TypeError(u);
|
|
6
6
|
};
|
|
7
|
-
var
|
|
8
|
-
for (var e in
|
|
9
|
-
|
|
10
|
-
if (
|
|
11
|
-
for (var e of
|
|
12
|
-
|
|
7
|
+
var Ae = (u, r, e) => r in u ? We(u, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : u[r] = e, Te = (u, r) => {
|
|
8
|
+
for (var e in r || (r = {}))
|
|
9
|
+
Fe.call(r, e) && Ae(u, e, r[e]);
|
|
10
|
+
if (ke)
|
|
11
|
+
for (var e of ke(r))
|
|
12
|
+
Ne.call(r, e) && Ae(u, e, r[e]);
|
|
13
13
|
return u;
|
|
14
14
|
};
|
|
15
|
-
var
|
|
16
|
-
var t = (u,
|
|
17
|
-
import { S as
|
|
15
|
+
var ve = (u, r, e) => r.has(u) || Me("Cannot " + e);
|
|
16
|
+
var t = (u, r, e) => (ve(u, r, "read from private field"), e ? e.call(u) : r.get(u)), s = (u, r, e) => r.has(u) ? Me("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(u) : r.set(u, e), h = (u, r, e, i) => (ve(u, r, "write to private field"), i ? i.call(u, e) : r.set(u, e), e), l = (u, r, e) => (ve(u, r, "access private method"), e);
|
|
17
|
+
import { S as qe } from "../Store-D2xCXENW.js";
|
|
18
18
|
import { i as H } from "../index-euf5anj6.js";
|
|
19
|
-
import { a as
|
|
20
|
-
import { d as
|
|
21
|
-
import { c as
|
|
22
|
-
import { a as
|
|
23
|
-
import { c as
|
|
24
|
-
import { l as
|
|
19
|
+
import { a as Ue } from "../easings-Bni3YAAW.js";
|
|
20
|
+
import { d as te } from "../events-CsVF98U6.js";
|
|
21
|
+
import { c as Ve } from "../jss-DtnXPEnq.js";
|
|
22
|
+
import { a as Ce, g as ye } from "../layout-DpZo-I0y.js";
|
|
23
|
+
import { c as Re } from "../math-BOBiC4TN.js";
|
|
24
|
+
import { l as Ge } from "../number-DwCxt_Ck.js";
|
|
25
25
|
import "../ticker/index.js";
|
|
26
|
-
import { TICK_ORDER as
|
|
27
|
-
import { D as
|
|
28
|
-
import { T as
|
|
29
|
-
import { WheelControls as
|
|
26
|
+
import { TICK_ORDER as Ke, RESIZE_ORDER as we } from "../order/index.js";
|
|
27
|
+
import { D as _e } from "../Damped-BXsGpI-B.js";
|
|
28
|
+
import { T as Ze } from "../Tweened-BhDWLNF0.js";
|
|
29
|
+
import { WheelControls as je, KeyboardControls as Je, DragControls as Qe, AutoplayControls as Xe } from "../controls/index.js";
|
|
30
30
|
import { windowResizer as Dt } from "../window-resizer/index.js";
|
|
31
31
|
import { scrollEntries as gt } from "../scroll-entries/index.js";
|
|
32
|
-
import { cssUnitParser as
|
|
33
|
-
import { CSSProperty as
|
|
34
|
-
import { device as
|
|
35
|
-
import { elementResizer as
|
|
36
|
-
import { s as
|
|
37
|
-
import { b as
|
|
38
|
-
import { d as
|
|
39
|
-
import { ScrollSegmentElement as
|
|
40
|
-
var b, Rt, g, vt, $, Y, Ct, yt,
|
|
41
|
-
class
|
|
42
|
-
constructor(
|
|
32
|
+
import { cssUnitParser as De } from "../css-unit-parser/index.js";
|
|
33
|
+
import { CSSProperty as f } from "../css-property/index.js";
|
|
34
|
+
import { device as Ye } from "../device/index.js";
|
|
35
|
+
import { elementResizer as re } from "../element-resizer/index.js";
|
|
36
|
+
import { s as ts } from "../gestures-CcXV6fCp.js";
|
|
37
|
+
import { b as Oe } from "../dom-CVWzyXPH.js";
|
|
38
|
+
import { d as es } from "../function-C10DGppn.js";
|
|
39
|
+
import { ScrollSegmentElement as ss } from "../scroll-segment/index.js";
|
|
40
|
+
var b, Rt, g, vt, $, Y, Ct, yt, ee;
|
|
41
|
+
class is {
|
|
42
|
+
constructor(r, e, i) {
|
|
43
43
|
s(this, yt);
|
|
44
44
|
s(this, b);
|
|
45
45
|
s(this, Rt);
|
|
@@ -48,7 +48,7 @@ class ss {
|
|
|
48
48
|
s(this, $, 0);
|
|
49
49
|
s(this, Y, null);
|
|
50
50
|
s(this, Ct, 0);
|
|
51
|
-
h(this, b,
|
|
51
|
+
h(this, b, r), h(this, Rt, e), h(this, g, i), gt.register(t(this, b)), this.setIndex(t(this, Rt));
|
|
52
52
|
}
|
|
53
53
|
get element() {
|
|
54
54
|
return t(this, b);
|
|
@@ -71,25 +71,27 @@ class ss {
|
|
|
71
71
|
unsetTransform() {
|
|
72
72
|
t(this, b).style.transform = "", this.setMark(null), this.setIndex(null), this.setCurrentIndex(null), this.setCurrentIndexArc(null), this.setCurrentIndexArcAbs(null), this.setMiddle(!1), this.setSize();
|
|
73
73
|
}
|
|
74
|
-
setSize(
|
|
75
|
-
|
|
74
|
+
setSize(r) {
|
|
75
|
+
r ? (t(this, b).style.setProperty("--size", r + "px"), t(this, g).axisCSSProperty.current === "x" ? (t(this, b).style.width = r + "px", t(this, b).style.height = "") : (t(this, b).style.height = r + "px", t(this, b).style.width = "")) : (t(this, b).style.width = "", t(this, b).style.height = "", t(this, b).style.removeProperty("--size"));
|
|
76
76
|
}
|
|
77
77
|
resize() {
|
|
78
|
-
h(this, vt, t(this, g).vertical ? t(this, b).offsetHeight : t(this, b).offsetWidth), h(this, $, t(this, g).vertical ?
|
|
78
|
+
h(this, vt, t(this, g).vertical ? t(this, b).offsetHeight : t(this, b).offsetWidth), h(this, $, t(this, g).vertical ? Ce(t(this, b)) : ye(t(this, b))), h(this, $, t(this, $) - t(this, g).contentPosition);
|
|
79
79
|
}
|
|
80
80
|
transform() {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
81
|
+
const r = t(this, g).shiftSectionPositionCSSProperty.current;
|
|
82
|
+
console.log(r);
|
|
83
|
+
let e = r;
|
|
84
|
+
const i = t(this, g).viewportSize * t(this, g).sectionDistanceScaleCSSProperty.current;
|
|
85
|
+
t(this, g).loopCSSProperty.current && t(this, $) + t(this, vt) < t(this, g).currentScrollValue - r && (e = (t(this, g).distance - r) * -1 - t(this, g).gap), gt.update(
|
|
84
86
|
t(this, b),
|
|
85
87
|
t(this, g).axisCSSProperty.current,
|
|
86
|
-
|
|
88
|
+
e
|
|
87
89
|
);
|
|
88
|
-
const
|
|
89
|
-
h(this, Ct,
|
|
90
|
+
const n = t(this, g).currentScrollValue + e, a = t(this, $) - t(this, g).viewportSize - i, m = t(this, $) + t(this, vt) + i, v = Re(n, a, m);
|
|
91
|
+
h(this, Ct, v * -1), t(this, g).vertical ? t(this, b).style.transform = `translate3d(0px, ${t(this, Ct)}px, 0px)` : t(this, b).style.transform = `translate3d(${t(this, Ct)}px, 0px, 0px)`;
|
|
90
92
|
}
|
|
91
|
-
setMark(
|
|
92
|
-
t(this, Y) !==
|
|
93
|
+
setMark(r) {
|
|
94
|
+
t(this, Y) !== r && (t(this, Y) && t(this, b).classList.remove(t(this, Y)), r && t(this, b).classList.add(r), h(this, Y, r), te(t(this, b), "scrollSectionMarkChange", {
|
|
93
95
|
composed: !0,
|
|
94
96
|
detail: {
|
|
95
97
|
mark: t(this, Y)
|
|
@@ -97,26 +99,26 @@ class ss {
|
|
|
97
99
|
custom: !0
|
|
98
100
|
}));
|
|
99
101
|
}
|
|
100
|
-
setMiddle(
|
|
101
|
-
t(this, b).classList.toggle("middle",
|
|
102
|
+
setMiddle(r) {
|
|
103
|
+
t(this, b).classList.toggle("middle", r);
|
|
102
104
|
}
|
|
103
|
-
setIndex(
|
|
104
|
-
l(this, yt,
|
|
105
|
+
setIndex(r) {
|
|
106
|
+
l(this, yt, ee).call(this, "index", r);
|
|
105
107
|
}
|
|
106
|
-
setCurrentIndex(
|
|
107
|
-
l(this, yt,
|
|
108
|
+
setCurrentIndex(r) {
|
|
109
|
+
l(this, yt, ee).call(this, "current-index", r);
|
|
108
110
|
}
|
|
109
|
-
setCurrentIndexArc(
|
|
110
|
-
l(this, yt,
|
|
111
|
+
setCurrentIndexArc(r) {
|
|
112
|
+
l(this, yt, ee).call(this, "current-index-arc", r);
|
|
111
113
|
}
|
|
112
|
-
setCurrentIndexArcAbs(
|
|
113
|
-
l(this, yt,
|
|
114
|
+
setCurrentIndexArcAbs(r) {
|
|
115
|
+
l(this, yt, ee).call(this, "current-index-arc-abs", r);
|
|
114
116
|
}
|
|
115
117
|
}
|
|
116
|
-
b = new WeakMap(), Rt = new WeakMap(), g = new WeakMap(), vt = new WeakMap(), $ = new WeakMap(), Y = new WeakMap(), Ct = new WeakMap(), yt = new WeakSet(),
|
|
117
|
-
e !== null ? (t(this, b).style.setProperty(`--${
|
|
118
|
+
b = new WeakMap(), Rt = new WeakMap(), g = new WeakMap(), vt = new WeakMap(), $ = new WeakMap(), Y = new WeakMap(), Ct = new WeakMap(), yt = new WeakSet(), ee = function(r, e) {
|
|
119
|
+
e !== null ? (t(this, b).style.setProperty(`--${r}`, e.toString()), t(this, b).setAttribute(`data-${r}`, e.toString())) : (t(this, b).style.removeProperty(`--${r}`), t(this, b).removeAttribute(`data-${r}`));
|
|
118
120
|
};
|
|
119
|
-
const
|
|
121
|
+
const rs = Ve({
|
|
120
122
|
":host": {
|
|
121
123
|
position: "relative",
|
|
122
124
|
width: "100%",
|
|
@@ -154,193 +156,199 @@ const is = De({
|
|
|
154
156
|
flexShrink: "0"
|
|
155
157
|
}
|
|
156
158
|
});
|
|
157
|
-
var d, wt, E, tt, B, W, F, T, et, st, N, it, xt, D, y, Et, Pt, Lt, zt, Ot, A, It, rt, M, nt, q, ht, kt, ot, lt, ct,
|
|
159
|
+
var d, wt, E, tt, B, W, F, T, et, st, N, it, xt, D, y, Et, Pt, Lt, zt, Ot, A, It, rt, M, nt, q, Ht, ht, kt, ot, lt, ct, p, $t, c, ne, he, C, S, k, V, at, R, w, P, Bt, U, G, K, _, Wt, ut, Z, Ft, O, x, oe, dt, o, xe, se, Tt, me, Se, Ee, Pe, L, Nt, He, qt, le, Le, ze, St, $e, ie, ce;
|
|
158
160
|
class Vt extends HTMLElement {
|
|
159
161
|
constructor() {
|
|
160
162
|
super();
|
|
161
163
|
s(this, o);
|
|
162
164
|
s(this, d, null);
|
|
163
|
-
s(this, wt, new
|
|
164
|
-
s(this, E, new
|
|
165
|
-
s(this, tt, new
|
|
166
|
-
s(this, B, new
|
|
167
|
-
s(this, W, new
|
|
165
|
+
s(this, wt, new f(this, "--controls", !0));
|
|
166
|
+
s(this, E, new f(this, "--axis", "y"));
|
|
167
|
+
s(this, tt, new f(this, "--reverse", !1));
|
|
168
|
+
s(this, B, new f(this, "--direction", 0));
|
|
169
|
+
s(this, W, new f(this, "--pages", 0, {
|
|
168
170
|
validate: (e) => Math.max(0, e - 1)
|
|
169
171
|
}));
|
|
170
|
-
s(this, F, new
|
|
171
|
-
s(this, T, new
|
|
172
|
-
s(this, et, new
|
|
172
|
+
s(this, F, new f(this, "--split", !1));
|
|
173
|
+
s(this, T, new f(this, "--sectional", !1));
|
|
174
|
+
s(this, et, new f(
|
|
173
175
|
this,
|
|
174
176
|
"--tween-easing",
|
|
175
177
|
!1
|
|
176
178
|
));
|
|
177
|
-
s(this, st, new
|
|
179
|
+
s(this, st, new f(
|
|
178
180
|
this,
|
|
179
181
|
"--tween-duration",
|
|
180
182
|
!1
|
|
181
183
|
));
|
|
182
|
-
s(this, N, new
|
|
183
|
-
s(this, it, new
|
|
184
|
+
s(this, N, new f(this, "--auto-size", !1));
|
|
185
|
+
s(this, it, new f(
|
|
184
186
|
this,
|
|
185
187
|
"--wheel-max-delta",
|
|
186
188
|
!1
|
|
187
189
|
));
|
|
188
|
-
s(this, xt, new
|
|
189
|
-
s(this, D, new
|
|
190
|
+
s(this, xt, new f(this, "--drag-inertion", 1));
|
|
191
|
+
s(this, D, new f(
|
|
190
192
|
this,
|
|
191
193
|
"--sections-in-view",
|
|
192
194
|
1
|
|
193
195
|
));
|
|
194
|
-
s(this, y, new
|
|
195
|
-
s(this, Et, new
|
|
196
|
-
s(this, Pt, new
|
|
197
|
-
s(this, Lt, new
|
|
198
|
-
s(this, zt, new
|
|
199
|
-
s(this, Ot, new
|
|
196
|
+
s(this, y, new f(this, "--loop", !1));
|
|
197
|
+
s(this, Et, new f(this, "--damping", 20));
|
|
198
|
+
s(this, Pt, new f(this, "--mass", 0));
|
|
199
|
+
s(this, Lt, new f(this, "--stiffness", 0));
|
|
200
|
+
s(this, zt, new f(this, "--mouse-drag", !1));
|
|
201
|
+
s(this, Ot, new f(
|
|
200
202
|
this,
|
|
201
203
|
"--section-distance-scale",
|
|
202
204
|
0.5
|
|
203
205
|
));
|
|
204
|
-
s(this, A, new
|
|
205
|
-
s(this, It, new
|
|
206
|
+
s(this, A, new f(this, "--autoplay", 0));
|
|
207
|
+
s(this, It, new f(
|
|
206
208
|
this,
|
|
207
209
|
"--autoplay-pause-duration",
|
|
208
210
|
0
|
|
209
211
|
));
|
|
210
|
-
s(this, rt, new
|
|
212
|
+
s(this, rt, new f(
|
|
211
213
|
this,
|
|
212
214
|
"--autoplay-user-direction",
|
|
213
215
|
!1
|
|
214
216
|
));
|
|
215
|
-
s(this, M, new
|
|
216
|
-
s(this, nt, new
|
|
217
|
+
s(this, M, new f(this, "--classes", !1));
|
|
218
|
+
s(this, nt, new f(
|
|
217
219
|
this,
|
|
218
220
|
"--current-index-start-offset",
|
|
219
221
|
0
|
|
220
222
|
));
|
|
221
|
-
s(this, q, new
|
|
223
|
+
s(this, q, new f(
|
|
222
224
|
this,
|
|
223
225
|
"--current-index-end-offset",
|
|
224
226
|
0
|
|
225
227
|
));
|
|
226
|
-
s(this,
|
|
227
|
-
|
|
228
|
+
s(this, Ht, new f(
|
|
229
|
+
this,
|
|
230
|
+
"--shift-section-position",
|
|
231
|
+
0,
|
|
232
|
+
{ rawValueCheck: !1 }
|
|
233
|
+
));
|
|
234
|
+
s(this, ht, new f(this, "--focus-delay", 0));
|
|
235
|
+
s(this, kt, new f(
|
|
228
236
|
this,
|
|
229
237
|
"--focus-duration",
|
|
230
238
|
3e3
|
|
231
239
|
));
|
|
232
|
-
s(this, ot, new
|
|
233
|
-
s(this, lt, new
|
|
240
|
+
s(this, ot, new f(this, "--disabled", !1));
|
|
241
|
+
s(this, lt, new f(this, "--hibernate", !1));
|
|
234
242
|
s(this, ct, null);
|
|
235
|
-
s(this,
|
|
236
|
-
s(this,
|
|
243
|
+
s(this, p, null);
|
|
244
|
+
s(this, $t, null);
|
|
237
245
|
s(this, c, []);
|
|
238
|
-
s(this, re, 0);
|
|
239
246
|
s(this, ne, 0);
|
|
240
|
-
s(this,
|
|
247
|
+
s(this, he, 0);
|
|
248
|
+
s(this, C, 0);
|
|
241
249
|
s(this, S, 0);
|
|
242
250
|
s(this, k, 0);
|
|
243
251
|
s(this, V, null);
|
|
244
252
|
s(this, at, null);
|
|
245
253
|
s(this, R, null);
|
|
246
254
|
s(this, w, null);
|
|
247
|
-
s(this, P, new
|
|
248
|
-
s(this,
|
|
255
|
+
s(this, P, new qe(0));
|
|
256
|
+
s(this, Bt, 0);
|
|
249
257
|
s(this, U, 0);
|
|
250
258
|
s(this, G, !1);
|
|
251
259
|
s(this, K, !0);
|
|
252
260
|
s(this, _, !0);
|
|
253
|
-
s(this,
|
|
261
|
+
s(this, Wt);
|
|
254
262
|
s(this, ut);
|
|
255
|
-
s(this, Z, new
|
|
256
|
-
s(this,
|
|
263
|
+
s(this, Z, new Ze());
|
|
264
|
+
s(this, Ft, !1);
|
|
257
265
|
s(this, O, null);
|
|
258
266
|
s(this, x, !1);
|
|
259
|
-
s(this,
|
|
267
|
+
s(this, oe, null);
|
|
260
268
|
s(this, dt, []);
|
|
261
269
|
s(this, L, () => {
|
|
262
270
|
if (t(this, lt).current)
|
|
263
271
|
return;
|
|
264
272
|
t(this, d).unlistenAnimationFrame();
|
|
265
273
|
const e = this.currentScrollValue / t(this, S) || 0, i = t(this, P).current;
|
|
266
|
-
if (h(this,
|
|
267
|
-
getComputedStyle(t(this,
|
|
268
|
-
)) : h(this, k,
|
|
269
|
-
getComputedStyle(t(this,
|
|
274
|
+
if (h(this, ne, this.vertical ? Ce(this) : ye(this)), h(this, he, this.vertical ? Ce(t(this, p)) : ye(t(this, p))), h(this, C, this.vertical ? this.offsetHeight : this.offsetWidth), this.vertical ? h(this, k, De.parse(
|
|
275
|
+
getComputedStyle(t(this, p)).rowGap
|
|
276
|
+
)) : h(this, k, De.parse(
|
|
277
|
+
getComputedStyle(t(this, p)).columnGap
|
|
270
278
|
)), t(this, N).current && t(this, c).length) {
|
|
271
|
-
const
|
|
279
|
+
const n = t(this, D).current, a = (t(this, C) - t(this, k) * (n - 1)) / n;
|
|
272
280
|
t(this, c).forEach((m) => {
|
|
273
281
|
m.setSize(a);
|
|
274
282
|
});
|
|
275
283
|
} else
|
|
276
|
-
t(this, c).forEach((
|
|
277
|
-
|
|
284
|
+
t(this, c).forEach((n) => {
|
|
285
|
+
n.setSize();
|
|
278
286
|
});
|
|
279
|
-
if (t(this, c).forEach((
|
|
280
|
-
|
|
287
|
+
if (t(this, c).forEach((n) => {
|
|
288
|
+
n.resize();
|
|
281
289
|
}), t(this, W).current) {
|
|
282
|
-
h(this, S, t(this,
|
|
283
|
-
const
|
|
284
|
-
this.vertical ? (t(this,
|
|
290
|
+
h(this, S, t(this, C) * t(this, W).current);
|
|
291
|
+
const n = t(this, S) + t(this, C);
|
|
292
|
+
this.vertical ? (t(this, p).style.width = n + "px", t(this, p).style.height = "100%") : (t(this, p).style.height = n + "px", t(this, p).style.width = "100%");
|
|
285
293
|
} else
|
|
286
|
-
this.vertical ? (t(this,
|
|
294
|
+
this.vertical ? (t(this, p).style.width = "100%", t(this, p).style.height = "max-content", h(this, S, t(this, p).offsetHeight - t(this, C))) : (t(this, p).style.width = "max-content", t(this, p).style.height = "100%", h(this, S, t(this, p).offsetWidth - t(this, C)));
|
|
287
295
|
if (!t(this, y).current) {
|
|
288
|
-
const
|
|
296
|
+
const n = getComputedStyle(this), a = this.vertical ? parseFloat(n.paddingBlockStart) + parseFloat(n.paddingBlockEnd) : parseFloat(n.paddingInlineStart) + parseFloat(n.paddingInlineEnd);
|
|
289
297
|
h(this, S, t(this, S) + a), t(this, d).max = t(this, S);
|
|
290
298
|
}
|
|
291
299
|
if (t(this, y).current && t(this, c).length) {
|
|
292
|
-
const
|
|
293
|
-
h(this, U,
|
|
300
|
+
const n = t(this, c)[t(this, c).length - 1], a = n.position + n.size - t(this, C), m = t(this, S) - a;
|
|
301
|
+
h(this, U, n.position + n.size + m);
|
|
294
302
|
} else
|
|
295
303
|
h(this, U, t(this, S));
|
|
296
304
|
if (t(this, T).current && t(this, c).length) {
|
|
297
|
-
const
|
|
298
|
-
t(this, d).set(
|
|
305
|
+
const n = t(this, c)[i];
|
|
306
|
+
t(this, d).set(n.position, {
|
|
299
307
|
equalize: !0
|
|
300
308
|
});
|
|
301
309
|
} else
|
|
302
310
|
t(this, d).set(e * t(this, S), {
|
|
303
311
|
equalize: !0
|
|
304
312
|
});
|
|
305
|
-
h(this, G, (this.vertical ? t(this,
|
|
313
|
+
h(this, G, (this.vertical ? t(this, p).offsetHeight : t(this, p).offsetWidth) > t(this, C)), 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, Nt).call(this);
|
|
306
314
|
});
|
|
307
|
-
s(this,
|
|
315
|
+
s(this, Nt, () => {
|
|
308
316
|
if (!t(this, G) || t(this, _) || t(this, K))
|
|
309
317
|
return;
|
|
310
318
|
const e = this.currentScrollValue;
|
|
311
|
-
if (h(this,
|
|
319
|
+
if (h(this, Bt, Math.max(0, e - t(this, S))), t(this, c).length) {
|
|
312
320
|
for (let i = 0; i < t(this, c).length; i++)
|
|
313
321
|
t(this, c)[i].transform();
|
|
314
|
-
t(this, P).current = l(this, o,
|
|
322
|
+
t(this, P).current = l(this, o, ie).call(this);
|
|
315
323
|
} else
|
|
316
|
-
this.vertical ? t(this,
|
|
317
|
-
l(this, o,
|
|
324
|
+
this.vertical ? t(this, p).style.transform = `translate3d(0px, ${e * -1}px, 0px)` : t(this, p).style.transform = `translate3d(${e * -1}px, 0px, 0px)`;
|
|
325
|
+
l(this, o, $e).call(this), gt.update(
|
|
318
326
|
this,
|
|
319
327
|
t(this, E).current,
|
|
320
328
|
e
|
|
321
329
|
);
|
|
322
330
|
});
|
|
323
|
-
s(this,
|
|
324
|
-
t(this, wt).current && (l(this, o,
|
|
331
|
+
s(this, qt, (e, i) => {
|
|
332
|
+
t(this, wt).current && (l(this, o, Le).call(this, Math.sign(i) || 1), t(this, le).call(this, e, i));
|
|
325
333
|
});
|
|
326
|
-
s(this,
|
|
334
|
+
s(this, le, (e, i) => {
|
|
327
335
|
if (t(this, B).current) {
|
|
328
336
|
if (t(this, B).current < 0 && i > 0)
|
|
329
337
|
return;
|
|
330
338
|
if (t(this, B).current > 0 && i < 0)
|
|
331
339
|
return;
|
|
332
340
|
}
|
|
333
|
-
if (t(this, ut) || t(this, Z).unlistenAnimationFrame(), !t(this, A).current && t(this, ht).current && (clearInterval(t(this,
|
|
334
|
-
const
|
|
335
|
-
|
|
341
|
+
if (t(this, ut) || t(this, Z).unlistenAnimationFrame(), !t(this, A).current && t(this, ht).current && (clearInterval(t(this, Wt)), h(this, Wt, setTimeout(() => {
|
|
342
|
+
const n = t(this, c)[l(this, o, ie).call(this)];
|
|
343
|
+
n && this.scrollToSection(n.index, {
|
|
336
344
|
tween: {
|
|
337
345
|
duration: t(this, kt).current,
|
|
338
|
-
easing:
|
|
346
|
+
easing: Ue
|
|
339
347
|
}
|
|
340
348
|
});
|
|
341
|
-
}, t(this, ht).current))), !(e.includes("drag") && !
|
|
349
|
+
}, t(this, ht).current))), !(e.includes("drag") && !Ye.isTouch && !t(this, zt).current)) {
|
|
342
350
|
if (t(this, T).current && e !== "drag") {
|
|
343
|
-
const
|
|
351
|
+
const n = Math.sign(i);
|
|
344
352
|
if (t(this, c).length) {
|
|
345
353
|
const a = {
|
|
346
354
|
tween: t(this, et).current || t(this, st).current ? {
|
|
@@ -348,22 +356,22 @@ class Vt extends HTMLElement {
|
|
|
348
356
|
duration: t(this, st).current || 500
|
|
349
357
|
} : void 0
|
|
350
358
|
};
|
|
351
|
-
t(this,
|
|
359
|
+
t(this, Ft) ? this.scrollToSection(l(this, o, ie).call(this, !0), a) : this.shiftSections(n, a);
|
|
352
360
|
} else
|
|
353
|
-
t(this, d).shift(
|
|
361
|
+
t(this, d).shift(n * t(this, C));
|
|
354
362
|
} else
|
|
355
363
|
t(this, d).shift(i);
|
|
356
|
-
h(this,
|
|
364
|
+
h(this, Ft, e === "drag");
|
|
357
365
|
}
|
|
358
366
|
});
|
|
359
|
-
s(this,
|
|
360
|
-
h(this, x, !0), this.hibernatedCSSProperty.current || l(this, o,
|
|
367
|
+
s(this, ce, () => {
|
|
368
|
+
h(this, x, !0), this.hibernatedCSSProperty.current || l(this, o, Pe).call(this);
|
|
361
369
|
});
|
|
362
370
|
if (H) {
|
|
363
371
|
const e = this.attachShadow({ mode: "open" });
|
|
364
|
-
e.adoptedStyleSheets = [
|
|
372
|
+
e.adoptedStyleSheets = [rs];
|
|
365
373
|
const i = document.createElement("div");
|
|
366
|
-
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,
|
|
374
|
+
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((n) => {
|
|
367
375
|
this.tryResplit();
|
|
368
376
|
}));
|
|
369
377
|
}
|
|
@@ -446,6 +454,9 @@ class Vt extends HTMLElement {
|
|
|
446
454
|
get currentIndexEndOffsetCSSProperty() {
|
|
447
455
|
return t(this, q);
|
|
448
456
|
}
|
|
457
|
+
get shiftSectionPositionCSSProperty() {
|
|
458
|
+
return t(this, Ht);
|
|
459
|
+
}
|
|
449
460
|
get focusDelayCSSProperty() {
|
|
450
461
|
return t(this, ht);
|
|
451
462
|
}
|
|
@@ -459,28 +470,28 @@ class Vt extends HTMLElement {
|
|
|
459
470
|
return t(this, lt);
|
|
460
471
|
}
|
|
461
472
|
get currentScrollValue() {
|
|
462
|
-
return l(this, o,
|
|
473
|
+
return l(this, o, ze).call(this, "current");
|
|
463
474
|
}
|
|
464
475
|
get targetScrollValue() {
|
|
465
|
-
return l(this, o,
|
|
476
|
+
return l(this, o, ze).call(this, "target");
|
|
466
477
|
}
|
|
467
478
|
get contentWrapperElement() {
|
|
468
479
|
return t(this, ct);
|
|
469
480
|
}
|
|
470
481
|
get contentElement() {
|
|
471
|
-
return t(this,
|
|
482
|
+
return t(this, p);
|
|
472
483
|
}
|
|
473
484
|
get sections() {
|
|
474
485
|
return t(this, c);
|
|
475
486
|
}
|
|
476
487
|
get position() {
|
|
477
|
-
return t(this,
|
|
488
|
+
return t(this, ne);
|
|
478
489
|
}
|
|
479
490
|
get contentPosition() {
|
|
480
|
-
return t(this,
|
|
491
|
+
return t(this, he);
|
|
481
492
|
}
|
|
482
493
|
get viewportSize() {
|
|
483
|
-
return t(this,
|
|
494
|
+
return t(this, C);
|
|
484
495
|
}
|
|
485
496
|
get scrollSize() {
|
|
486
497
|
return t(this, S);
|
|
@@ -506,7 +517,7 @@ class Vt extends HTMLElement {
|
|
|
506
517
|
return t(this, G);
|
|
507
518
|
}
|
|
508
519
|
get overscroll() {
|
|
509
|
-
return t(this,
|
|
520
|
+
return t(this, Bt);
|
|
510
521
|
}
|
|
511
522
|
get scrollLine() {
|
|
512
523
|
return t(this, O);
|
|
@@ -527,7 +538,7 @@ class Vt extends HTMLElement {
|
|
|
527
538
|
return t(this, E).current === "x" ? 0 : t(this, d).distance;
|
|
528
539
|
}
|
|
529
540
|
tryResplit() {
|
|
530
|
-
!t(this, _) && (t(this, y).current || t(this, F).current || t(this, y).current || t(this, N).current || t(this, T).current) && l(this, o,
|
|
541
|
+
!t(this, _) && (t(this, y).current || t(this, F).current || t(this, y).current || t(this, N).current || t(this, T).current) && l(this, o, se).call(this);
|
|
531
542
|
}
|
|
532
543
|
onScroll(...e) {
|
|
533
544
|
return t(this, d).subscribe(...e);
|
|
@@ -536,32 +547,32 @@ class Vt extends HTMLElement {
|
|
|
536
547
|
t(this, d).unsubscribe(...e);
|
|
537
548
|
}
|
|
538
549
|
//https://github.com/pmndrs/drei/blob/d3282cdd02d170ef603a5e096505d83dc93cd57a/src/web/ScrollControls.tsx#L85C7-L100C9
|
|
539
|
-
range(e, i,
|
|
540
|
-
const a = e -
|
|
550
|
+
range(e, i, n = 0) {
|
|
551
|
+
const a = e - n, m = a + i + n * 2;
|
|
541
552
|
return this.currentProgress < a ? 0 : this.currentProgress > m ? 1 : (this.currentProgress - a) / (m - a);
|
|
542
553
|
}
|
|
543
|
-
curve(e, i,
|
|
544
|
-
return Math.sin(this.range(e, i,
|
|
554
|
+
curve(e, i, n = 0) {
|
|
555
|
+
return Math.sin(this.range(e, i, n) * Math.PI);
|
|
545
556
|
}
|
|
546
|
-
visible(e, i,
|
|
547
|
-
const a = e -
|
|
557
|
+
visible(e, i, n = 0) {
|
|
558
|
+
const a = e - n, m = a + i + n * 2;
|
|
548
559
|
return this.currentProgress >= a && this.currentProgress <= m;
|
|
549
560
|
}
|
|
550
561
|
scrollToSection(e, i) {
|
|
551
562
|
if (!t(this, c).length)
|
|
552
563
|
return;
|
|
553
|
-
const
|
|
554
|
-
if (m &&
|
|
564
|
+
const n = t(this, P).current, a = l(this, o, He).call(this, e), m = t(this, c)[n], v = t(this, c)[a];
|
|
565
|
+
if (m && v) {
|
|
555
566
|
let I = 0;
|
|
556
|
-
const
|
|
557
|
-
t(this, y).current ? a === 0 &&
|
|
567
|
+
const ge = l(this, o, ie).call(this), Mt = t(this, c)[ge], be = Mt ? this.targetScrollValue - Mt.position : 0;
|
|
568
|
+
t(this, y).current ? a === 0 && n === t(this, c).length - 1 ? I = t(this, S) + t(this, C) - m.position + t(this, k) : a === t(this, c).length - 1 && n === 0 ? I = v.position - (t(this, S) + t(this, C) + t(this, k)) : I = v.position - m.position : I = v.position - m.position, this.shiftPosition(I - be, i);
|
|
558
569
|
}
|
|
559
570
|
}
|
|
560
571
|
shiftSections(e, i) {
|
|
561
572
|
t(this, c).length && this.scrollToSection(t(this, P).current + e, i);
|
|
562
573
|
}
|
|
563
574
|
setPosition(e, i) {
|
|
564
|
-
l(this, o,
|
|
575
|
+
l(this, o, Le).call(this, Math.sign(e) || 1), i != null && i.tween ? t(this, ut) || (t(this, Z).set(t(this, d).current, { equalize: !0 }), t(this, Z).set(e, Te({}, i.tween)), h(this, ut, setTimeout(() => {
|
|
565
576
|
h(this, ut, void 0);
|
|
566
577
|
}, i.tween.duration || 0))) : t(this, d).set(e, {
|
|
567
578
|
equalize: (i == null ? void 0 : i.behaviour) === "instant"
|
|
@@ -571,20 +582,20 @@ class Vt extends HTMLElement {
|
|
|
571
582
|
this.setPosition(t(this, d).target + e, i);
|
|
572
583
|
}
|
|
573
584
|
connectedCallback() {
|
|
574
|
-
gt.register(this), h(this, d, new
|
|
585
|
+
gt.register(this), h(this, d, new _e(0, {
|
|
575
586
|
damping: 0.01,
|
|
576
587
|
min: 0,
|
|
577
|
-
order:
|
|
578
|
-
})), this.setAttribute("tabindex", "0"), h(this, V, new
|
|
588
|
+
order: Ke.SCROLL
|
|
589
|
+
})), 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 Je({
|
|
579
590
|
element: this
|
|
580
591
|
})), t(this, at).changeEvent.subscribe(
|
|
581
|
-
t(this,
|
|
582
|
-
), h(this, R, new
|
|
592
|
+
t(this, qt)
|
|
593
|
+
), h(this, R, new Qe({ element: t(this, p) })), t(this, R).changeEvent.subscribe(t(this, qt)), h(this, w, new Xe({
|
|
583
594
|
culling: this
|
|
584
|
-
})), t(this, w).changeEvent.subscribe(t(this,
|
|
585
|
-
l(this, o,
|
|
595
|
+
})), t(this, w).changeEvent.subscribe(t(this, le)), t(this, E).subscribe(() => {
|
|
596
|
+
l(this, o, xe).call(this);
|
|
586
597
|
}), t(this, tt).subscribe(() => {
|
|
587
|
-
l(this, o,
|
|
598
|
+
l(this, o, xe).call(this);
|
|
588
599
|
}), t(this, it).subscribe((e) => {
|
|
589
600
|
t(this, V).axis = e.current ? "max" : t(this, E).current;
|
|
590
601
|
}), t(this, xt).subscribe((e) => {
|
|
@@ -592,15 +603,15 @@ class Vt extends HTMLElement {
|
|
|
592
603
|
}), t(this, W).subscribe(() => {
|
|
593
604
|
t(this, x) && t(this, L).call(this);
|
|
594
605
|
}), t(this, F).subscribe(({ current: e }) => {
|
|
595
|
-
t(this, x) && (e ? l(this, o,
|
|
606
|
+
t(this, x) && (e ? l(this, o, se).call(this) : l(this, o, Tt).call(this));
|
|
596
607
|
}), t(this, T).subscribe((e) => {
|
|
597
|
-
t(this, V).debounce = e.current, t(this, R).swipe = e.current, t(this, w).interval = e.current, t(this, x) && (e.current && !e.previous && !t(this, c).length ? l(this, o,
|
|
608
|
+
t(this, V).debounce = e.current, t(this, R).swipe = e.current, t(this, w).interval = e.current, t(this, x) && (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, Tt).call(this));
|
|
598
609
|
}), t(this, N).subscribe((e) => {
|
|
599
|
-
t(this, x) && (t(this, L).call(this), e.current && !e.previous && !t(this, c).length ? l(this, o,
|
|
610
|
+
t(this, x) && (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, Tt).call(this));
|
|
600
611
|
}), t(this, D).subscribe((e) => {
|
|
601
612
|
t(this, x) && (t(this, L).call(this), l(this, o, St).call(this));
|
|
602
613
|
}), t(this, y).subscribe((e) => {
|
|
603
|
-
e.current ? (t(this, x) && (t(this, c).length || (t(this, F).current = !0)), t(this, d).max = 1 / 0, t(this, d).min = -1 / 0) : (h(this,
|
|
614
|
+
e.current ? (t(this, x) && (t(this, c).length || (t(this, F).current = !0)), t(this, d).max = 1 / 0, t(this, d).min = -1 / 0) : (h(this, Bt, 0), t(this, d).max = t(this, S), t(this, d).min = 0);
|
|
604
615
|
}), t(this, Et).subscribe((e) => {
|
|
605
616
|
t(this, d).damping = e.current;
|
|
606
617
|
}), t(this, Pt).subscribe((e) => {
|
|
@@ -624,144 +635,144 @@ class Vt extends HTMLElement {
|
|
|
624
635
|
}), t(this, Z).subscribe((e) => {
|
|
625
636
|
t(this, Z).isRunning.current && t(this, d).set(e.current, { equalize: !0 });
|
|
626
637
|
}), t(this, ot).subscribe((e) => {
|
|
627
|
-
e.current && !e.previous ? (this.classList.add("disabled"), l(this, o,
|
|
638
|
+
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));
|
|
628
639
|
}), t(this, lt).subscribe((e) => {
|
|
629
|
-
e.current && !e.previous ? (this.classList.add("hibernated"), l(this, o,
|
|
630
|
-
}), 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, y).observe(), t(this, Et).observe(), t(this, Pt).observe(), t(this, Lt).observe(), t(this, zt).observe(), t(this, Ot).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, ht).observe(), t(this, kt).observe(), t(this, ot).observe(), t(this, lt).observe(), Dt.subscribe(t(this,
|
|
640
|
+
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));
|
|
641
|
+
}), 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, y).observe(), t(this, Et).observe(), t(this, Pt).observe(), t(this, Lt).observe(), t(this, zt).observe(), t(this, Ot).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, Ht).observe(), t(this, ht).observe(), t(this, kt).observe(), t(this, ot).observe(), t(this, lt).observe(), Dt.subscribe(t(this, ce), we.LAST);
|
|
631
642
|
}
|
|
632
643
|
disconnectedCallback() {
|
|
633
|
-
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, y).unobserve(), t(this, Et).unobserve(), t(this, Pt).unobserve(), t(this, Lt).unobserve(), t(this, zt).unobserve(), t(this, Ot).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, ht).unobserve(), t(this, kt).unobserve(), t(this, ot).unobserve(), t(this, lt).unobserve(), Dt.unsubscribe(t(this,
|
|
644
|
+
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, y).unobserve(), t(this, Et).unobserve(), t(this, Pt).unobserve(), t(this, Lt).unobserve(), t(this, zt).unobserve(), t(this, Ot).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, Ht).unobserve(), t(this, ht).unobserve(), t(this, kt).unobserve(), t(this, ot).unobserve(), t(this, lt).unobserve(), Dt.unsubscribe(t(this, ce)), l(this, o, Ee).call(this), t(this, oe).disconnect();
|
|
634
645
|
}
|
|
635
646
|
}
|
|
636
|
-
d = 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(), y = new WeakMap(), Et = new WeakMap(), Pt = new WeakMap(), Lt = new WeakMap(), zt = new WeakMap(), Ot = new WeakMap(), A = new WeakMap(), It = new WeakMap(), rt = new WeakMap(), M = new WeakMap(), nt = new WeakMap(), q = new WeakMap(), ht = new WeakMap(), kt = new WeakMap(), ot = new WeakMap(), lt = new WeakMap(), ct = new WeakMap(),
|
|
647
|
+
d = 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(), y = new WeakMap(), Et = new WeakMap(), Pt = new WeakMap(), Lt = new WeakMap(), zt = new WeakMap(), Ot = new WeakMap(), A = new WeakMap(), It = new WeakMap(), rt = new WeakMap(), M = new WeakMap(), nt = new WeakMap(), q = new WeakMap(), Ht = new WeakMap(), ht = new WeakMap(), kt = 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(), S = new WeakMap(), k = new WeakMap(), V = new WeakMap(), at = new WeakMap(), R = new WeakMap(), w = 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(), x = new WeakMap(), oe = new WeakMap(), dt = new WeakMap(), o = new WeakSet(), xe = function() {
|
|
637
648
|
const e = t(this, E).current, i = t(this, tt).current ? "-reverse" : "";
|
|
638
|
-
t(this,
|
|
639
|
-
},
|
|
640
|
-
l(this, o, Tt).call(this), t(this,
|
|
641
|
-
e instanceof HTMLElement && t(this, c).push(new
|
|
642
|
-
}), t(this,
|
|
649
|
+
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, x) && t(this, L).call(this);
|
|
650
|
+
}, se = function() {
|
|
651
|
+
l(this, o, Tt).call(this), t(this, $t).assignedElements().forEach((e, i) => {
|
|
652
|
+
e instanceof HTMLElement && t(this, c).push(new is(e, i, this));
|
|
653
|
+
}), t(this, p).style.transform = "", te(this, "scrollSectionsChange", {
|
|
643
654
|
custom: !0,
|
|
644
655
|
composed: !0
|
|
645
656
|
}), t(this, L).call(this), l(this, o, St).call(this);
|
|
646
657
|
}, Tt = function() {
|
|
647
658
|
t(this, c).forEach((e) => {
|
|
648
659
|
e.destroy();
|
|
649
|
-
}), h(this, c, []), t(this, P).reset(), t(this, d).reset(),
|
|
660
|
+
}), h(this, c, []), t(this, P).reset(), t(this, d).reset(), te(this, "scrollSectionsChange", {
|
|
650
661
|
custom: !0,
|
|
651
662
|
composed: !0
|
|
652
663
|
});
|
|
653
|
-
},
|
|
654
|
-
t(this, K) || (h(this, K, !0), t(this, d).unsubscribe(t(this,
|
|
664
|
+
}, me = function() {
|
|
665
|
+
t(this, K) || (h(this, K, !0), t(this, d).unsubscribe(t(this, Nt)), t(this, d).unlistenAnimationFrame(), clearInterval(t(this, Wt)), clearInterval(t(this, ut)), t(this, Z).unlistenAnimationFrame(), t(this, V).disconnect(), t(this, at).disconnect(), t(this, R).disconnect(), t(this, w).disconnect(), t(this, G) || (this.sections.forEach((e) => {
|
|
655
666
|
e.unsetTransform();
|
|
656
667
|
}), t(this, L).call(this)));
|
|
657
|
-
},
|
|
658
|
-
t(this, K) && (h(this, K, !1), t(this, d).subscribe(t(this,
|
|
659
|
-
}, xe = function() {
|
|
660
|
-
t(this, _) || (h(this, _, !0), Dt.unsubscribe(t(this, L)), ie.unsubscribe(t(this, L)), l(this, o, be).call(this), t(this, f).style.transform = "", t(this, f).style.height = "", t(this, f).style.width = "", this.classList.remove("has-overflow", "start", "end"), t(this, c).length ? l(this, o, Tt).call(this) : (t(this, P).reset(), t(this, d).reset()), gt.unregister(this));
|
|
668
|
+
}, Se = function() {
|
|
669
|
+
t(this, K) && (h(this, K, !1), t(this, d).subscribe(t(this, Nt)), t(this, V).connect(), t(this, at).connect(), t(this, R).connect(), t(this, A).current && t(this, w).connect());
|
|
661
670
|
}, Ee = function() {
|
|
662
|
-
t(this, _)
|
|
663
|
-
},
|
|
671
|
+
t(this, _) || (h(this, _, !0), Dt.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, Tt).call(this) : (t(this, P).reset(), t(this, d).reset()), gt.unregister(this));
|
|
672
|
+
}, Pe = function() {
|
|
673
|
+
t(this, _) && (h(this, _, !1), gt.register(this), this.tryResplit(), l(this, o, Se).call(this), Dt.subscribe(t(this, L), we.SCROLL), re.subscribe(this, t(this, L)));
|
|
674
|
+
}, L = new WeakMap(), Nt = new WeakMap(), He = function(e) {
|
|
664
675
|
let i = t(this, P).current;
|
|
665
|
-
return t(this, y).current ? i =
|
|
666
|
-
},
|
|
676
|
+
return t(this, y).current ? i = Ge(e, t(this, c).length) : i = Re(e, 0, this.limit), i;
|
|
677
|
+
}, qt = new WeakMap(), le = new WeakMap(), Le = function(e = 1) {
|
|
667
678
|
t(this, rt).current && (t(this, w).direction = e), t(this, A).current && t(this, w).pauseAndContinue(
|
|
668
679
|
t(this, It).current,
|
|
669
680
|
this.sectionalCSSProperty.current
|
|
670
681
|
);
|
|
671
|
-
},
|
|
682
|
+
}, ze = function(e = "current") {
|
|
672
683
|
if (t(this, y).current && t(this, c).length) {
|
|
673
|
-
const i = t(this, d)[e] % (t(this, S) + t(this,
|
|
674
|
-
return i < 0 ? t(this, S) + i + t(this,
|
|
684
|
+
const i = t(this, d)[e] % Math.round(t(this, S) + t(this, C) + t(this, k));
|
|
685
|
+
return i < 0 ? t(this, S) + i + t(this, C) + t(this, k) : i;
|
|
675
686
|
} else
|
|
676
687
|
return t(this, d)[e];
|
|
677
688
|
}, St = function() {
|
|
678
689
|
if (t(this, c).length) {
|
|
679
690
|
const e = t(this, P).current + t(this, nt).current;
|
|
680
|
-
if (e === 0 ? h(this, O, "start") : e === this.limit ? h(this, O, "end") : h(this, O, null),
|
|
691
|
+
if (e === 0 ? h(this, O, "start") : e === this.limit ? h(this, O, "end") : h(this, O, null), te(this, "scrollLine", {
|
|
681
692
|
detail: { line: t(this, O) }
|
|
682
693
|
}), t(this, M).current) {
|
|
683
694
|
this.classList.remove("end", "start"), t(this, O) && this.classList.add(t(this, O));
|
|
684
695
|
const i = t(this, D).current + t(this, q).current;
|
|
685
|
-
h(this, dt, []), t(this, c).forEach((
|
|
686
|
-
|
|
687
|
-
const m = e - this.limit - 1 + t(this, q).current,
|
|
688
|
-
a >= e && a <
|
|
696
|
+
h(this, dt, []), t(this, c).forEach((n, a) => {
|
|
697
|
+
n.setCurrentIndex(null), n.setCurrentIndexArc(null), n.setCurrentIndexArcAbs(null);
|
|
698
|
+
const m = e - this.limit - 1 + t(this, q).current, v = e + i, I = this.sections.length - v;
|
|
699
|
+
a >= e && a < v || a <= m ? (n.setMark("current"), t(this, dt).push(n)) : a >= v && a < v + I / 2 || a <= m + i ? n.setMark("next") : n.setMark("previous");
|
|
689
700
|
});
|
|
690
701
|
}
|
|
691
702
|
}
|
|
692
|
-
},
|
|
703
|
+
}, $e = function() {
|
|
693
704
|
if (t(this, M).current) {
|
|
694
705
|
const e = Math.floor(t(this, dt).length / 2);
|
|
695
|
-
t(this, dt).sort((i,
|
|
696
|
-
const a =
|
|
697
|
-
i.setCurrentIndex(
|
|
706
|
+
t(this, dt).sort((i, n) => i.element.getBoundingClientRect().left - n.element.getBoundingClientRect().left), t(this, dt).forEach((i, n) => {
|
|
707
|
+
const a = n - e;
|
|
708
|
+
i.setCurrentIndex(n), i.setCurrentIndexArc(a), i.setCurrentIndexArcAbs(Math.abs(a)), i.setMiddle(n === e);
|
|
698
709
|
});
|
|
699
710
|
}
|
|
700
|
-
},
|
|
701
|
-
let i = this.targetScrollValue,
|
|
711
|
+
}, ie = function(e = !1) {
|
|
712
|
+
let i = this.targetScrollValue, n = 1 / 0, a = 0;
|
|
702
713
|
const m = t(this, d).direction;
|
|
703
|
-
for (let
|
|
704
|
-
const I = t(this, c)[
|
|
705
|
-
let
|
|
714
|
+
for (let v = 0; v < t(this, c).length; v++) {
|
|
715
|
+
const I = t(this, c)[v];
|
|
716
|
+
let ge = t(this, Ft) ? I.size * m * -1 * 0.4 : 0, Mt = I.position;
|
|
706
717
|
this.overscroll && Mt === 0 && e && (Mt = t(this, U));
|
|
707
|
-
let
|
|
708
|
-
|
|
718
|
+
let be = Math.abs(Mt + ge - i);
|
|
719
|
+
be <= n && (n = be, a = v);
|
|
709
720
|
}
|
|
710
721
|
return a;
|
|
711
|
-
},
|
|
722
|
+
}, ce = new WeakMap();
|
|
712
723
|
H && !customElements.get("e-scroll") && customElements.define("e-scroll", Vt);
|
|
713
|
-
var
|
|
714
|
-
class
|
|
724
|
+
var ae;
|
|
725
|
+
class Ie extends HTMLElement {
|
|
715
726
|
constructor() {
|
|
716
727
|
super(...arguments);
|
|
717
|
-
s(this,
|
|
728
|
+
s(this, ae, null);
|
|
718
729
|
}
|
|
719
730
|
get scrollElement() {
|
|
720
|
-
return t(this,
|
|
731
|
+
return t(this, ae);
|
|
721
732
|
}
|
|
722
733
|
connectedCallback() {
|
|
723
|
-
const e =
|
|
724
|
-
e instanceof Vt ? h(this,
|
|
734
|
+
const e = Oe(this, Vt);
|
|
735
|
+
e instanceof Vt ? h(this, ae, e) : console.error(this, "e-scroll not found");
|
|
725
736
|
}
|
|
726
737
|
}
|
|
727
|
-
|
|
728
|
-
var
|
|
729
|
-
class
|
|
738
|
+
ae = new WeakMap();
|
|
739
|
+
var ft, z, j, J, Ut, Gt, pt, Kt, ue, de;
|
|
740
|
+
class ns extends Ie {
|
|
730
741
|
constructor() {
|
|
731
742
|
super();
|
|
732
|
-
s(this,
|
|
743
|
+
s(this, ft, null);
|
|
733
744
|
s(this, z, null);
|
|
734
745
|
s(this, j, !1);
|
|
735
746
|
s(this, J, 0);
|
|
736
|
-
s(this, qt, 0);
|
|
737
747
|
s(this, Ut, 0);
|
|
738
|
-
s(this,
|
|
748
|
+
s(this, Gt, 0);
|
|
749
|
+
s(this, pt, () => {
|
|
739
750
|
h(this, j, this.offsetWidth > this.offsetHeight);
|
|
740
751
|
const e = t(this, j) ? this.offsetWidth : this.offsetHeight;
|
|
741
|
-
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,
|
|
752
|
+
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);
|
|
742
753
|
});
|
|
743
|
-
s(this,
|
|
744
|
-
h(this,
|
|
754
|
+
s(this, Kt, () => {
|
|
755
|
+
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)`;
|
|
745
756
|
});
|
|
746
|
-
s(this,
|
|
757
|
+
s(this, ue, () => {
|
|
747
758
|
this.setAttribute("axis", this.scrollElement.axisCSSProperty.current);
|
|
748
759
|
});
|
|
749
|
-
s(this,
|
|
750
|
-
document.documentElement.classList.add("grabbing"),
|
|
760
|
+
s(this, de, (e) => {
|
|
761
|
+
document.documentElement.classList.add("grabbing"), ts(
|
|
751
762
|
(a) => {
|
|
752
|
-
const m = t(this, j) ? a.x : a.y,
|
|
763
|
+
const m = t(this, j) ? a.x : a.y, v = this.scrollElement.distance / t(this, Ut), I = (m - n) * v;
|
|
753
764
|
this.scrollElement.setPosition(i + I);
|
|
754
765
|
},
|
|
755
766
|
() => {
|
|
756
767
|
document.documentElement.classList.remove("grabbing");
|
|
757
768
|
}
|
|
758
769
|
);
|
|
759
|
-
const i = this.scrollElement.damped.target,
|
|
770
|
+
const i = this.scrollElement.damped.target, n = t(this, j) ? e.x : e.y;
|
|
760
771
|
});
|
|
761
772
|
if (H) {
|
|
762
773
|
const e = this.attachShadow({ mode: "open" });
|
|
763
774
|
e.adoptedStyleSheets = [
|
|
764
|
-
|
|
775
|
+
Ve({
|
|
765
776
|
":host": {
|
|
766
777
|
display: "inline-block",
|
|
767
778
|
zIndex: "1",
|
|
@@ -790,7 +801,7 @@ class rs extends ze {
|
|
|
790
801
|
touchAction: "none"
|
|
791
802
|
}
|
|
792
803
|
})
|
|
793
|
-
], h(this,
|
|
804
|
+
], h(this, ft, document.createElement("slot")), t(this, ft).innerHTML = '<div class="default-thumb"></div>', e.appendChild(t(this, ft));
|
|
794
805
|
}
|
|
795
806
|
}
|
|
796
807
|
get thumbElement() {
|
|
@@ -798,66 +809,66 @@ class rs extends ze {
|
|
|
798
809
|
}
|
|
799
810
|
connectedCallback() {
|
|
800
811
|
super.connectedCallback(), this.setAttribute("drag-dead-zone", "");
|
|
801
|
-
const e = t(this,
|
|
802
|
-
h(this, z, e), t(this, z).addEventListener("pointerdown", t(this,
|
|
812
|
+
const e = t(this, ft).assignedElements()[0] || t(this, ft).firstElementChild;
|
|
813
|
+
h(this, z, e), t(this, z).addEventListener("pointerdown", t(this, de)), Dt.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));
|
|
803
814
|
}
|
|
804
815
|
disconnectedCallback() {
|
|
805
|
-
this.removeAttribute("drag-dead-zone"), this.style.display = "", t(this, z).removeEventListener("pointerdown", t(this,
|
|
816
|
+
this.removeAttribute("drag-dead-zone"), this.style.display = "", t(this, z).removeEventListener("pointerdown", t(this, de)), Dt.unsubscribe(t(this, pt)), re.unsubscribe(t(this, pt)), this.scrollElement.offScroll(t(this, Kt)), this.scrollElement.axisCSSProperty.unsubscribe(t(this, ue));
|
|
806
817
|
}
|
|
807
818
|
}
|
|
808
|
-
|
|
809
|
-
H && !customElements.get("e-scrollbar") && customElements.define("e-scrollbar",
|
|
810
|
-
var
|
|
811
|
-
class
|
|
819
|
+
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();
|
|
820
|
+
H && !customElements.get("e-scrollbar") && customElements.define("e-scrollbar", ns);
|
|
821
|
+
var _t, Zt, jt;
|
|
822
|
+
class Be extends Ie {
|
|
812
823
|
constructor() {
|
|
813
824
|
super();
|
|
814
|
-
s(this,
|
|
815
|
-
s(this,
|
|
825
|
+
s(this, _t, new f(this, "--behaviour", "smooth"));
|
|
826
|
+
s(this, Zt, new f(
|
|
816
827
|
this,
|
|
817
828
|
"--tween-easing",
|
|
818
829
|
!1
|
|
819
830
|
));
|
|
820
|
-
s(this,
|
|
831
|
+
s(this, jt, new f(this, "--tween-duration", 0));
|
|
821
832
|
H && this.addEventListener("click", () => {
|
|
822
|
-
const e = t(this,
|
|
833
|
+
const e = t(this, _t).current, i = t(this, Zt).current, n = t(this, jt).current;
|
|
823
834
|
this.handleClick({
|
|
824
835
|
behaviour: e,
|
|
825
|
-
tween: i ||
|
|
836
|
+
tween: i || n ? { easing: i, duration: n } : void 0
|
|
826
837
|
});
|
|
827
838
|
});
|
|
828
839
|
}
|
|
829
840
|
connectedCallback() {
|
|
830
|
-
super.connectedCallback(), t(this,
|
|
841
|
+
super.connectedCallback(), t(this, _t).observe(), t(this, Zt).observe(), t(this, jt).observe();
|
|
831
842
|
}
|
|
832
843
|
disconnectedCallback() {
|
|
833
|
-
t(this,
|
|
844
|
+
t(this, _t).close(), t(this, Zt).close(), t(this, jt).close();
|
|
834
845
|
}
|
|
835
846
|
}
|
|
836
|
-
|
|
837
|
-
var
|
|
838
|
-
class
|
|
847
|
+
_t = new WeakMap(), Zt = new WeakMap(), jt = new WeakMap();
|
|
848
|
+
var Jt;
|
|
849
|
+
class hs extends Be {
|
|
839
850
|
constructor() {
|
|
840
851
|
super(...arguments);
|
|
841
|
-
s(this,
|
|
852
|
+
s(this, Jt, new f(this, "--set", 1));
|
|
842
853
|
}
|
|
843
854
|
handleClick(e) {
|
|
844
|
-
this.scrollElement.scrollToSection(t(this,
|
|
855
|
+
this.scrollElement.scrollToSection(t(this, Jt).current, e);
|
|
845
856
|
}
|
|
846
857
|
connectedCallback() {
|
|
847
|
-
super.connectedCallback(), t(this,
|
|
858
|
+
super.connectedCallback(), t(this, Jt).observe();
|
|
848
859
|
}
|
|
849
860
|
disconnectedCallback() {
|
|
850
|
-
super.disconnectedCallback(), t(this,
|
|
861
|
+
super.disconnectedCallback(), t(this, Jt).close();
|
|
851
862
|
}
|
|
852
863
|
}
|
|
853
|
-
|
|
854
|
-
H && !customElements.get("e-scroll-set-button") && customElements.define("e-scroll-set-button",
|
|
855
|
-
var Q,
|
|
856
|
-
class
|
|
864
|
+
Jt = new WeakMap();
|
|
865
|
+
H && !customElements.get("e-scroll-set-button") && customElements.define("e-scroll-set-button", hs);
|
|
866
|
+
var Q, Qt;
|
|
867
|
+
class os extends Be {
|
|
857
868
|
constructor() {
|
|
858
869
|
super(...arguments);
|
|
859
|
-
s(this, Q, new
|
|
860
|
-
s(this,
|
|
870
|
+
s(this, Q, new f(this, "--step", 1));
|
|
871
|
+
s(this, Qt, () => {
|
|
861
872
|
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");
|
|
862
873
|
});
|
|
863
874
|
}
|
|
@@ -866,61 +877,61 @@ class hs extends $e {
|
|
|
866
877
|
}
|
|
867
878
|
connectedCallback() {
|
|
868
879
|
super.connectedCallback(), this.scrollElement && (t(this, Q).subscribe(() => {
|
|
869
|
-
t(this,
|
|
880
|
+
t(this, Qt).call(this);
|
|
870
881
|
}), t(this, Q).observe(), this.scrollElement.addEventListener(
|
|
871
882
|
"scrollLine",
|
|
872
|
-
t(this,
|
|
873
|
-
), t(this,
|
|
883
|
+
t(this, Qt)
|
|
884
|
+
), t(this, Qt).call(this));
|
|
874
885
|
}
|
|
875
886
|
disconnectedCallback() {
|
|
876
887
|
super.disconnectedCallback(), t(this, Q).close(), this.removeAttribute("disabled");
|
|
877
888
|
}
|
|
878
889
|
}
|
|
879
|
-
Q = new WeakMap(),
|
|
880
|
-
H && !customElements.get("e-scroll-step-button") && customElements.define("e-scroll-step-button",
|
|
881
|
-
var X, bt,
|
|
882
|
-
class
|
|
883
|
-
constructor(
|
|
890
|
+
Q = new WeakMap(), Qt = new WeakMap();
|
|
891
|
+
H && !customElements.get("e-scroll-step-button") && customElements.define("e-scroll-step-button", os);
|
|
892
|
+
var X, bt, Xt, fe, pe, Yt;
|
|
893
|
+
class ls {
|
|
894
|
+
constructor(r, e, i) {
|
|
884
895
|
s(this, X, null);
|
|
885
896
|
s(this, bt, null);
|
|
886
|
-
s(this,
|
|
887
|
-
s(this,
|
|
897
|
+
s(this, Xt, null);
|
|
898
|
+
s(this, fe, null);
|
|
888
899
|
s(this, pe, () => {
|
|
889
|
-
t(this, bt).scrollToSection(t(this,
|
|
890
|
-
behaviour: t(this,
|
|
900
|
+
t(this, bt).scrollToSection(t(this, Xt), {
|
|
901
|
+
behaviour: t(this, fe)
|
|
891
902
|
});
|
|
892
903
|
});
|
|
893
|
-
s(this,
|
|
904
|
+
s(this, Yt, () => {
|
|
894
905
|
t(this, X).classList.toggle(
|
|
895
906
|
"current",
|
|
896
|
-
t(this, bt).counter.current === t(this,
|
|
907
|
+
t(this, bt).counter.current === t(this, Xt)
|
|
897
908
|
);
|
|
898
909
|
});
|
|
899
|
-
H && (h(this, X, document.createElement("button")), h(this, bt,
|
|
910
|
+
H && (h(this, X, document.createElement("button")), h(this, bt, r), 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));
|
|
900
911
|
}
|
|
901
912
|
get element() {
|
|
902
913
|
return t(this, X);
|
|
903
914
|
}
|
|
904
915
|
destroy() {
|
|
905
|
-
t(this, X).removeEventListener("click", t(this, pe)), t(this, bt).counter.unsubscribe(t(this,
|
|
916
|
+
t(this, X).removeEventListener("click", t(this, pe)), t(this, bt).counter.unsubscribe(t(this, Yt)), t(this, X).remove();
|
|
906
917
|
}
|
|
907
918
|
}
|
|
908
|
-
X = new WeakMap(), bt = new WeakMap(),
|
|
919
|
+
X = new WeakMap(), bt = new WeakMap(), Xt = new WeakMap(), fe = new WeakMap(), pe = new WeakMap(), Yt = new WeakMap();
|
|
909
920
|
var mt, At;
|
|
910
|
-
class
|
|
921
|
+
class cs extends Ie {
|
|
911
922
|
constructor() {
|
|
912
923
|
super(...arguments);
|
|
913
924
|
s(this, mt, []);
|
|
914
|
-
s(this, At,
|
|
925
|
+
s(this, At, es(() => {
|
|
915
926
|
t(this, mt).forEach((i) => i.destroy()), h(this, mt, []);
|
|
916
927
|
const e = this.scrollElement.sections.length - Math.max(this.scrollElement.sectionsInViewCSSProperty.current - 1, 0);
|
|
917
928
|
for (let i = 0; i < e; i++) {
|
|
918
|
-
const
|
|
929
|
+
const n = new ls(
|
|
919
930
|
this.scrollElement,
|
|
920
931
|
i,
|
|
921
932
|
this.getAttribute("behaviour") || "smooth"
|
|
922
933
|
);
|
|
923
|
-
this.appendChild(
|
|
934
|
+
this.appendChild(n.element), t(this, mt).push(n);
|
|
924
935
|
}
|
|
925
936
|
}, 0));
|
|
926
937
|
}
|
|
@@ -942,11 +953,11 @@ class ls extends ze {
|
|
|
942
953
|
}
|
|
943
954
|
}
|
|
944
955
|
mt = new WeakMap(), At = new WeakMap();
|
|
945
|
-
H && !customElements.get("e-scroll-bullet-buttons") && customElements.define("e-scroll-bullet-buttons",
|
|
946
|
-
class
|
|
956
|
+
H && !customElements.get("e-scroll-bullet-buttons") && customElements.define("e-scroll-bullet-buttons", cs);
|
|
957
|
+
class as extends ss {
|
|
947
958
|
connectedCallback() {
|
|
948
|
-
const
|
|
949
|
-
|
|
959
|
+
const r = Oe(this, Vt);
|
|
960
|
+
r instanceof Vt ? (this.scrollContainer = r, this.scrollContainer.addEventListener(
|
|
950
961
|
"scrollSectionsChange",
|
|
951
962
|
this.findAnotherScrollEntries
|
|
952
963
|
), this.scrollContainer.addEventListener("scrollResize", this.resize), this.resize()) : console.error(this, "e-scroll not found");
|
|
@@ -958,12 +969,12 @@ class cs extends es {
|
|
|
958
969
|
), this.scrollContainer.removeEventListener("scrollResize", this.resize));
|
|
959
970
|
}
|
|
960
971
|
}
|
|
961
|
-
H && !customElements.get("e-scroll-segment") && customElements.define("e-scroll-segment",
|
|
972
|
+
H && !customElements.get("e-scroll-segment") && customElements.define("e-scroll-segment", as);
|
|
962
973
|
export {
|
|
963
|
-
|
|
974
|
+
cs as ScrollBulletButtonsElement,
|
|
964
975
|
Vt as ScrollElement,
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
976
|
+
as as ScrollSegmentElement,
|
|
977
|
+
hs as ScrollSetButtonElement,
|
|
978
|
+
os as ScrollStepButtonElement,
|
|
979
|
+
ns as ScrollbarElement
|
|
969
980
|
};
|