https://dartmoor-bikes.com/sites/dartmoor/files/js/js_JqB24fWySNM35XZcFTp2VavWGAgOigHT5Gcb3wxuTa8.js
vendor: 15,571 bytes, lines 1-94
1/* instafeed.js | v2.0.0 | https://github.com/stevenschobert/instafeed.js | License: MIT */ 2!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).Instafeed=t()}(this,function(){"use strict";function e(e,t){if(!e)throw new Error(t)}function t(t){e(!t||"object"==typeof t,"options must be an object, got "+t+" ("+typeof t+")");var o={accessToken:null,accessTokenTimeout:1e4,after:null,apiTimeout:1e4,apiLimit:null,before:null,debug:!1,error:null,filter:null,limit:null,mock:!1,render:null,sort:null,success:null,target:"instafeed",template:'<a href="{{link}}"><img title="{{caption}}" src="{{image}}" /></a>',templateBoundaries:["{{","}}"],transform:null};if(t)for(var n in o)"undefined"!=typeof t[n]&&(o[n]=t[n]);e("string"==typeof o.target||"object"==typeof o.target,"target must be a string or DOM node, got "+o.target+" ("+typeof o.target+")"),e("string"==typeof o.accessToken||"function"==typeof o.accessToken,"accessToken must be a string or function, got "+o.accessToken+" ("+typeof o.accessToken+")"),e("number"==typeof o.accessTokenTimeout,"accessTokenTimeout must be a number, got "+o.accessTokenTimeout+" ("+typeof o.accessTokenTimeout+")"),e("number"==typeof o.apiTimeout,"apiTimeout must be a number, got "+o.apiTimeout+" ("+typeof o.apiTimeout+")"),e("boolean"==typeof o.debug,"debug must be true or false, got "+o.debug+" ("+typeof o.debug+")"),e("boolean"==typeof o.mock,"mock must be true or false, got "+o.mock+" ("+typeof o.mock+")"),e("object"==typeof o.templateBoundaries&&2===o.templateBoundaries.length&&"string"==typeof o.templateBoundaries[0]&&"string"==typeof o.templateBoundaries[1],"templateBoundaries must be an array of 2 strings, got "+o.templateBoundaries+" ("+typeof o.templateBoundaries+")"),e(!o.template||"string"==typeof o.template,"template must null or string, got "+o.template+" ("+typeof o.template+")"),e(!o.error||"function"==typeof o.error,"error must be null or function, got "+o.error+" ("+typeof o.error+")"),e(!o.before||"function"==typeof o.before,"before must be null or function, got "+o.before+" ("+typeof o.before+")"),e(!o.after||"function"==typeof o.after,"after must be null or function, got "+o.after+" ("+typeof o.after+")"),e(!o.success||"function"==typeof o.success,"success must be null or function, got "+o.success+" ("+typeof o.success+")"),e(!o.filter||"function"==typeof o.filter,"filter must be null or function, got "+o.filter+" ("+typeof o.filter+")"),e(!o.transform||"function"==typeof o.transform,"transform must be null or function, got "+o.transform+" ("+typeof o.transform+")"),e(!o.sort||"function"==typeof o.sort,"sort must be null or function, got "+o.sort+" ("+typeof o.sort+")"),e(!o.render||"function"==typeof o.render,"render must be null or function, got "+o.render+" ("+typeof o.render+")"),e(!o.limit||"number"==typeof o.limit,"limit must be null or number, got "+o.limit+" ("+typeof o.limit+")"),e(!o.apiLimit||"number"==typeof o.apiLimit,"apiLimit must null or number, got "+o.apiLimit+" ("+typeof o.apiLimit+")"),this._state={running:!1,node:null,token:null,paging:null,pool:[]},this._options=o}return t.prototype.run=function(){var e=this;return this._debug("run","options",this._options),this._debug("run","state",this._state),this._state.running?(this._debug("run","already running, skipping"),!1):(this._start(),this._debug("run","getting dom node"),"string"==typeof this._options.target?this._state.node=document.getElementById(this._options.target):this._state.node=this._options.target,this._state.node?(this._debug("run","got dom node",this._state.node),this._debug("run","getting access token"),this._getAccessToken(function(t,o){if(t)return e._debug("onTokenReceived","error",t),void e._fail(new Error("error getting access token: "+t.message));e._debug("onTokenReceived","got token",o),e._state.token=o,e._showNext(function(t){if(t)return e._debug("onNextShown","error",t),void e._fail(t);e._finish()})}),!0):(this._fail(new Error("no element found with ID "+this._options.target)),!1))},t.prototype.hasNext=function(){var e=this._state.paging,t=this._state.pool;return this._debug("hasNext","paging",e),this._debug("hasNext","pool",t.length,t),t.length>0||e&&"string"==typeof e.next},t.prototype.next=function(){var e=this;return e.hasNext()?e._state.running?(e._debug("next","already running, skipping"),!1):(e._start(),void e._showNext(function(t){if(t)return e._debug("onNextShown","error",t),void e._fail(t);e._finish()})):(e._debug("next","hasNext is false, skipping"),!1)},t.prototype._showNext=function(e){var t=this,o=null,n=null,i="number"==typeof this._options.limit;if(t._debug("showNext","pool",t._state.pool.length,t._state.pool),t._state.pool.length>0){if(n=i?t._state.pool.splice(0,t._options.limit):t._state.pool.splice(0),t._debug("showNext","items from pool",n.length,n),t._debug("showNext","updated pool",t._state.pool.length,t._state.pool),t._options.mock)t._debug("showNext","mock enabled, skipping render");else try{t._renderData(n)}catch(s){return void e(s)}e(null)}else t._state.paging&&"string"==typeof t._state.paging.next?o=t._state.paging.next:(o="https://graph.instagram.com/me/media?fields=caption,id,media_type,media_url,permalink,thumbnail_url,timestamp,username&access_token="+t._state.token,t._options.apiLimit||"number"!=typeof t._options.limit?"number"==typeof t._options.apiLimit&&(t._debug("showNext","apiLimit set, overriding limit",t._options.apiLimit,t._options.limit),o=o+"&limit="+t._options.apiLimit):(t._debug("showNext","no apiLimit set, falling back to limit",t._options.apiLimit,t._options.limit),o=o+"&limit="+t._options.limit)),t._debug("showNext","making request",o),t._makeApiRequest(o,function(o,n){var i=null;if(o)return t._debug("onResponseReceived","error",o),void e(new Error("api request error: "+o.message));t._debug("onResponseReceived","data",n),t._success(n),t._debug("onResponseReceived","setting paging",n.paging),t._state.paging=n.paging;try{if(i=t._processData(n),t._debug("onResponseReceived","processed data",i),i.unused&&i.unused.length>0){t._debug("onResponseReceived","saving unused to pool",i.unused.length,i.unused);for(var r=0;r<i.unused.length;r++)t._state.pool.push(i.unused[r])}}catch(a){return void e(a)}if(t._options.mock)t._debug("onResponseReceived","mock enabled, skipping append");else try{t._renderData(i.items)}catch(s){return void e(s)}e(null)})},t.prototype._processData=function(e){var t="function"==typeof this._options.transform,o="function"==typeof this._options.filter,n="function"==typeof this._options.sort,i="number"==typeof this._options.limit,s=[],r=null,a=null,u=null,l=null,p=null;if(this._debug("processData","hasFilter",o,"hasTransform",t,"hasSort",n,"hasLimit",i),"object"!=typeof e||"object"!=typeof e.data||e.data.length<=0)return null;for(var c=0;c<e.data.length;c++){if(a=this._getItemData(e.data[c]),t)try{u=this._options.transform(a),this._debug("processData","transformed item",a,u)}catch(f){throw this._debug("processData","error calling transform",f),new Error("error in transform: "+f.message)}else u=a;if(o){try{l=this._options.filter(u),this._debug("processData","filter item result",u,l)}catch(f){throw this._debug("processData","error calling filter",f),new Error("error in filter: "+f.message)}l&&s.push(u)}else s.push(u)}if(n)try{s.sort(this._options.sort)}catch(f){throw this._debug("processData","error calling sort",f),new Error("error in sort: "+f.message)}return i&&(r=s.length-this._options.limit,this._debug("processData","checking limit",s.length,this._options.limit,r),r>0&&(p=s.slice(s.length-r),this._debug("processData","unusedItems",p.length,p),s.splice(s.length-r,r))),{items:s,unused:p}},t.prototype._extractTags=function(e){var t=/#([^\s]+)/gi,o=/[~`!@#$%^&*\(\)\-\+={}\[\]:;"'<>\?,\./|\\\s]+/i,n=[],i=null;if("string"==typeof e)for(;null!==(i=t.exec(e));)!1===o.test(i[1])&&n.push(i[1]);return n},t.prototype._getItemData=function(e){var t=null,o=null;switch(e.media_type){case"IMAGE":t="image",o=e.media_url;break;case"VIDEO":t="video",o=e.thumbnail_url;break;case"CAROUSEL_ALBUM":t="album",o=e.media_url}return{caption:e.caption,tags:this._extractTags(e.caption),id:e.id,image:o,link:e.permalink,model:e,timestamp:e.timestamp,type:t,username:e.username}},t.prototype._renderData=function(e){var t="string"==typeof this._options.template,o="function"==typeof this._options.render,n=null,i=null,s=null,r="";if(this._debug("renderData","hasTemplate",t,"hasRender",o),!("object"!=typeof e||e.length<=0)){for(var a=0;a<e.length;a++){if(n=e[a],o)try{i=this._options.render(n,this._options),this._debug("renderData","custom render result",n,i)}catch(u){throw this._debug("renderData","error calling render",u),new Error("error in render: "+u.message)}else t&&(i=this._basicRender(n));i?r+=i:this._debug("renderData","render item did not return any content",n)}for(this._debug("renderData","html content",r),(s=document.createElement("div")).innerHTML=r,this._debug("renderData","container",s,s.childNodes.length,s.childNodes);s.childNodes.length>0;)this._debug("renderData","appending child",s.childNodes[0]),this._state.node.appendChild(s.childNodes[0])}},t.prototype._basicRender=function(e){for(var t=new RegExp(this._options.templateBoundaries[0]+"([\\s\\w.]+)"+this._options.templateBoundaries[1],"gm"),o=this._options.template,n=null,i="",s=0,r=null,a=null;null!==(n=t.exec(o));)r=n[1],i+=o.slice(s,n.index),(a=this._valueForKeyPath(r,e))&&(i+=a.toString()),s=t.lastIndex;return s<o.length&&(i+=o.slice(s,o.length)),i},t.prototype._valueForKeyPath=function(e,t){for(var o=/([\w]+)/gm,n=null,i=t;null!==(n=o.exec(e));){if("object"!=typeof i)return null;i=i[n[1]]}return i},t.prototype._fail=function(e){!this._runHook("error",e)&&console&&"function"==typeof console.error&&console.error(e),this._state.running=!1},t.prototype._start=function(){this._state.running=!0,this._runHook("before")},t.prototype._finish=function(){this._runHook("after"),this._state.running=!1},t.prototype._success=function(e){this._runHook("success",e),this._state.running=!1},t.prototype._makeApiRequest=function(e,t){var o=!1,n=this,i=null,s=function(e,n){o||(o=!0,t(e,n))};(i=new XMLHttpRequest).ontimeout=function(){s(new Error("api request timed out"))},i.onerror=function(){s(new Error("api connection error"))},i.onload=function(e){var t=i.getResponseHeader("Content-Type"),o=null;if(n._debug("apiRequestOnLoad","loaded",e),n._debug("apiRequestOnLoad","response status",i.status),n._debug("apiRequestOnLoad","response content type",t),t.indexOf("application/json")>=0)try{o=JSON.parse(i.responseText)}catch(r){return n._debug("apiRequestOnLoad","json parsing error",r,i.responseText),void s(new Error("error parsing response json"))}200===i.status?s(null,o):o&&o.error?s(new Error(o.error.code+" "+o.error.message)):s(new Error("status code "+i.status))},i.open("GET",e,!0),i.timeout=this._options.apiTimeout,i.send()},t.prototype._getAccessToken=function(e){var t=!1,o=this,n=null,i=function(o,i){t||(t=!0,clearTimeout(n),e(o,i))};if("function"==typeof this._options.accessToken){this._debug("getAccessToken","calling accessToken as function"),n=setTimeout(function(){o._debug("getAccessToken","timeout check",t),i(new Error("accessToken timed out"),null)},this._options.accessTokenTimeout);try{this._options.accessToken(function(e,n){o._debug("getAccessToken","received accessToken callback",t,e,n),i(e,n)})}catch(s){this._debug("getAccessToken","error invoking the accessToken as function",s),i(s,null)}}else this._debug("getAccessToken","treating accessToken as static",typeof this._options.accessToken),i(null,this._options.accessToken)},t.prototype._debug=function(){var e=null;this._options.debug&&console&&"function"==typeof console.log&&((e=[].slice.call(arguments))[0]="[Instafeed] ["+e[0]+"]",console.log.apply(null,e))},t.prototype._runHook=function(e,t){var o=!1;if("function"==typeof this._options[e])try{this._options[e](t),o=!0}catch(n){this._debug("runHook","error calling hook",e,n)}return o},t}); 3 4/** 5 * @file 6 * Logic to initialize Instafeed.js with module settings. 7 */ 8(function ($, Drupal, drupalSettings) { 9 Drupal.behaviors.instafeedBlock = { 10 attach: function (context, settings) { 11 // Element to display the feed in. 12 const instafeedId = document.getElementById('instafeed'); 13 14 if (instafeedId && !instafeedId.dataset.instafeedInitialized) { 15 // Set a flag to avoid re-initialization. 16 instafeedId.dataset.instafeedInitialized = true; 17 18 // Get block form settings. 19 const template = drupalSettings.instafeed_block.template; 20 const limit = parseInt(drupalSettings.instafeed_block.limit); 21 const filterObject = drupalSettings.instafeed_block.filters || {}; 22 const filters = Object.keys(filterObject); 23 const accessToken = drupalSettings.instafeed_block.accessToken; 24 25 // Since the instafeed library limits the number of posts before 26 // we can filter the posts by media type, we fetch an additional number 27 // of posts to come closer to the requested limit. 28 // A higher limit affects the load time, hence only a few additional. 29 const fetchPosts = limit + 20; 30 // Counter to keep track of the number of found posts for requested 31 // media types. 32 let foundPosts = 0; 33 34 // Addon - execute after hook to init slick. 35 const afterInit = () => { 36 $(instafeedId).slick({ 37 autoplay: true, 38 arrows: true, 39 slidesToShow: 4, 40 slidesToScroll: 1, 41 adaptiveHeight: true, 42 infinite: true, 43 variableWidth: true, 44 prevArrow: '<button type="button" class="icon icon-slider-arrow icon-slider-prev horizontal slick-arrow" title=""></button>', 45 nextArrow: '<button type="button" class="icon icon-slider-arrow icon-slider-next horizontal slick-arrow" title=""></button>', 46 responsive: [ 47 { 48 breakpoint: 1201, 49 settings: { 50 slidesToShow: 3, 51 variableWidth: false, 52 } 53 }, 54 { 55 breakpoint: 761, 56 settings: { 57 slidesToShow: 2, 58 variableWidth: false, 59 }, 60 }] 61 }); 62 } 63 64 // Initialize Instafeed.js. 65 const feed = new Instafeed({ 66 limit: fetchPosts, 67 template: template, 68 accessToken: accessToken, 69 after: afterInit, 70 // Filter the feed based on the requested type of media. 71 filter: function(image) { 72 if (filters.length > 0) { 73 if (foundPosts < limit) { 74 if (filters.includes('image') && image.type === 'image') { 75 foundPosts++; 76 return true; 77 } 78 if (filters.includes('video') && image.type === 'video') { 79 foundPosts++; 80 return true; 81 } 82 if (filters.includes('album') && image.type === 'album') { 83 foundPosts++; 84 return true; 85 } 86 // Fallback if no filter matches. We should never reach this point. 87 if (filters.length === 0) { 88 foundPosts++; 89 return true; 90 } 91 } 92 // Requested limit reached. 93 else { 94 return false;
95 } 96 } 97 // Display all media if no filters are set. 98 else { 99 if (foundPosts < limit) { 100 foundPosts++; 101 return true; 102 } 103 // Requested limit reached. 104 else { 105 return false; 106 } 107 } 108 }, 109 // Element id to display the feed in. 110 target: 'instafeed' 111 }); 112 feed.run(); 113 } 114 } 115 }; 116})(jQuery, Drupal, drupalSettings); 117; 118/** 119* DO NOT EDIT THIS FILE. 120* See the following change record for more information, 121* https://www.drupal.org/node/2815083 122* @preserve 123**/ 124(function ($, once) { 125 var deprecatedMessageSuffix = "is deprecated in Drupal 9.3.0 and will be removed in Drupal 10.0.0. Use the core/once library instead. See https://www.drupal.org/node/3158256"; 126 var originalJQOnce = $.fn.once; 127 var originalJQRemoveOnce = $.fn.removeOnce; 128 $.fn.once = function jQueryOnce(id) { 129 Drupal.deprecationError({ 130 message: "jQuery.once() ".concat(deprecatedMessageSuffix) 131 }); 132 return originalJQOnce.apply(this, [id]); 133 }; 134 $.fn.removeOnce = function jQueryRemoveOnce(id) { 135 Drupal.deprecationError({ 136 message: "jQuery.removeOnce() ".concat(deprecatedMessageSuffix) 137 }); 138 return originalJQRemoveOnce.apply(this, [id]); 139 }; 140 var drupalOnce = once; 141 function augmentedOnce(id, selector, context) { 142 originalJQOnce.apply($(selector, context), [id]); 143 return drupalOnce(id, selector, context); 144 } 145 function remove(id, selector, context) { 146 originalJQRemoveOnce.apply($(selector, context), [id]); 147 return drupalOnce.remove(id, selector, context); 148 } 149 window.once = Object.assign(augmentedOnce, drupalOnce, { 150 remove: remove 151 }); 152})(jQuery, once);; 153/* 154* Flux 3D Carousel 155* Author: Dean Coulter 156* Licensed under the MIT license 157* 158* Version 0.1 159*/ 160 161(function($){ 162$.fn.carousel3d = function(args){ 163 164 var el = ({ 165 carousel_frame: $(this) 166 }); 167 168 console.log('carousel', el) 169 170 var size = el.carousel_frame.children().length; 171 var panelSize = el.carousel_frame.width(); 172 var translateZ = Math.round( ( panelSize / 2 ) / Math.tan( Math.PI / size ) ); 173 174 el.carousel_frame.css({ 175 "transform": "rotateY(0deg) translateZ(-"+translateZ+"px)" 176 }) 177 178 var rotateY = 0; 179 var rotate_int = 0; 180 var ry = 360/size; 181 var box = 0; 182 183 function animate_slider(){ 184 rotateY = ry*rotate_int; 185 $("#test").text(rotateY+", "+rotate_int+", "); 186 187 for(i=0;i<size;i++){ 188 var z = (rotate_int*ry)+(i*ry); 189 el.carousel_frame.children("figure:eq("+i+")").css({ 190 "transform":"rotateY("+z+"deg ) translateZ("+translateZ+"px)" 191 }); 192 } 193 194 rotateY = 0; 195 box = 0; // reset rotateY, ready for re-use 196 } 197 198 animate_slider(); 199 200 $(".next").on("click", function(){ 201 rotate_int -=1; 202 animate_slider(); 203 }); 204 205 $(".prev").on("click", function(){ 206 rotate_int +=1; 207 animate_slider(); 208 }); 209 210 el.carousel_frame.children().on("click", function(){ 211 new_int = -1*$(this).index(); 212 if(new_int < rotate_int+(-1*(size/2)) ){ 213 rotate_int = size + new_int; 214 } else { 215 rotate_int = new_int; 216 } 217 218 animate_slider(); 219 }); 220 221} 222})(jQuery); 223 224; 225(function (Drupal, once) { 226 227 'use strict'; 228 229 /** 230 * Extract YouTube video ID from various URL formats. 231 */ 232 function extractYouTubeId(url) { 233 if (!url) return null; 234 var match = url.match(/(?:youtu\.be\/|youtube\.com\/(?:watch\?v=|embed\/|v\/|shorts\/))([a-zA-Z0-9_-]{11})/); 235 return match ? match[1] : null; 236 } 237 238 /** 239 * Open YouTube video in a modal overlay. 240 */ 241 function openVideoModal(videoId) { 242 if (!videoId || document.querySelector('.video-modal-overlay')) { 243 return; 244 } 245 246 var overlay = document.createElement('div'); 247 overlay.className = 'video-modal-overlay'; 248 249 var closeBtn = document.createElement('button'); 250 closeBtn.className = 'video-modal-close'; 251 closeBtn.setAttribute('aria-label', Drupal.t('Close')); 252 closeBtn.innerHTML = '×'; 253 254 var iframeWrap = document.createElement('div'); 255 iframeWrap.className = 'video-modal-content'; 256 257 var iframe = document.createElement('iframe'); 258 iframe.src = 'https://www.youtube.com/embed/' + videoId + '?autoplay=1'; 259 iframe.allow = 'accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture'; 260 iframe.allowFullscreen = true; 261 262 iframeWrap.appendChild(iframe); 263 overlay.appendChild(closeBtn); 264 overlay.appendChild(iframeWrap); 265 document.body.appendChild(overlay); 266 267 // Trigger reflow, then show with transition. 268 overlay.offsetHeight; 269 overlay.classList.add('video-modal-visible'); 270 271 document.body.style.overflow = 'hidden'; 272 273 function closeModal() { 274 overlay.classList.remove('video-modal-visible'); 275 overlay.addEventListener('transitionend', function () { 276 overlay.remove(); 277 document.body.style.overflow = ''; 278 }, { once: true }); 279 } 280 281 closeBtn.addEventListener('click', function (e) { 282 e.stopPropagation(); 283 closeModal(); 284 }); 285 286 overlay.addEventListener('click', function (e) { 287 if (e.target === overlay) { 288 closeModal(); 289 } 290 }); 291 292 document.addEventListener('keydown', function onEsc(e) { 293 if (e.key === 'Escape') { 294 closeModal(); 295 document.removeEventListener('keydown', onEsc); 296 } 297 }); 298 } 299 300 // Expose globally so slider.js can reuse it. 301 Drupal.openVideoModal = openVideoModal; 302 Drupal.extractYouTubeId = extractYouTubeId; 303 304})(Drupal, once); 305;
vendor: 33,202 bytes, lines 305-306
305 306(function(factory){"use strict";if(typeof define==="function"&&define.amd){define(["jquery"],factory)}else if(typeof exports!=="undefined"){module.exports=factory(require("jquery"))}else{factory(jQuery)}})(function($){"use strict";var Slick=window.Slick||{};Slick=function(){var instanceUid=0;function Slick(element,settings){var _=this,dataSettings;_.defaults={accessibility:true,adaptiveHeight:false,appendArrows:$(element),appendDots:$(element),arrows:true,asNavFor:null,prevArrow:'<button class="slick-prev" aria-label="Previous" type="button">Previous</button>',nextArrow:'<button class="slick-next" aria-label="Next" type="button">Next</button>',autoplay:false,autoplaySpeed:3e3,centerMode:false,centerPadding:"50px",cssEase:"ease",customPaging:function(slider,i){return $('<button type="button" />').text(i+1)},dots:false,dotsClass:"slick-dots",draggable:true,easing:"linear",edgeFriction:.35,fade:false,focusOnSelect:false,focusOnChange:false,infinite:true,initialSlide:0,lazyLoad:"ondemand",mobileFirst:false,pauseOnHover:true,pauseOnFocus:true,pauseOnDotsHover:false,respondTo:"window",responsive:null,rows:1,rtl:false,slide:"",slidesPerRow:1,slidesToShow:1,slidesToScroll:1,speed:500,swipe:true,swipeToSlide:false,touchMove:true,touchThreshold:5,useCSS:true,useTransform:true,variableWidth:false,vertical:false,verticalSwiping:false,waitForAnimate:true,zIndex:1e3};_.initials={animating:false,dragging:false,autoPlayTimer:null,currentDirection:0,currentLeft:null,currentSlide:0,direction:1,$dots:null,listWidth:null,listHeight:null,loadIndex:0,$nextArrow:null,$prevArrow:null,scrolling:false,slideCount:null,slideWidth:null,$slideTrack:null,$slides:null,sliding:false,slideOffset:0,swipeLeft:null,swiping:false,$list:null,touchObject:{},transformsEnabled:false,unslicked:false};$.extend(_,_.initials);_.activeBreakpoint=null;_.animType=null;_.animProp=null;_.breakpoints=[];_.breakpointSettings=[];_.cssTransitions=false;_.focussed=false;_.interrupted=false;_.hidden="hidden";_.paused=true;_.positionProp=null;_.respondTo=null;_.rowCount=1;_.shouldClick=true;_.$slider=$(element);_.$slidesCache=null;_.transformType=null;_.transitionType=null;_.visibilityChange="visibilitychange";_.windowWidth=0;_.windowTimer=null;dataSettings=$(element).data("slick")||{};_.options=$.extend({},_.defaults,settings,dataSettings);_.currentSlide=_.options.initialSlide;_.originalSettings=_.options;if(typeof document.mozHidden!=="undefined"){_.hidden="mozHidden";_.visibilityChange="mozvisibilitychange"}else if(typeof document.webkitHidden!=="undefined"){_.hidden="webkitHidden";_.visibilityChange="webkitvisibilitychange"}_.autoPlay=$.proxy(_.autoPlay,_);_.autoPlayClear=$.proxy(_.autoPlayClear,_);_.autoPlayIterator=$.proxy(_.autoPlayIterator,_);_.changeSlide=$.proxy(_.changeSlide,_);_.clickHandler=$.proxy(_.clickHandler,_);_.selectHandler=$.proxy(_.selectHandler,_);_.setPosition=$.proxy(_.setPosition,_);_.swipeHandler=$.proxy(_.swipeHandler,_);_.dragHandler=$.proxy(_.dragHandler,_);_.keyHandler=$.proxy(_.keyHandler,_);_.instanceUid=instanceUid++;_.htmlExpr=/^(?:\s*(<[\w\W]+>)[^>]*)$/;_.registerBreakpoints();_.init(true)}return Slick}();Slick.prototype.activateADA=function(){var _=this;_.$slideTrack.find(".slick-active").attr({"aria-hidden":"false"}).find("a, input, button, select").attr({tabindex:"0"})};Slick.prototype.addSlide=Slick.prototype.slickAdd=function(markup,index,addBefore){var _=this;if(typeof index==="boolean"){addBefore=index;index=null}else if(index<0||index>=_.slideCount){return false}_.unload();if(typeof index==="number"){if(index===0&&_.$slides.length===0){$(markup).appendTo(_.$slideTrack)}else if(addBefore){$(markup).insertBefore(_.$slides.eq(index))}else{$(markup).insertAfter(_.$slides.eq(index))}}else{if(addBefore===true){$(markup).prependTo(_.$slideTrack)}else{$(markup).appendTo(_.$slideTrack)}}_.$slides=_.$slideTrack.children(this.options.slide);_.$slideTrack.children(this.options.slide).detach();_.$slideTrack.append(_.$slides);_.$slides.each(function(index,element){$(element).attr("data-slick-index",index)});_.$slidesCache=_.$slides;_.reinit()};Slick.prototype.animateHeight=function(){var _=this;if(_.options.slidesToShow===1&&_.options.adaptiveHeight===true&&_.options.vertical===false){var targetHeight=_.$slides.eq(_.currentSlide).outerHeight(true);_.$list.animate({height:targetHeight},_.options.speed)}};Slick.prototype.animateSlide=function(targetLeft,callback){var animProps={},_=this;_.animateHeight();if(_.options.rtl===true&&_.options.vertical===false){targetLeft=-targetLeft}if(_.transformsEnabled===false){if(_.options.vertical===false){_.$slideTrack.animate({left:targetLeft},_.options.speed,_.options.easing,callback)}else{_.$slideTrack.animate({top:targetLeft},_.options.speed,_.options.easing,callback)}}else{if(_.cssTransitions===false){if(_.options.rtl===true){_.currentLeft=-_.currentLeft}$({animStart:_.currentLeft}).animate({animStart:targetLeft},{duration:_.options.speed,easing:_.options.easing,step:function(now){now=Math.ceil(now);if(_.options.vertical===false){animProps[_.animType]="translate("+now+"px, 0px)";_.$slideTrack.css(animProps)}else{animProps[_.animType]="translate(0px,"+now+"px)";_.$slideTrack.css(animProps)}},complete:function(){if(callback){callback.call()}}})}else{_.applyTransition();targetLeft=Math.ceil(targetLeft);if(_.options.vertical===false){animProps[_.animType]="translate3d("+targetLeft+"px, 0px, 0px)"}else{animProps[_.animType]="translate3d(0px,"+targetLeft+"px, 0px)"}_.$slideTrack.css(animProps);if(callback){setTimeout(function(){_.disableTransition();callback.call()},_.options.speed)}}}};Slick.prototype.getNavTarget=function(){var _=this,asNavFor=_.options.asNavFor;if(asNavFor&&asNavFor!==null){asNavFor=$(asNavFor).not(_.$slider)}return asNavFor};Slick.prototype.asNavFor=function(index){var _=this,asNavFor=_.getNavTarget();if(asNavFor!==null&&typeof asNavFor==="object"){asNavFor.each(function(){var target=$(this).slick("getSlick");if(!target.unslicked){target.slideHandler(index,true)}})}};Slick.prototype.applyTransition=function(slide){var _=this,transition={};if(_.options.fade===false){transition[_.transitionType]=_.transformType+" "+_.options.speed+"ms "+_.options.cssEase}else{transition[_.transitionType]="opacity "+_.options.speed+"ms "+_.options.cssEase}if(_.options.fade===false){_.$slideTrack.css(transition)}else{_.$slides.eq(slide).css(transition)}};Slick.prototype.autoPlay=function(){var _=this;_.autoPlayClear();if(_.slideCount>_.options.slidesToShow){_.autoPlayTimer=setInterval(_.autoPlayIterator,_.options.autoplaySpeed)}};Slick.prototype.autoPlayClear=function(){var _=this;if(_.autoPlayTimer){clearInterval(_.autoPlayTimer)}};Slick.prototype.autoPlayIterator=function(){var _=this,slideTo=_.currentSlide+_.options.slidesToScroll;if(!_.paused&&!_.interrupted&&!_.focussed){if(_.options.infinite===false){if(_.direction===1&&_.currentSlide+1===_.slideCount-1){_.direction=0}else if(_.direction===0){slideTo=_.currentSlide-_.options.slidesToScroll;if(_.currentSlide-1===0){_.direction=1}}}_.slideHandler(slideTo)}};Slick.prototype.buildArrows=function(){var _=this;if(_.options.arrows===true){_.$prevArrow=$(_.options.prevArrow).addClass("slick-arrow");_.$nextArrow=$(_.options.nextArrow).addClass("slick-arrow");if(_.slideCount>_.options.slidesToShow){_.$prevArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex");_.$nextArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex");if(_.htmlExpr.test(_.options.prevArrow)){_.$prevArrow.prependTo(_.options.appendArrows)}if(_.htmlExpr.test(_.options.nextArrow)){_.$nextArrow.appendTo(_.options.appendArrows)}if(_.options.infinite!==true){_.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true")}}else{_.$prevArrow.add(_.$nextArrow).addClass("slick-hidden").attr({"aria-disabled":"true",tabindex:"-1"})}}};Slick.prototype.buildDots=function(){var _=this,i,dot;if(_.options.dots===true&&_.slideCount>_.options.slidesToShow){_.$slider.addClass("slick-dotted");dot=$("<ul />").addClass(_.options.dotsClass);for(i=0;i<=_.getDotCount();i+=1){dot.append($("<li />").append(_.options.customPaging.call(this,_,i)))}_.$dots=dot.appendTo(_.options.appendDots);_.$dots.find("li").first().addClass("slick-active")}};Slick.prototype.buildOut=function(){var _=this;_.$slides=_.$slider.children(_.options.slide+":not(.slick-cloned)").addClass("slick-slide");_.slideCount=_.$slides.length;_.$slides.each(function(index,element){$(element).attr("data-slick-index",index).data("originalStyling",$(element).attr("style")||"")});_.$slider.addClass("slick-slider");_.$slideTrack=_.slideCount===0?$('<div class="slick-track"/>').appendTo(_.$slider):_.$slides.wrapAll('<div class="slick-track"/>').parent();_.$list=_.$slideTrack.wrap('<div class="slick-list"/>').parent();_.$slideTrack.css("opacity",0);if(_.options.centerMode===true||_.options.swipeToSlide===true){_.options.slidesToScroll=1}$("img[data-lazy]",_.$slider).not("[src]").addClass("slick-loading");_.setupInfinite();_.buildArrows();_.buildDots();_.updateDots();_.setSlideClasses(typeof _.currentSlide==="number"?_.currentSlide:0);if(_.options.draggable===true){_.$list.addClass("draggable")}};Slick.prototype.buildRows=function(){var _=this,a,b,c,newSlides,numOfSlides,originalSlides,slidesPerSection;newSlides=document.createDocumentFragment();originalSlides=_.$slider.children();if(_.options.rows>0){slidesPerSection=_.options.slidesPerRow*_.options.rows;numOfSlides=Math.ceil(originalSlides.length/slidesPerSection);for(a=0;a<numOfSlides;a++){var slide=document.createElement("div");for(b=0;b<_.options.rows;b++){var row=document.createElement("div");for(c=0;c<_.options.slidesPerRow;c++){var target=a*slidesPerSection+(b*_.options.slidesPerRow+c);if(originalSlides.get(target)){row.appendChild(originalSlides.get(target))}}slide.appendChild(row)}newSlides.appendChild(slide)}_.$slider.empty().append(newSlides);_.$slider.children().children().children().css({width:100/_.options.slidesPerRow+"%",display:"inline-block"})}};Slick.prototype.checkResponsive=function(initial,forceUpdate){var _=this,breakpoint,targetBreakpoint,respondToWidth,triggerBreakpoint=false;var sliderWidth=_.$slider.width();var windowWidth=window.innerWidth||$(window).width();if(_.respondTo==="window"){respondToWidth=windowWidth}else if(_.respondTo==="slider"){respondToWidth=sliderWidth}else if(_.respondTo==="min"){respondToWidth=Math.min(windowWidth,sliderWidth)}if(_.options.responsive&&_.options.responsive.length&&_.options.responsive!==null){targetBreakpoint=null;for(breakpoint in _.breakpoints){if(_.breakpoints.hasOwnProperty(breakpoint)){if(_.originalSettings.mobileFirst===false){if(respondToWidth<_.breakpoints[breakpoint]){targetBreakpoint=_.breakpoints[breakpoint]}}else{if(respondToWidth>_.breakpoints[breakpoint]){targetBreakpoint=_.breakpoints[breakpoint]}}}}if(targetBreakpoint!==null){if(_.activeBreakpoint!==null){if(targetBreakpoint!==_.activeBreakpoint||forceUpdate){_.activeBreakpoint=targetBreakpoint;if(_.breakpointSettings[targetBreakpoint]==="unslick"){_.unslick(targetBreakpoint)}else{_.options=$.extend({},_.originalSettings,_.breakpointSettings[targetBreakpoint]);if(initial===true){_.currentSlide=_.options.initialSlide}_.refresh(initial)}triggerBreakpoint=targetBreakpoint}}else{_.activeBreakpoint=targetBreakpoint;if(_.breakpointSettings[targetBreakpoint]==="unslick"){_.unslick(targetBreakpoint)}else{_.options=$.extend({},_.originalSettings,_.breakpointSettings[targetBreakpoint]);if(initial===true){_.currentSlide=_.options.initialSlide}_.refresh(initial)}triggerBreakpoint=targetBreakpoint}}else{if(_.activeBreakpoint!==null){_.activeBreakpoint=null;_.options=_.originalSettings;if(initial===true){_.currentSlide=_.options.initialSlide}_.refresh(initial);triggerBreakpoint=targetBreakpoint}}if(!initial&&triggerBreakpoint!==false){_.$slider.trigger("breakpoint",[_,triggerBreakpoint])}}};Slick.prototype.changeSlide=function(event,dontAnimate){var _=this,$target=$(event.currentTarget),indexOffset,slideOffset,unevenOffset;if($target.is("a")){event.preventDefault()}if(!$target.is("li")){$target=$target.closest("li")}unevenOffset=_.slideCount%_.options.slidesToScroll!==0;indexOffset=unevenOffset?0:(_.slideCount-_.currentSlide)%_.options.slidesToScroll;switch(event.data.message){case"previous":slideOffset=indexOffset===0?_.options.slidesToScroll:_.options.slidesToShow-indexOffset;if(_.slideCount>_.options.slidesToShow){_.slideHandler(_.currentSlide-slideOffset,false,dontAnimate)}break;case"next":slideOffset=indexOffset===0?_.options.slidesToScroll:indexOffset;if(_.slideCount>_.options.slidesToShow){_.slideHandler(_.currentSlide+slideOffset,false,dontAnimate)}break;case"index":var index=event.data.index===0?0:event.data.index||$target.index()*_.options.slidesToScroll;_.slideHandler(_.checkNavigable(index),false,dontAnimate);$target.children().trigger("focus");break;default:return}};Slick.prototype.checkNavigable=function(index){var _=this,navigables,prevNavigable;navigables=_.getNavigableIndexes();prevNavigable=0;if(index>navigables[navigables.length-1]){index=navigables[navigables.length-1]}else{for(var n in navigables){if(index<navigables[n]){index=prevNavigable;break}prevNavigable=navigables[n]}}return index};Slick.prototype.cleanUpEvents=function(){var _=this;if(_.options.dots&&_.$dots!==null){$("li",_.$dots).off("click.slick",_.changeSlide).off("mouseenter.slick",$.proxy(_.interrupt,_,true)).off("mouseleave.slick",$.proxy(_.interrupt,_,false));if(_.options.accessibility===true){_.$dots.off("keydown.slick",_.keyHandler)}}_.$slider.off("focus.slick blur.slick");if(_.options.arrows===true&&_.slideCount>_.options.slidesToShow){_.$prevArrow&&_.$prevArrow.off("click.slick",_.changeSlide);_.$nextArrow&&_.$nextArrow.off("click.slick",_.changeSlide);if(_.options.accessibility===true){_.$prevArrow&&_.$prevArrow.off("keydown.slick",_.keyHandler);_.$nextArrow&&_.$nextArrow.off("keydown.slick",_.keyHandler)}}_.$list.off("touchstart.slick mousedown.slick",_.swipeHandler);_.$list.off("touchmove.slick mousemove.slick",_.swipeHandler);_.$list.off("touchend.slick mouseup.slick",_.swipeHandler);_.$list.off("touchcancel.slick mouseleave.slick",_.swipeHandler);_.$list.off("click.slick",_.clickHandler);$(document).off(_.visibilityChange,_.visibility);_.cleanUpSlideEvents();if(_.options.accessibility===true){_.$list.off("keydown.slick",_.keyHandler)}if(_.options.focusOnSelect===true){$(_.$slideTrack).children().off("click.slick",_.selectHandler)}$(window).off("orientationchange.slick.slick-"+_.instanceUid,_.orientationChange);$(window).off("resize.slick.slick-"+_.instanceUid,_.resize);$("[draggable!=true]",_.$slideTrack).off("dragstart",_.preventDefault);$(window).off("load.slick.slick-"+_.instanceUid,_.setPosition)};Slick.prototype.cleanUpSlideEvents=function(){var _=this;_.$list.off("mouseenter.slick",$.proxy(_.interrupt,_,true));_.$list.off("mouseleave.slick",$.proxy(_.interrupt,_,false))};Slick.prototype.cleanUpRows=function(){var _=this,originalSlides;if(_.options.rows>0){originalSlides=_.$slides.children().children();originalSlides.removeAttr("style");_.$slider.empty().append(originalSlides)}};Slick.prototype.clickHandler=function(event){var _=this;if(_.shouldClick===false){event.stopImmediatePropagation();event.stopPropagation();event.preventDefault()}};Slick.prototype.destroy=function(refresh){var _=this;_.autoPlayClear();_.touchObject={};_.cleanUpEvents();$(".slick-cloned",_.$slider).detach();if(_.$dots){_.$dots.remove()}if(_.$prevArrow&&_.$prevArrow.length){_.$prevArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display","");if(_.htmlExpr.test(_.options.prevArrow)){_.$prevArrow.remove()}}if(_.$nextArrow&&_.$nextArrow.length){_.$nextArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display","");if(_.htmlExpr.test(_.options.nextArrow)){_.$nextArrow.remove()}}if(_.$slides){_.$slides.removeClass("slick-slide slick-active slick-center slick-visible slick-current").removeAttr("aria-hidden").removeAttr("data-slick-index").each(function(){$(this).attr("style",$(this).data("originalStyling"))});_.$slideTrack.children(this.options.slide).detach();_.$slideTrack.detach();_.$list.detach();_.$slider.append(_.$slides)}_.cleanUpRows();_.$slider.removeClass("slick-slider");_.$slider.removeClass("slick-initialized");_.$slider.removeClass("slick-dotted");_.unslicked=true;if(!refresh){_.$slider.trigger("destroy",[_])}};Slick.prototype.disableTransition=function(slide){var _=this,transition={};transition[_.transitionType]="";if(_.options.fade===false){_.$slideTrack.css(transition)}else{_.$slides.eq(slide).css(transition)}};Slick.prototype.fadeSlide=function(slideIndex,callback){var _=this;if(_.cssTransitions===false){_.$slides.eq(slideIndex).css({zIndex:_.options.zIndex});_.$slides.eq(slideIndex).animate({opacity:1},_.options.speed,_.options.easing,callback)}else{_.applyTransition(slideIndex);_.$slides.eq(slideIndex).css({opacity:1,zIndex:_.options.zIndex});if(callback){setTimeout(function(){_.disableTransition(slideIndex);callback.call()},_.options.speed)}}};Slick.prototype.fadeSlideOut=function(slideIndex){var _=this;if(_.cssTransitions===false){_.$slides.eq(slideIndex).animate({opacity:0,zIndex:_.options.zIndex-2},_.options.speed,_.options.easing)}else{_.applyTransition(slideIndex);_.$slides.eq(slideIndex).css({opacity:0,zIndex:_.options.zIndex-2})}};Slick.prototype.filterSlides=Slick.prototype.slickFilter=function(filter){var _=this;if(filter!==null){_.$slidesCache=_.$slides;_.unload();_.$slideTrack.children(this.options.slide).detach();_.$slidesCache.filter(filter).appendTo(_.$slideTrack);_.reinit()}};Slick.prototype.focusHandler=function(){var _=this;_.$slider.off("focus.slick blur.slick").on("focus.slick","*",function(event){var $sf=$(this);setTimeout(function(){if(_.options.pauseOnFocus){if($sf.is(":focus")){_.focussed=true;_.autoPlay()}}},0)}).on("blur.slick","*",function(event){var $sf=$(this);if(_.options.pauseOnFocus){_.focussed=false;_.autoPlay()}})};Slick.prototype.getCurrent=Slick.prototype.slickCurrentSlide=function(){var _=this;return _.currentSlide};Slick.prototype.getDotCount=function(){var _=this;var breakPoint=0;var counter=0;var pagerQty=0;if(_.options.infinite===true){if(_.slideCount<=_.options.slidesToShow){++pagerQty}else{while(breakPoint<_.slideCount){++pagerQty;breakPoint=counter+_.options.slidesToScroll;counter+=_.options.slidesToScroll<=_.options.slidesToShow?_.options.slidesToScroll:_.options.slidesToShow}}}else if(_.options.centerMode===true){pagerQty=_.slideCount}else if(!_.options.asNavFor){pagerQty=1+Math.ceil((_.slideCount-_.options.slidesToShow)/_.options.slidesToScroll)}else{while(breakPoint<_.slideCount){++pagerQty;breakPoint=counter+_.options.slidesToScroll;counter+=_.options.slidesToScroll<=_.options.slidesToShow?_.options.slidesToScroll:_.options.slidesToShow}}return pagerQty-1};Slick.prototype.getLeft=function(slideIndex){var _=this,targetLeft,verticalHeight,verticalOffset=0,targetSlide,coef;_.slideOffset=0;verticalHeight=_.$slides.first().outerHeight(true);if(_.options.infinite===true){if(_.slideCount>_.options.slidesToShow){_.slideOffset=_.slideWidth*_.options.slidesToShow*-1;coef=-1;if(_.options.vertical===true&&_.options.centerMode===true){if(_.options.slidesToShow===2){coef=-1.5}else if(_.options.slidesToShow===1){coef=-2}}verticalOffset=verticalHeight*_.options.slidesToShow*coef}if(_.slideCount%_.options.slidesToScroll!==0){if(slideIndex+_.options.slidesToScroll>_.slideCount&&_.slideCount>_.options.slidesToShow){if(slideIndex>_.slideCount){_.slideOffset=(_.options.slidesToShow-(slideIndex-_.slideCount))*_.slideWidth*-1;verticalOffset=(_.options.slidesToShow-(slideIndex-_.slideCount))*verticalHeight*-1}else{_.slideOffset=_.slideCount%_.options.slidesToScroll*_.slideWidth*-1;verticalOffset=_.slideCount%_.options.slidesToScroll*verticalHeight*-1}}}}else{if(slideIndex+_.options.slidesToShow>_.slideCount){_.slideOffset=(slideIndex+_.options.slidesToShow-_.slideCount)*_.slideWidth;verticalOffset=(slideIndex+_.options.slidesToShow-_.slideCount)*verticalHeight}}if(_.slideCount<=_.options.slidesToShow){_.slideOffset=0;verticalOffset=0}if(_.options.centerMode===true&&_.slideCount<=_.options.slidesToShow){_.slideOffset=_.slideWidth*Math.floor(_.options.slidesToShow)/2-_.slideWidth*_.slideCount/2}else if(_.options.centerMode===true&&_.options.infinite===true){_.slideOffset+=_.slideWidth*Math.floor(_.options.slidesToShow/2)-_.slideWidth}else if(_.options.centerMode===true){_.slideOffset=0;_.slideOffset+=_.slideWidth*Math.floor(_.options.slidesToShow/2)}if(_.options.vertical===false){targetLeft=slideIndex*_.slideWidth*-1+_.slideOffset}else{targetLeft=slideIndex*verticalHeight*-1+verticalOffset}if(_.options.variableWidth===true){if(_.slideCount<=_.options.slidesToShow||_.options.infinite===false){targetSlide=_.$slideTrack.children(".slick-slide").eq(slideIndex)}else{targetSlide=_.$slideTrack.children(".slick-slide").eq(slideIndex+_.options.slidesToShow)}if(_.options.rtl===true){if(targetSlide[0]){targetLeft=(_.$slideTrack.width()-targetSlide[0].offsetLeft-targetSlide.width())*-1}else{targetLeft=0}}else{targetLeft=targetSlide[0]?targetSlide[0].offsetLeft*-1:0}if(_.options.centerMode===true){if(_.slideCount<=_.options.slidesToShow||_.options.infinite===false){targetSlide=_.$slideTrack.children(".slick-slide").eq(slideIndex)}else{targetSlide=_.$slideTrack.children(".slick-slide").eq(slideIndex+_.options.slidesToShow+1)}if(_.options.rtl===true){if(targetSlide[0]){targetLeft=(_.$slideTrack.width()-targetSlide[0].offsetLeft-targetSlide.width())*-1}else{targetLeft=0}}else{targetLeft=targetSlide[0]?targetSlide[0].offsetLeft*-1:0}targetLeft+=(_.$list.width()-targetSlide.outerWidth())/2}}return targetLeft};Slick.prototype.getOption=Slick.prototype.slickGetOption=function(option){var _=this;return _.options[option]};Slick.prototype.getNavigableIndexes=function(){var _=this,breakPoint=0,counter=0,indexes=[],max;if(_.options.infinite===false){max=_.slideCount}else{breakPoint=_.options.slidesToScroll*-1;counter=_.options.slidesToScroll*-1;max=_.slideCount*2}while(breakPoint<max){indexes.push(breakPoint);breakPoint=counter+_.options.slidesToScroll;counter+=_.options.slidesToScroll<=_.options.slidesToShow?_.options.slidesToScroll:_.options.slidesToShow}return indexes};Slick.prototype.getSlick=function(){return this};Slick.prototype.getSlideCount=function(){var _=this,slidesTraversed,swipedSlide,swipeTarget,centerOffset;centerOffset=_.options.centerMode===true?Math.floor(_.$list.width()/2):0;swipeTarget=_.swipeLeft*-1+centerOffset;if(_.options.swipeToSlide===true){_.$slideTrack.find(".slick-slide").each(function(index,slide){var slideOuterWidth,slideOffset,slideRightBoundary;slideOuterWidth=$(slide).outerWidth();slideOffset=slide.offsetLeft;if(_.options.centerMode!==true){slideOffset+=slideOuterWidth/2}slideRightBoundary=slideOffset+slideOuterWidth;if(swipeTarget<slideRightBoundary){swipedSlide=slide;return false}});slidesTraversed=Math.abs($(swipedSlide).attr("data-slick-index")-_.currentSlide)||1;return slidesTraversed}else{return _.options.slidesToScroll}};Slick.prototype.goTo=Slick.prototype.slickGoTo=function(slide,dontAnimate){var _=this;_.changeSlide({data:{message:"index",index:parseInt(slide)}},dontAnimate)};Slick.prototype.init=function(creation){var _=this;if(!$(_.$slider).hasClass("slick-initialized")){$(_.$slider).addClass("slick-initialized");_.buildRows();_.buildOut();_.setProps();_.startLoad();_.loadSlider();_.initializeEvents();_.updateArrows();_.updateDots();_.checkResponsive(true);_.focusHandler()}if(creation){_.$slider.trigger("init",[_])}if(_.options.accessibility===true){_.initADA()}if(_.options.autoplay){_.paused=false;_.autoPlay()}};Slick.prototype.initADA=function(){var _=this,numDotGroups=Math.ceil(_.slideCount/_.options.slidesToShow),tabControlIndexes=_.getNavigableIndexes().filter(function(val){return val>=0&&val<_.slideCount});_.$slides.add(_.$slideTrack.find(".slick-cloned")).attr({"aria-hidden":"true",tabindex:"-1"}).find("a, input, button, select").attr({tabindex:"-1"});if(_.$dots!==null){_.$slides.not(_.$slideTrack.find(".slick-cloned")).each(function(i){var slideControlIndex=tabControlIndexes.indexOf(i);$(this).attr({role:"tabpanel",id:"slick-slide"+_.instanceUid+i,tabindex:-1});if(slideControlIndex!==-1){var ariaButtonControl="slick-slide-control"+_.instanceUid+slideControlIndex;if($("#"+ariaButtonControl).length){$(this).attr({"aria-describedby":ariaButtonControl})}}});_.$dots.attr("role","tablist").find("li").each(function(i){var mappedSlideIndex=tabControlIndexes[i];$(this).attr({role:"presentation"});$(this).find("button").first().attr({role:"tab",id:"slick-slide-control"+_.instanceUid+i,"aria-controls":"slick-slide"+_.instanceUid+mappedSlideIndex,"aria-label":i+1+" of "+numDotGroups,"aria-selected":null,tabindex:"-1"})}).eq(_.currentSlide).find("button").attr({"aria-selected":"true",tabindex:"0"}).end()}for(var i=_.currentSlide,max=i+_.options.slidesToShow;i<max;i++){if(_.options.focusOnChange){_.$slides.eq(i).attr({tabindex:"0"})}else{_.$slides.eq(i).removeAttr("tabindex")}}_.activateADA()};Slick.prototype.initArrowEvents=function(){var _=this;if(_.options.arrows===true&&_.slideCount>_.options.slidesToShow){_.$prevArrow.off("click.slick").on("click.slick",{message:"previous"},_.changeSlide);_.$nextArrow.off("click.slick").on("click.slick",{message:"next"},_.changeSlide);if(_.options.accessibility===true){_.$prevArrow.on("keydown.slick",_.keyHandler);_.$nextArrow.on("keydown.slick",_.keyHandler)}}};Slick.prototype.initDotEvents=function(){var _=this;if(_.options.dots===true&&_.slideCount>_.options.slidesToShow){$("li",_.$dots).on("click.slick",{message:"index"},_.changeSlide);if(_.options.accessibility===true){_.$dots.on("keydown.slick",_.keyHandler)}}if(_.options.dots===true&&_.options.pauseOnDotsHover===true&&_.slideCount>_.options.slidesToShow){$("li",_.$dots).on("mouseenter.slick",$.proxy(_.interrupt,_,true)).on("mouseleave.slick",$.proxy(_.interrupt,_,false))}};Slick.prototype.initSlideEvents=function(){var _=this;if(_.options.pauseOnHover){_.$list.on("mouseenter.slick",$.proxy(_.interrupt,_,true));_.$list.on("mouseleave.slick",$.proxy(_.interrupt,_,false))}};Slick.prototype.initializeEvents=function(){var _=this;_.initArrowEvents();_.initDotEvents();_.initSlideEvents();_.$list.on("touchstart.slick mousedown.slick",{action:"start"},_.swipeHandler);_.$list.on("touchmove.slick mousemove.slick",{action:"move"},_.swipeHandler);_.$list.on("touchend.slick mouseup.slick",{action:"end"},_.swipeHandler);_.$list.on("touchcancel.slick mouseleave.slick",{action:"end"},_.swipeHandler);_.$list.on("click.slick",_.clickHandler);$(document).on(_.visibilityChange,$.proxy(_.visibility,_));if(_.options.accessibility===true){_.$list.on("keydown.slick",_.keyHandler)}if(_.options.focusOnSelect===true){$(_.$slideTrack).children().on("click.slick",_.selectHandler)}$(window).on("orientationchange.slick.slick-"+_.instanceUid,$.proxy(_.orientationChange,_));$(window).on("resize.slick.slick-"+_.instanceUid,$.proxy(_.resize,_));$("[draggable!=true]",_.$slideTrack).on("dragstart",_.preventDefault);$(window).on("load.slick.slick-"+_.instanceUid,_.setPosition);$(_.setPosition)};Slick.prototype.initUI=function(){var _=this;if(_.options.arrows===true&&_.slideCount>_.options.slidesToShow){_.$prevArrow.show();_.$nextArrow.show()}if(_.options.dots===true&&_.slideCount>_.options.slidesToShow){_.$dots.show()}};Slick.prototype.keyHandler=function(event){var _=this;if(!event.target.tagName.match("TEXTAREA|INPUT|SELECT")){if(event.keyCode===37&&_.options.accessibility===true){_.changeSlide({data:{message:_.options.rtl===true?"next":"previous"}})}else if(event.keyCode===39&&_.options.accessibility===true){_.changeSlide({data:{message:_.options.rtl===true?"previous":"next"}})}}};Slick.prototype.lazyLoad=function(){var _=this,loadRange,cloneRange,rangeStart,rangeEnd;function loadImages(imagesScope){$("img[data-lazy]",imagesScope).each(function(){var image=$(this),imageSource=$(this).attr("data-lazy"),imageSrcSet=$(this).attr("data-srcset"),imageSizes=$(this).attr("data-sizes")||_.$slider.attr("data-sizes"),imageToLoad=document.createElement("img");imageToLoad.onload=function(){image.animate({opacity:0},100,function(){if(imageSrcSet){image.attr("srcset",imageSrcSet);if(imageSizes){image.attr("sizes",imageSizes)}}image.attr("src",imageSource).animate({opacity:1},200,function(){image.removeAttr("data-lazy data-srcset data-sizes").removeClass("slick-loading")});_.$slider.trigger("lazyLoaded",[_,image,imageSource])})};imageToLoad.onerror=function(){image.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error");_.$slider.trigger("lazyLoadError",[_,image,imageSource])};imageToLoad.src=imageSource})}if(_.options.centerMode===true){if(_.options.infinite===true){rangeStart=_.currentSlide+(_.options.slidesToShow/2+1);rangeEnd=rangeStart+_.options.slidesToShow+2}else{rangeStart=Math.max(0,_.currentSlide-(_.options.slidesToShow/2+1));rangeEnd=2+(_.options.slidesToShow/2+1)+_.currentSlide}}else{rangeStart=_.options.infinite?_.options.slidesToShow+_.currentSlide:_.currentSlide;rangeEnd=Math.ceil(rangeStart+_.options.slidesToShow);if(_.options.fade===true){if(rangeStart>0)rangeStart--;if(rangeEnd<=_.slideCount)rangeEnd++}}loadRange=_.$slider.find(".slick-slide").slice(rangeStart,rangeEnd);if(_.options.lazyLoad==="anticipated"){var prevSlide=rangeStart-1,nextSlide=rangeEnd,$slides=_.$slider.find(".slick-slide");for(var i=0;i<_.options.slidesToScroll;i++){if(prevSlide<0)prevSlide=_.slideCount-1;loadRange=loadRange.add($slides.eq(prevSlide));loadRange=loadRange.add($slides.eq(nextSlide));prevSlide--;nextSlide++}}loadImages(loadRange);if(_.slideCount<=_.options.slidesToShow){cloneRange=_.$slider.find(".slick-slide");loadImages(cloneRange)}else if(_.currentSlide>=_.slideCount-_.options.slidesToShow){cloneRange=_.$slider.find(".slick-cloned").slice(0,_.options.slidesToShow);loadImages(cloneRange)}else if(_.currentSlide===0){cloneRange=_.$slider.find(".slick-cloned").slice(_.options.slidesToShow*-1);loadImages(cloneRange)}};Slick.prototype.loadSlider=function(){var _=this;_.setPosition();_.$slideTrack.css({opacity:1});_.$slider.removeClass("slick-loading");_.initUI();if(_.options.lazyLoad==="progressive"){_.progressiveLazyLoad()}};Slick.prototype.next=Slick.prototype.slickNext=function(){var _=this;_.changeSlide({data:{message:"next"}})};Slick.prototype.orientationChange=function(){var _=this;_.checkResponsive();_.setPosition()};Slick.prototype.pause=Slick.prototype.slickPause=function(){var _=this;_.autoPlayClear();_.paused=true};Slick.prototype.play=Slick.prototype.slickPlay=function(){var _=this;_.autoPlay();_.options.autoplay=true;_.paused=false;_.focussed=false;_.interrupted=false};Slick.prototype.postSlide=function(index){var _=this;if(!_.unslicked){_.$slider.trigger("afterChange",[_,index]);_.animating=false;if(_.slideCount>_.options.slidesToShow){_.setPosition()}_.swipeLeft=null;if(_.options.autoplay){_.autoPlay()}if(_.options.accessibility===true){_.initADA();if(_.options.focusOnChange){var $currentSlide=$(_.$slides.get(_.currentSlide));$currentSlide.attr("tabindex",0).focus()}}}};Slick.prototype.prev=Slick.prototype.slickPrev=function(){var _=this;_.changeSlide({data:{message:"previous"}})};Slick.prototype.preventDefault=function(event){event.preventDefault()};Slick.prototype.progressiveLazyLoad=function(tryCount){tryCount=tryCount||1;var _=this,$imgsToLoad=$("img[data-lazy]",_.$slider),image,imageSource,imageSrcSet,imageSizes,imageToLoad;if($imgsToLoad.length){image=$imgsToLoad.first();imageSource=image.attr("data-lazy");imageSrcSet=image.attr("data-srcset");imageSizes=image.attr("data-sizes")||_.$slider.attr("data-sizes");imageToLoad=document.createElement("img");imageToLoad.onload=function(){if(imageSrcSet){image.attr("srcset",imageSrcSet);if(imageSizes){image.attr("sizes",imageSizes)}}image.attr("src",imageSource).removeAttr("data-lazy data-srcset data-sizes").removeClass("slick-loading");if(_.options.adaptiveHeight===true){_.setPosition()}_.$slider.trigger("lazyLoaded",[_,image,imageSource]);_.progressiveLazyLoad()};imageToLoad.onerror=function(){if(tryCount<3){setTimeout(function(){_.progressiveLazyLoad(tryCount+1)},500)}else{image.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error");_.$slider.trigger("lazyLoadError",[_,image,imageSource]);_.progressiveLazyLoad()}};imageToLoad.src=imageSource}else{_.$slider.trigger("allImagesLoaded",[_])}};Slick.prototype.refresh=function(initializing){var _=this,currentSlide,lastVisibleIndex;lastVisibleIndex=_.slideCount-_.options.slidesToShow;if(!_.options.infinite&&_.currentSlide>lastVisibleIndex){_.currentSlide=lastVisibleIndex}if(_.slideCount<=_.options.slidesToShow){_.currentSlide=0}currentSlide=_.currentSlide;_.destroy(true);$.extend(_,_.initials,{currentSlide:currentSlide});_.init();if(!initializing){_.changeSlide({data:{message:"index",index:currentSlide}},false)}};Slick.prototype.registerBreakpoints=function(){var _=this,breakpoint,currentBreakpoint,l,responsiveSettings=_.options.responsive||null;if(
vendor: 4,085 bytes, line 306
306$.type(responsiveSettings)==="array"&&responsiveSettings.length){_.respondTo=_.options.respondTo||"window";for(breakpoint in responsiveSettings){l=_.breakpoints.length-1;if(responsiveSettings.hasOwnProperty(breakpoint)){currentBreakpoint=responsiveSettings[breakpoint].breakpoint;while(l>=0){if(_.breakpoints[l]&&_.breakpoints[l]===currentBreakpoint){_.breakpoints.splice(l,1)}l--}_.breakpoints.push(currentBreakpoint);_.breakpointSettings[currentBreakpoint]=responsiveSettings[breakpoint].settings}}_.breakpoints.sort(function(a,b){return _.options.mobileFirst?a-b:b-a})}};Slick.prototype.reinit=function(){var _=this;_.$slides=_.$slideTrack.children(_.options.slide).addClass("slick-slide");_.slideCount=_.$slides.length;if(_.currentSlide>=_.slideCount&&_.currentSlide!==0){_.currentSlide=_.currentSlide-_.options.slidesToScroll}if(_.slideCount<=_.options.slidesToShow){_.currentSlide=0}_.registerBreakpoints();_.setProps();_.setupInfinite();_.buildArrows();_.updateArrows();_.initArrowEvents();_.buildDots();_.updateDots();_.initDotEvents();_.cleanUpSlideEvents();_.initSlideEvents();_.checkResponsive(false,true);if(_.options.focusOnSelect===true){$(_.$slideTrack).children().on("click.slick",_.selectHandler)}_.setSlideClasses(typeof _.currentSlide==="number"?_.currentSlide:0);_.setPosition();_.focusHandler();_.paused=!_.options.autoplay;_.autoPlay();_.$slider.trigger("reInit",[_])};Slick.prototype.resize=function(){var _=this;if($(window).width()!==_.windowWidth){clearTimeout(_.windowDelay);_.windowDelay=window.setTimeout(function(){_.windowWidth=$(window).width();_.checkResponsive();if(!_.unslicked){_.setPosition()}},50)}};Slick.prototype.removeSlide=Slick.prototype.slickRemove=function(index,removeBefore,removeAll){var _=this;if(typeof index==="boolean"){removeBefore=index;index=removeBefore===true?0:_.slideCount-1}else{index=removeBefore===true?--index:index}if(_.slideCount<1||index<0||index>_.slideCount-1){return false}_.unload();if(removeAll===true){_.$slideTrack.children().remove()}else{_.$slideTrack.children(this.options.slide).eq(index).remove()}_.$slides=_.$slideTrack.children(this.options.slide);_.$slideTrack.children(this.options.slide).detach();_.$slideTrack.append(_.$slides);_.$slidesCache=_.$slides;_.reinit()};Slick.prototype.setCSS=function(position){var _=this,positionProps={},x,y;if(_.options.rtl===true){position=-position}x=_.positionProp=="left"?Math.ceil(position)+"px":"0px";y=_.positionProp=="top"?Math.ceil(position)+"px":"0px";positionProps[_.positionProp]=position;if(_.transformsEnabled===false){_.$slideTrack.css(positionProps)}else{positionProps={};if(_.cssTransitions===false){positionProps[_.animType]="translate("+x+", "+y+")";_.$slideTrack.css(positionProps)}else{positionProps[_.animType]="translate3d("+x+", "+y+", 0px)";_.$slideTrack.css(positionProps)}}};Slick.prototype.setDimensions=function(){var _=this;if(_.options.vertical===false){if(_.options.centerMode===true){_.$list.css({padding:"0px "+_.options.centerPadding})}}else{_.$list.height(_.$slides.first().outerHeight(true)*_.options.slidesToShow);if(_.options.centerMode===true){_.$list.css({padding:_.options.centerPadding+" 0px"})}}_.listWidth=_.$list.width();_.listHeight=_.$list.height();if(_.options.vertical===false&&_.options.variableWidth===false){_.slideWidth=Math.ceil(_.listWidth/_.options.slidesToShow);_.$slideTrack.width(Math.ceil(_.slideWidth*_.$slideTrack.children(".slick-slide").length))}else if(_.options.variableWidth===true){_.$slideTrack.width(5e3*_.slideCount)}else{_.slideWidth=Math.ceil(_.listWidth);_.$slideTrack.height(Math.ceil(_.$slides.first().outerHeight(true)*_.$slideTrack.children(".slick-slide").length))}var offset=_.$slides.first().outerWidth(true)-_.$slides.first().width();if(_.options.variableWidth===false)_.$slideTrack.children(".slick-slide").width(_.slideWidth-offset)};Slick.prototype.setFade=function(){var _=this,targetLeft;_.$slides.each(function(index,element){targetLeft=_.slideWidth*index*-1;if(_.options.rtl===true){$(element).css({position:"relative",right:targetLeft,top:0,zIndex:_.options.zIndex-2,opacity:0}
306)}else{$(element).css({position:"relative",left:targetLeft,top:0,zIndex:_.options.zIndex-2,opacity:0})}});_.$slides.eq(_.currentSlide).css({zIndex:_.options.zIndex-1,opacity:1})};Slick.prototype.setHeight=function(){var _=this;if(_.options.slidesToShow===1&&_.options.adaptiveHeight===true&&_.options.vertical===false){var targetHeight=_.$slides.eq(_.currentSlide).outerHeight(true);_.$list.css("height",targetHeight)}};Slick.prototype.setOption=Slick.prototype.slickSetOption=function(){var _=this,l,item,option,value,refresh=false,type;if($.type(arguments[0])==="object"){option=arguments[0];refresh=arguments[1];type="multiple"}else if($.type(arguments[0])==="string"){option=arguments[0];value=arguments[1];refresh=arguments[2];if(arguments[0]==="responsive"&&$.type(arguments[1])==="array"){type="responsive"}else if(typeof arguments[1]!=="undefined"){type="single"}}if(type==="single"){_.options[option]=value}else if(type==="multiple"){$.each(option,function(opt,val){_.options[opt]=val})}else if(type==="responsive"){for(item in value){if($.type(_.options.responsive)!=="array"
vendor: 14,808 bytes, line 306
306){_.options.responsive=[value[item]]}else{l=_.options.responsive.length-1;while(l>=0){if(_.options.responsive[l].breakpoint===value[item].breakpoint){_.options.responsive.splice(l,1)}l--}_.options.responsive.push(value[item])}}}if(refresh){_.unload();_.reinit()}};Slick.prototype.setPosition=function(){var _=this;_.setDimensions();_.setHeight();if(_.options.fade===false){_.setCSS(_.getLeft(_.currentSlide))}else{_.setFade()}_.$slider.trigger("setPosition",[_])};Slick.prototype.setProps=function(){var _=this,bodyStyle=document.body.style;_.positionProp=_.options.vertical===true?"top":"left";if(_.positionProp==="top"){_.$slider.addClass("slick-vertical")}else{_.$slider.removeClass("slick-vertical")}if(bodyStyle.WebkitTransition!==undefined||bodyStyle.MozTransition!==undefined||bodyStyle.msTransition!==undefined){if(_.options.useCSS===true){_.cssTransitions=true}}if(_.options.fade){if(typeof _.options.zIndex==="number"){if(_.options.zIndex<3){_.options.zIndex=3}}else{_.options.zIndex=_.defaults.zIndex}}if(bodyStyle.OTransform!==undefined){_.animType="OTransform";_.transformType="-o-transform";_.transitionType="OTransition";if(bodyStyle.perspectiveProperty===undefined&&bodyStyle.webkitPerspective===undefined)_.animType=false}if(bodyStyle.MozTransform!==undefined){_.animType="MozTransform";_.transformType="-moz-transform";_.transitionType="MozTransition";if(bodyStyle.perspectiveProperty===undefined&&bodyStyle.MozPerspective===undefined)_.animType=false}if(bodyStyle.webkitTransform!==undefined){_.animType="webkitTransform";_.transformType="-webkit-transform";_.transitionType="webkitTransition";if(bodyStyle.perspectiveProperty===undefined&&bodyStyle.webkitPerspective===undefined)_.animType=false}if(bodyStyle.msTransform!==undefined){_.animType="msTransform";_.transformType="-ms-transform";_.transitionType="msTransition";if(bodyStyle.msTransform===undefined)_.animType=false}if(bodyStyle.transform!==undefined&&_.animType!==false){_.animType="transform";_.transformType="transform";_.transitionType="transition"}_.transformsEnabled=_.options.useTransform&&(_.animType!==null&&_.animType!==false)};Slick.prototype.setSlideClasses=function(index){var _=this,centerOffset,allSlides,indexOffset,remainder;allSlides=_.$slider.find(".slick-slide").removeClass("slick-active slick-center slick-current").attr("aria-hidden","true");_.$slides.eq(index).addClass("slick-current");if(_.options.centerMode===true){var evenCoef=_.options.slidesToShow%2===0?1:0;centerOffset=Math.floor(_.options.slidesToShow/2);if(_.options.infinite===true){if(index>=centerOffset&&index<=_.slideCount-1-centerOffset){_.$slides.slice(index-centerOffset+evenCoef,index+centerOffset+1).addClass("slick-active").attr("aria-hidden","false")}else{indexOffset=_.options.slidesToShow+index;allSlides.slice(indexOffset-centerOffset+1+evenCoef,indexOffset+centerOffset+2).addClass("slick-active").attr("aria-hidden","false")}if(index===0){allSlides.eq(allSlides.length-1-_.options.slidesToShow).addClass("slick-center")}else if(index===_.slideCount-1){allSlides.eq(_.options.slidesToShow).addClass("slick-center")}}_.$slides.eq(index).addClass("slick-center")}else{if(index>=0&&index<=_.slideCount-_.options.slidesToShow){_.$slides.slice(index,index+_.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false")}else if(allSlides.length<=_.options.slidesToShow){allSlides.addClass("slick-active").attr("aria-hidden","false")}else{remainder=_.slideCount%_.options.slidesToShow;indexOffset=_.options.infinite===true?_.options.slidesToShow+index:index;if(_.options.slidesToShow==_.options.slidesToScroll&&_.slideCount-index<_.options.slidesToShow){allSlides.slice(indexOffset-(_.options.slidesToShow-remainder),indexOffset+remainder).addClass("slick-active").attr("aria-hidden","false")}else{allSlides.slice(indexOffset,indexOffset+_.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false")}}}if(_.options.lazyLoad==="ondemand"||_.options.lazyLoad==="anticipated"){_.lazyLoad()}};Slick.prototype.setupInfinite=function(){var _=this,i,slideIndex,infiniteCount;if(_.options.fade===true){_.options.centerMode=false}if(_.options.infinite===true&&_.options.fade===false){slideIndex=null;if(_.slideCount>_.options.slidesToShow){if(_.options.centerMode===true){infiniteCount=_.options.slidesToShow+1}else{infiniteCount=_.options.slidesToShow}for(i=_.slideCount;i>_.slideCount-infiniteCount;i-=1){slideIndex=i-1;$(_.$slides[slideIndex]).clone(true).attr("id","").attr("data-slick-index",slideIndex-_.slideCount).prependTo(_.$slideTrack).addClass("slick-cloned")}for(i=0;i<infiniteCount+_.slideCount;i+=1){slideIndex=i;$(_.$slides[slideIndex]).clone(true).attr("id","").attr("data-slick-index",slideIndex+_.slideCount).appendTo(_.$slideTrack).addClass("slick-cloned")}_.$slideTrack.find(".slick-cloned").find("[id]").each(function(){$(this).attr("id","")})}}};Slick.prototype.interrupt=function(toggle){var _=this;if(!toggle){_.autoPlay()}_.interrupted=toggle};Slick.prototype.selectHandler=function(event){var _=this;var targetElement=$(event.target).is(".slick-slide")?$(event.target):$(event.target).parents(".slick-slide");var index=parseInt(targetElement.attr("data-slick-index"));if(!index)index=0;if(_.slideCount<=_.options.slidesToShow){_.slideHandler(index,false,true);return}_.slideHandler(index)};Slick.prototype.slideHandler=function(index,sync,dontAnimate){var targetSlide,animSlide,oldSlide,slideLeft,targetLeft=null,_=this,navTarget;sync=sync||false;if(_.animating===true&&_.options.waitForAnimate===true){return}if(_.options.fade===true&&_.currentSlide===index){return}if(sync===false){_.asNavFor(index)}targetSlide=index;targetLeft=_.getLeft(targetSlide);slideLeft=_.getLeft(_.currentSlide);_.currentLeft=_.swipeLeft===null?slideLeft:_.swipeLeft;if(_.options.infinite===false&&_.options.centerMode===false&&(index<0||index>_.getDotCount()*_.options.slidesToScroll)){if(_.options.fade===false){targetSlide=_.currentSlide;if(dontAnimate!==true&&_.slideCount>_.options.slidesToShow){_.animateSlide(slideLeft,function(){_.postSlide(targetSlide)})}else{_.postSlide(targetSlide)}}return}else if(_.options.infinite===false&&_.options.centerMode===true&&(index<0||index>_.slideCount-_.options.slidesToScroll)){if(_.options.fade===false){targetSlide=_.currentSlide;if(dontAnimate!==true&&_.slideCount>_.options.slidesToShow){_.animateSlide(slideLeft,function(){_.postSlide(targetSlide)})}else{_.postSlide(targetSlide)}}return}if(_.options.autoplay){clearInterval(_.autoPlayTimer)}if(targetSlide<0){if(_.slideCount%_.options.slidesToScroll!==0){animSlide=_.slideCount-_.slideCount%_.options.slidesToScroll}else{animSlide=_.slideCount+targetSlide}}else if(targetSlide>=_.slideCount){if(_.slideCount%_.options.slidesToScroll!==0){animSlide=0}else{animSlide=targetSlide-_.slideCount}}else{animSlide=targetSlide}_.animating=true;_.$slider.trigger("beforeChange",[_,_.currentSlide,animSlide]);oldSlide=_.currentSlide;_.currentSlide=animSlide;_.setSlideClasses(_.currentSlide);if(_.options.asNavFor){navTarget=_.getNavTarget();navTarget=navTarget.slick("getSlick");if(navTarget.slideCount<=navTarget.options.slidesToShow){navTarget.setSlideClasses(_.currentSlide)}}_.updateDots();_.updateArrows();if(_.options.fade===true){if(dontAnimate!==true){_.fadeSlideOut(oldSlide);_.fadeSlide(animSlide,function(){_.postSlide(animSlide)})}else{_.postSlide(animSlide)}_.animateHeight();return}if(dontAnimate!==true&&_.slideCount>_.options.slidesToShow){_.animateSlide(targetLeft,function(){_.postSlide(animSlide)})}else{_.postSlide(animSlide)}};Slick.prototype.startLoad=function(){var _=this;if(_.options.arrows===true&&_.slideCount>_.options.slidesToShow){_.$prevArrow.hide();_.$nextArrow.hide()}if(_.options.dots===true&&_.slideCount>_.options.slidesToShow){_.$dots.hide()}_.$slider.addClass("slick-loading")};Slick.prototype.swipeDirection=function(){var xDist,yDist,r,swipeAngle,_=this;xDist=_.touchObject.startX-_.touchObject.curX;yDist=_.touchObject.startY-_.touchObject.curY;r=Math.atan2(yDist,xDist);swipeAngle=Math.round(r*180/Math.PI);if(swipeAngle<0){swipeAngle=360-Math.abs(swipeAngle)}if(swipeAngle<=45&&swipeAngle>=0){return _.options.rtl===false?"left":"right"}if(swipeAngle<=360&&swipeAngle>=315){return _.options.rtl===false?"left":"right"}if(swipeAngle>=135&&swipeAngle<=225){return _.options.rtl===false?"right":"left"}if(_.options.verticalSwiping===true){if(swipeAngle>=35&&swipeAngle<=135){return"down"}else{return"up"}}return"vertical"};Slick.prototype.swipeEnd=function(event){var _=this,slideCount,direction;_.dragging=false;_.swiping=false;if(_.scrolling){_.scrolling=false;return false}_.interrupted=false;_.shouldClick=_.touchObject.swipeLength>10?false:true;if(_.touchObject.curX===undefined){return false}if(_.touchObject.edgeHit===true){_.$slider.trigger("edge",[_,_.swipeDirection()])}if(_.touchObject.swipeLength>=_.touchObject.minSwipe){direction=_.swipeDirection();switch(direction){case"left":case"down":slideCount=_.options.swipeToSlide?_.checkNavigable(_.currentSlide+_.getSlideCount()):_.currentSlide+_.getSlideCount();_.currentDirection=0;break;case"right":case"up":slideCount=_.options.swipeToSlide?_.checkNavigable(_.currentSlide-_.getSlideCount()):_.currentSlide-_.getSlideCount();_.currentDirection=1;break;default:}if(direction!="vertical"){_.slideHandler(slideCount);_.touchObject={};_.$slider.trigger("swipe",[_,direction])}}else{if(_.touchObject.startX!==_.touchObject.curX){_.slideHandler(_.currentSlide);_.touchObject={}}}};Slick.prototype.swipeHandler=function(event){var _=this;if(_.options.swipe===false||"ontouchend"in document&&_.options.swipe===false){return}else if(_.options.draggable===false&&event.type.indexOf("mouse")!==-1){return}_.touchObject.fingerCount=event.originalEvent&&event.originalEvent.touches!==undefined?event.originalEvent.touches.length:1;_.touchObject.minSwipe=_.listWidth/_.options.touchThreshold;if(_.options.verticalSwiping===true){_.touchObject.minSwipe=_.listHeight/_.options.touchThreshold}switch(event.data.action){case"start":_.swipeStart(event);break;case"move":_.swipeMove(event);break;case"end":_.swipeEnd(event);break}};Slick.prototype.swipeMove=function(event){var _=this,edgeWasHit=false,curLeft,swipeDirection,swipeLength,positionOffset,touches,verticalSwipeLength;touches=event.originalEvent!==undefined?event.originalEvent.touches:null;if(!_.dragging||_.scrolling||touches&&touches.length!==1){return false}curLeft=_.getLeft(_.currentSlide);_.touchObject.curX=touches!==undefined?touches[0].pageX:event.clientX;_.touchObject.curY=touches!==undefined?touches[0].pageY:event.clientY;_.touchObject.swipeLength=Math.round(Math.sqrt(Math.pow(_.touchObject.curX-_.touchObject.startX,2)));verticalSwipeLength=Math.round(Math.sqrt(Math.pow(_.touchObject.curY-_.touchObject.startY,2)));if(!_.options.verticalSwiping&&!_.swiping&&verticalSwipeLength>4){_.scrolling=true;return false}if(_.options.verticalSwiping===true){_.touchObject.swipeLength=verticalSwipeLength}swipeDirection=_.swipeDirection();if(event.originalEvent!==undefined&&_.touchObject.swipeLength>4){_.swiping=true;event.preventDefault()}positionOffset=(_.options.rtl===false?1:-1)*(_.touchObject.curX>_.touchObject.startX?1:-1);if(_.options.verticalSwiping===true){positionOffset=_.touchObject.curY>_.touchObject.startY?1:-1}swipeLength=_.touchObject.swipeLength;_.touchObject.edgeHit=false;if(_.options.infinite===false){if(_.currentSlide===0&&swipeDirection==="right"||_.currentSlide>=_.getDotCount()&&swipeDirection==="left"){swipeLength=_.touchObject.swipeLength*_.options.edgeFriction;_.touchObject.edgeHit=true}}if(_.options.vertical===false){_.swipeLeft=curLeft+swipeLength*positionOffset}else{_.swipeLeft=curLeft+swipeLength*(_.$list.height()/_.listWidth)*positionOffset}if(_.options.verticalSwiping===true){_.swipeLeft=curLeft+swipeLength*positionOffset}if(_.options.fade===true||_.options.touchMove===false){return false}if(_.animating===true){_.swipeLeft=null;return false}_.setCSS(_.swipeLeft)};Slick.prototype.swipeStart=function(event){var _=this,touches;_.interrupted=true;if(_.touchObject.fingerCount!==1||_.slideCount<=_.options.slidesToShow){_.touchObject={};return false}if(event.originalEvent!==undefined&&event.originalEvent.touches!==undefined){touches=event.originalEvent.touches[0]}_.touchObject.startX=_.touchObject.curX=touches!==undefined?touches.pageX:event.clientX;_.touchObject.startY=_.touchObject.curY=touches!==undefined?touches.pageY:event.clientY;_.dragging=true};Slick.prototype.unfilterSlides=Slick.prototype.slickUnfilter=function(){var _=this;if(_.$slidesCache!==null){_.unload();_.$slideTrack.children(this.options.slide).detach();_.$slidesCache.appendTo(_.$slideTrack);_.reinit()}};Slick.prototype.unload=function(){var _=this;$(".slick-cloned",_.$slider).remove();if(_.$dots){_.$dots.remove()}if(_.$prevArrow&&_.htmlExpr.test(_.options.prevArrow)){_.$prevArrow.remove()}if(_.$nextArrow&&_.htmlExpr.test(_.options.nextArrow)){_.$nextArrow.remove()}_.$slides.removeClass("slick-slide slick-active slick-visible slick-current").attr("aria-hidden","true").css("width","")};Slick.prototype.unslick=function(fromBreakpoint){var _=this;_.$slider.trigger("unslick",[_,fromBreakpoint]);_.destroy()};Slick.prototype.updateArrows=function(){var _=this,centerOffset;centerOffset=Math.floor(_.options.slidesToShow/2);if(_.options.arrows===true&&_.slideCount>_.options.slidesToShow&&!_.options.infinite){_.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false");_.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false");if(_.currentSlide===0){_.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true");_.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false")}else if(_.currentSlide>=_.slideCount-_.options.slidesToShow&&_.options.centerMode===false){_.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true");_.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")}else if(_.currentSlide>=_.slideCount-1&&_.options.centerMode===true){_.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true");_.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")}}};Slick.prototype.updateDots=function(){var _=this;if(_.$dots!==null){_.$dots.find("li").removeClass("slick-active").end();_.$dots.find("li").eq(Math.floor(_.currentSlide/_.options.slidesToScroll)).addClass("slick-active")}};Slick.prototype.visibility=function(){var _=this;if(_.options.autoplay){if(document[_.hidden]){_.interrupted=true}else{_.interrupted=false}}};$.fn.slick=function(){var _=this,opt=arguments[0],args=Array.prototype.slice.call(arguments,1),l=_.length,i,ret;for(i=0;i<l;i++){if(typeof opt=="object"||typeof opt=="undefined")_[i].slick=new Slick(_[i],opt);else ret=_[i].slick[opt].apply(_[i].slick,args);if(typeof ret!="undefined")return ret}return _}});
306 307; 308(function ($, Drupal, drupalSettings, once) { 309 310 'use strict'; 311 312 const next_string = Drupal.t('Next'); 313 const prev_string = Drupal.t('Prev'); 314 315 Drupal.behaviors.sliderBehavior = { 316 attach: function (context, settings) { 317 // Default slider (front page). 318 once('sliderBehaviorDefaultSlick', '.slider__container', context).forEach(element => { 319 320 // Shuffle slides order if they are from the same paragraph. 321 function shuffleImages() { 322 let slidesIdArray = {}; 323 element.querySelectorAll('.slider__banner[data-slide-id]').forEach((item) => { 324 const id = item.dataset.slideId; 325 if (id) { 326 if (slidesIdArray[id]) { 327 slidesIdArray[id]++; 328 } else { 329 slidesIdArray[id] = 1; 330 } 331 } 332 }); 333 334 for (const [key, value] of Object.entries(slidesIdArray)) { 335 if (value < 2) { 336 continue 337 } 338 339 let items = element.querySelectorAll(`.slider__banner[data-slide-id="${key}"]`); 340 let shuffled = [...items] 341 .map((item) => item.cloneNode(true)) 342 .sort(() => Math.random() - 0.5); 343 344 items.forEach((item, index) => { 345 item.after(shuffled[index]); 346 item.remove(); 347 }); 348 } 349 } 350 351 shuffleImages(); 352 353 354 let sliderSettings = { 355 arrows: false, 356 autoplay: true 357 } 358 359 if (typeof drupalSettings !== 'undefined' && drupalSettings.sliderEntityType !== 'undefined' && drupalSettings.sliderEntityType === 'commerce_product') { 360 sliderSettings = { 361 arrows: true, 362 autoplay: true, 363 prevArrow: '<span class="icon icon-slider-arrow icon-slider-prev horizontal"></span>', 364 nextArrow: '<span class="icon icon-slider-arrow icon-slider-next horizontal"></span>', 365 } 366 } else { 367 sliderSettings = { 368 autoplay: true, 369 dots: true, 370 pauseOnFocus: false, 371 arrows: false, 372 swipe: true, 373 responsive: [{ 374 breakpoint: 769, 375 settings: { 376 dots: false, 377 } 378 }] 379 }; 380 } 381 382 sliderSettings.autoplaySpeed = 6000 383 384 let slider = $(".slider__container").slick(sliderSettings); 385 386 // Play video from the beginning. 387 function playVideoFromStart(slideIndex) { 388 if (!slider.slick('getSlick').$slides) { 389 return; 390 } 391 392 let slideElement = slider.slick('getSlick').$slides[slideIndex]; 393 let video = $(slideElement).find('video')[0]; 394 if (video) { 395 video.currentTime = 0; 396 video.muted = true; 397 video.playsInline = true; 398 let promise = video.play(); 399 if (promise !== undefined) { 400 promise.catch(error => { 401 // Auto-play was prevented 402 video.controls = true; 403 }).then(() => { 404 // Auto-play started 405 }); 406 } 407 } 408 } 409 410 // Add event listeners for video elements within the slider. 411 slider.find('video').each(function () { 412 let video = this; 413 414 // Pause Slick autoplay when video starts playing. 415 video.addEventListener('play', function () { 416 slider.slick('slickPause'); 417 }); 418 419 // Resume Slick autoplay when video ends. 420 video.addEventListener('ended', function () { 421 slider.slick('slickNext'); 422 slider.slick('slickPlay'); 423 }); 424 }); 425 426 // Play video from the beginning when the slide is shown. 427 slider.on('beforeChange', function (event, slick, currentSlide, nextSlide) { 428 playVideoFromStart(nextSlide); 429 }); 430 431 // Play video from the beginning if it's on the first slide. 432 playVideoFromStart(0); 433 }); 434 435 // Family slider. 436 once('sliderBehaviorMainProductPhotosSlick', '.slider__family-container .slider-container', context).forEach(element => { 437 function changeImgSlide(index) { 438 let img = $('.slider__family-container [data-slick-index="' + (index) + '"]').find('img') 439 img = $(img) 440 img.attr('src', img.data('main-src')) 441 } 442 443 function changeClsSlide(index, cls) { 444 let slide = '.slider__family-container [data-slick-index="' + (index) + '"]'; 445 $(slide).addClass(cls) 446 } 447 448 const familySlider = $(element).slick({ 449 autoplay: false, 450 infinite: true, 451 lazyload: 'ondemand', 452 slidesToShow: 3, 453 slidesToScroll: 1, 454 centerMode: true, 455 accessibility: false, 456 variableWidth: true, 457 swipe: false, 458 prevArrow: '<span class="icon icon-slider-arrow icon-slider-prev horizontal"></span>', 459 nextArrow: '<span class="icon icon-slider-arrow icon-slider-next horizontal"></span>', 460 responsive: [{ 461 breakpoint: 769, 462 settings: { 463 slidesToShow: 1, 464 slidesToScroll: 1, 465 variableWidth: false, 466 centerMode: false, 467 swipe: true 468 } 469 }] 470 }); 471 472 familySlider.on('beforeChange', function (event, {slideCount: count}, currentSlide, nextSlide) { 473 let slides = $(this).find('.slick-slide').find('img')
474 Object.values(slides).forEach(slide => { 475 $(slide).attr('src', $(slide).data('sub-src')) 476 }); 477 let direction; 478 if (nextSlide == currentSlide) { 479 direction = "same"; 480 481 } else if (Math.abs(nextSlide - currentSlide) == 1) { 482 direction = (nextSlide - currentSlide > 0) ? "right" : "left"; 483 484 } else { 485 direction = (nextSlide - currentSlide > 0) ? "left" : "right"; 486 } 487 488 $('.first-active-family-slide').removeClass('first-active-family-slide'); 489 $('.last-active-family-slide').removeClass('last-active-family-slide'); 490 $('.custom-current').removeClass('custom-current'); 491 $('.family-slide-active').removeClass('family-slide-active') 492 493 if (currentSlide - 1 == nextSlide || (nextSlide + 1 == count && currentSlide < nextSlide)) { 494 let nextIndex = currentSlide - 1 495 496 if (direction === 'right') { 497 nextIndex = currentSlide + 1 498 } 499 500 changeImgSlide(nextIndex) 501 changeClsSlide(nextIndex, 'custom-current') 502 503 changeClsSlide(nextIndex - 1, 'first-active-family-slide') 504 changeClsSlide(nextIndex - 1, 'family-slide-active') 505 changeClsSlide(nextIndex + 1, 'last-active-family-slide') 506 } 507 508 if (currentSlide + 1 == count) { 509 let nextIndex = currentSlide + 1 510 511 if (direction === 'left') { 512 nextIndex = currentSlide - 1 513 } 514 515 changeImgSlide(nextIndex) 516 changeClsSlide(nextIndex, 'custom-current') 517 518 changeClsSlide(nextIndex - 1, 'first-active-family-slide') 519 changeClsSlide(nextIndex - 1, 'family-slide-active') 520 changeClsSlide(nextIndex + 1, 'last-active-family-slide') 521 } 522 523 changeImgSlide(nextSlide) 524 changeClsSlide(nextSlide, 'custom-current') 525 526 changeClsSlide((nextSlide - 1), 'first-active-family-slide') 527 changeClsSlide((nextSlide - 1), 'family-slide-active') 528 changeClsSlide((nextSlide + 1), 'last-active-family-slide') 529 changeClsSlide((nextSlide + 1), 'family-slide-active') 530 531 }) 532 533 let img = $(element).find('.slick-slide.slick-current').find('img') 534 img = $(img) 535 img.attr('src', img.data('main-src')) 536 537 $(element).find('.slick-slide.slick-current').addClass('custom-current') 538 539 let actives = $(element).find('.slick-slide.slick-active') 540 541 $(actives).eq(0).addClass('first-active-family-slide') 542 $(actives).eq(0).addClass('family-slide-active') 543 $(actives).eq(($(actives).length - 1)).addClass('last-active-family-slide') 544 $(actives).eq(($(actives).length - 1)).addClass('family-slide-active') 545 546 $('.slider__family-container .slick-slide .slider__banner-family-link').click(function (e) { 547 console.log('event', e.currentTarget.parentElement.parentElement.parentElement.parentElement) 548 let parent = e.currentTarget.parentElement.parentElement.parentElement.parentElement 549 550 if (!parent.classList.contains('slick-current')) { 551 e.preventDefault(); 552 } 553 }) 554 }); 555 556 // Main product photo. 557 once('sliderBehaviorMainProductPhotosSlick', '.slider__main-product-photo', context).forEach(element => { 558 /** 559 * Enable zoom inside main product photo slick... but only when 'hover' is possible. 560 */ 561 $(element).on('init', function (e, slick) { 562 if (!window.matchMedia("(hover: hover)").matches) { 563 return; 564 } 565 566 // Get slick slides' children elements with data-zoom-image attribute. 567 let slick_slides_elements = $(e.target).find('.slick-slide [data-zoom-image]'); 568 569 slick_slides_elements.each(function () { 570 let zoom_image = $(this).data('zoom-image'); 571 572 if (zoom_image) { 573 // Create zoom image container. 574 let zoom_image_container = $(`<div class="slick-zoom-image" style="background-image: url(${zoom_image})"></div>`); 575 576 // Change the position of the background image according to the position of the cursor. 577 zoom_image_container.on('mousemove', function (e) { 578 // Calculate the background's position in percent. 579 let left = (e.pageX - $(this).offset().left) / $(this).outerWidth() * 100; 580 let top = (e.pageY - $(this).offset().top) / $(this).outerHeight() * 100; 581 582 $(this).css('background-position', `${left}% ${top}%`); 583 }); 584 585 // Add zoom image container to the slick slide. 586 $(this).append(zoom_image_container); 587 } 588 }); 589 }); 590 591 $(element).slick({ 592 autoplay: false, 593 arrows: true, 594 lazyload: 'ondemand', 595 slidesToShow: 1, 596 asNavFor: '.slider__main-product-photo-navigation', 597 prevArrow: '<span class="icon icon-slider-arrow icon-slider-prev horizontal"></span>', 598 nextArrow: '<span class="icon icon-slider-arrow icon-slider-next horizontal"></span>' 599 }); 600 601 $(element).slickLightbox({ 602 lazy: true, 603 imageMaxHeight: 0.98, 604 slick: { 605 prevArrow: `<button class="slick-prev" aria-label="${prev_str
605ing}" type="button"><span class="icon-slider-prev-light"></span></button>`, 606 nextArrow: `<button class="slick-next" aria-label="${next_string}" type="button"><span class="icon-slider-next-light"></span></button>`, 607 } 608 609 }) 610 611 const productTypes = ['bike', 'frames', 'parts']; 612 if (!productTypes.includes(drupalSettings.productType)) { 613 return; 614 } 615 616 const IMAGE_MAX_ZOOM = 600; 617 618 $.fn.setZoom = function (posX, posY, zoom, isPercentage = false) { 619 let left, top; 620 if (isPercentage) { 621 left = posX; 622 top = posY; 623 } else { 624 left = (posX - $(this).offset().left) / $(this).outerWidth() * 100; 625 top = (posY - $(this).offset().top) / $(this).outerHeight() * 100; 626 } 627 628 // Clamp percentages to avoid image wrapping if no-repeat is set or showing wrong part 629 left = Math.min(Math.max(left, 0), 100); 630 top = Math.min(Math.max(top, 0), 100); 631 632 if (zoom === undefined) { 633 zoom = 200; 634 } 635 636 if (zoom > IMAGE_MAX_ZOOM) { 637 zoom = IMAGE_MAX_ZOOM; 638 } 639 640 const bg = zoom + '%'; 641 642 $(this).css({ 643 'background-position': `${left}% ${top}%`, 644 'background-size': bg 645 }); 646 647 if (zoom > 100) { 648 $(this).addClass('zoomed'); 649 } 650 else { 651 $(this).removeClass('zoomed'); 652 } 653 } 654 655 $(element).on('show.slickLightbox', function (e) { 656 // Get original slick slides. 657 let slick_slides = $(e.target).find('.slick-slide:not(.slick-cloned)'); 658 slick_slides.each(function () { 659 let slick_index = $(this).data('slick-index'); 660 let zoom_image = $(this).find('div a').first().data('zoom-image'); 661 662 if (slick_index !== undefined && zoom_image !== undefined) { 663 // Find lightbox slide corresponding to the original slide. 664 let slick_lightbox_slide = $(`.slick-lightbox .slick-slide:not(.slick-cloned)[data-slick-index=${slick_index}] .slick-lightbox-slick-item-inner`); 665 666 if (slick_lightbox_slide) { 667 // Create Zoom image container. 668 let zoom_image_container = $(`<div class="slick-lightbox-zoom-image" style="background-image: url(${zoom_image})"></div>`); 669 670 // Change the position of the background image according to the position of the cursor. 671 zoom_image_container.on('mousemove', function (e) { 672 $(this).setZoom(e.pageX, e.pageY); 673 }); 674 675 zoom_image_container.on('mouseleave', function (e) { 676 $(this).setZoom(e.pageX, e.pageY, 100); 677 }); 678 679 // Touch support for pinch zoom and panning. 680 let initialDist = null; 681 let initialBgSize = 200; 682 let currentBgSize = 200; 683 let initialPos = { x: 0, y: 0 }; 684 let currentBgPos = { x: 50, y: 50 }; 685 let lastTapTime = 0; 686 687 if ($('.toolbar-tray-open').length > 0) { 688 initialBgSize = 400; 689 currentBgSize = 400; 690 } 691 692 zoom_image_container.attr('data-zoom', currentBgSize); 693 694 // Ensure events are not passive if possible. 695 zoom_image_container[0].addEventListener('touchstart', function() {}, {passive: false}); 696 697 zoom_image_container.on('touchstart', function (e) { 698 let zoom = parseFloat($(this).attr('data-zoom')) || 100; 699 700 // Double tap zoom logic (always active for quick zoom). 701 let currentTime = new Date().getTime(); 702 let tapThreshold = 300; // ms 703 if (e.originalEvent.touches.length === 1) { 704 if (currentTime - lastTapTime < tapThreshold) { 705 e.stopPropagation(); 706 if (e.cancelable) e.preventDefault(); 707 // Double tap detected. 708 if (currentBgSize > 100) { 709 currentBgSize = 100; 710 } else { 711 currentBgSize = 400; 712 } 713 // Center on tap location. 714 let tapX = e.originalEvent.touches[0].pageX - $(this).offset().left; 715 let tapY = e.originalEvent.touches[0].pageY - $(this).offset().top; 716 currentBgPos.x = Math.min(Math.max((tapX / $(this).outerWidth()) * 100, 0), 100); 717 currentBgPos.y = Math.min(Math.max((tapY / $(this).outerHeight()) * 100, 0), 100); 718 719 $(this).setZoom(currentBgPos.x, currentBgPos.y, currentBgSize, true); 720 $(this).attr('data-zoom', currentBgSize); 721 722 lastTapTime = 0; // Reset after zoom. 723 return; 724 } 725 lastTapTime = currentTime; 726 } 727 728 if (e.originalEvent.touches.length === 2) { 729 e.stopPropagation(); 730 initialDist = Math.hypot( 731 e.originalEvent.touches[0].pageX - e.originalEvent.touches[1].pageX, 732 e.originalEvent.touches[0].pageY - e.originalEvent.touches[1].pageY 733 ); 734 initialBgSize = currentBgSize; 735 initialPos = { 736 x: (e.originalEvent.touches[0].pageX + e.originalEvent.touches[1].pageX) / 2, 737 y: (e.originalEvent.touches[0].pageY + e.originalEvent.touches[1].pageY) / 2 738 }; 739 } 740 }); 741 742 zoom_image_container.on('touchmove', function (e) { 743 let zoom = parseFloat($(this).attr('data-zoom')) || 100; 744 745 if (e.originalEvent.touches.length === 2) { 746 e.stopPropagation(); 747 if (e.cancelable) e.preventDefault(); 748 749 let touch1 = e.originalEvent.touches[0]; 750 let touch2 = e.originalEvent.touches[1]; 751 752 // Handle Zoom 753 let dist = Math.hypot(
754 touch1.pageX - touch2.pageX, 755 touch1.pageY - touch2.pageY 756 ); 757 758 let scale = dist / initialDist; 759 let newBgSize = Math.min(Math.max(initialBgSize * scale, 100), 800); 760 761 // Calculate midpoint in pixels relative to container. 762 let offset = $(this).offset(); 763 let midX = ((touch1.pageX + touch2.pageX) / 2) - offset.left; 764 let midY = ((touch1.pageY + touch2.pageY) / 2) - offset.top; 765 766 // Midpoint in percentage. 767 let midXPerc = (midX / $(this).outerWidth()) * 100; 768 let midYPerc = (midY / $(this).outerHeight()) * 100; 769 770 // Adjust background position to keep the midpoint stable during scaling. 771 if (currentBgSize > 100) { 772 let ratio = 1 - (currentBgSize / newBgSize); 773 currentBgPos.x = Math.min(Math.max(currentBgPos.x + (midXPerc - currentBgPos.x) * ratio, 0), 100); 774 currentBgPos.y = Math.min(Math.max(currentBgPos.y + (midYPerc - currentBgPos.y) * ratio, 0), 100); 775 } 776 777 // Handle Panning (two fingers) 778 let currentMidX = (touch1.pageX + touch2.pageX) / 2; 779 let currentMidY = (touch1.pageY + touch2.pageY) / 2; 780 781 let deltaX = currentMidX - initialPos.x; 782 let deltaY = currentMidY - initialPos.y; 783 784 let moveX = (deltaX / $(this).outerWidth()) * 100; 785 let moveY = (deltaY / $(this).outerHeight()) * 100; 786 787 currentBgPos.x = Math.min(Math.max(currentBgPos.x - moveX, 0), 100); 788 currentBgPos.y = Math.min(Math.max(currentBgPos.y - moveY, 0), 100); 789 790 currentBgSize = newBgSize; 791 $(this).setZoom(currentBgPos.x, currentBgPos.y, currentBgSize, true); 792 $(this).attr('data-zoom', currentBgSize); 793 794 initialPos = { x: currentMidX, y: currentMidY }; 795 initialDist = dist; 796 initialBgSize = newBgSize; 797 } 798 }); 799 800 zoom_image_container.on('touchend', function (e) { 801 if (e.originalEvent.touches.length < 2) { 802 initialDist = null; 803 } 804 }); 805 806 // Prevent lightbox from closing when accidentally clicking on the zoom image container. 807 zoom_image_container.on('click', function (e) { 808 e.stopPropagation(); 809 }); 810 811 // Add zoom image container to slick lightbox slide. 812 slick_lightbox_slide.append(zoom_image_container) 813 //zoom_image_container.trigger('mousemove'); 814 } 815 } 816 }); 817 }); 818 }); 819 820 // Main product photo navigation slider. 821 once('sliderBehaviorMainProductPhotosSlick', '.slider__main-product-photo-navigation', context).forEach(element => { 822 $(element).slick({ 823 slidesToShow: 7, 824 slidesToScroll: 1, 825 asNavFor: '.slider__main-product-photo', 826 dots: false, 827 centerMode: false, 828 focusOnSelect: true, 829 lazyload: 'ondemand', 830 prevArrow: '<button class="icon icon-slider-arrow icon-slider-prev horizontal"></button>', 831 nextArrow: '<button class="icon icon-slider-arrow icon-slider-next horizontal"></button>', 832 responsive: [ 833 { 834 breakpoint: 1080, 835 settings: { 836 slidesToShow: 5, 837 } 838 }, 839 { 840 breakpoint: 769, 841 settings: { 842 slidesToShow: 3, 843 } 844 } 845 ] 846 }); 847 }); 848 849 // Media slider. 850 once('sliderBehaviorExtrasSlick', '.media-slider', context).forEach(element => { 851 $(element).slick({ 852 className: "media-slider variable-width", 853 lazyload: 'ondemand', 854 autoplay: false, 855 infinite: true, 856 slidesToShow: 3, 857 variableWidth: true, 858 prevArrow: '<span class="icon icon-slider-arrow icon-slider-prev horizontal"></span>', 859 nextArrow: '<span class="icon icon-slider-arrow icon-slider-next horizontal"></span>', 860 responsive: [ 861 { 862 breakpoint: 1080, 863 settings: { 864 slidesToShow: 2, 865 variableWidth: false, 866 } 867 }, 868 { 869 breakpoint: 769, 870 settings: { 871 slidesToShow: 1, 872 variableWidth: false, 873 centerMode: true, 874 } 875 } 876 ] 877 }); 878 }); 879 880 // Extras slider. 881 once('sliderBehaviorExtrasSlick', '.extras-slider-init', context).forEach(element => { 882 $(element).slick({ 883 className: "extras-slider variable-width", 884 autoplay: false, 885 infinite: true, 886 lazyload: 'ondemand', 887 slidesToShow: 2, 888 prevArrow: '<span class="icon icon-slider-arrow icon-slider-prev horizontal"></span>', 889 nextArrow: '<span class="icon icon-slider-arrow icon-slider-next horizontal"></span>', 890 responsive: [{ 891 breakpoint: 769, 892 settings: { 893 slidesToShow: 1, 894 } 895 }] 896 }); 897 }); 898 899 // Field features and paragraph key features slick. 900 once('sliderBehaviorKeyFeaturesSlick', '.paragraph--type--key-feature .field--name-field-media, .product .field--name-field-features', context).forEach(element => { 901 $(element).slick({ 902 autoplay: false, 903 arrows: true, 904 lazyload: 'ondemand', 905 slidesToShow: 1, 906 prevArrow: `<button class="slick-prev" aria-label="${prev_str
906ing}" type="button"><span class="icon icon-slider-arrow icon-slider-prev horizontal"></span></button>`, 907 nextArrow: `<button class="slick-next" aria-label="${next_string}" type="button"><span class="icon icon-slider-arrow icon-slider-next horizontal"></span></button>`, 908 }); 909 }); 910 911 912 // Extract YouTube video ID from various URL formats. 913 function extractYouTubeId(url) { 914 if (!url) return null; 915 let match = url.match(/(?:youtu\.be\/|youtube\.com\/(?:watch\?v=|embed\/|v\/|shorts\/))([a-zA-Z0-9_-]{11})/); 916 return match ? match[1] : null; 917 } 918 919 // Open YouTube video modal (use global if available, fallback to local). 920 function openVideoModal(videoId) { 921 if (Drupal.openVideoModal) { 922 Drupal.openVideoModal(videoId); 923 } 924 } 925 926 // Handle video elements with data-video-id â open in modal. 927 once('sliderBehaviorVideItems', '.product__medias .video-item, .product__extras .video-item, .recommended_slider__wrapper .video-item, .medias-slider__wrapper .video-item', context).forEach(item => { 928 const videoId = item.dataset.videoId; 929 930 let isDragging = false; 931 let startX, startY; 932 const DRAG_THRESHOLD = 5; 933 934 item.addEventListener('mousedown', (e) => { 935 isDragging = false; 936 startX = e.clientX; 937 startY = e.clientY; 938 }); 939 940 item.addEventListener('mousemove', (e) => { 941 if (Math.abs(e.clientX - startX) > DRAG_THRESHOLD || 942 Math.abs(e.clientY - startY) > DRAG_THRESHOLD) { 943 isDragging = true; 944 } 945 }); 946 947 item.addEventListener('click', () => { 948 if (isDragging) { 949 e.stopPropagation(); 950 e.preventDefault(); 951 return; 952 } 953 954 openVideoModal(videoId); 955 }); 956 }); 957 958 // Handle YouTube links (youtu.be, youtube.com) in product sliders â open in modal instead of navigating. 959 once('sliderBehaviorYTLinks', '.product__extras a[href*="youtu.be"], .product__extras a[href*="youtube.com/watch"], .product__medias a[href*="youtu.be"], .product__medias a[href*="youtube.com/watch"], .medias-slider__wrapper a[href*="youtu.be"], .medias-slider__wrapper a[href*="youtube.com/watch"], .recommended_slider__wrapper a[href*="youtu.be"], .recommended_slider__wrapper a[href*="youtube.com/watch"], .field--name-field-features a[href*="youtu.be"], .field--name-field-features a[href*="youtube.com/watch"]', context).forEach(link => { 960 const videoId = extractYouTubeId(link.href); 961 if (videoId) { 962 link.addEventListener('click', (e) => { 963 e.preventDefault(); 964 openVideoModal(videoId); 965 }); 966 } 967 }); 968 969 } 970 }; 971 972})(jQuery, Drupal, drupalSettings, once); 973;
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.