vendor: 10,106 bytes, lines 1-2
1/*! skrollr 0.6.30 (2015-06-19) | Alexander Prinzhorn - https://github.com/Prinzhorn/skrollr | Free to use under terms of MIT license */ 2!function(a,b,c){"use strict";function d(c){if(e=b.documentElement,f=b.body,T(),ha=this,c=c||{},ma=c.constants||{},c.easing)for(var d in c.easing)W[d]=c.easing[d];ta=c.edgeStrategy||"set",ka={beforerender:c.beforerender,render:c.render,keyframe:c.keyframe},la=c.forceHeight!==!1,la&&(Ka=c.scale||1),na=c.mobileDeceleration||y,pa=c.smoothScrolling!==!1,qa=c.smoothScrollingDuration||A,ra={targetTop:ha.getScrollTop()},Sa=(c.mobileCheck||function(){return/Android|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent||navigator.vendor||a.opera)})(),Sa?(ja=b.getElementById(c.skrollrBody||z),ja&&ga(),X(),Ea(e,[s,v],[t])):Ea(e,[s,u],[t]),ha.refresh(),wa(a,"resize orientationchange",function(){var a=e.clientWidth,b=e.clientHeight;(b!==Pa||a!==Oa)&&(Pa=b,Oa=a,Qa=!0)});var g=U();return function h(){$(),va=g(h)}(),ha}var e,f,g={get:function(){return ha},init:function(a){return ha||new d(a)},VERSION:"0.6.29"},h=Object.prototype.hasOwnProperty,i=a.Math,j=a.getComputedStyle,k="touchstart",l="touchmove",m="touchcancel",n="touchend",o="skrollable",p=o+"-before",q=o+"-between",r=o+"-after",s="skrollr",t="no-"+s,u=s+"-desktop",v=s+"-mobile",w="linear",x=1e3,y=.004,z="skrollr-body",A=200,B="start",C="end",D="center",E="bottom",F="___skrollable_id",G=/^(?:input|textarea|button|select)$/i,H=/^\s+|\s+$/g,I=/^data(?:-(_\w+))?(?:-?(-?\d*\.?\d+p?))?(?:-?(start|end|top|center|bottom))?(?:-?(top|center|bottom))?$/,J=/\s*(@?[\w\-\[\]]+)\s*:\s*(.+?)\s*(?:;|$)/gi,K=/^(@?[a-z\-]+)\[(\w+)\]$/,L=/-([a-z0-9_])/g,M=function(a,b){return b.toUpperCase()},N=/[\-+]?[\d]*\.?[\d]+/g,O=/\{\?\}/g,P=/rgba?\(\s*-?\d+\s*,\s*-?\d+\s*,\s*-?\d+/g,Q=/[a-z\-]+-gradient/g,R="",S="",T=function(){var a=/^(?:O|Moz|webkit|ms)|(?:-(?:o|moz|webkit|ms)-)/;if(j){var b=j(f,null);for(var c in b)if(R=c.match(a)||+c==c&&b[c].match(a))break;if(!R)return void(R=S="");R=R[0],"-"===R.slice(0,1)?(S=R,R={"-webkit-":"webkit","-moz-":"Moz","-ms-":"ms","-o-":"O"}[R]):S="-"+R.toLowerCase()+"-"}},U=function(){var b=a.requestAnimationFrame||a[R.toLowerCase()+"RequestAnimationFrame"],c=Ha();return(Sa||!b)&&(b=function(b){var d=Ha()-c,e=i.max(0,1e3/60-d);return a.setTimeout(function(){c=Ha(),b()},e)}),b},V=function(){var b=a.cancelAnimationFrame||a[R.toLowerCase()+"CancelAnimationFrame"];return(Sa||!b)&&(b=function(b){return a.clearTimeout(b)}),b},W={begin:function(){return 0},end:function(){return 1},linear:function(a){return a},quadratic:function(a){return a*a},cubic:function(a){return a*a*a},swing:function(a){return-i.cos(a*i.PI)/2+.5},sqrt:function(a){return i.sqrt(a)},outCubic:function(a){return i.pow(a-1,3)+1},bounce:function(a){var b;if(.5083>=a)b=3;else if(.8489>=a)b=9;else if(.96208>=a)b=27;else{if(!(.99981>=a))return 1;b=91}return 1-i.abs(3*i.cos(a*b*1.028)/b)}};d.prototype.refresh=function(a){var d,e,f=!1;for(a===c?(f=!0,ia=[],Ra=0,a=b.getElementsByTagName("*")):a.length===c&&(a=[a]),d=0,e=a.length;e>d;d++){var g=a[d],h=g,i=[],j=pa,k=ta,l=!1;if(f&&F in g&&delete g[F],g.attributes){for(var m=0,n=g.attributes.length;n>m;m++){var p=g.attributes[m];if("data-anchor-target"!==p.name)if("data-smooth-scrolling"!==p.name)if("data-edge-strategy"!==p.name)if("data-emit-events"!==p.name){var q=p.name.match(I);if(null!==q){var r={props:p.value,element:g,eventType:p.name.replace(L,M)};i.push(r);var s=q[1];s&&(r.constant=s.substr(1));var t=q[2];/p$/.test(t)?(r.isPercentage=!0,r.offset=(0|t.slice(0,-1))/100):r.offset=0|t;var u=q[3],v=q[4]||u;u&&u!==B&&u!==C?(r.mode="relative",r.anchors=[u,v]):(r.mode="absolute",u===C?r.isEnd=!0:r.isPercentage||(r.offset=r.offset*Ka))}}else l=!0;else k=p.value;else j="off"!==p.value;else if(h=b.querySelector(p.value),null===h)throw'Unable to find anchor target "'+p.value+'"'}if(i.length){var w,x,y;!f&&F in g?(y=g[F],w=ia[y].styleAttr,x=ia[y].classAttr):(y=g[F]=Ra++,w=g.style.cssText,x=Da(g)),ia[y]={element:g,styleAttr:w,classAttr:x,anchorTarget:h,keyFrames:i,smoothScrolling:j,edgeStrategy:k,emitEvents:l,lastFrameIndex:-1},Ea(g,[o],[])}}}for(Aa(),d=0,e=a.length;e>d;d++){var z=ia[a[d][F]];z!==c&&(_(z),ba(z))}return ha},d.prototype.relativeToAbsolute=function(a,b,c){var d=e.clientHeight,f=a.getBoundingClientRect(),g=f.top,h=f.bottom-f.top;return b===E?g-=d:b===D&&(g-=d/2),c===E?g+=h:c===D&&(g+=h/2),g+=ha.getScrollTop(),g+.5|0},d.prototype.animateTo=function(a,b){b=b||{};var d=Ha(),e=ha.getScrollTop(),f=b.duration===c?x:b.duration;return oa={startTop:e,topDiff:a-e,targetTop:a,duration:f,startTime:d,endTime:d+f,easing:W[b.easing||w],done:b.done},oa.topDiff||(oa.done&&oa.done.call(ha,!1),oa=c),ha},d.prototype.stopAnimateTo=function(){oa&&oa.done&&oa.done.call(ha,!0),oa=c},d.prototype.isAnimatingTo=function(){return!!oa},d.prototype.isMobile=function(){return Sa},d.prototype.setScrollTop=function(b,c){return sa=c===!0,Sa?Ta=i.min(i.max(b,0),Ja):a.scrollTo(0,b),ha},d.prototype.getScrollTop=function(){return Sa?Ta:a.pageYOffset||e.scrollTop||f.scrollTop||0},d.prototype.getMaxScrollTop=function(){return Ja},d.prototype.on=function(a,b){return ka[a]=b,ha},d.prototype.off=function(a){return delete ka[a],ha},d.prototype.destroy=function(){var a=V();a(va),ya(),Ea(e,[t],[s,u,v]);for(var b=0,d=ia.length;d>b;b++)fa(ia[b].element);e.style.overflow=f.style.overflow="",e.style.height=f.style.height="",ja&&g.setStyle(ja,"transform","none"),ha=c,ja=c,ka=c,la=c,Ja=0,Ka=1,ma=c,na=c,La="down",Ma=-1,Oa=0,Pa=0,Qa=!1,oa=c,pa=c,qa=c,ra=c,sa=c,Ra=0,ta=c,Sa=!1,Ta=0,ua=c};var X=function(){var d,g,h,j,o,p,q,r,s,t,u,v;wa(e,[k,l,m,n].join(" "),function(a){var e=a.changedTouches[0];for(j=a.target;3===j.nodeType;)j=j.parentNode;switch(o=e.clientY,p=e.clientX,t=a.timeStamp,G.test(j.tagName)||a.preventDefault(),a.type){case k:d&&d.blur(),ha.stopAnimateTo(),d=j,g=q=o,h=p,s=t;break;case l:G.test(j.tagName)&&b.activeElement!==j&&a.preventDefault(),r=o-q,v=t-u,ha.setScrollTop(Ta-r,!0),q=o,u=t;break;default:case m:case n:var f=g-o,w=h-p,x=w*w+f*f;if(49>x){if(!G.test(d.tagName)){d.focus();var y=b.createEvent("MouseEvents");y.initMouseEvent("click",!0,!0,a.view,1,e.screenX,e.screenY,e.clientX,e.clientY,a.ctrlKey,a.altKey,a.shiftKey,a.metaKey,0,null),d.dispatchEvent(y)}return}d=c;var z=r/v;z=i.max(i.min(z,3),-3);var A=i.abs(z/na),B=z*A+.5*na*A*A,C=ha.getScrollTop()-B,D=0;C>Ja?(D=(Ja-C)/B,C=Ja):0>C&&(D=-C/B,C=0),A*=1-D,ha.animateTo(C+.5|0,{easing:"outCubic",duration:A})}}),a.scrollTo(0,0),e.style.overflow=f.style.overflow="hidden"},Y=function(){var a,b,c,d,f,g,h,j,k,l,m,n=e.clientHeight,o=Ba();for(j=0,k=ia.length;k>j;j++)for(a=ia[j],b=a.element,c=a.anchorTarget,d=a.keyFrames,f=0,g=d.length;g>f;f++)h=d[f],l=h.offset,m=o[h.constant]||0,h.frame=l,h.isPercentage&&(l*=n,h.frame=l),"relative"===h.mode&&(fa(b),h.frame=ha.relativeToAbsolute(c,h.anchors[0],h.anchors[1])-l,fa(b,!0)),h.frame+=m,la&&!h.isEnd&&h.frame>Ja&&(Ja=h.frame);for(Ja=i.max(Ja,Ca()),j=0,k=ia.length;k>j;j++){for(a=ia[j],d=a.keyFrames,f=0,g=d.length;g>f;f++)h=d[f],m=o[h.constant]||0,h.isEnd&&(h.frame=Ja-h.offset+m);a.keyFrames.sort(Ia)}},Z=function(a,b){for(var c=0,d=ia.length;d>c;c++){var e,f,i=ia[c],j=i.element,k=i.smoothScrolling?a:b,l=i.keyFrames,m=l.length,n=l[0],s=l[l.length-1],t=k<n.frame,u=k>s.frame,v=t?n:s,w=i.emitEvents,x=i.lastFrameIndex;if(t||u){if(t&&-1===i.edge||u&&1===i.edge)continue;switch(t?(Ea(j,[p],[r,q]),w&&x>-1&&(za(j,n.eventType,La),i.lastFrameIndex=-1)):(Ea(j,[r],[p,q]),w&&m>x&&(za(j,s.eventType,La),i.lastFrameIndex=m)),i.edge=t?-1:1,i.edgeStrategy){case"reset":fa(j);continue;case"ease":k=v.frame;break;default:case"set":var y=v.props;for(e in y)h.call(y,e)&&(f=ea(y[e].value),0===e.indexOf("@")?j.setAttribute(e.substr(1),f):g.setStyle(j,e,f));continue}}else 0!==i.edge&&(Ea(j,[o,q],[p,r]),i.edge=0);for(var z=0;m-1>z;z++)if(k>=l[z].frame&&k<=l[z+1].frame){var A=l[z],B=l[z+1];for(e in A.props)if(h.call(A.props,e)){var C=(k-A.frame)/(B.frame-A.frame);C=A.props[e].easing(C),f=da(A.props[e].value,B.props[e].value,C),f=ea(f),0===e.indexOf("@")?j.setAttribute(e.substr(1),f):g.setStyle(j,e,f)}w&&x!==z&&("down"===La?za(j,A.eventType,La):za(j,B.eventType,La),i.lastFrameIndex=z);break}}},$=function(){Qa&&(Qa=!1,Aa());var a,b,d=ha.getScrollTop(),e=Ha();if(oa)e>=oa.endTime?(d=oa.targetTop,a=oa.done,oa=c):(b=oa.easing((e-oa.startTime)/oa.duration),d=oa.startTop+b*oa.topDiff|0),ha.setScrollTop(d,!0);else if(!sa){var f=ra.targetTop-d;f&&(ra={startTop:Ma,topDiff:d-Ma,targetTop:d,startTime:Na,endTime:Na+qa}),e<=ra.endTime&&(b=W.sqrt((e-ra.startTime)/qa),d=ra.startTop+b*ra.topDiff|0)}if(sa||Ma!==d){La=d>Ma?"down":Ma>d?"up":La,sa=!1;var h={curTop:d,lastTop:Ma,maxTop:Ja,direction:La},i=ka.beforerender&&ka.beforerender.call(ha,h);i!==!1&&(Z(d,ha.getScrollTop()),Sa&&ja&&g.setStyle(ja,"transform","translate(0, "+-Ta+"px) "+ua),Ma=d,ka.render&&ka.render.call(ha,h)),a&&a.call(ha,!1)}Na=e},_=function(a){for(var b=0,c=a.keyFrames.length;c>b;b++){for(var d,e,f,g,h=a.keyFrames[b],i={};null!==(g=J.exec(h.props));)f=g[1],e=g[2],d=f.match(K),null!==d?(f=d[1],d=d[2]):d=w,e=e.indexOf("!")?aa(e):[e.slice(1)],i[f]={value:e,easing:W[d]};h.props=i}},aa=function(a){var b=[];return P.lastIndex=0,a=a.replace(P,function(a){return a.replace(N,function(a){return a/255*100+"%"})}),S&&(Q.lastIndex=0,a=a.replace(Q,function(a){return S+a})),a=a.replace(N,function(a){return b.push(+a),"{?}"}),b.unshift(a),b},ba=function(a){var b,c,d={};for(b=0,c=a.keyFrames.length;c>b;b++)ca(a.keyFrames[b],d);for(d={},b=a.keyFrames.length-1;b>=0;b--)ca(a.keyFrames[b],d)},ca=function(a,b){var c;for(c in b)h.call(a.props,c)||(a.props[c]=b[c]);for(c in a.props)b[c]=a.props[c]},da=function(a,b,c){var d,e=a.length;if(e!==b.length)throw"Can't interpolate between \""+a[0]+'" and "'+b[0]+'"';var f=[a[0]];for(d=1;e>d;d++)f[d]=a[d]+(b[d]-a[d])*c;return f},ea=function(a){var b=1;return O.lastIndex=0,a[0].replace(O,function(){return a[b++]})},fa=function(a,b){a=[].concat(a);for(var c,d,e=0,f=a.length;f>e;e++)d=a[e],c=ia[d[F]],c&&(b?(d.style.cssText=c.dirtyStyleAttr,Ea(d,c.dirtyClassAttr)):(c.dirtyStyleAttr=d.style.cssText,c.dirtyClassAttr=Da(d),d.style.cssText=c.styleAttr,E
2a(d,c.classAttr)))},ga=function(){ua="translateZ(0)",g.setStyle(ja,"transform",ua);var a=j(ja),b=a.getPropertyValue("transform"),c=a.getPropertyValue(S+"transform"),d=b&&"none"!==b||c&&"none"!==c;d||(ua="")};g.setStyle=function(a,b,c){var d=a.style;if(b=b.replace(L,M).replace("-",""),"zIndex"===b)isNaN(c)?d[b]=c:d[b]=""+(0|c);else if("float"===b)d.styleFloat=d.cssFloat=c;else try{R&&(d[R+b.slice(0,1).toUpperCase()+b.slice(1)]=c),d[b]=c}catch(e){}};var ha,ia,ja,ka,la,ma,na,oa,pa,qa,ra,sa,ta,ua,va,wa=g.addEvent=function(b,c,d){var e=function(b){return b=b||a.event,b.target||(b.target=b.srcElement),b.preventDefault||(b.preventDefault=function(){b.returnValue=!1,b.defaultPrevented=!0}),d.call(this,b)};c=c.split(" ");for(var f,g=0,h=c.length;h>g;g++)f=c[g],b.addEventListener?b.addEventListener(f,d,!1):b.attachEvent("on"+f,e),Ua.push({element:b,name:f,listener:d})},xa=g.removeEvent=function(a,b,c){b=b.split(" ");for(var d=0,e=b.length;e>d;d++)a.removeEventListener?a.removeEventListener(b[d],c,!1):a.detachEvent("on"+b[d],c)},ya=function(){for(var a,b=0,c=Ua.length;c>b;b++)a=Ua[b],xa(a.element,a.name,a.listener);Ua=[]},za=function(a,b,c){ka.keyframe&&ka.keyframe.call(ha,a,b,c)},Aa=function(){var a=ha.getScrollTop();Ja=0,la&&!Sa&&(f.style.height=""),Y(),la&&!Sa&&(f.style.height=Ja+e.clientHeight+"px"),Sa?ha.setScrollTop(i.min(ha.getScrollTop(),Ja)):ha.setScrollTop(a,!0),sa=!0},Ba=function(){var a,b,c=e.clientHeight,d={};for(a in ma)b=ma[a],"function"==typeof b?b=b.call(ha):/p$/.test(b)&&(b=b.slice(0,-1)/100*c),d[a]=b;return d},Ca=function(){var a,b=0;return ja&&(b=i.max(ja.offsetHeight,ja.scrollHeight)),a=i.max(b,f.scrollHeight,f.offsetHeight,e.scrollHeight,e.offsetHeight,e.clientHeight),a-e.clientHeight},Da=function(b){var c="className";return a.SVGElement&&b instanceof a.SVGElement&&(b=b[c],c="baseVal"),b[c]},Ea=function(b,d,e){var f="className";if(a.SVGElement&&b instanceof a.SVGElement&&(b=b[f],f="baseVal"),e===c)return void(b[f]=d);for(var g=b[f],h=0,i=e.length;i>h;h++)g=Ga(g).replace(Ga(e[h])," ");g=Fa(g);for(var j=0,k=d.length;k>j;j++)-1===Ga(g).indexOf(Ga(d[j]))&&(g+=" "+d[j]);b[f]=Fa(g)},Fa=function(a){return a.replace(H,"")},Ga=function(a){return" "+a+" "},Ha=Date.now||function(){return+new Date},Ia=function(a,b){return a.frame-b.frame},Ja=0,Ka=1,La="down",Ma=-1,Na=Ha(),Oa=0,Pa=0,Qa=!1,Ra=0,Sa=!1,Ta=0,Ua=[];"function"==typeof define&&define.amd?define([],function(){return g}):"undefined"!=typeof module&&module.exports?module.exports=g:a.skrollr=g}(window,document); 3/*! 4 * headroom.js v0.11.0 - Give your page some headroom. Hide your header until you need it 5 * Copyright (c) 2020 Nick Williams - http://wicky.nillia.ms/headroom.js 6 * License: MIT 7 */ 8 9!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(t=t||self).Headroom=n()}(this,function(){"use strict";function t(){return"undefined"!=typeof window}function d(t){return function(t){return t&&t.document&&function(t){return 9===t.nodeType}(t.document)}(t)?function(t){var n=t.document,o=n.body,s=n.documentElement;return{scrollHeight:function(){return Math.max(o.scrollHeight,s.scrollHeight,o.offsetHeight,s.offsetHeight,o.clientHeight,s.clientHeight)},height:function(){return t.innerHeight||s.clientHeight||o.clientHeight},scrollY:function(){return void 0!==t.pageYOffset?t.pageYOffset:(s||o.parentNode||o).scrollTop}}}(t):function(t){return{scrollHeight:function(){return Math.max(t.scrollHeight,t.offsetHeight,t.clientHeight)},height:function(){return Math.max(t.offsetHeight,t.clientHeight)},scrollY:function(){return t.scrollTop}}}(t)}function n(t,s,e){var n,o=function(){var n=!1;try{var t={get passive(){n=!0}};window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch(t){n=!1}return n}(),i=!1,r=d(t),l=r.scrollY(),a={};function c(){var t=Math.round(r.scrollY()),n=r.height(),o=r.scrollHeight();a.scrollY=t,a.lastScrollY=l,a.direction=l<t?"down":"up",a.distance=Math.abs(t-l),a.isOutOfBounds=t<0||o<t+n,a.top=t<=s.offset,a.bottom=o<=t+n,a.toleranceExceeded=a.distance>s.tolerance[a.direction],e(a),l=t,i=!1}function h(){i||(i=!0,n=requestAnimationFrame(c))}var u=!!o&&{passive:!0,capture:!1};return t.addEventListener("scroll",h,u),c(),{destroy:function(){cancelAnimationFrame(n),t.removeEventListener("scroll",h,u)}}}function o(t,n){n=n||{},Object.assign(this,o.options,n),this.classes=Object.assign({},o.options.classes,n.classes),this.elem=t,this.tolerance=function(t){return t===Object(t)?t:{down:t,up:t}}(this.tolerance),this.initialised=!1,this.frozen=!1}return o.prototype={constructor:o,init:function(){return o.cutsTheMustard&&!this.initialised&&(this.addClass("initial"),this.initialised=!0,setTimeout(function(t){t.scrollTracker=n(t.scroller,{offset:t.offset,tolerance:t.tolerance},t.update.bind(t))},100,this)),this},destroy:function(){this.initialised=!1,Object.keys(this.classes).forEac
vendor: 2,122 bytes, line 9
9h(this.removeClass,this),this.scrollTracker.destroy()},unpin:function(){!this.hasClass("pinned")&&this.hasClass("unpinned")||(this.addClass("unpinned"),this.removeClass("pinned"),this.onUnpin&&this.onUnpin.call(this))},pin:function(){this.hasClass("unpinned")&&(this.addClass("pinned"),this.removeClass("unpinned"),this.onPin&&this.onPin.call(this))},freeze:function(){this.frozen=!0,this.addClass("frozen")},unfreeze:function(){this.frozen=!1,this.removeClass("frozen")},top:function(){this.hasClass("top")||(this.addClass("top"),this.removeClass("notTop"),this.onTop&&this.onTop.call(this))},notTop:function(){this.hasClass("notTop")||(this.addClass("notTop"),this.removeClass("top"),this.onNotTop&&this.onNotTop.call(this))},bottom:function(){this.hasClass("bottom")||(this.addClass("bottom"),this.removeClass("notBottom"),this.onBottom&&this.onBottom.call(this))},notBottom:function(){this.hasClass("notBottom")||(this.addClass("notBottom"),this.removeClass("bottom"),this.onNotBottom&&this.onNotBottom.call(this))},shouldUnpin:function(t){return"down"===t.direction&&!t.top&&t.toleranceExceeded},shouldPin:function(t){return"up"===t.direction&&t.toleranceExceeded||t.top},addClass:function(t){this.elem.classList.add.apply(this.elem.classList,this.classes[t].split(" "))},removeClass:function(t){this.elem.classList.remove.apply(this.elem.classList,this.classes[t].split(" "))},hasClass:function(t){return this.classes[t].split(" ").every(function(t){return this.classList.contains(t)},this.elem)},update:function(t){t.isOutOfBounds||!0!==this.frozen&&(t.top?this.top():this.notTop(),t.bottom?this.bottom():this.notBottom(),this.shouldUnpin(t)?this.unpin():this.shouldPin(t)&&this.pin())}},o.options={tolerance:{up:0,down:0},offset:0,scroller:t()?window:null,classes:{frozen:"headroom--frozen",pinned:"headroom--pinned",unpinned:"headroom--unpinned",top:"headroom--top",notTop:"headroom--not-top",bottom:"headroom--bottom",notBottom:"headroom--not-bottom",initial:"headroom"}},o.cutsTheMustard=!!(t()&&function(){}.bind&&"classList"in document.documentElement&&Object.assign&&Object.keys&&requestAnimationFrame),o});
vendor: 15,068 bytes, line 10
10var tns=function(){var t=window,Ai=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.msRequestAnimationFrame||function(t){return setTimeout(t,16)},e=window,Ni=e.cancelAnimationFrame||e.mozCancelAnimationFrame||function(t){clearTimeout(t)};function Li(){for(var t,e,n,i=arguments[0]||{},a=1,r=arguments.length;a<r;a++)if(null!==(t=arguments[a]))for(e in t)i!==(n=t[e])&&void 0!==n&&(i[e]=n);return i}function Bi(t){return 0<=["true","false"].indexOf(t)?JSON.parse(t):t}function Si(t,e,n,i){if(i)try{t.setItem(e,n)}catch(t){}return n}function Hi(){var t=document,e=t.body;return e||((e=t.createElement("body")).fake=!0),e}var n=document.documentElement;function Oi(t){var e="";return t.fake&&(e=n.style.overflow,t.style.background="",t.style.overflow=n.style.overflow="hidden",n.appendChild(t)),e}function Di(t,e){t.fake&&(t.remove(),n.style.overflow=e,n.offsetHeight)}function ki(t,e,n,i){"insertRule"in t?t.insertRule(e+"{"+n+"}",i):t.addRule(e,n,i)}function Ri(t){return("insertRule"in t?t.cssRules:t.rules).length}function Ii(t,e,n){for(var i=0,a=t.length;i<a;i++)e.call(n,t[i],i)}var i="classList"in document.createElement("_"),Pi=i?function(t,e){return t.classList.contains(e)}:function(t,e){return 0<=t.className.indexOf(e)},zi=i?function(t,e){Pi(t,e)||t.classList.add(e)}:function(t,e){Pi(t,e)||(t.className+=" "+e)},Wi=i?function(t,e){Pi(t,e)&&t.classList.remove(e)}:function(t,e){Pi(t,e)&&(t.className=t.className.replace(e,""))};function qi(t,e){return t.hasAttribute(e)}function Fi(t,e){return t.getAttribute(e)}function r(t){return void 0!==t.item}function ji(t,e){if(t=r(t)||t instanceof Array?t:[t],"[object Object]"===Object.prototype.toString.call(e))for(var n=t.length;n--;)for(var i in e)t[n].setAttribute(i,e[i])}function Vi(t,e){t=r(t)||t instanceof Array?t:[t];for(var n=(e=e instanceof Array?e:[e]).length,i=t.length;i--;)for(var a=n;a--;)t[i].removeAttribute(e[a])}function Gi(t){for(var e=[],n=0,i=t.length;n<i;n++)e.push(t[n]);return e}function Qi(t,e){"none"!==t.style.display&&(t.style.display="none")}function Xi(t,e){"none"===t.style.display&&(t.style.display="")}function Yi(t){return"none"!==window.getComputedStyle(t).display}function Ki(e){if("string"==typeof e){var n=[e],i=e.charAt(0).toUpperCase()+e.substr(1);["Webkit","Moz","ms","O"].forEach(function(t){"ms"===t&&"transform"!==e||n.push(t+i)}),e=n}for(var t=document.createElement("fakeelement"),a=(e.length,0);a<e.length;a++){var r=e[a];if(void 0!==t.style[r])return r}return!1}function Ji(t,e){var n=!1;return/^Webkit/.test(t)?n="webkit"+e+"End":/^O/.test(t)?n="o"+e+"End":t&&(n=e.toLowerCase()+"end"),n}var a=!1;try{var o=Object.defineProperty({},"passive",{get:function(){a=!0}});window.addEventListener("test",null,o)}catch(t){}var u=!!a&&{passive:!0};function Ui(t,e,n){for(var i in e){var a=0<=["touchstart","touchmove"].indexOf(i)&&!n&&u;t.addEventListener(i,e[i],a)}}function _i(t,e){for(var n in e){var i=0<=["touchstart","touchmove"].indexOf(n)&&u;t.removeEventListener(n,e[n],i)}}function Zi(){return{topics:{},on:function(t,e){this.topics[t]=this.topics[t]||[],this.topics[t].push(e)},off:function(t,e){if(this.topics[t])for(var n=0;n<this.topics[t].length;n++)if(this.topics[t][n]===e){this.topics[t].splice(n,1);break}},emit:function(e,n){n.type=e,this.topics[e]&&this.topics[e].forEach(function(t){t(n,e)})}}}Object.keys||(Object.keys=function(t){var e=[];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.push(n);return e}),"remove"in Element.prototype||(Element.prototype.remove=function(){this.parentNode&&this.parentNode.removeChild(this)});var $i=function(H){H=Li({container:".slider",mode:"carousel",axis:"horizontal",items:1,gutter:0,edgePadding:0,fixedWidth:!1,autoWidth:!1,viewportMax:!1,slideBy:1,center:!1,controls:!0,controlsPosition:"top",controlsText:["prev","next"],controlsContainer:!1,prevButton:!1,nextButton:!1,nav:!0,navPosition:"top",navContainer:!1,navAsThumbnails:!1,arrowKeys:!1,speed:300,autoplay:!1,autoplayPosition:"top",autoplayTimeout:5e3,autoplayDirection:"forward",autoplayText:["start","stop"],autoplayHoverPause:!1,autoplayButton:!1,autoplayButtonOutput:!0,autoplayResetOnVisibility:!0,animateIn:"tns-fadeIn",animateOut:"tns-fadeOut",animateNormal:"tns-normal",animateDelay:!1,loop:!0,rewind:!1,autoHeight:!1,responsive:!1,lazyload:!1,lazyloadSelector:".tns-lazy-img",touch:!0,mouseDrag:!1,swipeAngle:15,nested:!1,preventActionWhenRunning:!1,preventScrollOnTouch:!1,freezable:!0,onInit:!1,useLocalStorage:!0,nonce:!1},H||{});var O=document,m=window,a={ENTER:13,SPACE:32,LEFT:37,RIGHT:39},e={},n=H.useLocalStorage;if(n){var t=navigator.userAgent,i=new Date;try{(e=m.localStorage)?(e.setItem(i,i),n=e.getItem(i)==i,e.removeItem(i)):n=!1,n||(e={})}catch(t){n=!1}n&&(e.tnsApp&&e.tnsApp!==t&&["tC","tPL","tMQ","tTf","t3D","tTDu","tTDe","tADu","tADe","tTE","tAE"].forEach(function(t){e.removeItem(t)}),localStorage.tnsApp=t)}var y=e.tC?Bi(e.tC):Si(e,"tC",function(){var t=document,e=Hi(),n=Oi(e),i=t.createElement("div"),a=!1;e.appendChild(i);try{for(var r,o="(10px * 10)",u=["calc"+o,"-moz-calc"+o,"-webkit-calc"+o],l=0;l<3;l++)if(r=u[l],i.style.width=r,100===i.offsetWidth){a=r.replace(o,"");break}}catch(t){}return e.fake?Di(e,n):i.remove(),a}(),n),g=e.tPL?Bi(e.tPL):Si(e,"tPL",function(){var t,e=document,n=Hi(),i=Oi(n),a=e.createElement("div"),r=e.createElement("div"),o="";a.className="tns-t-subp2",r.className="tns-t-ct";for(var u=0;u<70;u++)o+="<div></div>";return r.innerHTML=o,a.appendChild(r),n.appendChild(a),t=Math.abs(a.getBoundingClientRect().left-r.children[67].getBoundingClientRect().left)<2,n.fake?Di(n,i):a.remove(),t}(),n),D=e.tMQ?Bi(e.tMQ):Si(e,"tMQ",function(){if(window.matchMedia||window.msMatchMedia)return!0;var t,e=document,n=Hi(),i=Oi(n),a=e.createElement("div"),r=e.createElement("style"),o="@media all and (min-width:1px){.tns-mq-test{position:absolute}}";return r.type="text/css",a.className="tns-mq-test",n.appendChild(r),n.appendChild(a),r.styleSheet?r.styleSheet.cssText=o:r.appendChild(e.createTextNode(o)),t=window.getComputedStyle?window.getComputedStyle(a).position:a.currentStyle.position,n.fake?Di(n,i):a.remove(),"absolute"===t}(),n),r=e.tTf?Bi(e.tTf):Si(e,"tTf",Ki("transform"),n),o=e.t3D?Bi(e.t3D):Si(e,"t3D",function(t){if(!t)return!1;if(!window.getComputedStyle)return!1;var e,n=document,i=Hi(),a=Oi(i),r=n.createElement("p"),o=9<t.length?"-"+t.slice(0,-9).toLowerCase()+"-":"";return o+="transform",i.insertBefore(r,null),r.style[t]="translate3d(1px,1px,1px)",e=window.getComputedStyle(r).getPropertyValue(o),i.fake?Di(i,a):r.remove(),void 0!==e&&0<e.length&&"none"!==e}(r),n),x=e.tTDu?Bi(e.tTDu):Si(e,"tTDu",Ki("transitionDuration"),n),u=e.tTDe?Bi(e.tTDe):Si(e,"tTDe",Ki("transitionDelay"),n),b=e.tADu?Bi(e.tADu):Si(e,"tADu",Ki("animationDuration"),n),l=e.tADe?Bi(e.tADe):Si(e,"tADe",Ki("animationDelay"),n),s=e.tTE?Bi(e.tTE):Si(e,"tTE",Ji(x,"Transition"),n),c=e.tAE?Bi(e.tAE):Si(e,"tAE",Ji(b,"Animation"),n),f=m.console&&"function"==typeof m.console.warn,d=["container","controlsContainer","prevButton","nextButton","navContainer","autoplayButton"],v={};if(d.forEach(function(t){if("string"==typeof H[t]){var e=H[t],n=O.querySelector(e);if(v[t]=e,!n||!n.nodeName)return void(f&&console.warn("Can't find",H[t]));H[t]=n}}),!(H.container.children.length<1)){var k=H.responsive,R=H.nested,I="carousel"===H.mode;if(k){0 in k&&(H=Li(H,k[0]),delete k[0]);var p={};for(var h in k){var w=k[h];w="number"==typeof w?{items:w}:w,p[h]=w}k=p,p=null}if(I||function t(e){for(var n in e)I||("slideBy"===n&&(e[n]="page"),"edgePadding"===n&&(e[n]=!1),"autoHeight"===n&&(e[n]=!1)),"responsive"===n&&t(e[n])}(H),!I){H.axis="horizontal",H.slideBy="page",H.edgePadding=!1;var P=H.animateIn,z=H.animateOut,C=H.animateDelay,W=H.animateNormal}var M,q,F="horizontal"===H.axis,T=O.createElement("div"),j=O.createElement("div"),V=H.container,E=V.parentNode,A=V.outerHTML,G=V.children,Q=G.length,X=rn(),Y=!1;k&&En(),I&&(V.className+=" tns-vpfix");var N,L,B,S,K,J,U,_,Z,$=H.autoWidth,tt=sn("fixedWidth"),et=sn("edgePadding"),nt=sn("gutter"),it=un(),at=sn("center"),rt=$?1:Math.floor(sn("items")),ot=sn("slideBy"),ut=H.viewportMax||H.fixedWidthViewportWidth,lt=sn("arrowKeys"),st=sn("speed"),ct=H.rewind,ft=!ct&&H.loop,dt=sn("autoHeight"),vt=sn("controls"),pt=sn("controlsText"),ht=sn("nav"),mt=sn("touch"),yt=sn("mouseDrag"),gt=sn("autoplay"),xt=sn("autoplayTimeout"),bt=sn("autoplayText"),wt=sn("autoplayHoverPause"),Ct=sn("autoplayResetOnVisibility"),Mt=(U=null,_=sn("nonce"),Z=document.createElement("style"),U&&Z.setAttribute("media",U),_&&Z.setAttribute("nonce",_),document.querySelector("head").appendChild(Z),Z.sheet?Z.sheet:Z.styleSheet),Tt=H.lazyload,Et=H.lazyloadSelector,At=[],Nt=ft?(K=function(){{if($||tt&&!ut)return Q-1;var t=tt?"fixedWidth":"items",e=[];if((tt||H[t]<Q)&&e.push(H[t]),k)for(var n in k){var i=k[n][t];i&&(tt||i<Q)&&e.push(i)}return e.length||e.push(0),Math.ceil(tt?ut/Math.min.apply(null,e):Math.max.apply(null,e))}}(),J=I?Math.ceil((5*K-Q)/2):4*K-Q,J=Math.max(K,J),ln("edgePadding")?J+1:J):0,Lt=I?Q+2*Nt:Q+Nt,Bt=!(!tt&&!$||ft),St=tt?_n():null,Ht=!I||!ft,Ot=F?"left":"top",Dt="",kt="",Rt=tt?function(){return at&&!ft?Q-1:Math.ceil(-St/(tt+nt))}:$?function(){for(var t=0;t<Lt;t++)if(N[t]>=-St)return t}:function(){return at&&I&&!ft?Q-1:ft||I?Math.max(0,Lt-Math.ceil(rt)):Lt-1},It=en(sn("startIndex")),Pt=It,zt=(tn(),0),Wt=$?null:Rt(),qt=H.preventActionWhenRunning,Ft=H.swipeAngle,jt=!Ft||"?",Vt=!1,Gt=H.onInit,Qt=new Zi,Xt=" tns-slider tns-"+H.mode,Yt=V.id||(S=window.tnsId,window.tnsId=S?S+1:1,"tns"+window.tnsId),Kt=sn("disable"),Jt=!1,Ut=H.freezable,_t=!(!Ut||$)&&Tn(),Zt=!1,$t={click:oi,keydown:function(t){t=pi(t);var e=[a.LEFT,a.RIGHT].indexOf(t.keyCode);0<=e&&(0===e?we.disabled||oi(t,-1):Ce.disabled||oi(t,1))}},te={click:function(t){if(Vt){if(qt)return;ai()}var e=hi(t=pi(t));for(;e!==Ae&&!qi(e,"data-nav");)e=e.parentNode;if(qi(e,"data-nav")){var n=Se=Number(Fi(e,"data-nav")),i=tt||$?n*Q/Le:n*rt,a=le?n:Math.min(Math.ceil(i),Q-1);ri(a,t),He===n&&(Pe&&fi(),Se=-1)}},keydown:function(t){t=pi(t);var e=O.activeElement;if(!qi(e,"data-nav"))return;var n=[a.LEFT,a.RIGHT,a.ENTER,a.SPACE].indexOf(t.keyCode),i=Number(Fi(e,"data-nav"));0<=n&&(0===n?0<i&&vi(Ee[i-1]):1===n?i<Le-1&&vi(Ee[i+1]):ri(Se=i,t))}},ee={mouseover:function(){Pe&&(li(),ze=!0)},mouseout:function(){ze&&(ui(),ze=!1)}},ne={visibilitychange:function(){O.hidden?Pe&&(li(),qe=!0):qe&&(ui(),qe=!1)}},ie={keydown:function(t){t=pi(t);var e=[a.LEFT,a.RIGHT].indexOf(t.keyCode);0<=e&&oi(t,0===e?-1:1)}},ae={touchstart:xi,touchmove:bi,touchend:wi,touchcancel:wi},re={mousedown:xi,mousemove:bi,mouseup:wi,mouseleave:wi},oe=ln("controls"),ue=ln("nav"),le=!!$||H.navAsThumbnails,se=ln("autoplay"),ce=ln("touch"),fe=ln("mouseDrag"),de="tns-slide-active",ve="tns-slide-cloned",pe="tns-complete",he={load:function(t){kn(hi(t))},error:function(t){e=hi(t),zi(e,"failed"),Rn(e);var e}},me="force"===H.preventScrollOnTouch;if(oe)var ye,ge,xe=H.controlsContainer,be=H.controlsContainer?H.controlsContainer.outerHTML:"",we=H.prevButton,Ce=H.nextButton,Me=H.prevButton?H.prevButton.outerHTML:"",Te=H.nextButton?H.nextButton.outerHTML:"";if(ue)var Ee,Ae=H.navContainer,Ne=H.navContainer?H.navContainer.outerHTML:"",Le=$?Q:Mi(),Be=0,Se=-1,He=an(),Oe=He,De="tns-nav-active",ke="Carousel Page ",Re=" (Current Slide)";if(se)var Ie,Pe,ze,We,qe,Fe="forward"===H.autoplayDirection?1:-1,je=H.autoplayButton,Ve=H.autoplayButton?H.autoplayButton.outerHTML:"",Ge=["<span class='tns-visually-hidden'>"," animation</span>"];if(ce||fe)var Qe,Xe,Ye={},Ke={},Je=!1,Ue=F?function(t,e){return t.x-e.x}:function(t,e){return t.y-e.y};$||$e(Kt||_t),r&&(Ot=r,Dt="translate",o?(Dt+=F?"3d(":"3d(0px, ",kt=F?", 0px, 0px)":", 0px)"):(Dt+=F?"X(":"Y(",kt=")")),I&&(V.className=V.className.replace("tns-vpfix","")),function(){ln("gutter");T.className="tns-outer",j.className="tns-inner",T.id=Yt+"-ow",j.id=Yt+"-iw",""===V.id&&(V.id=Yt);Xt+=g||$?" tns-subpixel":" tns-no-subpixel",Xt+=y?" tns-calc":" tns-no-calc",$&&(Xt+=" tns-autowidth");Xt+=" tns-"+H.axis,V.className+=Xt,I?((M=O.createElement("div")).id=Yt+"-mw",M.className="tns-ovh",T.appendChild(M),M.appendChild(j)):T.appendChild(j);if(dt){var t=M||j;t.className+=" tns-ah"}if(E.insertBefore(T,V),j.appendChild(V),Ii(G,function(t,e){zi(t,"tns-item"),t.id||(t.id=Yt+"-item"+e),!I&&W&&zi(t,W),ji(t,{"aria-hidden":"true",tabindex:"-1"})}),Nt){for(var e=O.createDocumentFragment(),n=O.createDocumentFragment(),i=Nt;i--;){var a=i%Q,r=G[a].cloneNode(!0);if(zi(r,ve),Vi(r,"id"),n.insertBefore(r,n.firstChild),I){var o=G[Q-1-a].cloneNode(!0);zi(o,ve),Vi(o,"id"),e.appendChild(o)}}V.insertBefore(e,V.firstChild),V.appendChild(n),G=V.children}}(),function(){if(!I)for(var t=It,e=It+Math.min(Q,rt);t<e;t++){var n=G[t];n.style.left=100*(t-It)/rt+"%",zi(n,P),Wi(n,W)}F&&(g||$?(ki(Mt,"#"+Yt+" > .tns-item","font-size:"+m.getComputedStyle(G[0]).fontSize+";",Ri(Mt)),ki(Mt,"#"+Yt,"font-size:0;",Ri(Mt))):I&&Ii(G,function(t,e){var n;t.style.marginLeft=(n=e,y?y+"("+100*n+"% / "+Lt+")":100*n/Lt+"%")}));if(D){if(x){var i=M&&H.autoHeight?hn(H.speed):"";ki(Mt,"#"+Yt+"-mw",i,Ri(Mt))}i=cn(H.edgePadding,H.gutter,H.fixedWidth,H.speed,H.autoHeight),ki(Mt,"#"+Yt+"-iw",i,Ri(Mt)),I&&(i=F&&!$?"width:"+fn(H.fixedWidth,H.gutter,H.items)+";":"",x&&(i+=hn(st)),ki(Mt,"#"+Yt,i,Ri(Mt))),i=F&&!$?dn(H.fixedWidth,H.gutter,H.items):"",H.gutter&&(i+=vn(H.gutter)),I||(x&&(i+=hn(st)),b&&(i+=mn(st))),i&&ki(Mt,"#"+Yt+" > .tns-item",i,Ri(Mt))}else{I&&dt&&(M.style[x]=st/1e3+"s"),j.style.cssText=cn(et,nt,tt,dt),I&&F&&!$&&(V.style.width=fn(tt,nt,rt));var i=F&&!$?dn(tt,nt,rt):"";nt&&(i+=vn(nt)),i&&ki(Mt,"#"+Yt+" > .tns-item",i,Ri(Mt))}if(k&&D)for(var a in k){a=parseInt(a);var r=k[a],i="",o="",u="",l="",s="",c=$?null:sn("items",a),f=sn("fixedWidth",a),d=sn("speed",a),v=sn("edgePadding",a),p=sn("autoHeight",a),h=sn("gutter",a);x&&M&&sn("autoHeight",a)&&"speed"in r&&(o="#"+Yt+"-mw{"+hn(d)+"}"),("edgePadding"in r||"gutter"in r)&&(u="#"+Yt+"-iw{"+cn(v,h,f,d,p)+"}"),I&&F&&!$&&("fixedWidth"in r||"items"in r||tt&&"gutter"in r)&&(l="width:"+fn(f,h,c)+";"),x&&"speed"in r&&(l+=hn(d)),l&&(l="#"+Yt+"{"+l+"}"),("fixedWidth"in r||tt&&"gutter"in r||!I&&"items"in r)&&(s+=dn(f,h,c)),"gutter"in r&&(s+=vn(h)),!I&&"speed"in r&&(x&&(s+=hn(d)),b&&(s+=mn(d))),s&&(s="#"+Yt+" > .tns-item{"+s+"}"),(i=o+u+l+s)&&Mt.insertRule("@media (min-width: "+a/16+"em) {"+i+"}",Mt.cssRules.length)}}(),yn();var _e=ft?I?function(){var t=zt,e=Wt;t+=ot,e-=ot,et?(t+=1,e-=1):tt&&(it+nt)%(tt+nt)&&(e-=1),Nt&&(e<It?It-=Q:It<t&&(It+=Q))}:function(){if(Wt<It)for(;zt+Q<=It;)It-=Q;else if(It<zt)for(;It<=Wt-Q;)It+=Q}:function(){It=Math.max(zt,Math.min(Wt,It))},Ze=I?function(){var e,n,i,a,t,r,o,u,l,s,c;Jn(V,""),x||!st?(ti(),st&&Yi(V)||ai()):(e=V,n=Ot,i=Dt,a=kt,t=Zn(),r=st,o=ai,u=Math.min(r,10),l=0<=t.indexOf("%")?"%":"px",t=t.replace(l,""),s=Number(e.style[n].replace(i,"").replace(a,"").replace(l,"")),c=(t-s)/r*u,setTimeout(function t(){r-=u,s+=c,e.style[n]=i+s+l+a,0<r?setTimeout(t,u):o()},u)),F||Ci()}:function(){At=[];var t={};t[s]=t[c]=ai,_i(G[Pt],t),Ui(G[It],t),ei(Pt,P,z,!0),ei(It,W,P),s&&c&&st&&Yi(V)||ai()};return{version:"2.9.
103
vendor: 16,842 bytes, line 10
10",getInfo:Ei,events:Qt,goTo:ri,play:function(){gt&&!Pe&&(ci(),We=!1)},pause:function(){Pe&&(fi(),We=!0)},isOn:Y,updateSliderHeight:Fn,refresh:yn,destroy:function(){if(Mt.disabled=!0,Mt.ownerNode&&Mt.ownerNode.remove(),_i(m,{resize:Cn}),lt&&_i(O,ie),xe&&_i(xe,$t),Ae&&_i(Ae,te),_i(V,ee),_i(V,ne),je&&_i(je,{click:di}),gt&&clearInterval(Ie),I&&s){var t={};t[s]=ai,_i(V,t)}mt&&_i(V,ae),yt&&_i(V,re);var r=[A,be,Me,Te,Ne,Ve];for(var e in d.forEach(function(t,e){var n="container"===t?T:H[t];if("object"==typeof n&&n){var i=!!n.previousElementSibling&&n.previousElementSibling,a=n.parentNode;n.outerHTML=r[e],H[t]=i?i.nextElementSibling:a.firstElementChild}}),d=P=z=C=W=F=T=j=V=E=A=G=Q=q=X=$=tt=et=nt=it=rt=ot=ut=lt=st=ct=ft=dt=Mt=Tt=N=At=Nt=Lt=Bt=St=Ht=Ot=Dt=kt=Rt=It=Pt=zt=Wt=Ft=jt=Vt=Gt=Qt=Xt=Yt=Kt=Jt=Ut=_t=Zt=$t=te=ee=ne=ie=ae=re=oe=ue=le=se=ce=fe=de=pe=he=L=vt=pt=xe=be=we=Ce=ye=ge=ht=Ae=Ne=Ee=Le=Be=Se=He=Oe=De=ke=Re=gt=xt=Fe=bt=wt=je=Ve=Ct=Ge=Ie=Pe=ze=We=qe=Ye=Ke=Qe=Je=Xe=Ue=mt=yt=null,this)"rebuild"!==e&&(this[e]=null);Y=!1},rebuild:function(){return $i(Li(H,v))}}}function $e(t){t&&(vt=ht=mt=yt=lt=gt=wt=Ct=!1)}function tn(){for(var t=I?It-Nt:It;t<0;)t+=Q;return t%Q+1}function en(t){return t=t?Math.max(0,Math.min(ft?Q-1:Q-rt,t)):0,I?t+Nt:t}function nn(t){for(null==t&&(t=It),I&&(t-=Nt);t<0;)t+=Q;return Math.floor(t%Q)}function an(){var t,e=nn();return t=le?e:tt||$?Math.ceil((e+1)*Le/Q-1):Math.floor(e/rt),!ft&&I&&It===Wt&&(t=Le-1),t}function rn(){return m.innerWidth||O.documentElement.clientWidth||O.body.clientWidth}function on(t){return"top"===t?"afterbegin":"beforeend"}function un(){var t=et?2*et-nt:0;return function t(e){if(null!=e){var n,i,a=O.createElement("div");return e.appendChild(a),i=(n=a.getBoundingClientRect()).right-n.left,a.remove(),i||t(e.parentNode)}}(E)-t}function ln(t){if(H[t])return!0;if(k)for(var e in k)if(k[e][t])return!0;return!1}function sn(t,e){if(null==e&&(e=X),"items"===t&&tt)return Math.floor((it+nt)/(tt+nt))||1;var n=H[t];if(k)for(var i in k)e>=parseInt(i)&&t in k[i]&&(n=k[i][t]);return"slideBy"===t&&"page"===n&&(n=sn("items")),I||"slideBy"!==t&&"items"!==t||(n=Math.floor(n)),n}function cn(t,e,n,i,a){var r="";if(void 0!==t){var o=t;e&&(o-=e),r=F?"margin: 0 "+o+"px 0 "+t+"px;":"margin: "+t+"px 0 "+o+"px 0;"}else if(e&&!n){var u="-"+e+"px";r="margin: 0 "+(F?u+" 0 0":"0 "+u+" 0")+";"}return!I&&a&&x&&i&&(r+=hn(i)),r}function fn(t,e,n){return t?(t+e)*Lt+"px":y?y+"("+100*Lt+"% / "+n+")":100*Lt/n+"%"}function dn(t,e,n){var i;if(t)i=t+e+"px";else{I||(n=Math.floor(n));var a=I?Lt:n;i=y?y+"(100% / "+a+")":100/a+"%"}return i="width:"+i,"inner"!==R?i+";":i+" !important;"}function vn(t){var e="";!1!==t&&(e=(F?"padding-":"margin-")+(F?"right":"bottom")+": "+t+"px;");return e}function pn(t,e){var n=t.substring(0,t.length-e).toLowerCase();return n&&(n="-"+n+"-"),n}function hn(t){return pn(x,18)+"transition-duration:"+t/1e3+"s;"}function mn(t){return pn(b,17)+"animation-duration:"+t/1e3+"s;"}function yn(){if(ln("autoHeight")||$||!F){var t=V.querySelectorAll("img");Ii(t,function(t){var e=t.src;Tt||(e&&e.indexOf("data:image")<0?(t.src="",Ui(t,he),zi(t,"loading"),t.src=e):kn(t))}),Ai(function(){zn(Gi(t),function(){L=!0})}),ln("autoHeight")&&(t=In(It,Math.min(It+rt-1,Lt-1))),Tt?gn():Ai(function(){zn(Gi(t),gn)})}else I&&$n(),bn(),wn()}function gn(){if($&&1<Q){var i=ft?It:Q-1;!function t(){var e=G[i].getBoundingClientRect().left,n=G[i-1].getBoundingClientRect().right;Math.abs(e-n)<=1?xn():setTimeout(function(){t()},16)}()}else xn()}function xn(){F&&!$||(jn(),$?(St=_n(),Ut&&(_t=Tn()),Wt=Rt(),$e(Kt||_t)):Ci()),I&&$n(),bn(),wn()}function bn(){if(Vn(),T.insertAdjacentHTML("afterbegin",'<div class="tns-liveregion tns-visually-hidden" aria-live="polite" aria-atomic="true">slide <span class="current">'+Hn()+"</span> of "+Q+"</div>"),B=T.querySelector(".tns-liveregion .current"),se){var t=gt?"stop":"start";je?ji(je,{"data-action":t}):H.autoplayButtonOutput&&(T.insertAdjacentHTML(on(H.autoplayPosition),'<button type="button" data-action="'+t+'">'+Ge[0]+t+Ge[1]+bt[0]+"</button>"),je=T.querySelector("[data-action]")),je&&Ui(je,{click:di}),gt&&(ci(),wt&&Ui(V,ee),Ct&&Ui(V,ne))}if(ue){if(Ae)ji(Ae,{"aria-label":"Carousel Pagination"}),Ii(Ee=Ae.children,function(t,e){ji(t,{"data-nav":e,tabindex:"-1","aria-label":ke+(e+1),"aria-controls":Yt})});else{for(var e="",n=le?"":'style="display:none"',i=0;i<Q;i++)e+='<button type="button" data-nav="'+i+'" tabindex="-1" aria-controls="'+Yt+'" '+n+' aria-label="'+ke+(i+1)+'"></button>';e='<div class="tns-nav" aria-label="Carousel Pagination">'+e+"</div>",T.insertAdjacentHTML(on(H.navPosition),e),Ae=T.querySelector(".tns-nav"),Ee=Ae.children}if(Ti(),x){var a=x.substring(0,x.length-18).toLowerCase(),r="transition: all "+st/1e3+"s";a&&(r="-"+a+"-"+r),ki(Mt,"[aria-controls^="+Yt+"-item]",r,Ri(Mt))}ji(Ee[He],{"aria-label":ke+(He+1)+Re}),Vi(Ee[He],"tabindex"),zi(Ee[He],De),Ui(Ae,te)}oe&&(xe||we&&Ce||(T.insertAdjacentHTML(on(H.controlsPosition),'<div class="tns-controls" aria-label="Carousel Navigation" tabindex="0"><button type="button" data-controls="prev" tabindex="-1" aria-controls="'+Yt+'">'+pt[0]+'</button><button type="button" data-controls="next" tabindex="-1" aria-controls="'+Yt+'">'+pt[1]+"</button></div>"),xe=T.querySelector(".tns-controls")),we&&Ce||(we=xe.children[0],Ce=xe.children[1]),H.controlsContainer&&ji(xe,{"aria-label":"Carousel Navigation",tabindex:"0"}),(H.controlsContainer||H.prevButton&&H.nextButton)&&ji([we,Ce],{"aria-controls":Yt,tabindex:"-1"}),(H.controlsContainer||H.prevButton&&H.nextButton)&&(ji(we,{"data-controls":"prev"}),ji(Ce,{"data-controls":"next"})),ye=Qn(we),ge=Qn(Ce),Kn(),xe?Ui(xe,$t):(Ui(we,$t),Ui(Ce,$t))),An()}function wn(){if(I&&s){var t={};t[s]=ai,Ui(V,t)}mt&&Ui(V,ae,H.preventScrollOnTouch),yt&&Ui(V,re),lt&&Ui(O,ie),"inner"===R?Qt.on("outerResized",function(){Mn(),Qt.emit("innerLoaded",Ei())}):(k||tt||$||dt||!F)&&Ui(m,{resize:Cn}),dt&&("outer"===R?Qt.on("innerLoaded",Pn):Kt||Pn()),Dn(),Kt?Bn():_t&&Ln(),Qt.on("indexChanged",Wn),"inner"===R&&Qt.emit("innerLoaded",Ei()),"function"==typeof Gt&&Gt(Ei()),Y=!0}function Cn(t){Ai(function(){Mn(pi(t))})}function Mn(t){if(Y){"outer"===R&&Qt.emit("outerResized",Ei(t)),X=rn();var e,n=q,i=!1;k&&(En(),(e=n!==q)&&Qt.emit("newBreakpointStart",Ei(t)));var a,r,o,u,l=rt,s=Kt,c=_t,f=lt,d=vt,v=ht,p=mt,h=yt,m=gt,y=wt,g=Ct,x=It;if(e){var b=tt,w=dt,C=pt,M=at,T=bt;if(!D)var E=nt,A=et}if(lt=sn("arrowKeys"),vt=sn("controls"),ht=sn("nav"),mt=sn("touch"),at=sn("center"),yt=sn("mouseDrag"),gt=sn("autoplay"),wt=sn("autoplayHoverPause"),Ct=sn("autoplayResetOnVisibility"),e&&(Kt=sn("disable"),tt=sn("fixedWidth"),st=sn("speed"),dt=sn("autoHeight"),pt=sn("controlsText"),bt=sn("autoplayText"),xt=sn("autoplayTimeout"),D||(et=sn("edgePadding"),nt=sn("gutter"))),$e(Kt),it=un(),F&&!$||Kt||(jn(),F||(Ci(),i=!0)),(tt||$)&&(St=_n(),Wt=Rt()),(e||tt)&&(rt=sn("items"),ot=sn("slideBy"),(r=rt!==l)&&(tt||$||(Wt=Rt()),_e())),e&&Kt!==s&&(Kt?Bn():function(){if(!Jt)return;if(Mt.disabled=!1,V.className+=Xt,$n(),ft)for(var t=Nt;t--;)I&&Xi(G[t]),Xi(G[Lt-t-1]);if(!I)for(var e=It,n=It+Q;e<n;e++){var i=G[e],a=e<It+rt?P:W;i.style.left=100*(e-It)/rt+"%",zi(i,a)}Nn(),Jt=!1}()),Ut&&(e||tt||$)&&(_t=Tn())!==c&&(_t?(ti(Zn(en(0))),Ln()):(!function(){if(!Zt)return;et&&D&&(j.style.margin="");if(Nt)for(var t="tns-transparent",e=Nt;e--;)I&&Wi(G[e],t),Wi(G[Lt-e-1],t);Nn(),Zt=!1}(),i=!0)),$e(Kt||_t),gt||(wt=Ct=!1),lt!==f&&(lt?Ui(O,ie):_i(O,ie)),vt!==d&&(vt?xe?Xi(xe):(we&&Xi(we),Ce&&Xi(Ce)):xe?Qi(xe):(we&&Qi(we),Ce&&Qi(Ce))),ht!==v&&(ht?(Xi(Ae),Ti()):Qi(Ae)),mt!==p&&(mt?Ui(V,ae,H.preventScrollOnTouch):_i(V,ae)),yt!==h&&(yt?Ui(V,re):_i(V,re)),gt!==m&&(gt?(je&&Xi(je),Pe||We||ci()):(je&&Qi(je),Pe&&fi())),wt!==y&&(wt?Ui(V,ee):_i(V,ee)),Ct!==g&&(Ct?Ui(O,ne):_i(O,ne)),e){if(tt===b&&at===M||(i=!0),dt!==w&&(dt||(j.style.height="")),vt&&pt!==C&&(we.innerHTML=pt[0],Ce.innerHTML=pt[1]),je&&bt!==T){var N=gt?1:0,L=je.innerHTML,B=L.length-T[N].length;L.substring(B)===T[N]&&(je.innerHTML=L.substring(0,B)+bt[N])}}else at&&(tt||$)&&(i=!0);if((r||tt&&!$)&&(Le=Mi(),Ti()),(a=It!==x)?(Qt.emit("indexChanged",Ei()),i=!0):r?a||Wn():(tt||$)&&(Dn(),Vn(),Sn()),r&&!I&&function(){for(var t=It+Math.min(Q,rt),e=Lt;e--;){var n=G[e];It<=e&&e<t?(zi(n,"tns-moving"),n.style.left=100*(e-It)/rt+"%",zi(n,P),Wi(n,W)):n.style.left&&(n.style.left="",zi(n,W),Wi(n,P)),Wi(n,z)}setTimeout(function(){Ii(G,function(t){Wi(t,"tns-moving")})},300)}(),!Kt&&!_t){if(e&&!D&&(et===A&&nt===E||(j.style.cssText=cn(et,nt,tt,st,dt)),F)){I&&(V.style.width=fn(tt,nt,rt));var S=dn(tt,nt,rt)+vn(nt);u=Ri(o=Mt)-1,"deleteRule"in o?o.deleteRule(u):o.removeRule(u),ki(Mt,"#"+Yt+" > .tns-item",S,Ri(Mt))}dt&&Pn(),i&&($n(),Pt=It)}e&&Qt.emit("newBreakpointEnd",Ei(t))}}function Tn(){if(!tt&&!$)return Q<=(at?rt-(rt-1)/2:rt);var t=tt?(tt+nt)*Q:N[Q],e=et?it+2*et:it+nt;return at&&(e-=tt?(it-tt)/2:(it-(N[It+1]-N[It]-nt))/2),t<=e}function En(){for(var t in q=0,k)(t=parseInt(t))<=X&&(q=t)}function An(){!gt&&je&&Qi(je),!ht&&Ae&&Qi(Ae),vt||(xe?Qi(xe):(we&&Qi(we),Ce&&Qi(Ce)))}function Nn(){gt&&je&&Xi(je),ht&&Ae&&Xi(Ae),vt&&(xe?Xi(xe):(we&&Xi(we),Ce&&Xi(Ce)))}function Ln(){if(!Zt){if(et&&(j.style.margin="0px"),Nt)for(var t="tns-transparent",e=Nt;e--;)I&&zi(G[e],t),zi(G[Lt-e-1],t);An(),Zt=!0}}function Bn(){if(!Jt){if(Mt.disabled=!0,V.className=V.className.replace(Xt.substring(1),""),Vi(V,["style"]),ft)for(var t=Nt;t--;)I&&Qi(G[t]),Qi(G[Lt-t-1]);if(F&&I||Vi(j,["style"]),!I)for(var e=It,n=It+Q;e<n;e++){var i=G[e];Vi(i,["style"]),Wi(i,P),Wi(i,W)}An(),Jt=!0}}function Sn(){var t=Hn();B.innerHTML!==t&&(B.innerHTML=t)}function Hn(){var t=On(),e=t[0]+1,n=t[1]+1;return e===n?e+"":e+" to "+n}function On(t){null==t&&(t=Zn());var n,i,a,r=It;if(at||et?($||tt)&&(i=-(parseFloat(t)+et),a=i+it+2*et):$&&(i=N[It],a=i+it),$)N.forEach(function(t,e){e<Lt&&((at||et)&&t<=i+.5&&(r=e),.5<=a-t&&(n=e))});else{if(tt){var e=tt+nt;at||et?(r=Math.floor(i/e),n=Math.ceil(a/e-1)):n=r+Math.ceil(it/e)-1}else if(at||et){var o=rt-1;if(at?(r-=o/2,n=It+o/2):n=It+o,et){var u=et*rt/it;r-=u,n+=u}r=Math.floor(r),n=Math.ceil(n)}else n=r+rt-1;r=Math.max(r,0),n=Math.min(n,Lt-1)}return[r,n]}function Dn(){if(Tt&&!Kt){var t=On();t.push(Et),In.apply(null,t).forEach(function(t){if(!Pi(t,pe)){var e={};e[s]=function(t){t.stopPropagation()},Ui(t,e),Ui(t,he),t.src=Fi(t,"data-src");var n=Fi(t,"data-srcset");n&&(t.srcset=n),zi(t,"loading")}})}}function kn(t){zi(t,"loaded"),Rn(t)}function Rn(t){zi(t,pe),Wi(t,"loading"),_i(t,he)}function In(t,e,n){var i=[];for(n||(n="img");t<=e;)Ii(G[t].querySelectorAll(n),function(t){i.push(t)}),t++;return i}function Pn(){var t=In.apply(null,On());Ai(function(){zn(t,Fn)})}function zn(n,t){return L?t():(n.forEach(function(t,e){!Tt&&t.complete&&Rn(t),Pi(t,pe)&&n.splice(e,1)}),n.length?void Ai(function(){zn(n,t)}):t())}function Wn(){Dn(),Vn(),Sn(),Kn(),function(){if(ht&&(He=0<=Se?Se:an(),Se=-1,He!==Oe)){var t=Ee[Oe],e=Ee[He];ji(t,{tabindex:"-1","aria-label":ke+(Oe+1)}),Wi(t,De),ji(e,{"aria-label":ke+(He+1)+Re}),Vi(e,"tabindex"),zi(e,De),Oe=He}}()}function qn(t,e){for(var n=[],i=t,a=Math.min(t+e,Lt);i<a;i++)n.push(G[i].offsetHeight);return Math.max.apply(null,n)}function Fn(){var t=dt?qn(It,rt):qn(Nt,Q),e=M||j;e.style.height!==t&&(e.style.height=t+"px")}function jn(){N=[0];var n=F?"left":"top",i=F?"right":"bottom",a=G[0].getBoundingClientRect()[n];Ii(G,function(t,e){e&&N.push(t.getBoundingClientRect()[n]-a),e===Lt-1&&N.push(t.getBoundingClientRect()[i]-a)})}function Vn(){var t=On(),n=t[0],i=t[1];Ii(G,function(t,e){n<=e&&e<=i?qi(t,"aria-hidden")&&(Vi(t,["aria-hidden","tabindex"]),zi(t,de)):qi(t,"aria-hidden")||(ji(t,{"aria-hidden":"true",tabindex:"-1"}),Wi(t,de))})}function Gn(t){return t.nodeName.toLowerCase()}function Qn(t){return"button"===Gn(t)}function Xn(t){return"true"===t.getAttribute("aria-disabled")}function Yn(t,e,n){t?e.disabled=n:e.setAttribute("aria-disabled",n.toString())}function Kn(){if(vt&&!ct&&!ft){var t=ye?we.disabled:Xn(we),e=ge?Ce.disabled:Xn(Ce),n=It<=zt,i=!ct&&Wt<=It;n&&!t&&Yn(ye,we,!0),!n&&t&&Yn(ye,we,!1),i&&!e&&Yn(ge,Ce,!0),!i&&e&&Yn(ge,Ce,!1)}}function Jn(t,e){x&&(t.style[x]=e)}function Un(t){return null==t&&(t=It),$?(it-(et?nt:0)-(N[t+1]-N[t]-nt))/2:tt?(it-tt)/2:(rt-1)/2}function _n(){var t=it+(et?nt:0)-(tt?(tt+nt)*Lt:N[Lt]);return at&&!ft&&(t=tt?-(tt+nt)*(Lt-1)-Un():Un(Lt-1)-N[Lt-1]),0<t&&(t=0),t}function Zn(t){var e;if(null==t&&(t=It),F&&!$)if(tt)e=-(tt+nt)*t,at&&(e+=Un());else{var n=r?Lt:rt;at&&(t-=Un()),e=100*-t/n}else e=-N[t],at&&$&&(e+=Un());return Bt&&(e=Math.max(e,St)),e+=!F||$||tt?"px":"%"}function $n(t){Jn(V,"0s"),ti(t)}function ti(t){null==t&&(t=Zn()),V.style[Ot]=Dt+t+kt}function ei(t,e,n,i){var a=t+rt;ft||(a=Math.min(a,Lt));for(var r=t;r<a;r++){var o=G[r];i||(o.style.left=100*(r-It)/rt+"%"),C&&u&&(o.style[u]=o.style[l]=C*(r-t)/1e3+"s"),Wi(o,e),zi(o,n),i&&At.push(o)}}function ni(t,e){Ht&&_e(),(It!==Pt||e)&&(Qt.emit("indexChanged",Ei()),Qt.emit("transitionStart",Ei()),dt&&Pn(),Pe&&t&&0<=["click","keydown"].indexOf(t.type)&&fi(),Vt=!0,Ze())}function ii(t){return t.toLowerCase().replace(/-/g,"")}function ai(t){if(I||Vt){if(Qt.emit("transitionEnd",Ei(t)),!I&&0<At.length)for(var e=0;e<At.length;e++){var n=At[e];n.style.left="",l&&u&&(n.style[l]="",n.style[u]=""),Wi(n,z),zi(n,W)}if(!t||!I&&t.target.parentNode===V||t.target===V&&ii(t.propertyName)===ii(Ot)){if(!Ht){var i=It;_e(),It!==i&&(Qt.emit("indexChanged",Ei()),$n())}"inner"===R&&Qt.emit("innerLoaded",Ei()),Vt=!1,Pt=It}}}function ri(t,e){if(!_t)if("prev"===t)oi(e,-1);else if("next"===t)oi(e,1);else{if(Vt){if(qt)return;ai()}var n=nn(),i=0;if("first"===t?i=-n:"last"===t?i=I?Q-rt-n:Q-1-n:("number"!=typeof t&&(t=parseInt(t)),isNaN(t)||(e||(t=Math.max(0,Math.min(Q-1,t))),i=t-n)),!I&&i&&Math.abs(i)<rt){var a=0<i?1:-1;i+=zt<=It+i-Q?Q*a:2*Q*a*-1}It+=i,I&&ft&&(It<zt&&(It+=Q),Wt<It&&(It-=Q)),nn(It)!==nn(Pt)&&ni(e)}}function oi(t,e){if(Vt){if(qt)return;ai()}var n;if(!e){for(var i=hi(t=pi(t));i!==xe&&[we,Ce].indexOf(i)<0;)i=i.parentNode;var a=[we,Ce].indexOf(i);0<=a&&(n=!0,e=0===a?-1:1)}if(ct){if(It===zt&&-1===e)return void ri("last",t);if(It===Wt&&1===e)return void ri("first",t)}e&&(It+=ot*e,$&&(It=Math.floor(It)),ni(n||t&&"keydown"===t.type?t:null))}function ui(){Ie=setInterval(function(){oi(null,Fe)},xt),Pe=!0}function li(){clearInterval(Ie),Pe=!1}function si(t,e){ji(je,{"data-action":t}),je.innerHTML=Ge[0]+t+Ge[1]+e}function ci(){ui(),je&&si("stop",bt[1])}function fi(){li(),je&&si("start",bt[0])}function di(){Pe?(fi(),We=!0):(ci(),We=!1)}function vi(t){t.focus()}function pi(t){return mi(t=t||m.event)?t.changedTouches[0]:t}function hi(t){return t.target||m.event.srcElement}function mi(t){return 0<=t.type.indexOf("touch")}function yi(t){t.preventDefault?t.preventDefault():t.returnValue=!1}function gi(){return a=Ke.y-Ye.y,r=Ke.x-Ye.x,t=Math.atan2(a,r)*(180/Math.PI),e=Ft,n=!1,i=Math.abs(90-Math.abs(t)),90-e<=i?n="horizontal":i<=e&&(n="vertical"),n===H.axis;var t,e,n,i,a,r}function xi(t){if(Vt){if(qt)return;ai()}gt&&Pe&&li(),Je=!0,Xe&&(Ni(Xe),Xe=null);var e=pi(t);Qt.emit(mi(t)?"touchStart":"dragStart",Ei(t)),!mi(t)&&0<=["img","a"].indexOf(Gn(hi(t)))&&yi(t),Ke.x=Ye.x=e.clientX,Ke.y=Ye.y=e.clientY,I&&(Qe=parseFloat(V.style[Ot].replace(Dt,"")),Jn(V,"0s"))}function bi(t){if(Je){var e=pi(t);Ke.x=e.clientX,Ke.y=e.clientY,I?Xe||(Xe=Ai(function(){!function t(e){if(!jt)return void(Je=!1);Ni(Xe);Je&&(Xe=Ai(function(){t(e)}));"?"===jt&&(jt=gi());if(jt){!me&&mi(e)&&(me=!0);try{e.type&&Qt.emit(mi(e)?"touchMove":"dragMove",Ei(e))}catch(t){}var n=Qe,i=Ue(Ke,Ye);if(!F||tt||$)n+=i,n+="px";else{var a=r?i*rt*100/((it+nt)*Lt):100*i/(it+nt);n+=a,n+="%"}V.style[Ot]=Dt+n+kt}}(t)})):("?"===jt&&(jt=gi()),jt&&(me=!0)),("boolean"!=typeof t.cancelable||t.cancelable)&&me&&t.preventDefault()}}function wi(i){if(Je){Xe&&(Ni(Xe),Xe=null),I&&Jn(V,""),Je=!1;var t=pi(i);Ke.x=t.clientX,Ke.y=t.clientY;var a=Ue(Ke,Ye);if(Math.abs(a)){if(!mi(i)){var n=hi(i);Ui(n,{click:function t(e){yi(e),_i(n,{click:t})}})}I?Xe=Ai(function(){if(F&&!$){var t=-a*rt/(it+nt);t=0<a?Math.floor(t):Math.ceil(t),It+=t}else{var e=-(Qe+a);if(e<=0)It=zt;else if(e>=N[Lt-1])It=Wt;else for(var n=0;n<Lt&&e>=N[n];)e>N[It=n]&&a<0&&(It+=1),n++}ni(i,a),Qt.emit(mi(i)?"touchEnd":"dragEnd",Ei(i))}):jt&&oi(i,0<a?-1:1)}}"auto"===H.preventScrollOnTouch&&(me=!1),Ft&&(jt="?"),gt&&!Pe&&ui()}function Ci(){(M||j).style.height=N[It+rt]-N[It]+"px"}function Mi(){var t=tt?(tt+nt)*Q/it:Q/rt;return Math.min(Math.ceil(t),Q)}function Ti(){if(ht&&!le&&Le!==Be){var t=Be,e=Le,n=Xi;for(Le<Be&&(t=Le,e=Be,n=Qi);t<e;)n(Ee[t]),t++;Be=Le}}function Ei(t){return{container:V,slideItems:G,navContainer:Ae,navItems:Ee,controlsContainer:xe,hasControls:oe,prevButton:we,nextButton:Ce,items:rt,slideBy:ot,cloneCount:Nt,slideCount:Q,slideCountNew:Lt,index:It,indexCached:Pt,displayIndex:tn(),navCurrentIndex:He,navCurrentIndexCached:Oe,pages:Le,pagesCached:Be,sheet:Mt,isOn:Y,event:t||{}}}f&&console.warn("No slides found in",H.container)};return $i}();
vendor: 15,805 bytes, lines 10-19
10 11//# sourceMappingURL=../sourcemaps/tiny-slider.js.map 12 13/**! 14 * lightgallery.js | 1.4.0 | October 13th 2020 15 * http://sachinchoolur.github.io/lightgallery.js/ 16 * Copyright (c) 2016 Sachin N; 17 * @license GPLv3 18 */ 19!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.Lightgallery=e()}}(function(){var e,t,s;return function(){function e(t,s,l){function i(r,a){if(!s[r]){if(!t[r]){var d="function"==typeof require&&require;if(!a&&d)return d(r,!0);if(o)return o(r,!0);var n=new Error("Cannot find module '"+r+"'");throw n.code="MODULE_NOT_FOUND",n}var u=s[r]={exports:{}};t[r][0].call(u.exports,function(e){return i(t[r][1][e]||e)},u,u.exports,e,t,s,l)}return s[r].exports}for(var o="function"==typeof require&&require,r=0;r<l.length;r++)i(l[r]);return i}return e}()({1:[function(t,s,l){!function(t,s){if("function"==typeof e&&e.amd)e(["exports"],s);else if(void 0!==l)s(l);else{var i={exports:{}};s(i.exports),t.lgUtils=i.exports}}(this,function(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var t={getAttribute:function e(t,s){return t[s]},setAttribute:function e(t,s,l){t[s]=l},wrap:function e(t,s){if(t){var l=document.createElement("div");l.className=s,t.parentNode.insertBefore(l,t),t.parentNode.removeChild(t),l.appendChild(t)}},addClass:function e(t,s){t&&(t.classList?t.classList.add(s):t.className+=" "+s)},removeClass:function e(t,s){t&&(t.classList?t.classList.remove(s):t.className=t.className.replace(new RegExp("(^|\\b)"+s.split(" ").join("|")+"(\\b|$)","gi")," "))},hasClass:function e(t,s){return t.classList?t.classList.contains(s):new RegExp("(^| )"+s+"( |$)","gi").test(t.className)},setVendor:function e(t,s,l){t&&(t.style[s.charAt(0).toLowerCase()+s.slice(1)]=l,t.style["webkit"+s]=l,t.style["moz"+s]=l,t.style["ms"+s]=l,t.style["o"+s]=l)},trigger:function e(t,s){var l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(t){var i=new CustomEvent(s,{detail:l});t.dispatchEvent(i)}},Listener:{uid:0},on:function e(s,l,i){var o=this;s&&l.split(" ").forEach(function(e){var l=o.getAttribute(s,"lg-event-uid")||"";t.Listener.uid++,l+="&"+t.Listener.uid,o.setAttribute(s,"lg-event-uid",l),t.Listener[e+t.Listener.uid]=i,s.addEventListener(e.split(".")[0],i,!1)})},off:function e(s,l){if(s){var i=this.getAttribute(s,"lg-event-uid");if(i){i=i.split("&");for(var o=0;o<i.length;o++)if(i[o]){var r=l+i[o];if("."===r.substring(0,1))for(var a in t.Listener)t.Listener.hasOwnProperty(a)&&a.split(".").indexOf(r.split(".")[1])>-1&&(s.removeEventListener(a.split(".")[0],t.Listener[a]),this.setAttribute(s,"lg-event-uid",this.getAttribute(s,"lg-event-uid").replace("&"+i[o],"")),delete t.Listener[a]);else s.removeEventListener(r.split(".")[0],t.Listener[r]),this.setAttribute(s,"lg-event-uid",this.getAttribute(s,"lg-event-uid").replace("&"+i[o],"")),delete t.Listener[r]}}}},param:function e(t){return Object.keys(t).map(function(e){return encodeURIComponent(e)+"="+encodeURIComponent(t[e])}).join("&")}};e.default=t})},{}],2:[function(t,s,l){!function(s,i){if("function"==typeof e&&e.amd)e(["./lg-utils"],i);else if(void 0!==l)i(t("./lg-utils"));else{var o={exports:{}};i(s.lgUtils),s.lightgallery=o.exports}}(this,function(e){"use strict";function t(e){return e&&e.__esModule?e:{default:e}}function s(e,t){if(this.el=e,this.s=i({},o,t),this.s.dynamic&&"undefined"!==this.s.dynamicEl&&this.s.dynamicEl.constructor===Array&&!this.s.dynamicEl.length)throw"When using dynamic mode, you must also define dynamicEl as an Array.";return this.modules={},this.lGalleryOn=!1,this.lgBusy=!1,this.hideBartimeout=!1,this.isTouch="ontouchstart"in document.documentElement,this.s.slideEndAnimatoin&&(this.s.hideControlOnEnd=!1),this.items=[],this.s.dynamic?this.items=this.s.dynamicEl:"this"===this.s.selector?this.items.push(this.el):""!==this.s.selector?this.s.selectWithin?this.items=document.querySelector(this.s.selectWithin).querySelectorAll(this.s.selector):this.items=this.el.querySelectorAll(this.s.selector):this.items=this.el.children,this.___slide="",this.outer="",this.init(),this}var l=t(e),i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var l in s)Object.prototype.hasOwnProperty.call(s,l)&&(e[l]=s[l])}return e};!function(){function e(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};var s=document.createEvent("CustomEvent");return s.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),s}if("function"==typeof window.CustomEvent)return!1;e.prototype=window.Event.prototype,window.CustomEvent=e}(),window.utils=l.default,window.lgData={uid:0},window.lgModules={};var o={mode:"lg-slide",cssEasing:"ease",easing:"linear",speed:600,height:"100%",width:"100%",addClass:"",startClass:"lg-start-zoom",backdropDuration:150,hideBarsDelay:6e3,useLeft:!1,ariaLabelledby:"",ariaDescribedby:"",closable:!0,loop:!0,escKey:!0,keyPress:!0,controls:!0,slideEndAnimatoin:!0,hideControlOnEnd:!1,mousewheel:!1,getCaptionFromTitleOrAlt:!0,appendSubHtmlTo:".lg-sub-html",subHtmlSelectorRelative:!1,preload:1,showAfterLoad:!0,selector:"",selectWithin:"",nextHtml:"",prevHtml:"",index:!1,iframeMaxWidth:"100%",download:!0,counter:!0,appendCounterTo:".lg-toolbar",swipeThreshold:50,enableSwipe:!0,enableDrag:!0,dynamic:!1,dynamicEl:[],galleryId:1,supportLegacyBrowser:!0};s.prototype.init=function(){var e=this;e.s.preload>e.items.length&&(e.s.preload=e.items.length);var t=window.location.hash;if(t.indexOf("lg="+this.s.galleryId)>0&&(e.index=parseInt(t.split("&slide=")[1],10),l.default.addClass(document.body,"lg-from-hash"),l.default.hasClass(document.body,"lg-on")||(l.default.addClass(document.body,"lg-on"),setTimeout(function(){e.build(e.index)}))),e.s.dynamic)l.default.trigger(this.el,"onBeforeOpen"),e.index=e.s.index||0,l.default.hasClass(document.body,"lg-on")||(l.default.addClass(document.body,"lg-on"),setTimeout(function(){e.build(e.index)}));else for(var s=0;s<e.items.length;s++)!function(t){l.default.on(e.items[t],"click.lgcustom",function(s){s.preventDefault(),l.default.trigger(e.el,"onBeforeOpen"),e.index=e.s.index||t,l.default.hasClass(document.body,"lg-on")||(e.build(e.index),l.default.addClass(document.body,"lg-on"))})}(s)},s.prototype.build=function(e){var t=this;t.structure();for(var s in window.lgModules)t.modules[s]=new window.lgModules[s](t.el);if(t.slide(e,!1,!1),t.s.keyPress&&t.keyPress(),t.items.length>1&&(t.arrow(),setTimeout(function(){t.enableDrag(),t.enableSwipe()},50),t.s.mousewheel&&t.mousewheel()),t.counter(),t.closeGallery(),l.default.trigger(t.el,"onAfterOpen"),t.s.hideBarsDelay>0){var i=setTimeout(function(){l.default.addClass(t.outer,"lg-hide-items")},t.s.hideBarsDelay);l.default.on(t.outer,"mousemove.lg click.lg touchstart.lg",function(){clearTimeout(i),l.default.removeClass(t.outer,"lg-hide-items"),clearTimeout(t.hideBartimeout),t.hideBartimeout=setTimeout(function(){l.default.addClass(t.outer,"lg-hide-items")},t.s.hideBarsDelay)})}},s.prototype.structure=function(){var e="",t="",s=0,i="",o,r=this;for(document.body.insertAdjacentHTML("beforeend",'<div class="lg-backdrop"></div>'),l.default.setVendor(document.querySelector(".lg-backdrop"),"TransitionDuration",this.s.backdropDuration+"ms"),s=0;s<this.items.length;s++)e+='<div class="lg-item"></div>';if(this.s.controls&&this.items.length>1&&(t='<div class="lg-actions"><button type="button" aria-label="Previous slide" class="lg-prev lg-icon">'+this.s.prevHtml+'</button><button type="button" aria-label="Next slide" class="lg-next lg-icon">'+this.s.nextHtml+"</button></div>"),".lg-sub-html"===this.s.appendSubHtmlTo&&(i='<div role="status" aria-live="polite" class="lg-sub-html"></div>'),o='<div tabindex="-1" aria-modal="true" '+(this.s.ariaLabelledby?'aria-labelledby="'+this.s.ariaLabelledby+'"':"")+" "+(this.s.ariaDescribedby?'aria-describedby="'+this.s.ariaDescribedby+'"':"")+' role="dialog" class="lg-outer '+this.s.addClass+" "+this.s.startClass+'"><div class="lg" style="width:'+this.s.width+"; height:"+this.s.height+'"><div class="lg-inner">'+e+'</div><div class="lg-toolbar lg-group"><button type="button" aria-label="Close gallery" class="lg-close lg-icon"></button></div>'+t+i+"</div></div>",document.body.insertAdjacentHTML("beforeend",o),this.outer=document.querySelector(".lg-outer"),this.outer.focus(),this.___slide=this.outer.querySelectorAll(".lg-item"),this.s.useLeft?(l.default.addClass(this.outer,"lg-use-left"),this.s.mode="lg-slide"):l.default.addClass(this.outer,"lg-use-css3"),r.setTop(),l.default.on(window,"resize.lg orientationchange.lg",function(){setTimeout(function(){r.setTop()},100)}),l.default.addClass(this.___slide[this.index],"lg-current"),this.doCss()?l.default.addClass(this.outer,"lg-css3"):(l.default.addClass(this.outer,"lg-css"),this.s.speed=0),l.default.addClass(this.outer,this.s.mode),this.s.enableDrag&&this.items.length>1&&l.default.addClass(this.outer,"lg-grab"),this.s.showAfterLoad&&l.default.addClass(this.outer,"lg-show-after-load"),this.doCss()){var a=this.outer.querySelector(".lg-inner");l.default.setVendor(a,"TransitionTimingFunction",this.s.cssEasing),l.default.setVendor(a,"TransitionDuration",this.s.speed+"ms")}setTimeout(function(){l.default.addClass(document.querySelector(".lg-backdrop"),"in")}),setTimeout(function(){l.default.addClass(r.outer,"lg-visible")},this.s.backdropDuration),this.s.download&&this.outer.querySelector(".lg-toolbar").insertAdjacentHTML("beforeend",'<a id="lg-download" aria-label="Download" target="_blank" download class="lg-download lg-icon"></a>'),this.prevScrollTop=document.documentElement.scrollTop||document.body.scrollTop},s.prototype.setTop=function(){if("100%"!==this.s.height){var e=window.innerHeight,t=(e-parseInt(this.s.height,10))/2,s=this.outer.querySelector(".lg");e>=parseInt(this.s.height,10)?s.style.top=t+"px":s.style.top="0px"}},s.prototype.doCss=function(){return!!function e(){var t=["transition","MozTransition","WebkitTransition","OTransition","msTransition","KhtmlTransition"],s=document.documentElement,l=0;for(l=0;l<t.length;l++)if(t[l]in s.style)return!0}()},s.prototype.isVideo=function(e,t){var s;if(s=this.s.dynamic?this.s.dynamicEl[t].html:this.items[t].getAttribute("data-html"),!e&&s)return{html5:!0};var l=e.match(/\/\/(?:www\.)?youtu(?:\.be|be\.com|be-nocookie\.com)\/(?:watch\?v=|embed\/)?([a-z0-9\-\_\%]+)/i),i=e.match(/\/\/(?:www\.)?vimeo.com\/([0-9a-z\-_]+)/i),o=e.match(/\/\/(?:www\.)?dai.ly\/([0-9a-z\-_]+)/i),r=e.match(/\/\/(?:www\.)?(?:vk\.com|vkontakte\.ru)\/(?:video_ext\.php\?)(.*)/i);return l?{youtube:l}:i?{vimeo:i}:o?{dailymotion:o}:r?{vk:r}:void 0},s.prototype.counter=function(){this.s.counter&&this.outer.querySelector(this.s.appendCounterTo).insertAdjacentHTML("beforeend",'<div id="lg-counter" role="status" aria-live="polite"><span id="lg-counter-current">'+(parseInt(this.index,10)+1)+'</span> / <span id="lg-counter-all">'+this.items.length+"</span></div>")},s.prototype.addHtml=function(e){var t=null,s;if(this.s.dynamic?t=this.s.dynamicEl[e].subHtml:(s=this.items[e],t=s.getAttribute("data-sub-html"),this.s.getCaptionFromTitleOrAlt&&!t&&(t=s.getAttribute("title"))&&s.querySelector("img")&&(t=s.querySelector("img").getAttribute("alt"))),void 0!==t&&null!==t){var i=t.substring(0,1);"."!==i&&"#"!==i||(t=this.s.subHtmlSelectorRelative&&!this.s.dynamic?s.querySelector(t).innerHTML:document.querySelector(t).innerHTML)}else t="";".lg-sub-html"===this.s.appendSubHtmlTo?this.outer.querySelector(this.s.appendSubHtmlTo).innerHTML=t:this.___slide[e].insertAdjacentHTML("beforeend",t),void 0!==t&&null!==t&&(""===t?l.default.addClass(this.outer.querySelector(this.s.appendSubHtmlTo),"lg-empty-html"):l.default.removeClass(this.outer.querySelector(this.s.appendSubHtmlTo),"lg-empty-html")),l.default.trigger(this.el,"onAfterAppendSubHtml",{index:e})},s.prototype.preload=function(e){var t=1,s=1;for(t=1;t<=this.s.preload&&!(t>=this.items.length-e);t++)this.loadContent(e+t,!1,0);for(s=1;s<=this.s.preload&&!(e-s<0);s++)this.loadContent(e-s,!1,0)},s.prototype.loadContent=function(e,t,s){var i=this,o=!1,r,a,d,n,u,c,g,f=function e(t){for(var s=[],l=[],i=0;i<t.length;i++){var o=t[i].split(" ");""===o[0]&&o.splice(0,1),l.push(o[0]),s.push(o[1])}for(var r=window.innerWidth,d=0;d<s.length;d++)if(parseInt(s[d],10)>r){a=l[d];break}};if(i.s.dynamic){if(i.s.dynamicEl[e].poster&&(o=!0,d=i.s.dynamicEl[e].poster),c=i.s.dynamicEl[e].html,a=i.s.dynamicEl[e].src,g=i.s.dynamicEl[e].alt,i.s.dynamicEl[e].responsive){f(i.s.dynamicEl[e].responsive.split(","))}n=i.s.dynamicEl[e].srcset,u=i.s.dynamicEl[e].sizes}else{if(i.items[e].getAttribute("data-poster")&&(o=!0,d=i.items[e].getAttribute("data-poster")),c=i.items[e].getAttribute("data-html"),a=i.items[e].getAttribute("href")||i.items[e].getAttribute("data-src"),g=i.items[e].getAttribute("title"),i.items[e].querySelector("img")&&(g=g||i.items[e].querySelector("img").getAttribute("alt")),i.items[e].getAttribute("data-responsive")){f(i.items[e].getAttribute("data-responsive").split(","))}n=i.items[e].getAttribute("data-srcset"),u=i.items[e].getAttribute("data-sizes")}var h=!1;i.s.dynamic?i.s.dynamicEl[e].iframe&&(h=!0):"true"===i.items[e].getAttribute("data-iframe")&&(h=!0);var m=i.isVideo(a,e);if(!l.default.hasClass(i.___slide[e],"lg-loaded")){if(h)i.___slide[e].insertAdjacentHTML("afterbegin",'<div class="lg-video-cont" style="max-width:'+i.s.iframeMaxWidth+'"><div class="lg-video"><iframe class="lg-object" frameborder="0" src="'+a+'" allowfullscreen="true"></iframe></div></div>');else if(o){var p="";p=m&&m.youtube?"lg-has-youtube":m&&m.vimeo?"lg-has-vimeo":"lg-has-html5",i.___slide[e].insertAdjacentHTML("beforeend",'<div class="lg-video-cont '+p+' "><div class="lg-video"><span class="lg-video-play"></span><img class="lg-object lg-has-poster" src="'+d+'" /></div></div>')}else m?(i.___slide[e].insertAdjacentHTML("beforeend",'<div class="lg-video-cont "><div class="lg-video"></div></div>'),l.default.trigger(i.el,"hasVideo",{index:e,src:a,html:c})):(g=g?'alt="'+g+'"':"",i.___slide[e].insertAdjacentHTML("beforeend",'<div class="lg-img-wrap"><img class="lg-object lg-image" '+g+' src="'+a+'" /></div>'));if(l.default.trigger(i.el,"onAferAppendSlide",{index:e}),r=i.___slide[e].querySelector(".lg-object"),u&&r.setAttribute("sizes",u),n&&(r.setAttribute("srcset",n),this.s.supportLegacyBrowser))try{picturefill({elements:[r[0]]})}catch(e){console.warn("If you want srcset to be supported for older browsers, please include picturefil javascript library in your document.")}".lg-sub-html"!==this.s.appendSubHtmlTo&&i.addHtml(e),l.default.addClass(i.___slide[e],"lg-loaded")}l.default.on(i.___slide[e].querySelector(".lg-object"),"load.lg error.lg",function(){var t=0;s&&!l.default.hasClass(document.body,"lg-from-hash")&&(t=s),setTimeout(function(){l.default.addClass(i.___slide[e],"lg-complete"),l.default.trigger(i.el,"onSlideItemLoad",{index:e,delay:s||0})},t)}),m&&m.html5&&!o&&l.default.addClass(i.___slide[e],"lg-complete"),!0===t&&(l.default.hasClass(i.___slide[e],"lg-complete")?i.preload(e):l.default.on(i.___slide[e].querySelector(".lg-object"),"load.lg error.lg",function(){i.preload(e)}))},s.prototype.slide=function(e,t,s){for(var i=0,o=0;o<this.___slide.length;o++)if(l.default.hasClass(this.___slide[o],"lg-current")){i=o;break}var r=this;if(!r.lGalleryOn||i!==e){var a=this.___slide.length,d=r.lGalleryOn?this.s.speed:0,n=!1,u=!1;if(!r.lgBusy){if(this.s.download){var c;c=r.s.dynamic?!1!==r.s.dynamicEl[e].downloadUrl&&(r.s.dynamicEl[e].downloadUrl||r.s.dynamicEl[e].src):"false"!==r.items[e].getAttribute("data-download-url")&&(r.items[e].getAttribute("data-download-url")||r.items[e].getAttribute("href")||r.items[e].getAttribute("data-src")),c?(document.getElementById("lg-
19download").setAttribute("href",c),l.default.removeClass(r.outer,"lg-hide-download")):l.default.addClass(r.outer,"lg-hide-download")}if(l.default.trigger(r.el,"onBeforeSlide",{prevIndex:i,index:e,fromTouch:t,fromThumb:s}),r.lgBusy=!0,clearTimeout(r.hideBartimeout),".lg-sub-html"===this.s.appendSubHtmlTo&&setTimeout(function(){r.addHtml(e)},d),this.arrowDisable(e),t){var g=e-1,f=e+1;0===e&&i===a-1?(f=0,g=a-1):e===a-1&&0===i&&(f=0,g=a-1),l.default.removeClass(r.outer.querySelector(".lg-prev-slide"),"lg-prev-slide"),l.default.removeClass(r.outer.querySelector(".lg-current"),"lg-current"),l.default.removeClass(r.outer.querySelector(".lg-next-slide"),"lg-next-slide"),l.default.addClass(r.___slide[g],"lg-prev-slide"),l.default.addClass(r.___slide[f],"lg-next-slide"),l.default.addClass(r.___slide[e],"lg-current")}else{l.default.addClass(r.outer,"lg-no-trans");for(var h=0;h<this.___slide.length;h++)l.default.removeClass(this.___slide[h],"lg-prev-slide"),l.default.removeClass(this.___slide[h],"lg-next-slide");e<i?(u=!0,0!==e||i!==a-1||s||(u=!1,n=!0)):e>i&&(n=!0,e!==a-1||0!==i||s||(u=!0,n=!1)),u?(l.default.addClass(this.___slide[e],"lg-prev-slide"),l.default.addClass(this.___slide[i],"lg-next-slide")):n&&(l.default.addClass(this.___slide[e],"lg-next-slide"),l.default.addClass(this.___slide[i],"lg-prev-slide")),setTimeout(function(){l.default.removeClass(r.outer.querySelector(".lg-current"),"lg
19-current"),l.default.addClass(r.___slide[e],"lg-current"),l.default.removeClass(r.outer,"lg-no-trans")},50)}r.lGalleryOn?(setTimeout(function(){r.loadContent(e,!0,0)},this.s.speed+50),setTimeout(function(){r.lgBusy=!1,l.default.trigger(r.el,"onAfterSlide",{prevIndex:i,index:e,fromTouch:t,fromThumb:s})},this.s.speed)):(r.loadContent(e,!0,r.s.backdropDuration),r.lgBusy=!1,l.default.trigger(r.el,"onAfterSlide",{prevIndex:i,index:e,fromTouch:t,fromThumb:s})),r.lGalleryOn=!0,this.s.counter&&document.getElementById("lg-counter-current")&&(document.getElementById("lg-counter-current").innerHTML=e+1)}}},s.prototype.goToNextSlide=function(e){var t=this;t.lgBusy||(t.index+1<t.___slide.length?(t.index++,l.default.trigger(t.el,"onBeforeNextSlide",{index:t.index}),t.slide(t.index,e,!1)):t.s.loop?(t.index=0,l.default.trigger(t.el,"onBeforeNextSlide",{index:t.index}),t.slide(t.index,e,!1)):t.s.slideEndAnimatoin&&(l.default.addClass(t.outer,"lg-right-end"),setTimeout(function(){l.default.removeClass(t.outer,"lg-right-end")},400)))},s.prototype.goToPrevSlide=function(e){var t=this;t.lgBusy||(t.index>0?(t.index--,l.default.trigger(t.el,"onBeforePrevSlide",{index:t.index,fromTouch:e}),t.slide(t.index,e,!1)):t.s.loop?(t.index=t.items.length-1,l.default.trigger(t.el,"onBeforePrevSlide",{index:t.index,fromTouch:e}),t.slide(t.index,e,!1)):t.s.slideEndAnimatoin&&(l.default.addClass(t.outer,"lg-left-end"),setTimeout(function(){l.default.removeClass(t.outer,"lg-left-end")},400)))},s.prototype.keyPress=function(){var e=this;this.items.length>1&&l.default.on(window,"keyup.lg",function(t){e.items.length>1&&(37===t.keyCode&&(t.preventDefault(),e.goToPrevSlide()),39===t.keyCode&&(t.preventDefault(),e.goToNextSlide()))}),l.default.on(window,"keydown.lg",function(t){!0===e.s.escKey&&27===t.keyCode&&(t.preventDefault(),l.default.hasClass(e.outer,"lg-thumb-open")?l.default.removeClass(e.outer,"lg-thumb-open"):e.destroy())})},s.prototype.arrow=function(){var e=this;l.default.on(this.outer.querySelector(".lg-prev"),"click.lg",function(){e.goToPrevSlide()}),l.default.on(this.outer.querySelector(".lg-next"),"click.lg",function(){e.goToNextSlide()})},s.prototype.arrowDisable=function(e){if(!this.s.loop&&this.s.hideControlOnEnd){var t=this.outer.querySelector(".lg-next"),s=this.outer.querySelector(".lg-prev");e+1<this.___slide.length?(t.removeAttribute("disabled"),l.default.removeClass(t,"disabled")):(t.setAttribute("disabled","disabled"),l.default.addClass(t,"disabled")),e>0?(s.removeAttribute("disabled"),l.default.removeClass(s,"disabled")):(s.setAttribute("disabled","disabled"),l.default.addClass(s,"disabled"))}},s.prototype.setTranslate=function(e,t,s){this.s.useLeft?e.style.left=t:l.default.setVendor(e,"Transform","translate3d("+t+"px, "+s+"px, 0px)")},s.prototype.touchMove=function(e,t){var s=t-e;Math.abs(s)>15&&(l.default.addClass(this.outer,"lg-dragging"),this.setTranslate(this.___slide[this.index],s,0),this.setTranslate(document.querySelector(".lg-prev-slide"),-this.___slide[this.index].clientWidth+s,0),this.setTranslate(document.querySelector(".lg-next-slide"),this.___slide[this.index].clientWidth+s,0))},s.prototype.touchEnd=function(e){var t=this;"lg-slide"!==t.s.mode&&l.default.addClass(t.outer,"lg-slide");for(var s=0;s<this.___slide.length;s++)l.default.hasClass(this.___slide[s],"lg-current")||l.default.hasClass(this.___slide[s],"lg-prev-slide")||l.default.hasClass(this.___slide[s],"lg-next-slide")||(this.___slide[s].style.opacity="0");setTimeout(function(){l.default.removeClass(t.outer,"lg-dragging"),e<0&&Math.abs(e)>t.s.swipeThreshold?t.goToNextSlide(!0):e>0&&Math.abs(e)>t.s.swipeThreshold?t.goToPrevSlide(!0):Math.abs(e)<5&&l.default.trigger(t.el,"onSlideClick");for(var s=0;s<t.___slide.length;s++)t.___slide[s].removeAttribute("style")}),setTimeout(function(){l.default.hasClass(t.outer,"lg-dragging")||"lg-slide"===t.s.mode||l.default.removeClass(t.outer,"lg-slide")},t.s.speed+100)},s.prototype.enableSwipe=function(){var e=this,t=0,s=0,i=!1;if(e.s.enableSwipe&&e.isTouch&&e.doCss()){for(var o=0;o<e.___slide.length;o++)l.default.on(e.___slide[o],"touchstart.lg",function(s){l.default.hasClass(e.outer,"lg-zoomed")||e.lgBusy||(s.preventDefault(),e.manageSwipeClass(),t=s.targetTouches[0].pageX)});for(var r=0;r<e.___slide.length;r++)l.default.on(e.___slide[r],"touchmove.lg",function(o){l.default.hasClass(e.outer,"lg-zoomed")||(o.preventDefault(),s=o.targetTouches[0].pageX,e.touchMove(t,s),i=!0)});for(var a=0;a<e.___slide.length;a++)l.default.on(e.___slide[a],"touchend.lg",function(){l.default.hasClass(e.outer,"lg-zoomed")||(i?(i=!1,e.touchEnd(s-t)):l.default.trigger(e.el,"onSlideClick"))})}},s.prototype.enableDrag=function(){var e=this,t=0,s=0,i=!1,o=!1;if(e.s.enableDrag&&!e.isTouch&&e.doCss()){for(var r=0;r<e.___slide.length;r++)l.default.on(e.___slide[r],"mousedown.lg",function(s){l.default.hasClass(e.outer,"lg-zoomed")||(l.default.hasClass(s.target,"lg-object")||l.default.hasClass(s.target,"lg-video-play"))&&(s.preventDefault(),e.lgBusy||(e.manageSwipeClass(),t=s.pageX,i=!0,e.outer.scrollLeft+=1,e.outer.scrollLeft-=1,l.default.removeClass(e.outer,"lg-grab"),l.default.addClass(e.outer,"lg-grabbing"),l.default.trigger(e.el,"onDragstart")))});l.default.on(window,"mousemove.lg",function(r){i&&(o=!0,s=r.pageX,e.touchMove(t,s),l.default.trigger(e.el,"onDragmove"))}),l.default.on(window,"mouseup.lg",function(r){o?(o=!1,e.touchEnd(s-t),l.default.trigger(e.el,"onDragend")):(l.default.hasClass(r.target,"lg-object")||l.default.hasClass(r.target,"lg-video-play"))&&l.default.trigger(e.el,"onSlideClick"),i&&(i=!1,l.default.removeClass(e.outer,"lg-grabbing"),l.default.addClass(e.outer,"lg-grab"))})}},s.prototype.manageSwipeClass=function(){var e=this.index+1,t=this.index-1,s=this.___slide.length;this.s.loop&&(0===this.index?t=s-1:this.index===s-1&&(e=0));for(var i=0;i<this.___slide.length;i++)l.default.removeClass(this.___slide[i],"lg-next-slide"),l.default.removeClass(this.___slide[i],"lg-prev-slide");t>-1&&l.default.addClass(this.___slide[t],"lg-prev-slide"),l.default.addClass(this.___slide[e],"lg
vendor: 4,806 bytes, lines 19-26
19-next-slide")},s.prototype.mousewheel=function(){var e=this;l.default.on(e.outer,"mousewheel.lg",function(t){t.deltaY&&(t.deltaY>0?e.goToPrevSlide():e.goToNextSlide(),t.preventDefault())})},s.prototype.closeGallery=function(){var e=this,t=!1;l.default.on(this.outer.querySelector(".lg-close"),"click.lg",function(){e.destroy()}),e.s.closable&&(l.default.on(e.outer,"mousedown.lg",function(e){t=!!(l.default.hasClass(e.target,"lg-outer")||l.default.hasClass(e.target,"lg-item")||l.default.hasClass(e.target,"lg-img-wrap"))}),l.default.on(e.outer,"mouseup.lg",function(s){(l.default.hasClass(s.target,"lg-outer")||l.default.hasClass(s.target,"lg-item")||l.default.hasClass(s.target,"lg-img-wrap")&&t)&&(l.default.hasClass(e.outer,"lg-dragging")||e.destroy())}))},s.prototype.destroy=function(e){var t=this;if(e||l.default.trigger(t.el,"onBeforeClose"),document.body.scrollTop=t.prevScrollTop,document.documentElement.scrollTop=t.prevScrollTop,e){if(!t.s.dynamic)for(var s=0;s<this.items.length;s++)l.default.off(this.items[s],".lg"),l.default.off(this.items[s],".lgcustom");var i=t.el.getAttribute("lg-uid");delete window.lgData[i],t.el.removeAttribute("lg-uid")}l.default.off(this.el,".lgtm");for(var o in window.lgModules)t.modules[o]&&t.modules[o].destroy(e);this.lGalleryOn=!1,clearTimeout(t.hideBartimeout),this.hideBartimeout=!1,l.default.off(window,".lg"),l.default.removeClass(document.body,"lg-on"),l.default.removeClass(document.body,"lg-from-hash"),t.outer&&l.default.removeClass(t.outer,"lg-visible"),l.default.removeClass(document.querySelector(".lg-backdrop"),"in"),setTimeout(function(){try{t.outer&&t.outer.parentNode.removeChild(t.outer),document.querySelector(".lg-backdrop")&&document.querySelector(".lg-backdrop").parentNode.removeChild(document.querySelector(".lg-backdrop")),e||l.default.trigger(t.el,"onCloseAfter"),t.el.focus()}catch(e){}},t.s.backdropDuration+50)},window.lightGallery=function(e,t){if(e)try{if(e.getAttribute("lg-uid"))window.lgData[e.getAttribute("lg-uid")].init();else{var l="lg"+window.lgData.uid++;window.lgData[l]=new s(e,t),e.setAttribute("lg-uid",l)}}catch(e){console.error("lightGallery has not initiated properly",e)}}})},{"./lg-utils":1}]},{},[2])(2)}); 20/**! 21 * lg-video.js | 1.3.0 | November 7th 2020 22 * http://sachinchoolur.github.io/lg-video.js 23 * Copyright (c) 2016 Sachin N; 24 * @license GPLv3 25 */ 26!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var o;o="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,o.LgVideo=e()}}(function(){var e,o,i;return function(){function e(o,i,t){function l(a,s){if(!i[a]){if(!o[a]){var d="function"==typeof require&&require;if(!s&&d)return d(a,!0);if(r)return r(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var n=i[a]={exports:{}};o[a][0].call(n.exports,function(e){return l(o[a][1][e]||e)},n,n.exports,e,o,i,t)}return i[a].exports}for(var r="function"==typeof require&&require,a=0;a<t.length;a++)l(t[a]);return l}return e}()({1:[function(o,i,t){!function(o,i){if("function"==typeof e&&e.amd)e([],i);else if(void 0!==t)i();else{var l={exports:{}};i(),o.lgVideo=l.exports}}(this,function(){"use strict";var e=Object.assign||function(e){for(var o=1;o<arguments.length;o++){var i=arguments[o];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(e[t]=i[t])}return e},o={videoMaxWidth:"855px",autoplayFirstVideo:!0,youtubePlayerParams:!1,vimeoPlayerParams:!1,dailymotionPlayerParams:!1,vkPlayerParams:!1,videojs:!1,videojsOptions:{}},i=function i(t){return this.el=t,this.core=window.lgData[this.el.getAttribute("lg-uid")],this.core.s=e({},o,this.core.s),this.videoLoaded=!1,this.init(),this};i.prototype.init=function(){var e=this;utils.on(e.core.el,"hasVideo.lgtm",function(o){if(e.core.___slide[o.detail.index].querySelector(".lg-video").insertAdjacentHTML("beforeend",e.loadVideo(o.detail.src,"lg-object",!0,o.detail.index,o.detail.html)),o.detail.html)if(e.core.s.videojs)try{videojs(e.core.___slide[o.detail.index].querySelector(".lg-html5"),e.core.s.videojsOptions,function(){!e.videoLoaded&&o.detail.index===e.core.index&&e.core.s.autoplayFirstVideo&&this.play()})}catch(e){console.error("lightGallery:- Make sure you have included videojs")}else!e.videoLoaded&&o.detail.index===e.core.index&&e.core.s.autoplayFirstVideo&&e.core.___slide[o.detail.index].querySelector(".lg-html5").play()}),utils.on(e.core.el,"onAferAppendSlide.lgtm",function(o){e.core.___slide[o.detail.index].querySelector(".lg-video-cont")&&(e.core.___slide[o.detail.index].querySelector(".lg-video-cont").style.maxWidth=e.core.s.videoMaxWidth,e.videoLoaded=!0)});var o=function o(i){if(utils.hasClass(i.querySelector(".lg-object"),"lg
26-has-poster")&&"none"!==i.querySelector(".lg-object").style.display)if(utils.hasClass(i,"lg-has-video")){var t=i.querySelector(".lg-youtube"),l=i.querySelector(".lg-vimeo"),r=i.querySelector(".lg-dailymotion"),a=i.querySelector(".lg-html5");if(t)t.contentWindow.postMessage('{"event":"command","func":"playVideo","args":""}',"*");else if(l)try{new Vimeo.Player(l).play().catch(function(e){console.error("error playing the video:",e.name)})}catch(e){console.warn("lightGallery:- Make sure you have included https://github.com/vimeo/player.js")}else if(r)r.contentWindow.postMessage("play","*");else if(a)if(e.core.s.videojs)try{videojs(a).play()}catch(e){console.error("lightGallery:- Make sure you have included videojs")}else a.play();utils.addClass(i,"lg-video-playing")}else{utils.addClass(i,"lg-video-playing"),utils.addClass(i,"lg-has-video");var s,d,c=function o(t,l){if(i.querySelector(".lg-video").insertAdjacentHTML("beforeend",e.loadVideo(t,"",!1,e.core.index,l)),l)if(e.core.s.videojs)try{videojs(e.core.___slide[e.core.index].querySelector(".lg-html5"),e.core.s.videojsOptions,function(){this.play()})}catch(e){console.error("lightGallery:- Make sure you have included videojs")}else e.core.___slide[e.core.index].querySelector(".lg-html5").play()};e.core.s.dynamic?(s=e.core.s.dynamicEl[e.core.index].src,d=e.core.s.dynamicEl[e.core.index].html,c(s,d)):(s=e.core.items[e.core.index].getAttribute("href")||e.core.items[e.core.index].getAttribute("data-src"),d=e.core.items[e.core.index].getAttribute("data-html"),c(s,d));var n=i.querySelector(".lg-object");i.querySelector(".lg-video").appendChild(n),utils.hasClass(i.querySelector(".lg-video-object"),"lg-html5")||(utils.removeClass(i,"lg-complete"),utils.on(i.querySelector(".lg-video-object"),"load.lg error.lg",function(){utils.addClass(i,"lg-complete")}))}};if(e.core.doCss()&&e.core.items.length>1&&(e.core.s.enableSwipe&&e.core.isTouch||e.core.s.enableDrag&&!e.core.isTouch))utils.on(e.core.el,"onSlideClick.lgtm",function(){var i=e.core.___slide[e.core.index];o(i)});else for(var i=0;i<e.core.___slide.length;i++)!function(i){utils.on(e.core.___slide[i],"click.lg",function(){o(e.core.___slide[i])})}(i);utils.on(e.core.el,"onBeforeSlide.lgtm",function(o){var i=e.core.___slide[o.detail.prevIndex],t=i.querySelector(".lg-youtube"),l=i.querySelector(".lg-vimeo"),r=i.querySelector(".lg-dailymotion"),a=i.querySelector(".lg-vk"),s=i.querySelector(".lg-html5");if(t)t.contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}',"*");else if(l)try{new Vimeo.Player(l).pause().catch(function(e){console.error("Unable to pause the video:",e.name)})}catch(e){console.warn("lightGallery:- Make sure you have included https://github.com/vimeo/player.js")}else if(r)r.contentWindow.postMessage("pause","*");else if(s)if(e.core.s.videojs)try{videojs(s).pause()}catch(e){console.error("lightGallery:- Make sure you have included videojs")}else s.pause();a&&a.setAttribute("src",a.getAttribute("src").replace("&autoplay","&noplay"));var d;d=e.core.s.dynamic?e.core.s.dynamicEl[o.detail.index].src:e.core.items[o.detail.index].getAttribute("href")||e.core.items[o.detail.index].getAttribute("data-src");var c=e.core.isVideo(d,o.detail.index)||{};(c.youtube||c.vimeo||c.dailymotion||c.vk)&&utils.addClass(e.core.outer,"lg-hide-download")}),utils.on(e.core.el,"onAfterSlide.lgtm",function(o){utils.removeClass(e.core.___slide[o.detail.prevIndex],"lg-video-playing")})},i.prototype.loadVideo=function(e,o,i,t,l){var r="",a=1,s="",d=this.core.isVideo(e,t)||{};i&&(a=this.videoLoaded?0:this.core.s.autoplayFirstVideo?1:0);var c;if(this.core.s.dynamic)c=this.core.s.dynamicEl[t].title;else if(!(c=this.core.items[t].getAttribute("title"))){var n=this.core.items[t].querySelector("img");n&&(c=n.getAttribute("alt"))}if(c=c?'title="'+c+'"':"",d.youtube)s="?wmode=opaque&autoplay="+a+"&enablejsapi=1",this.core.s.youtubePlayerParams&&(s=s+"&"+utils.param(this.core.s.youtubePlayerParams)),r='<iframe allow="autoplay" class="lg-video-object lg-youtube '+o+'" '+c+' width="560" height="315" src="//www.youtube.com/embed/'+d.youtube[1]+s+'" frameborder="0" allowfullscreen></iframe>';
26else if(d.vimeo)s="?autoplay="+a,this.core.s.vimeoPlayerParams&&(s=s+"&"+utils.param(this.core.s.vimeoPlayerParams)),r='<iframe allow="autoplay" class="lg-video-object lg-vimeo '+o+'" '+c+' width="560" height="315" src="//player.vimeo.com/video/'+d.vimeo[1]+s+'" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>';else if(d.dailymotion)s="?wmode=opaque&autoplay="+a+"&api=postMessage",this.core.s.dailymotionPlayerParams&&(s=s+"&"+utils.param(this.core.s.dailymotionPlayerParams)),r='<iframe allow="autoplay" class="lg-video-object lg-dailymotion '+o+'" '+c+' width="560" height="315" src="//www.dailymotion.com/embed/video/'+d.dailymotion[1]+s+'" frameborder="0" allowfullscreen></iframe>';else if(d.html5){var u=l.substring(0,1);"."!==u&&"#"!==u||(l=document.querySelector(l).innerHTML),r=l}else d.vk&&(s="&autoplay="+a,this.core.s.vkPlayerParams&&(s=s+"&"+utils.param(this.core.s.vkPlayerParams)),r='<iframe allow="autoplay" class="lg-video-object lg-vk '+o+'" '+c+' width="560" height="315" src="//vk.com/video_ext.php?'+d.vk[1]+s+'" frameborder="0" allowfullscreen></iframe>');return r},i.prototype.destroy=function(){this.videoLoaded=!1},window.lgModules.video=i})},{}]},{},[1])(1)}); 27!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=t(e,document):"function"==typeof define&&define.amd?define([],function(){return t(e,document)}):e.plyr=t(e,document)}("undefined"!=typeof window?window:this,function(e,t){"use strict";function n(){var e,n,r,a=navigator.userAgent,s=navigator.appName,o=""+parseFloat(navigator.appVersion),i=parseInt(navigator.appVersion,10),l=!1,u=!1,c=!1,d=!1;return navigator.appVersion.indexOf("Windows NT")!==-1&&navigator.appVersion.indexOf("rv:11")!==-1?(l=!0,s="IE",o="11"):(n=a.indexOf("MSIE"))!==-1?(l=!0,s="IE",o=a.substring(n+5)):(n=a.indexOf("Chrome"))!==-1?(c=!0,s="Chrome",o=a.substring(n+7)):(n=a.indexOf("Safari"))!==-1?(d=!0,s="Safari",o=a.substring(n+7),(n=a.indexOf("Version"))!==-1&&(o=a.substring(n+8))):(n=a.indexOf("Firefox"))!==-1?(u=!0,s="Firefox",o=a.substring(n+8)):(e=a.lastIndexOf(" ")+1)<(n=a.lastIndexOf("/"))&&(s=a.substring(e,n),o=a.substring(n+1),s.toLowerCase()===s.toUpperCase()&&(s=navigator.appName)),(r=o.indexOf(";"))!==-1&&(o=o.substring(0,r)),(r=o.indexOf(" "))!==-1&&(o=o.substring(0,r)),i=parseInt(""+o,10),isNaN(i)&&(o=""+parseFloat(navigator.appVersion),i=parseInt(navigator.appVersion,10)),{name:s,version:i,isIE:l,isFirefox:u,isChrome:c,isSafari:d,isIos:/(iPad|iPhone|iPod)/g.test(navigator.platform),isIphone:/(iPhone|iPod)/g.test(navigator.userAgent),isTouch:"ontouchstart"in t.documentElement}}function r(e,t){var n=e.media;if("video"===e.type)switch(t){case"video/webm":return!(!n.canPlayType||!n.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/no/,""));case"video/mp4":return!(!n.canPlayType||!n.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"').replace(/no/,""));case"video/ogg":return!(!n.canPlayType||!n.canPlayType('video/ogg; codecs="theora"').replace(/no/,""))}else if("audio"===e.type)switch(t){case"audio/mpeg":return!(!n.canPlayType||!n.canPlayType("audio/mpeg;").replace(/no/,""));case"audio/ogg":return!(!n.canPlayType||!n.canPlayType('audio/ogg; codecs="vorbis"').replace(/no/,""));case"audio/wav":return!(!n.canPlayType||!n.canPlayType('audio/wav; codecs="1"').replace(/no/,""))}return!1}function a(e){if(!t.querySelectorAll('script[src="'+e+'"]').length){var n=t.createElement("script");n.src=e;var r=t.getElementsByTagName("script")[0];r.parentNode.insertBefore(n,r)}}function s(e,t){return Array.prototype.indexOf&&e.indexOf(t)!==-1}function o(e,t,n){return e.replace(new RegExp(t.replace(/([.*+?\^=!:${}()|\[\]\/\\])/g,"\\$1"),"g"),n)}function i(e,t){e.length||(e=[e]);for(var n=e.length-1;n>=0;n--){var r=n>0?t.cloneNode(!0):t,a=e[n],s=a.parentNode,o=a.nextSibling;return r.appendChild(a),o?s.insertBefore(r,o):s.appendChild(r),r}}function l(e){e&&e.parentNode.removeChild(e)}function u(e,t){e.insertBefore(t,e.firstChild)}function c(e,t){for(var n in t)e.setAttribute(n,O.boolean(t[n])&&t[n]?"":t[n])}function d(e,n,r){var a=t.createElement(e);c(a,r),u(n,a)}function p(e){return e.replace(".","")}function m(e,t,n){if(e)if(e.classList)e.classList[n?"add":"remove"](t);else{var r=(" "+e.className+" ").replace(/\s+/g," ").replace(" "+t+" ","");e.className=r+(n?" "+t:"")}}function f(e,t){return!!e&&(e.classList?e.classList.contains(t):new RegExp("(\\s|^)"+t+"(\\s|$)").test(e.className))}function y(e,n){var r=Element.prototype,a=r.matches||r.webkitMatchesSelector||r.mozMatchesSelector||r.msMatchesSelector||function(e){return[].indexOf.call(t.querySelectorAll(e),this)!==-1};return a.call(e,n)}function b(e,t,n,r,a){g(e,t,function(t){n&&n.apply(e,[t]),r.apply(e,[t])},a)}function v(e,t,n,r,a){var s=t.split(" ");if(O.boolean(a)||(a=!1),e instanceof NodeList)for(var o=0;o<e.length;o++)e[o]instanceof Node&&v(e[o],arguments[1],arguments[2],arguments[3]);else for(var i=0;i<s.length;i++)e[r?"addEventListener":"removeEventListener"](s[i],n,a)}function g(e,t,n,r){e&&v(e,t,n,!0,r)}function h(e,t,n,r){if(e&&t){O.boolean(n)||(n=!1);var a=new CustomEvent(t,{bubbles:n,detail:r});e.dispatchEvent(a)}}function k(e,t){if(e)return t=O.boolean(t)?t:!e.getAttribute("aria-pressed"),e.setAttribute("aria-pressed",t),t}function w(e,t){return 0===e||0===t||isNaN(e)||isNaN(t)?0:(e/t*100).toFixed(2)}function x(){var e=arguments;if(e.length){if(1===e.length)return e[0];for(var t=Array.prototype.shift.call(e),n=e.length,r=0;r<n;r++){var a=e[r];for(var s in a)a[s]&&a[s].constructor&&a[s].constructor===Object?(t[s]=t[s]||{},x(t[s],a[s])):t[s]=a[s]}return t}}function T(e){var t=/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/;return e.match(t)?RegExp.$2:e}function S(e){var t=/^.*(vimeo.com\/|video\/)(\d+).*/;return e.match(t)?RegExp.$2:e}function _(){var e={supportsFullScreen:!1,isFullScreen:function(){return!1},requestFullScreen:function(){},cancelFullScreen:function(){},fullScreenEventName:"",element:null,prefix:""},n="webkit o moz ms khtml".split(" ");if(O.undefined(t.cancelFullScreen))for(var r=0,a=n.length;r<a;r++){if(e.prefix=n[r],!O.undefined(t[e.prefix+"CancelFullScreen"])){e.supportsFullScreen=!0;break}if(!O.undefined(t.msExitFullscreen)&&t.msFullscreenEnabled){e.prefix="ms",e.supportsFullScreen=!0;break}}else e.supportsFullScreen=!0;
27return e.supportsFullScreen&&(e.fullScreenEventName="ms"===e.prefix?"MSFullscreenChange":e.prefix+"fullscreenchange",e.isFullScreen=function(e){switch(O.undefined(e)&&(e=t.body),this.prefix){case"":return t.fullscreenElement===e;case"moz":return t.mozFullScreenElement===e;default:return t[this.prefix+"FullscreenElement"]===e}},e.requestFullScreen=function(e){return O.undefined(e)&&(e=t.body),""===this.prefix?e.requestFullScreen():e[this.prefix+("ms"===this.prefix?"RequestFullscreen":"RequestFullScreen")]()},e.cancelFullScreen=function(){return""===this.prefix?t.cancelFullScreen():t[this.prefix+("ms"===this.prefix?"ExitFullscreen":"CancelFullScreen")]()},e.element=function(){return""===this.prefix?t.fullscreenElement:t[this.prefix+"FullscreenElement"]}),e}function E(v,E){function A(e,t,n,r){h(e,t,n,x({},r,{plyr:Ue}))}function j(t,n){E.debug&&e.console&&(n=Array.prototype.slice.call(n),O.string(E.logPrefix)&&E.logPrefix.length&&n.unshift(E.logPrefix),console[t].apply(console,n))}function V(){return{url:E.iconUrl,absolute:0===E.iconUrl.indexOf("http")||Be.browser.isIE}}function R(){var e=[],t=V(),n=(t.absolute?"":t.url)+"#"+E.iconPrefix;return s(E.controls,"play-large")&&e.push('<button type="button" data-plyr="play" class="plyr__play-large">','<svg><use xlink:href="'+n+'-play" /></svg>','<span class="plyr__sr-only">'+E.i18n.play+"</span>","</button>"),e.push('<div class="plyr__controls">'),s(E.controls,"restart")&&e.push('<button type="button" data-plyr="restart">','<svg><use xlink:href="'+n+'-restart" /></svg>','<span class="plyr__sr-only">'+E.i18n.restart+"</span>","</button>"),s(E.controls,"rewind")&&e.push('<button type="button" data-plyr="rewind">','<svg><use xlink:href="'+n+'-rewind" /></svg>','<span class="plyr__sr-only">'+E.i18n.rewind+"</span>","</button>"),s(E.controls,"play")&&e.push('<button type="button" data-plyr="play">','<svg><use xlink:href="'+n+'-play" /></svg>','<span class="plyr__sr-only">'+E.i18n.play+"</span>","</button>",'<button type="button" data-plyr="pause">','<svg><use xlink:href="'+n+'-pause" /></svg>','<span class="plyr__sr-only">'+E.i18n.pause+"</span>","</button>"),s(E.controls,"fast-forward")&&e.push('<button type="button" data-plyr="fast-forward">','<svg><use xlink:href="'+n+'-fast-forward" /></svg>','<span class="plyr__sr-only">'+E.i18n.forward+"</span>","</button>"),s(E.controls,"progress")&&(e.push('<span class="plyr__progress">','<label for="seek{id}" class="plyr__sr-only">Seek</label>','<input id="seek{id}" class="plyr__progress--seek" type="range" min="0" max="100" step="0.1" value="0" data-plyr="seek">','<progress class="plyr__progress--played" max="100" value="0" role="presentation"></progress>','<progress class="plyr__progress--buffer" max="100" value="0">',"<span>0</span>% "+E.i18n.buffered,"</progress>"),E.tooltips.seek&&e.push('<span class="plyr__tooltip">00:00</span>'),e.push("</span>")),s(E.controls,"current-time")&&e.push('<span class="plyr__time">','<span class="plyr__sr-only">'+E.i18n.currentTime+"</span>",'<span class="plyr__time--current">00:00</span>',"</span>"),s(E.controls,"duration")&&e.push('<span class="plyr__time">','<span class="plyr__sr-only">'+E.i18n.duration+"</span>",'<span class="plyr__time--duration">00:00</span>',"</span>"),s(E.controls,"mute")&&e.push('<button type="button" data-plyr="mute">','<svg class="icon--muted"><use xlink:href="'+n+'-muted" /></svg>','<svg><use xlink:href="'+n+'-volume" /></svg>','<span class="plyr__sr-only">'+E.i18n.toggleMute+"</span>","</button>"),s(E.controls,"volume")&&e.push('<span class="plyr__volume">','<label for="volume{id}" class="plyr__sr-only">'+E.i18n.volume+"</label>",'<input id="volume{id}" class="plyr__volume--input" type="range" min="'+E.volumeMin+'" max="'+E.volumeMax+'" value="'+E.volume+'" data-plyr="volume">','<progress class="plyr__volume--display" max="'+E.volumeMax+'" value="'+E.volumeMin+'" role="presentation"></progress>',"</span>"),s(E.controls,"captions")&&e.push('<button type="button" data-plyr="captions">','<svg class="icon--captions-on"><use xlink:href="'+n+'-captions-on" /></svg>','<svg><use xlink:href="'+n+'-captions-off" /></svg>','<span class="plyr__sr-only">'+E.i18n.toggleCaptions+"</span>","</button>"),s(E.controls,"fullscreen")&&e.push('<button type="button" data-plyr="fullscreen">','<svg class="icon--exit-fullscreen"><use xlink:href="'+n+'-exit-fullscreen" /></svg>','<svg><use xlink:href="'+n+'-enter-fullscreen" /></svg>','<span class="plyr__sr-only">'+E.i18n.toggleFullscreen+"</span>","</button>"),e.push("</div>"),e.join("")}function q(){if(Be.supported.full&&("audio"!==Be.type||E.fullscreen.allowAudio)&&E.fullscreen.enabled){var e=N.supportsFullScreen;e||E.fullscreen.fallback&&!X()?(Je((e?"Native":"Fallback")+" fullscreen enabled"),m(Be.container,E.classes.fullscreen.enabled,!0)):Je("Fullscreen not supported and fallback disabled"),Be.buttons&&Be.buttons.fullscreen&&k(Be.buttons.fullscreen,!1),$()}}function D(){if("video"===Be.type){B(E.selectors.captions)||Be.videoContainer.insertAdjacentHTML("afterbegin",'<div class="'+p(E.selectors.captions)+'"></div>'),Be.usingTextTracks=!1,Be.media.textTracks&&(Be.usingTextTracks=!0);for(var e,t="",n=Be.media.childNodes,r=0;r<n.length;r++)"track"===n[r].nodeName.toLowerCase()&&(e=n[r].kind,"captions"!==e&&"subtitles"!==e||(t=n[r].getAttribute("src")));if(Be.captionExists=!0,""===t?(Be.captionExists=!1,Je("No caption track found")):Je("Caption track found; URI: "+t),Be.captionExists){for(var a=Be.media.textTracks,s=0;s<a.length;s++)a[s].mode="hidden";if(Y(Be),(Be.browser.isIE&&Be.browser.version>=10||Be.browser.isFirefox&&Be.browser.version>=31)&&(Je("Detected browser with known TextTrack issues - using manual fallback"),Be.usingTextTracks=!1),Be.usingTextTracks){Je("TextTracks supp
27orted");for(var o=0;o<a.length;o++){var i=a[o];"captions"!==i.kind&&"subtitles"!==i.kind||g(i,"cuechange",function(){this.activeCues[0]&&"text"in this.activeCues[0]?H(this.activeCues[0].getCueAsHTML()):H()})}}else if(Je("TextTracks not supported so rendering captions manually"),Be.currentCaption="",Be.captions=[],""!==t){var l=new XMLHttpRequest;l.onreadystatechange=function(){if(4===l.readyState)if(200===l.status){var e,t=[],n=l.responseText,r="\r\n";n.indexOf(r+r)===-1&&(r=n.indexOf("\r\r")!==-1?"\r":"\n"),t=n.split(r+r);for(var a=0;a<t.length;a++){e=t[a],Be.captions[a]=[];var s=e.split(r),o=0;s[o].indexOf(":")===-1&&(o=1),Be.captions[a]=[s[o],s[o+1]]}Be.captions.shift(),Je("Successfully loaded the caption file via AJAX")}else ze(E.logPrefix+"There was a problem loading the caption file via AJAX")},l.open("get",t,!0),l.send()}}else m(Be.container,E.classes.captions.enabled)}}function H(e){var n=B(E.selectors.captions),r=t.createElement("span");n.innerHTML="",O.undefined(e)&&(e=""),O.string(e)?r.innerHTML=e.trim():r.appendChild(e),n.appendChild(r);n.offsetHeight}function W(e){function t(e,t){var n=[];n=e.split(" --> ");for(var r=0;r<n.length;r++)n[r]=n[r].replace(/(\d+:\d+:\d+\.\d+).*/,"$1");return a(n[t])}function n(e){return t(e,0)}function r(e){return t(e,1)}function a(e){if(null===e||void 0===e)return 0;var t,n=[],r=[];return n=e.split(","),r=n[0].split(":"),t=Math.floor(60*r[0]*60)+Math.floor(60*r[1])+Math.floor(r[2])}if(!Be.usingTextTracks&&"video"===Be.type&&Be.supported.full&&(Be.subcount=0,e=O.number(e)?e:Be.media.currentTime,Be.captions[Be.subcount])){for(;r(Be.captions[Be.subcount][0])<e.toFixed(1);)if(Be.subcount++,Be.subcount>Be.captions.length-1){Be.subcount=Be.captions.length-1;break}Be.media.currentTime.toFixed(1)>=n(Be.captions[Be.subcount][0])&&Be.media.currentTime.toFixed(1)<=r(Be.captions[Be.subcount][0])?(Be.currentCaption=Be.captions[Be.subcount][1],H(Be.currentCaption)):H()}}function Y(){if(Be.buttons.captions){m(Be.container,E.classes.captions.enabled,!0);var e=Be.storage.captionsEnabled;O.boolean(e)||(e=E.captions.defaultActive),e&&(m(Be.container,E.classes.captions.active,!0),k(Be.buttons.captions,!0))}}function U(e){return Be.container.querySelectorAll(e)}function B(e){return U(e)[0]}function X(){try{return e.self!==e.top}catch(e){return!0}}function $(){function e(e){9===e.which&&Be.isFullscreen&&(e.target!==r||e.shiftKey?e.target===n&&e.shiftKey&&(e.preventDefault(),r.focus()):(e.preventDefault(),n.focus()))}var t=U("input:not([disabled]), button:not([disabled])"),n=t[0],r=t[t.length-1];g(Be.container,"keydown",e)}function J(e,t){if(O.string(t))d(e,Be.media,{src:t});else if(t.constructor===Array)for(var n=t.length-1;n>=0;n--)d(e,Be.media,t[n])}function z(){if(E.loadSprite){var e=V();e.absolute?(Je("AJAX loading absolute SVG sprite"+(Be.browser.isIE?" (due to IE)":"")),C(e.url,"sprite-plyr")):Je("Sprite will be used as external resource directly")}var n=E.html;Je("Injecting custom controls"),n||(n=R()),n=o(n,"{seektime}",E.seekTime),n=o(n,"{id}",Math.floor(1e4*Math.random()));var r;if(O.string(E.selectors.controls.container)&&(r=t.querySelector(E.selectors.controls.container)),O.htmlElement(r)||(r=Be.container),r.insertAdjacentHTML("beforeend",n),E.tooltips.controls)for(var a=U([E.selectors.controls.wrapper," ",E.selectors.labels," .",E.classes.hidden].join("")),s=a.length-1;s>=0;s--){var i=a[s];m(i,E.classes.hidden,!1),m(i,E.classes.tooltip,!0)}}function G(){try{return Be.controls=B(E.selectors.controls.wrapper),Be.buttons={},Be.buttons.seek=B(E.selectors.buttons.seek),Be.buttons.play=U(E.selectors.buttons.play),Be.buttons.pause=B(E.selectors.buttons.pause),Be.buttons.restart=B(E.selectors.buttons.restart),Be.buttons.rewind=B(E.selectors.buttons.rewind),Be.buttons.forward=B(E.selectors.buttons.forward),Be.buttons.fullscreen=B(E.selectors.buttons.fullscreen),Be.buttons.mute=B(E.selectors.buttons.mute),Be.buttons.captions=B(E.selectors.buttons.captions),Be.progress={},Be.progress.container=B(E.selectors.progress.container),Be.progress.buffer={},Be.progress.buffer.bar=B(E.selectors.progress.buffer),Be.progress.buffer.text=Be.progress.buffer.bar&&Be.progress.buffer.bar.getElementsByTagName("span")[0],Be.progress.played=B(E.selectors.progress.played),Be.progress.tooltip=Be.progress.container&&Be.progress.container.querySelector("."+E.classes.tooltip),Be.volume={},Be.volume.input=B(E.selectors.volume.input),Be.volume.display=B(E.selectors.volume.display),Be.duration=B(E.selectors.duration),Be.currentTime=B(E.selectors.currentTime),Be.seekTime=U(E.selectors.seekTime),!0}catch(e){return ze("It looks like there is a problem with your controls HTML"),Q(!0),!1}}function K(){m(Be.container,E.selectors.container.replace(".",""),Be.supported.full)}function Q(e){e&&s(E.types.html5,Be.type)?Be.media.setAttribute("controls",""):Be.media.removeAttribute("controls")}function Z(e){var t=E.i18n.play;if(O.string(E.title)&&E.title.length&&(t+=", "+E.title,Be.container.setAttribute("aria-label",E.title)),Be.supported.full&&Be.buttons.play)for(var n=Be.buttons.play.length-1;n>=0;n--)Be.buttons.play[n].setAttribute("aria-label",t);O.htmlElement(e)&&e.setAttribute("title",E.i18n.frameTitle.replace("{title}",E.title))}function ee(){var t=null;Be.storage={},L.supported&&E.storage.enabled&&(e.localStorage.removeItem("plyr-volume"),t=e.localStorage.getItem(E.storage.key),t&&(/^\d+(\.\d+)?$/.test(t)?te({volume:parseFloat(t)}):Be.storage=JSON.parse(t)))}function te(t){L.supported&&E.storage.enabled&&(x(Be.storage,t),e.localStorage.setItem(E.storage.key,JSON.stringify(Be.storage)))}function ne(){if(!Be.media)return void ze("No media element found!");if(Be.supported.full&&(m(Be.container,E.classes.type.replace("{0}",Be.type),!0),s(E.types.embed,Be.type)&&m(Be.container,E.classes.type.replace("{0}","video"),!0),m(Be.container,E.classes.stopped,E.autoplay),m(Be.container,E.classes.isIos,Be.browser.isIos),m(Be.container,E.classes.isTouch,Be.browser.isTouch),"video"===Be.type)){var e=t.createElement("div");e.setAttribute("class",E.classes.videoWrapper),i(Be.media,e),Be.videoContainer=e}s(E.types.embed,Be.type)&&re()}function re(){var n,r=t.createElement("div"),s=Be.type+"-"+Math.floor(1e4*Math.random());switch(Be.type){case"youtube":n=T(Be.embedId);break;case"vimeo":n=S(Be.embedId);break;default:n=Be.embedId}for(var o=U('[id^="'+Be.type+'-"]'),i=o.length-1;i>=0;i--)l(o[i]);if(m(Be.media,E.classes.videoWrapper,!0),m(Be.media,E.classes.embedWrapper,!0),"youtube"===Be.type)Be.media.appendChild(r),r.setAttribute("id",s),O.object(e.YT)?se(n,r):(a(E.urls.youtube.api),e.onYouTubeReadyCallbacks=e.onYouTubeReadyCallbacks||[],e.onYouTubeReadyCallbacks.push(function(){se(n,r)}),e.onYouTubeIframeAPIReady=function(){e.onYouTubeReadyCallbacks.forEach(function(e){e()})});else if("vimeo"===Be.type)if(Be.supported.full?Be.media.appendChild(r):r=Be.media,r.setAttribute("id",s),O.object(e.Vimeo))oe(n,r);else{a(E.urls.vimeo.api);var u=e.setInterval(function(){O.object(e.Vimeo)&&(e.clearInterval(u),oe(n,r))},50)}else if("soundcloud"===Be.type){var d=t.createElement("iframe");d.loaded=!1,g(d,"load",function(){d.loaded=!0}),c(d,{src:"https://w.soundcloud.com/player/?url=https://api.soundcloud.com/tracks/"+n,id:s}),r.appendChild(d),Be.media.appendChild(r),e.SC||a(E.urls.soundcloud.api);var p=e.setInterval(function(){e.SC&&d.loaded&&(e.clearInterval(p),ie.call(d))},50)}}function ae(){Be.supported.full&&(We(),Ye()),Z(B("iframe"))}function se(t,n){Be.embed=new e.YT.Player(n.id,{videoId:t,playerVars:{autoplay:E.autoplay?1:0,controls:Be.supported.full?0:1,rel:0,showinfo:0,iv_load_policy:3,cc_load_policy:E.captions.defaultActive?1:0,cc_lang_pref:"en",wmode:"transparent",modestbranding:1,disablekb:1,origin:"*"},events:{onError:function(e){A(Be.container,"error",!0,{code:e.data,embed:e.target})},onReady:function(t){var n=t.target;Be.media.play=function(){n.playVideo(),Be.media.paused=!1},Be.media.pause=function(){n.pauseVideo(),Be.media.paused=!0},Be.media.stop=function(){n.stopVideo(),Be.media.paused=!0},Be.media.duration=n.getDuration(),Be.media.paused=!0,Be.media.currentTime=0,Be.media.muted=n.isMuted(),E.title=n.getVideoData().title,Be.supported.full&&Be.media.querySelector("iframe").setAttribute("tabindex","-1"),ae(),A(Be.media,"timeupdate"),A(Be.media,"durationchange"),e.clearInterval(Xe.buffering),Xe.buffering=e.setInterval(function(){Be.media.buffered=n.getVideoLoadedFraction(),(null===Be.media.lastBuffered||Be.media.lastBuffered<Be.media.buffered)&&A(Be.media,"progress"),Be.media.lastBuffered=Be.media.buffered,1===Be.media.buffered&&(e.clearInterval(Xe.buffering),A(Be.media,"canplaythrough"))},200)},onStateChange:function(t){var n=t.target;switch(e.clearInterval(Xe.playing),t.data){case 0:Be.media.paused=!0,A(Be.media,"ended");break;case 1:Be.media.paused=!1,Be.media.seeking&&A(Be.media,"seeked"),Be.media.seeking=!1,A(Be.media,"play"),A(Be.media,"playing"),Xe.playing=e.setInterval(function(){Be.media.currentTime=n.getCurrentTime(),A(Be.media,"timeupdate")},100),Be.media.duration!==n.getDuration()&&(Be.media.duration=n.getDuration(),A(Be.media,"durationchange"));break;case 2:Be.media.paused=!0,A(Be.media,"pause")}A(Be.container,"statechange",!1,{code:t.data})}}})}function oe(t,n){Be.embed=new e.Vimeo.Player(n,{id:parseInt(t),loop:E.loop,autoplay:E.autoplay,byline:!1,portrait:!1,title:!1}),Be.media.play=function(){Be.embed.play(),Be.media.paused=!1},Be.media.pause=function(){Be.embed.pause(),Be.media.paused=!0},Be.media.stop=function(){Be.embed.stop(),Be.media.paused=!0},Be.media.paused=!0,Be.media.currentTime=0,ae(),Be.embed.getCurrentTime().then(function(e){Be.media.currentTime=e,A(Be.media,"timeupdate")}),Be.embed.getDuration().then(function(e){Be.media.duration=e,A(Be.media,"durationchange")}),Be.embed.on("loaded",function(){O.htmlElement(Be.embed.element)&&Be.supported.full&&Be.embed.element.setAttribute("tabindex","-1")}),Be.embed.on("play",function(){Be.media.paused=!1,A(Be.media,"play"),A(Be.media,"playing")}),Be.embed.on("pause",function(){Be.media.paused=!0,A(Be.media,"pause")}),Be.embed.on("timeupdate",function(e){Be.media.seeking=!1,Be.media.currentTime=e.seconds,A(Be.media,"timeupdate")}),Be.embed.on("progress",function(e){Be.media.buffered=e.percent,A(Be.media,"progress"),1===parseInt(e.percent)&&A(Be.media,"canplaythrough")}),Be.embed.on("seeked",function(){Be.media.seeking=!1,A(Be.media,"seeked"),A(Be.media,"play")}),Be.embed.on("ended",function(){Be.media.paused=!0,A(Be.media,"ended")})}function ie(){Be.embed=e.SC.Widget(this),Be.embed.bind(e.SC.Widget.Events.READY,function(){Be.media.play=function(){Be.embed.play(),Be.media.paused=!1},Be.media.pause=function(){Be.embed.pause(),Be.media.paused=!0},Be.media.stop=function(){Be.embed.seekTo(0),Be.embed.pause(),Be.media.paused=!0},Be.media.paused=!0,Be.media.currentTime=0,Be.embed.getDuration(function(e){Be.media.duration=e/1e3,ae()}),Be.embed.getPosition(function(e){Be.media.currentTime=e,A(Be.media,"timeupdate")}),Be.embed.bind(e.SC.Widget.Events.PLAY,function(){Be.media.paused=!1,A(Be.media,"play"),A(Be.media,"playing")}),Be.embed.bind(e.SC.Widget.Events.PAUSE,function(){Be.media.paused=!0,A(Be.media,"pause")}),Be.embed.bind(e.SC.Widget.Events.PLAY_PROGRESS,function(e){Be.media.seeking=!1,Be.media.currentTime=e.currentPosition/1e3,A(Be.media,"timeupdate")}),Be.embed.bind(e.SC.Widget.Events.LOAD_PROGRESS,function(e){Be.media.buffered=e.loadProgress,A(Be.media,"progress"),1===parseInt(e.loadProgress)&&A(Be.media,"canplaythrough")}),Be.embed.bind(e.SC.Widget.Events.FINISH,function(){Be.media.paused=!0,A(Be.media,"ended")})})}function le(){"play"in Be.media&&Be.media.play()}function ue(){"pause"in Be.media&&Be.media.pause()}function ce(e){return O.boolean(e)||(e=Be.media.paused),e?le():ue(),e}function de(e){O.number(e)||(e=E.seekTime),me(Be.media.currentTime-e)}function pe(e){O.number(e)||(e=E.seekTime),me(Be.media.currentTime+e)}function me(e){var t=0,n=Be.media.paused,r=fe();O.number(e)?t=e:O.object(e)&&s(["input","change"],e.type)&&(t=e.target.value/e.target.max*r),t<0?t=0:t>r&&(t=r),Ne(t);try{Be.media.currentTime=t.toFixed(4)}catch(e){}if(s(E.types.embed,Be.type)){switch(Be.type){case"youtube":Be.embed.seekTo(t);break;case"vimeo":Be.embed.setCurrentTime(t.toFixed(0));break;case"soundcloud":Be.embed.seekTo(1e3*t)}n&&ue(),A(Be.media,"timeupdate"),Be.media.seeking=!0,A(Be.media,"seeking")}Je("Seeking to "+Be.media.currentTime+" seconds"),W(t)}function fe(){var e=parseInt(E.duration),t=0;return null===Be.media.duration||isNaN(Be.media.duration)||(t=Be.media.duration),isNaN(e)?t:e}function ye(){m(Be.container,E.classes.playing,!Be.media.paused),m(Be.container,E.classes.stopped,Be.media.paused),Me(Be.media.paused)}function be(){P={x:e.pageXOffset||0,y:e.pageYOffset||0}}function ve(){e.scrollTo(P.x,P.y)}function ge(e){var n=N.supportsFullScreen;if(n){if(!e||e.type!==N.fullScreenEventName)return N.isFullScreen(Be.container)?N.cancelFullScreen():(be(),N.requestFullScreen(Be.container)),void(Be.isFullscreen=N.isFullScreen(Be.container));Be.isFullscreen=N.isFullScreen(Be.container)}else Be.isFullscreen=!Be.isFullscreen,t.body.style.overflow=Be.isFullscreen?"hidden":"";m(Be.container,E.classes.fullscreen.active,Be.isFullscreen),$(Be.isFullscreen),Be.buttons&&Be.buttons.fullscreen&&k(Be.buttons.fullscreen,Be.isFullscreen),A(Be.container,Be.isFullscreen?"enterfullscreen":"exitfullscreen",!0),!Be.isFullscreen&&n&&ve()}function he(e){if(O.boolean(e)||(e=!Be.media.muted),k(Be.buttons.mute,e),Be.media.muted=e,0===Be.media.volume&&ke(E.volume),s(E.types.embed,Be.type)){switch(Be.type){case"youtube":Be.embed[Be.media.muted?"mute":"unMute"]();break;case"vimeo":case"soundcloud":Be.embed.setVolume(Be.media.muted?0:parseFloat(E.volume/E.volumeMax))}A(Be.media,"volumechange")}}function ke(e){var t=E.volumeMax,n=E.volumeMin;if(O.undefined(e)&&(e=Be.storage.volume),(null===e||isNaN(e))&&(e=E.volume),e>t&&(e=t),e<n&&(e=n),Be.media.volume=parseFloat(e/t),Be.volume.display&&(Be.volume.display.value=e),s(E.t
27ypes.embed,Be.type)){switch(Be.type){case"youtube":Be.embed.setVolume(100*Be.media.volume);break;case"vimeo":case"soundcloud":Be.embed.setVolume(Be.media.volume)}A(Be.media,"volumechange")}0===e?Be.media.muted=!0:Be.media.muted&&e>0&&he()}function we(e){var t=Be.media.muted?0:Be.media.volume*E.volumeMax;O.number(e)||(e=E.volumeStep),ke(t+e)}function xe(e){var t=Be.media.muted?0:Be.media.volume*E.volumeMax;O.number(e)||(e=E.volumeStep),ke(t-e)}function Te(){var e=Be.media.muted?0:Be.media.volume*E.volumeMax;Be.supported.full&&(Be.volume.input&&(Be.volume.input.value=e),Be.volume.display&&(Be.volume.display.value=e)),te({volume:e}),m(Be.container,E.classes.muted,0===e),Be.supported.full&&Be.buttons.mute&&k(Be.buttons.mute,0===e)}function Se(e){Be.supported.full&&Be.buttons.captions&&(O.boolean(e)||(e=Be.container.className.indexOf(E.classes.captions.active)===-1),Be.captionsEnabled=e,k(Be.buttons.captions,Be.captionsEnabled),m(Be.container,E.classes.captions.active,Be.captionsEnabled),A(Be.container,Be.captionsEnabled?"captionsenabled":"captionsdisabled",!0),te({captionsEnabled:Be.captionsEnabled}))}function _e(e){var t="waiting"===e.type;clearTimeout(Xe.loading),Xe.loading=setTimeout(function(){m(Be.container,E.classes.loading,t),Me(t)},t?250:0)}function Ee(e){if(Be.supported.full){var t=Be.progress.played,n=0,r=fe();if(e)switch(e.type){case"timeupdate":case"seeking":if(Be.controls.pressed)return;n=w(Be.media.currentTime,r),"timeupdate"===e.type&&Be.buttons.seek&&(Be.buttons.seek.value=n);break;case"playing":case"progress":t=Be.progress.buffer,n=function(){var e=Be.media.buffered;return e&&e.length?w(e.end(0),r):O.number(e)?100*e:0}()}Ce(t,n)}}function Ce(e,t){if(Be.supported.full){if(O.undefined(t)&&(t=0),O.undefined(e)){if(!Be.progress||!Be.progress.buffer)return;e=Be.progress.buffer}O.htmlElement(e)?e.value=t:e&&(e.bar&&(e.bar.value=t),e.text&&(e.text.innerHTML=t))}}function Fe(e,t){if(t){isNaN(e)&&(e=0),Be.secs=parseInt(e%60),Be.mins=parseInt(e/60%60),Be.hours=parseInt(e/60/60%60);var n=parseInt(fe()/60/60%60)>0;Be.secs=("0"+Be.secs).slice(-2),Be.mins=("0"+Be.mins).slice(-2),t.innerHTML=(n?Be.hours+":":"")+Be.mins+":"+Be.secs}}function Ae(){if(Be.supported.full){var e=fe()||0;!Be.duration&&E.displayDuration&&Be.media.paused&&Fe(e,Be.currentTime),Be.duration&&Fe(e,Be.duration),Pe()}}function Ie(e){Fe(Be.media.currentTime,Be.currentTime),e&&"timeupdate"===e.type&&Be.media.seeking||Ee(e)}function Ne(e){O.number(e)||(e=0);var t=fe(),n=w(e,t);Be.progress&&Be.progress.played&&(Be.progress.played.value=n),Be.buttons&&Be.buttons.seek&&(Be.buttons.seek.value=n)}function Pe(e){var t=fe();if(E.tooltips.seek&&Be.progress.container&&0!==t){var n=Be.progress.container.getBoundingClientRect(),r=0,a=E.classes.tooltip+"--visible";if(e)r=100/n.width*(e.pageX-n.left);else{if(!f(Be.progress.tooltip,a))return;r=Be.progress.tooltip.style.left.replace("%","")}r<0?r=0:r>100&&(r=100),Fe(t/100*r,Be.progress.tooltip),Be.progress.tooltip.style.left=r+"%",e&&s(["mouseenter","mouseleave"],e.type)&&m(Be.progress.tooltip,a,"mouseenter"===e.type)}}function Me(t){if(E.hideControls&&"audio"!==Be.type){var n=0,r=!1,a=t,o=f(Be.container,E.classes.loading);if(O.boolean(t)||(t&&t.type?(r="enterfullscreen"===t.type,a=s(["mousemove","touchstart","mouseenter","focus"],t.type),s(["mousemove","touchmove"],t.type)&&(n=2e3),"focus"===t.type&&(n=3e3)):a=f(Be.container,E.classes.hideControls)),e.clearTimeout(Xe.hover),a||Be.media.paused||o){if(m(Be.container,E.classes.hideControls,!1),Be.media.paused||o)return;Be.browser.isTouch&&(n=3e3)}a&&Be.media.paused||(Xe.hover=e.setTimeout(function(){(!Be.controls.pressed&&!Be.controls.hover||r)&&m(Be.container,E.classes.hideControls,!0)},n))}}function Oe(e){if(!O.undefined(e))return void Le(e);var t;switch(Be.type){case"youtube":t=Be.embed.getVideoUrl();break;case"vimeo":Be.embed.getVideoUrl.then(function(e){t=e});break;case"soundcloud":Be.embed.getCurrentSound(function(e){t=e.permalink_url});break;default:t=Be.media.currentSrc}return t||""}function Le(e){function n(){if(Be.embed=null,l(Be.media),"video"===Be.type&&Be.videoContainer&&l(Be.videoContainer),Be.container&&Be.container.removeAttribute("class"),"type"in e&&(Be.type=e.type,"video"===Be.type)){var n=e.sources[0];
27"type"in n&&s(E.types.embed,n.type)&&(Be.type=n.type)}switch(Be.supported=F(Be.type),Be.type){case"video":Be.media=t.createElement("video");break;case"audio":Be.media=t.createElement("audio");break;case"youtube":case"vimeo":case"soundcloud":Be.media=t.createElement("div"),Be.embedId=e.sources[0].src}u(Be.container,Be.media),O.boolean(e.autoplay)&&(E.autoplay=e.autoplay),s(E.types.html5,Be.type)&&(E.crossorigin&&Be.media.setAttribute("crossorigin",""),E.autoplay&&Be.media.setAttribute("autoplay",""),"poster"in e&&Be.media.setAttribute("poster",e.poster),E.loop&&Be.media.setAttribute("loop","")),m(Be.container,E.classes.fullscreen.active,Be.isFullscreen),m(Be.container,E.classes.captions.active,Be.captionsEnabled),K(),s(E.types.html5,Be.type)&&J("source",e.sources),ne(),s(E.types.html5,Be.type)&&("tracks"in e&&J("track",e.tracks),Be.media.load()),(s(E.types.html5,Be.type)||s(E.types.embed,Be.type)&&!Be.supported.full)&&(We(),Ye()),E.title=e.title,Z()}return O.object(e)&&"sources"in e&&e.sources.length?(m(Be.container,E.classes.ready,!1),ue(),Ne(),Ce(),qe(),void De(n,!1)):void ze("Invalid source format")}function je(e){"video"===Be.type&&Be.media.setAttribute("poster",e)}function Ve(){function n(){var e=ce(),t=Be.buttons[e?"play":"pause"],n=Be.buttons[e?"pause":"play"];if(n=n&&n.length>1?n[n.length-1]:n[0]){var r=f(t,E.classes.tabFocus);setTimeout(function(){n.focus(),r&&(m(t,E.classes.tabFocus,!1),m(n,E.classes.tabFocus,!0))},100)}}function r(){var e=t.activeElement;return e=e&&e!==t.body?t.querySelector(":focus"):null}function a(e){return e.keyCode?e.keyCode:e.which}function o(e){for(var t in Be.buttons){var n=Be.buttons[t];if(O.nodeList(n))for(var r=0;r<n.length;r++)m(n[r],E.classes.tabFocus,n[r]===e);else m(n,E.classes.tabFocus,n===e)}}function i(e){function t(){var e=Be.media.duration;O.number(e)&&me(e/10*(n-48))}var n=a(e),r="keydown"===e.type,o=r&&n===u;if(O.number(n))if(r){var i=[48,49,50,51,52,53,54,56,57,32,75,38,40,77,39,37,70,67];switch(s(i,n)&&(e.preventDefault(),e.stopPropagation()),n){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:o||t();break;case 32:case 75:o||ce();break;case 38:we();break;case 40:xe();break;case 77:o||he();break;case 39:pe();break;case 37:de();break;case 70:ge();break;case 67:o||Se()}!N.supportsFullScreen&&Be.isFullscreen&&27===n&&ge(),u=n}else u=null}var l=Be.browser.isIE?"change":"input";if(E.keyboardShorcuts.focused){var u=null;E.keyboardShorcuts.global&&g(e,"keydown keyup",function(e){var t=a(e),n=r(),o=[48,49,50,51,52,53,54,56,57,75,77,70,67],l=I().length;1!==l||!s(o,t)||O.htmlElement(n)&&y(n,E.selectors.editable)||i(e)}),g(Be.container,"keydown keyup",i)}g(e,"keyup",function(e){var t=a(e),n=r();9===t&&o(n)}),g(t.body,"click",function(){m(B("."+E.classes.tabFocus),E.classes.tabFocus,!1)});for(var c in Be.buttons){var d=Be.buttons[c];g(d,"blur",function(){m(d,"tab-focus",!1); 28})}b(Be.buttons.play,"click",E.listeners.play,n),b(Be.buttons.pause,"click",E.listeners.pause,n),b(Be.buttons.restart,"click",E.listeners.restart,me),b(Be.buttons.rewind,"click",E.listeners.rewind,de),b(Be.buttons.forward,"click",E.listeners.forward,pe),b(Be.buttons.seek,l,E.listeners.seek,me),b(Be.volume.input,l,E.listeners.volume,function(){ke(Be.volume.input.value)}),b(Be.buttons.mute,"click",E.listeners.mute,he),b(Be.buttons.fullscreen,"click",E.listeners.fullscreen,ge),N.supportsFullScreen&&g(t,N.fullScreenEventName,ge),b(Be.buttons.captions,"click",E.listeners.captions,Se),g(Be.progress.container,"mouseenter mouseleave mousemove",Pe),E.hideControls&&(g(Be.container,"mouseenter mouseleave mousemove touchstart touchend touchcancel touchmove enterfullscreen",Me),g(Be.controls,"mouseenter mouseleave",function(e){Be.controls.hover="mouseenter"===e.type}),g(Be.controls,"mousedown mouseup touchstart touchend touchcancel",function(e){Be.controls.pressed=s(["mousedown","touchstart"],e.type)}),g(Be.controls,"focus blur",Me,!0)),g(Be.volume.input,"wheel",function(e){e.preventDefault();var t=e.webkitDirectionInvertedFromDevice,n=E.volumeStep/5;(e.deltaY<0||e.deltaX>0)&&(t?xe(n):we(n)),(e.deltaY>0||e.deltaX<0)&&(t?we(n):xe(n))})}function Re(){if(g(Be.media,"timeupdate seeking",Ie),g(Be.media,"timeupdate",W),g(Be.media,"durationchange loadedmetadata",Ae),g(Be.media,"ended",function(){"video"===Be.type&&E.showPosterOnEnd&&("video"===Be.type&&H(),me(),Be.media.load())}),g(Be.media,"progress playing",Ee),g(Be.media,"volumechange",Te),g(Be.media,"play pause ended",ye),g(Be.media,"waiting canplay seeked",_e),E.clickToPlay&&"audio"!==Be.type){var e=B("."+E.classes.videoWrapper);if(!e)return;e.style.cursor="pointer",g(e,"click",function(){E.hideControls&&Be.browser.isTouch&&!Be.media.paused||(Be.media.paused?le():Be.media.ended?(me(),le()):ue())})}E.disableContextMenu&&g(Be.media,"contextmenu",function(e){e.preventDefault()}),g(Be.media,E.events.concat(["keyup","keydown"]).join(" "),function(e){A(Be.container,e.type,!0)})}function qe(){if(s(E.types.html5,Be.type)){for(var e=Be.media.querySelectorAll("source"),t=0;t<e.length;t++)l(e[t]);Be.media.setAttribute("src",E.blankUrl),Be.media.load(),Je("Cancelled network requests")}}function De(n,r){function a(){clearTimeout(Xe.cleanUp),O.boolean(r)||(r=!0),O.function(n)&&n.call($e),r&&(Be.init=!1,Be.container.parentNode.replaceChild($e,Be.container),t.body.style.overflow="",A($e,"destroyed",!0))}if(!Be.init)return null;switch(Be.type){case"youtube":e.clearInterval(Xe.buffering),e.clearInterval(Xe.playing),Be.embed.destroy(),a();break;case"vimeo":Be.embed.unload().then(a),Xe.cleanUp=e.setTimeout(a,200);break;case"video":case"audio":Q(!0),a()}}function He(){if(Be.init)return null;if(N=_(),Be.browser=n(),O.htmlElement(Be.media)){ee();var e=v.tagName.toLowerCase();
28"div"===e?(Be.type=v.getAttribute("data-type"),Be.embedId=v.getAttribute("data-video-id"),v.removeAttribute("data-type"),v.removeAttribute("data-video-id")):(Be.type=e,E.crossorigin=null!==v.getAttribute("crossorigin"),E.autoplay=E.autoplay||null!==v.getAttribute("autoplay"),E.loop=E.loop||null!==v.getAttribute("loop")),Be.supported=F(Be.type),Be.supported.basic&&(Be.container=i(v,t.createElement("div")),Be.container.setAttribute("tabindex",0),K(),Je(""+Be.browser.name+" "+Be.browser.version),ne(),(s(E.types.html5,Be.type)||s(E.types.embed,Be.type)&&!Be.supported.full)&&(We(),Ye(),Z()),Be.init=!0)}}function We(){if(!Be.supported.full)return ze("Basic support only",Be.type),l(B(E.selectors.controls.wrapper)),l(B(E.selectors.buttons.play)),void Q(!0);var e=!U(E.selectors.controls.wrapper).length;e&&z(),G()&&(e&&Ve(),Re(),Q(),q(),D(),ke(),Te(),Ie(),ye())}function Ye(){e.setTimeout(function(){A(Be.media,"ready")},0),m(Be.media,M.classes.setup,!0),m(Be.container,E.classes.ready,!0),Be.media.plyr=Ue,E.autoplay&&le()}var Ue,Be=this,Xe={};Be.media=v;var $e=v.cloneNode(!0),Je=function(){j("log",arguments)},ze=function(){j("warn",arguments)};return Je("Config",E),Ue={getOriginal:function(){return $e},getContainer:function(){return Be.container},getEmbed:function(){return Be.embed},getMedia:function(){return Be.media},getType:function(){return Be.type},getDuration:fe,getCurrentTime:function(){return Be.media.currentTime},getVolume:function(){return Be.media.volume},isMuted:function(){return Be.media.muted},isReady:function(){return f(Be.container,E.classes.ready)},isLoading:function(){return f(Be.container,E.classes.loading)},isPaused:function(){return Be.media.paused},on:function(e,t){return g(Be.container,e,t),this},play:le,pause:ue,stop:function(){ue(),me()},restart:me,rewind:de,forward:pe,seek:me,source:Oe,poster:je,setVolume:ke,togglePlay:ce,toggleMute:he,toggleCaptions:Se,toggleFullscreen:ge,toggleControls:Me,isFullscreen:function(){return Be.isFullscreen||!1},support:function(e){return r(Be,e)},destroy:De},He(),Be.init?Ue:null}function C(e,n){var r=new XMLHttpRequest;if(!O.string(n)||!O.htmlElement(t.querySelector("#"+n))){var a=t.createElement("div");a.setAttribute("hidden",""),O.string(n)&&a.setAttribute("id",n),t.body.insertBefore(a,t.body.childNodes[0]),"withCredentials"in r&&(r.open("GET",e,!0),r.onload=function(){a.innerHTML=r.responseText},r.send())}}function F(e){var r=n(),a=r.isIE&&r.version<=9,s=r.isIos,o=r.isIphone,i=!!t.createElement("audio").canPlayType,l=!!t.createElement("video").canPlayType,u=!1,c=!1;switch(e){case"video":u=l,c=u&&!a&&!o;break;case"audio":u=i,c=u&&!a;break;case"vimeo":u=!0,c=!a&&!s;break;case"youtube":u=!0,c=!a&&!s,s&&!o&&r.version>=10&&(c=!0);break;case"soundcloud":u=!0,c=!a&&!o;break;default:u=i&&l,c=u&&!a}return{basic:u,full:c}}function A(e,n){function r(e,t){f(t,M.classes.hook)||a.push({target:e,media:t})}var a=[],s=[],o=[M.selectors.html5,M.selectors.embed].join(",");if(O.string(e)?e=t.querySelectorAll(e):O.htmlElement(e)?e=[e]:O.nodeList(e)||O.array(e)||O.string(e)||(O.undefined(n)&&O.object(e)&&(n=e),e=t.querySelectorAll(o)),O.nodeList(e)&&(e=Array.prototype.slice.call(e)),!F().basic||!e.length)return!1;for(var i=0;i<e.length;i++){var l=e[i],u=l.querySelectorAll(o);if(u.length)for(var c=0;c<u.length;c++)r(l,u[c]);else y(l,o)&&r(l,l)}return a.forEach(function(e){var t=e.target,r=e.media,a=!1;r===t&&(a=!0);var o={};try{o=JSON.parse(t.getAttribute("data-plyr"))}catch(e){}var i=x({},M,n,o);if(!i.enabled)return null;var l=new E(r,i);if(O.object(l)){if(i.debug){var u=i.events.concat(["setup","statechange","enterfullscreen","exitfullscreen","captionsenabled","captionsdisabled"]);g(l.getContainer(),u.join(" "),function(e){console.log([i.logPrefix,"event:",e.type].join(" "),e.detail.plyr)})}h(l.getContainer(),"setup",!0,{plyr:l}),s.push(l)}}),s}function I(e){if(O.string(e)?e=t.querySelector(e):O.undefined(e)&&(e=t.body),O.htmlElement(e)){var n=e.querySelectorAll("."+M.classes.setup),r=[];return Array.prototype.slice.call(n).forEach(function(e){O.object(e.plyr)&&r.push(e.plyr)}),r}return[]}var N,P={x:0,y:0},M={enabled:!0,debug:!1,autoplay:!1,loop:!1,seekTime:10,volume:10,volumeMin:0,volumeMax:10,volumeStep:1,duration:null,displayDuration:!0,loadSprite:!0,iconPrefix:"plyr",iconUrl:"https://cdn.plyr.io/2.0.11/plyr.svg",blankUrl:"https://cdn.selz.com/plyr/blank.mp4",clickToPlay:!0,hideControls:!0,showPosterOnEnd:!1,disableContextMenu:!0,keyboardShorcuts:{focused:!0,global:!1},tooltips:{controls:!1,seek:!0},selectors:{html5:"video, audio",embed:"[data-type]",editable:"input, textarea, select, [contenteditable]",container:".plyr",controls:{container:null,wrapper:".plyr__controls"},labels:"[data-plyr]",buttons:{seek:'[data-plyr="seek"]',play:'[data-plyr="play"]',pause:'[data-plyr="pause"]',restart:'[data-plyr="restart"]',rewind:'[data-plyr="rewind"]',forward:'[data-plyr="fast-forward"]',mute:'[data-plyr="mute"]',captions:'[data-plyr="captions"]',fullscreen:'[data-plyr="fullscreen"]'},volume:{input:'[data-plyr="volume"]',display:".plyr__volume--display"},progress:{container:".plyr__progress",buffer:".plyr__progress--buffer",played:".plyr__progress--played"},captions:".plyr__captions",currentTime:".plyr__time--current",duration:".plyr__time--duration"},classes:{setup:"plyr--setup",ready:"plyr--ready",videoWrapper:"plyr__video-wrapper",embedWrapper:"plyr__video-embed",type:"plyr--{0}",stopped:"plyr--stopped",playing:"plyr--playing",muted:"plyr--muted",loading:"plyr--loading",hover:"plyr--hover",tooltip:"plyr__tooltip",hidden:"plyr__sr-only",hideControls:"plyr--hide-control
28s",isIos:"plyr--is-ios",isTouch:"plyr--is-touch",captions:{enabled:"plyr--captions-enabled",active:"plyr--captions-active"},fullscreen:{enabled:"plyr--fullscreen-enabled",active:"plyr--fullscreen-active"},tabFocus:"tab-focus"},captions:{defaultActive:!1},fullscreen:{enabled:!0,fallback:!0,allowAudio:!1},storage:{enabled:!0,key:"plyr"},controls:["play-large","play","progress","current-time","mute","volume","captions","fullscreen"],i18n:{restart:"Restart",rewind:"Rewind {seektime} secs",play:"Play",pause:"Pause",forward:"Forward {seektime} secs",played:"played",buffered:"buffered",currentTime:"Current time",duration:"Duration",volume:"Volume",toggleMute:"Toggle Mute",toggleCaptions:"Toggle Captions",toggleFullscreen:"Toggle Fullscreen",frameTitle:"Player for {title}"},types:{embed:["youtube","vimeo","soundcloud"],html5:["video","audio"]},urls:{vimeo:{api:"https://player.vimeo.com/api/player.js"},youtube:{api:"https://www.youtube.com/iframe_api"},soundcloud:{api:"https://w.soundcloud.com/player/api.js"}},listeners:{seek:null,play:null,pause:null,restart:null,rewind:null,forward:null,mute:null,volume:null,captions:null,fullscreen:null},events:["ready","ended","progress","stalled","playing","waiting","canplay","canplaythrough","loadstart","loadeddata","loadedmetadata","timeupdate","volumechange","play","pause","error","seeking","seeked","emptied"],logPrefix:"[Plyr]"},O={object:function(e){return null!==e&&"object"==typeof e},array:function(e){return null!==e&&"object"==typeof e&&e.constructor===Array},number:function(e){return null!==e&&("number"==typeof e&&!isNaN(e-0)||"object"==typeof e&&e.constructor===Number)},string:function(e){return null!==e&&("string"==typeof e||"object"==typeof e&&e.constructor===String)},boolean:function(e){return null!==e&&"boolean"==typeof e},nodeList:function(e){return null!==e&&e instanceof NodeList},htmlElement:function(e){return null!==e&&e instanceof HTMLElement},function:function(e){return null!==e&&"function"==typeof e},undefined:function(e){return null!==e&&"undefined"==typeof e}},L={supported:function(){if(!("localStorage"in e))return!1;try{e.localStorage.setItem("___test","OK");var t=e.localStorage.getItem("___test");return e.localStorage.removeItem("___test"),"OK"===t}catch(e){return!1}return!1}()};return{setup:A,supported:F,loadSprite:C,get:I}}),function(){function e(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),n}"function"!=typeof window.CustomEvent&&(e.prototype=window.Event.prototype,window.CustomEvent=e)}(); 29(function (global, factory) { 30 typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : 31 typeof define === 'function' && define.amd ? define(factory) : 32 (global = global || self, global.Alpine = factory()); 33}(this, (function () { 'use strict'; 34 35 function _defineProperty(obj, key, value) { 36 if (key in obj) { 37 Object.defineProperty(obj, key, { 38 value: value, 39 enumerable: true, 40 configurable: true, 41 writable: true 42 }); 43 } else { 44 obj[key] = value; 45 } 46 47 return obj; 48 } 49 50 function ownKeys(object, enumerableOnly) { 51 var keys = Object.keys(object); 52 53 if (Object.getOwnPropertySymbols) { 54 var symbols = Object.getOwnPropertySymbols(object); 55 if (enumerableOnly) symbols = symbols.filter(function (sym) { 56 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 57 }); 58 keys.push.apply(keys, symbols); 59 } 60 61 return keys; 62 } 63 64 function _objectSpread2(target) { 65 for (var i = 1; i < arguments.length; i++) { 66 var source = arguments[i] != null ? arguments[i] : {}; 67 68 if (i % 2) { 69 ownKeys(Object(source), true).forEach(function (key) { 70 _defineProperty(target, key, source[key]); 71 }); 72 } else if (Object.getOwnPropertyDescriptors) { 73 Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); 74 } else { 75 ownKeys(Object(source)).forEach(function (key) {
76 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 77 }); 78 } 79 } 80 81 return target; 82 } 83 84 // Thanks @stimulus: 85 // https://github.com/stimulusjs/stimulus/blob/master/packages/%40stimulus/core/src/application.ts 86 function domReady() { 87 return new Promise(resolve => { 88 if (document.readyState == "loading") { 89 document.addEventListener("DOMContentLoaded", resolve); 90 } else { 91 resolve(); 92 } 93 }); 94 } 95 function arrayUnique(array) { 96 return Array.from(new Set(array)); 97 } 98 function isTesting() { 99 return navigator.userAgent.includes("Node.js") || navigator.userAgent.includes("jsdom"); 100 } 101 function warnIfMalformedTemplate(el, directive) { 102 if (el.tagName.toLowerCase() !== 'template') { 103 console.warn(`Alpine: [${directive}] directive should only be added to <template> tags. See https://github.com/alpinejs/alpine#${directive}`); 104 } else if (el.content.childElementCount !== 1) { 105 console.warn(`Alpine: <template> tag with [${directive}] encountered with multiple element roots. Make sure <template> only has a single child node.`); 106 } 107 } 108 function kebabCase(subject) { 109 return subject.replace(/([a-z])([A-Z])/g, '$1-$2').replace(/[_\s]/, '-').toLowerCase(); 110 } 111 function camelCase(subject) { 112 return subject.toLowerCase().replace(/[^a-zA-Z0-9]+(.)/g, (match, char) => char.toUpperCase()); 113 } 114 function walk(el, callback) { 115 if (callback(el) === false) return; 116 let node = el.firstElementChild; 117 118 while (node) { 119 walk(node, callback); 120 node = node.nextElementSibling; 121 } 122 } 123 function debounce(func, wait) { 124 var timeout; 125 return function () { 126 var context = this, 127 args = arguments; 128 129 var later = function later() { 130 timeout = null; 131 func.apply(context, args); 132 }; 133 134 clearTimeout(timeout); 135 timeout = setTimeout(later, wait); 136 }; 137 } 138 function saferEval(expression, dataContext, additionalHelperVariables = {}) { 139 if (typeof expression === 'function') { 140 return expression.call(dataContext); 141 } 142 143 return new Function(['$data', ...Object.keys(additionalHelperVariables)], `var __alpine_result; with($data) { __alpine_result = ${expression} }; return __alpine_result`)(dataContext, ...Object.values(additionalHelperVariables)); 144 } 145 function saferEvalNoReturn(expression, dataContext, additionalHelperVariables = {}) { 146 if (typeof expression === 'function') { 147 return expression.call(dataContext, additionalHelperVariables['$event']); 148 } // For the cases when users pass only a function reference to the caller: `x-on:click="foo"` 149 // Where "foo" is a function. Also, we'll pass the function the event instance when we call it. 150 151 152 if (Object.keys(dataContext).includes(expression)) { 153 let methodReference = new Function(['dataContext', ...Object.keys(additionalHelperVariables)], `with(dataContext) { return ${expression} }`)(dataContext, ...Object.values(additionalHelperVariables)); 154 155 if (typeof methodReference === 'function') { 156 return methodReference.call(dataContext, additionalHelperVariables['$event']); 157 } 158 } 159 160 return new Function(['dataContext', ...Object.keys(additionalHelperVariables)], `with(dataContext) { ${expression} }`)(dataContext, ...Object.values(additionalHelperVariables)); 161 } 162 const xAttrRE = /^x-(on|bind|data|text|html|model|if|for|show|cloak|transition|ref|spread)\b/; 163 function isXAttr(attr) { 164 const name = replaceAtAndColonWithStandardSyntax(attr.name); 165 return xAttrRE.test(name); 166 } 167 function getXAttrs(el, component, type) { 168 let directives = Array.from(el.attributes).filter(isXAttr).map(parseHtmlAttribute); // Get an object of directives from x-spread. 169 170 let spreadDirective = directives.filter(directive => directive.type === 'spread')[0]; 171 172 if (spreadDirective) { 173 let spreadObject = saferEval(spreadDirective.expression, component.$data); // Add x-spread directives to the pile of existing directives. 174 175 directives = directives.concat(Object.entries(spreadObject).map(([name, value]) => parseHtmlAttribute({ 176 name, 177 value 178 }))); 179 } 180 181 if (type) return directives.filter(i => i.type === type); 182 return sortDirectives(directives); 183 } 184 185 function sortDirectives(directives) { 186 let directiveOrder = ['bind', 'model', 'show', 'catch-all']; 187 return directives.sort((a, b) => { 188 let typeA = directiveOrder.indexOf(a.type) === -1 ? 'catch-all' : a.type; 189 let typeB = directiveOrder.indexOf(b.type) === -1 ? 'catch-all' : b.type; 190 return directiveOrder.indexOf(typeA) - directiveOrder.indexOf(typeB); 191 });
192 } 193 194 function parseHtmlAttribute({ 195 name, 196 value 197 }) { 198 const normalizedName = replaceAtAndColonWithStandardSyntax(name); 199 const typeMatch = normalizedName.match(xAttrRE); 200 const valueMatch = normalizedName.match(/:([a-zA-Z\-:]+)/); 201 const modifiers = normalizedName.match(/\.[^.\]]+(?=[^\]]*$)/g) || []; 202 return { 203 type: typeMatch ? typeMatch[1] : null, 204 value: valueMatch ? valueMatch[1] : null, 205 modifiers: modifiers.map(i => i.replace('.', '')), 206 expression: value 207 }; 208 } 209 210 function isBooleanAttr(attrName) { 211 // As per HTML spec table https://html.spec.whatwg.org/multipage/indices.html#attributes-3:boolean-attribute 212 // Array roughly ordered by estimated usage 213 const booleanAttributes = ['disabled', 'checked', 'required', 'readonly', 'hidden', 'open', 'selected', 'autofocus', 'itemscope', 'multiple', 'novalidate', 'allowfullscreen', 'allowpaymentrequest', 'formnovalidate', 'autoplay', 'controls', 'loop', 'muted', 'playsinline', 'default', 'ismap', 'reversed', 'async', 'defer', 'nomodule']; 214 return booleanAttributes.includes(attrName); 215 } 216 function replaceAtAndColonWithStandardSyntax(name) { 217 if (name.startsWith('@')) { 218 return name.replace('@', 'x-on:'); 219 } else if (name.startsWith(':')) { 220 return name.replace(':', 'x-bind:'); 221 } 222 223 return name; 224 } 225 function convertClassStringToArray(classList, filterFn = Boolean) { 226 return classList.split(' ').filter(filterFn); 227 } 228 const TRANSITION_TYPE_IN = 'in'; 229 const TRANSITION_TYPE_OUT = 'out'; 230 function transitionIn(el, show, component, forceSkip = false) { 231 // We don't want to transition on the initial page load. 232 if (forceSkip) return show(); 233 234 if (el.__x_transition && el.__x_transition.type === TRANSITION_TYPE_IN) { 235 // there is already a similar transition going on, this was probably triggered by 236 // a change in a different property, let's just leave the previous one doing its job 237 return; 238 } 239 240 const attrs = getXAttrs(el, component, 'transition'); 241 const showAttr = getXAttrs(el, component, 'show')[0]; // If this is triggered by a x-show.transition. 242 243 if (showAttr && showAttr.modifiers.includes('transition')) { 244 let modifiers = showAttr.modifiers; // If x-show.transition.out, we'll skip the "in" transition. 245 246 if (modifiers.includes('out') && !modifiers.includes('in')) return show(); 247 const settingBothSidesOfTransition = modifiers.includes('in') && modifiers.includes('out'); // If x-show.transition.in...out... only use "in" related modifiers for this transition. 248 249 modifiers = settingBothSidesOfTransition ? modifiers.filter((i, index) => index < modifiers.indexOf('out')) : modifiers; 250 transitionHelperIn(el, modifiers, show); // Otherwise, we can assume x-transition:enter. 251 } else if (attrs.some(attr => ['enter', 'enter-start', 'enter-end'].includes(attr.value))) { 252 transitionClassesIn(el, component, attrs, show); 253 } else { 254 // If neither, just show that damn thing. 255 show(); 256 } 257 } 258 function transitionOut(el, hide, component, forceSkip = false) { 259 // We don't want to transition on the initial page load. 260 if (forceSkip) return hide(); 261 262 if (el.__x_transition && el.__x_transition.type === TRANSITION_TYPE_OUT) { 263 // there is already a similar transition going on, this was probably triggered by 264 // a change in a different property, let's just leave the previous one doing its job 265 return; 266 } 267 268 const attrs = getXAttrs(el, component, 'transition'); 269 const showAttr = getXAttrs(el, component, 'show')[0]; 270 271 if (showAttr && showAttr.modifiers.includes('transition')) { 272 let modifiers = showAttr.modifiers; 273 if (modifiers.includes('in') && !modifiers.includes('out')) return hide(); 274 const settingBothSidesOfTransition = modifiers.includes('in') && modifiers.includes('out'); 275 modifiers = settingBothSidesOfTransition ? modifiers.filter((i, index) => index > modifiers.indexOf('out')) : modifiers; 276 transitionHelperOut(el, modifiers, settingBothSidesOfTransition, hide); 277 } else if (attrs.some(attr => ['leave', 'leave-start', 'leave-end'].includes(attr.value))) { 278 transitionClassesOut(el, component, attrs, hide); 279 } else { 280 hide(); 281 } 282 } 283 function transitionHelperIn(el, modifiers, showCallback) { 284 // Default values inspired by: https://material.io/design/motion/speed.html#duration 285 const styleValues = { 286 duration: modifierValue(modifiers, 'duration', 150), 287 origin: modifierValue(modifiers, 'origin', 'center'), 288 first: { 289 opacity: 0, 290 scale: modifierValue(modifiers, 'scale', 95) 291 }, 292 second: { 293 opacity: 1, 294 scale: 100 295 } 296 }; 297 transitionHelper(el, modifiers, showCallback, () => {}, styleValues, TRANSITION_TYPE_IN); 298 } 299 function transitionHelperOut(el, modifiers, settingBothSidesOfTransition, hideCallback) { 300 // Make the "out" transition .5x slower than the "in". (Visually better) 301 // HOWEVER, if they explicitly set a duration for the "out" transition, 302 // use that. 303 const duration = settingBothSidesOfTransition ? modifierValue(modifiers, 'duration', 150) : modifierValue(modifiers, 'duration', 150) / 2; 304 const styleValues = { 305 duration: duration, 306 origin: modifierValue(modifiers, 'origin', 'center'), 307 first: { 308 opacity: 1, 309 scale: 100 310 }, 311 second: { 312 opacity: 0, 313 scale: modifierValue(modifiers, 'scale', 95) 314 } 315 }; 316 transitionHelper(el, modifiers, () => {}, hideCallback, styleValues, TRANSITION_TYPE_OUT); 317 } 318 319 function modifierValue(modifiers, key, fallback) { 320 // If the modifier isn't present, use the default. 321 if (modifiers.indexOf(key) === -1) return fallback; // If it IS present, grab the value after it: x-show.transition.duration.500ms 322 323 const rawValue = modifiers[modifiers.indexOf(key) + 1];
324 if (!rawValue) return fallback; 325 326 if (key === 'scale') { 327 // Check if the very next value is NOT a number and return the fallback. 328 // If x-show.transition.scale, we'll use the default scale value. 329 // That is how a user opts out of the opacity transition. 330 if (!isNumeric(rawValue)) return fallback; 331 } 332 333 if (key === 'duration') { 334 // Support x-show.transition.duration.500ms && duration.500 335 let match = rawValue.match(/([0-9]+)ms/); 336 if (match) return match[1]; 337 } 338 339 if (key === 'origin') { 340 // Support chaining origin directions: x-show.transition.top.right 341 if (['top', 'right', 'left', 'center', 'bottom'].includes(modifiers[modifiers.indexOf(key) + 2])) { 342 return [rawValue, modifiers[modifiers.indexOf(key) + 2]].join(' '); 343 } 344 } 345 346 return rawValue; 347 } 348 349 function transitionHelper(el, modifiers, hook1, hook2, styleValues, type) { 350 // clear the previous transition if exists to avoid caching the wrong styles 351 if (el.__x_transition) { 352 cancelAnimationFrame(el.__x_transition.nextFrame); 353 el.__x_transition.callback && el.__x_transition.callback(); 354 } // If the user set these style values, we'll put them back when we're done with them. 355 356 357 const opacityCache = el.style.opacity; 358 const transformCache = el.style.transform; 359 const transformOriginCache = el.style.transformOrigin; // If no modifiers are present: x-show.transition, we'll default to both opacity and scale. 360 361 const noModifiers = !modifiers.includes('opacity') && !modifiers.includes('scale'); 362 const transitionOpacity = noModifiers || modifiers.includes('opacity'); 363 const transitionScale = noModifiers || modifiers.includes('scale'); // These are the explicit stages of a transition (same stages for in and for out). 364 // This way you can get a birds eye view of the hooks, and the differences 365 // between them. 366 367 const stages = { 368 start() { 369 if (transitionOpacity) el.style.opacity = styleValues.first.opacity; 370 if (transitionScale) el.style.transform = `scale(${styleValues.first.scale / 100})`; 371 }, 372 373 during() { 374 if (transitionScale) el.style.transformOrigin = styleValues.origin; 375 el.style.transitionProperty = [transitionOpacity ? `opacity` : ``, transitionScale ? `transform` : ``].join(' ').trim(); 376 el.style.transitionDuration = `${styleValues.duration / 1000}s`; 377 el.style.transitionTimingFunction = `cubic-bezier(0.4, 0.0, 0.2, 1)`; 378 }, 379 380 show() { 381 hook1(); 382 }, 383 384 end() { 385 if (transitionOpacity) el.style.opacity = styleValues.second.opacity; 386 if (transitionScale) el.style.transform = `scale(${styleValues.second.scale / 100})`; 387 }, 388 389 hide() { 390 hook2(); 391 }, 392 393 cleanup() { 394 if (transitionOpacity) el.style.opacity = opacityCache; 395 if (transitionScale) el.style.transform = transformCache; 396 if (transitionScale) el.style.transformOrigin = transformOriginCache; 397 el.style.transitionProperty = null; 398 el.style.transitionDuration = null; 399 el.style.transitionTimingFunction = null; 400 } 401 402 }; 403 transition(el, stages, type); 404 } 405 function transitionClassesIn(el, component, directives, showCallback) { 406 let ensureStringExpression = expression => { 407 return typeof expression === 'function' ? component.evaluateReturnExpression(el, expression) : expression; 408 }; 409 410 const enter = convertClassStringToArray(ensureStringExpression((directives.find(i => i.value === 'enter') || { 411 expression: '' 412 }).expression)); 413 const enterStart = convertClassStringToArray(ensureStringExpression((directives.find(i => i.value === 'enter-start') || { 414 expression: '' 415 }).expression)); 416 const enterEnd = convertClassStringToArray(ensureStringExpression((directives.find(i => i.value === 'enter-end') || { 417 expression: '' 418 }).expression)); 419 transitionClasses(el, enter, enterStart, enterEnd, showCallback, () => {}, TRANSITION_TYPE_IN); 420 } 421 function transitionClassesOut(el, component, directives, hideCallback) { 422 const leave = convertClassStringToArray((directives.find(i => i.value === 'leave') || { 423 expression: '' 424 }).expression); 425 const leaveStart = convertClassStringToArray((directives.find(i => i.value === 'leave-start') || { 426 expression: '' 427 }).expression); 428 const leaveEnd = convertClassStringToArray((directives.find(i => i.value === 'leave-end') || { 429 expression: '' 430 }).expression); 431 transitionClasses(el, leave, leaveStart, leaveEnd, () => {}, hideCallback, TRANSITION_TYPE_OUT); 432 } 433 function transitionClasses(el, classesDuring, classesStart, classesEnd, hook1, hook2, type) { 434 // clear the previous transition if exists to avoid caching the wrong classes 435 if (el.__x_transition) { 436 cancelAnimationFrame(el.__x_transition.nextFrame); 437 el.__x_transition.callback && el.__x_transition.callback(); 438 } 439 440 const originalClasses = el.__x_original_classes || []; 441 const stages = { 442 start() { 443 el.classList.add(...classesStart); 444 }, 445 446 during() { 447 el.classList.add(...classesDuring); 448 }, 449 450 show() { 451 hook1(); 452 }, 453 454 end() { 455 // Don't remove classes that were in the original class attribute. 456 el.classList.remove(...classesStart.filter(i => !originalClasses.includes(i))); 457 el.classList.add(...classesEnd); 458 }, 459 460 hide() { 461 hook2(); 462 }, 463 464 cleanup() { 465 el.classList.remove(...classesDuring.filter(i => !originalClasses.includes(i))); 466 el.classList.remove(...classesEnd.filter(i => !originalClasses.includes(i))); 467 } 468 469 }; 470 transition(el, stages, type); 471 } 472 function transition(el, stages, type) { 473 el.__x_transition = { 474 // Set transition type so we can avoid clearing transition if the direction is the same 475 type: type, 476 // create a callback for the last stages of the transition so we can call it 477 // from different point and early terminate it. Once will ensure that function 478 // is only called one time. 479 callback: once(() => { 480 stages.hide(); // Adding an "isConnected" check, in case the callback 481 // removed the element from the DOM. 482 483 if (el.isConnected) { 484 stages.cleanup(); 485 } 486 487 delete el.__x_transition; 488 }), 489 // This store the next animation frame so we can cancel it 490 nextFrame: null 491 }; 492 stages.start(); 493 stages.during(); 494 el.__x_transition.nextFrame = requestAnimationFrame(() => { 495 // Note: Safari's transitionDuration property will list out comma separated transition durations 496 // for every single transition property. Let's grab the first one and call it a day. 497 let duration = Number(getComputedStyle(el).transitionDuration.replace(/,.*/, '').replace('s', '')) * 1000; 498 499 if (duration === 0) { 500 duration = Number(getComputedStyle(el).animationDuration.replace('s', '')) * 1000; 501 } 502 503 stages.show(); 504 el.__x_transition.nextFrame = requestAnimationFrame(() => { 505 stages.end(); 506 setTimeout(el.__x_transition.callback, duration); 507 }); 508 });
509 } 510 function isNumeric(subject) { 511 return !isNaN(subject); 512 } // Thanks @vuejs 513 // https://github.com/vuejs/vue/blob/4de4649d9637262a9b007720b59f80ac72a5620c/src/shared/util.js 514 515 function once(callback) { 516 let called = false; 517 return function () { 518 if (!called) { 519 called = true; 520 callback.apply(this, arguments); 521 } 522 }; 523 } 524 525 function handleForDirective(component, templateEl, expression, initialUpdate, extraVars) { 526 warnIfMalformedTemplate(templateEl, 'x-for'); 527 let iteratorNames = typeof expression === 'function' ? parseForExpression(component.evaluateReturnExpression(templateEl, expression)) : parseForExpression(expression); 528 let items = evaluateItemsAndReturnEmptyIfXIfIsPresentAndFalseOnElement(component, templateEl, iteratorNames, extraVars); // As we walk the array, we'll also walk the DOM (updating/creating as we go). 529 530 let currentEl = templateEl; 531 items.forEach((item, index) => { 532 let iterationScopeVariables = getIterationScopeVariables(iteratorNames, item, index, items, extraVars()); 533 let currentKey = generateKeyForIteration(component, templateEl, index, iterationScopeVariables); 534 let nextEl = lookAheadForMatchingKeyedElementAndMoveItIfFound(currentEl.nextElementSibling, currentKey); // If we haven't found a matching key, insert the element at the current position. 535 536 if (!nextEl) { 537 nextEl = addElementInLoopAfterCurrentEl(templateEl, currentEl); // And transition it in if it's not the first page load. 538 539 transitionIn(nextEl, () => {}, component, initialUpdate); 540 nextEl.__x_for = iterationScopeVariables; 541 component.initializeElements(nextEl, () => nextEl.__x_for); // Otherwise update the element we found. 542 } else { 543 // Temporarily remove the key indicator to allow the normal "updateElements" to work. 544 delete nextEl.__x_for_key; 545 nextEl.__x_for = iterationScopeVariables; 546 component.updateElements(nextEl, () => nextEl.__x_for); 547 } 548 549 currentEl = nextEl; 550 currentEl.__x_for_key = currentKey; 551 }); 552 removeAnyLeftOverElementsFromPreviousUpdate(currentEl, component); 553 } // This was taken from VueJS 2.* core. Thanks Vue! 554 555 function parseForExpression(expression) { 556 let forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/; 557 let stripParensRE = /^\(|\)$/g; 558 let forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/; 559 let inMatch = expression.match(forAliasRE); 560 if (!inMatch) return; 561 let res = {}; 562 res.items = inMatch[2].trim(); 563 let item = inMatch[1].trim().replace(stripParensRE, ''); 564 let iteratorMatch = item.match(forIteratorRE); 565 566 if (iteratorMatch) { 567 res.item = item.replace(forIteratorRE, '').trim(); 568 res.index = iteratorMatch[1].trim(); 569 570 if (iteratorMatch[2]) { 571 res.collection = iteratorMatch[2].trim(); 572 } 573 } else { 574 res.item = item; 575 } 576 577 return res; 578 } 579 580 function getIterationScopeVariables(iteratorNames, item, index, items, extraVars) { 581 // We must create a new object, so each iteration has a new scope 582 let scopeVariables = extraVars ? _objectSpread2({}, extraVars) : {}; 583 scopeVariables[iteratorNames.item] = item; 584 if (iteratorNames.index) scopeVariables[iteratorNames.index] = index; 585 if (iteratorNames.collection) scopeVariables[iteratorNames.collection] = items; 586 return scopeVariables; 587 } 588 589 function generateKeyForIteration(component, el, index, iterationScopeVariables) { 590 let bindKeyAttribute = getXAttrs(el, component, 'bind').filter(attr => attr.value === 'key')[0]; // If the dev hasn't specified a key, just return the index of the iteration. 591 592 if (!bindKeyAttribute) return index; 593 return component.evaluateReturnExpression(el, bindKeyAttribute.expression, () => iterationScopeVariables); 594 } 595 596 function evaluateItemsAndReturnEmptyIfXIfIsPresentAndFalseOnElement(component, el, iteratorNames, extraVars) { 597 let ifAttribute = getXAttrs(el, component, 'if')[0]; 598 599 if (ifAttribute && !component.evaluateReturnExpression(el, ifAttribute.expression)) { 600 return []; 601 } 602 603 return component.evaluateReturnExpression(el, iteratorNames.items, extraVars); 604 } 605 606 function addElementInLoopAfterCurrentEl(templateEl, currentEl) {
607 let clone = document.importNode(templateEl.content, true); 608 currentEl.parentElement.insertBefore(clone, currentEl.nextElementSibling); 609 return currentEl.nextElementSibling; 610 } 611 612 function lookAheadForMatchingKeyedElementAndMoveItIfFound(nextEl, currentKey) { 613 if (!nextEl) return; // If the the key's DO match, no need to look ahead. 614 615 if (nextEl.__x_for_key === currentKey) return nextEl; // If they don't, we'll look ahead for a match. 616 // If we find it, we'll move it to the current position in the loop. 617 618 let tmpNextEl = nextEl; 619 620 while (tmpNextEl) { 621 if (tmpNextEl.__x_for_key === currentKey) { 622 return tmpNextEl.parentElement.insertBefore(tmpNextEl, nextEl); 623 } 624 625 tmpNextEl = tmpNextEl.nextElementSibling && tmpNextEl.nextElementSibling.__x_for_key !== undefined ? tmpNextEl.nextElementSibling : false; 626 } 627 } 628 629 function removeAnyLeftOverElementsFromPreviousUpdate(currentEl, component) { 630 var nextElementFromOldLoop = currentEl.nextElementSibling && currentEl.nextElementSibling.__x_for_key !== undefined ? currentEl.nextElementSibling : false; 631 632 while (nextElementFromOldLoop) { 633 let nextElementFromOldLoopImmutable = nextElementFromOldLoop; 634 let nextSibling = nextElementFromOldLoop.nextElementSibling; 635 transitionOut(nextElementFromOldLoop, () => { 636 nextElementFromOldLoopImmutable.remove(); 637 }, component); 638 nextElementFromOldLoop = nextSibling && nextSibling.__x_for_key !== undefined ? nextSibling : false; 639 } 640 } 641 642 function handleAttributeBindingDirective(component, el, attrName, expression, extraVars, attrType, modifiers) { 643 var value = component.evaluateReturnExpression(el, expression, extraVars); 644 645 if (attrName === 'value') { 646 // If nested model key is undefined, set the default value to empty string. 647 if (value === undefined && expression.match(/\./).length) { 648 value = ''; 649 } 650 651 if (el.type === 'radio') { 652 // Set radio value from x-bind:value, if no "value" attribute exists. 653 // If there are any initial state values, radio will have a correct 654 // "checked" value since x-bind:value is processed before x-model. 655 if (el.attributes.value === undefined && attrType === 'bind') { 656 el.value = value; 657 } else if (attrType !== 'bind') { 658 el.checked = el.value == value; 659 } 660 } else if (el.type === 'checkbox') { 661 // If we are explicitly binding a string to the :value, set the string, 662 // If the value is a boolean, leave it alone, it will be set to "on" 663 // automatically. 664 if (typeof value === 'string' && attrType === 'bind') { 665 el.value = value; 666 } else if (attrType !== 'bind') { 667 if (Array.isArray(value)) { 668 // I'm purposely not using Array.includes here because it's 669 // strict, and because of Numeric/String mis-casting, I 670 // want the "includes" to be "fuzzy". 671 el.checked = value.some(val => val == el.value); 672 } else { 673 el.checked = !!value; 674 } 675 } 676 } else if (el.tagName === 'SELECT') { 677 updateSelect(el, value); 678 } else { 679 if (el.value === value) return; 680 el.value = value; 681 } 682 } else if (attrName === 'class') { 683 if (Array.isArray(value)) { 684 const originalClasses = el.__x_original_classes || []; 685 el.setAttribute('class', arrayUnique(originalClasses.concat(value)).join(' ')); 686 } else if (typeof value === 'object') { 687 // Sorting the keys / class names by their boolean value will ensure that 688 // anything that evaluates to `false` and needs to remove classes is run first. 689 const keysSortedByBooleanValue = Object.keys(value).sort((a, b) => value[a] - value[b]); 690 keysSortedByBooleanValue.forEach(classNames => { 691 if (value[classNames]) { 692 convertClassStringToArray(classNames).forEach(className => el.classList.add(className)); 693 } else {
694 convertClassStringToArray(classNames).forEach(className => el.classList.remove(className)); 695 } 696 }); 697 } else { 698 const originalClasses = el.__x_original_classes || []; 699 const newClasses = convertClassStringToArray(value); 700 el.setAttribute('class', arrayUnique(originalClasses.concat(newClasses)).join(' ')); 701 } 702 } else { 703 attrName = modifiers.includes('camel') ? camelCase(attrName) : attrName; // If an attribute's bound value is null, undefined or false, remove the attribute 704 705 if ([null, undefined, false].includes(value)) { 706 el.removeAttribute(attrName); 707 } else { 708 isBooleanAttr(attrName) ? setIfChanged(el, attrName, attrName) : setIfChanged(el, attrName, value); 709 } 710 } 711 } 712 713 function setIfChanged(el, attrName, value) { 714 if (el.getAttribute(attrName) != value) { 715 el.setAttribute(attrName, value); 716 } 717 } 718 719 function updateSelect(el, value) { 720 const arrayWrappedValue = [].concat(value).map(value => { 721 return value + ''; 722 }); 723 Array.from(el.options).forEach(option => { 724 option.selected = arrayWrappedValue.includes(option.value || option.text); 725 }); 726 } 727 728 function handleTextDirective(el, output, expression) { 729 // If nested model key is undefined, set the default value to empty string. 730 if (output === undefined && expression.match(/\./)) { 731 output = ''; 732 } 733 734 el.innerText = output; 735 } 736 737 function handleHtmlDirective(component, el, expression, extraVars) { 738 el.innerHTML = component.evaluateReturnExpression(el, expression, extraVars); 739 } 740 741 function handleShowDirective(component, el, value, modifiers, initialUpdate = false) { 742 const hide = () => { 743 el.style.display = 'none'; 744 }; 745 746 const show = () => { 747 if (el.style.length === 1 && el.style.display === 'none') { 748 el.removeAttribute('style'); 749 } else { 750 el.style.removeProperty('display'); 751 } 752 }; 753 754 if (initialUpdate === true) { 755 if (value) { 756 show(); 757 } else { 758 hide(); 759 } 760 761 return; 762 } 763 764 const handle = resolve => { 765 if (value) { 766 if (el.style.display === 'none' || el.__x_transition) { 767 transitionIn(el, () => { 768 show(); 769 }, component); 770 } 771 772 resolve(() => {}); 773 } else { 774 if (el.style.display !== 'none') { 775 transitionOut(el, () => { 776 resolve(() => { 777 hide(); 778 }); 779 }, component); 780 } else { 781 resolve(() => {}); 782 } 783 } 784 }; // The working of x-show is a bit complex because we need to 785 // wait for any child transitions to finish before hiding 786 // some element. Also, this has to be done recursively. 787 // If x-show.immediate, foregoe the waiting. 788 789 790 if (modifiers.includes('immediate')) { 791 handle(finish => finish()); 792 return; 793 } // x-show is encountered during a DOM tree walk. If an element 794 // we encounter is NOT a child of another x-show element we 795 // can execute the previous x-show stack (if one exists). 796 797 798 if (component.showDirectiveLastElement && !component.showDirectiveLastElement.contains(el)) { 799 component.executeAndClearRemainingShowDirectiveStack(); 800 } 801 802 component.showDirectiveStack.push(handle); 803 component.showDirectiveLastElement = el; 804 } 805 806 function handleIfDirective(component, el, expressionResult, initialUpdate, extraVars) { 807 warnIfMalformedTemplate(el, 'x-if'); 808 const elementHasAlreadyBeenAdded = el.nextElementSibling && el.nextElementSibling.__x_inserted_me === true; 809 810 if (expressionResult && (!elementHasAlreadyBeenAdded || el.__x_transition)) { 811 const clone = document.importNode(el.content, true); 812 el.parentElement.insertBefore(clone, el.nextElementSibling); 813 transitionIn(el.nextElementSibling, () => {}, component, initialUpdate); 814 component.initializeElements(el.nextElementSibling, extraVars); 815 el.nextElementSibling.__x_inserted_me = true; 816 } else if (!expressionResult && elementHasAlreadyBeenAdded) { 817 transitionOut(el.nextElementSibling, () => { 818 el.nextElementSibling.remove(); 819 }, component, initialUpdate); 820 } 821 } 822 823 function registerListener(component, el, event, modifiers, expression, extraVars = {}) { 824 const options = { 825 passive: modifiers.includes('passive') 826 }; 827 828 if (modifiers.includes('camel')) { 829 event = camelCase(event); 830 } 831 832 if (modifiers.includes('away')) { 833 let handler = e => { 834 // Don't do anything if the click came from the element or within it. 835 if (el.contains(e.target)) return; // Don't do anything if this element isn't currently visible. 836 837 if (el.offsetWidth < 1 && el.offsetHeight < 1) return; // Now that we are sure the element is visible, AND the click 838 // is from outside it, let's run the expression. 839 840 runListenerHandler(component, expression, e, extraVars); 841 842 if (modifiers.includes('once')) { 843 document.removeEventListener(event, handler, options); 844 } 845 }; // Listen for this event at the root level. 846 847 848 document.addEventListener(event, handler, options); 849 } else { 850 let listenerTarget = modifiers.includes('window') ? window : modifiers.includes('document') ? document : el; 851 852 let handler = e => { 853 // Remove this global event handler if the element that declared it 854 // has been removed. It's now stale. 855 if (listenerTarget === window || listenerTarget === document) { 856 if (!document.body.contains(el)) { 857 listenerTarget.removeEventListener(event, handler, options); 858 return; 859 } 860 } 861 862 if (isKeyEvent(event)) { 863 if (isListeningForASpecificKeyThatHasntBeenPressed(e, modifiers)) { 864 return; 865 } 866 } 867 868 if (modifiers.includes('prevent')) e.preventDefault(); 869 if (modifiers.includes('stop')) e.stopPropagation(); // If the .self modifier isn't present, or if it is present and 870 // the target element matches the element we are registering the 871 // event on, run the handler 872 873 if (!modifiers.includes('self') || e.target === el) { 874 const returnValue = runListenerHandler(component, expression, e, extraVars); 875 876 if (returnValue === false) { 877 e.preventDefault(); 878 } else { 879 if (modifiers.includes('once')) { 880 listenerTarget.removeEventListener(event, handler, options); 881 } 882 } 883 } 884 }; 885 886 if (modifiers.includes('debounce')) { 887 let nextModifier = modifiers[modifiers.indexOf('debounce') + 1] || 'invalid-wait'; 888 let wait = isNumeric(nextModifier.split('ms')[0]) ? Number(nextModifier.split('ms')[0]) : 250; 889 handler = debounce(handler, wait); 890 } 891 892 listenerTarget.addEventListener(event, handler, options); 893 } 894 } 895 896 function runListenerHandler(component, expression, e, extraVars) { 897 return component.evaluateCommandExpression(e.target, expression, () => {
898 return _objectSpread2(_objectSpread2({}, extraVars()), {}, { 899 '$event': e 900 }); 901 }); 902 } 903 904 function isKeyEvent(event) { 905 return ['keydown', 'keyup'].includes(event); 906 } 907 908 function isListeningForASpecificKeyThatHasntBeenPressed(e, modifiers) { 909 let keyModifiers = modifiers.filter(i => { 910 return !['window', 'document', 'prevent', 'stop'].includes(i); 911 }); 912 913 if (keyModifiers.includes('debounce')) { 914 let debounceIndex = keyModifiers.indexOf('debounce'); 915 keyModifiers.splice(debounceIndex, isNumeric((keyModifiers[debounceIndex + 1] || 'invalid-wait').split('ms')[0]) ? 2 : 1); 916 } // If no modifier is specified, we'll call it a press. 917 918 919 if (keyModifiers.length === 0) return false; // If one is passed, AND it matches the key pressed, we'll call it a press. 920 921 if (keyModifiers.length === 1 && keyModifiers[0] === keyToModifier(e.key)) return false; // The user is listening for key combinations. 922 923 const systemKeyModifiers = ['ctrl', 'shift', 'alt', 'meta', 'cmd', 'super']; 924 const selectedSystemKeyModifiers = systemKeyModifiers.filter(modifier => keyModifiers.includes(modifier)); 925 keyModifiers = keyModifiers.filter(i => !selectedSystemKeyModifiers.includes(i)); 926 927 if (selectedSystemKeyModifiers.length > 0) { 928 const activelyPressedKeyModifiers = selectedSystemKeyModifiers.filter(modifier => { 929 // Alias "cmd" and "super" to "meta" 930 if (modifier === 'cmd' || modifier === 'super') modifier = 'meta'; 931 return e[`${modifier}Key`]; 932 }); // If all the modifiers selected are pressed, ... 933 934 if (activelyPressedKeyModifiers.length === selectedSystemKeyModifiers.length) { 935 // AND the remaining key is pressed as well. It's a press. 936 if (keyModifiers[0] === keyToModifier(e.key)) return false; 937 } 938 } // We'll call it NOT a valid keypress. 939 940 941 return true; 942 } 943 944 function keyToModifier(key) { 945 switch (key) { 946 case '/': 947 return 'slash'; 948 949 case ' ': 950 case 'Spacebar': 951 return 'space'; 952 953 default: 954 return key && kebabCase(key); 955 } 956 } 957 958 function registerModelListener(component, el, modifiers, expression, extraVars) { 959 // If the element we are binding to is a select, a radio, or checkbox 960 // we'll listen for the change event instead of the "input" event. 961 var event = el.tagName.toLowerCase() === 'select' || ['checkbox', 'radio'].includes(el.type) || modifiers.includes('lazy') ? 'change' : 'input'; 962 const listenerExpression = `${expression} = rightSideOfExpression($event, ${expression})`; 963 registerListener(component, el, event, modifiers, listenerExpression, () => { 964 return _objectSpread2(_objectSpread2({}, extraVars()), {}, { 965 rightSideOfExpression: generateModelAssignmentFunction(el, modifiers, expression) 966 }); 967 }); 968 } 969 970 function generateModelAssignmentFunction(el, modifiers, expression) { 971 if (el.type === 'radio') { 972 // Radio buttons only work properly when they share a name attribute. 973 // People might assume we take care of that for them, because 974 // they already set a shared "x-model" attribute. 975 if (!el.hasAttribute('name')) el.setAttribute('name', expression); 976 } 977 978 return (event, currentValue) => { 979 // Check for event.detail due to an issue where IE11 handles other events as a CustomEvent. 980 if (event instanceof CustomEvent && event.detail) { 981 return event.detail; 982 } else if (el.type === 'checkbox') { 983 // If the data we are binding to is an array, toggle its value inside the array. 984 if (Array.isArray(currentValue)) { 985 const newValue = modifiers.includes('number') ? safeParseNumber(event.target.value) : event.target.value; 986 return event.target.checked ? currentValue.concat([newValue]) : currentValue.filter(i => i !== newValue); 987 } else { 988 return event.target.checked; 989 } 990 } else if (el.tagName.toLowerCase() === 'select' && el.multiple) { 991 return modifiers.includes('number') ? Array.from(event.target.selectedOptions).map(option => { 992 const rawValue = option.value || option.text; 993 return safeParseNumber(rawValue); 994 }) : Array.from(event.target.selectedOptions).map(option => { 995 return option.value || option.text; 996 }); 997 } else { 998 const rawValue = event.target.value; 999 return modifiers.includes('number') ? safeParseNumber(rawValue) : modifiers.includes('trim') ? rawValue.trim() : rawValue; 1000 } 1001 }; 1002 } 1003 1004 function safeParseNumber(rawValue) { 1005 const number = rawValue ? parseFloat(rawValue) : null; 1006 return isNumeric(number) ? number : rawValue; 1007 } 1008 1009 /** 1010 * Copyright (C) 2017 salesforce.com, inc. 1011 */ 1012 const { isArray } = Array; 1013 const { getPrototypeOf, create: ObjectCreate, defineProperty: ObjectDefineProperty, defineProperties: ObjectDefineProperties, isExtensible, getOwnPropertyDescriptor, getOwnPropertyNames, getOwnPropertySymbols, preventExtensions, hasOwnProperty, } = Object; 1014 const { push: ArrayPush, concat: ArrayConcat, map: ArrayMap, } = Array.prototype; 1015 function isUndefined(obj) { 1016 return obj === undefined; 1017 } 1018 function isFunction(obj) { 1019 return typeof obj === 'function'; 1020 } 1021 function isObject(obj) { 1022 return typeof obj === 'object'; 1023 } 1024 const proxyToValueMap = new WeakMap(); 1025 function registerProxy(proxy, value) { 1026 proxyToValueMap.set(proxy, value); 1027 } 1028 const unwrap = (replicaOrAny) => proxyToValueMap.get(replicaOrAny) || replicaOrAny; 1029 1030 function wrapValue(membrane, value) { 1031 return membrane.valueIsObservable(value) ? membrane.getProxy(value) : value; 1032 } 1033 /** 1034 * Unwrap property descriptors will set value on original descriptor 1035 * We only need to unwrap if value is specified 1036 * @param descriptor external descrpitor provided to define new property on original value 1037 */ 1038 function unwrapDescriptor(descriptor) { 1039 if (hasOwnProperty.call(descriptor, 'value')) { 1040 descriptor.value = unwrap(descriptor.value); 1041 } 1042 return descriptor; 1043 } 1044 function lockShadowTarget(membrane, shadowTarget, originalTarget) { 1045 const targetKeys = ArrayConcat.call(getOwnPropertyNames(originalTarget), getOwnPropertySymbols(originalTarget)); 1046 targetKeys.forEach((key) => { 1047 let descriptor = getOwnPropertyDescriptor(originalTarget, key); 1048 // We do not need to wrap the descriptor if configurable 1049 // Because we can deal with wrapping it when user goes through 1050 // Get own property descriptor. There is also a chance that this descriptor 1051 // could change sometime in the future, so we can defer wrapping 1052 // until we need to 1053 if (!descriptor.configurable) { 1054 descriptor = wrapDescriptor(membrane, descriptor, wrapValue); 1055 } 1056 ObjectDefineProperty(shadowTarget, key, descriptor); 1057 }); 1058 preventExtensions(shadowTarget); 1059 } 1060 class ReactiveProxyHandler { 1061 constructor(membrane, value) { 1062 this.originalTarget = value; 1063 this.membrane = membrane; 1064 } 1065 get(shadowTarget, key) { 1066 const { originalTarget, membrane } = this; 1067 const value = originalTarget[key]; 1068 const { valueObserved } = membrane; 1069 valueObserved(originalTarget, key); 1070 return membrane.getProxy(value); 1071 } 1072 set(shadowTarget, key, value) { 1073 const { originalTarget, membrane: { valueMutated } } = this; 1074 const oldValue = originalTarget[key]; 1075 if (oldValue !== value) { 1076 originalTarget[key] = value; 1077 valueMutated(originalTarget, key); 1078 } 1079 else if (key === 'length' && isArray(originalTarget)) { 1080 // fix for issue #236: push will add the new index, and by the time length 1081 // is updated, the internal length is already equal to the new length value 1082 // therefore, the oldValue is equal to the value. This is the forking logic 1083 // to support this use case. 1084 valueMutated(originalTarget, key); 1085 } 1086 return true; 1087 } 1088 deleteProperty(shadowTarget, key) { 1089 const { originalTarget, membrane: { valueMutated } } = this; 1090 delete originalTarget[key]; 1091 valueMutated(originalTarget, key); 1092 return true; 1093 } 1094 apply(shadowTarget, thisArg, argArray) { 1095 /* No op */ 1096 } 1097 construct(target, argArray, newTarget) { 1098 /* No op */ 1099 } 1100 has(shadowTarget, key) { 1101 const { originalTarget, membrane: { valueObserved } } = this; 1102 valueObserved(originalTarget, key); 1103 return key in originalTarget; 1104 } 1105 ownKeys(shadowTarget) { 1106 const { originalTarget } = this; 1107 return ArrayConcat.call(getOwnPropertyNames(originalTarget), getOwnPropertySymbols(originalTarget)); 1108 }
1109 isExtensible(shadowTarget) { 1110 const shadowIsExtensible = isExtensible(shadowTarget); 1111 if (!shadowIsExtensible) { 1112 return shadowIsExtensible; 1113 } 1114 const { originalTarget, membrane } = this; 1115 const targetIsExtensible = isExtensible(originalTarget); 1116 if (!targetIsExtensible) { 1117 lockShadowTarget(membrane, shadowTarget, originalTarget); 1118 } 1119 return targetIsExtensible; 1120 } 1121 setPrototypeOf(shadowTarget, prototype) { 1122 } 1123 getPrototypeOf(shadowTarget) { 1124 const { originalTarget } = this; 1125 return getPrototypeOf(originalTarget); 1126 } 1127 getOwnPropertyDescriptor(shadowTarget, key) { 1128 const { originalTarget, membrane } = this; 1129 const { valueObserved } = this.membrane; 1130 // keys looked up via hasOwnProperty need to be reactive 1131 valueObserved(originalTarget, key); 1132 let desc = getOwnPropertyDescriptor(originalTarget, key); 1133 if (isUndefined(desc)) { 1134 return desc; 1135 } 1136 const shadowDescriptor = getOwnPropertyDescriptor(shadowTarget, key); 1137 if (!isUndefined(shadowDescriptor)) { 1138 return shadowDescriptor; 1139 } 1140 // Note: by accessing the descriptor, the key is marked as observed 1141 // but access to the value, setter or getter (if available) cannot observe 1142 // mutations, just like regular methods, in which case we just do nothing. 1143 desc = wrapDescriptor(membrane, desc, wrapValue); 1144 if (!desc.configurable) { 1145 // If descriptor from original target is not configurable, 1146 // We must copy the wrapped descriptor over to the shadow target. 1147 // Otherwise, proxy will throw an invariant error. 1148 // This is our last chance to lock the value. 1149 // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/getOwnPropertyDescriptor#Invariants 1150 ObjectDefineProperty(shadowTarget, key, desc); 1151 } 1152 return desc; 1153 } 1154 preventExtensions(shadowTarget) { 1155 const { originalTarget, membrane } = this; 1156 lockShadowTarget(membrane, shadowTarget, originalTarget); 1157 preventExtensions(originalTarget); 1158 return true; 1159 } 1160 defineProperty(shadowTarget, key, descriptor) { 1161 const { originalTarget, membrane } = this; 1162 const { valueMutated } = membrane; 1163 const { configurable } = descriptor; 1164 // We have to check for value in descriptor 1165 // because Object.freeze(proxy) calls this method 1166 // with only { configurable: false, writeable: false } 1167 // Additionally, method will only be called with writeable:false 1168 // if the descriptor has a value, as opposed to getter/setter 1169 // So we can just check if writable is present and then see if 1170 // value is present. This eliminates getter and setter descriptors 1171 if (hasOwnProperty.call(descriptor, 'writable') && !hasOwnProperty.call(descriptor, 'value')) { 1172 const originalDescriptor = getOwnPropertyDescriptor(originalTarget, key); 1173 descriptor.value = originalDescriptor.value; 1174 } 1175 ObjectDefineProperty(originalTarget, key, unwrapDescriptor(descriptor)); 1176 if (configurable === false) { 1177 ObjectDefineProperty(shadowTarget, key, wrapDescriptor(membrane, descriptor, wrapValue)); 1178 } 1179 valueMutated(originalTarget, key); 1180 return true; 1181 } 1182 } 1183 1184 function wrapReadOnlyValue(membrane, value) { 1185 return membrane.valueIsObservable(value) ? membrane.getReadOnlyProxy(value) : value; 1186 } 1187 class ReadOnlyHandler { 1188 constructor(membrane, value) { 1189 this.originalTarget = value; 1190 this.membrane = membrane; 1191 } 1192 get(shadowTarget, key) { 1193 const { membrane, originalTarget } = this; 1194 const value = originalTarget[key]; 1195 const { valueObserved } = membrane; 1196 valueObserved(originalTarget, key); 1197 return membrane.getReadOnlyProxy(value); 1198 } 1199 set(shadowTarget, key, value) { 1200 return false; 1201 } 1202 deleteProperty(shadowTarget, key) { 1203 return false; 1204 } 1205 apply(shadowTarget, thisArg, argArray) { 1206 /* No op */ 1207 } 1208 construct(target, argArray, newTarget) { 1209 /* No op */ 1210 } 1211 has(shadowTarget, key) { 1212 const { originalTarget, membrane: { valueObserved } } = this; 1213 valueObserved(originalTarget, key); 1214 return key in originalTarget; 1215 } 1216 ownKeys(shadowTarget) { 1217 const { originalTarget } = this; 1218 return ArrayConcat.call(getOwnPropertyNames(originalTarget), getOwnPropertySymbols(originalTarget)); 1219 } 1220 setPrototypeOf(shadowTarget, prototype) { 1221 } 1222 getOwnPropertyDescriptor(shadowTarget, key) { 1223 const { originalTarget, membrane } = this; 1224 const { valueObserved } = membrane; 1225 // keys looked up via hasOwnProperty need to be reactive 1226 valueObserved(originalTarget, key); 1227 let desc = getOwnPropertyDescriptor(originalTarget, key); 1228 if (isUndefined(desc)) { 1229 return desc; 1230 } 1231 const shadowDescriptor = getOwnPropertyDescriptor(shadowTarget, key); 1232 if (!isUndefined(shadowDescriptor)) { 1233 return shadowDescriptor; 1234 } 1235 // Note: by accessing the descriptor, the key is marked as observed 1236 // but access to the value or getter (if available) cannot be observed,
1237 // just like regular methods, in which case we just do nothing. 1238 desc = wrapDescriptor(membrane, desc, wrapReadOnlyValue); 1239 if (hasOwnProperty.call(desc, 'set')) { 1240 desc.set = undefined; // readOnly membrane does not allow setters 1241 } 1242 if (!desc.configurable) { 1243 // If descriptor from original target is not configurable, 1244 // We must copy the wrapped descriptor over to the shadow target. 1245 // Otherwise, proxy will throw an invariant error. 1246 // This is our last chance to lock the value. 1247 // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/getOwnPropertyDescriptor#Invariants 1248 ObjectDefineProperty(shadowTarget, key, desc); 1249 } 1250 return desc; 1251 } 1252 preventExtensions(shadowTarget) { 1253 return false; 1254 } 1255 defineProperty(shadowTarget, key, descriptor) { 1256 return false; 1257 } 1258 } 1259 function createShadowTarget(value) { 1260 let shadowTarget = undefined; 1261 if (isArray(value)) { 1262 shadowTarget = []; 1263 } 1264 else if (isObject(value)) { 1265 shadowTarget = {}; 1266 } 1267 return shadowTarget; 1268 } 1269 const ObjectDotPrototype = Object.prototype; 1270 function defaultValueIsObservable(value) { 1271 // intentionally checking for null 1272 if (value === null) { 1273 return false; 1274 } 1275 // treat all non-object types, including undefined, as non-observable values 1276 if (typeof value !== 'object') { 1277 return false; 1278 } 1279 if (isArray(value)) { 1280 return true; 1281 } 1282 const proto = getPrototypeOf(value); 1283 return (proto === ObjectDotPrototype || proto === null || getPrototypeOf(proto) === null); 1284 } 1285 const defaultValueObserved = (obj, key) => { 1286 /* do nothing */ 1287 }; 1288 const defaultValueMutated = (obj, key) => { 1289 /* do nothing */ 1290 }; 1291 const defaultValueDistortion = (value) => value; 1292 function wrapDescriptor(membrane, descriptor, getValue) { 1293 const { set, get } = descriptor; 1294 if (hasOwnProperty.call(descriptor, 'value')) { 1295 descriptor.value = getValue(membrane, descriptor.value); 1296 } 1297 else { 1298 if (!isUndefined(get)) { 1299 descriptor.get = function () { 1300 // invoking the original getter with the original target 1301 return getValue(membrane, get.call(unwrap(this))); 1302 }; 1303 } 1304 if (!isUndefined(set)) { 1305 descriptor.set = function (value) { 1306 // At this point we don't have a clear indication of whether 1307 // or not a valid mutation will occur, we don't have the key, 1308 // and we are not sure why and how they are invoking this setter. 1309 // Nevertheless we preserve the original semantics by invoking the 1310 // original setter with the original target and the unwrapped value 1311 set.call(unwrap(this), membrane.unwrapProxy(value)); 1312 }; 1313 } 1314 } 1315 return descriptor; 1316 } 1317 class ReactiveMembrane { 1318 constructor(options) { 1319 this.valueDistortion = defaultValueDistortion; 1320 this.valueMutated = defaultValueMutated; 1321 this.valueObserved = defaultValueObserved; 1322 this.valueIsObservable = defaultValueIsObservable; 1323 this.objectGraph = new WeakMap(); 1324 if (!isUndefined(options)) { 1325 const { valueDistortion, valueMutated, valueObserved, valueIsObservable } = options; 1326 this.valueDistortion = isFunction(valueDistortion) ? valueDistortion : defaultValueDistortion; 1327 this.valueMutated = isFunction(valueMutated) ? valueMutated : defaultValueMutated; 1328 this.valueObserved = isFunction(valueObserved) ? valueObserved : defaultValueObserved; 1329 this.valueIsObservable = isFunction(valueIsObservable) ? valueIsObservable : defaultValueIsObservable; 1330 } 1331 } 1332 getProxy(value) { 1333 const unwrappedValue = unwrap(value); 1334 const distorted = this.valueDistortion(unwrappedValue); 1335 if (this.valueIsObservable(distorted)) { 1336 const o = this.getReactiveState(unwrappedValue, distorted); 1337 // when trying to extract the writable version of a readonly 1338 // we return the readonly. 1339 return o.readOnly === value ? value : o.reactive; 1340 } 1341 return distorted; 1342 } 1343 getReadOnlyProxy(value) { 1344 value = unwrap(value); 1345 const distorted = this.valueDistortion(value); 1346 if (this.valueIsObservable(distorted)) { 1347 return this.getReactiveState(value, distorted).readOnly; 1348 } 1349 return distorted; 1350 } 1351 unwrapProxy(p) { 1352 return unwrap(p); 1353 } 1354 getReactiveState(value, distortedValue) { 1355 const { objectGraph, } = this; 1356 let reactiveState = objectGraph.get(distortedValue); 1357 if (reactiveState) { 1358 return reactiveState; 1359 } 1360 const membrane = this; 1361 reactiveState = { 1362 get reactive() { 1363 const reactiveHandler = new ReactiveProxyHandler(membrane, distortedValue); 1364 // caching the reactive proxy after the first time it is accessed 1365 const proxy = new Proxy(createShadowTarget(distortedValue), reactiveHandler); 1366 registerProxy(proxy, value); 1367 ObjectDefineProperty(this, 'reactive', { value: proxy }); 1368 return proxy; 1369 }, 1370 get readOnly() { 1371 const readOnlyHandler = new ReadOnlyHandler(membrane, distortedValue); 1372 // caching the readOnly proxy after the first time it is accessed 1373 const proxy = new Proxy(createShadowTarget(distortedValue), readOnlyHandler); 1374 registerProxy(proxy, value); 1375 ObjectDefineProperty(this, 'readOnly', { value: proxy }); 1376 return proxy; 1377 } 1378 }; 1379 objectGraph.set(distortedValue, reactiveState); 1380 return reactiveState; 1381 } 1382 } 1383 /** version: 0.26.0 */ 1384 1385 function wrap(data, mutationCallback) { 1386 1387 let membrane = new ReactiveMembrane({ 1388 valueMutated(target, key) { 1389 mutationCallback(target, key); 1390 } 1391 1392 });
1393 return { 1394 data: membrane.getProxy(data), 1395 membrane: membrane 1396 }; 1397 } 1398 function unwrap$1(membrane, observable) { 1399 let unwrappedData = membrane.unwrapProxy(observable); 1400 let copy = {}; 1401 Object.keys(unwrappedData).forEach(key => { 1402 if (['$el', '$refs', '$nextTick', '$watch'].includes(key)) return; 1403 copy[key] = unwrappedData[key]; 1404 }); 1405 return copy; 1406 } 1407 1408 class Component { 1409 constructor(el, componentForClone = null) { 1410 this.$el = el; 1411 const dataAttr = this.$el.getAttribute('x-data'); 1412 const dataExpression = dataAttr === '' ? '{}' : dataAttr; 1413 const initExpression = this.$el.getAttribute('x-init'); 1414 this.unobservedData = componentForClone ? componentForClone.getUnobservedData() : saferEval(dataExpression, { 1415 $el: this.$el 1416 }); 1417 // Construct a Proxy-based observable. This will be used to handle reactivity. 1418 1419 let { 1420 membrane, 1421 data 1422 } = this.wrapDataInObservable(this.unobservedData); 1423 this.$data = data; 1424 this.membrane = membrane; // After making user-supplied data methods reactive, we can now add 1425 // our magic properties to the original data for access. 1426 1427 this.unobservedData.$el = this.$el; 1428 this.unobservedData.$refs = this.getRefsProxy(); 1429 this.nextTickStack = []; 1430 1431 this.unobservedData.$nextTick = callback => { 1432 this.nextTickStack.push(callback); 1433 }; 1434 1435 this.watchers = {}; 1436 1437 this.unobservedData.$watch = (property, callback) => { 1438 if (!this.watchers[property]) this.watchers[property] = []; 1439 this.watchers[property].push(callback); 1440 }; 1441 1442 let canonicalComponentElementReference = componentForClone ? componentForClone.$el : this.$el; // Register custom magic properties. 1443 1444 Object.entries(Alpine.magicProperties).forEach(([name, callback]) => { 1445 Object.defineProperty(this.unobservedData, `$${name}`, { 1446 get: function get() { 1447 return callback(canonicalComponentElementReference); 1448 } 1449 }); 1450 }); 1451 this.showDirectiveStack = []; 1452 this.showDirectiveLastElement; 1453 var initReturnedCallback; // If x-init is present AND we aren't cloning (skip x-init on clone) 1454
1455 if (initExpression && !componentForClone) { 1456 // We want to allow data manipulation, but not trigger DOM updates just yet. 1457 // We haven't even initialized the elements with their Alpine bindings. I mean c'mon. 1458 this.pauseReactivity = true; 1459 initReturnedCallback = this.evaluateReturnExpression(this.$el, initExpression); 1460 this.pauseReactivity = false; 1461 } // Register all our listeners and set all our attribute bindings. 1462 1463 1464 this.initializeElements(this.$el); // Use mutation observer to detect new elements being added within this component at run-time. 1465 // Alpine's just so darn flexible amirite? 1466 1467 this.listenForNewElementsToInitialize(); 1468 1469 if (typeof initReturnedCallback === 'function') { 1470 // Run the callback returned from the "x-init" hook to allow the user to do stuff after 1471 // Alpine's got it's grubby little paws all over everything. 1472 initReturnedCallback.call(this.$data); 1473 } 1474 1475 componentForClone || setTimeout(() => { 1476 Alpine.onComponentInitializeds.forEach(callback => callback(this)); 1477 }, 0); 1478 } 1479 1480 getUnobservedData() { 1481 return unwrap$1(this.membrane, this.$data); 1482 } 1483 1484 wrapDataInObservable(data) { 1485 var self = this; 1486 let updateDom = debounce(function () { 1487 self.updateElements(self.$el); 1488 }, 0); 1489 return wrap(data, (target, key) => { 1490 if (self.watchers[key]) { 1491 // If there's a watcher for this specific key, run it. 1492 self.watchers[key].forEach(callback => callback(target[key])); 1493 } else { 1494 // Let's walk through the watchers with "dot-notation" (foo.bar) and see 1495 // if this mutation fits any of them. 1496 Object.keys(self.watchers).filter(i => i.includes('.')).forEach(fullDotNotationKey => { 1497 let dotNotationParts = fullDotNotationKey.split('.'); // If this dot-notation watcher's last "part" doesn't match the current 1498 // key, then skip it early for performance reasons. 1499 1500 if (key !== dotNotationParts[dotNotationParts.length - 1]) return; // Now, walk through the dot-notation "parts" recursively to find 1501 // a match, and call the watcher if one's found. 1502 1503 dotNotationParts.reduce((comparisonData, part) => { 1504 if (Object.is(target, comparisonData)) { 1505 // Run the watchers. 1506 self.watchers[fullDotNotationKey].forEach(callback => callback(target[key])); 1507 } 1508 1509 return comparisonData[part]; 1510 }, self.getUnobservedData()); 1511 }); 1512 } // Don't react to data changes for cases like the `x-created` hook. 1513 1514 1515 if (self.pauseReactivity) return; 1516 updateDom(); 1517 }); 1518 } 1519 1520 walkAndSkipNestedComponents(el, callback, initializeComponentCallback = () => {}) { 1521 walk(el, el => { 1522 // We've hit a component. 1523 if (el.hasAttribute('x-data')) { 1524 // If it's not the current one. 1525 if (!el.isSameNode(this.$el)) { 1526 // Initialize it if it's not. 1527 if (!el.__x) initializeComponentCallback(el); // Now we'll let that sub-component deal with itself. 1528 1529 return false; 1530 } 1531 } 1532 1533 return callback(el); 1534 }); 1535 } 1536 1537 initializeElements(rootEl, extraVars = () => {}) { 1538 this.walkAndSkipNestedComponents(rootEl, el => { 1539 // Don't touch spawns from for loop 1540 if (el.__x_for_key !== undefined) return false; // Don't touch spawns from if directives 1541 1542 if (el.__x_inserted_me !== undefined) return false; 1543 this.initializeElement(el, extraVars); 1544 }, el => { 1545 el.__x = new Component(el); 1546 }); 1547 this.executeAndClearRemainingShowDirectiveStack(); 1548 this.executeAndClearNextTickStack(rootEl); 1549 } 1550 1551 initializeElement(el, extraVars) { 1552 // To support class attribute merging, we have to know what the element's 1553 // original class attribute looked like for reference. 1554 if (el.hasAttribute('class') && getXAttrs(el, this).length > 0) { 1555 el.__x_original_classes = convertClassStringToArray(el.getAttribute('class')); 1556 } 1557 1558 this.registerListeners(el, extraVars); 1559 this.resolveBoundAttributes(el, true, extraVars); 1560 } 1561 1562 updateElements(rootEl, extraVars = () => {}) { 1563 this.walkAndSkipNestedComponents(rootEl, el => { 1564 // Don't touch spawns from for loop (and check if the root is actually a for loop in a parent, don't skip it.) 1565 if (el.__x_for_key !== undefined && !el.isSameNode(this.$el)) return false; 1566 this.updateElement(el, extraVars); 1567 }, el => { 1568 el.__x = new Component(el); 1569 }); 1570 this.executeAndClearRemainingShowDirectiveStack(); 1571 this.executeAndClearNextTickStack(rootEl); 1572 } 1573 1574 executeAndClearNextTickStack(el) { 1575 // Skip spawns from alpine directives 1576 if (el === this.$el && this.nextTickStack.length > 0) { 1577 // We run the tick stack after the next frame to allow any 1578 // running transitions to pass the initial show stage. 1579 requestAnimationFrame(() => { 1580 while (this.nextTickStack.length > 0) { 1581 this.nextTickStack.shift()(); 1582 } 1583 }); 1584 } 1585 } 1586 1587 executeAndClearRemainingShowDirectiveStack() { 1588 // The goal here is to start all the x-show transitions 1589 // and build a nested promise chain so that elements 1590 // only hide when the children are finished hiding. 1591 this.showDirectiveStack.reverse().map(thing => { 1592 return new Promise(resolve => { 1593 thing(finish => { 1594 resolve(finish); 1595 }); 1596 }); 1597 }).reduce((nestedPromise, promise) => { 1598 return nestedPromise.then(() => { 1599 return promise.then(finish => finish()); 1600 }); 1601 }, Promise.resolve(() => {})); // We've processed the handler stack. let's clear it. 1602 1603 this.showDirectiveStack = []; 1604 this.showDirectiveLastElement = undefined; 1605 } 1606 1607 updateElement(el, extraVars) { 1608 this.resolveBoundAttributes(el, false, extraVars); 1609 } 1610 1611 registerListeners(el, extraVars) {
1612 getXAttrs(el, this).forEach(({ 1613 type, 1614 value, 1615 modifiers, 1616 expression 1617 }) => { 1618 switch (type) { 1619 case 'on': 1620 registerListener(this, el, value, modifiers, expression, extraVars); 1621 break; 1622 1623 case 'model': 1624 registerModelListener(this, el, modifiers, expression, extraVars); 1625 break; 1626 } 1627 }); 1628 } 1629 1630 resolveBoundAttributes(el, initialUpdate = false, extraVars) { 1631 let attrs = getXAttrs(el, this); 1632 1633 if (el.type !== undefined && el.type === 'radio') { 1634 // If there's an x-model on a radio input, move it to end of attribute list 1635 // to ensure that x-bind:value (if present) is processed first. 1636 const modelIdx = attrs.findIndex(attr => attr.type === 'model'); 1637 1638 if (modelIdx > -1) { 1639 attrs.push(attrs.splice(modelIdx, 1)[0]); 1640 } 1641 } 1642 1643 attrs.forEach(({ 1644 type, 1645 value, 1646 modifiers, 1647 expression 1648 }) => { 1649 switch (type) { 1650 case 'model': 1651 handleAttributeBindingDirective(this, el, 'value', expression, extraVars, type, modifiers); 1652 break; 1653 1654 case 'bind': 1655 // The :key binding on an x-for is special, ignore it. 1656 if (el.tagName.toLowerCase() === 'template' && value === 'key') return; 1657 handleAttributeBindingDirective(this, el, value, expression, extraVars, type, modifiers); 1658 break; 1659 1660 case 'text': 1661 var output = this.evaluateReturnExpression(el, expression, extraVars); 1662 handleTextDirective(el, output, expression); 1663 break; 1664 1665 case 'html': 1666 handleHtmlDirective(this, el, expression, extraVars); 1667 break; 1668 1669 case 'show': 1670 var output = this.evaluateReturnExpression(el, expression, extraVars); 1671 handleShowDirective(this, el, output, modifiers, initialUpdate); 1672 break; 1673 1674 case 'if': 1675 // If this element also has x-for on it, don't process x-if. 1676 // We will let the "x-for" directive handle the "if"ing. 1677 if (attrs.some(i => i.type === 'for')) return; 1678 var output = this.evaluateReturnExpression(el, expression, extraVars); 1679 handleIfDirective(this, el, output, initialUpdate, extraVars); 1680 break; 1681 1682 case 'for': 1683 handleForDirective(this, el, expression, initialUpdate, extraVars); 1684 break; 1685 1686 case 'cloak': 1687 el.removeAttribute('x-cloak'); 1688 break; 1689 } 1690 }); 1691 } 1692 1693 evaluateReturnExpression(el, expression, extraVars = () => {}) { 1694 return saferEval(expression, this.$data, _objectSpread2(_objectSpread2({}, extraVars()), {}, { 1695 $dispatch: this.getDispatchFunction(el) 1696 })); 1697 } 1698 1699 evaluateCommandExpression(el, expression, extraVars = () => {}) { 1700 return saferEvalNoReturn(expression, this.$data, _objectSpread2(_objectSpread2({}, extraVars()), {}, { 1701 $dispatch: this.getDispatchFunction(el) 1702 })); 1703 } 1704 1705 getDispatchFunction(el) { 1706 return (event, detail = {}) => { 1707 el.dispatchEvent(new CustomEvent(event, { 1708 detail, 1709 bubbles: true 1710 })); 1711 }; 1712 } 1713 1714 listenForNewElementsToInitialize() { 1715 const targetNode = this.$el; 1716 const observerOptions = { 1717 childList: true, 1718 attributes: true, 1719 subtree: true 1720 }; 1721 const observer = new MutationObserver(mutations => { 1722 for (let i = 0; i < mutations.length; i++) { 1723 // Filter out mutations triggered from child components. 1724 const closestParentComponent = mutations[i].target.closest('[x-data]'); 1725 if (!(closestParentComponent && closestParentComponent.isSameNode(this.$el))) continue; 1726 1727 if (mutations[i].type === 'attributes' && mutations[i].attributeName === 'x-data') { 1728 const rawData = saferEval(mutations[i].target.getAttribute('x-data') || '{}', { 1729 $el: this.$el 1730 });
1731 Object.keys(rawData).forEach(key => { 1732 if (this.$data[key] !== rawData[key]) { 1733 this.$data[key] = rawData[key]; 1734 } 1735 }); 1736 } 1737 1738 if (mutations[i].addedNodes.length > 0) { 1739 mutations[i].addedNodes.forEach(node => { 1740 if (node.nodeType !== 1 || node.__x_inserted_me) return; 1741 1742 if (node.matches('[x-data]') && !node.__x) { 1743 node.__x = new Component(node); 1744 return; 1745 } 1746 1747 this.initializeElements(node); 1748 }); 1749 } 1750 } 1751 }); 1752 observer.observe(targetNode, observerOptions); 1753 } 1754 1755 getRefsProxy() { 1756 var self = this; 1757 var refObj = {}; 1758 // One of the goals of this is to not hold elements in memory, but rather re-evaluate 1759 // the DOM when the system needs something from it. This way, the framework is flexible and 1760 // friendly to outside DOM changes from libraries like Vue/Livewire. 1761 // For this reason, I'm using an "on-demand" proxy to fake a "$refs" object. 1762 1763 return new Proxy(refObj, { 1764 get(object, property) { 1765 if (property === '$isAlpineProxy') return true; 1766 var ref; // We can't just query the DOM because it's hard to filter out refs in 1767 // nested components. 1768 1769 self.walkAndSkipNestedComponents(self.$el, el => { 1770 if (el.hasAttribute('x-ref') && el.getAttribute('x-ref') === property) { 1771 ref = el; 1772 } 1773 }); 1774 return ref; 1775 } 1776 1777 }); 1778 } 1779 1780 } 1781 1782 const Alpine = { 1783 version: "2.5.0", 1784 pauseMutationObserver: false, 1785 magicProperties: {}, 1786 onComponentInitializeds: [], 1787 start: async function start() { 1788 if (!isTesting()) { 1789 await domReady(); 1790 } 1791 1792 this.discoverComponents(el => { 1793 this.initializeComponent(el); 1794 }); // It's easier and more performant to just support Turbolinks than listen 1795 // to MutationObserver mutations at the document level. 1796 1797 document.addEventListener("turbolinks:load", () => { 1798 this.discoverUninitializedComponents(el => { 1799 this.initializeComponent(el); 1800 }); 1801 }); 1802 this.listenForNewUninitializedComponentsAtRunTime(el => { 1803 this.initializeComponent(el); 1804 }); 1805 }, 1806 discoverComponents: function discoverComponents(callback) { 1807 const rootEls = document.querySelectorAll('[x-data]'); 1808 rootEls.forEach(rootEl => { 1809 callback(rootEl); 1810 }); 1811 }, 1812 discoverUninitializedComponents: function discoverUninitializedComponents(callback, el = null) { 1813 const rootEls = (el || document).querySelectorAll('[x-data]'); 1814 Array.from(rootEls).filter(el => el.__x === undefined).forEach(rootEl => { 1815 callback(rootEl); 1816 }); 1817 }, 1818 listenForNewUninitializedComponentsAtRunTime: function listenForNewUninitializedComponentsAtRunTime(callback) { 1819 const targetNode = document.querySelector('body'); 1820 const observerOptions = { 1821 childList: true, 1822 attributes: true, 1823 subtree: true 1824 }; 1825 const observer = new MutationObserver(mutations => { 1826 if (this.pauseMutationObserver) return; 1827 1828 for (let i = 0; i < mutations.length; i++) { 1829 if (mutations[i].addedNodes.length > 0) { 1830 mutations[i].addedNodes.forEach(node => { 1831 // Discard non-element nodes (like line-breaks) 1832 if (node.nodeType !== 1) return; // Discard any changes happening within an existing component. 1833 // They will take care of themselves. 1834 1835 if (node.parentElement && node.parentElement.closest('[x-data]')) return; 1836 this.discoverUninitializedComponents(el => { 1837 this.initializeComponent(el); 1838 }, node.parentElement); 1839 }); 1840 } 1841 } 1842 }); 1843 observer.observe(targetNode, observerOptions); 1844 }, 1845 initializeComponent: function initializeComponent(el) { 1846 if (!el.__x) { 1847 // Wrap in a try/catch so that we don't prevent other components 1848 // from initializing when one component contains an error. 1849 try { 1850 el.__x = new Component(el); 1851 } catch (error) { 1852 setTimeout(() => { 1853 throw error; 1854 }, 0); 1855 } 1856 } 1857 }, 1858 clone: function clone(component, newEl) { 1859 if (!newEl.__x) { 1860 newEl.__x = new Component(newEl, component); 1861 } 1862 }, 1863 addMagicProperty: function addMagicProperty(name, callback) { 1864 this.magicProperties[name] = callback; 1865 }, 1866 onComponentInitialized: function onComponentInitialized(callback) { 1867 this.onComponentInitializeds.push(callback); 1868 } 1869 }; 1870 1871 if (!isTesting()) { 1872 window.Alpine = Alpine; 1873 1874 if (window.deferLoadingAlpine) { 1875 window.deferLoadingAlpine(function () { 1876 window.Alpine.start(); 1877 }); 1878 } else { 1879 window.Alpine.start(); 1880 } 1881 } 1882 1883 return Alpine; 1884 1885}))); 1886 1887/*! 1888 * shareon v1.4.1 by Nikita Karamov 1889 * https://shareon.js.org 1890 */ 1891 1892var shareon=function(){"use strict";var t={facebook:t=>"https://www.facebook.com/sharer/sharer.php?u="+t.url,linkedin:t=>`https://www.linkedin.com/shareArticle?mini=true&url=${t.url}&title=${t.title}`,messenger:t=>`https://www.facebook.com/dialog/send?app_id=3619024578167617&link=${t.url}&redirect_uri=${t.url}`,odnoklassniki:t=>`https://connect.ok.ru/offer?url=${t.url}&title=${t.title}${t.media?"&imageUrl="+t.media:""}`,pinterest:t=>`https://pinterest.com/pin/create/button/?url=${t.url}&description=${t.title}${t.media?"&media="+t.media:""}`,pocket:t=>"https://getpocket.com/edit.php?url="+t.url,reddit:t=>`https://www.reddit.com/submit?title=${t.title}&url=${t.url}`,telegram:t=>`https://telegram.me/share/url?url=${t.url}${t.text?"&text="+t.text:""}`,twitter:t=>`https://twitter.com/intent/tweet?url=${t.url}&text=${t.title}${t.via?"&via="+t.via:""}`,viber:t=>`viber://forward?text=${t.title}%0D%0A${t.url}${t.text?"%0D%0A%0D%0A"+t.text:""}
1892`,vkontakte:t=>`https://vk.com/share.php?url=${t.url}&title=${t.title}${t.media?"&image="+t.media:""}`,whatsapp:t=>`whatsapp://send?text=${t.title}%0D%0A${t.url}${t.text?"%0D%0A%0D%0A"+t.text:""}`};const e=()=>{const e=document.getElementsByClassName("shareon");for(let r=0;r<e.length;r+=1){const i=e[r];for(let e=0;e<i.children.length;e+=1){const r=i.children[e];if(r){const e=r.classList.length;for(let a=0;a<e;a+=1){const e=r.classList.item(a);if(Object.prototype.hasOwnProperty.call(t,e)){const a={url:encodeURIComponent(r.dataset.url||i.dataset.url||window.location.href),title:encodeURIComponent(r.dataset.title||i.dataset.title||document.title),media:encodeURIComponent(r.dataset.media||i.dataset.media||""),text:encodeURIComponent(r.dataset.text||i.dataset.text||""),via:encodeURIComponent(r.dataset.via||i.dataset.via||"")},o=t[e](a);"a"===r.tagName.toLowerCase()?(r.setAttribute("href",o),r.setAttribute("rel","noopener noreferrer"),r.setAttribute("target","_blank")):r.addEventListener("click",()=>{window.open(o,"_blank","noopener,noreferrer").opener=null});break}}}}}};return window.onload=()=>{e()},e}(); 1893 1894!function(e,t){if("function"==typeof define&&define.amd)define(function(){return t(e)});else if("object"==typeof module&&"object"==typeof module.exports)module.exports=t(e);else{var n=!e.Nette||!e.Nette.noInit;e.Nette=t(e),n&&e.Nette.initOnLoad()}}("undefined"!=typeof window?window:this,function(window){"use strict";var Nette={version:"2.3"};return Nette.addEvent=function(e,t,n){var r=e["on"+t];e["on"+t]=function(){return("function"!=typeof r||r.apply(e,arguments)!==!1)&&n.apply(e,arguments)}},Nette.getValue=function(e){var t;if(e){if(e.tagName){if("radio"===e.type){var n=e.form.elements;for(t=0;t<n.length;t++)if(n[t].name===e.name&&n[t].checked)return n[t].value;return null}if("file"===e.type)return e.files||e.value;if("select"===e.tagName.toLowerCase()){var r=e.selectedIndex,a=e.options,i=[];if("select-one"===e.type)return r<0?null:a[r].value;for(t=0;t<a.length;t++)a[t].selected&&i.push(a[t].value);return i}if(e.name&&e.name.match(/\[\]$/)){var n=e.form.elements[e.name].tagName?[e]:e.form.elements[e.name],i=[];for(t=0;t<n.length;t++)("checkbox"!==n[t].type||n[t].checked)&&i.push(n[t].value);return i}return"checkbox"===e.type?e.checked:"textarea"===e.tagName.toLowerCase()?e.value.replace("\r",""):e.value.replace("\r","").replace(/^\s+|\s+$/g,"")}return e[0]?Nette.getValue(e[0]):null}return null},Nette.getEffectiveValue=function(e){var t=Nette.getValue(e);return e.getAttribute&&t===e.getAttribute("data-nette-empty-value")&&(t=""),t},Nette.validateControl=function(e,t,n,r,a){e=e.tagName?e:e[0],t=t||Nette.parseJSON(e.getAttribute("data-nette-rules")),r=void 0===r?{value:Nette.getEffectiveValue(e)}:r;for(var i=0,u=t.length;i<u;i++){var l=t[i],o=l.op.match(/(~)?([^?]+)/),f=l.control?e.form.elements.namedItem(l.control):e;if(l.neg=o[1],l.op=o[2],l.condition=!!l.rules,f)if("optional"!==l.op){if(!a||l.condition||":filled"===l.op){f=f.tagName?f:f[0];var d=e===f?r:{value:Nette.getEffectiveValue(f)},s=Nette.validateRule(f,l.op,l.arg,d);if(null!==s)if(l.neg&&(s=!s),l.condition&&s){if(!Nette.validateControl(e,l.rules,n,r,":blank"!==l.op&&a))return!1}else if(!l.condition&&!s){if(Nette.isDisabled(f))continue;if(!n){var c=Nette.isArray(l.arg)?l.arg:[l.arg],g=l.msg.replace(/%(value|\d+)/g,function(t,n){return Nette.getValue("value"===n?f:e.form.elements.namedItem(c[n].control))});Nette.addError(f,g)}return!1}}}else a=!Nette.validateRule(e,":filled",null,r)}return!("number"===e.type&&!e.validity.valid)||(n||Nette.addError(e,"Please enter a valid value."),!1)},Nette.validateForm=function(e){var t=e.form||e,n=!1;if(t["nette-submittedBy"]&&null!==t["nette-submittedBy"].getAttribute("formnovalidate")){var r=Nette.parseJSON(t["nette-submittedBy"].getAttribute("data-nette-validation-scope"));if(!r.length)return!0;n=new RegExp("^("+r.join("-|")+"-)")}var a,i,u={};for(a=0;a<t.elements.length;a++)if(i=t.elements[a],!i.tagName||i.tagName.toLowerCase()in{input:1,select:1,textarea:1,button:1}){if("radio"===i.type){if(u[i.name])continue;u[i.name]=!0}if(!(n&&!i.name.replace(/]\[|\[|]|$/g,"-").match(n)||Nette.isDisabled(i)||Nette.validateControl(i)))return!1}return!0},Nette.isDisabled=function(e){if("radio"===e.type){for(var t=0,n=e.form.elements;t<n.length;t++)if(n[t].name===e.name&&!n[t].disabled)return!1;return!0}return e.disabled},Nette.addError=function(e,t){t&&alert(t),e.focus&&e.focus()},Nette.expandRuleArgument=function(e,t){return t&&t.control&&(t=Nette.getEffectiveValue(e.elements.namedItem(t.control))),t},Nette.validateRule=function(e,t,n,r){r=void 0===r?{value:Nette.getEffectiveValue(e)}:r,":"===t.charAt(0)&&(t=t.substr(1)),t=t.replace("::","_"),t=t.replace(/\\/g,"");for(var a=Nette.isArray(n)?n.slice(0):[n],i=0,u=a.length;i<u;i++)a[i]=Nette.expandRuleArgument(e.form,a[i]);return Nette.validators[t]?Nette.validators[t](e,Nette.isArray(n)?a:a[0],r.value,r):null},Nette.validators={filled:function(e,t,n){return!("number"!==e.type||!e.validity.badInput)||""!==n&&n!==!1&&null!==n&&(!Nette.isArray(n)||
1894!!n.length)&&(!window.FileList||!(n instanceof window.FileList)||n.length)},blank:function(e,t,n){return!Nette.validators.filled(e,t,n)},valid:function(e,t,n){return Nette.validateControl(e,null,!0)},equal:function(e,t,n){function r(e){return"number"==typeof e||"string"==typeof e?""+e:e===!0?"1":""}if(void 0===t)return null;n=Nette.isArray(n)?n:[n],t=Nette.isArray(t)?t:[t];e:for(var a=0,i=n.length;a<i;a++){for(var u=0,l=t.length;u<l;u++)if(r(n[a])===r(t[u]))continue e;return!1}return!0},notEqual:function(e,t,n){return void 0===t?null:!Nette.validators.equal(e,t,n)},minLength:function(e,t,n){if("number"===e.type){if(e.validity.tooShort)return!1;if(e.validity.badInput)return null}return n.length>=t},maxLength:function(e,t,n){if("number"===e.type){if(e.validity.tooLong)return!1;if(e.validity.badInput)return null}return n.length<=t},length:function(e,t,n){if("number"===e.type){if(e.validity.tooShort||e.validity.tooLong)return!1;if(e.validity.badInput)return null}return t=Nette.isArray(t)?t:[t,t],(null===t[0]||n.length>=t[0])&&(null===t[1]||n.length<=t[1])},email:function(e,t,n){return/^("([ !#-[\]-~]|\\[ -~])+"|[-a-z0-9!#$%&'*+\/=?^_`{|}~]+(\.[-a-z0-9!#$%&'*+\/=?^_`{|}~]+)*)@([0-9a-z\u00C0-\u02FF\u0370-\u1EFF]([-0-9a-z\u00C0-\u02FF\u0370-\u1EFF]{0,61}[0-9a-z\u00C0-\u02FF\u0370-\u1EFF])?\.)+[a-z\u00C0-\u02FF\u0370-\u1EFF]([-0-9a-z\u00C0-\u02FF\u0370-\u1EFF]{0,17}[a-z\u00C0-\u02FF\u0370-\u1EFF])?$/i.test(n)},url:function(e,t,n,r){return/^[a-z\d+.-]+:/.test(n)||(n="http://"+n),!!/^https?:\/\/((([-_0-9a-z\u00C0-\u02FF\u0370-\u1EFF]+\.)*[0-9a-z\u00C0-\u02FF\u0370-\u1EFF]([-0-9a-z\u00C0-\u02FF\u0370-\u1EFF]{0,61}[0-9a-z\u00C0-\u02FF\u0370-\u1EFF])?\.)?[a-z\u00C0-\u02FF\u0370-\u1EFF]([-0-9a-z\u00C0-\u02FF\u0370-\u1EFF]{0,17}[a-z\u00C0-\u02FF\u0370-\u1EFF])?|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}|\[[0-9a-f:]{3,39}\])(:\d{1,5})?(\/\S*)?$/i.test(n)&&(r.value=n,!0)},regexp:function(e,t,n){var r="string"==typeof t&&t.match(/^\/(.*)\/([imu]*)$/);try{return r&&new RegExp(r[1],r[2].replace("u","")).test(n)}catch(e){}},pattern:function(e,t,n){try{return"string"==typeof t?new RegExp("^(?:"+t+")$").test(n):null}catch(e){}},integer:function(e,t,n){return("number"!==e.type||!e.validity.badInput)&&/^-?[0-9]+$/.test(n)},float:function(e,t,n,r){return("number"!==e.type||!e.validity.badInput)&&(n=n.replace(" ","").replace(",","."),!!/^-?[0-9]*[.,]?[0-9]+$/.test(n)&&(r.value=n,!0))},min:function(e,t,n){if("number"===e.type){if(e.validity.rangeUnderflow)return!1;if(e.validity.badInput)return null}return null===t||parseFloat(n)>=t},max:function(e,t,n){if("number"===e.type){if(e.validity.rangeOverflow)return!1;if(e.validity.badInput)return null}return null===t||parseFloat(n)<=t},range:function(e,t,n){if("number"===e.type){if(e.validity.rangeUnderflow||e.validity.rangeOverflow)return!1;if(e.validity.badInput)return null}return Nette.isArray(t)?(null===t[0]||parseFloat(n)>=t[0])&&(null===t[1]||parseFloat(n)<=t[1]):null},submitted:function(e,t,n){return e.form["nette-submittedBy"]===e},fileSize:function(e,t,n){if(window.FileList)for(var r=0;r<n.length;r++)if(n[r].size>t)return!1;return!0},image:function(e,t,n){if(window.FileList&&n instanceof window.FileList)for(var r=0;r<n.length;r++){var a=n[r].type;if(a&&"image/gif"!==a&&"image/png"!==a&&"image/jpeg"!==a)return!1}return!0}},Nette.toggleForm=function(e,t){var n;for(Nette.toggles={},n=0;n<e.elements.length;n++)e.elements[n].tagName.toLowerCase()in{input:1,select:1,textarea:1,button:1}&&Nette.toggleControl(e.elements[n],null,null,!t);for(n in Nette.toggles)Nette.toggle(n,Nette.toggles[n],t)},Nette.toggleControl=function(e,t,n,r,a){t=t||Nette.parseJSON(e.getAttribute("data-nette-rules")),a=void 0===a?{value:Nette.getEffectiveValue(e)}:a;for(var i,u=!1,l=[],o=function(){Nette.toggleForm(e.form,e)},f=0,d=t.length;f<d;f++){var s=t[f],c=s.op.match(/(~)?([^?]+)/),g=s.control?e.form.elements.namedItem(s.control):e;if(g){if(i=n,n!==!1){s.neg=c[1],s.op=c[2];var m=e===g?a:{value:Nette.getEffectiveValue(g)};if(i=Nette.validateRule(g,s.op,s.arg,m),null===i)continue;s.neg&&(i=!i),s.rules||(n=i)}if(s.rules&&Nette.toggleControl(e,s.rules,i,r,a)||s.toggle){if(u=!0,r)for(var v=!document.addEventListener,p=g.tagName?g.n
1894ame:g[0].name,N=g.tagName?g.form.elements:g,y=0;y<N.length;y++)N[y].name!==p||Nette.inArray(l,N[y])||(Nette.addEvent(N[y],v&&N[y].type in{checkbox:1,radio:1}?"click":"change",o),l.push(N[y]));for(var F in s.toggle||[])Object.prototype.hasOwnProperty.call(s.toggle,F)&&(Nette.toggles[F]=Nette.toggles[F]||(s.toggle[F]?i:!i))}}}return u},Nette.parseJSON=function(s){return s=s||"[]","{op"===s.substr(0,3)?eval("["+s+"]"):window.JSON&&window.JSON.parse?JSON.parse(s):eval(s)},Nette.toggle=function(e,t,n){var r=document.getElementById(e);r&&(r.style.display=t?"":"none")},Nette.initForm=function(e){e.noValidate="novalidate",Nette.addEvent(e,"submit",function(t){if(!Nette.validateForm(e))return t&&t.stopPropagation?t.stopPropagation():window.event&&(event.cancelBubble=!0),!1}),Nette.addEvent(e,"click",function(t){t=t||event;var n=t.target||t.srcElement;e["nette-submittedBy"]=n.type in{submit:1,image:1}?n:null}),Nette.toggleForm(e)},Nette.initOnLoad=function(){Nette.addEvent(window,"load",function(){for(var e=0;e<document.forms.length;e++)for(var t=document.forms[e],n=0;n<t.elements.length;n++)if(t.elements[n].getAttribute("data-nette-rules")){Nette.initForm(t);break}})},Nette.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},Nette.inArray=function(e,t){if([].indexOf)return e.indexOf(t)>-1;for(var n=0;n<e.length;n++)if(e[n]===t)return!0;return!1},Nette.webalize=function(e){e=e.toLowerCase();var t,n,r="";for(t=0;t<e.length;t++)n=Nette.webalizeTable[e.charAt(t)],r+=n?n:e.charAt(t);return r.replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")},Nette.webalizeTable={"á":"a","ä":"a","Ä":"c","Ä":"d","é":"e","Ä":"e","Ã":"i","ľ":"l","Å":"n","ó":"o","ô":"o","Å":"r","Å¡":"s","Å¥":"t","ú":"u","ů":"u","ý":"y","ž":"z"},Nette}); 1895function EventsDispatcher(){this.listeners={},this.addListener=function(e,t,i){this.addListenerSelectorEvent(e,void 0,void 0,t,i)},this.addListenerSelector=function(e,t,i,n){this.addListenerSelectorEvent(e,t,void 0,i,n)},this.addListenerSelectorEvent=function(e,t,i,n,s){var r=this.listeners[e]={callback:n,selector:t,event:i,context:s?s:{}};r.context._dispatcher=this},this.removeListener=function(e){delete this.listeners[e]},this.dispatchEvent=function(e,t){var i=this;for(var n in this.listeners){var s=this.listeners[n];if(void 0!==s.selector){var r,c=e.querySelectorAll(s.selector);for(r=0;r<c.length;++r){var o=c[r];void 0!==s.event?!function(n,s){n.addEventListener(s.event,function(r){i.fireListener(s.callback,s.context,[n,r,e,t])})}(o,s):i.fireListener(s.callback,s.context,[o,e,t])}}else i.fireListener(s.callback,s.context,[e,t])}},this.fireListener=function(e,t,i){e.apply(t,i)}} 1896Object.defineProperty(HTMLMediaElement.prototype,"playing",{get:function(){return!!(this.currentTime>0&&!this.paused&&!this.ended&&this.readyState>2)}});var Timer=function(i,t){var e,s,n=t;this.pause=function(){window.clearTimeout(e),n-=Date.now()-s},this.resume=function(){s=Date.now(),window.clearTimeout(e),e=window.setTimeout(i,n)},this.clear=function(){window.clearTimeout(e)},this.resume()};Slider=function(){return{slides:[],active:0,transition:!1,timer:null,__init:function(){[].forEach.call(this.$el.querySelectorAll(".slide"),function(i){this.slides.push(i)}.bind(this)),this._setTimer()},next:function(){this.transition===!1&&(null!==this.timer&&this.timer.clear(),this.transition=!0,setTimeout(function(){this._videoPause(),this.active=this.active===this.slides.length-1?0:this.active+1,this.transition=!1,this._setTimer()}.bind(this),1e3))},pause:function(){this.transition===!1&&null!==this.timer&&(this.timer.pause(),this._videoPause())},resume:function(){this.transition===!1&&null!==this.timer&&(this.timer.resume(),this._videoPause())},_setTimer:function(){this._videoPlay(),this.timer=new Timer(function(){this.next()}.bind(this),1e3*this.slides[this.active].getAttribute("data-duration")-1e3)},_videoPlay:function(){var i=this.slides[this.active].querySelector("video");return i&&(isNaN(i.duration)||(i.currentTime=0),i.play()),i},_videoPause:function(){var i=this.slides[this.active].querySelector("video");return i&&(i.playing?i.pause():i.play()),i}}};
1897var binds=new EventsDispatcher;binds.addListenerSelector("singlemarks","h1, h2, h3, h4, h5, p, .singlemarks",function(e){var n=e.innerHTML;n=n.replace(/(\s|^)(a|i|k|o|s|u|v|z)(\s+)([^\p{Cc}\p{Cf}\p{Zp}]+)/gim,"$1$2 $4"),e.innerHTML=n}),binds.dispatchEvent(document,"init"),HSTable=function(){return{__init:function(e){var n=this.$el;n.style.display="none";var a=document.createElement("div");n.parentNode.insertBefore(a,n.nextSibling);new Handsontable(a,{rowHeaders:!1,colHeaders:!1,columns:e,minSpareRows:1,contextMenu:!0,stretchH:"all",afterChange:function(e,a){"loadData"!==a&&(n.value=JSON.stringify(this.getData()))},afterRemoveRow:function(e,a){"loadData"!==a&&(n.value=JSON.stringify(this.getData()))}}).loadData(n.value?$.parseJSON(n.value):[])}}};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.