diff --git a/packages/larva-js/build/video-showcase.js b/packages/larva-js/build/video-showcase.js index 106be3821..e60f4d53d 100644 --- a/packages/larva-js/build/video-showcase.js +++ b/packages/larva-js/build/video-showcase.js @@ -1,2 +1,2 @@ /*! For license information please see video-showcase.js.LICENSE.txt */ -(()=>{var t={741:(t,e,i)=>{var s,n;!function(o,r){"use strict";void 0===(n="function"==typeof(s=r)?s.call(e,i,e,t):s)||(t.exports=n)}(window,(function(){"use strict";var t=function(){var t=window.Element.prototype;if(t.matches)return"matches";if(t.matchesSelector)return"matchesSelector";for(var e=["webkit","moz","ms","o"],i=0;i{var s,n;!function(o,r){s=[i(741)],n=function(t){return function(t,e){"use strict";var i={extend:function(t,e){for(var i in e)t[i]=e[i];return t},modulo:function(t,e){return(t%e+e)%e}},s=Array.prototype.slice;i.makeArray=function(t){return Array.isArray(t)?t:null==t?[]:"object"==typeof t&&"number"==typeof t.length?s.call(t):[t]},i.removeFrom=function(t,e){var i=t.indexOf(e);-1!=i&&t.splice(i,1)},i.getParent=function(t,i){for(;t.parentNode&&t!=document.body;)if(t=t.parentNode,e(t,i))return t},i.getQueryElement=function(t){return"string"==typeof t?document.querySelector(t):t},i.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},i.filterFindElements=function(t,s){t=i.makeArray(t);var n=[];return t.forEach((function(t){if(t instanceof HTMLElement)if(s){e(t,s)&&n.push(t);for(var i=t.querySelectorAll(s),o=0;o{var s,n;window,s=[i(217),i(47)],void 0===(n=function(t,e){return function(t,e,i){"use strict";var s=e.prototype;return s.insert=function(t,e){var i=this._makeCells(t);if(i&&i.length){var s=this.cells.length;e=void 0===e?s:e;var n=function(t){var e=document.createDocumentFragment();return t.forEach((function(t){e.appendChild(t.element)})),e}(i),o=e==s;if(o)this.slider.appendChild(n);else{var r=this.cells[e].element;this.slider.insertBefore(n,r)}if(0===e)this.cells=i.concat(this.cells);else if(o)this.cells=this.cells.concat(i);else{var a=this.cells.splice(e,s-e);this.cells=this.cells.concat(i).concat(a)}this._sizeCells(i),this.cellChange(e,!0)}},s.append=function(t){this.insert(t,this.cells.length)},s.prepend=function(t){this.insert(t,0)},s.remove=function(t){var e=this.getCells(t);if(e&&e.length){var s=this.cells.length-1;e.forEach((function(t){t.remove();var e=this.cells.indexOf(t);s=Math.min(e,s),i.removeFrom(this.cells,t)}),this),this.cellChange(s,!0)}},s.cellSizeChange=function(t){var e=this.getCell(t);if(e){e.getSize();var i=this.cells.indexOf(e);this.cellChange(i)}},s.cellChange=function(t,e){var i=this.selectedElement;this._positionCells(t),this._getWrapShiftCells(),this.setGallerySize();var s=this.getCell(i);s&&(this.selectedIndex=this.getCellSlideIndex(s)),this.selectedIndex=Math.min(this.slides.length-1,this.selectedIndex),this.emitEvent("cellChange",[t]),this.select(this.selectedIndex),e&&this.positionSliderAtSelected()},e}(0,t,e)}.apply(e,s))||(t.exports=n)},880:(t,e,i)=>{var s,n;window,s=[i(47)],void 0===(n=function(t){return function(t,e){"use strict";return{startAnimation:function(){this.isAnimating||(this.isAnimating=!0,this.restingFrames=0,this.animate())},animate:function(){this.applyDragForce(),this.applySelectedAttraction();var t=this.x;if(this.integratePhysics(),this.positionSlider(),this.settle(t),this.isAnimating){var e=this;requestAnimationFrame((function(){e.animate()}))}},positionSlider:function(){var t=this.x;this.options.wrapAround&&this.cells.length>1&&(t=e.modulo(t,this.slideableWidth),t-=this.slideableWidth,this.shiftWrapCells(t)),this.setTranslateX(t,this.isAnimating),this.dispatchScrollEvent()},setTranslateX:function(t,e){t+=this.cursorPosition,t=this.options.rightToLeft?-t:t;var i=this.getPositionValue(t);this.slider.style.transform=e?"translate3d("+i+",0,0)":"translateX("+i+")"},dispatchScrollEvent:function(){var t=this.slides[0];if(t){var e=-this.x-t.target,i=e/this.slidesWidth;this.dispatchEvent("scroll",null,[i,e])}},positionSliderAtSelected:function(){this.cells.length&&(this.x=-this.selectedSlide.target,this.velocity=0,this.positionSlider())},getPositionValue:function(t){return this.options.percentPosition?.01*Math.round(t/this.size.innerWidth*1e4)+"%":Math.round(t)+"px"},settle:function(t){!this.isPointerDown&&Math.round(100*this.x)==Math.round(100*t)&&this.restingFrames++,this.restingFrames>2&&(this.isAnimating=!1,delete this.isFreeScrolling,this.positionSlider(),this.dispatchEvent("settle",null,[this.selectedIndex]))},shiftWrapCells:function(t){var e=this.cursorPosition+t;this._shiftCells(this.beforeShiftCells,e,-1);var i=this.size.innerWidth-(t+this.slideableWidth+this.cursorPosition);this._shiftCells(this.afterShiftCells,i,1)},_shiftCells:function(t,e,i){for(var s=0;s0?i:0;n.wrapShift(o),e-=n.size.outerWidth}},_unshiftCells:function(t){if(t&&t.length)for(var e=0;e{var s,n;window,s=[i(131)],void 0===(n=function(t){return function(t,e){"use strict";function i(t,e){this.element=t,this.parent=e,this.create()}var s=i.prototype;return s.create=function(){this.element.style.position="absolute",this.element.setAttribute("aria-hidden","true"),this.x=0,this.shift=0,this.element.style[this.parent.originSide]=0},s.destroy=function(){this.unselect(),this.element.style.position="";var t=this.parent.originSide;this.element.style[t]="",this.element.style.transform="",this.element.removeAttribute("aria-hidden")},s.getSize=function(){this.size=e(this.element)},s.setPosition=function(t){this.x=t,this.updateTarget(),this.renderPosition(t)},s.updateTarget=s.setDefaultTarget=function(){var t="left"==this.parent.originSide?"marginLeft":"marginRight";this.target=this.x+this.size[t]+this.size.width*this.parent.cellAlign},s.renderPosition=function(t){var e="left"===this.parent.originSide?1:-1,i=this.parent.options.percentPosition?t*e*(this.parent.size.innerWidth/this.size.width):t*e;this.element.style.transform="translateX("+this.parent.getPositionValue(i)+")"},s.select=function(){this.element.classList.add("is-selected"),this.element.removeAttribute("aria-hidden")},s.unselect=function(){this.element.classList.remove("is-selected"),this.element.setAttribute("aria-hidden","true")},s.wrapShift=function(t){this.shift=t,this.renderPosition(this.x+this.parent.slideableWidth*t)},s.remove=function(){this.element.parentNode.removeChild(this.element)},i}(0,t)}.apply(e,s))||(t.exports=n)},690:(t,e,i)=>{var s,n;!function(o,r){s=[i(217),i(842),i(47)],n=function(t,e,i){return function(t,e,i,s){"use strict";s.extend(e.defaults,{draggable:">1",dragThreshold:3}),e.createMethods.push("_createDrag");var n=e.prototype;s.extend(n,i.prototype),n._touchActionValue="pan-y",n._createDrag=function(){this.on("activate",this.onActivateDrag),this.on("uiChange",this._uiChangeDrag),this.on("deactivate",this.onDeactivateDrag),this.on("cellChange",this.updateDraggable)},n.onActivateDrag=function(){this.handles=[this.viewport],this.bindHandles(),this.updateDraggable()},n.onDeactivateDrag=function(){this.unbindHandles(),this.element.classList.remove("is-draggable")},n.updateDraggable=function(){">1"==this.options.draggable?this.isDraggable=this.slides.length>1:this.isDraggable=this.options.draggable,this.isDraggable?this.element.classList.add("is-draggable"):this.element.classList.remove("is-draggable")},n.bindDrag=function(){this.options.draggable=!0,this.updateDraggable()},n.unbindDrag=function(){this.options.draggable=!1,this.updateDraggable()},n._uiChangeDrag=function(){delete this.isFreeScrolling},n.pointerDown=function(e,i){this.isDraggable?this.okayPointerDown(e)&&(this._pointerDownPreventDefault(e),this.pointerDownFocus(e),document.activeElement!=this.element&&this.pointerDownBlur(),this.dragX=this.x,this.viewport.classList.add("is-pointer-down"),this.pointerDownScroll=r(),t.addEventListener("scroll",this),this._pointerDownDefault(e,i)):this._pointerDownDefault(e,i)},n._pointerDownDefault=function(t,e){this.pointerDownPointer={pageX:e.pageX,pageY:e.pageY},this._bindPostStartEvents(t),this.dispatchEvent("pointerDown",t,[e])};var o={INPUT:!0,TEXTAREA:!0,SELECT:!0};function r(){return{x:t.pageXOffset,y:t.pageYOffset}}return n.pointerDownFocus=function(t){o[t.target.nodeName]||this.focus()},n._pointerDownPreventDefault=function(t){var e="touchstart"==t.type,i="touch"==t.pointerType,s=o[t.target.nodeName];e||i||s||t.preventDefault()},n.hasDragStarted=function(t){return Math.abs(t.x)>this.options.dragThreshold},n.pointerUp=function(t,e){delete this.isTouchScrolling,this.viewport.classList.remove("is-pointer-down"),this.dispatchEvent("pointerUp",t,[e]),this._dragPointerUp(t,e)},n.pointerDone=function(){t.removeEventListener("scroll",this),delete this.pointerDownScroll},n.dragStart=function(e,i){this.isDraggable&&(this.dragStartPosition=this.x,this.startAnimation(),t.removeEventListener("scroll",this),this.dispatchEvent("dragStart",e,[i]))},n.pointerMove=function(t,e){var i=this._dragPointerMove(t,e);this.dispatchEvent("pointerMove",t,[e,i]),this._dragMove(t,e,i)},n.dragMove=function(t,e,i){if(this.isDraggable){t.preventDefault(),this.previousDragX=this.dragX;var s=this.options.rightToLeft?-1:1;this.options.wrapAround&&(i.x%=this.slideableWidth);var n=this.dragStartPosition+i.x*s;if(!this.options.wrapAround&&this.slides.length){var o=Math.max(-this.slides[0].target,this.dragStartPosition);n=n>o?.5*(n+o):n;var r=Math.min(-this.getLastSlide().target,this.dragStartPosition);n=nthis.slides[0].target&&-s1,o=n?s.modulo(e,i):e,r=this.slides[o];if(!r)return null;var a=n?this.slideableWidth*Math.floor(e/i):0;return t-(r.target+a)},n.dragEndBoostSelect=function(){if(void 0===this.previousDragX||!this.dragMoveTime||new Date-this.dragMoveTime>100)return 0;var t=this.getSlideDistance(-this.dragX,this.selectedIndex),e=this.previousDragX-this.dragX;return t>0&&e>0?1:t<0&&e<0?-1:0},n.staticClick=function(t,e){var i=this.getParentCell(t.target),s=i&&i.element,n=i&&this.cells.indexOf(i);this.dispatchEvent("staticClick",t,[e,s,n])},n.onscroll=function(){var t=r(),e=this.pointerDownScroll.x-t.x,i=this.pointerDownScroll.y-t.y;(Math.abs(e)>3||Math.abs(i)>3)&&this._pointerDone()},e}(o,t,e,i)}.apply(e,s),void 0===n||(t.exports=n)}(window)},217:(t,e,i)=>{var s,n;!function(o,r){s=[i(158),i(131),i(47),i(229),i(714),i(880)],n=function(t,e,i,s,n,r){return function(t,e,i,s,n,o,r){"use strict";var a=t.jQuery,l=t.getComputedStyle,h=t.console;function c(t,e){for(t=s.makeArray(t);t.length;)e.appendChild(t.shift())}var d=0,u={};function p(t,e){var i=s.getQueryElement(t);if(i){if(this.element=i,this.element.flickityGUID){var n=u[this.element.flickityGUID];return n&&n.option(e),n}a&&(this.$element=a(this.element)),this.options=s.extend({},this.constructor.defaults),this.option(e),this._create()}else h&&h.error("Bad element for Flickity: "+(i||t))}p.defaults={accessibility:!0,cellAlign:"center",freeScrollFriction:.075,friction:.28,namespaceJQueryEvents:!0,percentPosition:!0,resize:!0,selectedAttraction:.025,setGallerySize:!0},p.createMethods=[];var f=p.prototype;s.extend(f,e.prototype),f._create=function(){var e=this.guid=++d;for(var i in this.element.flickityGUID=e,u[e]=this,this.selectedIndex=0,this.restingFrames=0,this.x=0,this.velocity=0,this.originSide=this.options.rightToLeft?"right":"left",this.viewport=document.createElement("div"),this.viewport.className="flickity-viewport",this._createSlider(),(this.options.resize||this.options.watchCSS)&&t.addEventListener("resize",this),this.options.on){var s=this.options.on[i];this.on(i,s)}p.createMethods.forEach((function(t){this[t]()}),this),this.options.watchCSS?this.watchCSS():this.activate()},f.option=function(t){s.extend(this.options,t)},f.activate=function(){this.isActive||(this.isActive=!0,this.element.classList.add("flickity-enabled"),this.options.rightToLeft&&this.element.classList.add("flickity-rtl"),this.getSize(),c(this._filterFindCellElements(this.element.children),this.slider),this.viewport.appendChild(this.slider),this.element.appendChild(this.viewport),this.reloadCells(),this.options.accessibility&&(this.element.tabIndex=0,this.element.addEventListener("keydown",this)),this.emitEvent("activate"),this.selectInitialIndex(),this.isInitActivated=!0,this.dispatchEvent("ready"))},f._createSlider=function(){var t=document.createElement("div");t.className="flickity-slider",t.style[this.originSide]=0,this.slider=t},f._filterFindCellElements=function(t){return s.filterFindElements(t,this.options.cellSelector)},f.reloadCells=function(){this.cells=this._makeCells(this.slider.children),this.positionCells(),this._getWrapShiftCells(),this.setGallerySize()},f._makeCells=function(t){return this._filterFindCellElements(t).map((function(t){return new n(t,this)}),this)},f.getLastCell=function(){return this.cells[this.cells.length-1]},f.getLastSlide=function(){return this.slides[this.slides.length-1]},f.positionCells=function(){this._sizeCells(this.cells),this._positionCells(0)},f._positionCells=function(t){t=t||0,this.maxCellHeight=t&&this.maxCellHeight||0;var e=0;if(t>0){var i=this.cells[t-1];e=i.x+i.size.outerWidth}for(var s=this.cells.length,n=t;n0;){var n=this.cells[e];if(!n)break;s.push(n),e+=i,t-=n.size.outerWidth}return s},f._containSlides=function(){if(this.options.contain&&!this.options.wrapAround&&this.cells.length){var t=this.options.rightToLeft,e=t?"marginRight":"marginLeft",i=t?"marginLeft":"marginRight",s=this.slideableWidth-this.getLastCell().size[i],n=s1))return t;var i=s.modulo(t,e),n=Math.abs(i-this.selectedIndex),o=Math.abs(i+e-this.selectedIndex),r=Math.abs(i-e-this.selectedIndex);!this.isDragSelect&&o=e&&(this.x+=this.slideableWidth)},f.previous=function(t,e){this.select(this.selectedIndex-1,t,e)},f.next=function(t,e){this.select(this.selectedIndex+1,t,e)},f.updateSelectedSlide=function(){var t=this.slides[this.selectedIndex];t&&(this.unselectSelectedSlide(),this.selectedSlide=t,t.select(),this.selectedCells=t.cells,this.selectedElements=t.getCellElements(),this.selectedCell=t.cells[0],this.selectedElement=this.selectedElements[0])},f.unselectSelectedSlide=function(){this.selectedSlide&&this.selectedSlide.unselect()},f.selectInitialIndex=function(){var t=this.options.initialIndex;if(this.isInitActivated)this.select(this.selectedIndex,!1,!0);else{if(t&&"string"==typeof t&&this.queryCell(t))return void this.selectCell(t,!1,!0);var e=0;t&&this.slides[t]&&(e=t),this.select(e,!1,!0)}},f.selectCell=function(t,e,i){var s=this.queryCell(t);if(s){var n=this.getCellSlideIndex(s);this.select(n,e,i)}},f.getCellSlideIndex=function(t){for(var e=0;e *"),this.getCell(t))},f.getAdjacentCellElements=function(t,e){if(!t)return this.selectedSlide.getCellElements();e=void 0===e?this.selectedIndex:e;var i=this.slides.length;if(1+2*t>=i)return this.getCellElements();for(var n=[],o=e-t;o<=e+t;o++){var r=this.options.wrapAround?s.modulo(o,i):o,a=this.slides[r];a&&(n=n.concat(a.getCellElements()))}return n},f.queryCell=function(t){if("number"==typeof t)return this.cells[t];if("string"==typeof t){if(t.match(/^[#.]?[\d/]/))return;t=this.element.querySelector(t)}return this.getCell(t)},f.uiChange=function(){this.emitEvent("uiChange")},f.childUIPointerDown=function(t){"touchstart"!=t.type&&t.preventDefault(),this.focus()},f.onresize=function(){this.watchCSS(),this.resize()},s.debounceMethod(p,"onresize",150),f.resize=function(){if(this.isActive&&!this.isAnimating&&!this.isDragging){this.getSize(),this.options.wrapAround&&(this.x=s.modulo(this.x,this.slideableWidth)),this.positionCells(),this._getWrapShiftCells(),this.setGallerySize(),this.emitEvent("resize");var t=this.selectedElements&&this.selectedElements[0];this.selectCell(t,!1,!0)}},f.watchCSS=function(){this.options.watchCSS&&(-1!=l(this.element,":after").content.indexOf("flickity")?this.activate():this.deactivate())},f.onkeydown=function(t){var e=document.activeElement&&document.activeElement!=this.element;if(this.options.accessibility&&!e){var i=p.keyboardHandlers[t.keyCode];i&&i.call(this)}},p.keyboardHandlers={37:function(){var t=this.options.rightToLeft?"next":"previous";this.uiChange(),this[t]()},39:function(){var t=this.options.rightToLeft?"previous":"next";this.uiChange(),this[t]()}},f.focus=function(){var e=t.pageYOffset;this.element.focus({preventScroll:!0}),t.pageYOffset!=e&&t.scrollTo(t.pageXOffset,e)},f.deactivate=function(){this.isActive&&(this.element.classList.remove("flickity-enabled"),this.element.classList.remove("flickity-rtl"),this.unselectSelectedSlide(),this.cells.forEach((function(t){t.destroy()})),this.element.removeChild(this.viewport),c(this.slider.children,this.element),this.options.accessibility&&(this.element.removeAttribute("tabIndex"),this.element.removeEventListener("keydown",this)),this.isActive=!1,this.emitEvent("deactivate"))},f.destroy=function(){this.deactivate(),t.removeEventListener("resize",this),this.allOff(),this.emitEvent("destroy"),a&&this.$element&&a.removeData(this.element,"flickity"),delete this.element.flickityGUID,delete u[this.guid]},s.extend(f,r),p.data=function(t){var e=(t=s.getQueryElement(t))&&t.flickityGUID;return e&&u[e]},s.htmlInit(p,"flickity"),a&&a.bridget&&a.bridget("flickity",p),p.setJQuery=function(t){a=t},p.Cell=n,p.Slide=o,p}(o,t,e,i,s,n,r)}.apply(e,s),void 0===n||(t.exports=n)}(window)},442:(t,e,i)=>{var s,n,o;window,n=[i(217),i(690),i(410),i(573),i(516),i(597),i(227)],void 0===(o="function"==typeof(s=function(t){return t})?s.apply(e,n):s)||(t.exports=o)},227:(t,e,i)=>{var s,n;window,s=[i(217),i(47)],void 0===(n=function(t,e){return function(t,e,i){"use strict";e.createMethods.push("_createLazyload");var s=e.prototype;function n(t,e){this.img=t,this.flickity=e,this.load()}return s._createLazyload=function(){this.on("select",this.lazyLoad)},s.lazyLoad=function(){var t=this.options.lazyLoad;if(t){var e="number"==typeof t?t:0,s=this.getAdjacentCellElements(e),o=[];s.forEach((function(t){var e=function(t){if("IMG"==t.nodeName){var e=t.getAttribute("data-flickity-lazyload"),s=t.getAttribute("data-flickity-lazyload-src"),n=t.getAttribute("data-flickity-lazyload-srcset");if(e||s||n)return[t]}var o=t.querySelectorAll("img[data-flickity-lazyload], img[data-flickity-lazyload-src], img[data-flickity-lazyload-srcset]");return i.makeArray(o)}(t);o=o.concat(e)})),o.forEach((function(t){new n(t,this)}),this)}},n.prototype.handleEvent=i.handleEvent,n.prototype.load=function(){this.img.addEventListener("load",this),this.img.addEventListener("error",this);var t=this.img.getAttribute("data-flickity-lazyload")||this.img.getAttribute("data-flickity-lazyload-src"),e=this.img.getAttribute("data-flickity-lazyload-srcset");this.img.src=t,e&&this.img.setAttribute("srcset",e),this.img.removeAttribute("data-flickity-lazyload"),this.img.removeAttribute("data-flickity-lazyload-src"),this.img.removeAttribute("data-flickity-lazyload-srcset")},n.prototype.onload=function(t){this.complete(t,"flickity-lazyloaded")},n.prototype.onerror=function(t){this.complete(t,"flickity-lazyerror")},n.prototype.complete=function(t,e){this.img.removeEventListener("load",this),this.img.removeEventListener("error",this);var i=this.flickity.getParentCell(this.img),s=i&&i.element;this.flickity.cellSizeChange(s),this.img.classList.add(e),this.flickity.dispatchEvent("lazyLoad",t,s)},e.LazyLoader=n,e}(0,t,e)}.apply(e,s))||(t.exports=n)},573:(t,e,i)=>{var s,n;window,s=[i(217),i(704),i(47)],void 0===(n=function(t,e,i){return function(t,e,i,s){"use strict";function n(t){this.parent=t,this._create()}n.prototype=Object.create(i.prototype),n.prototype._create=function(){this.holder=document.createElement("ol"),this.holder.className="flickity-page-dots",this.dots=[],this.handleClick=this.onClick.bind(this),this.on("pointerDown",this.parent.childUIPointerDown.bind(this.parent))},n.prototype.activate=function(){this.setDots(),this.holder.addEventListener("click",this.handleClick),this.bindStartEvent(this.holder),this.parent.element.appendChild(this.holder)},n.prototype.deactivate=function(){this.holder.removeEventListener("click",this.handleClick),this.unbindStartEvent(this.holder),this.parent.element.removeChild(this.holder)},n.prototype.setDots=function(){var t=this.parent.slides.length-this.dots.length;t>0?this.addDots(t):t<0&&this.removeDots(-t)},n.prototype.addDots=function(t){for(var e=document.createDocumentFragment(),i=[],s=this.dots.length,n=s+t,o=s;o{var s,n;window,s=[i(158),i(47),i(217)],void 0===(n=function(t,e,i){return function(t,e,i){"use strict";function s(t){this.parent=t,this.state="stopped",this.onVisibilityChange=this.visibilityChange.bind(this),this.onVisibilityPlay=this.visibilityPlay.bind(this)}s.prototype=Object.create(t.prototype),s.prototype.play=function(){"playing"!=this.state&&(document.hidden?document.addEventListener("visibilitychange",this.onVisibilityPlay):(this.state="playing",document.addEventListener("visibilitychange",this.onVisibilityChange),this.tick()))},s.prototype.tick=function(){if("playing"==this.state){var t=this.parent.options.autoPlay;t="number"==typeof t?t:3e3;var e=this;this.clear(),this.timeout=setTimeout((function(){e.parent.next(!0),e.tick()}),t)}},s.prototype.stop=function(){this.state="stopped",this.clear(),document.removeEventListener("visibilitychange",this.onVisibilityChange)},s.prototype.clear=function(){clearTimeout(this.timeout)},s.prototype.pause=function(){"playing"==this.state&&(this.state="paused",this.clear())},s.prototype.unpause=function(){"paused"==this.state&&this.play()},s.prototype.visibilityChange=function(){this[document.hidden?"pause":"unpause"]()},s.prototype.visibilityPlay=function(){this.play(),document.removeEventListener("visibilitychange",this.onVisibilityPlay)},e.extend(i.defaults,{pauseAutoPlayOnHover:!0}),i.createMethods.push("_createPlayer");var n=i.prototype;return n._createPlayer=function(){this.player=new s(this),this.on("activate",this.activatePlayer),this.on("uiChange",this.stopPlayer),this.on("pointerDown",this.stopPlayer),this.on("deactivate",this.deactivatePlayer)},n.activatePlayer=function(){this.options.autoPlay&&(this.player.play(),this.element.addEventListener("mouseenter",this))},n.playPlayer=function(){this.player.play()},n.stopPlayer=function(){this.player.stop()},n.pausePlayer=function(){this.player.pause()},n.unpausePlayer=function(){this.player.unpause()},n.deactivatePlayer=function(){this.player.stop(),this.element.removeEventListener("mouseenter",this)},n.onmouseenter=function(){this.options.pauseAutoPlayOnHover&&(this.player.pause(),this.element.addEventListener("mouseleave",this))},n.onmouseleave=function(){this.player.unpause(),this.element.removeEventListener("mouseleave",this)},i.Player=s,i}(t,e,i)}.apply(e,s))||(t.exports=n)},410:(t,e,i)=>{var s,n;window,s=[i(217),i(704),i(47)],void 0===(n=function(t,e,i){return function(t,e,i,s){"use strict";var n="http://www.w3.org/2000/svg";function o(t,e){this.direction=t,this.parent=e,this._create()}o.prototype=Object.create(i.prototype),o.prototype._create=function(){this.isEnabled=!0,this.isPrevious=-1==this.direction;var t=this.parent.options.rightToLeft?1:-1;this.isLeft=this.direction==t;var e=this.element=document.createElement("button");e.className="flickity-button flickity-prev-next-button",e.className+=this.isPrevious?" previous":" next",e.setAttribute("type","button"),this.disable(),e.setAttribute("aria-label",this.isPrevious?"Previous":"Next");var i=this.createSVG();e.appendChild(i),this.parent.on("select",this.update.bind(this)),this.on("pointerDown",this.parent.childUIPointerDown.bind(this.parent))},o.prototype.activate=function(){this.bindStartEvent(this.element),this.element.addEventListener("click",this),this.parent.element.appendChild(this.element)},o.prototype.deactivate=function(){this.parent.element.removeChild(this.element),this.unbindStartEvent(this.element),this.element.removeEventListener("click",this)},o.prototype.createSVG=function(){var t=document.createElementNS(n,"svg");t.setAttribute("class","flickity-button-icon"),t.setAttribute("viewBox","0 0 100 100");var e,i=document.createElementNS(n,"path"),s="string"==typeof(e=this.parent.options.arrowShape)?e:"M "+e.x0+",50 L "+e.x1+","+(e.y1+50)+" L "+e.x2+","+(e.y2+50)+" L "+e.x3+",50 L "+e.x2+","+(50-e.y2)+" L "+e.x1+","+(50-e.y1)+" Z";return i.setAttribute("d",s),i.setAttribute("class","arrow"),this.isLeft||i.setAttribute("transform","translate(100, 100) rotate(180) "),t.appendChild(i),t},o.prototype.handleEvent=s.handleEvent,o.prototype.onclick=function(){if(this.isEnabled){this.parent.uiChange();var t=this.isPrevious?"previous":"next";this.parent[t]()}},o.prototype.enable=function(){this.isEnabled||(this.element.disabled=!1,this.isEnabled=!0)},o.prototype.disable=function(){this.isEnabled&&(this.element.disabled=!0,this.isEnabled=!1)},o.prototype.update=function(){var t=this.parent.slides;if(this.parent.options.wrapAround&&t.length>1)this.enable();else{var e=t.length?t.length-1:0,i=this.isPrevious?0:e;this[this.parent.selectedIndex==i?"disable":"enable"]()}},o.prototype.destroy=function(){this.deactivate(),this.allOff()},s.extend(e.defaults,{prevNextButtons:!0,arrowShape:{x0:10,x1:60,y1:50,x2:70,y2:40,x3:30}}),e.createMethods.push("_createPrevNextButtons");var r=e.prototype;return r._createPrevNextButtons=function(){this.options.prevNextButtons&&(this.prevButton=new o(-1,this),this.nextButton=new o(1,this),this.on("activate",this.activatePrevNextButtons))},r.activatePrevNextButtons=function(){this.prevButton.activate(),this.nextButton.activate(),this.on("deactivate",this.deactivatePrevNextButtons)},r.deactivatePrevNextButtons=function(){this.prevButton.deactivate(),this.nextButton.deactivate(),this.off("deactivate",this.deactivatePrevNextButtons)},e.PrevNextButton=o,e}(0,t,e,i)}.apply(e,s))||(t.exports=n)},714:(t,e,i)=>{var s,n;window,void 0===(n="function"==typeof(s=function(){"use strict";function t(t){this.parent=t,this.isOriginLeft="left"==t.originSide,this.cells=[],this.outerWidth=0,this.height=0}var e=t.prototype;return e.addCell=function(t){if(this.cells.push(t),this.outerWidth+=t.size.outerWidth,this.height=Math.max(t.size.outerHeight,this.height),1==this.cells.length){this.x=t.x;var e=this.isOriginLeft?"marginLeft":"marginRight";this.firstMargin=t.size[e]}},e.updateTarget=function(){var t=this.isOriginLeft?"marginRight":"marginLeft",e=this.getLastCell(),i=e?e.size[t]:0,s=this.outerWidth-(this.firstMargin+i);this.target=this.x+this.firstMargin+s*this.parent.cellAlign},e.getLastCell=function(){return this.cells[this.cells.length-1]},e.select=function(){this.cells.forEach((function(t){t.select()}))},e.unselect=function(){this.cells.forEach((function(t){t.unselect()}))},e.getCellElements=function(){return this.cells.map((function(t){return t.element}))},t})?s.call(e,i,e,t):s)||(t.exports=n)},131:(t,e,i)=>{var s,n;window,void 0===(n="function"==typeof(s=function(){"use strict";function t(t){var e=parseFloat(t);return-1==t.indexOf("%")&&!isNaN(e)&&e}var e="undefined"==typeof console?function(){}:function(t){console.error(t)},i=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],s=i.length;function n(t){var i=getComputedStyle(t);return i||e("Style returned "+i+". Are you running this code in a hidden iframe on Firefox? See https://bit.ly/getsizebug1"),i}var o,r=!1;function a(e){if(function(){if(!r){r=!0;var e=document.createElement("div");e.style.width="200px",e.style.padding="1px 2px 3px 4px",e.style.borderStyle="solid",e.style.borderWidth="1px 2px 3px 4px",e.style.boxSizing="border-box";var i=document.body||document.documentElement;i.appendChild(e);var s=n(e);o=200==Math.round(t(s.width)),a.isBoxSizeOuter=o,i.removeChild(e)}}(),"string"==typeof e&&(e=document.querySelector(e)),e&&"object"==typeof e&&e.nodeType){var l=n(e);if("none"==l.display)return function(){for(var t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},e=0;e{var s,n;!function(o,r){s=[i(704)],n=function(t){return function(t,e){"use strict";function i(){}var s=i.prototype=Object.create(e.prototype);s.bindHandles=function(){this._bindHandles(!0)},s.unbindHandles=function(){this._bindHandles(!1)},s._bindHandles=function(e){for(var i=(e=void 0===e||e)?"addEventListener":"removeEventListener",s=e?this._touchActionValue:"",n=0;n3||Math.abs(t.y)>3},s.pointerUp=function(t,e){this.emitEvent("pointerUp",[t,e]),this._dragPointerUp(t,e)},s._dragPointerUp=function(t,e){this.isDragging?this._dragEnd(t,e):this._staticClick(t,e)},s._dragStart=function(t,e){this.isDragging=!0,this.isPreventingClicks=!0,this.dragStart(t,e)},s.dragStart=function(t,e){this.emitEvent("dragStart",[t,e])},s._dragMove=function(t,e,i){this.isDragging&&this.dragMove(t,e,i)},s.dragMove=function(t,e,i){t.preventDefault(),this.emitEvent("dragMove",[t,e,i])},s._dragEnd=function(t,e){this.isDragging=!1,setTimeout(function(){delete this.isPreventingClicks}.bind(this)),this.dragEnd(t,e)},s.dragEnd=function(t,e){this.emitEvent("dragEnd",[t,e])},s.onclick=function(t){this.isPreventingClicks&&t.preventDefault()},s._staticClick=function(t,e){this.isIgnoringMouseUp&&"mouseup"==t.type||(this.staticClick(t,e),"mouseup"!=t.type&&(this.isIgnoringMouseUp=!0,setTimeout(function(){delete this.isIgnoringMouseUp}.bind(this),400)))},s.staticClick=function(t,e){this.emitEvent("staticClick",[t,e])},i.getPointerPoint=e.getPointerPoint,i}(o,t)}.apply(e,s),void 0===n||(t.exports=n)}(window)},704:(t,e,i)=>{var s,n;!function(o,r){s=[i(158)],n=function(t){return function(t,e){"use strict";function i(){}var s=i.prototype=Object.create(e.prototype);s.bindStartEvent=function(t){this._bindStartEvent(t,!0)},s.unbindStartEvent=function(t){this._bindStartEvent(t,!1)},s._bindStartEvent=function(e,i){var s=(i=void 0===i||i)?"addEventListener":"removeEventListener",n="mousedown";"ontouchstart"in t?n="touchstart":t.PointerEvent&&(n="pointerdown"),e[s](n,this)},s.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},s.getTouch=function(t){for(var e=0;e{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var s in e)i.o(e,s)&&!i.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";class t{constructor(t){this.el=t,this.toggleEl=this.el.querySelector("[data-collapsible-toggle]"),this.panels=[...this.el.querySelectorAll("[data-collapsible-panel]")],this.group=this.findGroup(),this.toggle=this.toggle.bind(this),this.onClick=this.onClick.bind(this),this.toggleEl&&this.toggleEl.addEventListener("click",this.onClick)}destroy(){this.toggleEl&&this.toggleEl.removeEventListener("click",this.onClick),this.isCollapsed||this.toggle()}get state(){return this.el.dataset.collapsible}set state(t){this.el.dataset.collapsible=t,this.isCollapsed?this.el.classList.remove("is-expanded"):this.el.classList.add("is-expanded")}get isCollapsed(){return"collapsed"===this.state}get container(){return document.querySelector(this.el.dataset.collapsibleContainer)}get closeOnClick(){return void 0!==this.el.dataset.collapsibleCloseOnClick}findGroup(){return[...document.body.querySelectorAll("[data-collapsible-group]")].find((t=>t.contains(this.el)))||null}onClick(t){t.preventDefault(),this.toggle()}toggle(){this.state=this.isCollapsed?"expanded":"collapsed",this.maybeRepositionPanel(),this.maybeCloseOnClick(),"expanded"===this.state&&(document.querySelector("[data-collapsible-toggle] + li > a").focus(),null!==this.group&&this.closeOthersInGroup())}collapse(){"expanded"===this.state&&this.toggle()}closeOthersInGroup(){[...this.group.querySelectorAll("[data-collapsible]")].forEach((t=>{t!==this.el&&t.pmcCollapsible.collapse()}))}maybeRepositionPanel(){if(this.container)if(this.isCollapsed)this.panels.forEach((t=>t.style.marginLeft=""));else{const t=this.container.getBoundingClientRect().left;this.panels.forEach((e=>{const i=e.getBoundingClientRect();if(0===i.width&&0===i.height)return;const s=parseInt(window.getComputedStyle(e).marginLeft,10),n=i.left-2*s;ndocument.body.addEventListener("click",this.toggle)),1))}}function e(){[...document.querySelectorAll("[data-collapsible]")].forEach((e=>e.pmcCollapsible=new t(e)))}var s=i(442),n=i.n(s);class o{constructor(t){var e,i,s;this.el=t,this.triggers=[...t.querySelectorAll("[data-video-showcase-trigger]")],this.player=t.querySelector("[data-video-showcase-player]"),this.elementsToHide=[...this.el.querySelectorAll(".is-to-be-hidden")],this.attributesToRemoveFromPlayer=["data-video-showcase-trigger","data-video-showcase-title","data-video-showcase-dek","data-video-showcase-permalink","data-video-showcase-type","href"],this.state={isPlayerSetup:!1,hasSocialShare:!1,playerID:"",videoID:"",videoType:""},this.playerUI={title:t.querySelector(".js-VideoShowcase-title"),sponsoredBadge:t.querySelector(".js-video-showcase-sponsored-badge"),dek:t.querySelector(".js-VideoShowcase-dek"),iframe:t.querySelector("[data-video-showcase-iframe]"),jwplayerContainer:t.querySelector("[data-video-showcase-jwplayer], #jwplayerContainer"),social:t.querySelector("[data-video-showcase-player-social-share]"),connatixContainer:t.querySelector("[data-video-showcase-connatix]"),player:t.querySelector("[data-video-player-id]")},this.init(),this.player.dataset.videoShowcaseAutoplay?this.handleTriggerClick(null,this.triggers[0]):(e=this.el,"click",i="[data-video-showcase-trigger]",s=this.handleTriggerClick.bind(this),e.addEventListener("click",(t=>{const e=((t,e)=>e.matches&&e.matches(t))(i,t.target)?t.target:t.target.closest(i);e&&s(t,e)})))}init(){null!==this.playerUI.social&&(this.state.hasSocialShare=!0)}getPlayerCardData(t,e){let i="";i="connatix"===t?e.dataset.videoMediaId:e.dataset.videoShowcaseTrigger;const s=this.state.hasSocialShare;return{title:e.dataset.videoShowcaseTitle,sponsored:e.dataset.videoShowcaseSponsored,dek:e.dataset.videoShowcaseDek,permalink:e.dataset.videoShowcasePermalink,socialString:function(t){if(window.wp&&s)return wp.template(`trigger-social-share-${i}`)(void 0)}()}}updatePlayerCardData(t,e){this.playerUI.title&&e.title&&(this.playerUI.title.innerText=e.title),this.playerUI.title&&e.permalink&&this.playerUI.title.setAttribute("href",e.permalink),e.dek&&(this.playerUI.dek.innerText=e.dek),e.socialString&&this.state.hasSocialShare&&this.updateCardSocialShare(e.socialString),null!==this.playerUI.sponsoredBadge&&(e.sponsored?this.playerUI.sponsoredBadge.classList.remove("u-hidden"):this.playerUI.sponsoredBadge.classList.add("u-hidden"))}updateCardSocialShare(t){this.playerUI.social.removeChild(this.playerUI.social.querySelector("ul")),this.playerUI.social.insertAdjacentHTML("beforeend",t),e()}returnUrl(t,e){return"youtube"===e?`https://www.youtube.com/embed/${t}`:"jwplayer"===e?`https://content.jwplatform.com/feeds/${t}.json`:"twitch"===e?`https://player.twitch.tv/?video=${t}`:"connatix"===e?t:void 0}playYoutube(t){this.playerUI.iframe.removeAttribute("hidden"),this.playerUI.iframe.setAttribute("src",`${t}?rel=0&autoplay=1&showinfo=0&controls=2&rel=0&modestbranding=0`)}playConnatix(t,e){this.playerUI.connatixContainer.removeAttribute("hidden");const i=this.playerUI.connatixContainer.getAttribute("id");(new Image).src="https://capi.elements.video/tr/si?token=094029a3-814c-41d5-8a62-2c3adc647176&cid=1ffe63de-eb53-11e9-b4d2-06948452ae1a",pmcCnx.cmd.push((function(){pmcCnx({playerId:e,mediaId:t}).render(i).play()}))}playTwitch(t){this.playerUI.iframe.removeAttribute("hidden"),this.playerUI.iframe.setAttribute("src",`${t}&autoplay=true&parent=${window.location.hostname}`)}playJW(t){this.playerUI.jwplayerContainer.removeAttribute("hidden"),window.pmc_jwplayer&&window.pmc_jwplayer(this.playerUI.jwplayerContainer.id).setup({playlist:t,aspectratio:"16:9"}).play()}handleTriggerClick(t,e){if(t&&t.preventDefault(),"object"!=typeof e)return!1;const i=this.state.videoType;this.resetPlayer(i),this.state.videoType=e.dataset.videoShowcaseType,"connatix"===e.dataset.videoShowcaseType?(this.state.videoID=e.dataset.videoMediaId,this.state.playerID=e.dataset.videoPlayerId):this.state.videoID=e.dataset.videoShowcaseTrigger,this.playVideo(this.state),this.updatePlayerUI(this.state),this.onFirstTimePlay()}playVideo(t){const e=this.returnUrl(t.videoID,t.videoType);if("youtube"===t.videoType&&this.playYoutube(e),"jwplayer"===t.videoType&&this.playJW(e),"twitch"===t.videoType&&this.playTwitch(e),"connatix"===t.videoType){const t=this.playerUI.player.dataset.videoPlayerId;this.playConnatix(e,t)}}onFirstTimePlay(){!1===this.state.isPlayerSetup&&(this.el.dispatchEvent(new CustomEvent("firstVideoPlay")),this.elementsToHide.forEach((t=>t.setAttribute("hidden",""))),this.attributesToRemoveFromPlayer.forEach((t=>this.player.parentNode.removeAttribute(t))),this.state.isPlayerSetup=!0)}updatePlayerUI(t){let e="";e="connatix"===t.videoType?this.el.querySelector(`[data-video-media-id="${t.videoID}"]`):this.el.querySelector(`[data-video-showcase-trigger="${t.videoID}"]`);const i=this.getPlayerCardData(t.videoType,e);this.setActiveTrigger(t.videoType,t.videoID),this.updatePlayerCardData(e,i)}resetPlayer(t){if("jwplayer"===t&&window.pmc_jwplayer&&(window.pmc_jwplayer("jwplayerContainer").remove(),this.playerUI.jwplayerContainer.setAttribute("hidden","")),"youtube"===t&&(this.playerUI.iframe.setAttribute("src",""),this.playerUI.iframe.setAttribute("hidden","")),"connatix"===t){const t=document.getElementsByClassName("cnx-main-container");for(;t.length>0;)t[0].parentNode.removeChild(t[0])}}resetAllTriggers(){this.triggers.forEach((t=>t.classList.remove("is-playing")))}setActiveTrigger(t,e){let i="";i="connatix"===t?this.el.querySelector(`.related-videos [data-video-media-id="${e}"]`):this.el.querySelector(`[data-video-showcase-trigger="${e}"]`),this.resetAllTriggers(),null!==i&&i.classList.add("is-playing")}}document.addEventListener("DOMContentLoaded",(()=>{e(),[...document.querySelectorAll(".js-Flickity")].forEach((t=>{const e=t.classList.contains("js-Flickity--isContained"),i=t.classList.contains("js-Flickity--isFreeScroll"),s=t.classList.contains("js-Flickity--isWrapAround"),o=t.classList.contains("js-Flickity--pageDots");return new(n())(t,{cellSelector:".js-Flickity-cell",pageDots:o,imagesLoaded:!0,groupCells:!0,contain:e,wrapAround:s,freeScroll:i,arrowShape:{x0:10,x1:60,y1:50,x2:65,y2:45,x3:20}})})),function(){const t=[...document.querySelectorAll("[data-video-showcase]")];t.length&&t.forEach((t=>t.pmcVideoShowcase=new o(t)))}()}))})()})(); \ No newline at end of file +(()=>{var t={741:(t,e,i)=>{var s,n;!function(o,r){"use strict";void 0===(n="function"==typeof(s=r)?s.call(e,i,e,t):s)||(t.exports=n)}(window,(function(){"use strict";var t=function(){var t=window.Element.prototype;if(t.matches)return"matches";if(t.matchesSelector)return"matchesSelector";for(var e=["webkit","moz","ms","o"],i=0;i{var s,n;!function(o,r){s=[i(741)],n=function(t){return function(t,e){"use strict";var i={extend:function(t,e){for(var i in e)t[i]=e[i];return t},modulo:function(t,e){return(t%e+e)%e}},s=Array.prototype.slice;i.makeArray=function(t){return Array.isArray(t)?t:null==t?[]:"object"==typeof t&&"number"==typeof t.length?s.call(t):[t]},i.removeFrom=function(t,e){var i=t.indexOf(e);-1!=i&&t.splice(i,1)},i.getParent=function(t,i){for(;t.parentNode&&t!=document.body;)if(t=t.parentNode,e(t,i))return t},i.getQueryElement=function(t){return"string"==typeof t?document.querySelector(t):t},i.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},i.filterFindElements=function(t,s){t=i.makeArray(t);var n=[];return t.forEach((function(t){if(t instanceof HTMLElement)if(s){e(t,s)&&n.push(t);for(var i=t.querySelectorAll(s),o=0;o{var s,n;window,s=[i(217),i(47)],void 0===(n=function(t,e){return function(t,e,i){"use strict";var s=e.prototype;return s.insert=function(t,e){var i=this._makeCells(t);if(i&&i.length){var s=this.cells.length;e=void 0===e?s:e;var n=function(t){var e=document.createDocumentFragment();return t.forEach((function(t){e.appendChild(t.element)})),e}(i),o=e==s;if(o)this.slider.appendChild(n);else{var r=this.cells[e].element;this.slider.insertBefore(n,r)}if(0===e)this.cells=i.concat(this.cells);else if(o)this.cells=this.cells.concat(i);else{var a=this.cells.splice(e,s-e);this.cells=this.cells.concat(i).concat(a)}this._sizeCells(i),this.cellChange(e,!0)}},s.append=function(t){this.insert(t,this.cells.length)},s.prepend=function(t){this.insert(t,0)},s.remove=function(t){var e=this.getCells(t);if(e&&e.length){var s=this.cells.length-1;e.forEach((function(t){t.remove();var e=this.cells.indexOf(t);s=Math.min(e,s),i.removeFrom(this.cells,t)}),this),this.cellChange(s,!0)}},s.cellSizeChange=function(t){var e=this.getCell(t);if(e){e.getSize();var i=this.cells.indexOf(e);this.cellChange(i)}},s.cellChange=function(t,e){var i=this.selectedElement;this._positionCells(t),this._getWrapShiftCells(),this.setGallerySize();var s=this.getCell(i);s&&(this.selectedIndex=this.getCellSlideIndex(s)),this.selectedIndex=Math.min(this.slides.length-1,this.selectedIndex),this.emitEvent("cellChange",[t]),this.select(this.selectedIndex),e&&this.positionSliderAtSelected()},e}(0,t,e)}.apply(e,s))||(t.exports=n)},880:(t,e,i)=>{var s,n;window,s=[i(47)],void 0===(n=function(t){return function(t,e){"use strict";return{startAnimation:function(){this.isAnimating||(this.isAnimating=!0,this.restingFrames=0,this.animate())},animate:function(){this.applyDragForce(),this.applySelectedAttraction();var t=this.x;if(this.integratePhysics(),this.positionSlider(),this.settle(t),this.isAnimating){var e=this;requestAnimationFrame((function(){e.animate()}))}},positionSlider:function(){var t=this.x;this.options.wrapAround&&this.cells.length>1&&(t=e.modulo(t,this.slideableWidth),t-=this.slideableWidth,this.shiftWrapCells(t)),this.setTranslateX(t,this.isAnimating),this.dispatchScrollEvent()},setTranslateX:function(t,e){t+=this.cursorPosition,t=this.options.rightToLeft?-t:t;var i=this.getPositionValue(t);this.slider.style.transform=e?"translate3d("+i+",0,0)":"translateX("+i+")"},dispatchScrollEvent:function(){var t=this.slides[0];if(t){var e=-this.x-t.target,i=e/this.slidesWidth;this.dispatchEvent("scroll",null,[i,e])}},positionSliderAtSelected:function(){this.cells.length&&(this.x=-this.selectedSlide.target,this.velocity=0,this.positionSlider())},getPositionValue:function(t){return this.options.percentPosition?.01*Math.round(t/this.size.innerWidth*1e4)+"%":Math.round(t)+"px"},settle:function(t){!this.isPointerDown&&Math.round(100*this.x)==Math.round(100*t)&&this.restingFrames++,this.restingFrames>2&&(this.isAnimating=!1,delete this.isFreeScrolling,this.positionSlider(),this.dispatchEvent("settle",null,[this.selectedIndex]))},shiftWrapCells:function(t){var e=this.cursorPosition+t;this._shiftCells(this.beforeShiftCells,e,-1);var i=this.size.innerWidth-(t+this.slideableWidth+this.cursorPosition);this._shiftCells(this.afterShiftCells,i,1)},_shiftCells:function(t,e,i){for(var s=0;s0?i:0;n.wrapShift(o),e-=n.size.outerWidth}},_unshiftCells:function(t){if(t&&t.length)for(var e=0;e{var s,n;window,s=[i(131)],void 0===(n=function(t){return function(t,e){"use strict";function i(t,e){this.element=t,this.parent=e,this.create()}var s=i.prototype;return s.create=function(){this.element.style.position="absolute",this.element.setAttribute("aria-hidden","true"),this.x=0,this.shift=0,this.element.style[this.parent.originSide]=0},s.destroy=function(){this.unselect(),this.element.style.position="";var t=this.parent.originSide;this.element.style[t]="",this.element.style.transform="",this.element.removeAttribute("aria-hidden")},s.getSize=function(){this.size=e(this.element)},s.setPosition=function(t){this.x=t,this.updateTarget(),this.renderPosition(t)},s.updateTarget=s.setDefaultTarget=function(){var t="left"==this.parent.originSide?"marginLeft":"marginRight";this.target=this.x+this.size[t]+this.size.width*this.parent.cellAlign},s.renderPosition=function(t){var e="left"===this.parent.originSide?1:-1,i=this.parent.options.percentPosition?t*e*(this.parent.size.innerWidth/this.size.width):t*e;this.element.style.transform="translateX("+this.parent.getPositionValue(i)+")"},s.select=function(){this.element.classList.add("is-selected"),this.element.removeAttribute("aria-hidden")},s.unselect=function(){this.element.classList.remove("is-selected"),this.element.setAttribute("aria-hidden","true")},s.wrapShift=function(t){this.shift=t,this.renderPosition(this.x+this.parent.slideableWidth*t)},s.remove=function(){this.element.parentNode.removeChild(this.element)},i}(0,t)}.apply(e,s))||(t.exports=n)},690:(t,e,i)=>{var s,n;!function(o,r){s=[i(217),i(842),i(47)],n=function(t,e,i){return function(t,e,i,s){"use strict";s.extend(e.defaults,{draggable:">1",dragThreshold:3}),e.createMethods.push("_createDrag");var n=e.prototype;s.extend(n,i.prototype),n._touchActionValue="pan-y",n._createDrag=function(){this.on("activate",this.onActivateDrag),this.on("uiChange",this._uiChangeDrag),this.on("deactivate",this.onDeactivateDrag),this.on("cellChange",this.updateDraggable)},n.onActivateDrag=function(){this.handles=[this.viewport],this.bindHandles(),this.updateDraggable()},n.onDeactivateDrag=function(){this.unbindHandles(),this.element.classList.remove("is-draggable")},n.updateDraggable=function(){">1"==this.options.draggable?this.isDraggable=this.slides.length>1:this.isDraggable=this.options.draggable,this.isDraggable?this.element.classList.add("is-draggable"):this.element.classList.remove("is-draggable")},n.bindDrag=function(){this.options.draggable=!0,this.updateDraggable()},n.unbindDrag=function(){this.options.draggable=!1,this.updateDraggable()},n._uiChangeDrag=function(){delete this.isFreeScrolling},n.pointerDown=function(e,i){this.isDraggable?this.okayPointerDown(e)&&(this._pointerDownPreventDefault(e),this.pointerDownFocus(e),document.activeElement!=this.element&&this.pointerDownBlur(),this.dragX=this.x,this.viewport.classList.add("is-pointer-down"),this.pointerDownScroll=r(),t.addEventListener("scroll",this),this._pointerDownDefault(e,i)):this._pointerDownDefault(e,i)},n._pointerDownDefault=function(t,e){this.pointerDownPointer={pageX:e.pageX,pageY:e.pageY},this._bindPostStartEvents(t),this.dispatchEvent("pointerDown",t,[e])};var o={INPUT:!0,TEXTAREA:!0,SELECT:!0};function r(){return{x:t.pageXOffset,y:t.pageYOffset}}return n.pointerDownFocus=function(t){o[t.target.nodeName]||this.focus()},n._pointerDownPreventDefault=function(t){var e="touchstart"==t.type,i="touch"==t.pointerType,s=o[t.target.nodeName];e||i||s||t.preventDefault()},n.hasDragStarted=function(t){return Math.abs(t.x)>this.options.dragThreshold},n.pointerUp=function(t,e){delete this.isTouchScrolling,this.viewport.classList.remove("is-pointer-down"),this.dispatchEvent("pointerUp",t,[e]),this._dragPointerUp(t,e)},n.pointerDone=function(){t.removeEventListener("scroll",this),delete this.pointerDownScroll},n.dragStart=function(e,i){this.isDraggable&&(this.dragStartPosition=this.x,this.startAnimation(),t.removeEventListener("scroll",this),this.dispatchEvent("dragStart",e,[i]))},n.pointerMove=function(t,e){var i=this._dragPointerMove(t,e);this.dispatchEvent("pointerMove",t,[e,i]),this._dragMove(t,e,i)},n.dragMove=function(t,e,i){if(this.isDraggable){t.preventDefault(),this.previousDragX=this.dragX;var s=this.options.rightToLeft?-1:1;this.options.wrapAround&&(i.x%=this.slideableWidth);var n=this.dragStartPosition+i.x*s;if(!this.options.wrapAround&&this.slides.length){var o=Math.max(-this.slides[0].target,this.dragStartPosition);n=n>o?.5*(n+o):n;var r=Math.min(-this.getLastSlide().target,this.dragStartPosition);n=nthis.slides[0].target&&-s1,o=n?s.modulo(e,i):e,r=this.slides[o];if(!r)return null;var a=n?this.slideableWidth*Math.floor(e/i):0;return t-(r.target+a)},n.dragEndBoostSelect=function(){if(void 0===this.previousDragX||!this.dragMoveTime||new Date-this.dragMoveTime>100)return 0;var t=this.getSlideDistance(-this.dragX,this.selectedIndex),e=this.previousDragX-this.dragX;return t>0&&e>0?1:t<0&&e<0?-1:0},n.staticClick=function(t,e){var i=this.getParentCell(t.target),s=i&&i.element,n=i&&this.cells.indexOf(i);this.dispatchEvent("staticClick",t,[e,s,n])},n.onscroll=function(){var t=r(),e=this.pointerDownScroll.x-t.x,i=this.pointerDownScroll.y-t.y;(Math.abs(e)>3||Math.abs(i)>3)&&this._pointerDone()},e}(o,t,e,i)}.apply(e,s),void 0===n||(t.exports=n)}(window)},217:(t,e,i)=>{var s,n;!function(o,r){s=[i(158),i(131),i(47),i(229),i(714),i(880)],n=function(t,e,i,s,n,r){return function(t,e,i,s,n,o,r){"use strict";var a=t.jQuery,l=t.getComputedStyle,h=t.console;function c(t,e){for(t=s.makeArray(t);t.length;)e.appendChild(t.shift())}var d=0,u={};function p(t,e){var i=s.getQueryElement(t);if(i){if(this.element=i,this.element.flickityGUID){var n=u[this.element.flickityGUID];return n&&n.option(e),n}a&&(this.$element=a(this.element)),this.options=s.extend({},this.constructor.defaults),this.option(e),this._create()}else h&&h.error("Bad element for Flickity: "+(i||t))}p.defaults={accessibility:!0,cellAlign:"center",freeScrollFriction:.075,friction:.28,namespaceJQueryEvents:!0,percentPosition:!0,resize:!0,selectedAttraction:.025,setGallerySize:!0},p.createMethods=[];var f=p.prototype;s.extend(f,e.prototype),f._create=function(){var e=this.guid=++d;for(var i in this.element.flickityGUID=e,u[e]=this,this.selectedIndex=0,this.restingFrames=0,this.x=0,this.velocity=0,this.originSide=this.options.rightToLeft?"right":"left",this.viewport=document.createElement("div"),this.viewport.className="flickity-viewport",this._createSlider(),(this.options.resize||this.options.watchCSS)&&t.addEventListener("resize",this),this.options.on){var s=this.options.on[i];this.on(i,s)}p.createMethods.forEach((function(t){this[t]()}),this),this.options.watchCSS?this.watchCSS():this.activate()},f.option=function(t){s.extend(this.options,t)},f.activate=function(){this.isActive||(this.isActive=!0,this.element.classList.add("flickity-enabled"),this.options.rightToLeft&&this.element.classList.add("flickity-rtl"),this.getSize(),c(this._filterFindCellElements(this.element.children),this.slider),this.viewport.appendChild(this.slider),this.element.appendChild(this.viewport),this.reloadCells(),this.options.accessibility&&(this.element.tabIndex=0,this.element.addEventListener("keydown",this)),this.emitEvent("activate"),this.selectInitialIndex(),this.isInitActivated=!0,this.dispatchEvent("ready"))},f._createSlider=function(){var t=document.createElement("div");t.className="flickity-slider",t.style[this.originSide]=0,this.slider=t},f._filterFindCellElements=function(t){return s.filterFindElements(t,this.options.cellSelector)},f.reloadCells=function(){this.cells=this._makeCells(this.slider.children),this.positionCells(),this._getWrapShiftCells(),this.setGallerySize()},f._makeCells=function(t){return this._filterFindCellElements(t).map((function(t){return new n(t,this)}),this)},f.getLastCell=function(){return this.cells[this.cells.length-1]},f.getLastSlide=function(){return this.slides[this.slides.length-1]},f.positionCells=function(){this._sizeCells(this.cells),this._positionCells(0)},f._positionCells=function(t){t=t||0,this.maxCellHeight=t&&this.maxCellHeight||0;var e=0;if(t>0){var i=this.cells[t-1];e=i.x+i.size.outerWidth}for(var s=this.cells.length,n=t;n0;){var n=this.cells[e];if(!n)break;s.push(n),e+=i,t-=n.size.outerWidth}return s},f._containSlides=function(){if(this.options.contain&&!this.options.wrapAround&&this.cells.length){var t=this.options.rightToLeft,e=t?"marginRight":"marginLeft",i=t?"marginLeft":"marginRight",s=this.slideableWidth-this.getLastCell().size[i],n=s1))return t;var i=s.modulo(t,e),n=Math.abs(i-this.selectedIndex),o=Math.abs(i+e-this.selectedIndex),r=Math.abs(i-e-this.selectedIndex);!this.isDragSelect&&o=e&&(this.x+=this.slideableWidth)},f.previous=function(t,e){this.select(this.selectedIndex-1,t,e)},f.next=function(t,e){this.select(this.selectedIndex+1,t,e)},f.updateSelectedSlide=function(){var t=this.slides[this.selectedIndex];t&&(this.unselectSelectedSlide(),this.selectedSlide=t,t.select(),this.selectedCells=t.cells,this.selectedElements=t.getCellElements(),this.selectedCell=t.cells[0],this.selectedElement=this.selectedElements[0])},f.unselectSelectedSlide=function(){this.selectedSlide&&this.selectedSlide.unselect()},f.selectInitialIndex=function(){var t=this.options.initialIndex;if(this.isInitActivated)this.select(this.selectedIndex,!1,!0);else{if(t&&"string"==typeof t&&this.queryCell(t))return void this.selectCell(t,!1,!0);var e=0;t&&this.slides[t]&&(e=t),this.select(e,!1,!0)}},f.selectCell=function(t,e,i){var s=this.queryCell(t);if(s){var n=this.getCellSlideIndex(s);this.select(n,e,i)}},f.getCellSlideIndex=function(t){for(var e=0;e *"),this.getCell(t))},f.getAdjacentCellElements=function(t,e){if(!t)return this.selectedSlide.getCellElements();e=void 0===e?this.selectedIndex:e;var i=this.slides.length;if(1+2*t>=i)return this.getCellElements();for(var n=[],o=e-t;o<=e+t;o++){var r=this.options.wrapAround?s.modulo(o,i):o,a=this.slides[r];a&&(n=n.concat(a.getCellElements()))}return n},f.queryCell=function(t){if("number"==typeof t)return this.cells[t];if("string"==typeof t){if(t.match(/^[#.]?[\d/]/))return;t=this.element.querySelector(t)}return this.getCell(t)},f.uiChange=function(){this.emitEvent("uiChange")},f.childUIPointerDown=function(t){"touchstart"!=t.type&&t.preventDefault(),this.focus()},f.onresize=function(){this.watchCSS(),this.resize()},s.debounceMethod(p,"onresize",150),f.resize=function(){if(this.isActive&&!this.isAnimating&&!this.isDragging){this.getSize(),this.options.wrapAround&&(this.x=s.modulo(this.x,this.slideableWidth)),this.positionCells(),this._getWrapShiftCells(),this.setGallerySize(),this.emitEvent("resize");var t=this.selectedElements&&this.selectedElements[0];this.selectCell(t,!1,!0)}},f.watchCSS=function(){this.options.watchCSS&&(-1!=l(this.element,":after").content.indexOf("flickity")?this.activate():this.deactivate())},f.onkeydown=function(t){var e=document.activeElement&&document.activeElement!=this.element;if(this.options.accessibility&&!e){var i=p.keyboardHandlers[t.keyCode];i&&i.call(this)}},p.keyboardHandlers={37:function(){var t=this.options.rightToLeft?"next":"previous";this.uiChange(),this[t]()},39:function(){var t=this.options.rightToLeft?"previous":"next";this.uiChange(),this[t]()}},f.focus=function(){var e=t.pageYOffset;this.element.focus({preventScroll:!0}),t.pageYOffset!=e&&t.scrollTo(t.pageXOffset,e)},f.deactivate=function(){this.isActive&&(this.element.classList.remove("flickity-enabled"),this.element.classList.remove("flickity-rtl"),this.unselectSelectedSlide(),this.cells.forEach((function(t){t.destroy()})),this.element.removeChild(this.viewport),c(this.slider.children,this.element),this.options.accessibility&&(this.element.removeAttribute("tabIndex"),this.element.removeEventListener("keydown",this)),this.isActive=!1,this.emitEvent("deactivate"))},f.destroy=function(){this.deactivate(),t.removeEventListener("resize",this),this.allOff(),this.emitEvent("destroy"),a&&this.$element&&a.removeData(this.element,"flickity"),delete this.element.flickityGUID,delete u[this.guid]},s.extend(f,r),p.data=function(t){var e=(t=s.getQueryElement(t))&&t.flickityGUID;return e&&u[e]},s.htmlInit(p,"flickity"),a&&a.bridget&&a.bridget("flickity",p),p.setJQuery=function(t){a=t},p.Cell=n,p.Slide=o,p}(o,t,e,i,s,n,r)}.apply(e,s),void 0===n||(t.exports=n)}(window)},442:(t,e,i)=>{var s,n,o;window,n=[i(217),i(690),i(410),i(573),i(516),i(597),i(227)],void 0===(o="function"==typeof(s=function(t){return t})?s.apply(e,n):s)||(t.exports=o)},227:(t,e,i)=>{var s,n;window,s=[i(217),i(47)],void 0===(n=function(t,e){return function(t,e,i){"use strict";e.createMethods.push("_createLazyload");var s=e.prototype;function n(t,e){this.img=t,this.flickity=e,this.load()}return s._createLazyload=function(){this.on("select",this.lazyLoad)},s.lazyLoad=function(){var t=this.options.lazyLoad;if(t){var e="number"==typeof t?t:0,s=this.getAdjacentCellElements(e),o=[];s.forEach((function(t){var e=function(t){if("IMG"==t.nodeName){var e=t.getAttribute("data-flickity-lazyload"),s=t.getAttribute("data-flickity-lazyload-src"),n=t.getAttribute("data-flickity-lazyload-srcset");if(e||s||n)return[t]}var o=t.querySelectorAll("img[data-flickity-lazyload], img[data-flickity-lazyload-src], img[data-flickity-lazyload-srcset]");return i.makeArray(o)}(t);o=o.concat(e)})),o.forEach((function(t){new n(t,this)}),this)}},n.prototype.handleEvent=i.handleEvent,n.prototype.load=function(){this.img.addEventListener("load",this),this.img.addEventListener("error",this);var t=this.img.getAttribute("data-flickity-lazyload")||this.img.getAttribute("data-flickity-lazyload-src"),e=this.img.getAttribute("data-flickity-lazyload-srcset");this.img.src=t,e&&this.img.setAttribute("srcset",e),this.img.removeAttribute("data-flickity-lazyload"),this.img.removeAttribute("data-flickity-lazyload-src"),this.img.removeAttribute("data-flickity-lazyload-srcset")},n.prototype.onload=function(t){this.complete(t,"flickity-lazyloaded")},n.prototype.onerror=function(t){this.complete(t,"flickity-lazyerror")},n.prototype.complete=function(t,e){this.img.removeEventListener("load",this),this.img.removeEventListener("error",this);var i=this.flickity.getParentCell(this.img),s=i&&i.element;this.flickity.cellSizeChange(s),this.img.classList.add(e),this.flickity.dispatchEvent("lazyLoad",t,s)},e.LazyLoader=n,e}(0,t,e)}.apply(e,s))||(t.exports=n)},573:(t,e,i)=>{var s,n;window,s=[i(217),i(704),i(47)],void 0===(n=function(t,e,i){return function(t,e,i,s){"use strict";function n(t){this.parent=t,this._create()}n.prototype=Object.create(i.prototype),n.prototype._create=function(){this.holder=document.createElement("ol"),this.holder.className="flickity-page-dots",this.dots=[],this.handleClick=this.onClick.bind(this),this.on("pointerDown",this.parent.childUIPointerDown.bind(this.parent))},n.prototype.activate=function(){this.setDots(),this.holder.addEventListener("click",this.handleClick),this.bindStartEvent(this.holder),this.parent.element.appendChild(this.holder)},n.prototype.deactivate=function(){this.holder.removeEventListener("click",this.handleClick),this.unbindStartEvent(this.holder),this.parent.element.removeChild(this.holder)},n.prototype.setDots=function(){var t=this.parent.slides.length-this.dots.length;t>0?this.addDots(t):t<0&&this.removeDots(-t)},n.prototype.addDots=function(t){for(var e=document.createDocumentFragment(),i=[],s=this.dots.length,n=s+t,o=s;o{var s,n;window,s=[i(158),i(47),i(217)],void 0===(n=function(t,e,i){return function(t,e,i){"use strict";function s(t){this.parent=t,this.state="stopped",this.onVisibilityChange=this.visibilityChange.bind(this),this.onVisibilityPlay=this.visibilityPlay.bind(this)}s.prototype=Object.create(t.prototype),s.prototype.play=function(){"playing"!=this.state&&(document.hidden?document.addEventListener("visibilitychange",this.onVisibilityPlay):(this.state="playing",document.addEventListener("visibilitychange",this.onVisibilityChange),this.tick()))},s.prototype.tick=function(){if("playing"==this.state){var t=this.parent.options.autoPlay;t="number"==typeof t?t:3e3;var e=this;this.clear(),this.timeout=setTimeout((function(){e.parent.next(!0),e.tick()}),t)}},s.prototype.stop=function(){this.state="stopped",this.clear(),document.removeEventListener("visibilitychange",this.onVisibilityChange)},s.prototype.clear=function(){clearTimeout(this.timeout)},s.prototype.pause=function(){"playing"==this.state&&(this.state="paused",this.clear())},s.prototype.unpause=function(){"paused"==this.state&&this.play()},s.prototype.visibilityChange=function(){this[document.hidden?"pause":"unpause"]()},s.prototype.visibilityPlay=function(){this.play(),document.removeEventListener("visibilitychange",this.onVisibilityPlay)},e.extend(i.defaults,{pauseAutoPlayOnHover:!0}),i.createMethods.push("_createPlayer");var n=i.prototype;return n._createPlayer=function(){this.player=new s(this),this.on("activate",this.activatePlayer),this.on("uiChange",this.stopPlayer),this.on("pointerDown",this.stopPlayer),this.on("deactivate",this.deactivatePlayer)},n.activatePlayer=function(){this.options.autoPlay&&(this.player.play(),this.element.addEventListener("mouseenter",this))},n.playPlayer=function(){this.player.play()},n.stopPlayer=function(){this.player.stop()},n.pausePlayer=function(){this.player.pause()},n.unpausePlayer=function(){this.player.unpause()},n.deactivatePlayer=function(){this.player.stop(),this.element.removeEventListener("mouseenter",this)},n.onmouseenter=function(){this.options.pauseAutoPlayOnHover&&(this.player.pause(),this.element.addEventListener("mouseleave",this))},n.onmouseleave=function(){this.player.unpause(),this.element.removeEventListener("mouseleave",this)},i.Player=s,i}(t,e,i)}.apply(e,s))||(t.exports=n)},410:(t,e,i)=>{var s,n;window,s=[i(217),i(704),i(47)],void 0===(n=function(t,e,i){return function(t,e,i,s){"use strict";var n="http://www.w3.org/2000/svg";function o(t,e){this.direction=t,this.parent=e,this._create()}o.prototype=Object.create(i.prototype),o.prototype._create=function(){this.isEnabled=!0,this.isPrevious=-1==this.direction;var t=this.parent.options.rightToLeft?1:-1;this.isLeft=this.direction==t;var e=this.element=document.createElement("button");e.className="flickity-button flickity-prev-next-button",e.className+=this.isPrevious?" previous":" next",e.setAttribute("type","button"),this.disable(),e.setAttribute("aria-label",this.isPrevious?"Previous":"Next");var i=this.createSVG();e.appendChild(i),this.parent.on("select",this.update.bind(this)),this.on("pointerDown",this.parent.childUIPointerDown.bind(this.parent))},o.prototype.activate=function(){this.bindStartEvent(this.element),this.element.addEventListener("click",this),this.parent.element.appendChild(this.element)},o.prototype.deactivate=function(){this.parent.element.removeChild(this.element),this.unbindStartEvent(this.element),this.element.removeEventListener("click",this)},o.prototype.createSVG=function(){var t=document.createElementNS(n,"svg");t.setAttribute("class","flickity-button-icon"),t.setAttribute("viewBox","0 0 100 100");var e,i=document.createElementNS(n,"path"),s="string"==typeof(e=this.parent.options.arrowShape)?e:"M "+e.x0+",50 L "+e.x1+","+(e.y1+50)+" L "+e.x2+","+(e.y2+50)+" L "+e.x3+",50 L "+e.x2+","+(50-e.y2)+" L "+e.x1+","+(50-e.y1)+" Z";return i.setAttribute("d",s),i.setAttribute("class","arrow"),this.isLeft||i.setAttribute("transform","translate(100, 100) rotate(180) "),t.appendChild(i),t},o.prototype.handleEvent=s.handleEvent,o.prototype.onclick=function(){if(this.isEnabled){this.parent.uiChange();var t=this.isPrevious?"previous":"next";this.parent[t]()}},o.prototype.enable=function(){this.isEnabled||(this.element.disabled=!1,this.isEnabled=!0)},o.prototype.disable=function(){this.isEnabled&&(this.element.disabled=!0,this.isEnabled=!1)},o.prototype.update=function(){var t=this.parent.slides;if(this.parent.options.wrapAround&&t.length>1)this.enable();else{var e=t.length?t.length-1:0,i=this.isPrevious?0:e;this[this.parent.selectedIndex==i?"disable":"enable"]()}},o.prototype.destroy=function(){this.deactivate(),this.allOff()},s.extend(e.defaults,{prevNextButtons:!0,arrowShape:{x0:10,x1:60,y1:50,x2:70,y2:40,x3:30}}),e.createMethods.push("_createPrevNextButtons");var r=e.prototype;return r._createPrevNextButtons=function(){this.options.prevNextButtons&&(this.prevButton=new o(-1,this),this.nextButton=new o(1,this),this.on("activate",this.activatePrevNextButtons))},r.activatePrevNextButtons=function(){this.prevButton.activate(),this.nextButton.activate(),this.on("deactivate",this.deactivatePrevNextButtons)},r.deactivatePrevNextButtons=function(){this.prevButton.deactivate(),this.nextButton.deactivate(),this.off("deactivate",this.deactivatePrevNextButtons)},e.PrevNextButton=o,e}(0,t,e,i)}.apply(e,s))||(t.exports=n)},714:(t,e,i)=>{var s,n;window,void 0===(n="function"==typeof(s=function(){"use strict";function t(t){this.parent=t,this.isOriginLeft="left"==t.originSide,this.cells=[],this.outerWidth=0,this.height=0}var e=t.prototype;return e.addCell=function(t){if(this.cells.push(t),this.outerWidth+=t.size.outerWidth,this.height=Math.max(t.size.outerHeight,this.height),1==this.cells.length){this.x=t.x;var e=this.isOriginLeft?"marginLeft":"marginRight";this.firstMargin=t.size[e]}},e.updateTarget=function(){var t=this.isOriginLeft?"marginRight":"marginLeft",e=this.getLastCell(),i=e?e.size[t]:0,s=this.outerWidth-(this.firstMargin+i);this.target=this.x+this.firstMargin+s*this.parent.cellAlign},e.getLastCell=function(){return this.cells[this.cells.length-1]},e.select=function(){this.cells.forEach((function(t){t.select()}))},e.unselect=function(){this.cells.forEach((function(t){t.unselect()}))},e.getCellElements=function(){return this.cells.map((function(t){return t.element}))},t})?s.call(e,i,e,t):s)||(t.exports=n)},131:(t,e,i)=>{var s,n;window,void 0===(n="function"==typeof(s=function(){"use strict";function t(t){var e=parseFloat(t);return-1==t.indexOf("%")&&!isNaN(e)&&e}var e="undefined"==typeof console?function(){}:function(t){console.error(t)},i=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],s=i.length;function n(t){var i=getComputedStyle(t);return i||e("Style returned "+i+". Are you running this code in a hidden iframe on Firefox? See https://bit.ly/getsizebug1"),i}var o,r=!1;function a(e){if(function(){if(!r){r=!0;var e=document.createElement("div");e.style.width="200px",e.style.padding="1px 2px 3px 4px",e.style.borderStyle="solid",e.style.borderWidth="1px 2px 3px 4px",e.style.boxSizing="border-box";var i=document.body||document.documentElement;i.appendChild(e);var s=n(e);o=200==Math.round(t(s.width)),a.isBoxSizeOuter=o,i.removeChild(e)}}(),"string"==typeof e&&(e=document.querySelector(e)),e&&"object"==typeof e&&e.nodeType){var l=n(e);if("none"==l.display)return function(){for(var t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},e=0;e{var s,n;!function(o,r){s=[i(704)],n=function(t){return function(t,e){"use strict";function i(){}var s=i.prototype=Object.create(e.prototype);s.bindHandles=function(){this._bindHandles(!0)},s.unbindHandles=function(){this._bindHandles(!1)},s._bindHandles=function(e){for(var i=(e=void 0===e||e)?"addEventListener":"removeEventListener",s=e?this._touchActionValue:"",n=0;n3||Math.abs(t.y)>3},s.pointerUp=function(t,e){this.emitEvent("pointerUp",[t,e]),this._dragPointerUp(t,e)},s._dragPointerUp=function(t,e){this.isDragging?this._dragEnd(t,e):this._staticClick(t,e)},s._dragStart=function(t,e){this.isDragging=!0,this.isPreventingClicks=!0,this.dragStart(t,e)},s.dragStart=function(t,e){this.emitEvent("dragStart",[t,e])},s._dragMove=function(t,e,i){this.isDragging&&this.dragMove(t,e,i)},s.dragMove=function(t,e,i){t.preventDefault(),this.emitEvent("dragMove",[t,e,i])},s._dragEnd=function(t,e){this.isDragging=!1,setTimeout(function(){delete this.isPreventingClicks}.bind(this)),this.dragEnd(t,e)},s.dragEnd=function(t,e){this.emitEvent("dragEnd",[t,e])},s.onclick=function(t){this.isPreventingClicks&&t.preventDefault()},s._staticClick=function(t,e){this.isIgnoringMouseUp&&"mouseup"==t.type||(this.staticClick(t,e),"mouseup"!=t.type&&(this.isIgnoringMouseUp=!0,setTimeout(function(){delete this.isIgnoringMouseUp}.bind(this),400)))},s.staticClick=function(t,e){this.emitEvent("staticClick",[t,e])},i.getPointerPoint=e.getPointerPoint,i}(o,t)}.apply(e,s),void 0===n||(t.exports=n)}(window)},704:(t,e,i)=>{var s,n;!function(o,r){s=[i(158)],n=function(t){return function(t,e){"use strict";function i(){}var s=i.prototype=Object.create(e.prototype);s.bindStartEvent=function(t){this._bindStartEvent(t,!0)},s.unbindStartEvent=function(t){this._bindStartEvent(t,!1)},s._bindStartEvent=function(e,i){var s=(i=void 0===i||i)?"addEventListener":"removeEventListener",n="mousedown";"ontouchstart"in t?n="touchstart":t.PointerEvent&&(n="pointerdown"),e[s](n,this)},s.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},s.getTouch=function(t){for(var e=0;e{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var s in e)i.o(e,s)&&!i.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";class t{constructor(t){this.el=t,this.toggleEl=this.el.querySelector("[data-collapsible-toggle]"),this.panels=[...this.el.querySelectorAll("[data-collapsible-panel]")],this.group=this.findGroup(),this.toggle=this.toggle.bind(this),this.onClick=this.onClick.bind(this),this.toggleEl&&this.toggleEl.addEventListener("click",this.onClick)}destroy(){this.toggleEl&&this.toggleEl.removeEventListener("click",this.onClick),this.isCollapsed||this.toggle()}get state(){return this.el.dataset.collapsible}set state(t){this.el.dataset.collapsible=t,this.isCollapsed?this.el.classList.remove("is-expanded"):this.el.classList.add("is-expanded")}get isCollapsed(){return"collapsed"===this.state}get container(){return document.querySelector(this.el.dataset.collapsibleContainer)}get closeOnClick(){return void 0!==this.el.dataset.collapsibleCloseOnClick}findGroup(){return[...document.body.querySelectorAll("[data-collapsible-group]")].find((t=>t.contains(this.el)))||null}onClick(t){t.preventDefault(),this.toggle()}toggle(){this.state=this.isCollapsed?"expanded":"collapsed",this.maybeRepositionPanel(),this.maybeCloseOnClick(),"expanded"===this.state&&(document.querySelector("[data-collapsible-toggle] + li > a").focus(),null!==this.group&&this.closeOthersInGroup())}collapse(){"expanded"===this.state&&this.toggle()}closeOthersInGroup(){[...this.group.querySelectorAll("[data-collapsible]")].forEach((t=>{t!==this.el&&t.pmcCollapsible.collapse()}))}maybeRepositionPanel(){if(this.container)if(this.isCollapsed)this.panels.forEach((t=>t.style.marginLeft=""));else{const t=this.container.getBoundingClientRect().left;this.panels.forEach((e=>{const i=e.getBoundingClientRect();if(0===i.width&&0===i.height)return;const s=parseInt(window.getComputedStyle(e).marginLeft,10),n=i.left-2*s;ndocument.body.addEventListener("click",this.toggle)),1))}}function e(){[...document.querySelectorAll("[data-collapsible]")].forEach((e=>e.pmcCollapsible=new t(e)))}var s=i(442),n=i.n(s);class o{constructor(t){var e,i,s;this.el=t,this.triggers=[...t.querySelectorAll("[data-video-showcase-trigger]")],this.player=t.querySelector("[data-video-showcase-player]"),this.elementsToHide=[...this.el.querySelectorAll(".is-to-be-hidden")],this.attributesToRemoveFromPlayer=["data-video-showcase-trigger","data-video-showcase-title","data-video-showcase-dek","data-video-showcase-permalink","data-video-showcase-type","href"],this.state={isPlayerSetup:!1,hasSocialShare:!1,playerID:"",videoID:"",videoType:""},this.playerUI={title:t.querySelector(".js-VideoShowcase-title"),sponsoredBadge:t.querySelector(".js-video-showcase-sponsored-badge"),dek:t.querySelector(".js-VideoShowcase-dek"),iframe:t.querySelector("[data-video-showcase-iframe]"),jwplayerContainer:t.querySelector("[data-video-showcase-jwplayer], #jwplayerContainer"),social:t.querySelector("[data-video-showcase-player-social-share]"),connatixContainer:t.querySelector("[data-video-showcase-connatix]"),player:t.querySelector("[data-video-player-id]")},this.init(),this.player.dataset.videoShowcaseAutoplay?this.handleTriggerClick(null,this.triggers[0]):(e=this.el,"click",i="[data-video-showcase-trigger]",s=this.handleTriggerClick.bind(this),e.addEventListener("click",(t=>{const e=((t,e)=>e.matches&&e.matches(t))(i,t.target)?t.target:t.target.closest(i);e&&s(t,e)})))}init(){null!==this.playerUI.social&&(this.state.hasSocialShare=!0)}getPlayerCardData(t,e){let i="";i="connatix"===t?e.dataset.videoMediaId:e.dataset.videoShowcaseTrigger;const s=this.state.hasSocialShare;return{title:e.dataset.videoShowcaseTitle,sponsored:e.dataset.videoShowcaseSponsored,dek:e.dataset.videoShowcaseDek,permalink:e.dataset.videoShowcasePermalink,socialString:function(t){if(window.wp&&s)return wp.template(`trigger-social-share-${i}`)(void 0)}()}}updatePlayerCardData(t,e){this.playerUI.title&&e.title&&(this.playerUI.title.innerText=e.title),this.playerUI.title&&e.permalink&&this.playerUI.title.setAttribute("href",e.permalink),e.dek&&(this.playerUI.dek.innerText=e.dek),e.socialString&&this.state.hasSocialShare&&this.updateCardSocialShare(e.socialString),null!==this.playerUI.sponsoredBadge&&(e.sponsored?this.playerUI.sponsoredBadge.classList.remove("u-hidden"):this.playerUI.sponsoredBadge.classList.add("u-hidden"))}updateCardSocialShare(t){this.playerUI.social.removeChild(this.playerUI.social.querySelector("ul")),this.playerUI.social.insertAdjacentHTML("beforeend",t),e()}returnUrl(t,e){return"youtube"===e?`https://www.youtube.com/embed/${t}`:"jwplayer"===e?`https://content.jwplatform.com/feeds/${t}.json`:"twitch"===e?`https://player.twitch.tv/?video=${t}`:"connatix"===e||"iframe"===e?t:void 0}playYoutube(t){this.playerUI.iframe.removeAttribute("hidden"),this.playerUI.iframe.setAttribute("src",`${t}?rel=0&autoplay=1&showinfo=0&controls=2&rel=0&modestbranding=0`)}playConnatix(t,e){this.playerUI.connatixContainer.removeAttribute("hidden");const i=this.playerUI.connatixContainer.getAttribute("id");(new Image).src="https://capi.elements.video/tr/si?token=094029a3-814c-41d5-8a62-2c3adc647176&cid=1ffe63de-eb53-11e9-b4d2-06948452ae1a",pmcCnx.cmd.push((function(){pmcCnx({playerId:e,mediaId:t}).render(i).play()}))}playTwitch(t){this.playerUI.iframe.removeAttribute("hidden"),this.playerUI.iframe.setAttribute("src",`${t}&autoplay=true&parent=${window.location.hostname}`)}playIframeUrl(t){this.playerUI.iframe.removeAttribute("hidden"),this.playerUI.iframe.setAttribute("src",t)}playJW(t){this.playerUI.jwplayerContainer.removeAttribute("hidden"),window.pmc_jwplayer&&window.pmc_jwplayer(this.playerUI.jwplayerContainer.id).setup({playlist:t,aspectratio:"16:9"}).play()}handleTriggerClick(t,e){if(t&&t.preventDefault(),"object"!=typeof e)return!1;const i=this.state.videoType;this.resetPlayer(i),this.state.videoType=e.dataset.videoShowcaseType,"connatix"===e.dataset.videoShowcaseType?(this.state.videoID=e.dataset.videoMediaId,this.state.playerID=e.dataset.videoPlayerId):this.state.videoID=e.dataset.videoShowcaseTrigger,this.playVideo(this.state),this.updatePlayerUI(this.state),this.onFirstTimePlay()}playVideo(t){const e=this.returnUrl(t.videoID,t.videoType);if("youtube"===t.videoType&&this.playYoutube(e),"jwplayer"===t.videoType&&this.playJW(e),"twitch"===t.videoType&&this.playTwitch(e),"connatix"===t.videoType){const t=this.playerUI.player.dataset.videoPlayerId;this.playConnatix(e,t)}"iframe"===t.videoType&&this.playIframeUrl(e)}onFirstTimePlay(){!1===this.state.isPlayerSetup&&(this.el.dispatchEvent(new CustomEvent("firstVideoPlay")),this.elementsToHide.forEach((t=>t.setAttribute("hidden",""))),this.attributesToRemoveFromPlayer.forEach((t=>this.player.parentNode.removeAttribute(t))),this.state.isPlayerSetup=!0)}updatePlayerUI(t){let e="";e="connatix"===t.videoType?this.el.querySelector(`[data-video-media-id="${t.videoID}"]`):this.el.querySelector(`[data-video-showcase-trigger="${t.videoID}"]`);const i=this.getPlayerCardData(t.videoType,e);this.setActiveTrigger(t.videoType,t.videoID),this.updatePlayerCardData(e,i)}resetPlayer(t){if("jwplayer"===t&&window.pmc_jwplayer&&(window.pmc_jwplayer("jwplayerContainer").remove(),this.playerUI.jwplayerContainer.setAttribute("hidden","")),"youtube"===t&&(this.playerUI.iframe.setAttribute("src",""),this.playerUI.iframe.setAttribute("hidden","")),"connatix"===t){const t=document.getElementsByClassName("cnx-main-container");for(;t.length>0;)t[0].parentNode.removeChild(t[0])}}resetAllTriggers(){this.triggers.forEach((t=>t.classList.remove("is-playing")))}setActiveTrigger(t,e){let i="";i="connatix"===t?this.el.querySelector(`.related-videos [data-video-media-id="${e}"]`):this.el.querySelector(`[data-video-showcase-trigger="${e}"]`),this.resetAllTriggers(),null!==i&&i.classList.add("is-playing")}}document.addEventListener("DOMContentLoaded",(()=>{e(),[...document.querySelectorAll(".js-Flickity")].forEach((t=>{const e=t.classList.contains("js-Flickity--isContained"),i=t.classList.contains("js-Flickity--isFreeScroll"),s=t.classList.contains("js-Flickity--isWrapAround"),o=t.classList.contains("js-Flickity--pageDots");return new(n())(t,{cellSelector:".js-Flickity-cell",pageDots:o,imagesLoaded:!0,groupCells:!0,contain:e,wrapAround:s,freeScroll:i,arrowShape:{x0:10,x1:60,y1:50,x2:65,y2:45,x3:20}})})),function(){const t=[...document.querySelectorAll("[data-video-showcase]")];t.length&&t.forEach((t=>t.pmcVideoShowcase=new o(t)))}()}))})()})(); \ No newline at end of file diff --git a/packages/larva-js/src/interface/VideoShowcase/VideoShowcase.js b/packages/larva-js/src/interface/VideoShowcase/VideoShowcase.js index 2ba232490..1b29683dd 100644 --- a/packages/larva-js/src/interface/VideoShowcase/VideoShowcase.js +++ b/packages/larva-js/src/interface/VideoShowcase/VideoShowcase.js @@ -230,9 +230,10 @@ export default class VideoShowcase { return `https://player.twitch.tv/?video=${ id }`; } - if ( 'connatix' === type ) { + if ( 'connatix' === type || 'iframe' === type ) { return id; } + } /** @@ -283,6 +284,16 @@ export default class VideoShowcase { ); } + /** + * Remove hidden attribute from the iframe and set the src. + * + * @param {string} IframeUrl - Iframe embed URL from returnUrl. + */ + playIframeUrl( IframeUrl ) { + this.playerUI.iframe.removeAttribute( 'hidden' ); + this.playerUI.iframe.setAttribute( 'src', IframeUrl ); + } + /** * Remove hidden attribute from jwplayerContainer and play the video with the jwplayer API. * Note that `playlist` refers to a JWPlayer media object where the videos are handled within @@ -366,6 +377,10 @@ export default class VideoShowcase { const playerId = this.playerUI.player.dataset.videoPlayerId; this.playConnatix( url, playerId ); } + + if ( 'iframe' === state.videoType ) { + this.playIframeUrl( url ); + } } // Remove any trigger-related data attributes and hide any elements that are not relevant for the player.