/*! * Glide.js v3.4.1 * (c) 2013-2019 Jędrzej Chałubek (http://jedrzejchalubek.com/) * Released under the MIT License. */ !function(global,factory){"object"==typeof exports&&"undefined"!=typeof module?module.exports=factory():"function"==typeof define&&define.amd?define(factory):global.Glide=factory()}(this,(function(){"use strict";var defaults={type:"slider",startAt:0,perView:1,focusAt:0,gap:10,autoplay:!1,hoverpause:!0,keyboard:!0,bound:!1,swipeThreshold:80,dragThreshold:120,perTouch:!1,touchRatio:.5,touchAngle:45,animationDuration:400,rewind:!0,rewindDuration:800,animationTimingFunc:"cubic-bezier(.165, .840, .440, 1)",throttle:10,direction:"ltr",peek:0,breakpoints:{},classes:{direction:{ltr:"glide--ltr",rtl:"glide--rtl"},slider:"glide--slider",carousel:"glide--carousel",swipeable:"glide--swipeable",dragging:"glide--dragging",cloneSlide:"glide__slide--clone",activeNav:"glide__bullet--active",activeSlide:"glide__slide--active",disabledArrow:"glide__arrow--disabled"}};function warn(msg){console.error("[Glide warn]: "+msg)}var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},classCallCheck=function(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")},createClass=function(){function defineProperties(target,props){for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:{};classCallCheck(this,EventsBus),this.events=events,this.hop=events.hasOwnProperty}return createClass(EventsBus,[{key:"on",value:function(event,handler){if(isArray(event))for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:{};classCallCheck(this,Glide),this._c={},this._t=[],this._e=new EventsBus,this.disabled=!1,this.selector=selector,this.settings=mergeOptions(defaults,options),this.index=this.settings.startAt}return createClass(Glide,[{key:"mount",value:function(){var extensions=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._e.emit("mount.before"),isObject(extensions)?this._c=function(glide,extensions,events){var components={};for(var name in extensions)isFunction(extensions[name])?components[name]=extensions[name](glide,components,events):warn("Extension must be a function");for(var _name in components)isFunction(components[_name].mount)&&components[_name].mount();return components}(this,extensions,this._e):warn("You need to provide a object on `mount()`"),this._e.emit("mount.after"),this}},{key:"mutate",value:function(){var transformers=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return isArray(transformers)?this._t=transformers:warn("You need to provide a array on `mutate()`"),this}},{key:"update",value:function(){var settings=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.settings=mergeOptions(this.settings,settings),settings.hasOwnProperty("startAt")&&(this.index=settings.startAt),this._e.emit("update"),this}},{key:"go",value:function(pattern){return this._c.Run.make(pattern),this}},{key:"move",value:function(distance){return this._c.Transition.disable(),this._c.Move.make(distance),this}},{key:"destroy",value:function(){return this._e.emit("destroy"),this}},{key:"play",value:function(){var interval=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return interval&&(this.settings.autoplay=interval),this._e.emit("play"),this}},{key:"pause",value:function(){return this._e.emit("pause"),this}},{key:"disable",value:function(){return this.disabled=!0,this}},{key:"enable",value:function(){return this.disabled=!1,this}},{key:"on",value:function(event,handler){return this._e.on(event,handler),this}},{key:"isType",value:function(name){return this.settings.type===name}},{key:"settings",get:function(){return this._o},set:function(o){isObject(o)?this._o=o:warn("Options must be an `object` instance.")}},{key:"index",get:function(){return this._i},set:function(i){this._i=toInt(i)}},{key:"type",get:function(){return this.settings.type}},{key:"disabled",get:function(){return this._d},set:function(status){this._d=!!status}}]),Glide}();function now(){return(new Date).getTime()}function throttle(func,wait,options){var timeout=void 0,context=void 0,args=void 0,result=void 0,previous=0;options||(options={});var later=function(){previous=!1===options.leading?0:now(),timeout=null,result=func.apply(context,args),timeout||(context=args=null)},throttled=function(){var at=now();previous||!1!==options.leading||(previous=at);var remaining=wait-(at-previous);return context=this,args=arguments,remaining<=0||remaining>wait?(timeout&&(clearTimeout(timeout),timeout=null),previous=at,result=func.apply(context,args),timeout||(context=args=null)):timeout||!1===options.trailing||(timeout=setTimeout(later,remaining)),result};return throttled.cancel=function(){clearTimeout(timeout),previous=0,timeout=context=args=null},throttled}var MARGIN_TYPE={ltr:["marginLeft","marginRight"],rtl:["marginRight","marginLeft"]};function siblings(node){if(node&&node.parentNode){for(var n=node.parentNode.firstChild,matched=[];n;n=n.nextSibling)1===n.nodeType&&n!==node&&matched.push(n);return matched}return[]}function exist(node){return!!(node&&node instanceof window.HTMLElement)}var EventsBinder=function(){function EventsBinder(){var listeners=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};classCallCheck(this,EventsBinder),this.listeners=listeners}return createClass(EventsBinder,[{key:"on",value:function(events,el,closure){var capture=arguments.length>3&&void 0!==arguments[3]&&arguments[3];isString(events)&&(events=[events]);for(var i=0;i2&&void 0!==arguments[2]&&arguments[2];isString(events)&&(events=[events]);for(var i=0;i":"<","<":">","=":"="};function Rtl(Glide,Components){return{modify:function(translate){return Components.Direction.is("rtl")?-translate:translate}}}function Gap(Glide,Components){return{modify:function(translate){return translate+Components.Gaps.value*Glide.index}}}function Grow(Glide,Components){return{modify:function(translate){return translate+Components.Clones.grow/2}}}function Peeking(Glide,Components){return{modify:function(translate){if(Glide.settings.focusAt>=0){var peek=Components.Peek.value;return isObject(peek)?translate-peek.before:translate-peek}return translate}}}function Focusing(Glide,Components){return{modify:function(translate){var gap=Components.Gaps.value,width=Components.Sizes.width,focusAt=Glide.settings.focusAt,slideWidth=Components.Sizes.slideWidth;return"center"===focusAt?translate-(width/2-slideWidth/2):translate-slideWidth*focusAt-gap*focusAt}}}var supportsPassive=!1;try{var opts=Object.defineProperty({},"passive",{get:function(){supportsPassive=!0}});window.addEventListener("testPassive",null,opts),window.removeEventListener("testPassive",null,opts)}catch(e){}var supportsPassive$1=supportsPassive,START_EVENTS=["touchstart","mousedown"],MOVE_EVENTS=["touchmove","mousemove"],END_EVENTS=["touchend","touchcancel","mouseup","mouseleave"],MOUSE_EVENTS=["mousedown","mousemove","mouseup","mouseleave"];function sortBreakpoints(points){return isObject(points)?(obj=points,Object.keys(obj).sort().reduce((function(r,k){return r[k]=obj[k],r[k],r}),{})):(warn("Breakpoints option must be an object"),{});var obj}var COMPONENTS={Html:function(Glide,Components){var Html={mount:function(){this.root=Glide.selector,this.track=this.root.querySelector('[data-glide-el="track"]'),this.slides=Array.prototype.slice.call(this.wrapper.children).filter((function(slide){return!slide.classList.contains(Glide.settings.classes.cloneSlide)}))}};return define(Html,"root",{get:function(){return Html._r},set:function(r){isString(r)&&(r=document.querySelector(r)),exist(r)?Html._r=r:warn("Root element must be a existing Html node")}}),define(Html,"track",{get:function(){return Html._t},set:function(t){exist(t)?Html._t=t:warn('Could not find track element. Please use [data-glide-el="track"] attribute.')}}),define(Html,"wrapper",{get:function(){return Html.track.children[0]}}),Html},Translate:function(Glide,Components,Events){var Translate={set:function(value){var transform=function(Glide,Components,Events){var TRANSFORMERS=[Gap,Grow,Peeking,Focusing].concat(Glide._t,[Rtl]);return{mutate:function(translate){for(var i=0;i")?(Components.Transition.after((function(){Events.emit("translate.jump"),Translate.set(0)})),Translate.set(width*length+gap*length)):Translate.set(context.movement)})),Events.on("destroy",(function(){Translate.remove()})),Translate},Transition:function(Glide,Components,Events){var disabled=!1,Transition={compose:function(property){var settings=Glide.settings;return disabled?property+" 0ms "+settings.animationTimingFunc:property+" "+this.duration+"ms "+settings.animationTimingFunc},set:function(){var property=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"transform";Components.Html.wrapper.style.transition=this.compose(property)},remove:function(){Components.Html.wrapper.style.transition=""},after:function(callback){setTimeout((function(){callback()}),this.duration)},enable:function(){disabled=!1,this.set()},disable:function(){disabled=!0,this.set()}};return define(Transition,"duration",{get:function(){var settings=Glide.settings;return Glide.isType("slider")&&Components.Run.offset?settings.rewindDuration:settings.animationDuration}}),Events.on("move",(function(){Transition.set()})),Events.on(["build.before","resize","translate.jump"],(function(){Transition.disable()})),Events.on("run",(function(){Transition.enable()})),Events.on("destroy",(function(){Transition.remove()})),Transition},Direction:function(Glide,Components,Events){var Direction={mount:function(){this.value=Glide.settings.direction},resolve:function(pattern){var token=pattern.slice(0,1);return this.is("rtl")?pattern.split(token).join(FLIPED_MOVEMENTS[token]):pattern},is:function(direction){return this.value===direction},addClass:function(){Components.Html.root.classList.add(Glide.settings.classes.direction[this.value])},removeClass:function(){Components.Html.root.classList.remove(Glide.settings.classes.direction[this.value])}};return define(Direction,"value",{get:function(){return Direction._v},set:function(value){VALID_DIRECTIONS.indexOf(value)>-1?Direction._v=value:warn("Direction value must be `ltr` or `rtl`")}}),Events.on(["destroy","update"],(function(){Direction.removeClass()})),Events.on("update",(function(){Direction.mount()})),Events.on(["build.before","update"],(function(){Direction.addClass()})),Direction},Peek:function(Glide,Components,Events){var Peek={mount:function(){this.value=Glide.settings.peek}};return define(Peek,"value",{get:function(){return Peek._v},set:function(value){isObject(value)?(value.before=toInt(value.before),value.after=toInt(value.after)):value=toInt(value),Peek._v=value}}),define(Peek,"reductor",{get:function(){var value=Peek.value,perView=Glide.settings.perView;return isObject(value)?value.before/perView+value.after/perView:2*value/perView}}),Events.on(["resize","update"],(function(){Peek.mount()})),Peek},Sizes:function(Glide,Components,Events){var Sizes={setupSlides:function(){for(var width=this.slideWidth+"px",slides=Components.Html.slides,i=0;i0&&void 0!==arguments[0]?arguments[0]:0;this.offset=offset,Events.emit("move",{movement:this.value}),Components.Transition.after((function(){Events.emit("move.after",{movement:_this.value})}))}};return define(Move,"offset",{get:function(){return Move._o},set:function(value){Move._o=isUndefined(value)?0:toInt(value)}}),define(Move,"translate",{get:function(){return Components.Sizes.slideWidth*Glide.index}}),define(Move,"value",{get:function(){var offset=this.offset,translate=this.translate;return Components.Direction.is("rtl")?translate+offset:translate-offset}}),Events.on(["build.before","run"],(function(){Move.make()})),Move},Clones:function(Glide,Components,Events){var Clones={mount:function(){this.items=[],Glide.isType("carousel")&&(this.items=this.collect())},collect:function(){for(var items=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],slides=Components.Html.slides,_Glide$settings=Glide.settings,perView=_Glide$settings.perView,classes=_Glide$settings.classes,part=perView+ +!!Glide.settings.peek,start=slides.slice(0,part),end=slides.slice(-part),r=0;r"))&&(_this._o=!1,Events.emit("run.offset",_this.move)),Events.emit("run.after",_this.move),Glide.enable()})))},calculate:function(){var move=this.move,length=this.length,steps=move.steps,direction=move.direction,countableSteps="number"==typeof toInt(steps)&&0!==toInt(steps);switch(direction){case">":">"===steps?Glide.index=length:this.isEnd()?Glide.isType("slider")&&!Glide.settings.rewind||(this._o=!0,Glide.index=0):countableSteps?Glide.index+=Math.min(length-Glide.index,-toInt(steps)):Glide.index++;break;case"<":"<"===steps?Glide.index=0:this.isStart()?Glide.isType("slider")&&!Glide.settings.rewind||(this._o=!0,Glide.index=length):countableSteps?Glide.index-=Math.min(Glide.index,toInt(steps)):Glide.index--;break;case"=":Glide.index=steps;break;default:warn("Invalid direction pattern ["+direction+steps+"] has been used")}},isStart:function(){return 0===Glide.index},isEnd:function(){return Glide.index===this.length},isOffset:function(direction){return this._o&&this.move.direction===direction}};return define(Run,"move",{get:function(){return this._m},set:function(value){var step=value.substr(1);this._m={direction:value.substr(0,1),steps:step?toInt(step)?toInt(step):step:0}}}),define(Run,"length",{get:function(){var settings=Glide.settings,length=Components.Html.slides.length;return Glide.isType("slider")&&"center"!==settings.focusAt&&settings.bound?length-1-(toInt(settings.perView)-1)+toInt(settings.focusAt):length-1}}),define(Run,"offset",{get:function(){return this._o}}),Run},Swipe:function(Glide,Components,Events){var Binder=new EventsBinder,swipeSin=0,swipeStartX=0,swipeStartY=0,disabled=!1,capture=!!supportsPassive$1&&{passive:!0},Swipe={mount:function(){this.bindSwipeStart()},start:function(event){if(!disabled&&!Glide.disabled){this.disable();var swipe=this.touches(event);swipeSin=null,swipeStartX=toInt(swipe.pageX),swipeStartY=toInt(swipe.pageY),this.bindSwipeMove(),this.bindSwipeEnd(),Events.emit("swipe.start")}},move:function(event){if(!Glide.disabled){var _Glide$settings=Glide.settings,touchAngle=_Glide$settings.touchAngle,touchRatio=_Glide$settings.touchRatio,classes=_Glide$settings.classes,swipe=this.touches(event),subExSx=toInt(swipe.pageX)-swipeStartX,subEySy=toInt(swipe.pageY)-swipeStartY,powEX=Math.abs(subExSx<<2),powEY=Math.abs(subEySy<<2),swipeHypotenuse=Math.sqrt(powEX+powEY),swipeCathetus=Math.sqrt(powEY);if(!(180*(swipeSin=Math.asin(swipeCathetus/swipeHypotenuse))/Math.PIthreshold&&swipeDeg"+steps))):Components.Move.make(),Components.Html.root.classList.remove(settings.classes.dragging),this.unbindSwipeMove(),this.unbindSwipeEnd(),Events.emit("swipe.end")}},bindSwipeStart:function(){var _this=this,settings=Glide.settings;settings.swipeThreshold&&Binder.on(START_EVENTS[0],Components.Html.wrapper,(function(event){_this.start(event)}),capture),settings.dragThreshold&&Binder.on(START_EVENTS[1],Components.Html.wrapper,(function(event){_this.start(event)}),capture)},unbindSwipeStart:function(){Binder.off(START_EVENTS[0],Components.Html.wrapper,capture),Binder.off(START_EVENTS[1],Components.Html.wrapper,capture)},bindSwipeMove:function(){var _this2=this;Binder.on(MOVE_EVENTS,Components.Html.wrapper,throttle((function(event){_this2.move(event)}),Glide.settings.throttle),capture)},unbindSwipeMove:function(){Binder.off(MOVE_EVENTS,Components.Html.wrapper,capture)},bindSwipeEnd:function(){var _this3=this;Binder.on(END_EVENTS,Components.Html.wrapper,(function(event){_this3.end(event)}))},unbindSwipeEnd:function(){Binder.off(END_EVENTS,Components.Html.wrapper)},touches:function(event){return MOUSE_EVENTS.indexOf(event.type)>-1?event:event.touches[0]||event.changedTouches[0]},threshold:function(event){var settings=Glide.settings;return MOUSE_EVENTS.indexOf(event.type)>-1?settings.dragThreshold:settings.swipeThreshold},enable:function(){return disabled=!1,Components.Transition.enable(),this},disable:function(){return disabled=!0,Components.Transition.disable(),this}};return Events.on("build.after",(function(){Components.Html.root.classList.add(Glide.settings.classes.swipeable)})),Events.on("destroy",(function(){Swipe.unbindSwipeStart(),Swipe.unbindSwipeMove(),Swipe.unbindSwipeEnd(),Binder.destroy()})),Swipe},Images:function(Glide,Components,Events){var Binder=new EventsBinder,Images={mount:function(){this.bind()},bind:function(){Binder.on("dragstart",Components.Html.wrapper,this.dragstart)},unbind:function(){Binder.off("dragstart",Components.Html.wrapper)},dragstart:function(event){event.preventDefault()}};return Events.on("destroy",(function(){Images.unbind(),Binder.destroy()})),Images},Anchors:function(Glide,Components,Events){var Binder=new EventsBinder,detached=!1,prevented=!1,Anchors={mount:function(){this._a=Components.Html.wrapper.querySelectorAll("a"),this.bind()},bind:function(){Binder.on("click",Components.Html.wrapper,this.click)},unbind:function(){Binder.off("click",Components.Html.wrapper)},click:function(event){prevented&&(event.stopPropagation(),event.preventDefault())},detach:function(){if(prevented=!0,!detached){for(var i=0;i")),37===event.keyCode&&Components.Run.make(Components.Direction.resolve("<"))}};return Events.on(["destroy","update"],(function(){Keyboard.unbind()})),Events.on("update",(function(){Keyboard.mount()})),Events.on("destroy",(function(){Binder.destroy()})),Keyboard},Autoplay:function(Glide,Components,Events){var Binder=new EventsBinder,Autoplay={mount:function(){this.start(),Glide.settings.hoverpause&&this.bind()},start:function(){var _this=this;Glide.settings.autoplay&&isUndefined(this._i)&&(this._i=setInterval((function(){_this.stop(),Components.Run.make(">"),_this.start()}),this.time))},stop:function(){this._i=clearInterval(this._i)},bind:function(){var _this2=this;Binder.on("mouseover",Components.Html.root,(function(){_this2.stop()})),Binder.on("mouseout",Components.Html.root,(function(){_this2.start()}))},unbind:function(){Binder.off(["mouseover","mouseout"],Components.Html.root)}};return define(Autoplay,"time",{get:function(){var autoplay=Components.Html.slides[Glide.index].getAttribute("data-glide-autoplay");return toInt(autoplay||Glide.settings.autoplay)}}),Events.on(["destroy","update"],(function(){Autoplay.unbind()})),Events.on(["run.before","pause","destroy","swipe.start","update"],(function(){Autoplay.stop()})),Events.on(["run.after","play","swipe.end"],(function(){Autoplay.start()})),Events.on("update",(function(){Autoplay.mount()})),Events.on("destroy",(function(){Binder.destroy()})),Autoplay},Breakpoints:function(Glide,Components,Events){var Binder=new EventsBinder,settings=Glide.settings,points=sortBreakpoints(settings.breakpoints),defaults=_extends({},settings),Breakpoints={match:function(points){if(void 0!==window.matchMedia)for(var point in points)if(points.hasOwnProperty(point)&&window.matchMedia("(max-width: "+point+"px)").matches)return points[point];return defaults}};return _extends(settings,Breakpoints.match(points)),Binder.on("resize",window,throttle((function(){Glide.settings=mergeOptions(settings,Breakpoints.match(points))}),Glide.settings.throttle)),Events.on("update",(function(){points=sortBreakpoints(points),defaults=_extends({},settings)})),Events.on("destroy",(function(){Binder.off("resize",window)})),Breakpoints}},Glide$1=function(_Core){function Glide$$1(){return classCallCheck(this,Glide$$1),function(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}(this,(Glide$$1.__proto__||Object.getPrototypeOf(Glide$$1)).apply(this,arguments))}return function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}(Glide$$1,_Core),createClass(Glide$$1,[{key:"mount",value:function(){var extensions=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return get(Glide$$1.prototype.__proto__||Object.getPrototypeOf(Glide$$1.prototype),"mount",this).call(this,_extends({},COMPONENTS,extensions))}}]),Glide$$1}(Glide);return Glide$1})); //# sourceURL=https://cdn2.hubspot.net/hub/21660151/hub_generated/template_assets/118055994896/1686203063379/Matter/js/plugins/glide.js