@rethink-js/rt-slider 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +48 -25
- package/dist/index.js +137 -30
- package/dist/index.js.map +2 -2
- package/dist/index.min.js +2 -2
- package/dist/index.min.js.map +3 -3
- package/package.json +1 -1
package/dist/index.min.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! @rethink-js/rt-slider v1.2.
|
|
2
|
-
(()=>{(function(){var I="rtSlider";if(window[I]&&window[I].__initialized)return;var _=null;function F(){return typeof window.Lenis!="undefined"?Promise.resolve():_||(_=new Promise(function(t,e){var i=document.querySelector('script[data-rt-slider-lenis="true"]')||document.querySelector('script[src*="lenis"]');if(i){if(typeof window.Lenis!="undefined"){t();return}i.addEventListener("load",function(){t()}),i.addEventListener("error",function(s){e(s)})}else{var r=document.createElement("script");r.src="https://cdn.jsdelivr.net/npm/lenis@1.3.16/dist/lenis.min.js",r.async=!0,r.setAttribute("data-rt-slider-lenis","true"),r.onload=function(){t()},r.onerror=function(s){e(s)},document.head.appendChild(r)}}),_)}var D=(function(){var t=new Set,e=0;function i(r){t.forEach(function(s){try{s.raf(r)}catch(n){}}),e=t.size?requestAnimationFrame(i):0}return{add:function(r){r&&(t.add(r),e||(e=requestAnimationFrame(i)))},remove:function(r){r&&(t.delete(r),!t.size&&e&&(cancelAnimationFrame(e),e=0))}}})();function X(){return"s"+Math.random().toString(36).slice(2)}function C(t,e){return t.getAttribute(e)||t.setAttribute(e,X()),t.getAttribute(e)}function z(t,e){var i=document.head.querySelector('[data-rt-slider-injected="'+t+'"]');return i||(i=document.createElement("style"),i.setAttribute("data-rt-slider-injected",t),document.head.appendChild(i)),i.textContent!==e&&(i.textContent=e),i}function U(t){var e=document.head.querySelector('[data-rt-slider-injected="'+t+'"]');e&&e.parentNode&&e.parentNode.removeChild(e)}function S(t){return typeof t=="string"?t.trim():""}function E(t,e){if(t==null)return e;var i=String(t).trim().toLowerCase();return i===""||i==="true"||i==="1"||i==="yes"||i==="y"||i==="on"?!0:i==="false"||i==="0"||i==="no"||i==="n"||i==="off"?!1:e}function T(t,e){if(t==null)return e;var i=String(t).trim();if(!i.length)return e;var r=Number(i);return Number.isFinite(r)?r:e}function A(t,e){if(t==null)return e;var i=String(t);return i.length?i:e}function u(t){return t<0?0:t>1?1:t}function P(t,e){if(!Number.isFinite(t))return 0;var i=Math.pow(10,e||0);return Math.round(t*i)/i}function G(t){var e=String(t||"").trim();if(!e)return null;var i={linear:function(r){return u(r)},easeInQuad:function(r){return r=u(r),r*r},easeOutQuad:function(r){return r=u(r),r*(2-r)},easeInOutQuad:function(r){return r=u(r),r<.5?2*r*r:1-Math.pow(-2*r+2,2)/2},easeInCubic:function(r){return r=u(r),r*r*r},easeOutCubic:function(r){return r=u(r),1-Math.pow(1-r,3)},easeInOutCubic:function(r){return r=u(r),r<.5?4*r*r*r:1-Math.pow(-2*r+2,3)/2},easeInOutSine:function(r){return r=u(r),-(Math.cos(Math.PI*r)-1)/2},easeOutExpo:function(r){return r=u(r),r===1?1:1-Math.pow(2,-10*r)}};return i[e]||null}function N(t){if(!t)return!0;var e=String(t).trim().toLowerCase();if(e==="transparent")return!0;if(e.startsWith("rgba(")){var i=e.slice(5,-1).split(",").map(function(s){return s.trim()}),r=i.length===4?Number(i[3]):1;return Number.isFinite(r)?r===0:!1}return!1}function H(t){for(var e=t;e&&e!==document.documentElement;){var i=getComputedStyle(e),r=i.backgroundColor;if(!N(r))return r;e=e.parentElement}var s=getComputedStyle(document.body).backgroundColor;return N(s)?"rgb(255, 255, 255)":s}function j(t){if(!t)return!1;try{return t.scrollWidth>t.clientWidth+1}catch(e){return!1}}function Q(t){for(var e=t;e&&e!==document.body;){var i=getComputedStyle(e),r=i.overflowX,s=r==="auto"||r==="scroll"||r==="overlay";if(s&&j(e))return e;e=e.parentElement}return t}function M(t,e,i){if(!e)return null;var r=t.querySelector(e);if(r)return r;var s=document.querySelector(e+'[data-rt-slider-for="'+i+'"]');if(s)return s;var n=Array.from(document.querySelectorAll(e));if(n.length===1)return n[0];var l=n.filter(function(a){var c=a.closest("[data-rt-slider]");return c===t});return l.length===1?l[0]:null}function K(t){if(!t)return!1;var e=getComputedStyle(t);return e.display==="none"||e.visibility==="hidden"?!1:t.getClientRects().length>0}function V(t){return{list:S(t.getAttribute("data-rt-list")),item:S(t.getAttribute("data-rt-item")),spacer:S(t.getAttribute("data-rt-spacer")),btnPrev:S(t.getAttribute("data-rt-btn-prev")),btnNext:S(t.getAttribute("data-rt-btn-next")),scrollTrack:S(t.getAttribute("data-rt-scroll-track")),scrollBar:S(t.getAttribute("data-rt-scroll-bar")),marginRef:S(t.getAttribute("data-rt-margin-ref")),overlayStart:S(t.getAttribute("data-rt-overlay-start")),overlayEnd:S(t.getAttribute("data-rt-overlay-end"))}}function o(t,e){if(this.root=t,this.id=e,this.conf=V(t),this.valid=!!(this.conf.list&&this.conf.item),!!this.valid){if(this.sliderId=C(this.root,"data-rt-slider-id"),this.list=this.root.querySelector(this.conf.list),!this.list){this.valid=!1;return}this.list.style.overflowX="auto",this.list.style.webkitOverflowScrolling="touch",this.list.style.scrollbarWidth="none",this.list.style.msOverflowStyle="none",this.scroller=Q(this.list),this.scroller.style.scrollbarWidth="none",this.scroller.style.msOverflowStyle="none";try{this.scroller.style.webkitOverflowScrolling="touch"}catch(r){}try{this.scroller.style.overscrollBehaviorX="contain"}catch(r){}this._basePaddingBottomPx=null,this._basePaddingCaptured=!1,this._touchClampTimer=0,this.btnPrev=this.conf.btnPrev?M(this.root,this.conf.btnPrev,this.sliderId):null,this.btnNext=this.conf.btnNext?M(this.root,this.conf.btnNext,this.sliderId):null,this.overlayStart=this.conf.overlayStart?M(this.root,this.conf.overlayStart,this.sliderId):null,this.overlayEnd=this.conf.overlayEnd?M(this.root,this.conf.overlayEnd,this.sliderId):null,this.overlayStart&&(this.overlayStart.style.transition="opacity 0.3s ease",this.overlayStart.style.willChange="opacity"),this.overlayEnd&&(this.overlayEnd.style.transition="opacity 0.3s ease",this.overlayEnd.style.willChange="opacity"),this.scrollTrack=this.conf.scrollTrack?this.root.querySelector(this.conf.scrollTrack):null,this.scrollBar=this.conf.scrollBar?this.root.querySelector(this.conf.scrollBar):null,this.firstItem=this.list.querySelector(this.conf.item+":first-child"),this.lastItem=this.list.querySelector(this.conf.item+":last-child"),this.dragging=!1,this.maybeDrag=!1,this.draggingBar=!1,this.barPointerId=null,this.barOffsetX=0,this.startX=0,this.startScroll=0,this.lastX=0,this.lastT=0,this.velocity=0,this.inertiaId=0,this.ticking=!1,this.didDrag=!1,this.didDragTs=0,this.dragMovedPx=0,this.cursorBindings=[],this.imgHandlers=[],this._roTicking=!1,this.lenis=null,this._lenisWasStopped=!1,this.mq=window.matchMedia("(hover: hover) and (pointer: fine)"),this._injectedKey=null,this._lastGutterPx=0,this._lastGapPx=0,this.slideState=null,this._slideStateSig="",this._lastSlideStateActiveIndex=-1,this._lastSlideStateScrollLeft=0;var i=this;this.ro=typeof ResizeObserver!="undefined"?new ResizeObserver(function(){i._roTicking||(i._roTicking=!0,requestAnimationFrame(function(){i._roTicking=!1,i.rafUpdate(),i.setupCursorMode(),i.applyIOSScrollIndicatorMask(),i.applyListStyles()}))}):null}}o.prototype.devicePixelEpsilon=function(){var t=Math.max(1,window.devicePixelRatio||1);return 1/t},o.prototype.listGap=function(){var t=getComputedStyle(this.list),e=parseFloat(t.columnGap||"0")||0,i=parseFloat(t.gap||"0")||0;return Math.max(e,i)},o.prototype.pickVisibleMarginRef=function(){if(!this.conf.marginRef)return null;var t=this.root.querySelectorAll(this.conf.marginRef);t.length===0&&(t=document.querySelectorAll(this.conf.marginRef));for(var e=0;e<t.length;e++)if(K(t[e]))return t[e];return null},o.prototype.isFlex=function(){return getComputedStyle(this.list).display.indexOf("flex")!==-1},o.prototype.isGrid=function(){return getComputedStyle(this.list).display.indexOf("grid")!==-1},o.prototype.ensureSpacers=function(){var t=Array.from(this.list.children),e=this.conf.spacer?this.conf.spacer.replace(/^[.#]/,""):"awards-slider-spacer",i=!(t[0]&&t[0].classList&&t[0].classList.contains(e)),r=!(t[t.length-1]&&t[t.length-1].classList&&t[t.length-1].classList.contains(e));if(i){var s=document.createElement("div");s.className=e,s.setAttribute("aria-hidden","true"),s.style.pointerEvents="none",s.style.height="1px",s.style.minHeight="1px",this.isFlex()&&(s.style.flex="0 0 auto"),this.list.insertBefore(s,this.list.firstChild)}if(r){var n=document.createElement("div");n.className=e,n.setAttribute("aria-hidden","true"),n.style.pointerEvents="none",n.style.height="1px",n.style.minHeight="1px",this.isFlex()&&(n.style.flex="0 0 auto"),this.list.appendChild(n)}},o.prototype.resetEdgeItemMargins=function(){this.firstItem&&(this.firstItem.style.marginLeft="0px"),this.lastItem&&(this.lastItem.style.marginRight="0px")},o.prototype.updateSpacers=function(){this.ensureSpacers(),this.resetEdgeItemMargins();var t=Array.from(this.list.children),e=this.conf.spacer?this.conf.spacer.replace(/^[.#]/,""):"awards-slider-spacer",i=t[0]&&t[0].classList.contains(e)?t[0]:null,r=t[t.length-1]&&t[t.length-1].classList.contains(e)?t[t.length-1]:null;if(!(!i||!r)){var s=this.pickVisibleMarginRef(),n=this.devicePixelEpsilon(),l=this.listGap();if(this._lastGapPx=l,i.style.marginRight="",r.style.marginLeft="",l>1e-4&&(i.style.marginRight="-"+l+"px",r.style.marginLeft="-"+l+"px"),!s){i.style.width=n+"px",r.style.width=n+"px",this._lastGutterPx=n;return}var a=this.scroller.getBoundingClientRect(),c=s.getBoundingClientRect(),h=getComputedStyle(this.scroller),f=getComputedStyle(this.list),g=parseFloat(h.borderLeftWidth||"0")||0,y=parseFloat(h.paddingLeft||"0")||0,L=parseFloat(f.paddingLeft||"0")||0,x=a.left+g+y,p=c.left,v=p-x-L,b=v<=0?n:Math.round(v);i.style.width=b+"px",r.style.width=b+"px",this.isGrid()&&(i.style.justifySelf="start",r.style.justifySelf="start",i.style.gridColumn="auto",r.style.gridColumn="auto"),this._lastGutterPx=b}},o.prototype.maxScroll=function(){return Math.max(0,this.scroller.scrollWidth-this.scroller.clientWidth)},o.prototype.updateOverlays=function(){if(!this.overlayStart&&!this.overlayEnd)return;var t=this.scroller.scrollWidth,e=this.scroller.clientWidth,i=t>e+1;function r(h,f){h&&(h.style.opacity=f?"1":"0",h.style.pointerEvents=f?"":"none")}if(!i){r(this.overlayStart,!1),r(this.overlayEnd,!1);return}var s=this.maxScroll(),n=this.scroller.scrollLeft,l=10,a=n<=l,c=n>=s-l;r(this.overlayStart,!a),r(this.overlayEnd,!c)},o.prototype.updateButtons=function(){if(!(!this.btnPrev&&!this.btnNext)){var t=this.scroller.scrollWidth,e=this.scroller.clientWidth,i=t>e+1;if(!i){this.btnPrev&&(this.btnPrev.classList.add("inactive"),this.btnPrev.style.display="none"),this.btnNext&&(this.btnNext.classList.add("inactive"),this.btnNext.style.display="none");return}this.btnPrev&&(this.btnPrev.style.display=""),this.btnNext&&(this.btnNext.style.display="");var r=this.maxScroll(),s=this.scroller.scrollLeft,n=10,l=s<=n,a=s>=r-n;this.btnPrev&&(l?this.btnPrev.classList.add("inactive"):this.btnPrev.classList.remove("inactive")),this.btnNext&&(a?this.btnNext.classList.add("inactive"):this.btnNext.classList.remove("inactive"))}},o.prototype.computeScrollbarMetrics=function(){if(!this.scrollTrack||!this.scrollBar)return null;var t=this.scroller.scrollWidth,e=this.scroller.clientWidth,i=this.list.querySelectorAll(this.conf.item).length;if(t<=e||i===0)return null;var r=this.scrollTrack.clientWidth,s=t/Math.max(1,i+2),n=Math.max(1,Math.round(e/s)),l=Math.max(8,n/(i+2)*r),a=Math.max(1,t-e),c=Math.max(0,r-l),h=Math.min(1,Math.max(0,this.scroller.scrollLeft/a)),f=c*h;return{trackWidth:r,barWidth:l,maxS:a,maxX:c,x:f}},o.prototype.updateScrollbar=function(){if(!(!this.scrollTrack||!this.scrollBar)){var t=this.computeScrollbarMetrics();if(!t){this.scrollTrack.style.display="none";return}this.scrollTrack.style.display="",this.scrollBar.style.width=t.barWidth+"px",this.draggingBar||(this.scrollBar.style.transform="translateX("+t.x+"px)")}},o.prototype.rafUpdate=function(){this.updateSpacers(),this.updateScrollbar(),this.updateButtons(),this.updateOverlays(),this.updateSlideState(!1)},o.prototype.safeClampScroll=function(t){var e=Math.min(Math.max(t,0),this.maxScroll());return Number.isFinite(e)?e:0},o.prototype.setScroll=function(t,e){var i=this.safeClampScroll(t);if(this.lenis){var r=e||{};try{this.lenis.scrollTo(i,{immediate:!!r.immediate,lock:!!r.lock,force:r.force!==!1})}catch(s){this.scroller.scrollLeft=i}}else this.scroller.scrollLeft=i;this.updateScrollbar(),this.updateButtons(),this.updateOverlays(),this.updateSlideState(!1)},o.prototype.scheduleTouchClamp=function(){var t=this;this._touchClampTimer&&clearTimeout(this._touchClampTimer),this._touchClampTimer=setTimeout(function(){t._touchClampTimer=0;var e=t.scroller.scrollLeft,i=t.maxScroll(),r=1;Number.isFinite(e)?e<-r||e>i+r?t.scroller.scrollLeft=t.safeClampScroll(e):e<0?t.scroller.scrollLeft=0:e>i&&(t.scroller.scrollLeft=i):t.scroller.scrollLeft=0,t.updateScrollbar(),t.updateButtons(),t.updateOverlays(),t.updateSlideState(!1)},90)},o.prototype.onScroll=function(){var t=this;if(!this.mq.matches){this.updateScrollbar(),this.updateButtons(),this.updateOverlays(),this.updateSlideState(!1),this.scheduleTouchClamp();return}this.ticking||(this.ticking=!0,requestAnimationFrame(function(){var e=t.safeClampScroll(t.scroller.scrollLeft);e!==t.scroller.scrollLeft&&(t.lenis?t.setScroll(e,{immediate:!0,lock:!1,force:!0}):t.scroller.scrollLeft=e),t.updateScrollbar(),t.updateButtons(),t.updateOverlays(),t.updateSlideState(!1),t.ticking=!1}))},o.prototype.itemStepWidth=function(){if(!this.conf.item)return Math.max(1,Math.floor(this.scroller.clientWidth*.9));var t=this.list.querySelector(this.conf.item);if(!t)return Math.max(1,Math.floor(this.scroller.clientWidth*.9));var e=getComputedStyle(t),i=t.getBoundingClientRect().width,r=parseFloat(e.marginRight)||0;return Math.max(1,Math.round(i+r))},o.prototype.getAlignTargetLeft=function(){var t=this.pickVisibleMarginRef();if(t)return t.getBoundingClientRect().left;var e=this.scroller.getBoundingClientRect(),i=getComputedStyle(this.scroller),r=getComputedStyle(this.list),s=parseFloat(i.borderLeftWidth||"0")||0,n=parseFloat(i.paddingLeft||"0")||0,l=parseFloat(r.paddingLeft||"0")||0,a=Number.isFinite(this._lastGutterPx)?this._lastGutterPx:0;return e.left+s+n+l+a},o.prototype.getOrderedItems=function(){if(!this.conf.item)return[];var t=Array.from(this.list.querySelectorAll(this.conf.item));return t.filter(function(e){return e&&e.nodeType===1})},o.prototype.getCurrentItemIndex=function(t){if(!t||!t.length)return-1;for(var e=this.getAlignTargetLeft(),i=0,r=1/0,s=0;s<t.length;s++){var n=t[s].getBoundingClientRect(),l=n.left-e,a=Math.abs(l);a<r&&(r=a,i=s)}return i},o.prototype.getItemAnchorScrolls=function(t){for(var e=this.safeClampScroll(this.scroller.scrollLeft),i=this.getAlignTargetLeft(),r=[],s=-1/0,n=0;n<t.length;n++){var l=t[n];l.setAttribute("data-rt-slider-item-index",String(n));var a=l.getBoundingClientRect(),c=e+(a.left-i),h=this.safeClampScroll(c);h<s&&(h=s),r.push(h),s=h}return r},o.prototype.cloneSlideState=function(t){return t?{sliderId:t.sliderId,itemCount:t.itemCount,scroll:{current:t.scroll.current,max:t.scroll.max,progress:t.scroll.progress,progressPercent:t.scroll.progressPercent,direction:t.scroll.direction,isAtStart:t.scroll.isAtStart,isAtEnd:t.scroll.isAtEnd},active:{index:t.active.index,element:t.active.element,anchorScrollLeft:t.active.anchorScrollLeft,distancePx:t.active.distancePx},previous:{index:t.previous.index,element:t.previous.element},next:{index:t.next.index,element:t.next.element},segment:{fromIndex:t.segment.fromIndex,fromElement:t.segment.fromElement,toIndex:t.segment.toIndex,toElement:t.segment.toElement,progress:t.segment.progress,progressPercent:t.segment.progressPercent,distancePx:t.segment.distancePx,spanPx:t.segment.spanPx,remainingPx:t.segment.remainingPx,isBetween:t.segment.isBetween},slides:t.slides.map(function(e){return{index:e.index,element:e.element,anchorScrollLeft:e.anchorScrollLeft,anchorProgress:e.anchorProgress,anchorProgressPercent:e.anchorProgressPercent,distanceFromCurrentPx:e.distanceFromCurrentPx,isActive:e.isActive,isPrevious:e.isPrevious,isNext:e.isNext,isFrom:e.isFrom,isTo:e.isTo,isBeforeActive:e.isBeforeActive,isAfterActive:e.isAfterActive}})}:null},o.prototype.dispatchSliderEvent=function(t,e){var i=this.cloneSlideState(e);try{this.root.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:i}))}catch(s){var r=document.createEvent("CustomEvent");r.initCustomEvent(t,!0,!1,i),this.root.dispatchEvent(r)}},o.prototype.applySlideStateAttributes=function(t){var e=this.root;e.setAttribute("data-rt-slider-active-index",String(t.active.index)),e.setAttribute("data-rt-slider-from-index",String(t.segment.fromIndex)),e.setAttribute("data-rt-slider-to-index",String(t.segment.toIndex)),e.setAttribute("data-rt-slider-segment-progress",String(P(t.segment.progress,6))),e.setAttribute("data-rt-slider-segment-progress-percent",String(P(t.segment.progressPercent,4))),e.setAttribute("data-rt-slider-scroll-progress",String(P(t.scroll.progress,6))),e.setAttribute("data-rt-slider-scroll-progress-percent",String(P(t.scroll.progressPercent,4))),e.setAttribute("data-rt-slider-scroll-direction",t.scroll.direction);for(var i=0;i<t.slides.length;i++){var r=t.slides[i],s=r.element;s&&(s.setAttribute("data-rt-slider-item-index",String(r.index)),s.setAttribute("data-rt-slider-item-active",r.isActive?"true":"false"),s.setAttribute("data-rt-slider-item-from",r.isFrom?"true":"false"),s.setAttribute("data-rt-slider-item-to",r.isTo?"true":"false"),s.setAttribute("data-rt-slider-item-previous",r.isPrevious?"true":"false"),s.setAttribute("data-rt-slider-item-next",r.isNext?"true":"false"),s.setAttribute("data-rt-slider-item-before-active",r.isBeforeActive?"true":"false"),s.setAttribute("data-rt-slider-item-after-active",r.isAfterActive?"true":"false"),s.setAttribute("data-rt-slider-item-anchor-progress",String(P(r.anchorProgress,6))),s.setAttribute("data-rt-slider-item-anchor-progress-percent",String(P(r.anchorProgressPercent,4))),s.setAttribute("data-rt-slider-item-distance",String(P(r.distanceFromCurrentPx,4))))}},o.prototype.buildSlideState=function(){var t=this.getOrderedItems(),e=this.maxScroll(),i=this.safeClampScroll(this.scroller.scrollLeft),r=this._lastSlideStateScrollLeft,s="none";if(i>r+.01?s="forward":i<r-.01&&(s="backward"),!t.length)return{sliderId:this.sliderId,itemCount:0,scroll:{current:i,max:e,progress:e>0?u(i/e):0,progressPercent:e>0?u(i/e)*100:0,direction:s,isAtStart:i<=.5,isAtEnd:i>=e-.5},active:{index:-1,element:null,anchorScrollLeft:0,distancePx:0},previous:{index:-1,element:null},next:{index:-1,element:null},segment:{fromIndex:-1,fromElement:null,toIndex:-1,toElement:null,progress:0,progressPercent:0,distancePx:0,spanPx:0,remainingPx:0,isBetween:!1},slides:[]};for(var n=this.getItemAnchorScrolls(t),l=0,a=1/0,c=0;c<n.length;c++){var h=i-n[c],f=Math.abs(h);f<a&&(a=f,l=c)}var g=0,y=0,L=0,x=0,p=0,v=0,b=!1;if(i<=n[0])g=0,y=0,L=0,x=0,p=0,v=0,b=!1;else if(i>=n[n.length-1])g=n.length-1,y=n.length-1,L=1,x=0,p=0,v=0,b=!1;else for(var k=0;k<n.length-1;k++){var w=n[k],B=n[k+1];if(i>=w&&i<=B){g=k,y=k+1,p=Math.max(0,B-w),x=Math.max(0,i-w),L=p>0?u(x/p):0,v=Math.max(0,p-x),b=i>w&&i<B;break}}for(var R=[],m=0;m<t.length;m++){var W=n[m],q=e>0?u(W/e):0;R.push({index:m,element:t[m],anchorScrollLeft:W,anchorProgress:q,anchorProgressPercent:q*100,distanceFromCurrentPx:i-W,isActive:m===l,isPrevious:m===l-1,isNext:m===l+1,isFrom:m===g,isTo:m===y,isBeforeActive:m<l,isAfterActive:m>l})}return{sliderId:this.sliderId,itemCount:t.length,scroll:{current:i,max:e,progress:e>0?u(i/e):0,progressPercent:e>0?u(i/e)*100:0,direction:s,isAtStart:i<=.5,isAtEnd:i>=e-.5},active:{index:l,element:t[l]||null,anchorScrollLeft:n[l]||0,distancePx:i-(n[l]||0)},previous:{index:l>0?l-1:-1,element:l>0?t[l-1]:null},next:{index:l<t.length-1?l+1:-1,element:l<t.length-1?t[l+1]:null},segment:{fromIndex:g,fromElement:t[g]||null,toIndex:y,toElement:t[y]||null,progress:L,progressPercent:L*100,distancePx:x,spanPx:p,remainingPx:v,isBetween:b},slides:R}},o.prototype.updateSlideState=function(t){var e=this.buildSlideState(),i=this._lastSlideStateActiveIndex,r=e.active.index+"|"+e.segment.fromIndex+"|"+e.segment.toIndex+"|"+P(e.segment.progress,4)+"|"+P(e.scroll.progress,4)+"|"+e.scroll.direction;this.slideState=e,this.applySlideStateAttributes(e),this._lastSlideStateScrollLeft=e.scroll.current,(t||r!==this._slideStateSig)&&(this._slideStateSig=r,this.dispatchSliderEvent("rtSlider:slide",e)),(t||e.active.index!==i)&&(this._lastSlideStateActiveIndex=e.active.index,this.dispatchSliderEvent("rtSlider:active",e))},o.prototype.getSlideState=function(){return this.slideState||this.updateSlideState(!0),this.cloneSlideState(this.slideState)},o.prototype.getActiveIndex=function(){var t=this.getSlideState();return t&&t.active?t.active.index:-1},o.prototype.getActiveElement=function(){var t=this.getSlideState();return t&&t.active?t.active.element:null},o.prototype.scrollAlignToItem=function(t){if(t){var e=this.scroller.scrollWidth,i=this.scroller.clientWidth;if(!(e<=i+1)){var r=this.getAlignTargetLeft(),s=t.getBoundingClientRect(),n=s.left-r;if(Number.isFinite(n)){var l=this.safeClampScroll(this.scroller.scrollLeft+n);if(this.lenis){var a=1.2;try{this.lenis.scrollTo(l,{duration:a,easing:function(c){return Math.min(1,1.001-Math.pow(2,-10*c))},immediate:!1,lock:!1,force:!0})}catch(c){this.scroller.scrollTo({left:l,behavior:"smooth"})}}else this.scroller.scrollTo({left:l,behavior:"smooth"})}}}},o.prototype.scrollByItems=function(t){var e=this.scroller.scrollWidth,i=this.scroller.clientWidth;if(!(e<=i+1)){var r=this.getOrderedItems();if(!r.length){var s=this.itemStepWidth(),n=t>0?this.scroller.scrollLeft+s*t:this.scroller.scrollLeft-s*Math.abs(t),l=this.safeClampScroll(n);if(this.lenis)try{this.lenis.scrollTo(l,{duration:1.2,easing:function(h){return Math.min(1,1.001-Math.pow(2,-10*h))},immediate:!1,lock:!1,force:!0})}catch(h){this.scroller.scrollTo({left:l,behavior:"smooth"})}else this.scroller.scrollTo({left:l,behavior:"smooth"});return}var a=this.getCurrentItemIndex(r);a<0&&(a=0);var c=a;t>0?c=Math.min(r.length-1,a+1):t<0&&(c=Math.max(0,a-1)),this.scrollAlignToItem(r[c])}},o.prototype.onPrevClick=function(t){t.preventDefault(),this.scrollByItems(-1)},o.prototype.onNextClick=function(t){t.preventDefault(),this.scrollByItems(1)},o.prototype.stopInertia=function(){this.inertiaId&&(cancelAnimationFrame(this.inertiaId),this.inertiaId=0)},o.prototype.startDrag=function(t){if(!this.dragging){if(this.dragging=!0,this.didDrag=!0,this.didDragTs=performance.now(),this.dragMovedPx=Math.max(this.dragMovedPx,Math.abs(t.clientX-this.startX)),this.lenis)try{this.lenis.stop(),this._lenisWasStopped=!0}catch(e){this._lenisWasStopped=!1}try{this.scroller.setPointerCapture(t.pointerId)}catch(e){}this.scroller.classList.add("is-dragging"),this.scroller.style.userSelect="none",this.stopInertia(),this.lastX=t.clientX,this.lastT=performance.now(),this.velocity=0}},o.prototype.endDrag=function(t){if(this.dragging){if(this.dragging=!1,this.scroller.classList.remove("is-dragging"),this.scroller.style.userSelect="",t&&t.pointerId!=null)try{this.scroller.releasePointerCapture(t.pointerId)}catch(h){}var e=.2;if(this.lenis){if(this._lenisWasStopped)try{this.lenis.start()}catch(h){}if(this._lenisWasStopped=!1,Math.abs(this.velocity)>=e){var i=this.velocity*24,r=this.safeClampScroll(this.scroller.scrollLeft+i),s=Math.min(2,Math.max(.35,Math.abs(this.velocity)/18)),n=Math.min(1.35,Math.max(.35,.85/s));try{this.lenis.scrollTo(r,{duration:n,easing:function(h){return Math.min(1,1.001-Math.pow(2,-10*h))},immediate:!1,lock:!1,force:!0})}catch(h){this.scroller.scrollTo({left:r,behavior:"smooth"})}}return}var l=.92,a=this,c=function(){var h=a.safeClampScroll(a.scroller.scrollLeft+a.velocity);a.scroller.scrollLeft=h,a.velocity*=l;var f=h<=0||h>=a.maxScroll();if(Math.abs(a.velocity)<e||f){a.inertiaId=0;return}a.inertiaId=requestAnimationFrame(c)};Math.abs(this.velocity)>=e&&(this.inertiaId=requestAnimationFrame(c))}},o.prototype.onPointerDown=function(t){var e=this.scroller.scrollWidth,i=this.scroller.clientWidth;e<=i+1||t.pointerType==="mouse"&&t.button!==0||(this.maybeDrag=!0,this.dragging=!1,this.didDrag=!1,this.didDragTs=0,this.dragMovedPx=0,this.startX=t.clientX,this.startScroll=this.scroller.scrollLeft,this.lastX=t.clientX,this.lastT=performance.now(),this.velocity=0)},o.prototype.onPointerMove=function(t){if(!(!this.maybeDrag&&!this.dragging)){var e=t.clientX-this.startX;if(this.dragMovedPx=Math.max(this.dragMovedPx,Math.abs(e)),!this.dragging)if(Math.abs(e)>=6)this.startDrag(t);else return;var i=performance.now(),r=t.clientX-this.lastX,s=Math.max(1,i-this.lastT),n=this.startScroll-(t.clientX-this.startX);this.setScroll(n,{immediate:!0,lock:!0,force:!0}),this.velocity=-(r/s)*16,this.lastX=t.clientX,this.lastT=i}},o.prototype.onPointerUp=function(t){var e=this;this.dragging&&this.endDrag(t),this.maybeDrag=!1,this.dragMovedPx<6?(this.didDrag=!1,this.didDragTs=0):(this.didDrag=!0,this.didDragTs=performance.now()),setTimeout(function(){e.didDrag=!1,e.didDragTs=0,e.dragMovedPx=0},420)},o.prototype.onPointerCancel=function(){var t=this;if(this.dragging){if(this.dragging=!1,this.scroller.classList.remove("is-dragging"),this.scroller.style.userSelect="",this.stopInertia(),this.lenis&&this._lenisWasStopped)try{this.lenis.start()}catch(e){}this._lenisWasStopped=!1}this.maybeDrag=!1,setTimeout(function(){t.didDrag=!1,t.didDragTs=0,t.dragMovedPx=0},0)},o.prototype.trackMetrics=function(){if(!this.scrollTrack||!this.scrollBar)return{trackWidth:0,barWidth:0,maxX:0,m:Math.max(1,this.maxScroll())};var t=this.scrollTrack.clientWidth,e=Math.max(1,this.maxScroll()),i=0,r=this.computeScrollbarMetrics();r?i=r.barWidth:i=this.scrollBar.getBoundingClientRect().width||0;var s=Math.max(0,t-i);return{trackWidth:t,barWidth:i,maxX:s,m:e}},o.prototype.setScrollFromTrackX=function(t,e){var i=this.trackMetrics(),r=Math.min(Math.max(t,0),i.maxX);this.scrollBar&&(this.scrollBar.style.transform="translateX("+r+"px)");var s=i.maxX===0?0:r/i.maxX,n=s*i.m;this.setScroll(n,e||{immediate:!0,lock:!0,force:!0})},o.prototype.startBarDrag=function(t){if(!(!this.scrollTrack||!this.scrollBar)&&!(t.pointerType==="mouse"&&t.button!==0)){if(t.preventDefault(),t.stopPropagation(),this.lenis)try{this.lenis.stop(),this._lenisWasStopped=!0}catch(s){this._lenisWasStopped=!1}this.draggingBar=!0,this.barPointerId=t.pointerId!=null?t.pointerId:null;var e=this.scrollBar.getBoundingClientRect();this.barOffsetX=t.clientX-e.left,this.scrollBar.style.cursor="grabbing",this.scrollTrack.style.cursor="grabbing";try{this.scrollTrack.setPointerCapture(t.pointerId)}catch(s){}var i=this.scrollTrack.getBoundingClientRect(),r=t.clientX-i.left-this.barOffsetX;this.setScrollFromTrackX(r,{immediate:!0,lock:!0,force:!0})}},o.prototype.onTrackPointerDown=function(t){!this.scrollTrack||!this.scrollBar||(this.updateScrollbar(),this.startBarDrag(t))},o.prototype.onTrackPointerMove=function(t){if(!(!this.draggingBar||!this.scrollTrack)&&!(this.barPointerId!=null&&t.pointerId!=null&&t.pointerId!==this.barPointerId)){t.preventDefault();var e=this.scrollTrack.getBoundingClientRect(),i=t.clientX-e.left-this.barOffsetX;this.setScrollFromTrackX(i,{immediate:!0,lock:!0,force:!0})}},o.prototype.endBarDrag=function(t){if(this.draggingBar){if(this.draggingBar=!1,this.scrollBar&&(this.scrollBar.style.cursor="grab"),this.scrollTrack&&(this.scrollTrack.style.cursor="pointer"),this.scrollTrack&&t&&t.pointerId!=null)try{this.scrollTrack.releasePointerCapture(t.pointerId)}catch(e){}if(this.lenis&&this._lenisWasStopped)try{this.lenis.start()}catch(e){}this._lenisWasStopped=!1,this.updateScrollbar(),this.updateButtons(),this.updateOverlays(),this.updateSlideState(!1),this.barPointerId=null}},o.prototype.detectLinksInItems=function(){return this.conf.item?!!this.list.querySelector(this.conf.item+" a[href]"):!1},o.prototype.clearCursorBindings=function(){for(var t=0;t<this.cursorBindings.length;t++){var e=this.cursorBindings[t];e.el.removeEventListener(e.type,e.fn)}this.cursorBindings=[]},o.prototype.setupCursorMode=function(){this.clearCursorBindings();var t=this.scroller.scrollWidth,e=this.scroller.clientWidth,i=t>e+1;if(!i){this.scroller.style.cursor="";return}if(!this.mq.matches){this.scroller.style.cursor="";return}if(this.hasLinks=this.detectLinksInItems(),this.hasLinks){this.scroller.style.cursor="";return}var r=this,s=function(){r.scroller.classList.contains("is-dragging")||(r.scroller.style.cursor="grab")},n=function(){r.scroller.style.cursor=""};this.scroller.addEventListener("mouseenter",s),this.scroller.addEventListener("mouseleave",n),this.cursorBindings.push({el:this.scroller,type:"mouseenter",fn:s}),this.cursorBindings.push({el:this.scroller,type:"mouseleave",fn:n})},o.prototype.captureBasePaddingBottomOnce=function(){if(!this._basePaddingCaptured){var t=getComputedStyle(this.scroller),e=parseFloat(t.paddingBottom||"0")||0;this._basePaddingBottomPx=e,this._basePaddingCaptured=!0}},o.prototype.applyIOSScrollIndicatorMask=function(){if(this._basePaddingCaptured||this.captureBasePaddingBottomOnce(),this.mq.matches){this.scroller.style.removeProperty("--rt-slider-mask-bg"),this.scroller.style.removeProperty("--rt-slider-mask-h"),this.scroller.style.removeProperty("--rt-slider-base-pb");return}var t=H(this.scroller);this.scroller.style.setProperty("--rt-slider-mask-bg",t),this.scroller.style.setProperty("--rt-slider-mask-h","12px"),this.scroller.style.setProperty("--rt-slider-base-pb",(this._basePaddingBottomPx||0)+"px")},o.prototype.applyListStyles=function(){var t=C(this.list,"data-rt-slider-list-uid"),e=C(this.scroller,"data-rt-slider-scroller-uid"),i=this.mq.matches,r="";if(this.scrollTrack&&this.scrollBar){var s=C(this.scrollTrack,"data-rt-slider-track-uid"),n=C(this.scrollBar,"data-rt-slider-bar-uid");i?r='[data-rt-slider-track-uid="'+s+'"]{position:relative; touch-action:none; overflow: visible !important;}[data-rt-slider-track-uid="'+s+'"]::before{content:"";position:absolute;top:-30px;bottom:-30px;left:0;right:0;z-index:0; cursor:pointer; pointer-events:auto;}[data-rt-slider-bar-uid="'+n+'"]{position:relative; z-index:2; touch-action:none;}[data-rt-slider-bar-uid="'+n+'"]::after{content:"";position:absolute;top:-30px;bottom:-30px;left:0;right:0;z-index:3; cursor:grab; pointer-events:auto;}':r='[data-rt-slider-track-uid="'+s+'"]{position:relative; touch-action:auto; overflow: visible !important; pointer-events:none !important; user-select:none !important;}[data-rt-slider-track-uid="'+s+'"]::before{content:"";position:absolute;top:-30px;bottom:-30px;left:0;right:0;z-index:0; pointer-events:none !important;}[data-rt-slider-bar-uid="'+n+'"]{position:relative; z-index:2; touch-action:auto; pointer-events:none !important; user-select:none !important;}[data-rt-slider-bar-uid="'+n+'"]::after{content:"";position:absolute;top:-30px;bottom:-30px;left:0;right:0;z-index:3; pointer-events:none !important;}'}var l='[data-rt-slider-list-uid="'+t+'"]::-webkit-scrollbar{width:0 !important;height:0 !important;display:none !important;background:transparent !important;}[data-rt-slider-list-uid="'+t+'"]::-webkit-scrollbar-thumb{background:transparent !important;}[data-rt-slider-list-uid="'+t+'"]::-webkit-scrollbar-track{background:transparent !important;}[data-rt-slider-list-uid="'+t+'"]{scrollbar-width:none !important;-ms-overflow-style:none !important;}[data-rt-slider-scroller-uid="'+e+'"]::-webkit-scrollbar{width:0 !important;height:0 !important;display:none !important;background:transparent !important;}[data-rt-slider-scroller-uid="'+e+'"]::-webkit-scrollbar-thumb{background:transparent !important;}[data-rt-slider-scroller-uid="'+e+'"]::-webkit-scrollbar-track{background:transparent !important;}[data-rt-slider-scroller-uid="'+e+'"]{scrollbar-width:none !important;-ms-overflow-style:none !important;}',a=i?"":'[data-rt-slider-scroller-uid="'+e+'"]{position:relative;padding-bottom:calc(var(--rt-slider-base-pb, 0px) + var(--rt-slider-mask-h, 12px));}[data-rt-slider-scroller-uid="'+e+'"]::after{content:"";position:absolute;left:0;right:0;bottom:0;height:var(--rt-slider-mask-h, 12px);pointer-events:none;z-index:2147483647;background:var(--rt-slider-mask-bg, transparent);}',c='[data-rt-slider-scroller-uid="'+e+'"].is-dragging{cursor:grabbing !important;user-select:none}[data-rt-slider-list-uid="'+t+'"].is-dragging{cursor:grabbing !important;user-select:none}[data-rt-slider-scroller-uid="'+e+'"].is-dragging img,[data-rt-slider-scroller-uid="'+e+'"].is-dragging a,[data-rt-slider-scroller-uid="'+e+'"].is-dragging '+this.conf.item+'{user-select:none;-webkit-user-drag:none}[data-rt-slider-list-uid="'+t+'"] img{-webkit-user-drag:none}';this._injectedKey="rt-ss-"+t,z(this._injectedKey,l+c+r+a)},o.prototype.onResize=function(){this.stopInertia(),this.rafUpdate(),this.setupCursorMode(),this.applyIOSScrollIndicatorMask(),this.applyListStyles(),this.updateSlideState(!0)},o.prototype.onClickCapture=function(t){if(this.didDragTs&&!(performance.now()-this.didDragTs>420)){var e=t.target&&t.target.closest?t.target.closest("a,button,[role='button'],input,textarea,select,label"):null;e&&(t.preventDefault(),t.stopPropagation())}},o.prototype.getLenisOptions=function(){var t="data-rt-slider-",e=this.root;function i(k){return e.getAttribute(t+k)}var r={wrapper:this.scroller,content:this.list,orientation:"horizontal",gestureOrientation:"horizontal",smoothWheel:!0,syncTouch:!1},s=T(i("lerp"),void 0),n=T(i("duration"),void 0),l=A(i("easing"),""),a=G(l);s!==void 0?r.lerp=s:n!==void 0&&(r.duration=n),a&&(r.easing=a);var c=A(i("orientation"),"");c&&(r.orientation=c);var h=A(i("gesture-orientation"),"");h&&(r.gestureOrientation=h);var f=i("smooth-wheel");f!==null&&(r.smoothWheel=E(f,!0));var g=T(i("wheel-multiplier"),void 0);g!==void 0&&(r.wheelMultiplier=g);var y=T(i("touch-multiplier"),void 0);y!==void 0&&(r.touchMultiplier=y);var L=E(i("infinite"),!1);L&&(r.infinite=!0);var x=E(i("auto-resize"),!0);x===!1&&(r.autoResize=!1);var p=i("options-json");if(p)try{var v=JSON.parse(p);if(v&&typeof v=="object")for(var b in v)r[b]=v[b]}catch(k){}return r},o.prototype.setupLenisInstance=function(){if(this.mq.matches&&!this.lenis){var t=this.getLenisOptions();try{this.lenis=new window.Lenis(t),D.add(this.lenis)}catch(e){this.lenis=null}}},o.prototype.bindEvents=function(){this._onScroll=this.onScroll.bind(this),this.scroller.addEventListener("scroll",this._onScroll,{passive:!0}),this._onResize=this.onResize.bind(this),window.addEventListener("resize",this._onResize),this.mq.matches&&(this._onPD=this.onPointerDown.bind(this),this.scroller.addEventListener("pointerdown",this._onPD),this._onPM=this.onPointerMove.bind(this),this.scroller.addEventListener("pointermove",this._onPM),this._onPU=this.onPointerUp.bind(this),this.scroller.addEventListener("pointerup",this._onPU),this._onPC=this.onPointerCancel.bind(this),this.scroller.addEventListener("pointercancel",this._onPC),this._onPL=this.onPointerCancel.bind(this),this.scroller.addEventListener("pointerleave",this._onPL),this._onClickCap=this.onClickCapture.bind(this),this.scroller.addEventListener("click",this._onClickCap,!0)),this.btnPrev&&(this._onPrev=this.onPrevClick.bind(this),this.btnPrev.addEventListener("click",this._onPrev)),this.btnNext&&(this._onNext=this.onNextClick.bind(this),this.btnNext.addEventListener("click",this._onNext)),this.mq.matches?(this.scrollBar&&(this.scrollBar.style.touchAction="none",this.scrollBar.style.cursor="grab"),this.scrollTrack&&(this.scrollTrack.style.userSelect="none",this.scrollTrack.style.cursor="pointer",this.scrollTrack.style.touchAction="none",this._onTPD=this.onTrackPointerDown.bind(this),this.scrollTrack.addEventListener("pointerdown",this._onTPD),this._onTPM=this.onTrackPointerMove.bind(this),this.scrollTrack.addEventListener("pointermove",this._onTPM),this._onTPU=this.endBarDrag.bind(this),this.scrollTrack.addEventListener("pointerup",this._onTPU),this._onTPC=this.endBarDrag.bind(this),this.scrollTrack.addEventListener("pointercancel",this._onTPC),this._onTPL=this.endBarDrag.bind(this),this.scrollTrack.addEventListener("pointerleave",this._onTPL))):(this.scrollBar&&(this.scrollBar.style.touchAction="",this.scrollBar.style.cursor=""),this.scrollTrack&&(this.scrollTrack.style.userSelect="",this.scrollTrack.style.cursor="",this.scrollTrack.style.touchAction=""));var t=this;this._onMQ=function(){t.applyIOSScrollIndicatorMask(),t.applyListStyles(),t.setupCursorMode(),t.rafUpdate(),t.updateSlideState(!0)},this.mq.addEventListener?this.mq.addEventListener("change",this._onMQ):this.mq.addListener&&this.mq.addListener(this._onMQ);var e=Array.from(this.list.querySelectorAll("img"));e.forEach(function(i){if(!i.complete){var r=function(){t.rafUpdate(),t.setupCursorMode(),t.applyIOSScrollIndicatorMask(),t.applyListStyles(),t.updateSlideState(!0)};i.addEventListener("load",r,{once:!0}),i.addEventListener("error",r,{once:!0}),t.imgHandlers.push({img:i,onL:r,onE:r})}}),this.ro&&(this.ro.observe(this.list),this.ro.observe(this.scroller),this.scrollTrack&&this.ro.observe(this.scrollTrack)),this._onPH=this.destroy.bind(this),window.addEventListener("pagehide",this._onPH),this._onBU=this.destroy.bind(this),window.addEventListener("beforeunload",this._onBU)},o.prototype.init=function(){this.captureBasePaddingBottomOnce(),this.applyIOSScrollIndicatorMask(),this.applyListStyles();var t=this;this.mq.matches&&F().then(function(){t.setupLenisInstance()}).catch(function(){}),this.rafUpdate(),this._onWL=function(){t.rafUpdate(),t.applyIOSScrollIndicatorMask(),t.applyListStyles(),t.updateSlideState(!0)},window.addEventListener("load",this._onWL),this.setupCursorMode(),this.bindEvents(),this.updateSlideState(!0)},o.prototype.destroy=function(){if(this.stopInertia(),this._touchClampTimer&&clearTimeout(this._touchClampTimer),this.lenis){try{D.remove(this.lenis)}catch(t){}try{this.lenis.destroy()}catch(t){}this.lenis=null}this._onScroll&&this.scroller.removeEventListener("scroll",this._onScroll),this._onResize&&window.removeEventListener("resize",this._onResize),this._onPD&&this.scroller.removeEventListener("pointerdown",this._onPD),this._onPM&&this.scroller.removeEventListener("pointermove",this._onPM),this._onPU&&this.scroller.removeEventListener("pointerup",this._onPU),this._onPC&&this.scroller.removeEventListener("pointercancel",this._onPC),this._onPL&&this.scroller.removeEventListener("pointerleave",this._onPL),this._onClickCap&&this.scroller.removeEventListener("click",this._onClickCap,!0),this._onPrev&&this.btnPrev&&this.btnPrev.removeEventListener("click",this._onPrev),this._onNext&&this.btnNext&&this.btnNext.removeEventListener("click",this._onNext),this.scrollTrack&&(this._onTPD&&this.scrollTrack.removeEventListener("pointerdown",this._onTPD),this._onTPM&&this.scrollTrack.removeEventListener("pointermove",this._onTPM),this._onTPU&&this.scrollTrack.removeEventListener("pointerup",this._onTPU),this._onTPC&&this.scrollTrack.removeEventListener("pointercancel",this._onTPC),this._onTPL&&this.scrollTrack.removeEventListener("pointerleave",this._onTPL)),this.mq.removeEventListener?this.mq.removeEventListener("change",this._onMQ):this.mq.removeListener&&this.mq.removeListener(this._onMQ),this._onWL&&window.removeEventListener("load",this._onWL),this._onPH&&window.removeEventListener("pagehide",this._onPH),this._onBU&&window.removeEventListener("beforeunload",this._onBU),this.imgHandlers.forEach(function(t){t.img.removeEventListener("load",t.onL),t.img.removeEventListener("error",t.onE)}),this.imgHandlers=[],this.clearCursorBindings(),this.scroller.style.cursor="",this.scroller.style.removeProperty("--rt-slider-mask-bg"),this.scroller.style.removeProperty("--rt-slider-mask-h"),this.scroller.style.removeProperty("--rt-slider-base-pb"),this.ro&&this.ro.disconnect(),this._injectedKey&&(U(this._injectedKey),this._injectedKey=null)};var d={instances:{},order:[]};function O(){for(var t=document.querySelectorAll("[data-rt-slider]"),e=0,i=0;i<t.length;i++){var r=t[i],s=r.getAttribute("data-rt-slider-id");if(s||(e++,s="slider-"+e,r.setAttribute("data-rt-slider-id",s)),!d.instances[s]){var n=new o(r,s);n.valid&&(d.instances[s]=n,d.order.push(s),n.init())}}}function J(){return{__initialized:!0,ids:function(){return d.order.slice()},get:function(t){return d.instances[t]||null},getSlideState:function(t){var e=d.instances[t];return e?e.getSlideState():null},refresh:function(){for(var t=d.order,e=0;e<t.length;e++){var i=d.instances[t[e]];i&&i.onResize()}},destroy:function(t){if(typeof t=="string"){var e=d.instances[t];if(e){e.destroy(),delete d.instances[t];var i=d.order.indexOf(t);i>-1&&d.order.splice(i,1)}return}for(var r=0;r<d.order.length;r++){var s=d.order[r];d.instances[s]&&d.instances[s].destroy()}d.instances={},d.order=[]}}}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",O):O(),window[I]=J()})();})();
|
|
1
|
+
/*! @rethink-js/rt-slider v1.2.1 | MIT */
|
|
2
|
+
(()=>{(function(){var w="rtSlider";if(window[w]&&window[w].__initialized)return;var _=null;function X(){return typeof window.Lenis!="undefined"?Promise.resolve():_||(_=new Promise(function(t,e){var i=document.querySelector('script[data-rt-slider-lenis="true"]')||document.querySelector('script[src*="lenis"]');if(i){if(typeof window.Lenis!="undefined"){t();return}i.addEventListener("load",function(){t()}),i.addEventListener("error",function(s){e(s)})}else{var r=document.createElement("script");r.src="https://cdn.jsdelivr.net/npm/lenis@1.3.16/dist/lenis.min.js",r.async=!0,r.setAttribute("data-rt-slider-lenis","true"),r.onload=function(){t()},r.onerror=function(s){e(s)},document.head.appendChild(r)}}),_)}var N=(function(){var t=new Set,e=0;function i(r){t.forEach(function(s){try{s.raf(r)}catch(n){}}),e=t.size?requestAnimationFrame(i):0}return{add:function(r){r&&(t.add(r),e||(e=requestAnimationFrame(i)))},remove:function(r){r&&(t.delete(r),!t.size&&e&&(cancelAnimationFrame(e),e=0))}}})();function z(){return"s"+Math.random().toString(36).slice(2)}function C(t,e){return t.getAttribute(e)||t.setAttribute(e,z()),t.getAttribute(e)}function U(t,e){var i=document.head.querySelector('[data-rt-slider-injected="'+t+'"]');return i||(i=document.createElement("style"),i.setAttribute("data-rt-slider-injected",t),document.head.appendChild(i)),i.textContent!==e&&(i.textContent=e),i}function G(t){var e=document.head.querySelector('[data-rt-slider-injected="'+t+'"]');e&&e.parentNode&&e.parentNode.removeChild(e)}function b(t){return typeof t=="string"?t.trim():""}function I(t,e){if(t==null)return e;var i=String(t).trim().toLowerCase();return i===""||i==="true"||i==="1"||i==="yes"||i==="y"||i==="on"?!0:i==="false"||i==="0"||i==="no"||i==="n"||i==="off"?!1:e}function A(t,e){if(t==null)return e;var i=String(t).trim();if(!i.length)return e;var r=Number(i);return Number.isFinite(r)?r:e}function B(t,e){if(t==null)return e;var i=String(t);return i.length?i:e}function m(t){return t<0?0:t>1?1:t}function p(t,e){if(!Number.isFinite(t))return 0;var i=Math.pow(10,e||0);return Math.round(t*i)/i}function H(t){var e=String(t||"").trim();if(!e)return null;var i={linear:function(r){return m(r)},easeInQuad:function(r){return r=m(r),r*r},easeOutQuad:function(r){return r=m(r),r*(2-r)},easeInOutQuad:function(r){return r=m(r),r<.5?2*r*r:1-Math.pow(-2*r+2,2)/2},easeInCubic:function(r){return r=m(r),r*r*r},easeOutCubic:function(r){return r=m(r),1-Math.pow(1-r,3)},easeInOutCubic:function(r){return r=m(r),r<.5?4*r*r*r:1-Math.pow(-2*r+2,3)/2},easeInOutSine:function(r){return r=m(r),-(Math.cos(Math.PI*r)-1)/2},easeOutExpo:function(r){return r=m(r),r===1?1:1-Math.pow(2,-10*r)}};return i[e]||null}function O(t){if(!t)return!0;var e=String(t).trim().toLowerCase();if(e==="transparent")return!0;if(e.startsWith("rgba(")){var i=e.slice(5,-1).split(",").map(function(s){return s.trim()}),r=i.length===4?Number(i[3]):1;return Number.isFinite(r)?r===0:!1}return!1}function j(t){for(var e=t;e&&e!==document.documentElement;){var i=getComputedStyle(e),r=i.backgroundColor;if(!O(r))return r;e=e.parentElement}var s=getComputedStyle(document.body).backgroundColor;return O(s)?"rgb(255, 255, 255)":s}function Q(t){if(!t)return!1;try{return t.scrollWidth>t.clientWidth+1}catch(e){return!1}}function K(t){for(var e=t;e&&e!==document.body;){var i=getComputedStyle(e),r=i.overflowX,s=r==="auto"||r==="scroll"||r==="overlay";if(s&&Q(e))return e;e=e.parentElement}return t}function T(t,e,i){if(!e)return null;var r=t.querySelector(e);if(r)return r;var s=document.querySelector(e+'[data-rt-slider-for="'+i+'"]');if(s)return s;var n=Array.from(document.querySelectorAll(e));if(n.length===1)return n[0];var a=n.filter(function(l){var h=l.closest("[data-rt-slider]");return h===t});return a.length===1?a[0]:null}function V(t){if(!t)return!1;var e=getComputedStyle(t);return e.display==="none"||e.visibility==="hidden"?!1:t.getClientRects().length>0}function J(t){return{list:b(t.getAttribute("data-rt-list")),item:b(t.getAttribute("data-rt-item")),spacer:b(t.getAttribute("data-rt-spacer")),btnPrev:b(t.getAttribute("data-rt-btn-prev")),btnNext:b(t.getAttribute("data-rt-btn-next")),scrollTrack:b(t.getAttribute("data-rt-scroll-track")),scrollBar:b(t.getAttribute("data-rt-scroll-bar")),marginRef:b(t.getAttribute("data-rt-margin-ref")),overlayStart:b(t.getAttribute("data-rt-overlay-start")),overlayEnd:b(t.getAttribute("data-rt-overlay-end"))}}function o(t,e){if(this.root=t,this.id=e,this.conf=J(t),this.valid=!!(this.conf.list&&this.conf.item),!!this.valid){if(this.sliderId=C(this.root,"data-rt-slider-id"),this.list=this.root.querySelector(this.conf.list),!this.list){this.valid=!1;return}this.list.style.overflowX="auto",this.list.style.webkitOverflowScrolling="touch",this.list.style.scrollbarWidth="none",this.list.style.msOverflowStyle="none",this.scroller=K(this.list),this.scroller.style.scrollbarWidth="none",this.scroller.style.msOverflowStyle="none";try{this.scroller.style.webkitOverflowScrolling="touch"}catch(r){}try{this.scroller.style.overscrollBehaviorX="contain"}catch(r){}this._basePaddingBottomPx=null,this._basePaddingCaptured=!1,this._touchClampTimer=0,this.btnPrev=this.conf.btnPrev?T(this.root,this.conf.btnPrev,this.sliderId):null,this.btnNext=this.conf.btnNext?T(this.root,this.conf.btnNext,this.sliderId):null,this.overlayStart=this.conf.overlayStart?T(this.root,this.conf.overlayStart,this.sliderId):null,this.overlayEnd=this.conf.overlayEnd?T(this.root,this.conf.overlayEnd,this.sliderId):null,this.overlayStart&&(this.overlayStart.style.transition="opacity 0.3s ease",this.overlayStart.style.willChange="opacity"),this.overlayEnd&&(this.overlayEnd.style.transition="opacity 0.3s ease",this.overlayEnd.style.willChange="opacity"),this.scrollTrack=this.conf.scrollTrack?this.root.querySelector(this.conf.scrollTrack):null,this.scrollBar=this.conf.scrollBar?this.root.querySelector(this.conf.scrollBar):null,this.firstItem=this.list.querySelector(this.conf.item+":first-child"),this.lastItem=this.list.querySelector(this.conf.item+":last-child"),this.dragging=!1,this.maybeDrag=!1,this.draggingBar=!1,this.barPointerId=null,this.barOffsetX=0,this.startX=0,this.startScroll=0,this.lastX=0,this.lastT=0,this.velocity=0,this.inertiaId=0,this.ticking=!1,this.didDrag=!1,this.didDragTs=0,this.dragMovedPx=0,this.cursorBindings=[],this.imgHandlers=[],this._roTicking=!1,this.lenis=null,this._lenisWasStopped=!1,this.mq=window.matchMedia("(hover: hover) and (pointer: fine)"),this._injectedKey=null,this._lastGutterPx=0,this._lastGapPx=0,this.slideState=null,this._slideStateSig="",this._progressSig="",this._lastSlideStateActiveIndex=-1,this._lastSlideStateScrollLeft=0;var i=this;this.ro=typeof ResizeObserver!="undefined"?new ResizeObserver(function(){i._roTicking||(i._roTicking=!0,requestAnimationFrame(function(){i._roTicking=!1,i.rafUpdate(),i.setupCursorMode(),i.applyIOSScrollIndicatorMask(),i.applyListStyles()}))}):null}}o.prototype.devicePixelEpsilon=function(){var t=Math.max(1,window.devicePixelRatio||1);return 1/t},o.prototype.scrollEdgeEpsilon=function(){return Math.max(2,this.devicePixelEpsilon()*4)},o.prototype.listGap=function(){var t=getComputedStyle(this.list),e=parseFloat(t.columnGap||"0")||0,i=parseFloat(t.gap||"0")||0;return Math.max(e,i)},o.prototype.pickVisibleMarginRef=function(){if(!this.conf.marginRef)return null;var t=this.root.querySelectorAll(this.conf.marginRef);t.length===0&&(t=document.querySelectorAll(this.conf.marginRef));for(var e=0;e<t.length;e++)if(V(t[e]))return t[e];return null},o.prototype.isFlex=function(){return getComputedStyle(this.list).display.indexOf("flex")!==-1},o.prototype.isGrid=function(){return getComputedStyle(this.list).display.indexOf("grid")!==-1},o.prototype.ensureSpacers=function(){var t=Array.from(this.list.children),e=this.conf.spacer?this.conf.spacer.replace(/^[.#]/,""):"awards-slider-spacer",i=!(t[0]&&t[0].classList&&t[0].classList.contains(e)),r=!(t[t.length-1]&&t[t.length-1].classList&&t[t.length-1].classList.contains(e));if(i){var s=document.createElement("div");s.className=e,s.setAttribute("aria-hidden","true"),s.style.pointerEvents="none",s.style.height="1px",s.style.minHeight="1px",this.isFlex()&&(s.style.flex="0 0 auto"),this.list.insertBefore(s,this.list.firstChild)}if(r){var n=document.createElement("div");n.className=e,n.setAttribute("aria-hidden","true"),n.style.pointerEvents="none",n.style.height="1px",n.style.minHeight="1px",this.isFlex()&&(n.style.flex="0 0 auto"),this.list.appendChild(n)}},o.prototype.resetEdgeItemMargins=function(){this.firstItem&&(this.firstItem.style.marginLeft="0px"),this.lastItem&&(this.lastItem.style.marginRight="0px")},o.prototype.updateSpacers=function(){this.ensureSpacers(),this.resetEdgeItemMargins();var t=Array.from(this.list.children),e=this.conf.spacer?this.conf.spacer.replace(/^[.#]/,""):"awards-slider-spacer",i=t[0]&&t[0].classList.contains(e)?t[0]:null,r=t[t.length-1]&&t[t.length-1].classList.contains(e)?t[t.length-1]:null;if(!(!i||!r)){var s=this.pickVisibleMarginRef(),n=this.devicePixelEpsilon(),a=this.listGap();if(this._lastGapPx=a,i.style.marginRight="",r.style.marginLeft="",a>1e-4&&(i.style.marginRight="-"+a+"px",r.style.marginLeft="-"+a+"px"),!s){i.style.width=n+"px",r.style.width=n+"px",this._lastGutterPx=n;return}var l=this.scroller.getBoundingClientRect(),h=s.getBoundingClientRect(),c=getComputedStyle(this.scroller),u=getComputedStyle(this.list),x=parseFloat(c.borderLeftWidth||"0")||0,v=parseFloat(c.paddingLeft||"0")||0,P=parseFloat(u.paddingLeft||"0")||0,L=l.left+x+v,y=h.left,f=y-L-P,S=f<=0?n:Math.round(f);i.style.width=S+"px",r.style.width=S+"px",this.isGrid()&&(i.style.justifySelf="start",r.style.justifySelf="start",i.style.gridColumn="auto",r.style.gridColumn="auto"),this._lastGutterPx=S}},o.prototype.maxScroll=function(){return Math.max(0,this.scroller.scrollWidth-this.scroller.clientWidth)},o.prototype.getLiveScrollMetrics=function(){var t=Math.max(0,this.scroller.scrollWidth||0),e=Math.max(0,this.scroller.clientWidth||0),i=Math.max(0,t-e),r=this.safeClampScroll(this.scroller.scrollLeft),s=this.scrollEdgeEpsilon();if(i<=0||t<=e+s)return{current:0,max:0,progress:0,progressPercent:0,isAtStart:!0,isAtEnd:!0};var n=r<=s,a=r>=i-s||r+e>=t-s;n&&(r=0),a&&(r=i);var l=i>0?m(r/i):0;return a&&(l=1),n&&(l=0),{current:r,max:i,progress:l,progressPercent:l*100,isAtStart:n,isAtEnd:a}},o.prototype.updateOverlays=function(){if(!this.overlayStart&&!this.overlayEnd)return;var t=this.scroller.scrollWidth,e=this.scroller.clientWidth,i=t>e+1;function r(n,a){n&&(n.style.opacity=a?"1":"0",n.style.pointerEvents=a?"":"none")}if(!i){r(this.overlayStart,!1),r(this.overlayEnd,!1);return}var s=this.getLiveScrollMetrics();r(this.overlayStart,!s.isAtStart),r(this.overlayEnd,!s.isAtEnd)},o.prototype.updateButtons=function(){if(!(!this.btnPrev&&!this.btnNext)){var t=this.scroller.scrollWidth,e=this.scroller.clientWidth,i=t>e+1;if(!i){this.btnPrev&&(this.btnPrev.classList.add("inactive"),this.btnPrev.style.display="none"),this.btnNext&&(this.btnNext.classList.add("inactive"),this.btnNext.style.display="none");return}this.btnPrev&&(this.btnPrev.style.display=""),this.btnNext&&(this.btnNext.style.display="");var r=this.getLiveScrollMetrics();this.btnPrev&&(r.isAtStart?this.btnPrev.classList.add("inactive"):this.btnPrev.classList.remove("inactive")),this.btnNext&&(r.isAtEnd?this.btnNext.classList.add("inactive"):this.btnNext.classList.remove("inactive"))}},o.prototype.computeScrollbarMetrics=function(){if(!this.scrollTrack||!this.scrollBar)return null;var t=this.scroller.scrollWidth,e=this.scroller.clientWidth,i=this.list.querySelectorAll(this.conf.item).length;if(t<=e||i===0)return null;var r=this.scrollTrack.clientWidth,s=t/Math.max(1,i+2),n=Math.max(1,Math.round(e/s)),a=Math.max(8,n/(i+2)*r),l=this.getLiveScrollMetrics(),h=Math.max(1,l.max),c=Math.max(0,r-a),u=c*l.progress;return{trackWidth:r,barWidth:a,maxS:h,maxX:c,x:u}},o.prototype.updateScrollbar=function(){if(!(!this.scrollTrack||!this.scrollBar)){var t=this.computeScrollbarMetrics();if(!t){this.scrollTrack.style.display="none";return}this.scrollTrack.style.display="",this.scrollBar.style.width=t.barWidth+"px",this.draggingBar||(this.scrollBar.style.transform="translateX("+t.x+"px)")}},o.prototype.rafUpdate=function(){this.updateSpacers(),this.updateScrollbar(),this.updateButtons(),this.updateOverlays(),this.updateSlideState(!1)},o.prototype.safeClampScroll=function(t){var e=Math.min(Math.max(t,0),this.maxScroll());return Number.isFinite(e)?e:0},o.prototype.setScroll=function(t,e){var i=this.safeClampScroll(t);if(this.lenis){var r=e||{};try{this.lenis.scrollTo(i,{immediate:!!r.immediate,lock:!!r.lock,force:r.force!==!1})}catch(s){this.scroller.scrollLeft=i}}else this.scroller.scrollLeft=i;this.updateScrollbar(),this.updateButtons(),this.updateOverlays(),this.updateSlideState(!1)},o.prototype.scheduleTouchClamp=function(){var t=this;this._touchClampTimer&&clearTimeout(this._touchClampTimer),this._touchClampTimer=setTimeout(function(){t._touchClampTimer=0;var e=t.scroller.scrollLeft,i=t.maxScroll(),r=Math.max(0,t.scroller.clientWidth||0),s=Math.max(0,t.scroller.scrollWidth||0),n=t.scrollEdgeEpsilon();Number.isFinite(e)?e<-n||e>i+n?t.scroller.scrollLeft=t.safeClampScroll(e):e<0?t.scroller.scrollLeft=0:e>i?t.scroller.scrollLeft=i:e<=n?t.scroller.scrollLeft=0:e+r>=s-n&&(t.scroller.scrollLeft=i):t.scroller.scrollLeft=0,t.updateScrollbar(),t.updateButtons(),t.updateOverlays(),t.updateSlideState(!1)},90)},o.prototype.onScroll=function(){var t=this;if(!this.mq.matches){this.updateScrollbar(),this.updateButtons(),this.updateOverlays(),this.updateSlideState(!1),this.scheduleTouchClamp();return}this.ticking||(this.ticking=!0,requestAnimationFrame(function(){var e=t.safeClampScroll(t.scroller.scrollLeft);e!==t.scroller.scrollLeft&&(t.lenis?t.setScroll(e,{immediate:!0,lock:!1,force:!0}):t.scroller.scrollLeft=e),t.updateScrollbar(),t.updateButtons(),t.updateOverlays(),t.updateSlideState(!1),t.ticking=!1}))},o.prototype.itemStepWidth=function(){if(!this.conf.item)return Math.max(1,Math.floor(this.scroller.clientWidth*.9));var t=this.list.querySelector(this.conf.item);if(!t)return Math.max(1,Math.floor(this.scroller.clientWidth*.9));var e=getComputedStyle(t),i=t.getBoundingClientRect().width,r=parseFloat(e.marginRight)||0;return Math.max(1,Math.round(i+r))},o.prototype.getAlignTargetLeft=function(){var t=this.pickVisibleMarginRef();if(t)return t.getBoundingClientRect().left;var e=this.scroller.getBoundingClientRect(),i=getComputedStyle(this.scroller),r=getComputedStyle(this.list),s=parseFloat(i.borderLeftWidth||"0")||0,n=parseFloat(i.paddingLeft||"0")||0,a=parseFloat(r.paddingLeft||"0")||0,l=Number.isFinite(this._lastGutterPx)?this._lastGutterPx:0;return e.left+s+n+a+l},o.prototype.getOrderedItems=function(){if(!this.conf.item)return[];var t=Array.from(this.list.querySelectorAll(this.conf.item));return t.filter(function(e){return e&&e.nodeType===1})},o.prototype.getCurrentItemIndex=function(t){if(!t||!t.length)return-1;for(var e=this.getAlignTargetLeft(),i=0,r=1/0,s=0;s<t.length;s++){var n=t[s].getBoundingClientRect(),a=n.left-e,l=Math.abs(a);l<r&&(r=l,i=s)}return i},o.prototype.getItemAnchorScrolls=function(t){for(var e=this.getLiveScrollMetrics(),i=e.current,r=this.getAlignTargetLeft(),s=[],n=-1/0,a=0;a<t.length;a++){var l=t[a];l.setAttribute("data-rt-slider-item-index",String(a));var h=l.getBoundingClientRect(),c=i+(h.left-r),u=this.safeClampScroll(c);u<n&&(u=n),s.push(u),n=u}if(s.length){var x=this.maxScroll(),v=this.scrollEdgeEpsilon();s[0]<=v&&(s[0]=0),s[s.length-1]>=x-v&&(s[s.length-1]=x)}return s},o.prototype.cloneSlideState=function(t){return t?{sliderId:t.sliderId,itemCount:t.itemCount,scroll:{current:t.scroll.current,max:t.scroll.max,progress:t.scroll.progress,progressPercent:t.scroll.progressPercent,direction:t.scroll.direction,isAtStart:t.scroll.isAtStart,isAtEnd:t.scroll.isAtEnd},active:{index:t.active.index,element:t.active.element,anchorScrollLeft:t.active.anchorScrollLeft,distancePx:t.active.distancePx},previous:{index:t.previous.index,element:t.previous.element},next:{index:t.next.index,element:t.next.element},segment:{fromIndex:t.segment.fromIndex,fromElement:t.segment.fromElement,toIndex:t.segment.toIndex,toElement:t.segment.toElement,progress:t.segment.progress,progressPercent:t.segment.progressPercent,distancePx:t.segment.distancePx,spanPx:t.segment.spanPx,remainingPx:t.segment.remainingPx,isBetween:t.segment.isBetween},slides:t.slides.map(function(e){return{index:e.index,element:e.element,anchorScrollLeft:e.anchorScrollLeft,anchorProgress:e.anchorProgress,anchorProgressPercent:e.anchorProgressPercent,distanceFromCurrentPx:e.distanceFromCurrentPx,isActive:e.isActive,isPrevious:e.isPrevious,isNext:e.isNext,isFrom:e.isFrom,isTo:e.isTo,isBeforeActive:e.isBeforeActive,isAfterActive:e.isAfterActive}})}:null},o.prototype.cloneScrollState=function(t){return t?{current:t.current,max:t.max,progress:t.progress,progressPercent:t.progressPercent,direction:t.direction,isAtStart:t.isAtStart,isAtEnd:t.isAtEnd}:null},o.prototype.dispatchSliderEvent=function(t,e){var i=this.cloneSlideState(e);try{this.root.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:i}))}catch(s){var r=document.createEvent("CustomEvent");r.initCustomEvent(t,!0,!1,i),this.root.dispatchEvent(r)}},o.prototype.dispatchProgressEvent=function(t,e){var i=this.cloneScrollState(e);try{this.root.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:i}))}catch(s){var r=document.createEvent("CustomEvent");r.initCustomEvent(t,!0,!1,i),this.root.dispatchEvent(r)}},o.prototype.applySlideStateAttributes=function(t){var e=this.root;e.setAttribute("data-rt-slider-active-index",String(t.active.index)),e.setAttribute("data-rt-slider-from-index",String(t.segment.fromIndex)),e.setAttribute("data-rt-slider-to-index",String(t.segment.toIndex)),e.setAttribute("data-rt-slider-segment-progress",String(p(t.segment.progress,6))),e.setAttribute("data-rt-slider-segment-progress-percent",String(p(t.segment.progressPercent,4))),e.setAttribute("data-rt-slider-scroll-current",String(p(t.scroll.current,4))),e.setAttribute("data-rt-slider-scroll-max",String(p(t.scroll.max,4))),e.setAttribute("data-rt-slider-scroll-progress",String(p(t.scroll.progress,6))),e.setAttribute("data-rt-slider-scroll-progress-percent",String(p(t.scroll.progressPercent,4))),e.setAttribute("data-rt-slider-scroll-direction",t.scroll.direction),e.setAttribute("data-rt-slider-scroll-at-start",t.scroll.isAtStart?"true":"false"),e.setAttribute("data-rt-slider-scroll-at-end",t.scroll.isAtEnd?"true":"false");for(var i=0;i<t.slides.length;i++){var r=t.slides[i],s=r.element;s&&(s.setAttribute("data-rt-slider-item-index",String(r.index)),s.setAttribute("data-rt-slider-item-active",r.isActive?"true":"false"),s.setAttribute("data-rt-slider-item-from",r.isFrom?"true":"false"),s.setAttribute("data-rt-slider-item-to",r.isTo?"true":"false"),s.setAttribute("data-rt-slider-item-previous",r.isPrevious?"true":"false"),s.setAttribute("data-rt-slider-item-next",r.isNext?"true":"false"),s.setAttribute("data-rt-slider-item-before-active",r.isBeforeActive?"true":"false"),s.setAttribute("data-rt-slider-item-after-active",r.isAfterActive?"true":"false"),s.setAttribute("data-rt-slider-item-anchor-progress",String(p(r.anchorProgress,6))),s.setAttribute("data-rt-slider-item-anchor-progress-percent",String(p(r.anchorProgressPercent,4))),s.setAttribute("data-rt-slider-item-distance",String(p(r.distanceFromCurrentPx,4))))}},o.prototype.buildSlideState=function(){var t=this.getOrderedItems(),e=this.getLiveScrollMetrics(),i=e.max,r=e.current,s=this._lastSlideStateScrollLeft,n="none";if(r>s+.01?n="forward":r<s-.01&&(n="backward"),!t.length)return{sliderId:this.sliderId,itemCount:0,scroll:{current:r,max:i,progress:e.progress,progressPercent:e.progressPercent,direction:n,isAtStart:e.isAtStart,isAtEnd:e.isAtEnd},active:{index:-1,element:null,anchorScrollLeft:0,distancePx:0},previous:{index:-1,element:null},next:{index:-1,element:null},segment:{fromIndex:-1,fromElement:null,toIndex:-1,toElement:null,progress:0,progressPercent:0,distancePx:0,spanPx:0,remainingPx:0,isBetween:!1},slides:[]};for(var a=this.getItemAnchorScrolls(t),l=0,h=1/0,c=0;c<a.length;c++){var u=r-a[c],x=Math.abs(u);x<h&&(h=x,l=c)}var v=0,P=0,L=0,y=0,f=0,S=0,E=!1;if(r<=a[0])v=0,P=0,L=0,y=0,f=0,S=0,E=!1;else if(r>=a[a.length-1])v=a.length-1,P=a.length-1,L=1,y=0,f=0,S=0,E=!1;else for(var k=0;k<a.length-1;k++){var M=a[k],W=a[k+1];if(r>=M&&r<=W){v=k,P=k+1,f=Math.max(0,W-M),y=Math.max(0,r-M),L=f>0?m(y/f):0,S=Math.max(0,f-y),E=r>M&&r<W;break}}for(var q=[],g=0;g<t.length;g++){var D=a[g],F=i>0?m(D/i):0;q.push({index:g,element:t[g],anchorScrollLeft:D,anchorProgress:F,anchorProgressPercent:F*100,distanceFromCurrentPx:r-D,isActive:g===l,isPrevious:g===l-1,isNext:g===l+1,isFrom:g===v,isTo:g===P,isBeforeActive:g<l,isAfterActive:g>l})}return{sliderId:this.sliderId,itemCount:t.length,scroll:{current:r,max:i,progress:e.progress,progressPercent:e.progressPercent,direction:n,isAtStart:e.isAtStart,isAtEnd:e.isAtEnd},active:{index:l,element:t[l]||null,anchorScrollLeft:a[l]||0,distancePx:r-(a[l]||0)},previous:{index:l>0?l-1:-1,element:l>0?t[l-1]:null},next:{index:l<t.length-1?l+1:-1,element:l<t.length-1?t[l+1]:null},segment:{fromIndex:v,fromElement:t[v]||null,toIndex:P,toElement:t[P]||null,progress:L,progressPercent:L*100,distancePx:y,spanPx:f,remainingPx:S,isBetween:E},slides:q}},o.prototype.updateSlideState=function(t){var e=this.buildSlideState(),i=this._lastSlideStateActiveIndex,r=e.active.index+"|"+e.segment.fromIndex+"|"+e.segment.toIndex+"|"+p(e.segment.progress,4)+"|"+p(e.scroll.progress,4)+"|"+e.scroll.direction,s=p(e.scroll.progress,6)+"|"+p(e.scroll.current,4)+"|"+p(e.scroll.max,4)+"|"+e.scroll.direction+"|"+(e.scroll.isAtStart?"1":"0")+"|"+(e.scroll.isAtEnd?"1":"0");this.slideState=e,this.applySlideStateAttributes(e),this._lastSlideStateScrollLeft=e.scroll.current,(t||s!==this._progressSig)&&(this._progressSig=s,this.dispatchProgressEvent("rtSlider:progress",e.scroll)),(t||r!==this._slideStateSig)&&(this._slideStateSig=r,this.dispatchSliderEvent("rtSlider:slide",e)),(t||e.active.index!==i)&&(this._lastSlideStateActiveIndex=e.active.index,this.dispatchSliderEvent("rtSlider:active",e))},o.prototype.getSlideState=function(){return this.slideState||this.updateSlideState(!0),this.cloneSlideState(this.slideState)},o.prototype.getScrollState=function(){var t=this.getSlideState();return t?this.cloneScrollState(t.scroll):null},o.prototype.getProgress=function(){var t=this.getScrollState();return t?t.progress:0},o.prototype.getActiveIndex=function(){var t=this.getSlideState();return t&&t.active?t.active.index:-1},o.prototype.getActiveElement=function(){var t=this.getSlideState();return t&&t.active?t.active.element:null},o.prototype.scrollAlignToItem=function(t){if(t){var e=this.scroller.scrollWidth,i=this.scroller.clientWidth;if(!(e<=i+1)){var r=this.getAlignTargetLeft(),s=t.getBoundingClientRect(),n=s.left-r;if(Number.isFinite(n)){var a=this.safeClampScroll(this.scroller.scrollLeft+n);if(this.lenis){var l=1.2;try{this.lenis.scrollTo(a,{duration:l,easing:function(h){return Math.min(1,1.001-Math.pow(2,-10*h))},immediate:!1,lock:!1,force:!0})}catch(h){this.scroller.scrollTo({left:a,behavior:"smooth"})}}else this.scroller.scrollTo({left:a,behavior:"smooth"})}}}},o.prototype.scrollByItems=function(t){var e=this.scroller.scrollWidth,i=this.scroller.clientWidth;if(!(e<=i+1)){var r=this.getOrderedItems();if(!r.length){var s=this.itemStepWidth(),n=t>0?this.scroller.scrollLeft+s*t:this.scroller.scrollLeft-s*Math.abs(t),a=this.safeClampScroll(n);if(this.lenis)try{this.lenis.scrollTo(a,{duration:1.2,easing:function(c){return Math.min(1,1.001-Math.pow(2,-10*c))},immediate:!1,lock:!1,force:!0})}catch(c){this.scroller.scrollTo({left:a,behavior:"smooth"})}else this.scroller.scrollTo({left:a,behavior:"smooth"});return}var l=this.getCurrentItemIndex(r);l<0&&(l=0);var h=l;t>0?h=Math.min(r.length-1,l+1):t<0&&(h=Math.max(0,l-1)),this.scrollAlignToItem(r[h])}},o.prototype.onPrevClick=function(t){t.preventDefault(),this.scrollByItems(-1)},o.prototype.onNextClick=function(t){t.preventDefault(),this.scrollByItems(1)},o.prototype.stopInertia=function(){this.inertiaId&&(cancelAnimationFrame(this.inertiaId),this.inertiaId=0)},o.prototype.startDrag=function(t){if(!this.dragging){if(this.dragging=!0,this.didDrag=!0,this.didDragTs=performance.now(),this.dragMovedPx=Math.max(this.dragMovedPx,Math.abs(t.clientX-this.startX)),this.lenis)try{this.lenis.stop(),this._lenisWasStopped=!0}catch(e){this._lenisWasStopped=!1}try{this.scroller.setPointerCapture(t.pointerId)}catch(e){}this.scroller.classList.add("is-dragging"),this.scroller.style.userSelect="none",this.stopInertia(),this.lastX=t.clientX,this.lastT=performance.now(),this.velocity=0}},o.prototype.endDrag=function(t){if(this.dragging){if(this.dragging=!1,this.scroller.classList.remove("is-dragging"),this.scroller.style.userSelect="",t&&t.pointerId!=null)try{this.scroller.releasePointerCapture(t.pointerId)}catch(c){}var e=.2;if(this.lenis){if(this._lenisWasStopped)try{this.lenis.start()}catch(c){}if(this._lenisWasStopped=!1,Math.abs(this.velocity)>=e){var i=this.velocity*24,r=this.safeClampScroll(this.scroller.scrollLeft+i),s=Math.min(2,Math.max(.35,Math.abs(this.velocity)/18)),n=Math.min(1.35,Math.max(.35,.85/s));try{this.lenis.scrollTo(r,{duration:n,easing:function(c){return Math.min(1,1.001-Math.pow(2,-10*c))},immediate:!1,lock:!1,force:!0})}catch(c){this.scroller.scrollTo({left:r,behavior:"smooth"})}}return}var a=.92,l=this,h=function(){var c=l.safeClampScroll(l.scroller.scrollLeft+l.velocity);l.scroller.scrollLeft=c,l.velocity*=a;var u=c<=0||c>=l.maxScroll();if(Math.abs(l.velocity)<e||u){l.inertiaId=0;return}l.inertiaId=requestAnimationFrame(h)};Math.abs(this.velocity)>=e&&(this.inertiaId=requestAnimationFrame(h))}},o.prototype.onPointerDown=function(t){var e=this.scroller.scrollWidth,i=this.scroller.clientWidth;e<=i+1||t.pointerType==="mouse"&&t.button!==0||(this.maybeDrag=!0,this.dragging=!1,this.didDrag=!1,this.didDragTs=0,this.dragMovedPx=0,this.startX=t.clientX,this.startScroll=this.scroller.scrollLeft,this.lastX=t.clientX,this.lastT=performance.now(),this.velocity=0)},o.prototype.onPointerMove=function(t){if(!(!this.maybeDrag&&!this.dragging)){var e=t.clientX-this.startX;if(this.dragMovedPx=Math.max(this.dragMovedPx,Math.abs(e)),!this.dragging)if(Math.abs(e)>=6)this.startDrag(t);else return;var i=performance.now(),r=t.clientX-this.lastX,s=Math.max(1,i-this.lastT),n=this.startScroll-(t.clientX-this.startX);this.setScroll(n,{immediate:!0,lock:!0,force:!0}),this.velocity=-(r/s)*16,this.lastX=t.clientX,this.lastT=i}},o.prototype.onPointerUp=function(t){var e=this;this.dragging&&this.endDrag(t),this.maybeDrag=!1,this.dragMovedPx<6?(this.didDrag=!1,this.didDragTs=0):(this.didDrag=!0,this.didDragTs=performance.now()),setTimeout(function(){e.didDrag=!1,e.didDragTs=0,e.dragMovedPx=0},420)},o.prototype.onPointerCancel=function(){var t=this;if(this.dragging){if(this.dragging=!1,this.scroller.classList.remove("is-dragging"),this.scroller.style.userSelect="",this.stopInertia(),this.lenis&&this._lenisWasStopped)try{this.lenis.start()}catch(e){}this._lenisWasStopped=!1}this.maybeDrag=!1,setTimeout(function(){t.didDrag=!1,t.didDragTs=0,t.dragMovedPx=0},0)},o.prototype.trackMetrics=function(){if(!this.scrollTrack||!this.scrollBar)return{trackWidth:0,barWidth:0,maxX:0,m:Math.max(1,this.maxScroll())};var t=this.scrollTrack.clientWidth,e=Math.max(1,this.maxScroll()),i=0,r=this.computeScrollbarMetrics();r?i=r.barWidth:i=this.scrollBar.getBoundingClientRect().width||0;var s=Math.max(0,t-i);return{trackWidth:t,barWidth:i,maxX:s,m:e}},o.prototype.setScrollFromTrackX=function(t,e){var i=this.trackMetrics(),r=Math.min(Math.max(t,0),i.maxX);this.scrollBar&&(this.scrollBar.style.transform="translateX("+r+"px)");var s=i.maxX===0?0:r/i.maxX,n=s*i.m;this.setScroll(n,e||{immediate:!0,lock:!0,force:!0})},o.prototype.startBarDrag=function(t){if(!(!this.scrollTrack||!this.scrollBar)&&!(t.pointerType==="mouse"&&t.button!==0)){if(t.preventDefault(),t.stopPropagation(),this.lenis)try{this.lenis.stop(),this._lenisWasStopped=!0}catch(s){this._lenisWasStopped=!1}this.draggingBar=!0,this.barPointerId=t.pointerId!=null?t.pointerId:null;var e=this.scrollBar.getBoundingClientRect();this.barOffsetX=t.clientX-e.left,this.scrollBar.style.cursor="grabbing",this.scrollTrack.style.cursor="grabbing";try{this.scrollTrack.setPointerCapture(t.pointerId)}catch(s){}var i=this.scrollTrack.getBoundingClientRect(),r=t.clientX-i.left-this.barOffsetX;this.setScrollFromTrackX(r,{immediate:!0,lock:!0,force:!0})}},o.prototype.onTrackPointerDown=function(t){!this.scrollTrack||!this.scrollBar||(this.updateScrollbar(),this.startBarDrag(t))},o.prototype.onTrackPointerMove=function(t){if(!(!this.draggingBar||!this.scrollTrack)&&!(this.barPointerId!=null&&t.pointerId!=null&&t.pointerId!==this.barPointerId)){t.preventDefault();var e=this.scrollTrack.getBoundingClientRect(),i=t.clientX-e.left-this.barOffsetX;this.setScrollFromTrackX(i,{immediate:!0,lock:!0,force:!0})}},o.prototype.endBarDrag=function(t){if(this.draggingBar){if(this.draggingBar=!1,this.scrollBar&&(this.scrollBar.style.cursor="grab"),this.scrollTrack&&(this.scrollTrack.style.cursor="pointer"),this.scrollTrack&&t&&t.pointerId!=null)try{this.scrollTrack.releasePointerCapture(t.pointerId)}catch(e){}if(this.lenis&&this._lenisWasStopped)try{this.lenis.start()}catch(e){}this._lenisWasStopped=!1,this.updateScrollbar(),this.updateButtons(),this.updateOverlays(),this.updateSlideState(!1),this.barPointerId=null}},o.prototype.detectLinksInItems=function(){return this.conf.item?!!this.list.querySelector(this.conf.item+" a[href]"):!1},o.prototype.clearCursorBindings=function(){for(var t=0;t<this.cursorBindings.length;t++){var e=this.cursorBindings[t];e.el.removeEventListener(e.type,e.fn)}this.cursorBindings=[]},o.prototype.setupCursorMode=function(){this.clearCursorBindings();var t=this.scroller.scrollWidth,e=this.scroller.clientWidth,i=t>e+1;if(!i){this.scroller.style.cursor="";return}if(!this.mq.matches){this.scroller.style.cursor="";return}if(this.hasLinks=this.detectLinksInItems(),this.hasLinks){this.scroller.style.cursor="";return}var r=this,s=function(){r.scroller.classList.contains("is-dragging")||(r.scroller.style.cursor="grab")},n=function(){r.scroller.style.cursor=""};this.scroller.addEventListener("mouseenter",s),this.scroller.addEventListener("mouseleave",n),this.cursorBindings.push({el:this.scroller,type:"mouseenter",fn:s}),this.cursorBindings.push({el:this.scroller,type:"mouseleave",fn:n})},o.prototype.captureBasePaddingBottomOnce=function(){if(!this._basePaddingCaptured){var t=getComputedStyle(this.scroller),e=parseFloat(t.paddingBottom||"0")||0;this._basePaddingBottomPx=e,this._basePaddingCaptured=!0}},o.prototype.applyIOSScrollIndicatorMask=function(){if(this._basePaddingCaptured||this.captureBasePaddingBottomOnce(),this.mq.matches){this.scroller.style.removeProperty("--rt-slider-mask-bg"),this.scroller.style.removeProperty("--rt-slider-mask-h"),this.scroller.style.removeProperty("--rt-slider-base-pb");return}var t=j(this.scroller);this.scroller.style.setProperty("--rt-slider-mask-bg",t),this.scroller.style.setProperty("--rt-slider-mask-h","12px"),this.scroller.style.setProperty("--rt-slider-base-pb",(this._basePaddingBottomPx||0)+"px")},o.prototype.applyListStyles=function(){var t=C(this.list,"data-rt-slider-list-uid"),e=C(this.scroller,"data-rt-slider-scroller-uid"),i=this.mq.matches,r="";if(this.scrollTrack&&this.scrollBar){var s=C(this.scrollTrack,"data-rt-slider-track-uid"),n=C(this.scrollBar,"data-rt-slider-bar-uid");i?r='[data-rt-slider-track-uid="'+s+'"]{position:relative; touch-action:none; overflow: visible !important;}[data-rt-slider-track-uid="'+s+'"]::before{content:"";position:absolute;top:-30px;bottom:-30px;left:0;right:0;z-index:0; cursor:pointer; pointer-events:auto;}[data-rt-slider-bar-uid="'+n+'"]{position:relative; z-index:2; touch-action:none;}[data-rt-slider-bar-uid="'+n+'"]::after{content:"";position:absolute;top:-30px;bottom:-30px;left:0;right:0;z-index:3; cursor:grab; pointer-events:auto;}':r='[data-rt-slider-track-uid="'+s+'"]{position:relative; touch-action:auto; overflow: visible !important; pointer-events:none !important; user-select:none !important;}[data-rt-slider-track-uid="'+s+'"]::before{content:"";position:absolute;top:-30px;bottom:-30px;left:0;right:0;z-index:0; pointer-events:none !important;}[data-rt-slider-bar-uid="'+n+'"]{position:relative; z-index:2; touch-action:auto; pointer-events:none !important; user-select:none !important;}[data-rt-slider-bar-uid="'+n+'"]::after{content:"";position:absolute;top:-30px;bottom:-30px;left:0;right:0;z-index:3; pointer-events:none !important;}'}var a='[data-rt-slider-list-uid="'+t+'"]::-webkit-scrollbar{width:0 !important;height:0 !important;display:none !important;background:transparent !important;}[data-rt-slider-list-uid="'+t+'"]::-webkit-scrollbar-thumb{background:transparent !important;}[data-rt-slider-list-uid="'+t+'"]::-webkit-scrollbar-track{background:transparent !important;}[data-rt-slider-list-uid="'+t+'"]{scrollbar-width:none !important;-ms-overflow-style:none !important;}[data-rt-slider-scroller-uid="'+e+'"]::-webkit-scrollbar{width:0 !important;height:0 !important;display:none !important;background:transparent !important;}[data-rt-slider-scroller-uid="'+e+'"]::-webkit-scrollbar-thumb{background:transparent !important;}[data-rt-slider-scroller-uid="'+e+'"]::-webkit-scrollbar-track{background:transparent !important;}[data-rt-slider-scroller-uid="'+e+'"]{scrollbar-width:none !important;-ms-overflow-style:none !important;}',l=i?"":'[data-rt-slider-scroller-uid="'+e+'"]{position:relative;padding-bottom:calc(var(--rt-slider-base-pb, 0px) + var(--rt-slider-mask-h, 12px));}[data-rt-slider-scroller-uid="'+e+'"]::after{content:"";position:absolute;left:0;right:0;bottom:0;height:var(--rt-slider-mask-h, 12px);pointer-events:none;z-index:2147483647;background:var(--rt-slider-mask-bg, transparent);}',h='[data-rt-slider-scroller-uid="'+e+'"].is-dragging{cursor:grabbing !important;user-select:none}[data-rt-slider-list-uid="'+t+'"].is-dragging{cursor:grabbing !important;user-select:none}[data-rt-slider-scroller-uid="'+e+'"].is-dragging img,[data-rt-slider-scroller-uid="'+e+'"].is-dragging a,[data-rt-slider-scroller-uid="'+e+'"].is-dragging '+this.conf.item+'{user-select:none;-webkit-user-drag:none}[data-rt-slider-list-uid="'+t+'"] img{-webkit-user-drag:none}';this._injectedKey="rt-ss-"+t,U(this._injectedKey,a+h+r+l)},o.prototype.onResize=function(){this.stopInertia(),this.rafUpdate(),this.setupCursorMode(),this.applyIOSScrollIndicatorMask(),this.applyListStyles(),this.updateSlideState(!0)},o.prototype.onClickCapture=function(t){if(this.didDragTs&&!(performance.now()-this.didDragTs>420)){var e=t.target&&t.target.closest?t.target.closest("a,button,[role='button'],input,textarea,select,label"):null;e&&(t.preventDefault(),t.stopPropagation())}},o.prototype.getLenisOptions=function(){var t="data-rt-slider-",e=this.root;function i(E){return e.getAttribute(t+E)}var r={wrapper:this.scroller,content:this.list,orientation:"horizontal",gestureOrientation:"horizontal",smoothWheel:!0,syncTouch:!1},s=A(i("lerp"),void 0),n=A(i("duration"),void 0),a=B(i("easing"),""),l=H(a);s!==void 0?r.lerp=s:n!==void 0&&(r.duration=n),l&&(r.easing=l);var h=B(i("orientation"),"");h&&(r.orientation=h);var c=B(i("gesture-orientation"),"");c&&(r.gestureOrientation=c);var u=i("smooth-wheel");u!==null&&(r.smoothWheel=I(u,!0));var x=A(i("wheel-multiplier"),void 0);x!==void 0&&(r.wheelMultiplier=x);var v=A(i("touch-multiplier"),void 0);v!==void 0&&(r.touchMultiplier=v);var P=I(i("infinite"),!1);P&&(r.infinite=!0);var L=I(i("auto-resize"),!0);L===!1&&(r.autoResize=!1);var y=i("options-json");if(y)try{var f=JSON.parse(y);if(f&&typeof f=="object")for(var S in f)r[S]=f[S]}catch(E){}return r},o.prototype.setupLenisInstance=function(){if(this.mq.matches&&!this.lenis){var t=this.getLenisOptions();try{this.lenis=new window.Lenis(t),N.add(this.lenis)}catch(e){this.lenis=null}}},o.prototype.bindEvents=function(){this._onScroll=this.onScroll.bind(this),this.scroller.addEventListener("scroll",this._onScroll,{passive:!0}),this._onResize=this.onResize.bind(this),window.addEventListener("resize",this._onResize),this.mq.matches&&(this._onPD=this.onPointerDown.bind(this),this.scroller.addEventListener("pointerdown",this._onPD),this._onPM=this.onPointerMove.bind(this),this.scroller.addEventListener("pointermove",this._onPM),this._onPU=this.onPointerUp.bind(this),this.scroller.addEventListener("pointerup",this._onPU),this._onPC=this.onPointerCancel.bind(this),this.scroller.addEventListener("pointercancel",this._onPC),this._onPL=this.onPointerCancel.bind(this),this.scroller.addEventListener("pointerleave",this._onPL),this._onClickCap=this.onClickCapture.bind(this),this.scroller.addEventListener("click",this._onClickCap,!0)),this.btnPrev&&(this._onPrev=this.onPrevClick.bind(this),this.btnPrev.addEventListener("click",this._onPrev)),this.btnNext&&(this._onNext=this.onNextClick.bind(this),this.btnNext.addEventListener("click",this._onNext)),this.mq.matches?(this.scrollBar&&(this.scrollBar.style.touchAction="none",this.scrollBar.style.cursor="grab"),this.scrollTrack&&(this.scrollTrack.style.userSelect="none",this.scrollTrack.style.cursor="pointer",this.scrollTrack.style.touchAction="none",this._onTPD=this.onTrackPointerDown.bind(this),this.scrollTrack.addEventListener("pointerdown",this._onTPD),this._onTPM=this.onTrackPointerMove.bind(this),this.scrollTrack.addEventListener("pointermove",this._onTPM),this._onTPU=this.endBarDrag.bind(this),this.scrollTrack.addEventListener("pointerup",this._onTPU),this._onTPC=this.endBarDrag.bind(this),this.scrollTrack.addEventListener("pointercancel",this._onTPC),this._onTPL=this.endBarDrag.bind(this),this.scrollTrack.addEventListener("pointerleave",this._onTPL))):(this.scrollBar&&(this.scrollBar.style.touchAction="",this.scrollBar.style.cursor=""),this.scrollTrack&&(this.scrollTrack.style.userSelect="",this.scrollTrack.style.cursor="",this.scrollTrack.style.touchAction=""));var t=this;this._onMQ=function(){t.applyIOSScrollIndicatorMask(),t.applyListStyles(),t.setupCursorMode(),t.rafUpdate(),t.updateSlideState(!0)},this.mq.addEventListener?this.mq.addEventListener("change",this._onMQ):this.mq.addListener&&this.mq.addListener(this._onMQ);var e=Array.from(this.list.querySelectorAll("img"));e.forEach(function(i){if(!i.complete){var r=function(){t.rafUpdate(),t.setupCursorMode(),t.applyIOSScrollIndicatorMask(),t.applyListStyles(),t.updateSlideState(!0)};i.addEventListener("load",r,{once:!0}),i.addEventListener("error",r,{once:!0}),t.imgHandlers.push({img:i,onL:r,onE:r})}}),this.ro&&(this.ro.observe(this.list),this.ro.observe(this.scroller),this.scrollTrack&&this.ro.observe(this.scrollTrack)),this._onPH=this.destroy.bind(this),window.addEventListener("pagehide",this._onPH),this._onBU=this.destroy.bind(this),window.addEventListener("beforeunload",this._onBU)},o.prototype.init=function(){this.captureBasePaddingBottomOnce(),this.applyIOSScrollIndicatorMask(),this.applyListStyles();var t=this;this.mq.matches&&X().then(function(){t.setupLenisInstance()}).catch(function(){}),this.rafUpdate(),this._onWL=function(){t.rafUpdate(),t.applyIOSScrollIndicatorMask(),t.applyListStyles(),t.updateSlideState(!0)},window.addEventListener("load",this._onWL),this.setupCursorMode(),this.bindEvents(),this.updateSlideState(!0)},o.prototype.destroy=function(){if(this.stopInertia(),this._touchClampTimer&&clearTimeout(this._touchClampTimer),this.lenis){try{N.remove(this.lenis)}catch(t){}try{this.lenis.destroy()}catch(t){}this.lenis=null}this._onScroll&&this.scroller.removeEventListener("scroll",this._onScroll),this._onResize&&window.removeEventListener("resize",this._onResize),this._onPD&&this.scroller.removeEventListener("pointerdown",this._onPD),this._onPM&&this.scroller.removeEventListener("pointermove",this._onPM),this._onPU&&this.scroller.removeEventListener("pointerup",this._onPU),this._onPC&&this.scroller.removeEventListener("pointercancel",this._onPC),this._onPL&&this.scroller.removeEventListener("pointerleave",this._onPL),this._onClickCap&&this.scroller.removeEventListener("click",this._onClickCap,!0),this._onPrev&&this.btnPrev&&this.btnPrev.removeEventListener("click",this._onPrev),this._onNext&&this.btnNext&&this.btnNext.removeEventListener("click",this._onNext),this.scrollTrack&&(this._onTPD&&this.scrollTrack.removeEventListener("pointerdown",this._onTPD),this._onTPM&&this.scrollTrack.removeEventListener("pointermove",this._onTPM),this._onTPU&&this.scrollTrack.removeEventListener("pointerup",this._onTPU),this._onTPC&&this.scrollTrack.removeEventListener("pointercancel",this._onTPC),this._onTPL&&this.scrollTrack.removeEventListener("pointerleave",this._onTPL)),this.mq.removeEventListener?this.mq.removeEventListener("change",this._onMQ):this.mq.removeListener&&this.mq.removeListener(this._onMQ),this._onWL&&window.removeEventListener("load",this._onWL),this._onPH&&window.removeEventListener("pagehide",this._onPH),this._onBU&&window.removeEventListener("beforeunload",this._onBU),this.imgHandlers.forEach(function(t){t.img.removeEventListener("load",t.onL),t.img.removeEventListener("error",t.onE)}),this.imgHandlers=[],this.clearCursorBindings(),this.scroller.style.cursor="",this.scroller.style.removeProperty("--rt-slider-mask-bg"),this.scroller.style.removeProperty("--rt-slider-mask-h"),this.scroller.style.removeProperty("--rt-slider-base-pb"),this.ro&&this.ro.disconnect(),this._injectedKey&&(G(this._injectedKey),this._injectedKey=null)};var d={instances:{},order:[]};function R(){for(var t=document.querySelectorAll("[data-rt-slider]"),e=0,i=0;i<t.length;i++){var r=t[i],s=r.getAttribute("data-rt-slider-id");if(s||(e++,s="slider-"+e,r.setAttribute("data-rt-slider-id",s)),!d.instances[s]){var n=new o(r,s);n.valid&&(d.instances[s]=n,d.order.push(s),n.init())}}}function Y(){return{__initialized:!0,ids:function(){return d.order.slice()},get:function(t){return d.instances[t]||null},getSlideState:function(t){var e=d.instances[t];return e?e.getSlideState():null},getScrollState:function(t){var e=d.instances[t];return e?e.getScrollState():null},getProgress:function(t){var e=d.instances[t];return e?e.getProgress():0},refresh:function(){for(var t=d.order,e=0;e<t.length;e++){var i=d.instances[t[e]];i&&i.onResize()}},destroy:function(t){if(typeof t=="string"){var e=d.instances[t];if(e){e.destroy(),delete d.instances[t];var i=d.order.indexOf(t);i>-1&&d.order.splice(i,1)}return}for(var r=0;r<d.order.length;r++){var s=d.order[r];d.instances[s]&&d.instances[s].destroy()}d.instances={},d.order=[]}}}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",R):R(),window[w]=Y()})();})();
|
|
3
3
|
//# sourceMappingURL=index.min.js.map
|