1document.addEventListener('DOMContentLoaded',function(){const ARX_SLIDER_DOT_BASE_WIDTH=10 2const ARX_SLIDER_DOT_ACTIVE_WIDTH=50 3const ARX_SLIDER_DRAG_CLICK_THRESHOLD=5 4const ARX_SLIDER_DRAG_CLICK_SUPPRESSION_MS=500 5const ARX_SLIDER_MOBILE_SWIPE_THRESHOLD=70 6const ARX_SLIDER_TRANSITION_DURATION_MS=500 7const ARX_SLIDER_DEFAULT_AUTOPLAY_DURATION_MS=5000 8const ARX_SLIDER_PROGRESS_FADE_DURATION_MS=180 9const ARX_SLIDER_INTERACTION_RESET_COOLDOWN_MS=120 10const ARX_SLIDER_PAGE_LOAD_SETTLE_DELAY_MS=180 11const ARX_SLIDER_DEFAULT_ARROW_URL=window.arxDesignSystemSlider?.arrowUrl||window.arxCpcSlider?.arrowUrl||'/wp-content/plugins/arx-design-system/assets/img/slider_arrow.svg' 12const arxSliderBody=document.body 13const arxSliderHtml=document.documentElement 14const arxSliderSearchParams=new URLSearchParams(window.location.search) 15const arxIsDiviBuilderContext=Boolean(arxSliderSearchParams.get('et_fb')==='1'||arxSliderBody?.classList.contains('et-fb')||arxSliderHtml?.classList.contains('et-fb')||arxSliderBody?.classList.contains('et-fb-root-ancestor')||arxSliderHtml?.classList.contains('et-fb-root-ancestor')) 16if(arxIsDiviBuilderContext){return}
17let arxSliderPageLoadSettled=document.readyState==='complete' 18class ARXSlider{constructor(container,optionsSource=container){this.container=container 19this.optionsSource=optionsSource 20this.options=arxGetSliderOptions(optionsSource) 21this.originalInlineOverflowY=container.style.overflowY 22this.originalInlineOverscrollBehaviorY=container.style.overscrollBehaviorY 23this.originalDisplayArrowsOnHoverAttr=container.getAttribute('data-display-arrows-onhover') 24this.container.classList.add('arx-slider-instance') 25if(optionsSource!==container){this.container.dataset.arxSliderTarget='true'}else{delete this.container.dataset.arxSliderTarget} 26const arxSliderDisplayArrowsOnHoverAttr=optionsSource.getAttribute('data-display-arrows-onhover') 27if(arxSliderDisplayArrowsOnHoverAttr!==null){this.container.setAttribute('data-display-arrows-onhover',arxSliderDisplayArrowsOnHoverAttr)} 28this.container.style.setProperty('overflow-y','hidden','important') 29this.handlersEnabled=!1 30this.viewportWidth=0 31this.currentTranslateX=0 32this.currentDomIndex=0 33this.activeSlide=0 34this.hasCompletedInitialLayout=!1 35this.initialPositionLocked=!arxSliderPageLoadSettled 36this.nbPages=0 37this.realNbSlides=0 38this.nbSlides=0 39this.cloneOffset=0 40this.originalSlides=[] 41this.touchSwipeDeltaX=0 42this.wasDragged=!1 43this.suppressClickUntil=0 44this.dragClickSuppressionTimeout=null 45this.autoplayTimeout=null 46this.progressBarElements=null 47this.borderGradientElements=null 48this.progressBarAnimationFrame=null 49this.progressBarFadeTimeout=null 50this.progressBarTransitionTimeout=null 51this.progressBarAnimationToken=0 52this.currentProgressBarHost=null 53this.lastInteractionAutoplayResetAt=0 54this.pendingAutoplayUntilPageLoad=!1 55this.refreshSlides() 56this.realNbSlides=this.nbSlides 57if(this.options.infinite&&this.realNbSlides>1){this.setupInfiniteMode()}else{this.options.infinite=!1} 58this.currentDomIndex=this.getDOMIndex(0) 59this.bindInstanceHandlers() 60this.container.addEventListener('click',this.handleDotsClick) 61this.container.addEventListener('click',this.preventClickAfterDrag,!0) 62this.updateEnabledState() 63if(!this.options.customSlideWidth){this.handleResize() 64window.addEventListener('resize',this.handleResize)}else{this.applyCustomSlideWidthMode()}} 65bindInstanceHandlers(){this.handleResize=this.handleResize.bind(this) 66this.handleDesktopDragStart=this.handleDesktopDragStart.bind(this) 67this.handleMobileDragStart=this.handleMobileDragStart.bind(this) 68this.handleLeftArrowClick=this.handleLeftArrowClick.bind(this) 69this.handleRightArrowClick=this.handleRightArrowClick.bind(this) 70this.handleDotsClick=this.handleDotsClick.bind(this) 71this.preventClickAfterDrag=this.preventClickAfterDrag.bind(this) 72this.handleInteractionEnter=this.handleInteractionEnter.bind(this) 73this.handleInteractionMove=this.handleInteractionMove.bind(this)} 74refreshSlides(){this.slideList=Array.from(this.container.children).filter((element)=>{return!element.classList.contains('arx-slider-dots')&&!element.classList.contains('arx-slider-dot')&&!element.classList.contains('arx-slider-arrows')&&!element.classList.contains('arx-slider-arrow-left')&&!element.classList.contains('arx-slider-arrow-right')&&!element.classList.contains('arx-slider-border-gradients')}) 75this.nbSlides=this.slideList.length} 76setupInfiniteMode(){this.originalSlides=this.slideList.slice() 77for(const arxSliderOriginalSlide of this.originalSlides.slice().reverse()){const arxSliderPrependedClone=arxSliderOriginalSlide.cloneNode(!0) 78arxSliderPrependedClone.dataset.arxClone='true' 79this.container.insertBefore(arxSliderPrependedClone,this.container.firstChild)} 80for(const arxSliderOriginalSlide of this.originalSlides){const arxSliderAppendedClone=arxSliderOriginalSlide.cloneNode(!0) 81arxSliderAppendedClone.dataset.arxClone='true' 82this.container.appendChild(arxSliderAppendedClone)} 83this.refreshSlides() 84this.cloneOffset=this.realNbSlides 85this.activeSlide=0} 86applyEqualHeight(){if(!this.options.equalHeight||this.nbSlides===0){return} 87for(const arxSliderSlide of this.slideList){arxSliderSlide.style.removeProperty('height')} 88let arxSliderMaxHeight=0 89for(const arxSliderSlide of this.slideList){if(arxSliderSlide.clientHeight>arxSliderMaxHeight){arxSliderMaxHeight=arxSliderSlide.clientHeight}} 90if(arxSliderMaxHeight<=0){return}
91for(const arxSliderSlide of this.slideList){arxSliderSlide.style.height=`${arxSliderMaxHeight}px`}} 92applyCustomSlideWidthMode(){this.viewportWidth=window.innerWidth 93for(const arxSliderSlide of this.slideList){arxSliderSlide.style.minWidth='fit-content'} 94this.applyEqualHeight() 95this.placeDots() 96this.syncNavigationForViewport() 97this.initializeAtFirstSlide()} 98getHorizontalPadding(){const arxSliderContainerStyle=getComputedStyle(this.container) 99const arxSliderPaddingLeft=parseFloat(arxSliderContainerStyle.paddingLeft)||0 100const arxSliderPaddingRight=parseFloat(arxSliderContainerStyle.paddingRight)||0 101return arxSliderPaddingLeft+arxSliderPaddingRight} 102computeSlidesMetrics(){const arxSliderContainerStyle=getComputedStyle(this.container) 103const arxSliderPaddingLeft=parseFloat(arxSliderContainerStyle.paddingLeft)||0 104const arxSliderPaddingRight=parseFloat(arxSliderContainerStyle.paddingRight)||0 105const arxSliderGap=parseFloat(arxSliderContainerStyle.gap)||0 106const arxSliderAvailableWidth=this.container.clientWidth-(arxSliderPaddingLeft+arxSliderPaddingRight) 107const arxSliderMetricSlides=this.options.infinite&&this.originalSlides.length?this.originalSlides:this.slideList 108let arxSliderTotalSlidesWidth=0 109for(const arxSliderSlide of arxSliderMetricSlides){arxSliderTotalSlidesWidth+=arxSliderSlide.offsetWidth} 110arxSliderTotalSlidesWidth+=arxSliderGap*Math.max(0,arxSliderMetricSlides.length-1) 111return{containerPaddingLeft:arxSliderPaddingLeft,containerPaddingRight:arxSliderPaddingRight,containerGap:arxSliderGap,availableWidth:arxSliderAvailableWidth,totalSlidesWidth:arxSliderTotalSlidesWidth}}
112getDOMIndex(logicalIndex){if(this.options.infinite){return this.cloneOffset+logicalIndex} 113return logicalIndex} 114getSlideTranslateX(slide){if(!slide){return 0} 115const arxSliderTransform=getComputedStyle(slide).transform 116if(!arxSliderTransform||arxSliderTransform==='none'){return 0} 117return new DOMMatrixReadOnly(arxSliderTransform).m41} 118getCurrentSlidesToShow(){if(this.viewportWidth>this.options.tabletBreakpoint){return this.options.desktopSlideToShow} 119if(this.viewportWidth>this.options.mobileBreakpoint){return this.options.tabletSlideToShow} 120return this.options.mobileSlidestoShow} 121getCurrentDisplayDots(){if(this.viewportWidth>this.options.tabletBreakpoint){return this.options.displayDotsDesktop} 122if(this.viewportWidth>this.options.mobileBreakpoint){return this.options.displayDotsTablet} 123return this.options.displayDotsMobile} 124getCurrentDisplayArrows(){if(this.viewportWidth>this.options.tabletBreakpoint){return this.options.displayArrowsDesktop} 125if(this.viewportWidth>this.options.mobileBreakpoint){return this.options.displayArrowsTablet} 126return this.options.displayArrowsMobile} 127getCurrentDragPosition(){const arxSliderFirstSlide=this.slideList[0] 128if(!arxSliderFirstSlide){return 0} 129const arxSliderContainerStyle=getComputedStyle(this.container) 130const arxSliderPaddingLeft=parseFloat(arxSliderContainerStyle.paddingLeft)||0 131const arxSliderGap=parseFloat(arxSliderContainerStyle.gap)||0 132const arxSliderSlideStep=arxSliderFirstSlide.offsetWidth+arxSliderGap 133if(arxSliderSlideStep<=0){return 0} 134const arxSliderContainerLeft=this.container.getBoundingClientRect().left+arxSliderPaddingLeft 135const arxSliderFirstSlideLeft=arxSliderFirstSlide.getBoundingClientRect().left 136return(arxSliderContainerLeft-arxSliderFirstSlideLeft)/arxSliderSlideStep}
137getInfiniteDomIndexCandidates(logicalIndex){if(!this.options.infinite){return[logicalIndex]} 138return[logicalIndex,logicalIndex+this.realNbSlides,logicalIndex+(this.realNbSlides*2)]} 139getClosestInfiniteDomIndex(logicalIndex){const arxSliderFallbackDomIndex=this.getDOMIndex(logicalIndex) 140if(typeof this.currentDomIndex!=='number'){return arxSliderFallbackDomIndex} 141let arxSliderClosestDomIndex=arxSliderFallbackDomIndex 142let arxSliderClosestDistance=Infinity 143for(const arxSliderCandidate of this.getInfiniteDomIndexCandidates(logicalIndex)){const arxSliderDistance=Math.abs(arxSliderCandidate-this.currentDomIndex) 144if(arxSliderDistance<arxSliderClosestDistance){arxSliderClosestDistance=arxSliderDistance 145arxSliderClosestDomIndex=arxSliderCandidate}} 146return arxSliderClosestDomIndex} 147getTouchSwipeTargetSlide(dragDeltaX){if(Math.abs(dragDeltaX)<ARX_SLIDER_MOBILE_SWIPE_THRESHOLD){return this.activeSlide} 148if(dragDeltaX<0){if(this.options.infinite){return(this.activeSlide+1)%this.realNbSlides} 149return Math.min(this.activeSlide+1,this.nbPages-1)} 150if(this.options.infinite){return(this.activeSlide-1+this.realNbSlides)%this.realNbSlides} 151return Math.max(this.activeSlide-1,0)} 152getDotsContainer(){return this.container.querySelector('.arx-slider-dots')} 153getArrowsContainer(){return this.container.querySelector('.arx-slider-arrows')} 154getBorderGradientsContainer(){return this.container.querySelector('.arx-slider-border-gradients')} 155getArrowElements(){return{left:this.container.querySelector('.arx-slider-arrow-left'),right:this.container.querySelector('.arx-slider-arrow-right')}} 156getBorderGradientElements(){const arxSliderBorderGradients=this.getBorderGradientsContainer() 157if(!arxSliderBorderGradients){return{wrapper:null,left:null,right:null}} 158return{wrapper:arxSliderBorderGradients,left:arxSliderBorderGradients.querySelector('.arx-slider-border-gradient-left'),right:arxSliderBorderGradients.querySelector('.arx-slider-border-gradient-right')}} 159shouldDisplayProgressBar(){return this.options.displayProgressBar&&this.canAutoplay()} 160shouldDisplayBorderGradient(){return this.options.borderGradient&&!this.options.infinite&&!this.options.autoplay&&this.nbPages>1} 161ensureProgressBar(){if(this.progressBarElements){return this.progressBarElements} 162if(!this.shouldDisplayProgressBar()){return null} 163const arxSliderProgressBar=document.createElement('div') 164const arxSliderProgressBarFill=document.createElement('div') 165arxSliderProgressBar.className='arx-slider-progress-bar' 166arxSliderProgressBarFill.className='arx-slider-progress-bar-fill' 167arxSliderProgressBarFill.style.width='0' 168arxSliderProgressBarFill.style.transition='none' 169arxSliderProgressBar.appendChild(arxSliderProgressBarFill) 170this.progressBarElements={wrapper:arxSliderProgressBar,fill:arxSliderProgressBarFill} 171return this.progressBarElements} 172ensureBorderGradients(){if(this.borderGradientElements){return this.borderGradientElements} 173if(!this.options.borderGradient){return null} 174const arxSliderBorderGradients=document.createElement('div') 175const arxSliderBorderGradientLeft=document.createElement('div') 176const arxSliderBorderGradientRight=document.createElement('div') 177arxSliderBorderGradients.className='arx-slider-border-gradients' 178arxSliderBorderGradientLeft.className='arx-slider-border-gradient arx-slider-border-gradient-left' 179arxSliderBorderGradientRight.className='arx-slider-border-gradient arx-slider-border-gradient-right' 180arxSliderBorderGradients.style.setProperty('--arx-slider-border-gradient-color',this.options.borderGradientColor) 181arxSliderBorderGradients.appendChild(arxSliderBorderGradientLeft) 182arxSliderBorderGradients.appendChild(arxSliderBorderGradientRight) 183this.container.appendChild(arxSliderBorderGradients) 184this.borderGradientElements={wrapper:arxSliderBorderGradients,left:arxSliderBorderGradientLeft,right:arxSliderBorderGradientRight} 185return this.borderGradientElements} 186resetProgressBarAnimation(hide=!1){if(!this.progressBarElements){return} 187this.cancelProgressBarAsyncWork() 188this.progressBarElements.wrapper.classList.remove('is-resetting') 189this.progressBarElements.wrapper.style.display=hide?'none':'' 190this.progressBarElements.fill.style.transition='none' 191this.progressBarElements.fill.style.width='0'} 192cancelProgressBarAsyncWork(){if(this.progressBarAnimationFrame){cancelAnimationFrame(this.progressBarAnimationFrame) 193this.progressBarAnimationFrame=null} 194if(this.progressBarFadeTimeout){clearTimeout(this.progressBarFadeTimeout) 195this.progressBarFadeTimeout=null} 196if(this.progressBarTransitionTimeout){clearTimeout(this.progressBarTransitionTimeout) 197this.progressBarTransitionTimeout=null}} 198getProgressBarTargetSlide(){if(!this.slideList.length){return null} 199if(typeof this.currentDomIndex==='number'&&this.slideList[this.currentDomIndex]){return this.slideList[this.currentDomIndex]} 200return this.slideList[this.getDOMIndex(this.activeSlide)]||null}
201mountProgressBarOnSlide(slide){const arxSliderProgressBar=this.ensureProgressBar() 202if(!arxSliderProgressBar||!slide){return} 203if(this.currentProgressBarHost&&this.currentProgressBarHost!==slide){this.currentProgressBarHost.classList.remove('arx-slider-progress-host')} 204if(getComputedStyle(slide).position==='static'){slide.style.position='relative' 205slide.dataset.arxSliderProgressPositioned='true'} 206const arxSliderSlideStyle=getComputedStyle(slide) 207const arxSliderBottomLeftRadius=arxSliderSlideStyle.borderBottomLeftRadius||'0px' 208const arxSliderBottomRightRadius=arxSliderSlideStyle.borderBottomRightRadius||'0px' 209slide.classList.add('arx-slider-progress-host') 210arxSliderProgressBar.wrapper.style.borderBottomLeftRadius=arxSliderBottomLeftRadius 211arxSliderProgressBar.wrapper.style.borderBottomRightRadius=arxSliderBottomRightRadius 212arxSliderProgressBar.fill.style.borderBottomLeftRadius=arxSliderBottomLeftRadius 213arxSliderProgressBar.fill.style.borderBottomRightRadius=arxSliderBottomRightRadius 214if(arxSliderProgressBar.wrapper.parentElement!==slide||slide.firstChild!==arxSliderProgressBar.wrapper){slide.insertBefore(arxSliderProgressBar.wrapper,slide.firstChild)} 215this.currentProgressBarHost=slide} 216moveProgressBarToCurrentSlide(){this.mountProgressBarOnSlide(this.getProgressBarTargetSlide())} 217beginProgressBarSlideTransition(){if(!this.shouldDisplayProgressBar()||!this.progressBarElements||!this.currentProgressBarHost||!this.currentProgressBarHost.isConnected){return!1} 218this.cancelProgressBarAsyncWork() 219this.mountProgressBarOnSlide(this.currentProgressBarHost) 220this.progressBarElements.wrapper.style.display='' 221this.progressBarElements.wrapper.classList.remove('is-resetting') 222this.progressBarElements.fill.style.transition='none' 223this.progressBarElements.fill.style.width='100%' 224void this.progressBarElements.wrapper.offsetWidth 225this.progressBarElements.wrapper.classList.add('is-resetting') 226return!0} 227scheduleAutoplayRestartAfterSlideTransition(delay=ARX_SLIDER_TRANSITION_DURATION_MS+20){this.stopAutoplayTimeout() 228this.cancelProgressBarAsyncWork() 229this.progressBarTransitionTimeout=setTimeout(()=>{this.progressBarTransitionTimeout=null 230this.restartAutoplay()},delay)} 231queueProgressBarFillAnimation(token){this.progressBarAnimationFrame=requestAnimationFrame(()=>{if(!this.progressBarElements||!this.shouldDisplayProgressBar()||token!==this.progressBarAnimationToken){return} 232this.progressBarAnimationFrame=null 233void this.progressBarElements.fill.offsetWidth 234this.progressBarElements.fill.style.transition=`width ${this.options.autoplayDuration}ms linear` 235this.progressBarElements.fill.style.width='100%'})} 236startProgressBarAnimation(animateReset=!1){if(!this.shouldDisplayProgressBar()){this.resetProgressBarAnimation() 237return} 238const arxSliderProgressBar=this.ensureProgressBar() 239if(!arxSliderProgressBar){return} 240this.cancelProgressBarAsyncWork() 241const arxSliderTargetSlide=animateReset&&this.currentProgressBarHost?.isConnected?this.currentProgressBarHost:this.getProgressBarTargetSlide()||(this.currentProgressBarHost?.isConnected?this.currentProgressBarHost:null) 242if(!arxSliderTargetSlide){return} 243arxSliderProgressBar.wrapper.style.display='' 244const arxSliderAnimationToken=++this.progressBarAnimationToken 245const arxSliderCurrentProgressWidth=parseFloat(this.progressBarElements.fill.style.width)||0 246if(animateReset&&arxSliderCurrentProgressWidth>0){this.progressBarElements.wrapper.classList.add('is-resetting') 247this.progressBarFadeTimeout=setTimeout(()=>{if(!this.progressBarElements||arxSliderAnimationToken!==this.progressBarAnimationToken){return} 248this.progressBarFadeTimeout=null 249this.mountProgressBarOnSlide(arxSliderTargetSlide) 250this.progressBarElements.wrapper.classList.remove('is-resetting') 251this.progressBarElements.fill.style.transition='none' 252this.progressBarElements.fill.style.width='0' 253this.queueProgressBarFillAnimation(arxSliderAnimationToken)},ARX_SLIDER_PROGRESS_FADE_DURATION_MS) 254return} 255this.mountProgressBarOnSlide(arxSliderTargetSlide) 256this.progressBarElements.wrapper.classList.remove('is-resetting') 257this.progressBarElements.fill.style.transition='none' 258this.progressBarElements.fill.style.width='0' 259this.queueProgressBarFillAnimation(arxSliderAnimationToken)} 260setSlidesTranslateX(translateX,transition='none'){this.currentTranslateX=translateX
261for(const arxSliderSlide of this.slideList){arxSliderSlide.style.transition=transition 262arxSliderSlide.style.transform=`translateX(${translateX}px)`}} 263resetSlidesTransitionAfterDelay(delay=ARX_SLIDER_TRANSITION_DURATION_MS){for(const arxSliderSlide of this.slideList){setTimeout(()=>{arxSliderSlide.style.transition='none'},delay)}} 264updateDragPreviewDots(position){const arxSliderDotsContainer=this.getDotsContainer() 265if(!arxSliderDotsContainer){return} 266const arxSliderDots=arxSliderDotsContainer.children 267const arxSliderLeftDomIndex=Math.floor(position) 268const arxSliderProgress=position-arxSliderLeftDomIndex 269if(this.options.infinite){const arxSliderLeftLogicalIndex=((arxSliderLeftDomIndex-this.cloneOffset)%this.realNbSlides+this.realNbSlides)%this.realNbSlides 270const arxSliderRightLogicalIndex=(arxSliderLeftLogicalIndex+1)%this.realNbSlides 271this.applyDotPreviewWidths(arxSliderDots,arxSliderLeftLogicalIndex,arxSliderRightLogicalIndex,arxSliderProgress) 272return} 273const arxSliderLeftIndex=arxSliderLeftDomIndex 274const arxSliderRightIndex=arxSliderLeftIndex+1 275if(!arxSliderDots[arxSliderLeftIndex]||!arxSliderDots[arxSliderRightIndex]){return} 276this.applyDotPreviewWidths(arxSliderDots,arxSliderLeftIndex,arxSliderRightIndex,arxSliderProgress)} 277applyDotPreviewWidths(dots,leftIndex,rightIndex,progress){for(let arxSliderDotIndex=0;arxSliderDotIndex<dots.length;arxSliderDotIndex++){dots[arxSliderDotIndex].style.transition='none' 278if(arxSliderDotIndex!==leftIndex&&arxSliderDotIndex!==rightIndex){dots[arxSliderDotIndex].style.width=`${ARX_SLIDER_DOT_BASE_WIDTH}px`}} 279dots[leftIndex].style.width=`${ARX_SLIDER_DOT_BASE_WIDTH + ((ARX_SLIDER_DOT_ACTIVE_WIDTH - ARX_SLIDER_DOT_BASE_WIDTH) * (1 - progress))}px` 280dots[rightIndex].style.width=`${ARX_SLIDER_DOT_BASE_WIDTH + ((ARX_SLIDER_DOT_ACTIVE_WIDTH - ARX_SLIDER_DOT_BASE_WIDTH) * progress)}px`} 281resetDotPreviewState(){const arxSliderDotsContainer=this.getDotsContainer() 282if(!arxSliderDotsContainer){return} 283for(const arxSliderDot of Array.from(arxSliderDotsContainer.children)){arxSliderDot.style.transition='0.3s ease-in-out' 284arxSliderDot.style.removeProperty('width')}} 285preventClickAfterDrag(event){if(!this.wasDragged&&Date.now()>=this.suppressClickUntil){return} 286event.preventDefault() 287event.stopImmediatePropagation() 288this.wasDragged=!1 289this.suppressClickUntil=0 290clearTimeout(this.dragClickSuppressionTimeout)} 291suppressNavigationAfterDrag(event){event.preventDefault() 292event.stopImmediatePropagation() 293this.suppressClickUntil=Date.now()+ARX_SLIDER_DRAG_CLICK_SUPPRESSION_MS 294clearTimeout(this.dragClickSuppressionTimeout) 295this.dragClickSuppressionTimeout=setTimeout(()=>{this.suppressClickUntil=0},ARX_SLIDER_DRAG_CLICK_SUPPRESSION_MS)} 296canAutoplay(){return this.options.autoplay&&this.nbPages>1} 297isAutoplayEnvironmentReady(){return arxSliderPageLoadSettled} 298queueAutoplayUntilPageLoad(){this.pendingAutoplayUntilPageLoad=!0 299this.resetProgressBarAnimation()} 300resumeAutoplayAfterPageLoad(){if(!this.pendingAutoplayUntilPageLoad||!this.container.isConnected){return} 301this.pendingAutoplayUntilPageLoad=!1 302if(!this.options.customSlideWidth){this.viewportWidth=0 303this.handleResize() 304return} 305this.syncNavigationForViewport() 306this.applySlideChange()} 307stopAutoplayTimeout(){if(this.autoplayTimeout){clearTimeout(this.autoplayTimeout) 308this.autoplayTimeout=null}} 309clearAutoplayTimeout(hideProgressBar=!1){this.stopAutoplayTimeout() 310this.resetProgressBarAnimation(hideProgressBar)} 311scheduleAutoplay(animateReset=!1){this.stopAutoplayTimeout() 312if(!this.canAutoplay()){this.pendingAutoplayUntilPageLoad=!1 313this.resetProgressBarAnimation() 314return} 315if(!this.isAutoplayEnvironmentReady()){this.queueAutoplayUntilPageLoad() 316return} 317this.autoplayTimeout=setTimeout(()=>{this.goToNextSlide()},this.options.autoplayDuration) 318this.startProgressBarAnimation(animateReset)} 319restartAutoplay(animateReset=!1){this.scheduleAutoplay(animateReset)} 320shouldThrottleInteractionReset(){return(Date.now()-this.lastInteractionAutoplayResetAt)<ARX_SLIDER_INTERACTION_RESET_COOLDOWN_MS} 321resetAutoplayFromInteraction(){if(this.shouldThrottleInteractionReset()){return} 322this.lastInteractionAutoplayResetAt=Date.now() 323this.restartAutoplay(!0)} 324handleInteractionEnter(event){if(!this.options.autoplay||this.wasDragged){return} 325if(event.target.closest('.arx-slider-dots')||event.target.closest('.arx-slider-arrow-left')||event.target.closest('.arx-slider-arrow-right')){return} 326this.resetAutoplayFromInteraction()} 327handleInteractionMove(event){if(!this.options.autoplay||this.wasDragged){return} 328if(event.target.closest('.arx-slider-dots')||event.target.closest('.arx-slider-arrow-left')||event.target.closest('.arx-slider-arrow-right')){return} 329this.resetAutoplayFromInteraction()} 330goToNextSlide(){if(this.options.infinite){this.activeSlide=(this.activeSlide+1)%this.realNbSlides}else{this.activeSlide=Math.min(this.activeSlide+1,this.nbPages-1)} 331this.applySlideChange()} 332enableHandlers(){if(this.handlersEnabled){return} 333this.placeArrows() 334this.handlersEnabled=!0 335this.container.addEventListener('mousedown',this.handleDesktopDragStart) 336this.container.addEventListener('touchstart',this.handleMobileDragStart,{passive:!0}) 337this.container.addEventListener('mouseenter',this.handleInteractionEnter) 338this.container.addEventListener('mousemove',this.handleInteractionMove) 339this.container.addEventListener('touchmove',this.handleInteractionMove,{passive:!0}) 340const{left,right}=this.getArrowElements() 341if(left){left.addEventListener('click',this.handleLeftArrowClick,{passive:!0})} 342if(right){right.addEventListener('click',this.handleRightArrowClick,{passive:!0})}} 343disableHandlers(){if(!this.handlersEnabled){return} 344this.handlersEnabled=!1 345this.container.removeEventListener('mousedown',this.handleDesktopDragStart) 346this.container.removeEventListener('touchstart',this.handleMobileDragStart) 347this.container.removeEventListener('mouseenter',this.handleInteractionEnter) 348this.container.removeEventListener('mousemove',this.handleInteractionMove) 349this.container.removeEventListener('touchmove',this.handleInteractionMove) 350const{left,right}=this.getArrowElements() 351if(left){left.removeEventListener('click',this.handleLeftArrowClick)} 352if(right){right.removeEventListener('click',this.handleRightArrowClick)}}
353updateEnabledState(){const arxSliderShouldEnable=arxShouldEnableSliderForViewport(this.options) 354this.container.classList.toggle('arx-slider-enabled',arxSliderShouldEnable) 355if(arxSliderShouldEnable){this.enableHandlers() 356this.updateInteractiveState()}else{this.clearAutoplayTimeout(!0) 357this.disableHandlers() 358this.container.classList.remove('arx-slider-interactive')} 359return arxSliderShouldEnable} 360updateInteractiveState(){let arxSliderIsInteractive=this.container.isConnected 361let arxSliderCurrentElement=this.container 362while(arxSliderIsInteractive&&arxSliderCurrentElement){const arxSliderCurrentStyle=getComputedStyle(arxSliderCurrentElement) 363const arxSliderCurrentOpacity=parseFloat(arxSliderCurrentStyle.opacity) 364if(arxSliderCurrentElement.hidden||arxSliderCurrentElement.hasAttribute('inert')||arxSliderCurrentElement.getAttribute('aria-hidden')==='true'||arxSliderCurrentStyle.display==='none'||arxSliderCurrentStyle.visibility==='hidden'||arxSliderCurrentStyle.visibility==='collapse'||arxSliderCurrentStyle.pointerEvents==='none'||arxSliderCurrentStyle.contentVisibility==='hidden'||arxSliderCurrentOpacity===0){arxSliderIsInteractive=!1 365break} 366arxSliderCurrentElement=arxSliderCurrentElement.parentElement} 367this.container.classList.toggle('arx-slider-interactive',arxSliderIsInteractive) 368return arxSliderIsInteractive} 369handleDotsClick(event){const arxSliderDot=event.target.closest('.arx-slider-dot') 370if(!arxSliderDot){return} 371const arxSliderDotsWrapper=arxSliderDot.parentElement 372const arxSliderDotIndex=Array.prototype.indexOf.call(arxSliderDotsWrapper.children,arxSliderDot) 373if(arxSliderDotIndex<0){return} 374this.releaseInitialPositionLock() 375this.activeSlide=arxSliderDotIndex 376this.applySlideChange()} 377handleLeftArrowClick(){this.releaseInitialPositionLock() 378this.clearAutoplayTimeout() 379if(this.options.infinite){this.activeSlide=(this.activeSlide-1+this.realNbSlides)%this.realNbSlides}else{this.activeSlide=Math.max(this.activeSlide-1,0)} 380this.applySlideChange()} 381handleRightArrowClick(){this.releaseInitialPositionLock() 382this.clearAutoplayTimeout() 383this.goToNextSlide()} 384handleMobileDragStart(event){this.releaseInitialPositionLock() 385const arxSliderTouchStartX=event.touches[0].clientX 386const arxSliderTouchStartY=event.touches[0].clientY 387const arxSliderStartTranslateX=this.getSlideTranslateX(this.slideList[0]) 388let arxSliderCurrentTouchX=arxSliderTouchStartX 389let arxSliderCurrentTouchY=arxSliderTouchStartY 390let arxSliderTouchMode='unset' 391this.wasDragged=!1 392this.touchSwipeDeltaX=0 393this.clearAutoplayTimeout() 394const handleTouchMove=(moveEvent)=>{arxSliderCurrentTouchX=moveEvent.touches[0].clientX 395arxSliderCurrentTouchY=moveEvent.touches[0].clientY 396const arxSliderDeltaX=arxSliderCurrentTouchX-arxSliderTouchStartX 397const arxSliderDeltaY=arxSliderCurrentTouchY-arxSliderTouchStartY 398if(arxSliderTouchMode==='unset'&&Math.abs(arxSliderDeltaY)>Math.abs(arxSliderDeltaX)&&Math.abs(arxSliderDeltaY)>ARX_SLIDER_DRAG_CLICK_THRESHOLD){document.removeEventListener('touchmove',handleTouchMove) 399return} 400if(Math.abs(arxSliderDeltaX)<=Math.abs(arxSliderDeltaY)&&arxSliderTouchMode!=='swipe'){return} 401arxSliderTouchMode='swipe' 402this.wasDragged=this.wasDragged||Math.abs(arxSliderDeltaX)>ARX_SLIDER_DRAG_CLICK_THRESHOLD 403moveEvent.preventDefault() 404this.touchSwipeDeltaX=arxSliderDeltaX 405this.setSlidesTranslateX(arxSliderStartTranslateX+arxSliderDeltaX) 406this.updateDragPreviewDots(this.getCurrentDragPosition())} 407document.addEventListener('touchmove',handleTouchMove,{passive:!1}) 408document.addEventListener('touchend',(endEvent)=>{document.removeEventListener('touchmove',handleTouchMove) 409const arxSliderTouchEndX=endEvent.changedTouches[0]?.clientX??arxSliderCurrentTouchX 410const arxSliderTouchEndDeltaX=arxSliderTouchEndX-arxSliderTouchStartX 411const arxSliderWasDragged=this.wasDragged||(arxSliderTouchMode==='swipe'&&Math.abs(arxSliderTouchEndDeltaX)>ARX_SLIDER_DRAG_CLICK_THRESHOLD) 412this.touchSwipeDeltaX=arxSliderTouchEndDeltaX 413this.snapFromTouchGesture(arxSliderTouchEndDeltaX) 414this.wasDragged=!1 415if(arxSliderWasDragged){this.suppressNavigationAfterDrag(endEvent)}},{once:!0,capture:!0,passive:!1})} 416handleDesktopDragStart(event){if(event.target.closest('.arx-slider-dots')||event.target.closest('.arx-slider-arrow-left')||event.target.closest('.arx-slider-arrow-right')||event.which!==1){return} 417this.releaseInitialPositionLock() 418event.preventDefault()
419const arxSliderMouseStartX=event.pageX 420const arxSliderStartTranslateX=this.getSlideTranslateX(this.slideList[0]) 421this.wasDragged=!1 422this.clearAutoplayTimeout() 423const handleMouseMove=(moveEvent)=>{const arxSliderDragDeltaX=moveEvent.pageX-arxSliderMouseStartX 424if(Math.abs(arxSliderDragDeltaX)>ARX_SLIDER_DRAG_CLICK_THRESHOLD){this.wasDragged=!0} 425this.setSlidesTranslateX(arxSliderStartTranslateX+arxSliderDragDeltaX) 426this.updateDragPreviewDots(this.getCurrentDragPosition())} 427document.addEventListener('mousemove',handleMouseMove) 428document.addEventListener('mouseup',(endEvent)=>{document.removeEventListener('mousemove',handleMouseMove) 429const arxSliderWasDragged=this.wasDragged 430this.snapToClosestSlide() 431this.wasDragged=!1 432if(arxSliderWasDragged){this.suppressNavigationAfterDrag(endEvent)}},{once:!0,capture:!0})} 433snapFromTouchGesture(dragDeltaX){this.activeSlide=this.getTouchSwipeTargetSlide(dragDeltaX) 434this.applySlideChange() 435this.resetDotPreviewState()} 436initializeAtFirstSlide(){this.activeSlide=0 437this.currentDomIndex=this.getDOMIndex(0) 438this.hasCompletedInitialLayout=!0 439this.applySlideChange() 440this.resetDotPreviewState()} 441releaseInitialPositionLock(){this.initialPositionLocked=!1} 442snapToClosestSlide(){const arxSliderSlideOffsets=[] 443const arxSliderContainerStyle=getComputedStyle(this.container) 444const arxSliderPaddingLeft=parseFloat(arxSliderContainerStyle.paddingLeft)||0 445const arxSliderContainerLeft=this.container.getBoundingClientRect().left 446for(const arxSliderSlide of this.slideList){const arxSliderSlideLeft=arxSliderSlide.getBoundingClientRect().left 447arxSliderSlideOffsets.push((arxSliderContainerLeft+arxSliderPaddingLeft)-arxSliderSlideLeft)} 448const arxSliderClosestSlideIndex=arxSliderSlideOffsets.indexOf(closestToZero(arxSliderSlideOffsets)) 449if(this.options.infinite){this.currentDomIndex=arxSliderClosestSlideIndex 450const arxSliderRelativeIndex=arxSliderClosestSlideIndex-this.cloneOffset 451this.activeSlide=((arxSliderRelativeIndex%this.realNbSlides)+this.realNbSlides)%this.realNbSlides}else{this.activeSlide=Math.max(Math.min(arxSliderClosestSlideIndex,this.nbPages-1),0)} 452this.applySlideChange() 453this.resetDotPreviewState()} 454placeDots(){const arxSliderSlidesToShow=this.getCurrentSlidesToShow() 455let arxSliderDotsCount=0 456if(this.options.infinite){arxSliderDotsCount=this.realNbSlides}else if(!this.options.customSlideWidth){arxSliderDotsCount=this.nbSlides-Math.floor(arxSliderSlidesToShow)+1}else{const arxSliderPadding=this.getHorizontalPadding() 457const arxSliderGap=parseFloat(getComputedStyle(this.container).gap)||0 458const arxSliderAvailableWidth=this.container.clientWidth-arxSliderPadding 459let arxSliderVisibleSlides=0 460let arxSliderAccumulatedWidth=0 461for(const arxSliderSlide of this.slideList){const arxSliderSlideWidth=arxSliderSlide.offsetWidth 462if(arxSliderVisibleSlides>0){arxSliderAccumulatedWidth+=arxSliderGap} 463if((arxSliderAccumulatedWidth+arxSliderSlideWidth)<=arxSliderAvailableWidth){arxSliderAccumulatedWidth+=arxSliderSlideWidth 464arxSliderVisibleSlides++}else{break}} 465arxSliderDotsCount=Math.max(1,this.nbSlides-Math.max(1,arxSliderVisibleSlides)+1)} 466this.nbPages=arxSliderDotsCount 467const arxSliderExistingDots=this.getDotsContainer() 468if(arxSliderExistingDots){arxSliderExistingDots.remove()} 469if(arxSliderDotsCount<2){return} 470const arxSliderDotsWrapper=document.createElement('div') 471arxSliderDotsWrapper.className='arx-slider-dots' 472for(let arxSliderDotIndex=0;arxSliderDotIndex<arxSliderDotsCount;arxSliderDotIndex++){const arxSliderDot=document.createElement('div') 473arxSliderDot.className=arxSliderDotIndex===0?'arx-slider-dot active':'arx-slider-dot' 474arxSliderDotsWrapper.appendChild(arxSliderDot)} 475this.container.appendChild(arxSliderDotsWrapper)} 476placeArrows(){const arxSliderExistingArrows=this.getArrowsContainer() 477if(arxSliderExistingArrows){return} 478const arxSliderArrowsWrapper=document.createElement('div') 479arxSliderArrowsWrapper.className='arx-slider-arrows' 480const arxSliderLeftArrow=document.createElement('div') 481const arxSliderRightArrow=document.createElement('div') 482arxSliderLeftArrow.className='arx-slider-arrow-left disabled' 483arxSliderRightArrow.className='arx-slider-arrow-right' 484arxSliderLeftArrow.style.backgroundImage=`url("${this.options.arrowUrl}")` 485arxSliderRightArrow.style.backgroundImage=`url("${this.options.arrowUrl}")` 486arxSliderArrowsWrapper.appendChild(arxSliderLeftArrow) 487arxSliderArrowsWrapper.appendChild(arxSliderRightArrow) 488this.container.appendChild(arxSliderArrowsWrapper)} 489placeBorderGradients(){this.ensureBorderGradients()}
490updateArrowsVerticalAlignment(){const arxSliderArrows=this.getArrowsContainer() 491if(!arxSliderArrows){return} 492const arxSliderContainerStyle=getComputedStyle(this.container) 493const arxSliderPaddingTop=parseFloat(arxSliderContainerStyle.paddingTop)||0 494const arxSliderPaddingBottom=parseFloat(arxSliderContainerStyle.paddingBottom)||0 495const arxSliderInnerHeight=this.container.clientHeight-arxSliderPaddingTop-arxSliderPaddingBottom 496const arxSliderVerticalCenter=arxSliderPaddingTop+(Math.max(0,arxSliderInnerHeight)/2) 497arxSliderArrows.style.top=`${arxSliderVerticalCenter}px`} 498syncNavigationForViewport(){const arxSliderDots=this.getDotsContainer() 499if(arxSliderDots){arxSliderDots.style.display=this.getCurrentDisplayDots()?'':'none'} 500this.placeBorderGradients() 501this.placeArrows() 502this.updateArrowsVerticalAlignment() 503const arxSliderArrows=this.getArrowsContainer() 504if(arxSliderArrows){arxSliderArrows.style.display=this.getCurrentDisplayArrows()?'':'none'} 505this.updateBorderGradientState()} 506handleResize(){if(!this.updateEnabledState()){return} 507if(this.viewportWidth===window.innerWidth){return} 508this.viewportWidth=window.innerWidth 509this.container.style.maxWidth=`${this.viewportWidth}px` 510this.syncNavigationForViewport() 511for(const arxSliderSlide of this.slideList){arxSliderSlide.style.removeProperty('min-width')} 512const arxSliderPadding=this.getHorizontalPadding() 513const arxSliderGap=parseFloat(getComputedStyle(this.container).gap)||0 514this.placeDots() 515this.syncNavigationForViewport() 516const arxSliderSlidesToShow=this.getCurrentSlidesToShow() 517const arxSliderSlideWidth=(this.container.clientWidth-((arxSliderGap*(arxSliderSlidesToShow-1))+arxSliderPadding))/arxSliderSlidesToShow 518for(const arxSliderSlide of this.slideList){arxSliderSlide.style.minWidth=`${arxSliderSlideWidth}px`} 519this.applyEqualHeight() 520const arxSliderMetrics=this.computeSlidesMetrics() 521if(arxSliderMetrics.totalSlidesWidth<=arxSliderMetrics.availableWidth){if(!this.hasCompletedInitialLayout){this.activeSlide=0 522this.currentDomIndex=this.getDOMIndex(0) 523this.hasCompletedInitialLayout=!0} 524this.centerSlidesAndDisableNavigation(arxSliderMetrics) 525return} 526this.updateArrowsVerticalAlignment() 527this.showNavigation() 528this.enableHandlers() 529if(this.hasCompletedInitialLayout&&!this.initialPositionLocked){this.snapToClosestSlide()}else{this.initializeAtFirstSlide()}} 530centerSlidesAndDisableNavigation(metrics){const arxSliderSpareWidth=metrics.availableWidth-metrics.totalSlidesWidth 531const arxSliderTargetLeft=this.container.getBoundingClientRect().left+metrics.containerPaddingLeft+(arxSliderSpareWidth/2) 532const arxSliderFirstSlide=this.slideList[this.getDOMIndex(0)] 533const arxSliderFirstSlideTranslateX=this.getSlideTranslateX(arxSliderFirstSlide) 534const arxSliderFirstSlideLeft=arxSliderFirstSlide.getBoundingClientRect().left 535const arxSliderTranslateOffset=arxSliderFirstSlideLeft-arxSliderTargetLeft 536this.setSlidesTranslateX(arxSliderFirstSlideTranslateX-arxSliderTranslateOffset,'0.5s ease-in-out') 537this.resetSlidesTransitionAfterDelay() 538this.clearAutoplayTimeout(!0) 539this.hideNavigation() 540this.disableHandlers()} 541hideNavigation(){const arxSliderDots=this.getDotsContainer() 542const arxSliderArrows=this.getArrowsContainer() 543const arxSliderBorderGradients=this.getBorderGradientsContainer() 544if(arxSliderDots){arxSliderDots.style.display='none'} 545if(arxSliderArrows){arxSliderArrows.style.display='none'} 546if(arxSliderBorderGradients){arxSliderBorderGradients.style.display='none'}} 547showNavigation(){const arxSliderDots=this.getDotsContainer() 548const arxSliderArrows=this.getArrowsContainer() 549if(arxSliderDots){arxSliderDots.style.display=this.getCurrentDisplayDots()?'':'none'} 550if(arxSliderArrows){arxSliderArrows.style.display=this.getCurrentDisplayArrows()?'':'none'} 551this.updateBorderGradientState()} 552updateArrowState(){const{left,right}=this.getArrowElements() 553if(!left||!right){return} 554if(this.options.infinite){left.classList.remove('disabled') 555right.classList.remove('disabled') 556return} 557left.classList.toggle('disabled',this.activeSlide===0) 558right.classList.toggle('disabled',this.activeSlide===this.nbPages-1)}
559updateBorderGradientState(){const arxSliderBorderGradients=this.ensureBorderGradients() 560if(!arxSliderBorderGradients){return} 561if(!this.shouldDisplayBorderGradient()){arxSliderBorderGradients.wrapper.style.display='none' 562return} 563arxSliderBorderGradients.wrapper.style.display='' 564arxSliderBorderGradients.left.classList.toggle('disabled',this.activeSlide===0) 565arxSliderBorderGradients.right.classList.toggle('disabled',this.activeSlide===this.nbPages-1)} 566getRemainingWidthFromActiveSlide(containerGap){let arxSliderRemainingWidth=0 567for(let arxSliderSlideIndex=this.activeSlide;arxSliderSlideIndex<this.slideList.length;arxSliderSlideIndex++){if(arxSliderSlideIndex>this.activeSlide){arxSliderRemainingWidth+=containerGap} 568arxSliderRemainingWidth+=this.slideList[arxSliderSlideIndex].offsetWidth} 569return arxSliderRemainingWidth} 570alignLastSlideToRight(metrics){const arxSliderLastSlide=this.slideList[this.slideList.length-1] 571const arxSliderTargetLeft=this.container.getBoundingClientRect().left+metrics.containerPaddingLeft+(metrics.availableWidth-arxSliderLastSlide.offsetWidth) 572const arxSliderLastSlideTranslateX=this.getSlideTranslateX(arxSliderLastSlide) 573const arxSliderLastSlideLeft=arxSliderLastSlide.getBoundingClientRect().left 574const arxSliderTranslateOffset=arxSliderLastSlideLeft-arxSliderTargetLeft 575this.setSlidesTranslateX(arxSliderLastSlideTranslateX-arxSliderTranslateOffset,'0.5s ease-in-out') 576this.resetSlidesTransitionAfterDelay() 577this.activeSlide=Math.max(0,this.nbPages-1) 578this.currentDomIndex=this.getDOMIndex(this.activeSlide)} 579alignActiveSlideToLeft(containerPaddingLeft){const arxSliderTargetDomIndex=this.options.infinite?this.getClosestInfiniteDomIndex(this.activeSlide):this.getDOMIndex(this.activeSlide) 580const arxSliderTargetSlide=this.slideList[arxSliderTargetDomIndex] 581const arxSliderTargetTranslateX=this.getSlideTranslateX(arxSliderTargetSlide) 582const arxSliderTargetSlideLeft=arxSliderTargetSlide.getBoundingClientRect().left 583const arxSliderContainerLeft=this.container.getBoundingClientRect().left+containerPaddingLeft 584const arxSliderTranslateOffset=arxSliderTargetSlideLeft-arxSliderContainerLeft 585this.setSlidesTranslateX(arxSliderTargetTranslateX-arxSliderTranslateOffset,'0.5s ease-in-out') 586this.resetSlidesTransitionAfterDelay() 587this.currentDomIndex=arxSliderTargetDomIndex 588return this.resetInfinitePosition(arxSliderTargetDomIndex)} 589resetInfinitePosition(targetDomIndex){if(!this.options.infinite){return!1} 590const arxSliderOriginalTargetIndex=this.getDOMIndex(this.activeSlide) 591if(targetDomIndex===arxSliderOriginalTargetIndex){this.currentDomIndex=arxSliderOriginalTargetIndex 592return!1} 593if(this.infiniteResetTimeout){clearTimeout(this.infiniteResetTimeout)} 594this.infiniteResetTimeout=setTimeout(()=>{const arxSliderTargetSlide=this.slideList[arxSliderOriginalTargetIndex] 595if(!arxSliderTargetSlide){return} 596const arxSliderTargetTranslateX=this.getSlideTranslateX(arxSliderTargetSlide) 597const arxSliderTargetSlideLeft=arxSliderTargetSlide.getBoundingClientRect().left 598const arxSliderContainerStyle=getComputedStyle(this.container) 599const arxSliderPaddingLeft=parseFloat(arxSliderContainerStyle.paddingLeft)||0 600const arxSliderContainerLeft=this.container.getBoundingClientRect().left+arxSliderPaddingLeft 601const arxSliderTranslateOffset=arxSliderTargetSlideLeft-arxSliderContainerLeft 602this.setSlidesTranslateX(arxSliderTargetTranslateX-arxSliderTranslateOffset) 603this.currentDomIndex=arxSliderOriginalTargetIndex 604this.restartAutoplay()},ARX_SLIDER_TRANSITION_DURATION_MS+20) 605return!0} 606updateActiveDot(){const arxSliderDotsContainer=this.getDotsContainer() 607if(!arxSliderDotsContainer){return} 608const arxSliderDots=Array.from(arxSliderDotsContainer.children) 609for(const[arxSliderDotIndex,arxSliderDot]of arxSliderDots.entries()){arxSliderDot.classList.toggle('active',arxSliderDotIndex===this.activeSlide)}} 610applySlideChange(){this.updateArrowState() 611this.updateBorderGradientState() 612const arxSliderMetrics=this.computeSlidesMetrics() 613if(arxSliderMetrics.totalSlidesWidth<=arxSliderMetrics.availableWidth){this.centerSlidesAndDisableNavigation(arxSliderMetrics) 614return} 615this.showNavigation() 616this.enableHandlers()
617const arxSliderHasProgressTransition=this.beginProgressBarSlideTransition() 618const arxSliderRemainingWidth=this.getRemainingWidthFromActiveSlide(arxSliderMetrics.containerGap) 619let arxSliderDeferredAutoplayRestart=!1 620if(!this.options.infinite&&arxSliderRemainingWidth<arxSliderMetrics.availableWidth){this.alignLastSlideToRight(arxSliderMetrics)}else{arxSliderDeferredAutoplayRestart=this.alignActiveSlideToLeft(arxSliderMetrics.containerPaddingLeft)} 621this.updateArrowState() 622this.updateActiveDot() 623this.updateBorderGradientState() 624if(arxSliderDeferredAutoplayRestart){this.stopAutoplayTimeout() 625return} 626if(arxSliderHasProgressTransition){this.scheduleAutoplayRestartAfterSlideTransition() 627return} 628this.restartAutoplay()} 629ArxSliderEnableHandlers(){this.enableHandlers()} 630ArxSliderDisableHandlers(){this.disableHandlers()} 631ArxSliderCheckIfEnabled(){this.updateEnabledState()} 632ArxSliderResizeHandler(){this.handleResize()} 633ArxSliderPlaceDots(){this.placeDots()} 634ArxSliderPlaceArrows(){this.placeArrows()} 635ArxSliderLeftArrowHandler(){this.handleLeftArrowClick()} 636ArxSliderRightArrowHandler(){this.handleRightArrowClick()} 637ArxSliderMobileDragAndDropHandler(event){this.handleMobileDragStart(event)} 638ArxSliderDragAndDropHandler(event){this.handleDesktopDragStart(event)} 639ArxSliderSnapSlide(){this.snapToClosestSlide()} 640destroy(){try{this.disableHandlers() 641this.container.removeEventListener('click',this.handleDotsClick) 642this.container.removeEventListener('click',this.preventClickAfterDrag,!0) 643window.removeEventListener('resize',this.handleResize) 644clearTimeout(this.infiniteResetTimeout) 645clearTimeout(this.dragClickSuppressionTimeout) 646this.clearAutoplayTimeout() 647this.cancelProgressBarAsyncWork() 648const arxSliderDots=this.getDotsContainer() 649const arxSliderArrows=this.getArrowsContainer() 650const arxSliderBorderGradients=this.getBorderGradientsContainer() 651if(arxSliderDots){arxSliderDots.remove()} 652if(arxSliderArrows){arxSliderArrows.remove()} 653if(arxSliderBorderGradients){arxSliderBorderGradients.remove()} 654if(this.options.infinite){for(const arxSliderClone of Array.from(this.container.querySelectorAll('[data-arx-clone]'))){arxSliderClone.remove()}} 655this.container.style.maxWidth='' 656if(this.originalInlineOverflowY){this.container.style.overflowY=this.originalInlineOverflowY}else{this.container.style.removeProperty('overflow-y')} 657if(this.originalInlineOverscrollBehaviorY){this.container.style.overscrollBehaviorY=this.originalInlineOverscrollBehaviorY}else{this.container.style.removeProperty('overscroll-behavior-y')} 658if(this.originalDisplayArrowsOnHoverAttr!==null){this.container.setAttribute('data-display-arrows-onhover',this.originalDisplayArrowsOnHoverAttr)}else{this.container.removeAttribute('data-display-arrows-onhover')} 659this.container.classList.remove('arx-slider-instance') 660this.container.classList.remove('arx-slider-interactive') 661delete this.container.dataset.arxSliderTarget 662for(const arxSliderSlide of this.slideList){arxSliderSlide.classList.remove('arx-slider-progress-host') 663if(arxSliderSlide.dataset.arxSliderProgressPositioned==='true'){arxSliderSlide.style.removeProperty('position') 664delete arxSliderSlide.dataset.arxSliderProgressPositioned} 665arxSliderSlide.style.removeProperty('min-width') 666arxSliderSlide.style.removeProperty('height') 667arxSliderSlide.style.removeProperty('transform') 668arxSliderSlide.style.removeProperty('transition')} 669const arxSliderArrowsAfterCleanup=this.getArrowsContainer() 670if(arxSliderArrowsAfterCleanup){arxSliderArrowsAfterCleanup.style.removeProperty('top')} 671if(this.progressBarElements?.wrapper){this.progressBarElements.wrapper.remove()} 672this.currentProgressBarHost=null 673this.borderGradientElements=null 674this.progressBarElements=null}catch(error){console.error('ARXSlider.destroy error',error)}}} 675function arxGetSliderTargetSelector(container){return(container.getAttribute('data-slider-target')||'').trim()} 676function arxResolveSliderTargets(container){const arxSliderTargetSelector=arxGetSliderTargetSelector(container) 677if(!arxSliderTargetSelector){return[container]} 678try{const arxSliderScopedTargets=Array.from(container.querySelectorAll(arxSliderTargetSelector))
679const arxSliderResolvedTargets=new Set(arxSliderScopedTargets) 680arxSliderResolvedTargets.delete(container) 681return Array.from(arxSliderResolvedTargets)}catch(error){console.error(`Invalid ARX slider target selector "${arxSliderTargetSelector}"`,error) 682return[]}} 683function arxGetSliderOptions(container){const arxSliderDesktopSlidesToShow=parseFloat(container.getAttribute('data-desktop-slide-to-show'))||3 684const arxSliderTabletSlidesToShow=parseFloat(container.getAttribute('data-tablet-slide-to-show'))||2 685const arxSliderMobileSlidesToShow=parseFloat(container.getAttribute('data-mobile-slide-to-show'))||1 686const arxSliderTabletBreakpoint=parseInt(container.getAttribute('data-tablet-breakpoint'),10)||980 687const arxSliderMobileBreakpoint=parseInt(container.getAttribute('data-mobile-breakpoint'),10)||768 688const arxSliderAutoplay=parseBoolAttr(container,'data-autoplay',!1) 689const arxSliderAutoplayDuration=parseInt(container.getAttribute('data-autoplay-duration'),10) 690const arxSliderInfinite=parseBoolAttr(container,'data-infinite',!1) 691const arxSliderBorderGradient=parseBoolAttr(container,'data-border-gradient',!1)&&!arxSliderAutoplay&&!arxSliderInfinite 692const arxSliderBorderGradientFallback=window.arxDesignSystemSlider?.borderGradientColor||window.arxCpcSlider?.borderGradientColor||'#ffffff' 693const arxSliderBorderGradientColor=parseCssColorAttr(container,'data-border-gradient-color',arxSliderBorderGradientFallback) 694const arxSliderDisplayDots=parseResponsiveBoolAttrWithFalseCascade(container,{desktop:'data-display-dots-desktop',tablet:'data-display-dots-tablet',mobile:'data-display-dots-mobile'},!0) 695const arxSliderDisplayArrows=parseResponsiveBoolAttrWithFalseCascade(container,{desktop:'data-display-arrows-desktop',tablet:'data-display-arrows-tablet',mobile:'data-display-arrows-mobile'},!0) 696return{desktopSlideToShow:arxSliderDesktopSlidesToShow,tabletSlideToShow:arxSliderTabletSlidesToShow,mobileSlidestoShow:arxSliderMobileSlidesToShow,tabletBreakpoint:arxSliderTabletBreakpoint,mobileBreakpoint:arxSliderMobileBreakpoint,enableOnDesktop:parseBoolAttr(container,'data-enable-on-desktop',!0),enableOnTablet:parseBoolAttr(container,'data-enable-on-tablet',!0),enableOnMobile:parseBoolAttr(container,'data-enable-on-mobile',!0),displayDotsDesktop:arxSliderDisplayDots.desktop,displayDotsTablet:arxSliderDisplayDots.tablet,displayDotsMobile:arxSliderDisplayDots.mobile,displayArrowsDesktop:arxSliderDisplayArrows.desktop,displayArrowsTablet:arxSliderDisplayArrows.tablet,displayArrowsMobile:arxSliderDisplayArrows.mobile,displayArrowsOnHover:parseBoolAttr(container,'data-display-arrows-onhover',!0),borderGradient:arxSliderBorderGradient,borderGradientColor:arxSliderBorderGradientColor,arrowUrl:container.getAttribute('data-arrow-url')||ARX_SLIDER_DEFAULT_ARROW_URL,customSlideWidth:parseBoolAttr(container,'data-custom-slide-width',!1),equalHeight:parseBoolAttr(container,'data-equal-height',!0),displayProgressBar:parseBoolAttr(container,'data-display-progress-bar',!0),infinite:arxSliderAutoplay||arxSliderInfinite,autoplay:arxSliderAutoplay,autoplayDuration:Number.isFinite(arxSliderAutoplayDuration)&&arxSliderAutoplayDuration>0?arxSliderAutoplayDuration:ARX_SLIDER_DEFAULT_AUTOPLAY_DURATION_MS}} 697function arxShouldEnableSliderForViewport(options,viewportWidth=window.innerWidth){if(viewportWidth>options.tabletBreakpoint){return options.enableOnDesktop} 698if(viewportWidth>options.mobileBreakpoint){return options.enableOnTablet} 699return options.enableOnMobile} 700const ARX_SLIDER_REGISTRY=new Map() 701const ARX_SLIDER_SOURCE_REGISTRY=new Map() 702const ARX_SLIDER_TARGET_OWNER_REGISTRY=new Map() 703function arxInitializeSliderTarget(arxSliderTarget,arxSliderSource){if(ARX_SLIDER_REGISTRY.has(arxSliderTarget)){return} 704const arxSliderInstance=new ARXSlider(arxSliderTarget,arxSliderSource) 705ARX_SLIDER_REGISTRY.set(arxSliderTarget,arxSliderInstance)} 706function arxDestroySliderInstance(container,preserveRegistration=!1){const arxSliderInstance=ARX_SLIDER_REGISTRY.get(container) 707if(arxSliderInstance){try{if(typeof arxSliderInstance.destroy==='function'){arxSliderInstance.destroy()}
707else if(typeof arxSliderInstance.ArxSliderDisableHandlers==='function'){arxSliderInstance.ArxSliderDisableHandlers()}else if(typeof arxSliderInstance.disableHandlers==='function'){arxSliderInstance.disableHandlers()}}catch(error){console.error('Error destroying ARXSlider instance',error)} 708ARX_SLIDER_REGISTRY.delete(container) 709container.classList.remove('arx-slider-enabled')} 710if(preserveRegistration){return} 711const arxSliderTargetOwner=ARX_SLIDER_TARGET_OWNER_REGISTRY.get(container) 712if(arxSliderTargetOwner){ARX_SLIDER_TARGET_OWNER_REGISTRY.delete(container) 713const arxSliderOwnedTargets=ARX_SLIDER_SOURCE_REGISTRY.get(arxSliderTargetOwner) 714if(Array.isArray(arxSliderOwnedTargets)){ARX_SLIDER_SOURCE_REGISTRY.set(arxSliderTargetOwner,arxSliderOwnedTargets.filter((arxSliderTarget)=>arxSliderTarget!==container))}}} 715function arxReconcileSliderResponsiveState(){for(const[arxSliderSource,arxSliderTargets]of ARX_SLIDER_SOURCE_REGISTRY.entries()){const arxSliderShouldEnable=arxShouldEnableSliderForViewport(arxGetSliderOptions(arxSliderSource)) 716for(const arxSliderTarget of arxSliderTargets){if(arxSliderShouldEnable){arxInitializeSliderTarget(arxSliderTarget,arxSliderSource)}else{arxDestroySliderInstance(arxSliderTarget,!0)}}}} 717function arxSyncSliderInteractiveStates(changedElement=null){for(const arxSliderInstance of ARX_SLIDER_REGISTRY.values()){if(changedElement&&changedElement!==arxSliderInstance.container&&!changedElement.contains(arxSliderInstance.container)){continue} 718arxSliderInstance.updateInteractiveState()}} 719const arxSliderInteractiveStateObserver=typeof MutationObserver==='function'?new MutationObserver((mutations)=>{const arxSliderChangedAncestors=new Set(mutations.map((mutation)=>mutation.target)) 720for(const arxSliderChangedAncestor of arxSliderChangedAncestors){arxSyncSliderInteractiveStates(arxSliderChangedAncestor)}}):null 721function arxSetPageLoadSettled(){arxSliderPageLoadSettled=!0 722for(const arxSliderInstance of ARX_SLIDER_REGISTRY.values()){if(typeof arxSliderInstance.resumeAutoplayAfterPageLoad==='function'){arxSliderInstance.resumeAutoplayAfterPageLoad()} 723arxSliderInstance.releaseInitialPositionLock()}} 724if(!arxSliderPageLoadSettled){window.addEventListener('load',()=>{setTimeout(()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{arxSetPageLoadSettled()})})},ARX_SLIDER_PAGE_LOAD_SETTLE_DELAY_MS)},{once:!0})} 725function arxInitSliders(root=document){const arxSliderSources=Array.from(root.querySelectorAll('.arx-slider')) 726if(!arxSliderSources.length){return} 727const arxSliderDefinitions=arxSliderSources.map((arxSliderSource)=>({source:arxSliderSource,targetSelector:arxGetSliderTargetSelector(arxSliderSource),targets:arxResolveSliderTargets(arxSliderSource)})) 728for(const arxSliderDefinition of arxSliderDefinitions){const{source,targetSelector,targets}=arxSliderDefinition 729if(!targetSelector){continue} 730for(const arxSliderTarget of targets){const arxSliderExistingOwner=ARX_SLIDER_TARGET_OWNER_REGISTRY.get(arxSliderTarget) 731if(arxSliderExistingOwner&&arxSliderExistingOwner!==source){console.warn('ARX slider target already managed by another source. Skipping duplicate target.',arxSliderTarget) 732continue} 733ARX_SLIDER_TARGET_OWNER_REGISTRY.set(arxSliderTarget,source)}} 734for(const arxSliderDefinition of arxSliderDefinitions){const{source,targetSelector}=arxSliderDefinition 735if(ARX_SLIDER_SOURCE_REGISTRY.has(source)){continue} 736let arxSliderTargets=arxSliderDefinition.targets 737if(!targetSelector){const arxSliderTargetOwner=ARX_SLIDER_TARGET_OWNER_REGISTRY.get(source) 738if(arxSliderTargetOwner&&arxSliderTargetOwner!==source){console.warn('ARX slider source is already targeted by another slider configuration. Skipping direct initialization.',source) 739continue}}else{arxSliderTargets=arxSliderTargets.filter((arxSliderTarget)=>{return ARX_SLIDER_TARGET_OWNER_REGISTRY.get(arxSliderTarget)===source})} 740if(!arxSliderTargets.length){ARX_SLIDER_SOURCE_REGISTRY.set(source,[]) 741continue} 742ARX_SLIDER_SOURCE_REGISTRY.set(source,arxSliderTargets) 743if(!arxShouldEnableSliderForViewport(arxGetSliderOptions(source))){continue}
744for(const arxSliderTarget of arxSliderTargets){arxInitializeSliderTarget(arxSliderTarget,source)}}} 745function arxDestroySliders(container){if(ARX_SLIDER_SOURCE_REGISTRY.has(container)){const arxSliderTargets=ARX_SLIDER_SOURCE_REGISTRY.get(container)||[] 746ARX_SLIDER_SOURCE_REGISTRY.delete(container) 747for(const arxSliderTarget of arxSliderTargets){arxDestroySliders(arxSliderTarget)} 748return} 749arxDestroySliderInstance(container)} 750function arxReinitSliders(root=document){for(const arxSliderContainer of root.querySelectorAll('.arx-slider')){if(ARX_SLIDER_SOURCE_REGISTRY.has(arxSliderContainer)||ARX_SLIDER_REGISTRY.has(arxSliderContainer)){arxDestroySliders(arxSliderContainer)}} 751arxInitSliders(root)} 752window.arx_init_sliders=arxInitSliders 753window.arx_reinit_sliders=arxReinitSliders 754window.arx_destroy_slider=arxDestroySliders 755try{arxInitSliders(document) 756window.addEventListener('resize',arxReconcileSliderResponsiveState) 757if(arxSliderInteractiveStateObserver){arxSliderInteractiveStateObserver.observe(document.documentElement,{attributes:!0,subtree:!0,attributeFilter:['aria-hidden','class','hidden','inert','style']})} 758document.addEventListener('transitionend',(event)=>{arxSyncSliderInteractiveStates(event.target)},!0) 759document.addEventListener('animationend',(event)=>{arxSyncSliderInteractiveStates(event.target)},!0)}catch(error){console.error('Error initializing ARX sliders on DOMContentLoaded',error)} 760function closestToZero(array){if(!array||!array.length){return 0} 761return array.reduce((closestValue,currentValue)=>{const arxSliderCurrentDistance=Math.abs(currentValue) 762const arxSliderClosestDistance=Math.abs(closestValue) 763if(arxSliderCurrentDistance<arxSliderClosestDistance){return currentValue} 764if(arxSliderCurrentDistance===arxSliderClosestDistance&¤tValue>
764closestValue){return currentValue} 765return closestValue})} 766function parseBoolAttr(element,attributeName,defaultValue=!0){const arxSliderAttributeValue=element.getAttribute(attributeName) 767if(arxSliderAttributeValue===null){return defaultValue} 768if(arxSliderAttributeValue===''){return!0} 769if(arxSliderAttributeValue==='true'){return!0} 770if(arxSliderAttributeValue==='false'){return!1} 771return defaultValue} 772function parseOptionalBoolAttr(element,attributeName){const arxSliderAttributeValue=element.getAttribute(attributeName) 773if(arxSliderAttributeValue===null){return null} 774if(arxSliderAttributeValue===''){return!0} 775if(arxSliderAttributeValue==='true'){return!0} 776if(arxSliderAttributeValue==='false'){return!1} 777return null} 778function parseResponsiveBoolAttrWithFalseCascade(element,attributes,defaultValue=!0){const arxSliderDesktopValue=parseOptionalBoolAttr(element,attributes.desktop) 779const arxSliderResolvedDesktopValue=arxSliderDesktopValue===null?defaultValue:arxSliderDesktopValue 780const arxSliderTabletValue=parseOptionalBoolAttr(element,attributes.tablet) 781const arxSliderResolvedTabletValue=arxSliderTabletValue===null?(arxSliderResolvedDesktopValue===!1?!1:defaultValue):arxSliderTabletValue 782const arxSliderMobileValue=parseOptionalBoolAttr(element,attributes.mobile) 783const arxSliderResolvedMobileValue=arxSliderMobileValue===null?(arxSliderResolvedTabletValue===!1?!1:defaultValue):arxSliderMobileValue 784return{desktop:arxSliderResolvedDesktopValue,tablet:arxSliderResolvedTabletValue,mobile:arxSliderResolvedMobileValue}} 785function parseCssColorAttr(element,attributeName,fallbackValue='#ffffff'){const arxSliderAttributeValue=(element.getAttribute(attributeName)||'').trim() 786if(!arxSliderAttributeValue){return fallbackValue} 787if(typeof CSS!=='undefined'&&typeof CSS.supports==='function'&&CSS.supports('color',arxSliderAttributeValue)){return arxSliderAttributeValue} 788const arxSliderColorProbe=document.createElement('span') 789arxSliderColorProbe.style.color='' 790arxSliderColorProbe.style.color=arxSliderAttributeValue 791return arxSliderColorProbe.style.color?arxSliderAttributeValue:fallbackValue}}) 792;
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.