aptechka 0.30.12 → 0.30.14
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var ye=Object.defineProperty;var ie=Object.getOwnPropertySymbols;var Ce=Object.prototype.hasOwnProperty,ve=Object.prototype.propertyIsEnumerable;var ne=u=>{throw TypeError(u)};var re=(u,n,e)=>n in u?ye(u,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):u[n]=e,he=(u,n)=>{for(var e in n||(n={}))Ce.call(n,e)&&re(u,e,n[e]);if(ie)for(var e of ie(n))ve.call(n,e)&&re(u,e,n[e]);return u};var jt=(u,n,e)=>n.has(u)||ne("Cannot "+e);var t=(u,n,e)=>(jt(u,n,"read from private field"),e?e.call(u):n.get(u)),s=(u,n,e)=>n.has(u)?ne("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(u):n.set(u,e),h=(u,n,e,i)=>(jt(u,n,"write to private field"),i?i.call(u,e):n.set(u,e),e),d=(u,n,e)=>(jt(u,n,"access private method"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ee=require("../../Store-CDb6RMce.cjs"),Nt=require("../../browser-CpzFX2xg.cjs"),Pe=require("../../easings-DsS5-Kqc.cjs"),Gt=require("../../events-KVanG9sR.cjs"),le=require("../../jss-GJLvaNfT.cjs"),bt=require("../../layout-8ryRAMGJ.cjs"),ce=require("../../math-GDWEqu7y.cjs");require("../../ticker/vanilla/index.cjs");const Kt=require("../../order/index.cjs"),we=require("../../Damped-CTsV8tl_.cjs"),xe=require("../../Tweened-BttGiyB0.cjs"),Wt=require("../../controls/index.cjs"),Ut=require("../../window-resizer/vanilla/index.cjs"),gt=require("../../scroll-entries/index.cjs"),oe=require("../../css-unit-parser/index.cjs"),S=require("../../css-property/index.cjs"),ze=require("../../device/index.cjs"),$t=require("../../element-resizer/vanilla/index.cjs"),Le=require("../../gestures-DHLrn6Q8.cjs"),ue=require("../../dom-JBOkFLTh.cjs"),ke=require("../../function-MthRj-GJ.cjs"),De=require("../../scroll-segment/index.cjs");var f,Rt,y,it,I,$;class qe{constructor(n,e,i){s(this,f);s(this,Rt);s(this,y);s(this,it,0);s(this,I,0);s(this,$,null);h(this,f,n),h(this,Rt,e),h(this,y,i),gt.scrollEntries.register(t(this,f))}get index(){return t(this,Rt)}get size(){return t(this,it)}get position(){return t(this,I)}destroy(){gt.scrollEntries.unregister(t(this,f)),t(this,f).style.transform="",this.mark(null)}setSize(n){n?(t(this,f).style.setProperty("--size",n+"px"),t(this,y).axisCSSProperty.current==="x"?(t(this,f).style.width=n+"px",t(this,f).style.height=""):(t(this,f).style.height=n+"px",t(this,f).style.width="")):(t(this,f).style.width="",t(this,f).style.height="",t(this,f).style.removeProperty("--size"))}resize(){h(this,it,t(this,y).vertical?t(this,f).offsetHeight:t(this,f).offsetWidth),h(this,I,t(this,y).vertical?bt.getCumulativeOffsetTop(t(this,f)):bt.getCumulativeOffsetLeft(t(this,f))),h(this,I,t(this,I)-t(this,y).contentPosition)}transform(){let n=0;const e=t(this,y).viewportSize*t(this,y).sectionDistanceScaleCSSProperty.current;t(this,y).loopCSSProperty.current&&t(this,y).overscroll&&t(this,I)+t(this,it)<t(this,y).currentScrollValue&&(n=t(this,y).distance*-1-t(this,y).gap),gt.scrollEntries.update(t(this,f),t(this,y).axisCSSProperty.current,n);const i=t(this,y).currentScrollValue+n,r=t(this,I)-t(this,y).viewportSize-e,c=t(this,I)+t(this,it)+e,m=ce.clamp(i,r,c);t(this,y).vertical?t(this,f).style.transform=`translate3d(0px, ${m*-1}px, 0px)`:t(this,f).style.transform=`translate3d(${m*-1}px, 0px, 0px)`}mark(n){t(this,$)!==n&&(t(this,$)&&t(this,f).classList.remove(t(this,$)),n&&t(this,f).classList.add(n),h(this,$,n),Gt.dispatchEvent(t(this,f),"scrollSectionMarkChange",{composed:!0,detail:{mark:t(this,$)},custom:!0}))}}f=new WeakMap,Rt=new WeakMap,y=new WeakMap,it=new WeakMap,I=new WeakMap,$=new WeakMap;const Re=le.createStylesheet({":host":{position:"relative",width:"100%",height:"100%",display:"block",outline:"none"},':host([hibernated="true"])':{display:"contents"},".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="true"]) .content':{display:"contents"},"::slotted(*)":{flexShrink:"0"}});var a,rt,x,M,T,O,D,V,N,q,v,nt,ht,ot,lt,yt,k,ct,j,R,G,B,K,ut,at,Z,J,p,Ct,o,At,It,C,g,z,A,Q,_,E,b,vt,X,dt,pt,Et,H,l,qt,mt,Zt,Jt,Qt,Xt,L,Mt,ae,Pt,Tt,Yt,te,st,ee;class Dt extends HTMLElement{constructor(){super();s(this,l);s(this,a,null);s(this,rt,new S.CSSProperty(this,"--controls",!0));s(this,x,new S.CSSProperty(this,"--axis","y"));s(this,M,new S.CSSProperty(this,"--direction",0));s(this,T,new S.CSSProperty(this,"--pages",0,{validate:e=>Math.max(0,e-1)}));s(this,O,new S.CSSProperty(this,"--split",!1));s(this,D,new S.CSSProperty(this,"--sectional",!1));s(this,V,new S.CSSProperty(this,"--auto-size",!1));s(this,N,new S.CSSProperty(this,"--wheel-max-delta",!1));s(this,q,new S.CSSProperty(this,"--sections-in-view",1));s(this,v,new S.CSSProperty(this,"--loop",!1));s(this,nt,new S.CSSProperty(this,"--damping",20));s(this,ht,new S.CSSProperty(this,"--mass",0));s(this,ot,new S.CSSProperty(this,"--stiffness",0));s(this,lt,new S.CSSProperty(this,"--mouse-drag",!1));s(this,yt,new S.CSSProperty(this,"--section-distance-scale",.5));s(this,k,new S.CSSProperty(this,"--autoplay",0));s(this,ct,new S.CSSProperty(this,"--autoplay-pause-duration",0));s(this,j,new S.CSSProperty(this,"--autoplay-user-direction",!1));s(this,R,new S.CSSProperty(this,"--classes",!1));s(this,G,new S.CSSProperty(this,"--current-index-start-offset",0));s(this,B,new S.CSSProperty(this,"--current-index-end-offset",0));s(this,K,new S.CSSProperty(this,"--focus-delay",0));s(this,ut,new S.CSSProperty(this,"--focus-duration",3e3));s(this,at,new S.CSSProperty(this,"--disabled",!1));s(this,Z,new S.CSSProperty(this,"--hibernated",!1));s(this,J,null);s(this,p,null);s(this,Ct,null);s(this,o,[]);s(this,At,0);s(this,It,0);s(this,C,0);s(this,g,0);s(this,z,0);s(this,A,null);s(this,Q,null);s(this,_,null);s(this,E,null);s(this,b,new Ee.Store(0));s(this,vt,0);s(this,X,0);s(this,dt,!0);s(this,pt,!0);s(this,Et);s(this,H,new xe.Tweened);s(this,L,()=>{t(this,a).unlistenAnimationFrame();const e=this.currentScrollValue/t(this,g)||0,i=t(this,b).current;if(h(this,At,this.vertical?bt.getCumulativeOffsetTop(this):bt.getCumulativeOffsetLeft(this)),h(this,It,this.vertical?bt.getCumulativeOffsetTop(t(this,p)):bt.getCumulativeOffsetLeft(t(this,p))),h(this,C,this.vertical?this.offsetHeight:this.offsetWidth),this.vertical?h(this,z,oe.cssUnitParser.parse(getComputedStyle(t(this,p)).rowGap)):h(this,z,oe.cssUnitParser.parse(getComputedStyle(t(this,p)).columnGap)),t(this,V).current&&t(this,o).length){const r=t(this,q).current,c=(t(this,C)-t(this,z)*(r-1))/r;t(this,o).forEach(m=>{m.setSize(c)})}else t(this,o).forEach(r=>{r.setSize()});if(t(this,o).forEach(r=>{r.resize()}),t(this,T).current){h(this,g,t(this,C)*t(this,T).current);const r=t(this,g)+t(this,C);this.vertical?(t(this,p).style.width=r+"px",t(this,p).style.height="100%"):(t(this,p).style.height=r+"px",t(this,p).style.width="100%")}else this.vertical?(t(this,p).style.width="100%",t(this,p).style.height="max-content",h(this,g,t(this,p).offsetHeight-t(this,C))):(t(this,p).style.width="max-content",t(this,p).style.height="100%",h(this,g,t(this,p).offsetWidth-t(this,C)));if(!t(this,v).current){const r=getComputedStyle(this),c=this.vertical?parseFloat(r.paddingBlockStart)+parseFloat(r.paddingBlockEnd):parseFloat(r.paddingInlineStart)+parseFloat(r.paddingInlineEnd);h(this,g,t(this,g)+c),t(this,a).max=t(this,g)}if(t(this,v).current&&t(this,o).length){const r=t(this,o)[t(this,o).length-1],c=r.position+r.size-t(this,C),m=t(this,g)-c;h(this,X,r.position+r.size+m)}else h(this,X,t(this,g));if(t(this,D).current&&t(this,o).length){const r=t(this,o)[i];t(this,a).set(r.position,{equalize:!0})}else t(this,a).set(e*t(this,g),{equalize:!0})});s(this,Mt,()=>{const e=this.currentScrollValue;if(h(this,vt,Math.max(0,e-t(this,g))),t(this,o).length){let i=0;for(let r=0;r<t(this,o).length;r++){const c=t(this,o)[r];c.transform(),this.targetScrollValue+c.size/2>=c.position&&(i=r)}t(this,b).current=i}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)`;gt.scrollEntries.update(this,t(this,x).current,e)});s(this,Pt,(e,i)=>{t(this,rt).current&&(d(this,l,Yt).call(this,Math.sign(i)||1),t(this,Tt).call(this,e,i))});s(this,Tt,(e,i)=>{if(t(this,M).current){if(t(this,M).current<0&&i>0)return;if(t(this,M).current>0&&i<0)return}if(t(this,H).unlistenAnimationFrame(),!t(this,k).current&&t(this,K).current&&(clearInterval(t(this,Et)),h(this,Et,setTimeout(()=>{const r=d(this,l,ee).call(this);r&&this.scrollToSection(r.index,{tween:{duration:t(this,ut).current,easing:Pe.easeInOutExpo}})},t(this,K).current))),!(e==="drag"&&!ze.device.isMobile&&!t(this,lt).current))if(t(this,D).current){const r=Math.sign(i);t(this,o).length?this.shiftSections(r):t(this,a).shift(r*t(this,C))}else t(this,a).shift(i)});if(Nt.isBrowser){const e=this.attachShadow({mode:"open"});e.adoptedStyleSheets.push(Re);const i=document.createElement("div");i.className="static",i.innerHTML='<slot name="static"></slot>',e.appendChild(i),h(this,J,document.createElement("div")),t(this,J).className="content-wrapper",h(this,p,document.createElement("div")),t(this,p).className="content",h(this,Ct,document.createElement("slot")),t(this,p).appendChild(t(this,Ct)),t(this,J).appendChild(t(this,p)),e.appendChild(t(this,J))}}get damped(){return t(this,a)}get controlsCSSProperty(){return t(this,rt)}get axisCSSProperty(){return t(this,x)}get directionCSSProperty(){return t(this,M)}get pagesCSSProperty(){return t(this,T)}get splitCSSProperty(){return t(this,O)}get sectionalCSSProperty(){return t(this,D)}get autoSizeCSSProperty(){return t(this,V)}get wheelMaxDeltaCSSProperty(){return t(this,N)}get sectionsInViewCSSProperty(){return t(this,q)}get loopCSSProperty(){return t(this,v)}get dampingCSSProperty(){return t(this,nt)}get massCSSProperty(){return t(this,ht)}get stiffnessCSSProperty(){return t(this,ot)}get mouseDragCSSProperty(){return t(this,lt)}get sectionDistanceScaleCSSProperty(){return t(this,yt)}get autoplayCSSProperty(){return t(this,k)}get autoplayPauseDurationCSSProperty(){return t(this,ct)}get autoplayUserDirectionCSSProperty(){return t(this,j)}get classesCSSProperty(){return t(this,R)}get currentIndexStartOffsetCSSProperty(){return t(this,G)}get currentIndexEndOffsetCSSProperty(){return t(this,B)}get focusDelayCSSProperty(){return t(this,K)}get focusDurationCSSProperty(){return t(this,ut)}get disabledCSSProperty(){return t(this,at)}get hibernatedCSSProperty(){return t(this,Z)}get currentScrollValue(){return d(this,l,te).call(this,"current")}get targetScrollValue(){return d(this,l,te).call(this,"target")}get contentWrapperElement(){return t(this,J)}get contentElement(){return t(this,p)}get sections(){return t(this,o)}get position(){return t(this,At)}get contentPosition(){return t(this,It)}get viewportSize(){return t(this,C)}get scrollSize(){return t(this,g)}get gap(){return t(this,z)}get counter(){return t(this,b)}get limit(){return t(this,o).length-t(this,q).current}get distance(){return t(this,X)}get loopDistance(){return t(this,v).current?t(this,X)+t(this,z):t(this,X)}get overscroll(){return t(this,vt)}get vertical(){return t(this,x).current==="y"}get currentProgress(){return this.currentScrollValue/this.loopDistance||0}get targetProgress(){return this.targetScrollValue/this.loopDistance||0}get scrollWidth(){return t(this,x).current==="y"?0:t(this,a).distance}get scrollHeight(){return t(this,x).current==="x"?0:t(this,a).distance}onScroll(...e){return t(this,a).subscribe(...e)}offScroll(...e){t(this,a).unsubscribe(...e)}range(e,i,r=0){const c=e-r,m=c+i+r*2;return this.currentProgress<c?0:this.currentProgress>m?1:(this.currentProgress-c)/(m-c)}curve(e,i,r=0){return Math.sin(this.range(e,i,r)*Math.PI)}visible(e,i,r=0){const c=e-r,m=c+i+r*2;return this.currentProgress>=c&&this.currentProgress<=m}scrollToSection(e,i){if(!t(this,o).length)return;const r=t(this,b).current;d(this,l,ae).call(this,e);const c=t(this,o)[r],m=t(this,o)[t(this,b).current];if(c&&m){let w=0;const ft=d(this,l,ee).call(this),ge=ft?this.targetScrollValue-ft.position:0;t(this,v).current?t(this,b).current===0&&r===t(this,o).length-1?w=t(this,g)+t(this,C)-c.position+t(this,z):t(this,b).current===t(this,o).length-1&&r===0?w=m.position-(t(this,g)+t(this,C)+t(this,z)):w=m.position-c.position:w=m.position-c.position,this.shiftPosition(w-ge,i)}}shiftSections(e,i){t(this,o).length&&this.scrollToSection(t(this,b).current+e,i)}setPosition(e,i){d(this,l,Yt).call(this,Math.sign(e)||1),i!=null&&i.tween?(t(this,H).set(t(this,a).current,{equalize:!0}),t(this,H).set(e,he({},i.tween))):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(){h(this,a,new we.Damped(0,{damping:.01,min:0,order:Kt.TICK_ORDER.SCROLL})),this.setAttribute("tabindex","0"),h(this,A,new Wt.WheelControls({element:t(this,p)})),t(this,A).changeEvent.subscribe(t(this,Pt)),h(this,Q,new Wt.KeyboardControls({element:this})),t(this,Q).changeEvent.subscribe(t(this,Pt)),h(this,_,new Wt.DragControls({element:t(this,p)})),t(this,_).changeEvent.subscribe(t(this,Pt)),h(this,E,new Wt.AutoplayControls({culling:this})),t(this,E).changeEvent.subscribe(t(this,Tt)),t(this,x).subscribe(({current:e})=>{t(this,p).style.flexDirection=e==="x"?"row":"column",t(this,A).axis=t(this,N).current?"max":e,t(this,Q).dimension=e==="x"?"width":"height",t(this,_).axis=e,e==="x"?this.style.touchAction="pan-y":e==="y"&&(this.style.touchAction="pan-x"),this.isConnected&&t(this,L).call(this)}),t(this,N).subscribe(e=>{t(this,A).axis=e.current?"max":t(this,x).current}),t(this,T).subscribe(()=>{this.isConnected&&t(this,L).call(this)}),t(this,O).subscribe(({current:e})=>{this.isConnected&&(e?d(this,l,qt).call(this):d(this,l,mt).call(this))}),t(this,D).subscribe(e=>{t(this,A).debounce=e.current,t(this,_).swipe=e.current,t(this,E).interval=e.current,this.isConnected&&(e.current&&!e.previous&&!t(this,o).length?d(this,l,qt).call(this):!e.current&&e.previous&&t(this,o).length&&d(this,l,mt).call(this))}),t(this,V).subscribe(e=>{this.isConnected&&(t(this,L).call(this),e.current&&!e.previous&&!t(this,o).length?d(this,l,qt).call(this):!e.current&&e.previous&&t(this,o).length&&d(this,l,mt).call(this))}),t(this,q).subscribe(e=>{this.isConnected&&(t(this,L).call(this),d(this,l,st).call(this))}),t(this,v).subscribe(e=>{e.current?(this.isConnected&&(t(this,o).length||(t(this,O).current=!0)),t(this,o).length&&(t(this,a).max=1/0,t(this,a).min=-1/0)):(h(this,vt,0),t(this,a).max=t(this,g),t(this,a).min=0)}),t(this,nt).subscribe(e=>{t(this,a).damping=e.current}),t(this,ht).subscribe(e=>{t(this,a).mass=e.current}),t(this,ot).subscribe(e=>{t(this,a).stiffness=e.current}),t(this,k).subscribe(e=>{t(this,E).speed=e.current,e.current&&!e.previous?t(this,E).connect():!e.current&&e.previous&&t(this,E).disconnect()}),t(this,j).subscribe(e=>{e.current||(t(this,E).direction=1)}),t(this,R).subscribe(e=>{this.isConnected&&d(this,l,st).call(this)}),t(this,G).subscribe(e=>{this.isConnected&&t(this,R).current&&d(this,l,st).call(this)}),t(this,B).subscribe(e=>{this.isConnected&&t(this,R).current&&d(this,l,st).call(this)}),t(this,a).isRunning.subscribe(e=>{this.classList.toggle("active",e.current)}),t(this,b).subscribe(e=>{t(this,o).length&&d(this,l,st).call(this)}),t(this,H).subscribe(e=>{t(this,H).isRunning.current&&t(this,a).set(e.current)}),t(this,at).subscribe(e=>{e.current&&!e.previous?d(this,l,Zt).call(this):!e.current&&e.previous&&d(this,l,Jt).call(this)}),t(this,Z).subscribe(e=>{e.current&&!e.previous?d(this,l,Qt).call(this):!e.current&&e.previous&&d(this,l,Xt).call(this)}),t(this,rt).observe(),t(this,x).observe(),t(this,M).observe(),t(this,T).observe(),t(this,O).observe(),t(this,D).observe(),t(this,V).observe(),t(this,N).observe(),t(this,q).observe(),t(this,v).observe(),t(this,nt).observe(),t(this,ht).observe(),t(this,ot).observe(),t(this,lt).observe(),t(this,yt).observe(),t(this,k).observe(),t(this,k).observe(),t(this,ct).observe(),t(this,j).observe(),t(this,R).observe(),t(this,G).observe(),t(this,B).observe(),t(this,K).observe(),t(this,ut).observe(),t(this,at).observe(),t(this,Z).observe(),t(this,Z).current||d(this,l,Xt).call(this)}disconnectedCallback(){this.setAttribute("tabindex",""),t(this,rt).unobserve(),t(this,x).unobserve(),t(this,M).unobserve(),t(this,T).unobserve(),t(this,O).unobserve(),t(this,D).unobserve(),t(this,V).unobserve(),t(this,N).unobserve(),t(this,q).unobserve(),t(this,v).unobserve(),t(this,nt).unobserve(),t(this,ht).unobserve(),t(this,ot).unobserve(),t(this,lt).unobserve(),t(this,yt).unobserve(),t(this,k).unobserve(),t(this,ct).unobserve(),t(this,j).unobserve(),t(this,R).unobserve(),t(this,G).unobserve(),t(this,B).unobserve(),t(this,K).unobserve(),t(this,ut).unobserve(),t(this,at).unobserve(),t(this,Z).unobserve(),d(this,l,Qt).call(this)}}a=new WeakMap,rt=new WeakMap,x=new WeakMap,M=new WeakMap,T=new WeakMap,O=new WeakMap,D=new WeakMap,V=new WeakMap,N=new WeakMap,q=new WeakMap,v=new WeakMap,nt=new WeakMap,ht=new WeakMap,ot=new WeakMap,lt=new WeakMap,yt=new WeakMap,k=new WeakMap,ct=new WeakMap,j=new WeakMap,R=new WeakMap,G=new WeakMap,B=new WeakMap,K=new WeakMap,ut=new WeakMap,at=new WeakMap,Z=new WeakMap,J=new WeakMap,p=new WeakMap,Ct=new WeakMap,o=new WeakMap,At=new WeakMap,It=new WeakMap,C=new WeakMap,g=new WeakMap,z=new WeakMap,A=new WeakMap,Q=new WeakMap,_=new WeakMap,E=new WeakMap,b=new WeakMap,vt=new WeakMap,X=new WeakMap,dt=new WeakMap,pt=new WeakMap,Et=new WeakMap,H=new WeakMap,l=new WeakSet,qt=function(){d(this,l,mt).call(this),t(this,Ct).assignedElements().forEach((e,i)=>{e instanceof HTMLElement&&t(this,o).push(new qe(e,i,this))}),t(this,p).style.transform="",Gt.dispatchEvent(this,"scrollSectionsChange",{custom:!0,composed:!0}),t(this,L).call(this),d(this,l,st).call(this)},mt=function(){t(this,o).forEach(e=>{e.destroy()}),h(this,o,[]),t(this,b).reset(),t(this,a).reset(),Gt.dispatchEvent(this,"scrollSectionsChange",{custom:!0,composed:!0})},Zt=function(){t(this,dt)||(h(this,dt,!0),t(this,a).unsubscribe(t(this,Mt)),t(this,a).unlistenAnimationFrame(),clearInterval(t(this,Et)),t(this,H).unlistenAnimationFrame(),t(this,A).disconnect(),t(this,Q).disconnect(),t(this,_).disconnect(),t(this,E).disconnect())},Jt=function(){t(this,dt)&&(h(this,dt,!1),t(this,a).subscribe(t(this,Mt)),t(this,A).connect(),t(this,Q).connect(),t(this,_).connect(),t(this,k).current&&t(this,E).connect())},Qt=function(){t(this,pt)||(h(this,pt,!0),Ut.windowResizer.unsubscribe(t(this,L)),$t.elementResizer.unsubscribe(t(this,L)),d(this,l,Zt).call(this),t(this,p).style.transform="",t(this,o).length?d(this,l,mt).call(this):(t(this,b).reset(),t(this,a).reset()),gt.scrollEntries.unregister(this))},Xt=function(){t(this,pt)&&(h(this,pt,!1),(t(this,v).current||t(this,O).current||t(this,v).current||t(this,V).current||t(this,D).current)&&d(this,l,qt).call(this),gt.scrollEntries.register(this),d(this,l,Jt).call(this),Ut.windowResizer.subscribe(t(this,L),Kt.RESIZE_ORDER.SCROLL),$t.elementResizer.subscribe(this,t(this,L)))},L=new WeakMap,Mt=new WeakMap,ae=function(e){t(this,v).current?(t(this,b).current=e%t(this,o).length,t(this,b).current=t(this,b).current<0?t(this,o).length+t(this,b).current:t(this,b).current):t(this,b).current=ce.clamp(e,0,this.limit)},Pt=new WeakMap,Tt=new WeakMap,Yt=function(e=1){t(this,j).current&&(t(this,E).direction=e),t(this,k).current&&t(this,E).pauseAndContinue(t(this,ct).current,this.sectionalCSSProperty.current)},te=function(e="current"){if(t(this,v).current&&t(this,o).length){const i=t(this,a)[e]%(t(this,g)+t(this,C)+t(this,z));return i<0?t(this,g)+i+t(this,C)+t(this,z):i}else return t(this,a)[e]},st=function(){if(t(this,R).current&&t(this,o).length){const e=t(this,b).current+t(this,G).current;e===0?this.classList.add("start"):this.classList.remove("start"),e===this.limit?this.classList.add("end"):this.classList.remove("end");const i=t(this,q).current+t(this,B).current;t(this,o).forEach((r,c)=>{const m=e-this.limit-1+t(this,B).current,w=e+i,ft=this.sections.length-w;c>=e&&c<w||c<=m?r.mark("current"):c>=w&&c<w+ft/2||c<=m+i?r.mark("next"):r.mark("previous")})}},ee=function(){let e=null,i=1/0;for(let r=0;r<t(this,o).length;r++){const c=Math.abs(t(this,o)[r].position-this.targetScrollValue);c<i&&(i=c,e=r)}return e!==null?t(this,o)[e]:null};customElements.get("e-scroll")||customElements.define("e-scroll",Dt);var Ot;class se extends HTMLElement{constructor(){super(...arguments);s(this,Ot,null)}get scrollElement(){return t(this,Ot)}connectedCallback(){const e=ue.findParentElement(this,Dt);e instanceof Dt?h(this,Ot,e):console.error(this,"e-scroll not found")}}Ot=new WeakMap;var Y,P,F,W,wt,xt,St,Vt,Bt,_t;class de extends se{constructor(){super();s(this,Y,null);s(this,P,null);s(this,F,!1);s(this,W,0);s(this,wt,0);s(this,xt,0);s(this,St,()=>{h(this,F,this.offsetWidth>this.offsetHeight);const e=t(this,F)?this.offsetWidth:this.offsetHeight;h(this,W,e/((this.scrollElement.scrollSize+this.scrollElement.viewportSize)/e)),h(this,W,Math.max(t(this,W),30)),t(this,F)?(t(this,P).style.width=t(this,W)+"px",t(this,P).style.height="100%"):(t(this,P).style.width="100%",t(this,P).style.height=t(this,W)+"px"),h(this,wt,e-t(this,W)),this.scrollElement.scrollSize||(this.style.display="none")});s(this,Vt,()=>{h(this,xt,this.scrollElement.currentProgress*t(this,wt)),t(this,F)?t(this,P).style.transform=`translate3d(${t(this,xt)}px, 0px, 0px)`:t(this,P).style.transform=`translate3d(0px, ${t(this,xt)}px, 0px)`});s(this,Bt,()=>{this.setAttribute("axis",this.scrollElement.axisCSSProperty.current)});s(this,_t,e=>{document.documentElement.classList.add("grabbing"),Le.setupDrag(c=>{const m=t(this,F)?c.x:c.y,w=this.scrollElement.distance/t(this,wt),ft=(m-r)*w;this.scrollElement.setPosition(i+ft)},()=>{document.documentElement.classList.remove("grabbing")});const i=this.scrollElement.damped.target,r=t(this,F)?e.x:e.y});if(Nt.isBrowser){const e=this.attachShadow({mode:"open"});e.adoptedStyleSheets.push(le.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:"black",borderRadius:"0.3vmin",touchAction:"none"},"::slotted(*)":{touchAction:"none"}})),h(this,Y,document.createElement("slot")),t(this,Y).innerHTML='<div class="default-thumb"></div>',e.appendChild(t(this,Y))}}get thumbElement(){return t(this,P)}connectedCallback(){super.connectedCallback(),this.setAttribute("drag-dead-zone","");const e=t(this,Y).assignedElements()[0]||t(this,Y).firstElementChild;h(this,P,e),t(this,P).addEventListener("pointerdown",t(this,_t)),Ut.windowResizer.subscribe(t(this,St),Kt.RESIZE_ORDER.SCROLL),$t.elementResizer.subscribe(this,t(this,St)),this.scrollElement.onScroll(t(this,Vt)),this.scrollElement.axisCSSProperty.subscribe(t(this,Bt))}disconnectedCallback(){this.removeAttribute("drag-dead-zone"),t(this,P).removeEventListener("pointerdown",t(this,_t)),Ut.windowResizer.unsubscribe(t(this,St)),$t.elementResizer.unsubscribe(t(this,St)),this.scrollElement.offScroll(t(this,Vt)),this.scrollElement.axisCSSProperty.unsubscribe(t(this,Bt))}}Y=new WeakMap,P=new WeakMap,F=new WeakMap,W=new WeakMap,wt=new WeakMap,xt=new WeakMap,St=new WeakMap,Vt=new WeakMap,Bt=new WeakMap,_t=new WeakMap;customElements.get("e-scrollbar")||customElements.define("e-scrollbar",de);class pe extends se{constructor(){super(),Nt.isBrowser&&this.addEventListener("click",()=>{this.handleClick()})}}class Se extends pe{handleClick(){const n=this.getAttribute("index"),e=this.getAttribute("behaviour");this.scrollElement.scrollToSection(parseInt(n||"0"),{behaviour:e})}}customElements.get("e-scroll-set-button")||customElements.define("e-scroll-set-button",Se);class fe extends pe{handleClick(){const n=this.getAttribute("step"),e=this.getAttribute("behaviour");this.scrollElement.shiftSections(parseInt(n||"1"),{behaviour:e})}}customElements.get("e-scroll-step-button")||customElements.define("e-scroll-step-button",fe);var U,tt,zt,Ht,Ft,Lt;class Ae{constructor(n,e,i){s(this,U,null);s(this,tt,null);s(this,zt,null);s(this,Ht,null);s(this,Ft,()=>{t(this,tt).scrollToSection(t(this,zt),{behaviour:t(this,Ht)})});s(this,Lt,()=>{t(this,U).classList.toggle("current",t(this,tt).counter.current===t(this,zt))});Nt.isBrowser&&(h(this,U,document.createElement("button")),h(this,tt,n),h(this,Ht,i),h(this,zt,e),t(this,U).addEventListener("click",t(this,Ft)),t(this,tt).counter.subscribe(t(this,Lt)),t(this,Lt).call(this))}get element(){return t(this,U)}destroy(){t(this,U).removeEventListener("click",t(this,Ft)),t(this,tt).counter.unsubscribe(t(this,Lt)),t(this,U).remove()}}U=new WeakMap,tt=new WeakMap,zt=new WeakMap,Ht=new WeakMap,Ft=new WeakMap,Lt=new WeakMap;var et,kt;class me extends se{constructor(){super(...arguments);s(this,et,[]);s(this,kt,ke.debounce(()=>{t(this,et).forEach(e=>e.destroy()),h(this,et,[]);for(let e=0;e<this.scrollElement.sections.length;e++){const i=new Ae(this.scrollElement,e,this.getAttribute("behaviour")||"smooth");this.appendChild(i.element),t(this,et).push(i)}},0))}connectedCallback(){super.connectedCallback(),this.scrollElement.addEventListener("sectionsChange",t(this,kt)),t(this,kt).call(this)}disconnectedCallback(){this.scrollElement.removeEventListener("sectionsChange",t(this,kt)),t(this,et).forEach(e=>e.destroy()),h(this,et,[])}}et=new WeakMap,kt=new WeakMap;customElements.get("e-scroll-bullet-buttons")||customElements.define("e-scroll-bullet-buttons",me);class be extends De.ScrollSegmentElement{connectedCallback(){const n=ue.findParentElement(this,Dt);n instanceof Dt?(this.scrollContainer=n,this.scrollContainer.addEventListener("scrollSectionsChange",this.findAnotherScrollEntries)):console.error(this,"e-scroll not found")}}customElements.get("e-scroll-segment")||customElements.define("e-scroll-segment",be);exports.ScrollBulletButtonsElement=me;exports.ScrollElement=Dt;exports.ScrollSegmentElement=be;exports.ScrollSetButtonElement=Se;exports.ScrollStepButtonElement=fe;exports.ScrollbarElement=de;
|
|
1
|
+
"use strict";var Ce=Object.defineProperty;var ne=Object.getOwnPropertySymbols;var Ee=Object.prototype.hasOwnProperty,Pe=Object.prototype.propertyIsEnumerable;var oe=u=>{throw TypeError(u)};var he=(u,n,e)=>n in u?Ce(u,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):u[n]=e,le=(u,n)=>{for(var e in n||(n={}))Ee.call(n,e)&&he(u,e,n[e]);if(ne)for(var e of ne(n))Pe.call(n,e)&&he(u,e,n[e]);return u};var Zt=(u,n,e)=>n.has(u)||oe("Cannot "+e);var t=(u,n,e)=>(Zt(u,n,"read from private field"),e?e.call(u):n.get(u)),s=(u,n,e)=>n.has(u)?oe("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(u):n.set(u,e),h=(u,n,e,i)=>(Zt(u,n,"write to private field"),i?i.call(u,e):n.set(u,e),e),d=(u,n,e)=>(Zt(u,n,"access private method"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const we=require("../../Store-CDb6RMce.cjs"),Kt=require("../../browser-CpzFX2xg.cjs"),xe=require("../../easings-DsS5-Kqc.cjs"),Jt=require("../../events-KVanG9sR.cjs"),ue=require("../../jss-GJLvaNfT.cjs"),gt=require("../../layout-8ryRAMGJ.cjs"),ae=require("../../math-GDWEqu7y.cjs");require("../../ticker/vanilla/index.cjs");const Qt=require("../../order/index.cjs"),ze=require("../../Damped-CTsV8tl_.cjs"),Le=require("../../Tweened-BttGiyB0.cjs"),Ut=require("../../controls/index.cjs"),jt=require("../../window-resizer/vanilla/index.cjs"),yt=require("../../scroll-entries/index.cjs"),ce=require("../../css-unit-parser/index.cjs"),S=require("../../css-property/index.cjs"),ke=require("../../device/index.cjs"),Gt=require("../../element-resizer/vanilla/index.cjs"),De=require("../../gestures-DHLrn6Q8.cjs"),de=require("../../dom-JBOkFLTh.cjs"),qe=require("../../function-MthRj-GJ.cjs"),Re=require("../../scroll-segment/index.cjs");var f,At,y,nt,A,N;class Te{constructor(n,e,i){s(this,f);s(this,At);s(this,y);s(this,nt,0);s(this,A,0);s(this,N,null);h(this,f,n),h(this,At,e),h(this,y,i),yt.scrollEntries.register(t(this,f))}get index(){return t(this,At)}get size(){return t(this,nt)}get position(){return t(this,A)}destroy(){yt.scrollEntries.unregister(t(this,f)),this.unsetTransform()}unsetTransform(){t(this,f).style.transform="",this.mark(null)}setSize(n){n?(t(this,f).style.setProperty("--size",n+"px"),t(this,y).axisCSSProperty.current==="x"?(t(this,f).style.width=n+"px",t(this,f).style.height=""):(t(this,f).style.height=n+"px",t(this,f).style.width="")):(t(this,f).style.width="",t(this,f).style.height="",t(this,f).style.removeProperty("--size"))}resize(){h(this,nt,t(this,y).vertical?t(this,f).offsetHeight:t(this,f).offsetWidth),h(this,A,t(this,y).vertical?gt.getCumulativeOffsetTop(t(this,f)):gt.getCumulativeOffsetLeft(t(this,f))),h(this,A,t(this,A)-t(this,y).contentPosition)}transform(){let n=0;const e=t(this,y).viewportSize*t(this,y).sectionDistanceScaleCSSProperty.current;t(this,y).loopCSSProperty.current&&t(this,y).overscroll&&t(this,A)+t(this,nt)<t(this,y).currentScrollValue&&(n=t(this,y).distance*-1-t(this,y).gap),yt.scrollEntries.update(t(this,f),t(this,y).axisCSSProperty.current,n);const i=t(this,y).currentScrollValue+n,r=t(this,A)-t(this,y).viewportSize-e,c=t(this,A)+t(this,nt)+e,m=ae.clamp(i,r,c);t(this,y).vertical?t(this,f).style.transform=`translate3d(0px, ${m*-1}px, 0px)`:t(this,f).style.transform=`translate3d(${m*-1}px, 0px, 0px)`}mark(n){t(this,N)!==n&&(t(this,N)&&t(this,f).classList.remove(t(this,N)),n&&t(this,f).classList.add(n),h(this,N,n),Jt.dispatchEvent(t(this,f),"scrollSectionMarkChange",{composed:!0,detail:{mark:t(this,N)},custom:!0}))}}f=new WeakMap,At=new WeakMap,y=new WeakMap,nt=new WeakMap,A=new WeakMap,N=new WeakMap;const Ae=ue.createStylesheet({":host":{position:"relative",width:"100%",height:"100%",display:"block",outline:"none"},':host([hibernated="true"])':{display:"contents"},".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="true"]) .content':{display:"contents"},"::slotted(*)":{flexShrink:"0"}});var a,ht,x,I,M,O,D,V,j,q,C,ot,lt,ct,ut,vt,k,at,G,R,K,B,Z,dt,pt,J,Q,p,Ct,l,It,Mt,v,g,z,T,X,_,E,b,Et,Y,ie,H,tt,St,Pt,W,o,Tt,bt,$t,Nt,Xt,Yt,L,wt,pe,xt,Ot,te,ee,rt,se;class Rt extends HTMLElement{constructor(){super();s(this,o);s(this,a,null);s(this,ht,new S.CSSProperty(this,"--controls",!0));s(this,x,new S.CSSProperty(this,"--axis","y"));s(this,I,new S.CSSProperty(this,"--direction",0));s(this,M,new S.CSSProperty(this,"--pages",0,{validate:e=>Math.max(0,e-1)}));s(this,O,new S.CSSProperty(this,"--split",!1));s(this,D,new S.CSSProperty(this,"--sectional",!1));s(this,V,new S.CSSProperty(this,"--auto-size",!1));s(this,j,new S.CSSProperty(this,"--wheel-max-delta",!1));s(this,q,new S.CSSProperty(this,"--sections-in-view",1));s(this,C,new S.CSSProperty(this,"--loop",!1));s(this,ot,new S.CSSProperty(this,"--damping",20));s(this,lt,new S.CSSProperty(this,"--mass",0));s(this,ct,new S.CSSProperty(this,"--stiffness",0));s(this,ut,new S.CSSProperty(this,"--mouse-drag",!1));s(this,vt,new S.CSSProperty(this,"--section-distance-scale",.5));s(this,k,new S.CSSProperty(this,"--autoplay",0));s(this,at,new S.CSSProperty(this,"--autoplay-pause-duration",0));s(this,G,new S.CSSProperty(this,"--autoplay-user-direction",!1));s(this,R,new S.CSSProperty(this,"--classes",!1));s(this,K,new S.CSSProperty(this,"--current-index-start-offset",0));s(this,B,new S.CSSProperty(this,"--current-index-end-offset",0));s(this,Z,new S.CSSProperty(this,"--focus-delay",0));s(this,dt,new S.CSSProperty(this,"--focus-duration",3e3));s(this,pt,new S.CSSProperty(this,"--disabled",!1));s(this,J,new S.CSSProperty(this,"--hibernated",!1));s(this,Q,null);s(this,p,null);s(this,Ct,null);s(this,l,[]);s(this,It,0);s(this,Mt,0);s(this,v,0);s(this,g,0);s(this,z,0);s(this,T,null);s(this,X,null);s(this,_,null);s(this,E,null);s(this,b,new we.Store(0));s(this,Et,0);s(this,Y,0);s(this,ie,!1);s(this,H,!1);s(this,tt,!0);s(this,St,!0);s(this,Pt);s(this,W,new Le.Tweened);s(this,L,()=>{t(this,a).unlistenAnimationFrame();const e=this.currentScrollValue/t(this,g)||0,i=t(this,b).current;if(h(this,It,this.vertical?gt.getCumulativeOffsetTop(this):gt.getCumulativeOffsetLeft(this)),h(this,Mt,this.vertical?gt.getCumulativeOffsetTop(t(this,p)):gt.getCumulativeOffsetLeft(t(this,p))),h(this,v,this.vertical?this.offsetHeight:this.offsetWidth),this.vertical?h(this,z,ce.cssUnitParser.parse(getComputedStyle(t(this,p)).rowGap)):h(this,z,ce.cssUnitParser.parse(getComputedStyle(t(this,p)).columnGap)),t(this,V).current&&t(this,l).length){const r=t(this,q).current,c=(t(this,v)-t(this,z)*(r-1))/r;t(this,l).forEach(m=>{m.setSize(c)})}else t(this,l).forEach(r=>{r.setSize()});if(t(this,l).forEach(r=>{r.resize()}),t(this,M).current){h(this,g,t(this,v)*t(this,M).current);const r=t(this,g)+t(this,v);this.vertical?(t(this,p).style.width=r+"px",t(this,p).style.height="100%"):(t(this,p).style.height=r+"px",t(this,p).style.width="100%")}else this.vertical?(t(this,p).style.width="100%",t(this,p).style.height="max-content",h(this,g,t(this,p).offsetHeight-t(this,v))):(t(this,p).style.width="max-content",t(this,p).style.height="100%",h(this,g,t(this,p).offsetWidth-t(this,v)));if(!t(this,C).current){const r=getComputedStyle(this),c=this.vertical?parseFloat(r.paddingBlockStart)+parseFloat(r.paddingBlockEnd):parseFloat(r.paddingInlineStart)+parseFloat(r.paddingInlineEnd);h(this,g,t(this,g)+c),t(this,a).max=t(this,g)}if(t(this,C).current&&t(this,l).length){const r=t(this,l)[t(this,l).length-1],c=r.position+r.size-t(this,v),m=t(this,g)-c;h(this,Y,r.position+r.size+m)}else h(this,Y,t(this,g));if(t(this,D).current&&t(this,l).length){const r=t(this,l)[i];t(this,a).set(r.position,{equalize:!0})}else t(this,a).set(e*t(this,g),{equalize:!0});h(this,H,(this.vertical?t(this,p).offsetHeight:t(this,p).offsetWidth)>t(this,v)),this.classList.toggle("has-overflow",t(this,H)),t(this,H)?d(this,o,Nt).call(this):d(this,o,$t).call(this),t(this,wt).call(this)});s(this,wt,()=>{if(!t(this,H))return;const e=this.currentScrollValue;if(h(this,Et,Math.max(0,e-t(this,g))),t(this,l).length){let i=0;for(let r=0;r<t(this,l).length;r++){const c=t(this,l)[r];c.transform(),this.targetScrollValue+c.size/2>=c.position&&(i=r)}t(this,b).current=i}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)`;yt.scrollEntries.update(this,t(this,x).current,e)});s(this,xt,(e,i)=>{t(this,ht).current&&(d(this,o,te).call(this,Math.sign(i)||1),t(this,Ot).call(this,e,i))});s(this,Ot,(e,i)=>{if(t(this,I).current){if(t(this,I).current<0&&i>0)return;if(t(this,I).current>0&&i<0)return}if(t(this,W).unlistenAnimationFrame(),!t(this,k).current&&t(this,Z).current&&(clearInterval(t(this,Pt)),h(this,Pt,setTimeout(()=>{const r=d(this,o,se).call(this);r&&this.scrollToSection(r.index,{tween:{duration:t(this,dt).current,easing:xe.easeInOutExpo}})},t(this,Z).current))),!(e==="drag"&&!ke.device.isMobile&&!t(this,ut).current))if(t(this,D).current){const r=Math.sign(i);t(this,l).length?this.shiftSections(r):t(this,a).shift(r*t(this,v))}else t(this,a).shift(i)});if(Kt.isBrowser){const e=this.attachShadow({mode:"open"});e.adoptedStyleSheets.push(Ae);const i=document.createElement("div");i.className="static",i.innerHTML='<slot name="static"></slot>',e.appendChild(i),h(this,Q,document.createElement("div")),t(this,Q).className="content-wrapper",h(this,p,document.createElement("div")),t(this,p).className="content",h(this,Ct,document.createElement("slot")),t(this,p).appendChild(t(this,Ct)),t(this,Q).appendChild(t(this,p)),e.appendChild(t(this,Q))}}get damped(){return t(this,a)}get controlsCSSProperty(){return t(this,ht)}get axisCSSProperty(){return t(this,x)}get directionCSSProperty(){return t(this,I)}get pagesCSSProperty(){return t(this,M)}get splitCSSProperty(){return t(this,O)}get sectionalCSSProperty(){return t(this,D)}get autoSizeCSSProperty(){return t(this,V)}get wheelMaxDeltaCSSProperty(){return t(this,j)}get sectionsInViewCSSProperty(){return t(this,q)}get loopCSSProperty(){return t(this,C)}get dampingCSSProperty(){return t(this,ot)}get massCSSProperty(){return t(this,lt)}get stiffnessCSSProperty(){return t(this,ct)}get mouseDragCSSProperty(){return t(this,ut)}get sectionDistanceScaleCSSProperty(){return t(this,vt)}get autoplayCSSProperty(){return t(this,k)}get autoplayPauseDurationCSSProperty(){return t(this,at)}get autoplayUserDirectionCSSProperty(){return t(this,G)}get classesCSSProperty(){return t(this,R)}get currentIndexStartOffsetCSSProperty(){return t(this,K)}get currentIndexEndOffsetCSSProperty(){return t(this,B)}get focusDelayCSSProperty(){return t(this,Z)}get focusDurationCSSProperty(){return t(this,dt)}get disabledCSSProperty(){return t(this,pt)}get hibernatedCSSProperty(){return t(this,J)}get currentScrollValue(){return d(this,o,ee).call(this,"current")}get targetScrollValue(){return d(this,o,ee).call(this,"target")}get contentWrapperElement(){return t(this,Q)}get contentElement(){return t(this,p)}get sections(){return t(this,l)}get position(){return t(this,It)}get contentPosition(){return t(this,Mt)}get viewportSize(){return t(this,v)}get scrollSize(){return t(this,g)}get gap(){return t(this,z)}get counter(){return t(this,b)}get limit(){return t(this,l).length-t(this,q).current}get distance(){return t(this,Y)}get loopDistance(){return t(this,C).current?t(this,Y)+t(this,z):t(this,Y)}get hasOverflow(){return t(this,H)}get overscroll(){return t(this,Et)}get vertical(){return t(this,x).current==="y"}get currentProgress(){return this.currentScrollValue/this.loopDistance||0}get targetProgress(){return this.targetScrollValue/this.loopDistance||0}get scrollWidth(){return t(this,x).current==="y"?0:t(this,a).distance}get scrollHeight(){return t(this,x).current==="x"?0:t(this,a).distance}onScroll(...e){return t(this,a).subscribe(...e)}offScroll(...e){t(this,a).unsubscribe(...e)}range(e,i,r=0){const c=e-r,m=c+i+r*2;return this.currentProgress<c?0:this.currentProgress>m?1:(this.currentProgress-c)/(m-c)}curve(e,i,r=0){return Math.sin(this.range(e,i,r)*Math.PI)}visible(e,i,r=0){const c=e-r,m=c+i+r*2;return this.currentProgress>=c&&this.currentProgress<=m}scrollToSection(e,i){if(!t(this,l).length)return;const r=t(this,b).current;d(this,o,pe).call(this,e);const c=t(this,l)[r],m=t(this,l)[t(this,b).current];if(c&&m){let w=0;const mt=d(this,o,se).call(this),ve=mt?this.targetScrollValue-mt.position:0;t(this,C).current?t(this,b).current===0&&r===t(this,l).length-1?w=t(this,g)+t(this,v)-c.position+t(this,z)+1:t(this,b).current===t(this,l).length-1&&r===0?w=m.position-(t(this,g)+t(this,v)+t(this,z)):w=m.position-c.position:w=m.position-c.position,this.shiftPosition(w-ve,i)}}shiftSections(e,i){t(this,l).length&&this.scrollToSection(t(this,b).current+e,i)}setPosition(e,i){d(this,o,te).call(this,Math.sign(e)||1),i!=null&&i.tween?(t(this,W).set(t(this,a).current,{equalize:!0}),t(this,W).set(e,le({},i.tween))):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(){h(this,a,new ze.Damped(0,{damping:.01,min:0,order:Qt.TICK_ORDER.SCROLL})),this.setAttribute("tabindex","0"),h(this,T,new Ut.WheelControls({element:t(this,p)})),t(this,T).changeEvent.subscribe(t(this,xt)),h(this,X,new Ut.KeyboardControls({element:this})),t(this,X).changeEvent.subscribe(t(this,xt)),h(this,_,new Ut.DragControls({element:t(this,p)})),t(this,_).changeEvent.subscribe(t(this,xt)),h(this,E,new Ut.AutoplayControls({culling:this})),t(this,E).changeEvent.subscribe(t(this,Ot)),t(this,x).subscribe(({current:e})=>{t(this,p).style.flexDirection=e==="x"?"row":"column",t(this,T).axis=t(this,j).current?"max":e,t(this,X).dimension=e==="x"?"width":"height",t(this,_).axis=e,e==="x"?this.style.touchAction="pan-y":e==="y"&&(this.style.touchAction="pan-x"),this.isConnected&&t(this,L).call(this)}),t(this,j).subscribe(e=>{t(this,T).axis=e.current?"max":t(this,x).current}),t(this,M).subscribe(()=>{this.isConnected&&t(this,L).call(this)}),t(this,O).subscribe(({current:e})=>{this.isConnected&&(e?d(this,o,Tt).call(this):d(this,o,bt).call(this))}),t(this,D).subscribe(e=>{t(this,T).debounce=e.current,t(this,_).swipe=e.current,t(this,E).interval=e.current,this.isConnected&&(e.current&&!e.previous&&!t(this,l).length?d(this,o,Tt).call(this):!e.current&&e.previous&&t(this,l).length&&d(this,o,bt).call(this))}),t(this,V).subscribe(e=>{this.isConnected&&(t(this,L).call(this),e.current&&!e.previous&&!t(this,l).length?d(this,o,Tt).call(this):!e.current&&e.previous&&t(this,l).length&&d(this,o,bt).call(this))}),t(this,q).subscribe(e=>{this.isConnected&&(t(this,L).call(this),d(this,o,rt).call(this))}),t(this,C).subscribe(e=>{e.current?(this.isConnected&&(t(this,l).length||(t(this,O).current=!0)),t(this,l).length&&(t(this,a).max=1/0,t(this,a).min=-1/0)):(h(this,Et,0),t(this,a).max=t(this,g),t(this,a).min=0)}),t(this,ot).subscribe(e=>{t(this,a).damping=e.current}),t(this,lt).subscribe(e=>{t(this,a).mass=e.current}),t(this,ct).subscribe(e=>{t(this,a).stiffness=e.current}),t(this,k).subscribe(e=>{t(this,E).speed=e.current,!t(this,tt)&&e.current&&!e.previous?t(this,E).connect():!e.current&&e.previous&&t(this,E).disconnect()}),t(this,G).subscribe(e=>{e.current||(t(this,E).direction=1)}),t(this,R).subscribe(e=>{this.isConnected&&d(this,o,rt).call(this)}),t(this,K).subscribe(e=>{this.isConnected&&t(this,R).current&&d(this,o,rt).call(this)}),t(this,B).subscribe(e=>{this.isConnected&&t(this,R).current&&d(this,o,rt).call(this)}),t(this,a).isRunning.subscribe(e=>{this.classList.toggle("active",e.current)}),t(this,b).subscribe(e=>{t(this,l).length&&d(this,o,rt).call(this)}),t(this,W).subscribe(e=>{t(this,W).isRunning.current&&t(this,a).set(e.current)}),t(this,pt).subscribe(e=>{e.current&&!e.previous?d(this,o,$t).call(this):!e.current&&e.previous&&d(this,o,Nt).call(this)}),t(this,J).subscribe(e=>{e.current&&!e.previous?d(this,o,Xt).call(this):!e.current&&e.previous&&d(this,o,Yt).call(this)}),t(this,ht).observe(),t(this,x).observe(),t(this,I).observe(),t(this,M).observe(),t(this,O).observe(),t(this,D).observe(),t(this,V).observe(),t(this,j).observe(),t(this,q).observe(),t(this,C).observe(),t(this,ot).observe(),t(this,lt).observe(),t(this,ct).observe(),t(this,ut).observe(),t(this,vt).observe(),t(this,k).observe(),t(this,k).observe(),t(this,at).observe(),t(this,G).observe(),t(this,R).observe(),t(this,K).observe(),t(this,B).observe(),t(this,Z).observe(),t(this,dt).observe(),t(this,pt).observe(),t(this,J).observe(),t(this,J).current||d(this,o,Yt).call(this)}disconnectedCallback(){this.removeAttribute("tabindex"),this.classList.remove("has-overflow"),t(this,ht).unobserve(),t(this,x).unobserve(),t(this,I).unobserve(),t(this,M).unobserve(),t(this,O).unobserve(),t(this,D).unobserve(),t(this,V).unobserve(),t(this,j).unobserve(),t(this,q).unobserve(),t(this,C).unobserve(),t(this,ot).unobserve(),t(this,lt).unobserve(),t(this,ct).unobserve(),t(this,ut).unobserve(),t(this,vt).unobserve(),t(this,k).unobserve(),t(this,at).unobserve(),t(this,G).unobserve(),t(this,R).unobserve(),t(this,K).unobserve(),t(this,B).unobserve(),t(this,Z).unobserve(),t(this,dt).unobserve(),t(this,pt).unobserve(),t(this,J).unobserve(),d(this,o,Xt).call(this)}}a=new WeakMap,ht=new WeakMap,x=new WeakMap,I=new WeakMap,M=new WeakMap,O=new WeakMap,D=new WeakMap,V=new WeakMap,j=new WeakMap,q=new WeakMap,C=new WeakMap,ot=new WeakMap,lt=new WeakMap,ct=new WeakMap,ut=new WeakMap,vt=new WeakMap,k=new WeakMap,at=new WeakMap,G=new WeakMap,R=new WeakMap,K=new WeakMap,B=new WeakMap,Z=new WeakMap,dt=new WeakMap,pt=new WeakMap,J=new WeakMap,Q=new WeakMap,p=new WeakMap,Ct=new WeakMap,l=new WeakMap,It=new WeakMap,Mt=new WeakMap,v=new WeakMap,g=new WeakMap,z=new WeakMap,T=new WeakMap,X=new WeakMap,_=new WeakMap,E=new WeakMap,b=new WeakMap,Et=new WeakMap,Y=new WeakMap,ie=new WeakMap,H=new WeakMap,tt=new WeakMap,St=new WeakMap,Pt=new WeakMap,W=new WeakMap,o=new WeakSet,Tt=function(){d(this,o,bt).call(this),t(this,Ct).assignedElements().forEach((e,i)=>{e instanceof HTMLElement&&t(this,l).push(new Te(e,i,this))}),t(this,p).style.transform="",Jt.dispatchEvent(this,"scrollSectionsChange",{custom:!0,composed:!0}),t(this,L).call(this),d(this,o,rt).call(this)},bt=function(){t(this,l).forEach(e=>{e.destroy()}),h(this,l,[]),t(this,b).reset(),t(this,a).reset(),Jt.dispatchEvent(this,"scrollSectionsChange",{custom:!0,composed:!0})},$t=function(){t(this,tt)||(h(this,tt,!0),t(this,a).unsubscribe(t(this,wt)),t(this,a).unlistenAnimationFrame(),clearInterval(t(this,Pt)),t(this,W).unlistenAnimationFrame(),t(this,T).disconnect(),t(this,X).disconnect(),t(this,_).disconnect(),t(this,E).disconnect(),t(this,H)||this.sections.forEach(e=>{e.unsetTransform()}))},Nt=function(){t(this,tt)&&(h(this,tt,!1),t(this,a).subscribe(t(this,wt)),t(this,T).connect(),t(this,X).connect(),t(this,_).connect(),t(this,k).current&&t(this,E).connect())},Xt=function(){t(this,St)||(h(this,St,!0),jt.windowResizer.unsubscribe(t(this,L)),Gt.elementResizer.unsubscribe(t(this,L)),d(this,o,$t).call(this),t(this,p).style.transform="",t(this,l).length?d(this,o,bt).call(this):(t(this,b).reset(),t(this,a).reset()),yt.scrollEntries.unregister(this))},Yt=function(){t(this,St)&&(h(this,St,!1),(t(this,C).current||t(this,O).current||t(this,C).current||t(this,V).current||t(this,D).current)&&d(this,o,Tt).call(this),yt.scrollEntries.register(this),d(this,o,Nt).call(this),jt.windowResizer.subscribe(t(this,L),Qt.RESIZE_ORDER.SCROLL),Gt.elementResizer.subscribe(this,t(this,L)))},L=new WeakMap,wt=new WeakMap,pe=function(e){t(this,C).current?(t(this,b).current=e%t(this,l).length,t(this,b).current=t(this,b).current<0?t(this,l).length+t(this,b).current:t(this,b).current):t(this,b).current=ae.clamp(e,0,this.limit)},xt=new WeakMap,Ot=new WeakMap,te=function(e=1){t(this,G).current&&(t(this,E).direction=e),t(this,k).current&&t(this,E).pauseAndContinue(t(this,at).current,this.sectionalCSSProperty.current)},ee=function(e="current"){if(t(this,C).current&&t(this,l).length){const i=t(this,a)[e]%(t(this,g)+t(this,v)+t(this,z));return i<0?t(this,g)+i+t(this,v)+t(this,z):i}else return t(this,a)[e]},rt=function(){if(t(this,R).current&&t(this,l).length){const e=t(this,b).current+t(this,K).current;e===0?this.classList.add("start"):this.classList.remove("start"),e===this.limit?this.classList.add("end"):this.classList.remove("end");const i=t(this,q).current+t(this,B).current;t(this,l).forEach((r,c)=>{const m=e-this.limit-1+t(this,B).current,w=e+i,mt=this.sections.length-w;c>=e&&c<w||c<=m?r.mark("current"):c>=w&&c<w+mt/2||c<=m+i?r.mark("next"):r.mark("previous")})}},se=function(){let e=null,i=1/0;for(let r=0;r<t(this,l).length;r++){const c=Math.abs(t(this,l)[r].position-this.targetScrollValue);c<i&&(i=c,e=r)}return e!==null?t(this,l)[e]:null};customElements.get("e-scroll")||customElements.define("e-scroll",Rt);var Vt;class re extends HTMLElement{constructor(){super(...arguments);s(this,Vt,null)}get scrollElement(){return t(this,Vt)}connectedCallback(){const e=de.findParentElement(this,Rt);e instanceof Rt?h(this,Vt,e):console.error(this,"e-scroll not found")}}Vt=new WeakMap;var et,P,F,U,zt,Lt,ft,Bt,_t,Ht;class Se extends re{constructor(){super();s(this,et,null);s(this,P,null);s(this,F,!1);s(this,U,0);s(this,zt,0);s(this,Lt,0);s(this,ft,()=>{h(this,F,this.offsetWidth>this.offsetHeight);const e=t(this,F)?this.offsetWidth:this.offsetHeight;h(this,U,e/((this.scrollElement.scrollSize+this.scrollElement.viewportSize)/e)),h(this,U,Math.max(t(this,U),30)),t(this,F)?(t(this,P).style.width=t(this,U)+"px",t(this,P).style.height="100%"):(t(this,P).style.width="100%",t(this,P).style.height=t(this,U)+"px"),h(this,zt,e-t(this,U)),this.scrollElement.scrollSize||(this.style.display="none")});s(this,Bt,()=>{h(this,Lt,this.scrollElement.currentProgress*t(this,zt)),t(this,F)?t(this,P).style.transform=`translate3d(${t(this,Lt)}px, 0px, 0px)`:t(this,P).style.transform=`translate3d(0px, ${t(this,Lt)}px, 0px)`});s(this,_t,()=>{this.setAttribute("axis",this.scrollElement.axisCSSProperty.current)});s(this,Ht,e=>{document.documentElement.classList.add("grabbing"),De.setupDrag(c=>{const m=t(this,F)?c.x:c.y,w=this.scrollElement.distance/t(this,zt),mt=(m-r)*w;this.scrollElement.setPosition(i+mt)},()=>{document.documentElement.classList.remove("grabbing")});const i=this.scrollElement.damped.target,r=t(this,F)?e.x:e.y});if(Kt.isBrowser){const e=this.attachShadow({mode:"open"});e.adoptedStyleSheets.push(ue.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:"black",borderRadius:"0.3vmin",touchAction:"none"},"::slotted(*)":{touchAction:"none"}})),h(this,et,document.createElement("slot")),t(this,et).innerHTML='<div class="default-thumb"></div>',e.appendChild(t(this,et))}}get thumbElement(){return t(this,P)}connectedCallback(){super.connectedCallback(),this.setAttribute("drag-dead-zone","");const e=t(this,et).assignedElements()[0]||t(this,et).firstElementChild;h(this,P,e),t(this,P).addEventListener("pointerdown",t(this,Ht)),jt.windowResizer.subscribe(t(this,ft),Qt.RESIZE_ORDER.SCROLL),Gt.elementResizer.subscribe(this,t(this,ft)),this.scrollElement.onScroll(t(this,Bt)),this.scrollElement.axisCSSProperty.subscribe(t(this,_t))}disconnectedCallback(){this.removeAttribute("drag-dead-zone"),t(this,P).removeEventListener("pointerdown",t(this,Ht)),jt.windowResizer.unsubscribe(t(this,ft)),Gt.elementResizer.unsubscribe(t(this,ft)),this.scrollElement.offScroll(t(this,Bt)),this.scrollElement.axisCSSProperty.unsubscribe(t(this,_t))}}et=new WeakMap,P=new WeakMap,F=new WeakMap,U=new WeakMap,zt=new WeakMap,Lt=new WeakMap,ft=new WeakMap,Bt=new WeakMap,_t=new WeakMap,Ht=new WeakMap;customElements.get("e-scrollbar")||customElements.define("e-scrollbar",Se);class fe extends re{constructor(){super(),Kt.isBrowser&&this.addEventListener("click",()=>{this.handleClick()})}}class me extends fe{handleClick(){const n=this.getAttribute("index"),e=this.getAttribute("behaviour");this.scrollElement.scrollToSection(parseInt(n||"0"),{behaviour:e})}}customElements.get("e-scroll-set-button")||customElements.define("e-scroll-set-button",me);class be extends fe{handleClick(){const n=this.getAttribute("step"),e=this.getAttribute("behaviour");this.scrollElement.shiftSections(parseInt(n||"1"),{behaviour:e})}}customElements.get("e-scroll-step-button")||customElements.define("e-scroll-step-button",be);var $,st,kt,Wt,Ft,Dt;class Ie{constructor(n,e,i){s(this,$,null);s(this,st,null);s(this,kt,null);s(this,Wt,null);s(this,Ft,()=>{t(this,st).scrollToSection(t(this,kt),{behaviour:t(this,Wt)})});s(this,Dt,()=>{t(this,$).classList.toggle("current",t(this,st).counter.current===t(this,kt))});Kt.isBrowser&&(h(this,$,document.createElement("button")),h(this,st,n),h(this,Wt,i),h(this,kt,e),t(this,$).addEventListener("click",t(this,Ft)),t(this,st).counter.subscribe(t(this,Dt)),t(this,Dt).call(this))}get element(){return t(this,$)}destroy(){t(this,$).removeEventListener("click",t(this,Ft)),t(this,st).counter.unsubscribe(t(this,Dt)),t(this,$).remove()}}$=new WeakMap,st=new WeakMap,kt=new WeakMap,Wt=new WeakMap,Ft=new WeakMap,Dt=new WeakMap;var it,qt;class ge extends re{constructor(){super(...arguments);s(this,it,[]);s(this,qt,qe.debounce(()=>{t(this,it).forEach(e=>e.destroy()),h(this,it,[]);for(let e=0;e<this.scrollElement.sections.length;e++){const i=new Ie(this.scrollElement,e,this.getAttribute("behaviour")||"smooth");this.appendChild(i.element),t(this,it).push(i)}},0))}connectedCallback(){super.connectedCallback(),this.scrollElement.addEventListener("sectionsChange",t(this,qt)),t(this,qt).call(this)}disconnectedCallback(){this.scrollElement.removeEventListener("sectionsChange",t(this,qt)),t(this,it).forEach(e=>e.destroy()),h(this,it,[])}}it=new WeakMap,qt=new WeakMap;customElements.get("e-scroll-bullet-buttons")||customElements.define("e-scroll-bullet-buttons",ge);class ye extends Re.ScrollSegmentElement{connectedCallback(){const n=de.findParentElement(this,Rt);n instanceof Rt?(this.scrollContainer=n,this.scrollContainer.addEventListener("scrollSectionsChange",this.findAnotherScrollEntries)):console.error(this,"e-scroll not found")}}customElements.get("e-scroll-segment")||customElements.define("e-scroll-segment",ye);exports.ScrollBulletButtonsElement=ge;exports.ScrollElement=Rt;exports.ScrollSegmentElement=ye;exports.ScrollSetButtonElement=me;exports.ScrollStepButtonElement=be;exports.ScrollbarElement=Se;
|
|
@@ -1,93 +1,96 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
throw TypeError(
|
|
1
|
+
var be = Object.defineProperty;
|
|
2
|
+
var re = Object.getOwnPropertySymbols;
|
|
3
|
+
var Se = Object.prototype.hasOwnProperty, ge = Object.prototype.propertyIsEnumerable;
|
|
4
|
+
var he = (a) => {
|
|
5
|
+
throw TypeError(a);
|
|
6
6
|
};
|
|
7
|
-
var
|
|
7
|
+
var ne = (a, n, e) => n in a ? be(a, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[n] = e, oe = (a, n) => {
|
|
8
8
|
for (var e in n || (n = {}))
|
|
9
|
-
|
|
10
|
-
if (
|
|
11
|
-
for (var e of
|
|
12
|
-
|
|
13
|
-
return
|
|
9
|
+
Se.call(n, e) && ne(a, e, n[e]);
|
|
10
|
+
if (re)
|
|
11
|
+
for (var e of re(n))
|
|
12
|
+
ge.call(n, e) && ne(a, e, n[e]);
|
|
13
|
+
return a;
|
|
14
14
|
};
|
|
15
|
-
var
|
|
16
|
-
var t = (
|
|
17
|
-
import { S as
|
|
18
|
-
import { i as
|
|
19
|
-
import { p as
|
|
20
|
-
import { d as
|
|
21
|
-
import { c as
|
|
22
|
-
import { a as
|
|
23
|
-
import { c as
|
|
15
|
+
var _t = (a, n, e) => n.has(a) || he("Cannot " + e);
|
|
16
|
+
var t = (a, n, e) => (_t(a, n, "read from private field"), e ? e.call(a) : n.get(a)), s = (a, n, e) => n.has(a) ? he("Cannot add the same private member more than once") : n instanceof WeakSet ? n.add(a) : n.set(a, e), h = (a, n, e, i) => (_t(a, n, "write to private field"), i ? i.call(a, e) : n.set(a, e), e), d = (a, n, e) => (_t(a, n, "access private method"), e);
|
|
17
|
+
import { S as ve } from "../../Store-OTdcl6SX.js";
|
|
18
|
+
import { i as Kt } from "../../browser-0zX67oeU.js";
|
|
19
|
+
import { p as ye } from "../../easings-BKi40vHz.js";
|
|
20
|
+
import { d as Zt } from "../../events-CsVF98U6.js";
|
|
21
|
+
import { c as ce } from "../../jss-CjccJC-K.js";
|
|
22
|
+
import { a as jt, g as Jt } from "../../layout-HoBT_Da2.js";
|
|
23
|
+
import { c as ae } from "../../math-BOBiC4TN.js";
|
|
24
24
|
import "../../ticker/vanilla/index.js";
|
|
25
|
-
import { TICK_ORDER as
|
|
26
|
-
import { D as
|
|
27
|
-
import { T as
|
|
28
|
-
import { WheelControls as
|
|
29
|
-
import { windowResizer as
|
|
30
|
-
import { scrollEntries as
|
|
31
|
-
import { cssUnitParser as
|
|
32
|
-
import { CSSProperty as
|
|
33
|
-
import { device as
|
|
34
|
-
import { elementResizer as
|
|
35
|
-
import { s as
|
|
36
|
-
import { f as
|
|
37
|
-
import { d as
|
|
38
|
-
import { ScrollSegmentElement as
|
|
39
|
-
var
|
|
40
|
-
class
|
|
25
|
+
import { TICK_ORDER as Ce, RESIZE_ORDER as ue } from "../../order/index.js";
|
|
26
|
+
import { D as Ee } from "../../Damped-Chu29wn-.js";
|
|
27
|
+
import { T as we } from "../../Tweened-BUuSLSF7.js";
|
|
28
|
+
import { WheelControls as xe, KeyboardControls as Pe, DragControls as Le, AutoplayControls as ze } from "../../controls/index.js";
|
|
29
|
+
import { windowResizer as Ut } from "../../window-resizer/vanilla/index.js";
|
|
30
|
+
import { scrollEntries as gt } from "../../scroll-entries/index.js";
|
|
31
|
+
import { cssUnitParser as le } from "../../css-unit-parser/index.js";
|
|
32
|
+
import { CSSProperty as p } from "../../css-property/index.js";
|
|
33
|
+
import { device as ke } from "../../device/index.js";
|
|
34
|
+
import { elementResizer as Gt } from "../../element-resizer/vanilla/index.js";
|
|
35
|
+
import { s as De } from "../../gestures-D2Fdra_G.js";
|
|
36
|
+
import { f as de } from "../../dom-0S_WDL4g.js";
|
|
37
|
+
import { d as Ae } from "../../function-C10DGppn.js";
|
|
38
|
+
import { ScrollSegmentElement as Ie } from "../../scroll-segment/index.js";
|
|
39
|
+
var m, Mt, v, nt, T, G;
|
|
40
|
+
class Me {
|
|
41
41
|
constructor(n, e, i) {
|
|
42
|
-
s(this,
|
|
43
|
-
s(this,
|
|
42
|
+
s(this, m);
|
|
43
|
+
s(this, Mt);
|
|
44
44
|
s(this, v);
|
|
45
|
-
s(this,
|
|
45
|
+
s(this, nt, 0);
|
|
46
46
|
s(this, T, 0);
|
|
47
|
-
s(this,
|
|
48
|
-
h(this,
|
|
47
|
+
s(this, G, null);
|
|
48
|
+
h(this, m, n), h(this, Mt, e), h(this, v, i), gt.register(t(this, m));
|
|
49
49
|
}
|
|
50
50
|
get index() {
|
|
51
|
-
return t(this,
|
|
51
|
+
return t(this, Mt);
|
|
52
52
|
}
|
|
53
53
|
get size() {
|
|
54
|
-
return t(this,
|
|
54
|
+
return t(this, nt);
|
|
55
55
|
}
|
|
56
56
|
get position() {
|
|
57
57
|
return t(this, T);
|
|
58
58
|
}
|
|
59
59
|
destroy() {
|
|
60
|
-
|
|
60
|
+
gt.unregister(t(this, m)), this.unsetTransform();
|
|
61
|
+
}
|
|
62
|
+
unsetTransform() {
|
|
63
|
+
t(this, m).style.transform = "", this.mark(null);
|
|
61
64
|
}
|
|
62
65
|
setSize(n) {
|
|
63
|
-
n ? (t(this,
|
|
66
|
+
n ? (t(this, m).style.setProperty("--size", n + "px"), t(this, v).axisCSSProperty.current === "x" ? (t(this, m).style.width = n + "px", t(this, m).style.height = "") : (t(this, m).style.height = n + "px", t(this, m).style.width = "")) : (t(this, m).style.width = "", t(this, m).style.height = "", t(this, m).style.removeProperty("--size"));
|
|
64
67
|
}
|
|
65
68
|
resize() {
|
|
66
|
-
h(this,
|
|
69
|
+
h(this, nt, t(this, v).vertical ? t(this, m).offsetHeight : t(this, m).offsetWidth), h(this, T, t(this, v).vertical ? jt(t(this, m)) : Jt(t(this, m))), h(this, T, t(this, T) - t(this, v).contentPosition);
|
|
67
70
|
}
|
|
68
71
|
transform() {
|
|
69
72
|
let n = 0;
|
|
70
73
|
const e = t(this, v).viewportSize * t(this, v).sectionDistanceScaleCSSProperty.current;
|
|
71
|
-
t(this, v).loopCSSProperty.current && t(this, v).overscroll && t(this, T) + t(this,
|
|
72
|
-
t(this,
|
|
74
|
+
t(this, v).loopCSSProperty.current && t(this, v).overscroll && t(this, T) + t(this, nt) < t(this, v).currentScrollValue && (n = t(this, v).distance * -1 - t(this, v).gap), gt.update(
|
|
75
|
+
t(this, m),
|
|
73
76
|
t(this, v).axisCSSProperty.current,
|
|
74
77
|
n
|
|
75
78
|
);
|
|
76
|
-
const i = t(this, v).currentScrollValue + n, r = t(this, T) - t(this, v).viewportSize - e, c = t(this, T) + t(this,
|
|
77
|
-
t(this, v).vertical ? t(this,
|
|
79
|
+
const i = t(this, v).currentScrollValue + n, r = t(this, T) - t(this, v).viewportSize - e, c = t(this, T) + t(this, nt) + e, b = ae(i, r, c);
|
|
80
|
+
t(this, v).vertical ? t(this, m).style.transform = `translate3d(0px, ${b * -1}px, 0px)` : t(this, m).style.transform = `translate3d(${b * -1}px, 0px, 0px)`;
|
|
78
81
|
}
|
|
79
82
|
mark(n) {
|
|
80
|
-
t(this,
|
|
83
|
+
t(this, G) !== n && (t(this, G) && t(this, m).classList.remove(t(this, G)), n && t(this, m).classList.add(n), h(this, G, n), Zt(t(this, m), "scrollSectionMarkChange", {
|
|
81
84
|
composed: !0,
|
|
82
85
|
detail: {
|
|
83
|
-
mark: t(this,
|
|
86
|
+
mark: t(this, G)
|
|
84
87
|
},
|
|
85
88
|
custom: !0
|
|
86
89
|
}));
|
|
87
90
|
}
|
|
88
91
|
}
|
|
89
|
-
|
|
90
|
-
const
|
|
92
|
+
m = new WeakMap(), Mt = new WeakMap(), v = new WeakMap(), nt = new WeakMap(), T = new WeakMap(), G = new WeakMap();
|
|
93
|
+
const Te = ce({
|
|
91
94
|
":host": {
|
|
92
95
|
position: "relative",
|
|
93
96
|
width: "100%",
|
|
@@ -125,188 +128,193 @@ const Ie = oe({
|
|
|
125
128
|
flexShrink: "0"
|
|
126
129
|
}
|
|
127
130
|
});
|
|
128
|
-
var
|
|
129
|
-
class
|
|
131
|
+
var u, ht, P, V, R, O, D, H, K, A, C, ot, lt, ct, at, vt, k, ut, _, I, Z, B, j, dt, ft, J, Q, f, yt, l, Tt, Vt, y, g, L, M, X, W, E, S, Ct, Y, se, F, tt, pt, Et, $, o, At, St, Nt, qt, Qt, Xt, z, wt, fe, xt, Rt, Yt, te, rt, ee;
|
|
132
|
+
class It extends HTMLElement {
|
|
130
133
|
constructor() {
|
|
131
134
|
super();
|
|
132
|
-
s(this,
|
|
133
|
-
s(this,
|
|
134
|
-
s(this,
|
|
135
|
-
s(this, P, new
|
|
136
|
-
s(this, V, new
|
|
137
|
-
s(this, R, new
|
|
135
|
+
s(this, o);
|
|
136
|
+
s(this, u, null);
|
|
137
|
+
s(this, ht, new p(this, "--controls", !0));
|
|
138
|
+
s(this, P, new p(this, "--axis", "y"));
|
|
139
|
+
s(this, V, new p(this, "--direction", 0));
|
|
140
|
+
s(this, R, new p(this, "--pages", 0, {
|
|
138
141
|
validate: (e) => Math.max(0, e - 1)
|
|
139
142
|
}));
|
|
140
|
-
s(this,
|
|
141
|
-
s(this, D, new
|
|
142
|
-
s(this,
|
|
143
|
-
s(this,
|
|
143
|
+
s(this, O, new p(this, "--split", !1));
|
|
144
|
+
s(this, D, new p(this, "--sectional", !1));
|
|
145
|
+
s(this, H, new p(this, "--auto-size", !1));
|
|
146
|
+
s(this, K, new p(
|
|
144
147
|
this,
|
|
145
148
|
"--wheel-max-delta",
|
|
146
149
|
!1
|
|
147
150
|
));
|
|
148
|
-
s(this, A, new
|
|
151
|
+
s(this, A, new p(
|
|
149
152
|
this,
|
|
150
153
|
"--sections-in-view",
|
|
151
154
|
1
|
|
152
155
|
));
|
|
153
|
-
s(this, C, new
|
|
154
|
-
s(this,
|
|
155
|
-
s(this,
|
|
156
|
-
s(this,
|
|
157
|
-
s(this,
|
|
158
|
-
s(this,
|
|
156
|
+
s(this, C, new p(this, "--loop", !1));
|
|
157
|
+
s(this, ot, new p(this, "--damping", 20));
|
|
158
|
+
s(this, lt, new p(this, "--mass", 0));
|
|
159
|
+
s(this, ct, new p(this, "--stiffness", 0));
|
|
160
|
+
s(this, at, new p(this, "--mouse-drag", !1));
|
|
161
|
+
s(this, vt, new p(
|
|
159
162
|
this,
|
|
160
163
|
"--section-distance-scale",
|
|
161
164
|
0.5
|
|
162
165
|
));
|
|
163
|
-
s(this, k, new
|
|
164
|
-
s(this,
|
|
166
|
+
s(this, k, new p(this, "--autoplay", 0));
|
|
167
|
+
s(this, ut, new p(
|
|
165
168
|
this,
|
|
166
169
|
"--autoplay-pause-duration",
|
|
167
170
|
0
|
|
168
171
|
));
|
|
169
|
-
s(this,
|
|
172
|
+
s(this, _, new p(
|
|
170
173
|
this,
|
|
171
174
|
"--autoplay-user-direction",
|
|
172
175
|
!1
|
|
173
176
|
));
|
|
174
|
-
s(this, I, new
|
|
175
|
-
s(this,
|
|
177
|
+
s(this, I, new p(this, "--classes", !1));
|
|
178
|
+
s(this, Z, new p(
|
|
176
179
|
this,
|
|
177
180
|
"--current-index-start-offset",
|
|
178
181
|
0
|
|
179
182
|
));
|
|
180
|
-
s(this, B, new
|
|
183
|
+
s(this, B, new p(
|
|
181
184
|
this,
|
|
182
185
|
"--current-index-end-offset",
|
|
183
186
|
0
|
|
184
187
|
));
|
|
185
|
-
s(this,
|
|
186
|
-
s(this,
|
|
188
|
+
s(this, j, new p(this, "--focus-delay", 0));
|
|
189
|
+
s(this, dt, new p(
|
|
187
190
|
this,
|
|
188
191
|
"--focus-duration",
|
|
189
192
|
3e3
|
|
190
193
|
));
|
|
191
|
-
s(this,
|
|
192
|
-
s(this,
|
|
193
|
-
s(this,
|
|
194
|
-
s(this,
|
|
195
|
-
s(this,
|
|
196
|
-
s(this,
|
|
197
|
-
s(this,
|
|
198
|
-
s(this,
|
|
194
|
+
s(this, ft, new p(this, "--disabled", !1));
|
|
195
|
+
s(this, J, new p(this, "--hibernated", !1));
|
|
196
|
+
s(this, Q, null);
|
|
197
|
+
s(this, f, null);
|
|
198
|
+
s(this, yt, null);
|
|
199
|
+
s(this, l, []);
|
|
200
|
+
s(this, Tt, 0);
|
|
201
|
+
s(this, Vt, 0);
|
|
199
202
|
s(this, y, 0);
|
|
200
203
|
s(this, g, 0);
|
|
201
204
|
s(this, L, 0);
|
|
202
205
|
s(this, M, null);
|
|
203
|
-
s(this,
|
|
204
|
-
s(this,
|
|
206
|
+
s(this, X, null);
|
|
207
|
+
s(this, W, null);
|
|
205
208
|
s(this, E, null);
|
|
206
|
-
s(this, S, new
|
|
207
|
-
s(this,
|
|
208
|
-
s(this,
|
|
209
|
-
s(this,
|
|
209
|
+
s(this, S, new ve(0));
|
|
210
|
+
s(this, Ct, 0);
|
|
211
|
+
s(this, Y, 0);
|
|
212
|
+
s(this, se, !1);
|
|
213
|
+
s(this, F, !1);
|
|
214
|
+
s(this, tt, !0);
|
|
210
215
|
s(this, pt, !0);
|
|
211
|
-
s(this,
|
|
212
|
-
s(this,
|
|
216
|
+
s(this, Et);
|
|
217
|
+
s(this, $, new we());
|
|
213
218
|
s(this, z, () => {
|
|
214
|
-
t(this,
|
|
219
|
+
t(this, u).unlistenAnimationFrame();
|
|
215
220
|
const e = this.currentScrollValue / t(this, g) || 0, i = t(this, S).current;
|
|
216
|
-
if (h(this,
|
|
217
|
-
getComputedStyle(t(this,
|
|
218
|
-
)) : h(this, L,
|
|
219
|
-
getComputedStyle(t(this,
|
|
220
|
-
)), t(this,
|
|
221
|
+
if (h(this, Tt, this.vertical ? jt(this) : Jt(this)), h(this, Vt, this.vertical ? jt(t(this, f)) : Jt(t(this, f))), h(this, y, this.vertical ? this.offsetHeight : this.offsetWidth), this.vertical ? h(this, L, le.parse(
|
|
222
|
+
getComputedStyle(t(this, f)).rowGap
|
|
223
|
+
)) : h(this, L, le.parse(
|
|
224
|
+
getComputedStyle(t(this, f)).columnGap
|
|
225
|
+
)), t(this, H).current && t(this, l).length) {
|
|
221
226
|
const r = t(this, A).current, c = (t(this, y) - t(this, L) * (r - 1)) / r;
|
|
222
|
-
t(this,
|
|
227
|
+
t(this, l).forEach((b) => {
|
|
223
228
|
b.setSize(c);
|
|
224
229
|
});
|
|
225
230
|
} else
|
|
226
|
-
t(this,
|
|
231
|
+
t(this, l).forEach((r) => {
|
|
227
232
|
r.setSize();
|
|
228
233
|
});
|
|
229
|
-
if (t(this,
|
|
234
|
+
if (t(this, l).forEach((r) => {
|
|
230
235
|
r.resize();
|
|
231
236
|
}), t(this, R).current) {
|
|
232
237
|
h(this, g, t(this, y) * t(this, R).current);
|
|
233
238
|
const r = t(this, g) + t(this, y);
|
|
234
|
-
this.vertical ? (t(this,
|
|
239
|
+
this.vertical ? (t(this, f).style.width = r + "px", t(this, f).style.height = "100%") : (t(this, f).style.height = r + "px", t(this, f).style.width = "100%");
|
|
235
240
|
} else
|
|
236
|
-
this.vertical ? (t(this,
|
|
241
|
+
this.vertical ? (t(this, f).style.width = "100%", t(this, f).style.height = "max-content", h(this, g, t(this, f).offsetHeight - t(this, y))) : (t(this, f).style.width = "max-content", t(this, f).style.height = "100%", h(this, g, t(this, f).offsetWidth - t(this, y)));
|
|
237
242
|
if (!t(this, C).current) {
|
|
238
243
|
const r = getComputedStyle(this), c = this.vertical ? parseFloat(r.paddingBlockStart) + parseFloat(r.paddingBlockEnd) : parseFloat(r.paddingInlineStart) + parseFloat(r.paddingInlineEnd);
|
|
239
|
-
h(this, g, t(this, g) + c), t(this,
|
|
244
|
+
h(this, g, t(this, g) + c), t(this, u).max = t(this, g);
|
|
240
245
|
}
|
|
241
|
-
if (t(this, C).current && t(this,
|
|
242
|
-
const r = t(this,
|
|
243
|
-
h(this,
|
|
246
|
+
if (t(this, C).current && t(this, l).length) {
|
|
247
|
+
const r = t(this, l)[t(this, l).length - 1], c = r.position + r.size - t(this, y), b = t(this, g) - c;
|
|
248
|
+
h(this, Y, r.position + r.size + b);
|
|
244
249
|
} else
|
|
245
|
-
h(this,
|
|
246
|
-
if (t(this, D).current && t(this,
|
|
247
|
-
const r = t(this,
|
|
248
|
-
t(this,
|
|
250
|
+
h(this, Y, t(this, g));
|
|
251
|
+
if (t(this, D).current && t(this, l).length) {
|
|
252
|
+
const r = t(this, l)[i];
|
|
253
|
+
t(this, u).set(r.position, {
|
|
249
254
|
equalize: !0
|
|
250
255
|
});
|
|
251
256
|
} else
|
|
252
|
-
t(this,
|
|
257
|
+
t(this, u).set(e * t(this, g), {
|
|
253
258
|
equalize: !0
|
|
254
259
|
});
|
|
260
|
+
h(this, F, (this.vertical ? t(this, f).offsetHeight : t(this, f).offsetWidth) > t(this, y)), this.classList.toggle("has-overflow", t(this, F)), t(this, F) ? d(this, o, qt).call(this) : d(this, o, Nt).call(this), t(this, wt).call(this);
|
|
255
261
|
});
|
|
256
|
-
s(this,
|
|
262
|
+
s(this, wt, () => {
|
|
263
|
+
if (!t(this, F))
|
|
264
|
+
return;
|
|
257
265
|
const e = this.currentScrollValue;
|
|
258
|
-
if (h(this,
|
|
266
|
+
if (h(this, Ct, Math.max(0, e - t(this, g))), t(this, l).length) {
|
|
259
267
|
let i = 0;
|
|
260
|
-
for (let r = 0; r < t(this,
|
|
261
|
-
const c = t(this,
|
|
268
|
+
for (let r = 0; r < t(this, l).length; r++) {
|
|
269
|
+
const c = t(this, l)[r];
|
|
262
270
|
c.transform(), this.targetScrollValue + c.size / 2 >= c.position && (i = r);
|
|
263
271
|
}
|
|
264
272
|
t(this, S).current = i;
|
|
265
273
|
} else
|
|
266
|
-
this.vertical ? t(this,
|
|
267
|
-
|
|
274
|
+
this.vertical ? t(this, f).style.transform = `translate3d(0px, ${e * -1}px, 0px)` : t(this, f).style.transform = `translate3d(${e * -1}px, 0px, 0px)`;
|
|
275
|
+
gt.update(
|
|
268
276
|
this,
|
|
269
277
|
t(this, P).current,
|
|
270
278
|
e
|
|
271
279
|
);
|
|
272
280
|
});
|
|
273
|
-
s(this,
|
|
274
|
-
t(this,
|
|
281
|
+
s(this, xt, (e, i) => {
|
|
282
|
+
t(this, ht).current && (d(this, o, Yt).call(this, Math.sign(i) || 1), t(this, Rt).call(this, e, i));
|
|
275
283
|
});
|
|
276
|
-
s(this,
|
|
284
|
+
s(this, Rt, (e, i) => {
|
|
277
285
|
if (t(this, V).current) {
|
|
278
286
|
if (t(this, V).current < 0 && i > 0)
|
|
279
287
|
return;
|
|
280
288
|
if (t(this, V).current > 0 && i < 0)
|
|
281
289
|
return;
|
|
282
290
|
}
|
|
283
|
-
if (t(this,
|
|
284
|
-
const r = d(this,
|
|
291
|
+
if (t(this, $).unlistenAnimationFrame(), !t(this, k).current && t(this, j).current && (clearInterval(t(this, Et)), h(this, Et, setTimeout(() => {
|
|
292
|
+
const r = d(this, o, ee).call(this);
|
|
285
293
|
r && this.scrollToSection(r.index, {
|
|
286
294
|
tween: {
|
|
287
|
-
duration: t(this,
|
|
288
|
-
easing:
|
|
295
|
+
duration: t(this, dt).current,
|
|
296
|
+
easing: ye
|
|
289
297
|
}
|
|
290
298
|
});
|
|
291
|
-
}, t(this,
|
|
299
|
+
}, t(this, j).current))), !(e === "drag" && !ke.isMobile && !t(this, at).current))
|
|
292
300
|
if (t(this, D).current) {
|
|
293
301
|
const r = Math.sign(i);
|
|
294
|
-
t(this,
|
|
302
|
+
t(this, l).length ? this.shiftSections(r) : t(this, u).shift(r * t(this, y));
|
|
295
303
|
} else
|
|
296
|
-
t(this,
|
|
304
|
+
t(this, u).shift(i);
|
|
297
305
|
});
|
|
298
|
-
if (
|
|
306
|
+
if (Kt) {
|
|
299
307
|
const e = this.attachShadow({ mode: "open" });
|
|
300
|
-
e.adoptedStyleSheets.push(
|
|
308
|
+
e.adoptedStyleSheets.push(Te);
|
|
301
309
|
const i = document.createElement("div");
|
|
302
|
-
i.className = "static", i.innerHTML = '<slot name="static"></slot>', e.appendChild(i), h(this,
|
|
310
|
+
i.className = "static", i.innerHTML = '<slot name="static"></slot>', e.appendChild(i), h(this, Q, document.createElement("div")), t(this, Q).className = "content-wrapper", h(this, f, document.createElement("div")), t(this, f).className = "content", h(this, yt, document.createElement("slot")), t(this, f).appendChild(t(this, yt)), t(this, Q).appendChild(t(this, f)), e.appendChild(t(this, Q));
|
|
303
311
|
}
|
|
304
312
|
}
|
|
305
313
|
get damped() {
|
|
306
|
-
return t(this,
|
|
314
|
+
return t(this, u);
|
|
307
315
|
}
|
|
308
316
|
get controlsCSSProperty() {
|
|
309
|
-
return t(this,
|
|
317
|
+
return t(this, ht);
|
|
310
318
|
}
|
|
311
319
|
get axisCSSProperty() {
|
|
312
320
|
return t(this, P);
|
|
@@ -318,16 +326,16 @@ class Dt extends HTMLElement {
|
|
|
318
326
|
return t(this, R);
|
|
319
327
|
}
|
|
320
328
|
get splitCSSProperty() {
|
|
321
|
-
return t(this,
|
|
329
|
+
return t(this, O);
|
|
322
330
|
}
|
|
323
331
|
get sectionalCSSProperty() {
|
|
324
332
|
return t(this, D);
|
|
325
333
|
}
|
|
326
334
|
get autoSizeCSSProperty() {
|
|
327
|
-
return t(this,
|
|
335
|
+
return t(this, H);
|
|
328
336
|
}
|
|
329
337
|
get wheelMaxDeltaCSSProperty() {
|
|
330
|
-
return t(this,
|
|
338
|
+
return t(this, K);
|
|
331
339
|
}
|
|
332
340
|
get sectionsInViewCSSProperty() {
|
|
333
341
|
return t(this, A);
|
|
@@ -336,70 +344,70 @@ class Dt extends HTMLElement {
|
|
|
336
344
|
return t(this, C);
|
|
337
345
|
}
|
|
338
346
|
get dampingCSSProperty() {
|
|
339
|
-
return t(this,
|
|
347
|
+
return t(this, ot);
|
|
340
348
|
}
|
|
341
349
|
get massCSSProperty() {
|
|
342
|
-
return t(this,
|
|
350
|
+
return t(this, lt);
|
|
343
351
|
}
|
|
344
352
|
get stiffnessCSSProperty() {
|
|
345
|
-
return t(this,
|
|
353
|
+
return t(this, ct);
|
|
346
354
|
}
|
|
347
355
|
get mouseDragCSSProperty() {
|
|
348
|
-
return t(this,
|
|
356
|
+
return t(this, at);
|
|
349
357
|
}
|
|
350
358
|
get sectionDistanceScaleCSSProperty() {
|
|
351
|
-
return t(this,
|
|
359
|
+
return t(this, vt);
|
|
352
360
|
}
|
|
353
361
|
get autoplayCSSProperty() {
|
|
354
362
|
return t(this, k);
|
|
355
363
|
}
|
|
356
364
|
get autoplayPauseDurationCSSProperty() {
|
|
357
|
-
return t(this,
|
|
365
|
+
return t(this, ut);
|
|
358
366
|
}
|
|
359
367
|
get autoplayUserDirectionCSSProperty() {
|
|
360
|
-
return t(this,
|
|
368
|
+
return t(this, _);
|
|
361
369
|
}
|
|
362
370
|
get classesCSSProperty() {
|
|
363
371
|
return t(this, I);
|
|
364
372
|
}
|
|
365
373
|
get currentIndexStartOffsetCSSProperty() {
|
|
366
|
-
return t(this,
|
|
374
|
+
return t(this, Z);
|
|
367
375
|
}
|
|
368
376
|
get currentIndexEndOffsetCSSProperty() {
|
|
369
377
|
return t(this, B);
|
|
370
378
|
}
|
|
371
379
|
get focusDelayCSSProperty() {
|
|
372
|
-
return t(this,
|
|
380
|
+
return t(this, j);
|
|
373
381
|
}
|
|
374
382
|
get focusDurationCSSProperty() {
|
|
375
|
-
return t(this,
|
|
383
|
+
return t(this, dt);
|
|
376
384
|
}
|
|
377
385
|
get disabledCSSProperty() {
|
|
378
|
-
return t(this,
|
|
386
|
+
return t(this, ft);
|
|
379
387
|
}
|
|
380
388
|
get hibernatedCSSProperty() {
|
|
381
|
-
return t(this,
|
|
389
|
+
return t(this, J);
|
|
382
390
|
}
|
|
383
391
|
get currentScrollValue() {
|
|
384
|
-
return d(this,
|
|
392
|
+
return d(this, o, te).call(this, "current");
|
|
385
393
|
}
|
|
386
394
|
get targetScrollValue() {
|
|
387
|
-
return d(this,
|
|
395
|
+
return d(this, o, te).call(this, "target");
|
|
388
396
|
}
|
|
389
397
|
get contentWrapperElement() {
|
|
390
|
-
return t(this,
|
|
398
|
+
return t(this, Q);
|
|
391
399
|
}
|
|
392
400
|
get contentElement() {
|
|
393
|
-
return t(this,
|
|
401
|
+
return t(this, f);
|
|
394
402
|
}
|
|
395
403
|
get sections() {
|
|
396
|
-
return t(this,
|
|
404
|
+
return t(this, l);
|
|
397
405
|
}
|
|
398
406
|
get position() {
|
|
399
|
-
return t(this,
|
|
407
|
+
return t(this, Tt);
|
|
400
408
|
}
|
|
401
409
|
get contentPosition() {
|
|
402
|
-
return t(this,
|
|
410
|
+
return t(this, Vt);
|
|
403
411
|
}
|
|
404
412
|
get viewportSize() {
|
|
405
413
|
return t(this, y);
|
|
@@ -414,16 +422,19 @@ class Dt extends HTMLElement {
|
|
|
414
422
|
return t(this, S);
|
|
415
423
|
}
|
|
416
424
|
get limit() {
|
|
417
|
-
return t(this,
|
|
425
|
+
return t(this, l).length - t(this, A).current;
|
|
418
426
|
}
|
|
419
427
|
get distance() {
|
|
420
|
-
return t(this,
|
|
428
|
+
return t(this, Y);
|
|
421
429
|
}
|
|
422
430
|
get loopDistance() {
|
|
423
|
-
return t(this, C).current ? t(this,
|
|
431
|
+
return t(this, C).current ? t(this, Y) + t(this, L) : t(this, Y);
|
|
432
|
+
}
|
|
433
|
+
get hasOverflow() {
|
|
434
|
+
return t(this, F);
|
|
424
435
|
}
|
|
425
436
|
get overscroll() {
|
|
426
|
-
return t(this,
|
|
437
|
+
return t(this, Ct);
|
|
427
438
|
}
|
|
428
439
|
get vertical() {
|
|
429
440
|
return t(this, P).current === "y";
|
|
@@ -435,16 +446,16 @@ class Dt extends HTMLElement {
|
|
|
435
446
|
return this.targetScrollValue / this.loopDistance || 0;
|
|
436
447
|
}
|
|
437
448
|
get scrollWidth() {
|
|
438
|
-
return t(this, P).current === "y" ? 0 : t(this,
|
|
449
|
+
return t(this, P).current === "y" ? 0 : t(this, u).distance;
|
|
439
450
|
}
|
|
440
451
|
get scrollHeight() {
|
|
441
|
-
return t(this, P).current === "x" ? 0 : t(this,
|
|
452
|
+
return t(this, P).current === "x" ? 0 : t(this, u).distance;
|
|
442
453
|
}
|
|
443
454
|
onScroll(...e) {
|
|
444
|
-
return t(this,
|
|
455
|
+
return t(this, u).subscribe(...e);
|
|
445
456
|
}
|
|
446
457
|
offScroll(...e) {
|
|
447
|
-
t(this,
|
|
458
|
+
t(this, u).unsubscribe(...e);
|
|
448
459
|
}
|
|
449
460
|
//https://github.com/pmndrs/drei/blob/d3282cdd02d170ef603a5e096505d83dc93cd57a/src/web/ScrollControls.tsx#L85C7-L100C9
|
|
450
461
|
range(e, i, r = 0) {
|
|
@@ -459,193 +470,195 @@ class Dt extends HTMLElement {
|
|
|
459
470
|
return this.currentProgress >= c && this.currentProgress <= b;
|
|
460
471
|
}
|
|
461
472
|
scrollToSection(e, i) {
|
|
462
|
-
if (!t(this,
|
|
473
|
+
if (!t(this, l).length)
|
|
463
474
|
return;
|
|
464
475
|
const r = t(this, S).current;
|
|
465
|
-
d(this,
|
|
466
|
-
const c = t(this,
|
|
476
|
+
d(this, o, fe).call(this, e);
|
|
477
|
+
const c = t(this, l)[r], b = t(this, l)[t(this, S).current];
|
|
467
478
|
if (c && b) {
|
|
468
|
-
let
|
|
469
|
-
const
|
|
470
|
-
t(this, C).current ? t(this, S).current === 0 && r === t(this,
|
|
479
|
+
let x = 0;
|
|
480
|
+
const bt = d(this, o, ee).call(this), me = bt ? this.targetScrollValue - bt.position : 0;
|
|
481
|
+
t(this, C).current ? t(this, S).current === 0 && r === t(this, l).length - 1 ? x = t(this, g) + t(this, y) - c.position + t(this, L) + 1 : t(this, S).current === t(this, l).length - 1 && r === 0 ? x = b.position - (t(this, g) + t(this, y) + t(this, L)) : x = b.position - c.position : x = b.position - c.position, this.shiftPosition(x - me, i);
|
|
471
482
|
}
|
|
472
483
|
}
|
|
473
484
|
shiftSections(e, i) {
|
|
474
|
-
t(this,
|
|
485
|
+
t(this, l).length && this.scrollToSection(t(this, S).current + e, i);
|
|
475
486
|
}
|
|
476
487
|
setPosition(e, i) {
|
|
477
|
-
d(this,
|
|
488
|
+
d(this, o, Yt).call(this, Math.sign(e) || 1), i != null && i.tween ? (t(this, $).set(t(this, u).current, { equalize: !0 }), t(this, $).set(e, oe({}, i.tween))) : t(this, u).set(e, {
|
|
478
489
|
equalize: (i == null ? void 0 : i.behaviour) === "instant"
|
|
479
490
|
});
|
|
480
491
|
}
|
|
481
492
|
shiftPosition(e, i) {
|
|
482
|
-
this.setPosition(t(this,
|
|
493
|
+
this.setPosition(t(this, u).target + e, i);
|
|
483
494
|
}
|
|
484
495
|
connectedCallback() {
|
|
485
|
-
h(this,
|
|
496
|
+
h(this, u, new Ee(0, {
|
|
486
497
|
damping: 0.01,
|
|
487
498
|
min: 0,
|
|
488
|
-
order:
|
|
489
|
-
})), this.setAttribute("tabindex", "0"), h(this, M, new
|
|
499
|
+
order: Ce.SCROLL
|
|
500
|
+
})), this.setAttribute("tabindex", "0"), h(this, M, new xe({ element: t(this, f) })), t(this, M).changeEvent.subscribe(t(this, xt)), h(this, X, new Pe({
|
|
490
501
|
element: this
|
|
491
|
-
})), t(this,
|
|
492
|
-
t(this,
|
|
493
|
-
), h(this,
|
|
502
|
+
})), t(this, X).changeEvent.subscribe(
|
|
503
|
+
t(this, xt)
|
|
504
|
+
), h(this, W, new Le({ element: t(this, f) })), t(this, W).changeEvent.subscribe(t(this, xt)), h(this, E, new ze({
|
|
494
505
|
culling: this
|
|
495
|
-
})), t(this, E).changeEvent.subscribe(t(this,
|
|
496
|
-
t(this,
|
|
497
|
-
}), t(this,
|
|
506
|
+
})), t(this, E).changeEvent.subscribe(t(this, Rt)), t(this, P).subscribe(({ current: e }) => {
|
|
507
|
+
t(this, f).style.flexDirection = e === "x" ? "row" : "column", t(this, M).axis = t(this, K).current ? "max" : e, t(this, X).dimension = e === "x" ? "width" : "height", t(this, W).axis = e, e === "x" ? this.style.touchAction = "pan-y" : e === "y" && (this.style.touchAction = "pan-x"), this.isConnected && t(this, z).call(this);
|
|
508
|
+
}), t(this, K).subscribe((e) => {
|
|
498
509
|
t(this, M).axis = e.current ? "max" : t(this, P).current;
|
|
499
510
|
}), t(this, R).subscribe(() => {
|
|
500
511
|
this.isConnected && t(this, z).call(this);
|
|
501
|
-
}), t(this,
|
|
502
|
-
this.isConnected && (e ? d(this,
|
|
512
|
+
}), t(this, O).subscribe(({ current: e }) => {
|
|
513
|
+
this.isConnected && (e ? d(this, o, At).call(this) : d(this, o, St).call(this));
|
|
503
514
|
}), t(this, D).subscribe((e) => {
|
|
504
|
-
t(this, M).debounce = e.current, t(this,
|
|
505
|
-
}), t(this,
|
|
506
|
-
this.isConnected && (t(this, z).call(this), e.current && !e.previous && !t(this,
|
|
515
|
+
t(this, M).debounce = e.current, t(this, W).swipe = e.current, t(this, E).interval = e.current, this.isConnected && (e.current && !e.previous && !t(this, l).length ? d(this, o, At).call(this) : !e.current && e.previous && t(this, l).length && d(this, o, St).call(this));
|
|
516
|
+
}), t(this, H).subscribe((e) => {
|
|
517
|
+
this.isConnected && (t(this, z).call(this), e.current && !e.previous && !t(this, l).length ? d(this, o, At).call(this) : !e.current && e.previous && t(this, l).length && d(this, o, St).call(this));
|
|
507
518
|
}), t(this, A).subscribe((e) => {
|
|
508
|
-
this.isConnected && (t(this, z).call(this), d(this,
|
|
519
|
+
this.isConnected && (t(this, z).call(this), d(this, o, rt).call(this));
|
|
509
520
|
}), t(this, C).subscribe((e) => {
|
|
510
|
-
e.current ? (this.isConnected && (t(this,
|
|
511
|
-
}), t(this, nt).subscribe((e) => {
|
|
512
|
-
t(this, a).damping = e.current;
|
|
513
|
-
}), t(this, ht).subscribe((e) => {
|
|
514
|
-
t(this, a).mass = e.current;
|
|
521
|
+
e.current ? (this.isConnected && (t(this, l).length || (t(this, O).current = !0)), t(this, l).length && (t(this, u).max = 1 / 0, t(this, u).min = -1 / 0)) : (h(this, Ct, 0), t(this, u).max = t(this, g), t(this, u).min = 0);
|
|
515
522
|
}), t(this, ot).subscribe((e) => {
|
|
516
|
-
t(this,
|
|
523
|
+
t(this, u).damping = e.current;
|
|
524
|
+
}), t(this, lt).subscribe((e) => {
|
|
525
|
+
t(this, u).mass = e.current;
|
|
526
|
+
}), t(this, ct).subscribe((e) => {
|
|
527
|
+
t(this, u).stiffness = e.current;
|
|
517
528
|
}), t(this, k).subscribe((e) => {
|
|
518
|
-
t(this, E).speed = e.current, e.current && !e.previous ? t(this, E).connect() : !e.current && e.previous && t(this, E).disconnect();
|
|
519
|
-
}), t(this,
|
|
529
|
+
t(this, E).speed = e.current, !t(this, tt) && e.current && !e.previous ? t(this, E).connect() : !e.current && e.previous && t(this, E).disconnect();
|
|
530
|
+
}), t(this, _).subscribe((e) => {
|
|
520
531
|
e.current || (t(this, E).direction = 1);
|
|
521
532
|
}), t(this, I).subscribe((e) => {
|
|
522
|
-
this.isConnected && d(this,
|
|
523
|
-
}), t(this,
|
|
524
|
-
this.isConnected && t(this, I).current && d(this,
|
|
533
|
+
this.isConnected && d(this, o, rt).call(this);
|
|
534
|
+
}), t(this, Z).subscribe((e) => {
|
|
535
|
+
this.isConnected && t(this, I).current && d(this, o, rt).call(this);
|
|
525
536
|
}), t(this, B).subscribe((e) => {
|
|
526
|
-
this.isConnected && t(this, I).current && d(this,
|
|
527
|
-
}), t(this,
|
|
537
|
+
this.isConnected && t(this, I).current && d(this, o, rt).call(this);
|
|
538
|
+
}), t(this, u).isRunning.subscribe((e) => {
|
|
528
539
|
this.classList.toggle("active", e.current);
|
|
529
540
|
}), t(this, S).subscribe((e) => {
|
|
530
|
-
t(this,
|
|
531
|
-
}), t(this,
|
|
532
|
-
t(this,
|
|
533
|
-
}), t(this,
|
|
534
|
-
e.current && !e.previous ? d(this,
|
|
535
|
-
}), t(this,
|
|
536
|
-
e.current && !e.previous ? d(this,
|
|
537
|
-
}), t(this,
|
|
541
|
+
t(this, l).length && d(this, o, rt).call(this);
|
|
542
|
+
}), t(this, $).subscribe((e) => {
|
|
543
|
+
t(this, $).isRunning.current && t(this, u).set(e.current);
|
|
544
|
+
}), t(this, ft).subscribe((e) => {
|
|
545
|
+
e.current && !e.previous ? d(this, o, Nt).call(this) : !e.current && e.previous && d(this, o, qt).call(this);
|
|
546
|
+
}), t(this, J).subscribe((e) => {
|
|
547
|
+
e.current && !e.previous ? d(this, o, Qt).call(this) : !e.current && e.previous && d(this, o, Xt).call(this);
|
|
548
|
+
}), t(this, ht).observe(), t(this, P).observe(), t(this, V).observe(), t(this, R).observe(), t(this, O).observe(), t(this, D).observe(), t(this, H).observe(), t(this, K).observe(), t(this, A).observe(), t(this, C).observe(), t(this, ot).observe(), t(this, lt).observe(), t(this, ct).observe(), t(this, at).observe(), t(this, vt).observe(), t(this, k).observe(), t(this, k).observe(), t(this, ut).observe(), t(this, _).observe(), t(this, I).observe(), t(this, Z).observe(), t(this, B).observe(), t(this, j).observe(), t(this, dt).observe(), t(this, ft).observe(), t(this, J).observe(), t(this, J).current || d(this, o, Xt).call(this);
|
|
538
549
|
}
|
|
539
550
|
disconnectedCallback() {
|
|
540
|
-
this.
|
|
551
|
+
this.removeAttribute("tabindex"), this.classList.remove("has-overflow"), t(this, ht).unobserve(), t(this, P).unobserve(), t(this, V).unobserve(), t(this, R).unobserve(), t(this, O).unobserve(), t(this, D).unobserve(), t(this, H).unobserve(), t(this, K).unobserve(), t(this, A).unobserve(), t(this, C).unobserve(), t(this, ot).unobserve(), t(this, lt).unobserve(), t(this, ct).unobserve(), t(this, at).unobserve(), t(this, vt).unobserve(), t(this, k).unobserve(), t(this, ut).unobserve(), t(this, _).unobserve(), t(this, I).unobserve(), t(this, Z).unobserve(), t(this, B).unobserve(), t(this, j).unobserve(), t(this, dt).unobserve(), t(this, ft).unobserve(), t(this, J).unobserve(), d(this, o, Qt).call(this);
|
|
541
552
|
}
|
|
542
553
|
}
|
|
543
|
-
|
|
544
|
-
d(this,
|
|
545
|
-
e instanceof HTMLElement && t(this,
|
|
546
|
-
}), t(this,
|
|
554
|
+
u = new WeakMap(), ht = new WeakMap(), P = new WeakMap(), V = new WeakMap(), R = new WeakMap(), O = new WeakMap(), D = new WeakMap(), H = new WeakMap(), K = new WeakMap(), A = new WeakMap(), C = new WeakMap(), ot = new WeakMap(), lt = new WeakMap(), ct = new WeakMap(), at = new WeakMap(), vt = new WeakMap(), k = new WeakMap(), ut = new WeakMap(), _ = new WeakMap(), I = new WeakMap(), Z = new WeakMap(), B = new WeakMap(), j = new WeakMap(), dt = new WeakMap(), ft = new WeakMap(), J = new WeakMap(), Q = new WeakMap(), f = new WeakMap(), yt = new WeakMap(), l = new WeakMap(), Tt = new WeakMap(), Vt = new WeakMap(), y = new WeakMap(), g = new WeakMap(), L = new WeakMap(), M = new WeakMap(), X = new WeakMap(), W = new WeakMap(), E = new WeakMap(), S = new WeakMap(), Ct = new WeakMap(), Y = new WeakMap(), se = new WeakMap(), F = new WeakMap(), tt = new WeakMap(), pt = new WeakMap(), Et = new WeakMap(), $ = new WeakMap(), o = new WeakSet(), At = function() {
|
|
555
|
+
d(this, o, St).call(this), t(this, yt).assignedElements().forEach((e, i) => {
|
|
556
|
+
e instanceof HTMLElement && t(this, l).push(new Me(e, i, this));
|
|
557
|
+
}), t(this, f).style.transform = "", Zt(this, "scrollSectionsChange", {
|
|
547
558
|
custom: !0,
|
|
548
559
|
composed: !0
|
|
549
|
-
}), t(this, z).call(this), d(this,
|
|
550
|
-
},
|
|
551
|
-
t(this,
|
|
560
|
+
}), t(this, z).call(this), d(this, o, rt).call(this);
|
|
561
|
+
}, St = function() {
|
|
562
|
+
t(this, l).forEach((e) => {
|
|
552
563
|
e.destroy();
|
|
553
|
-
}), h(this,
|
|
564
|
+
}), h(this, l, []), t(this, S).reset(), t(this, u).reset(), Zt(this, "scrollSectionsChange", {
|
|
554
565
|
custom: !0,
|
|
555
566
|
composed: !0
|
|
556
567
|
});
|
|
557
|
-
},
|
|
558
|
-
t(this,
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
},
|
|
562
|
-
t(this,
|
|
568
|
+
}, Nt = function() {
|
|
569
|
+
t(this, tt) || (h(this, tt, !0), t(this, u).unsubscribe(t(this, wt)), t(this, u).unlistenAnimationFrame(), clearInterval(t(this, Et)), t(this, $).unlistenAnimationFrame(), t(this, M).disconnect(), t(this, X).disconnect(), t(this, W).disconnect(), t(this, E).disconnect(), t(this, F) || this.sections.forEach((e) => {
|
|
570
|
+
e.unsetTransform();
|
|
571
|
+
}));
|
|
572
|
+
}, qt = function() {
|
|
573
|
+
t(this, tt) && (h(this, tt, !1), t(this, u).subscribe(t(this, wt)), t(this, M).connect(), t(this, X).connect(), t(this, W).connect(), t(this, k).current && t(this, E).connect());
|
|
563
574
|
}, Qt = function() {
|
|
564
|
-
t(this, pt)
|
|
565
|
-
},
|
|
566
|
-
t(this,
|
|
567
|
-
},
|
|
568
|
-
t(this,
|
|
569
|
-
|
|
575
|
+
t(this, pt) || (h(this, pt, !0), Ut.unsubscribe(t(this, z)), Gt.unsubscribe(t(this, z)), d(this, o, Nt).call(this), t(this, f).style.transform = "", t(this, l).length ? d(this, o, St).call(this) : (t(this, S).reset(), t(this, u).reset()), gt.unregister(this));
|
|
576
|
+
}, Xt = function() {
|
|
577
|
+
t(this, pt) && (h(this, pt, !1), (t(this, C).current || t(this, O).current || t(this, C).current || t(this, H).current || t(this, D).current) && d(this, o, At).call(this), gt.register(this), d(this, o, qt).call(this), Ut.subscribe(t(this, z), ue.SCROLL), Gt.subscribe(this, t(this, z)));
|
|
578
|
+
}, z = new WeakMap(), wt = new WeakMap(), fe = function(e) {
|
|
579
|
+
t(this, C).current ? (t(this, S).current = e % t(this, l).length, t(this, S).current = t(this, S).current < 0 ? t(this, l).length + t(this, S).current : t(this, S).current) : t(this, S).current = ae(e, 0, this.limit);
|
|
580
|
+
}, xt = new WeakMap(), Rt = new WeakMap(), Yt = function(e = 1) {
|
|
581
|
+
t(this, _).current && (t(this, E).direction = e), t(this, k).current && t(this, E).pauseAndContinue(
|
|
582
|
+
t(this, ut).current,
|
|
570
583
|
this.sectionalCSSProperty.current
|
|
571
584
|
);
|
|
572
|
-
},
|
|
573
|
-
if (t(this, C).current && t(this,
|
|
574
|
-
const i = t(this,
|
|
585
|
+
}, te = function(e = "current") {
|
|
586
|
+
if (t(this, C).current && t(this, l).length) {
|
|
587
|
+
const i = t(this, u)[e] % (t(this, g) + t(this, y) + t(this, L));
|
|
575
588
|
return i < 0 ? t(this, g) + i + t(this, y) + t(this, L) : i;
|
|
576
589
|
} else
|
|
577
|
-
return t(this,
|
|
578
|
-
},
|
|
579
|
-
if (t(this, I).current && t(this,
|
|
580
|
-
const e = t(this, S).current + t(this,
|
|
590
|
+
return t(this, u)[e];
|
|
591
|
+
}, rt = function() {
|
|
592
|
+
if (t(this, I).current && t(this, l).length) {
|
|
593
|
+
const e = t(this, S).current + t(this, Z).current;
|
|
581
594
|
e === 0 ? this.classList.add("start") : this.classList.remove("start"), e === this.limit ? this.classList.add("end") : this.classList.remove("end");
|
|
582
595
|
const i = t(this, A).current + t(this, B).current;
|
|
583
|
-
t(this,
|
|
584
|
-
const b = e - this.limit - 1 + t(this, B).current,
|
|
585
|
-
c >= e && c <
|
|
596
|
+
t(this, l).forEach((r, c) => {
|
|
597
|
+
const b = e - this.limit - 1 + t(this, B).current, x = e + i, bt = this.sections.length - x;
|
|
598
|
+
c >= e && c < x || c <= b ? r.mark("current") : c >= x && c < x + bt / 2 || c <= b + i ? r.mark("next") : r.mark("previous");
|
|
586
599
|
});
|
|
587
600
|
}
|
|
588
|
-
},
|
|
601
|
+
}, ee = function() {
|
|
589
602
|
let e = null, i = 1 / 0;
|
|
590
|
-
for (let r = 0; r < t(this,
|
|
591
|
-
const c = Math.abs(t(this,
|
|
603
|
+
for (let r = 0; r < t(this, l).length; r++) {
|
|
604
|
+
const c = Math.abs(t(this, l)[r].position - this.targetScrollValue);
|
|
592
605
|
c < i && (i = c, e = r);
|
|
593
606
|
}
|
|
594
|
-
return e !== null ? t(this,
|
|
607
|
+
return e !== null ? t(this, l)[e] : null;
|
|
595
608
|
};
|
|
596
|
-
customElements.get("e-scroll") || customElements.define("e-scroll",
|
|
597
|
-
var
|
|
598
|
-
class
|
|
609
|
+
customElements.get("e-scroll") || customElements.define("e-scroll", It);
|
|
610
|
+
var Ot;
|
|
611
|
+
class ie extends HTMLElement {
|
|
599
612
|
constructor() {
|
|
600
613
|
super(...arguments);
|
|
601
|
-
s(this,
|
|
614
|
+
s(this, Ot, null);
|
|
602
615
|
}
|
|
603
616
|
get scrollElement() {
|
|
604
|
-
return t(this,
|
|
617
|
+
return t(this, Ot);
|
|
605
618
|
}
|
|
606
619
|
connectedCallback() {
|
|
607
|
-
const e =
|
|
608
|
-
e instanceof
|
|
620
|
+
const e = de(this, It);
|
|
621
|
+
e instanceof It ? h(this, Ot, e) : console.error(this, "e-scroll not found");
|
|
609
622
|
}
|
|
610
623
|
}
|
|
611
|
-
|
|
612
|
-
var
|
|
613
|
-
class
|
|
624
|
+
Ot = new WeakMap();
|
|
625
|
+
var et, w, N, q, Pt, Lt, mt, Ht, Bt, Wt;
|
|
626
|
+
class Ve extends ie {
|
|
614
627
|
constructor() {
|
|
615
628
|
super();
|
|
616
|
-
s(this,
|
|
617
|
-
s(this,
|
|
618
|
-
s(this,
|
|
619
|
-
s(this,
|
|
620
|
-
s(this,
|
|
621
|
-
s(this,
|
|
629
|
+
s(this, et, null);
|
|
630
|
+
s(this, w, null);
|
|
631
|
+
s(this, N, !1);
|
|
632
|
+
s(this, q, 0);
|
|
633
|
+
s(this, Pt, 0);
|
|
634
|
+
s(this, Lt, 0);
|
|
622
635
|
s(this, mt, () => {
|
|
623
|
-
h(this,
|
|
624
|
-
const e = t(this,
|
|
625
|
-
h(this,
|
|
636
|
+
h(this, N, this.offsetWidth > this.offsetHeight);
|
|
637
|
+
const e = t(this, N) ? this.offsetWidth : this.offsetHeight;
|
|
638
|
+
h(this, q, e / ((this.scrollElement.scrollSize + this.scrollElement.viewportSize) / e)), h(this, q, Math.max(t(this, q), 30)), t(this, N) ? (t(this, w).style.width = t(this, q) + "px", t(this, w).style.height = "100%") : (t(this, w).style.width = "100%", t(this, w).style.height = t(this, q) + "px"), h(this, Pt, e - t(this, q)), this.scrollElement.scrollSize || (this.style.display = "none");
|
|
626
639
|
});
|
|
627
640
|
s(this, Ht, () => {
|
|
628
|
-
h(this,
|
|
641
|
+
h(this, Lt, this.scrollElement.currentProgress * t(this, Pt)), t(this, N) ? t(this, w).style.transform = `translate3d(${t(this, Lt)}px, 0px, 0px)` : t(this, w).style.transform = `translate3d(0px, ${t(this, Lt)}px, 0px)`;
|
|
629
642
|
});
|
|
630
|
-
s(this,
|
|
643
|
+
s(this, Bt, () => {
|
|
631
644
|
this.setAttribute("axis", this.scrollElement.axisCSSProperty.current);
|
|
632
645
|
});
|
|
633
|
-
s(this,
|
|
634
|
-
document.documentElement.classList.add("grabbing"),
|
|
646
|
+
s(this, Wt, (e) => {
|
|
647
|
+
document.documentElement.classList.add("grabbing"), De(
|
|
635
648
|
(c) => {
|
|
636
|
-
const b = t(this,
|
|
637
|
-
this.scrollElement.setPosition(i +
|
|
649
|
+
const b = t(this, N) ? c.x : c.y, x = this.scrollElement.distance / t(this, Pt), bt = (b - r) * x;
|
|
650
|
+
this.scrollElement.setPosition(i + bt);
|
|
638
651
|
},
|
|
639
652
|
() => {
|
|
640
653
|
document.documentElement.classList.remove("grabbing");
|
|
641
654
|
}
|
|
642
655
|
);
|
|
643
|
-
const i = this.scrollElement.damped.target, r = t(this,
|
|
656
|
+
const i = this.scrollElement.damped.target, r = t(this, N) ? e.x : e.y;
|
|
644
657
|
});
|
|
645
|
-
if (
|
|
658
|
+
if (Kt) {
|
|
646
659
|
const e = this.attachShadow({ mode: "open" });
|
|
647
660
|
e.adoptedStyleSheets.push(
|
|
648
|
-
|
|
661
|
+
ce({
|
|
649
662
|
":host": {
|
|
650
663
|
display: "inline-block",
|
|
651
664
|
zIndex: "1",
|
|
@@ -674,119 +687,119 @@ class Me extends ee {
|
|
|
674
687
|
touchAction: "none"
|
|
675
688
|
}
|
|
676
689
|
})
|
|
677
|
-
), h(this,
|
|
690
|
+
), h(this, et, document.createElement("slot")), t(this, et).innerHTML = '<div class="default-thumb"></div>', e.appendChild(t(this, et));
|
|
678
691
|
}
|
|
679
692
|
}
|
|
680
693
|
get thumbElement() {
|
|
681
|
-
return t(this,
|
|
694
|
+
return t(this, w);
|
|
682
695
|
}
|
|
683
696
|
connectedCallback() {
|
|
684
697
|
super.connectedCallback(), this.setAttribute("drag-dead-zone", "");
|
|
685
|
-
const e = t(this,
|
|
686
|
-
h(this,
|
|
698
|
+
const e = t(this, et).assignedElements()[0] || t(this, et).firstElementChild;
|
|
699
|
+
h(this, w, e), t(this, w).addEventListener("pointerdown", t(this, Wt)), Ut.subscribe(t(this, mt), ue.SCROLL), Gt.subscribe(this, t(this, mt)), this.scrollElement.onScroll(t(this, Ht)), this.scrollElement.axisCSSProperty.subscribe(t(this, Bt));
|
|
687
700
|
}
|
|
688
701
|
disconnectedCallback() {
|
|
689
|
-
this.removeAttribute("drag-dead-zone"), t(this,
|
|
702
|
+
this.removeAttribute("drag-dead-zone"), t(this, w).removeEventListener("pointerdown", t(this, Wt)), Ut.unsubscribe(t(this, mt)), Gt.unsubscribe(t(this, mt)), this.scrollElement.offScroll(t(this, Ht)), this.scrollElement.axisCSSProperty.unsubscribe(t(this, Bt));
|
|
690
703
|
}
|
|
691
704
|
}
|
|
692
|
-
|
|
693
|
-
customElements.get("e-scrollbar") || customElements.define("e-scrollbar",
|
|
694
|
-
class
|
|
705
|
+
et = new WeakMap(), w = new WeakMap(), N = new WeakMap(), q = new WeakMap(), Pt = new WeakMap(), Lt = new WeakMap(), mt = new WeakMap(), Ht = new WeakMap(), Bt = new WeakMap(), Wt = new WeakMap();
|
|
706
|
+
customElements.get("e-scrollbar") || customElements.define("e-scrollbar", Ve);
|
|
707
|
+
class pe extends ie {
|
|
695
708
|
constructor() {
|
|
696
|
-
super(),
|
|
709
|
+
super(), Kt && this.addEventListener("click", () => {
|
|
697
710
|
this.handleClick();
|
|
698
711
|
});
|
|
699
712
|
}
|
|
700
713
|
}
|
|
701
|
-
class
|
|
714
|
+
class Re extends pe {
|
|
702
715
|
handleClick() {
|
|
703
716
|
const n = this.getAttribute("index"), e = this.getAttribute("behaviour");
|
|
704
717
|
this.scrollElement.scrollToSection(parseInt(n || "0"), { behaviour: e });
|
|
705
718
|
}
|
|
706
719
|
}
|
|
707
|
-
customElements.get("e-scroll-set-button") || customElements.define("e-scroll-set-button",
|
|
708
|
-
class
|
|
720
|
+
customElements.get("e-scroll-set-button") || customElements.define("e-scroll-set-button", Re);
|
|
721
|
+
class Oe extends pe {
|
|
709
722
|
handleClick() {
|
|
710
723
|
const n = this.getAttribute("step"), e = this.getAttribute("behaviour");
|
|
711
724
|
this.scrollElement.shiftSections(parseInt(n || "1"), { behaviour: e });
|
|
712
725
|
}
|
|
713
726
|
}
|
|
714
|
-
customElements.get("e-scroll-step-button") || customElements.define("e-scroll-step-button",
|
|
715
|
-
var
|
|
716
|
-
class
|
|
727
|
+
customElements.get("e-scroll-step-button") || customElements.define("e-scroll-step-button", Oe);
|
|
728
|
+
var U, st, zt, Ft, $t, kt;
|
|
729
|
+
class He {
|
|
717
730
|
constructor(n, e, i) {
|
|
718
|
-
s(this,
|
|
719
|
-
s(this,
|
|
720
|
-
s(this,
|
|
731
|
+
s(this, U, null);
|
|
732
|
+
s(this, st, null);
|
|
733
|
+
s(this, zt, null);
|
|
721
734
|
s(this, Ft, null);
|
|
722
|
-
s(this,
|
|
723
|
-
t(this,
|
|
735
|
+
s(this, $t, () => {
|
|
736
|
+
t(this, st).scrollToSection(t(this, zt), {
|
|
724
737
|
behaviour: t(this, Ft)
|
|
725
738
|
});
|
|
726
739
|
});
|
|
727
|
-
s(this,
|
|
728
|
-
t(this,
|
|
740
|
+
s(this, kt, () => {
|
|
741
|
+
t(this, U).classList.toggle(
|
|
729
742
|
"current",
|
|
730
|
-
t(this,
|
|
743
|
+
t(this, st).counter.current === t(this, zt)
|
|
731
744
|
);
|
|
732
745
|
});
|
|
733
|
-
|
|
746
|
+
Kt && (h(this, U, document.createElement("button")), h(this, st, n), h(this, Ft, i), h(this, zt, e), t(this, U).addEventListener("click", t(this, $t)), t(this, st).counter.subscribe(t(this, kt)), t(this, kt).call(this));
|
|
734
747
|
}
|
|
735
748
|
get element() {
|
|
736
|
-
return t(this,
|
|
749
|
+
return t(this, U);
|
|
737
750
|
}
|
|
738
751
|
destroy() {
|
|
739
|
-
t(this,
|
|
752
|
+
t(this, U).removeEventListener("click", t(this, $t)), t(this, st).counter.unsubscribe(t(this, kt)), t(this, U).remove();
|
|
740
753
|
}
|
|
741
754
|
}
|
|
742
|
-
|
|
743
|
-
var
|
|
744
|
-
class
|
|
755
|
+
U = new WeakMap(), st = new WeakMap(), zt = new WeakMap(), Ft = new WeakMap(), $t = new WeakMap(), kt = new WeakMap();
|
|
756
|
+
var it, Dt;
|
|
757
|
+
class Be extends ie {
|
|
745
758
|
constructor() {
|
|
746
759
|
super(...arguments);
|
|
747
|
-
s(this,
|
|
748
|
-
s(this,
|
|
749
|
-
t(this,
|
|
760
|
+
s(this, it, []);
|
|
761
|
+
s(this, Dt, Ae(() => {
|
|
762
|
+
t(this, it).forEach((e) => e.destroy()), h(this, it, []);
|
|
750
763
|
for (let e = 0; e < this.scrollElement.sections.length; e++) {
|
|
751
|
-
const i = new
|
|
764
|
+
const i = new He(
|
|
752
765
|
this.scrollElement,
|
|
753
766
|
e,
|
|
754
767
|
this.getAttribute("behaviour") || "smooth"
|
|
755
768
|
);
|
|
756
|
-
this.appendChild(i.element), t(this,
|
|
769
|
+
this.appendChild(i.element), t(this, it).push(i);
|
|
757
770
|
}
|
|
758
771
|
}, 0));
|
|
759
772
|
}
|
|
760
773
|
connectedCallback() {
|
|
761
774
|
super.connectedCallback(), this.scrollElement.addEventListener(
|
|
762
775
|
"sectionsChange",
|
|
763
|
-
t(this,
|
|
764
|
-
), t(this,
|
|
776
|
+
t(this, Dt)
|
|
777
|
+
), t(this, Dt).call(this);
|
|
765
778
|
}
|
|
766
779
|
disconnectedCallback() {
|
|
767
780
|
this.scrollElement.removeEventListener(
|
|
768
781
|
"sectionsChange",
|
|
769
|
-
t(this,
|
|
770
|
-
), t(this,
|
|
782
|
+
t(this, Dt)
|
|
783
|
+
), t(this, it).forEach((e) => e.destroy()), h(this, it, []);
|
|
771
784
|
}
|
|
772
785
|
}
|
|
773
|
-
|
|
774
|
-
customElements.get("e-scroll-bullet-buttons") || customElements.define("e-scroll-bullet-buttons",
|
|
775
|
-
class
|
|
786
|
+
it = new WeakMap(), Dt = new WeakMap();
|
|
787
|
+
customElements.get("e-scroll-bullet-buttons") || customElements.define("e-scroll-bullet-buttons", Be);
|
|
788
|
+
class We extends Ie {
|
|
776
789
|
connectedCallback() {
|
|
777
|
-
const n =
|
|
778
|
-
n instanceof
|
|
790
|
+
const n = de(this, It);
|
|
791
|
+
n instanceof It ? (this.scrollContainer = n, this.scrollContainer.addEventListener(
|
|
779
792
|
"scrollSectionsChange",
|
|
780
793
|
this.findAnotherScrollEntries
|
|
781
794
|
)) : console.error(this, "e-scroll not found");
|
|
782
795
|
}
|
|
783
796
|
}
|
|
784
|
-
customElements.get("e-scroll-segment") || customElements.define("e-scroll-segment",
|
|
797
|
+
customElements.get("e-scroll-segment") || customElements.define("e-scroll-segment", We);
|
|
785
798
|
export {
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
799
|
+
Be as ScrollBulletButtonsElement,
|
|
800
|
+
It as ScrollElement,
|
|
801
|
+
We as ScrollSegmentElement,
|
|
802
|
+
Re as ScrollSetButtonElement,
|
|
803
|
+
Oe as ScrollStepButtonElement,
|
|
804
|
+
Ve as ScrollbarElement
|
|
792
805
|
};
|