vendor: 4,121 bytes, line 1
1"object"==typeof navigator&&function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define("Plyr",t):(e="undefined"!=typeof globalThis?globalThis:e||self).Plyr=t()}(this,function(){"use strict";function e(e,t,i){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function i(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var n,s,r={};function a(){if(s)return n;s=1;var e=function(e){return e&&e.Math===Math&&e};return n=e("object"==typeof globalThis&&globalThis)||e("object"==typeof window&&window)||e("object"==typeof self&&self)||e("object"==typeof t&&t)||e("object"==typeof n&&n)||function(){return this}()||Function("return this")()}var o,l,c,u,h,d,p,m,f={};function g(){return l?o:(l=1,o=function(e){try{return!!e()}catch(e){return!0}})}function y(){if(u)return c;u=1;var e=g();return c=!e(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})}function b(){if(d)return h;d=1;var e=g();return h=!e(function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})}function v(){if(m)return p;m=1;var e=b(),t=Function.prototype.call;return p=e?t.bind(t):function(){return t.apply(t,arguments)},p}var w,k,T,S,C,E,P,A,M,O,x,N,L,j,_,I,$,R,D,q,H,F,U,V,B,W,z,K,Y,X,Q,J,G,Z,ee,te,ie,ne,se,re,ae,oe={};function le(){return T?k:(T=1,k=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}})}function ce(){if(C)return S;C=1;var e=b(),t=Function.prototype,i=t.call,n=e&&t.bind.bind(i,i);return S=e?n:function(e){return function(){return i.apply(e,arguments)}},S}function ue(){if(M)return A;M=1;var e=ce(),t=g(),i=function(){if(P)return E;P=1;var e=ce(),t=e({}.toString),i=e("".slice);return E=function(e){return i(t(e),8,-1)}}(),n=Object,s=e("".split);return A=t(function(){return!n("z").propertyIsEnumerable(0)})?function(e){return"String"===i(e)?s(e,""):n(e)}:n}function he(){return x?O:(x=1,O=function(e){return null==e})}function de(){if(L)return N;L=1;var e=he(),t=TypeError;return N=function(i){if(e(i))throw new t("Can't call method on "+i);return i}}function pe(){if(_)return j;_=1;var e=ue(),t=de();return j=function(i){return e(t(i))}}function me(){if($)return I;$=1;var e="object"==typeof document&&document.all;return I=void 0===e&&void 0!==e?function(t){return"function"==typeof t||t===e}:function(e){return"function"==typeof e}}function fe(){if(D)return R;D=1;var e=me();return R=function(t){return"object"==typeof t?null!==t:e(t)}}function ge(){if(H)return q;H=1;var e=a(),t=me();return q=function(i,n){return arguments.length<2?(s=e[i],t(s)?s:void 0):e[i]&&e[i][n];var s},q}function ye(){if(z)return W;z=1;var e,t,i=a(),n=function(){if(B)return V;B=1;var e=a().navigator,t=e&&e.userAgent;return V=t?String(t):""}(),s=i.process,r=i.Deno,o=s&&s.versions||r&&r.version,l=o&&o.v8;return l&&(t=(e=l.split("."))[0]>0&&e[0]<4?1:+(e[0]+e[1])),!t&&n&&(!(e=n.match(/Edge\/(\d+)/))||e[1]>=74)&&(e=n.match(/Chrome\/(\d+)/))&&(t=+e[1]),W=t}function be(){if(Y)return K;Y=1;var e=ye(),t=g(),i=a().String;return K=!!Object.getOwnPropertySymbols&&!t(function(){var t=Symbol("symbol detection");return!i(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&e&&e<41})}function ve(){if(Q)return X;Q=1;var e=be();return X=e&&!Symbol.sham&&"symbol"==typeof Symbol.iterator}function we(){if(G)return J;G=1;var e=ge(),t=me(),i=function(){if(U)return F;U=1;var e=ce();return F=e({}.isPrototypeOf)}(),n=ve(),s=Object;return J=n?function(e){return"symbol"==typeof e}:function(n){var r=e("Symbol");return t(r)&&i(r.prototype,s(n))}}
vendor: 4,166 bytes, line 1
1function ke(){if(ee)return Z;ee=1;var e=String;return Z=function(t){try{return e(t)}catch(e){return"Object"}}}function Te(){if(ie)return te;ie=1;var e=me(),t=ke(),i=TypeError;return te=function(n){if(e(n))return n;throw new i(t(n)+" is not a function")}}function Se(){if(se)return ne;se=1;var e=Te(),t=he();return ne=function(i,n){var s=i[n];return t(s)?void 0:e(s)}}function Ce(){if(ae)return re;ae=1;var e=v(),t=me(),i=fe(),n=TypeError;return re=function(s,r){var a,o;if("string"===r&&t(a=s.toString)&&!i(o=e(a,s)))return o;if(t(a=s.valueOf)&&!i(o=e(a,s)))return o;if("string"!==r&&t(a=s.toString)&&!i(o=e(a,s)))return o;throw new n("Can't convert object to primitive value")}}var Ee,Pe,Ae,Me,Oe,xe,Ne,Le,je,_e,Ie,$e,Re,De,qe,He,Fe,Ue,Ve,Be,We,ze,Ke,Ye,Xe={exports:{}};function Qe(){if(Me)return Ae;Me=1;var e=a(),t=Object.defineProperty;return Ae=function(i,n){try{t(e,i,{value:n,configurable:!0,writable:!0})}catch(t){e[i]=n}return n}}function Je(){if(Oe)return Xe.exports;Oe=1;var e=Pe?Ee:(Pe=1,Ee=!1),t=a(),i=Qe(),n="__core-js_shared__",s=Xe.exports=t[n]||i(n,{});return(s.versions||(s.versions=[])).push({version:"3.50.0",mode:e?"pure":"global",copyright:"© 2013â2025 Denis Pushkarev (zloirock.ru), 2025â2026 CoreJS Company (core-js.io). All rights reserved.",license:"https://github.com/zloirock/core-js/blob/v3.50.0/LICENSE",source:"https://github.com/zloirock/core-js"}),Xe.exports}function Ge(){if(Ne)return xe;Ne=1;var e=Je(),t=Object.create||Object;return xe=function(i,n){return e[i]||(e[i]=n||t(null))}}function Ze(){if(je)return Le;je=1;var e=de(),t=Object;return Le=function(i){return t(e(i))}}function et(){if(Ie)return _e;Ie=1;var e=ce(),t=Ze(),i=e({}.hasOwnProperty);return _e=Object.hasOwn||function(e,n){return i(t(e),n)}}function tt(){if(Re)return $e;Re=1;var e=ce(),t=0,i=Math.random(),n=e(1.1.toString);return $e=function(e){return"Symbol("+(void 0===e?"":e)+")_"+n(++t+i,36)}}function it(){if(qe)return De;qe=1;var e=a(),t=Ge(),i=et(),n=tt(),s=be(),r=ve(),o=e.Symbol,l=t("wks"),c=r?o.for||o:o&&o.withoutSetter||n;return De=function(e){return i(l,e)||(l[e]=s&&i(o,e)?o[e]:c("Symbol."+e)),l[e]}}function nt(){if(Fe)return He;Fe=1;var e=v(),t=fe(),i=we(),n=Se(),s=Ce(),r=it(),a=TypeError,o=r("toPrimitive");return He=function(r,l){if(!t(r)||i(r))return r;var c,u=n(r,o);if(u){if(void 0===l&&(l="default"),c=e(u,r,l),!t(c)||i(c))return c;throw new a("Can't convert object to primitive value")}return void 0===l&&(l="number"),s(r,l)}}function st(){if(Ve)return Ue;Ve=1;var e=nt(),t=we();return Ue=function(i){var n=e(i,"string");return t(n)?n:n+""}}function rt(){if(We)return Be;We=1;var e=a(),t=fe(),i=e.document,n=t(i)&&t(i.createElement);return Be=function(e){return n?i.createElement(e):{}}}function at(){if(Ke)return ze;Ke=1;var e=y(),t=g(),i=rt();return ze=!e&&!t(function(){return 7!==Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a})}function ot(){if(Ye)return f;Ye=1;var e=y(),t=v(),i=function(){if(w)return oe;w=1;var e={}.propertyIsEnumerable,t=Object.getOwnPropertyDescriptor,i=t&&!e.call({1:2},1);return oe.f=i?function(e){var i=t(this,e);return!!i&&i.enumerable}:e,oe}(),n=le(),s=pe(),r=st(),a=et(),o=at(),l=Object.getOwnPropertyDescriptor;return f.f=e?l:function(e,c){if(e=s(e),c=r(c),o)try{return l(e,c)}catch(e){}if(a(e,c))return n(!t(i.f,e,c),e[c])},f}var lt,ct,ut,ht,dt,pt,mt,ft={};function gt(){if(ct)return lt;ct=1;var e=y(),t=g();return lt=e&&t(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})}function yt(){if(ht)return ut;ht=1;var e=fe(),t=String,i=TypeError;return ut=function(n){if(e(n))return n;throw new i(t(n)+" is not an object")}}function bt(){if(dt)return ft;dt=1;var e=y(),t=at(),i=gt(),n=yt(),s=st(),r=TypeError,a=Object.defineProperty,o=Object.getOwnPropertyDescriptor,l="enumerable",c="configurable",u="writable";return ft.f=e?i?function(e,t,i){if(n(e),t=s(t),n(i),"function"==typeof e&&"prototype"===t&&"value"in i&&u in i&&!i[u]){var r=o(e,t);r&&r[u]&&(e[t]=i.value,i={configurable:c in i?i[c]:r[c],enumerable:l in i?i[l]:r[l],writable:!1})}return a(e,t,i)}:a:function(e,i,o){if(n(e),i=s(i),n(o),t)try{return a(e,i,o)}catch(e){}
vendor: 3,121 bytes, line 1
1if("get"in o||"set"in o)throw new r("Accessors not supported");return"value"in o&&(e[i]=o.value),e},ft}function vt(){if(mt)return pt;mt=1;var e=y(),t=bt(),i=le();return pt=e?function(e,n,s){return t.f(e,n,i(1,s))}:function(e,t,i){return e[t]=i,e}}var wt,kt,Tt,St,Ct,Et,Pt,At,Mt,Ot,xt,Nt,Lt,jt,_t,It={exports:{}};function $t(){if(St)return Tt;St=1;var e=ce(),t=me(),i=Je(),n=e(Function.toString);return t(i.inspectSource)||(i.inspectSource=function(e){return n(e)}),Tt=i.inspectSource}function Rt(){if(At)return Pt;At=1;var e=Ge(),t=tt(),i=e("keys");return Pt=function(e){return i[e]||(i[e]=t(e))}}function Dt(){return Ot?Mt:(Ot=1,Mt={})}function qt(){if(Nt)return xt;Nt=1;var e,t,i,n=function(){if(Et)return Ct;Et=1;var e=a(),t=me(),i=e.WeakMap;return Ct=t(i)&&/native code/.test(String(i))}(),s=a(),r=fe(),o=vt(),l=et(),c=Je(),u=Rt(),h=Dt(),d="Object already initialized",p=s.TypeError,m=s.WeakMap;if(n||c.state){var f=c.state||(c.state=new m);f.get=f.get,f.has=f.has,f.set=f.set,e=function(e,t){if(f.has(e))throw new p(d);return t.facade=e,f.set(e,t),t},t=function(e){return f.get(e)||{}},i=function(e){return f.has(e)}}else{var g=u("state");h[g]=!0,e=function(e,t){if(l(e,g))throw new p(d);return t.facade=e,o(e,g,t),t},t=function(e){return l(e,g)?e[g]:{}},i=function(e){return l(e,g)}}return xt={set:e,get:t,has:i,enforce:function(n){return i(n)?t(n):e(n,{})},getterFor:function(e){return function(i){var n;if(!r(i)||(n=t(i)).type!==e)throw new p("Incompatible receiver, "+e+" required");return n}}}}function Ht(){if(Lt)return It.exports;Lt=1;var e=ce(),t=g(),i=me(),n=et(),s=y(),r=function(){if(kt)return wt;kt=1;var e=y(),t=et(),i=Function.prototype,n=e&&Object.getOwnPropertyDescriptor,s=t(i,"name"),r=s&&"something"===function(){}.name,a=s&&(!e||e&&n(i,"name").configurable);return wt={EXISTS:s,PROPER:r,CONFIGURABLE:a}}().CONFIGURABLE,a=$t(),o=qt(),l=o.enforce,c=o.get,u=String,h=Object.defineProperty,d=e("".slice),p=e("".replace),m=e([].join),f=s&&!t(function(){return 8!==h(function(){},"length",{value:8}).length}),b=String(String).split("String"),v=It.exports=function(e,t,i){"Symbol("===d(u(t),0,7)&&(t="["+p(u(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),i&&i.getter&&(t="get "+t),i&&i.setter&&(t="set "+t),(!n(e,"name")||r&&e.name!==t)&&(s?h(e,"name",{value:t,configurable:!0}):e.name=t),f&&i&&n(i,"arity")&&e.length!==i.arity&&h(e,"length",{value:i.arity});try{i&&n(i,"constructor")&&i.constructor?s&&h(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var a=l(e);return n(a,"source")||(a.source=m(b,"string"==typeof t?t:"")),e};return Function.prototype.toString=v(function(){return i(this)&&c(this).source||a(this)},"toString"),It.exports}function Ft(){if(_t)return jt;_t=1;var e=me(),t=bt(),i=Ht(),n=Qe();return jt=function(s,r,a,o){o||(o={});var l=o.enumerable,c=void 0!==o.name?o.name:r;if(e(a)&&i(a,c,o),o.global)l?s[r]=a:n(r,a);else{try{o.unsafe?s[r]&&(l=!0):delete s[r]}catch(e){}l?s[r]=a:t.f(s,r,{value:a,enumerable:!1,configurable:!o.nonConfigurable,writable:!o.nonWritable})}return s}}var Ut,Vt,Bt,Wt,zt,Kt,Yt,Xt,Qt,Jt,Gt,Zt,ei,ti,ii,ni,si,ri={};function ai(){if(Wt)return Bt;
vendor: 4,499 bytes, line 1
1Wt=1;var e=function(){if(Vt)return Ut;Vt=1;var e=Math.ceil,t=Math.floor;return Ut=Math.trunc||function(i){var n=+i;return(n>0?t:e)(n)}}();return Bt=function(t){var i=+t;return i!=i||0===i?0:e(i)}}function oi(){if(Kt)return zt;Kt=1;var e=ai(),t=Math.max,i=Math.min;return zt=function(n,s){var r=e(n);return r<0?t(r+s,0):i(r,s)}}function li(){if(Xt)return Yt;Xt=1;var e=ai(),t=Math.min;return Yt=function(i){var n=e(i);return n>0?t(n,9007199254740991):0}}function ci(){if(Jt)return Qt;Jt=1;var e=li();return Qt=function(t){return e(t.length)}}function ui(){if(Zt)return Gt;Zt=1;var e=pe(),t=oi(),i=ci(),n=function(n){return function(s,r,a){var o=e(s),l=i(o);if(0===l)return!n&&-1;var c,u=t(a,l);if(n&&r!=r){for(;l>u;)if((c=o[u++])!=c)return!0}else for(;l>u;u++)if((n||u in o)&&o[u]===r)return n||u||0;return!n&&-1}};return Gt={includes:n(!0),indexOf:n(!1)}}function hi(){if(ti)return ei;ti=1;var e=ce(),t=et(),i=pe(),n=ui().indexOf,s=Dt(),r=e([].push);return ei=function(e,a){var o,l=i(e),c=0,u=[];for(o in l)!t(s,o)&&t(l,o)&&r(u,o);for(;a.length>c;)t(l,o=a[c++])&&(~n(u,o)||r(u,o));return u}}function di(){return ni?ii:(ni=1,ii=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"])}var pi,mi,fi,gi,yi,bi,vi,wi,ki,Ti={};function Si(){if(fi)return mi;fi=1;var e=ge(),t=ce(),i=function(){if(si)return ri;si=1;var e=hi(),t=di().concat("length","prototype");return ri.f=Object.getOwnPropertyNames||function(i){return e(i,t)},ri}(),n=(pi||(pi=1,Ti.f=Object.getOwnPropertySymbols),Ti),s=yt(),r=t([].concat);return mi=e("Reflect","ownKeys")||function(e){var t=i.f(s(e)),a=n.f;return a?r(t,a(e)):t}}function Ci(){if(yi)return gi;yi=1;var e=et(),t=Si(),i=ot(),n=bt();return gi=function(s,r,a){for(var o=t(r),l=n.f,c=i.f,u=0;u<o.length;u++){var h=o[u];e(s,h)||a&&e(a,h)||l(s,h,c(r,h))}},gi}function Ei(){if(ki)return wi;ki=1;var e=a(),t=ot().f,i=vt(),n=Ft(),s=Qe(),r=Ci(),o=function(){if(vi)return bi;vi=1;var e=g(),t=me(),i=/#|\.prototype\./,n=function(i,n){var l=r[s(i)];return l===o||l!==a&&(t(n)?e(n):!!n)},s=n.normalize=function(e){return String(e).replace(i,".").toLowerCase()},r=n.data={},a=n.NATIVE="N",o=n.POLYFILL="P";return bi=n}();return wi=function(a,l){var c,u,h,d,p,m=a.target,f=a.global,g=a.stat;if(c=f?e:g?e[m]||s(m,{}):e[m]&&e[m].prototype)for(u in l){if(d=l[u],h=a.dontCallGetSet?(p=t(c,u))&&p.value:c[u],!o(f?u:m+(g?".":"#")+u,a.forced)&&void 0!==h){if(typeof d==typeof h)continue;r(d,h)}(a.sham||h&&h.sham)&&i(d,"sham",!0),n(c,u,d,a)}},wi}var Pi,Ai,Mi,Oi,xi,Ni,Li,ji,_i,Ii,$i={};function Ri(){if(Ai)return Pi;Ai=1;var e=hi(),t=di();return Pi=Object.keys||function(i){return e(i,t)}}function Di(){if(xi)return Oi;xi=1;var e=ge();return Oi=e("document","documentElement")}function qi(){if(Li)return Ni;Li=1;var e,t=yt(),i=function(){if(Mi)return $i;Mi=1;var e=y(),t=gt(),i=bt(),n=yt(),s=pe(),r=Ri();return $i.f=e&&!t?Object.defineProperties:function(e,t){n(e);for(var a,o=s(t),l=r(t),c=l.length,u=0;c>u;)i.f(e,a=l[u++],o[a]);return e},$i}(),n=di(),s=Dt(),r=Di(),a=rt(),o=Rt(),l="prototype",c="script",u=o("IE_PROTO"),h=function(){},d=function(e){return"<"+c+">"+e+"</"+c+">"},p=function(e){e.write(d("")),e.close();var t=e.parentWindow.Object;return e=null,t},m=function(){try{e=new ActiveXObject("htmlfile")}catch(e){}var t,i,s;m="undefined"!=typeof document?document.domain&&e?p(e):(i=a("iframe"),s="java"+c+":",i.style.display="none",r.appendChild(i),i.src=String(s),(t=i.contentWindow.document).open(),t.write(d("document.F=Object")),t.close(),t.F):p(e);for(var o=n.length;o--;)delete m[l][n[o]];return m()};return s[u]=!0,Ni=Object.create||function(e,n){var s;return null!==e?(h[l]=t(e),s=new h,h[l]=null,s[u]=e):s=m(),void 0===n?s:i.f(s,n)}}function Hi(){if(_i)return ji;_i=1;var e=it(),t=qi(),i=bt().f,n=e("unscopables"),s=Array.prototype;return void 0===s[n]&&i(s,n,{configurable:!0,value:t(null)}),ji=function(e){s[n][e]=!0}}function Fi(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 Ui(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function Vi(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,n)}return i}function Bi(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};
vendor: 45,540 bytes, line 1
1t%2?Vi(Object(i),!0).forEach(function(t){Ui(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Vi(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}!function(){if(Ii)return r;Ii=1;var e=Ei(),t=ui().includes,i=g(),n=Hi(),s=i(function(){return!Array(1).includes()}),a=i(function(){return[,1].includes(void 0,1)});e({target:"Array",proto:!0,forced:s||a},{includes:function(e){return t(this,e,arguments.length>1?arguments[1]:void 0)}}),n("includes")}();var Wi={addCSS:!0,thumbWidth:15,watch:!0};var zi=function(e){return null!=e?e.constructor:null},Ki=function(e,t){return!!(e&&t&&e instanceof t)},Yi=function(e){return null==e},Xi=function(e){return zi(e)===Object},Qi=function(e){return zi(e)===String},Ji=function(e){return Array.isArray(e)},Gi=function(e){return Ki(e,NodeList)},Zi=Qi,en=Ji,tn=Gi,nn=function(e){return Ki(e,Element)},sn=function(e){return Ki(e,Event)},rn=function(e){return Yi(e)||(Qi(e)||Ji(e)||Gi(e))&&!e.length||Xi(e)&&!Object.keys(e).length};function an(e,t){if(1>t){var i=function(e){var t="".concat(e).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return t?Math.max(0,(t[1]?t[1].length:0)-(t[2]?+t[2]:0)):0}(t);return parseFloat(e.toFixed(i))}return Math.round(e/t)*t}var on=function(){function e(t,i){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),nn(t)?this.element=t:Zi(t)&&(this.element=document.querySelector(t)),nn(this.element)&&rn(this.element.rangeTouch)&&(this.config=Bi({},Wi,{},i),this.init())}return function(e,t,i){t&&Fi(e.prototype,t),i&&Fi(e,i)}(e,[{key:"init",value:function(){e.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(){e.enabled&&(this.config.addCSS&&(this.element.style.userSelect="",this.element.style.webKitUserSelect="",this.element.style.touchAction=""),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(t){if(!e.enabled||!sn(t))return null;var i,n=t.target,s=t.changedTouches[0],r=parseFloat(n.getAttribute("min"))||0,a=parseFloat(n.getAttribute("max"))||100,o=parseFloat(n.getAttribute("step"))||1,l=n.getBoundingClientRect(),c=100/l.width*(this.config.thumbWidth/2)/100;return 0>(i=100/l.width*(s.clientX-l.left))?i=0:100<i&&(i=100),50>i?i-=(100-2*i)*c:50<i&&(i+=2*(i-50)*c),r+an(i/100*(a-r),o)}},{key:"set",value:function(t){e.enabled&&sn(t)&&!t.target.disabled&&(t.preventDefault(),t.target.value=this.get(t),function(e,t){if(e&&t){var i=new Event(t,{bubbles:!0});e.dispatchEvent(i)}}(t.target,"touchend"===t.type?"change":"input"))}}],[{key:"setup",value:function(t){var i=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=null;if(rn(t)||Zi(t)?n=Array.from(document.querySelectorAll(Zi(t)?t:'input[type="range"]')):nn(t)?n=[t]:tn(t)?n=Array.from(t):en(t)&&(n=t.filter(nn)),rn(n))return null;var s=Bi({},Wi,{},i);if(Zi(t)&&s.watch){var r=new MutationObserver(function(i){Array.from(i).forEach(function(i){Array.from(i.addedNodes).forEach(function(i){nn(i)&&function(e,t){return function(){return Array.from(document.querySelectorAll(t)).includes(this)}.call(e,t)}(i,t)&&new e(i,s)})})});r.observe(document.body,{childList:!0,subtree:!0})}return n.map(function(t){return new e(t,i)})}},{key:"enabled",get:function(){return"ontouchstart"in document.documentElement}}]),e}();const ln=e=>null!=e?e.constructor:null,cn=(e,t)=>Boolean(e&&t&&e instanceof t),un=e=>null==e,hn=e=>ln(e)===Object,dn=e=>ln(e)===String,pn=e=>"function"==typeof e,mn=e=>Array.isArray(e),fn=e=>cn(e,NodeList);function gn(e){return un(e)||(dn(e)||mn(e)||fn(e))&&!e.length||hn(e)&&!Object.keys(e).length}var yn={nullOrUndefined:un,object:hn,number:e=>ln(e)===Number&&!Number.isNaN(e),string:dn,boolean:e=>ln(e)===Boolean,function:pn,array:mn,weakMap:e=>cn(e,WeakMap),nodeList:fn,element:function(e){return null!==e&&"object"==typeof e&&1===e.nodeType&&"object"==typeof e.style&&"object"==typeof e.ownerDocument},textNode:e=>ln(e)===Text,event:e=>cn(e,Event),keyboardEvent:e=>cn(e,KeyboardEvent),cue:e=>cn(e,window.TextTrackCue)||cn(e,window.VTTCue),track:e=>cn(e,TextTrack)||!un(e)&&dn(e.kind),promise:e=>cn(e,Promise)&&pn(e.then),url:function(e){if(cn(e,window.URL))return!0;if(!dn(e))return!1;let t=e;e.startsWith("http://")&&e.startsWith("https://")||(t=`http://${e}`);try{return!gn(new URL(t).hostname)}catch{return!1}},empty:gn};const bn=(()=>{const e=document.createElement("span"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},i=Object.keys(t).find(t=>void 0!==e.style[t]);return!!yn.string(i)&&t[i]})();function vn(e,t){setTimeout(()=>{try{e.hidden=!0,e.offsetHeight,e.hidden=!1}catch{}},t)}function wn(e,t){return t.split(".").reduce((e,t)=>e&&e[t],e)}function kn(e={},...t){if(!t.length)return e;const i=t.shift();return yn.object(i)?(Object.keys(i).forEach(t=>{yn.object(i[t])?(Object.keys(e).includes(t)||Object.assign(e,{[t]:{}}),kn(e[t],i[t])):Object.assign(e,{[t]:i[t]})}),kn(e,...t)):e}function Tn(e,t){const i=e.length?e:[e];Array.from(i).reverse().forEach((e,i)=>{const n=i>0?t.cloneNode(!0):t,s=e.parentNode,r=e.nextSibling;n.appendChild(e),r?s.insertBefore(n,r):s.appendChild(n)})}function Sn(e,t){yn.element(e)&&!yn.empty(t)&&Object.entries(t).filter(([,e])=>!yn.nullOrUndefined(e)).forEach(([t,i])=>e.setAttribute(t,i))}function Cn(e,t,i){const n=document.createElement(e);return yn.object(t)&&Sn(n,t),yn.string(i)&&(n.textContent=i),n}function En(e,t,i,n){yn.element(t)&&t.appendChild(Cn(e,i,n))}function Pn(e){yn.nodeList(e)||yn.array(e)?Array.from(e).forEach(Pn):yn.element(e)&&yn.element(e.parentNode)&&e.parentNode.removeChild(e)}function An(e){if(!yn.element(e))return;let{length:t}=e.childNodes;for(;t>0;)e.removeChild(e.lastChild),t-=1}function Mn(e,t){return yn.element(t)&&yn.element(t.parentNode)&&yn.element(e)?(t.parentNode.replaceChild(e,t),e):null}function On(e,t){if(!yn.string(e)||yn.empty(e))return{};const i={},n=kn({},t);return e.split(",").forEach(e=>{const t=e.trim(),s=t.replace(".",""),r=t.replace(/[[\]]/g,"").split("="),[a]=r,o=r.length>1?r[1].replace(/["']/g,""):"";switch(t.charAt(0)){case".":yn.string(n.class)?i.class=`${n.class} ${s}`:i.class=s;break;case"#":i.id=t.replace("#","");break;case"[":i[a]=o}}),kn(n,i)}function xn(e,t){if(!yn.element(e))return;let i=t;yn.boolean(i)||(i=!e.hidden),e.hidden=i}function Nn(e,t,i){if(yn.nodeList(e))return Array.from(e).map(e=>Nn(e,t,i));if(yn.element(e)){let n="toggle";return void 0!==i&&(n=i?"add":"remove"),e.classList[n](t),e.classList.contains(t)}return!1}function Ln(e,t){return yn.element(e)&&e.classList.contains(t)}function jn(e,t){const{prototype:i}=Element;return(i.matches||i.webkitMatchesSelector||i.mozMatchesSelector||i.msMatchesSelector||function(){return Array.from(document.querySelectorAll(t)).includes(this)}).call(e,t)}function _n(e){return this.elements.container.querySelectorAll(e)}function In(e){return this.elements.container.querySelector(e)}function $n(e=null,t=!1){yn.element(e)&&e.focus({preventScroll:!0,focusVisible:t})}const Rn={"audio/ogg":"vorbis","audio/wav":"1","video/webm":"vp8, vorbis","video/mp4":"avc1.42E01E, mp4a.40.2","video/ogg":"theora"},Dn={audio:"canPlayType"in document.createElement("audio"),video:"canPlayType"in document.createElement("video"),check(e,t){const i=Dn[e]||"html5"!==t;return{api:i,ui:i&&Dn.rangeInput}},pip:document.pictureInPictureEnabled&&!Cn("video").disablePictureInPicture,airplay:yn.function(window.WebKitPlaybackTargetAvailabilityEvent),playsinline:"playsInline"in document.createElement("video"),mime(e){if(yn.empty(e))return!1;const[t]=e.split("/");let i=e;if(!this.isHTML5||t!==this.type)return!1;Object.keys(Rn).includes(i)&&(i+=`; codecs="${Rn[e]}"`);try{return Boolean(i&&this.media.canPlayType(i).replace(/no/,""))}catch{return!1}},textTracks:"textTracks"in document.createElement("video"),rangeInput:(()=>{const e=document.createElement("input");return e.type="range","range"===e.type})(),touch:"ontouchstart"in document.documentElement,transitions:!1!==bn,reducedMotion:"matchMedia"in window&&window.matchMedia("(prefers-reduced-motion)").matches},qn=(()=>{let e=!1;try{const t=Object.defineProperty({},"passive",{get:()=>(e=!0,null)});window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch{}return e})();function Hn(e,t,i,n=!1,s=!0,r=!1){if(!e||!("addEventListener"in e)||yn.empty(t)||!yn.function(i))return;const a=t.split(" ");let o=r;qn&&(o={passive:s,capture:r}),a.forEach(t=>{this&&this.eventListeners&&n&&this.eventListeners.push({element:e,type:t,callback:i,options:o}),e[n?"addEventListener":"removeEventListener"](t,i,o)})}function Fn(e,t="",i,n=!0,s=!1){Hn.call(this,e,t,i,!0,n,s)}function Un(e,t="",i,n=!0,s=!1){Hn.call(this,e,t,i,!1,n,s)}function Vn(e,t="",i,n=!0,s=!1){const r=(...a)=>{Un(e,t,r,n,s),i.apply(this,a)};Hn.call(this,e,t,r,!0,n,s)}function Bn(e,t="",i=!1,n={}){if(!yn.element(e)||yn.empty(t))return;const s=new CustomEvent(t,{bubbles:i,detail:{...n,plyr:this}});e.dispatchEvent(s)}function Wn(){this&&this.eventListeners&&(this.eventListeners.forEach(e=>{const{element:t,type:i,callback:n,options:s}=e;t.removeEventListener(i,n,s)}),this.eventListeners=[])}function zn(){return new Promise(e=>this.ready?setTimeout(e,0):Fn.call(this,this.elements.container,"ready",e)).then(()=>{})}function Kn(e){yn.promise(e)&&e.then(null,()=>{})}function Yn(e){return yn.array(e)?e.filter((t,i)=>e.indexOf(t)===i):e}function Xn(e,t){return yn.array(e)&&e.length?e.reduce((e,i)=>Math.abs(i-t)<Math.abs(e-t)?i:e):null}function Qn(e){return!(!window||!window.CSS)&&window.CSS.supports(e)}const Jn=[[1,1],[4,3],[3,4],[5,4],[4,5],[3,2],[2,3],[16,10],[10,16],[16,9],[9,16],[21,9],[9,21],[32,9],[9,32]].reduce((e,[t,i])=>({...e,[t/i]:[t,i]}),{});function Gn(e){if(!(yn.array(e)||yn.string(e)&&e.includes(":")))return!1;return(yn.array(e)?e:e.split(":")).map(Number).every(yn.number)}function Zn(e){if(!yn.array(e)||!e.every(yn.number))return null;const[t,i]=e,n=(e,t)=>0===t?e:n(t,e%t),s=n(t,i);return[t/s,i/s]}function es(e){const t=e=>Gn(e)?e.split(":").map(Number):null;let i=t(e);if(null===i&&(i=t(this.config.ratio)),null===i&&!yn.empty(this.embed)&&yn.array(this.embed.ratio)&&({ratio:i}=this.embed),null===i&&this.isHTML5){const{videoWidth:e,videoHeight:t}=this.media;i=[e,t]}return Zn(i)}function ts(e){if(!this.isVideo)return{};const{wrapper:t}=this.elements,i=es.call(this,e);if(!yn.array(i))return{};const[n,s]=Zn(i),r=100/n*s;if(Qn(`aspect-ratio: ${n}/${s}`)?t.style.aspectRatio=`${n}/${s}`:t.style.paddingBottom=`${r}%`,this.isVimeo&&!this.config.vimeo.premium&&this.supported.ui){const e=100/this.media.offsetWidth*Number.parseInt(window.getComputedStyle(this.media).paddingBottom,10),i=(e-r)/(e/50);this.fullscreen.active?t.style.paddingBottom=null:this.media.style.transform=`translateY(-${i}%)`}else this.isHTML5&&t.classList.add(this.config.classNames.videoFixedRatio);return{padding:r,ratio:i}}function is(e,t,i=.05){const n=e/t,s=Xn(Object.keys(Jn),n);return Math.abs(s-n)<=i?Jn[s]:[e,t]}const ns={getSources(){if(!this.isHTML5)return[];return Array.from(this.media.querySelectorAll("source")).filter(e=>{const t=e.getAttribute("type");return!!yn.empty(t)||Dn.mime.call(this,t)})},getQualityOptions(){return this.config.quality.forced?this.config.quality.options:ns.getSources.call(this).map(e=>Number(e.getAttribute("size"))).filter(Boolean)},setup(){if(!this.isHTML5)return;const e=this;e.options.speed=e.config.speed.options,yn.empty(this.config.ratio)||ts.call(e),Object.defineProperty(e.media,"quality",{get(){const t=ns.getSources.call(e).find(t=>t.getAttribute("src")===e.source);return t&&Number(t.getAttribute("size"))},set(t){if(e.quality!==t){if(e.config.quality.forced&&yn.function(e.config.quality.onChange))e.config.quality.onChange(t);else{const i=ns.getSources.call(e).find(e=>Number(e.getAttribute("size"))===t);if(!i)return;const{currentTime:n,paused:s,preload:r,readyState:a,playbackRate:o}=e.media;e.media.src=i.getAttribute("src"),("none"!==r||a)&&(e.once("loadedmetadata",()=>{e.speed=o,e.currentTime=n,s||Kn(e.play())}),e.media.load())}Bn.call(e,e.media,"qualitychange",!1,{quality:t})}}})},cancelRequests(){this.isHTML5&&(Pn(ns.getSources.call(this)),this.media.setAttribute("src",this.config.blankVideo),this.media.load(),this.debug.log("Cancelled network requests"))}};var ss={isIE:Boolean(window.document.documentMode),isEdge:/Edge/.test(navigator.userAgent),isWebKit:"WebkitAppearance"in document.documentElement.style&&!/Edge/.test(navigator.userAgent),isIPadOS:"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1,isIos:/iPad|iPhone|iPod/i.test(navigator.userAgent)&&navigator.maxTouchPoints>1};function rs(e,...t){return yn.empty(e)?e:e.toString().replace(/\{(\d+)\}/g,(e,i)=>t[i].toString())}function as(e="",t="",i=""){return e.replace(new RegExp(t.toString().replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1"),"g"),i.toString())}function os(e=""){return e.toString().replace(/\w\S*/g,e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase())}function ls(e=""){let t=e.toString();return t=function(e=""){let t=e.toString();return t=as(t,"-"," "),t=as(t,"_"," "),t=os(t),as(t," ","")}(t),t.charAt(0).toLowerCase()+t.slice(1)}function cs(e){const t=document.createElement("div");return t.appendChild(e),t.innerHTML}const us={pip:"PIP",airplay:"AirPlay",html5:"HTML5",vimeo:"Vimeo",youtube:"YouTube"},hs={get(e="",t={}){if(yn.empty(e)||yn.empty(t))return"";let i=wn(t.i18n,e);if(yn.empty(i))return Object.keys(us).includes(e)?us[e]:"";const n={"{seektime}":t.seekTime,"{title}":t.title};return Object.entries(n).forEach(([e,t])=>{i=as(i,e,t)}),i}};class ds{constructor(t){e(this,"get",e=>{if(!ds.supported||!this.enabled)return null;const t=window.localStorage.getItem(this.key);if(yn.empty(t))return null;const i=JSON.parse(t);return yn.string(e)&&e.length?i[e]:i}),e(this,"set",e=>{if(!ds.supported||!this.enabled)return;if(!yn.object(e))return;let t=this.get();yn.empty(t)&&(t={}),kn(t,e);try{window.localStorage.setItem(this.key,JSON.stringify(t))}catch{}}),this.enabled=t.config.storage.enabled,this.key=t.config.storage.key}static get supported(){try{if(!("localStorage"in window))return!1;const e="___test";return window.localStorage.setItem(e,e),window.localStorage.removeItem(e),!0}catch{return!1}}}function ps(e,t="text",i=!1){return new Promise((n,s)=>{try{const s=new XMLHttpRequest;if(!("withCredentials"in s))return;i&&(s.withCredentials=!0),s.addEventListener("load",()=>{if("text"===t)try{n(JSON.parse(s.responseText))}catch{n(s.responseText)}else n(s.response)}),s.addEventListener("error",()=>{throw new Error(s.status)}),s.open("GET",e,!0),s.responseType=t,s.send()}catch(e){s(e)}})}function ms(e,t){if(!yn.string(e))return;const i="cache",n=yn.string(t);let s=!1;const r=()=>null!==document.getElementById(t),a=(e,t)=>{e.innerHTML=t,n&&r()||document.body.insertAdjacentElement("afterbegin",e)};if(!n||!r()){const r=ds.supported,o=document.createElement("div");if(o.setAttribute("hidden",""),n&&o.setAttribute("id",t),r){const e=window.localStorage.getItem(`${i}-${t}`);if(s=null!==e,s){const t=JSON.parse(e);a(o,t.content)}}ps(e).then(e=>{if(!yn.empty(e)){if(r)try{window.localStorage.setItem(`${i}-${t}`,JSON.stringify({content:e}))}catch{}a(o,e)}}).catch(()=>{})}}const fs=e=>Math.trunc(e/60/60%60,10);function gs(e=0,t=!1,i=!1){if(!yn.number(e))return gs(void 0,t,i);const n=e=>`0${e}`.slice(-2);let s=fs(e);const r=(a=e,Math.trunc(a/60%60,10));var a;const o=(e=>Math.trunc(e%60,10))(e);return s=t||s>0?`${s}:`:"",`${i&&e>0?"-":""}${s}${n(r)}:${n(o)}`}const ys={getIconUrl(){const e=new URL(this.config.iconUrl,window.location),t=window.location.host?window.location.host:window.top.location.host,i=e.host!==t||ss.isIE&&!window.svg4everybody;return{url:this.config.iconUrl,cors:i}},findElements(){try{return this.elements.controls=In.call(this,this.config.selectors.controls.wrapper),this.elements.buttons={play:_n.call(this,this.config.selectors.buttons.play),pause:In.call(this,this.config.selectors.buttons.pause),restart:In.call(this,this.config.selectors.buttons.restart),rewind:In.call(this,this.config.selectors.buttons.rewind),fastForward:In.call(this,this.config.selectors.buttons.fastForward),mute:In.call(this,this.config.selectors.buttons.mute),pip:In.call(this,this.config.selectors.buttons.pip),airplay:In.call(this,this.config.selectors.buttons.airplay),settings:In.call(this,this.config.selectors.buttons.settings),captions:In.call(this,this.config.selectors.buttons.captions),fullscreen:In.call(this,this.config.selectors.buttons.fullscreen)},this.elements.progress=In.call(this,this.config.selectors.progress),this.elements.inputs={seek:In.call(this,this.config.selectors.inputs.seek),volume:In.call(this,this.config.selectors.inputs.volume)},this.elements.display={buffer:In.call(this,this.config.selectors.display.buffer),currentTime:In.call(this,this.config.selectors.display.currentTime),duration:In.call(this,this.config.selectors.display.duration)},yn.element(this.elements.progress)&&(this.elements.display.seekTooltip=this.elements.progress.querySelector(`.${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(e,t){const i="http://www.w3.org/2000/svg",n=ys.getIconUrl.call(this),s=`${n.cors?"":n.url}#${this.config.iconPrefix}`,r=document.createElementNS(i,"svg");Sn(r,kn(t,{"aria-hidden":"true",focusable:"false"}));const a=document.createElementNS(i,"use"),o=`${s}-${e}`;return"href"in a&&a.setAttributeNS("http://www.w3.org/1999/xlink","href",o),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o),r.appendChild(a),r},createLabel(e,t={}){const i=hs.get(e,this.config);return Cn("span",{...t,class:[t.class,this.config.classNames.hidden].filter(Boolean).join(" ")},i)},createBadge(e){if(yn.empty(e))return null;const t=Cn("span",{class:this.config.classNames.menu.value});return t.appendChild(Cn("span",{class:this.config.classNames.menu.badge},e)),t},createButton(e,t){const i=kn({},t);let n=ls(e);const s={element:"button",toggle:!1,label:null,icon:null,labelPressed:null,iconPressed:null};switch(["element","icon","label"].forEach(e=>{Object.keys(i).includes(e)&&(s[e]=i[e],delete i[e])}),"button"!==s.element||Object.keys(i).includes("type")||(i.type="button"),Object.keys(i).includes("class")?i.class.split(" ").includes(this.config.classNames.control)||kn(i,{class:`${i.class} ${this.config.classNames.control}`}):i.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":i.class+=` ${this.config.classNames.control}--overlaid`,n="play",s.label="play",s.icon="play";break;default:yn.empty(s.label)&&(s.label=n),yn.empty(s.icon)&&(s.icon=e)}const r=Cn(s.element);return s.toggle?(r.appendChild(ys.createIcon.call(this,s.iconPressed,{class:"icon--pressed"})),r.appendChild(ys.createIcon.call(this,s.icon,{class:"icon--not-pressed"})),r.appendChild(ys.createLabel.call(this,s.labelPressed,{class:"label--pressed"})),r.appendChild(ys.createLabel.call(this,s.label,{class:"label--not-pressed"}))):(r.appendChild(ys.createIcon.call(this,s.icon)),r.appendChild(ys.createLabel.call(this,s.label))),kn(i,On(this.config.selectors.buttons[n],i)),Sn(r,i),"play"===n?(yn.array(this.elements.buttons[n])||(this.elements.buttons[n]=[]),this.elements.buttons[n].push(r)):this.elements.buttons[n]=r,r},createRange(e,t){const i=Cn("input",kn(On(this.config.selectors.inputs[e]),{type:"range",min:0,max:100,step:.01,value:0,autocomplete:"off",role:"slider","aria-label":hs.get(e,this.config),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":0},t));return this.elements.inputs[e]=i,ys.updateRangeFill.call(this,i),on.setup(i),i},createProgress(e,t){const i=Cn("progress",kn(On(this.config.selectors.display[e]),{min:0,max:100,value:0,role:"progressbar","aria-hidden":!0},t));if("volume"!==e){i.appendChild(Cn("span",null,"0"));const t={played:"played",buffer:"buffered"}[e],n=t?hs.get(t,this.config):"";i.textContent=`% ${n.toLowerCase()}`}return this.elements.display[e]=i,i},createTime(e,t){const i=On(this.config.selectors.display[e],t),n=Cn("div",kn(i,{class:`${i.class?i.class:""} ${this.config.classNames.display.time} `.trim(),"aria-label":hs.get(e,this.config),role:"timer"}),"00:00");return this.elements.display[e]=n,n},bindMenuItemShortcuts(e,t){Fn.call(this,e,"keydown keyup",i=>{if(![" ","ArrowUp","ArrowDown","ArrowRight"].includes(i.key))return;if(i.preventDefault(),i.stopPropagation(),"keydown"===i.type)return;const n=jn(e,'[role="menuitemradio"]');if(!n&&[" ","ArrowRight"].includes(i.key))ys.showMenuPanel.call(this,t,!0);else{let t;" "!==i.key&&("ArrowDown"===i.key||n&&"ArrowRight"===i.key?(t=e.nextElementSibling,yn.element(t)||(t=e.parentNode.firstElementChild)):(t=e.previousElementSibling,yn.element(t)||(t=e.parentNode.lastElementChild)),$n.call(this,t,!0))}},!1),Fn.call(this,e,"keyup",e=>{"Return"===e.key&&ys.focusFirstMenuItem.call(this,null,!0)})},createMenuItem({value:e,list:t,type:i,title:n,badge:s=null,checked:r=!1}){const a=On(this.config.selectors.inputs[i]),o=Cn("button",kn(a,{type:"button",role:"menuitemradio",class:`${this.config.classNames.control} ${a.class?a.class:""}`.trim(),"aria-checked":r,value:e})),l=Cn("span");l.innerHTML=n,yn.element(s)&&l.appendChild(s),o.appendChild(l),Object.defineProperty(o,"checked",{enumerable:!0,get:()=>"true"===o.getAttribute("aria-checked"),set(e){e&&Array.from(o.parentNode.children).filter(e=>jn(e,'[role="menuitemradio"]')).forEach(e=>e.setAttribute("aria-checked","false")),o.setAttribute("aria-checked",e?"true":"false")}}),this.listeners.bind(o,"click keyup",t=>{if(!yn.keyboardEvent(t)||" "===t.key){switch(t.preventDefault(),t.stopPropagation(),o.checked=!0,i){case"language":this.currentTrack=Number(e);break;case"quality":this.quality=e;break;case"speed":this.speed=Number.parseFloat(e)}ys.showMenuPanel.call(this,"home",yn.keyboardEvent(t))}},i,!1),ys.bindMenuItemShortcuts.call(this,o,i),t.appendChild(o)},formatTime(e=0,t=!1){if(!yn.number(e))return e;return gs(e,fs(this.duration)>0,t)},updateTimeDisplay(e=null,t=0,i=!1){yn.element(e)&&yn.number(t)&&(e.textContent=ys.formatTime(t,i))},updateVolume(){this.supported.ui&&(yn.element(this.elements.inputs.volume)&&ys.setRange.call(this,this.elements.inputs.volume,this.muted?0:this.volume),yn.element(this.elements.buttons.mute)&&(this.elements.buttons.mute.pressed=this.muted||0===this.volume))},setRange(e,t=0){yn.element(e)&&(e.value=t,ys.updateRangeFill.call(this,e))},updateProgress(e){if(!this.supported.ui||!yn.event(e))return;let t=0;const i=(e,t)=>{const i=yn.number(t)?t:0,n=yn.element(e)?e:this.elements.display.buffer;if(yn.element(n)){n.value=i;const e=n.getElementsByTagName("span")[0];yn.element(e)&&(e.childNodes[0].nodeValue=i)}};if(e)switch(e.type){case"timeupdate":case"seeking":case"seeked":n=this.currentTime,s=this.duration,t=0===n||0===s||Number.isNaN(n)||Number.isNaN(s)?0:(n/s*100).toFixed(2),"timeupdate"===e.type&&ys.setRange.call(this,this.elements.inputs.seek,t);break;case"playing":case"progress":i(this.elements.display.buffer,100*this.buffered)}var n,s},updateRangeFill(e){const t=yn.event(e)?e.target:e;if(yn.element(t)&&"range"===t.getAttribute("type")){if(jn(t,this.config.selectors.inputs.seek)){t.setAttribute("aria-valuenow",this.currentTime);const e=ys.formatTime(this.currentTime),i=ys.formatTime(this.duration),n=hs.get("seekLabel",this.config);t.setAttribute("aria-valuetext",n.replace("{currentTime}",e).replace("{duration}",i))}else if(jn(t,this.config.selectors.inputs.volume)){const e=100*t.value;t.setAttribute("aria-valuenow",e),t.setAttribute("aria-valuetext",`${e.toFixed(1)}%`)}else t.setAttribute("aria-valuenow",t.value);(ss.isWebKit||ss.isIPadOS)&&t.style.setProperty("--value",t.value/t.max*100+"%")}},updateSeekTooltip(e){var t,i;if(!this.config.tooltips.seek||!yn.element(this.elements.inputs.seek)||!yn.element(this.elements.display.seekTooltip)||0===this.duration)return;const n=this.elements.display.seekTooltip,s=`${this.config.classNames.tooltip}--visible`,r=e=>Nn(n,s,e);if(this.touch)return void r(!1);let a=0;const o=this.elements.progress.getBoundingClientRect();if(yn.event(e)){const t=e.pageX-e.clientX;a=100/o.width*(e.pageX-o.left-t)}else{if(!Ln(n,s))return;a=Number.parseFloat(n.style.left,10)}a<0?a=0:a>100&&(a=100);const l=this.duration/100*a;n.textContent=ys.formatTime(l);const c=null===(t=this.config.markers)||void 0===t||null===(i=t.points)||void 0===i?void 0:i.find(({time:e})=>e===Math.round(l));c&&n.insertAdjacentHTML("afterbegin",`${c.label}<br>`),n.style.left=`${a}%`,yn.event(e)&&["mouseenter","mouseleave"].includes(e.type)&&r("mouseenter"===e.type)},timeUpdate(e){const t=!yn.element(this.elements.display.duration)&&this.config.invertTime;ys.updateTimeDisplay.call(this,this.elements.display.currentTime,t?this.duration-this.currentTime:this.currentTime,t),e&&"timeupdate"===e.type&&this.media.seeking||ys.updateProgress.call(this,e)},durationUpdate(){if(!this.supported.ui||!this.config.invertTime&&this.currentTime)return;if(this.duration>=2**32)return xn(this.elements.display.currentTime,!0),void xn(this.elements.progress,!0);yn.element(this.elements.inputs.seek)&&this.elements.inputs.seek.setAttribute("aria-valuemax",this.duration);const e=yn.element(this.elements.display.duration);!e&&this.config.displayDuration&&this.paused&&ys.updateTimeDisplay.call(this,this.elements.display.currentTime,this.duration),e&&ys.updateTimeDisplay.call(this,this.elements.display.duration,this.duration),this.config.markers.enabled&&ys.setMarkers.call(this),ys.updateSeekTooltip.call(this)},toggleMenuButton(e,t){xn(this.elements.settings.buttons[e],!t)},updateSetting(e,t,i){const n=this.elements.settings.panels[e];let s=null,r=t;if("captions"===e)s=this.currentTrack;else{if(s=yn.empty(i)?this[e]:i,yn.empty(s)&&(s=this.config[e].default),!yn.empty(this.options[e])&&!this.options[e].includes(s))return void this.debug.warn(`Unsupported value of '${s}' for ${e}`);if(!this.config[e].options.includes(s))return void this.debug.warn(`Disabled value of '${s}' for ${e}`)}if(yn.element(r)||(r=n&&n.querySelector('[role="menu"]')),!yn.element(r))return;this.elements.settings.buttons[e].querySelector(`.${this.config.classNames.menu.value}`).innerHTML=ys.getLabel.call(this,e,s);const a=r&&r.querySelector(`[value="${s}"]`);yn.element(a)&&(a.checked=!0)},getLabel(e,t){switch(e){case"speed":return 1===t?hs.get("normal",this.config):`${t}×`;case"quality":if(yn.number(t)){const e=hs.get(`qualityLabel.${t}`,this.config);return e.length?e:`${t}p`}return os(t);case"captions":return ws.getLabel.call(this);default:return null}},setQualityMenu(e){if(!yn.element(this.elements.settings.panels.quality))return;const t="quality",i=this.elements.settings.panels.quality.querySelector('[role="menu"]');yn.array(e)&&(this.options.quality=Yn(e).filter(e=>this.config.quality.options.includes(e)));const n=!yn.empty(this.options.quality)&&this.options.quality.length>1;if(ys.toggleMenuButton.call(this,t,n),An(i),ys.checkMenu.call(this),!n)return;const s=e=>{const t=hs.get(`qualityBadge.${e}`,this.config);return t.length?ys.createBadge.call(this,t):null};this.options.quality.sort((e,t)=>{const i=this.config.quality.options;return i.indexOf(e)>i.indexOf(t)?1:-1}).forEach(e=>{ys.createMenuItem.call(this,{value:e,list:i,type:t,title:ys.getLabel.call(this,"quality",e),badge:s(e)})}),ys.updateSetting.call(this,t,i)},setCaptionsMenu(){if(!yn.element(this.elements.settings.panels.captions))return;const e="captions",t=this.elements.settings.panels.captions.querySelector('[role="menu"]'),i=ws.getTracks.call(this),n=Boolean(i.length);if(ys.toggleMenuButton.call(this,e,n),An(t),ys.checkMenu.call(this),!n)return;const s=i.map((e,i)=>({value:i,checked:this.captions.toggled&&this.currentTrack===i,title:ws.getLabel.call(this,e),badge:e.language&&ys.createBadge.call(this,e.language.toUpperCase()),list:t,type:"language"}));s.unshift({value:-1,checked:!this.captions.toggled,title:hs.get("disabled",this.config),list:t,type:"language"}),s.forEach(ys.createMenuItem.bind(this)),ys.updateSetting.call(this,e,t)},setSpeedMenu(){if(!yn.element(this.elements.settings.panels.speed))return;const e="speed",t=this.elements.settings.panels.speed.querySelector('[role="menu"]');this.options.speed=this.options.speed.filter(e=>e>=this.minimumSpeed&&e<=this.maximumSpeed);const i=!yn.empty(this.options.speed)&&this.options.speed.length>1;ys.toggleMenuButton.call(this,e,i),An(t),ys.checkMenu.call(this),i&&(this.options.speed.forEach(i=>{ys.createMenuItem.call(this,{value:i,list:t,type:e,title:ys.getLabel.call(this,"speed",i)})}),ys.updateSetting.call(this,e,t))},checkMenu(){const{buttons:e}=this.elements.settings,t=!yn.empty(e)&&Object.values(e).some(e=>!e.hidden);xn(this.elements.settings.menu,!t)},focusFirstMenuItem(e,t=!1){if(this.elements.settings.popup.hidden)return;let i=e;yn.element(i)||(i=Object.values(this.elements.settings.panels).find(e=>!e.hidden));const n=i.querySelector('[role^="menuitem"]');$n.call(this,n,t)},toggleMenu(e){const{popup:t}=this.elements.settings,i=this.elements.buttons.settings;if(!yn.element(t)||!yn.element(i))return;const{hidden:n}=t;let s=n;if(yn.boolean(e))s=e;else if(yn.keyboardEvent(e)&&"Escape"===e.key)s=!1;else if(yn.event(e)){const n=yn.function(e.composedPath)?e.composedPath()[0]:e.target,r=t.contains(n);if(r||!r&&e.target!==i&&s)return}i.setAttribute("aria-expanded",s),xn(t,!s),Nn(this.elements.container,this.config.classNames.menu.open,s),s&&yn.keyboardEvent(e)?ys.focusFirstMenuItem.call(this,null,!0):s||n||$n.call(this,i,yn.keyboardEvent(e))},getMenuSize(e){const t=e.cloneNode(!0);t.style.position="absolute",t.style.opacity=0,t.removeAttribute("hidden"),e.parentNode.appendChild(t);const i=t.scrollWidth,n=t.scrollHeight;return Pn(t),{width:i,height:n}},showMenuPanel(e="",t=!1){const i=this.elements.container.querySelector(`#plyr-settings-${this.id}-${e}`);if(!yn.element(i))return;const n=i.parentNode,s=Array.from(n.children).find(e=>!e.hidden);if(Dn.transitions&&!Dn.reducedMotion){n.style.width=`${s.scrollWidth}px`,n.style.height=`${s.scrollHeight}px`;const e=ys.getMenuSize.call(this,i),t=e=>{e.target===n&&["width","height"].includes(e.propertyName)&&(n.style.width="",n.style.height="",Un.call(this,n,bn,t))};Fn.call(this,n,bn,t),n.style.width=`${e.width}px`,n.style.height=`${e.height}px`}xn(s,!0),xn(i,!1),ys.focusFirstMenuItem.call(this,i,t)},setDownloadUrl(){const e=this.elements.buttons.download;yn.element(e)&&e.setAttribute("href",this.download)},create(e){const{bindMenuItemShortcuts:t,createButton:i,createProgress:n,createRange:s,createTime:r,setQualityMenu:a,setSpeedMenu:o,showMenuPanel:l}=ys;this.elements.controls=null,yn.array(this.config.controls)&&this.config.controls.includes("play-large")&&this.elements.container.appendChild(i.call(this,"play-large"));const c=Cn("div",On(this.config.selectors.controls.wrapper));this.elements.controls=c;const u={class:"plyr__controls__item"};return Yn(yn.array(this.config.controls)?this.config.controls:[]).forEach(a=>{if("restart"===a&&c.appendChild(i.call(this,"restart",u)),"rewind"===a&&c.appendChild(i.call(this,"rewind",u)),"play"===a&&c.appendChild(i.call(this,"play",u)),"fast-forward"===a&&c.appendChild(i.call(this,"fast-forward",u)),"progress"===a){const t=Cn("div",{class:`${u.class} plyr__progress__container`}),i=Cn("div",On(this.config.selectors.progress));if(i.appendChild(s.call(this,"seek",{id:`plyr-seek-${e.id}`})),i.appendChild(n.call(this,"buffer")),this.config.tooltips.seek){const e=Cn("span",{class:this.config.classNames.tooltip},"00:00");i.appendChild(e),this.elements.display.seekTooltip=e}this.elements.progress=i,t.appendChild(this.elements.progress),c.appendChild(t)}if("current-time"===a&&c.appendChild(r.call(this,"currentTime",u)),"duration"===a&&c.appendChild(r.call(this,"duration",u)),"mute"===a||"volume"===a){let{volume:t}=this.elements;if(yn.element(t)&&c.contains(t)||(t=Cn("div",kn({},u,{class:`${u.class} plyr__volume`.trim()})),this.elements.volume=t,c.appendChild(t)),"mute"===a&&t.appendChild(i.call(this,"mute")),"volume"===a&&!ss.isIos&&!ss.isIPadOS){const i={max:1,step:.05,value:this.config.volume};t.appendChild(s.call(this,"volume",kn(i,{id:`plyr-volume-${e.id}`})))}}if("captions"===a&&c.appendChild(i.call(this,"captions",u)),"settings"===a&&!yn.empty(this.config.settings)){const n=Cn("div",kn({},u,{class:`${u.class} plyr__menu`.trim(),hidden:""}));n.appendChild(i.call(this,"settings",{"aria-haspopup":!0,"aria-controls":`plyr-settings-${e.id}`,"aria-expanded":!1}));const s=Cn("div",{class:"plyr__menu__container",id:`plyr-settings-${e.id}`,hidden:""}),r=Cn("div"),a=Cn("div",{id:`plyr-settings-${e.id}-home`}),o=Cn("div",{role:"menu"});a.appendChild(o),r.appendChild(a),this.elements.settings.panels.home=a,this.config.settings.forEach(i=>{const n=Cn("button",kn(On(this.config.selectors.buttons.settings),{type:"button",class:`${this.config.classNames.control} ${this.config.classNames.control}--forward`,role:"menuitem","aria-haspopup":!0,hidden:""}));t.call(this,n,i),Fn.call(this,n,"click",()=>{l.call(this,i,!1)});const s=Cn("span",null,hs.get(i,this.config)),a=Cn("span",{class:this.config.classNames.menu.value});a.innerHTML=e[i],s.appendChild(a),n.appendChild(s),o.appendChild(n);const c=Cn("div",{id:`plyr-settings-${e.id}-${i}`,hidden:""}),u=Cn("button",{type:"button",class:`${this.config.classNames.control} ${this.config.classNames.control}--back`});u.appendChild(Cn("span",{"aria-hidden":!0},hs.get(i,this.config))),u.appendChild(Cn("span",{class:this.config.classNames.hidden},hs.get("menuBack",this.config))),Fn.call(this,c,"keydown",e=>{"ArrowLeft"===e.key&&(e.preventDefault(),e.stopPropagation(),l.call(this,"home",!0))},!1),Fn.call(this,u,"click",()=>{l.call(this,"home",!1)}),c.appendChild(u),c.appendChild(Cn("div",{role:"menu"})),r.appendChild(c),this.elements.settings.buttons[i]=n,this.elements.settings.panels[i]=c}),s.appendChild(r),n.appendChild(s),c.appendChild(n),this.elements.settings.popup=s,this.elements.settings.menu=n}if("pip"===a&&Dn.pip&&c.appendChild(i.call(this,"pip",u)),"airplay"===a&&Dn.airplay&&c.appendChild(i.call(this,"airplay",u)),"download"===a){const e=kn({},u,{element:"a",href:this.download,target:"_blank"});this.isHTML5&&(e.download="");const{download:t}=this.config.urls;!yn.url(t)&&this.isEmbed&&kn(e,{icon:`logo-${this.provider}`,label:this.provider}),c.appendChild(i.call(this,"download",e))}"fullscreen"===a&&c.appendChild(i.call(this,"fullscreen",u))}),this.isHTML5&&a.call(this,ns.getQualityOptions.call(this)),o.call(this),c},inject(){if(this.config.loadSprite){const e=ys.getIconUrl.call(this);e.cors&&ms(e.url,"sprite-plyr")}this.id=Math.floor(1e4*Math.random());let e=null;this.elements.controls=null;const t={id:this.id,seektime:this.config.seekTime,title:this.config.title};let i=!0;yn.function(this.config.controls)&&(this.config.controls=this.config.controls.call(this,t)),this.config.controls||(this.config.controls=[]),yn.element(this.config.controls)||yn.string(this.config.controls)?e=this.config.controls:(e=ys.create.call(this,{id:this.id,seektime:this.config.seekTime,speed:this.speed,quality:this.quality,captions:ws.getLabel.call(this)}),i=!1);let n;i&&yn.string(this.config.controls)&&(e=(e=>{let i=e;return Object.entries(t).forEach(([e,t])=>{i=as(i,`{${e}}`,t)}),i})(e)),yn.string(this.config.selectors.controls.container)&&(n=document.querySelector(this.config.selectors.controls.container)),yn.element(n)||(n=this.elements.container);if(n[yn.element(e)?"insertAdjacentElement":"insertAdjacentHTML"]("afterbegin",e),yn.element(this.elements.controls)||ys.findElements.call(this),!yn.empty(this.elements.buttons)){const e=e=>{const t=this.config.classNames.controlPressed;e.setAttribute("aria-pressed","false"),Object.defineProperty(e,"pressed",{configurable:!0,enumerable:!0,get:()=>Ln(e,t),set(i=!1){Nn(e,t,i),e.setAttribute("aria-pressed",i?"true":"false")}})};Object.values(this.elements.buttons).filter(Boolean).forEach(t=>{yn.array(t)||yn.nodeList(t)?Array.from(t).filter(Boolean).forEach(e):e(t)})}if(ss.isEdge&&vn(n),this.config.tooltips.controls){const{classNames:e,selectors:t}=this.config,i=`${t.controls.wrapper} ${t.labels} .${e.hidden}`,n=_n.call(this,i);Array.from(n).forEach(e=>{Nn(e,this.config.classNames.hidden,!1),Nn(e,this.config.classNames.tooltip,!0)})}},setMediaMetadata(){try{"mediaSession"in navigator&&(navigator.mediaSession.metadata=new window.MediaMetadata({title:this.config.mediaMetadata.title,artist:this.config.mediaMetadata.artist,album:this.config.mediaMetadata.album,artwork:this.config.mediaMetadata.artwork}))}catch{}},setMarkers(){var e,t;if(!this.duration||this.elements.markers)return;const i=null===(e=this.config.markers)||void 0===e||null===(t=e.points)||void 0===t?void 0:t.filter(({time:e})=>e>0&&e<this.duration);if(null==i||!i.length)return;const n=document.createDocumentFragment(),s=document.createDocumentFragment();let r=null;const a=`${this.config.classNames.tooltip}--visible`,o=e=>Nn(r,a,e);i.forEach(e=>{const t=Cn("span",{class:this.config.classNames.marker},""),i=e.time/this.duration*100+"%";r&&(t.addEventListener("mouseenter",()=>{e.label||(r.style.left=i,r.innerHTML=e.label,o(!0))}),t.addEventListener("mouseleave",()=>{o(!1)})),t.addEventListener("click",()=>{this.currentTime=e.time}),t.style.left=i,s.appendChild(t)}),n.appendChild(s),this.config.tooltips.seek||(r=Cn("span",{class:this.config.classNames.tooltip},""),n.appendChild(r)),this.elements.markers={points:s,tip:r},this.elements.progress.appendChild(n)}};function bs(e,t=!0){let i=e;if(t){const e=document.createElement("a");e.href=i,i=e.href}try{return new URL(i)}catch{return null}}function vs(e){const t=new URLSearchParams;return yn.object(e)&&Object.entries(e).forEach(([e,i])=>{t.set(e,i)}),t}const ws={setup(){if(!this.supported.ui)return;if(!this.isVideo||this.isYouTube||this.isHTML5&&!Dn.textTracks)return void(yn.array(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&ys.setCaptionsMenu.call(this));var e,t;if(yn.element(this.elements.captions)||(this.elements.captions=Cn("div",On(this.config.selectors.captions)),this.elements.captions.setAttribute("dir","auto"),e=this.elements.captions,t=this.elements.wrapper,yn.element(e)&&yn.element(t)&&t.parentNode.insertBefore(e,t.nextSibling)),ss.isIE&&window.URL){const e=this.media.querySelectorAll("track");Array.from(e).forEach(e=>{const t=e.getAttribute("src"),i=bs(t);null!==i&&i.hostname!==window.location.href.hostname&&["http:","https:"].includes(i.protocol)&&ps(t,"blob").then(t=>{e.setAttribute("src",window.URL.createObjectURL(t))}).catch(()=>{Pn(e)})})}const i=Yn((navigator.languages||[navigator.language||navigator.userLanguage||"en"]).map(e=>e.split("-")[0]));let n=(this.storage.get("language")||this.captions.language||this.config.captions.language||"auto").toLowerCase();"auto"===n&&([n]=i);let s=this.storage.get("captions")||this.captions.active;if(yn.boolean(s)||({active:s}=this.config.captions),Object.assign(this.captions,{toggled:!1,active:s,language:n,languages:i}),this.isHTML5){const e=this.config.captions.update?"addtrack removetrack":"removetrack";Fn.call(this,this.media.textTracks,e,ws.update.bind(this))}setTimeout(ws.update.bind(this),0)},update(){const e=ws.getTracks.call(this,!0),{active:t,language:i,meta:n,currentTrackNode:s}=this.captions,r=Boolean(e.find(e=>e.language===i));this.isHTML5&&this.isVideo&&e.filter(e=>!n.get(e)).forEach(e=>{this.debug.log("Track added",e),n.set(e,{default:"showing"===e.mode}),"showing"===e.mode&&(e.mode="hidden"),Fn.call(this,e,"cuechange",()=>ws.updateCues.call(this))}),(r&&this.language!==i||!e.includes(s))&&(ws.setLanguage.call(this,i),ws.toggle.call(this,t&&r)),this.elements&&Nn(this.elements.container,this.config.classNames.captions.enabled,!yn.empty(e)),yn.array(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&ys.setCaptionsMenu.call(this)},toggle(e,t=!0){if(!this.supported.ui)return;const{toggled:i}=this.captions,n=this.config.classNames.captions.active,s=yn.nullOrUndefined(e)?!i:e;if(s!==i){if(t||(this.captions.active=s,this.storage.set({captions:s})),!this.language&&s&&!t){const e=ws.getTracks.call(this),t=ws.findTrack.call(this,[this.captions.language,...this.captions.languages],!0);return this.captions.language=t.language,void ws.set.call(this,e.indexOf(t))}this.elements.buttons.captions&&(this.elements.buttons.captions.pressed=s),Nn(this.elements.container,n,s),this.captions.toggled=s,ys.updateSetting.call(this,"captions"),Bn.call(this,this.media,s?"captionsenabled":"captionsdisabled")}setTimeout(()=>{s&&this.captions.toggled&&(this.captions.currentTrackNode.mode="hidden")})},set(e,t=!0){const i=ws.getTracks.call(this);if(-1!==e)if(yn.number(e))if(e in i){if(this.captions.currentTrack!==e){this.captions.currentTrack=e;const n=i[e],{language:s}=n||{};this.captions.currentTrackNode=n,ys.updateSetting.call(this,"captions"),t||(this.captions.language=s,this.storage.set({language:s})),this.isVimeo&&this.embed.enableTextTrack(s,null,!1),Bn.call(this,this.media,"languagechange")}ws.toggle.call(this,!0,t),this.isHTML5&&this.isVideo&&ws.updateCues.call(this)}else this.debug.warn("Track not found",e);else this.debug.warn("Invalid caption argument",e);else ws.toggle.call(this,!1,t)},setLanguage(e,t=!0){if(!yn.string(e))return void this.debug.warn("Invalid language argument",e);const i=e.toLowerCase();this.captions.language=i;const n=ws.getTracks.call(this),s=ws.findTrack.call(this,[i]);ws.set.call(this,n.indexOf(s),t)},getTracks(e=!1){return Array.from((this.media||{}).textTracks||[]).filter(t=>!this.isHTML5||e||this.captions.meta.has(t)).filter(e=>["captions","subtitles"].includes(e.kind))},findTrack(e,t=!1){const i=ws.getTracks.call(this),n=e=>Number((this.captions.meta.get(e)||{}).default),s=Array.from(i).sort((e,t)=>n(t)-n(e));let r;return e.every(e=>(r=s.find(t=>t.language===e),!r)),r||(t?s[0]:void 0)},getCurrentTrack(){return ws.getTracks.call(this)[this.currentTrack]},getLabel(e){let t=e;return!yn.track(t)&&Dn.textTracks&&this.captions.toggled&&(t=ws.getCurrentTrack.call(this)),yn.track(t)?yn.empty(t.label)?yn.empty(t.language)?hs.get("enabled",this.config):e.language.toUpperCase():t.label:hs.get("disabled",this.config)},updateCues(e){if(!this.supported.ui)return;if(!yn.element(this.elements.captions))return void this.debug.warn("No captions element to render to");if(!yn.nullOrUndefined(e)&&!Array.isArray(e))return void this.debug.warn("updateCues: Invalid input",e);let t=e;if(!t){const e=ws.getCurrentTrack.call(this);t=Array.from((e||{}).activeCues||[]).map(e=>e.getCueAsHTML()).map(cs)}const i=t.map(e=>e.trim()).join("\n");if(i!==this.elements.captions.innerHTML){An(this.elements.captions);const e=Cn("span",On(this.config.selectors.caption));e.innerHTML=i,this.elements.captions.appendChild(e),Bn.call(this,this.media,"cuechange")}}},ks={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.8.4/plyr.svg",blankVideo:"https://cdn.plyr.io/static/blank.mp4",quality:{default:576,options:[4320,2880,2160,1440,1080,720,576,480,360,240],forced:!1,onChange:null},loop:{active:!1},speed:{selected:1,options:[.5,.75,1,1.25,1.5,1.75,2,4]},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",pip:"PIP",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:"S
1D"}},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/oembed.json?url={0}"},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",marker:"plyr__progress__marker",hidden:"plyr__sr-only",hideControls:"plyr--hide-controls",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"},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",hash:"data-plyr-embed-hash"}},ads:{enabled:!1,publisherId:"",tagUrl:""},previewThumbnails:{enabled:!1,src:"",withCredentials:!1},vimeo:{byline:!1,portrait:!1,title:!1,speed:!0,transparent:!1,customControls:!0,referrerPolicy:null,premium:!1},youtube:{rel:0,showinfo:0,iv_load_policy:3,modestbranding:1,customControls:!0,noCookie:!1},mediaMetadata:{title:"",artist:"",album:"",artwork:[]},markers:{enabled:!1,points:[]}},Ts="picture-in-picture",Ss="inline",Cs={html5:"html5",youtube:"youtube",vimeo:"vimeo"},Es="audio",Ps="video";function As(){}class Ms{constructor(e=!1){this.enabled=window.console&&e,this.enabled&&this.log("Debugging enabled")}get log(){return this.enabled?Function.prototype.bind.call(console.log,console):As}get warn(){return this.enabled?Function.prototype.bind.call(console.warn,console):As}get error(){return this.enabled?Function.prototype.bind.call(console.error,console):As}}class Os{constructor(t){e(this,"onChange",()=>{if(!this.supported)return;const e=this.player.elements.buttons.fullscreen;
vendor: 15,571 bytes, line 1
1yn.element(e)&&(e.pressed=this.active);const t=this.target===this.player.media?this.target:this.player.elements.container;Bn.call(this.player,t,this.active?"enterfullscreen":"exitfullscreen",!0)}),e(this,"toggleFallback",(e=!1)=>{var t,i;e?this.scrollPosition={x:null!==(t=window.scrollX)&&void 0!==t?t:0,y:null!==(i=window.scrollY)&&void 0!==i?i:0}:window.scrollTo(this.scrollPosition.x,this.scrollPosition.y);if(document.body.style.overflow=e?"hidden":"",Nn(this.target,this.player.config.classNames.fullscreen.fallback,e),ss.isIos){let t=document.head.querySelector('meta[name="viewport"]');const i="viewport-fit=cover";t||(t=document.createElement("meta"),t.setAttribute("name","viewport"));const n=yn.string(t.content)&&t.content.includes(i);e?(this.cleanupViewport=!n,n||(t.content+=`,${i}`)):this.cleanupViewport&&(t.content=t.content.split(",").filter(e=>e.trim()!==i).join(","))}this.onChange()}),e(this,"trapFocus",e=>{if(ss.isIos||ss.isIPadOS||!this.active||"Tab"!==e.key)return;const t=document.activeElement,i=_n.call(this.player,"a[href], button:not(:disabled), input:not(:disabled), [tabindex]"),[n]=i,s=i[i.length-1];t!==s||e.shiftKey?t===n&&e.shiftKey&&(s.focus(),e.preventDefault()):(n.focus(),e.preventDefault())}),e(this,"update",()=>{if(this.supported){let e;e=this.forceFallback?"Fallback (forced)":Os.nativeSupported?"Native":"Fallback",this.player.debug.log(`${e} fullscreen enabled`)}else this.player.debug.log("Fullscreen not supported and fallback disabled");Nn(this.player.elements.container,this.player.config.classNames.fullscreen.enabled,this.supported)}),e(this,"enter",()=>{this.supported&&(ss.isIos&&this.player.config.fullscreen.iosNative?this.player.isVimeo?this.player.embed.requestFullscreen():this.target.webkitEnterFullscreen():!Os.nativeSupported||this.forceFallback?this.toggleFallback(!0):this.prefix?yn.empty(this.prefix)||this.target[`${this.prefix}Request${this.property}`]():this.target.requestFullscreen({navigationUI:"hide"}))}),e(this,"exit",()=>{if(this.supported)if(ss.isIos&&this.player.config.fullscreen.iosNative)this.player.isVimeo?this.player.embed.exitFullscreen():this.target.webkitEnterFullscreen(),Kn(this.player.play());else if(!Os.nativeSupported||this.forceFallback)this.toggleFallback(!1);else if(this.prefix){if(!yn.empty(this.prefix)){const e="moz"===this.prefix?"Cancel":"Exit";document[`${this.prefix}${e}${this.property}`]()}}else(document.cancelFullScreen||document.exitFullscreen).call(document)}),e(this,"toggle",()=>{this.active?this.exit():this.enter()}),this.player=t,this.prefix=Os.prefix,this.property=Os.property,this.scrollPosition={x:0,y:0},this.forceFallback="force"===t.config.fullscreen.fallback,this.player.elements.fullscreen=t.config.fullscreen.container&&function(e,t){const{prototype:i}=Element;return(i.closest||function(){let e=this;do{if(jn.matches(e,t))return e;e=e.parentElement||e.parentNode}while(null!==e&&1===e.nodeType);return null}).call(e,t)}(this.player.elements.container,t.config.fullscreen.container),Fn.call(this.player,document,"ms"===this.prefix?"MSFullscreenChange":`${this.prefix}fullscreenchange`,()=>{this.onChange()}),Fn.call(this.player,this.player.elements.container,"dblclick",e=>{yn.element(this.player.elements.controls)&&this.player.elements.controls.contains(e.target)||this.player.listeners.proxy(e,this.toggle,"fullscreen")}),Fn.call(this,this.player.elements.container,"keydown",e=>this.trapFocus(e)),this.update()}static get nativeSupported(){return!!(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}get useNative(){return Os.nativeSupported&&!this.forceFallback}static get prefix(){if(yn.function(document.exitFullscreen))return"";let e="";return["webkit","moz","ms"].some(t=>!(!yn.function(document[`${t}ExitFullscreen`])&&!yn.function(document[`${t}CancelFullScreen`]))&&(e=t,!0)),e}static get property(){return"moz"===this.prefix?"FullScreen":"Fullscreen"}get supported(){return[this.player.config.fullscreen.enabled,this.player.isVideo,Os.nativeSupported||this.player.config.fullscreen.fallback,!this.player.isYouTube||Os.nativeSupported||!ss.isIos||this.player.config.playsinline&&!this.player.config.fullscreen.iosNative].every(Boolean)}get active(){if(!this.supported)return!1;if(!Os.nativeSupported||this.forceFallback)return Ln(this.target,this.player.config.classNames.fullscreen.fallback);const e=this.prefix?this.target.getRootNode()[`${this.prefix}${this.property}Element`]:this.target.getRootNode().fullscreenElement;return e&&e.shadowRoot?e===this.target.getRootNode().host:e===this.target}get target(){var e;return ss.isIos&&this.player.config.fullscreen.iosNative?this.player.media:null!==(e=this.player.elements.fullscreen)&&void 0!==e?e:this.player.elements.container}}function xs(e,t=1){return new Promise((i,n)=>{const s=new Image,r=()=>{delete s.onload,delete s.onerror,(s.naturalWidth>=t?i:n)(s)};Object.assign(s,{onload:r,onerror:r,src:e})})}const Ns={addStyleHook(){Nn(this.elements.container,this.config.selectors.container.replace(".",""),!0),Nn(this.elements.container,this.config.classNames.uiSupported,this.supported.ui)},toggleNativeControls(e=!1){e&&this.isHTML5?this.media.setAttribute("controls",""):this.media.removeAttribute("controls")},build(){if(this.listeners.media(),!this.supported.ui)return this.debug.warn(`Basic support only for ${this.provider} ${this.type}`),void Ns.toggleNativeControls.call(this,!0);yn.element(this.elements.controls)||(ys.inject.call(this),this.listeners.controls()),Ns.toggleNativeControls.call(this),this.isHTML5&&ws.setup.call(this),this.volume=null,this.muted=null,this.loop=null,this.quality=null,this.speed=null,ys.updateVolume.call(this),ys.timeUpdate.call(this),ys.durationUpdate.call(this),Ns.checkPlaying.call(this),Nn(this.elements.container,this.config.classNames.pip.supported,Dn.pip&&this.isHTML5&&this.isVideo),Nn(this.elements.container,this.config.classNames.airplay.supported,Dn.airplay&&this.isHTML5),Nn(this.elements.container,this.config.classNames.isTouch,this.touch),this.ready=!0,setTimeout(()=>{Bn.call(this,this.media,"ready")},0),Ns.setTitle.call(this),this.poster&&Ns.setPoster.call(this,this.poster,!1).catch(()=>{}),this.config.duration&&ys.durationUpdate.call(this),this.config.mediaMetadata&&ys.setMediaMetadata.call(this)},setTitle(){let e=hs.get("play",this.config);if(yn.string(this.config.title)&&!yn.empty(this.config.title)&&(e+=`, ${this.config.title}`),Array.from(this.elements.buttons.play||[]).forEach(t=>{t.setAttribute("aria-label",e)}),this.isEmbed){const e=In.call(this,"iframe");if(!yn.element(e))return;const t=yn.empty(this.config.title)?"video":this.config.title,i=hs.get("frameTitle",this.config);e.setAttribute("title",i.replace("{title}",t))}},togglePoster(e){Nn(this.elements.container,this.config.classNames.posterEnabled,e)},setPoster(e,t=!0){return t&&this.poster?Promise.reject(new Error("Poster already set")):(this.media.setAttribute("data-poster",e),this.elements.poster.removeAttribute("hidden"),zn.call(this).then(()=>xs(e)).catch(t=>{throw e===this.poster&&Ns.togglePoster.call(this,!1),t}).then(()=>{if(e!==this.poster)throw new Error("setPoster cancelled by later call to setPoster")}).then(()=>(Object.assign(this.elements.poster.style,{backgroundImage:`url('${e}')`,backgroundSize:""}),Ns.togglePoster.call(this,!0),e)))},checkPlaying(e){Nn(this.elements.container,this.config.classNames.playing,this.playing),Nn(this.elements.container,this.config.classNames.paused,this.paused),Nn(this.elements.container,this.config.classNames.stopped,this.stopped),Array.from(this.elements.buttons.play||[]).forEach(e=>{Object.assign(e,{pressed:this.playing}),e.setAttribute("aria-label",hs.get(this.playing?"pause":"play",this.config))}),yn.event(e)&&"timeupdate"===e.type||Ns.toggleControls.call(this)},checkLoading(e){this.loading=["stalled","waiting"].includes(e.type),clearTimeout(this.timers.loading),this.timers.loading=setTimeout(()=>{Nn(this.elements.container,this.config.classNames.loading,this.loading),Ns.toggleControls.call(this)},this.loading?250:0)},toggleControls(e){const{controls:t}=this.elements;if(t&&this.config.hideControls){const i=this.touch&&this.lastSeekTime+2e3>Date.now();this.toggleControls(Boolean(e||this.loading||this.paused||t.pressed||t.hover||i))}},migrateStyles(){Object.values({...this.media.style}).filter(e=>!yn.empty(e)&&yn.string(e)&&e.startsWith("--plyr")).forEach(e=>{this.elements.container.style.setProperty(e,this.media.style.getPropertyValue(e)),this.media.style.removeProperty(e)}),yn.empty(this.media.style)&&this.media.removeAttribute("style")}};class Ls{constructor(t){e(this,"firstTouch",()=>{const{player:e}=this,{elements:t}=e;e.touch=!0,Nn(t.container,e.config.classNames.isTouch,!0)}),e(this,"global",(e=!0)=>{const{player:t}=this;t.config.keyboard.global&&Hn.call(t,window,"keydown keyup",this.handleKey,e,!1),Hn.call(t,document.body,"click",this.toggleMenu,e),Vn.call(t,document.body,"touchstart",this.firstTouch)}),e(this,"container",()=>{const{player:e}=this,{config:t,elements:i,timers:n}=e;!t.keyboard.global&&t.keyboard.focused&&Fn.call(e,i.container,"keydown keyup",this.handleKey,!1),Fn.call(e,i.container,"mousemove mouseleave touchstart touchmove enterfullscreen exitfullscreen",t=>{const{controls:s}=i;s&&"enterfullscreen"===t.type&&(s.pressed=!1,s.hover=!1);let r=0;["touchstart","touchmove","mousemove"].includes(t.type)&&(Ns.toggleControls.call(e,!0),r=e.touch?3e3:2e3),clearTimeout(n.controls),n.controls=setTimeout(()=>Ns.toggleControls.call(e,!1),r)});const s=()=>{if(!e.isVimeo||e.config.vimeo.premium)return;const t=i.wrapper,{active:n}=e.fullscreen,[s,r]=es.call(e),a=Qn(`aspect-ratio: ${s} / ${r}`);if(!n)return void(a?(t.style.width=null,t.style.height=null):(t.style.maxWidth=null,t.style.margin=null));const[o,l]=[Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),Math.max(document.documentElement.clientHeight||0,window.innerHeight||0)],c=o/l>s/r;a?(t.style.width=c?"auto":"100%",t.style.height=c?"100%":"auto"):(t.style.maxWidth=c?l/r*s+"px":null,t.style.margin=c?"0 auto":null)},r=()=>{clearTimeout(n.resized),n.resized=setTimeout(s,50)};Fn.call(e,i.container,"enterfullscreen exitfullscreen",t=>{const{target:n}=e.fullscreen;if(n!==i.container)return;if(!e.isEmbed&&yn.empty(e.config.ratio))return;s();("enterfullscreen"===t.type?Fn:Un).call(e,window,"resize",r)})}),e(this,"media",()=>{const{player:e}=this,{elements:t}=e;if(Fn.call(e,e.media,"timeupdate seeking seeked",t=>ys.timeUpdate.call(e,t)),Fn.call(e,e.media,"durationchange loadeddata loadedmetadata",t=>ys.durationUpdate.call(e,t)),Fn.call(e,e.media,"ended",()=>{e.isHTML5&&e.isVideo&&e.config.resetOnEnd&&(e.restart(),e.pause())}),Fn.call(e,e.media,"progress playing seeking seeked",t=>ys.updateProgress.call(e,t)),Fn.call(e,e.media,"volumechange",t=>ys.updateVolume.call(e,t)),Fn.call(e,e.media,"playing play pause ended emptied timeupdate",t=>Ns.checkPlaying.call(e,t)),Fn.call(e,e.media,"waiting canplay seeked playing",t=>Ns.checkLoading.call(e,t)),e.supported.ui&&e.config.clickToPlay&&!e.isAudio){const i=In.call(e,`.${e.config.classNames.video}`);if(!yn.element(i))return;Fn.call(e,t.container,"click",n=>{([t.container,i].includes(n.target)||i.contains(n.target))&&(e.touch&&e.config.hideControls||(e.ended?(this.proxy(n,e.restart,"restart"),this.proxy(n,()=>{Kn(e.play())},"play")):this.proxy(n,()=>{Kn(e.togglePlay())},"play")))})}e.supported.ui&&e.config.disableContextMenu&&Fn.call(e,t.wrapper,"contextmenu",e=>{e.preventDefault()},!1),Fn.call(e,e.media,"volumechange",()=>{e.storage.set({volume:e.volume,muted:e.muted})}),Fn.call(e,e.media,"ratechange",()=>{ys.updateSetting.call(e,"speed"),e.storage.set({speed:e.speed})}),Fn.call(e,e.media,"qualitychange",t=>{ys.updateSetting.call(e,"quality",null,t.detail.quality)}),Fn.call(e,e.media,"ready qualitychange",()=>{ys.setDownloadUrl.call(e)});const i=e.config.events.concat(["keyup","keydown"]).join(" ");Fn.call(e,e.media,i,i=>{let{detail:n={}}=i;"error"===i.type&&(n=e.media.error),Bn.call(e,t.container,i.type,!0,n)})}),e(this,"proxy",(e,t,i)=>{const{player:n}=this,s=n.config.listeners[i];let r=!0;yn.function(s)&&(r=s.call(n,e)),!1!==r&&yn.function(t)&&t.call(n,e)}),e(this,"bind",(e,t,i,n,s=!0)=>{const{player:r}=this,a=r.config.listeners[n],o=yn.function(a);Fn.call(r,e,t,e=>this.proxy(e,i,n),s&&!o)}),e(this,"controls",()=>{const{player:e}=this,{elements:t}=e,i=ss.isIE?"change":"input";if(t.buttons.play&&Array.from(t.buttons.play).forEach(t=>{this.bind(t,"click",()=>{Kn(e.togglePlay())},"play")}),this.bind(t.buttons.restart,"click",e.restart,"restart"),this.bind(t.buttons.rewind,"click",()=>{e.lastSeekTime=Date.now(),e.rewind()},"rewind"),this.bind(t.buttons.fastForward,"click",()=>{e.lastSeekTime=Date.now(),e.forward()},"fastForward"),this.bind(t.buttons.mute,"click",()=>{e.muted=!e.muted},"mute"),this.bind(t.buttons.captions,"click",()=>e.toggleCaptions()),this.bind(t.buttons.download,"click",()=>{Bn.call(e,e.media,"download")},"download"),this.bind(t.buttons.fullscreen,"click",()=>{e.fullscreen.toggle()},"fullscreen"),this.bind(t.buttons.pip,"click",()=>{e.pip="toggle"},"pip"),this.bind(t.buttons.airplay,"click",e.airplay,"airplay"),this.bind(t.buttons.settings,"click",t=>{t.stopPropagation(),t.preventDefault(),ys.toggleMenu.call(e,t)},null,!1),this.bind(t.buttons.settings,"keyup",t=>{[" ","Enter"].includes(t.key)&&("Enter"!==t.key?(t.preventDefault(),t.stopPropagation(),ys.toggleMenu.call(e,t)):ys.focusFirstMenuItem.call(e,null,!0))},null,!1),this.bind(t.settings.menu,"keydown",t=>{"Escape"===t.key&&ys.toggleMenu.call(e,t)}),this.bind(t.inputs.seek,"mousedown mousemove",e=>{const i=t.progress.getBoundingClientRect(),n=e.pageX-e.clientX,s=100/i.width*(e.pageX-i.left-n);e.currentTarget.setAttribute("seek-value",s)}),this.bind(t.inputs.seek,"mousedown mouseup keydown keyup touchstart touchend",t=>{const i=t.currentTarget,n="play-on-seeked";if(yn.keyboardEvent(t)&&!["ArrowLeft","ArrowRight"].includes(t.key))return;e.lastSeekTime=Date.now();const s=i.hasAttribute(n),r=["mouseup","touchend","keyup"].includes(t.type);s&&r?(i.removeAttribute(n),Kn(e.play())):!r&&e.playing&&(i.setAttribute(n,""),e.pause())}),ss.isIos){const t=_n.call(e,'input[type="range"]');Array.from(t).forEach(e=>this.bind(e,i,e=>vn(e.target)))}this.bind(t.inputs.seek,i,t=>{const i=t.currentTarget;let n=i.getAttribute("seek-value");yn.empty(n)&&(n=i.value),i.removeAttribute("seek-value"),e.currentTime=n/i.max*e.duration},"seek"),this.bind(t.progress,"mouseenter mouseleave mousemove",t=>ys.updateSeekTooltip.call(e,t)),this.bind(t.progress,"mousemove touchmove",t=>{const{previewThumbnails:i}=e;i&&i.loaded&&i.startMove(t)}),this.bind(t.progress,"mouseleave touchend click",()=>{const{previewThumbnails:t}=e;t&&t.loaded&&t.endMove(!1,!0)}),this.bind(t.progress,"mousedown touchstart",t=>{const{previewThumbnails:i}=e;i&&i.loaded&&i.startScrubbing(t)}),this.bind(t.progress,"mouseup touchend",t=>{const{previewThumbnails:i}=e;i&&i.loaded&&i.endScrubbing(t)}),ss.isWebKit&&Array.from(_n.call(e,'input[type="range"]')).forEach(t=>{this.bind(t,"input",t=>ys.updateRangeFill.call(e,t.target))}),e.config.toggleInvert&&!yn.element(t.display.duration)&&this.bind(t.display.currentTime,"click",()=>{0!==e.currentTime&&(e.config.invertTime=!e.config.invertTime,ys.timeUpdate.call(e))}),this.bind(t.inputs.volume,i,t=>{e.volume=t.target.value},"volume"),this.bind(t.controls,"mouseenter mouseleave",i=>{t.controls.hover=!e.touch&&"mouseenter"===i.type}),t.fullscreen&&Array.from(t.fullscreen.children).filter(e=>
vendor: 4,163 bytes, line 1
1!e.contains(t.container)).forEach(i=>{this.bind(i,"mouseenter mouseleave",i=>{t.controls&&(t.controls.hover=!e.touch&&"mouseenter"===i.type)})}),this.bind(t.controls,"mousedown mouseup touchstart touchend touchcancel",e=>{t.controls.pressed=["mousedown","touchstart"].includes(e.type)}),this.bind(t.controls,"focusin",()=>{const{config:i,timers:n}=e;Nn(t.controls,i.classNames.noTransition,!0),Ns.toggleControls.call(e,!0),setTimeout(()=>{Nn(t.controls,i.classNames.noTransition,!1)},0);const s=this.touch?3e3:4e3;clearTimeout(n.controls),n.controls=setTimeout(()=>Ns.toggleControls.call(e,!1),s)}),this.bind(t.inputs.volume,"wheel",t=>{const i=t.webkitDirectionInvertedFromDevice,[n,s]=[t.deltaX,-t.deltaY].map(e=>i?-e:e),r=Math.sign(Math.abs(n)>Math.abs(s)?n:s);e.increaseVolume(r/50);const{volume:a}=e.media;(1===r&&a<1||-1===r&&a>0)&&t.preventDefault()},"volume",!1)}),this.player=t,this.lastKey=null,this.focusTimer=null,this.lastKeyDown=null,this.handleKey=this.handleKey.bind(this),this.toggleMenu=this.toggleMenu.bind(this),this.firstTouch=this.firstTouch.bind(this)}handleKey(e){const{player:t}=this,{elements:i}=t,{key:n,type:s,altKey:r,ctrlKey:a,metaKey:o,shiftKey:l}=e,c="keydown"===s,u=c&&n===this.lastKey;if(r||a||o||l)return;if(!n)return;if(c){const s=document.activeElement;if(yn.element(s)){const{editable:n}=t.config.selectors,{seek:r}=i.inputs;if(s!==r&&jn(s,n))return;if(" "===e.key&&jn(s,'button, [role^="menuitem"]'))return}switch([" ","ArrowLeft","ArrowUp","ArrowRight","ArrowDown","0","1","2","3","4","5","6","7","8","9","c","f","k","l","m"].includes(n)&&(e.preventDefault(),e.stopPropagation()),n){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":u||(h=Number.parseInt(n,10),t.currentTime=t.duration/10*h);break;case" ":case"k":u||Kn(t.togglePlay());break;case"ArrowUp":t.increaseVolume(.1);break;case"ArrowDown":t.decreaseVolume(.1);break;case"m":u||(t.muted=!t.muted);break;case"ArrowRight":t.forward();break;case"ArrowLeft":t.rewind();break;case"f":t.fullscreen.toggle();break;case"c":u||t.toggleCaptions();break;case"l":t.loop=!t.loop}"Escape"===n&&!t.fullscreen.usingNative&&t.fullscreen.active&&t.fullscreen.toggle(),this.lastKey=n}else this.lastKey=null;var h}toggleMenu(e){ys.toggleMenu.call(this.player,e)}}var js,_s={exports:{}};var Is=(js||(js=1,function(e){e.exports=function(){var e=function(){},t={},i={},n={};function s(e,t){e=e.push?e:[e];var s,r,a,o=[],l=e.length,c=l;for(s=function(e,i){i.length&&o.push(e),--c||t(o)};l--;)r=e[l],(a=i[r])?s(r,a):(n[r]=n[r]||[]).push(s)}function r(e,t){if(e){var s=n[e];if(i[e]=t,s)for(;s.length;)s[0](e,t),s.splice(0,1)}}function a(t,i){t.call&&(t={success:t}),i.length?(t.error||e)(i):(t.success||e)(t)}function o(t,i,n,s){var r,a,l,c=document,u=n.async,h=(n.numRetries||0)+1,d=n.before||e,p=t.replace(/[\?|#].*$/,""),m=t.replace(/^(css|img|module|nomodule)!/,"");if(s=s||0,/(^css!|\.css$)/.test(p))(l=c.createElement("link")).rel="stylesheet",l.href=m,(r="hideFocus"in l)&&l.relList&&(r=0,l.rel="preload",l.as="style");else if(/(^img!|\.(png|gif|jpg|svg|webp)$)/.test(p))(l=c.createElement("img")).src=m;else if((l=c.createElement("script")).src=m,l.async=void 0===u||u,a="noModule"in l,/^module!/.test(p)){if(!a)return i(t,"l");l.type="module"}else if(/^nomodule!/.test(p)&&a)return i(t,"l");l.onload=l.onerror=l.onbeforeload=function(e){var a=e.type[0];if(r)try{l.sheet.cssText.length||(a="e")}catch(e){18!=e.code&&(a="e")}if("e"==a){if((s+=1)<h)return o(t,i,n,s)}else if("preload"==l.rel&&"style"==l.as)return l.rel="stylesheet";i(t,a,e.defaultPrevented)},!1!==d(t,l)&&c.head.appendChild(l)}function l(e,t,i){var n,s,r=(e=e.push?e:[e]).length,a=r,l=[];for(n=function(e,i,n){if("e"==i&&l.push(e),"b"==i){if(!n)return;l.push(e)}--r||t(l)},s=0;s<a;s++)o(e[s],n,i)}function c(e,i,n){var s,o;if(i&&i.trim&&(s=i),o=(s?n:i)||{},s){if(s in t)throw"LoadJS";t[s]=!0}function c(t,i){l(e,function(e){a(o,e),t&&a({success:t,error:i},e),r(s,e)},o)}if(o.returnPromise)return new Promise(c);c()}return c.ready=function(e,t){return s(e,function(e){a(t,e)}),c},c.done=function(e){r(e,[])},c.reset=function(){t={},i={},n={}},c.isDefined=function(e){return e in t},c}()}
vendor: 40,741 bytes, line 1
1(_s)),_s.exports),$s=i(Is);function Rs(e){return new Promise((t,i)=>{$s(e,{success:t,error:i})})}function Ds(e){e&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===e&&(this.media.paused=!e,Bn.call(this,this.media,e?"play":"pause"))}const qs={setup(){const e=this;Nn(e.elements.wrapper,e.config.classNames.embed,!0),e.options.speed=e.config.speed.options,ts.call(e),yn.object(window.Vimeo)?qs.ready.call(e):Rs(e.config.urls.vimeo.sdk).then(()=>{qs.ready.call(e)}).catch(t=>{e.debug.warn("Vimeo SDK (player.js) failed to load",t)})},ready(){const e=this,t=e.config.vimeo,{premium:i,referrerPolicy:n,...s}=t;let r=e.media.getAttribute("src"),a="";yn.empty(r)?(r=e.media.getAttribute(e.config.attributes.embed.id),a=e.media.getAttribute(e.config.attributes.embed.hash)):a=function(e){const t=e.match(/^.*(vimeo.com\/|video\/)(\d+)(\?.*h=|\/)+([\d,a-f]+)/);return t&&5===t.length?t[4]:null}(r);const o=a?{h:a}:{};i&&Object.assign(s,{controls:!1,sidedock:!1});const l=vs({loop:e.config.loop.active,autoplay:e.autoplay,muted:e.muted,gesture:"media",playsinline:e.config.playsinline,...o,...s}),c=function(e){if(yn.empty(e))return null;if(yn.number(Number(e)))return e;const t=e.match(/^.*(vimeo.com\/|video\/)(\d+).*/);return t?t[2]:e}(r),u=Cn("iframe"),h=rs(e.config.urls.vimeo.iframe,c,l);if(u.setAttribute("src",h),u.setAttribute("allowfullscreen",""),u.setAttribute("allow",["autoplay","fullscreen","picture-in-picture","encrypted-media","accelerometer","gyroscope"].join("; ")),yn.empty(n)||u.setAttribute("referrerPolicy",n),i||!t.customControls)u.setAttribute("data-poster",e.poster),e.media=Mn(u,e.media);else{const t=Cn("div",{class:e.config.classNames.embedContainer,"data-poster":e.poster});t.appendChild(u),e.media=Mn(t,e.media)}t.customControls||ps(rs(e.config.urls.vimeo.api,h)).then(t=>{!yn.empty(t)&&t.thumbnail_url&&Ns.setPoster.call(e,t.thumbnail_url).catch(()=>{})}),e.embed=new window.Vimeo.Player(u,{autopause:e.config.autopause,muted:e.muted}),e.media.paused=!0,e.media.currentTime=0,e.supported.ui&&e.embed.disableTextTrack(),e.media.play=()=>(Ds.call(e,!0),e.embed.play()),e.media.pause=()=>(Ds.call(e,!1),e.embed.pause()),e.media.stop=()=>{e.pause(),e.currentTime=0};let{currentTime:d}=e.media;Object.defineProperty(e.media,"currentTime",{get:()=>d,set(t){const{embed:i,media:n,paused:s,volume:r}=e,a=s&&!i.hasPlayed;n.seeking=!0,Bn.call(e,n,"seeking"),Promise.resolve(a&&i.setVolume(0)).then(()=>i.setCurrentTime(t)).then(()=>a&&i.pause()).then(()=>a&&i.setVolume(r)).catch(()=>{})}});let p=e.config.speed.selected;Object.defineProperty(e.media,"playbackRate",{get:()=>p,set(t){e.embed.setPlaybackRate(t).then(()=>{p=t,Bn.call(e,e.media,"ratechange")}).catch(()=>{e.options.speed=[1]})}});let{volume:m}=e.config;Object.defineProperty(e.media,"volume",{get:()=>m,set(t){e.embed.setVolume(t).then(()=>{m=t,Bn.call(e,e.media,"volumechange")})}});let{muted:f}=e.config;Object.defineProperty(e.media,"muted",{get:()=>f,set(t){const i=!!yn.boolean(t)&&t;e.embed.setMuted(!!i||e.config.muted).then(()=>{f=i,Bn.call(e,e.media,"volumechange")})}});let g,{loop:y}=e.config;Object.defineProperty(e.media,"loop",{get:()=>y,set(t){const i=yn.boolean(t)?t:e.config.loop.active;e.embed.setLoop(i).then(()=>{y=i})}}),e.embed.getVideoUrl().then(t=>{g=t,ys.setDownloadUrl.call(e)}).catch(e=>{this.debug.warn(e)}),Object.defineProperty(e.media,"currentSrc",{get:()=>g}),Object.defineProperty(e.media,"ended",{get:()=>e.currentTime===e.duration}),Promise.all([e.embed.getVideoWidth(),e.embed.getVideoHeight()]).then(t=>{const[i,n]=t;e.embed.ratio=is(i,n),ts.call(this)}),e.embed.setAutopause(e.config.autopause).then(t=>{e.config.autopause=t}),e.embed.getVideoTitle().then(t=>{e.config.title=t,Ns.setTitle.call(this)}),e.embed.getCurrentTime().then(t=>{d=t,Bn.call(e,e.media,"timeupdate")}),e.embed.getDuration().then(t=>{e.media.duration=t,Bn.call(e,e.media,"durationchange")}),e.embed.getTextTracks().then(t=>{e.media.textTracks=t,ws.setup.call(e)}),e.embed.on("cuechange",({cues:t=[]})=>{const i=t.map(e=>function(e){const t=document.createDocumentFragment(),i=document.createElement("div");return t.appendChild(i),i.innerHTML=e,t.firstChild.textContent}(e.text));ws.updateCues.call(e,i)}),e.embed.on("loaded",()=>{if(e.embed.getPaused().then(t=>{Ds.call(e,!t),t||Bn.call(e,e.media,"playing")}),yn.element(e.embed.element)&&e.supported.ui){e.embed.element.setAttribute("tabindex",-1)}}),e.embed.on("bufferstart",()=>{Bn.call(e,e.media,"waiting")}),e.embed.on("bufferend",()=>{Bn.call(e,e.media,"playing")}),e.embed.on("play",()=>{Ds.call(e,!0),Bn.call(e,e.media,"playing")}),e.embed.on("pause",()=>{Ds.call(e,!1)}),e.embed.on("timeupdate",t=>{e.media.seeking=!1,d=t.seconds,Bn.call(e,e.media,"timeupdate")}),e.embed.on("progress",t=>{e.media.buffered=t.percent,Bn.call(e,e.media,"progress"),1===Number.parseInt(t.percent,10)&&Bn.call(e,e.media,"canplaythrough"),e.embed.getDuration().then(t=>{t!==e.media.duration&&(e.media.duration=t,Bn.call(e,e.media,"durationchange"))})}),e.embed.on("seeked",()=>{e.media.seeking=!1,Bn.call(e,e.media,"seeked")}),e.embed.on("ended",()=>{e.media.paused=!0,Bn.call(e,e.media,"ended")}),e.embed.on("error",t=>{e.media.error=t,Bn.call(e,e.media,"error")}),t.customControls&&setTimeout(()=>Ns.build.call(e),0)}};function Hs(e){e&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===e&&(this.media.paused=!e,Bn.call(this,this.media,e?"play":"pause"))}function Fs(e){return e.noCookie?"https://www.youtube-nocookie.com":"http:"===window.location.protocol?"http://www.youtube.com":void 0}const Us={setup(){if(Nn(this.elements.wrapper,this.config.classNames.embed,!0),yn.object(window.YT)&&yn.function(window.YT.Player))Us.ready.call(this);else{const e=window.onYouTubeIframeAPIReady;window.onYouTubeIframeAPIReady=()=>{yn.function(e)&&e(),Us.ready.call(this)},Rs(this.config.urls.youtube.sdk).catch(e=>{this.debug.warn("YouTube API failed to load",e)})}},getTitle(e){ps(rs(this.config.urls.youtube.api,e)).then(e=>{if(yn.object(e)){const{title:t,height:i,width:n}=e;this.config.title=t,Ns.setTitle.call(this),this.embed.ratio=is(n,i)}ts.call(this)}).catch(()=>{ts.call(this)})},ready(){const e=this,t=e.config.youtube,i=e.media&&e.media.getAttribute("id");if(!yn.empty(i)&&i.startsWith("youtube-"))return;let n=e.media.getAttribute("src");yn.empty(n)&&(n=e.media.getAttribute(this.config.attributes.embed.id));const s=function(e){if(yn.empty(e))return null;const t=e.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/);return t&&t[2]?t[2]:e}(n);const r=Cn("div",{id:`${e.provider}-${Math.floor(1e4*Math.random())}`,"data-poster":t.customControls?e.poster:void 0});if(e.media=Mn(r,e.media),t.customControls){const t=e=>`https://i.ytimg.com/vi/${s}/${e}default.jpg`;xs(t("maxres"),121).catch(()=>xs(t("sd"),121)).catch(()=>xs(t("hq"))).then(t=>Ns.setPoster.call(e,t.src)).then(t=>{t.includes("maxres")||(e.elements.poster.style.backgroundSize="cover")}).catch(()=>{})}e.embed=new window.YT.Player(e.media,{videoId:s,host:Fs(t),playerVars:kn({},{autoplay:e.config.autoplay?1:0,hl:e.config.hl,controls:e.supported.ui&&t.customControls?0:1,disablekb:1,playsinline:e.config.playsinline&&!e.config.fullscreen.iosNative?1:0,cc_load_policy:e.captions.active?1:0,cc_lang_pref:e.config.captions.language,widget_referrer:window?window.location.href:null},t),events:{onError(t){if(!e.media.error){const 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 occurred";e.media.error={code:i,message:n},Bn.call(e,e.media,"error")}},onPlaybackRateChange(t){const i=t.target;e.media.playbackRate=i.getPlaybackRate(),Bn.call(e,e.media,"ratechange")},onReady(i){if(yn.function(e.media.play))return;const n=i.target;Us.getTitle.call(e,s),e.media.play=()=>{Hs.call(e,!0),n.playVideo()},e.media.pause=()=>{Hs.call(e,!1),n.pauseVideo()},e.media.stop=()=>{n.stopVideo()},e.media.duration=n.getDuration(),e.media.paused=!0,e.media.currentTime=0,Object.defineProperty(e.media,"currentTime",{get:()=>Number(n.getCurrentTime()),set(t){e.paused&&!e.embed.hasPlayed&&e.embed.mute(),e.media.seeking=!0,Bn.call(e,e.media,"seeking"),n.seekTo(t)}}),Object.defineProperty(e.media,"playbackRate",{get:()=>n.getPlaybackRate(),set(e){n.setPlaybackRate(e)}});let{volume:r}=e.config;Object.defineProperty(e.media,"volume",{get:()=>r,set(t){r=t,n.setVolume(100*r),Bn.call(e,e.media,"volumechange")}});let{muted:a}=e.config;Object.defineProperty(e.media,"muted",{get:()=>a,set(t){const i=yn.boolean(t)?t:a;a=i,n[i?"mute":"unMute"](),n.setVolume(100*r),Bn.call(e,e.media,"volumechange")}}),Object.defineProperty(e.media,"currentSrc",{get:()=>n.getVideoUrl()}),Object.defineProperty(e.media,"ended",{get:()=>e.currentTime===e.duration});const o=n.getAvailablePlaybackRates();e.options.speed=o.filter(t=>e.config.speed.options.includes(t)),e.supported.ui&&t.customControls&&e.media.setAttribute("tabindex",-1),Bn.call(e,e.media,"timeupdate"),Bn.call(e,e.media,"durationchange"),clearInterval(e.timers.buffering),e.timers.buffering=setInterval(()=>{e.media.buffered=n.getVideoLoadedFraction(),(null===e.media.lastBuffered||e.media.lastBuffered<e.media.buffered)&&Bn.call(e,e.media,"progress"),e.media.lastBuffered=e.media.buffered,1===e.media.buffered&&(clearInterval(e.timers.buffering),Bn.call(e,e.media,"canplaythrough"))},200),t.customControls&&setTimeout(()=>Ns.build.call(e),50)},onStateChange(i){const n=i.target;clearInterval(e.timers.playing);switch(e.media.seeking&&[1,2].includes(i.data)&&(e.media.seeking=!1,Bn.call(e,e.media,"seeked")),i.data){case-1:Bn.call(e,e.media,"timeupdate"),e.media.buffered=n.getVideoLoadedFraction(),Bn.call(e,e.media,"progress");break;case 0:Hs.call(e,!1),e.media.loop?(n.stopVideo(),n.playVideo()):Bn.call(e,e.media,"ended");break;case 1:t.customControls&&!e.config.autoplay&&e.media.paused&&!e.embed.hasPlayed?e.media.pause():(Hs.call(e,!0),Bn.call(e,e.media,"playing"),e.timers.playing=setInterval(()=>{Bn.call(e,e.media,"timeupdate")},50),e.media.duration!==n.getDuration()&&(e.media.duration=n.getDuration(),Bn.call(e,e.media,"durationchange")));break;case 2:e.muted||e.embed.unMute(),Hs.call(e,!1);break;case 3:Bn.call(e,e.media,"waiting")}Bn.call(e,e.elements.container,"statechange",!1,{code:i.data})}}})}},Vs={setup(){this.media?(Nn(this.elements.container,this.config.classNames.type.replace("{0}",this.type),!0),Nn(this.elements.container,this.config.classNames.provider.replace("{0}",this.provider),!0),this.isEmbed&&Nn(this.elements.container,this.config.classNames.type.replace("{0}","video"),!0),this.isVideo&&(this.elements.wrapper=Cn("div",{class:this.config.classNames.video}),Tn(this.media,this.elements.wrapper),this.elements.poster=Cn("div",{class:this.config.classNames.poster}),this.elements.wrapper.appendChild(this.elements.poster)),this.isHTML5?ns.setup.call(this):this.isYouTube?Us.setup.call(this):this.isVimeo&&qs.setup.call(this)):this.debug.warn("No media element found!")}};class Bs{constructor(t){e(this,"load",()=>{this.enabled&&(yn.object(window.google)&&yn.object(window.google.ima)?this.ready():Rs(this.player.config.urls.googleIMA.sdk).then(()=>{this.ready()}).catch(()=>{this.trigger("error",new Error("Google IMA SDK failed to load"))}))}),e(this,"ready",()=>{var e;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(()=>{this.clearSafetyTimer("onAdsManagerLoaded()")}),this.listeners(),this.setupIMA()}),e(this,"setupIMA",()=>{this.elements.container=Cn("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.loader=new google.ima.AdsLoader(this.elements.displayContainer),this.loader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,e=>this.onAdsManagerLoaded(e),!1),this.loader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,e=>this.onAdError(e),!1),this.requestAds()}),e(this,"requestAds",()=>{const{container:e}=this.player.elements;try{const t=new google.ima.AdsRequest;t.adTagUrl=this.tagUrl,t.linearAdSlotWidth=e.offsetWidth,t.linearAdSlotHeight=e.offsetHeight,t.nonLinearAdSlotWidth=e.offsetWidth,t.nonLinearAdSlotHeight=e.offsetHeight,t.forceNonLinearFullSlot=!1,t.setAdWillPlayMuted(!this.player.muted),this.loader.requestAds(t)}catch(e){this.onAdError(e)}}),e(this,"pollCountdown",(e=!1)=>{if(!e)return clearInterval(this.countdownTimer),void this.elements.container.removeAttribute("data-badge-text");this.countdownTimer=setInterval(()=>{const e=gs(Math.max(this.manager.getRemainingTime(),0)),t=`${hs.get("advertisement",this.player.config)} - ${e}`;this.elements.container.setAttribute("data-badge-text",t)},100)}),e(this,"onAdsManagerLoaded",e=>{if(!this.enabled)return;const t=new google.ima.AdsRenderingSettings;t.restoreCustomPlaybackStateOnAdBreakComplete=!0,t.enablePreloading=!0,this.manager=e.getAdsManager(this.player,t),this.cuePoints=this.manager.getCuePoints(),this.manager.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,e=>this.onAdError(e)),Object.keys(google.ima.AdEvent.Type).forEach(e=>{this.manager.addEventListener(google.ima.AdEvent.Type[e],e=>this.onAdEvent(e))}),this.trigger("loaded")}),e(this,"addCuePoints",()=>{yn.empty(this.cuePoints)||this.cuePoints.forEach(e=>{if(0!==e&&-1!==e&&e<this.player.duration){const t=this.player.elements.progress;if(yn.element(t)){const i=100/this.player.duration*e,n=Cn("span",{class:this.player.config.classNames.cues});n.style.left=`${i.toString()}%`,t.appendChild(n)}}})}),e(this,"onAdEvent",e=>{const{container:t}=this.player.elements,i=e.getAd(),n=e.getAdData();switch((e=>{Bn.call(this.player,this.player.media,`ads${e.replace(/_/g,"").toLowerCase()}`)})(e.type),e.type){case google.ima.AdEvent.Type.LOADED:this.trigger("loaded"),this.pollCountdown(!0),i.isLinear()||(i.width=t.offsetWidth,i.height=t.offsetHeight);break;case google.ima.AdEvent.Type.STARTED:this.manager.setVolume(this.player.volume);break;case google.ima.AdEvent.Type.ALL_ADS_COMPLETED:this.player.ended?this.loadAds():this.loader.contentComplete();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:n.adError&&this.player.debug.warn(`Non-fatal ad error: ${n.adError.getMessage()}`)}}),e(this,"onAdError",e=>{this.cancel(),this.player.debug.warn("Ads error",e)}),e(this,"listeners",()=>{const{container:e}=this.player.elements;let t;this.player.on("canplay",()=>{this.addCuePoints()}),this.player.on("ended",()=>{this.loader.contentComplete()}),this.player.on("timeupdate",()=>{t=this.player.currentTime}),this.player.on("seeked",()=>{const e=this.player.currentTime;yn.empty(this.cuePoints)||this.cuePoints.forEach((i,n)=>{t<i&&i<e&&(this.manager.discardAdBreak(),this.cuePoints.splice(n,1))})}),window.addEventListener("resize",()=>{this.manager&&this.manager.resize(e.offsetWidth,e.offsetHeight,google.ima.ViewMode.NORMAL)})}),e(this,"play",()=>{const{container:e}=this.player.elements;this.managerPromise||this.resumeContent(),this.managerPromise.then(()=>{this.manager.setVolume(this.player.volume),this.elements.displayContainer.initialize();try{this.initialized||(this.manager.init(e.offsetWidth,e.offsetHeight,google.ima.ViewMode.NORMAL),this.manager.start()),this.initialized=!0}catch(e){this.onAdError(e)}}).catch(()=>{})}),e(this,"resumeContent",()=>{this.elements.container.style.zIndex="",this.playing=!1,Kn(this.player.media.play())}),e(this,"pauseContent",()=>{this.elements.container.style.zIndex=3,this.playing=!0,this.player.media.pause()}),e(this,"cancel",()=>{this.initialized&&this.resumeContent(),this.trigger("error"),this.loadAds()}),e(this,"loadAds",()=>{this.managerPromise.then(()=>{this.manager&&this.manager.destroy(),this.managerPromise=new Promise(e=>{this.on("loaded",e),this.player.debug.log(this.manager)}),this.initialized=!1,this.requestAds()}).catch(()=>{})}),e(this,"trigger",(e,...t)=>{const i=this.events[e];yn.array(i)&&i.forEach(e=>{yn.function(e)&&e.apply(this,t)})}),e(this,"on",(e,t)=>(yn.array(this.events[e])||(this.events[e]=[]),this.events[e].push(t),this)),e(this,"startSafetyTimer",(e,t)=>{this.player.debug.log(`Safety timer invoked from: ${t}`),this.safetyTimer=setTimeout(()=>{this.cancel(),this.clearSafetyTimer("startSafetyTimer()")},e)}),e(this,"clearSafetyTimer",e=>{yn.nullOrUndefined(this.safetyTimer)||(this.player.debug.log(`Safety timer cleared from: ${e}`),clearTimeout(this.safetyTimer),this.safetyTimer=null)}),this.player=t,this.config=t.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((e,t)=>{this.on("loaded",e),this.on("error",t)}),this.load()}get enabled(){const{config:e}=this;return this.player.isHTML5&&this.player.isVideo&&e.enabled&&(!yn.empty(e.publisherId)||yn.url(e.tagUrl))}get tagUrl(){const{config:e}=this;if(yn.url(e.tagUrl))return e.tagUrl;return`https://go.aniview.com/api/adserver6/vast/?${vs({AV_PUBLISHERID:"58c25bb0073ef448b1087ad6",AV_CHANNELID:"5a0458dc28a06145e4519d21",AV_URL:window.location.hostname,cb:Date.now(),AV_WIDTH:640,AV_HEIGHT:480,AV_CDIM2:e.publisherId})}`}}function Ws(e=0,t=0,i=255){return Math.min(Math.max(e,t),i)}function zs(e){const t=[];return e.split(/\r\n\r\n|\n\n|\r\r/).forEach(e=>{const i={};e.split(/\r\n|\n|\r/).forEach(e=>{if(yn.number(i.startTime)){if(!yn.empty(e.trim())&&yn.empty(i.text)){const t=e.trim().split("#xywh=");[i.text]=t,t[1]&&([i.x,i.y,i.w,i.h]=t[1].split(","))}}else{const t=e.match(/(\d{2})?:?(\d{2}):(\d{2}).(\d{2,3})( ?--> ?)(\d{2})?:?(\d{2}):(\d{2}).(\d{2,3})/);t&&(i.startTime=60*Number(t[1]||0)*60+60*Number(t[2])+Number(t[3])+Number(`0.${t[4]}`),i.endTime=60*Number(t[6]||0)*60+60*Number(t[7])+Number(t[8])+Number(`0.${t[9]}`))}}),i.text&&t.push(i)}),t}function Ks(e,t){const i={};return e>t.width/t.height?(i.width=t.width,i.height=1/e*t.width):(i.height=t.height,i.width=e*t.height),i}class Ys{constructor(t){e(this,"load",()=>{this.player.elements.display.seekTooltip&&(this.player.elements.display.seekTooltip.hidden=this.enabled),this.enabled&&this.getThumbnails().then(()=>{this.enabled&&(this.render(),this.determineContainerAutoSizing(),this.listeners(),this.loaded=!0)})}),e(this,"getThumbnails",()=>new Promise(e=>{const{src:t}=this.player.config.previewThumbnails;if(yn.empty(t))throw new Error("Missing previewThumbnails.src config attribute");const i=()=>{this.thumbnails.sort((e,t)=>e.height-t.height),this.player.debug.log("Preview thumbnails",this.thumbnails),e()};if(yn.function(t))t(e=>{this.thumbnails=e,i()});else{const e=(yn.string(t)?[t]:t).map(e=>this.getThumbnail(e));Promise.all(e).then(i)}})),e(this,"getThumbnail",e=>new Promise(t=>{ps(e,void 0,this.player.config.previewThumbnails.withCredentials).then(i=>{const n={frames:zs(i),height:null,urlPrefix:""};n.frames[0].text.startsWith("/")||n.frames[0].text.startsWith("http://")||n.frames[0].text.startsWith("https://")||(n.urlPrefix=e.substring(0,e.lastIndexOf("/")+1));const s=new Image;s.onload=()=>{n.height=s.naturalHeight,n.width=s.naturalWidth,this.thumbnails.push(n),t()},s.src=n.urlPrefix+n.frames[0].text})})),e(this,"startMove",e=>{if(this.loaded&&yn.event(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,i;const n=this.player.elements.progress.getBoundingClientRect(),s=100/n.width*(e.pageX-n.left);this.seekTime=this.player.media.duration*(s/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.textContent=gs(this.seekTime);const r=null===(t=this.player.config.markers)||void 0===t||null===(i=t.points)||void 0===i?void 0:i.find(({time:e})=>e===Math.round(this.seekTime));r&&this.elements.thumb.time.insertAdjacentHTML("afterbegin",`${r.label}<br>`)}this.showImageAtCurrentTime()}}),e(this,"endMove",()=>{this.toggleThumbContainer(!1,!0)}),e(this,"startScrubbing",e=>{(yn.nullOrUndefined(e.button)||!1===e.button||0===e.button)&&(this.mouseDown=!0,this.player.media.duration&&(this.toggleScrubbingContainer(!0),this.toggleThumbContainer(!1,!0),this.showImageAtCurrentTime()))}),e(this,"endScrubbing",()=>{this.mouseDown=!1,Math.ceil(this.lastTime)===Math.ceil(this.player.media.currentTime)?this.toggleScrubbingContainer(!1):Vn.call(this.player,this.player.media,"timeupdate",()=>{this.mouseDown||this.toggleScrubbingContainer(!1)})}),e(this,"listeners",()=>{this.player.on("play",()=>{this.toggleThumbContainer(!1,!0)}),this.player.on("seeked",()=>{this.toggleThumbContainer(!1)}),this.player.on("timeupdate",()=>{this.lastTime=this.player.media.currentTime})}),e(this,"render",()=>{this.elements.thumb.container=Cn("div",{class:this.player.config.classNames.previewThumbnails.thumbContainer}),this.elements.thumb.imageContainer=Cn("div",{class:this.player.config.classNames.previewThumbnails.imageContainer}),this.elements.thumb.container.appendChild(this.elements.thumb.imageContainer);const e=Cn("div",{class:this.player.config.classNames.previewThumbnails.timeContainer});this.elements.thumb.time=Cn("span",{},"00:00"),e.appendChild(this.elements.thumb.time),this.elements.thumb.imageContainer.appendChild(e),yn.element(this.player.elements.progress)&&this.player.elements.progress.appendChild(this.elements.thumb.container),this.elements.scrubbing.container=Cn("div",{class:this.player.config.classNames.previewThumbnails.scrubbingContainer}),this.player.elements.wrapper.appendChild(this.elements.scrubbing.container)}),e(this,"destroy",()=>{this.elements.thumb.container&&this.elements.thumb.container.remove(),this.elements.scrubbing.container&&this.elements.scrubbing.container.remove()}),e(this,"showImageAtCurrentTime",()=>{this.mouseDown?this.setScrubbingContainerSize():this.setThumbContainerSizeAndPos();const e=this.thumbnails[0].frames.findIndex(e=>this.seekTime>=e.startTime&&this.seekTime<=e.endTime),t=e>=0;let i=0;this.mouseDown||this.toggleThumbContainer(t),t&&(this.thumbnails.forEach((t,n)=>{this.loadedImages.includes(t.frames[e].text)&&(i=n)}),e!==this.showingThumb&&(this.showingThumb=e,this.loadImage(i)))}),e(this,"loadImage",(e=0)=>{const t=this.showingThumb,i=this.thumbnails[e],{urlPrefix:n}=i,s=i.frames[t],r=i.frames[t].text,a=n+r;if(this.currentImageElement&&this.currentImageElement.dataset.filename===r)this.showImage(this.currentImageElement,s,e,t,r,!1),this.currentImageElement.dataset.index=t,this.removeOldImages(this.currentImageElement);else{this.loadingImage&&this.usingSprites&&(this.loadingImage.onload=null);const i=new Image;i.src=a,i.dataset.index=t,i.dataset.filename=r,this.showingThumbFilename=r,this.player.debug.log(`Loading image: ${a}`),i.onload=()=>this.showImage(i,s,e,t,r,!0),this.loadingImage=i,this.removeOldImages(i)}}),e(this,"showImage",(e,t,i,n,s,r=!0)=>{this.player.debug.log(`Showing thumb: ${s}. num: ${n}. qual: ${i}. newimg: ${r}`),this.setImageSizeAndOffset(e,t),r&&(this.currentImageContainer.appendChild(e),this.currentImageElement=e,this.loadedImages.includes(s)||this.loadedImages.push(s)),this.preloadNearby(n,!0).then(this.preloadNearby(n,!1)).then(this.getHigherQuality(i,e,t,s))}),e(this,"removeOldImages",e=>{Array.from(this.currentImageContainer.children).forEach(t=>{if("img"!==t.tagName.toLowerCase())return;const i=this.usingSprites?500:1e3;if(t.dataset.index!==e.dataset.index&&!t.dataset.deleting){t.dataset.deleting=!0;const{currentImageContainer:e}=this;setTimeout(()=>{e.removeChild(t),this.player.debug.log(`Removing thumb: ${t.dataset.filename}`)},i)}})}),e(this,"preloadNearby",(e,t=!0)=>new Promise(i=>{setTimeout(()=>{const n=this.thumbnails[0].frames[e].text;if(this.showingThumbFilename===n){let s;s=t?this.thumbnails[0].frames.slice(e):this.thumbnails[0].frames.slice(0,e).reverse();let r=!1;s.forEach(e=>{const t=e.text;if(t!==n&&!this.loadedImages.includes(t)){r=!0,this.player.debug.log(`Preloading thumb filename: ${t}`);const{urlPrefix:e}=this.thumbnails[0],n=e+t,s=new Image;s.src=n,s.onload=()=>{this.player.debug.log(`Preloaded thumb filename: ${t}`),this.loadedImages.includes(t)||this.loadedImages.push(t),i()}}}),r||i()}},300)})),e(this,"getHigherQuality",(e,t,i,n)=>{if(e<this.thumbnails.length-1){let s=t.naturalHeight;this.usingSprites&&(s=i.h),s<this.thumbContainerHeight&&setTimeout(()=>{this.showingThumbFilename===n&&(this.player.debug.log(`Showing higher quality thumb for: ${n}`),this.loadImage(e+1))},300)}}),e(this,"toggleThumbContainer",(e=!1,t=!1)=>{const i=this.player.config.classNames.previewThumbnails.thumbContainerShown;this.elements.thumb.container.classList.toggle(i,e),!e&&t&&(this.showingThumb=null,this.showingThumbFilename=null)}),e(this,"toggleScrubbingContainer",(e=!1)=>{const t=this.player.config.classNames.previewThumbnails.scrubbingContainerShown;this.elements.scrubbing.container.classList.toggle(t,e),e||(this.showingThumb=null,this.showingThumbFilename=null)}),e(this,"determineContainerAutoSizing",()=>{(this.elements.thumb.imageContainer.clientHeight>20||this.elements.thumb.imageContainer.clientWidth>20)&&(this.sizeSpecifiedInCSS=!0)}),e(this,"setThumbContainerSizeAndPos",()=>{const{imageContainer:e}=this.elements.thumb;if(this.sizeSpecifiedInCSS){if(e.clientHeight>20&&e.clientWidth<20){const t=Math.floor(e.clientHeight*this.thumbAspectRatio);e.style.width=`${t}px`}else if(e.clientHeight<20&&e.clientWidth>20){const t=Math.floor(e.clientWidth/this.thumbAspectRatio);e.style.height=`${t}px`}}else{const t=Math.floor(this.thumbContainerHeight*this.thumbAspectRatio);e.style.height=`${this.thumbContainerHeight}px`,e.style.width=`${t}px`}this.setThumbContainerPos()}),e(this,"setThumbContainerPos",()=>{const e=this.player.elements.progress.getBoundingClientRect(),t=this.player.elements.container.getBoundingClientRect(),{container:i}=this.elements.thumb,n=t.left-e.left+10,s=t.right-e.left-i.clientWidth-10,r=this.mousePosX-e.left-i.clientWidth/2,a=Ws(r,n,s);i.style.left=`${a}px`,i.style.setProperty("--preview-arrow-offset",r-a+"px")}),e(this,"setScrubbingContainerSize",()=>{const{width:e,height:t}=Ks(this.thumbAspectRatio,{width:this.player.media.clientWidth,height:this.player.media.clientHeight});this.elements.scrubbing.container.style.width=`${e}px`,this.elements.scrubbing.container.style.height=`${t}px`}),e(this,"setImageSizeAndOffset",(e,t)=>{if(!this.usingSprites)return;const i=this.thumbContainerHeight/t.h;e.style.height=e.naturalHeight*i+"px",e.style.width=e.naturalWidth*i+"px",e.style.left=`-${t.x*i}px`,e.style.top=`-${t.y*i}px`}),this.player=t,this.thumbnails=[],this.loaded=!1,this.lastMouseMoveTime=Date.now(),this.mouseDown=!1,this.loadedImages=[],this.elements={thumb:{},scrubbing:{}},this.load()}get enabled(){return this.player.isHTML5&&this.player.isVideo&&this.player.config.previewThumbnails.enabled}get currentImageContainer(){return this.mouseDown?this.elements.scrubbing.container:this.elements.thumb.imageContainer}get usingSprites(){return Object.keys(this.thumbnails[0].frames[0]).includes("w")}get thumbAspectRatio(){return this.usingSprites?this.thumbnails[0].frames[0].w/this.thumbnails[0].frames[0].h:this.thumbnails[0].width/this.thumbnails[0].height}get thumbContainerHeight(){if(this.mouseDown){const{height:e}=Ks(this.thumbAspectRatio,{width:this.player.media.clientWidth,height:this.player.media.clientHeight});return e}return this.sizeSpecifiedInCSS?this.elements.thumb.imageContainer.clientHeight:Math.floor(this.player.media.clientWidth/this.thumbAspectRatio/4)}get currentImageElement(){return this.mouseDown?this.currentScrubbingImageElement:this.currentThumbnailImageElement}set currentImageElement(e){this.mouseDown?this.currentScrubbingImageElement=e:this.currentThumbnailImageElement=e}}const Xs={insertElements(e,t){yn.string(t)?En(e,this.media,{src:t}):yn.array(t)&&t.forEach(t=>{En(e,this.media,t)})},change(e){wn(e,"sources.length")?(ns.cancelRequests.call(this),this.destroy(()=>{this.options.quality=[],Pn(this.media),this.media=null,yn.element(this.elements.container)&&this.elements.container.removeAttribute("class");const{sources:t,type:i}=e,[{provider:n=Cs.html5,src:s}]=t,r="html5"===n?i:"div",a="html5"===n?{}:{src:s};Object.assign(this,{provider:n,type:i,supported:Dn.check(i,n,this.config.playsinline),media:Cn(r,a)}),this.elements.container.appendChild(this.media),yn.boolean(e.autoplay)&&(this.config.autoplay=e.autoplay),this.isHTML5&&(this.config.crossorigin&&this.media.setAttribute("crossorigin",""),this.config.autoplay&&this.media.setAttribute("autoplay",""),yn.empty(e.poster)||(this.poster=e.poster),this.config.loop.active&&this.media.setAttribute("loop",""),this.config.muted&&this.media.setAttribute("muted",""),this.config.playsinline&&this.media.setAttribute("playsinline","")),Ns.addStyleHook.call(this),this.isHTML5&&Xs.insertElements.call(this,"source",t),this.config.title=e.title,Vs.setup.call(this),this.isHTML5&&Object.keys(e).includes("tracks")&&Xs.insertElements.call(this,"track",e.tracks),(this.isHTML5||this.isEmbed&&!this.supported.ui)&&Ns.build.call(this),this.isHTML5&&this.media.load(),yn.empty(e.previewThumbnails)||(Object.assign(this.config.previewThumbnails,e.previewThumbnails),this.previewThumbnails&&this.previewThumbnails.loaded&&(this.previewThumbnails.destroy(),this.previewThumbnails=null),this.config.previewThumbnails.enabled&&(this.previewThumbnails=new Ys(this))),this.fullscreen.update()},!0)):this.debug.warn("Invalid source format")}};class Qs{constructor(t,i){if(e(this,"play",()=>yn.function(this.media.play)?(this.ads&&this.ads.enabled&&this.ads.managerPromise.then(()=>this.ads.play()).catch(()=>Kn(this.media.play())),this.media.play()):null),e(this,"pause",()=>this.playing&&yn.function(this.media.pause)?this.media.pause():null),e(this,"togglePlay",e=>(yn.boolean(e)?e:!this.playing)?this.play():this.pause()),e(this,"stop",()=>{this.isHTML5?(this.pause(),this.restart()):yn.function(this.media.stop)&&this.media.stop()}),e(this,"restart",()=>{this.currentTime=0}),e(this,"rewind",e=>{this.currentTime-=yn.number(e)?e:this.config.seekTime}),e(this,"forward",e=>{this.currentTime+=yn.number(e)?e:this.config.seekTime}),e(this,"increaseVolume",e=>{const t=this.media.muted?0:this.volume;this.volume=t+(yn.number(e)?e:0)}),e(this,"decreaseVolume",e=>{this.increaseVolume(-e)}),e(this,"airplay",()=>{Dn.airplay&&this.media.webkitShowPlaybackTargetPicker()}),e(this,"toggleControls",e=>{if(this.supported.ui&&!this.isAudio){const t=Ln(this.elements.container,this.config.classNames.hideControls),i=void 0===e?void 0:!e,n=Nn(this.elements.container,this.config.classNames.hideControls,i);if(n&&yn.array(this.config.controls)&&this.config.controls.includes("settings")&&!yn.empty(this.config.settings)&&ys.toggleMenu.call(this,!1),n!==t){const e=n?"controlshidden":"controlsshown";Bn.call(this,this.media,e)}return!n}return!1}),e(this,"on",(e,t)=>{Fn.call(this,this.elements.container,e,t)}),e(this,"once",(e,t)=>{Vn.call(this,this.elements.container,e,t)}),e(this,"off",(e,t)=>{Un(this.elements.container,e,t)}),e(this,"destroy",(e,t=!1)=>{if(!this.ready)return;const i=()=>{document.body.style.overflow="",this.embed=null,t?(Object.keys(this.elements).length&&(Pn(this.elements.buttons.play),Pn(this.elements.captions),Pn(this.elements.controls),Pn(this.elements.wrapper),this.elements.buttons.play=null,this.elements.captions=null,this.elements.controls=null,this.elements.wrapper=null),yn.function(e)&&e()):(Wn.call(this),ns.cancelRequests.call(this),Mn(this.elements.original,this.elements.container),Bn.call(this,this.elements.original,"destroyed",!0),yn.function(e)&&e.call(this.elements.original),this.ready=!1,setTimeout(()=>{this.elements=null,this.media=null},200))};this.stop(),clearTimeout(this.timers.loading),clearTimeout(this.timers.controls),clearTimeout(this.timers.resized),this.isHTML5?(Ns.toggleNativeControls.call(this,!0),i()):this.isYouTube?(clearInterval(this.timers.buffering),clearInterval(this.timers.playing),null!==this.embed&&yn.function(this.embed.destroy)&&this.embed.destroy(),i()):this.isVimeo&&(null!==this.embed&&this.embed.unload().then(i),setTimeout(i,200))}),e(this,"supports",e=>Dn.mime.call(this,e)),this.timers={},this.ready=!1,this.loading=!1,this.failed=!1,this.touch=Dn.touch,this.media=t,yn.string(this.media)&&(this.media=document.querySelectorAll(this.media)),(window.jQuery&&this.media instanceof jQuery||yn.nodeList(this.media)||yn.array(this.media))&&(this.media=this.media[0]),this.config=kn({},ks,Qs.defaults,i||{},(()=>{try{return JSON.parse(this.media.getAttribute("data-plyr-config"))}catch{return{}}})()),this.elements={container:null,fullscreen: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 Ms(this.config.debug),this.debug.log("Config",this.config),this.debug.log("Support",Dn),yn.nullOrUndefined(this.media)||!yn.element(this.media))return void this.debug.error("Setup failed: no suitable element passed");if(this.media.plyr)return void this.debug.warn("Target already setup");if(!this.config.enabled)return void this.debug.error("Setup failed: disabled by config");if(!Dn.check().api)return void this.debug.error("Setup failed: no support");const n=this.media.cloneNode(!0);n.autoplay=!1,this.elements.original=n;const s=this.media.tagName.toLowerCase();let r=null,a=null;switch(s){case"div":if(r=this.media.querySelector("iframe"),yn.element(r)){if(a=bs(r.getAttribute("src")),this.provider=function(e){return/^(?:https?:\/\/)?(?:www\.)?(?:youtube\.com|youtube-nocookie\.com|youtu\.?be)\/.+$/.test(e)?Cs.youtube:/^https?:\/\/player.vimeo.com\/video\/\d{0,9}(?=\b|\/)/.test(e)?Cs.vimeo:null}(a.toString()),this.elements.container=this.media,this.media=r,this.elements.container.className="",a.search.length){const e=["1","true"];e.includes(a.searchParams.get("autoplay"))&&(this.config.autoplay=!0),e.includes(a.searchParams.get("loop"))&&(this.config.loop.active=!0),this.isYouTube?(this.config.playsinline=e.includes(a.searchParams.get("playsinline")),this.config.youtube.hl=a.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(yn.empty(this.provider)||!Object.values(Cs).includes(this.provider))return void this.debug.error("Setup failed: Invalid provider");this.type=Ps;break;case"video":case"audio":this.type=s,this.provider=Cs.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=Dn.check(this.type,this.provider),this.supported.api?(this.eventListeners=[],this.listeners=new Ls(this),this.storage=new ds(this),this.media.plyr=this,yn.element(this.elements.container)||(this.elements.container=Cn("div"),Tn(this.media,this.elements.container)),Ns.migrateStyles.call(this),Ns.addStyleHook.call(this),Vs.setup.call(this),this.config.debug&&Fn.call(this,this.elements.container,this.config.events.join(" "),e=>{this.debug.log(`event: ${e.type}`)}),this.fullscreen=new Os(this),(this.isHTML5||this.isEmbed&&!this.supported.ui)&&Ns.build.call(this),this.listeners.container(),this.listeners.global(),this.config.ads.enabled&&(this.ads=new Bs(this)),this.isHTML5&&this.config.autoplay&&this.once("canplay",()=>Kn(this.play())),this.lastSeekTime=0,this.config.previewThumbnails.enabled&&(this.previewThumbnails=new Ys(this))):this.debug.error("Setup failed: no support")}get isHTML5(){return this.provider===Cs.html5}get isEmbed(){return this.isYouTube||this.isVimeo}get isYouTube(){return this.provider===Cs.youtube}get isVimeo(){return this.provider===Cs.vimeo}get isVideo(){return this.type===Ps}get isAudio(){return this.type===Es}get playing(){return Boolean(this.ready&&!this.paused&&!this.ended)}get paused(){return Boolean(this.media.paused)}get stopped(){return Boolean(this.paused&&0===this.currentTime)}get ended(){return Boolean(this.media.ended)}set currentTime(e){if(!this.duration)return;const t=yn.number(e)&&e>0;this.media.currentTime=t?Math.min(e,this.duration):0,this.debug.log(`Seeking to ${this.currentTime} seconds`)}get currentTime(){return Number(this.media.currentTime)}get buffered(){const{buffered:e}=this.media;return yn.number(e)?e:e&&e.length&&this.duration>0?e.end(0)/this.duration:0}get seeking(){return Boolean(this.media.seeking)}get duration(){const e=Number.parseFloat(this.config.duration),t=(this.media||{}).duration,i=yn.number(t)&&t!==1/0?t:0;return e||i}set volume(e){let t=e;yn.string(t)&&(t=Number(t)),yn.number(t)||(t=this.storage.get("volume")),yn.number(t)||({volume:t}=this.config),t>1&&(t=1),t<0&&(t=0),this.config.volume=t,this.media.volume=t,!yn.empty(e)&&this.muted&&t>0&&(this.muted=!1)}get volume(){return Number(this.media.volume)}set muted(e){let t=e;yn.boolean(t)||(t=this.storage.get("muted")),yn.boolean(t)||(t=this.config.muted),this.config.muted=t,this.media.muted=t}get muted(){return Boolean(this.media.muted)}get hasAudio(){return!this.isHTML5||(!!this.isAudio||(Boolean(this.media.mozHasAudio)||Boolean(this.media.webkitAudioDecodedByteCount)||Boolean(this.media.audioTracks&&this.media.audioTracks.length)))}set speed(e){let t=null;yn.number(e)&&(t=e),yn.number(t)||(t=this.storage.get("speed")),yn.number(t)||(t=this.config.speed.selected);const{minimumSpeed:i,maximumSpeed:n}=this;t=Ws(t,i,n),this.config.speed.selected=t,setTimeout(()=>{this.media&&(this.media.playbackRate=t)},0)}get speed(){return Number(this.media.playbackRate)}get minimumSpeed(){return this.isYouTube?Math.min(...this.options.speed):this.isVimeo?.5:.0625}get maximumSpeed(){return this.isYouTube?Math.max(...this.options.speed):this.isVimeo?2:16}set quality(e){const t=this.config.quality,i=this.options.quality;if(!i.length)return;let n=[!yn.empty(e)&&Number(e),this.storage.get("quality"),t.selected,t.default].find(yn.number),s=!0;if(!i.includes(n)){const e=Xn(i,n);this.debug.warn(`Unsupported quality option: ${n}, using ${e} instead`),n=e,s=!1}t.selected=n,this.media.quality=n,s&&this.storage.set({quality:n})}get quality(){return this.media.quality}set loop(e){const t=yn.boolean(e)?e:this.config.loop.active;this.config.loop.active=t,this.media.loop=t}get loop(){return Boolean(this.media.loop)}set source(e){Xs.change.call(this,e)}get source(){return this.media.currentSrc}get download(){const{download:e}=this.config.urls;return yn.url(e)?e:this.source}set download(e){yn.url(e)&&(this.config.urls.download=e,ys.setDownloadUrl.call(this))}set poster(e){this.isVideo?Ns.setPoster.call(this,e,!1).catch(()=>{}):this.debug.warn("Poster can only be set for video")}get poster(){return this.isVideo?this.media.getAttribute("poster")||this.media.getAttribute("data-poster"):null}get ratio(){if(!this.isVideo)return null;const e=Zn(es.call(this));return yn.array(e)?e.join(":"):e}set ratio(e){this.isVideo?yn.string(e)&&Gn(e)?(this.config.ratio=Zn(e),ts.call(this)):this.debug.error(`Invalid aspect ratio specified (${e})`):this.debug.warn("Aspect ratio can only be set for video")}
vendor: 8,258 bytes, line 1
1set autoplay(e){this.config.autoplay=yn.boolean(e)?e:this.config.autoplay}get autoplay(){return Boolean(this.config.autoplay)}toggleCaptions(e){ws.toggle.call(this,e,!1)}set currentTrack(e){ws.set.call(this,e,!1),ws.setup.call(this)}get currentTrack(){const{toggled:e,currentTrack:t}=this.captions;return e?t:-1}set language(e){ws.setLanguage.call(this,e,!1)}get language(){return(ws.getCurrentTrack.call(this)||{}).language}set pip(e){if(!Dn.pip)return;const t=yn.boolean(e)?e:!this.pip;yn.function(this.media.webkitSetPresentationMode)&&this.media.webkitSetPresentationMode(t?Ts:Ss),yn.function(this.media.requestPictureInPicture)&&(!this.pip&&t?this.media.requestPictureInPicture():this.pip&&!t&&document.exitPictureInPicture())}get pip(){return Dn.pip?yn.empty(this.media.webkitPresentationMode)?this.media===document.pictureInPictureElement:this.media.webkitPresentationMode===Ts:null}setPreviewThumbnails(e){this.previewThumbnails&&this.previewThumbnails.loaded&&(this.previewThumbnails.destroy(),this.previewThumbnails=null),Object.assign(this.config.previewThumbnails,e),this.config.previewThumbnails.enabled&&(this.previewThumbnails=new Ys(this))}static supported(e,t){return Dn.check(e,t)}static loadSprite(e,t){return ms(e,t)}static setup(e,t={}){let i=null;return yn.string(e)?i=Array.from(document.querySelectorAll(e)):yn.nodeList(e)?i=Array.from(e):yn.array(e)&&(i=e.filter(yn.element)),yn.empty(i)?null:i.map(e=>new Qs(e,t))}}var Js;Qs.defaults=(Js=ks,JSON.parse(JSON.stringify(Js))),function(){if("undefined"!=typeof window)try{var e=new window.CustomEvent("test",{cancelable:!0});if(e.preventDefault(),!0!==e.defaultPrevented)throw new Error("Could not prevent default")}catch(e){var t=function(e,t){var i,n;return(t=t||{}).bubbles=!!t.bubbles,t.cancelable=!!t.cancelable,(i=document.createEvent("CustomEvent")).initCustomEvent(e,t.bubbles,t.cancelable,t.detail),n=i.preventDefault,i.preventDefault=function(){n.call(this);try{Object.defineProperty(this,"defaultPrevented",{get:function(){return!0}})}catch(e){this.defaultPrevented=!0}},i};t.prototype=window.Event.prototype,window.CustomEvent=t}}();var Gs,Zs={};return Gs||(Gs=1,function(e){var t=function(){try{return!!Symbol.iterator}catch(e){return!1}}(),i=function(e){var i={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return t&&(i[Symbol.iterator]=function(){return i}),i},n=function(e){return encodeURIComponent(e).replace(/%20/g,"+")},s=function(e){return decodeURIComponent(String(e).replace(/\+/g," "))};(function(){try{var t=e.URLSearchParams;return"a=1"===new t("?a=1").toString()&&"function"==typeof t.prototype.set&&"function"==typeof t.prototype.entries}catch(e){return!1}})()||function(){var s=function(e){Object.defineProperty(this,"_entries",{writable:!0,value:{}});var t=typeof e;if("undefined"===t);else if("string"===t)""!==e&&this._fromString(e);else if(e instanceof s){var i=this;e.forEach(function(e,t){i.append(t,e)})}else{if(null===e||"object"!==t)throw new TypeError("Unsupported input's type for URLSearchParams");if("[object Array]"===Object.prototype.toString.call(e))for(var n=0;n<e.length;n++){var r=e[n];if("[object Array]"!==Object.prototype.toString.call(r)&&2===r.length)throw new TypeError("Expected [string, any] as entry at index "+n+" of URLSearchParams's input");this.append(r[0],r[1])}else for(var a in e)e.hasOwnProperty(a)&&this.append(a,e[a])}},r=s.prototype;r.append=function(e,t){e in this._entries?this._entries[e].push(String(t)):this._entries[e]=[String(t)]},r.delete=function(e){delete this._entries[e]},r.get=function(e){return e in this._entries?this._entries[e][0]:null},r.getAll=function(e){return e in this._entries?this._entries[e].slice(0):[]},r.has=function(e){return e in this._entries},r.set=function(e,t){this._entries[e]=[String(t)]},r.forEach=function(e,t){var i;for(var n in this._entries)if(this._entries.hasOwnProperty(n)){i=this._entries[n];for(var s=0;s<i.length;s++)e.call(t,i[s],n,this)}},r.keys=function(){var e=[];return this.forEach(function(t,i){e.push(i)}),i(e)},r.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),i(e)},r.entries=function(){var e=[];return this.forEach(function(t,i){e.push([i,t])}),i(e)},t&&(r[Symbol.iterator]=r.entries),r.toString=function(){var e=[];return this.forEach(function(t,i){e.push(n(i)+"="+n(t))}),e.join("&")},Object.defineProperty(r,"size",{get:function(){return this._entries?Object.keys(this._entries).length:0}}),e.URLSearchParams=s}();var r=e.URLSearchParams.prototype;"function"!=typeof r.sort&&(r.sort=function(){var e=this,t=[];this.forEach(function(i,n){t.push([n,i]),e._entries||e.delete(n)}),t.sort(function(e,t){return e[0]<t[0]?-1:e[0]>t[0]?1:0}),e._entries&&(e._entries={});for(var i=0;i<t.length;i++)this.append(t[i][0],t[i][1])}),"function"!=typeof r._fromString&&Object.defineProperty(r,"_fromString",{enumerable:!1,configurable:!1,writable:!1,value:function(e){if(this._entries)this._entries={};else{var t=[];this.forEach(function(e,i){t.push(i)});for(var i=0;i<t.length;i++)this.delete(t[i])}var n,r=(e=e.replace(/^\?/,"")).split("&");for(i=0;i<r.length;i++)n=r[i].split("="),this.append(s(n[0]),n.length>1?s(n.slice(1).join("=")):"")}})}(void 0!==t?t:"undefined"!=typeof window?window:"undefined"!=typeof self?self:Zs),function(e){if(function(){try{var t=new e.URL("b","http://a");return t.pathname="c d","http://a/c%20d"===t.href&&t.searchParams}catch(e){return!1}}()||function(){var t=e.URL,i=function(t,i){"string"!=typeof t&&(t=String(t)),i&&"string"!=typeof i&&(i=String(i));var n,s=document;if(i&&(void 0===e.location||i!==e.location.href)){!!window.MSInputMethodContext&&!!document.documentMode&&(i=i.toLowerCase()),(n=(s=document.implementation.createHTMLDocument("")).createElement("base")).href=i,s.head.appendChild(n);try{if(0!==n.href.indexOf(i))throw new Error(n.href)}catch(e){throw new Error("URL unable to set base "+i+" due to "+e)}}var r=s.createElement("a");r.href=t,n&&(s.body.appendChild(r),r.href=r.href);var a=s.createElement("input");if(a.type="url",a.value=t,":"===r.protocol||!/:/.test(r.href)||!a.checkValidity()&&!i)throw new TypeError("Invalid URL");Object.defineProperty(this,"_anchorElement",{value:r});var o=new e.URLSearchParams(this.search),l=!0,c=!0,u=this;["append","delete","set"].forEach(function(e){var t=o[e];o[e]=function(){t.apply(o,arguments),l&&(c=!1,u.search=o.toString(),c=!0)}}),Object.defineProperty(this,"searchParams",{value:o,enumerable:!0});var h=void 0;Object.defineProperty(this,"_updateSearchParams",{enumerable:!1,configurable:!1,writable:!1,value:function(){this.search!==h&&(h=this.search,c&&(l=!1,this.searchParams._fromString(this.search),l=!0))}})},n=i.prototype;["hash","host","hostname","port","protocol"].forEach(function(e){!function(e){Object.defineProperty(n,e,{get:function(){return this._anchorElement[e]},set:function(t){this._anchorElement[e]=t},enumerable:!0})}(e)}),Object.defineProperty(n,"search",{get:function(){return this._anchorElement.search},set:function(e){this._anchorElement.search=e,this._updateSearchParams()},enumerable:!0}),Object.defineProperties(n,{toString:{get:function(){var e=this;return function(){return e.href}}},href:{get:function(){return this._anchorElement.href.replace(/\?$/,"")},set:function(e){this._anchorElement.href=e,this._updateSearchParams()},enumerable:!0},pathname:{get:function(){return this._anchorElement.pathname.replace(/(^\/?)/,"/")},set:function(e){this._anchorElement.pathname=e},enumerable:!0},origin:{get:function(){var e={"http:":80,"https:":443,"ftp:":21}[this._anchorElement.protocol],t=this._anchorElement.port!=e&&""!==this._anchorElement.port;return this._anchorElement.protocol+"//"+this._anchorElement.hostname+(t?":"+this._anchorElement.port:"")},enumerable:!0},password:{get:function(){return""},set:function(e){},enumerable:!0},username:{get:function(){return""},set:function(e){},enumerable:!0}}),i.createObjectURL=function(e){return t.createObjectURL.apply(t,arguments)},i.revokeObjectURL=function(e){return t.revokeObjectURL.apply(t,arguments)},e.URL=i}(),void 0!==e.location&&!("origin"in e.location)){var t=function(){return e.location.protocol+"//"+e.location.hostname+(e.location.port?":"+e.location.port:"")};try{Object.defineProperty(e.location,"origin",{get:t,enumerable:!0})}
1catch(i){setInterval(function(){e.location.origin=t()},100)}}}(void 0!==t?t:"undefined"!=typeof window?window:"undefined"!=typeof self?self:Zs)),Qs}); 2//# sourceMappingURL=plyr.polyfilled.min.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.