aptechka 0.50.6 → 0.50.8
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 +202 -196
- package/package.json +1 -1
|
@@ -73,6 +73,7 @@ export declare class ScrollElement extends HTMLElement {
|
|
|
73
73
|
get targetProgress(): number;
|
|
74
74
|
get scrollWidth(): number;
|
|
75
75
|
get scrollHeight(): number;
|
|
76
|
+
tryResplit(): void;
|
|
76
77
|
onScroll(...parameters: Parameters<Damped['subscribe']>): () => void;
|
|
77
78
|
offScroll(...parameters: Parameters<Damped['unsubscribe']>): void;
|
|
78
79
|
range(from: number, distance: number, margin?: number): number;
|
package/lib/scroll/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var Ve=Object.defineProperty;var we=Object.getOwnPropertySymbols;var _e=Object.prototype.hasOwnProperty,He=Object.prototype.propertyIsEnumerable;var Ee=u=>{throw TypeError(u)};var Pe=(u,h,e)=>h in u?Ve(u,h,{enumerable:!0,configurable:!0,writable:!0,value:e}):u[h]=e,xe=(u,h)=>{for(var e in h||(h={}))_e.call(h,e)&&Pe(u,e,h[e]);if(we)for(var e of we(h))He.call(h,e)&&Pe(u,e,h[e]);return u};var be=(u,h,e)=>h.has(u)||Ee("Cannot "+e);var t=(u,h,e)=>(be(u,h,"read from private field"),e?e.call(u):h.get(u)),s=(u,h,e)=>h.has(u)?Ee("Cannot add the same private member more than once"):h instanceof WeakSet?h.add(u):h.set(u,e),n=(u,h,e,i)=>(be(u,h,"write to private field"),i?i.call(u,e):h.set(u,e),e),c=(u,h,e)=>(be(u,h,"access private method"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const We=require("../Store-DRp_K37w.cjs"),O=require("../index-Cqw2NKev.cjs"),Fe=require("../easings-GegIwET5.cjs"),ce=require("../events-KVanG9sR.cjs"),ze=require("../jss-BXAMRO12.cjs"),It=require("../layout-Ctc2p3uz.cjs"),ke=require("../math-GDWEqu7y.cjs"),$e=require("../number-0243DApo.cjs");require("../ticker/index.cjs");const ue=require("../order/index.cjs"),Ne=require("../Damped-DbaLw6w1.cjs"),Ue=require("../Tweened-Dm6Avip9.cjs"),le=require("../controls/index.cjs"),Rt=require("../window-resizer/index.cjs"),mt=require("../scroll-entries/index.cjs"),Le=require("../css-unit-parser/index.cjs"),S=require("../css-property/index.cjs"),Ge=require("../device/index.cjs"),Qt=require("../element-resizer/index.cjs"),Ze=require("../gestures-DHLrn6Q8.cjs"),Ie=require("../dom-JBOkFLTh.cjs"),je=require("../function-MthRj-GJ.cjs"),Ke=require("../scroll-segment/index.cjs");var f,Xt,g,gt,V,Q;class Je{constructor(h,e,i){s(this,f);s(this,Xt);s(this,g);s(this,gt,0);s(this,V,0);s(this,Q,null);n(this,f,h),n(this,Xt,e),n(this,g,i),mt.scrollEntries.register(t(this,f))}get index(){return t(this,Xt)}get size(){return t(this,gt)}get position(){return t(this,V)}destroy(){mt.scrollEntries.unregister(t(this,f)),this.unsetTransform()}unsetTransform(){t(this,f).style.transform="",this.mark(null),this.setSize()}setSize(h){h?(t(this,f).style.setProperty("--size",h+"px"),t(this,g).axisCSSProperty.current==="x"?(t(this,f).style.width=h+"px",t(this,f).style.height=""):(t(this,f).style.height=h+"px",t(this,f).style.width="")):(t(this,f).style.width="",t(this,f).style.height="",t(this,f).style.removeProperty("--size"))}resize(){n(this,gt,t(this,g).vertical?t(this,f).offsetHeight:t(this,f).offsetWidth),n(this,V,t(this,g).vertical?It.getCumulativeOffsetTop(t(this,f)):It.getCumulativeOffsetLeft(t(this,f))),n(this,V,t(this,V)-t(this,g).contentPosition)}transform(){let h=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,gt)<t(this,g).currentScrollValue&&(h=t(this,g).distance*-1-t(this,g).gap),mt.scrollEntries.update(t(this,f),t(this,g).axisCSSProperty.current,h);const i=t(this,g).currentScrollValue+h,r=t(this,V)-t(this,g).viewportSize-e,d=t(this,V)+t(this,gt)+e,b=ke.clamp(i,r,d);t(this,g).vertical?t(this,f).style.transform=`translate3d(0px, ${b*-1}px, 0px)`:t(this,f).style.transform=`translate3d(${b*-1}px, 0px, 0px)`}mark(h){t(this,Q)!==h&&(t(this,Q)&&t(this,f).classList.remove(t(this,Q)),h&&t(this,f).classList.add(h),n(this,Q,h),ce.dispatchEvent(t(this,f),"scrollSectionMarkChange",{composed:!0,detail:{mark:t(this,Q)},custom:!0}))}}f=new WeakMap,Xt=new WeakMap,g=new WeakMap,gt=new WeakMap,V=new WeakMap,Q=new WeakMap;const Qe=ze.createStylesheet({":host":{position:"relative",width:"100%",height:"100%",display:"block",outline:"none"},".static":{position:"var(--static-position, absolute)",top:"var(--static-top, 0)",left:"var(--static-left, 0)",width:"var(--static-width, 100%)",height:"var(--static-height, 100%)"},".content-wrapper":{width:"100%",height:"100%",overflow:"var(--overflow, initial)"},".content":{position:"relative",display:"flex",width:"100%",height:"100%",gap:"var(--gap, 0px)",willChange:"var(--will-change, transform)"},":host(.hibernated) .content-wrapper":{display:"contents"},":host(.hibernated) .content":{display:"contents"},"::slotted(*)":{flexShrink:"0"}});var a,yt,x,X,_,H,W,T,Y,tt,F,et,vt,q,v,Ct,wt,Pt,Et,Tt,R,xt,st,D,it,$,rt,Lt,nt,ht,ot,p,qt,l,Yt,te,y,m,k,A,lt,M,w,P,Dt,ct,N,U,ut,At,at,G,Mt,B,E,o,fe,Jt,kt,ae,de,me,ge,L,Bt,Re,Ot,ee,ye,ve,ft,Se,se;class jt extends HTMLElement{constructor(){super();s(this,o);s(this,a,null);s(this,yt,new S.CSSProperty(this,"--controls",!0));s(this,x,new S.CSSProperty(this,"--axis","y"));s(this,X,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,W,new S.CSSProperty(this,"--split",!1));s(this,T,new S.CSSProperty(this,"--sectional",!1));s(this,Y,new S.CSSProperty(this,"--tween-easing",!1));s(this,tt,new S.CSSProperty(this,"--tween-duration",!1));s(this,F,new S.CSSProperty(this,"--auto-size",!1));s(this,et,new S.CSSProperty(this,"--wheel-max-delta",!1));s(this,vt,new S.CSSProperty(this,"--drag-inertion",1));s(this,q,new S.CSSProperty(this,"--sections-in-view",1));s(this,v,new S.CSSProperty(this,"--loop",!1));s(this,Ct,new S.CSSProperty(this,"--damping",20));s(this,wt,new S.CSSProperty(this,"--mass",0));s(this,Pt,new S.CSSProperty(this,"--stiffness",0));s(this,Et,new S.CSSProperty(this,"--mouse-drag",!1));s(this,Tt,new S.CSSProperty(this,"--section-distance-scale",.5));s(this,R,new S.CSSProperty(this,"--autoplay",0));s(this,xt,new S.CSSProperty(this,"--autoplay-pause-duration",0));s(this,st,new S.CSSProperty(this,"--autoplay-user-direction",!1));s(this,D,new S.CSSProperty(this,"--classes",!1));s(this,it,new S.CSSProperty(this,"--current-index-start-offset",0));s(this,$,new S.CSSProperty(this,"--current-index-end-offset",0));s(this,rt,new S.CSSProperty(this,"--focus-delay",0));s(this,Lt,new S.CSSProperty(this,"--focus-duration",3e3));s(this,nt,new S.CSSProperty(this,"--disabled",!1));s(this,ht,new S.CSSProperty(this,"--hibernate",!1));s(this,ot,null);s(this,p,null);s(this,qt,null);s(this,l,[]);s(this,Yt,0);s(this,te,0);s(this,y,0);s(this,m,0);s(this,k,0);s(this,A,null);s(this,lt,null);s(this,M,null);s(this,w,null);s(this,P,new We.Store(0));s(this,Dt,0);s(this,ct,0);s(this,N,!1);s(this,U,!0);s(this,ut,!0);s(this,At);s(this,at);s(this,G,new Ue.Tweened);s(this,Mt,!1);s(this,B,null);s(this,E,!1);s(this,L,()=>{if(t(this,ht).current)return;t(this,a).unlistenAnimationFrame();const e=this.currentScrollValue/t(this,m)||0,i=t(this,P).current;if(n(this,Yt,this.vertical?It.getCumulativeOffsetTop(this):It.getCumulativeOffsetLeft(this)),n(this,te,this.vertical?It.getCumulativeOffsetTop(t(this,p)):It.getCumulativeOffsetLeft(t(this,p))),n(this,y,this.vertical?this.offsetHeight:this.offsetWidth),this.vertical?n(this,k,Le.cssUnitParser.parse(getComputedStyle(t(this,p)).rowGap)):n(this,k,Le.cssUnitParser.parse(getComputedStyle(t(this,p)).columnGap)),t(this,F).current&&t(this,l).length){const r=t(this,q).current,d=(t(this,y)-t(this,k)*(r-1))/r;t(this,l).forEach(b=>{b.setSize(d)})}else t(this,l).forEach(r=>{r.setSize()});if(t(this,l).forEach(r=>{r.resize()}),t(this,H).current){n(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",n(this,m,t(this,p).offsetHeight-t(this,y))):(t(this,p).style.width="max-content",t(this,p).style.height="100%",n(this,m,t(this,p).offsetWidth-t(this,y)));if(!t(this,v).current){const r=getComputedStyle(this),d=this.vertical?parseFloat(r.paddingBlockStart)+parseFloat(r.paddingBlockEnd):parseFloat(r.paddingInlineStart)+parseFloat(r.paddingInlineEnd);n(this,m,t(this,m)+d),t(this,a).max=t(this,m)}if(t(this,v).current&&t(this,l).length){const r=t(this,l)[t(this,l).length-1],d=r.position+r.size-t(this,y),b=t(this,m)-d;n(this,ct,r.position+r.size+b)}else n(this,ct,t(this,m));if(t(this,T).current&&t(this,l).length){const r=t(this,l)[i];t(this,a).set(r.position,{equalize:!0})}else t(this,a).set(e*t(this,m),{equalize:!0});n(this,N,(this.vertical?t(this,p).offsetHeight:t(this,p).offsetWidth)>t(this,y)),this.classList.toggle("has-overflow",t(this,N)),t(this,N)?t(this,nt).current||c(this,o,de).call(this):c(this,o,ae).call(this),t(this,Bt).call(this)});s(this,Bt,()=>{if(!t(this,N)||t(this,ut)||t(this,U))return;const e=this.currentScrollValue;if(n(this,Dt,Math.max(0,e-t(this,m))),t(this,l).length){for(let i=0;i<t(this,l).length;i++)t(this,l)[i].transform();t(this,P).current=c(this,o,Se).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)`;mt.scrollEntries.update(this,t(this,x).current,e)});s(this,Ot,(e,i)=>{t(this,yt).current&&(c(this,o,ye).call(this,Math.sign(i)||1),t(this,ee).call(this,e,i))});s(this,ee,(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,G).unlistenAnimationFrame(),!t(this,R).current&&t(this,rt).current&&(clearInterval(t(this,At)),n(this,At,setTimeout(()=>{const r=t(this,l)[c(this,o,Se).call(this)];r&&this.scrollToSection(r.index,{tween:{duration:t(this,Lt).current,easing:Fe.easeInOutExpo}})},t(this,rt).current))),!(e.includes("drag")&&!Ge.device.isTouch&&!t(this,Et).current)){if(t(this,T).current&&e!=="drag"){const r=Math.sign(i);if(t(this,l).length){const d={tween:t(this,Y).current||t(this,tt).current?{easing:t(this,Y).current||"easeInOutCubic",duration:t(this,tt).current||500}:void 0};t(this,Mt)?this.scrollToSection(t(this,P).current,d):this.shiftSections(r,d)}else t(this,a).shift(r*t(this,y))}else t(this,a).shift(i);n(this,Mt,e==="drag")}});s(this,se,()=>{n(this,E,!0),this.hibernatedCSSProperty.current||c(this,o,ge).call(this)});if(O.isBrowser){const e=this.attachShadow({mode:"open"});e.adoptedStyleSheets=[Qe];const i=document.createElement("div");i.className="static",i.innerHTML='<slot name="static"></slot>',e.appendChild(i),n(this,ot,document.createElement("div")),t(this,ot).className="content-wrapper",n(this,p,document.createElement("div")),t(this,p).className="content",n(this,qt,document.createElement("slot")),t(this,p).appendChild(t(this,qt)),t(this,ot).appendChild(t(this,p)),e.appendChild(t(this,ot))}}get damped(){return t(this,a)}get controlsCSSProperty(){return t(this,yt)}get axisCSSProperty(){return t(this,x)}get reverseCSSProperty(){return t(this,X)}get directionCSSProperty(){return t(this,_)}get pagesCSSProperty(){return t(this,H)}get splitCSSProperty(){return t(this,W)}get sectionalCSSProperty(){return t(this,T)}get easingCSSProperty(){return t(this,Y)}get durationCSSProperty(){return t(this,tt)}get autoSizeCSSProperty(){return t(this,F)}get wheelMaxDeltaCSSProperty(){return t(this,et)}get dragInertionCSSProperty(){return t(this,vt)}get sectionsInViewCSSProperty(){return t(this,q)}get loopCSSProperty(){return t(this,v)}get dampingCSSProperty(){return t(this,Ct)}get massCSSProperty(){return t(this,wt)}get stiffnessCSSProperty(){return t(this,Pt)}get mouseDragCSSProperty(){return t(this,Et)}get sectionDistanceScaleCSSProperty(){return t(this,Tt)}get autoplayCSSProperty(){return t(this,R)}get autoplayPauseDurationCSSProperty(){return t(this,xt)}get autoplayUserDirectionCSSProperty(){return t(this,st)}get classesCSSProperty(){return t(this,D)}get currentIndexStartOffsetCSSProperty(){return t(this,it)}get currentIndexEndOffsetCSSProperty(){return t(this,$)}get focusDelayCSSProperty(){return t(this,rt)}get focusDurationCSSProperty(){return t(this,Lt)}get disabledCSSProperty(){return t(this,nt)}get hibernatedCSSProperty(){return t(this,ht)}get currentScrollValue(){return c(this,o,ve).call(this,"current")}get targetScrollValue(){return c(this,o,ve).call(this,"target")}get contentWrapperElement(){return t(this,ot)}get contentElement(){return t(this,p)}get sections(){return t(this,l)}get position(){return t(this,Yt)}get contentPosition(){return t(this,te)}get viewportSize(){return t(this,y)}get scrollSize(){return t(this,m)}get gap(){return t(this,k)}get counter(){return t(this,P)}get limit(){return Math.ceil(t(this,l).length-t(this,q).current)}get distance(){return t(this,ct)}get loopDistance(){return t(this,v).current?t(this,ct)+t(this,k):t(this,ct)}get hasOverflow(){return t(this,N)}get overscroll(){return t(this,Dt)}get scrollLine(){return t(this,B)}get vertical(){return t(this,x).current==="y"}get currentProgress(){return this.currentScrollValue/this.loopDistance||0}get targetProgress(){return this.targetScrollValue/this.loopDistance||0}get scrollWidth(){return t(this,x).current==="y"?0:t(this,a).distance}get scrollHeight(){return t(this,x).current==="x"?0:t(this,a).distance}onScroll(...e){return t(this,a).subscribe(...e)}offScroll(...e){t(this,a).unsubscribe(...e)}range(e,i,r=0){const d=e-r,b=d+i+r*2;return this.currentProgress<d?0:this.currentProgress>b?1:(this.currentProgress-d)/(b-d)}curve(e,i,r=0){return Math.sin(this.range(e,i,r)*Math.PI)}visible(e,i,r=0){const d=e-r,b=d+i+r*2;return this.currentProgress>=d&&this.currentProgress<=b}scrollToSection(e,i){if(!t(this,l).length)return;const r=t(this,P).current,d=c(this,o,Re).call(this,e),b=t(this,l)[r],C=t(this,l)[d];if(b&&C){let I=0;const pe=c(this,o,Se).call(this),Kt=t(this,l)[pe],Oe=Kt?this.targetScrollValue-Kt.position:0;t(this,v).current?d===0&&r===t(this,l).length-1?I=t(this,m)+t(this,y)-b.position+t(this,k):d===t(this,l).length-1&&r===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-Oe,i)}}shiftSections(e,i){t(this,l).length&&this.scrollToSection(t(this,P).current+e,i)}setPosition(e,i){c(this,o,ye).call(this,Math.sign(e)||1),i!=null&&i.tween?t(this,at)||(t(this,G).set(t(this,a).current,{equalize:!0}),t(this,G).set(e,xe({},i.tween)),n(this,at,setTimeout(()=>{n(this,at,void 0)},i.tween.duration||0))):t(this,a).set(e,{equalize:(i==null?void 0:i.behaviour)==="instant"})}shiftPosition(e,i){this.setPosition(t(this,a).target+e,i)}connectedCallback(){mt.scrollEntries.register(this),n(this,a,new Ne.Damped(0,{damping:.01,min:0,order:ue.TICK_ORDER.SCROLL})),this.setAttribute("tabindex","0"),n(this,A,new le.WheelControls({element:t(this,p)})),t(this,A).changeEvent.subscribe(t(this,Ot)),n(this,lt,new le.KeyboardControls({element:this})),t(this,lt).changeEvent.subscribe(t(this,Ot)),n(this,M,new le.DragControls({element:t(this,p)})),t(this,M).changeEvent.subscribe(t(this,Ot)),n(this,w,new le.AutoplayControls({culling:this})),t(this,w).changeEvent.subscribe(t(this,ee)),t(this,x).subscribe(()=>{c(this,o,fe).call(this)}),t(this,X).subscribe(()=>{c(this,o,fe).call(this)}),t(this,et).subscribe(e=>{t(this,A).axis=e.current?"max":t(this,x).current}),t(this,vt).subscribe(e=>{t(this,M).inertion=typeof e.current=="number"?e.current:1}),t(this,H).subscribe(()=>{t(this,E)&&t(this,L).call(this)}),t(this,W).subscribe(({current:e})=>{t(this,E)&&(e?c(this,o,Jt).call(this):c(this,o,kt).call(this))}),t(this,T).subscribe(e=>{t(this,A).debounce=e.current,t(this,M).swipe=e.current,t(this,w).interval=e.current,t(this,E)&&(e.current&&!e.previous&&!t(this,l).length?c(this,o,Jt).call(this):!e.current&&e.previous&&t(this,l).length&&c(this,o,kt).call(this))}),t(this,F).subscribe(e=>{t(this,E)&&(t(this,L).call(this),e.current&&!e.previous&&!t(this,l).length?c(this,o,Jt).call(this):!e.current&&e.previous&&t(this,l).length&&c(this,o,kt).call(this))}),t(this,q).subscribe(e=>{t(this,E)&&(t(this,L).call(this),c(this,o,ft).call(this))}),t(this,v).subscribe(e=>{e.current?(t(this,E)&&(t(this,l).length||(t(this,W).current=!0)),t(this,a).max=1/0,t(this,a).min=-1/0):(n(this,Dt,0),t(this,a).max=t(this,m),t(this,a).min=0)}),t(this,Ct).subscribe(e=>{t(this,a).damping=e.current}),t(this,wt).subscribe(e=>{t(this,a).mass=e.current}),t(this,Pt).subscribe(e=>{t(this,a).stiffness=e.current}),t(this,R).subscribe(e=>{t(this,w).speed=e.current,!t(this,U)&&e.current&&!e.previous?t(this,w).connect():!e.current&&e.previous&&t(this,w).disconnect()}),t(this,st).subscribe(e=>{e.current||(t(this,w).direction=1)}),t(this,D).subscribe(e=>{t(this,E)&&c(this,o,ft).call(this)}),t(this,it).subscribe(e=>{t(this,E)&&t(this,D).current&&c(this,o,ft).call(this)}),t(this,$).subscribe(e=>{t(this,E)&&t(this,D).current&&c(this,o,ft).call(this)}),t(this,a).isRunning.subscribe(e=>{this.classList.toggle("active",e.current)}),t(this,P).subscribe(e=>{t(this,l).length&&c(this,o,ft).call(this)}),t(this,G).subscribe(e=>{t(this,G).isRunning.current&&t(this,a).set(e.current,{equalize:!0})}),t(this,nt).subscribe(e=>{e.current&&!e.previous?(this.classList.add("disabled"),c(this,o,ae).call(this)):!e.current&&e.previous&&(this.classList.remove("disabled"),c(this,o,de).call(this))}),t(this,ht).subscribe(e=>{e.current&&!e.previous?(this.classList.add("hibernated"),c(this,o,me).call(this)):!e.current&&e.previous&&(this.classList.remove("hibernated"),c(this,o,ge).call(this))}),t(this,yt).observe(),t(this,x).observe(),t(this,X).observe(),t(this,_).observe(),t(this,H).observe(),t(this,W).observe(),t(this,T).observe(),t(this,Y).observe(),t(this,tt).observe(),t(this,F).observe(),t(this,et).observe(),t(this,vt).observe(),t(this,q).observe(),t(this,v).observe(),t(this,Ct).observe(),t(this,wt).observe(),t(this,Pt).observe(),t(this,Et).observe(),t(this,Tt).observe(),t(this,R).observe(),t(this,R).observe(),t(this,xt).observe(),t(this,st).observe(),t(this,D).observe(),t(this,it).observe(),t(this,$).observe(),t(this,rt).observe(),t(this,Lt).observe(),t(this,nt).observe(),t(this,ht).observe(),Rt.windowResizer.subscribe(t(this,se),ue.RESIZE_ORDER.LAST)}disconnectedCallback(){this.removeAttribute("tabindex"),this.classList.remove("disabled"),this.classList.remove("hibernated"),t(this,yt).unobserve(),t(this,x).unobserve(),t(this,X).unobserve(),t(this,_).unobserve(),t(this,H).unobserve(),t(this,W).unobserve(),t(this,T).unobserve(),t(this,Y).unobserve(),t(this,tt).unobserve(),t(this,F).unobserve(),t(this,et).unobserve(),t(this,vt).unobserve(),t(this,q).unobserve(),t(this,v).unobserve(),t(this,Ct).unobserve(),t(this,wt).unobserve(),t(this,Pt).unobserve(),t(this,Et).unobserve(),t(this,Tt).unobserve(),t(this,R).unobserve(),t(this,xt).unobserve(),t(this,st).unobserve(),t(this,D).unobserve(),t(this,it).unobserve(),t(this,$).unobserve(),t(this,rt).unobserve(),t(this,Lt).unobserve(),t(this,nt).unobserve(),t(this,ht).unobserve(),Rt.windowResizer.unsubscribe(t(this,se)),c(this,o,me).call(this)}}a=new WeakMap,yt=new WeakMap,x=new WeakMap,X=new WeakMap,_=new WeakMap,H=new WeakMap,W=new WeakMap,T=new WeakMap,Y=new WeakMap,tt=new WeakMap,F=new WeakMap,et=new WeakMap,vt=new WeakMap,q=new WeakMap,v=new WeakMap,Ct=new WeakMap,wt=new WeakMap,Pt=new WeakMap,Et=new WeakMap,Tt=new WeakMap,R=new WeakMap,xt=new WeakMap,st=new WeakMap,D=new WeakMap,it=new WeakMap,$=new WeakMap,rt=new WeakMap,Lt=new WeakMap,nt=new WeakMap,ht=new WeakMap,ot=new WeakMap,p=new WeakMap,qt=new WeakMap,l=new WeakMap,Yt=new WeakMap,te=new WeakMap,y=new WeakMap,m=new WeakMap,k=new WeakMap,A=new WeakMap,lt=new WeakMap,M=new WeakMap,w=new WeakMap,P=new WeakMap,Dt=new WeakMap,ct=new WeakMap,N=new WeakMap,U=new WeakMap,ut=new WeakMap,At=new WeakMap,at=new WeakMap,G=new WeakMap,Mt=new WeakMap,B=new WeakMap,E=new WeakMap,o=new WeakSet,fe=function(){const e=t(this,x).current,i=t(this,X).current?"-reverse":"";t(this,p).style.flexDirection=e==="x"?`row${i}`:`column${i}`,t(this,A).axis=t(this,et).current?"max":e,t(this,lt).dimension=e==="x"?"width":"height",t(this,M).axis=e,e==="x"?this.style.touchAction="pan-y":e==="y"&&(this.style.touchAction="pan-x"),t(this,E)&&t(this,L).call(this)},Jt=function(){c(this,o,kt).call(this),t(this,qt).assignedElements().forEach((e,i)=>{e instanceof HTMLElement&&t(this,l).push(new Je(e,i,this))}),t(this,p).style.transform="",ce.dispatchEvent(this,"scrollSectionsChange",{custom:!0,composed:!0}),t(this,L).call(this),c(this,o,ft).call(this)},kt=function(){t(this,l).forEach(e=>{e.destroy()}),n(this,l,[]),t(this,P).reset(),t(this,a).reset(),ce.dispatchEvent(this,"scrollSectionsChange",{custom:!0,composed:!0})},ae=function(){t(this,U)||(n(this,U,!0),t(this,a).unsubscribe(t(this,Bt)),t(this,a).unlistenAnimationFrame(),clearInterval(t(this,At)),clearInterval(t(this,at)),t(this,G).unlistenAnimationFrame(),t(this,A).disconnect(),t(this,lt).disconnect(),t(this,M).disconnect(),t(this,w).disconnect(),t(this,N)||(this.sections.forEach(e=>{e.unsetTransform()}),t(this,L).call(this)))},de=function(){t(this,U)&&(n(this,U,!1),t(this,a).subscribe(t(this,Bt)),t(this,A).connect(),t(this,lt).connect(),t(this,M).connect(),t(this,R).current&&t(this,w).connect())},me=function(){t(this,ut)||(n(this,ut,!0),Rt.windowResizer.unsubscribe(t(this,L)),Qt.elementResizer.unsubscribe(t(this,L)),c(this,o,ae).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,l).length?c(this,o,kt).call(this):(t(this,P).reset(),t(this,a).reset()),mt.scrollEntries.unregister(this))},ge=function(){t(this,ut)&&(n(this,ut,!1),mt.scrollEntries.register(this),(t(this,v).current||t(this,W).current||t(this,v).current||t(this,F).current||t(this,T).current)&&c(this,o,Jt).call(this),c(this,o,de).call(this),Rt.windowResizer.subscribe(t(this,L),ue.RESIZE_ORDER.SCROLL),Qt.elementResizer.subscribe(this,t(this,L)))},L=new WeakMap,Bt=new WeakMap,Re=function(e){let i=t(this,P).current;return t(this,v).current?i=$e.loopNumber(e,t(this,l).length):i=ke.clamp(e,0,this.limit),i},Ot=new WeakMap,ee=new WeakMap,ye=function(e=1){t(this,st).current&&(t(this,w).direction=e),t(this,R).current&&t(this,w).pauseAndContinue(t(this,xt).current,this.sectionalCSSProperty.current)},ve=function(e="current"){if(t(this,v).current&&t(this,l).length){const i=t(this,a)[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,a)[e]},ft=function(){if(t(this,l).length){const e=t(this,P).current+t(this,it).current;if(e===0?n(this,B,"start"):e===this.limit?n(this,B,"end"):n(this,B,null),ce.dispatchEvent(this,"scrollLine",{detail:{line:t(this,B)}}),t(this,D).current){this.classList.remove("end","start"),t(this,B)&&this.classList.add(t(this,B));const i=t(this,q).current+t(this,$).current;t(this,l).forEach((r,d)=>{const b=e-this.limit-1+t(this,$).current,C=e+i,I=this.sections.length-C;d>=e&&d<C||d<=b?r.mark("current"):d>=C&&d<C+I/2||d<=b+i?r.mark("next"):r.mark("previous")})}}},Se=function(){let e=this.targetScrollValue,i=1/0,r=0;const d=t(this,a).direction;for(let b=0;b<t(this,l).length;b++){const C=t(this,l)[b];let I=t(this,Mt)?C.size*d*-1*.4:0,pe=C.position;const Kt=Math.abs(pe+I-e);Kt<i&&(i=Kt,r=b)}return r},se=new WeakMap;O.isBrowser&&!customElements.get("e-scroll")&&customElements.define("e-scroll",jt);var ie;class Ce extends HTMLElement{constructor(){super(...arguments);s(this,ie,null)}get scrollElement(){return t(this,ie)}connectedCallback(){const e=Ie.findParentElement(this,jt);e instanceof jt?n(this,ie,e):console.error(this,"e-scroll not found")}}ie=new WeakMap;var dt,z,Z,j,Vt,_t,St,Ht,re,ne;class Te extends Ce{constructor(){super();s(this,dt,null);s(this,z,null);s(this,Z,!1);s(this,j,0);s(this,Vt,0);s(this,_t,0);s(this,St,()=>{n(this,Z,this.offsetWidth>this.offsetHeight);const e=t(this,Z)?this.offsetWidth:this.offsetHeight;n(this,j,e/((this.scrollElement.scrollSize+this.scrollElement.viewportSize)/e)),n(this,j,Math.max(t(this,j),30)),t(this,Z)?(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"),n(this,Vt,e-t(this,j)),this.scrollElement.scrollSize<=0?this.style.display="none":this.style.display="",t(this,Ht).call(this)});s(this,Ht,()=>{n(this,_t,this.scrollElement.currentProgress*t(this,Vt)),t(this,Z)?t(this,z).style.transform=`translate3d(${t(this,_t)}px, 0px, 0px)`:t(this,z).style.transform=`translate3d(0px, ${t(this,_t)}px, 0px)`});s(this,re,()=>{this.setAttribute("axis",this.scrollElement.axisCSSProperty.current)});s(this,ne,e=>{document.documentElement.classList.add("grabbing"),Ze.setupDrag(d=>{const b=t(this,Z)?d.x:d.y,C=this.scrollElement.distance/t(this,Vt),I=(b-r)*C;this.scrollElement.setPosition(i+I)},()=>{document.documentElement.classList.remove("grabbing")});const i=this.scrollElement.damped.target,r=t(this,Z)?e.x:e.y});if(O.isBrowser){const e=this.attachShadow({mode:"open"});e.adoptedStyleSheets=[ze.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"}})],n(this,dt,document.createElement("slot")),t(this,dt).innerHTML='<div class="default-thumb"></div>',e.appendChild(t(this,dt))}}get thumbElement(){return t(this,z)}connectedCallback(){super.connectedCallback(),this.setAttribute("drag-dead-zone","");const e=t(this,dt).assignedElements()[0]||t(this,dt).firstElementChild;n(this,z,e),t(this,z).addEventListener("pointerdown",t(this,ne)),Rt.windowResizer.subscribe(t(this,St),ue.RESIZE_ORDER.SCROLL),Qt.elementResizer.subscribe(this,t(this,St)),Qt.elementResizer.subscribe(this.scrollElement,t(this,St)),this.scrollElement.onScroll(t(this,Ht)),this.scrollElement.axisCSSProperty.subscribe(t(this,re))}disconnectedCallback(){this.removeAttribute("drag-dead-zone"),this.style.display="",t(this,z).removeEventListener("pointerdown",t(this,ne)),Rt.windowResizer.unsubscribe(t(this,St)),Qt.elementResizer.unsubscribe(t(this,St)),this.scrollElement.offScroll(t(this,Ht)),this.scrollElement.axisCSSProperty.unsubscribe(t(this,re))}}dt=new WeakMap,z=new WeakMap,Z=new WeakMap,j=new WeakMap,Vt=new WeakMap,_t=new WeakMap,St=new WeakMap,Ht=new WeakMap,re=new WeakMap,ne=new WeakMap;O.isBrowser&&!customElements.get("e-scrollbar")&&customElements.define("e-scrollbar",Te);var Wt,Ft,$t;class qe extends Ce{constructor(){super();s(this,Wt,new S.CSSProperty(this,"--behaviour","smooth"));s(this,Ft,new S.CSSProperty(this,"--tween-easing",!1));s(this,$t,new S.CSSProperty(this,"--tween-duration",0));O.isBrowser&&this.addEventListener("click",()=>{const e=t(this,Wt).current,i=t(this,Ft).current,r=t(this,$t).current;this.handleClick({behaviour:e,tween:i||r?{easing:i,duration:r}:void 0})})}connectedCallback(){super.connectedCallback(),t(this,Wt).observe(),t(this,Ft).observe(),t(this,$t).observe()}disconnectedCallback(){t(this,Wt).close(),t(this,Ft).close(),t(this,$t).close()}}Wt=new WeakMap,Ft=new WeakMap,$t=new WeakMap;var Nt;class De extends qe{constructor(){super(...arguments);s(this,Nt,new S.CSSProperty(this,"--set",1))}handleClick(e){this.scrollElement.scrollToSection(t(this,Nt).current,e)}connectedCallback(){super.connectedCallback(),t(this,Nt).observe()}disconnectedCallback(){super.disconnectedCallback(),t(this,Nt).close()}}Nt=new WeakMap;O.isBrowser&&!customElements.get("e-scroll-set-button")&&customElements.define("e-scroll-set-button",De);var K,Ut;class Ae extends qe{constructor(){super(...arguments);s(this,K,new S.CSSProperty(this,"--step",1));s(this,Ut,()=>{this.scrollElement.loopCSSProperty.current?this.removeAttribute("disabled"):t(this,K).current>0&&this.scrollElement.scrollLine==="end"||t(this,K).current<0&&this.scrollElement.scrollLine==="start"?this.setAttribute("disabled",""):this.removeAttribute("disabled")})}handleClick(e){this.scrollElement.shiftSections(t(this,K).current,e)}connectedCallback(){super.connectedCallback(),this.scrollElement&&(t(this,K).subscribe(()=>{t(this,Ut).call(this)}),t(this,K).observe(),this.scrollElement.addEventListener("scrollLine",t(this,Ut)),t(this,Ut).call(this))}disconnectedCallback(){super.disconnectedCallback(),t(this,K).close(),this.removeAttribute("disabled")}}K=new WeakMap,Ut=new WeakMap;O.isBrowser&&!customElements.get("e-scroll-step-button")&&customElements.define("e-scroll-step-button",Ae);var J,pt,Gt,he,oe,Zt;class Xe{constructor(h,e,i){s(this,J,null);s(this,pt,null);s(this,Gt,null);s(this,he,null);s(this,oe,()=>{t(this,pt).scrollToSection(t(this,Gt),{behaviour:t(this,he)})});s(this,Zt,()=>{t(this,J).classList.toggle("current",t(this,pt).counter.current===t(this,Gt))});O.isBrowser&&(n(this,J,document.createElement("button")),n(this,pt,h),n(this,he,i),n(this,Gt,e),t(this,J).addEventListener("click",t(this,oe)),t(this,pt).counter.subscribe(t(this,Zt)),t(this,Zt).call(this))}get element(){return t(this,J)}destroy(){t(this,J).removeEventListener("click",t(this,oe)),t(this,pt).counter.unsubscribe(t(this,Zt)),t(this,J).remove()}}J=new WeakMap,pt=new WeakMap,Gt=new WeakMap,he=new WeakMap,oe=new WeakMap,Zt=new WeakMap;var bt,zt;class Me extends Ce{constructor(){super(...arguments);s(this,bt,[]);s(this,zt,je.debounce(()=>{t(this,bt).forEach(i=>i.destroy()),n(this,bt,[]);const e=this.scrollElement.sections.length-Math.max(this.scrollElement.sectionsInViewCSSProperty.current-1,0);for(let i=0;i<e;i++){const r=new Xe(this.scrollElement,i,this.getAttribute("behaviour")||"smooth");this.appendChild(r.element),t(this,bt).push(r)}},0))}connectedCallback(){super.connectedCallback(),this.scrollElement.addEventListener("sectionsChange",t(this,zt)),this.scrollElement.sectionsInViewCSSProperty.subscribe(t(this,zt))}disconnectedCallback(){this.scrollElement.removeEventListener("sectionsChange",t(this,zt)),this.scrollElement.sectionsInViewCSSProperty.unsubscribe(t(this,zt)),t(this,bt).forEach(e=>e.destroy()),n(this,bt,[])}}bt=new WeakMap,zt=new WeakMap;O.isBrowser&&!customElements.get("e-scroll-bullet-buttons")&&customElements.define("e-scroll-bullet-buttons",Me);class Be extends Ke.ScrollSegmentElement{connectedCallback(){const h=Ie.findParentElement(this,jt);h instanceof jt?(this.scrollContainer=h,this.scrollContainer.addEventListener("scrollSectionsChange",this.findAnotherScrollEntries)):console.error(this,"e-scroll not found")}}O.isBrowser&&!customElements.get("e-scroll-segment")&&customElements.define("e-scroll-segment",Be);exports.ScrollBulletButtonsElement=Me;exports.ScrollElement=jt;exports.ScrollSegmentElement=Be;exports.ScrollSetButtonElement=De;exports.ScrollStepButtonElement=Ae;exports.ScrollbarElement=Te;
|
|
1
|
+
"use strict";var _e=Object.defineProperty;var Pe=Object.getOwnPropertySymbols;var He=Object.prototype.hasOwnProperty,We=Object.prototype.propertyIsEnumerable;var xe=u=>{throw TypeError(u)};var Ee=(u,h,e)=>h in u?_e(u,h,{enumerable:!0,configurable:!0,writable:!0,value:e}):u[h]=e,Le=(u,h)=>{for(var e in h||(h={}))He.call(h,e)&&Ee(u,e,h[e]);if(Pe)for(var e of Pe(h))We.call(h,e)&&Ee(u,e,h[e]);return u};var fe=(u,h,e)=>h.has(u)||xe("Cannot "+e);var t=(u,h,e)=>(fe(u,h,"read from private field"),e?e.call(u):h.get(u)),s=(u,h,e)=>h.has(u)?xe("Cannot add the same private member more than once"):h instanceof WeakSet?h.add(u):h.set(u,e),n=(u,h,e,i)=>(fe(u,h,"write to private field"),i?i.call(u,e):h.set(u,e),e),c=(u,h,e)=>(fe(u,h,"access private method"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Fe=require("../Store-DRp_K37w.cjs"),B=require("../index-Cqw2NKev.cjs"),$e=require("../easings-GegIwET5.cjs"),ue=require("../events-KVanG9sR.cjs"),ke=require("../jss-BXAMRO12.cjs"),Rt=require("../layout-Ctc2p3uz.cjs"),Re=require("../math-GDWEqu7y.cjs"),Ne=require("../number-0243DApo.cjs");require("../ticker/index.cjs");const ae=require("../order/index.cjs"),Ue=require("../Damped-DbaLw6w1.cjs"),Ge=require("../Tweened-Dm6Avip9.cjs"),ce=require("../controls/index.cjs"),It=require("../window-resizer/index.cjs"),mt=require("../scroll-entries/index.cjs"),ze=require("../css-unit-parser/index.cjs"),S=require("../css-property/index.cjs"),Ze=require("../device/index.cjs"),Qt=require("../element-resizer/index.cjs"),je=require("../gestures-DHLrn6Q8.cjs"),Ie=require("../dom-JBOkFLTh.cjs"),Ke=require("../function-MthRj-GJ.cjs"),Je=require("../scroll-segment/index.cjs");var f,Xt,g,gt,V,X;class Qe{constructor(h,e,i){s(this,f);s(this,Xt);s(this,g);s(this,gt,0);s(this,V,0);s(this,X,null);n(this,f,h),n(this,Xt,e),n(this,g,i),mt.scrollEntries.register(t(this,f))}get index(){return t(this,Xt)}get size(){return t(this,gt)}get position(){return t(this,V)}destroy(){mt.scrollEntries.unregister(t(this,f)),this.unsetTransform()}unsetTransform(){t(this,f).style.transform="",this.mark(null),this.setSize()}setSize(h){h?(t(this,f).style.setProperty("--size",h+"px"),t(this,g).axisCSSProperty.current==="x"?(t(this,f).style.width=h+"px",t(this,f).style.height=""):(t(this,f).style.height=h+"px",t(this,f).style.width="")):(t(this,f).style.width="",t(this,f).style.height="",t(this,f).style.removeProperty("--size"))}resize(){n(this,gt,t(this,g).vertical?t(this,f).offsetHeight:t(this,f).offsetWidth),n(this,V,t(this,g).vertical?Rt.getCumulativeOffsetTop(t(this,f)):Rt.getCumulativeOffsetLeft(t(this,f))),n(this,V,t(this,V)-t(this,g).contentPosition)}transform(){let h=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,gt)<t(this,g).currentScrollValue&&(h=t(this,g).distance*-1-t(this,g).gap),mt.scrollEntries.update(t(this,f),t(this,g).axisCSSProperty.current,h);const i=t(this,g).currentScrollValue+h,r=t(this,V)-t(this,g).viewportSize-e,d=t(this,V)+t(this,gt)+e,b=Re.clamp(i,r,d);t(this,g).vertical?t(this,f).style.transform=`translate3d(0px, ${b*-1}px, 0px)`:t(this,f).style.transform=`translate3d(${b*-1}px, 0px, 0px)`}mark(h){t(this,X)!==h&&(t(this,X)&&t(this,f).classList.remove(t(this,X)),h&&t(this,f).classList.add(h),n(this,X,h),ue.dispatchEvent(t(this,f),"scrollSectionMarkChange",{composed:!0,detail:{mark:t(this,X)},custom:!0}))}}f=new WeakMap,Xt=new WeakMap,g=new WeakMap,gt=new WeakMap,V=new WeakMap,X=new WeakMap;const Xe=ke.createStylesheet({":host":{position:"relative",width:"100%",height:"100%",display:"block",outline:"none"},".static":{position:"var(--static-position, absolute)",top:"var(--static-top, 0)",left:"var(--static-left, 0)",width:"var(--static-width, 100%)",height:"var(--static-height, 100%)"},".content-wrapper":{width:"100%",height:"100%",overflow:"var(--overflow, initial)"},".content":{position:"relative",display:"flex",width:"100%",height:"100%",gap:"var(--gap, 0px)",willChange:"var(--will-change, transform)"},":host(.hibernated) .content-wrapper":{display:"contents"},":host(.hibernated) .content":{display:"contents"},"::slotted(*)":{flexShrink:"0"}});var a,yt,x,Y,_,H,W,T,tt,et,F,st,vt,q,v,Ct,wt,Pt,Et,Tt,I,xt,it,D,rt,$,nt,Lt,ht,ot,lt,p,qt,l,Yt,te,y,m,k,A,ct,M,w,P,Dt,ut,N,U,G,At,at,Z,Mt,O,E,ee,o,me,Jt,kt,de,Se,ge,ye,L,Ot,Te,Bt,se,ve,Ce,ft,pe,ie;class jt extends HTMLElement{constructor(){super();s(this,o);s(this,a,null);s(this,yt,new S.CSSProperty(this,"--controls",!0));s(this,x,new S.CSSProperty(this,"--axis","y"));s(this,Y,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,W,new S.CSSProperty(this,"--split",!1));s(this,T,new S.CSSProperty(this,"--sectional",!1));s(this,tt,new S.CSSProperty(this,"--tween-easing",!1));s(this,et,new S.CSSProperty(this,"--tween-duration",!1));s(this,F,new S.CSSProperty(this,"--auto-size",!1));s(this,st,new S.CSSProperty(this,"--wheel-max-delta",!1));s(this,vt,new S.CSSProperty(this,"--drag-inertion",1));s(this,q,new S.CSSProperty(this,"--sections-in-view",1));s(this,v,new S.CSSProperty(this,"--loop",!1));s(this,Ct,new S.CSSProperty(this,"--damping",20));s(this,wt,new S.CSSProperty(this,"--mass",0));s(this,Pt,new S.CSSProperty(this,"--stiffness",0));s(this,Et,new S.CSSProperty(this,"--mouse-drag",!1));s(this,Tt,new S.CSSProperty(this,"--section-distance-scale",.5));s(this,I,new S.CSSProperty(this,"--autoplay",0));s(this,xt,new S.CSSProperty(this,"--autoplay-pause-duration",0));s(this,it,new S.CSSProperty(this,"--autoplay-user-direction",!1));s(this,D,new S.CSSProperty(this,"--classes",!1));s(this,rt,new S.CSSProperty(this,"--current-index-start-offset",0));s(this,$,new S.CSSProperty(this,"--current-index-end-offset",0));s(this,nt,new S.CSSProperty(this,"--focus-delay",0));s(this,Lt,new S.CSSProperty(this,"--focus-duration",3e3));s(this,ht,new S.CSSProperty(this,"--disabled",!1));s(this,ot,new S.CSSProperty(this,"--hibernate",!1));s(this,lt,null);s(this,p,null);s(this,qt,null);s(this,l,[]);s(this,Yt,0);s(this,te,0);s(this,y,0);s(this,m,0);s(this,k,0);s(this,A,null);s(this,ct,null);s(this,M,null);s(this,w,null);s(this,P,new Fe.Store(0));s(this,Dt,0);s(this,ut,0);s(this,N,!1);s(this,U,!0);s(this,G,!0);s(this,At);s(this,at);s(this,Z,new Ge.Tweened);s(this,Mt,!1);s(this,O,null);s(this,E,!1);s(this,ee,null);s(this,L,()=>{if(t(this,ot).current)return;t(this,a).unlistenAnimationFrame();const e=this.currentScrollValue/t(this,m)||0,i=t(this,P).current;if(n(this,Yt,this.vertical?Rt.getCumulativeOffsetTop(this):Rt.getCumulativeOffsetLeft(this)),n(this,te,this.vertical?Rt.getCumulativeOffsetTop(t(this,p)):Rt.getCumulativeOffsetLeft(t(this,p))),n(this,y,this.vertical?this.offsetHeight:this.offsetWidth),this.vertical?n(this,k,ze.cssUnitParser.parse(getComputedStyle(t(this,p)).rowGap)):n(this,k,ze.cssUnitParser.parse(getComputedStyle(t(this,p)).columnGap)),t(this,F).current&&t(this,l).length){const r=t(this,q).current,d=(t(this,y)-t(this,k)*(r-1))/r;t(this,l).forEach(b=>{b.setSize(d)})}else t(this,l).forEach(r=>{r.setSize()});if(t(this,l).forEach(r=>{r.resize()}),t(this,H).current){n(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",n(this,m,t(this,p).offsetHeight-t(this,y))):(t(this,p).style.width="max-content",t(this,p).style.height="100%",n(this,m,t(this,p).offsetWidth-t(this,y)));if(!t(this,v).current){const r=getComputedStyle(this),d=this.vertical?parseFloat(r.paddingBlockStart)+parseFloat(r.paddingBlockEnd):parseFloat(r.paddingInlineStart)+parseFloat(r.paddingInlineEnd);n(this,m,t(this,m)+d),t(this,a).max=t(this,m)}if(t(this,v).current&&t(this,l).length){const r=t(this,l)[t(this,l).length-1],d=r.position+r.size-t(this,y),b=t(this,m)-d;n(this,ut,r.position+r.size+b)}else n(this,ut,t(this,m));if(t(this,T).current&&t(this,l).length){const r=t(this,l)[i];t(this,a).set(r.position,{equalize:!0})}else t(this,a).set(e*t(this,m),{equalize:!0});n(this,N,(this.vertical?t(this,p).offsetHeight:t(this,p).offsetWidth)>t(this,y)),this.classList.toggle("has-overflow",t(this,N)),t(this,N)?t(this,ht).current||c(this,o,Se).call(this):c(this,o,de).call(this),t(this,Ot).call(this)});s(this,Ot,()=>{if(!t(this,N)||t(this,G)||t(this,U))return;const e=this.currentScrollValue;if(n(this,Dt,Math.max(0,e-t(this,m))),t(this,l).length){for(let i=0;i<t(this,l).length;i++)t(this,l)[i].transform();t(this,P).current=c(this,o,pe).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)`;mt.scrollEntries.update(this,t(this,x).current,e)});s(this,Bt,(e,i)=>{t(this,yt).current&&(c(this,o,ve).call(this,Math.sign(i)||1),t(this,se).call(this,e,i))});s(this,se,(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,Z).unlistenAnimationFrame(),!t(this,I).current&&t(this,nt).current&&(clearInterval(t(this,At)),n(this,At,setTimeout(()=>{const r=t(this,l)[c(this,o,pe).call(this)];r&&this.scrollToSection(r.index,{tween:{duration:t(this,Lt).current,easing:$e.easeInOutExpo}})},t(this,nt).current))),!(e.includes("drag")&&!Ze.device.isTouch&&!t(this,Et).current)){if(t(this,T).current&&e!=="drag"){const r=Math.sign(i);if(t(this,l).length){const d={tween:t(this,tt).current||t(this,et).current?{easing:t(this,tt).current||"easeInOutCubic",duration:t(this,et).current||500}:void 0};t(this,Mt)?this.scrollToSection(t(this,P).current,d):this.shiftSections(r,d)}else t(this,a).shift(r*t(this,y))}else t(this,a).shift(i);n(this,Mt,e==="drag")}});s(this,ie,()=>{n(this,E,!0),this.hibernatedCSSProperty.current||c(this,o,ye).call(this)});if(B.isBrowser){const e=this.attachShadow({mode:"open"});e.adoptedStyleSheets=[Xe];const i=document.createElement("div");i.className="static",i.innerHTML='<slot name="static"></slot>',e.appendChild(i),n(this,lt,document.createElement("div")),t(this,lt).className="content-wrapper",n(this,p,document.createElement("div")),t(this,p).className="content",n(this,qt,document.createElement("slot")),t(this,p).appendChild(t(this,qt)),t(this,lt).appendChild(t(this,p)),e.appendChild(t(this,lt)),n(this,ee,new MutationObserver(r=>{this.tryResplit()}))}}get damped(){return t(this,a)}get controlsCSSProperty(){return t(this,yt)}get axisCSSProperty(){return t(this,x)}get reverseCSSProperty(){return t(this,Y)}get directionCSSProperty(){return t(this,_)}get pagesCSSProperty(){return t(this,H)}get splitCSSProperty(){return t(this,W)}get sectionalCSSProperty(){return t(this,T)}get easingCSSProperty(){return t(this,tt)}get durationCSSProperty(){return t(this,et)}get autoSizeCSSProperty(){return t(this,F)}get wheelMaxDeltaCSSProperty(){return t(this,st)}get dragInertionCSSProperty(){return t(this,vt)}get sectionsInViewCSSProperty(){return t(this,q)}get loopCSSProperty(){return t(this,v)}get dampingCSSProperty(){return t(this,Ct)}get massCSSProperty(){return t(this,wt)}get stiffnessCSSProperty(){return t(this,Pt)}get mouseDragCSSProperty(){return t(this,Et)}get sectionDistanceScaleCSSProperty(){return t(this,Tt)}get autoplayCSSProperty(){return t(this,I)}get autoplayPauseDurationCSSProperty(){return t(this,xt)}get autoplayUserDirectionCSSProperty(){return t(this,it)}get classesCSSProperty(){return t(this,D)}get currentIndexStartOffsetCSSProperty(){return t(this,rt)}get currentIndexEndOffsetCSSProperty(){return t(this,$)}get focusDelayCSSProperty(){return t(this,nt)}get focusDurationCSSProperty(){return t(this,Lt)}get disabledCSSProperty(){return t(this,ht)}get hibernatedCSSProperty(){return t(this,ot)}get currentScrollValue(){return c(this,o,Ce).call(this,"current")}get targetScrollValue(){return c(this,o,Ce).call(this,"target")}get contentWrapperElement(){return t(this,lt)}get contentElement(){return t(this,p)}get sections(){return t(this,l)}get position(){return t(this,Yt)}get contentPosition(){return t(this,te)}get viewportSize(){return t(this,y)}get scrollSize(){return t(this,m)}get gap(){return t(this,k)}get counter(){return t(this,P)}get limit(){return Math.ceil(t(this,l).length-t(this,q).current)}get distance(){return t(this,ut)}get loopDistance(){return t(this,v).current?t(this,ut)+t(this,k):t(this,ut)}get hasOverflow(){return t(this,N)}get overscroll(){return t(this,Dt)}get scrollLine(){return t(this,O)}get vertical(){return t(this,x).current==="y"}get currentProgress(){return this.currentScrollValue/this.loopDistance||0}get targetProgress(){return this.targetScrollValue/this.loopDistance||0}get scrollWidth(){return t(this,x).current==="y"?0:t(this,a).distance}get scrollHeight(){return t(this,x).current==="x"?0:t(this,a).distance}tryResplit(){!t(this,G)&&(t(this,v).current||t(this,W).current||t(this,v).current||t(this,F).current||t(this,T).current)&&c(this,o,Jt).call(this)}onScroll(...e){return t(this,a).subscribe(...e)}offScroll(...e){t(this,a).unsubscribe(...e)}range(e,i,r=0){const d=e-r,b=d+i+r*2;return this.currentProgress<d?0:this.currentProgress>b?1:(this.currentProgress-d)/(b-d)}curve(e,i,r=0){return Math.sin(this.range(e,i,r)*Math.PI)}visible(e,i,r=0){const d=e-r,b=d+i+r*2;return this.currentProgress>=d&&this.currentProgress<=b}scrollToSection(e,i){if(!t(this,l).length)return;const r=t(this,P).current,d=c(this,o,Te).call(this,e),b=t(this,l)[r],C=t(this,l)[d];if(b&&C){let R=0;const be=c(this,o,pe).call(this),Kt=t(this,l)[be],Ve=Kt?this.targetScrollValue-Kt.position:0;t(this,v).current?d===0&&r===t(this,l).length-1?R=t(this,m)+t(this,y)-b.position+t(this,k):d===t(this,l).length-1&&r===0?R=C.position-(t(this,m)+t(this,y)+t(this,k)):R=C.position-b.position:R=C.position-b.position,this.shiftPosition(R-Ve,i)}}shiftSections(e,i){t(this,l).length&&this.scrollToSection(t(this,P).current+e,i)}setPosition(e,i){c(this,o,ve).call(this,Math.sign(e)||1),i!=null&&i.tween?t(this,at)||(t(this,Z).set(t(this,a).current,{equalize:!0}),t(this,Z).set(e,Le({},i.tween)),n(this,at,setTimeout(()=>{n(this,at,void 0)},i.tween.duration||0))):t(this,a).set(e,{equalize:(i==null?void 0:i.behaviour)==="instant"})}shiftPosition(e,i){this.setPosition(t(this,a).target+e,i)}connectedCallback(){mt.scrollEntries.register(this),n(this,a,new Ue.Damped(0,{damping:.01,min:0,order:ae.TICK_ORDER.SCROLL})),this.setAttribute("tabindex","0"),n(this,A,new ce.WheelControls({element:t(this,p)})),t(this,A).changeEvent.subscribe(t(this,Bt)),n(this,ct,new ce.KeyboardControls({element:this})),t(this,ct).changeEvent.subscribe(t(this,Bt)),n(this,M,new ce.DragControls({element:t(this,p)})),t(this,M).changeEvent.subscribe(t(this,Bt)),n(this,w,new ce.AutoplayControls({culling:this})),t(this,w).changeEvent.subscribe(t(this,se)),t(this,x).subscribe(()=>{c(this,o,me).call(this)}),t(this,Y).subscribe(()=>{c(this,o,me).call(this)}),t(this,st).subscribe(e=>{t(this,A).axis=e.current?"max":t(this,x).current}),t(this,vt).subscribe(e=>{t(this,M).inertion=typeof e.current=="number"?e.current:1}),t(this,H).subscribe(()=>{t(this,E)&&t(this,L).call(this)}),t(this,W).subscribe(({current:e})=>{t(this,E)&&(e?c(this,o,Jt).call(this):c(this,o,kt).call(this))}),t(this,T).subscribe(e=>{t(this,A).debounce=e.current,t(this,M).swipe=e.current,t(this,w).interval=e.current,t(this,E)&&(e.current&&!e.previous&&!t(this,l).length?c(this,o,Jt).call(this):!e.current&&e.previous&&t(this,l).length&&c(this,o,kt).call(this))}),t(this,F).subscribe(e=>{t(this,E)&&(t(this,L).call(this),e.current&&!e.previous&&!t(this,l).length?c(this,o,Jt).call(this):!e.current&&e.previous&&t(this,l).length&&c(this,o,kt).call(this))}),t(this,q).subscribe(e=>{t(this,E)&&(t(this,L).call(this),c(this,o,ft).call(this))}),t(this,v).subscribe(e=>{e.current?(t(this,E)&&(t(this,l).length||(t(this,W).current=!0)),t(this,a).max=1/0,t(this,a).min=-1/0):(n(this,Dt,0),t(this,a).max=t(this,m),t(this,a).min=0)}),t(this,Ct).subscribe(e=>{t(this,a).damping=e.current}),t(this,wt).subscribe(e=>{t(this,a).mass=e.current}),t(this,Pt).subscribe(e=>{t(this,a).stiffness=e.current}),t(this,I).subscribe(e=>{t(this,w).speed=e.current,!t(this,U)&&e.current&&!e.previous?t(this,w).connect():!e.current&&e.previous&&t(this,w).disconnect()}),t(this,it).subscribe(e=>{e.current||(t(this,w).direction=1)}),t(this,D).subscribe(e=>{t(this,E)&&c(this,o,ft).call(this)}),t(this,rt).subscribe(e=>{t(this,E)&&t(this,D).current&&c(this,o,ft).call(this)}),t(this,$).subscribe(e=>{t(this,E)&&t(this,D).current&&c(this,o,ft).call(this)}),t(this,a).isRunning.subscribe(e=>{this.classList.toggle("active",e.current)}),t(this,P).subscribe(e=>{t(this,l).length&&c(this,o,ft).call(this)}),t(this,Z).subscribe(e=>{t(this,Z).isRunning.current&&t(this,a).set(e.current,{equalize:!0})}),t(this,ht).subscribe(e=>{e.current&&!e.previous?(this.classList.add("disabled"),c(this,o,de).call(this)):!e.current&&e.previous&&(this.classList.remove("disabled"),c(this,o,Se).call(this))}),t(this,ot).subscribe(e=>{e.current&&!e.previous?(this.classList.add("hibernated"),c(this,o,ge).call(this)):!e.current&&e.previous&&(this.classList.remove("hibernated"),c(this,o,ye).call(this))}),t(this,yt).observe(),t(this,x).observe(),t(this,Y).observe(),t(this,_).observe(),t(this,H).observe(),t(this,W).observe(),t(this,T).observe(),t(this,tt).observe(),t(this,et).observe(),t(this,F).observe(),t(this,st).observe(),t(this,vt).observe(),t(this,q).observe(),t(this,v).observe(),t(this,Ct).observe(),t(this,wt).observe(),t(this,Pt).observe(),t(this,Et).observe(),t(this,Tt).observe(),t(this,I).observe(),t(this,I).observe(),t(this,xt).observe(),t(this,it).observe(),t(this,D).observe(),t(this,rt).observe(),t(this,$).observe(),t(this,nt).observe(),t(this,Lt).observe(),t(this,ht).observe(),t(this,ot).observe(),It.windowResizer.subscribe(t(this,ie),ae.RESIZE_ORDER.LAST)}disconnectedCallback(){this.removeAttribute("tabindex"),this.classList.remove("disabled"),this.classList.remove("hibernated"),t(this,yt).unobserve(),t(this,x).unobserve(),t(this,Y).unobserve(),t(this,_).unobserve(),t(this,H).unobserve(),t(this,W).unobserve(),t(this,T).unobserve(),t(this,tt).unobserve(),t(this,et).unobserve(),t(this,F).unobserve(),t(this,st).unobserve(),t(this,vt).unobserve(),t(this,q).unobserve(),t(this,v).unobserve(),t(this,Ct).unobserve(),t(this,wt).unobserve(),t(this,Pt).unobserve(),t(this,Et).unobserve(),t(this,Tt).unobserve(),t(this,I).unobserve(),t(this,xt).unobserve(),t(this,it).unobserve(),t(this,D).unobserve(),t(this,rt).unobserve(),t(this,$).unobserve(),t(this,nt).unobserve(),t(this,Lt).unobserve(),t(this,ht).unobserve(),t(this,ot).unobserve(),It.windowResizer.unsubscribe(t(this,ie)),c(this,o,ge).call(this),t(this,ee).disconnect()}}a=new WeakMap,yt=new WeakMap,x=new WeakMap,Y=new WeakMap,_=new WeakMap,H=new WeakMap,W=new WeakMap,T=new WeakMap,tt=new WeakMap,et=new WeakMap,F=new WeakMap,st=new WeakMap,vt=new WeakMap,q=new WeakMap,v=new WeakMap,Ct=new WeakMap,wt=new WeakMap,Pt=new WeakMap,Et=new WeakMap,Tt=new WeakMap,I=new WeakMap,xt=new WeakMap,it=new WeakMap,D=new WeakMap,rt=new WeakMap,$=new WeakMap,nt=new WeakMap,Lt=new WeakMap,ht=new WeakMap,ot=new WeakMap,lt=new WeakMap,p=new WeakMap,qt=new WeakMap,l=new WeakMap,Yt=new WeakMap,te=new WeakMap,y=new WeakMap,m=new WeakMap,k=new WeakMap,A=new WeakMap,ct=new WeakMap,M=new WeakMap,w=new WeakMap,P=new WeakMap,Dt=new WeakMap,ut=new WeakMap,N=new WeakMap,U=new WeakMap,G=new WeakMap,At=new WeakMap,at=new WeakMap,Z=new WeakMap,Mt=new WeakMap,O=new WeakMap,E=new WeakMap,ee=new WeakMap,o=new WeakSet,me=function(){const e=t(this,x).current,i=t(this,Y).current?"-reverse":"";t(this,p).style.flexDirection=e==="x"?`row${i}`:`column${i}`,t(this,A).axis=t(this,st).current?"max":e,t(this,ct).dimension=e==="x"?"width":"height",t(this,M).axis=e,e==="x"?this.style.touchAction="pan-y":e==="y"&&(this.style.touchAction="pan-x"),t(this,E)&&t(this,L).call(this)},Jt=function(){c(this,o,kt).call(this),t(this,qt).assignedElements().forEach((e,i)=>{e instanceof HTMLElement&&t(this,l).push(new Qe(e,i,this))}),t(this,p).style.transform="",ue.dispatchEvent(this,"scrollSectionsChange",{custom:!0,composed:!0}),t(this,L).call(this),c(this,o,ft).call(this)},kt=function(){t(this,l).forEach(e=>{e.destroy()}),n(this,l,[]),t(this,P).reset(),t(this,a).reset(),ue.dispatchEvent(this,"scrollSectionsChange",{custom:!0,composed:!0})},de=function(){t(this,U)||(n(this,U,!0),t(this,a).unsubscribe(t(this,Ot)),t(this,a).unlistenAnimationFrame(),clearInterval(t(this,At)),clearInterval(t(this,at)),t(this,Z).unlistenAnimationFrame(),t(this,A).disconnect(),t(this,ct).disconnect(),t(this,M).disconnect(),t(this,w).disconnect(),t(this,N)||(this.sections.forEach(e=>{e.unsetTransform()}),t(this,L).call(this)))},Se=function(){t(this,U)&&(n(this,U,!1),t(this,a).subscribe(t(this,Ot)),t(this,A).connect(),t(this,ct).connect(),t(this,M).connect(),t(this,I).current&&t(this,w).connect())},ge=function(){t(this,G)||(n(this,G,!0),It.windowResizer.unsubscribe(t(this,L)),Qt.elementResizer.unsubscribe(t(this,L)),c(this,o,de).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,l).length?c(this,o,kt).call(this):(t(this,P).reset(),t(this,a).reset()),mt.scrollEntries.unregister(this))},ye=function(){t(this,G)&&(n(this,G,!1),mt.scrollEntries.register(this),this.tryResplit(),c(this,o,Se).call(this),It.windowResizer.subscribe(t(this,L),ae.RESIZE_ORDER.SCROLL),Qt.elementResizer.subscribe(this,t(this,L)))},L=new WeakMap,Ot=new WeakMap,Te=function(e){let i=t(this,P).current;return t(this,v).current?i=Ne.loopNumber(e,t(this,l).length):i=Re.clamp(e,0,this.limit),i},Bt=new WeakMap,se=new WeakMap,ve=function(e=1){t(this,it).current&&(t(this,w).direction=e),t(this,I).current&&t(this,w).pauseAndContinue(t(this,xt).current,this.sectionalCSSProperty.current)},Ce=function(e="current"){if(t(this,v).current&&t(this,l).length){const i=t(this,a)[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,a)[e]},ft=function(){if(t(this,l).length){const e=t(this,P).current+t(this,rt).current;if(e===0?n(this,O,"start"):e===this.limit?n(this,O,"end"):n(this,O,null),ue.dispatchEvent(this,"scrollLine",{detail:{line:t(this,O)}}),t(this,D).current){this.classList.remove("end","start"),t(this,O)&&this.classList.add(t(this,O));const i=t(this,q).current+t(this,$).current;t(this,l).forEach((r,d)=>{const b=e-this.limit-1+t(this,$).current,C=e+i,R=this.sections.length-C;d>=e&&d<C||d<=b?r.mark("current"):d>=C&&d<C+R/2||d<=b+i?r.mark("next"):r.mark("previous")})}}},pe=function(){let e=this.targetScrollValue,i=1/0,r=0;const d=t(this,a).direction;for(let b=0;b<t(this,l).length;b++){const C=t(this,l)[b];let R=t(this,Mt)?C.size*d*-1*.4:0,be=C.position;const Kt=Math.abs(be+R-e);Kt<i&&(i=Kt,r=b)}return r},ie=new WeakMap;B.isBrowser&&!customElements.get("e-scroll")&&customElements.define("e-scroll",jt);var re;class we extends HTMLElement{constructor(){super(...arguments);s(this,re,null)}get scrollElement(){return t(this,re)}connectedCallback(){const e=Ie.findParentElement(this,jt);e instanceof jt?n(this,re,e):console.error(this,"e-scroll not found")}}re=new WeakMap;var dt,z,j,K,Vt,_t,St,Ht,ne,he;class qe extends we{constructor(){super();s(this,dt,null);s(this,z,null);s(this,j,!1);s(this,K,0);s(this,Vt,0);s(this,_t,0);s(this,St,()=>{n(this,j,this.offsetWidth>this.offsetHeight);const e=t(this,j)?this.offsetWidth:this.offsetHeight;n(this,K,e/((this.scrollElement.scrollSize+this.scrollElement.viewportSize)/e)),n(this,K,Math.max(t(this,K),30)),t(this,j)?(t(this,z).style.width=t(this,K)+"px",t(this,z).style.height="100%"):(t(this,z).style.width="100%",t(this,z).style.height=t(this,K)+"px"),n(this,Vt,e-t(this,K)),this.scrollElement.scrollSize<=0?this.style.display="none":this.style.display="",t(this,Ht).call(this)});s(this,Ht,()=>{n(this,_t,this.scrollElement.currentProgress*t(this,Vt)),t(this,j)?t(this,z).style.transform=`translate3d(${t(this,_t)}px, 0px, 0px)`:t(this,z).style.transform=`translate3d(0px, ${t(this,_t)}px, 0px)`});s(this,ne,()=>{this.setAttribute("axis",this.scrollElement.axisCSSProperty.current)});s(this,he,e=>{document.documentElement.classList.add("grabbing"),je.setupDrag(d=>{const b=t(this,j)?d.x:d.y,C=this.scrollElement.distance/t(this,Vt),R=(b-r)*C;this.scrollElement.setPosition(i+R)},()=>{document.documentElement.classList.remove("grabbing")});const i=this.scrollElement.damped.target,r=t(this,j)?e.x:e.y});if(B.isBrowser){const e=this.attachShadow({mode:"open"});e.adoptedStyleSheets=[ke.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"}})],n(this,dt,document.createElement("slot")),t(this,dt).innerHTML='<div class="default-thumb"></div>',e.appendChild(t(this,dt))}}get thumbElement(){return t(this,z)}connectedCallback(){super.connectedCallback(),this.setAttribute("drag-dead-zone","");const e=t(this,dt).assignedElements()[0]||t(this,dt).firstElementChild;n(this,z,e),t(this,z).addEventListener("pointerdown",t(this,he)),It.windowResizer.subscribe(t(this,St),ae.RESIZE_ORDER.SCROLL),Qt.elementResizer.subscribe(this,t(this,St)),Qt.elementResizer.subscribe(this.scrollElement,t(this,St)),this.scrollElement.onScroll(t(this,Ht)),this.scrollElement.axisCSSProperty.subscribe(t(this,ne))}disconnectedCallback(){this.removeAttribute("drag-dead-zone"),this.style.display="",t(this,z).removeEventListener("pointerdown",t(this,he)),It.windowResizer.unsubscribe(t(this,St)),Qt.elementResizer.unsubscribe(t(this,St)),this.scrollElement.offScroll(t(this,Ht)),this.scrollElement.axisCSSProperty.unsubscribe(t(this,ne))}}dt=new WeakMap,z=new WeakMap,j=new WeakMap,K=new WeakMap,Vt=new WeakMap,_t=new WeakMap,St=new WeakMap,Ht=new WeakMap,ne=new WeakMap,he=new WeakMap;B.isBrowser&&!customElements.get("e-scrollbar")&&customElements.define("e-scrollbar",qe);var Wt,Ft,$t;class De extends we{constructor(){super();s(this,Wt,new S.CSSProperty(this,"--behaviour","smooth"));s(this,Ft,new S.CSSProperty(this,"--tween-easing",!1));s(this,$t,new S.CSSProperty(this,"--tween-duration",0));B.isBrowser&&this.addEventListener("click",()=>{const e=t(this,Wt).current,i=t(this,Ft).current,r=t(this,$t).current;this.handleClick({behaviour:e,tween:i||r?{easing:i,duration:r}:void 0})})}connectedCallback(){super.connectedCallback(),t(this,Wt).observe(),t(this,Ft).observe(),t(this,$t).observe()}disconnectedCallback(){t(this,Wt).close(),t(this,Ft).close(),t(this,$t).close()}}Wt=new WeakMap,Ft=new WeakMap,$t=new WeakMap;var Nt;class Ae extends De{constructor(){super(...arguments);s(this,Nt,new S.CSSProperty(this,"--set",1))}handleClick(e){this.scrollElement.scrollToSection(t(this,Nt).current,e)}connectedCallback(){super.connectedCallback(),t(this,Nt).observe()}disconnectedCallback(){super.disconnectedCallback(),t(this,Nt).close()}}Nt=new WeakMap;B.isBrowser&&!customElements.get("e-scroll-set-button")&&customElements.define("e-scroll-set-button",Ae);var J,Ut;class Me extends De{constructor(){super(...arguments);s(this,J,new S.CSSProperty(this,"--step",1));s(this,Ut,()=>{this.scrollElement.loopCSSProperty.current?this.removeAttribute("disabled"):t(this,J).current>0&&this.scrollElement.scrollLine==="end"||t(this,J).current<0&&this.scrollElement.scrollLine==="start"?this.setAttribute("disabled",""):this.removeAttribute("disabled")})}handleClick(e){this.scrollElement.shiftSections(t(this,J).current,e)}connectedCallback(){super.connectedCallback(),this.scrollElement&&(t(this,J).subscribe(()=>{t(this,Ut).call(this)}),t(this,J).observe(),this.scrollElement.addEventListener("scrollLine",t(this,Ut)),t(this,Ut).call(this))}disconnectedCallback(){super.disconnectedCallback(),t(this,J).close(),this.removeAttribute("disabled")}}J=new WeakMap,Ut=new WeakMap;B.isBrowser&&!customElements.get("e-scroll-step-button")&&customElements.define("e-scroll-step-button",Me);var Q,pt,Gt,oe,le,Zt;class Ye{constructor(h,e,i){s(this,Q,null);s(this,pt,null);s(this,Gt,null);s(this,oe,null);s(this,le,()=>{t(this,pt).scrollToSection(t(this,Gt),{behaviour:t(this,oe)})});s(this,Zt,()=>{t(this,Q).classList.toggle("current",t(this,pt).counter.current===t(this,Gt))});B.isBrowser&&(n(this,Q,document.createElement("button")),n(this,pt,h),n(this,oe,i),n(this,Gt,e),t(this,Q).addEventListener("click",t(this,le)),t(this,pt).counter.subscribe(t(this,Zt)),t(this,Zt).call(this))}get element(){return t(this,Q)}destroy(){t(this,Q).removeEventListener("click",t(this,le)),t(this,pt).counter.unsubscribe(t(this,Zt)),t(this,Q).remove()}}Q=new WeakMap,pt=new WeakMap,Gt=new WeakMap,oe=new WeakMap,le=new WeakMap,Zt=new WeakMap;var bt,zt;class Oe extends we{constructor(){super(...arguments);s(this,bt,[]);s(this,zt,Ke.debounce(()=>{t(this,bt).forEach(i=>i.destroy()),n(this,bt,[]);const e=this.scrollElement.sections.length-Math.max(this.scrollElement.sectionsInViewCSSProperty.current-1,0);for(let i=0;i<e;i++){const r=new Ye(this.scrollElement,i,this.getAttribute("behaviour")||"smooth");this.appendChild(r.element),t(this,bt).push(r)}},0))}connectedCallback(){super.connectedCallback(),this.scrollElement.addEventListener("sectionsChange",t(this,zt)),this.scrollElement.sectionsInViewCSSProperty.subscribe(t(this,zt))}disconnectedCallback(){this.scrollElement.removeEventListener("sectionsChange",t(this,zt)),this.scrollElement.sectionsInViewCSSProperty.unsubscribe(t(this,zt)),t(this,bt).forEach(e=>e.destroy()),n(this,bt,[])}}bt=new WeakMap,zt=new WeakMap;B.isBrowser&&!customElements.get("e-scroll-bullet-buttons")&&customElements.define("e-scroll-bullet-buttons",Oe);class Be extends Je.ScrollSegmentElement{connectedCallback(){const h=Ie.findParentElement(this,jt);h instanceof jt?(this.scrollContainer=h,this.scrollContainer.addEventListener("scrollSectionsChange",this.findAnotherScrollEntries)):console.error(this,"e-scroll not found")}}B.isBrowser&&!customElements.get("e-scroll-segment")&&customElements.define("e-scroll-segment",Be);exports.ScrollBulletButtonsElement=Oe;exports.ScrollElement=jt;exports.ScrollSegmentElement=Be;exports.ScrollSetButtonElement=Ae;exports.ScrollStepButtonElement=Me;exports.ScrollbarElement=qe;
|
package/lib/scroll/index.js
CHANGED
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
1
|
+
var Ve = Object.defineProperty;
|
|
2
|
+
var Ee = Object.getOwnPropertySymbols;
|
|
3
|
+
var Oe = Object.prototype.hasOwnProperty, Re = Object.prototype.propertyIsEnumerable;
|
|
4
|
+
var xe = (a) => {
|
|
5
5
|
throw TypeError(a);
|
|
6
6
|
};
|
|
7
|
-
var
|
|
7
|
+
var Pe = (a, h, e) => h in a ? Ve(a, h, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[h] = e, Le = (a, h) => {
|
|
8
8
|
for (var e in h || (h = {}))
|
|
9
|
-
|
|
10
|
-
if (
|
|
11
|
-
for (var e of
|
|
12
|
-
|
|
9
|
+
Oe.call(h, e) && Pe(a, e, h[e]);
|
|
10
|
+
if (Ee)
|
|
11
|
+
for (var e of Ee(h))
|
|
12
|
+
Re.call(h, e) && Pe(a, e, h[e]);
|
|
13
13
|
return a;
|
|
14
14
|
};
|
|
15
|
-
var
|
|
16
|
-
var t = (a, h, e) => (
|
|
17
|
-
import { S as
|
|
15
|
+
var pe = (a, h, e) => h.has(a) || xe("Cannot " + e);
|
|
16
|
+
var t = (a, h, e) => (pe(a, h, "read from private field"), e ? e.call(a) : h.get(a)), s = (a, h, e) => h.has(a) ? xe("Cannot add the same private member more than once") : h instanceof WeakSet ? h.add(a) : h.set(a, e), n = (a, h, e, i) => (pe(a, h, "write to private field"), i ? i.call(a, e) : h.set(a, e), e), c = (a, h, e) => (pe(a, h, "access private method"), e);
|
|
17
|
+
import { S as He } 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 Be } from "../easings-Bni3YAAW.js";
|
|
20
|
+
import { d as le } from "../events-CsVF98U6.js";
|
|
21
|
+
import { c as ze } from "../jss-Chm3yE5y.js";
|
|
22
|
+
import { a as fe, g as me } from "../layout-DpZo-I0y.js";
|
|
23
|
+
import { c as Ie } from "../math-BOBiC4TN.js";
|
|
24
|
+
import { l as We } 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 Fe, RESIZE_ORDER as be } from "../order/index.js";
|
|
27
|
+
import { D as $e } from "../Damped-CucKOQsI.js";
|
|
28
|
+
import { T as Ne } from "../Tweened-CcPeZ0UE.js";
|
|
29
|
+
import { WheelControls as qe, KeyboardControls as Ue, DragControls as Ge, AutoplayControls as Ke } from "../controls/index.js";
|
|
30
30
|
import { windowResizer as It } from "../window-resizer/index.js";
|
|
31
31
|
import { scrollEntries as St } from "../scroll-entries/index.js";
|
|
32
|
-
import { cssUnitParser as
|
|
32
|
+
import { cssUnitParser as ke } from "../css-unit-parser/index.js";
|
|
33
33
|
import { CSSProperty as p } from "../css-property/index.js";
|
|
34
|
-
import { device as
|
|
34
|
+
import { device as _e } from "../device/index.js";
|
|
35
35
|
import { elementResizer as jt } from "../element-resizer/index.js";
|
|
36
|
-
import { s as
|
|
37
|
-
import { b as
|
|
38
|
-
import { d as
|
|
39
|
-
import { ScrollSegmentElement as
|
|
40
|
-
var b, Qt, g, gt, B,
|
|
41
|
-
class
|
|
36
|
+
import { s as Ze } from "../gestures-D2Fdra_G.js";
|
|
37
|
+
import { b as Te } from "../dom-CVWzyXPH.js";
|
|
38
|
+
import { d as je } from "../function-C10DGppn.js";
|
|
39
|
+
import { ScrollSegmentElement as Je } from "../scroll-segment/index.js";
|
|
40
|
+
var b, Qt, g, gt, B, X;
|
|
41
|
+
class Qe {
|
|
42
42
|
constructor(h, e, i) {
|
|
43
43
|
s(this, b);
|
|
44
44
|
s(this, Qt);
|
|
45
45
|
s(this, g);
|
|
46
46
|
s(this, gt, 0);
|
|
47
47
|
s(this, B, 0);
|
|
48
|
-
s(this,
|
|
48
|
+
s(this, X, null);
|
|
49
49
|
n(this, b, h), n(this, Qt, e), n(this, g, i), St.register(t(this, b));
|
|
50
50
|
}
|
|
51
51
|
get index() {
|
|
@@ -67,7 +67,7 @@ class Je {
|
|
|
67
67
|
h ? (t(this, b).style.setProperty("--size", h + "px"), t(this, g).axisCSSProperty.current === "x" ? (t(this, b).style.width = h + "px", t(this, b).style.height = "") : (t(this, b).style.height = h + "px", t(this, b).style.width = "")) : (t(this, b).style.width = "", t(this, b).style.height = "", t(this, b).style.removeProperty("--size"));
|
|
68
68
|
}
|
|
69
69
|
resize() {
|
|
70
|
-
n(this, gt, t(this, g).vertical ? t(this, b).offsetHeight : t(this, b).offsetWidth), n(this, B, t(this, g).vertical ?
|
|
70
|
+
n(this, gt, t(this, g).vertical ? t(this, b).offsetHeight : t(this, b).offsetWidth), n(this, B, t(this, g).vertical ? fe(t(this, b)) : me(t(this, b))), n(this, B, t(this, B) - t(this, g).contentPosition);
|
|
71
71
|
}
|
|
72
72
|
transform() {
|
|
73
73
|
let h = 0;
|
|
@@ -77,21 +77,21 @@ class Je {
|
|
|
77
77
|
t(this, g).axisCSSProperty.current,
|
|
78
78
|
h
|
|
79
79
|
);
|
|
80
|
-
const i = t(this, g).currentScrollValue + h, r = t(this, B) - t(this, g).viewportSize - e, d = t(this, B) + t(this, gt) + e, m =
|
|
80
|
+
const i = t(this, g).currentScrollValue + h, r = t(this, B) - t(this, g).viewportSize - e, d = t(this, B) + t(this, gt) + e, m = Ie(i, r, d);
|
|
81
81
|
t(this, g).vertical ? t(this, b).style.transform = `translate3d(0px, ${m * -1}px, 0px)` : t(this, b).style.transform = `translate3d(${m * -1}px, 0px, 0px)`;
|
|
82
82
|
}
|
|
83
83
|
mark(h) {
|
|
84
|
-
t(this,
|
|
84
|
+
t(this, X) !== h && (t(this, X) && t(this, b).classList.remove(t(this, X)), h && t(this, b).classList.add(h), n(this, X, h), le(t(this, b), "scrollSectionMarkChange", {
|
|
85
85
|
composed: !0,
|
|
86
86
|
detail: {
|
|
87
|
-
mark: t(this,
|
|
87
|
+
mark: t(this, X)
|
|
88
88
|
},
|
|
89
89
|
custom: !0
|
|
90
90
|
}));
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
|
-
b = new WeakMap(), Qt = new WeakMap(), g = new WeakMap(), gt = new WeakMap(), B = new WeakMap(),
|
|
94
|
-
const
|
|
93
|
+
b = new WeakMap(), Qt = new WeakMap(), g = new WeakMap(), gt = new WeakMap(), B = new WeakMap(), X = new WeakMap();
|
|
94
|
+
const Xe = ze({
|
|
95
95
|
":host": {
|
|
96
96
|
position: "relative",
|
|
97
97
|
width: "100%",
|
|
@@ -129,7 +129,7 @@ const Qe = ke({
|
|
|
129
129
|
flexShrink: "0"
|
|
130
130
|
}
|
|
131
131
|
});
|
|
132
|
-
var u, vt, x,
|
|
132
|
+
var u, vt, x, Y, W, F, $, A, tt, et, N, st, yt, D, y, Ct, wt, Et, Pt, Tt, T, xt, it, M, rt, q, nt, Lt, ht, ot, lt, f, At, l, Xt, Yt, v, S, z, V, ct, O, w, E, Dt, at, U, G, K, Mt, ut, _, Vt, R, P, te, o, Se, Zt, zt, ce, ae, ge, ve, L, Ot, Ae, Rt, ee, ye, Ce, bt, ue, se;
|
|
133
133
|
class Jt extends HTMLElement {
|
|
134
134
|
constructor() {
|
|
135
135
|
super();
|
|
@@ -137,25 +137,25 @@ class Jt extends HTMLElement {
|
|
|
137
137
|
s(this, u, null);
|
|
138
138
|
s(this, vt, new p(this, "--controls", !0));
|
|
139
139
|
s(this, x, new p(this, "--axis", "y"));
|
|
140
|
-
s(this,
|
|
140
|
+
s(this, Y, new p(this, "--reverse", !1));
|
|
141
141
|
s(this, W, new p(this, "--direction", 0));
|
|
142
142
|
s(this, F, new p(this, "--pages", 0, {
|
|
143
143
|
validate: (e) => Math.max(0, e - 1)
|
|
144
144
|
}));
|
|
145
145
|
s(this, $, new p(this, "--split", !1));
|
|
146
146
|
s(this, A, new p(this, "--sectional", !1));
|
|
147
|
-
s(this,
|
|
147
|
+
s(this, tt, new p(
|
|
148
148
|
this,
|
|
149
149
|
"--tween-easing",
|
|
150
150
|
!1
|
|
151
151
|
));
|
|
152
|
-
s(this,
|
|
152
|
+
s(this, et, new p(
|
|
153
153
|
this,
|
|
154
154
|
"--tween-duration",
|
|
155
155
|
!1
|
|
156
156
|
));
|
|
157
157
|
s(this, N, new p(this, "--auto-size", !1));
|
|
158
|
-
s(this,
|
|
158
|
+
s(this, st, new p(
|
|
159
159
|
this,
|
|
160
160
|
"--wheel-max-delta",
|
|
161
161
|
!1
|
|
@@ -182,13 +182,13 @@ class Jt extends HTMLElement {
|
|
|
182
182
|
"--autoplay-pause-duration",
|
|
183
183
|
0
|
|
184
184
|
));
|
|
185
|
-
s(this,
|
|
185
|
+
s(this, it, new p(
|
|
186
186
|
this,
|
|
187
187
|
"--autoplay-user-direction",
|
|
188
188
|
!1
|
|
189
189
|
));
|
|
190
190
|
s(this, M, new p(this, "--classes", !1));
|
|
191
|
-
s(this,
|
|
191
|
+
s(this, rt, new p(
|
|
192
192
|
this,
|
|
193
193
|
"--current-index-start-offset",
|
|
194
194
|
0
|
|
@@ -198,15 +198,15 @@ class Jt extends HTMLElement {
|
|
|
198
198
|
"--current-index-end-offset",
|
|
199
199
|
0
|
|
200
200
|
));
|
|
201
|
-
s(this,
|
|
201
|
+
s(this, nt, new p(this, "--focus-delay", 0));
|
|
202
202
|
s(this, Lt, new p(
|
|
203
203
|
this,
|
|
204
204
|
"--focus-duration",
|
|
205
205
|
3e3
|
|
206
206
|
));
|
|
207
|
-
s(this,
|
|
208
|
-
s(this,
|
|
209
|
-
s(this,
|
|
207
|
+
s(this, ht, new p(this, "--disabled", !1));
|
|
208
|
+
s(this, ot, new p(this, "--hibernate", !1));
|
|
209
|
+
s(this, lt, null);
|
|
210
210
|
s(this, f, null);
|
|
211
211
|
s(this, At, null);
|
|
212
212
|
s(this, l, []);
|
|
@@ -216,29 +216,30 @@ class Jt extends HTMLElement {
|
|
|
216
216
|
s(this, S, 0);
|
|
217
217
|
s(this, z, 0);
|
|
218
218
|
s(this, V, null);
|
|
219
|
-
s(this,
|
|
219
|
+
s(this, ct, null);
|
|
220
220
|
s(this, O, null);
|
|
221
221
|
s(this, w, null);
|
|
222
|
-
s(this, E, new
|
|
222
|
+
s(this, E, new He(0));
|
|
223
223
|
s(this, Dt, 0);
|
|
224
|
-
s(this,
|
|
224
|
+
s(this, at, 0);
|
|
225
225
|
s(this, U, !1);
|
|
226
226
|
s(this, G, !0);
|
|
227
|
-
s(this,
|
|
227
|
+
s(this, K, !0);
|
|
228
228
|
s(this, Mt);
|
|
229
229
|
s(this, ut);
|
|
230
|
-
s(this,
|
|
230
|
+
s(this, _, new Ne());
|
|
231
231
|
s(this, Vt, !1);
|
|
232
232
|
s(this, R, null);
|
|
233
233
|
s(this, P, !1);
|
|
234
|
+
s(this, te, null);
|
|
234
235
|
s(this, L, () => {
|
|
235
|
-
if (t(this,
|
|
236
|
+
if (t(this, ot).current)
|
|
236
237
|
return;
|
|
237
238
|
t(this, u).unlistenAnimationFrame();
|
|
238
239
|
const e = this.currentScrollValue / t(this, S) || 0, i = t(this, E).current;
|
|
239
|
-
if (n(this, Xt, this.vertical ?
|
|
240
|
+
if (n(this, Xt, this.vertical ? fe(this) : me(this)), n(this, Yt, this.vertical ? fe(t(this, f)) : me(t(this, f))), n(this, v, this.vertical ? this.offsetHeight : this.offsetWidth), this.vertical ? n(this, z, ke.parse(
|
|
240
241
|
getComputedStyle(t(this, f)).rowGap
|
|
241
|
-
)) : n(this, z,
|
|
242
|
+
)) : n(this, z, ke.parse(
|
|
242
243
|
getComputedStyle(t(this, f)).columnGap
|
|
243
244
|
)), t(this, N).current && t(this, l).length) {
|
|
244
245
|
const r = t(this, D).current, d = (t(this, v) - t(this, z) * (r - 1)) / r;
|
|
@@ -263,9 +264,9 @@ class Jt extends HTMLElement {
|
|
|
263
264
|
}
|
|
264
265
|
if (t(this, y).current && t(this, l).length) {
|
|
265
266
|
const r = t(this, l)[t(this, l).length - 1], d = r.position + r.size - t(this, v), m = t(this, S) - d;
|
|
266
|
-
n(this,
|
|
267
|
+
n(this, at, r.position + r.size + m);
|
|
267
268
|
} else
|
|
268
|
-
n(this,
|
|
269
|
+
n(this, at, t(this, S));
|
|
269
270
|
if (t(this, A).current && t(this, l).length) {
|
|
270
271
|
const r = t(this, l)[i];
|
|
271
272
|
t(this, u).set(r.position, {
|
|
@@ -275,16 +276,16 @@ class Jt extends HTMLElement {
|
|
|
275
276
|
t(this, u).set(e * t(this, S), {
|
|
276
277
|
equalize: !0
|
|
277
278
|
});
|
|
278
|
-
n(this, U, (this.vertical ? t(this, f).offsetHeight : t(this, f).offsetWidth) > t(this, v)), this.classList.toggle("has-overflow", t(this, U)), t(this, U) ? t(this,
|
|
279
|
+
n(this, U, (this.vertical ? t(this, f).offsetHeight : t(this, f).offsetWidth) > t(this, v)), this.classList.toggle("has-overflow", t(this, U)), t(this, U) ? t(this, ht).current || c(this, o, ae).call(this) : c(this, o, ce).call(this), t(this, Ot).call(this);
|
|
279
280
|
});
|
|
280
281
|
s(this, Ot, () => {
|
|
281
|
-
if (!t(this, U) || t(this,
|
|
282
|
+
if (!t(this, U) || t(this, K) || t(this, G))
|
|
282
283
|
return;
|
|
283
284
|
const e = this.currentScrollValue;
|
|
284
285
|
if (n(this, Dt, Math.max(0, e - t(this, S))), t(this, l).length) {
|
|
285
286
|
for (let i = 0; i < t(this, l).length; i++)
|
|
286
287
|
t(this, l)[i].transform();
|
|
287
|
-
t(this, E).current = c(this, o,
|
|
288
|
+
t(this, E).current = c(this, o, ue).call(this);
|
|
288
289
|
} else
|
|
289
290
|
this.vertical ? t(this, f).style.transform = `translate3d(0px, ${e * -1}px, 0px)` : t(this, f).style.transform = `translate3d(${e * -1}px, 0px, 0px)`;
|
|
290
291
|
St.update(
|
|
@@ -294,31 +295,31 @@ class Jt extends HTMLElement {
|
|
|
294
295
|
);
|
|
295
296
|
});
|
|
296
297
|
s(this, Rt, (e, i) => {
|
|
297
|
-
t(this, vt).current && (c(this, o,
|
|
298
|
+
t(this, vt).current && (c(this, o, ye).call(this, Math.sign(i) || 1), t(this, ee).call(this, e, i));
|
|
298
299
|
});
|
|
299
|
-
s(this,
|
|
300
|
+
s(this, ee, (e, i) => {
|
|
300
301
|
if (t(this, W).current) {
|
|
301
302
|
if (t(this, W).current < 0 && i > 0)
|
|
302
303
|
return;
|
|
303
304
|
if (t(this, W).current > 0 && i < 0)
|
|
304
305
|
return;
|
|
305
306
|
}
|
|
306
|
-
if (t(this, ut) || t(this,
|
|
307
|
-
const r = t(this, l)[c(this, o,
|
|
307
|
+
if (t(this, ut) || t(this, _).unlistenAnimationFrame(), !t(this, T).current && t(this, nt).current && (clearInterval(t(this, Mt)), n(this, Mt, setTimeout(() => {
|
|
308
|
+
const r = t(this, l)[c(this, o, ue).call(this)];
|
|
308
309
|
r && this.scrollToSection(r.index, {
|
|
309
310
|
tween: {
|
|
310
311
|
duration: t(this, Lt).current,
|
|
311
|
-
easing:
|
|
312
|
+
easing: Be
|
|
312
313
|
}
|
|
313
314
|
});
|
|
314
|
-
}, t(this,
|
|
315
|
+
}, t(this, nt).current))), !(e.includes("drag") && !_e.isTouch && !t(this, Pt).current)) {
|
|
315
316
|
if (t(this, A).current && e !== "drag") {
|
|
316
317
|
const r = Math.sign(i);
|
|
317
318
|
if (t(this, l).length) {
|
|
318
319
|
const d = {
|
|
319
|
-
tween: t(this,
|
|
320
|
-
easing: t(this,
|
|
321
|
-
duration: t(this,
|
|
320
|
+
tween: t(this, tt).current || t(this, et).current ? {
|
|
321
|
+
easing: t(this, tt).current || "easeInOutCubic",
|
|
322
|
+
duration: t(this, et).current || 500
|
|
322
323
|
} : void 0
|
|
323
324
|
};
|
|
324
325
|
t(this, Vt) ? this.scrollToSection(t(this, E).current, d) : this.shiftSections(r, d);
|
|
@@ -329,14 +330,16 @@ class Jt extends HTMLElement {
|
|
|
329
330
|
n(this, Vt, e === "drag");
|
|
330
331
|
}
|
|
331
332
|
});
|
|
332
|
-
s(this,
|
|
333
|
-
n(this, P, !0), this.hibernatedCSSProperty.current || c(this, o,
|
|
333
|
+
s(this, se, () => {
|
|
334
|
+
n(this, P, !0), this.hibernatedCSSProperty.current || c(this, o, ve).call(this);
|
|
334
335
|
});
|
|
335
336
|
if (H) {
|
|
336
337
|
const e = this.attachShadow({ mode: "open" });
|
|
337
|
-
e.adoptedStyleSheets = [
|
|
338
|
+
e.adoptedStyleSheets = [Xe];
|
|
338
339
|
const i = document.createElement("div");
|
|
339
|
-
i.className = "static", i.innerHTML = '<slot name="static"></slot>', e.appendChild(i), n(this,
|
|
340
|
+
i.className = "static", i.innerHTML = '<slot name="static"></slot>', e.appendChild(i), n(this, lt, document.createElement("div")), t(this, lt).className = "content-wrapper", n(this, f, document.createElement("div")), t(this, f).className = "content", n(this, At, document.createElement("slot")), t(this, f).appendChild(t(this, At)), t(this, lt).appendChild(t(this, f)), e.appendChild(t(this, lt)), n(this, te, new MutationObserver((r) => {
|
|
341
|
+
this.tryResplit();
|
|
342
|
+
}));
|
|
340
343
|
}
|
|
341
344
|
}
|
|
342
345
|
get damped() {
|
|
@@ -349,7 +352,7 @@ class Jt extends HTMLElement {
|
|
|
349
352
|
return t(this, x);
|
|
350
353
|
}
|
|
351
354
|
get reverseCSSProperty() {
|
|
352
|
-
return t(this,
|
|
355
|
+
return t(this, Y);
|
|
353
356
|
}
|
|
354
357
|
get directionCSSProperty() {
|
|
355
358
|
return t(this, W);
|
|
@@ -364,16 +367,16 @@ class Jt extends HTMLElement {
|
|
|
364
367
|
return t(this, A);
|
|
365
368
|
}
|
|
366
369
|
get easingCSSProperty() {
|
|
367
|
-
return t(this,
|
|
370
|
+
return t(this, tt);
|
|
368
371
|
}
|
|
369
372
|
get durationCSSProperty() {
|
|
370
|
-
return t(this,
|
|
373
|
+
return t(this, et);
|
|
371
374
|
}
|
|
372
375
|
get autoSizeCSSProperty() {
|
|
373
376
|
return t(this, N);
|
|
374
377
|
}
|
|
375
378
|
get wheelMaxDeltaCSSProperty() {
|
|
376
|
-
return t(this,
|
|
379
|
+
return t(this, st);
|
|
377
380
|
}
|
|
378
381
|
get dragInertionCSSProperty() {
|
|
379
382
|
return t(this, yt);
|
|
@@ -406,37 +409,37 @@ class Jt extends HTMLElement {
|
|
|
406
409
|
return t(this, xt);
|
|
407
410
|
}
|
|
408
411
|
get autoplayUserDirectionCSSProperty() {
|
|
409
|
-
return t(this,
|
|
412
|
+
return t(this, it);
|
|
410
413
|
}
|
|
411
414
|
get classesCSSProperty() {
|
|
412
415
|
return t(this, M);
|
|
413
416
|
}
|
|
414
417
|
get currentIndexStartOffsetCSSProperty() {
|
|
415
|
-
return t(this,
|
|
418
|
+
return t(this, rt);
|
|
416
419
|
}
|
|
417
420
|
get currentIndexEndOffsetCSSProperty() {
|
|
418
421
|
return t(this, q);
|
|
419
422
|
}
|
|
420
423
|
get focusDelayCSSProperty() {
|
|
421
|
-
return t(this,
|
|
424
|
+
return t(this, nt);
|
|
422
425
|
}
|
|
423
426
|
get focusDurationCSSProperty() {
|
|
424
427
|
return t(this, Lt);
|
|
425
428
|
}
|
|
426
429
|
get disabledCSSProperty() {
|
|
427
|
-
return t(this,
|
|
430
|
+
return t(this, ht);
|
|
428
431
|
}
|
|
429
432
|
get hibernatedCSSProperty() {
|
|
430
|
-
return t(this,
|
|
433
|
+
return t(this, ot);
|
|
431
434
|
}
|
|
432
435
|
get currentScrollValue() {
|
|
433
|
-
return c(this, o,
|
|
436
|
+
return c(this, o, Ce).call(this, "current");
|
|
434
437
|
}
|
|
435
438
|
get targetScrollValue() {
|
|
436
|
-
return c(this, o,
|
|
439
|
+
return c(this, o, Ce).call(this, "target");
|
|
437
440
|
}
|
|
438
441
|
get contentWrapperElement() {
|
|
439
|
-
return t(this,
|
|
442
|
+
return t(this, lt);
|
|
440
443
|
}
|
|
441
444
|
get contentElement() {
|
|
442
445
|
return t(this, f);
|
|
@@ -468,10 +471,10 @@ class Jt extends HTMLElement {
|
|
|
468
471
|
);
|
|
469
472
|
}
|
|
470
473
|
get distance() {
|
|
471
|
-
return t(this,
|
|
474
|
+
return t(this, at);
|
|
472
475
|
}
|
|
473
476
|
get loopDistance() {
|
|
474
|
-
return t(this, y).current ? t(this,
|
|
477
|
+
return t(this, y).current ? t(this, at) + t(this, z) : t(this, at);
|
|
475
478
|
}
|
|
476
479
|
get hasOverflow() {
|
|
477
480
|
return t(this, U);
|
|
@@ -497,6 +500,9 @@ class Jt extends HTMLElement {
|
|
|
497
500
|
get scrollHeight() {
|
|
498
501
|
return t(this, x).current === "x" ? 0 : t(this, u).distance;
|
|
499
502
|
}
|
|
503
|
+
tryResplit() {
|
|
504
|
+
!t(this, K) && (t(this, y).current || t(this, $).current || t(this, y).current || t(this, N).current || t(this, A).current) && c(this, o, Zt).call(this);
|
|
505
|
+
}
|
|
500
506
|
onScroll(...e) {
|
|
501
507
|
return t(this, u).subscribe(...e);
|
|
502
508
|
}
|
|
@@ -518,18 +524,18 @@ class Jt extends HTMLElement {
|
|
|
518
524
|
scrollToSection(e, i) {
|
|
519
525
|
if (!t(this, l).length)
|
|
520
526
|
return;
|
|
521
|
-
const r = t(this, E).current, d = c(this, o,
|
|
527
|
+
const r = t(this, E).current, d = c(this, o, Ae).call(this, e), m = t(this, l)[r], C = t(this, l)[d];
|
|
522
528
|
if (m && C) {
|
|
523
529
|
let I = 0;
|
|
524
|
-
const
|
|
525
|
-
t(this, y).current ? d === 0 && r === t(this, l).length - 1 ? I = t(this, S) + t(this, v) - m.position + t(this, z) : d === t(this, l).length - 1 && r === 0 ? I = C.position - (t(this, S) + t(this, v) + t(this, z)) : I = C.position - m.position : I = C.position - m.position, this.shiftPosition(I -
|
|
530
|
+
const de = c(this, o, ue).call(this), _t = t(this, l)[de], Me = _t ? this.targetScrollValue - _t.position : 0;
|
|
531
|
+
t(this, y).current ? d === 0 && r === t(this, l).length - 1 ? I = t(this, S) + t(this, v) - m.position + t(this, z) : d === t(this, l).length - 1 && r === 0 ? I = C.position - (t(this, S) + t(this, v) + t(this, z)) : I = C.position - m.position : I = C.position - m.position, this.shiftPosition(I - Me, i);
|
|
526
532
|
}
|
|
527
533
|
}
|
|
528
534
|
shiftSections(e, i) {
|
|
529
535
|
t(this, l).length && this.scrollToSection(t(this, E).current + e, i);
|
|
530
536
|
}
|
|
531
537
|
setPosition(e, i) {
|
|
532
|
-
c(this, o,
|
|
538
|
+
c(this, o, ye).call(this, Math.sign(e) || 1), i != null && i.tween ? t(this, ut) || (t(this, _).set(t(this, u).current, { equalize: !0 }), t(this, _).set(e, Le({}, i.tween)), n(this, ut, setTimeout(() => {
|
|
533
539
|
n(this, ut, void 0);
|
|
534
540
|
}, i.tween.duration || 0))) : t(this, u).set(e, {
|
|
535
541
|
equalize: (i == null ? void 0 : i.behaviour) === "instant"
|
|
@@ -539,21 +545,21 @@ class Jt extends HTMLElement {
|
|
|
539
545
|
this.setPosition(t(this, u).target + e, i);
|
|
540
546
|
}
|
|
541
547
|
connectedCallback() {
|
|
542
|
-
St.register(this), n(this, u, new
|
|
548
|
+
St.register(this), n(this, u, new $e(0, {
|
|
543
549
|
damping: 0.01,
|
|
544
550
|
min: 0,
|
|
545
|
-
order:
|
|
546
|
-
})), this.setAttribute("tabindex", "0"), n(this, V, new
|
|
551
|
+
order: Fe.SCROLL
|
|
552
|
+
})), this.setAttribute("tabindex", "0"), n(this, V, new qe({ element: t(this, f) })), t(this, V).changeEvent.subscribe(t(this, Rt)), n(this, ct, new Ue({
|
|
547
553
|
element: this
|
|
548
|
-
})), t(this,
|
|
554
|
+
})), t(this, ct).changeEvent.subscribe(
|
|
549
555
|
t(this, Rt)
|
|
550
|
-
), n(this, O, new
|
|
556
|
+
), n(this, O, new Ge({ element: t(this, f) })), t(this, O).changeEvent.subscribe(t(this, Rt)), n(this, w, new Ke({
|
|
551
557
|
culling: this
|
|
552
|
-
})), t(this, w).changeEvent.subscribe(t(this,
|
|
553
|
-
c(this, o,
|
|
554
|
-
}), t(this,
|
|
555
|
-
c(this, o,
|
|
556
|
-
}), t(this,
|
|
558
|
+
})), t(this, w).changeEvent.subscribe(t(this, ee)), t(this, x).subscribe(() => {
|
|
559
|
+
c(this, o, Se).call(this);
|
|
560
|
+
}), t(this, Y).subscribe(() => {
|
|
561
|
+
c(this, o, Se).call(this);
|
|
562
|
+
}), t(this, st).subscribe((e) => {
|
|
557
563
|
t(this, V).axis = e.current ? "max" : t(this, x).current;
|
|
558
564
|
}), t(this, yt).subscribe((e) => {
|
|
559
565
|
t(this, O).inertion = typeof e.current == "number" ? e.current : 1;
|
|
@@ -577,11 +583,11 @@ class Jt extends HTMLElement {
|
|
|
577
583
|
t(this, u).stiffness = e.current;
|
|
578
584
|
}), t(this, T).subscribe((e) => {
|
|
579
585
|
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();
|
|
580
|
-
}), t(this,
|
|
586
|
+
}), t(this, it).subscribe((e) => {
|
|
581
587
|
e.current || (t(this, w).direction = 1);
|
|
582
588
|
}), t(this, M).subscribe((e) => {
|
|
583
589
|
t(this, P) && c(this, o, bt).call(this);
|
|
584
|
-
}), t(this,
|
|
590
|
+
}), t(this, rt).subscribe((e) => {
|
|
585
591
|
t(this, P) && t(this, M).current && c(this, o, bt).call(this);
|
|
586
592
|
}), t(this, q).subscribe((e) => {
|
|
587
593
|
t(this, P) && t(this, M).current && c(this, o, bt).call(this);
|
|
@@ -589,54 +595,54 @@ class Jt extends HTMLElement {
|
|
|
589
595
|
this.classList.toggle("active", e.current);
|
|
590
596
|
}), t(this, E).subscribe((e) => {
|
|
591
597
|
t(this, l).length && c(this, o, bt).call(this);
|
|
592
|
-
}), t(this,
|
|
593
|
-
t(this,
|
|
594
|
-
}), t(this, nt).subscribe((e) => {
|
|
595
|
-
e.current && !e.previous ? (this.classList.add("disabled"), c(this, o, le).call(this)) : !e.current && e.previous && (this.classList.remove("disabled"), c(this, o, ce).call(this));
|
|
598
|
+
}), t(this, _).subscribe((e) => {
|
|
599
|
+
t(this, _).isRunning.current && t(this, u).set(e.current, { equalize: !0 });
|
|
596
600
|
}), t(this, ht).subscribe((e) => {
|
|
597
|
-
e.current && !e.previous ? (this.classList.add("
|
|
598
|
-
}), t(this,
|
|
601
|
+
e.current && !e.previous ? (this.classList.add("disabled"), c(this, o, ce).call(this)) : !e.current && e.previous && (this.classList.remove("disabled"), c(this, o, ae).call(this));
|
|
602
|
+
}), t(this, ot).subscribe((e) => {
|
|
603
|
+
e.current && !e.previous ? (this.classList.add("hibernated"), c(this, o, ge).call(this)) : !e.current && e.previous && (this.classList.remove("hibernated"), c(this, o, ve).call(this));
|
|
604
|
+
}), t(this, vt).observe(), t(this, x).observe(), t(this, Y).observe(), t(this, W).observe(), t(this, F).observe(), t(this, $).observe(), t(this, A).observe(), t(this, tt).observe(), t(this, et).observe(), t(this, N).observe(), t(this, st).observe(), t(this, yt).observe(), t(this, D).observe(), t(this, y).observe(), t(this, Ct).observe(), t(this, wt).observe(), t(this, Et).observe(), t(this, Pt).observe(), t(this, Tt).observe(), t(this, T).observe(), t(this, T).observe(), t(this, xt).observe(), t(this, it).observe(), t(this, M).observe(), t(this, rt).observe(), t(this, q).observe(), t(this, nt).observe(), t(this, Lt).observe(), t(this, ht).observe(), t(this, ot).observe(), It.subscribe(t(this, se), be.LAST);
|
|
599
605
|
}
|
|
600
606
|
disconnectedCallback() {
|
|
601
|
-
this.removeAttribute("tabindex"), this.classList.remove("disabled"), this.classList.remove("hibernated"), t(this, vt).unobserve(), t(this, x).unobserve(), t(this,
|
|
607
|
+
this.removeAttribute("tabindex"), this.classList.remove("disabled"), this.classList.remove("hibernated"), t(this, vt).unobserve(), t(this, x).unobserve(), t(this, Y).unobserve(), t(this, W).unobserve(), t(this, F).unobserve(), t(this, $).unobserve(), t(this, A).unobserve(), t(this, tt).unobserve(), t(this, et).unobserve(), t(this, N).unobserve(), t(this, st).unobserve(), t(this, yt).unobserve(), t(this, D).unobserve(), t(this, y).unobserve(), t(this, Ct).unobserve(), t(this, wt).unobserve(), t(this, Et).unobserve(), t(this, Pt).unobserve(), t(this, Tt).unobserve(), t(this, T).unobserve(), t(this, xt).unobserve(), t(this, it).unobserve(), t(this, M).unobserve(), t(this, rt).unobserve(), t(this, q).unobserve(), t(this, nt).unobserve(), t(this, Lt).unobserve(), t(this, ht).unobserve(), t(this, ot).unobserve(), It.unsubscribe(t(this, se)), c(this, o, ge).call(this), t(this, te).disconnect();
|
|
602
608
|
}
|
|
603
609
|
}
|
|
604
|
-
u = new WeakMap(), vt = new WeakMap(), x = new WeakMap(),
|
|
605
|
-
const e = t(this, x).current, i = t(this,
|
|
606
|
-
t(this, f).style.flexDirection = e === "x" ? `row${i}` : `column${i}`, t(this, V).axis = t(this,
|
|
610
|
+
u = new WeakMap(), vt = new WeakMap(), x = new WeakMap(), Y = new WeakMap(), W = new WeakMap(), F = new WeakMap(), $ = new WeakMap(), A = new WeakMap(), tt = new WeakMap(), et = new WeakMap(), N = new WeakMap(), st = new WeakMap(), yt = new WeakMap(), D = new WeakMap(), y = new WeakMap(), Ct = new WeakMap(), wt = new WeakMap(), Et = new WeakMap(), Pt = new WeakMap(), Tt = new WeakMap(), T = new WeakMap(), xt = new WeakMap(), it = new WeakMap(), M = new WeakMap(), rt = new WeakMap(), q = new WeakMap(), nt = new WeakMap(), Lt = new WeakMap(), ht = new WeakMap(), ot = new WeakMap(), lt = new WeakMap(), f = new WeakMap(), At = new WeakMap(), l = new WeakMap(), Xt = new WeakMap(), Yt = new WeakMap(), v = new WeakMap(), S = new WeakMap(), z = new WeakMap(), V = new WeakMap(), ct = new WeakMap(), O = new WeakMap(), w = new WeakMap(), E = new WeakMap(), Dt = new WeakMap(), at = new WeakMap(), U = new WeakMap(), G = new WeakMap(), K = new WeakMap(), Mt = new WeakMap(), ut = new WeakMap(), _ = new WeakMap(), Vt = new WeakMap(), R = new WeakMap(), P = new WeakMap(), te = new WeakMap(), o = new WeakSet(), Se = function() {
|
|
611
|
+
const e = t(this, x).current, i = t(this, Y).current ? "-reverse" : "";
|
|
612
|
+
t(this, f).style.flexDirection = e === "x" ? `row${i}` : `column${i}`, t(this, V).axis = t(this, st).current ? "max" : e, t(this, ct).dimension = e === "x" ? "width" : "height", t(this, O).axis = e, e === "x" ? this.style.touchAction = "pan-y" : e === "y" && (this.style.touchAction = "pan-x"), t(this, P) && t(this, L).call(this);
|
|
607
613
|
}, Zt = function() {
|
|
608
614
|
c(this, o, zt).call(this), t(this, At).assignedElements().forEach((e, i) => {
|
|
609
|
-
e instanceof HTMLElement && t(this, l).push(new
|
|
610
|
-
}), t(this, f).style.transform = "",
|
|
615
|
+
e instanceof HTMLElement && t(this, l).push(new Qe(e, i, this));
|
|
616
|
+
}), t(this, f).style.transform = "", le(this, "scrollSectionsChange", {
|
|
611
617
|
custom: !0,
|
|
612
618
|
composed: !0
|
|
613
619
|
}), t(this, L).call(this), c(this, o, bt).call(this);
|
|
614
620
|
}, zt = function() {
|
|
615
621
|
t(this, l).forEach((e) => {
|
|
616
622
|
e.destroy();
|
|
617
|
-
}), n(this, l, []), t(this, E).reset(), t(this, u).reset(),
|
|
623
|
+
}), n(this, l, []), t(this, E).reset(), t(this, u).reset(), le(this, "scrollSectionsChange", {
|
|
618
624
|
custom: !0,
|
|
619
625
|
composed: !0
|
|
620
626
|
});
|
|
621
|
-
},
|
|
622
|
-
t(this, G) || (n(this, G, !0), t(this, u).unsubscribe(t(this, Ot)), t(this, u).unlistenAnimationFrame(), clearInterval(t(this, Mt)), clearInterval(t(this, ut)), t(this,
|
|
627
|
+
}, ce = function() {
|
|
628
|
+
t(this, G) || (n(this, G, !0), t(this, u).unsubscribe(t(this, Ot)), t(this, u).unlistenAnimationFrame(), clearInterval(t(this, Mt)), clearInterval(t(this, ut)), t(this, _).unlistenAnimationFrame(), t(this, V).disconnect(), t(this, ct).disconnect(), t(this, O).disconnect(), t(this, w).disconnect(), t(this, U) || (this.sections.forEach((e) => {
|
|
623
629
|
e.unsetTransform();
|
|
624
630
|
}), t(this, L).call(this)));
|
|
625
|
-
},
|
|
626
|
-
t(this, G) && (n(this, G, !1), t(this, u).subscribe(t(this, Ot)), t(this, V).connect(), t(this,
|
|
627
|
-
}, Se = function() {
|
|
628
|
-
t(this, at) || (n(this, at, !0), It.unsubscribe(t(this, L)), jt.unsubscribe(t(this, L)), c(this, o, le).call(this), t(this, f).style.transform = "", t(this, f).style.height = "", t(this, f).style.width = "", this.classList.remove("has-overflow", "start", "end"), t(this, l).length ? c(this, o, zt).call(this) : (t(this, E).reset(), t(this, u).reset()), St.unregister(this));
|
|
631
|
+
}, ae = function() {
|
|
632
|
+
t(this, G) && (n(this, G, !1), t(this, u).subscribe(t(this, Ot)), t(this, V).connect(), t(this, ct).connect(), t(this, O).connect(), t(this, T).current && t(this, w).connect());
|
|
629
633
|
}, ge = function() {
|
|
630
|
-
t(this,
|
|
631
|
-
},
|
|
634
|
+
t(this, K) || (n(this, K, !0), It.unsubscribe(t(this, L)), jt.unsubscribe(t(this, L)), c(this, o, ce).call(this), t(this, f).style.transform = "", t(this, f).style.height = "", t(this, f).style.width = "", this.classList.remove("has-overflow", "start", "end"), t(this, l).length ? c(this, o, zt).call(this) : (t(this, E).reset(), t(this, u).reset()), St.unregister(this));
|
|
635
|
+
}, ve = function() {
|
|
636
|
+
t(this, K) && (n(this, K, !1), St.register(this), this.tryResplit(), c(this, o, ae).call(this), It.subscribe(t(this, L), be.SCROLL), jt.subscribe(this, t(this, L)));
|
|
637
|
+
}, L = new WeakMap(), Ot = new WeakMap(), Ae = function(e) {
|
|
632
638
|
let i = t(this, E).current;
|
|
633
|
-
return t(this, y).current ? i =
|
|
634
|
-
}, Rt = new WeakMap(),
|
|
635
|
-
t(this,
|
|
639
|
+
return t(this, y).current ? i = We(e, t(this, l).length) : i = Ie(e, 0, this.limit), i;
|
|
640
|
+
}, Rt = new WeakMap(), ee = new WeakMap(), ye = function(e = 1) {
|
|
641
|
+
t(this, it).current && (t(this, w).direction = e), t(this, T).current && t(this, w).pauseAndContinue(
|
|
636
642
|
t(this, xt).current,
|
|
637
643
|
this.sectionalCSSProperty.current
|
|
638
644
|
);
|
|
639
|
-
},
|
|
645
|
+
}, Ce = function(e = "current") {
|
|
640
646
|
if (t(this, y).current && t(this, l).length) {
|
|
641
647
|
const i = t(this, u)[e] % (t(this, S) + t(this, v) + t(this, z));
|
|
642
648
|
return i < 0 ? t(this, S) + i + t(this, v) + t(this, z) : i;
|
|
@@ -644,8 +650,8 @@ u = new WeakMap(), vt = new WeakMap(), x = new WeakMap(), X = new WeakMap(), W =
|
|
|
644
650
|
return t(this, u)[e];
|
|
645
651
|
}, bt = function() {
|
|
646
652
|
if (t(this, l).length) {
|
|
647
|
-
const e = t(this, E).current + t(this,
|
|
648
|
-
if (e === 0 ? n(this, R, "start") : e === this.limit ? n(this, R, "end") : n(this, R, null),
|
|
653
|
+
const e = t(this, E).current + t(this, rt).current;
|
|
654
|
+
if (e === 0 ? n(this, R, "start") : e === this.limit ? n(this, R, "end") : n(this, R, null), le(this, "scrollLine", {
|
|
649
655
|
detail: { line: t(this, R) }
|
|
650
656
|
}), t(this, M).current) {
|
|
651
657
|
this.classList.remove("end", "start"), t(this, R) && this.classList.add(t(this, R));
|
|
@@ -657,70 +663,70 @@ u = new WeakMap(), vt = new WeakMap(), x = new WeakMap(), X = new WeakMap(), W =
|
|
|
657
663
|
}
|
|
658
664
|
}
|
|
659
665
|
}, // TODO: Учитывать loop
|
|
660
|
-
|
|
666
|
+
ue = function() {
|
|
661
667
|
let e = this.targetScrollValue, i = 1 / 0, r = 0;
|
|
662
668
|
const d = t(this, u).direction;
|
|
663
669
|
for (let m = 0; m < t(this, l).length; m++) {
|
|
664
670
|
const C = t(this, l)[m];
|
|
665
|
-
let I = t(this, Vt) ? C.size * d * -1 * 0.4 : 0,
|
|
666
|
-
const _t = Math.abs(
|
|
671
|
+
let I = t(this, Vt) ? C.size * d * -1 * 0.4 : 0, de = C.position;
|
|
672
|
+
const _t = Math.abs(de + I - e);
|
|
667
673
|
_t < i && (i = _t, r = m);
|
|
668
674
|
}
|
|
669
675
|
return r;
|
|
670
|
-
},
|
|
676
|
+
}, se = new WeakMap();
|
|
671
677
|
H && !customElements.get("e-scroll") && customElements.define("e-scroll", Jt);
|
|
672
|
-
var
|
|
673
|
-
class
|
|
678
|
+
var ie;
|
|
679
|
+
class we extends HTMLElement {
|
|
674
680
|
constructor() {
|
|
675
681
|
super(...arguments);
|
|
676
|
-
s(this,
|
|
682
|
+
s(this, ie, null);
|
|
677
683
|
}
|
|
678
684
|
get scrollElement() {
|
|
679
|
-
return t(this,
|
|
685
|
+
return t(this, ie);
|
|
680
686
|
}
|
|
681
687
|
connectedCallback() {
|
|
682
|
-
const e =
|
|
683
|
-
e instanceof Jt ? n(this,
|
|
688
|
+
const e = Te(this, Jt);
|
|
689
|
+
e instanceof Jt ? n(this, ie, e) : console.error(this, "e-scroll not found");
|
|
684
690
|
}
|
|
685
691
|
}
|
|
686
|
-
|
|
687
|
-
var dt, k,
|
|
688
|
-
class
|
|
692
|
+
ie = new WeakMap();
|
|
693
|
+
var dt, k, Z, j, Ht, Bt, pt, Wt, re, ne;
|
|
694
|
+
class Ye extends we {
|
|
689
695
|
constructor() {
|
|
690
696
|
super();
|
|
691
697
|
s(this, dt, null);
|
|
692
698
|
s(this, k, null);
|
|
693
|
-
s(this,
|
|
694
|
-
s(this,
|
|
699
|
+
s(this, Z, !1);
|
|
700
|
+
s(this, j, 0);
|
|
695
701
|
s(this, Ht, 0);
|
|
696
702
|
s(this, Bt, 0);
|
|
697
703
|
s(this, pt, () => {
|
|
698
|
-
n(this,
|
|
699
|
-
const e = t(this,
|
|
700
|
-
n(this,
|
|
704
|
+
n(this, Z, this.offsetWidth > this.offsetHeight);
|
|
705
|
+
const e = t(this, Z) ? this.offsetWidth : this.offsetHeight;
|
|
706
|
+
n(this, j, e / ((this.scrollElement.scrollSize + this.scrollElement.viewportSize) / e)), n(this, j, Math.max(t(this, j), 30)), t(this, Z) ? (t(this, k).style.width = t(this, j) + "px", t(this, k).style.height = "100%") : (t(this, k).style.width = "100%", t(this, k).style.height = t(this, j) + "px"), n(this, Ht, e - t(this, j)), this.scrollElement.scrollSize <= 0 ? this.style.display = "none" : this.style.display = "", t(this, Wt).call(this);
|
|
701
707
|
});
|
|
702
708
|
s(this, Wt, () => {
|
|
703
|
-
n(this, Bt, this.scrollElement.currentProgress * t(this, Ht)), t(this,
|
|
709
|
+
n(this, Bt, this.scrollElement.currentProgress * t(this, Ht)), t(this, Z) ? t(this, k).style.transform = `translate3d(${t(this, Bt)}px, 0px, 0px)` : t(this, k).style.transform = `translate3d(0px, ${t(this, Bt)}px, 0px)`;
|
|
704
710
|
});
|
|
705
|
-
s(this,
|
|
711
|
+
s(this, re, () => {
|
|
706
712
|
this.setAttribute("axis", this.scrollElement.axisCSSProperty.current);
|
|
707
713
|
});
|
|
708
|
-
s(this,
|
|
709
|
-
document.documentElement.classList.add("grabbing"),
|
|
714
|
+
s(this, ne, (e) => {
|
|
715
|
+
document.documentElement.classList.add("grabbing"), Ze(
|
|
710
716
|
(d) => {
|
|
711
|
-
const m = t(this,
|
|
717
|
+
const m = t(this, Z) ? d.x : d.y, C = this.scrollElement.distance / t(this, Ht), I = (m - r) * C;
|
|
712
718
|
this.scrollElement.setPosition(i + I);
|
|
713
719
|
},
|
|
714
720
|
() => {
|
|
715
721
|
document.documentElement.classList.remove("grabbing");
|
|
716
722
|
}
|
|
717
723
|
);
|
|
718
|
-
const i = this.scrollElement.damped.target, r = t(this,
|
|
724
|
+
const i = this.scrollElement.damped.target, r = t(this, Z) ? e.x : e.y;
|
|
719
725
|
});
|
|
720
726
|
if (H) {
|
|
721
727
|
const e = this.attachShadow({ mode: "open" });
|
|
722
728
|
e.adoptedStyleSheets = [
|
|
723
|
-
|
|
729
|
+
ze({
|
|
724
730
|
":host": {
|
|
725
731
|
display: "inline-block",
|
|
726
732
|
zIndex: "1",
|
|
@@ -758,16 +764,16 @@ class Xe extends Ce {
|
|
|
758
764
|
connectedCallback() {
|
|
759
765
|
super.connectedCallback(), this.setAttribute("drag-dead-zone", "");
|
|
760
766
|
const e = t(this, dt).assignedElements()[0] || t(this, dt).firstElementChild;
|
|
761
|
-
n(this, k, e), t(this, k).addEventListener("pointerdown", t(this,
|
|
767
|
+
n(this, k, e), t(this, k).addEventListener("pointerdown", t(this, ne)), It.subscribe(t(this, pt), be.SCROLL), jt.subscribe(this, t(this, pt)), jt.subscribe(this.scrollElement, t(this, pt)), this.scrollElement.onScroll(t(this, Wt)), this.scrollElement.axisCSSProperty.subscribe(t(this, re));
|
|
762
768
|
}
|
|
763
769
|
disconnectedCallback() {
|
|
764
|
-
this.removeAttribute("drag-dead-zone"), this.style.display = "", t(this, k).removeEventListener("pointerdown", t(this,
|
|
770
|
+
this.removeAttribute("drag-dead-zone"), this.style.display = "", t(this, k).removeEventListener("pointerdown", t(this, ne)), It.unsubscribe(t(this, pt)), jt.unsubscribe(t(this, pt)), this.scrollElement.offScroll(t(this, Wt)), this.scrollElement.axisCSSProperty.unsubscribe(t(this, re));
|
|
765
771
|
}
|
|
766
772
|
}
|
|
767
|
-
dt = new WeakMap(), k = new WeakMap(),
|
|
768
|
-
H && !customElements.get("e-scrollbar") && customElements.define("e-scrollbar",
|
|
773
|
+
dt = new WeakMap(), k = new WeakMap(), Z = new WeakMap(), j = new WeakMap(), Ht = new WeakMap(), Bt = new WeakMap(), pt = new WeakMap(), Wt = new WeakMap(), re = new WeakMap(), ne = new WeakMap();
|
|
774
|
+
H && !customElements.get("e-scrollbar") && customElements.define("e-scrollbar", Ye);
|
|
769
775
|
var Ft, $t, Nt;
|
|
770
|
-
class
|
|
776
|
+
class De extends we {
|
|
771
777
|
constructor() {
|
|
772
778
|
super();
|
|
773
779
|
s(this, Ft, new p(this, "--behaviour", "smooth"));
|
|
@@ -794,7 +800,7 @@ class Ae extends Ce {
|
|
|
794
800
|
}
|
|
795
801
|
Ft = new WeakMap(), $t = new WeakMap(), Nt = new WeakMap();
|
|
796
802
|
var qt;
|
|
797
|
-
class
|
|
803
|
+
class ts extends De {
|
|
798
804
|
constructor() {
|
|
799
805
|
super(...arguments);
|
|
800
806
|
s(this, qt, new p(this, "--set", 1));
|
|
@@ -810,71 +816,71 @@ class Ye extends Ae {
|
|
|
810
816
|
}
|
|
811
817
|
}
|
|
812
818
|
qt = new WeakMap();
|
|
813
|
-
H && !customElements.get("e-scroll-set-button") && customElements.define("e-scroll-set-button",
|
|
814
|
-
var
|
|
815
|
-
class
|
|
819
|
+
H && !customElements.get("e-scroll-set-button") && customElements.define("e-scroll-set-button", ts);
|
|
820
|
+
var J, Ut;
|
|
821
|
+
class es extends De {
|
|
816
822
|
constructor() {
|
|
817
823
|
super(...arguments);
|
|
818
|
-
s(this,
|
|
824
|
+
s(this, J, new p(this, "--step", 1));
|
|
819
825
|
s(this, Ut, () => {
|
|
820
|
-
this.scrollElement.loopCSSProperty.current ? this.removeAttribute("disabled") : t(this,
|
|
826
|
+
this.scrollElement.loopCSSProperty.current ? this.removeAttribute("disabled") : t(this, J).current > 0 && this.scrollElement.scrollLine === "end" || t(this, J).current < 0 && this.scrollElement.scrollLine === "start" ? this.setAttribute("disabled", "") : this.removeAttribute("disabled");
|
|
821
827
|
});
|
|
822
828
|
}
|
|
823
829
|
handleClick(e) {
|
|
824
|
-
this.scrollElement.shiftSections(t(this,
|
|
830
|
+
this.scrollElement.shiftSections(t(this, J).current, e);
|
|
825
831
|
}
|
|
826
832
|
connectedCallback() {
|
|
827
|
-
super.connectedCallback(), this.scrollElement && (t(this,
|
|
833
|
+
super.connectedCallback(), this.scrollElement && (t(this, J).subscribe(() => {
|
|
828
834
|
t(this, Ut).call(this);
|
|
829
|
-
}), t(this,
|
|
835
|
+
}), t(this, J).observe(), this.scrollElement.addEventListener(
|
|
830
836
|
"scrollLine",
|
|
831
837
|
t(this, Ut)
|
|
832
838
|
), t(this, Ut).call(this));
|
|
833
839
|
}
|
|
834
840
|
disconnectedCallback() {
|
|
835
|
-
super.disconnectedCallback(), t(this,
|
|
841
|
+
super.disconnectedCallback(), t(this, J).close(), this.removeAttribute("disabled");
|
|
836
842
|
}
|
|
837
843
|
}
|
|
838
|
-
|
|
839
|
-
H && !customElements.get("e-scroll-step-button") && customElements.define("e-scroll-step-button",
|
|
840
|
-
var
|
|
841
|
-
class
|
|
844
|
+
J = new WeakMap(), Ut = new WeakMap();
|
|
845
|
+
H && !customElements.get("e-scroll-step-button") && customElements.define("e-scroll-step-button", es);
|
|
846
|
+
var Q, ft, Gt, he, oe, Kt;
|
|
847
|
+
class ss {
|
|
842
848
|
constructor(h, e, i) {
|
|
843
|
-
s(this,
|
|
849
|
+
s(this, Q, null);
|
|
844
850
|
s(this, ft, null);
|
|
845
851
|
s(this, Gt, null);
|
|
846
|
-
s(this,
|
|
847
|
-
s(this,
|
|
852
|
+
s(this, he, null);
|
|
853
|
+
s(this, oe, () => {
|
|
848
854
|
t(this, ft).scrollToSection(t(this, Gt), {
|
|
849
|
-
behaviour: t(this,
|
|
855
|
+
behaviour: t(this, he)
|
|
850
856
|
});
|
|
851
857
|
});
|
|
852
858
|
s(this, Kt, () => {
|
|
853
|
-
t(this,
|
|
859
|
+
t(this, Q).classList.toggle(
|
|
854
860
|
"current",
|
|
855
861
|
t(this, ft).counter.current === t(this, Gt)
|
|
856
862
|
);
|
|
857
863
|
});
|
|
858
|
-
H && (n(this,
|
|
864
|
+
H && (n(this, Q, document.createElement("button")), n(this, ft, h), n(this, he, i), n(this, Gt, e), t(this, Q).addEventListener("click", t(this, oe)), t(this, ft).counter.subscribe(t(this, Kt)), t(this, Kt).call(this));
|
|
859
865
|
}
|
|
860
866
|
get element() {
|
|
861
|
-
return t(this,
|
|
867
|
+
return t(this, Q);
|
|
862
868
|
}
|
|
863
869
|
destroy() {
|
|
864
|
-
t(this,
|
|
870
|
+
t(this, Q).removeEventListener("click", t(this, oe)), t(this, ft).counter.unsubscribe(t(this, Kt)), t(this, Q).remove();
|
|
865
871
|
}
|
|
866
872
|
}
|
|
867
|
-
|
|
873
|
+
Q = new WeakMap(), ft = new WeakMap(), Gt = new WeakMap(), he = new WeakMap(), oe = new WeakMap(), Kt = new WeakMap();
|
|
868
874
|
var mt, kt;
|
|
869
|
-
class
|
|
875
|
+
class is extends we {
|
|
870
876
|
constructor() {
|
|
871
877
|
super(...arguments);
|
|
872
878
|
s(this, mt, []);
|
|
873
|
-
s(this, kt,
|
|
879
|
+
s(this, kt, je(() => {
|
|
874
880
|
t(this, mt).forEach((i) => i.destroy()), n(this, mt, []);
|
|
875
881
|
const e = this.scrollElement.sections.length - Math.max(this.scrollElement.sectionsInViewCSSProperty.current - 1, 0);
|
|
876
882
|
for (let i = 0; i < e; i++) {
|
|
877
|
-
const r = new
|
|
883
|
+
const r = new ss(
|
|
878
884
|
this.scrollElement,
|
|
879
885
|
i,
|
|
880
886
|
this.getAttribute("behaviour") || "smooth"
|
|
@@ -901,22 +907,22 @@ class ss extends Ce {
|
|
|
901
907
|
}
|
|
902
908
|
}
|
|
903
909
|
mt = new WeakMap(), kt = new WeakMap();
|
|
904
|
-
H && !customElements.get("e-scroll-bullet-buttons") && customElements.define("e-scroll-bullet-buttons",
|
|
905
|
-
class
|
|
910
|
+
H && !customElements.get("e-scroll-bullet-buttons") && customElements.define("e-scroll-bullet-buttons", is);
|
|
911
|
+
class rs extends Je {
|
|
906
912
|
connectedCallback() {
|
|
907
|
-
const h =
|
|
913
|
+
const h = Te(this, Jt);
|
|
908
914
|
h instanceof Jt ? (this.scrollContainer = h, this.scrollContainer.addEventListener(
|
|
909
915
|
"scrollSectionsChange",
|
|
910
916
|
this.findAnotherScrollEntries
|
|
911
917
|
)) : console.error(this, "e-scroll not found");
|
|
912
918
|
}
|
|
913
919
|
}
|
|
914
|
-
H && !customElements.get("e-scroll-segment") && customElements.define("e-scroll-segment",
|
|
920
|
+
H && !customElements.get("e-scroll-segment") && customElements.define("e-scroll-segment", rs);
|
|
915
921
|
export {
|
|
916
|
-
|
|
922
|
+
is as ScrollBulletButtonsElement,
|
|
917
923
|
Jt as ScrollElement,
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
924
|
+
rs as ScrollSegmentElement,
|
|
925
|
+
ts as ScrollSetButtonElement,
|
|
926
|
+
es as ScrollStepButtonElement,
|
|
927
|
+
Ye as ScrollbarElement
|
|
922
928
|
};
|