PNG  IHDR pHYs   OiCCPPhotoshop ICC profilexڝSgTS=BKKoR RB&*! J!QEEȠQ, !{kּ> H3Q5 B.@ $pd!s#~<<+"x M0B\t8K@zB@F&S`cbP-`'{[! eDh;VEX0fK9-0IWfH  0Q){`##xFW<+*x<$9E[-qWW.(I+6aa@.y24x6_-"bbϫp@t~,/;m%h^ uf@Wp~<5j>{-]cK'Xto(hw?G%fIq^D$.Tʳ?D*A, `6B$BB dr`)B(Ͱ*`/@4Qhp.U=pa( Aa!ڈbX#!H$ ɈQ"K5H1RT UH=r9\F;2G1Q= C7F dt1r=6Ыhڏ>C03l0.B8, c˱" VcϱwE 6wB aAHXLXNH $4 7 Q'"K&b21XH,#/{C7$C2'ITFnR#,4H#dk9, +ȅ3![ b@qS(RjJ4e2AURݨT5ZBRQ4u9̓IKhhitݕNWGw Ljg(gwLӋT071oUX**| J&*/Tު UUT^S}FU3S ԖUPSSg;goT?~YYLOCQ_ cx,!k u5&|v*=9C3J3WRf?qtN (~))4L1e\kXHQG6EYAJ'\'GgSSݧ M=:.kDwn^Loy}/TmG X $ <5qo</QC]@Caaᄑ.ȽJtq]zۯ6iܟ4)Y3sCQ? 0k߬~OCOg#/c/Wװwa>>r><72Y_7ȷOo_C#dz%gA[z|!?:eAAA!h쐭!ΑiP~aa~ 'W?pX15wCsDDDޛg1O9-J5*>.j<74?.fYXXIlK9.*6nl {/]py.,:@LN8A*%w% yg"/6шC\*NH*Mz쑼5y$3,幄'L Lݛ:v m2=:1qB!Mggfvˬen/kY- BTZ(*geWf͉9+̳ې7ᒶKW-X潬j9(xoʿܔĹdff-[n ڴ VE/(ۻCɾUUMfeI?m]Nmq#׹=TR+Gw- 6 U#pDy  :v{vg/jBFS[b[O>zG499?rCd&ˮ/~јѡ򗓿m|x31^VwwO| (hSЧc3- cHRMz%u0`:o_F@8N ' p @8N@8}' p '#@8N@8N pQ9p!i~}|6-ӪG` VP.@*j>[ K^<֐Z]@8N'KQ<Q(`s" 'hgpKB`R@Dqj '  'P$a ( `D$Na L?u80e J,K˷NI'0eݷ(NI'؀ 2ipIIKp`:O'`ʤxB8Ѥx Ѥx $ $P6 :vRNb 'p,>NB 'P]-->P T+*^h& p '‰a ‰ (ĵt#u33;Nt̵'ޯ; [3W ~]0KH1q@8]O2]3*̧7# *p>us p _6]/}-4|t'|Smx= DoʾM×M_8!)6lq':l7!|4} '\ne t!=hnLn (~Dn\+‰_4k)0e@OhZ`F `.m1} 'vp{F`ON7Srx 'D˸nV`><;yMx!IS钦OM)Ե٥x 'DSD6bS8!" ODz#R >S8!7ّxEh0m$MIPHi$IvS8IN$I p$O8I,sk&I)$IN$Hi$I^Ah.p$MIN$IR8I·N "IF9Ah0m$MIN$IR8IN$I 3jIU;kO$ɳN$+ q.x* tEXtComment

Viewing File: /home/u403625155/domains/oceanheightcap.com/public_html/js/vendors/plyr.min.js

"object"==typeof navigator&&function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define("Plyr",t):(e=e||self).Plyr=t()}(this,(function(){"use strict";function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function i(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}function n(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=[],n=!0,a=!1,s=void 0;try{for(var o,r=e[Symbol.iterator]();!(n=(o=r.next()).done)&&(i.push(o.value),!t||i.length!==t);n=!0);}catch(e){a=!0,s=e}finally{try{n||null==r.return||r.return()}finally{if(a)throw s}}return i}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function s(e){return function(e){if(Array.isArray(e)){for(var t=0,i=new Array(e.length);t<e.length;t++)i[t]=e[t];return i}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var o={addCSS:!0,thumbWidth:15,watch:!0},r=function(e){return null!=e?e.constructor:null},l=function(e,t){return Boolean(e&&t&&e instanceof t)},c=function(e){return null==e},u=function(e){return r(e)===Object},d=function(e){return r(e)===String},h=function(e){return Array.isArray(e)},p=function(e){return l(e,NodeList)},m=d,f=h,g=p,y=function(e){return l(e,Element)},v=function(e){return l(e,Event)},b=function(e){return c(e)||(d(e)||h(e)||p(e))&&!e.length||u(e)&&!Object.keys(e).length};var k,w,T,C=function(){function t(i,n){e(this,t),y(i)?this.element=i:m(i)&&(this.element=document.querySelector(i)),y(this.element)&&b(this.element.rangeTouch)&&(this.config=Object.assign({},o,n),this.init())}return i(t,[{key:"init",value:function(){t.enabled&&(this.config.addCSS&&(this.element.style.userSelect="none",this.element.style.webKitUserSelect="none",this.element.style.touchAction="manipulation"),this.listeners(!0),this.element.rangeTouch=this)}},{key:"destroy",value:function(){t.enabled&&(this.listeners(!1),this.element.rangeTouch=null)}},{key:"listeners",value:function(e){var t=this,i=e?"addEventListener":"removeEventListener";["touchstart","touchmove","touchend"].forEach((function(e){t.element[i](e,(function(e){return t.set(e)}),!1)}))}},{key:"get",value:function(e){if(!t.enabled||!v(e))return null;var i,n=e.target,a=e.changedTouches[0],s=parseFloat(n.getAttribute("min"))||0,o=parseFloat(n.getAttribute("max"))||100,r=parseFloat(n.getAttribute("step"))||1,l=o-s,c=n.getBoundingClientRect(),u=100/c.width*(this.config.thumbWidth/2)/100;return(i=100/c.width*(a.clientX-c.left))<0?i=0:i>100&&(i=100),i<50?i-=(100-2*i)*u:i>50&&(i+=2*(i-50)*u),s+function(e,t){if(t<1){var i=(n="".concat(t).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/))?Math.max(0,(n[1]?n[1].length:0)-(n[2]?+n[2]:0)):0;return parseFloat(e.toFixed(i))}var n;return Math.round(e/t)*t}(l*(i/100),r)}},{key:"set",value:function(e){t.enabled&&v(e)&&!e.target.disabled&&(e.preventDefault(),e.target.value=this.get(e),function(e,t){if(e&&t){var i=new Event(t);e.dispatchEvent(i)}}(e.target,"touchend"===e.type?"change":"input"))}}],[{key:"setup",value:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null;if(b(e)||m(e)?n=Array.from(document.querySelectorAll(m(e)?e:'input[type="range"]')):y(e)?n=[e]:g(e)?n=Array.from(e):f(e)&&(n=e.filter(y)),b(n))return null;var a=Object.assign({},o,i);return m(e)&&a.watch&&new MutationObserver((function(i){Array.from(i).forEach((function(i){Array.from(i.addedNodes).forEach((function(i){var n;y(i)&&function(){return Array.from(document.querySelectorAll(n)).includes(this)}.call(i,n=e)&&new t(i,a)}))}))})).observe(document.body,{childList:!0,subtree:!0}),n.map((function(e){return new t(e,i)}))}},{key:"enabled",get:function(){return"ontouchstart"in document.documentElement}}]),t}(),A=function(e){return null!=e?e.constructor:null},E=function(e,t){return Boolean(e&&t&&e instanceof t)},S=function(e){return null==e},P=function(e){return A(e)===Object},M=function(e){return A(e)===String},N=function(e){return Array.isArray(e)},x=function(e){return E(e,NodeList)},I=function(e){return S(e)||(M(e)||N(e)||x(e))&&!e.length||P(e)&&!Object.keys(e).length},L=S,_=P,O=function(e){return A(e)===Number&&!Number.isNaN(e)},q=M,H=function(e){return A(e)===Boolean},j=function(e){return A(e)===Function},D=N,F=x,R=function(e){return E(e,Element)},V=function(e){return E(e,Event)},B=function(e){return E(e,KeyboardEvent)},U=function(e){return E(e,TextTrack)||!S(e)&&M(e.kind)},W=function(e){if(E(e,window.URL))return!0;if(!M(e))return!1;var t=e;e.startsWith("http://")&&e.startsWith("https://")||(t="http://".concat(e));try{return!I(new URL(t).hostname)}catch(e){return!1}},z=I,K=(k=document.createElement("span"),w={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},T=Object.keys(w).find((function(e){return void 0!==k.style[e]})),!!q(T)&&w[T]);function Y(e,t){setTimeout((function(){try{e.hidden=!0,e.offsetHeight,e.hidden=!1}catch(e){}}),t)}var Q={isIE:!!document.documentMode,isEdge:window.navigator.userAgent.includes("Edge"),isWebkit:"WebkitAppearance"in document.documentElement.style&&!/Edge/.test(navigator.userAgent),isIPhone:/(iPhone|iPod)/gi.test(navigator.platform),isIos:/(iPad|iPhone|iPod)/gi.test(navigator.platform)},X=function(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){return e=!0,null}});window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch(e){}return e}();function J(e,t,i){var n=this,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(e&&"addEventListener"in e&&!z(t)&&j(i)){var r=t.split(" "),l=o;X&&(l={passive:s,capture:o}),r.forEach((function(t){n&&n.eventListeners&&a&&n.eventListeners.push({element:e,type:t,callback:i,options:l}),e[a?"addEventListener":"removeEventListener"](t,i,l)}))}}function $(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2?arguments[2]:void 0,n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];J.call(this,e,t,i,!0,n,a)}function G(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2?arguments[2]:void 0,n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];J.call(this,e,t,i,!1,n,a)}function Z(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],s=arguments.length>4&&void 0!==arguments[4]&&arguments[4];J.call(this,e,i,(function o(){G(e,i,o,a,s);for(var r=arguments.length,l=new Array(r),c=0;c<r;c++)l[c]=arguments[c];n.apply(t,l)}),!0,a,s)}function ee(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(R(e)&&!z(t)){var a=new CustomEvent(t,{bubbles:i,detail:Object.assign({},n,{plyr:this})});e.dispatchEvent(a)}}function te(e,t){return t.split(".").reduce((function(e,t){return e&&e[t]}),e)}function ie(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length,i=new Array(t>1?t-1:0),a=1;a<t;a++)i[a-1]=arguments[a];if(!i.length)return e;var s=i.shift();return _(s)?(Object.keys(s).forEach((function(t){_(s[t])?(Object.keys(e).includes(t)||Object.assign(e,n({},t,{})),ie(e[t],s[t])):Object.assign(e,n({},t,s[t]))})),ie.apply(void 0,[e].concat(i))):e}function ne(e,t){var i=e.length?e:[e];Array.from(i).reverse().forEach((function(e,i){var n=i>0?t.cloneNode(!0):t,a=e.parentNode,s=e.nextSibling;n.appendChild(e),s?a.insertBefore(n,s):a.appendChild(n)}))}function ae(e,t){R(e)&&!z(t)&&Object.entries(t).filter((function(e){var t=a(e,2)[1];return!L(t)})).forEach((function(t){var i=a(t,2),n=i[0],s=i[1];return e.setAttribute(n,s)}))}function se(e,t,i){var n=document.createElement(e);return _(t)&&ae(n,t),q(i)&&(n.innerText=i),n}function oe(e,t,i,n){R(t)&&t.appendChild(se(e,i,n))}function re(e){F(e)||D(e)?Array.from(e).forEach(re):R(e)&&R(e.parentNode)&&e.parentNode.removeChild(e)}function le(e){if(R(e))for(var t=e.childNodes.length;t>0;)e.removeChild(e.lastChild),t-=1}function ce(e,t){return R(t)&&R(t.parentNode)&&R(e)?(t.parentNode.replaceChild(e,t),e):null}function ue(e,t){if(!q(e)||z(e))return{};var i={},n=ie({},t);return e.split(",").forEach((function(e){var t=e.trim(),s=t.replace(".",""),o=t.replace(/[[\]]/g,"").split("="),r=a(o,1)[0],l=o.length>1?o[1].replace(/["']/g,""):"";switch(t.charAt(0)){case".":q(n.class)?i.class="".concat(n.class," ").concat(s):i.class=s;break;case"#":i.id=t.replace("#","");break;case"[":i[r]=l}})),ie(n,i)}function de(e,t){if(R(e)){var i=t;H(i)||(i=!e.hidden),e.hidden=i}}function he(e,t,i){if(F(e))return Array.from(e).map((function(e){return he(e,t,i)}));if(R(e)){var n="toggle";return void 0!==i&&(n=i?"add":"remove"),e.classList[n](t),e.classList.contains(t)}return!1}function pe(e,t){return R(e)&&e.classList.contains(t)}function me(e,t){return function(){return Array.from(document.querySelectorAll(t)).includes(this)}.call(e,t)}function fe(e){return this.elements.container.querySelectorAll(e)}function ge(e){return this.elements.container.querySelector(e)}function ye(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];R(e)&&(e.focus({preventScroll:!0}),t&&he(e,this.config.classNames.tabFocus))}var ve,be={"audio/ogg":"vorbis","audio/wav":"1","video/webm":"vp8, vorbis","video/mp4":"avc1.42E01E, mp4a.40.2","video/ogg":"theora"},ke={audio:"canPlayType"in document.createElement("audio"),video:"canPlayType"in document.createElement("video"),check:function(e,t,i){var n=Q.isIPhone&&i&&ke.playsinline,a=ke[e]||"html5"!==t;return{api:a,ui:a&&ke.rangeInput&&("video"!==e||!Q.isIPhone||n)}},pip:!(Q.isIPhone||!j(se("video").webkitSetPresentationMode)&&(!document.pictureInPictureEnabled||se("video").disablePictureInPicture)),airplay:j(window.WebKitPlaybackTargetAvailabilityEvent),playsinline:"playsInline"in document.createElement("video"),mime:function(e){if(z(e))return!1;var t=a(e.split("/"),1)[0],i=e;if(!this.isHTML5||t!==this.type)return!1;Object.keys(be).includes(i)&&(i+='; codecs="'.concat(be[e],'"'));try{return Boolean(i&&this.media.canPlayType(i).replace(/no/,""))}catch(e){return!1}},textTracks:"textTracks"in document.createElement("video"),rangeInput:(ve=document.createElement("input"),ve.type="range","range"===ve.type),touch:"ontouchstart"in document.documentElement,transitions:!1!==K,reducedMotion:"matchMedia"in window&&window.matchMedia("(prefers-reduced-motion)").matches};function we(e){return!!(D(e)||q(e)&&e.includes(":"))&&(D(e)?e:e.split(":")).map(Number).every(O)}function Te(e){if(!D(e)||!e.every(O))return null;var t=a(e,2),i=t[0],n=t[1],s=function e(t,i){return 0===i?t:e(i,t%i)}(i,n);return[i/s,n/s]}function Ce(e){var t=function(e){return we(e)?e.split(":").map(Number):null},i=t(e);if(null===i&&(i=t(this.config.ratio)),null===i&&!z(this.embed)&&D(this.embed.ratio)&&(i=this.embed.ratio),null===i&&this.isHTML5){var n=this.media;i=Te([n.videoWidth,n.videoHeight])}return i}function Ae(e){if(!this.isVideo)return{};var t=Ce.call(this,e),i=a(D(t)?t:[0,0],2),n=100/i[0]*i[1];if(this.elements.wrapper.style.paddingBottom="".concat(n,"%"),this.isVimeo&&this.supported.ui){var s=(240-n)/4.8;this.media.style.transform="translateY(-".concat(s,"%)")}else this.isHTML5&&this.elements.wrapper.classList.toggle(this.config.classNames.videoFixedRatio,null!==t);return{padding:n,ratio:t}}var Ee={getSources:function(){var e=this;return this.isHTML5?Array.from(this.media.querySelectorAll("source")).filter((function(t){var i=t.getAttribute("type");return!!z(i)||ke.mime.call(e,i)})):[]},getQualityOptions:function(){return Ee.getSources.call(this).map((function(e){return Number(e.getAttribute("size"))})).filter(Boolean)},extend:function(){if(this.isHTML5){var e=this;z(this.config.ratio)||Ae.call(e),Object.defineProperty(e.media,"quality",{get:function(){var t=Ee.getSources.call(e).find((function(t){return t.getAttribute("src")===e.source}));return t&&Number(t.getAttribute("size"))},set:function(t){var i=Ee.getSources.call(e).find((function(e){return Number(e.getAttribute("size"))===t}));if(i){var n=e.media,a=n.currentTime,s=n.paused,o=n.preload,r=n.readyState;e.media.src=i.getAttribute("src"),("none"!==o||r)&&(e.once("loadedmetadata",(function(){e.currentTime=a,s||e.play()})),e.media.load()),ee.call(e,e.media,"qualitychange",!1,{quality:t})}}})}},cancelRequests:function(){this.isHTML5&&(re(Ee.getSources.call(this)),this.media.setAttribute("src",this.config.blankVideo),this.media.load(),this.debug.log("Cancelled network requests"))}};function Se(e){return D(e)?e.filter((function(t,i){return e.indexOf(t)===i})):e}function Pe(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];return z(e)?e:e.toString().replace(/{(\d+)}/g,(function(e,t){return i[t].toString()}))}function Me(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return e.replace(new RegExp(t.toString().replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1"),"g"),i.toString())}function Ne(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").toString().replace(/\w\S*/g,(function(e){return e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()}))}function xe(e){var t=document.createElement("div");return t.appendChild(e),t.innerHTML}var Ie={pip:"PIP",airplay:"AirPlay",html5:"HTML5",vimeo:"Vimeo",youtube:"YouTube"},Le=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(z(e)||z(t))return"";var i=te(t.i18n,e);if(z(i))return Object.keys(Ie).includes(e)?Ie[e]:"";var n={"{seektime}":t.seekTime,"{title}":t.title};return Object.entries(n).forEach((function(e){var t=a(e,2),n=t[0],s=t[1];i=Me(i,n,s)})),i},_e=function(){function t(i){e(this,t),this.enabled=i.config.storage.enabled,this.key=i.config.storage.key}return i(t,[{key:"get",value:function(e){if(!t.supported||!this.enabled)return null;var i=window.localStorage.getItem(this.key);if(z(i))return null;var n=JSON.parse(i);return q(e)&&e.length?n[e]:n}},{key:"set",value:function(e){if(t.supported&&this.enabled&&_(e)){var i=this.get();z(i)&&(i={}),ie(i,e),window.localStorage.setItem(this.key,JSON.stringify(i))}}}],[{key:"supported",get:function(){try{return"localStorage"in window&&(window.localStorage.setItem("___test","___test"),window.localStorage.removeItem("___test"),!0)}catch(e){return!1}}}]),t}();function Oe(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"text";return new Promise((function(i,n){try{var a=new XMLHttpRequest;if(!("withCredentials"in a))return;a.addEventListener("load",(function(){if("text"===t)try{i(JSON.parse(a.responseText))}catch(e){i(a.responseText)}else i(a.response)})),a.addEventListener("error",(function(){throw new Error(a.status)})),a.open("GET",e,!0),a.responseType=t,a.send()}catch(e){n(e)}}))}function qe(e,t){if(q(e)){var i=q(t),n=function(){return null!==document.getElementById(t)},a=function(e,t){e.innerHTML=t,i&&n()||document.body.insertAdjacentElement("afterbegin",e)};if(!i||!n()){var s=_e.supported,o=document.createElement("div");if(o.setAttribute("hidden",""),i&&o.setAttribute("id",t),s){var r=window.localStorage.getItem("".concat("cache","-").concat(t));if(null!==r){var l=JSON.parse(r);a(o,l.content)}}Oe(e).then((function(e){z(e)||(s&&window.localStorage.setItem("".concat("cache","-").concat(t),JSON.stringify({content:e})),a(o,e))})).catch((function(){}))}}}var He=function(e){return Math.trunc(e/60/60%60,10)},je=function(e){return Math.trunc(e/60%60,10)},De=function(e){return Math.trunc(e%60,10)};function Fe(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!O(e))return Fe(null,t,i);var n=function(e){return"0".concat(e).slice(-2)},a=He(e),s=je(e),o=De(e);return a=t||a>0?"".concat(a,":"):"","".concat(i&&e>0?"-":"").concat(a).concat(n(s),":").concat(n(o))}var Re={getIconUrl:function(){var e=new URL(this.config.iconUrl,window.location).host!==window.location.host||Q.isIE&&!window.svg4everybody;return{url:this.config.iconUrl,cors:e}},findElements:function(){try{return this.elements.controls=ge.call(this,this.config.selectors.controls.wrapper),this.elements.buttons={play:fe.call(this,this.config.selectors.buttons.play),pause:ge.call(this,this.config.selectors.buttons.pause),restart:ge.call(this,this.config.selectors.buttons.restart),rewind:ge.call(this,this.config.selectors.buttons.rewind),fastForward:ge.call(this,this.config.selectors.buttons.fastForward),mute:ge.call(this,this.config.selectors.buttons.mute),pip:ge.call(this,this.config.selectors.buttons.pip),airplay:ge.call(this,this.config.selectors.buttons.airplay),settings:ge.call(this,this.config.selectors.buttons.settings),captions:ge.call(this,this.config.selectors.buttons.captions),fullscreen:ge.call(this,this.config.selectors.buttons.fullscreen)},this.elements.progress=ge.call(this,this.config.selectors.progress),this.elements.inputs={seek:ge.call(this,this.config.selectors.inputs.seek),volume:ge.call(this,this.config.selectors.inputs.volume)},this.elements.display={buffer:ge.call(this,this.config.selectors.display.buffer),currentTime:ge.call(this,this.config.selectors.display.currentTime),duration:ge.call(this,this.config.selectors.display.duration)},R(this.elements.progress)&&(this.elements.display.seekTooltip=this.elements.progress.querySelector(".".concat(this.config.classNames.tooltip))),!0}catch(e){return this.debug.warn("It looks like there is a problem with your custom controls HTML",e),this.toggleNativeControls(!0),!1}},createIcon:function(e,t){var i=Re.getIconUrl.call(this),n="".concat(i.cors?"":i.url,"#").concat(this.config.iconPrefix),a=document.createElementNS("http://www.w3.org/2000/svg","svg");ae(a,ie(t,{role:"presentation",focusable:"false"}));var s=document.createElementNS("http://www.w3.org/2000/svg","use"),o="".concat(n,"-").concat(e);return"href"in s&&s.setAttributeNS("http://www.w3.org/1999/xlink","href",o),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o),a.appendChild(s),a},createLabel:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=Le(e,this.config);return se("span",Object.assign({},t,{class:[t.class,this.config.classNames.hidden].filter(Boolean).join(" ")}),i)},createBadge:function(e){if(z(e))return null;var t=se("span",{class:this.config.classNames.menu.value});return t.appendChild(se("span",{class:this.config.classNames.menu.badge},e)),t},createButton:function(e,t){var i=this,n=ie({},t),a=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").toString();return(e=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").toString();return e=Me(e,"-"," "),e=Me(e,"_"," "),Me(e=Ne(e)," ","")}(e)).charAt(0).toLowerCase()+e.slice(1)}(e),s={element:"button",toggle:!1,label:null,icon:null,labelPressed:null,iconPressed:null};switch(["element","icon","label"].forEach((function(e){Object.keys(n).includes(e)&&(s[e]=n[e],delete n[e])})),"button"!==s.element||Object.keys(n).includes("type")||(n.type="button"),Object.keys(n).includes("class")?n.class.split(" ").some((function(e){return e===i.config.classNames.control}))||ie(n,{class:"".concat(n.class," ").concat(this.config.classNames.control)}):n.class=this.config.classNames.control,e){case"play":s.toggle=!0,s.label="play",s.labelPressed="pause",s.icon="play",s.iconPressed="pause";break;case"mute":s.toggle=!0,s.label="mute",s.labelPressed="unmute",s.icon="volume",s.iconPressed="muted";break;case"captions":s.toggle=!0,s.label="enableCaptions",s.labelPressed="disableCaptions",s.icon="captions-off",s.iconPressed="captions-on";break;case"fullscreen":s.toggle=!0,s.label="enterFullscreen",s.labelPressed="exitFullscreen",s.icon="enter-fullscreen",s.iconPressed="exit-fullscreen";break;case"play-large":n.class+=" ".concat(this.config.classNames.control,"--overlaid"),a="play",s.label="play",s.icon="play";break;default:z(s.label)&&(s.label=a),z(s.icon)&&(s.icon=e)}var o=se(s.element);return s.toggle?(o.appendChild(Re.createIcon.call(this,s.iconPressed,{class:"icon--pressed"})),o.appendChild(Re.createIcon.call(this,s.icon,{class:"icon--not-pressed"})),o.appendChild(Re.createLabel.call(this,s.labelPressed,{class:"label--pressed"})),o.appendChild(Re.createLabel.call(this,s.label,{class:"label--not-pressed"}))):(o.appendChild(Re.createIcon.call(this,s.icon)),o.appendChild(Re.createLabel.call(this,s.label))),ie(n,ue(this.config.selectors.buttons[a],n)),ae(o,n),"play"===a?(D(this.elements.buttons[a])||(this.elements.buttons[a]=[]),this.elements.buttons[a].push(o)):this.elements.buttons[a]=o,o},createRange:function(e,t){var i=se("input",ie(ue(this.config.selectors.inputs[e]),{type:"range",min:0,max:100,step:.01,value:0,autocomplete:"off",role:"slider","aria-label":Le(e,this.config),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":0},t));return this.elements.inputs[e]=i,Re.updateRangeFill.call(this,i),C.setup(i),i},createProgress:function(e,t){var i=se("progress",ie(ue(this.config.selectors.display[e]),{min:0,max:100,value:0,role:"progressbar","aria-hidden":!0},t));if("volume"!==e){i.appendChild(se("span",null,"0"));var n={played:"played",buffer:"buffered"}[e],a=n?Le(n,this.config):"";i.innerText="% ".concat(a.toLowerCase())}return this.elements.display[e]=i,i},createTime:function(e,t){var i=ue(this.config.selectors.display[e],t),n=se("div",ie(i,{class:"".concat(i.class?i.class:""," ").concat(this.config.classNames.display.time," ").trim(),"aria-label":Le(e,this.config)}),"00:00");return this.elements.display[e]=n,n},bindMenuItemShortcuts:function(e,t){var i=this;$(e,"keydown keyup",(function(n){if([32,38,39,40].includes(n.which)&&(n.preventDefault(),n.stopPropagation(),"keydown"!==n.type)){var a,s=me(e,'[role="menuitemradio"]');!s&&[32,39].includes(n.which)?Re.showMenuPanel.call(i,t,!0):32!==n.which&&(40===n.which||s&&39===n.which?(a=e.nextElementSibling,R(a)||(a=e.parentNode.firstElementChild)):(a=e.previousElementSibling,R(a)||(a=e.parentNode.lastElementChild)),ye.call(i,a,!0))}}),!1),$(e,"keyup",(function(e){13===e.which&&Re.focusFirstMenuItem.call(i,null,!0)}))},createMenuItem:function(e){var t=this,i=e.value,n=e.list,a=e.type,s=e.title,o=e.badge,r=void 0===o?null:o,l=e.checked,c=void 0!==l&&l,u=ue(this.config.selectors.inputs[a]),d=se("button",ie(u,{type:"button",role:"menuitemradio",class:"".concat(this.config.classNames.control," ").concat(u.class?u.class:"").trim(),"aria-checked":c,value:i})),h=se("span");h.innerHTML=s,R(r)&&h.appendChild(r),d.appendChild(h),Object.defineProperty(d,"checked",{enumerable:!0,get:function(){return"true"===d.getAttribute("aria-checked")},set:function(e){e&&Array.from(d.parentNode.children).filter((function(e){return me(e,'[role="menuitemradio"]')})).forEach((function(e){return e.setAttribute("aria-checked","false")})),d.setAttribute("aria-checked",e?"true":"false")}}),this.listeners.bind(d,"click keyup",(function(e){if(!B(e)||32===e.which){switch(e.preventDefault(),e.stopPropagation(),d.checked=!0,a){case"language":t.currentTrack=Number(i);break;case"quality":t.quality=i;break;case"speed":t.speed=parseFloat(i)}Re.showMenuPanel.call(t,"home",B(e))}}),a,!1),Re.bindMenuItemShortcuts.call(this,d,a),n.appendChild(d)},formatTime:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return O(e)?Fe(e,He(this.duration)>0,t):e},updateTimeDisplay:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];R(e)&&O(t)&&(e.innerText=Re.formatTime(t,i))},updateVolume:function(){this.supported.ui&&(R(this.elements.inputs.volume)&&Re.setRange.call(this,this.elements.inputs.volume,this.muted?0:this.volume),R(this.elements.buttons.mute)&&(this.elements.buttons.mute.pressed=this.muted||0===this.volume))},setRange:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;R(e)&&(e.value=t,Re.updateRangeFill.call(this,e))},updateProgress:function(e){var t=this;if(this.supported.ui&&V(e)){var i,n,a=0;if(e)switch(e.type){case"timeupdate":case"seeking":case"seeked":i=this.currentTime,n=this.duration,a=0===i||0===n||Number.isNaN(i)||Number.isNaN(n)?0:(i/n*100).toFixed(2),"timeupdate"===e.type&&Re.setRange.call(this,this.elements.inputs.seek,a);break;case"playing":case"progress":!function(e,i){var n=O(i)?i:0,a=R(e)?e:t.elements.display.buffer;if(R(a)){a.value=n;var s=a.getElementsByTagName("span")[0];R(s)&&(s.childNodes[0].nodeValue=n)}}(this.elements.display.buffer,100*this.buffered)}}},updateRangeFill:function(e){var t=V(e)?e.target:e;if(R(t)&&"range"===t.getAttribute("type")){if(me(t,this.config.selectors.inputs.seek)){t.setAttribute("aria-valuenow",this.currentTime);var i=Re.formatTime(this.currentTime),n=Re.formatTime(this.duration),a=Le("seekLabel",this.config);t.setAttribute("aria-valuetext",a.replace("{currentTime}",i).replace("{duration}",n))}else if(me(t,this.config.selectors.inputs.volume)){var s=100*t.value;t.setAttribute("aria-valuenow",s),t.setAttribute("aria-valuetext","".concat(s.toFixed(1),"%"))}else t.setAttribute("aria-valuenow",t.value);Q.isWebkit&&t.style.setProperty("--value","".concat(t.value/t.max*100,"%"))}},updateSeekTooltip:function(e){var t=this;if(this.config.tooltips.seek&&R(this.elements.inputs.seek)&&R(this.elements.display.seekTooltip)&&0!==this.duration){var i="".concat(this.config.classNames.tooltip,"--visible"),n=function(e){return he(t.elements.display.seekTooltip,i,e)};if(this.touch)n(!1);else{var a=0,s=this.elements.progress.getBoundingClientRect();if(V(e))a=100/s.width*(e.pageX-s.left);else{if(!pe(this.elements.display.seekTooltip,i))return;a=parseFloat(this.elements.display.seekTooltip.style.left,10)}a<0?a=0:a>100&&(a=100),Re.updateTimeDisplay.call(this,this.elements.display.seekTooltip,this.duration/100*a),this.elements.display.seekTooltip.style.left="".concat(a,"%"),V(e)&&["mouseenter","mouseleave"].includes(e.type)&&n("mouseenter"===e.type)}}},timeUpdate:function(e){var t=!R(this.elements.display.duration)&&this.config.invertTime;Re.updateTimeDisplay.call(this,this.elements.display.currentTime,t?this.duration-this.currentTime:this.currentTime,t),e&&"timeupdate"===e.type&&this.media.seeking||Re.updateProgress.call(this,e)},durationUpdate:function(){if(this.supported.ui&&(this.config.invertTime||!this.currentTime)){if(this.duration>=Math.pow(2,32))return de(this.elements.display.currentTime,!0),void de(this.elements.progress,!0);R(this.elements.inputs.seek)&&this.elements.inputs.seek.setAttribute("aria-valuemax",this.duration);var e=R(this.elements.display.duration);!e&&this.config.displayDuration&&this.paused&&Re.updateTimeDisplay.call(this,this.elements.display.currentTime,this.duration),e&&Re.updateTimeDisplay.call(this,this.elements.display.duration,this.duration),Re.updateSeekTooltip.call(this)}},toggleMenuButton:function(e,t){de(this.elements.settings.buttons[e],!t)},updateSetting:function(e,t,i){var n=this.elements.settings.panels[e],a=null,s=t;if("captions"===e)a=this.currentTrack;else{if(a=z(i)?this[e]:i,z(a)&&(a=this.config[e].default),!z(this.options[e])&&!this.options[e].includes(a))return void this.debug.warn("Unsupported value of '".concat(a,"' for ").concat(e));if(!this.config[e].options.includes(a))return void this.debug.warn("Disabled value of '".concat(a,"' for ").concat(e))}if(R(s)||(s=n&&n.querySelector('[role="menu"]')),R(s)){this.elements.settings.buttons[e].querySelector(".".concat(this.config.classNames.menu.value)).innerHTML=Re.getLabel.call(this,e,a);var o=s&&s.querySelector('[value="'.concat(a,'"]'));R(o)&&(o.checked=!0)}},getLabel:function(e,t){switch(e){case"speed":return 1===t?Le("normal",this.config):"".concat(t,"&times;");case"quality":if(O(t)){var i=Le("qualityLabel.".concat(t),this.config);return i.length?i:"".concat(t,"p")}return Ne(t);case"captions":return Ue.getLabel.call(this);default:return null}},setQualityMenu:function(e){var t=this;if(R(this.elements.settings.panels.quality)){var i=this.elements.settings.panels.quality.querySelector('[role="menu"]');D(e)&&(this.options.quality=Se(e).filter((function(e){return t.config.quality.options.includes(e)})));var n=!z(this.options.quality)&&this.options.quality.length>1;if(Re.toggleMenuButton.call(this,"quality",n),le(i),Re.checkMenu.call(this),n){var a=function(e){var i=Le("qualityBadge.".concat(e),t.config);return i.length?Re.createBadge.call(t,i):null};this.options.quality.sort((function(e,i){var n=t.config.quality.options;return n.indexOf(e)>n.indexOf(i)?1:-1})).forEach((function(e){Re.createMenuItem.call(t,{value:e,list:i,type:"quality",title:Re.getLabel.call(t,"quality",e),badge:a(e)})})),Re.updateSetting.call(this,"quality",i)}}},setCaptionsMenu:function(){var e=this;if(R(this.elements.settings.panels.captions)){var t=this.elements.settings.panels.captions.querySelector('[role="menu"]'),i=Ue.getTracks.call(this),n=Boolean(i.length);if(Re.toggleMenuButton.call(this,"captions",n),le(t),Re.checkMenu.call(this),n){var a=i.map((function(i,n){return{value:n,checked:e.captions.toggled&&e.currentTrack===n,title:Ue.getLabel.call(e,i),badge:i.language&&Re.createBadge.call(e,i.language.toUpperCase()),list:t,type:"language"}}));a.unshift({value:-1,checked:!this.captions.toggled,title:Le("disabled",this.config),list:t,type:"language"}),a.forEach(Re.createMenuItem.bind(this)),Re.updateSetting.call(this,"captions",t)}}},setSpeedMenu:function(e){var t=this;if(R(this.elements.settings.panels.speed)){var i=this.elements.settings.panels.speed.querySelector('[role="menu"]');D(e)?this.options.speed=e:(this.isHTML5||this.isVimeo)&&(this.options.speed=[.5,.75,1,1.25,1.5,1.75,2]),this.options.speed=this.options.speed.filter((function(e){return t.config.speed.options.includes(e)}));var n=!z(this.options.speed)&&this.options.speed.length>1;Re.toggleMenuButton.call(this,"speed",n),le(i),Re.checkMenu.call(this),n&&(this.options.speed.forEach((function(e){Re.createMenuItem.call(t,{value:e,list:i,type:"speed",title:Re.getLabel.call(t,"speed",e)})})),Re.updateSetting.call(this,"speed",i))}},checkMenu:function(){var e=this.elements.settings.buttons,t=!z(e)&&Object.values(e).some((function(e){return!e.hidden}));de(this.elements.settings.menu,!t)},focusFirstMenuItem:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.elements.settings.popup.hidden){var i=e;R(i)||(i=Object.values(this.elements.settings.panels).find((function(e){return!e.hidden})));var n=i.querySelector('[role^="menuitem"]');ye.call(this,n,t)}},toggleMenu:function(e){var t=this.elements.settings.popup,i=this.elements.buttons.settings;if(R(t)&&R(i)){var n=t.hidden,a=n;if(H(e))a=e;else if(B(e)&&27===e.which)a=!1;else if(V(e)){var s=j(e.composedPath)?e.composedPath()[0]:e.target,o=t.contains(s);if(o||!o&&e.target!==i&&a)return}i.setAttribute("aria-expanded",a),de(t,!a),he(this.elements.container,this.config.classNames.menu.open,a),a&&B(e)?Re.focusFirstMenuItem.call(this,null,!0):a||n||ye.call(this,i,B(e))}},getMenuSize:function(e){var t=e.cloneNode(!0);t.style.position="absolute",t.style.opacity=0,t.removeAttribute("hidden"),e.parentNode.appendChild(t);var i=t.scrollWidth,n=t.scrollHeight;return re(t),{width:i,height:n}},showMenuPanel:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.elements.container.querySelector("#plyr-settings-".concat(this.id,"-").concat(t));if(R(n)){var a=n.parentNode,s=Array.from(a.children).find((function(e){return!e.hidden}));if(ke.transitions&&!ke.reducedMotion){a.style.width="".concat(s.scrollWidth,"px"),a.style.height="".concat(s.scrollHeight,"px");var o=Re.getMenuSize.call(this,n);$.call(this,a,K,(function t(i){i.target===a&&["width","height"].includes(i.propertyName)&&(a.style.width="",a.style.height="",G.call(e,a,K,t))})),a.style.width="".concat(o.width,"px"),a.style.height="".concat(o.height,"px")}de(s,!0),de(n,!1),Re.focusFirstMenuItem.call(this,n,i)}},setDownloadUrl:function(){var e=this.elements.buttons.download;R(e)&&e.setAttribute("href",this.download)},create:function(e){var t=this,i=Re.bindMenuItemShortcuts,n=Re.createButton,a=Re.createProgress,s=Re.createRange,o=Re.createTime,r=Re.setQualityMenu,l=Re.setSpeedMenu,c=Re.showMenuPanel;this.elements.controls=null,this.config.controls.includes("play-large")&&this.elements.container.appendChild(n.call(this,"play-large"));var u=se("div",ue(this.config.selectors.controls.wrapper));this.elements.controls=u;var d={class:"plyr__controls__item"};return Se(this.config.controls).forEach((function(r){if("restart"===r&&u.appendChild(n.call(t,"restart",d)),"rewind"===r&&u.appendChild(n.call(t,"rewind",d)),"play"===r&&u.appendChild(n.call(t,"play",d)),"fast-forward"===r&&u.appendChild(n.call(t,"fast-forward",d)),"progress"===r){var l=se("div",{class:"".concat(d.class," plyr__progress__container")}),h=se("div",ue(t.config.selectors.progress));if(h.appendChild(s.call(t,"seek",{id:"plyr-seek-".concat(e.id)})),h.appendChild(a.call(t,"buffer")),t.config.tooltips.seek){var p=se("span",{class:t.config.classNames.tooltip},"00:00");h.appendChild(p),t.elements.display.seekTooltip=p}t.elements.progress=h,l.appendChild(t.elements.progress),u.appendChild(l)}if("current-time"===r&&u.appendChild(o.call(t,"currentTime",d)),"duration"===r&&u.appendChild(o.call(t,"duration",d)),"mute"===r||"volume"===r){var m=t.elements.volume;if(R(m)&&u.contains(m)||(m=se("div",ie({},d,{class:"".concat(d.class," plyr__volume").trim()})),t.elements.volume=m,u.appendChild(m)),"mute"===r&&m.appendChild(n.call(t,"mute")),"volume"===r){var f={max:1,step:.05,value:t.config.volume};m.appendChild(s.call(t,"volume",ie(f,{id:"plyr-volume-".concat(e.id)})))}}if("captions"===r&&u.appendChild(n.call(t,"captions",d)),"settings"===r&&!z(t.config.settings)){var g=se("div",ie({},d,{class:"".concat(d.class," plyr__menu").trim(),hidden:""}));g.appendChild(n.call(t,"settings",{"aria-haspopup":!0,"aria-controls":"plyr-settings-".concat(e.id),"aria-expanded":!1}));var y=se("div",{class:"plyr__menu__container",id:"plyr-settings-".concat(e.id),hidden:""}),v=se("div"),b=se("div",{id:"plyr-settings-".concat(e.id,"-home")}),k=se("div",{role:"menu"});b.appendChild(k),v.appendChild(b),t.elements.settings.panels.home=b,t.config.settings.forEach((function(n){var a=se("button",ie(ue(t.config.selectors.buttons.settings),{type:"button",class:"".concat(t.config.classNames.control," ").concat(t.config.classNames.control,"--forward"),role:"menuitem","aria-haspopup":!0,hidden:""}));i.call(t,a,n),$(a,"click",(function(){c.call(t,n,!1)}));var s=se("span",null,Le(n,t.config)),o=se("span",{class:t.config.classNames.menu.value});o.innerHTML=e[n],s.appendChild(o),a.appendChild(s),k.appendChild(a);var r=se("div",{id:"plyr-settings-".concat(e.id,"-").concat(n),hidden:""}),l=se("button",{type:"button",class:"".concat(t.config.classNames.control," ").concat(t.config.classNames.control,"--back")});l.appendChild(se("span",{"aria-hidden":!0},Le(n,t.config))),l.appendChild(se("span",{class:t.config.classNames.hidden},Le("menuBack",t.config))),$(r,"keydown",(function(e){37===e.which&&(e.preventDefault(),e.stopPropagation(),c.call(t,"home",!0))}),!1),$(l,"click",(function(){c.call(t,"home",!1)})),r.appendChild(l),r.appendChild(se("div",{role:"menu"})),v.appendChild(r),t.elements.settings.buttons[n]=a,t.elements.settings.panels[n]=r})),y.appendChild(v),g.appendChild(y),u.appendChild(g),t.elements.settings.popup=y,t.elements.settings.menu=g}if("pip"===r&&ke.pip&&u.appendChild(n.call(t,"pip",d)),"airplay"===r&&ke.airplay&&u.appendChild(n.call(t,"airplay",d)),"download"===r){var w=ie({},d,{element:"a",href:t.download,target:"_blank"}),T=t.config.urls.download;!W(T)&&t.isEmbed&&ie(w,{icon:"logo-".concat(t.provider),label:t.provider}),u.appendChild(n.call(t,"download",w))}"fullscreen"===r&&u.appendChild(n.call(t,"fullscreen",d))})),this.isHTML5&&r.call(this,Ee.getQualityOptions.call(this)),l.call(this),u},inject:function(){var e=this;if(this.config.loadSprite){var t=Re.getIconUrl.call(this);t.cors&&qe(t.url,"sprite-plyr")}this.id=Math.floor(1e4*Math.random());var i=null;this.elements.controls=null;var n={id:this.id,seektime:this.config.seekTime,title:this.config.title},s=!0;j(this.config.controls)&&(this.config.controls=this.config.controls.call(this,n)),this.config.controls||(this.config.controls=[]),R(this.config.controls)||q(this.config.controls)?i=this.config.controls:(i=Re.create.call(this,{id:this.id,seektime:this.config.seekTime,speed:this.speed,quality:this.quality,captions:Ue.getLabel.call(this)}),s=!1);var o,r=function(e){var t=e;return Object.entries(n).forEach((function(e){var i=a(e,2),n=i[0],s=i[1];t=Me(t,"{".concat(n,"}"),s)})),t};if(s&&(q(this.config.controls)?i=r(i):R(i)&&(i.innerHTML=r(i.innerHTML))),q(this.config.selectors.controls.container)&&(o=document.querySelector(this.config.selectors.controls.container)),R(o)||(o=this.elements.container),o[R(i)?"insertAdjacentElement":"insertAdjacentHTML"]("afterbegin",i),R(this.elements.controls)||Re.findElements.call(this),!z(this.elements.buttons)){var l=function(t){var i=e.config.classNames.controlPressed;Object.defineProperty(t,"pressed",{enumerable:!0,get:function(){return pe(t,i)},set:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];he(t,i,e)}})};Object.values(this.elements.buttons).filter(Boolean).forEach((function(e){D(e)||F(e)?Array.from(e).filter(Boolean).forEach(l):l(e)}))}if(Q.isEdge&&Y(o),this.config.tooltips.controls){var c=this.config,u=c.classNames,d=c.selectors,h="".concat(d.controls.wrapper," ").concat(d.labels," .").concat(u.hidden),p=fe.call(this,h);Array.from(p).forEach((function(t){he(t,e.config.classNames.hidden,!1),he(t,e.config.classNames.tooltip,!0)}))}}};function Ve(e){var t=e;if(!(arguments.length>1&&void 0!==arguments[1])||arguments[1]){var i=document.createElement("a");i.href=t,t=i.href}try{return new URL(t)}catch(e){return null}}function Be(e){var t=new URLSearchParams;return _(e)&&Object.entries(e).forEach((function(e){var i=a(e,2),n=i[0],s=i[1];t.set(n,s)})),t}var Ue={setup:function(){if(this.supported.ui)if(!this.isVideo||this.isYouTube||this.isHTML5&&!ke.textTracks)D(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&Re.setCaptionsMenu.call(this);else{if(R(this.elements.captions)||(this.elements.captions=se("div",ue(this.config.selectors.captions)),function(e,t){R(e)&&R(t)&&t.parentNode.insertBefore(e,t.nextSibling)}(this.elements.captions,this.elements.wrapper)),Q.isIE&&window.URL){var e=this.media.querySelectorAll("track");Array.from(e).forEach((function(e){var t=e.getAttribute("src"),i=Ve(t);null!==i&&i.hostname!==window.location.href.hostname&&["http:","https:"].includes(i.protocol)&&Oe(t,"blob").then((function(t){e.setAttribute("src",window.URL.createObjectURL(t))})).catch((function(){re(e)}))}))}var t=Se((navigator.languages||[navigator.language||navigator.userLanguage||"en"]).map((function(e){return e.split("-")[0]}))),i=(this.storage.get("language")||this.config.captions.language||"auto").toLowerCase();"auto"===i&&(i=a(t,1)[0]);var n=this.storage.get("captions");if(H(n)||(n=this.config.captions.active),Object.assign(this.captions,{toggled:!1,active:n,language:i,languages:t}),this.isHTML5){var s=this.config.captions.update?"addtrack removetrack":"removetrack";$.call(this,this.media.textTracks,s,Ue.update.bind(this))}setTimeout(Ue.update.bind(this),0)}},update:function(){var e=this,t=Ue.getTracks.call(this,!0),i=this.captions,n=i.active,a=i.language,s=i.meta,o=i.currentTrackNode,r=Boolean(t.find((function(e){return e.language===a})));this.isHTML5&&this.isVideo&&t.filter((function(e){return!s.get(e)})).forEach((function(t){e.debug.log("Track added",t),s.set(t,{default:"showing"===t.mode}),t.mode="hidden",$.call(e,t,"cuechange",(function(){return Ue.updateCues.call(e)}))})),(r&&this.language!==a||!t.includes(o))&&(Ue.setLanguage.call(this,a),Ue.toggle.call(this,n&&r)),he(this.elements.container,this.config.classNames.captions.enabled,!z(t)),(this.config.controls||[]).includes("settings")&&this.config.settings.includes("captions")&&Re.setCaptionsMenu.call(this)},toggle:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.supported.ui){var i=this.captions.toggled,n=this.config.classNames.captions.active,a=L(e)?!i:e;if(a!==i){if(t||(this.captions.active=a,this.storage.set({captions:a})),!this.language&&a&&!t){var o=Ue.getTracks.call(this),r=Ue.findTrack.call(this,[this.captions.language].concat(s(this.captions.languages)),!0);return this.captions.language=r.language,void Ue.set.call(this,o.indexOf(r))}this.elements.buttons.captions&&(this.elements.buttons.captions.pressed=a),he(this.elements.container,n,a),this.captions.toggled=a,Re.updateSetting.call(this,"captions"),ee.call(this,this.media,a?"captionsenabled":"captionsdisabled")}}},set:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=Ue.getTracks.call(this);if(-1!==e)if(O(e))if(e in i){if(this.captions.currentTrack!==e){this.captions.currentTrack=e;var n=i[e],a=(n||{}).language;this.captions.currentTrackNode=n,Re.updateSetting.call(this,"captions"),t||(this.captions.language=a,this.storage.set({language:a})),this.isVimeo&&this.embed.enableTextTrack(a),ee.call(this,this.media,"languagechange")}Ue.toggle.call(this,!0,t),this.isHTML5&&this.isVideo&&Ue.updateCues.call(this)}else this.debug.warn("Track not found",e);else this.debug.warn("Invalid caption argument",e);else Ue.toggle.call(this,!1,t)},setLanguage:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(q(e)){var i=e.toLowerCase();this.captions.language=i;var n=Ue.getTracks.call(this),a=Ue.findTrack.call(this,[i]);Ue.set.call(this,n.indexOf(a),t)}else this.debug.warn("Invalid language argument",e)},getTracks:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Array.from((this.media||{}).textTracks||[]).filter((function(i){return!e.isHTML5||t||e.captions.meta.has(i)})).filter((function(e){return["captions","subtitles"].includes(e.kind)}))},findTrack:function(e){var t,i=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=Ue.getTracks.call(this),s=function(e){return Number((i.captions.meta.get(e)||{}).default)},o=Array.from(a).sort((function(e,t){return s(t)-s(e)}));return e.every((function(e){return!(t=o.find((function(t){return t.language===e})))})),t||(n?o[0]:void 0)},getCurrentTrack:function(){return Ue.getTracks.call(this)[this.currentTrack]},getLabel:function(e){var t=e;return!U(t)&&ke.textTracks&&this.captions.toggled&&(t=Ue.getCurrentTrack.call(this)),U(t)?z(t.label)?z(t.language)?Le("enabled",this.config):e.language.toUpperCase():t.label:Le("disabled",this.config)},updateCues:function(e){if(this.supported.ui)if(R(this.elements.captions))if(L(e)||Array.isArray(e)){var t=e;if(!t){var i=Ue.getCurrentTrack.call(this);t=Array.from((i||{}).activeCues||[]).map((function(e){return e.getCueAsHTML()})).map(xe)}var n=t.map((function(e){return e.trim()})).join("\n");if(n!==this.elements.captions.innerHTML){le(this.elements.captions);var a=se("span",ue(this.config.selectors.caption));a.innerHTML=n,this.elements.captions.appendChild(a),ee.call(this,this.media,"cuechange")}}else this.debug.warn("updateCues: Invalid input",e);else this.debug.warn("No captions element to render to")}},We={enabled:!0,title:"",debug:!1,autoplay:!1,autopause:!0,playsinline:!0,seekTime:10,volume:1,muted:!1,duration:null,displayDuration:!0,invertTime:!0,toggleInvert:!0,ratio:null,clickToPlay:!0,hideControls:!0,resetOnEnd:!1,disableContextMenu:!0,loadSprite:!0,iconPrefix:"plyr",iconUrl:"https://cdn.plyr.io/3.5.6/plyr.svg",blankVideo:"https://cdn.plyr.io/static/blank.mp4",quality:{default:576,options:[4320,2880,2160,1440,1080,720,576,480,360,240]},loop:{active:!1},speed:{selected:1,options:[.5,.75,1,1.25,1.5,1.75,2]},keyboard:{focused:!0,global:!1},tooltips:{controls:!1,seek:!0},captions:{active:!1,language:"auto",update:!1},fullscreen:{enabled:!0,fallback:!0,iosNative:!1},storage:{enabled:!0,key:"plyr"},controls:["play-large","play","progress","current-time","mute","volume","captions","settings","pip","airplay","fullscreen"],settings:["captions","quality","speed"],i18n:{restart:"Restart",rewind:"Rewind {seektime}s",play:"Play",pause:"Pause",fastForward:"Forward {seektime}s",seek:"Seek",seekLabel:"{currentTime} of {duration}",played:"Played",buffered:"Buffered",currentTime:"Current time",duration:"Duration",volume:"Volume",mute:"Mute",unmute:"Unmute",enableCaptions:"Enable captions",disableCaptions:"Disable captions",download:"Download",enterFullscreen:"Enter fullscreen",exitFullscreen:"Exit fullscreen",frameTitle:"Player for {title}",captions:"Captions",settings:"Settings",menuBack:"Go back to previous menu",speed:"Speed",normal:"Normal",quality:"Quality",loop:"Loop",start:"Start",end:"End",all:"All",reset:"Reset",disabled:"Disabled",enabled:"Enabled",advertisement:"Ad",qualityBadge:{2160:"4K",1440:"HD",1080:"HD",720:"HD",576:"SD",480:"SD"}},urls:{download:null,vimeo:{sdk:"https://player.vimeo.com/api/player.js",iframe:"https://player.vimeo.com/video/{0}?{1}",api:"https://vimeo.com/api/v2/video/{0}.json"},youtube:{sdk:"https://www.youtube.com/iframe_api",api:"https://noembed.com/embed?url=https://www.youtube.com/watch?v={0}"},googleIMA:{sdk:"https://imasdk.googleapis.com/js/sdkloader/ima3.js"}},listeners:{seek:null,play:null,pause:null,restart:null,rewind:null,fastForward:null,mute:null,volume:null,captions:null,download:null,fullscreen:null,pip:null,airplay:null,speed:null,quality:null,loop:null,language:null},events:["ended","progress","stalled","playing","waiting","canplay","canplaythrough","loadstart","loadeddata","loadedmetadata","timeupdate","volumechange","play","pause","error","seeking","seeked","emptied","ratechange","cuechange","download","enterfullscreen","exitfullscreen","captionsenabled","captionsdisabled","languagechange","controlshidden","controlsshown","ready","statechange","qualitychange","adsloaded","adscontentpause","adscontentresume","adstarted","adsmidpoint","adscomplete","adsallcomplete","adsimpression","adsclick"],selectors:{editable:"input, textarea, select, [contenteditable]",container:".plyr",controls:{container:null,wrapper:".plyr__controls"},labels:"[data-plyr]",buttons:{play:'[data-plyr="play"]',pause:'[data-plyr="pause"]',restart:'[data-plyr="restart"]',rewind:'[data-plyr="rewind"]',fastForward:'[data-plyr="fast-forward"]',mute:'[data-plyr="mute"]',captions:'[data-plyr="captions"]',download:'[data-plyr="download"]',fullscreen:'[data-plyr="fullscreen"]',pip:'[data-plyr="pip"]',airplay:'[data-plyr="airplay"]',settings:'[data-plyr="settings"]',loop:'[data-plyr="loop"]'},inputs:{seek:'[data-plyr="seek"]',volume:'[data-plyr="volume"]',speed:'[data-plyr="speed"]',language:'[data-plyr="language"]',quality:'[data-plyr="quality"]'},display:{currentTime:".plyr__time--current",duration:".plyr__time--duration",buffer:".plyr__progress__buffer",loop:".plyr__progress__loop",volume:".plyr__volume--display"},progress:".plyr__progress",captions:".plyr__captions",caption:".plyr__caption"},classNames:{type:"plyr--{0}",provider:"plyr--{0}",video:"plyr__video-wrapper",embed:"plyr__video-embed",videoFixedRatio:"plyr__video-wrapper--fixed-ratio",embedContainer:"plyr__video-embed__container",poster:"plyr__poster",posterEnabled:"plyr__poster-enabled",ads:"plyr__ads",control:"plyr__control",controlPressed:"plyr__control--pressed",playing:"plyr--playing",paused:"plyr--paused",stopped:"plyr--stopped",loading:"plyr--loading",hover:"plyr--hover",tooltip:"plyr__tooltip",cues:"plyr__cues",hidden:"plyr__sr-only",hideControls:"plyr--hide-controls",isIos:"plyr--is-ios",isTouch:"plyr--is-touch",uiSupported:"plyr--full-ui",noTransition:"plyr--no-transition",display:{time:"plyr__time"},menu:{value:"plyr__menu__value",badge:"plyr__badge",open:"plyr--menu-open"},captions:{enabled:"plyr--captions-enabled",active:"plyr--captions-active"},fullscreen:{enabled:"plyr--fullscreen-enabled",fallback:"plyr--fullscreen-fallback"},pip:{supported:"plyr--pip-supported",active:"plyr--pip-active"},airplay:{supported:"plyr--airplay-supported",active:"plyr--airplay-active"},tabFocus:"plyr__tab-focus",previewThumbnails:{thumbContainer:"plyr__preview-thumb",thumbContainerShown:"plyr__preview-thumb--is-shown",imageContainer:"plyr__preview-thumb__image-container",timeContainer:"plyr__preview-thumb__time-container",scrubbingContainer:"plyr__preview-scrubbing",scrubbingContainerShown:"plyr__preview-scrubbing--is-shown"}},attributes:{embed:{provider:"data-plyr-provider",id:"data-plyr-embed-id"}},ads:{enabled:!1,publisherId:"",tagUrl:""},previewThumbnails:{enabled:!1,src:""},vimeo:{byline:!1,portrait:!1,title:!1,speed:!0,transparent:!1},youtube:{noCookie:!1,rel:0,showinfo:0,iv_load_policy:3,modestbranding:1}},ze="picture-in-picture",Ke={html5:"html5",youtube:"youtube",vimeo:"vimeo"},Ye="audio",Qe="video",Xe=function(){},Je=function(){function t(){var i=arguments.length>0&&void 0!==arguments[0]&&arguments[0];e(this,t),this.enabled=window.console&&i,this.enabled&&this.log("Debugging enabled")}return i(t,[{key:"log",get:function(){return this.enabled?Function.prototype.bind.call(console.log,console):Xe}},{key:"warn",get:function(){return this.enabled?Function.prototype.bind.call(console.warn,console):Xe}},{key:"error",get:function(){return this.enabled?Function.prototype.bind.call(console.error,console):Xe}}]),t}();function $e(){if(this.enabled){var e=this.player.elements.buttons.fullscreen;R(e)&&(e.pressed=this.active),ee.call(this.player,this.target,this.active?"enterfullscreen":"exitfullscreen",!0),Q.isIos||function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(R(e)){var i=fe.call(this,"button:not(:disabled), input:not(:disabled), [tabindex]"),n=i[0],a=i[i.length-1];J.call(this,this.elements.container,"keydown",(function(e){if("Tab"===e.key&&9===e.keyCode){var t=document.activeElement;t!==a||e.shiftKey?t===n&&e.shiftKey&&(a.focus(),e.preventDefault()):(n.focus(),e.preventDefault())}}),t,!1)}}.call(this.player,this.target,this.active)}}function Ge(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(e?this.scrollPosition={x:window.scrollX||0,y:window.scrollY||0}:window.scrollTo(this.scrollPosition.x,this.scrollPosition.y),document.body.style.overflow=e?"hidden":"",he(this.target,this.player.config.classNames.fullscreen.fallback,e),Q.isIos){var t=document.head.querySelector('meta[name="viewport"]'),i="viewport-fit=cover";t||(t=document.createElement("meta")).setAttribute("name","viewport");var n=q(t.content)&&t.content.includes(i);e?(this.cleanupViewport=!n,n||(t.content+=",".concat(i))):this.cleanupViewport&&(t.content=t.content.split(",").filter((function(e){return e.trim()!==i})).join(","))}$e.call(this)}var Ze=function(){function t(i){var n=this;e(this,t),this.player=i,this.prefix=t.prefix,this.property=t.property,this.scrollPosition={x:0,y:0},this.forceFallback="force"===i.config.fullscreen.fallback,$.call(this.player,document,"ms"===this.prefix?"MSFullscreenChange":"".concat(this.prefix,"fullscreenchange"),(function(){$e.call(n)})),$.call(this.player,this.player.elements.container,"dblclick",(function(e){R(n.player.elements.controls)&&n.player.elements.controls.contains(e.target)||n.toggle()})),this.update()}return i(t,[{key:"update",value:function(){var e;this.enabled?(e=this.forceFallback?"Fallback (forced)":t.native?"Native":"Fallback",this.player.debug.log("".concat(e," fullscreen enabled"))):this.player.debug.log("Fullscreen not supported and fallback disabled"),he(this.player.elements.container,this.player.config.classNames.fullscreen.enabled,this.enabled)}},{key:"enter",value:function(){this.enabled&&(Q.isIos&&this.player.config.fullscreen.iosNative?this.target.webkitEnterFullscreen():!t.native||this.forceFallback?Ge.call(this,!0):this.prefix?z(this.prefix)||this.target["".concat(this.prefix,"Request").concat(this.property)]():this.target.requestFullscreen())}},{key:"exit",value:function(){if(this.enabled)if(Q.isIos&&this.player.config.fullscreen.iosNative)this.target.webkitExitFullscreen(),this.player.play();else if(!t.native||this.forceFallback)Ge.call(this,!1);else if(this.prefix){if(!z(this.prefix)){var e="moz"===this.prefix?"Cancel":"Exit";document["".concat(this.prefix).concat(e).concat(this.property)]()}}else(document.cancelFullScreen||document.exitFullscreen).call(document)}},{key:"toggle",value:function(){this.active?this.exit():this.enter()}},{key:"usingNative",get:function(){return t.native&&!this.forceFallback}},{key:"enabled",get:function(){return(t.native||this.player.config.fullscreen.fallback)&&this.player.config.fullscreen.enabled&&this.player.supported.ui&&this.player.isVideo}},{key:"active",get:function(){return!!this.enabled&&(!t.native||this.forceFallback?pe(this.target,this.player.config.classNames.fullscreen.fallback):(this.prefix?document["".concat(this.prefix).concat(this.property,"Element")]:document.fullscreenElement)===this.target)}},{key:"target",get:function(){return Q.isIos&&this.player.config.fullscreen.iosNative?this.player.media:this.player.elements.container}}],[{key:"native",get:function(){return!!(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}},{key:"prefix",get:function(){if(j(document.exitFullscreen))return"";var e="";return["webkit","moz","ms"].some((function(t){return!(!j(document["".concat(t,"ExitFullscreen")])&&!j(document["".concat(t,"CancelFullScreen")])||(e=t,0))})),e}},{key:"property",get:function(){return"moz"===this.prefix?"FullScreen":"Fullscreen"}}]),t}();function et(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return new Promise((function(i,n){var a=new Image,s=function(){delete a.onload,delete a.onerror,(a.naturalWidth>=t?i:n)(a)};Object.assign(a,{onload:s,onerror:s,src:e})}))}var tt={addStyleHook:function(){he(this.elements.container,this.config.selectors.container.replace(".",""),!0),he(this.elements.container,this.config.classNames.uiSupported,this.supported.ui)},toggleNativeControls:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&this.isHTML5?this.media.setAttribute("controls",""):this.media.removeAttribute("controls")},build:function(){var e=this;if(this.listeners.media(),!this.supported.ui)return this.debug.warn("Basic support only for ".concat(this.provider," ").concat(this.type)),void tt.toggleNativeControls.call(this,!0);R(this.elements.controls)||(Re.inject.call(this),this.listeners.controls()),tt.toggleNativeControls.call(this),this.isHTML5&&Ue.setup.call(this),this.volume=null,this.muted=null,this.loop=null,this.quality=null,this.speed=null,Re.updateVolume.call(this),Re.timeUpdate.call(this),tt.checkPlaying.call(this),he(this.elements.container,this.config.classNames.pip.supported,ke.pip&&this.isHTML5&&this.isVideo),he(this.elements.container,this.config.classNames.airplay.supported,ke.airplay&&this.isHTML5),he(this.elements.container,this.config.classNames.isIos,Q.isIos),he(this.elements.container,this.config.classNames.isTouch,this.touch),this.ready=!0,setTimeout((function(){ee.call(e,e.media,"ready")}),0),tt.setTitle.call(this),this.poster&&tt.setPoster.call(this,this.poster,!1).catch((function(){})),this.config.duration&&Re.durationUpdate.call(this)},setTitle:function(){var e=Le("play",this.config);if(q(this.config.title)&&!z(this.config.title)&&(e+=", ".concat(this.config.title)),Array.from(this.elements.buttons.play||[]).forEach((function(t){t.setAttribute("aria-label",e)})),this.isEmbed){var t=ge.call(this,"iframe");if(!R(t))return;var i=z(this.config.title)?"video":this.config.title,n=Le("frameTitle",this.config);t.setAttribute("title",n.replace("{title}",i))}},togglePoster:function(e){he(this.elements.container,this.config.classNames.posterEnabled,e)},setPoster:function(e){var t=this;return arguments.length>1&&void 0!==arguments[1]&&!arguments[1]||!this.poster?(this.media.setAttribute("poster",e),function(){var e=this;return new Promise((function(t){return e.ready?setTimeout(t,0):$.call(e,e.elements.container,"ready",t)})).then((function(){}))}.call(this).then((function(){return et(e)})).catch((function(i){throw e===t.poster&&tt.togglePoster.call(t,!1),i})).then((function(){if(e!==t.poster)throw new Error("setPoster cancelled by later call to setPoster")})).then((function(){return Object.assign(t.elements.poster.style,{backgroundImage:"url('".concat(e,"')"),backgroundSize:""}),tt.togglePoster.call(t,!0),e}))):Promise.reject(new Error("Poster already set"))},checkPlaying:function(e){var t=this;he(this.elements.container,this.config.classNames.playing,this.playing),he(this.elements.container,this.config.classNames.paused,this.paused),he(this.elements.container,this.config.classNames.stopped,this.stopped),Array.from(this.elements.buttons.play||[]).forEach((function(e){Object.assign(e,{pressed:t.playing})})),V(e)&&"timeupdate"===e.type||tt.toggleControls.call(this)},checkLoading:function(e){var t=this;this.loading=["stalled","waiting"].includes(e.type),clearTimeout(this.timers.loading),this.timers.loading=setTimeout((function(){he(t.elements.container,t.config.classNames.loading,t.loading),tt.toggleControls.call(t)}),this.loading?250:0)},toggleControls:function(e){var t=this.elements.controls;if(t&&this.config.hideControls){var i=this.touch&&this.lastSeekTime+2e3>Date.now();this.toggleControls(Boolean(e||this.loading||this.paused||t.pressed||t.hover||i))}}},it=function(){function t(i){e(this,t),this.player=i,this.lastKey=null,this.focusTimer=null,this.lastKeyDown=null,this.handleKey=this.handleKey.bind(this),this.toggleMenu=this.toggleMenu.bind(this),this.setTabFocus=this.setTabFocus.bind(this),this.firstTouch=this.firstTouch.bind(this)}return i(t,[{key:"handleKey",value:function(e){var t=this.player,i=t.elements,n=e.keyCode?e.keyCode:e.which,a="keydown"===e.type,s=a&&n===this.lastKey;if(!(e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)&&O(n))if(a){var o=document.activeElement;if(R(o)){var r=t.config.selectors.editable;if(o!==i.inputs.seek&&me(o,r))return;if(32===e.which&&me(o,'button, [role^="menuitem"]'))return}switch([32,37,38,39,40,48,49,50,51,52,53,54,56,57,67,70,73,75,76,77,79].includes(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:s||(t.currentTime=t.duration/10*(n-48));break;case 32:case 75:s||t.togglePlay();break;case 38:t.increaseVolume(.1);break;case 40:t.decreaseVolume(.1);break;case 77:s||(t.muted=!t.muted);break;case 39:t.forward();break;case 37:t.rewind();break;case 70:t.fullscreen.toggle();break;case 67:s||t.toggleCaptions();break;case 76:t.loop=!t.loop}27===n&&!t.fullscreen.usingNative&&t.fullscreen.active&&t.fullscreen.toggle(),this.lastKey=n}else this.lastKey=null}},{key:"toggleMenu",value:function(e){Re.toggleMenu.call(this.player,e)}},{key:"firstTouch",value:function(){var e=this.player,t=e.elements;e.touch=!0,he(t.container,e.config.classNames.isTouch,!0)}},{key:"setTabFocus",value:function(e){var t=this.player,i=t.elements;if(clearTimeout(this.focusTimer),"keydown"!==e.type||9===e.which){"keydown"===e.type&&(this.lastKeyDown=e.timeStamp);var n,a=e.timeStamp-this.lastKeyDown<=20;("focus"!==e.type||a)&&(n=t.config.classNames.tabFocus,he(fe.call(t,".".concat(n)),n,!1),this.focusTimer=setTimeout((function(){var e=document.activeElement;i.container.contains(e)&&he(document.activeElement,t.config.classNames.tabFocus,!0)}),10))}}},{key:"global",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=this.player;t.config.keyboard.global&&J.call(t,window,"keydown keyup",this.handleKey,e,!1),J.call(t,document.body,"click",this.toggleMenu,e),Z.call(t,document.body,"touchstart",this.firstTouch),J.call(t,document.body,"keydown focus blur",this.setTabFocus,e,!1,!0)}},{key:"container",value:function(){var e=this.player,t=e.config,i=e.elements,n=e.timers;!t.keyboard.global&&t.keyboard.focused&&$.call(e,i.container,"keydown keyup",this.handleKey,!1),$.call(e,i.container,"mousemove mouseleave touchstart touchmove enterfullscreen exitfullscreen",(function(t){var a=i.controls;a&&"enterfullscreen"===t.type&&(a.pressed=!1,a.hover=!1);var s=0;["touchstart","touchmove","mousemove"].includes(t.type)&&(tt.toggleControls.call(e,!0),s=e.touch?3e3:2e3),clearTimeout(n.controls),n.controls=setTimeout((function(){return tt.toggleControls.call(e,!1)}),s)}));var s=function(t){if(!t)return Ae.call(e);var n=i.container.getBoundingClientRect(),a=n.width,s=n.height;return Ae.call(e,"".concat(a,":").concat(s))},o=function(){clearTimeout(n.resized),n.resized=setTimeout(s,50)};$.call(e,i.container,"enterfullscreen exitfullscreen",(function(t){var n=e.fullscreen,r=n.target,l=n.usingNative;if(r===i.container&&(e.isEmbed||!z(e.config.ratio))){var c="enterfullscreen"===t.type,u=s(c);u.padding,!function(t,i,n){if(e.isVimeo){var s=e.elements.wrapper.firstChild,o=a(t,2)[1],r=a(Ce.call(e),2),l=r[0],c=r[1];s.style.maxWidth=n?"".concat(o/c*l,"px"):null,s.style.margin=n?"0 auto":null}}(u.ratio,0,c),l||(c?$.call(e,window,"resize",o):G.call(e,window,"resize",o))}}))}},{key:"media",value:function(){var e=this,t=this.player,i=t.elements;if($.call(t,t.media,"timeupdate seeking seeked",(function(e){return Re.timeUpdate.call(t,e)})),$.call(t,t.media,"durationchange loadeddata loadedmetadata",(function(e){return Re.durationUpdate.call(t,e)})),$.call(t,t.media,"canplay loadeddata",(function(){de(i.volume,!t.hasAudio),de(i.buttons.mute,!t.hasAudio)})),$.call(t,t.media,"ended",(function(){t.isHTML5&&t.isVideo&&t.config.resetOnEnd&&t.restart()})),$.call(t,t.media,"progress playing seeking seeked",(function(e){return Re.updateProgress.call(t,e)})),$.call(t,t.media,"volumechange",(function(e){return Re.updateVolume.call(t,e)})),$.call(t,t.media,"playing play pause ended emptied timeupdate",(function(e){return tt.checkPlaying.call(t,e)})),$.call(t,t.media,"waiting canplay seeked playing",(function(e){return tt.checkLoading.call(t,e)})),t.supported.ui&&t.config.clickToPlay&&!t.isAudio){var n=ge.call(t,".".concat(t.config.classNames.video));if(!R(n))return;$.call(t,i.container,"click",(function(a){([i.container,n].includes(a.target)||n.contains(a.target))&&(t.touch&&t.config.hideControls||(t.ended?(e.proxy(a,t.restart,"restart"),e.proxy(a,t.play,"play")):e.proxy(a,t.togglePlay,"play")))}))}t.supported.ui&&t.config.disableContextMenu&&$.call(t,i.wrapper,"contextmenu",(function(e){e.preventDefault()}),!1),$.call(t,t.media,"volumechange",(function(){t.storage.set({volume:t.volume,muted:t.muted})})),$.call(t,t.media,"ratechange",(function(){Re.updateSetting.call(t,"speed"),t.storage.set({speed:t.speed})})),$.call(t,t.media,"qualitychange",(function(e){Re.updateSetting.call(t,"quality",null,e.detail.quality)})),$.call(t,t.media,"ready qualitychange",(function(){Re.setDownloadUrl.call(t)}));var a=t.config.events.concat(["keyup","keydown"]).join(" ");$.call(t,t.media,a,(function(e){var n=e.detail,a=void 0===n?{}:n;"error"===e.type&&(a=t.media.error),ee.call(t,i.container,e.type,!0,a)}))}},{key:"proxy",value:function(e,t,i){var n=this.player,a=n.config.listeners[i],s=!0;j(a)&&(s=a.call(n,e)),s&&j(t)&&t.call(n,e)}},{key:"bind",value:function(e,t,i,n){var a=this,s=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=this.player,r=o.config.listeners[n],l=j(r);$.call(o,e,t,(function(e){return a.proxy(e,i,n)}),s&&!l)}},{key:"controls",value:function(){var e=this,t=this.player,i=t.elements,n=Q.isIE?"change":"input";if(i.buttons.play&&Array.from(i.buttons.play).forEach((function(i){e.bind(i,"click",t.togglePlay,"play")})),this.bind(i.buttons.restart,"click",t.restart,"restart"),this.bind(i.buttons.rewind,"click",t.rewind,"rewind"),this.bind(i.buttons.fastForward,"click",t.forward,"fastForward"),this.bind(i.buttons.mute,"click",(function(){t.muted=!t.muted}),"mute"),this.bind(i.buttons.captions,"click",(function(){return t.toggleCaptions()})),this.bind(i.buttons.download,"click",(function(){ee.call(t,t.media,"download")}),"download"),this.bind(i.buttons.fullscreen,"click",(function(){t.fullscreen.toggle()}),"fullscreen"),this.bind(i.buttons.pip,"click",(function(){t.pip="toggle"}),"pip"),this.bind(i.buttons.airplay,"click",t.airplay,"airplay"),this.bind(i.buttons.settings,"click",(function(e){e.stopPropagation(),Re.toggleMenu.call(t,e)})),this.bind(i.buttons.settings,"keyup",(function(e){var i=e.which;[13,32].includes(i)&&(13!==i?(e.preventDefault(),e.stopPropagation(),Re.toggleMenu.call(t,e)):Re.focusFirstMenuItem.call(t,null,!0))}),null,!1),this.bind(i.settings.menu,"keydown",(function(e){27===e.which&&Re.toggleMenu.call(t,e)})),this.bind(i.inputs.seek,"mousedown mousemove",(function(e){var t=i.progress.getBoundingClientRect(),n=100/t.width*(e.pageX-t.left);e.currentTarget.setAttribute("seek-value",n)})),this.bind(i.inputs.seek,"mousedown mouseup keydown keyup touchstart touchend",(function(e){var i=e.currentTarget,n=e.keyCode?e.keyCode:e.which;if(!B(e)||39===n||37===n){t.lastSeekTime=Date.now();var a=i.hasAttribute("play-on-seeked"),s=["mouseup","touchend","keyup"].includes(e.type);a&&s?(i.removeAttribute("play-on-seeked"),t.play()):!s&&t.playing&&(i.setAttribute("play-on-seeked",""),t.pause())}})),Q.isIos){var s=fe.call(t,'input[type="range"]');Array.from(s).forEach((function(t){return e.bind(t,n,(function(e){return Y(e.target)}))}))}this.bind(i.inputs.seek,n,(function(e){var i=e.currentTarget,n=i.getAttribute("seek-value");z(n)&&(n=i.value),i.removeAttribute("seek-value"),t.currentTime=n/i.max*t.duration}),"seek"),this.bind(i.progress,"mouseenter mouseleave mousemove",(function(e){return Re.updateSeekTooltip.call(t,e)})),this.bind(i.progress,"mousemove touchmove",(function(e){var i=t.previewThumbnails;i&&i.loaded&&i.startMove(e)})),this.bind(i.progress,"mouseleave click",(function(){var e=t.previewThumbnails;e&&e.loaded&&e.endMove(!1,!0)})),this.bind(i.progress,"mousedown touchstart",(function(e){var i=t.previewThumbnails;i&&i.loaded&&i.startScrubbing(e)})),this.bind(i.progress,"mouseup touchend",(function(e){var i=t.previewThumbnails;i&&i.loaded&&i.endScrubbing(e)})),Q.isWebkit&&Array.from(fe.call(t,'input[type="range"]')).forEach((function(i){e.bind(i,"input",(function(e){return Re.updateRangeFill.call(t,e.target)}))})),t.config.toggleInvert&&!R(i.display.duration)&&this.bind(i.display.currentTime,"click",(function(){0!==t.currentTime&&(t.config.invertTime=!t.config.invertTime,Re.timeUpdate.call(t))})),this.bind(i.inputs.volume,n,(function(e){t.volume=e.target.value}),"volume"),this.bind(i.controls,"mouseenter mouseleave",(function(e){i.controls.hover=!t.touch&&"mouseenter"===e.type})),this.bind(i.controls,"mousedown mouseup touchstart touchend touchcancel",(function(e){i.controls.pressed=["mousedown","touchstart"].includes(e.type)})),this.bind(i.controls,"focusin",(function(){var n=t.config,a=t.timers;he(i.controls,n.classNames.noTransition,!0),tt.toggleControls.call(t,!0),setTimeout((function(){he(i.controls,n.classNames.noTransition,!1)}),0);var s=e.touch?3e3:4e3;clearTimeout(a.controls),a.controls=setTimeout((function(){return tt.toggleControls.call(t,!1)}),s)})),this.bind(i.inputs.volume,"wheel",(function(e){var i=e.webkitDirectionInvertedFromDevice,n=a([e.deltaX,-e.deltaY].map((function(e){return i?-e:e})),2),s=n[0],o=n[1],r=Math.sign(Math.abs(s)>Math.abs(o)?s:o);t.increaseVolume(r/50);var l=t.media.volume;(1===r&&l<1||-1===r&&l>0)&&e.preventDefault()}),"volume",!1)}}]),t}();"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var nt=function(e,t){return function(e,t){e.exports=function(){var e=function(){},t={},i={},n={};function a(e,t){if(e){var a=n[e];if(i[e]=t,a)for(;a.length;)a[0](e,t),a.splice(0,1)}}function s(t,i){t.call&&(t={success:t}),i.length?(t.error||e)(i):(t.success||e)(t)}function o(t,i,n,a){var s,r,l=document,c=n.async,u=(n.numRetries||0)+1,d=n.before||e,h=t.replace(/^(css|img)!/,"");a=a||0,/(^css!|\.css$)/.test(t)?((r=l.createElement("link")).rel="stylesheet",r.href=h,(s="hideFocus"in r)&&r.relList&&(s=0,r.rel="preload",r.as="style")):/(^img!|\.(png|gif|jpg|svg)$)/.test(t)?(r=l.createElement("img")).src=h:((r=l.createElement("script")).src=t,r.async=void 0===c||c),r.onload=r.onerror=r.onbeforeload=function(e){var l=e.type[0];if(s)try{r.sheet.cssText.length||(l="e")}catch(e){18!=e.code&&(l="e")}if("e"==l){if((a+=1)<u)return o(t,i,n,a)}else if("preload"==r.rel&&"style"==r.as)return r.rel="stylesheet";i(t,l,e.defaultPrevented)},!1!==d(t,r)&&l.head.appendChild(r)}function r(e,i,n){var r,l;if(i&&i.trim&&(r=i),l=(r?n:i)||{},r){if(r in t)throw"LoadJS";t[r]=!0}function c(t,i){!function(e,t,i){var n,a,s=(e=e.push?e:[e]).length,r=s,l=[];for(n=function(e,i,n){if("e"==i&&l.push(e),"b"==i){if(!n)return;l.push(e)}--s||t(l)},a=0;a<r;a++)o(e[a],n,i)}(e,(function(e){s(l,e),t&&s({success:t,error:i},e),a(r,e)}),l)}if(l.returnPromise)return new Promise(c);c()}return r.ready=function(e,t){return function(e,t){e=e.push?e:[e];var a,s,o,r=[],l=e.length,c=l;for(a=function(e,i){i.length&&r.push(e),--c||t(r)};l--;)s=e[l],(o=i[s])?a(s,o):(n[s]=n[s]||[]).push(a)}(e,(function(e){s(t,e)})),r},r.done=function(e){a(e,[])},r.reset=function(){t={},i={},n={}},r.isDefined=function(e){return e in t},r}()}(t={exports:{}}),t.exports}();function at(e){return new Promise((function(t,i){nt(e,{success:t,error:i})}))}function st(e){e&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===e&&(this.media.paused=!e,ee.call(this,this.media,e?"play":"pause"))}var ot={setup:function(){var e=this;he(this.elements.wrapper,this.config.classNames.embed,!0),Ae.call(this),_(window.Vimeo)?ot.ready.call(this):at(this.config.urls.vimeo.sdk).then((function(){ot.ready.call(e)})).catch((function(t){e.debug.warn("Vimeo SDK (player.js) failed to load",t)}))},ready:function(){var e=this,t=this,i=t.config.vimeo,n=Be(ie({},{loop:t.config.loop.active,autoplay:t.autoplay,muted:t.muted,gesture:"media",playsinline:!this.config.fullscreen.iosNative},i)),s=t.media.getAttribute("src");z(s)&&(s=t.media.getAttribute(t.config.attributes.embed.id));var o,r=z(o=s)?null:O(Number(o))?o:o.match(/^.*(vimeo.com\/|video\/)(\d+).*/)?RegExp.$2:o,l=se("iframe"),c=Pe(t.config.urls.vimeo.iframe,r,n);l.setAttribute("src",c),l.setAttribute("allowfullscreen",""),l.setAttribute("allowtransparency",""),l.setAttribute("allow","autoplay");var u=se("div",{poster:t.poster,class:t.config.classNames.embedContainer});u.appendChild(l),t.media=ce(u,t.media),Oe(Pe(t.config.urls.vimeo.api,r),"json").then((function(e){if(!z(e)){var i=new URL(e[0].thumbnail_large);i.pathname="".concat(i.pathname.split("_")[0],".jpg"),tt.setPoster.call(t,i.href).catch((function(){}))}})),t.embed=new window.Vimeo.Player(l,{autopause:t.config.autopause,muted:t.muted}),t.media.paused=!0,t.media.currentTime=0,t.supported.ui&&t.embed.disableTextTrack(),t.media.play=function(){return st.call(t,!0),t.embed.play()},t.media.pause=function(){return st.call(t,!1),t.embed.pause()},t.media.stop=function(){t.pause(),t.currentTime=0};var d=t.media.currentTime;Object.defineProperty(t.media,"currentTime",{get:function(){return d},set:function(e){var i=t.embed,n=t.media,a=t.paused,s=t.volume,o=a&&!i.hasPlayed;n.seeking=!0,ee.call(t,n,"seeking"),Promise.resolve(o&&i.setVolume(0)).then((function(){return i.setCurrentTime(e)})).then((function(){return o&&i.pause()})).then((function(){return o&&i.setVolume(s)})).catch((function(){}))}});var h=t.config.speed.selected;Object.defineProperty(t.media,"playbackRate",{get:function(){return h},set:function(e){t.embed.setPlaybackRate(e).then((function(){h=e,ee.call(t,t.media,"ratechange")})).catch((function(e){"Error"===e.name&&Re.setSpeedMenu.call(t,[])}))}});var p=t.config.volume;Object.defineProperty(t.media,"volume",{get:function(){return p},set:function(e){t.embed.setVolume(e).then((function(){p=e,ee.call(t,t.media,"volumechange")}))}});var m=t.config.muted;Object.defineProperty(t.media,"muted",{get:function(){return m},set:function(e){var i=!!H(e)&&e;t.embed.setVolume(i?0:t.config.volume).then((function(){m=i,ee.call(t,t.media,"volumechange")}))}});var f,g=t.config.loop;Object.defineProperty(t.media,"loop",{get:function(){return g},set:function(e){var i=H(e)?e:t.config.loop.active;t.embed.setLoop(i).then((function(){g=i}))}}),t.embed.getVideoUrl().then((function(e){f=e,Re.setDownloadUrl.call(t)})).catch((function(t){e.debug.warn(t)})),Object.defineProperty(t.media,"currentSrc",{get:function(){return f}}),Object.defineProperty(t.media,"ended",{get:function(){return t.currentTime===t.duration}}),Promise.all([t.embed.getVideoWidth(),t.embed.getVideoHeight()]).then((function(i){var n=a(i,2),s=n[0],o=n[1];t.embed.ratio=[s,o],Ae.call(e)})),t.embed.setAutopause(t.config.autopause).then((function(e){t.config.autopause=e})),t.embed.getVideoTitle().then((function(i){t.config.title=i,tt.setTitle.call(e)})),t.embed.getCurrentTime().then((function(e){d=e,ee.call(t,t.media,"timeupdate")})),t.embed.getDuration().then((function(e){t.media.duration=e,ee.call(t,t.media,"durationchange")})),t.embed.getTextTracks().then((function(e){t.media.textTracks=e,Ue.setup.call(t)})),t.embed.on("cuechange",(function(e){var i=e.cues,n=(void 0===i?[]:i).map((function(e){return function(e){var t=document.createDocumentFragment(),i=document.createElement("div");return t.appendChild(i),i.innerHTML=e,t.firstChild.innerText}(e.text)}));Ue.updateCues.call(t,n)})),t.embed.on("loaded",(function(){t.embed.getPaused().then((function(e){st.call(t,!e),e||ee.call(t,t.media,"playing")})),R(t.embed.element)&&t.supported.ui&&t.embed.element.setAttribute("tabindex",-1)})),t.embed.on("play",(function(){st.call(t,!0),ee.call(t,t.media,"playing")})),t.embed.on("pause",(function(){st.call(t,!1)})),t.embed.on("timeupdate",(function(e){t.media.seeking=!1,d=e.seconds,ee.call(t,t.media,"timeupdate")})),t.embed.on("progress",(function(e){t.media.buffered=e.percent,ee.call(t,t.media,"progress"),1===parseInt(e.percent,10)&&ee.call(t,t.media,"canplaythrough"),t.embed.getDuration().then((function(e){e!==t.media.duration&&(t.media.duration=e,ee.call(t,t.media,"durationchange"))}))})),t.embed.on("seeked",(function(){t.media.seeking=!1,ee.call(t,t.media,"seeked")})),t.embed.on("ended",(function(){t.media.paused=!0,ee.call(t,t.media,"ended")})),t.embed.on("error",(function(e){t.media.error=e,ee.call(t,t.media,"error")})),setTimeout((function(){return tt.build.call(t)}),0)}};function rt(e){e&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===e&&(this.media.paused=!e,ee.call(this,this.media,e?"play":"pause"))}function lt(e){return e.noCookie?"https://www.youtube-nocookie.com":"http:"===window.location.protocol?"http://www.youtube.com":void 0}var ct,ut={setup:function(){var e=this;if(he(this.elements.wrapper,this.config.classNames.embed,!0),_(window.YT)&&j(window.YT.Player))ut.ready.call(this);else{var t=window.onYouTubeIframeAPIReady;window.onYouTubeIframeAPIReady=function(){j(t)&&t(),ut.ready.call(e)},at(this.config.urls.youtube.sdk).catch((function(t){e.debug.warn("YouTube API failed to load",t)}))}},getTitle:function(e){var t=this;Oe(Pe(this.config.urls.youtube.api,e)).then((function(e){if(_(e)){var i=e.title,n=e.height,a=e.width;t.config.title=i,tt.setTitle.call(t),t.embed.ratio=[a,n]}Ae.call(t)})).catch((function(){Ae.call(t)}))},ready:function(){var e=this,t=e.media&&e.media.getAttribute("id");if(z(t)||!t.startsWith("youtube-")){var i=e.media.getAttribute("src");z(i)&&(i=e.media.getAttribute(this.config.attributes.embed.id));var n,a,s=z(n=i)?null:n.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/)?RegExp.$2:n,o=(a=e.provider,"".concat(a,"-").concat(Math.floor(1e4*Math.random()))),r=se("div",{id:o,poster:e.poster});e.media=ce(r,e.media);var l=function(e){return"https://i.ytimg.com/vi/".concat(s,"/").concat(e,"default.jpg")};et(l("maxres"),121).catch((function(){return et(l("sd"),121)})).catch((function(){return et(l("hq"))})).then((function(t){return tt.setPoster.call(e,t.src)})).then((function(t){t.includes("maxres")||(e.elements.poster.style.backgroundSize="cover")})).catch((function(){}));var c=e.config.youtube;e.embed=new window.YT.Player(o,{videoId:s,host:lt(c),playerVars:ie({},{autoplay:e.config.autoplay?1:0,hl:e.config.hl,controls:e.supported.ui?0:1,disablekb:1,playsinline:e.config.fullscreen.iosNative?0:1,cc_load_policy:e.captions.active?1:0,cc_lang_pref:e.config.captions.language,widget_referrer:window?window.location.href:null},c),events:{onError:function(t){if(!e.media.error){var i=t.data,n={2:"The request contains an invalid parameter value. For example, this error occurs if you specify a video ID that does not have 11 characters, or if the video ID contains invalid characters, such as exclamation points or asterisks.",5:"The requested content cannot be played in an HTML5 player or another error related to the HTML5 player has occurred.",100:"The video requested was not found. This error occurs when a video has been removed (for any reason) or has been marked as private.",101:"The owner of the requested video does not allow it to be played in embedded players.",150:"The owner of the requested video does not allow it to be played in embedded players."}[i]||"An unknown error occured";e.media.error={code:i,message:n},ee.call(e,e.media,"error")}},onPlaybackRateChange:function(t){var i=t.target;e.media.playbackRate=i.getPlaybackRate(),ee.call(e,e.media,"ratechange")},onReady:function(t){if(!j(e.media.play)){var i=t.target;ut.getTitle.call(e,s),e.media.play=function(){rt.call(e,!0),i.playVideo()},e.media.pause=function(){rt.call(e,!1),i.pauseVideo()},e.media.stop=function(){i.stopVideo()},e.media.duration=i.getDuration(),e.media.paused=!0,e.media.currentTime=0,Object.defineProperty(e.media,"currentTime",{get:function(){return Number(i.getCurrentTime())},set:function(t){e.paused&&!e.embed.hasPlayed&&e.embed.mute(),e.media.seeking=!0,ee.call(e,e.media,"seeking"),i.seekTo(t)}}),Object.defineProperty(e.media,"playbackRate",{get:function(){return i.getPlaybackRate()},set:function(e){i.setPlaybackRate(e)}});var n=e.config.volume;Object.defineProperty(e.media,"volume",{get:function(){return n},set:function(t){n=t,i.setVolume(100*n),ee.call(e,e.media,"volumechange")}});var a=e.config.muted;Object.defineProperty(e.media,"muted",{get:function(){return a},set:function(t){var n=H(t)?t:a;a=n,i[n?"mute":"unMute"](),ee.call(e,e.media,"volumechange")}}),Object.defineProperty(e.media,"currentSrc",{get:function(){return i.getVideoUrl()}}),Object.defineProperty(e.media,"ended",{get:function(){return e.currentTime===e.duration}}),e.options.speed=i.getAvailablePlaybackRates(),e.supported.ui&&e.media.setAttribute("tabindex",-1),ee.call(e,e.media,"timeupdate"),ee.call(e,e.media,"durationchange"),clearInterval(e.timers.buffering),e.timers.buffering=setInterval((function(){e.media.buffered=i.getVideoLoadedFraction(),(null===e.media.lastBuffered||e.media.lastBuffered<e.media.buffered)&&ee.call(e,e.media,"progress"),e.media.lastBuffered=e.media.buffered,1===e.media.buffered&&(clearInterval(e.timers.buffering),ee.call(e,e.media,"canplaythrough"))}),200),setTimeout((function(){return tt.build.call(e)}),50)}},onStateChange:function(t){var i=t.target;switch(clearInterval(e.timers.playing),e.media.seeking&&[1,2].includes(t.data)&&(e.media.seeking=!1,ee.call(e,e.media,"seeked")),t.data){case-1:ee.call(e,e.media,"timeupdate"),e.media.buffered=i.getVideoLoadedFraction(),ee.call(e,e.media,"progress");break;case 0:rt.call(e,!1),e.media.loop?(i.stopVideo(),i.playVideo()):ee.call(e,e.media,"ended");break;case 1:e.config.autoplay||!e.media.paused||e.embed.hasPlayed?(rt.call(e,!0),ee.call(e,e.media,"playing"),e.timers.playing=setInterval((function(){ee.call(e,e.media,"timeupdate")}),50),e.media.duration!==i.getDuration()&&(e.media.duration=i.getDuration(),ee.call(e,e.media,"durationchange"))):e.media.pause();break;case 2:e.muted||e.embed.unMute(),rt.call(e,!1)}ee.call(e,e.elements.container,"statechange",!1,{code:t.data})}}})}}},dt={setup:function(){this.media?(he(this.elements.container,this.config.classNames.type.replace("{0}",this.type),!0),he(this.elements.container,this.config.classNames.provider.replace("{0}",this.provider),!0),this.isEmbed&&he(this.elements.container,this.config.classNames.type.replace("{0}","video"),!0),this.isVideo&&(this.elements.wrapper=se("div",{class:this.config.classNames.video}),ne(this.media,this.elements.wrapper),this.elements.poster=se("div",{class:this.config.classNames.poster}),this.elements.wrapper.appendChild(this.elements.poster)),this.isHTML5?Ee.extend.call(this):this.isYouTube?ut.setup.call(this):this.isVimeo&&ot.setup.call(this)):this.debug.warn("No media element found!")}},ht=function(){function t(i){var n=this;e(this,t),this.player=i,this.config=i.config.ads,this.playing=!1,this.initialized=!1,this.elements={container:null,displayContainer:null},this.manager=null,this.loader=null,this.cuePoints=null,this.events={},this.safetyTimer=null,this.countdownTimer=null,this.managerPromise=new Promise((function(e,t){n.on("loaded",e),n.on("error",t)})),this.load()}return i(t,[{key:"load",value:function(){var e=this;this.enabled&&(_(window.google)&&_(window.google.ima)?this.ready():at(this.player.config.urls.googleIMA.sdk).then((function(){e.ready()})).catch((function(){e.trigger("error",new Error("Google IMA SDK failed to load"))})))}},{key:"ready",value:function(){var e,t=this;this.enabled||((e=this).manager&&e.manager.destroy(),e.elements.displayContainer&&e.elements.displayContainer.destroy(),e.elements.container.remove()),this.startSafetyTimer(12e3,"ready()"),this.managerPromise.then((function(){t.clearSafetyTimer("onAdsManagerLoaded()")})),this.listeners(),this.setupIMA()}},{key:"setupIMA",value:function(){this.elements.container=se("div",{class:this.player.config.classNames.ads}),this.player.elements.container.appendChild(this.elements.container),google.ima.settings.setVpaidMode(google.ima.ImaSdkSettings.VpaidMode.ENABLED),google.ima.settings.setLocale(this.player.config.ads.language),google.ima.settings.setDisableCustomPlaybackForIOS10Plus(this.player.config.playsinline),this.elements.displayContainer=new google.ima.AdDisplayContainer(this.elements.container,this.player.media),this.requestAds()}},{key:"requestAds",value:function(){var e=this,t=this.player.elements.container;try{this.loader=new google.ima.AdsLoader(this.elements.displayContainer),this.loader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,(function(t){return e.onAdsManagerLoaded(t)}),!1),this.loader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,(function(t){return e.onAdError(t)}),!1);var i=new google.ima.AdsRequest;i.adTagUrl=this.tagUrl,i.linearAdSlotWidth=t.offsetWidth,i.linearAdSlotHeight=t.offsetHeight,i.nonLinearAdSlotWidth=t.offsetWidth,i.nonLinearAdSlotHeight=t.offsetHeight,i.forceNonLinearFullSlot=!1,i.setAdWillPlayMuted(!this.player.muted),this.loader.requestAds(i)}catch(e){this.onAdError(e)}}},{key:"pollCountdown",value:function(){var e=this;if(!(arguments.length>0&&void 0!==arguments[0]&&arguments[0]))return clearInterval(this.countdownTimer),void this.elements.container.removeAttribute("data-badge-text");this.countdownTimer=setInterval((function(){var t=Fe(Math.max(e.manager.getRemainingTime(),0)),i="".concat(Le("advertisement",e.player.config)," - ").concat(t);e.elements.container.setAttribute("data-badge-text",i)}),100)}},{key:"onAdsManagerLoaded",value:function(e){var t=this;if(this.enabled){var i=new google.ima.AdsRenderingSettings;i.restoreCustomPlaybackStateOnAdBreakComplete=!0,i.enablePreloading=!0,this.manager=e.getAdsManager(this.player,i),this.cuePoints=this.manager.getCuePoints(),this.manager.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,(function(e){return t.onAdError(e)})),Object.keys(google.ima.AdEvent.Type).forEach((function(e){t.manager.addEventListener(google.ima.AdEvent.Type[e],(function(e){return t.onAdEvent(e)}))})),this.trigger("loaded")}}},{key:"addCuePoints",value:function(){var e=this;z(this.cuePoints)||this.cuePoints.forEach((function(t){if(0!==t&&-1!==t&&t<e.player.duration){var i=e.player.elements.progress;if(R(i)){var n=100/e.player.duration*t,a=se("span",{class:e.player.config.classNames.cues});a.style.left="".concat(n.toString(),"%"),i.appendChild(a)}}}))}},{key:"onAdEvent",value:function(e){var t=this,i=this.player.elements.container,n=e.getAd(),a=e.getAdData();switch(function(e){ee.call(t.player,t.player.media,"ads".concat(e.replace(/_/g,"").toLowerCase()))}(e.type),e.type){case google.ima.AdEvent.Type.LOADED:this.trigger("loaded"),this.pollCountdown(!0),n.isLinear()||(n.width=i.offsetWidth,n.height=i.offsetHeight);break;case google.ima.AdEvent.Type.STARTED:this.manager.setVolume(this.player.volume);break;case google.ima.AdEvent.Type.ALL_ADS_COMPLETED:this.loadAds();break;case google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED:this.pauseContent();break;case google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED:this.pollCountdown(),this.resumeContent();break;case google.ima.AdEvent.Type.LOG:a.adError&&this.player.debug.warn("Non-fatal ad error: ".concat(a.adError.getMessage()))}}},{key:"onAdError",value:function(e){this.cancel(),this.player.debug.warn("Ads error",e)}},{key:"listeners",value:function(){var e,t=this,i=this.player.elements.container;this.player.on("canplay",(function(){t.addCuePoints()})),this.player.on("ended",(function(){t.loader.contentComplete()})),this.player.on("timeupdate",(function(){e=t.player.currentTime})),this.player.on("seeked",(function(){var i=t.player.currentTime;z(t.cuePoints)||t.cuePoints.forEach((function(n,a){e<n&&n<i&&(t.manager.discardAdBreak(),t.cuePoints.splice(a,1))}))})),window.addEventListener("resize",(function(){t.manager&&t.manager.resize(i.offsetWidth,i.offsetHeight,google.ima.ViewMode.NORMAL)}))}},{key:"play",value:function(){var e=this,t=this.player.elements.container;this.managerPromise||this.resumeContent(),this.managerPromise.then((function(){e.manager.setVolume(e.player.volume),e.elements.displayContainer.initialize();try{e.initialized||(e.manager.init(t.offsetWidth,t.offsetHeight,google.ima.ViewMode.NORMAL),e.manager.start()),e.initialized=!0}catch(t){e.onAdError(t)}})).catch((function(){}))}},{key:"resumeContent",value:function(){this.elements.container.style.zIndex="",this.playing=!1,this.player.media.play()}},{key:"pauseContent",value:function(){this.elements.container.style.zIndex=3,this.playing=!0,this.player.media.pause()}},{key:"cancel",value:function(){this.initialized&&this.resumeContent(),this.trigger("error"),this.loadAds()}},{key:"loadAds",value:function(){var e=this;this.managerPromise.then((function(){e.manager&&e.manager.destroy(),e.managerPromise=new Promise((function(t){e.on("loaded",t),e.player.debug.log(e.manager)})),e.requestAds()})).catch((function(){}))}},{key:"trigger",value:function(e){for(var t=this,i=arguments.length,n=new Array(i>1?i-1:0),a=1;a<i;a++)n[a-1]=arguments[a];var s=this.events[e];D(s)&&s.forEach((function(e){j(e)&&e.apply(t,n)}))}},{key:"on",value:function(e,t){return D(this.events[e])||(this.events[e]=[]),this.events[e].push(t),this}},{key:"startSafetyTimer",value:function(e,t){var i=this;this.player.debug.log("Safety timer invoked from: ".concat(t)),this.safetyTimer=setTimeout((function(){i.cancel(),i.clearSafetyTimer("startSafetyTimer()")}),e)}},{key:"clearSafetyTimer",value:function(e){L(this.safetyTimer)||(this.player.debug.log("Safety timer cleared from: ".concat(e)),clearTimeout(this.safetyTimer),this.safetyTimer=null)}},{key:"enabled",get:function(){var e=this.config;return this.player.isHTML5&&this.player.isVideo&&e.enabled&&(!z(e.publisherId)||W(e.tagUrl))}},{key:"tagUrl",get:function(){var e=this.config;if(W(e.tagUrl))return e.tagUrl;var t={AV_PUBLISHERID:"58c25bb0073ef448b1087ad6",AV_CHANNELID:"5a0458dc28a06145e4519d21",AV_URL:window.location.hostname,cb:Date.now(),AV_WIDTH:640,AV_HEIGHT:480,AV_CDIM2:this.publisherId};return"".concat("https://go.aniview.com/api/adserver6/vast/","?").concat(Be(t))}}]),t}(),pt=function(){function t(i){e(this,t),this.player=i,this.thumbnails=[],this.loaded=!1,this.lastMouseMoveTime=Date.now(),this.mouseDown=!1,this.loadedImages=[],this.elements={thumb:{},scrubbing:{}},this.load()}return i(t,[{key:"load",value:function(){var e=this;this.player.elements.display.seekTooltip&&(this.player.elements.display.seekTooltip.hidden=this.enabled),this.enabled&&this.getThumbnails().then((function(){e.enabled&&(e.render(),e.determineContainerAutoSizing(),e.loaded=!0)}))}},{key:"getThumbnails",value:function(){var e=this;return new Promise((function(t){var i=e.player.config.previewThumbnails.src;if(z(i))throw new Error("Missing previewThumbnails.src config attribute");var n=(q(i)?[i]:i).map((function(t){return e.getThumbnail(t)}));Promise.all(n).then((function(){e.thumbnails.sort((function(e,t){return e.height-t.height})),e.player.debug.log("Preview thumbnails",e.thumbnails),t()}))}))}},{key:"getThumbnail",value:function(e){var t=this;return new Promise((function(i){Oe(e).then((function(n){var s,o,r={frames:(s=n,o=[],s.split(/\r\n\r\n|\n\n|\r\r/).forEach((function(e){var t={};e.split(/\r\n|\n|\r/).forEach((function(e){if(O(t.startTime)){if(!z(e.trim())&&z(t.text)){var i=e.trim().split("#xywh="),n=a(i,1);if(t.text=n[0],i[1]){var s=a(i[1].split(","),4);t.x=s[0],t.y=s[1],t.w=s[2],t.h=s[3]}}}else{var o=e.match(/([0-9]{2})?:?([0-9]{2}):([0-9]{2}).([0-9]{2,3})( ?--> ?)([0-9]{2})?:?([0-9]{2}):([0-9]{2}).([0-9]{2,3})/);o&&(t.startTime=60*Number(o[1]||0)*60+60*Number(o[2])+Number(o[3])+Number("0.".concat(o[4])),t.endTime=60*Number(o[6]||0)*60+60*Number(o[7])+Number(o[8])+Number("0.".concat(o[9])))}})),t.text&&o.push(t)})),o),height:null,urlPrefix:""};r.frames[0].text.startsWith("/")||r.frames[0].text.startsWith("http://")||r.frames[0].text.startsWith("https://")||(r.urlPrefix=e.substring(0,e.lastIndexOf("/")+1));var l=new Image;l.onload=function(){r.height=l.naturalHeight,r.width=l.naturalWidth,t.thumbnails.push(r),i()},l.src=r.urlPrefix+r.frames[0].text}))}))}},{key:"startMove",value:function(e){if(this.loaded&&V(e)&&["touchmove","mousemove"].includes(e.type)&&this.player.media.duration){if("touchmove"===e.type)this.seekTime=this.player.media.duration*(this.player.elements.inputs.seek.value/100);else{var t=this.player.elements.progress.getBoundingClientRect(),i=100/t.width*(e.pageX-t.left);this.seekTime=this.player.media.duration*(i/100),this.seekTime<0&&(this.seekTime=0),this.seekTime>this.player.media.duration-1&&(this.seekTime=this.player.media.duration-1),this.mousePosX=e.pageX,this.elements.thumb.time.innerText=Fe(this.seekTime)}this.showImageAtCurrentTime()}}},{key:"endMove",value:function(){this.toggleThumbContainer(!1,!0)}},{key:"startScrubbing",value:function(e){!1!==e.button&&0!==e.button||(this.mouseDown=!0,this.player.media.duration&&(this.toggleScrubbingContainer(!0),this.toggleThumbContainer(!1,!0),this.showImageAtCurrentTime()))}},{key:"endScrubbing",value:function(){var e=this;this.mouseDown=!1,Math.ceil(this.lastTime)===Math.ceil(this.player.media.currentTime)?this.toggleScrubbingContainer(!1):Z.call(this.player,this.player.media,"timeupdate",(function(){e.mouseDown||e.toggleScrubbingContainer(!1)}))}},{key:"listeners",value:function(){var e=this;this.player.on("play",(function(){e.toggleThumbContainer(!1,!0)})),this.player.on("seeked",(function(){e.toggleThumbContainer(!1)})),this.player.on("timeupdate",(function(){e.lastTime=e.player.media.currentTime}))}},{key:"render",value:function(){this.elements.thumb.container=se("div",{class:this.player.config.classNames.previewThumbnails.thumbContainer}),this.elements.thumb.imageContainer=se("div",{class:this.player.config.classNames.previewThumbnails.imageContainer}),this.elements.thumb.container.appendChild(this.elements.thumb.imageContainer);var e=se("div",{class:this.player.config.classNames.previewThumbnails.timeContainer});this.elements.thumb.time=se("span",{},"00:00"),e.appendChild(this.elements.thumb.time),this.elements.thumb.container.appendChild(e),R(this.player.elements.progress)&&this.player.elements.progress.appendChild(this.elements.thumb.container),this.elements.scrubbing.container=se("div",{class:this.player.config.classNames.previewThumbnails.scrubbingContainer}),this.player.elements.wrapper.appendChild(this.elements.scrubbing.container)}},{key:"showImageAtCurrentTime",value:function(){var e=this;this.mouseDown?this.setScrubbingContainerSize():this.setThumbContainerSizeAndPos();var t=this.thumbnails[0].frames.findIndex((function(t){return e.seekTime>=t.startTime&&e.seekTime<=t.endTime})),i=t>=0,n=0;this.mouseDown||this.toggleThumbContainer(i),i&&(this.thumbnails.forEach((function(i,a){e.loadedImages.includes(i.frames[t].text)&&(n=a)})),t!==this.showingThumb&&(this.showingThumb=t,this.loadImage(n)))}},{key:"loadImage",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=this.showingThumb,n=this.thumbnails[t],a=n.urlPrefix,s=n.frames[i],o=n.frames[i].text,r=a+o;if(this.currentImageElement&&this.currentImageElement.dataset.filename===o)this.showImage(this.currentImageElement,s,t,i,o,!1),this.currentImageElement.dataset.index=i,this.removeOldImages(this.currentImageElement);else{this.loadingImage&&this.usingSprites&&(this.loadingImage.onload=null);var l=new Image;l.src=r,l.dataset.index=i,l.dataset.filename=o,this.showingThumbFilename=o,this.player.debug.log("Loading image: ".concat(r)),l.onload=function(){return e.showImage(l,s,t,i,o,!0)},this.loadingImage=l,this.removeOldImages(l)}}},{key:"showImage",value:function(e,t,i,n,a){var s=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];this.player.debug.log("Showing thumb: ".concat(a,". num: ").concat(n,". qual: ").concat(i,". newimg: ").concat(s)),this.setImageSizeAndOffset(e,t),s&&(this.currentImageContainer.appendChild(e),this.currentImageElement=e,this.loadedImages.includes(a)||this.loadedImages.push(a)),this.preloadNearby(n,!0).then(this.preloadNearby(n,!1)).then(this.getHigherQuality(i,e,t,a))}},{key:"removeOldImages",value:function(e){var t=this;Array.from(this.currentImageContainer.children).forEach((function(i){if("img"===i.tagName.toLowerCase()){var n=t.usingSprites?500:1e3;if(i.dataset.index!==e.dataset.index&&!i.dataset.deleting){i.dataset.deleting=!0;var a=t.currentImageContainer;setTimeout((function(){a.removeChild(i),t.player.debug.log("Removing thumb: ".concat(i.dataset.filename))}),n)}}}))}},{key:"preloadNearby",value:function(e){var t=this,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return new Promise((function(n){setTimeout((function(){var a=t.thumbnails[0].frames[e].text;if(t.showingThumbFilename===a){var s;s=i?t.thumbnails[0].frames.slice(e):t.thumbnails[0].frames.slice(0,e).reverse();var o=!1;s.forEach((function(e){var i=e.text;if(i!==a&&!t.loadedImages.includes(i)){o=!0,t.player.debug.log("Preloading thumb filename: ".concat(i));var s=t.thumbnails[0].urlPrefix+i,r=new Image;r.src=s,r.onload=function(){t.player.debug.log("Preloaded thumb filename: ".concat(i)),t.loadedImages.includes(i)||t.loadedImages.push(i),n()}}})),o||n()}}),300)}))}},{key:"getHigherQuality",value:function(e,t,i,n){var a=this;if(e<this.thumbnails.length-1){var s=t.naturalHeight;this.usingSprites&&(s=i.h),s<this.thumbContainerHeight&&setTimeout((function(){a.showingThumbFilename===n&&(a.player.debug.log("Showing higher quality thumb for: ".concat(n)),a.loadImage(e+1))}),300)}}},{key:"toggleThumbContainer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.player.config.classNames.previewThumbnails.thumbContainerShown;this.elements.thumb.container.classList.toggle(i,e),!e&&t&&(this.showingThumb=null,this.showingThumbFilename=null)}},{key:"toggleScrubbingContainer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.player.config.classNames.previewThumbnails.scrubbingContainerShown;this.elements.scrubbing.container.classList.toggle(t,e),e||(this.showingThumb=null,this.showingThumbFilename=null)}},{key:"determineContainerAutoSizing",value:function(){this.elements.thumb.imageContainer.clientHeight>20&&(this.sizeSpecifiedInCSS=!0)}},{key:"setThumbContainerSizeAndPos",value:function(){if(!this.sizeSpecifiedInCSS){var e=Math.floor(this.thumbContainerHeight*this.thumbAspectRatio);this.elements.thumb.imageContainer.style.height="".concat(this.thumbContainerHeight,"px"),this.elements.thumb.imageContainer.style.width="".concat(e,"px")}this.setThumbContainerPos()}},{key:"setThumbContainerPos",value:function(){var e=this.player.elements.progress.getBoundingClientRect(),t=this.player.elements.container.getBoundingClientRect(),i=this.elements.thumb.container,n=t.left-e.left+10,a=t.right-e.left-i.clientWidth-10,s=this.mousePosX-e.left-i.clientWidth/2;s<n&&(s=n),s>a&&(s=a),i.style.left="".concat(s,"px")}},{key:"setScrubbingContainerSize",value:function(){this.elements.scrubbing.container.style.width="".concat(this.player.media.clientWidth,"px"),this.elements.scrubbing.container.style.height="".concat(this.player.media.clientWidth/this.thumbAspectRatio,"px")}},{key:"setImageSizeAndOffset",value:function(e,t){if(this.usingSprites){var i=this.thumbContainerHeight/t.h;e.style.height="".concat(Math.floor(e.naturalHeight*i),"px"),e.style.width="".concat(Math.floor(e.naturalWidth*i),"px"),e.style.left="-".concat(t.x*i,"px"),e.style.top="-".concat(t.y*i,"px")}}},{key:"enabled",get:function(){return this.player.isHTML5&&this.player.isVideo&&this.player.config.previewThumbnails.enabled}},{key:"currentImageContainer",get:function(){return this.mouseDown?this.elements.scrubbing.container:this.elements.thumb.imageContainer}},{key:"usingSprites",get:function(){return Object.keys(this.thumbnails[0].frames[0]).includes("w")}},{key:"thumbAspectRatio",get:function(){return this.usingSprites?this.thumbnails[0].frames[0].w/this.thumbnails[0].frames[0].h:this.thumbnails[0].width/this.thumbnails[0].height}},{key:"thumbContainerHeight",get:function(){return this.mouseDown?Math.floor(this.player.media.clientWidth/this.thumbAspectRatio):Math.floor(this.player.media.clientWidth/this.thumbAspectRatio/4)}},{key:"currentImageElement",get:function(){return this.mouseDown?this.currentScrubbingImageElement:this.currentThumbnailImageElement},set:function(e){this.mouseDown?this.currentScrubbingImageElement=e:this.currentThumbnailImageElement=e}}]),t}(),mt={insertElements:function(e,t){var i=this;q(t)?oe(e,this.media,{src:t}):D(t)&&t.forEach((function(t){oe(e,i.media,t)}))},change:function(e){var t=this;te(e,"sources.length")?(Ee.cancelRequests.call(this),this.destroy.call(this,(function(){t.options.quality=[],re(t.media),t.media=null,R(t.elements.container)&&t.elements.container.removeAttribute("class");var i=e.sources,n=e.type,s=a(i,1)[0],o=s.provider,r=void 0===o?Ke.html5:o,l=s.src,c="html5"===r?n:"div",u="html5"===r?{}:{src:l};Object.assign(t,{provider:r,type:n,supported:ke.check(n,r,t.config.playsinline),media:se(c,u)}),t.elements.container.appendChild(t.media),H(e.autoplay)&&(t.config.autoplay=e.autoplay),t.isHTML5&&(t.config.crossorigin&&t.media.setAttribute("crossorigin",""),t.config.autoplay&&t.media.setAttribute("autoplay",""),z(e.poster)||(t.poster=e.poster),t.config.loop.active&&t.media.setAttribute("loop",""),t.config.muted&&t.media.setAttribute("muted",""),t.config.playsinline&&t.media.setAttribute("playsinline","")),tt.addStyleHook.call(t),t.isHTML5&&mt.insertElements.call(t,"source",i),t.config.title=e.title,dt.setup.call(t),t.isHTML5&&Object.keys(e).includes("tracks")&&mt.insertElements.call(t,"track",e.tracks),(t.isHTML5||t.isEmbed&&!t.supported.ui)&&tt.build.call(t),t.isHTML5&&t.media.load(),t.previewThumbnails&&t.previewThumbnails.load(),t.fullscreen.update()}),!0)):this.debug.warn("Invalid source format")}},ft=function(){function t(i,n){var a=this;if(e(this,t),this.timers={},this.ready=!1,this.loading=!1,this.failed=!1,this.touch=ke.touch,this.media=i,q(this.media)&&(this.media=document.querySelectorAll(this.media)),(window.jQuery&&this.media instanceof jQuery||F(this.media)||D(this.media))&&(this.media=this.media[0]),this.config=ie({},We,t.defaults,n||{},function(){try{return JSON.parse(a.media.getAttribute("data-plyr-config"))}catch(e){return{}}}()),this.elements={container:null,captions:null,buttons:{},display:{},progress:{},inputs:{},settings:{popup:null,menu:null,panels:{},buttons:{}}},this.captions={active:null,currentTrack:-1,meta:new WeakMap},this.fullscreen={active:!1},this.options={speed:[],quality:[]},this.debug=new Je(this.config.debug),this.debug.log("Config",this.config),this.debug.log("Support",ke),!L(this.media)&&R(this.media))if(this.media.plyr)this.debug.warn("Target already setup");else if(this.config.enabled)if(ke.check().api){var s=this.media.cloneNode(!0);s.autoplay=!1,this.elements.original=s;var o=this.media.tagName.toLowerCase(),r=null,l=null;switch(o){case"div":if(r=this.media.querySelector("iframe"),R(r)){if(l=Ve(r.getAttribute("src")),this.provider=function(e){return/^(https?:\/\/)?(www\.)?(youtube\.com|youtube-nocookie\.com|youtu\.?be)\/.+$/.test(e)?Ke.youtube:/^https?:\/\/player.vimeo.com\/video\/\d{0,9}(?=\b|\/)/.test(e)?Ke.vimeo:null}(l.toString()),this.elements.container=this.media,this.media=r,this.elements.container.className="",l.search.length){var c=["1","true"];c.includes(l.searchParams.get("autoplay"))&&(this.config.autoplay=!0),c.includes(l.searchParams.get("loop"))&&(this.config.loop.active=!0),this.isYouTube?(this.config.playsinline=c.includes(l.searchParams.get("playsinline")),this.config.youtube.hl=l.searchParams.get("hl")):this.config.playsinline=!0}}else this.provider=this.media.getAttribute(this.config.attributes.embed.provider),this.media.removeAttribute(this.config.attributes.embed.provider);if(z(this.provider)||!Object.keys(Ke).includes(this.provider))return void this.debug.error("Setup failed: Invalid provider");this.type=Qe;break;case"video":case"audio":this.type=o,this.provider=Ke.html5,this.media.hasAttribute("crossorigin")&&(this.config.crossorigin=!0),this.media.hasAttribute("autoplay")&&(this.config.autoplay=!0),(this.media.hasAttribute("playsinline")||this.media.hasAttribute("webkit-playsinline"))&&(this.config.playsinline=!0),this.media.hasAttribute("muted")&&(this.config.muted=!0),this.media.hasAttribute("loop")&&(this.config.loop.active=!0);break;default:return void this.debug.error("Setup failed: unsupported type")}this.supported=ke.check(this.type,this.provider,this.config.playsinline),this.supported.api?(this.eventListeners=[],this.listeners=new it(this),this.storage=new _e(this),this.media.plyr=this,R(this.elements.container)||(this.elements.container=se("div",{tabindex:0}),ne(this.media,this.elements.container)),tt.addStyleHook.call(this),dt.setup.call(this),this.config.debug&&$.call(this,this.elements.container,this.config.events.join(" "),(function(e){a.debug.log("event: ".concat(e.type))})),(this.isHTML5||this.isEmbed&&!this.supported.ui)&&tt.build.call(this),this.listeners.container(),this.listeners.global(),this.fullscreen=new Ze(this),this.config.ads.enabled&&(this.ads=new ht(this)),this.isHTML5&&this.config.autoplay&&setTimeout((function(){return a.play()}),10),this.lastSeekTime=0,this.config.previewThumbnails.enabled&&(this.previewThumbnails=new pt(this))):this.debug.error("Setup failed: no support")}else this.debug.error("Setup failed: no support");else this.debug.error("Setup failed: disabled by config");else this.debug.error("Setup failed: no suitable element passed")}return i(t,[{key:"play",value:function(){var e=this;return j(this.media.play)?(this.ads&&this.ads.enabled&&this.ads.managerPromise.then((function(){return e.ads.play()})).catch((function(){return e.media.play()})),this.media.play()):null}},{key:"pause",value:function(){this.playing&&j(this.media.pause)&&this.media.pause()}},{key:"togglePlay",value:function(e){(H(e)?e:!this.playing)?this.play():this.pause()}},{key:"stop",value:function(){this.isHTML5?(this.pause(),this.restart()):j(this.media.stop)&&this.media.stop()}},{key:"restart",value:function(){this.currentTime=0}},{key:"rewind",value:function(e){this.currentTime=this.currentTime-(O(e)?e:this.config.seekTime)}},{key:"forward",value:function(e){this.currentTime=this.currentTime+(O(e)?e:this.config.seekTime)}},{key:"increaseVolume",value:function(e){var t=this.media.muted?0:this.volume;this.volume=t+(O(e)?e:0)}},{key:"decreaseVolume",value:function(e){this.increaseVolume(-e)}},{key:"toggleCaptions",value:function(e){Ue.toggle.call(this,e,!1)}},{key:"airplay",value:function(){ke.airplay&&this.media.webkitShowPlaybackTargetPicker()}},{key:"toggleControls",value:function(e){if(this.supported.ui&&!this.isAudio){var t=pe(this.elements.container,this.config.classNames.hideControls),i=void 0===e?void 0:!e,n=he(this.elements.container,this.config.classNames.hideControls,i);if(n&&this.config.controls.includes("settings")&&!z(this.config.settings)&&Re.toggleMenu.call(this,!1),n!==t){var a=n?"controlshidden":"controlsshown";ee.call(this,this.media,a)}return!n}return!1}},{key:"on",value:function(e,t){$.call(this,this.elements.container,e,t)}},{key:"once",value:function(e,t){Z.call(this,this.elements.container,e,t)}},{key:"off",value:function(e,t){G(this.elements.container,e,t)}},{key:"destroy",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.ready){var n=function(){document.body.style.overflow="",t.embed=null,i?(Object.keys(t.elements).length&&(re(t.elements.buttons.play),re(t.elements.captions),re(t.elements.controls),re(t.elements.wrapper),t.elements.buttons.play=null,t.elements.captions=null,t.elements.controls=null,t.elements.wrapper=null),j(e)&&e()):(function(){this&&this.eventListeners&&(this.eventListeners.forEach((function(e){var t=e.element,i=e.type,n=e.callback,a=e.options;t.removeEventListener(i,n,a)})),this.eventListeners=[])}.call(t),ce(t.elements.original,t.elements.container),ee.call(t,t.elements.original,"destroyed",!0),j(e)&&e.call(t.elements.original),t.ready=!1,setTimeout((function(){t.elements=null,t.media=null}),200))};this.stop(),clearTimeout(this.timers.loading),clearTimeout(this.timers.controls),clearTimeout(this.timers.resized),this.isHTML5?(tt.toggleNativeControls.call(this,!0),n()):this.isYouTube?(clearInterval(this.timers.buffering),clearInterval(this.timers.playing),null!==this.embed&&j(this.embed.destroy)&&this.embed.destroy(),n()):this.isVimeo&&(null!==this.embed&&this.embed.unload().then(n),setTimeout(n,200))}}},{key:"supports",value:function(e){return ke.mime.call(this,e)}},{key:"isHTML5",get:function(){return this.provider===Ke.html5}},{key:"isEmbed",get:function(){return this.isYouTube||this.isVimeo}},{key:"isYouTube",get:function(){return this.provider===Ke.youtube}},{key:"isVimeo",get:function(){return this.provider===Ke.vimeo}},{key:"isVideo",get:function(){return this.type===Qe}},{key:"isAudio",get:function(){return this.type===Ye}},{key:"playing",get:function(){return Boolean(this.ready&&!this.paused&&!this.ended)}},{key:"paused",get:function(){return Boolean(this.media.paused)}},{key:"stopped",get:function(){return Boolean(this.paused&&0===this.currentTime)}},{key:"ended",get:function(){return Boolean(this.media.ended)}},{key:"currentTime",set:function(e){if(this.duration){var t=O(e)&&e>0;this.media.currentTime=t?Math.min(e,this.duration):0,this.debug.log("Seeking to ".concat(this.currentTime," seconds"))}},get:function(){return Number(this.media.currentTime)}},{key:"buffered",get:function(){var e=this.media.buffered;return O(e)?e:e&&e.length&&this.duration>0?e.end(0)/this.duration:0}},{key:"seeking",get:function(){return Boolean(this.media.seeking)}},{key:"duration",get:function(){var e=parseFloat(this.config.duration),t=(this.media||{}).duration,i=O(t)&&t!==1/0?t:0;return e||i}},{key:"volume",set:function(e){var t=e;q(t)&&(t=Number(t)),O(t)||(t=this.storage.get("volume")),O(t)||(t=this.config.volume),t>1&&(t=1),t<0&&(t=0),this.config.volume=t,this.media.volume=t,!z(e)&&this.muted&&t>0&&(this.muted=!1)},get:function(){return Number(this.media.volume)}},{key:"muted",set:function(e){var t=e;H(t)||(t=this.storage.get("muted")),H(t)||(t=this.config.muted),this.config.muted=t,this.media.muted=t},get:function(){return Boolean(this.media.muted)}},{key:"hasAudio",get:function(){return!this.isHTML5||!!this.isAudio||Boolean(this.media.mozHasAudio)||Boolean(this.media.webkitAudioDecodedByteCount)||Boolean(this.media.audioTracks&&this.media.audioTracks.length)}},{key:"speed",set:function(e){var t=this,i=null;O(e)&&(i=e),O(i)||(i=this.storage.get("speed")),O(i)||(i=this.config.speed.selected);var n=this.minimumSpeed,a=this.maximumSpeed;i=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:255;return Math.min(Math.max(e,t),i)}(i,n,a),this.config.speed.selected=i,setTimeout((function(){t.media.playbackRate=i}),0)},get:function(){return Number(this.media.playbackRate)}},{key:"minimumSpeed",get:function(){return this.isYouTube?Math.min.apply(Math,s(this.options.speed)):this.isVimeo?.5:.0625}},{key:"maximumSpeed",get:function(){return this.isYouTube?Math.max.apply(Math,s(this.options.speed)):this.isVimeo?2:16}},{key:"quality",set:function(e){var t=this.config.quality,i=this.options.quality;if(i.length){var n=[!z(e)&&Number(e),this.storage.get("quality"),t.selected,t.default].find(O),a=!0;if(!i.includes(n)){var s=function(e,t){return D(e)&&e.length?e.reduce((function(e,i){return Math.abs(i-t)<Math.abs(e-t)?i:e})):null}(i,n);this.debug.warn("Unsupported quality option: ".concat(n,", using ").concat(s," instead")),n=s,a=!1}t.selected=n,this.media.quality=n,a&&this.storage.set({quality:n})}},get:function(){return this.media.quality}},{key:"loop",set:function(e){var t=H(e)?e:this.config.loop.active;this.config.loop.active=t,this.media.loop=t},get:function(){return Boolean(this.media.loop)}},{key:"source",set:function(e){mt.change.call(this,e)},get:function(){return this.media.currentSrc}},{key:"download",get:function(){var e=this.config.urls.download;return W(e)?e:this.source},set:function(e){W(e)&&(this.config.urls.download=e,Re.setDownloadUrl.call(this))}},{key:"poster",set:function(e){this.isVideo?tt.setPoster.call(this,e,!1).catch((function(){})):this.debug.warn("Poster can only be set for video")},get:function(){return this.isVideo?this.media.getAttribute("poster"):null}},{key:"ratio",get:function(){if(!this.isVideo)return null;var e=Te(Ce.call(this));return D(e)?e.join(":"):e},set:function(e){this.isVideo?q(e)&&we(e)?(this.config.ratio=e,Ae.call(this)):this.debug.error("Invalid aspect ratio specified (".concat(e,")")):this.debug.warn("Aspect ratio can only be set for video")}},{key:"autoplay",set:function(e){var t=H(e)?e:this.config.autoplay;this.config.autoplay=t},get:function(){return Boolean(this.config.autoplay)}},{key:"currentTrack",set:function(e){Ue.set.call(this,e,!1)},get:function(){var e=this.captions,t=e.toggled,i=e.currentTrack;return t?i:-1}},{key:"language",set:function(e){Ue.setLanguage.call(this,e,!1)},get:function(){return(Ue.getCurrentTrack.call(this)||{}).language}},{key:"pip",set:function(e){if(ke.pip){var t=H(e)?e:!this.pip;j(this.media.webkitSetPresentationMode)&&this.media.webkitSetPresentationMode(t?ze:"inline"),j(this.media.requestPictureInPicture)&&(!this.pip&&t?this.media.requestPictureInPicture():this.pip&&!t&&document.exitPictureInPicture())}},get:function(){return ke.pip?z(this.media.webkitPresentationMode)?this.media===document.pictureInPictureElement:this.media.webkitPresentationMode===ze:null}}],[{key:"supported",value:function(e,t,i){return ke.check(e,t,i)}},{key:"loadSprite",value:function(e,t){return qe(e,t)}},{key:"setup",value:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null;return q(e)?n=Array.from(document.querySelectorAll(e)):F(e)?n=Array.from(e):D(e)&&(n=e.filter(R)),z(n)?null:n.map((function(e){return new t(e,i)}))}}]),t}();return ft.defaults=(ct=We,JSON.parse(JSON.stringify(ct))),ft}));
Back to Directory=ceiIENDB`