aptechka 0.29.1 → 0.29.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use strict";var nt=a=>{throw TypeError(a)};var et=(a,f,r)=>f.has(a)||nt("Cannot "+r);var t=(a,f,r)=>(et(a,f,"read from private field"),r?r.call(a):f.get(a)),i=(a,f,r)=>f.has(a)?nt("Cannot add the same private member more than once"):f instanceof WeakSet?f.add(a):f.set(a,r),e=(a,f,r,s)=>(et(a,f,"write to private field"),s?s.call(a,r):f.set(a,r),r),c=(a,f,r)=>(et(a,f,"access private method"),r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../css-property/index.cjs"),ct=require("../order/index.cjs"),ot=require("../window-resizer/vanilla/index.cjs"),U=require("../events-KVanG9sR.cjs"),vt=require("../function-MthRj-GJ.cjs"),ut=require("../layout-8ryRAMGJ.cjs"),Pt=require("../math-GDWEqu7y.cjs"),X=require("../Store-CDb6RMce.cjs"),Ft=require("../scroll-entries/index.cjs");require("../ticker/vanilla/index.cjs");const Vt=require("../Damped-CTsV8tl_.cjs");var p,H,I,j,G,D,T,k,_,d,y,g,v,M,S,R,z,Z,O,q,x,l,P,F,L,E,V,Y,n,K,N,tt,m,A,C,b,w,B,$,u,h,rt,it,St,pt,ft,dt,mt,bt,st,J,W,Ct,yt,ht,at;let lt=(at=class extends HTMLElement{constructor(){super();i(this,h);i(this,p);i(this,H);i(this,I);i(this,j);i(this,G);i(this,D);i(this,T);i(this,k);i(this,_);i(this,d);i(this,y);i(this,g);i(this,v);i(this,M);i(this,S);i(this,R);i(this,z);i(this,Z);i(this,O);i(this,q);i(this,x);i(this,l);i(this,P);i(this,F);i(this,L);i(this,E);i(this,V);i(this,Y);i(this,n);i(this,K);i(this,N);i(this,tt);i(this,m);i(this,A);i(this,C);i(this,b);i(this,w);i(this,B);i(this,$);i(this,u);i(this,st);i(this,J);e(this,p,null),e(this,H,new o.CSSProperty(this,"--damping",20)),e(this,I,new o.CSSProperty(this,"--mass",0)),e(this,j,new o.CSSProperty(this,"--stiffness",0)),e(this,G,new o.CSSProperty(this,"--target","")),e(this,D,new o.CSSProperty(this,"--disabled",!1)),e(this,T,new o.CSSProperty(this,"--distance-offset",0,{rawValueCheck:!1})),e(this,k,new o.CSSProperty(this,"--start-offset",0,{rawValueCheck:!1})),e(this,_,new o.CSSProperty(this,"--capture-once",!1)),e(this,d,new o.CSSProperty(this,"--captured","")),e(this,y,new o.CSSProperty(this,"--released","")),e(this,g,new o.CSSProperty(this,"--captured-from-start","")),e(this,v,new o.CSSProperty(this,"--captured-from-finish","")),e(this,M,new o.CSSProperty(this,"--released-from-start","")),e(this,S,new o.CSSProperty(this,"--released-from-finish","")),e(this,R,new o.CSSProperty(this,"--passed-var","")),e(this,z,new o.CSSProperty(this,"--progress-var","")),e(this,Z,new o.CSSProperty(this,"--animation-var-type","current")),e(this,O,new o.CSSProperty(this,"--distance-var","")),e(this,q,new o.CSSProperty(this,"--start-var","")),e(this,x,new o.CSSProperty(this,"--finish-var","")),e(this,l,new X.Store(!1)),e(this,P,new X.Store(!1)),e(this,F,new X.Store(!1)),e(this,L,new X.Store(!1)),e(this,E,new X.Store(!1)),e(this,V,new X.Store(!1)),e(this,Y,[]),e(this,n,this),e(this,K,0),e(this,N,0),e(this,tt,0),e(this,m,new Vt.Damped(0,{order:ct.TICK_ORDER.SEGMENT,min:0,max:1})),e(this,A,0),e(this,C,0),e(this,b,0),e(this,w,0),e(this,B,!1),e(this,$,!1),e(this,u,!0),this.findAnotherScrollEntries=vt.debounce(()=>{const r=Ft.scrollEntries.getAll(this).reverse();let s=0;r.forEach((Q,gt)=>{Q.element===t(this,p)&&(s=gt)}),e(this,Y,r.slice(s+1))},0),e(this,st,()=>{t(this,u)||(this.resize(),t(this,J).call(this))}),e(this,J,()=>{!t(this,u)&&t(this,B)&&this.tick()})}get scrollContainer(){return t(this,p)}set scrollContainer(r){c(this,h,it).call(this),e(this,p,r),c(this,h,rt).call(this)}get distanceOffsetCSSProperty(){return t(this,T)}get startOffsetCSSProperty(){return t(this,k)}get captureOnceCSSProperty(){return t(this,_)}get capturedCSSProperty(){return t(this,d)}get releasedCSSProperty(){return t(this,y)}get capturedFromStartCSSProperty(){return t(this,g)}get capturedFromFinishCSSProperty(){return t(this,v)}get releasedFromStartCSSProperty(){return t(this,M)}get releasedFromFinishCSSProperty(){return t(this,S)}get passedVarCSSProperty(){return t(this,R)}get progressVarCSSProperty(){return t(this,z)}get animationVarTypeCSSProperty(){return t(this,Z)}get distanceVarCSSProperty(){return t(this,O)}get startVarCSSProperty(){return t(this,q)}get finishVarCSSProperty(){return t(this,x)}get disabledCSSProperty(){return t(this,D)}get dampingCSSProperty(){return t(this,H)}get massCSSProperty(){return t(this,I)}get stiffnessCSSProperty(){return t(this,j)}get targetCSSProperty(){return t(this,G)}get isCaptured(){return t(this,l)}get isReleased(){return t(this,P)}get isCapturedFromStart(){return t(this,F)}get isReleasedFromStart(){return t(this,L)}get isCapturedFromFinish(){return t(this,E)}get isReleasedFromFinish(){return t(this,V)}get directionPosition(){return t(this,K)}get directionSize(){return t(this,N)}get passed(){return t(this,m)}get progress(){return t(this,A)}get start(){return t(this,C)}get finish(){return t(this,w)}get distance(){return t(this,b)}get isCapturedOnce(){return t(this,$)}get isDisabled(){return t(this,u)}resize(){e(this,N,t(this,p).vertical?this.offsetHeight:this.offsetWidth);const r=t(this,p)instanceof HTMLElement?t(this,p):t(this,p).element;e(this,K,t(this,p).vertical?ut.getCumulativeOffsetTop(this,r):ut.getCumulativeOffsetLeft(this,r)),e(this,C,this.getStart()),e(this,b,this.getDistance()),e(this,C,t(this,C)+t(this,k).current),e(this,b,t(this,b)+t(this,T).current),e(this,w,t(this,C)+t(this,b)),t(this,p).currentScrollValue>t(this,w)&&!t(this,l).current&&!t(this,P).current&&(t(this,l).current=!0),this.setVar(t(this,q).current,t(this,C)),this.setVar(t(this,x).current,t(this,w)),this.setVar(t(this,O).current,t(this,b)),t(this,m).max=t(this,b),e(this,B,!0)}tick(){let r=t(this,p).currentScrollValue;t(this,Y).forEach(Q=>{r+=Q.value}),t(this,m).set(r-t(this,C));const s=Math.round(r);t(this,l).current&&(s>=t(this,C)?t(this,F).current||c(this,h,ft).call(this):t(this,F).current&&!t(this,L).current&&c(this,h,mt).call(this),s<t(this,w)?t(this,V).current&&!t(this,E).current&&c(this,h,dt).call(this):t(this,F).current&&!t(this,V).current&&c(this,h,bt).call(this)),s>=t(this,C)&&s<t(this,w)?t(this,l).current||c(this,h,St).call(this):t(this,l).current&&(t(this,m).set(Pt.step(t(this,b)/2,t(this,m).target,0,t(this,b))),c(this,h,pt).call(this)),t(this,$)&&t(this,_).current&&(t(this,d).current&&t(this,n).classList.add(t(this,d).current),e(this,u,!0))}disable(){this.style.cssText="",e(this,K,0),e(this,N,0),t(this,m).reset(),e(this,A,0),e(this,C,0),e(this,b,0),e(this,w,0),e(this,B,!1),t(this,l).current=!1,t(this,P).current=!1,t(this,F).current=!1,t(this,L).current=!1,t(this,E).current=!1,t(this,V).current=!1,e(this,$,!1),e(this,u,!0),c(this,h,ht).call(this)}enable(){e(this,u,!1)}connectedCallback(){c(this,h,rt).call(this)}disconnectedCallback(){c(this,h,it).call(this)}removeVar(r){r&&t(this,n).style.removeProperty(`--${r}`)}setVar(r,s){r&&t(this,n).style.setProperty(`--${r}`,s.toString())}getDistance(){return t(this,N)+t(this,tt)}getStart(){return t(this,K)-t(this,tt)}},p=new WeakMap,H=new WeakMap,I=new WeakMap,j=new WeakMap,G=new WeakMap,D=new WeakMap,T=new WeakMap,k=new WeakMap,_=new WeakMap,d=new WeakMap,y=new WeakMap,g=new WeakMap,v=new WeakMap,M=new WeakMap,S=new WeakMap,R=new WeakMap,z=new WeakMap,Z=new WeakMap,O=new WeakMap,q=new WeakMap,x=new WeakMap,l=new WeakMap,P=new WeakMap,F=new WeakMap,L=new WeakMap,E=new WeakMap,V=new WeakMap,Y=new WeakMap,n=new WeakMap,K=new WeakMap,N=new WeakMap,tt=new WeakMap,m=new WeakMap,A=new WeakMap,C=new WeakMap,b=new WeakMap,w=new WeakMap,B=new WeakMap,$=new WeakMap,u=new WeakMap,h=new WeakSet,rt=function(){if(!t(this,p))return;t(this,l).subscribe(s=>{s.current&&U.dispatchEvent(this,"scrollSegmentCapture",{composed:!0,custom:!0})}),t(this,F).subscribe(s=>{s.current&&U.dispatchEvent(this,"scrollSegmentCaptureFromStart",{composed:!0,custom:!0})}),t(this,E).subscribe(s=>{s.current&&U.dispatchEvent(this,"scrollSegmentCaptureFromFinish",{composed:!0,custom:!0})}),t(this,P).subscribe(s=>{s.current&&U.dispatchEvent(this,"scrollSegmentRelease",{composed:!0,custom:!0})}),t(this,L).subscribe(s=>{s.current&&U.dispatchEvent(this,"scrollSegmentReleaseFromStart",{composed:!0,custom:!0})}),t(this,V).subscribe(s=>{s.current&&U.dispatchEvent(this,"scrollSegmentReleaseFromFinish",{composed:!0,custom:!0})}),t(this,H).observe(),t(this,I).observe(),t(this,j).observe(),t(this,G).observe(),t(this,D).observe(),t(this,T).observe(),t(this,k).observe(),t(this,_).observe(),t(this,d).observe(),t(this,y).observe(),t(this,g).observe(),t(this,v).observe(),t(this,M).observe(),t(this,S).observe(),t(this,R).observe(),t(this,z).observe(),t(this,Z).observe(),t(this,O).observe(),t(this,q).observe(),t(this,x).observe();let r=!1;this.findAnotherScrollEntries(),t(this,D).current||this.enable(),t(this,H).subscribe(s=>{t(this,m).damping=s.current}),t(this,I).subscribe(s=>{t(this,m).mass=s.current}),t(this,j).subscribe(s=>{t(this,m).stiffness=s.current}),t(this,G).subscribe(s=>{s.previous&&c(this,h,ht).call(this),s.current?s.current==="parent"?e(this,n,this.parentElement||this):e(this,n,document.querySelector(s.current)||this):e(this,n,this)}),t(this,D).subscribe(s=>{s.current&&!s.previous?this.disable():!s.current&&s.previous&&(this.resize(),this.enable())}),t(this,k).subscribe(()=>{r&&!t(this,u)&&this.resize()}),t(this,T).subscribe(()=>{r&&!t(this,u)&&this.resize()}),t(this,d).subscribe(s=>{c(this,h,W).call(this,s)}),t(this,g).subscribe(s=>{c(this,h,W).call(this,s)}),t(this,v).subscribe(s=>{c(this,h,W).call(this,s)}),t(this,y).subscribe(s=>{c(this,h,W).call(this,s)}),t(this,M).subscribe(s=>{c(this,h,W).call(this,s)}),t(this,S).subscribe(s=>{c(this,h,W).call(this,s)}),t(this,_).subscribe(s=>{t(this,u)||!s.current&&s.previous&&(this.resize(),this.enable())}),t(this,R).subscribe(s=>{t(this,u)||(this.removeVar(s.previous),this.setVar(s.current,this.passed.current))}),t(this,z).subscribe(s=>{t(this,u)||(this.removeVar(s.previous),this.setVar(s.current,t(this,A)))}),t(this,q).subscribe(s=>{t(this,u)||(this.removeVar(s.previous),this.setVar(s.current,t(this,C)))}),t(this,x).subscribe(s=>{t(this,u)||(this.removeVar(s.previous),this.setVar(s.current,t(this,w)))}),t(this,O).subscribe(s=>{t(this,u)||(this.removeVar(s.previous),this.setVar(s.current,t(this,b)))}),t(this,m).subscribe(s=>{const Q=t(this,m)[t(this,Z).current];e(this,A,Q/t(this,b)||0),this.setVar(t(this,R).current,Q.toFixed(6)),this.setVar(t(this,z).current,t(this,A).toFixed(6))}),ot.windowResizer.subscribe(t(this,st),ct.RESIZE_ORDER.SCROLL),this.scrollContainer.onScroll(t(this,J)),r=!0},it=function(){t(this,p)&&(ot.windowResizer.unsubscribe(t(this,st)),this.scrollContainer.offScroll(t(this,J)),t(this,H).close(),t(this,I).close(),t(this,j).close(),t(this,G).close(),t(this,D).close(),t(this,T).close(),t(this,k).close(),t(this,_).close(),t(this,d).close(),t(this,y).close(),t(this,g).close(),t(this,v).close(),t(this,M).close(),t(this,S).close(),t(this,R).close(),t(this,z).close(),t(this,O).close(),t(this,q).close(),t(this,x).close(),t(this,l).close(),t(this,P).close(),t(this,F).close(),t(this,L).close(),t(this,E).close(),t(this,V).close(),this.disable())},St=function(){t(this,l).current=!0,t(this,P).current=!1,e(this,$,!0),t(this,y).current&&t(this,n).classList.remove(t(this,y).current),t(this,S).current&&t(this,n).classList.remove(t(this,S).current),t(this,S).current&&t(this,n).classList.remove(t(this,S).current),t(this,d).current&&t(this,n).classList.add(t(this,d).current)},pt=function(){t(this,P).current=!0,t(this,l).current=!1,e(this,$,!0),t(this,d).current&&t(this,n).classList.remove(t(this,d).current),t(this,g).current&&t(this,n).classList.remove(t(this,g).current),t(this,v).current&&t(this,n).classList.remove(t(this,v).current),t(this,y).current&&t(this,n).classList.add(t(this,y).current)},ft=function(){t(this,l).current=!0,t(this,F).current=!0,t(this,L).current=!1,t(this,g).current&&t(this,n).classList.add(t(this,g).current)},dt=function(){t(this,l).current=!0,t(this,E).current=!0,t(this,V).current=!1,t(this,v).current&&t(this,n).classList.add(t(this,v).current)},mt=function(){t(this,P).current=!0,t(this,L).current=!0,t(this,F).current=!1,t(this,S).current&&t(this,n).classList.add(t(this,S).current)},bt=function(){t(this,P).current=!0,t(this,V).current=!0,t(this,E).current=!1,t(this,S).current&&t(this,n).classList.add(t(this,S).current)},st=new WeakMap,J=new WeakMap,W=function(r){if(t(this,u)){r.previous&&t(this,n).classList.remove(r.previous),r.current&&t(this,n).classList.remove(r.current);return}r.current&&t(this,l).current?(r.previous&&t(this,n).classList.remove(r.previous),t(this,n).classList.add(r.current)):!r.current&&r.previous&&t(this,n).classList.remove(r.previous)},Ct=function(...r){r.forEach(s=>{s&&t(this,n).classList.remove(s)})},yt=function(...r){r.forEach(s=>{s&&t(this,n).style.removeProperty(`--${s}`)})},ht=function(){c(this,h,Ct).call(this,t(this,d).current,t(this,g).current,t(this,v).current,t(this,y).current,t(this,M).current,t(this,S).current),c(this,h,yt).call(this,t(this,R).current,t(this,z).current,t(this,O).current,t(this,q).current,t(this,x).current)},at);customElements.get("scroll-segment")||customElements.define("scroll-segment",lt);exports.ScrollSegmentElement=lt;
1
+ "use strict";var ot=a=>{throw TypeError(a)};var rt=(a,f,r)=>f.has(a)||ot("Cannot "+r);var t=(a,f,r)=>(rt(a,f,"read from private field"),r?r.call(a):f.get(a)),i=(a,f,r)=>f.has(a)?ot("Cannot add the same private member more than once"):f instanceof WeakSet?f.add(a):f.set(a,r),e=(a,f,r,s)=>(rt(a,f,"write to private field"),s?s.call(a,r):f.set(a,r),r),c=(a,f,r)=>(rt(a,f,"access private method"),r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../css-property/index.cjs"),ut=require("../order/index.cjs"),at=require("../window-resizer/vanilla/index.cjs"),U=require("../events-KVanG9sR.cjs"),wt=require("../function-MthRj-GJ.cjs"),lt=require("../layout-8ryRAMGJ.cjs"),Ft=require("../math-GDWEqu7y.cjs"),X=require("../Store-CDb6RMce.cjs"),Vt=require("../scroll-entries/index.cjs");require("../ticker/vanilla/index.cjs");const Et=require("../Damped-CTsV8tl_.cjs");var S,j,G,K,N,T,D,_,M,d,y,g,v,A,p,R,O,B,k,z,q,l,P,w,E,L,F,Y,n,$,W,tt,m,H,C,b,V,J,I,u,h,ft,it,ht,dt,mt,bt,Ct,yt,gt,st,Q,Z,vt,Pt,nt,St;let pt=(St=class extends HTMLElement{constructor(){super();i(this,h);i(this,S);i(this,j);i(this,G);i(this,K);i(this,N);i(this,T);i(this,D);i(this,_);i(this,M);i(this,d);i(this,y);i(this,g);i(this,v);i(this,A);i(this,p);i(this,R);i(this,O);i(this,B);i(this,k);i(this,z);i(this,q);i(this,l);i(this,P);i(this,w);i(this,E);i(this,L);i(this,F);i(this,Y);i(this,n);i(this,$);i(this,W);i(this,tt);i(this,m);i(this,H);i(this,C);i(this,b);i(this,V);i(this,J);i(this,I);i(this,u);i(this,st);i(this,Q);e(this,S,null),e(this,j,new o.CSSProperty(this,"--damping",20)),e(this,G,new o.CSSProperty(this,"--mass",0)),e(this,K,new o.CSSProperty(this,"--stiffness",0)),e(this,N,new o.CSSProperty(this,"--target","")),e(this,T,new o.CSSProperty(this,"--disabled",!1)),e(this,D,new o.CSSProperty(this,"--distance-offset",0,{rawValueCheck:!1})),e(this,_,new o.CSSProperty(this,"--start-offset",0,{rawValueCheck:!1})),e(this,M,new o.CSSProperty(this,"--capture-once",!1)),e(this,d,new o.CSSProperty(this,"--captured","")),e(this,y,new o.CSSProperty(this,"--released","")),e(this,g,new o.CSSProperty(this,"--captured-from-start","")),e(this,v,new o.CSSProperty(this,"--captured-from-finish","")),e(this,A,new o.CSSProperty(this,"--released-from-start","")),e(this,p,new o.CSSProperty(this,"--released-from-finish","")),e(this,R,new o.CSSProperty(this,"--passed-var","")),e(this,O,new o.CSSProperty(this,"--progress-var","")),e(this,B,new o.CSSProperty(this,"--animation-var-type","current")),e(this,k,new o.CSSProperty(this,"--distance-var","")),e(this,z,new o.CSSProperty(this,"--start-var","")),e(this,q,new o.CSSProperty(this,"--finish-var","")),e(this,l,new X.Store(!1)),e(this,P,new X.Store(!1)),e(this,w,new X.Store(!1)),e(this,E,new X.Store(!1)),e(this,L,new X.Store(!1)),e(this,F,new X.Store(!1)),e(this,Y,[]),e(this,n,this),e(this,$,0),e(this,W,0),e(this,tt,0),e(this,m,new Et.Damped(0,{order:ut.TICK_ORDER.SEGMENT,min:0,max:1})),e(this,H,0),e(this,C,0),e(this,b,0),e(this,V,0),e(this,J,!1),e(this,I,!1),e(this,u,!0),this.findAnotherScrollEntries=wt.debounce(()=>{const r=Vt.scrollEntries.getAll(this).reverse();let s=0;r.forEach((x,et)=>{x.element===t(this,S)&&(s=et)}),e(this,Y,r.slice(s+1))},0),e(this,st,()=>{t(this,u)||(this.resize(),t(this,Q).call(this))}),e(this,Q,()=>{!t(this,u)&&t(this,J)&&this.tick()})}get scrollContainer(){return t(this,S)}set scrollContainer(r){c(this,h,ht).call(this),e(this,S,r),c(this,h,it).call(this)}get distanceOffsetCSSProperty(){return t(this,D)}get startOffsetCSSProperty(){return t(this,_)}get captureOnceCSSProperty(){return t(this,M)}get capturedCSSProperty(){return t(this,d)}get releasedCSSProperty(){return t(this,y)}get capturedFromStartCSSProperty(){return t(this,g)}get capturedFromFinishCSSProperty(){return t(this,v)}get releasedFromStartCSSProperty(){return t(this,A)}get releasedFromFinishCSSProperty(){return t(this,p)}get passedVarCSSProperty(){return t(this,R)}get progressVarCSSProperty(){return t(this,O)}get animationVarTypeCSSProperty(){return t(this,B)}get distanceVarCSSProperty(){return t(this,k)}get startVarCSSProperty(){return t(this,z)}get finishVarCSSProperty(){return t(this,q)}get disabledCSSProperty(){return t(this,T)}get dampingCSSProperty(){return t(this,j)}get massCSSProperty(){return t(this,G)}get stiffnessCSSProperty(){return t(this,K)}get targetCSSProperty(){return t(this,N)}get isCaptured(){return t(this,l)}get isReleased(){return t(this,P)}get isCapturedFromStart(){return t(this,w)}get isReleasedFromStart(){return t(this,E)}get isCapturedFromFinish(){return t(this,L)}get isReleasedFromFinish(){return t(this,F)}get directionPosition(){return t(this,$)}get directionSize(){return t(this,W)}get passed(){return t(this,m)}get progress(){return t(this,H)}get start(){return t(this,C)}get finish(){return t(this,V)}get distance(){return t(this,b)}get isCapturedOnce(){return t(this,I)}get isDisabled(){return t(this,u)}resize(){e(this,W,t(this,S).vertical?this.offsetHeight:this.offsetWidth);const r=t(this,S)instanceof HTMLElement?t(this,S):t(this,S).element;e(this,$,t(this,S).vertical?lt.getCumulativeOffsetTop(this,r):lt.getCumulativeOffsetLeft(this,r));const x=c(this,h,ft).call(this).reduce((et,ct)=>et+(t(this,S).vertical?ct.offsetTop:ct.offsetLeft),0);e(this,$,t(this,$)-x),e(this,C,this.getStart()),e(this,b,this.getDistance()),e(this,C,t(this,C)+t(this,_).current),e(this,b,t(this,b)+t(this,D).current),e(this,V,t(this,C)+t(this,b)),t(this,S).currentScrollValue>t(this,V)&&!t(this,l).current&&!t(this,P).current&&(t(this,l).current=!0),this.setVar(t(this,z).current,t(this,C)),this.setVar(t(this,q).current,t(this,V)),this.setVar(t(this,k).current,t(this,b)),t(this,m).max=t(this,b),e(this,J,!0)}tick(){let r=t(this,S).currentScrollValue;t(this,Y).forEach(x=>{r+=x.value}),t(this,m).set(r-t(this,C));const s=Math.round(r);t(this,l).current&&(s>=t(this,C)?t(this,w).current||c(this,h,bt).call(this):t(this,w).current&&!t(this,E).current&&c(this,h,yt).call(this),s<t(this,V)?t(this,F).current&&!t(this,L).current&&c(this,h,Ct).call(this):t(this,w).current&&!t(this,F).current&&c(this,h,gt).call(this)),s>=t(this,C)&&s<t(this,V)?t(this,l).current||c(this,h,dt).call(this):t(this,l).current&&(t(this,m).set(Ft.step(t(this,b)/2,t(this,m).target,0,t(this,b))),c(this,h,mt).call(this)),t(this,I)&&t(this,M).current&&(t(this,d).current&&t(this,n).classList.add(t(this,d).current),e(this,u,!0))}disable(){this.style.cssText="",e(this,$,0),e(this,W,0),t(this,m).reset(),e(this,H,0),e(this,C,0),e(this,b,0),e(this,V,0),e(this,J,!1),t(this,l).current=!1,t(this,P).current=!1,t(this,w).current=!1,t(this,E).current=!1,t(this,L).current=!1,t(this,F).current=!1,e(this,I,!1),e(this,u,!0),c(this,h,nt).call(this)}enable(){e(this,u,!1)}connectedCallback(){c(this,h,it).call(this)}disconnectedCallback(){c(this,h,ht).call(this)}removeVar(r){r&&t(this,n).style.removeProperty(`--${r}`)}setVar(r,s){r&&t(this,n).style.setProperty(`--${r}`,s.toString())}getDistance(){return t(this,W)+t(this,tt)}getStart(){return t(this,$)-t(this,tt)}},S=new WeakMap,j=new WeakMap,G=new WeakMap,K=new WeakMap,N=new WeakMap,T=new WeakMap,D=new WeakMap,_=new WeakMap,M=new WeakMap,d=new WeakMap,y=new WeakMap,g=new WeakMap,v=new WeakMap,A=new WeakMap,p=new WeakMap,R=new WeakMap,O=new WeakMap,B=new WeakMap,k=new WeakMap,z=new WeakMap,q=new WeakMap,l=new WeakMap,P=new WeakMap,w=new WeakMap,E=new WeakMap,L=new WeakMap,F=new WeakMap,Y=new WeakMap,n=new WeakMap,$=new WeakMap,W=new WeakMap,tt=new WeakMap,m=new WeakMap,H=new WeakMap,C=new WeakMap,b=new WeakMap,V=new WeakMap,J=new WeakMap,I=new WeakMap,u=new WeakMap,h=new WeakSet,ft=function(){const r=[];let s=this.parentElement;for(;s;)window.getComputedStyle(s).position==="sticky"&&r.push(s),s=s.parentElement;return r},it=function(){if(!t(this,S))return;t(this,l).subscribe(s=>{s.current&&U.dispatchEvent(this,"scrollSegmentCapture",{composed:!0,custom:!0})}),t(this,w).subscribe(s=>{s.current&&U.dispatchEvent(this,"scrollSegmentCaptureFromStart",{composed:!0,custom:!0})}),t(this,L).subscribe(s=>{s.current&&U.dispatchEvent(this,"scrollSegmentCaptureFromFinish",{composed:!0,custom:!0})}),t(this,P).subscribe(s=>{s.current&&U.dispatchEvent(this,"scrollSegmentRelease",{composed:!0,custom:!0})}),t(this,E).subscribe(s=>{s.current&&U.dispatchEvent(this,"scrollSegmentReleaseFromStart",{composed:!0,custom:!0})}),t(this,F).subscribe(s=>{s.current&&U.dispatchEvent(this,"scrollSegmentReleaseFromFinish",{composed:!0,custom:!0})}),t(this,j).observe(),t(this,G).observe(),t(this,K).observe(),t(this,N).observe(),t(this,T).observe(),t(this,D).observe(),t(this,_).observe(),t(this,M).observe(),t(this,d).observe(),t(this,y).observe(),t(this,g).observe(),t(this,v).observe(),t(this,A).observe(),t(this,p).observe(),t(this,R).observe(),t(this,O).observe(),t(this,B).observe(),t(this,k).observe(),t(this,z).observe(),t(this,q).observe();let r=!1;this.findAnotherScrollEntries(),t(this,T).current||this.enable(),t(this,j).subscribe(s=>{t(this,m).damping=s.current}),t(this,G).subscribe(s=>{t(this,m).mass=s.current}),t(this,K).subscribe(s=>{t(this,m).stiffness=s.current}),t(this,N).subscribe(s=>{s.previous&&c(this,h,nt).call(this),s.current?s.current==="parent"?e(this,n,this.parentElement||this):e(this,n,document.querySelector(s.current)||this):e(this,n,this)}),t(this,T).subscribe(s=>{s.current&&!s.previous?this.disable():!s.current&&s.previous&&(this.resize(),this.enable())}),t(this,_).subscribe(()=>{r&&!t(this,u)&&this.resize()}),t(this,D).subscribe(()=>{r&&!t(this,u)&&this.resize()}),t(this,d).subscribe(s=>{c(this,h,Z).call(this,s)}),t(this,g).subscribe(s=>{c(this,h,Z).call(this,s)}),t(this,v).subscribe(s=>{c(this,h,Z).call(this,s)}),t(this,y).subscribe(s=>{c(this,h,Z).call(this,s)}),t(this,A).subscribe(s=>{c(this,h,Z).call(this,s)}),t(this,p).subscribe(s=>{c(this,h,Z).call(this,s)}),t(this,M).subscribe(s=>{t(this,u)||!s.current&&s.previous&&(this.resize(),this.enable())}),t(this,R).subscribe(s=>{t(this,u)||(this.removeVar(s.previous),this.setVar(s.current,this.passed.current))}),t(this,O).subscribe(s=>{t(this,u)||(this.removeVar(s.previous),this.setVar(s.current,t(this,H)))}),t(this,z).subscribe(s=>{t(this,u)||(this.removeVar(s.previous),this.setVar(s.current,t(this,C)))}),t(this,q).subscribe(s=>{t(this,u)||(this.removeVar(s.previous),this.setVar(s.current,t(this,V)))}),t(this,k).subscribe(s=>{t(this,u)||(this.removeVar(s.previous),this.setVar(s.current,t(this,b)))}),t(this,m).subscribe(s=>{const x=t(this,m)[t(this,B).current];e(this,H,x/t(this,b)||0),this.setVar(t(this,R).current,x.toFixed(6)),this.setVar(t(this,O).current,t(this,H).toFixed(6))}),at.windowResizer.subscribe(t(this,st),ut.RESIZE_ORDER.SCROLL),this.scrollContainer.onScroll(t(this,Q)),r=!0},ht=function(){t(this,S)&&(at.windowResizer.unsubscribe(t(this,st)),this.scrollContainer.offScroll(t(this,Q)),t(this,j).close(),t(this,G).close(),t(this,K).close(),t(this,N).close(),t(this,T).close(),t(this,D).close(),t(this,_).close(),t(this,M).close(),t(this,d).close(),t(this,y).close(),t(this,g).close(),t(this,v).close(),t(this,A).close(),t(this,p).close(),t(this,R).close(),t(this,O).close(),t(this,k).close(),t(this,z).close(),t(this,q).close(),t(this,l).close(),t(this,P).close(),t(this,w).close(),t(this,E).close(),t(this,L).close(),t(this,F).close(),this.disable())},dt=function(){t(this,l).current=!0,t(this,P).current=!1,e(this,I,!0),t(this,y).current&&t(this,n).classList.remove(t(this,y).current),t(this,p).current&&t(this,n).classList.remove(t(this,p).current),t(this,p).current&&t(this,n).classList.remove(t(this,p).current),t(this,d).current&&t(this,n).classList.add(t(this,d).current)},mt=function(){t(this,P).current=!0,t(this,l).current=!1,e(this,I,!0),t(this,d).current&&t(this,n).classList.remove(t(this,d).current),t(this,g).current&&t(this,n).classList.remove(t(this,g).current),t(this,v).current&&t(this,n).classList.remove(t(this,v).current),t(this,y).current&&t(this,n).classList.add(t(this,y).current)},bt=function(){t(this,l).current=!0,t(this,w).current=!0,t(this,E).current=!1,t(this,g).current&&t(this,n).classList.add(t(this,g).current)},Ct=function(){t(this,l).current=!0,t(this,L).current=!0,t(this,F).current=!1,t(this,v).current&&t(this,n).classList.add(t(this,v).current)},yt=function(){t(this,P).current=!0,t(this,E).current=!0,t(this,w).current=!1,t(this,p).current&&t(this,n).classList.add(t(this,p).current)},gt=function(){t(this,P).current=!0,t(this,F).current=!0,t(this,L).current=!1,t(this,p).current&&t(this,n).classList.add(t(this,p).current)},st=new WeakMap,Q=new WeakMap,Z=function(r){if(t(this,u)){r.previous&&t(this,n).classList.remove(r.previous),r.current&&t(this,n).classList.remove(r.current);return}r.current&&t(this,l).current?(r.previous&&t(this,n).classList.remove(r.previous),t(this,n).classList.add(r.current)):!r.current&&r.previous&&t(this,n).classList.remove(r.previous)},vt=function(...r){r.forEach(s=>{s&&t(this,n).classList.remove(s)})},Pt=function(...r){r.forEach(s=>{s&&t(this,n).style.removeProperty(`--${s}`)})},nt=function(){c(this,h,vt).call(this,t(this,d).current,t(this,g).current,t(this,v).current,t(this,y).current,t(this,A).current,t(this,p).current),c(this,h,Pt).call(this,t(this,R).current,t(this,O).current,t(this,k).current,t(this,z).current,t(this,q).current)},St);customElements.get("scroll-segment")||customElements.define("scroll-segment",pt);exports.ScrollSegmentElement=pt;
@@ -1,123 +1,123 @@
1
- var nt = (a) => {
1
+ var ot = (a) => {
2
2
  throw TypeError(a);
3
3
  };
4
- var et = (a, S, r) => S.has(a) || nt("Cannot " + r);
5
- var t = (a, S, r) => (et(a, S, "read from private field"), r ? r.call(a) : S.get(a)), i = (a, S, r) => S.has(a) ? nt("Cannot add the same private member more than once") : S instanceof WeakSet ? S.add(a) : S.set(a, r), e = (a, S, r, s) => (et(a, S, "write to private field"), s ? s.call(a, r) : S.set(a, r), r), c = (a, S, r) => (et(a, S, "access private method"), r);
6
- import { CSSProperty as u } from "../css-property/index.js";
7
- import { TICK_ORDER as gt, RESIZE_ORDER as Ct } from "../order/index.js";
8
- import { windowResizer as ct } from "../window-resizer/vanilla/index.js";
4
+ var rt = (a, S, r) => S.has(a) || ot("Cannot " + r);
5
+ var t = (a, S, r) => (rt(a, S, "read from private field"), r ? r.call(a) : S.get(a)), i = (a, S, r) => S.has(a) ? ot("Cannot add the same private member more than once") : S instanceof WeakSet ? S.add(a) : S.set(a, r), e = (a, S, r, s) => (rt(a, S, "write to private field"), s ? s.call(a, r) : S.set(a, r), r), c = (a, S, r) => (rt(a, S, "access private method"), r);
6
+ import { CSSProperty as o } from "../css-property/index.js";
7
+ import { TICK_ORDER as vt, RESIZE_ORDER as yt } from "../order/index.js";
8
+ import { windowResizer as ut } from "../window-resizer/vanilla/index.js";
9
9
  import { d as U } from "../events-CsVF98U6.js";
10
- import { d as vt } from "../function-C10DGppn.js";
11
- import { a as yt, g as Pt } from "../layout-HoBT_Da2.js";
12
- import { s as Ft } from "../math-BOBiC4TN.js";
10
+ import { d as Pt } from "../function-C10DGppn.js";
11
+ import { a as Ft, g as Vt } from "../layout-HoBT_Da2.js";
12
+ import { s as wt } from "../math-BOBiC4TN.js";
13
13
  import { S as X } from "../Store-OTdcl6SX.js";
14
- import { scrollEntries as Vt } from "../scroll-entries/index.js";
14
+ import { scrollEntries as Lt } from "../scroll-entries/index.js";
15
15
  import "../ticker/vanilla/index.js";
16
- import { D as Lt } from "../Damped-Chu29wn-.js";
17
- var p, _, q, G, K, x, T, M, A, m, C, v, y, $, f, R, O, j, z, D, k, l, P, F, w, E, V, Y, n, N, W, tt, d, H, g, b, L, B, I, o, h, rt, it, ot, at, lt, ft, pt, St, st, J, Z, mt, dt, ht, ut;
18
- let wt = (ut = class extends HTMLElement {
16
+ import { D as Et } from "../Damped-Chu29wn-.js";
17
+ var f, G, K, N, W, x, M, A, $, m, C, v, y, H, p, R, k, B, O, z, D, l, P, F, L, E, V, Y, n, I, Z, tt, d, _, g, b, w, J, q, u, h, lt, it, ht, ft, pt, St, mt, dt, bt, st, Q, j, gt, Ct, nt, at;
18
+ let Rt = (at = class extends HTMLElement {
19
19
  constructor() {
20
20
  super();
21
21
  i(this, h);
22
- i(this, p);
23
- i(this, _);
24
- i(this, q);
22
+ i(this, f);
25
23
  i(this, G);
26
24
  i(this, K);
25
+ i(this, N);
26
+ i(this, W);
27
27
  i(this, x);
28
- i(this, T);
29
28
  i(this, M);
30
29
  i(this, A);
30
+ i(this, $);
31
31
  i(this, m);
32
32
  i(this, C);
33
33
  i(this, v);
34
34
  i(this, y);
35
- i(this, $);
36
- i(this, f);
35
+ i(this, H);
36
+ i(this, p);
37
37
  i(this, R);
38
+ i(this, k);
39
+ i(this, B);
38
40
  i(this, O);
39
- i(this, j);
40
41
  i(this, z);
41
42
  i(this, D);
42
- i(this, k);
43
43
  i(this, l);
44
44
  i(this, P);
45
45
  i(this, F);
46
- i(this, w);
46
+ i(this, L);
47
47
  i(this, E);
48
48
  i(this, V);
49
49
  i(this, Y);
50
50
  i(this, n);
51
- i(this, N);
52
- i(this, W);
51
+ i(this, I);
52
+ i(this, Z);
53
53
  i(this, tt);
54
54
  i(this, d);
55
- i(this, H);
55
+ i(this, _);
56
56
  i(this, g);
57
57
  i(this, b);
58
- i(this, L);
59
- i(this, B);
60
- i(this, I);
61
- i(this, o);
62
- i(this, st);
58
+ i(this, w);
63
59
  i(this, J);
64
- e(this, p, null), e(this, _, new u(this, "--damping", 20)), e(this, q, new u(this, "--mass", 0)), e(this, G, new u(this, "--stiffness", 0)), e(this, K, new u(this, "--target", "")), e(this, x, new u(this, "--disabled", !1)), e(this, T, new u(
60
+ i(this, q);
61
+ i(this, u);
62
+ i(this, st);
63
+ i(this, Q);
64
+ e(this, f, null), e(this, G, new o(this, "--damping", 20)), e(this, K, new o(this, "--mass", 0)), e(this, N, new o(this, "--stiffness", 0)), e(this, W, new o(this, "--target", "")), e(this, x, new o(this, "--disabled", !1)), e(this, M, new o(
65
65
  this,
66
66
  "--distance-offset",
67
67
  0,
68
68
  { rawValueCheck: !1 }
69
- )), e(this, M, new u(this, "--start-offset", 0, {
69
+ )), e(this, A, new o(this, "--start-offset", 0, {
70
70
  rawValueCheck: !1
71
- })), e(this, A, new u(
71
+ })), e(this, $, new o(
72
72
  this,
73
73
  "--capture-once",
74
74
  !1
75
- )), e(this, m, new u(this, "--captured", "")), e(this, C, new u(this, "--released", "")), e(this, v, new u(
75
+ )), e(this, m, new o(this, "--captured", "")), e(this, C, new o(this, "--released", "")), e(this, v, new o(
76
76
  this,
77
77
  "--captured-from-start",
78
78
  ""
79
- )), e(this, y, new u(
79
+ )), e(this, y, new o(
80
80
  this,
81
81
  "--captured-from-finish",
82
82
  ""
83
- )), e(this, $, new u(
83
+ )), e(this, H, new o(
84
84
  this,
85
85
  "--released-from-start",
86
86
  ""
87
- )), e(this, f, new u(
87
+ )), e(this, p, new o(
88
88
  this,
89
89
  "--released-from-finish",
90
90
  ""
91
- )), e(this, R, new u(this, "--passed-var", "")), e(this, O, new u(this, "--progress-var", "")), e(this, j, new u(
91
+ )), e(this, R, new o(this, "--passed-var", "")), e(this, k, new o(this, "--progress-var", "")), e(this, B, new o(
92
92
  this,
93
93
  "--animation-var-type",
94
94
  "current"
95
- )), e(this, z, new u(this, "--distance-var", "")), e(this, D, new u(this, "--start-var", "")), e(this, k, new u(this, "--finish-var", "")), e(this, l, new X(!1)), e(this, P, new X(!1)), e(this, F, new X(!1)), e(this, w, new X(!1)), e(this, E, new X(!1)), e(this, V, new X(!1)), e(this, Y, []), e(this, n, this), e(this, N, 0), e(this, W, 0), e(this, tt, 0), e(this, d, new Lt(0, { order: gt.SEGMENT, min: 0, max: 1 })), e(this, H, 0), e(this, g, 0), e(this, b, 0), e(this, L, 0), e(this, B, !1), e(this, I, !1), e(this, o, !0), this.findAnotherScrollEntries = vt(() => {
96
- const r = Vt.getAll(this).reverse();
95
+ )), e(this, O, new o(this, "--distance-var", "")), e(this, z, new o(this, "--start-var", "")), e(this, D, new o(this, "--finish-var", "")), e(this, l, new X(!1)), e(this, P, new X(!1)), e(this, F, new X(!1)), e(this, L, new X(!1)), e(this, E, new X(!1)), e(this, V, new X(!1)), e(this, Y, []), e(this, n, this), e(this, I, 0), e(this, Z, 0), e(this, tt, 0), e(this, d, new Et(0, { order: vt.SEGMENT, min: 0, max: 1 })), e(this, _, 0), e(this, g, 0), e(this, b, 0), e(this, w, 0), e(this, J, !1), e(this, q, !1), e(this, u, !0), this.findAnotherScrollEntries = Pt(() => {
96
+ const r = Lt.getAll(this).reverse();
97
97
  let s = 0;
98
- r.forEach((Q, bt) => {
99
- Q.element === t(this, p) && (s = bt);
98
+ r.forEach((T, et) => {
99
+ T.element === t(this, f) && (s = et);
100
100
  }), e(this, Y, r.slice(s + 1));
101
101
  }, 0), e(this, st, () => {
102
- t(this, o) || (this.resize(), t(this, J).call(this));
103
- }), e(this, J, () => {
104
- !t(this, o) && t(this, B) && this.tick();
102
+ t(this, u) || (this.resize(), t(this, Q).call(this));
103
+ }), e(this, Q, () => {
104
+ !t(this, u) && t(this, J) && this.tick();
105
105
  });
106
106
  }
107
107
  get scrollContainer() {
108
- return t(this, p);
108
+ return t(this, f);
109
109
  }
110
110
  set scrollContainer(r) {
111
- c(this, h, it).call(this), e(this, p, r), c(this, h, rt).call(this);
111
+ c(this, h, ht).call(this), e(this, f, r), c(this, h, it).call(this);
112
112
  }
113
113
  get distanceOffsetCSSProperty() {
114
- return t(this, T);
114
+ return t(this, M);
115
115
  }
116
116
  get startOffsetCSSProperty() {
117
- return t(this, M);
117
+ return t(this, A);
118
118
  }
119
119
  get captureOnceCSSProperty() {
120
- return t(this, A);
120
+ return t(this, $);
121
121
  }
122
122
  get capturedCSSProperty() {
123
123
  return t(this, m);
@@ -132,43 +132,43 @@ let wt = (ut = class extends HTMLElement {
132
132
  return t(this, y);
133
133
  }
134
134
  get releasedFromStartCSSProperty() {
135
- return t(this, $);
135
+ return t(this, H);
136
136
  }
137
137
  get releasedFromFinishCSSProperty() {
138
- return t(this, f);
138
+ return t(this, p);
139
139
  }
140
140
  get passedVarCSSProperty() {
141
141
  return t(this, R);
142
142
  }
143
143
  get progressVarCSSProperty() {
144
- return t(this, O);
144
+ return t(this, k);
145
145
  }
146
146
  get animationVarTypeCSSProperty() {
147
- return t(this, j);
147
+ return t(this, B);
148
148
  }
149
149
  get distanceVarCSSProperty() {
150
- return t(this, z);
150
+ return t(this, O);
151
151
  }
152
152
  get startVarCSSProperty() {
153
- return t(this, D);
153
+ return t(this, z);
154
154
  }
155
155
  get finishVarCSSProperty() {
156
- return t(this, k);
156
+ return t(this, D);
157
157
  }
158
158
  get disabledCSSProperty() {
159
159
  return t(this, x);
160
160
  }
161
161
  get dampingCSSProperty() {
162
- return t(this, _);
162
+ return t(this, G);
163
163
  }
164
164
  get massCSSProperty() {
165
- return t(this, q);
165
+ return t(this, K);
166
166
  }
167
167
  get stiffnessCSSProperty() {
168
- return t(this, G);
168
+ return t(this, N);
169
169
  }
170
170
  get targetCSSProperty() {
171
- return t(this, K);
171
+ return t(this, W);
172
172
  }
173
173
  get isCaptured() {
174
174
  return t(this, l);
@@ -180,7 +180,7 @@ let wt = (ut = class extends HTMLElement {
180
180
  return t(this, F);
181
181
  }
182
182
  get isReleasedFromStart() {
183
- return t(this, w);
183
+ return t(this, L);
184
184
  }
185
185
  get isCapturedFromFinish() {
186
186
  return t(this, E);
@@ -189,58 +189,63 @@ let wt = (ut = class extends HTMLElement {
189
189
  return t(this, V);
190
190
  }
191
191
  get directionPosition() {
192
- return t(this, N);
192
+ return t(this, I);
193
193
  }
194
194
  get directionSize() {
195
- return t(this, W);
195
+ return t(this, Z);
196
196
  }
197
197
  get passed() {
198
198
  return t(this, d);
199
199
  }
200
200
  get progress() {
201
- return t(this, H);
201
+ return t(this, _);
202
202
  }
203
203
  get start() {
204
204
  return t(this, g);
205
205
  }
206
206
  get finish() {
207
- return t(this, L);
207
+ return t(this, w);
208
208
  }
209
209
  get distance() {
210
210
  return t(this, b);
211
211
  }
212
212
  get isCapturedOnce() {
213
- return t(this, I);
213
+ return t(this, q);
214
214
  }
215
215
  get isDisabled() {
216
- return t(this, o);
216
+ return t(this, u);
217
217
  }
218
218
  resize() {
219
- e(this, W, t(this, p).vertical ? this.offsetHeight : this.offsetWidth);
220
- const r = t(this, p) instanceof HTMLElement ? t(this, p) : t(this, p).element;
221
- e(this, N, t(this, p).vertical ? yt(this, r) : Pt(this, r)), e(this, g, this.getStart()), e(this, b, this.getDistance()), e(this, g, t(this, g) + t(this, M).current), e(this, b, t(this, b) + t(this, T).current), e(this, L, t(this, g) + t(this, b)), t(this, p).currentScrollValue > t(this, L) && !t(this, l).current && !t(this, P).current && (t(this, l).current = !0), this.setVar(t(this, D).current, t(this, g)), this.setVar(t(this, k).current, t(this, L)), this.setVar(t(this, z).current, t(this, b)), t(this, d).max = t(this, b), e(this, B, !0);
219
+ e(this, Z, t(this, f).vertical ? this.offsetHeight : this.offsetWidth);
220
+ const r = t(this, f) instanceof HTMLElement ? t(this, f) : t(this, f).element;
221
+ e(this, I, t(this, f).vertical ? Ft(this, r) : Vt(this, r));
222
+ const T = c(this, h, lt).call(this).reduce(
223
+ (et, ct) => et + (t(this, f).vertical ? ct.offsetTop : ct.offsetLeft),
224
+ 0
225
+ );
226
+ e(this, I, t(this, I) - T), e(this, g, this.getStart()), e(this, b, this.getDistance()), e(this, g, t(this, g) + t(this, A).current), e(this, b, t(this, b) + t(this, M).current), e(this, w, t(this, g) + t(this, b)), t(this, f).currentScrollValue > t(this, w) && !t(this, l).current && !t(this, P).current && (t(this, l).current = !0), this.setVar(t(this, z).current, t(this, g)), this.setVar(t(this, D).current, t(this, w)), this.setVar(t(this, O).current, t(this, b)), t(this, d).max = t(this, b), e(this, J, !0);
222
227
  }
223
228
  tick() {
224
- let r = t(this, p).currentScrollValue;
225
- t(this, Y).forEach((Q) => {
226
- r += Q.value;
229
+ let r = t(this, f).currentScrollValue;
230
+ t(this, Y).forEach((T) => {
231
+ r += T.value;
227
232
  }), t(this, d).set(r - t(this, g));
228
233
  const s = Math.round(r);
229
- t(this, l).current && (s >= t(this, g) ? t(this, F).current || c(this, h, lt).call(this) : t(this, F).current && !t(this, w).current && c(this, h, pt).call(this), s < t(this, L) ? t(this, V).current && !t(this, E).current && c(this, h, ft).call(this) : t(this, F).current && !t(this, V).current && c(this, h, St).call(this)), s >= t(this, g) && s < t(this, L) ? t(this, l).current || c(this, h, ot).call(this) : t(this, l).current && (t(this, d).set(
230
- Ft(t(this, b) / 2, t(this, d).target, 0, t(this, b))
231
- ), c(this, h, at).call(this)), t(this, I) && t(this, A).current && (t(this, m).current && t(this, n).classList.add(t(this, m).current), e(this, o, !0));
234
+ t(this, l).current && (s >= t(this, g) ? t(this, F).current || c(this, h, St).call(this) : t(this, F).current && !t(this, L).current && c(this, h, dt).call(this), s < t(this, w) ? t(this, V).current && !t(this, E).current && c(this, h, mt).call(this) : t(this, F).current && !t(this, V).current && c(this, h, bt).call(this)), s >= t(this, g) && s < t(this, w) ? t(this, l).current || c(this, h, ft).call(this) : t(this, l).current && (t(this, d).set(
235
+ wt(t(this, b) / 2, t(this, d).target, 0, t(this, b))
236
+ ), c(this, h, pt).call(this)), t(this, q) && t(this, $).current && (t(this, m).current && t(this, n).classList.add(t(this, m).current), e(this, u, !0));
232
237
  }
233
238
  disable() {
234
- this.style.cssText = "", e(this, N, 0), e(this, W, 0), t(this, d).reset(), e(this, H, 0), e(this, g, 0), e(this, b, 0), e(this, L, 0), e(this, B, !1), t(this, l).current = !1, t(this, P).current = !1, t(this, F).current = !1, t(this, w).current = !1, t(this, E).current = !1, t(this, V).current = !1, e(this, I, !1), e(this, o, !0), c(this, h, ht).call(this);
239
+ this.style.cssText = "", e(this, I, 0), e(this, Z, 0), t(this, d).reset(), e(this, _, 0), e(this, g, 0), e(this, b, 0), e(this, w, 0), e(this, J, !1), t(this, l).current = !1, t(this, P).current = !1, t(this, F).current = !1, t(this, L).current = !1, t(this, E).current = !1, t(this, V).current = !1, e(this, q, !1), e(this, u, !0), c(this, h, nt).call(this);
235
240
  }
236
241
  enable() {
237
- e(this, o, !1);
242
+ e(this, u, !1);
238
243
  }
239
244
  connectedCallback() {
240
- c(this, h, rt).call(this);
245
+ c(this, h, it).call(this);
241
246
  }
242
247
  disconnectedCallback() {
243
- c(this, h, it).call(this);
248
+ c(this, h, ht).call(this);
244
249
  }
245
250
  removeVar(r) {
246
251
  r && t(this, n).style.removeProperty(`--${r}`);
@@ -249,13 +254,19 @@ let wt = (ut = class extends HTMLElement {
249
254
  r && t(this, n).style.setProperty(`--${r}`, s.toString());
250
255
  }
251
256
  getDistance() {
252
- return t(this, W) + t(this, tt);
257
+ return t(this, Z) + t(this, tt);
253
258
  }
254
259
  getStart() {
255
- return t(this, N) - t(this, tt);
256
- }
257
- }, p = new WeakMap(), _ = new WeakMap(), q = new WeakMap(), G = new WeakMap(), K = new WeakMap(), x = new WeakMap(), T = new WeakMap(), M = new WeakMap(), A = new WeakMap(), m = new WeakMap(), C = new WeakMap(), v = new WeakMap(), y = new WeakMap(), $ = new WeakMap(), f = new WeakMap(), R = new WeakMap(), O = new WeakMap(), j = new WeakMap(), z = new WeakMap(), D = new WeakMap(), k = new WeakMap(), l = new WeakMap(), P = new WeakMap(), F = new WeakMap(), w = new WeakMap(), E = new WeakMap(), V = new WeakMap(), Y = new WeakMap(), n = new WeakMap(), N = new WeakMap(), W = new WeakMap(), tt = new WeakMap(), d = new WeakMap(), H = new WeakMap(), g = new WeakMap(), b = new WeakMap(), L = new WeakMap(), B = new WeakMap(), I = new WeakMap(), o = new WeakMap(), h = new WeakSet(), rt = function() {
258
- if (!t(this, p))
260
+ return t(this, I) - t(this, tt);
261
+ }
262
+ }, f = new WeakMap(), G = new WeakMap(), K = new WeakMap(), N = new WeakMap(), W = new WeakMap(), x = new WeakMap(), M = new WeakMap(), A = new WeakMap(), $ = new WeakMap(), m = new WeakMap(), C = new WeakMap(), v = new WeakMap(), y = new WeakMap(), H = new WeakMap(), p = new WeakMap(), R = new WeakMap(), k = new WeakMap(), B = new WeakMap(), O = new WeakMap(), z = new WeakMap(), D = new WeakMap(), l = new WeakMap(), P = new WeakMap(), F = new WeakMap(), L = new WeakMap(), E = new WeakMap(), V = new WeakMap(), Y = new WeakMap(), n = new WeakMap(), I = new WeakMap(), Z = new WeakMap(), tt = new WeakMap(), d = new WeakMap(), _ = new WeakMap(), g = new WeakMap(), b = new WeakMap(), w = new WeakMap(), J = new WeakMap(), q = new WeakMap(), u = new WeakMap(), h = new WeakSet(), lt = function() {
263
+ const r = [];
264
+ let s = this.parentElement;
265
+ for (; s; )
266
+ window.getComputedStyle(s).position === "sticky" && r.push(s), s = s.parentElement;
267
+ return r;
268
+ }, it = function() {
269
+ if (!t(this, f))
259
270
  return;
260
271
  t(this, l).subscribe((s) => {
261
272
  s.current && U(this, "scrollSegmentCapture", {
@@ -277,7 +288,7 @@ let wt = (ut = class extends HTMLElement {
277
288
  composed: !0,
278
289
  custom: !0
279
290
  });
280
- }), t(this, w).subscribe((s) => {
291
+ }), t(this, L).subscribe((s) => {
281
292
  s.current && U(this, "scrollSegmentReleaseFromStart", {
282
293
  composed: !0,
283
294
  custom: !0
@@ -287,101 +298,101 @@ let wt = (ut = class extends HTMLElement {
287
298
  composed: !0,
288
299
  custom: !0
289
300
  });
290
- }), t(this, _).observe(), t(this, q).observe(), t(this, G).observe(), t(this, K).observe(), t(this, x).observe(), t(this, T).observe(), t(this, M).observe(), t(this, A).observe(), t(this, m).observe(), t(this, C).observe(), t(this, v).observe(), t(this, y).observe(), t(this, $).observe(), t(this, f).observe(), t(this, R).observe(), t(this, O).observe(), t(this, j).observe(), t(this, z).observe(), t(this, D).observe(), t(this, k).observe();
301
+ }), t(this, G).observe(), t(this, K).observe(), t(this, N).observe(), t(this, W).observe(), t(this, x).observe(), t(this, M).observe(), t(this, A).observe(), t(this, $).observe(), t(this, m).observe(), t(this, C).observe(), t(this, v).observe(), t(this, y).observe(), t(this, H).observe(), t(this, p).observe(), t(this, R).observe(), t(this, k).observe(), t(this, B).observe(), t(this, O).observe(), t(this, z).observe(), t(this, D).observe();
291
302
  let r = !1;
292
- this.findAnotherScrollEntries(), t(this, x).current || this.enable(), t(this, _).subscribe((s) => {
303
+ this.findAnotherScrollEntries(), t(this, x).current || this.enable(), t(this, G).subscribe((s) => {
293
304
  t(this, d).damping = s.current;
294
- }), t(this, q).subscribe((s) => {
305
+ }), t(this, K).subscribe((s) => {
295
306
  t(this, d).mass = s.current;
296
- }), t(this, G).subscribe((s) => {
307
+ }), t(this, N).subscribe((s) => {
297
308
  t(this, d).stiffness = s.current;
298
- }), t(this, K).subscribe((s) => {
299
- s.previous && c(this, h, ht).call(this), s.current ? s.current === "parent" ? e(this, n, this.parentElement || this) : e(this, n, document.querySelector(s.current) || this) : e(this, n, this);
309
+ }), t(this, W).subscribe((s) => {
310
+ s.previous && c(this, h, nt).call(this), s.current ? s.current === "parent" ? e(this, n, this.parentElement || this) : e(this, n, document.querySelector(s.current) || this) : e(this, n, this);
300
311
  }), t(this, x).subscribe((s) => {
301
312
  s.current && !s.previous ? this.disable() : !s.current && s.previous && (this.resize(), this.enable());
313
+ }), t(this, A).subscribe(() => {
314
+ r && !t(this, u) && this.resize();
302
315
  }), t(this, M).subscribe(() => {
303
- r && !t(this, o) && this.resize();
304
- }), t(this, T).subscribe(() => {
305
- r && !t(this, o) && this.resize();
316
+ r && !t(this, u) && this.resize();
306
317
  }), t(this, m).subscribe((s) => {
307
- c(this, h, Z).call(this, s);
318
+ c(this, h, j).call(this, s);
308
319
  }), t(this, v).subscribe((s) => {
309
- c(this, h, Z).call(this, s);
320
+ c(this, h, j).call(this, s);
310
321
  }), t(this, y).subscribe((s) => {
311
- c(this, h, Z).call(this, s);
322
+ c(this, h, j).call(this, s);
312
323
  }), t(this, C).subscribe((s) => {
313
- c(this, h, Z).call(this, s);
324
+ c(this, h, j).call(this, s);
325
+ }), t(this, H).subscribe((s) => {
326
+ c(this, h, j).call(this, s);
327
+ }), t(this, p).subscribe((s) => {
328
+ c(this, h, j).call(this, s);
314
329
  }), t(this, $).subscribe((s) => {
315
- c(this, h, Z).call(this, s);
316
- }), t(this, f).subscribe((s) => {
317
- c(this, h, Z).call(this, s);
318
- }), t(this, A).subscribe((s) => {
319
- t(this, o) || !s.current && s.previous && (this.resize(), this.enable());
330
+ t(this, u) || !s.current && s.previous && (this.resize(), this.enable());
320
331
  }), t(this, R).subscribe((s) => {
321
- t(this, o) || (this.removeVar(s.previous), this.setVar(s.current, this.passed.current));
322
- }), t(this, O).subscribe((s) => {
323
- t(this, o) || (this.removeVar(s.previous), this.setVar(s.current, t(this, H)));
324
- }), t(this, D).subscribe((s) => {
325
- t(this, o) || (this.removeVar(s.previous), this.setVar(s.current, t(this, g)));
332
+ t(this, u) || (this.removeVar(s.previous), this.setVar(s.current, this.passed.current));
326
333
  }), t(this, k).subscribe((s) => {
327
- t(this, o) || (this.removeVar(s.previous), this.setVar(s.current, t(this, L)));
334
+ t(this, u) || (this.removeVar(s.previous), this.setVar(s.current, t(this, _)));
328
335
  }), t(this, z).subscribe((s) => {
329
- t(this, o) || (this.removeVar(s.previous), this.setVar(s.current, t(this, b)));
336
+ t(this, u) || (this.removeVar(s.previous), this.setVar(s.current, t(this, g)));
337
+ }), t(this, D).subscribe((s) => {
338
+ t(this, u) || (this.removeVar(s.previous), this.setVar(s.current, t(this, w)));
339
+ }), t(this, O).subscribe((s) => {
340
+ t(this, u) || (this.removeVar(s.previous), this.setVar(s.current, t(this, b)));
330
341
  }), t(this, d).subscribe((s) => {
331
- const Q = t(this, d)[t(this, j).current];
332
- e(this, H, Q / t(this, b) || 0), this.setVar(t(this, R).current, Q.toFixed(6)), this.setVar(
333
- t(this, O).current,
334
- t(this, H).toFixed(6)
342
+ const T = t(this, d)[t(this, B).current];
343
+ e(this, _, T / t(this, b) || 0), this.setVar(t(this, R).current, T.toFixed(6)), this.setVar(
344
+ t(this, k).current,
345
+ t(this, _).toFixed(6)
335
346
  );
336
- }), ct.subscribe(t(this, st), Ct.SCROLL), this.scrollContainer.onScroll(t(this, J)), r = !0;
337
- }, it = function() {
338
- t(this, p) && (ct.unsubscribe(t(this, st)), this.scrollContainer.offScroll(t(this, J)), t(this, _).close(), t(this, q).close(), t(this, G).close(), t(this, K).close(), t(this, x).close(), t(this, T).close(), t(this, M).close(), t(this, A).close(), t(this, m).close(), t(this, C).close(), t(this, v).close(), t(this, y).close(), t(this, $).close(), t(this, f).close(), t(this, R).close(), t(this, O).close(), t(this, z).close(), t(this, D).close(), t(this, k).close(), t(this, l).close(), t(this, P).close(), t(this, F).close(), t(this, w).close(), t(this, E).close(), t(this, V).close(), this.disable());
339
- }, ot = function() {
340
- t(this, l).current = !0, t(this, P).current = !1, e(this, I, !0), t(this, C).current && t(this, n).classList.remove(t(this, C).current), t(this, f).current && t(this, n).classList.remove(
341
- t(this, f).current
342
- ), t(this, f).current && t(this, n).classList.remove(
343
- t(this, f).current
347
+ }), ut.subscribe(t(this, st), yt.SCROLL), this.scrollContainer.onScroll(t(this, Q)), r = !0;
348
+ }, ht = function() {
349
+ t(this, f) && (ut.unsubscribe(t(this, st)), this.scrollContainer.offScroll(t(this, Q)), t(this, G).close(), t(this, K).close(), t(this, N).close(), t(this, W).close(), t(this, x).close(), t(this, M).close(), t(this, A).close(), t(this, $).close(), t(this, m).close(), t(this, C).close(), t(this, v).close(), t(this, y).close(), t(this, H).close(), t(this, p).close(), t(this, R).close(), t(this, k).close(), t(this, O).close(), t(this, z).close(), t(this, D).close(), t(this, l).close(), t(this, P).close(), t(this, F).close(), t(this, L).close(), t(this, E).close(), t(this, V).close(), this.disable());
350
+ }, ft = function() {
351
+ t(this, l).current = !0, t(this, P).current = !1, e(this, q, !0), t(this, C).current && t(this, n).classList.remove(t(this, C).current), t(this, p).current && t(this, n).classList.remove(
352
+ t(this, p).current
353
+ ), t(this, p).current && t(this, n).classList.remove(
354
+ t(this, p).current
344
355
  ), t(this, m).current && t(this, n).classList.add(t(this, m).current);
345
- }, at = function() {
346
- t(this, P).current = !0, t(this, l).current = !1, e(this, I, !0), t(this, m).current && t(this, n).classList.remove(t(this, m).current), t(this, v).current && t(this, n).classList.remove(
356
+ }, pt = function() {
357
+ t(this, P).current = !0, t(this, l).current = !1, e(this, q, !0), t(this, m).current && t(this, n).classList.remove(t(this, m).current), t(this, v).current && t(this, n).classList.remove(
347
358
  t(this, v).current
348
359
  ), t(this, y).current && t(this, n).classList.remove(
349
360
  t(this, y).current
350
361
  ), t(this, C).current && t(this, n).classList.add(t(this, C).current);
351
- }, lt = function() {
352
- t(this, l).current = !0, t(this, F).current = !0, t(this, w).current = !1, t(this, v).current && t(this, n).classList.add(
362
+ }, St = function() {
363
+ t(this, l).current = !0, t(this, F).current = !0, t(this, L).current = !1, t(this, v).current && t(this, n).classList.add(
353
364
  t(this, v).current
354
365
  );
355
- }, ft = function() {
366
+ }, mt = function() {
356
367
  t(this, l).current = !0, t(this, E).current = !0, t(this, V).current = !1, t(this, y).current && t(this, n).classList.add(
357
368
  t(this, y).current
358
369
  );
359
- }, pt = function() {
360
- t(this, P).current = !0, t(this, w).current = !0, t(this, F).current = !1, t(this, f).current && t(this, n).classList.add(
361
- t(this, f).current
370
+ }, dt = function() {
371
+ t(this, P).current = !0, t(this, L).current = !0, t(this, F).current = !1, t(this, p).current && t(this, n).classList.add(
372
+ t(this, p).current
362
373
  );
363
- }, St = function() {
364
- t(this, P).current = !0, t(this, V).current = !0, t(this, E).current = !1, t(this, f).current && t(this, n).classList.add(
365
- t(this, f).current
374
+ }, bt = function() {
375
+ t(this, P).current = !0, t(this, V).current = !0, t(this, E).current = !1, t(this, p).current && t(this, n).classList.add(
376
+ t(this, p).current
366
377
  );
367
- }, st = new WeakMap(), J = new WeakMap(), Z = function(r) {
368
- if (t(this, o)) {
378
+ }, st = new WeakMap(), Q = new WeakMap(), j = function(r) {
379
+ if (t(this, u)) {
369
380
  r.previous && t(this, n).classList.remove(r.previous), r.current && t(this, n).classList.remove(r.current);
370
381
  return;
371
382
  }
372
383
  r.current && t(this, l).current ? (r.previous && t(this, n).classList.remove(r.previous), t(this, n).classList.add(r.current)) : !r.current && r.previous && t(this, n).classList.remove(r.previous);
373
- }, mt = function(...r) {
384
+ }, gt = function(...r) {
374
385
  r.forEach((s) => {
375
386
  s && t(this, n).classList.remove(s);
376
387
  });
377
- }, dt = function(...r) {
388
+ }, Ct = function(...r) {
378
389
  r.forEach((s) => {
379
390
  s && t(this, n).style.removeProperty(`--${s}`);
380
391
  });
381
- }, ht = function() {
382
- c(this, h, mt).call(this, t(this, m).current, t(this, v).current, t(this, y).current, t(this, C).current, t(this, $).current, t(this, f).current), c(this, h, dt).call(this, t(this, R).current, t(this, O).current, t(this, z).current, t(this, D).current, t(this, k).current);
383
- }, ut);
384
- customElements.get("scroll-segment") || customElements.define("scroll-segment", wt);
392
+ }, nt = function() {
393
+ c(this, h, gt).call(this, t(this, m).current, t(this, v).current, t(this, y).current, t(this, C).current, t(this, H).current, t(this, p).current), c(this, h, Ct).call(this, t(this, R).current, t(this, k).current, t(this, O).current, t(this, z).current, t(this, D).current);
394
+ }, at);
395
+ customElements.get("scroll-segment") || customElements.define("scroll-segment", Rt);
385
396
  export {
386
- wt as ScrollSegmentElement
397
+ Rt as ScrollSegmentElement
387
398
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aptechka",
3
- "version": "0.29.1",
3
+ "version": "0.29.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/denisavitski/aptechka.git"