aptechka 0.44.1 → 0.44.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/scroll/index.cjs +1 -1
- package/lib/scroll/index.js +30 -30
- package/lib/scroll-entries/index.cjs +1 -1
- package/lib/scroll-entries/index.js +21 -21
- package/lib/scroll-segment/ScrollSegmentDefaultContainer.d.ts +11 -0
- package/lib/scroll-segment/ScrollSegmentElement.d.ts +78 -0
- package/lib/scroll-segment/index.cjs +1 -1
- package/lib/scroll-segment/index.d.ts +2 -79
- package/lib/scroll-segment/index.js +182 -154
- package/package.json +1 -1
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),r=(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-B_mh4mIw.cjs"),kt=require("../layout-Ctc2p3uz.cjs"),ke=require("../math-GDWEqu7y.cjs"),$e=require("../polyfills-BANSrI_m.cjs");require("../ticker/index.cjs");const ue=require("../order/index.cjs"),Ne=require("../Damped-BbJjFOLH.cjs"),Ue=require("../Tweened-Dk1UNPSH.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"),Re=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);r(this,f,h),r(this,Xt,e),r(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(){r(this,gt,t(this,g).vertical?t(this,f).offsetHeight:t(this,f).offsetWidth),r(this,V,t(this,g).vertical?kt.getCumulativeOffsetTop(t(this,f)):kt.getCumulativeOffsetLeft(t(this,f))),r(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,n=t(this,V)-t(this,g).viewportSize-e,d=t(this,V)+t(this,gt)+e,b=ke.clamp(i,n,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),r(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,It,I,xt,st,D,it,$,rt,Lt,nt,ht,ot,p,Tt,l,Yt,te,y,m,z,A,lt,B,w,P,qt,ct,N,U,ut,Dt,at,G,At,M,E,o,fe,Jt,zt,ae,de,me,ge,k,Bt,Ie,Mt,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,It,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,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,Tt,null);s(this,l,[]);s(this,Yt,0);s(this,te,0);s(this,y,0);s(this,m,0);s(this,z,0);s(this,A,null);s(this,lt,null);s(this,B,null);s(this,w,null);s(this,P,new We.Store(0));s(this,qt,0);s(this,ct,0);s(this,N,!1);s(this,U,!0);s(this,ut,!0);s(this,Dt);s(this,at);s(this,G,new Ue.Tweened);s(this,At,!1);s(this,M,null);s(this,E,!1);s(this,k,()=>{if(t(this,ht).current)return;t(this,a).unlistenAnimationFrame();const e=this.currentScrollValue/t(this,m)||0,i=t(this,P).current;if(r(this,Yt,this.vertical?kt.getCumulativeOffsetTop(this):kt.getCumulativeOffsetLeft(this)),r(this,te,this.vertical?kt.getCumulativeOffsetTop(t(this,p)):kt.getCumulativeOffsetLeft(t(this,p))),r(this,y,this.vertical?this.offsetHeight:this.offsetWidth),this.vertical?r(this,z,Le.cssUnitParser.parse(getComputedStyle(t(this,p)).rowGap)):r(this,z,Le.cssUnitParser.parse(getComputedStyle(t(this,p)).columnGap)),t(this,F).current&&t(this,l).length){const n=t(this,q).current,d=(t(this,y)-t(this,z)*(n-1))/n;t(this,l).forEach(b=>{b.setSize(d)})}else t(this,l).forEach(n=>{n.setSize()});if(t(this,l).forEach(n=>{n.resize()}),t(this,H).current){r(this,m,t(this,y)*t(this,H).current);const n=t(this,m)+t(this,y);this.vertical?(t(this,p).style.width=n+"px",t(this,p).style.height="100%"):(t(this,p).style.height=n+"px",t(this,p).style.width="100%")}else this.vertical?(t(this,p).style.width="100%",t(this,p).style.height="max-content",r(this,m,t(this,p).offsetHeight-t(this,y))):(t(this,p).style.width="max-content",t(this,p).style.height="100%",r(this,m,t(this,p).offsetWidth-t(this,y)));if(!t(this,v).current){const n=getComputedStyle(this),d=this.vertical?parseFloat(n.paddingBlockStart)+parseFloat(n.paddingBlockEnd):parseFloat(n.paddingInlineStart)+parseFloat(n.paddingInlineEnd);r(this,m,t(this,m)+d),t(this,a).max=t(this,m)}if(t(this,v).current&&t(this,l).length){const n=t(this,l)[t(this,l).length-1],d=n.position+n.size-t(this,y),b=t(this,m)-d;r(this,ct,n.position+n.size+b)}else r(this,ct,t(this,m));if(t(this,T).current&&t(this,l).length){const n=t(this,l)[i];t(this,a).set(n.position,{equalize:!0})}else t(this,a).set(e*t(this,m),{equalize:!0});r(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(r(this,qt,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,Mt,(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,I).current&&t(this,rt).current&&(clearInterval(t(this,Dt)),r(this,Dt,setTimeout(()=>{const n=t(this,l)[c(this,o,Se).call(this)];n&&this.scrollToSection(n.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 n=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,At)?this.scrollToSection(t(this,P).current,d):this.shiftSections(n,d)}else t(this,a).shift(n*t(this,y))}else t(this,a).shift(i);r(this,At,e==="drag")}});s(this,se,()=>{r(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),r(this,ot,document.createElement("div")),t(this,ot).className="content-wrapper",r(this,p,document.createElement("div")),t(this,p).className="content",r(this,Tt,document.createElement("slot")),t(this,p).appendChild(t(this,Tt)),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,It)}get autoplayCSSProperty(){return t(this,I)}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,z)}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,z):t(this,ct)}get hasOverflow(){return t(this,N)}get overscroll(){return t(this,qt)}get scrollLine(){return t(this,M)}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,n=0){const d=e-n,b=d+i+n*2;return this.currentProgress<d?0:this.currentProgress>b?1:(this.currentProgress-d)/(b-d)}curve(e,i,n=0){return Math.sin(this.range(e,i,n)*Math.PI)}visible(e,i,n=0){const d=e-n,b=d+i+n*2;return this.currentProgress>=d&&this.currentProgress<=b}scrollToSection(e,i){if(!t(this,l).length)return;const n=t(this,P).current,d=c(this,o,Ie).call(this,e),b=t(this,l)[n],C=t(this,l)[d];if(b&&C){let R=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&&n===t(this,l).length-1?R=t(this,m)+t(this,y)-b.position+t(this,z):d===t(this,l).length-1&&n===0?R=C.position-(t(this,m)+t(this,y)+t(this,z)):R=C.position-b.position:R=C.position-b.position,this.shiftPosition(R-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)),r(this,at,setTimeout(()=>{r(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),r(this,a,new Ne.Damped(0,{damping:.01,min:0,order:ue.TICK_ORDER.SCROLL})),this.setAttribute("tabindex","0"),r(this,A,new le.WheelControls({element:t(this,p)})),t(this,A).changeEvent.subscribe(t(this,Mt)),r(this,lt,new le.KeyboardControls({element:this})),t(this,lt).changeEvent.subscribe(t(this,Mt)),r(this,B,new le.DragControls({element:t(this,p)})),t(this,B).changeEvent.subscribe(t(this,Mt)),r(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,B).inertion=typeof e.current=="number"?e.current:1}),t(this,H).subscribe(()=>{t(this,E)&&t(this,k).call(this)}),t(this,W).subscribe(({current:e})=>{t(this,E)&&(e?c(this,o,Jt).call(this):c(this,o,zt).call(this))}),t(this,T).subscribe(e=>{t(this,A).debounce=e.current,t(this,B).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,zt).call(this))}),t(this,F).subscribe(e=>{t(this,E)&&(t(this,k).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,zt).call(this))}),t(this,q).subscribe(e=>{t(this,E)&&(t(this,k).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):(r(this,qt,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,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,It).observe(),t(this,I).observe(),t(this,I).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,It).unobserve(),t(this,I).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,It=new WeakMap,I=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,Tt=new WeakMap,l=new WeakMap,Yt=new WeakMap,te=new WeakMap,y=new WeakMap,m=new WeakMap,z=new WeakMap,A=new WeakMap,lt=new WeakMap,B=new WeakMap,w=new WeakMap,P=new WeakMap,qt=new WeakMap,ct=new WeakMap,N=new WeakMap,U=new WeakMap,ut=new WeakMap,Dt=new WeakMap,at=new WeakMap,G=new WeakMap,At=new WeakMap,M=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,B).axis=e,e==="x"?this.style.touchAction="pan-y":e==="y"&&(this.style.touchAction="pan-x"),t(this,E)&&t(this,k).call(this)},Jt=function(){c(this,o,zt).call(this),t(this,Tt).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,k).call(this),c(this,o,ft).call(this)},zt=function(){t(this,l).forEach(e=>{e.destroy()}),r(this,l,[]),t(this,P).reset(),t(this,a).reset(),ce.dispatchEvent(this,"scrollSectionsChange",{custom:!0,composed:!0})},ae=function(){t(this,U)||(r(this,U,!0),t(this,a).unsubscribe(t(this,Bt)),t(this,a).unlistenAnimationFrame(),clearInterval(t(this,Dt)),clearInterval(t(this,at)),t(this,G).unlistenAnimationFrame(),t(this,A).disconnect(),t(this,lt).disconnect(),t(this,B).disconnect(),t(this,w).disconnect(),t(this,N)||this.sections.forEach(e=>{e.unsetTransform()}))},de=function(){t(this,U)&&(r(this,U,!1),t(this,a).subscribe(t(this,Bt)),t(this,A).connect(),t(this,lt).connect(),t(this,B).connect(),t(this,I).current&&t(this,w).connect())},me=function(){t(this,ut)||(r(this,ut,!0),Rt.windowResizer.unsubscribe(t(this,k)),Qt.elementResizer.unsubscribe(t(this,k)),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,zt).call(this):(t(this,P).reset(),t(this,a).reset()),mt.scrollEntries.unregister(this))},ge=function(){t(this,ut)&&(r(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,k),ue.RESIZE_ORDER.SCROLL),Qt.elementResizer.subscribe(this,t(this,k)))},k=new WeakMap,Bt=new WeakMap,Ie=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},Mt=new WeakMap,ee=new WeakMap,ye=function(e=1){t(this,st).current&&(t(this,w).direction=e),t(this,I).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,z));return i<0?t(this,m)+i+t(this,y)+t(this,z):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?r(this,M,"start"):e===this.limit?r(this,M,"end"):r(this,M,null),ce.dispatchEvent(this,"scrollLine",{detail:{line:t(this,M)}}),t(this,D).current){this.classList.remove("end","start"),t(this,M)&&this.classList.add(t(this,M));const i=t(this,q).current+t(this,$).current;t(this,l).forEach((n,d)=>{const b=e-this.limit-1+t(this,$).current,C=e+i,R=this.sections.length-C;d>=e&&d<C||d<=b?n.mark("current"):d>=C&&d<C+R/2||d<=b+i?n.mark("next"):n.mark("previous")})}}},Se=function(){let e=this.targetScrollValue,i=1/0,n=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,At)?C.size*d*-1*.4:0,pe=C.position;const Kt=Math.abs(pe+R-e);Kt<i&&(i=Kt,n=b)}return n},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=Re.findParentElement(this,jt);e instanceof jt?r(this,ie,e):console.error(this,"e-scroll not found")}}ie=new WeakMap;var dt,L,Z,j,Ot,Vt,St,_t,re,ne;class Te extends Ce{constructor(){super();s(this,dt,null);s(this,L,null);s(this,Z,!1);s(this,j,0);s(this,Ot,0);s(this,Vt,0);s(this,St,()=>{r(this,Z,this.offsetWidth>this.offsetHeight);const e=t(this,Z)?this.offsetWidth:this.offsetHeight;r(this,j,e/((this.scrollElement.scrollSize+this.scrollElement.viewportSize)/e)),r(this,j,Math.max(t(this,j),30)),t(this,Z)?(t(this,L).style.width=t(this,j)+"px",t(this,L).style.height="100%"):(t(this,L).style.width="100%",t(this,L).style.height=t(this,j)+"px"),r(this,Ot,e-t(this,j)),this.scrollElement.scrollSize<=0?this.style.display="none":this.style.display="",t(this,_t).call(this)});s(this,_t,()=>{r(this,Vt,this.scrollElement.currentProgress*t(this,Ot)),t(this,Z)?t(this,L).style.transform=`translate3d(${t(this,Vt)}px, 0px, 0px)`:t(this,L).style.transform=`translate3d(0px, ${t(this,Vt)}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,Ot),R=(b-n)*C;this.scrollElement.setPosition(i+R)},()=>{document.documentElement.classList.remove("grabbing")});const i=this.scrollElement.damped.target,n=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"}})],r(this,dt,document.createElement("slot")),t(this,dt).innerHTML='<div class="default-thumb"></div>',e.appendChild(t(this,dt))}}get thumbElement(){return t(this,L)}connectedCallback(){super.connectedCallback(),this.setAttribute("drag-dead-zone","");const e=t(this,dt).assignedElements()[0]||t(this,dt).firstElementChild;r(this,L,e),t(this,L).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,_t)),this.scrollElement.axisCSSProperty.subscribe(t(this,re))}disconnectedCallback(){this.removeAttribute("drag-dead-zone"),this.style.display="",t(this,L).removeEventListener("pointerdown",t(this,ne)),Rt.windowResizer.unsubscribe(t(this,St)),Qt.elementResizer.unsubscribe(t(this,St)),this.scrollElement.offScroll(t(this,_t)),this.scrollElement.axisCSSProperty.unsubscribe(t(this,re))}}dt=new WeakMap,L=new WeakMap,Z=new WeakMap,j=new WeakMap,Ot=new WeakMap,Vt=new WeakMap,St=new WeakMap,_t=new WeakMap,re=new WeakMap,ne=new WeakMap;O.isBrowser&&!customElements.get("e-scrollbar")&&customElements.define("e-scrollbar",Te);var Ht,Wt,Ft;class qe extends Ce{constructor(){super();s(this,Ht,new S.CSSProperty(this,"--behaviour","smooth"));s(this,Wt,new S.CSSProperty(this,"--tween-easing",!1));s(this,Ft,new S.CSSProperty(this,"--tween-duration",0));O.isBrowser&&this.addEventListener("click",()=>{const e=t(this,Ht).current,i=t(this,Wt).current,n=t(this,Ft).current;this.handleClick({behaviour:e,tween:i||n?{easing:i,duration:n}:void 0})})}connectedCallback(){super.connectedCallback(),t(this,Ht).observe(),t(this,Wt).observe(),t(this,Ft).observe()}disconnectedCallback(){t(this,Ht).close(),t(this,Wt).close(),t(this,Ft).close()}}Ht=new WeakMap,Wt=new WeakMap,Ft=new WeakMap;var $t;class De extends qe{constructor(){super(...arguments);s(this,$t,new S.CSSProperty(this,"--set",1))}handleClick(e){this.scrollElement.scrollToSection(t(this,$t).current,e)}connectedCallback(){super.connectedCallback(),t(this,$t).observe()}disconnectedCallback(){super.disconnectedCallback(),t(this,$t).close()}}$t=new WeakMap;O.isBrowser&&!customElements.get("e-scroll-set-button")&&customElements.define("e-scroll-set-button",De);var K,Nt;class Ae extends qe{constructor(){super(...arguments);s(this,K,new S.CSSProperty(this,"--step",1));s(this,Nt,()=>{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,Nt).call(this)}),t(this,K).observe(),this.scrollElement.addEventListener("scrollLine",t(this,Nt)),t(this,Nt).call(this))}disconnectedCallback(){super.disconnectedCallback(),t(this,K).close(),this.removeAttribute("disabled")}}K=new WeakMap,Nt=new WeakMap;O.isBrowser&&!customElements.get("e-scroll-step-button")&&customElements.define("e-scroll-step-button",Ae);var J,pt,Ut,he,oe,Gt;class Xe{constructor(h,e,i){s(this,J,null);s(this,pt,null);s(this,Ut,null);s(this,he,null);s(this,oe,()=>{t(this,pt).scrollToSection(t(this,Ut),{behaviour:t(this,he)})});s(this,Gt,()=>{t(this,J).classList.toggle("current",t(this,pt).counter.current===t(this,Ut))});O.isBrowser&&(r(this,J,document.createElement("button")),r(this,pt,h),r(this,he,i),r(this,Ut,e),t(this,J).addEventListener("click",t(this,oe)),t(this,pt).counter.subscribe(t(this,Gt)),t(this,Gt).call(this))}get element(){return t(this,J)}destroy(){t(this,J).removeEventListener("click",t(this,oe)),t(this,pt).counter.unsubscribe(t(this,Gt)),t(this,J).remove()}}J=new WeakMap,pt=new WeakMap,Ut=new WeakMap,he=new WeakMap,oe=new WeakMap,Gt=new WeakMap;var bt,Zt;class Be extends Ce{constructor(){super(...arguments);s(this,bt,[]);s(this,Zt,je.debounce(()=>{t(this,bt).forEach(e=>e.destroy()),r(this,bt,[]);for(let e=0;e<this.scrollElement.sections.length;e++){const i=new Xe(this.scrollElement,e,this.getAttribute("behaviour")||"smooth");this.appendChild(i.element),t(this,bt).push(i)}},0))}connectedCallback(){super.connectedCallback(),this.scrollElement.addEventListener("sectionsChange",t(this,Zt)),t(this,Zt).call(this)}disconnectedCallback(){this.scrollElement.removeEventListener("sectionsChange",t(this,Zt)),t(this,bt).forEach(e=>e.destroy()),r(this,bt,[])}}bt=new WeakMap,Zt=new WeakMap;O.isBrowser&&!customElements.get("e-scroll-bullet-buttons")&&customElements.define("e-scroll-bullet-buttons",Be);class Me extends Ke.ScrollSegmentElement{connectedCallback(){const h=Re.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",Me);exports.ScrollBulletButtonsElement=Be;exports.ScrollElement=jt;exports.ScrollSegmentElement=Me;exports.ScrollSetButtonElement=De;exports.ScrollStepButtonElement=Ae;exports.ScrollbarElement=Te;
|
|
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),r=(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-B_mh4mIw.cjs"),kt=require("../layout-Ctc2p3uz.cjs"),ke=require("../math-GDWEqu7y.cjs"),$e=require("../polyfills-BANSrI_m.cjs");require("../ticker/index.cjs");const ue=require("../order/index.cjs"),Ne=require("../Damped-BbJjFOLH.cjs"),Ue=require("../Tweened-Dk1UNPSH.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"),Re=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);r(this,f,h),r(this,Xt,e),r(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(){r(this,gt,t(this,g).vertical?t(this,f).offsetHeight:t(this,f).offsetWidth),r(this,V,t(this,g).vertical?kt.getCumulativeOffsetTop(t(this,f)):kt.getCumulativeOffsetLeft(t(this,f))),r(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,n=t(this,V)-t(this,g).viewportSize-e,d=t(this,V)+t(this,gt)+e,b=ke.clamp(i,n,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),r(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,It,I,xt,st,D,it,$,rt,Lt,nt,ht,ot,p,Tt,l,Yt,te,y,m,k,A,lt,B,w,P,qt,ct,N,U,ut,Dt,at,G,At,M,E,o,fe,Jt,zt,ae,de,me,ge,L,Bt,Ie,Mt,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,It,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,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,Tt,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,B,null);s(this,w,null);s(this,P,new We.Store(0));s(this,qt,0);s(this,ct,0);s(this,N,!1);s(this,U,!0);s(this,ut,!0);s(this,Dt);s(this,at);s(this,G,new Ue.Tweened);s(this,At,!1);s(this,M,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(r(this,Yt,this.vertical?kt.getCumulativeOffsetTop(this):kt.getCumulativeOffsetLeft(this)),r(this,te,this.vertical?kt.getCumulativeOffsetTop(t(this,p)):kt.getCumulativeOffsetLeft(t(this,p))),r(this,y,this.vertical?this.offsetHeight:this.offsetWidth),this.vertical?r(this,k,Le.cssUnitParser.parse(getComputedStyle(t(this,p)).rowGap)):r(this,k,Le.cssUnitParser.parse(getComputedStyle(t(this,p)).columnGap)),t(this,F).current&&t(this,l).length){const n=t(this,q).current,d=(t(this,y)-t(this,k)*(n-1))/n;t(this,l).forEach(b=>{b.setSize(d)})}else t(this,l).forEach(n=>{n.setSize()});if(t(this,l).forEach(n=>{n.resize()}),t(this,H).current){r(this,m,t(this,y)*t(this,H).current);const n=t(this,m)+t(this,y);this.vertical?(t(this,p).style.width=n+"px",t(this,p).style.height="100%"):(t(this,p).style.height=n+"px",t(this,p).style.width="100%")}else this.vertical?(t(this,p).style.width="100%",t(this,p).style.height="max-content",r(this,m,t(this,p).offsetHeight-t(this,y))):(t(this,p).style.width="max-content",t(this,p).style.height="100%",r(this,m,t(this,p).offsetWidth-t(this,y)));if(!t(this,v).current){const n=getComputedStyle(this),d=this.vertical?parseFloat(n.paddingBlockStart)+parseFloat(n.paddingBlockEnd):parseFloat(n.paddingInlineStart)+parseFloat(n.paddingInlineEnd);r(this,m,t(this,m)+d),t(this,a).max=t(this,m)}if(t(this,v).current&&t(this,l).length){const n=t(this,l)[t(this,l).length-1],d=n.position+n.size-t(this,y),b=t(this,m)-d;r(this,ct,n.position+n.size+b)}else r(this,ct,t(this,m));if(t(this,T).current&&t(this,l).length){const n=t(this,l)[i];t(this,a).set(n.position,{equalize:!0})}else t(this,a).set(e*t(this,m),{equalize:!0});r(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(r(this,qt,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,Mt,(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,I).current&&t(this,rt).current&&(clearInterval(t(this,Dt)),r(this,Dt,setTimeout(()=>{const n=t(this,l)[c(this,o,Se).call(this)];n&&this.scrollToSection(n.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 n=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,At)?this.scrollToSection(t(this,P).current,d):this.shiftSections(n,d)}else t(this,a).shift(n*t(this,y))}else t(this,a).shift(i);r(this,At,e==="drag")}});s(this,se,()=>{r(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),r(this,ot,document.createElement("div")),t(this,ot).className="content-wrapper",r(this,p,document.createElement("div")),t(this,p).className="content",r(this,Tt,document.createElement("slot")),t(this,p).appendChild(t(this,Tt)),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,It)}get autoplayCSSProperty(){return t(this,I)}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,qt)}get scrollLine(){return t(this,M)}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,n=0){const d=e-n,b=d+i+n*2;return this.currentProgress<d?0:this.currentProgress>b?1:(this.currentProgress-d)/(b-d)}curve(e,i,n=0){return Math.sin(this.range(e,i,n)*Math.PI)}visible(e,i,n=0){const d=e-n,b=d+i+n*2;return this.currentProgress>=d&&this.currentProgress<=b}scrollToSection(e,i){if(!t(this,l).length)return;const n=t(this,P).current,d=c(this,o,Ie).call(this,e),b=t(this,l)[n],C=t(this,l)[d];if(b&&C){let R=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&&n===t(this,l).length-1?R=t(this,m)+t(this,y)-b.position+t(this,k):d===t(this,l).length-1&&n===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-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)),r(this,at,setTimeout(()=>{r(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),r(this,a,new Ne.Damped(0,{damping:.01,min:0,order:ue.TICK_ORDER.SCROLL})),this.setAttribute("tabindex","0"),r(this,A,new le.WheelControls({element:t(this,p)})),t(this,A).changeEvent.subscribe(t(this,Mt)),r(this,lt,new le.KeyboardControls({element:this})),t(this,lt).changeEvent.subscribe(t(this,Mt)),r(this,B,new le.DragControls({element:t(this,p)})),t(this,B).changeEvent.subscribe(t(this,Mt)),r(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,B).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,zt).call(this))}),t(this,T).subscribe(e=>{t(this,A).debounce=e.current,t(this,B).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,zt).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,zt).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):(r(this,qt,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,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,It).observe(),t(this,I).observe(),t(this,I).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,It).unobserve(),t(this,I).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,It=new WeakMap,I=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,Tt=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,B=new WeakMap,w=new WeakMap,P=new WeakMap,qt=new WeakMap,ct=new WeakMap,N=new WeakMap,U=new WeakMap,ut=new WeakMap,Dt=new WeakMap,at=new WeakMap,G=new WeakMap,At=new WeakMap,M=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,B).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,zt).call(this),t(this,Tt).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)},zt=function(){t(this,l).forEach(e=>{e.destroy()}),r(this,l,[]),t(this,P).reset(),t(this,a).reset(),ce.dispatchEvent(this,"scrollSectionsChange",{custom:!0,composed:!0})},ae=function(){t(this,U)||(r(this,U,!0),t(this,a).unsubscribe(t(this,Bt)),t(this,a).unlistenAnimationFrame(),clearInterval(t(this,Dt)),clearInterval(t(this,at)),t(this,G).unlistenAnimationFrame(),t(this,A).disconnect(),t(this,lt).disconnect(),t(this,B).disconnect(),t(this,w).disconnect(),t(this,N)||(this.sections.forEach(e=>{e.unsetTransform()}),t(this,L).call(this)))},de=function(){t(this,U)&&(r(this,U,!1),t(this,a).subscribe(t(this,Bt)),t(this,A).connect(),t(this,lt).connect(),t(this,B).connect(),t(this,I).current&&t(this,w).connect())},me=function(){t(this,ut)||(r(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,zt).call(this):(t(this,P).reset(),t(this,a).reset()),mt.scrollEntries.unregister(this))},ge=function(){t(this,ut)&&(r(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,Ie=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},Mt=new WeakMap,ee=new WeakMap,ye=function(e=1){t(this,st).current&&(t(this,w).direction=e),t(this,I).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?r(this,M,"start"):e===this.limit?r(this,M,"end"):r(this,M,null),ce.dispatchEvent(this,"scrollLine",{detail:{line:t(this,M)}}),t(this,D).current){this.classList.remove("end","start"),t(this,M)&&this.classList.add(t(this,M));const i=t(this,q).current+t(this,$).current;t(this,l).forEach((n,d)=>{const b=e-this.limit-1+t(this,$).current,C=e+i,R=this.sections.length-C;d>=e&&d<C||d<=b?n.mark("current"):d>=C&&d<C+R/2||d<=b+i?n.mark("next"):n.mark("previous")})}}},Se=function(){let e=this.targetScrollValue,i=1/0,n=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,At)?C.size*d*-1*.4:0,pe=C.position;const Kt=Math.abs(pe+R-e);Kt<i&&(i=Kt,n=b)}return n},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=Re.findParentElement(this,jt);e instanceof jt?r(this,ie,e):console.error(this,"e-scroll not found")}}ie=new WeakMap;var dt,z,Z,j,Ot,Vt,St,_t,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,Ot,0);s(this,Vt,0);s(this,St,()=>{r(this,Z,this.offsetWidth>this.offsetHeight);const e=t(this,Z)?this.offsetWidth:this.offsetHeight;r(this,j,e/((this.scrollElement.scrollSize+this.scrollElement.viewportSize)/e)),r(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"),r(this,Ot,e-t(this,j)),this.scrollElement.scrollSize<=0?this.style.display="none":this.style.display="",t(this,_t).call(this)});s(this,_t,()=>{r(this,Vt,this.scrollElement.currentProgress*t(this,Ot)),t(this,Z)?t(this,z).style.transform=`translate3d(${t(this,Vt)}px, 0px, 0px)`:t(this,z).style.transform=`translate3d(0px, ${t(this,Vt)}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,Ot),R=(b-n)*C;this.scrollElement.setPosition(i+R)},()=>{document.documentElement.classList.remove("grabbing")});const i=this.scrollElement.damped.target,n=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"}})],r(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;r(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,_t)),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,_t)),this.scrollElement.axisCSSProperty.unsubscribe(t(this,re))}}dt=new WeakMap,z=new WeakMap,Z=new WeakMap,j=new WeakMap,Ot=new WeakMap,Vt=new WeakMap,St=new WeakMap,_t=new WeakMap,re=new WeakMap,ne=new WeakMap;O.isBrowser&&!customElements.get("e-scrollbar")&&customElements.define("e-scrollbar",Te);var Ht,Wt,Ft;class qe extends Ce{constructor(){super();s(this,Ht,new S.CSSProperty(this,"--behaviour","smooth"));s(this,Wt,new S.CSSProperty(this,"--tween-easing",!1));s(this,Ft,new S.CSSProperty(this,"--tween-duration",0));O.isBrowser&&this.addEventListener("click",()=>{const e=t(this,Ht).current,i=t(this,Wt).current,n=t(this,Ft).current;this.handleClick({behaviour:e,tween:i||n?{easing:i,duration:n}:void 0})})}connectedCallback(){super.connectedCallback(),t(this,Ht).observe(),t(this,Wt).observe(),t(this,Ft).observe()}disconnectedCallback(){t(this,Ht).close(),t(this,Wt).close(),t(this,Ft).close()}}Ht=new WeakMap,Wt=new WeakMap,Ft=new WeakMap;var $t;class De extends qe{constructor(){super(...arguments);s(this,$t,new S.CSSProperty(this,"--set",1))}handleClick(e){this.scrollElement.scrollToSection(t(this,$t).current,e)}connectedCallback(){super.connectedCallback(),t(this,$t).observe()}disconnectedCallback(){super.disconnectedCallback(),t(this,$t).close()}}$t=new WeakMap;O.isBrowser&&!customElements.get("e-scroll-set-button")&&customElements.define("e-scroll-set-button",De);var K,Nt;class Ae extends qe{constructor(){super(...arguments);s(this,K,new S.CSSProperty(this,"--step",1));s(this,Nt,()=>{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,Nt).call(this)}),t(this,K).observe(),this.scrollElement.addEventListener("scrollLine",t(this,Nt)),t(this,Nt).call(this))}disconnectedCallback(){super.disconnectedCallback(),t(this,K).close(),this.removeAttribute("disabled")}}K=new WeakMap,Nt=new WeakMap;O.isBrowser&&!customElements.get("e-scroll-step-button")&&customElements.define("e-scroll-step-button",Ae);var J,pt,Ut,he,oe,Gt;class Xe{constructor(h,e,i){s(this,J,null);s(this,pt,null);s(this,Ut,null);s(this,he,null);s(this,oe,()=>{t(this,pt).scrollToSection(t(this,Ut),{behaviour:t(this,he)})});s(this,Gt,()=>{t(this,J).classList.toggle("current",t(this,pt).counter.current===t(this,Ut))});O.isBrowser&&(r(this,J,document.createElement("button")),r(this,pt,h),r(this,he,i),r(this,Ut,e),t(this,J).addEventListener("click",t(this,oe)),t(this,pt).counter.subscribe(t(this,Gt)),t(this,Gt).call(this))}get element(){return t(this,J)}destroy(){t(this,J).removeEventListener("click",t(this,oe)),t(this,pt).counter.unsubscribe(t(this,Gt)),t(this,J).remove()}}J=new WeakMap,pt=new WeakMap,Ut=new WeakMap,he=new WeakMap,oe=new WeakMap,Gt=new WeakMap;var bt,Zt;class Be extends Ce{constructor(){super(...arguments);s(this,bt,[]);s(this,Zt,je.debounce(()=>{t(this,bt).forEach(e=>e.destroy()),r(this,bt,[]);for(let e=0;e<this.scrollElement.sections.length;e++){const i=new Xe(this.scrollElement,e,this.getAttribute("behaviour")||"smooth");this.appendChild(i.element),t(this,bt).push(i)}},0))}connectedCallback(){super.connectedCallback(),this.scrollElement.addEventListener("sectionsChange",t(this,Zt)),t(this,Zt).call(this)}disconnectedCallback(){this.scrollElement.removeEventListener("sectionsChange",t(this,Zt)),t(this,bt).forEach(e=>e.destroy()),r(this,bt,[])}}bt=new WeakMap,Zt=new WeakMap;O.isBrowser&&!customElements.get("e-scroll-bullet-buttons")&&customElements.define("e-scroll-bullet-buttons",Be);class Me extends Ke.ScrollSegmentElement{connectedCallback(){const h=Re.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",Me);exports.ScrollBulletButtonsElement=Be;exports.ScrollElement=jt;exports.ScrollSegmentElement=Me;exports.ScrollSetButtonElement=De;exports.ScrollStepButtonElement=Ae;exports.ScrollbarElement=Te;
|
package/lib/scroll/index.js
CHANGED
|
@@ -129,7 +129,7 @@ const Qe = ke({
|
|
|
129
129
|
flexShrink: "0"
|
|
130
130
|
}
|
|
131
131
|
});
|
|
132
|
-
var u, vt, P, X, W, F, $, A, Y, tt, N, et, yt, D, y, Ct, wt, Et, xt, It, T, Pt, st, M, it, q, rt, Lt, nt, ht, ot, f, Tt, l, Xt, Yt, v, S,
|
|
132
|
+
var u, vt, P, X, W, F, $, A, Y, tt, N, et, yt, D, y, Ct, wt, Et, xt, It, T, Pt, st, M, it, q, rt, Lt, nt, ht, ot, f, Tt, l, Xt, Yt, v, S, z, V, lt, O, w, E, At, ct, U, G, at, Dt, ut, K, Mt, R, x, o, be, Zt, kt, le, ce, Se, ge, L, Vt, Te, Ot, te, ve, ye, bt, ae, ee;
|
|
133
133
|
class Jt extends HTMLElement {
|
|
134
134
|
constructor() {
|
|
135
135
|
super();
|
|
@@ -214,7 +214,7 @@ class Jt extends HTMLElement {
|
|
|
214
214
|
s(this, Yt, 0);
|
|
215
215
|
s(this, v, 0);
|
|
216
216
|
s(this, S, 0);
|
|
217
|
-
s(this,
|
|
217
|
+
s(this, z, 0);
|
|
218
218
|
s(this, V, null);
|
|
219
219
|
s(this, lt, null);
|
|
220
220
|
s(this, O, null);
|
|
@@ -231,17 +231,17 @@ class Jt extends HTMLElement {
|
|
|
231
231
|
s(this, Mt, !1);
|
|
232
232
|
s(this, R, null);
|
|
233
233
|
s(this, x, !1);
|
|
234
|
-
s(this,
|
|
234
|
+
s(this, L, () => {
|
|
235
235
|
if (t(this, ht).current)
|
|
236
236
|
return;
|
|
237
237
|
t(this, u).unlistenAnimationFrame();
|
|
238
238
|
const e = this.currentScrollValue / t(this, S) || 0, i = t(this, E).current;
|
|
239
|
-
if (r(this, Xt, this.vertical ? pe(this) : fe(this)), r(this, Yt, this.vertical ? pe(t(this, f)) : fe(t(this, f))), r(this, v, this.vertical ? this.offsetHeight : this.offsetWidth), this.vertical ? r(this,
|
|
239
|
+
if (r(this, Xt, this.vertical ? pe(this) : fe(this)), r(this, Yt, this.vertical ? pe(t(this, f)) : fe(t(this, f))), r(this, v, this.vertical ? this.offsetHeight : this.offsetWidth), this.vertical ? r(this, z, Le.parse(
|
|
240
240
|
getComputedStyle(t(this, f)).rowGap
|
|
241
|
-
)) : r(this,
|
|
241
|
+
)) : r(this, z, Le.parse(
|
|
242
242
|
getComputedStyle(t(this, f)).columnGap
|
|
243
243
|
)), t(this, N).current && t(this, l).length) {
|
|
244
|
-
const n = t(this, D).current, d = (t(this, v) - t(this,
|
|
244
|
+
const n = t(this, D).current, d = (t(this, v) - t(this, z) * (n - 1)) / n;
|
|
245
245
|
t(this, l).forEach((m) => {
|
|
246
246
|
m.setSize(d);
|
|
247
247
|
});
|
|
@@ -457,7 +457,7 @@ class Jt extends HTMLElement {
|
|
|
457
457
|
return t(this, S);
|
|
458
458
|
}
|
|
459
459
|
get gap() {
|
|
460
|
-
return t(this,
|
|
460
|
+
return t(this, z);
|
|
461
461
|
}
|
|
462
462
|
get counter() {
|
|
463
463
|
return t(this, E);
|
|
@@ -471,7 +471,7 @@ class Jt extends HTMLElement {
|
|
|
471
471
|
return t(this, ct);
|
|
472
472
|
}
|
|
473
473
|
get loopDistance() {
|
|
474
|
-
return t(this, y).current ? t(this, ct) + t(this,
|
|
474
|
+
return t(this, y).current ? t(this, ct) + t(this, z) : t(this, ct);
|
|
475
475
|
}
|
|
476
476
|
get hasOverflow() {
|
|
477
477
|
return t(this, U);
|
|
@@ -522,7 +522,7 @@ class Jt extends HTMLElement {
|
|
|
522
522
|
if (m && C) {
|
|
523
523
|
let I = 0;
|
|
524
524
|
const ue = c(this, o, ae).call(this), _t = t(this, l)[ue], De = _t ? this.targetScrollValue - _t.position : 0;
|
|
525
|
-
t(this, y).current ? d === 0 && n === t(this, l).length - 1 ? I = t(this, S) + t(this, v) - m.position + t(this,
|
|
525
|
+
t(this, y).current ? d === 0 && n === t(this, l).length - 1 ? I = t(this, S) + t(this, v) - m.position + t(this, z) : d === t(this, l).length - 1 && n === 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 - De, i);
|
|
526
526
|
}
|
|
527
527
|
}
|
|
528
528
|
shiftSections(e, i) {
|
|
@@ -558,15 +558,15 @@ class Jt extends HTMLElement {
|
|
|
558
558
|
}), t(this, yt).subscribe((e) => {
|
|
559
559
|
t(this, O).inertion = typeof e.current == "number" ? e.current : 1;
|
|
560
560
|
}), t(this, F).subscribe(() => {
|
|
561
|
-
t(this, x) && t(this,
|
|
561
|
+
t(this, x) && t(this, L).call(this);
|
|
562
562
|
}), t(this, $).subscribe(({ current: e }) => {
|
|
563
563
|
t(this, x) && (e ? c(this, o, Zt).call(this) : c(this, o, kt).call(this));
|
|
564
564
|
}), t(this, A).subscribe((e) => {
|
|
565
565
|
t(this, V).debounce = e.current, t(this, O).swipe = e.current, t(this, w).interval = e.current, t(this, x) && (e.current && !e.previous && !t(this, l).length ? c(this, o, Zt).call(this) : !e.current && e.previous && t(this, l).length && c(this, o, kt).call(this));
|
|
566
566
|
}), t(this, N).subscribe((e) => {
|
|
567
|
-
t(this, x) && (t(this,
|
|
567
|
+
t(this, x) && (t(this, L).call(this), e.current && !e.previous && !t(this, l).length ? c(this, o, Zt).call(this) : !e.current && e.previous && t(this, l).length && c(this, o, kt).call(this));
|
|
568
568
|
}), t(this, D).subscribe((e) => {
|
|
569
|
-
t(this, x) && (t(this,
|
|
569
|
+
t(this, x) && (t(this, L).call(this), c(this, o, bt).call(this));
|
|
570
570
|
}), t(this, y).subscribe((e) => {
|
|
571
571
|
e.current ? (t(this, x) && (t(this, l).length || (t(this, $).current = !0)), t(this, u).max = 1 / 0, t(this, u).min = -1 / 0) : (r(this, At, 0), t(this, u).max = t(this, S), t(this, u).min = 0);
|
|
572
572
|
}), t(this, Ct).subscribe((e) => {
|
|
@@ -601,16 +601,16 @@ class Jt extends HTMLElement {
|
|
|
601
601
|
this.removeAttribute("tabindex"), this.classList.remove("disabled"), this.classList.remove("hibernated"), t(this, vt).unobserve(), t(this, P).unobserve(), t(this, X).unobserve(), t(this, W).unobserve(), t(this, F).unobserve(), t(this, $).unobserve(), t(this, A).unobserve(), t(this, Y).unobserve(), t(this, tt).unobserve(), t(this, N).unobserve(), t(this, et).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, xt).unobserve(), t(this, It).unobserve(), t(this, T).unobserve(), t(this, Pt).unobserve(), t(this, st).unobserve(), t(this, M).unobserve(), t(this, it).unobserve(), t(this, q).unobserve(), t(this, rt).unobserve(), t(this, Lt).unobserve(), t(this, nt).unobserve(), t(this, ht).unobserve(), zt.unsubscribe(t(this, ee)), c(this, o, Se).call(this);
|
|
602
602
|
}
|
|
603
603
|
}
|
|
604
|
-
u = new WeakMap(), vt = new WeakMap(), P = new WeakMap(), X = new WeakMap(), W = new WeakMap(), F = new WeakMap(), $ = new WeakMap(), A = new WeakMap(), Y = new WeakMap(), tt = new WeakMap(), N = new WeakMap(), et = new WeakMap(), yt = new WeakMap(), D = new WeakMap(), y = new WeakMap(), Ct = new WeakMap(), wt = new WeakMap(), Et = new WeakMap(), xt = new WeakMap(), It = new WeakMap(), T = new WeakMap(), Pt = new WeakMap(), st = new WeakMap(), M = new WeakMap(), it = new WeakMap(), q = new WeakMap(), rt = new WeakMap(), Lt = new WeakMap(), nt = new WeakMap(), ht = new WeakMap(), ot = new WeakMap(), f = new WeakMap(), Tt = new WeakMap(), l = new WeakMap(), Xt = new WeakMap(), Yt = new WeakMap(), v = new WeakMap(), S = new WeakMap(),
|
|
604
|
+
u = new WeakMap(), vt = new WeakMap(), P = new WeakMap(), X = new WeakMap(), W = new WeakMap(), F = new WeakMap(), $ = new WeakMap(), A = new WeakMap(), Y = new WeakMap(), tt = new WeakMap(), N = new WeakMap(), et = new WeakMap(), yt = new WeakMap(), D = new WeakMap(), y = new WeakMap(), Ct = new WeakMap(), wt = new WeakMap(), Et = new WeakMap(), xt = new WeakMap(), It = new WeakMap(), T = new WeakMap(), Pt = new WeakMap(), st = new WeakMap(), M = new WeakMap(), it = new WeakMap(), q = new WeakMap(), rt = new WeakMap(), Lt = new WeakMap(), nt = new WeakMap(), ht = new WeakMap(), ot = new WeakMap(), f = new WeakMap(), Tt = new WeakMap(), l = new WeakMap(), Xt = new WeakMap(), Yt = new WeakMap(), v = new WeakMap(), S = new WeakMap(), z = new WeakMap(), V = new WeakMap(), lt = new WeakMap(), O = new WeakMap(), w = new WeakMap(), E = new WeakMap(), At = new WeakMap(), ct = new WeakMap(), U = new WeakMap(), G = new WeakMap(), at = new WeakMap(), Dt = new WeakMap(), ut = new WeakMap(), K = new WeakMap(), Mt = new WeakMap(), R = new WeakMap(), x = new WeakMap(), o = new WeakSet(), be = function() {
|
|
605
605
|
const e = t(this, P).current, i = t(this, X).current ? "-reverse" : "";
|
|
606
|
-
t(this, f).style.flexDirection = e === "x" ? `row${i}` : `column${i}`, t(this, V).axis = t(this, et).current ? "max" : e, t(this, lt).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, x) && t(this,
|
|
606
|
+
t(this, f).style.flexDirection = e === "x" ? `row${i}` : `column${i}`, t(this, V).axis = t(this, et).current ? "max" : e, t(this, lt).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, x) && t(this, L).call(this);
|
|
607
607
|
}, Zt = function() {
|
|
608
608
|
c(this, o, kt).call(this), t(this, Tt).assignedElements().forEach((e, i) => {
|
|
609
609
|
e instanceof HTMLElement && t(this, l).push(new Je(e, i, this));
|
|
610
610
|
}), t(this, f).style.transform = "", oe(this, "scrollSectionsChange", {
|
|
611
611
|
custom: !0,
|
|
612
612
|
composed: !0
|
|
613
|
-
}), t(this,
|
|
613
|
+
}), t(this, L).call(this), c(this, o, bt).call(this);
|
|
614
614
|
}, kt = function() {
|
|
615
615
|
t(this, l).forEach((e) => {
|
|
616
616
|
e.destroy();
|
|
@@ -619,16 +619,16 @@ u = new WeakMap(), vt = new WeakMap(), P = new WeakMap(), X = new WeakMap(), W =
|
|
|
619
619
|
composed: !0
|
|
620
620
|
});
|
|
621
621
|
}, le = function() {
|
|
622
|
-
t(this, G) || (r(this, G, !0), t(this, u).unsubscribe(t(this, Vt)), t(this, u).unlistenAnimationFrame(), clearInterval(t(this, Dt)), clearInterval(t(this, ut)), t(this, K).unlistenAnimationFrame(), t(this, V).disconnect(), t(this, lt).disconnect(), t(this, O).disconnect(), t(this, w).disconnect(), t(this, U) || this.sections.forEach((e) => {
|
|
622
|
+
t(this, G) || (r(this, G, !0), t(this, u).unsubscribe(t(this, Vt)), t(this, u).unlistenAnimationFrame(), clearInterval(t(this, Dt)), clearInterval(t(this, ut)), t(this, K).unlistenAnimationFrame(), t(this, V).disconnect(), t(this, lt).disconnect(), t(this, O).disconnect(), t(this, w).disconnect(), t(this, U) || (this.sections.forEach((e) => {
|
|
623
623
|
e.unsetTransform();
|
|
624
|
-
}));
|
|
624
|
+
}), t(this, L).call(this)));
|
|
625
625
|
}, ce = function() {
|
|
626
626
|
t(this, G) && (r(this, G, !1), t(this, u).subscribe(t(this, Vt)), t(this, V).connect(), t(this, lt).connect(), t(this, O).connect(), t(this, T).current && t(this, w).connect());
|
|
627
627
|
}, Se = function() {
|
|
628
|
-
t(this, at) || (r(this, at, !0), zt.unsubscribe(t(this,
|
|
628
|
+
t(this, at) || (r(this, at, !0), zt.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, kt).call(this) : (t(this, E).reset(), t(this, u).reset()), St.unregister(this));
|
|
629
629
|
}, ge = function() {
|
|
630
|
-
t(this, at) && (r(this, at, !1), St.register(this), (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), c(this, o, ce).call(this), zt.subscribe(t(this,
|
|
631
|
-
},
|
|
630
|
+
t(this, at) && (r(this, at, !1), St.register(this), (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), c(this, o, ce).call(this), zt.subscribe(t(this, L), me.SCROLL), jt.subscribe(this, t(this, L)));
|
|
631
|
+
}, L = new WeakMap(), Vt = new WeakMap(), Te = function(e) {
|
|
632
632
|
let i = t(this, E).current;
|
|
633
633
|
return t(this, y).current ? i = Be(e, t(this, l).length) : i = ze(e, 0, this.limit), i;
|
|
634
634
|
}, Ot = new WeakMap(), te = new WeakMap(), ve = function(e = 1) {
|
|
@@ -638,8 +638,8 @@ u = new WeakMap(), vt = new WeakMap(), P = new WeakMap(), X = new WeakMap(), W =
|
|
|
638
638
|
);
|
|
639
639
|
}, ye = function(e = "current") {
|
|
640
640
|
if (t(this, y).current && t(this, l).length) {
|
|
641
|
-
const i = t(this, u)[e] % (t(this, S) + t(this, v) + t(this,
|
|
642
|
-
return i < 0 ? t(this, S) + i + t(this, v) + t(this,
|
|
641
|
+
const i = t(this, u)[e] % (t(this, S) + t(this, v) + t(this, z));
|
|
642
|
+
return i < 0 ? t(this, S) + i + t(this, v) + t(this, z) : i;
|
|
643
643
|
} else
|
|
644
644
|
return t(this, u)[e];
|
|
645
645
|
}, bt = function() {
|
|
@@ -684,12 +684,12 @@ class Ce extends HTMLElement {
|
|
|
684
684
|
}
|
|
685
685
|
}
|
|
686
686
|
se = new WeakMap();
|
|
687
|
-
var dt,
|
|
687
|
+
var dt, k, _, Z, Rt, Ht, pt, Bt, ie, re;
|
|
688
688
|
class Xe extends Ce {
|
|
689
689
|
constructor() {
|
|
690
690
|
super();
|
|
691
691
|
s(this, dt, null);
|
|
692
|
-
s(this,
|
|
692
|
+
s(this, k, null);
|
|
693
693
|
s(this, _, !1);
|
|
694
694
|
s(this, Z, 0);
|
|
695
695
|
s(this, Rt, 0);
|
|
@@ -697,10 +697,10 @@ class Xe extends Ce {
|
|
|
697
697
|
s(this, pt, () => {
|
|
698
698
|
r(this, _, this.offsetWidth > this.offsetHeight);
|
|
699
699
|
const e = t(this, _) ? this.offsetWidth : this.offsetHeight;
|
|
700
|
-
r(this, Z, e / ((this.scrollElement.scrollSize + this.scrollElement.viewportSize) / e)), r(this, Z, Math.max(t(this, Z), 30)), t(this, _) ? (t(this,
|
|
700
|
+
r(this, Z, e / ((this.scrollElement.scrollSize + this.scrollElement.viewportSize) / e)), r(this, Z, Math.max(t(this, Z), 30)), t(this, _) ? (t(this, k).style.width = t(this, Z) + "px", t(this, k).style.height = "100%") : (t(this, k).style.width = "100%", t(this, k).style.height = t(this, Z) + "px"), r(this, Rt, e - t(this, Z)), this.scrollElement.scrollSize <= 0 ? this.style.display = "none" : this.style.display = "", t(this, Bt).call(this);
|
|
701
701
|
});
|
|
702
702
|
s(this, Bt, () => {
|
|
703
|
-
r(this, Ht, this.scrollElement.currentProgress * t(this, Rt)), t(this, _) ? t(this,
|
|
703
|
+
r(this, Ht, this.scrollElement.currentProgress * t(this, Rt)), t(this, _) ? t(this, k).style.transform = `translate3d(${t(this, Ht)}px, 0px, 0px)` : t(this, k).style.transform = `translate3d(0px, ${t(this, Ht)}px, 0px)`;
|
|
704
704
|
});
|
|
705
705
|
s(this, ie, () => {
|
|
706
706
|
this.setAttribute("axis", this.scrollElement.axisCSSProperty.current);
|
|
@@ -753,18 +753,18 @@ class Xe extends Ce {
|
|
|
753
753
|
}
|
|
754
754
|
}
|
|
755
755
|
get thumbElement() {
|
|
756
|
-
return t(this,
|
|
756
|
+
return t(this, k);
|
|
757
757
|
}
|
|
758
758
|
connectedCallback() {
|
|
759
759
|
super.connectedCallback(), this.setAttribute("drag-dead-zone", "");
|
|
760
760
|
const e = t(this, dt).assignedElements()[0] || t(this, dt).firstElementChild;
|
|
761
|
-
r(this,
|
|
761
|
+
r(this, k, e), t(this, k).addEventListener("pointerdown", t(this, re)), zt.subscribe(t(this, pt), me.SCROLL), jt.subscribe(this, t(this, pt)), jt.subscribe(this.scrollElement, t(this, pt)), this.scrollElement.onScroll(t(this, Bt)), this.scrollElement.axisCSSProperty.subscribe(t(this, ie));
|
|
762
762
|
}
|
|
763
763
|
disconnectedCallback() {
|
|
764
|
-
this.removeAttribute("drag-dead-zone"), this.style.display = "", t(this,
|
|
764
|
+
this.removeAttribute("drag-dead-zone"), this.style.display = "", t(this, k).removeEventListener("pointerdown", t(this, re)), zt.unsubscribe(t(this, pt)), jt.unsubscribe(t(this, pt)), this.scrollElement.offScroll(t(this, Bt)), this.scrollElement.axisCSSProperty.unsubscribe(t(this, ie));
|
|
765
765
|
}
|
|
766
766
|
}
|
|
767
|
-
dt = new WeakMap(),
|
|
767
|
+
dt = new WeakMap(), k = new WeakMap(), _ = new WeakMap(), Z = new WeakMap(), Rt = new WeakMap(), Ht = new WeakMap(), pt = new WeakMap(), Bt = new WeakMap(), ie = new WeakMap(), re = new WeakMap();
|
|
768
768
|
H && !customElements.get("e-scrollbar") && customElements.define("e-scrollbar", Xe);
|
|
769
769
|
var Wt, Ft, $t;
|
|
770
770
|
class Ae extends Ce {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var u=
|
|
1
|
+
"use strict";var u=i=>{throw TypeError(i)};var c=(i,t,r)=>t.has(i)||u("Cannot "+r);var s=(i,t,r)=>(c(i,t,"read from private field"),r?r.call(i):t.get(i)),l=(i,t,r)=>t.has(i)?u("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(i):t.set(i,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("../notifier/index.cjs"),g=require("../dom-JBOkFLTh.cjs");var h,e,o;class d{constructor(){l(this,h,new Set);l(this,e,new WeakMap);l(this,o,new f.Notifier)}get notifier(){return s(this,o)}register(t){s(this,e).has(t)||(s(this,e).set(t,{axis:"y",value:0,element:t}),s(this,h).add(t),s(this,o).notify())}unregister(t){s(this,e).has(t)&&s(this,h).has(t)&&(s(this,e).delete(t),s(this,h).delete(t),s(this,o).notify())}update(t,r,a){const n=s(this,e).get(t);n&&(n.axis=r,n.value=a)}hasEntry(t){return s(this,e).has(t)}getEntry(t){return s(this,e).get(t)}getAll(t){const r=g.getAllParentElements(t).filter(n=>s(this,h).has(n)),a=[];return r.forEach(n=>{s(this,e).has(n)&&a.push(s(this,e).get(n))}),a}}h=new WeakMap,e=new WeakMap,o=new WeakMap;const y=new d;exports.scrollEntries=y;
|
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
var
|
|
2
|
-
throw TypeError(
|
|
1
|
+
var l = (i) => {
|
|
2
|
+
throw TypeError(i);
|
|
3
3
|
};
|
|
4
|
-
var u = (
|
|
5
|
-
var
|
|
4
|
+
var u = (i, t, e) => t.has(i) || l("Cannot " + e);
|
|
5
|
+
var s = (i, t, e) => (u(i, t, "read from private field"), e ? e.call(i) : t.get(i)), f = (i, t, e) => t.has(i) ? l("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(i) : t.set(i, e);
|
|
6
6
|
import { Notifier as g } from "../notifier/index.js";
|
|
7
7
|
import { a as c } from "../dom-CVWzyXPH.js";
|
|
8
|
-
var
|
|
8
|
+
var n, r, a;
|
|
9
9
|
class p {
|
|
10
10
|
constructor() {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
f(this, n, /* @__PURE__ */ new Set());
|
|
12
|
+
f(this, r, /* @__PURE__ */ new WeakMap());
|
|
13
|
+
f(this, a, new g());
|
|
14
14
|
}
|
|
15
15
|
get notifier() {
|
|
16
|
-
return
|
|
16
|
+
return s(this, a);
|
|
17
17
|
}
|
|
18
18
|
register(t) {
|
|
19
|
-
|
|
19
|
+
s(this, r).has(t) || (s(this, r).set(t, {
|
|
20
20
|
axis: "y",
|
|
21
21
|
value: 0,
|
|
22
22
|
element: t
|
|
23
|
-
}),
|
|
23
|
+
}), s(this, n).add(t), s(this, a).notify());
|
|
24
24
|
}
|
|
25
25
|
unregister(t) {
|
|
26
|
-
|
|
26
|
+
s(this, r).has(t) && s(this, n).has(t) && (s(this, r).delete(t), s(this, n).delete(t), s(this, a).notify());
|
|
27
27
|
}
|
|
28
|
-
update(t,
|
|
29
|
-
const
|
|
30
|
-
|
|
28
|
+
update(t, e, o) {
|
|
29
|
+
const h = s(this, r).get(t);
|
|
30
|
+
h && (h.axis = e, h.value = o);
|
|
31
31
|
}
|
|
32
32
|
hasEntry(t) {
|
|
33
|
-
return
|
|
33
|
+
return s(this, r).has(t);
|
|
34
34
|
}
|
|
35
35
|
getEntry(t) {
|
|
36
|
-
return
|
|
36
|
+
return s(this, r).get(t);
|
|
37
37
|
}
|
|
38
38
|
getAll(t) {
|
|
39
|
-
const
|
|
40
|
-
return
|
|
41
|
-
|
|
39
|
+
const e = c(t).filter((h) => s(this, n).has(h)), o = [];
|
|
40
|
+
return e.forEach((h) => {
|
|
41
|
+
s(this, r).has(h) && o.push(s(this, r).get(h));
|
|
42
42
|
}), o;
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
-
|
|
45
|
+
n = new WeakMap(), r = new WeakMap(), a = new WeakMap();
|
|
46
46
|
const w = new p();
|
|
47
47
|
export {
|
|
48
48
|
w as scrollEntries
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ScrollSegmentElement, ScrollSegmentContainer } from './ScrollSegmentElement';
|
|
2
|
+
export declare class ScrollSegmentDefaultContainer implements ScrollSegmentContainer {
|
|
3
|
+
#private;
|
|
4
|
+
constructor(segmentElement: ScrollSegmentElement);
|
|
5
|
+
get element(): HTMLElement;
|
|
6
|
+
get currentScrollValue(): number;
|
|
7
|
+
get vertical(): boolean;
|
|
8
|
+
destroy(): void;
|
|
9
|
+
onScroll(callback: Function): void;
|
|
10
|
+
offScroll(callback: Function): void;
|
|
11
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { CSSProperty } from '../css-property';
|
|
2
|
+
import { Store } from '../store';
|
|
3
|
+
import { Damped } from '../animation';
|
|
4
|
+
export interface ScrollSegmentEvents {
|
|
5
|
+
scrollSegmentCapture: CustomEvent;
|
|
6
|
+
scrollSegmentCaptureFromStart: CustomEvent;
|
|
7
|
+
scrollSegmentCaptureFromFinish: CustomEvent;
|
|
8
|
+
scrollSegmentRelease: CustomEvent;
|
|
9
|
+
scrollSegmentReleaseFromStart: CustomEvent;
|
|
10
|
+
scrollSegmentReleaseFromFinish: CustomEvent;
|
|
11
|
+
}
|
|
12
|
+
export interface ScrollSegmentContainer {
|
|
13
|
+
element: HTMLElement;
|
|
14
|
+
currentScrollValue: number;
|
|
15
|
+
vertical: boolean;
|
|
16
|
+
onScroll(callback: Function): void;
|
|
17
|
+
offScroll(callback: Function): void;
|
|
18
|
+
}
|
|
19
|
+
export interface ScrollSegmentContainerElement extends Omit<ScrollSegmentContainer, 'element'>, HTMLElement {
|
|
20
|
+
}
|
|
21
|
+
export declare class ScrollSegmentElement extends HTMLElement {
|
|
22
|
+
#private;
|
|
23
|
+
get scrollContainer(): ScrollSegmentContainerElement | ScrollSegmentContainer;
|
|
24
|
+
set scrollContainer(value: ScrollSegmentContainerElement | ScrollSegmentContainer);
|
|
25
|
+
get distanceOffsetCSSProperty(): CSSProperty<number>;
|
|
26
|
+
get startOffsetCSSProperty(): CSSProperty<number>;
|
|
27
|
+
get captureOnceCSSProperty(): CSSProperty<boolean>;
|
|
28
|
+
get capturedCSSProperty(): CSSProperty<string>;
|
|
29
|
+
get releasedCSSProperty(): CSSProperty<string>;
|
|
30
|
+
get capturedFromStartCSSProperty(): CSSProperty<string>;
|
|
31
|
+
get capturedFromFinishCSSProperty(): CSSProperty<string>;
|
|
32
|
+
get releasedFromStartCSSProperty(): CSSProperty<string>;
|
|
33
|
+
get releasedFromFinishCSSProperty(): CSSProperty<string>;
|
|
34
|
+
get passedVarCSSProperty(): CSSProperty<string>;
|
|
35
|
+
get progressVarCSSProperty(): CSSProperty<string>;
|
|
36
|
+
get animationVarTypeCSSProperty(): CSSProperty<"target" | "current">;
|
|
37
|
+
get distanceVarCSSProperty(): CSSProperty<string>;
|
|
38
|
+
get startVarCSSProperty(): CSSProperty<string>;
|
|
39
|
+
get finishVarCSSProperty(): CSSProperty<string>;
|
|
40
|
+
get disabledCSSProperty(): CSSProperty<boolean>;
|
|
41
|
+
get dampingCSSProperty(): CSSProperty<number>;
|
|
42
|
+
get massCSSProperty(): CSSProperty<number>;
|
|
43
|
+
get stiffnessCSSProperty(): CSSProperty<number>;
|
|
44
|
+
get targetCSSProperty(): CSSProperty<string>;
|
|
45
|
+
get isCaptured(): Store<boolean>;
|
|
46
|
+
get isReleased(): Store<boolean>;
|
|
47
|
+
get isCapturedFromStart(): Store<boolean>;
|
|
48
|
+
get isReleasedFromStart(): Store<boolean>;
|
|
49
|
+
get isCapturedFromFinish(): Store<boolean>;
|
|
50
|
+
get isReleasedFromFinish(): Store<boolean>;
|
|
51
|
+
get directionPosition(): number;
|
|
52
|
+
get directionSize(): number;
|
|
53
|
+
get passed(): Damped;
|
|
54
|
+
get progress(): number;
|
|
55
|
+
get start(): number;
|
|
56
|
+
get finish(): number;
|
|
57
|
+
get distance(): number;
|
|
58
|
+
get isCapturedOnce(): boolean;
|
|
59
|
+
get isDisabled(): boolean;
|
|
60
|
+
resize(): void;
|
|
61
|
+
tick(): void;
|
|
62
|
+
disable(): void;
|
|
63
|
+
enable(): void;
|
|
64
|
+
protected connectedCallback(): void;
|
|
65
|
+
protected disconnectedCallback(): void;
|
|
66
|
+
protected removeVar(name: string | undefined): void;
|
|
67
|
+
protected setVar(name: string | undefined, value: string | number): void;
|
|
68
|
+
protected getDistance(): number;
|
|
69
|
+
protected getStart(): number;
|
|
70
|
+
protected findAnotherScrollEntries: () => void;
|
|
71
|
+
}
|
|
72
|
+
declare global {
|
|
73
|
+
interface HTMLElementTagNameMap {
|
|
74
|
+
'scroll-segment': ScrollSegmentElement;
|
|
75
|
+
}
|
|
76
|
+
interface HTMLElementEventMap extends ScrollSegmentEvents {
|
|
77
|
+
}
|
|
78
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var ot=a=>{throw TypeError(a)};var rt=(a,f,r)=>f.has(a)||ot("Cannot "+r);var t=(a,f,r)=>(rt(a,f,"read from private field"),r?r.call(a):f.get(a)),i=(a,f,r)=>f.has(a)?ot("Cannot add the same private member more than once"):f instanceof WeakSet?f.add(a):f.set(a,r),e=(a,f,r,s)=>(rt(a,f,"write to private field"),s?s.call(a,r):f.set(a,r),r),c=(a,f,r)=>(rt(a,f,"access private method"),r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../css-property/index.cjs"),ut=require("../order/index.cjs"),at=require("../window-resizer/index.cjs"),wt=require("../index-Cqw2NKev.cjs"),U=require("../events-KVanG9sR.cjs"),Ft=require("../function-MthRj-GJ.cjs"),lt=require("../layout-Ctc2p3uz.cjs"),Vt=require("../math-GDWEqu7y.cjs"),X=require("../Store-DRp_K37w.cjs"),Et=require("../scroll-entries/index.cjs");require("../ticker/index.cjs");const Lt=require("../Damped-BbJjFOLH.cjs");var S,j,B,G,K,T,D,_,M,d,y,g,v,A,p,R,O,Z,k,z,q,l,P,w,E,L,F,Y,n,$,N,tt,m,H,C,b,V,J,I,u,h,ft,it,ht,dt,mt,bt,Ct,yt,gt,st,Q,W,vt,Pt,nt,St;let pt=(St=class extends HTMLElement{constructor(){super();i(this,h);i(this,S);i(this,j);i(this,B);i(this,G);i(this,K);i(this,T);i(this,D);i(this,_);i(this,M);i(this,d);i(this,y);i(this,g);i(this,v);i(this,A);i(this,p);i(this,R);i(this,O);i(this,Z);i(this,k);i(this,z);i(this,q);i(this,l);i(this,P);i(this,w);i(this,E);i(this,L);i(this,F);i(this,Y);i(this,n);i(this,$);i(this,N);i(this,tt);i(this,m);i(this,H);i(this,C);i(this,b);i(this,V);i(this,J);i(this,I);i(this,u);i(this,st);i(this,Q);e(this,S,null),e(this,j,new o.CSSProperty(this,"--damping",20)),e(this,B,new o.CSSProperty(this,"--mass",0)),e(this,G,new o.CSSProperty(this,"--stiffness",0)),e(this,K,new o.CSSProperty(this,"--target","")),e(this,T,new o.CSSProperty(this,"--disabled",!1)),e(this,D,new o.CSSProperty(this,"--distance-offset",0,{rawValueCheck:!1})),e(this,_,new o.CSSProperty(this,"--start-offset",0,{rawValueCheck:!1})),e(this,M,new o.CSSProperty(this,"--capture-once",!1)),e(this,d,new o.CSSProperty(this,"--captured","")),e(this,y,new o.CSSProperty(this,"--released","")),e(this,g,new o.CSSProperty(this,"--captured-from-start","")),e(this,v,new o.CSSProperty(this,"--captured-from-finish","")),e(this,A,new o.CSSProperty(this,"--released-from-start","")),e(this,p,new o.CSSProperty(this,"--released-from-finish","")),e(this,R,new o.CSSProperty(this,"--passed-var","")),e(this,O,new o.CSSProperty(this,"--progress-var","")),e(this,Z,new o.CSSProperty(this,"--animation-var-type","current")),e(this,k,new o.CSSProperty(this,"--distance-var","")),e(this,z,new o.CSSProperty(this,"--start-var","")),e(this,q,new o.CSSProperty(this,"--finish-var","")),e(this,l,new X.Store(!1)),e(this,P,new X.Store(!1)),e(this,w,new X.Store(!1)),e(this,E,new X.Store(!1)),e(this,L,new X.Store(!1)),e(this,F,new X.Store(!1)),e(this,Y,[]),e(this,n,this),e(this,$,0),e(this,N,0),e(this,tt,0),e(this,m,new Lt.Damped(0,{order:ut.TICK_ORDER.SEGMENT,min:0,max:1})),e(this,H,0),e(this,C,0),e(this,b,0),e(this,V,0),e(this,J,!1),e(this,I,!1),e(this,u,!0),this.findAnotherScrollEntries=Ft.debounce(()=>{const r=Et.scrollEntries.getAll(this).reverse();let s=0;r.forEach((x,et)=>{x.element===t(this,S)&&(s=et)}),e(this,Y,r.slice(s+1))},0),e(this,st,()=>{t(this,u)||(this.resize(),t(this,Q).call(this))}),e(this,Q,()=>{!t(this,u)&&t(this,J)&&this.tick()})}get scrollContainer(){return t(this,S)}set scrollContainer(r){c(this,h,ht).call(this),e(this,S,r),c(this,h,it).call(this)}get distanceOffsetCSSProperty(){return t(this,D)}get startOffsetCSSProperty(){return t(this,_)}get captureOnceCSSProperty(){return t(this,M)}get capturedCSSProperty(){return t(this,d)}get releasedCSSProperty(){return t(this,y)}get capturedFromStartCSSProperty(){return t(this,g)}get capturedFromFinishCSSProperty(){return t(this,v)}get releasedFromStartCSSProperty(){return t(this,A)}get releasedFromFinishCSSProperty(){return t(this,p)}get passedVarCSSProperty(){return t(this,R)}get progressVarCSSProperty(){return t(this,O)}get animationVarTypeCSSProperty(){return t(this,Z)}get distanceVarCSSProperty(){return t(this,k)}get startVarCSSProperty(){return t(this,z)}get finishVarCSSProperty(){return t(this,q)}get disabledCSSProperty(){return t(this,T)}get dampingCSSProperty(){return t(this,j)}get massCSSProperty(){return t(this,B)}get stiffnessCSSProperty(){return t(this,G)}get targetCSSProperty(){return t(this,K)}get isCaptured(){return t(this,l)}get isReleased(){return t(this,P)}get isCapturedFromStart(){return t(this,w)}get isReleasedFromStart(){return t(this,E)}get isCapturedFromFinish(){return t(this,L)}get isReleasedFromFinish(){return t(this,F)}get directionPosition(){return t(this,$)}get directionSize(){return t(this,N)}get passed(){return t(this,m)}get progress(){return t(this,H)}get start(){return t(this,C)}get finish(){return t(this,V)}get distance(){return t(this,b)}get isCapturedOnce(){return t(this,I)}get isDisabled(){return t(this,u)}resize(){e(this,N,t(this,S).vertical?this.offsetHeight:this.offsetWidth);const r=t(this,S)instanceof HTMLElement?t(this,S):t(this,S).element;e(this,$,t(this,S).vertical?lt.getCumulativeOffsetTop(this,r):lt.getCumulativeOffsetLeft(this,r));const x=c(this,h,ft).call(this).reduce((et,ct)=>et+(t(this,S).vertical?ct.offsetTop:ct.offsetLeft),0);e(this,$,t(this,$)-x),e(this,C,this.getStart()),e(this,b,this.getDistance()),e(this,C,t(this,C)+t(this,_).current),e(this,b,t(this,b)+t(this,D).current),e(this,V,t(this,C)+t(this,b)),t(this,S).currentScrollValue>t(this,V)&&!t(this,l).current&&!t(this,P).current&&(t(this,l).current=!0),this.setVar(t(this,z).current,t(this,C)),this.setVar(t(this,q).current,t(this,V)),this.setVar(t(this,k).current,t(this,b)),t(this,m).max=t(this,b),e(this,J,!0)}tick(){let r=t(this,S).currentScrollValue;t(this,Y).forEach(x=>{r+=x.value}),t(this,m).set(r-t(this,C));const s=Math.round(r);t(this,l).current&&(s>=t(this,C)?t(this,w).current||c(this,h,bt).call(this):t(this,w).current&&!t(this,E).current&&c(this,h,yt).call(this),s<t(this,V)?t(this,F).current&&!t(this,L).current&&c(this,h,Ct).call(this):t(this,w).current&&!t(this,F).current&&c(this,h,gt).call(this)),s>=t(this,C)&&s<t(this,V)?t(this,l).current||c(this,h,dt).call(this):t(this,l).current&&(t(this,m).set(Vt.step(t(this,b)/2,t(this,m).target,0,t(this,b))),c(this,h,mt).call(this)),t(this,I)&&t(this,M).current&&(t(this,d).current&&t(this,n).classList.add(t(this,d).current),e(this,u,!0))}disable(){this.style.cssText="",e(this,$,0),e(this,N,0),t(this,m).reset(),e(this,H,0),e(this,C,0),e(this,b,0),e(this,V,0),e(this,J,!1),t(this,l).current=!1,t(this,P).current=!1,t(this,w).current=!1,t(this,E).current=!1,t(this,L).current=!1,t(this,F).current=!1,e(this,I,!1),e(this,u,!0),c(this,h,nt).call(this)}enable(){e(this,u,!1)}connectedCallback(){c(this,h,it).call(this)}disconnectedCallback(){c(this,h,ht).call(this)}removeVar(r){r&&t(this,n).style.removeProperty(`--${r}`)}setVar(r,s){r&&t(this,n).style.setProperty(`--${r}`,s.toString())}getDistance(){return t(this,N)+t(this,tt)}getStart(){return t(this,$)-t(this,tt)}},S=new WeakMap,j=new WeakMap,B=new WeakMap,G=new WeakMap,K=new WeakMap,T=new WeakMap,D=new WeakMap,_=new WeakMap,M=new WeakMap,d=new WeakMap,y=new WeakMap,g=new WeakMap,v=new WeakMap,A=new WeakMap,p=new WeakMap,R=new WeakMap,O=new WeakMap,Z=new WeakMap,k=new WeakMap,z=new WeakMap,q=new WeakMap,l=new WeakMap,P=new WeakMap,w=new WeakMap,E=new WeakMap,L=new WeakMap,F=new WeakMap,Y=new WeakMap,n=new WeakMap,$=new WeakMap,N=new WeakMap,tt=new WeakMap,m=new WeakMap,H=new WeakMap,C=new WeakMap,b=new WeakMap,V=new WeakMap,J=new WeakMap,I=new WeakMap,u=new WeakMap,h=new WeakSet,ft=function(){const r=[];let s=this.parentElement;for(;s;)window.getComputedStyle(s).position==="sticky"&&r.push(s),s=s.parentElement;return r},it=function(){if(!t(this,S))return;t(this,l).subscribe(s=>{s.current&&U.dispatchEvent(this,"scrollSegmentCapture",{composed:!0,custom:!0})}),t(this,w).subscribe(s=>{s.current&&U.dispatchEvent(this,"scrollSegmentCaptureFromStart",{composed:!0,custom:!0})}),t(this,L).subscribe(s=>{s.current&&U.dispatchEvent(this,"scrollSegmentCaptureFromFinish",{composed:!0,custom:!0})}),t(this,P).subscribe(s=>{s.current&&U.dispatchEvent(this,"scrollSegmentRelease",{composed:!0,custom:!0})}),t(this,E).subscribe(s=>{s.current&&U.dispatchEvent(this,"scrollSegmentReleaseFromStart",{composed:!0,custom:!0})}),t(this,F).subscribe(s=>{s.current&&U.dispatchEvent(this,"scrollSegmentReleaseFromFinish",{composed:!0,custom:!0})}),t(this,j).observe(),t(this,B).observe(),t(this,G).observe(),t(this,K).observe(),t(this,T).observe(),t(this,D).observe(),t(this,_).observe(),t(this,M).observe(),t(this,d).observe(),t(this,y).observe(),t(this,g).observe(),t(this,v).observe(),t(this,A).observe(),t(this,p).observe(),t(this,R).observe(),t(this,O).observe(),t(this,Z).observe(),t(this,k).observe(),t(this,z).observe(),t(this,q).observe();let r=!1;this.findAnotherScrollEntries(),t(this,T).current||this.enable(),t(this,j).subscribe(s=>{t(this,m).damping=s.current}),t(this,B).subscribe(s=>{t(this,m).mass=s.current}),t(this,G).subscribe(s=>{t(this,m).stiffness=s.current}),t(this,K).subscribe(s=>{s.previous&&c(this,h,nt).call(this),s.current?s.current==="parent"?e(this,n,this.parentElement||this):e(this,n,document.querySelector(s.current)||this):e(this,n,this)}),t(this,T).subscribe(s=>{s.current&&!s.previous?this.disable():!s.current&&s.previous&&(this.resize(),this.enable())}),t(this,_).subscribe(()=>{r&&!t(this,u)&&this.resize()}),t(this,D).subscribe(()=>{r&&!t(this,u)&&this.resize()}),t(this,d).subscribe(s=>{c(this,h,W).call(this,s)}),t(this,g).subscribe(s=>{c(this,h,W).call(this,s)}),t(this,v).subscribe(s=>{c(this,h,W).call(this,s)}),t(this,y).subscribe(s=>{c(this,h,W).call(this,s)}),t(this,A).subscribe(s=>{c(this,h,W).call(this,s)}),t(this,p).subscribe(s=>{c(this,h,W).call(this,s)}),t(this,M).subscribe(s=>{t(this,u)||!s.current&&s.previous&&(this.resize(),this.enable())}),t(this,R).subscribe(s=>{t(this,u)||(this.removeVar(s.previous),this.setVar(s.current,this.passed.current))}),t(this,O).subscribe(s=>{t(this,u)||(this.removeVar(s.previous),this.setVar(s.current,t(this,H)))}),t(this,z).subscribe(s=>{t(this,u)||(this.removeVar(s.previous),this.setVar(s.current,t(this,C)))}),t(this,q).subscribe(s=>{t(this,u)||(this.removeVar(s.previous),this.setVar(s.current,t(this,V)))}),t(this,k).subscribe(s=>{t(this,u)||(this.removeVar(s.previous),this.setVar(s.current,t(this,b)))}),t(this,m).subscribe(s=>{const x=t(this,m)[t(this,Z).current];e(this,H,x/t(this,b)||0),this.setVar(t(this,R).current,x.toFixed(6)),this.setVar(t(this,O).current,t(this,H).toFixed(6))}),at.windowResizer.subscribe(t(this,st),ut.RESIZE_ORDER.SCROLL),this.scrollContainer.onScroll(t(this,Q)),r=!0},ht=function(){t(this,S)&&(at.windowResizer.unsubscribe(t(this,st)),this.scrollContainer.offScroll(t(this,Q)),t(this,j).close(),t(this,B).close(),t(this,G).close(),t(this,K).close(),t(this,T).close(),t(this,D).close(),t(this,_).close(),t(this,M).close(),t(this,d).close(),t(this,y).close(),t(this,g).close(),t(this,v).close(),t(this,A).close(),t(this,p).close(),t(this,R).close(),t(this,O).close(),t(this,k).close(),t(this,z).close(),t(this,q).close(),t(this,l).close(),t(this,P).close(),t(this,w).close(),t(this,E).close(),t(this,L).close(),t(this,F).close(),this.disable())},dt=function(){t(this,l).current=!0,t(this,P).current=!1,e(this,I,!0),t(this,y).current&&t(this,n).classList.remove(t(this,y).current),t(this,p).current&&t(this,n).classList.remove(t(this,p).current),t(this,p).current&&t(this,n).classList.remove(t(this,p).current),t(this,d).current&&t(this,n).classList.add(t(this,d).current)},mt=function(){t(this,P).current=!0,t(this,l).current=!1,e(this,I,!0),t(this,d).current&&t(this,n).classList.remove(t(this,d).current),t(this,g).current&&t(this,n).classList.remove(t(this,g).current),t(this,v).current&&t(this,n).classList.remove(t(this,v).current),t(this,y).current&&t(this,n).classList.add(t(this,y).current)},bt=function(){t(this,l).current=!0,t(this,w).current=!0,t(this,E).current=!1,t(this,g).current&&t(this,n).classList.add(t(this,g).current)},Ct=function(){t(this,l).current=!0,t(this,L).current=!0,t(this,F).current=!1,t(this,v).current&&t(this,n).classList.add(t(this,v).current)},yt=function(){t(this,P).current=!0,t(this,E).current=!0,t(this,w).current=!1,t(this,p).current&&t(this,n).classList.add(t(this,p).current)},gt=function(){t(this,P).current=!0,t(this,F).current=!0,t(this,L).current=!1,t(this,p).current&&t(this,n).classList.add(t(this,p).current)},st=new WeakMap,Q=new WeakMap,W=function(r){if(t(this,u)){r.previous&&t(this,n).classList.remove(r.previous),r.current&&t(this,n).classList.remove(r.current);return}r.current&&t(this,l).current?(r.previous&&t(this,n).classList.remove(r.previous),t(this,n).classList.add(r.current)):!r.current&&r.previous&&t(this,n).classList.remove(r.previous)},vt=function(...r){r.forEach(s=>{s&&t(this,n).classList.remove(s)})},Pt=function(...r){r.forEach(s=>{s&&t(this,n).style.removeProperty(`--${s}`)})},nt=function(){c(this,h,vt).call(this,t(this,d).current,t(this,g).current,t(this,v).current,t(this,y).current,t(this,A).current,t(this,p).current),c(this,h,Pt).call(this,t(this,R).current,t(this,O).current,t(this,k).current,t(this,z).current,t(this,q).current)},St);wt.isBrowser&&!customElements.get("scroll-segment")&&customElements.define("scroll-segment",pt);exports.ScrollSegmentElement=pt;
|
|
1
|
+
"use strict";var St=a=>{throw TypeError(a)};var ct=(a,c,r)=>c.has(a)||St("Cannot "+r);var t=(a,c,r)=>(ct(a,c,"read from private field"),r?r.call(a):c.get(a)),i=(a,c,r)=>c.has(a)?St("Cannot add the same private member more than once"):c instanceof WeakSet?c.add(a):c.set(a,r),s=(a,c,r,e)=>(ct(a,c,"write to private field"),e?e.call(a,r):c.set(a,r),r),o=(a,c,r)=>(ct(a,c,"access private method"),r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Lt=require("../dom-JBOkFLTh.cjs"),Rt=require("../index-Cqw2NKev.cjs"),ft=require("../element-resizer/index.cjs"),nt=require("../window-resizer/index.cjs"),u=require("../css-property/index.cjs"),pt=require("../order/index.cjs"),Y=require("../events-KVanG9sR.cjs"),zt=require("../function-MthRj-GJ.cjs"),ot=require("../layout-Ctc2p3uz.cjs"),Ot=require("../math-GDWEqu7y.cjs"),tt=require("../Store-DRp_K37w.cjs"),qt=require("../scroll-entries/index.cjs");require("../ticker/index.cjs");const xt=require("../Damped-BbJjFOLH.cjs");var V,ht,et,W;class ut{constructor(c){i(this,V,null);i(this,ht);i(this,et,!1);i(this,W,()=>{s(this,et,!(t(this,V).scrollWidth>t(this,V).clientWidth))});s(this,ht,c),s(this,V,Lt.findScrollParentElement(t(this,ht))),ft.elementResizer.subscribe(t(this,V),t(this,W)),nt.windowResizer.subscribe(t(this,W)),t(this,W).call(this)}get element(){return t(this,V)}get currentScrollValue(){return t(this,et)?t(this,V).scrollTop:t(this,V).scrollLeft}get vertical(){return t(this,et)}destroy(){ft.elementResizer.unsubscribe(t(this,W)),nt.windowResizer.unsubscribe(t(this,W))}onScroll(c){t(this,V).addEventListener("scroll",c)}offScroll(c){t(this,V).removeEventListener("scroll",c)}}V=new WeakMap,ht=new WeakMap,et=new WeakMap,W=new WeakMap;var l,j,B,G,K,k,T,_,M,d,g,y,v,A,p,z,O,J,q,x,D,f,P,w,L,R,F,st,n,$,N,rt,m,H,C,b,E,Q,I,S,h,bt,at,Ct,gt,yt,vt,Pt,wt,it,U,Z,Vt,Ft,lt,dt;let mt=(dt=class extends HTMLElement{constructor(){super(...arguments);i(this,h);i(this,l);i(this,j);i(this,B);i(this,G);i(this,K);i(this,k);i(this,T);i(this,_);i(this,M);i(this,d);i(this,g);i(this,y);i(this,v);i(this,A);i(this,p);i(this,z);i(this,O);i(this,J);i(this,q);i(this,x);i(this,D);i(this,f);i(this,P);i(this,w);i(this,L);i(this,R);i(this,F);i(this,st);i(this,n);i(this,$);i(this,N);i(this,rt);i(this,m);i(this,H);i(this,C);i(this,b);i(this,E);i(this,Q);i(this,I);i(this,S);i(this,it);i(this,U);s(this,l,null),s(this,j,new u.CSSProperty(this,"--damping",20)),s(this,B,new u.CSSProperty(this,"--mass",0)),s(this,G,new u.CSSProperty(this,"--stiffness",0)),s(this,K,new u.CSSProperty(this,"--target","")),s(this,k,new u.CSSProperty(this,"--disabled",!1)),s(this,T,new u.CSSProperty(this,"--distance-offset",0,{rawValueCheck:!1})),s(this,_,new u.CSSProperty(this,"--start-offset",0,{rawValueCheck:!1})),s(this,M,new u.CSSProperty(this,"--capture-once",!1)),s(this,d,new u.CSSProperty(this,"--captured","")),s(this,g,new u.CSSProperty(this,"--released","")),s(this,y,new u.CSSProperty(this,"--captured-from-start","")),s(this,v,new u.CSSProperty(this,"--captured-from-finish","")),s(this,A,new u.CSSProperty(this,"--released-from-start","")),s(this,p,new u.CSSProperty(this,"--released-from-finish","")),s(this,z,new u.CSSProperty(this,"--passed-var","")),s(this,O,new u.CSSProperty(this,"--progress-var","")),s(this,J,new u.CSSProperty(this,"--animation-var-type","current")),s(this,q,new u.CSSProperty(this,"--distance-var","")),s(this,x,new u.CSSProperty(this,"--start-var","")),s(this,D,new u.CSSProperty(this,"--finish-var","")),s(this,f,new tt.Store(!1)),s(this,P,new tt.Store(!1)),s(this,w,new tt.Store(!1)),s(this,L,new tt.Store(!1)),s(this,R,new tt.Store(!1)),s(this,F,new tt.Store(!1)),s(this,st,[]),s(this,n,this),s(this,$,0),s(this,N,0),s(this,rt,0),s(this,m,new xt.Damped(0,{order:pt.TICK_ORDER.SEGMENT,min:0,max:1})),s(this,H,0),s(this,C,0),s(this,b,0),s(this,E,0),s(this,Q,!1),s(this,I,!1),s(this,S,!0),this.findAnotherScrollEntries=zt.debounce(()=>{const r=qt.scrollEntries.getAll(this).reverse();let e=0;r.forEach((X,Et)=>{X.element===t(this,l)&&(e=Et)}),s(this,st,r.slice(e+1))},0),s(this,it,()=>{t(this,S)||(this.resize(),t(this,U).call(this))}),s(this,U,()=>{!t(this,S)&&t(this,Q)&&this.tick()})}get scrollContainer(){return t(this,l)}set scrollContainer(r){o(this,h,at).call(this),s(this,l,r),o(this,h,bt).call(this)}get distanceOffsetCSSProperty(){return t(this,T)}get startOffsetCSSProperty(){return t(this,_)}get captureOnceCSSProperty(){return t(this,M)}get capturedCSSProperty(){return t(this,d)}get releasedCSSProperty(){return t(this,g)}get capturedFromStartCSSProperty(){return t(this,y)}get capturedFromFinishCSSProperty(){return t(this,v)}get releasedFromStartCSSProperty(){return t(this,A)}get releasedFromFinishCSSProperty(){return t(this,p)}get passedVarCSSProperty(){return t(this,z)}get progressVarCSSProperty(){return t(this,O)}get animationVarTypeCSSProperty(){return t(this,J)}get distanceVarCSSProperty(){return t(this,q)}get startVarCSSProperty(){return t(this,x)}get finishVarCSSProperty(){return t(this,D)}get disabledCSSProperty(){return t(this,k)}get dampingCSSProperty(){return t(this,j)}get massCSSProperty(){return t(this,B)}get stiffnessCSSProperty(){return t(this,G)}get targetCSSProperty(){return t(this,K)}get isCaptured(){return t(this,f)}get isReleased(){return t(this,P)}get isCapturedFromStart(){return t(this,w)}get isReleasedFromStart(){return t(this,L)}get isCapturedFromFinish(){return t(this,R)}get isReleasedFromFinish(){return t(this,F)}get directionPosition(){return t(this,$)}get directionSize(){return t(this,N)}get passed(){return t(this,m)}get progress(){return t(this,H)}get start(){return t(this,C)}get finish(){return t(this,E)}get distance(){return t(this,b)}get isCapturedOnce(){return t(this,I)}get isDisabled(){return t(this,S)}resize(){s(this,N,t(this,l).vertical?this.offsetHeight:this.offsetWidth);const r=t(this,l)instanceof HTMLElement?t(this,l):t(this,l).element;s(this,$,t(this,l).vertical?ot.getCumulativeOffsetTop(this,r):ot.getCumulativeOffsetLeft(this,r));const e=ot.getStickyOffset(this,t(this,l).vertical?"top":"left");s(this,$,t(this,$)-e),s(this,C,this.getStart()),s(this,b,this.getDistance()),s(this,C,t(this,C)+t(this,_).current),s(this,b,t(this,b)+t(this,T).current),s(this,E,t(this,C)+t(this,b)),t(this,l).currentScrollValue>t(this,E)&&!t(this,f).current&&!t(this,P).current&&(t(this,f).current=!0),this.setVar(t(this,x).current,t(this,C)),this.setVar(t(this,D).current,t(this,E)),this.setVar(t(this,q).current,t(this,b)),t(this,m).max=t(this,b),s(this,Q,!0)}tick(){let r=t(this,l).currentScrollValue;t(this,st).forEach(X=>{r+=X.value}),t(this,m).set(r-t(this,C));const e=Math.round(r);t(this,f).current&&(e>=t(this,C)?t(this,w).current||o(this,h,yt).call(this):t(this,w).current&&!t(this,L).current&&o(this,h,Pt).call(this),e<t(this,E)?t(this,F).current&&!t(this,R).current&&o(this,h,vt).call(this):t(this,w).current&&!t(this,F).current&&o(this,h,wt).call(this)),e>=t(this,C)&&e<t(this,E)?t(this,f).current||o(this,h,Ct).call(this):t(this,f).current&&(t(this,m).set(Ot.step(t(this,b)/2,t(this,m).target,0,t(this,b))),o(this,h,gt).call(this)),t(this,I)&&t(this,M).current&&(t(this,d).current&&t(this,n).classList.add(t(this,d).current),s(this,S,!0))}disable(){this.style.cssText="",s(this,$,0),s(this,N,0),t(this,m).reset(),s(this,H,0),s(this,C,0),s(this,b,0),s(this,E,0),s(this,Q,!1),t(this,f).current=!1,t(this,P).current=!1,t(this,w).current=!1,t(this,L).current=!1,t(this,R).current=!1,t(this,F).current=!1,s(this,I,!1),s(this,S,!0),o(this,h,lt).call(this)}enable(){s(this,S,!1)}connectedCallback(){this.scrollContainer=new ut(this)}disconnectedCallback(){t(this,l)instanceof ut&&t(this,l).destroy(),o(this,h,at).call(this)}removeVar(r){r&&t(this,n).style.removeProperty(`--${r}`)}setVar(r,e){r&&t(this,n).style.setProperty(`--${r}`,e.toString())}getDistance(){return t(this,N)+t(this,rt)}getStart(){return t(this,$)-t(this,rt)}},l=new WeakMap,j=new WeakMap,B=new WeakMap,G=new WeakMap,K=new WeakMap,k=new WeakMap,T=new WeakMap,_=new WeakMap,M=new WeakMap,d=new WeakMap,g=new WeakMap,y=new WeakMap,v=new WeakMap,A=new WeakMap,p=new WeakMap,z=new WeakMap,O=new WeakMap,J=new WeakMap,q=new WeakMap,x=new WeakMap,D=new WeakMap,f=new WeakMap,P=new WeakMap,w=new WeakMap,L=new WeakMap,R=new WeakMap,F=new WeakMap,st=new WeakMap,n=new WeakMap,$=new WeakMap,N=new WeakMap,rt=new WeakMap,m=new WeakMap,H=new WeakMap,C=new WeakMap,b=new WeakMap,E=new WeakMap,Q=new WeakMap,I=new WeakMap,S=new WeakMap,h=new WeakSet,bt=function(){if(!t(this,l))return;t(this,f).subscribe(e=>{e.current&&Y.dispatchEvent(this,"scrollSegmentCapture",{composed:!0,custom:!0})}),t(this,w).subscribe(e=>{e.current&&Y.dispatchEvent(this,"scrollSegmentCaptureFromStart",{composed:!0,custom:!0})}),t(this,R).subscribe(e=>{e.current&&Y.dispatchEvent(this,"scrollSegmentCaptureFromFinish",{composed:!0,custom:!0})}),t(this,P).subscribe(e=>{e.current&&Y.dispatchEvent(this,"scrollSegmentRelease",{composed:!0,custom:!0})}),t(this,L).subscribe(e=>{e.current&&Y.dispatchEvent(this,"scrollSegmentReleaseFromStart",{composed:!0,custom:!0})}),t(this,F).subscribe(e=>{e.current&&Y.dispatchEvent(this,"scrollSegmentReleaseFromFinish",{composed:!0,custom:!0})}),t(this,j).observe(),t(this,B).observe(),t(this,G).observe(),t(this,K).observe(),t(this,k).observe(),t(this,T).observe(),t(this,_).observe(),t(this,M).observe(),t(this,d).observe(),t(this,g).observe(),t(this,y).observe(),t(this,v).observe(),t(this,A).observe(),t(this,p).observe(),t(this,z).observe(),t(this,O).observe(),t(this,J).observe(),t(this,q).observe(),t(this,x).observe(),t(this,D).observe();let r=!1;this.findAnotherScrollEntries(),t(this,k).current||this.enable(),t(this,j).subscribe(e=>{t(this,m).damping=e.current}),t(this,B).subscribe(e=>{t(this,m).mass=e.current}),t(this,G).subscribe(e=>{t(this,m).stiffness=e.current}),t(this,K).subscribe(e=>{e.previous&&o(this,h,lt).call(this),e.current?e.current==="parent"?s(this,n,this.parentElement||this):s(this,n,document.querySelector(e.current)||this):s(this,n,this)}),t(this,k).subscribe(e=>{e.current&&!e.previous?this.disable():!e.current&&e.previous&&(this.resize(),this.enable())}),t(this,_).subscribe(()=>{r&&!t(this,S)&&this.resize()}),t(this,T).subscribe(()=>{r&&!t(this,S)&&this.resize()}),t(this,d).subscribe(e=>{o(this,h,Z).call(this,e)}),t(this,y).subscribe(e=>{o(this,h,Z).call(this,e)}),t(this,v).subscribe(e=>{o(this,h,Z).call(this,e)}),t(this,g).subscribe(e=>{o(this,h,Z).call(this,e)}),t(this,A).subscribe(e=>{o(this,h,Z).call(this,e)}),t(this,p).subscribe(e=>{o(this,h,Z).call(this,e)}),t(this,M).subscribe(e=>{t(this,S)||!e.current&&e.previous&&(this.resize(),this.enable())}),t(this,z).subscribe(e=>{t(this,S)||(this.removeVar(e.previous),this.setVar(e.current,this.passed.current))}),t(this,O).subscribe(e=>{t(this,S)||(this.removeVar(e.previous),this.setVar(e.current,t(this,H)))}),t(this,x).subscribe(e=>{t(this,S)||(this.removeVar(e.previous),this.setVar(e.current,t(this,C)))}),t(this,D).subscribe(e=>{t(this,S)||(this.removeVar(e.previous),this.setVar(e.current,t(this,E)))}),t(this,q).subscribe(e=>{t(this,S)||(this.removeVar(e.previous),this.setVar(e.current,t(this,b)))}),t(this,m).subscribe(e=>{const X=t(this,m)[t(this,J).current];s(this,H,X/t(this,b)||0),this.setVar(t(this,z).current,X.toFixed(6)),this.setVar(t(this,O).current,t(this,H).toFixed(6))}),nt.windowResizer.subscribe(t(this,it),pt.RESIZE_ORDER.SCROLL),this.scrollContainer.onScroll(t(this,U)),r=!0},at=function(){t(this,l)&&(nt.windowResizer.unsubscribe(t(this,it)),this.scrollContainer.offScroll(t(this,U)),t(this,j).close(),t(this,B).close(),t(this,G).close(),t(this,K).close(),t(this,k).close(),t(this,T).close(),t(this,_).close(),t(this,M).close(),t(this,d).close(),t(this,g).close(),t(this,y).close(),t(this,v).close(),t(this,A).close(),t(this,p).close(),t(this,z).close(),t(this,O).close(),t(this,q).close(),t(this,x).close(),t(this,D).close(),t(this,f).close(),t(this,P).close(),t(this,w).close(),t(this,L).close(),t(this,R).close(),t(this,F).close(),this.disable())},Ct=function(){t(this,f).current=!0,t(this,P).current=!1,s(this,I,!0),t(this,g).current&&t(this,n).classList.remove(t(this,g).current),t(this,p).current&&t(this,n).classList.remove(t(this,p).current),t(this,p).current&&t(this,n).classList.remove(t(this,p).current),t(this,d).current&&t(this,n).classList.add(t(this,d).current)},gt=function(){t(this,P).current=!0,t(this,f).current=!1,s(this,I,!0),t(this,d).current&&t(this,n).classList.remove(t(this,d).current),t(this,y).current&&t(this,n).classList.remove(t(this,y).current),t(this,v).current&&t(this,n).classList.remove(t(this,v).current),t(this,g).current&&t(this,n).classList.add(t(this,g).current)},yt=function(){t(this,f).current=!0,t(this,w).current=!0,t(this,L).current=!1,t(this,y).current&&t(this,n).classList.add(t(this,y).current)},vt=function(){t(this,f).current=!0,t(this,R).current=!0,t(this,F).current=!1,t(this,v).current&&t(this,n).classList.add(t(this,v).current)},Pt=function(){t(this,P).current=!0,t(this,L).current=!0,t(this,w).current=!1,t(this,p).current&&t(this,n).classList.add(t(this,p).current)},wt=function(){t(this,P).current=!0,t(this,F).current=!0,t(this,R).current=!1,t(this,p).current&&t(this,n).classList.add(t(this,p).current)},it=new WeakMap,U=new WeakMap,Z=function(r){if(t(this,S)){r.previous&&t(this,n).classList.remove(r.previous),r.current&&t(this,n).classList.remove(r.current);return}r.current&&t(this,f).current?(r.previous&&t(this,n).classList.remove(r.previous),t(this,n).classList.add(r.current)):!r.current&&r.previous&&t(this,n).classList.remove(r.previous)},Vt=function(...r){r.forEach(e=>{e&&t(this,n).classList.remove(e)})},Ft=function(...r){r.forEach(e=>{e&&t(this,n).style.removeProperty(`--${e}`)})},lt=function(){o(this,h,Vt).call(this,t(this,d).current,t(this,y).current,t(this,v).current,t(this,g).current,t(this,A).current,t(this,p).current),o(this,h,Ft).call(this,t(this,z).current,t(this,O).current,t(this,q).current,t(this,x).current,t(this,D).current)},dt);Rt.isBrowser&&!customElements.get("scroll-segment")&&customElements.define("scroll-segment",mt);exports.ScrollSegmentDefaultContainer=ut;exports.ScrollSegmentElement=mt;
|
|
@@ -1,79 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { Damped } from '../animation';
|
|
4
|
-
export interface ScrollSegmentEvents {
|
|
5
|
-
scrollSegmentCapture: CustomEvent;
|
|
6
|
-
scrollSegmentCaptureFromStart: CustomEvent;
|
|
7
|
-
scrollSegmentCaptureFromFinish: CustomEvent;
|
|
8
|
-
scrollSegmentRelease: CustomEvent;
|
|
9
|
-
scrollSegmentReleaseFromStart: CustomEvent;
|
|
10
|
-
scrollSegmentReleaseFromFinish: CustomEvent;
|
|
11
|
-
}
|
|
12
|
-
export interface ScrollSegmentContainer {
|
|
13
|
-
element: HTMLElement;
|
|
14
|
-
currentScrollValue: number;
|
|
15
|
-
vertical: boolean;
|
|
16
|
-
onScroll(callback: Function): void;
|
|
17
|
-
offScroll(callback: Function): void;
|
|
18
|
-
}
|
|
19
|
-
export interface ScrollSegmentContainerElement extends Omit<ScrollSegmentContainer, 'element'>, HTMLElement {
|
|
20
|
-
}
|
|
21
|
-
export declare class ScrollSegmentElement extends HTMLElement {
|
|
22
|
-
#private;
|
|
23
|
-
constructor();
|
|
24
|
-
get scrollContainer(): ScrollSegmentContainerElement | ScrollSegmentContainer;
|
|
25
|
-
set scrollContainer(value: ScrollSegmentContainerElement | ScrollSegmentContainer);
|
|
26
|
-
get distanceOffsetCSSProperty(): CSSProperty<number>;
|
|
27
|
-
get startOffsetCSSProperty(): CSSProperty<number>;
|
|
28
|
-
get captureOnceCSSProperty(): CSSProperty<boolean>;
|
|
29
|
-
get capturedCSSProperty(): CSSProperty<string>;
|
|
30
|
-
get releasedCSSProperty(): CSSProperty<string>;
|
|
31
|
-
get capturedFromStartCSSProperty(): CSSProperty<string>;
|
|
32
|
-
get capturedFromFinishCSSProperty(): CSSProperty<string>;
|
|
33
|
-
get releasedFromStartCSSProperty(): CSSProperty<string>;
|
|
34
|
-
get releasedFromFinishCSSProperty(): CSSProperty<string>;
|
|
35
|
-
get passedVarCSSProperty(): CSSProperty<string>;
|
|
36
|
-
get progressVarCSSProperty(): CSSProperty<string>;
|
|
37
|
-
get animationVarTypeCSSProperty(): CSSProperty<"target" | "current">;
|
|
38
|
-
get distanceVarCSSProperty(): CSSProperty<string>;
|
|
39
|
-
get startVarCSSProperty(): CSSProperty<string>;
|
|
40
|
-
get finishVarCSSProperty(): CSSProperty<string>;
|
|
41
|
-
get disabledCSSProperty(): CSSProperty<boolean>;
|
|
42
|
-
get dampingCSSProperty(): CSSProperty<number>;
|
|
43
|
-
get massCSSProperty(): CSSProperty<number>;
|
|
44
|
-
get stiffnessCSSProperty(): CSSProperty<number>;
|
|
45
|
-
get targetCSSProperty(): CSSProperty<string>;
|
|
46
|
-
get isCaptured(): Store<boolean>;
|
|
47
|
-
get isReleased(): Store<boolean>;
|
|
48
|
-
get isCapturedFromStart(): Store<boolean>;
|
|
49
|
-
get isReleasedFromStart(): Store<boolean>;
|
|
50
|
-
get isCapturedFromFinish(): Store<boolean>;
|
|
51
|
-
get isReleasedFromFinish(): Store<boolean>;
|
|
52
|
-
get directionPosition(): number;
|
|
53
|
-
get directionSize(): number;
|
|
54
|
-
get passed(): Damped;
|
|
55
|
-
get progress(): number;
|
|
56
|
-
get start(): number;
|
|
57
|
-
get finish(): number;
|
|
58
|
-
get distance(): number;
|
|
59
|
-
get isCapturedOnce(): boolean;
|
|
60
|
-
get isDisabled(): boolean;
|
|
61
|
-
resize(): void;
|
|
62
|
-
tick(): void;
|
|
63
|
-
disable(): void;
|
|
64
|
-
enable(): void;
|
|
65
|
-
protected connectedCallback(): void;
|
|
66
|
-
protected disconnectedCallback(): void;
|
|
67
|
-
protected removeVar(name: string | undefined): void;
|
|
68
|
-
protected setVar(name: string | undefined, value: string | number): void;
|
|
69
|
-
protected getDistance(): number;
|
|
70
|
-
protected getStart(): number;
|
|
71
|
-
protected findAnotherScrollEntries: () => void;
|
|
72
|
-
}
|
|
73
|
-
declare global {
|
|
74
|
-
interface HTMLElementTagNameMap {
|
|
75
|
-
'scroll-segment': ScrollSegmentElement;
|
|
76
|
-
}
|
|
77
|
-
interface HTMLElementEventMap extends ScrollSegmentEvents {
|
|
78
|
-
}
|
|
79
|
-
}
|
|
1
|
+
export { ScrollSegmentDefaultContainer } from './ScrollSegmentDefaultContainer';
|
|
2
|
+
export { ScrollSegmentElement, type ScrollSegmentEvents, type ScrollSegmentContainer, type ScrollSegmentContainerElement, } from './ScrollSegmentElement';
|
|
@@ -1,26 +1,59 @@
|
|
|
1
|
-
var
|
|
1
|
+
var at = (a) => {
|
|
2
2
|
throw TypeError(a);
|
|
3
3
|
};
|
|
4
|
-
var
|
|
5
|
-
var t = (a,
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
4
|
+
var ct = (a, c, r) => c.has(a) || at("Cannot " + r);
|
|
5
|
+
var t = (a, c, r) => (ct(a, c, "read from private field"), r ? r.call(a) : c.get(a)), i = (a, c, r) => c.has(a) ? at("Cannot add the same private member more than once") : c instanceof WeakSet ? c.add(a) : c.set(a, r), e = (a, c, r, s) => (ct(a, c, "write to private field"), s ? s.call(a, r) : c.set(a, r), r), o = (a, c, r) => (ct(a, c, "access private method"), r);
|
|
6
|
+
import { f as Ft } from "../dom-CVWzyXPH.js";
|
|
7
|
+
import { i as Lt } from "../index-euf5anj6.js";
|
|
8
|
+
import { elementResizer as lt } from "../element-resizer/index.js";
|
|
9
|
+
import { windowResizer as nt } from "../window-resizer/index.js";
|
|
10
|
+
import { CSSProperty as u } from "../css-property/index.js";
|
|
11
|
+
import { TICK_ORDER as wt, RESIZE_ORDER as Et } from "../order/index.js";
|
|
12
|
+
import { d as Y } from "../events-CsVF98U6.js";
|
|
13
|
+
import { d as Rt } from "../function-C10DGppn.js";
|
|
14
|
+
import { a as Ot, g as zt, c as kt } from "../layout-DpZo-I0y.js";
|
|
15
|
+
import { s as Dt } from "../math-BOBiC4TN.js";
|
|
16
|
+
import { S as tt } from "../Store-D2xCXENW.js";
|
|
17
|
+
import { scrollEntries as Tt } from "../scroll-entries/index.js";
|
|
16
18
|
import "../ticker/index.js";
|
|
17
|
-
import { D as
|
|
18
|
-
var
|
|
19
|
-
|
|
19
|
+
import { D as xt } from "../Damped-BMmEn7PH.js";
|
|
20
|
+
var F, ht, st, q;
|
|
21
|
+
class ft {
|
|
22
|
+
constructor(c) {
|
|
23
|
+
i(this, F, null);
|
|
24
|
+
i(this, ht);
|
|
25
|
+
i(this, st, !1);
|
|
26
|
+
i(this, q, () => {
|
|
27
|
+
e(this, st, !(t(this, F).scrollWidth > t(this, F).clientWidth));
|
|
28
|
+
});
|
|
29
|
+
e(this, ht, c), e(this, F, Ft(t(this, ht))), lt.subscribe(t(this, F), t(this, q)), nt.subscribe(t(this, q)), t(this, q).call(this);
|
|
30
|
+
}
|
|
31
|
+
get element() {
|
|
32
|
+
return t(this, F);
|
|
33
|
+
}
|
|
34
|
+
get currentScrollValue() {
|
|
35
|
+
return t(this, st) ? t(this, F).scrollTop : t(this, F).scrollLeft;
|
|
36
|
+
}
|
|
37
|
+
get vertical() {
|
|
38
|
+
return t(this, st);
|
|
39
|
+
}
|
|
40
|
+
destroy() {
|
|
41
|
+
lt.unsubscribe(t(this, q)), nt.unsubscribe(t(this, q));
|
|
42
|
+
}
|
|
43
|
+
onScroll(c) {
|
|
44
|
+
t(this, F).addEventListener("scroll", c);
|
|
45
|
+
}
|
|
46
|
+
offScroll(c) {
|
|
47
|
+
t(this, F).removeEventListener("scroll", c);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
F = new WeakMap(), ht = new WeakMap(), st = new WeakMap(), q = new WeakMap();
|
|
51
|
+
var l, B, G, K, N, x, M, A, $, S, C, v, y, H, p, O, z, J, k, D, T, m, P, V, E, R, L, et, n, I, Z, rt, d, W, g, b, w, Q, _, f, h, pt, ot, St, dt, bt, gt, Ct, vt, it, U, j, yt, Pt, ut, mt;
|
|
52
|
+
let Mt = (mt = class extends HTMLElement {
|
|
20
53
|
constructor() {
|
|
21
|
-
super();
|
|
54
|
+
super(...arguments);
|
|
22
55
|
i(this, h);
|
|
23
|
-
i(this,
|
|
56
|
+
i(this, l);
|
|
24
57
|
i(this, B);
|
|
25
58
|
i(this, G);
|
|
26
59
|
i(this, K);
|
|
@@ -35,81 +68,81 @@ let kt = (at = class extends HTMLElement {
|
|
|
35
68
|
i(this, y);
|
|
36
69
|
i(this, H);
|
|
37
70
|
i(this, p);
|
|
38
|
-
i(this, R);
|
|
39
|
-
i(this, k);
|
|
40
|
-
i(this, j);
|
|
41
71
|
i(this, O);
|
|
42
72
|
i(this, z);
|
|
73
|
+
i(this, J);
|
|
74
|
+
i(this, k);
|
|
43
75
|
i(this, D);
|
|
44
|
-
i(this,
|
|
76
|
+
i(this, T);
|
|
77
|
+
i(this, m);
|
|
45
78
|
i(this, P);
|
|
46
|
-
i(this, F);
|
|
47
|
-
i(this, L);
|
|
48
|
-
i(this, E);
|
|
49
79
|
i(this, V);
|
|
50
|
-
i(this,
|
|
80
|
+
i(this, E);
|
|
81
|
+
i(this, R);
|
|
82
|
+
i(this, L);
|
|
83
|
+
i(this, et);
|
|
51
84
|
i(this, n);
|
|
52
85
|
i(this, I);
|
|
53
|
-
i(this,
|
|
54
|
-
i(this,
|
|
86
|
+
i(this, Z);
|
|
87
|
+
i(this, rt);
|
|
55
88
|
i(this, d);
|
|
56
|
-
i(this,
|
|
89
|
+
i(this, W);
|
|
57
90
|
i(this, g);
|
|
58
91
|
i(this, b);
|
|
59
92
|
i(this, w);
|
|
60
|
-
i(this, J);
|
|
61
|
-
i(this, q);
|
|
62
|
-
i(this, u);
|
|
63
|
-
i(this, st);
|
|
64
93
|
i(this, Q);
|
|
65
|
-
|
|
94
|
+
i(this, _);
|
|
95
|
+
i(this, f);
|
|
96
|
+
i(this, it);
|
|
97
|
+
i(this, U);
|
|
98
|
+
e(this, l, null), e(this, B, new u(this, "--damping", 20)), e(this, G, new u(this, "--mass", 0)), e(this, K, new u(this, "--stiffness", 0)), e(this, N, new u(this, "--target", "")), e(this, x, new u(this, "--disabled", !1)), e(this, M, new u(
|
|
66
99
|
this,
|
|
67
100
|
"--distance-offset",
|
|
68
101
|
0,
|
|
69
102
|
{ rawValueCheck: !1 }
|
|
70
|
-
)), e(this, A, new
|
|
103
|
+
)), e(this, A, new u(this, "--start-offset", 0, {
|
|
71
104
|
rawValueCheck: !1
|
|
72
|
-
})), e(this, $, new
|
|
105
|
+
})), e(this, $, new u(
|
|
73
106
|
this,
|
|
74
107
|
"--capture-once",
|
|
75
108
|
!1
|
|
76
|
-
)), e(this, S, new
|
|
109
|
+
)), e(this, S, new u(this, "--captured", "")), e(this, C, new u(this, "--released", "")), e(this, v, new u(
|
|
77
110
|
this,
|
|
78
111
|
"--captured-from-start",
|
|
79
112
|
""
|
|
80
|
-
)), e(this, y, new
|
|
113
|
+
)), e(this, y, new u(
|
|
81
114
|
this,
|
|
82
115
|
"--captured-from-finish",
|
|
83
116
|
""
|
|
84
|
-
)), e(this, H, new
|
|
117
|
+
)), e(this, H, new u(
|
|
85
118
|
this,
|
|
86
119
|
"--released-from-start",
|
|
87
120
|
""
|
|
88
|
-
)), e(this, p, new
|
|
121
|
+
)), e(this, p, new u(
|
|
89
122
|
this,
|
|
90
123
|
"--released-from-finish",
|
|
91
124
|
""
|
|
92
|
-
)), e(this,
|
|
125
|
+
)), e(this, O, new u(this, "--passed-var", "")), e(this, z, new u(this, "--progress-var", "")), e(this, J, new u(
|
|
93
126
|
this,
|
|
94
127
|
"--animation-var-type",
|
|
95
128
|
"current"
|
|
96
|
-
)), e(this,
|
|
97
|
-
const r =
|
|
129
|
+
)), e(this, k, new u(this, "--distance-var", "")), e(this, D, new u(this, "--start-var", "")), e(this, T, new u(this, "--finish-var", "")), e(this, m, new tt(!1)), e(this, P, new tt(!1)), e(this, V, new tt(!1)), e(this, E, new tt(!1)), e(this, R, new tt(!1)), e(this, L, new tt(!1)), e(this, et, []), e(this, n, this), e(this, I, 0), e(this, Z, 0), e(this, rt, 0), e(this, d, new xt(0, { order: wt.SEGMENT, min: 0, max: 1 })), e(this, W, 0), e(this, g, 0), e(this, b, 0), e(this, w, 0), e(this, Q, !1), e(this, _, !1), e(this, f, !0), this.findAnotherScrollEntries = Rt(() => {
|
|
130
|
+
const r = Tt.getAll(this).reverse();
|
|
98
131
|
let s = 0;
|
|
99
|
-
r.forEach((
|
|
100
|
-
|
|
101
|
-
}), e(this,
|
|
102
|
-
}, 0), e(this,
|
|
103
|
-
t(this,
|
|
104
|
-
}), e(this,
|
|
105
|
-
!t(this,
|
|
132
|
+
r.forEach((X, Vt) => {
|
|
133
|
+
X.element === t(this, l) && (s = Vt);
|
|
134
|
+
}), e(this, et, r.slice(s + 1));
|
|
135
|
+
}, 0), e(this, it, () => {
|
|
136
|
+
t(this, f) || (this.resize(), t(this, U).call(this));
|
|
137
|
+
}), e(this, U, () => {
|
|
138
|
+
!t(this, f) && t(this, Q) && this.tick();
|
|
106
139
|
});
|
|
107
140
|
}
|
|
108
141
|
get scrollContainer() {
|
|
109
|
-
return t(this,
|
|
142
|
+
return t(this, l);
|
|
110
143
|
}
|
|
111
144
|
set scrollContainer(r) {
|
|
112
|
-
|
|
145
|
+
o(this, h, ot).call(this), e(this, l, r), o(this, h, pt).call(this);
|
|
113
146
|
}
|
|
114
147
|
get distanceOffsetCSSProperty() {
|
|
115
148
|
return t(this, M);
|
|
@@ -139,22 +172,22 @@ let kt = (at = class extends HTMLElement {
|
|
|
139
172
|
return t(this, p);
|
|
140
173
|
}
|
|
141
174
|
get passedVarCSSProperty() {
|
|
142
|
-
return t(this,
|
|
175
|
+
return t(this, O);
|
|
143
176
|
}
|
|
144
177
|
get progressVarCSSProperty() {
|
|
145
|
-
return t(this,
|
|
178
|
+
return t(this, z);
|
|
146
179
|
}
|
|
147
180
|
get animationVarTypeCSSProperty() {
|
|
148
|
-
return t(this,
|
|
181
|
+
return t(this, J);
|
|
149
182
|
}
|
|
150
183
|
get distanceVarCSSProperty() {
|
|
151
|
-
return t(this,
|
|
184
|
+
return t(this, k);
|
|
152
185
|
}
|
|
153
186
|
get startVarCSSProperty() {
|
|
154
|
-
return t(this,
|
|
187
|
+
return t(this, D);
|
|
155
188
|
}
|
|
156
189
|
get finishVarCSSProperty() {
|
|
157
|
-
return t(this,
|
|
190
|
+
return t(this, T);
|
|
158
191
|
}
|
|
159
192
|
get disabledCSSProperty() {
|
|
160
193
|
return t(this, x);
|
|
@@ -172,34 +205,34 @@ let kt = (at = class extends HTMLElement {
|
|
|
172
205
|
return t(this, N);
|
|
173
206
|
}
|
|
174
207
|
get isCaptured() {
|
|
175
|
-
return t(this,
|
|
208
|
+
return t(this, m);
|
|
176
209
|
}
|
|
177
210
|
get isReleased() {
|
|
178
211
|
return t(this, P);
|
|
179
212
|
}
|
|
180
213
|
get isCapturedFromStart() {
|
|
181
|
-
return t(this,
|
|
214
|
+
return t(this, V);
|
|
182
215
|
}
|
|
183
216
|
get isReleasedFromStart() {
|
|
184
|
-
return t(this,
|
|
217
|
+
return t(this, E);
|
|
185
218
|
}
|
|
186
219
|
get isCapturedFromFinish() {
|
|
187
|
-
return t(this,
|
|
220
|
+
return t(this, R);
|
|
188
221
|
}
|
|
189
222
|
get isReleasedFromFinish() {
|
|
190
|
-
return t(this,
|
|
223
|
+
return t(this, L);
|
|
191
224
|
}
|
|
192
225
|
get directionPosition() {
|
|
193
226
|
return t(this, I);
|
|
194
227
|
}
|
|
195
228
|
get directionSize() {
|
|
196
|
-
return t(this,
|
|
229
|
+
return t(this, Z);
|
|
197
230
|
}
|
|
198
231
|
get passed() {
|
|
199
232
|
return t(this, d);
|
|
200
233
|
}
|
|
201
234
|
get progress() {
|
|
202
|
-
return t(this,
|
|
235
|
+
return t(this, W);
|
|
203
236
|
}
|
|
204
237
|
get start() {
|
|
205
238
|
return t(this, g);
|
|
@@ -211,42 +244,42 @@ let kt = (at = class extends HTMLElement {
|
|
|
211
244
|
return t(this, b);
|
|
212
245
|
}
|
|
213
246
|
get isCapturedOnce() {
|
|
214
|
-
return t(this,
|
|
247
|
+
return t(this, _);
|
|
215
248
|
}
|
|
216
249
|
get isDisabled() {
|
|
217
|
-
return t(this,
|
|
250
|
+
return t(this, f);
|
|
218
251
|
}
|
|
219
252
|
resize() {
|
|
220
|
-
e(this,
|
|
221
|
-
const r = t(this,
|
|
222
|
-
e(this, I, t(this,
|
|
223
|
-
const
|
|
224
|
-
|
|
225
|
-
|
|
253
|
+
e(this, Z, t(this, l).vertical ? this.offsetHeight : this.offsetWidth);
|
|
254
|
+
const r = t(this, l) instanceof HTMLElement ? t(this, l) : t(this, l).element;
|
|
255
|
+
e(this, I, t(this, l).vertical ? Ot(this, r) : zt(this, r));
|
|
256
|
+
const s = kt(
|
|
257
|
+
this,
|
|
258
|
+
t(this, l).vertical ? "top" : "left"
|
|
226
259
|
);
|
|
227
|
-
e(this, I, t(this, I) -
|
|
260
|
+
e(this, I, t(this, I) - s), e(this, g, this.getStart()), e(this, b, this.getDistance()), e(this, g, t(this, g) + t(this, A).current), e(this, b, t(this, b) + t(this, M).current), e(this, w, t(this, g) + t(this, b)), t(this, l).currentScrollValue > t(this, w) && !t(this, m).current && !t(this, P).current && (t(this, m).current = !0), this.setVar(t(this, D).current, t(this, g)), this.setVar(t(this, T).current, t(this, w)), this.setVar(t(this, k).current, t(this, b)), t(this, d).max = t(this, b), e(this, Q, !0);
|
|
228
261
|
}
|
|
229
262
|
tick() {
|
|
230
|
-
let r = t(this,
|
|
231
|
-
t(this,
|
|
232
|
-
r +=
|
|
263
|
+
let r = t(this, l).currentScrollValue;
|
|
264
|
+
t(this, et).forEach((X) => {
|
|
265
|
+
r += X.value;
|
|
233
266
|
}), t(this, d).set(r - t(this, g));
|
|
234
267
|
const s = Math.round(r);
|
|
235
|
-
t(this,
|
|
236
|
-
|
|
237
|
-
),
|
|
268
|
+
t(this, m).current && (s >= t(this, g) ? t(this, V).current || o(this, h, bt).call(this) : t(this, V).current && !t(this, E).current && o(this, h, Ct).call(this), s < t(this, w) ? t(this, L).current && !t(this, R).current && o(this, h, gt).call(this) : t(this, V).current && !t(this, L).current && o(this, h, vt).call(this)), s >= t(this, g) && s < t(this, w) ? t(this, m).current || o(this, h, St).call(this) : t(this, m).current && (t(this, d).set(
|
|
269
|
+
Dt(t(this, b) / 2, t(this, d).target, 0, t(this, b))
|
|
270
|
+
), o(this, h, dt).call(this)), t(this, _) && t(this, $).current && (t(this, S).current && t(this, n).classList.add(t(this, S).current), e(this, f, !0));
|
|
238
271
|
}
|
|
239
272
|
disable() {
|
|
240
|
-
this.style.cssText = "", e(this, I, 0), e(this,
|
|
273
|
+
this.style.cssText = "", e(this, I, 0), e(this, Z, 0), t(this, d).reset(), e(this, W, 0), e(this, g, 0), e(this, b, 0), e(this, w, 0), e(this, Q, !1), t(this, m).current = !1, t(this, P).current = !1, t(this, V).current = !1, t(this, E).current = !1, t(this, R).current = !1, t(this, L).current = !1, e(this, _, !1), e(this, f, !0), o(this, h, ut).call(this);
|
|
241
274
|
}
|
|
242
275
|
enable() {
|
|
243
|
-
e(this,
|
|
276
|
+
e(this, f, !1);
|
|
244
277
|
}
|
|
245
278
|
connectedCallback() {
|
|
246
|
-
|
|
279
|
+
this.scrollContainer = new ft(this);
|
|
247
280
|
}
|
|
248
281
|
disconnectedCallback() {
|
|
249
|
-
|
|
282
|
+
t(this, l) instanceof ft && t(this, l).destroy(), o(this, h, ot).call(this);
|
|
250
283
|
}
|
|
251
284
|
removeVar(r) {
|
|
252
285
|
r && t(this, n).style.removeProperty(`--${r}`);
|
|
@@ -255,51 +288,45 @@ let kt = (at = class extends HTMLElement {
|
|
|
255
288
|
r && t(this, n).style.setProperty(`--${r}`, s.toString());
|
|
256
289
|
}
|
|
257
290
|
getDistance() {
|
|
258
|
-
return t(this,
|
|
291
|
+
return t(this, Z) + t(this, rt);
|
|
259
292
|
}
|
|
260
293
|
getStart() {
|
|
261
|
-
return t(this, I) - t(this,
|
|
262
|
-
}
|
|
263
|
-
},
|
|
264
|
-
|
|
265
|
-
let s = this.parentElement;
|
|
266
|
-
for (; s; )
|
|
267
|
-
window.getComputedStyle(s).position === "sticky" && r.push(s), s = s.parentElement;
|
|
268
|
-
return r;
|
|
269
|
-
}, it = function() {
|
|
270
|
-
if (!t(this, f))
|
|
294
|
+
return t(this, I) - t(this, rt);
|
|
295
|
+
}
|
|
296
|
+
}, l = new WeakMap(), B = new WeakMap(), G = new WeakMap(), K = new WeakMap(), N = new WeakMap(), x = new WeakMap(), M = new WeakMap(), A = new WeakMap(), $ = new WeakMap(), S = new WeakMap(), C = new WeakMap(), v = new WeakMap(), y = new WeakMap(), H = new WeakMap(), p = new WeakMap(), O = new WeakMap(), z = new WeakMap(), J = new WeakMap(), k = new WeakMap(), D = new WeakMap(), T = new WeakMap(), m = new WeakMap(), P = new WeakMap(), V = new WeakMap(), E = new WeakMap(), R = new WeakMap(), L = new WeakMap(), et = new WeakMap(), n = new WeakMap(), I = new WeakMap(), Z = new WeakMap(), rt = new WeakMap(), d = new WeakMap(), W = new WeakMap(), g = new WeakMap(), b = new WeakMap(), w = new WeakMap(), Q = new WeakMap(), _ = new WeakMap(), f = new WeakMap(), h = new WeakSet(), pt = function() {
|
|
297
|
+
if (!t(this, l))
|
|
271
298
|
return;
|
|
272
|
-
t(this,
|
|
273
|
-
s.current &&
|
|
299
|
+
t(this, m).subscribe((s) => {
|
|
300
|
+
s.current && Y(this, "scrollSegmentCapture", {
|
|
274
301
|
composed: !0,
|
|
275
302
|
custom: !0
|
|
276
303
|
});
|
|
277
|
-
}), t(this,
|
|
278
|
-
s.current &&
|
|
304
|
+
}), t(this, V).subscribe((s) => {
|
|
305
|
+
s.current && Y(this, "scrollSegmentCaptureFromStart", {
|
|
279
306
|
composed: !0,
|
|
280
307
|
custom: !0
|
|
281
308
|
});
|
|
282
|
-
}), t(this,
|
|
283
|
-
s.current &&
|
|
309
|
+
}), t(this, R).subscribe((s) => {
|
|
310
|
+
s.current && Y(this, "scrollSegmentCaptureFromFinish", {
|
|
284
311
|
composed: !0,
|
|
285
312
|
custom: !0
|
|
286
313
|
});
|
|
287
314
|
}), t(this, P).subscribe((s) => {
|
|
288
|
-
s.current &&
|
|
315
|
+
s.current && Y(this, "scrollSegmentRelease", {
|
|
289
316
|
composed: !0,
|
|
290
317
|
custom: !0
|
|
291
318
|
});
|
|
292
|
-
}), t(this,
|
|
293
|
-
s.current &&
|
|
319
|
+
}), t(this, E).subscribe((s) => {
|
|
320
|
+
s.current && Y(this, "scrollSegmentReleaseFromStart", {
|
|
294
321
|
composed: !0,
|
|
295
322
|
custom: !0
|
|
296
323
|
});
|
|
297
|
-
}), t(this,
|
|
298
|
-
s.current &&
|
|
324
|
+
}), t(this, L).subscribe((s) => {
|
|
325
|
+
s.current && Y(this, "scrollSegmentReleaseFromFinish", {
|
|
299
326
|
composed: !0,
|
|
300
327
|
custom: !0
|
|
301
328
|
});
|
|
302
|
-
}), t(this, B).observe(), t(this, G).observe(), t(this, K).observe(), t(this, N).observe(), t(this, x).observe(), t(this, M).observe(), t(this, A).observe(), t(this, $).observe(), t(this, S).observe(), t(this, C).observe(), t(this, v).observe(), t(this, y).observe(), t(this, H).observe(), t(this, p).observe(), t(this,
|
|
329
|
+
}), t(this, B).observe(), t(this, G).observe(), t(this, K).observe(), t(this, N).observe(), t(this, x).observe(), t(this, M).observe(), t(this, A).observe(), t(this, $).observe(), t(this, S).observe(), t(this, C).observe(), t(this, v).observe(), t(this, y).observe(), t(this, H).observe(), t(this, p).observe(), t(this, O).observe(), t(this, z).observe(), t(this, J).observe(), t(this, k).observe(), t(this, D).observe(), t(this, T).observe();
|
|
303
330
|
let r = !1;
|
|
304
331
|
this.findAnotherScrollEntries(), t(this, x).current || this.enable(), t(this, B).subscribe((s) => {
|
|
305
332
|
t(this, d).damping = s.current;
|
|
@@ -308,92 +335,93 @@ let kt = (at = class extends HTMLElement {
|
|
|
308
335
|
}), t(this, K).subscribe((s) => {
|
|
309
336
|
t(this, d).stiffness = s.current;
|
|
310
337
|
}), t(this, N).subscribe((s) => {
|
|
311
|
-
s.previous &&
|
|
338
|
+
s.previous && o(this, h, ut).call(this), s.current ? s.current === "parent" ? e(this, n, this.parentElement || this) : e(this, n, document.querySelector(s.current) || this) : e(this, n, this);
|
|
312
339
|
}), t(this, x).subscribe((s) => {
|
|
313
340
|
s.current && !s.previous ? this.disable() : !s.current && s.previous && (this.resize(), this.enable());
|
|
314
341
|
}), t(this, A).subscribe(() => {
|
|
315
|
-
r && !t(this,
|
|
342
|
+
r && !t(this, f) && this.resize();
|
|
316
343
|
}), t(this, M).subscribe(() => {
|
|
317
|
-
r && !t(this,
|
|
344
|
+
r && !t(this, f) && this.resize();
|
|
318
345
|
}), t(this, S).subscribe((s) => {
|
|
319
|
-
|
|
346
|
+
o(this, h, j).call(this, s);
|
|
320
347
|
}), t(this, v).subscribe((s) => {
|
|
321
|
-
|
|
348
|
+
o(this, h, j).call(this, s);
|
|
322
349
|
}), t(this, y).subscribe((s) => {
|
|
323
|
-
|
|
350
|
+
o(this, h, j).call(this, s);
|
|
324
351
|
}), t(this, C).subscribe((s) => {
|
|
325
|
-
|
|
352
|
+
o(this, h, j).call(this, s);
|
|
326
353
|
}), t(this, H).subscribe((s) => {
|
|
327
|
-
|
|
354
|
+
o(this, h, j).call(this, s);
|
|
328
355
|
}), t(this, p).subscribe((s) => {
|
|
329
|
-
|
|
356
|
+
o(this, h, j).call(this, s);
|
|
330
357
|
}), t(this, $).subscribe((s) => {
|
|
331
|
-
t(this,
|
|
332
|
-
}), t(this,
|
|
333
|
-
t(this,
|
|
334
|
-
}), t(this, k).subscribe((s) => {
|
|
335
|
-
t(this, u) || (this.removeVar(s.previous), this.setVar(s.current, t(this, _)));
|
|
358
|
+
t(this, f) || !s.current && s.previous && (this.resize(), this.enable());
|
|
359
|
+
}), t(this, O).subscribe((s) => {
|
|
360
|
+
t(this, f) || (this.removeVar(s.previous), this.setVar(s.current, this.passed.current));
|
|
336
361
|
}), t(this, z).subscribe((s) => {
|
|
337
|
-
t(this,
|
|
362
|
+
t(this, f) || (this.removeVar(s.previous), this.setVar(s.current, t(this, W)));
|
|
338
363
|
}), t(this, D).subscribe((s) => {
|
|
339
|
-
t(this,
|
|
340
|
-
}), t(this,
|
|
341
|
-
t(this,
|
|
364
|
+
t(this, f) || (this.removeVar(s.previous), this.setVar(s.current, t(this, g)));
|
|
365
|
+
}), t(this, T).subscribe((s) => {
|
|
366
|
+
t(this, f) || (this.removeVar(s.previous), this.setVar(s.current, t(this, w)));
|
|
367
|
+
}), t(this, k).subscribe((s) => {
|
|
368
|
+
t(this, f) || (this.removeVar(s.previous), this.setVar(s.current, t(this, b)));
|
|
342
369
|
}), t(this, d).subscribe((s) => {
|
|
343
|
-
const
|
|
344
|
-
e(this,
|
|
345
|
-
t(this,
|
|
346
|
-
t(this,
|
|
370
|
+
const X = t(this, d)[t(this, J).current];
|
|
371
|
+
e(this, W, X / t(this, b) || 0), this.setVar(t(this, O).current, X.toFixed(6)), this.setVar(
|
|
372
|
+
t(this, z).current,
|
|
373
|
+
t(this, W).toFixed(6)
|
|
347
374
|
);
|
|
348
|
-
}),
|
|
349
|
-
},
|
|
350
|
-
t(this,
|
|
351
|
-
},
|
|
352
|
-
t(this,
|
|
375
|
+
}), nt.subscribe(t(this, it), Et.SCROLL), this.scrollContainer.onScroll(t(this, U)), r = !0;
|
|
376
|
+
}, ot = function() {
|
|
377
|
+
t(this, l) && (nt.unsubscribe(t(this, it)), this.scrollContainer.offScroll(t(this, U)), t(this, B).close(), t(this, G).close(), t(this, K).close(), t(this, N).close(), t(this, x).close(), t(this, M).close(), t(this, A).close(), t(this, $).close(), t(this, S).close(), t(this, C).close(), t(this, v).close(), t(this, y).close(), t(this, H).close(), t(this, p).close(), t(this, O).close(), t(this, z).close(), t(this, k).close(), t(this, D).close(), t(this, T).close(), t(this, m).close(), t(this, P).close(), t(this, V).close(), t(this, E).close(), t(this, R).close(), t(this, L).close(), this.disable());
|
|
378
|
+
}, St = function() {
|
|
379
|
+
t(this, m).current = !0, t(this, P).current = !1, e(this, _, !0), t(this, C).current && t(this, n).classList.remove(t(this, C).current), t(this, p).current && t(this, n).classList.remove(
|
|
353
380
|
t(this, p).current
|
|
354
381
|
), t(this, p).current && t(this, n).classList.remove(
|
|
355
382
|
t(this, p).current
|
|
356
383
|
), t(this, S).current && t(this, n).classList.add(t(this, S).current);
|
|
357
|
-
},
|
|
358
|
-
t(this, P).current = !0, t(this,
|
|
384
|
+
}, dt = function() {
|
|
385
|
+
t(this, P).current = !0, t(this, m).current = !1, e(this, _, !0), t(this, S).current && t(this, n).classList.remove(t(this, S).current), t(this, v).current && t(this, n).classList.remove(
|
|
359
386
|
t(this, v).current
|
|
360
387
|
), t(this, y).current && t(this, n).classList.remove(
|
|
361
388
|
t(this, y).current
|
|
362
389
|
), t(this, C).current && t(this, n).classList.add(t(this, C).current);
|
|
363
|
-
},
|
|
364
|
-
t(this,
|
|
390
|
+
}, bt = function() {
|
|
391
|
+
t(this, m).current = !0, t(this, V).current = !0, t(this, E).current = !1, t(this, v).current && t(this, n).classList.add(
|
|
365
392
|
t(this, v).current
|
|
366
393
|
);
|
|
367
|
-
},
|
|
368
|
-
t(this,
|
|
394
|
+
}, gt = function() {
|
|
395
|
+
t(this, m).current = !0, t(this, R).current = !0, t(this, L).current = !1, t(this, y).current && t(this, n).classList.add(
|
|
369
396
|
t(this, y).current
|
|
370
397
|
);
|
|
371
|
-
},
|
|
372
|
-
t(this, P).current = !0, t(this,
|
|
398
|
+
}, Ct = function() {
|
|
399
|
+
t(this, P).current = !0, t(this, E).current = !0, t(this, V).current = !1, t(this, p).current && t(this, n).classList.add(
|
|
373
400
|
t(this, p).current
|
|
374
401
|
);
|
|
375
|
-
},
|
|
376
|
-
t(this, P).current = !0, t(this,
|
|
402
|
+
}, vt = function() {
|
|
403
|
+
t(this, P).current = !0, t(this, L).current = !0, t(this, R).current = !1, t(this, p).current && t(this, n).classList.add(
|
|
377
404
|
t(this, p).current
|
|
378
405
|
);
|
|
379
|
-
},
|
|
380
|
-
if (t(this,
|
|
406
|
+
}, it = new WeakMap(), U = new WeakMap(), j = function(r) {
|
|
407
|
+
if (t(this, f)) {
|
|
381
408
|
r.previous && t(this, n).classList.remove(r.previous), r.current && t(this, n).classList.remove(r.current);
|
|
382
409
|
return;
|
|
383
410
|
}
|
|
384
|
-
r.current && t(this,
|
|
385
|
-
},
|
|
411
|
+
r.current && t(this, m).current ? (r.previous && t(this, n).classList.remove(r.previous), t(this, n).classList.add(r.current)) : !r.current && r.previous && t(this, n).classList.remove(r.previous);
|
|
412
|
+
}, yt = function(...r) {
|
|
386
413
|
r.forEach((s) => {
|
|
387
414
|
s && t(this, n).classList.remove(s);
|
|
388
415
|
});
|
|
389
|
-
},
|
|
416
|
+
}, Pt = function(...r) {
|
|
390
417
|
r.forEach((s) => {
|
|
391
418
|
s && t(this, n).style.removeProperty(`--${s}`);
|
|
392
419
|
});
|
|
393
|
-
},
|
|
394
|
-
|
|
395
|
-
},
|
|
396
|
-
|
|
420
|
+
}, ut = function() {
|
|
421
|
+
o(this, h, yt).call(this, t(this, S).current, t(this, v).current, t(this, y).current, t(this, C).current, t(this, H).current, t(this, p).current), o(this, h, Pt).call(this, t(this, O).current, t(this, z).current, t(this, k).current, t(this, D).current, t(this, T).current);
|
|
422
|
+
}, mt);
|
|
423
|
+
Lt && !customElements.get("scroll-segment") && customElements.define("scroll-segment", Mt);
|
|
397
424
|
export {
|
|
398
|
-
|
|
425
|
+
ft as ScrollSegmentDefaultContainer,
|
|
426
|
+
Mt as ScrollSegmentElement
|
|
399
427
|
};
|