3 lines
148 KiB
JavaScript
3 lines
148 KiB
JavaScript
"object"==typeof navigator&&function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define("Plyr",t):e.Plyr=t()}(this,function(){"use strict";!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 n,i;return t=t||{bubbles:!1,cancelable:!1,detail:void 0},(n=document.createEvent("CustomEvent")).initCustomEvent(e,t.bubbles,t.cancelable,t.detail),i=n.preventDefault,n.preventDefault=function(){i.call(this);try{Object.defineProperty(this,"defaultPrevented",{get:function(){return!0}})}catch(e){this.defaultPrevented=!0}},n};t.prototype=window.Event.prototype,window.CustomEvent=t}}();var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function t(e,t){return e(t={exports:{}},t.exports),t.exports}!function(e){var t=function(){try{return!!Symbol.iterator}catch(e){return!1}}(),n=function(e){var n={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return t&&(n[Symbol.iterator]=function(){return n}),n},i=function(e){return encodeURIComponent(e).replace(/%20/g,"+")},r=function(e){return decodeURIComponent(e).replace(/\+/g," ")};"URLSearchParams"in e&&"a=1"===new URLSearchParams("?a=1").toString()||function(){var r=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 r){var n=this;e.forEach(function(e,t){n.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 i=0;i<e.length;i++){var a=e[i];if("[object Array]"!==Object.prototype.toString.call(a)&&2===a.length)throw new TypeError("Expected [string, any] as entry at index "+i+" of URLSearchParams's input");this.append(a[0],a[1])}else for(var o in e)e.hasOwnProperty(o)&&this.append(o,e[o])}},a=r.prototype;a.append=function(e,t){e in this._entries?this._entries[e].push(String(t)):this._entries[e]=[String(t)]},a.delete=function(e){delete this._entries[e]},a.get=function(e){return e in this._entries?this._entries[e][0]:null},a.getAll=function(e){return e in this._entries?this._entries[e].slice(0):[]},a.has=function(e){return e in this._entries},a.set=function(e,t){this._entries[e]=[String(t)]},a.forEach=function(e,t){var n;for(var i in this._entries)if(this._entries.hasOwnProperty(i)){n=this._entries[i];for(var r=0;r<n.length;r++)e.call(t,n[r],i,this)}},a.keys=function(){var e=[];return this.forEach(function(t,n){e.push(n)}),n(e)},a.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),n(e)},a.entries=function(){var e=[];return this.forEach(function(t,n){e.push([n,t])}),n(e)},t&&(a[Symbol.iterator]=a.entries),a.toString=function(){var e=[];return this.forEach(function(t,n){e.push(i(n)+"="+i(t))}),e.join("&")},e.URLSearchParams=r}();var a=URLSearchParams.prototype;"function"!=typeof a.sort&&(a.sort=function(){var e=this,t=[];this.forEach(function(n,i){t.push([i,n]),e._entries||e.delete(i)}),t.sort(function(e,t){return e[0]<t[0]?-1:e[0]>t[0]?1:0}),e._entries&&(e._entries={});for(var n=0;n<t.length;n++)this.append(t[n][0],t[n][1])}),"function"!=typeof a._fromString&&Object.defineProperty(a,"_fromString",{enumerable:!1,configurable:!1,writable:!1,value:function(e){if(this._entries)this._entries={};else{var t=[];this.forEach(function(e,n){t.push(n)});for(var n=0;n<t.length;n++)this.delete(t[n])}var i,a=(e=e.replace(/^\?/,"")).split("&");for(n=0;n<a.length;n++)i=a[n].split("="),this.append(r(i[0]),i.length>1?r(i[1]):"")}})}(void 0!==e?e:"undefined"!=typeof window?window:"undefined"!=typeof self?self:e),function(e){if(function(){try{var e=new URL("b","http://a");return e.pathname="c%20d","http://a/c%20d"===e.href&&e.searchParams}catch(e){return!1}}()||function(){var t=e.URL,n=function(t,n){"string"!=typeof t&&(t=String(t));var i,r=document;if(n&&(void 0===e.location||n!==e.location.href)){(i=(r=document.implementation.createHTMLDocument("")).createElement("base")).href=n,r.head.appendChild(i);try{if(0!==i.href.indexOf(n))throw new Error(i.href)}catch(e){throw new Error("URL unable to set base "+n+" due to "+e)}}var a=r.createElement("a");if(a.href=t,i&&(r.body.appendChild(a),a.href=a.href),":"===a.protocol||!/:/.test(a.href))throw new TypeError("Invalid URL");Object.defineProperty(this,"_anchorElement",{value:a});var o=new URLSearchParams(this.search),s=!0,l=!0,c=this;["append","delete","set"].forEach(function(e){var t=o[e];o[e]=function(){t.apply(o,arguments),s&&(l=!1,c.search=o.toString(),l=!0)}}),Object.defineProperty(this,"searchParams",{value:o,enumerable:!0});var u=void 0;Object.defineProperty(this,"_updateSearchParams",{enumerable:!1,configurable:!1,writable:!1,value:function(){this.search!==u&&(u=this.search,l&&(s=!1,this.searchParams._fromString(this.search),s=!0))}})},i=n.prototype;["hash","host","hostname","port","protocol"].forEach(function(e){!function(e){Object.defineProperty(i,e,{get:function(){return this._anchorElement[e]},set:function(t){this._anchorElement[e]=t},enumerable:!0})}(e)}),Object.defineProperty(i,"search",{get:function(){return this._anchorElement.search},set:function(e){this._anchorElement.search=e,this._updateSearchParams()},enumerable:!0}),Object.defineProperties(i,{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}}),n.createObjectURL=function(e){return t.createObjectURL.apply(t,arguments)},n.revokeObjectURL=function(e){return t.revokeObjectURL.apply(t,arguments)},e.URL=n}(),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})}catch(n){setInterval(function(){e.location.origin=t()},100)}}}(void 0!==e?e:"undefined"!=typeof window?window:"undefined"!=typeof self?self:e);var n=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e},i=function(e,t,i){if(n(e),void 0===t)return e;switch(i){case 1:return function(n){return e.call(t,n)};case 2:return function(n,i){return e.call(t,n,i)};case 3:return function(n,i,r){return e.call(t,n,i,r)}}return function(){return e.apply(t,arguments)}},r=t(function(e){var t=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=t)}),a=t(function(e){var t=e.exports={version:"2.6.1"};"number"==typeof __e&&(__e=t)}),o=(a.version,function(e){return"object"==typeof e?null!==e:"function"==typeof e}),s=function(e){if(!o(e))throw TypeError(e+" is not an object!");return e},l=function(e){try{return!!e()}catch(e){return!0}},c=!l(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),u=r.document,h=o(u)&&o(u.createElement),d=function(e){return h?u.createElement(e):{}},f=!c&&!l(function(){return 7!=Object.defineProperty(d("div"),"a",{get:function(){return 7}}).a}),p=function(e,t){if(!o(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!o(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!o(i=n.call(e)))return i;if(!t&&"function"==typeof(n=e.toString)&&!o(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")},m=Object.defineProperty,g={f:c?Object.defineProperty:function(e,t,n){if(s(e),t=p(t,!0),s(n),f)try{return m(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},y=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},v=c?function(e,t,n){return g.f(e,t,y(1,n))}:function(e,t,n){return e[t]=n,e},b={}.hasOwnProperty,w=function(e,t){return b.call(e,t)},k=0,T=Math.random(),E=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++k+T).toString(36))},S=t(function(e){var t=E("src"),n=Function.toString,i=(""+n).split("toString");a.inspectSource=function(e){return n.call(e)},(e.exports=function(e,n,a,o){var s="function"==typeof a;s&&(w(a,"name")||v(a,"name",n)),e[n]!==a&&(s&&(w(a,t)||v(a,t,e[n]?""+e[n]:i.join(String(n)))),e===r?e[n]=a:o?e[n]?e[n]=a:v(e,n,a):(delete e[n],v(e,n,a)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[t]||n.call(this)})}),A=function(e,t,n){var o,s,l,c,u=e&A.F,h=e&A.G,d=e&A.S,f=e&A.P,p=e&A.B,m=h?r:d?r[t]||(r[t]={}):(r[t]||{}).prototype,g=h?a:a[t]||(a[t]={}),y=g.prototype||(g.prototype={});for(o in h&&(n=t),n)l=((s=!u&&m&&void 0!==m[o])?m:n)[o],c=p&&s?i(l,r):f&&"function"==typeof l?i(Function.call,l):l,m&&S(m,o,l,e&A.U),g[o]!=l&&v(g,o,c),f&&y[o]!=l&&(y[o]=l)};r.core=a,A.F=1,A.G=2,A.S=4,A.P=8,A.B=16,A.W=32,A.U=64,A.R=128;var C=A,P=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e},_=function(e){return Object(P(e))},x=function(e,t,n,i){try{return i?t(s(n)[0],n[1]):t(n)}catch(t){var r=e.return;throw void 0!==r&&s(r.call(e)),t}},I={},N=t(function(e){var t=r["__core-js_shared__"]||(r["__core-js_shared__"]={});(e.exports=function(e,n){return t[e]||(t[e]=void 0!==n?n:{})})("versions",[]).push({version:a.version,mode:"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})}),M=t(function(e){var t=N("wks"),n=r.Symbol,i="function"==typeof n;(e.exports=function(e){return t[e]||(t[e]=i&&n[e]||(i?n:E)("Symbol."+e))}).store=t}),O=M("iterator"),L=Array.prototype,j=function(e){return void 0!==e&&(I.Array===e||L[O]===e)},R=Math.ceil,D=Math.floor,F=function(e){return isNaN(e=+e)?0:(e>0?D:R)(e)},q=Math.min,H=function(e){return e>0?q(F(e),9007199254740991):0},V=function(e,t,n){t in e?g.f(e,t,y(0,n)):e[t]=n},B={}.toString,U=function(e){return B.call(e).slice(8,-1)},W=M("toStringTag"),z="Arguments"==U(function(){return arguments}()),K=function(e){var t,n,i;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),W))?n:z?U(t):"Object"==(i=U(t))&&"function"==typeof t.callee?"Arguments":i},Y=M("iterator"),G=a.getIteratorMethod=function(e){if(null!=e)return e[Y]||e["@@iterator"]||I[K(e)]},J=M("iterator"),$=!1;try{[7][J]().return=function(){$=!0}}catch(e){}var Q=function(e,t){if(!t&&!$)return!1;var n=!1;try{var i=[7],r=i[J]();r.next=function(){return{done:n=!0}},i[J]=function(){return r},e(i)}catch(e){}return n};C(C.S+C.F*!Q(function(e){}),"Array",{from:function(e){var t,n,r,a,o=_(e),s="function"==typeof this?this:Array,l=arguments.length,c=l>1?arguments[1]:void 0,u=void 0!==c,h=0,d=G(o);if(u&&(c=i(c,l>2?arguments[2]:void 0,2)),null==d||s==Array&&j(d))for(n=new s(t=H(o.length));t>h;h++)V(n,h,u?c(o[h],h):o[h]);else for(a=d.call(o),n=new s;!(r=a.next()).done;h++)V(n,h,u?x(a,c,[r.value,h],!0):r.value);return n.length=h,n}});var X=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==U(e)?e.split(""):Object(e)},Z=Array.isArray||function(e){return"Array"==U(e)},ee=M("species"),te=function(e,t){return new(function(e){var t;return Z(e)&&("function"!=typeof(t=e.constructor)||t!==Array&&!Z(t.prototype)||(t=void 0),o(t)&&null===(t=t[ee])&&(t=void 0)),void 0===t?Array:t}(e))(t)},ne=function(e,t){var n=1==e,r=2==e,a=3==e,o=4==e,s=6==e,l=5==e||s,c=t||te;return function(t,u,h){for(var d,f,p=_(t),m=X(p),g=i(u,h,3),y=H(m.length),v=0,b=n?c(t,y):r?c(t,0):void 0;y>v;v++)if((l||v in m)&&(f=g(d=m[v],v,p),e))if(n)b[v]=f;else if(f)switch(e){case 3:return!0;case 5:return d;case 6:return v;case 2:b.push(d)}else if(o)return!1;return s?-1:a||o?o:b}},ie=M("unscopables"),re=Array.prototype;null==re[ie]&&v(re,ie,{});var ae=function(e){re[ie][e]=!0},oe=ne(5),se=!0;"find"in[]&&Array(1).find(function(){se=!1}),C(C.P+C.F*se,"Array",{find:function(e){return oe(this,e,arguments.length>1?arguments[1]:void 0)}}),ae("find");var le={f:{}.propertyIsEnumerable},ce=function(e){return X(P(e))},ue=Object.getOwnPropertyDescriptor,he={f:c?ue:function(e,t){if(e=ce(e),t=p(t,!0),f)try{return ue(e,t)}catch(e){}if(w(e,t))return y(!le.f.call(e,t),e[t])}},de=function(e,t){if(s(e),!o(t)&&null!==t)throw TypeError(t+": can't set as prototype!")},fe={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,n){try{(n=i(Function.call,he.f(Object.prototype,"__proto__").set,2))(e,[]),t=!(e instanceof Array)}catch(e){t=!0}return function(e,i){return de(e,i),t?e.__proto__=i:n(e,i),e}}({},!1):void 0),check:de}.set,pe=function(e,t,n){var i,r=t.constructor;return r!==n&&"function"==typeof r&&(i=r.prototype)!==n.prototype&&o(i)&&fe&&fe(e,i),e},me=Math.max,ge=Math.min,ye=function(e){return function(t,n,i){var r,a=ce(t),o=H(a.length),s=function(e,t){return(e=F(e))<0?me(e+t,0):ge(e,t)}(i,o);if(e&&n!=n){for(;o>s;)if((r=a[s++])!=r)return!0}else for(;o>s;s++)if((e||s in a)&&a[s]===n)return e||s||0;return!e&&-1}},ve=N("keys"),be=function(e){return ve[e]||(ve[e]=E(e))},we=ye(!1),ke=be("IE_PROTO"),Te=function(e,t){var n,i=ce(e),r=0,a=[];for(n in i)n!=ke&&w(i,n)&&a.push(n);for(;t.length>r;)w(i,n=t[r++])&&(~we(a,n)||a.push(n));return a},Ee="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),Se=Ee.concat("length","prototype"),Ae={f:Object.getOwnPropertyNames||function(e){return Te(e,Se)}},Ce="\t\n\v\f\r \u2028\u2029\ufeff",Pe="["+Ce+"]",_e=RegExp("^"+Pe+Pe+"*"),xe=RegExp(Pe+Pe+"*$"),Ie=function(e,t,n){var i={},r=l(function(){return!!Ce[e]()||"
"!="
"[e]()}),a=i[e]=r?t(Ne):Ce[e];n&&(i[n]=a),C(C.P+C.F*r,"String",i)},Ne=Ie.trim=function(e,t){return e=String(P(e)),1&t&&(e=e.replace(_e,"")),2&t&&(e=e.replace(xe,"")),e},Me=Ie,Oe=Object.keys||function(e){return Te(e,Ee)},Le=c?Object.defineProperties:function(e,t){s(e);for(var n,i=Oe(t),r=i.length,a=0;r>a;)g.f(e,n=i[a++],t[n]);return e},je=r.document,Re=je&&je.documentElement,De=be("IE_PROTO"),Fe=function(){},qe=function(){var e,t=d("iframe"),n=Ee.length;for(t.style.display="none",Re.appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),qe=e.F;n--;)delete qe.prototype[Ee[n]];return qe()},He=Object.create||function(e,t){var n;return null!==e?(Fe.prototype=s(e),n=new Fe,Fe.prototype=null,n[De]=e):n=qe(),void 0===t?n:Le(n,t)},Ve=Ae.f,Be=he.f,Ue=g.f,We=Me.trim,ze=r.Number,Ke=ze,Ye=ze.prototype,Ge="Number"==U(He(Ye)),Je="trim"in String.prototype,$e=function(e){var t=p(e,!1);if("string"==typeof t&&t.length>2){var n,i,r,a=(t=Je?t.trim():We(t,3)).charCodeAt(0);if(43===a||45===a){if(88===(n=t.charCodeAt(2))||120===n)return NaN}else if(48===a){switch(t.charCodeAt(1)){case 66:case 98:i=2,r=49;break;case 79:case 111:i=8,r=55;break;default:return+t}for(var o,s=t.slice(2),l=0,c=s.length;l<c;l++)if((o=s.charCodeAt(l))<48||o>r)return NaN;return parseInt(s,i)}}return+t};if(!ze(" 0o1")||!ze("0b1")||ze("+0x1")){ze=function(e){var t=arguments.length<1?0:e,n=this;return n instanceof ze&&(Ge?l(function(){Ye.valueOf.call(n)}):"Number"!=U(n))?pe(new Ke($e(t)),n,ze):$e(t)};for(var Qe,Xe=c?Ve(Ke):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),Ze=0;Xe.length>Ze;Ze++)w(Ke,Qe=Xe[Ze])&&!w(ze,Qe)&&Ue(ze,Qe,Be(Ke,Qe));ze.prototype=Ye,Ye.constructor=ze,S(r,"Number",ze)}!function(e,t){var n=(a.Object||{})[e]||Object[e],i={};i[e]=t(n),C(C.S+C.F*l(function(){n(1)}),"Object",i)}("keys",function(){return function(e){return Oe(_(e))}});var et=M("match"),tt=function(e){var t;return o(e)&&(void 0!==(t=e[et])?!!t:"RegExp"==U(e))},nt=function(e,t,n){if(tt(t))throw TypeError("String#"+n+" doesn't accept regex!");return String(P(e))},it=M("match"),rt=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[it]=!1,!"/./"[e](t)}catch(e){}}return!0};C(C.P+C.F*rt("includes"),"String",{includes:function(e){return!!~nt(this,e,"includes").indexOf(e,arguments.length>1?arguments[1]:void 0)}});var at=ye(!0);C(C.P,"Array",{includes:function(e){return at(this,e,arguments.length>1?arguments[1]:void 0)}}),ae("includes");var ot=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t},st=RegExp.prototype.exec,lt=function(e,t){var n=e.exec;if("function"==typeof n){var i=n.call(e,t);if("object"!=typeof i)throw new TypeError("RegExp exec method returned something other than an Object or null");return i}if("RegExp"!==K(e))throw new TypeError("RegExp#exec called on incompatible receiver");return st.call(e,t)},ct=function(){var e=s(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t},ut=RegExp.prototype.exec,ht=String.prototype.replace,dt=ut,ft=function(){var e=/a/,t=/b*/g;return ut.call(e,"a"),ut.call(t,"a"),0!==e.lastIndex||0!==t.lastIndex}(),pt=void 0!==/()??/.exec("")[1];(ft||pt)&&(dt=function(e){var t,n,i,r,a=this;return pt&&(n=new RegExp("^"+a.source+"$(?!\\s)",ct.call(a))),ft&&(t=a.lastIndex),i=ut.call(a,e),ft&&i&&(a.lastIndex=a.global?i.index+i[0].length:t),pt&&i&&i.length>1&&ht.call(i[0],n,function(){for(r=1;r<arguments.length-2;r++)void 0===arguments[r]&&(i[r]=void 0)}),i});var mt=dt;C({target:"RegExp",proto:!0,forced:mt!==/./.exec},{exec:mt});var gt=M("species"),yt=!l(function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}),vt=function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2===n.length&&"a"===n[0]&&"b"===n[1]}(),bt=function(e,t,n){var i=M(e),r=!l(function(){var t={};return t[i]=function(){return 7},7!=""[e](t)}),a=r?!l(function(){var t=!1,n=/a/;return n.exec=function(){return t=!0,null},"split"===e&&(n.constructor={},n.constructor[gt]=function(){return n}),n[i](""),!t}):void 0;if(!r||!a||"replace"===e&&!yt||"split"===e&&!vt){var o=/./[i],s=n(P,i,""[e],function(e,t,n,i,a){return t.exec===mt?r&&!a?{done:!0,value:o.call(t,n,i)}:{done:!0,value:e.call(n,t,i)}:{done:!1}}),c=s[0],u=s[1];S(String.prototype,e,c),v(RegExp.prototype,i,2==t?function(e,t){return u.call(e,this,t)}:function(e){return u.call(e,this)})}};bt("search",1,function(e,t,n,i){return[function(n){var i=e(this),r=null==n?void 0:n[t];return void 0!==r?r.call(n,i):new RegExp(n)[t](String(i))},function(e){var t=i(n,e,this);if(t.done)return t.value;var r=s(e),a=String(this),o=r.lastIndex;ot(o,0)||(r.lastIndex=0);var l=lt(r,a);return ot(r.lastIndex,o)||(r.lastIndex=o),null===l?-1:l.index}]}),c&&"g"!=/./g.flags&&g.f(RegExp.prototype,"flags",{configurable:!0,get:ct});var wt=/./.toString,kt=function(e){S(RegExp.prototype,"toString",e,!0)};l(function(){return"/a/b"!=wt.call({source:"a",flags:"b"})})?kt(function(){var e=s(this);return"/".concat(e.source,"/","flags"in e?e.flags:!c&&e instanceof RegExp?ct.call(e):void 0)}):"toString"!=wt.name&&kt(function(){return wt.call(this)});var Tt=function(e,t){return{value:t,done:!!e}},Et=g.f,St=M("toStringTag"),At=function(e,t,n){e&&!w(e=n?e:e.prototype,St)&&Et(e,St,{configurable:!0,value:t})},Ct={};v(Ct,M("iterator"),function(){return this});var Pt=function(e,t,n){e.prototype=He(Ct,{next:y(1,n)}),At(e,t+" Iterator")},_t=be("IE_PROTO"),xt=Object.prototype,It=Object.getPrototypeOf||function(e){return e=_(e),w(e,_t)?e[_t]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?xt:null},Nt=M("iterator"),Mt=!([].keys&&"next"in[].keys()),Ot=function(){return this},Lt=function(e,t,n,i,r,a,o){Pt(n,t,i);var s,l,c,u=function(e){if(!Mt&&e in p)return p[e];switch(e){case"keys":case"values":return function(){return new n(this,e)}}return function(){return new n(this,e)}},h=t+" Iterator",d="values"==r,f=!1,p=e.prototype,m=p[Nt]||p["@@iterator"]||r&&p[r],g=m||u(r),y=r?d?u("entries"):g:void 0,b="Array"==t&&p.entries||m;if(b&&(c=It(b.call(new e)))!==Object.prototype&&c.next&&(At(c,h,!0),"function"!=typeof c[Nt]&&v(c,Nt,Ot)),d&&m&&"values"!==m.name&&(f=!0,g=function(){return m.call(this)}),(Mt||f||!p[Nt])&&v(p,Nt,g),I[t]=g,I[h]=Ot,r)if(s={values:d?g:u("values"),keys:a?g:u("keys"),entries:y},o)for(l in s)l in p||S(p,l,s[l]);else C(C.P+C.F*(Mt||f),t,s);return s},jt=Lt(Array,"Array",function(e,t){this._t=ce(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,Tt(1)):Tt(0,"keys"==t?n:"values"==t?e[n]:[n,e[n]])},"values");I.Arguments=I.Array,ae("keys"),ae("values"),ae("entries");for(var Rt=M("iterator"),Dt=M("toStringTag"),Ft=I.Array,qt={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},Ht=Oe(qt),Vt=0;Vt<Ht.length;Vt++){var Bt,Ut=Ht[Vt],Wt=qt[Ut],zt=r[Ut],Kt=zt&&zt.prototype;if(Kt&&(Kt[Rt]||v(Kt,Rt,Ft),Kt[Dt]||v(Kt,Dt,Ut),I[Ut]=Ft,Wt))for(Bt in jt)Kt[Bt]||S(Kt,Bt,jt[Bt],!0)}var Yt=function(e){return function(t,n){var i,r,a=String(P(t)),o=F(n),s=a.length;return o<0||o>=s?e?"":void 0:(i=a.charCodeAt(o))<55296||i>56319||o+1===s||(r=a.charCodeAt(o+1))<56320||r>57343?e?a.charAt(o):i:e?a.slice(o,o+2):r-56320+(i-55296<<10)+65536}},Gt=Yt(!0);Lt(String,"String",function(e){this._t=String(e),this._i=0},function(){var e,t=this._t,n=this._i;return n>=t.length?{value:void 0,done:!0}:(e=Gt(t,n),this._i+=e.length,{value:e,done:!1})});var Jt=t(function(e){var t=E("meta"),n=g.f,i=0,r=Object.isExtensible||function(){return!0},a=!l(function(){return r(Object.preventExtensions({}))}),s=function(e){n(e,t,{value:{i:"O"+ ++i,w:{}}})},c=e.exports={KEY:t,NEED:!1,fastKey:function(e,n){if(!o(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!w(e,t)){if(!r(e))return"F";if(!n)return"E";s(e)}return e[t].i},getWeak:function(e,n){if(!w(e,t)){if(!r(e))return!0;if(!n)return!1;s(e)}return e[t].w},onFreeze:function(e){return a&&c.NEED&&r(e)&&!w(e,t)&&s(e),e}}}),$t=(Jt.KEY,Jt.NEED,Jt.fastKey,Jt.getWeak,Jt.onFreeze,{f:Object.getOwnPropertySymbols}),Qt=Object.assign,Xt=!Qt||l(function(){var e={},t={},n=Symbol(),i="abcdefghijklmnopqrst";return e[n]=7,i.split("").forEach(function(e){t[e]=e}),7!=Qt({},e)[n]||Object.keys(Qt({},t)).join("")!=i})?function(e,t){for(var n=_(e),i=arguments.length,r=1,a=$t.f,o=le.f;i>r;)for(var s,l=X(arguments[r++]),c=a?Oe(l).concat(a(l)):Oe(l),u=c.length,h=0;u>h;)o.call(l,s=c[h++])&&(n[s]=l[s]);return n}:Qt,Zt=function(e,t,n){for(var i in t)S(e,i,t[i],n);return e},en=function(e,t,n,i){if(!(e instanceof t)||void 0!==i&&i in e)throw TypeError(n+": incorrect invocation!");return e},tn=t(function(e){var t={},n={},r=e.exports=function(e,r,a,o,l){var c,u,h,d,f=l?function(){return e}:G(e),p=i(a,o,r?2:1),m=0;if("function"!=typeof f)throw TypeError(e+" is not iterable!");if(j(f)){for(c=H(e.length);c>m;m++)if((d=r?p(s(u=e[m])[0],u[1]):p(e[m]))===t||d===n)return d}else for(h=f.call(e);!(u=h.next()).done;)if((d=x(h,p,u.value,r))===t||d===n)return d};r.BREAK=t,r.RETURN=n}),nn=function(e,t){if(!o(e)||e._t!==t)throw TypeError("Incompatible receiver, "+t+" required!");return e},rn=Jt.getWeak,an=ne(5),on=ne(6),sn=0,ln=function(e){return e._l||(e._l=new cn)},cn=function(){this.a=[]},un=function(e,t){return an(e.a,function(e){return e[0]===t})};cn.prototype={get:function(e){var t=un(this,e);if(t)return t[1]},has:function(e){return!!un(this,e)},set:function(e,t){var n=un(this,e);n?n[1]=t:this.a.push([e,t])},delete:function(e){var t=on(this.a,function(t){return t[0]===e});return~t&&this.a.splice(t,1),!!~t}};var hn={getConstructor:function(e,t,n,i){var r=e(function(e,a){en(e,r,t,"_i"),e._t=t,e._i=sn++,e._l=void 0,null!=a&&tn(a,n,e[i],e)});return Zt(r.prototype,{delete:function(e){if(!o(e))return!1;var n=rn(e);return!0===n?ln(nn(this,t)).delete(e):n&&w(n,this._i)&&delete n[this._i]},has:function(e){if(!o(e))return!1;var n=rn(e);return!0===n?ln(nn(this,t)).has(e):n&&w(n,this._i)}}),r},def:function(e,t,n){var i=rn(s(t),!0);return!0===i?ln(e).set(t,n):i[e._i]=n,e},ufstore:ln};t(function(e){var t,n=ne(0),i=Jt.getWeak,a=Object.isExtensible,s=hn.ufstore,c={},u=function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},h={get:function(e){if(o(e)){var t=i(e);return!0===t?s(nn(this,"WeakMap")).get(e):t?t[this._i]:void 0}},set:function(e,t){return hn.def(nn(this,"WeakMap"),e,t)}},d=e.exports=function(e,t,n,i,a,s){var c=r[e],u=c,h=a?"set":"add",d=u&&u.prototype,f={},p=function(e){var t=d[e];S(d,e,"delete"==e?function(e){return!(s&&!o(e))&&t.call(this,0===e?0:e)}:"has"==e?function(e){return!(s&&!o(e))&&t.call(this,0===e?0:e)}:"get"==e?function(e){return s&&!o(e)?void 0:t.call(this,0===e?0:e)}:"add"==e?function(e){return t.call(this,0===e?0:e),this}:function(e,n){return t.call(this,0===e?0:e,n),this})};if("function"==typeof u&&(s||d.forEach&&!l(function(){(new u).entries().next()}))){var m=new u,g=m[h](s?{}:-0,1)!=m,y=l(function(){m.has(1)}),v=Q(function(e){new u(e)}),b=!s&&l(function(){for(var e=new u,t=5;t--;)e[h](t,t);return!e.has(-0)});v||((u=t(function(t,n){en(t,u,e);var i=pe(new c,t,u);return null!=n&&tn(n,a,i[h],i),i})).prototype=d,d.constructor=u),(y||b)&&(p("delete"),p("has"),a&&p("get")),(b||g)&&p(h),s&&d.clear&&delete d.clear}else u=i.getConstructor(t,e,a,h),Zt(u.prototype,n),Jt.NEED=!0;return At(u,e),f[e]=u,C(C.G+C.W+C.F*(u!=c),f),s||i.setStrong(u,e,a),u}("WeakMap",u,h,hn,!0,!0);l(function(){return 7!=(new d).set((Object.freeze||Object)(c),7).get(c)})&&(t=hn.getConstructor(u,"WeakMap"),Xt(t.prototype,h),Jt.NEED=!0,n(["delete","has","get","set"],function(e){var n=d.prototype,i=n[e];S(n,e,function(n,r){if(o(n)&&!a(n)){this._f||(this._f=new t);var s=this._f[e](n,r);return"set"==e?this:s}return i.call(this,n,r)})}))});function dn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fn(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function pn(e,t,n){return t&&fn(e.prototype,t),n&&fn(e,n),e}function mn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gn(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],i=!0,r=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(i=(o=s.next()).done)&&(n.push(o.value),!t||n.length!==t);i=!0);}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function yn(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}C(C.S+C.F,"Object",{assign:Xt});var vn=M("species"),bn=function(e,t){var i,r=s(e).constructor;return void 0===r||null==(i=s(r)[vn])?t:n(i)},wn=Yt(!0),kn=function(e,t,n){return t+(n?wn(e,t).length:1)},Tn=Math.min,En=[].push,Sn=!!function(){try{return new RegExp("x","y")}catch(e){}}();bt("split",2,function(e,t,n,i){var r;return r="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,t){var i=String(this);if(void 0===e&&0===t)return[];if(!tt(e))return n.call(i,e,t);for(var r,a,o,s=[],l=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),c=0,u=void 0===t?4294967295:t>>>0,h=new RegExp(e.source,l+"g");(r=mt.call(h,i))&&!((a=h.lastIndex)>c&&(s.push(i.slice(c,r.index)),r.length>1&&r.index<i.length&&En.apply(s,r.slice(1)),o=r[0].length,c=a,s.length>=u));)h.lastIndex===r.index&&h.lastIndex++;return c===i.length?!o&&h.test("")||s.push(""):s.push(i.slice(c)),s.length>u?s.slice(0,u):s}:"0".split(void 0,0).length?function(e,t){return void 0===e&&0===t?[]:n.call(this,e,t)}:n,[function(n,i){var a=e(this),o=null==n?void 0:n[t];return void 0!==o?o.call(n,a,i):r.call(String(a),n,i)},function(e,t){var a=i(r,e,this,t,r!==n);if(a.done)return a.value;var o=s(e),l=String(this),c=bn(o,RegExp),u=o.unicode,h=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.unicode?"u":"")+(Sn?"y":"g"),d=new c(Sn?o:"^(?:"+o.source+")",h),f=void 0===t?4294967295:t>>>0;if(0===f)return[];if(0===l.length)return null===lt(d,l)?[l]:[];for(var p=0,m=0,g=[];m<l.length;){d.lastIndex=Sn?m:0;var y,v=lt(d,Sn?l:l.slice(m));if(null===v||(y=Tn(H(d.lastIndex+(Sn?0:m)),l.length))===p)m=kn(l,m,u);else{if(g.push(l.slice(p,m)),g.length===f)return g;for(var b=1;b<=v.length-1;b++)if(g.push(v[b]),g.length===f)return g;m=p=y}}return g.push(l.slice(p)),g}]});var An=le.f,Cn=function(e){return function(t){for(var n,i=ce(t),r=Oe(i),a=r.length,o=0,s=[];a>o;)An.call(i,n=r[o++])&&s.push(e?[n,i[n]]:i[n]);return s}},Pn=Cn(!0);C(C.S,"Object",{entries:function(e){return Pn(e)}});var _n=Cn(!1);C(C.S,"Object",{values:function(e){return _n(e)}});var xn=Math.max,In=Math.min,Nn=Math.floor,Mn=/\$([$&`']|\d\d?|<[^>]*>)/g,On=/\$([$&`']|\d\d?)/g;bt("replace",2,function(e,t,n,i){return[function(i,r){var a=e(this),o=null==i?void 0:i[t];return void 0!==o?o.call(i,a,r):n.call(String(a),i,r)},function(e,t){var a=i(n,e,this,t);if(a.done)return a.value;var o=s(e),l=String(this),c="function"==typeof t;c||(t=String(t));var u=o.global;if(u){var h=o.unicode;o.lastIndex=0}for(var d=[];;){var f=lt(o,l);if(null===f)break;if(d.push(f),!u)break;""===String(f[0])&&(o.lastIndex=kn(l,H(o.lastIndex),h))}for(var p,m="",g=0,y=0;y<d.length;y++){f=d[y];for(var v=String(f[0]),b=xn(In(F(f.index),l.length),0),w=[],k=1;k<f.length;k++)w.push(void 0===(p=f[k])?p:String(p));var T=f.groups;if(c){var E=[v].concat(w,b,l);void 0!==T&&E.push(T);var S=String(t.apply(void 0,E))}else S=r(v,l,b,w,T,t);b>=g&&(m+=l.slice(g,b)+S,g=b+v.length)}return m+l.slice(g)}];function r(e,t,i,r,a,o){var s=i+e.length,l=r.length,c=On;return void 0!==a&&(a=_(a),c=Mn),n.call(o,c,function(n,o){var c;switch(o.charAt(0)){case"$":return"$";case"&":return e;case"`":return t.slice(0,i);case"'":return t.slice(s);case"<":c=a[o.slice(1,-1)];break;default:var u=+o;if(0===u)return o;if(u>l){var h=Nn(u/10);return 0===h?o:h<=l?void 0===r[h-1]?o.charAt(1):r[h-1]+o.charAt(1):o}c=r[u-1]}return void 0===c?"":c})}});var Ln,jn,Rn,Dn=r.process,Fn=r.setImmediate,qn=r.clearImmediate,Hn=r.MessageChannel,Vn=r.Dispatch,Bn=0,Un={},Wn=function(){var e=+this;if(Un.hasOwnProperty(e)){var t=Un[e];delete Un[e],t()}},zn=function(e){Wn.call(e.data)};Fn&&qn||(Fn=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return Un[++Bn]=function(){!function(e,t,n){var i=void 0===n;switch(t.length){case 0:return i?e():e.call(n);case 1:return i?e(t[0]):e.call(n,t[0]);case 2:return i?e(t[0],t[1]):e.call(n,t[0],t[1]);case 3:return i?e(t[0],t[1],t[2]):e.call(n,t[0],t[1],t[2]);case 4:return i?e(t[0],t[1],t[2],t[3]):e.call(n,t[0],t[1],t[2],t[3])}e.apply(n,t)}("function"==typeof e?e:Function(e),t)},Ln(Bn),Bn},qn=function(e){delete Un[e]},"process"==U(Dn)?Ln=function(e){Dn.nextTick(i(Wn,e,1))}:Vn&&Vn.now?Ln=function(e){Vn.now(i(Wn,e,1))}:Hn?(Rn=(jn=new Hn).port2,jn.port1.onmessage=zn,Ln=i(Rn.postMessage,Rn,1)):r.addEventListener&&"function"==typeof postMessage&&!r.importScripts?(Ln=function(e){r.postMessage(e+"","*")},r.addEventListener("message",zn,!1)):Ln="onreadystatechange"in d("script")?function(e){Re.appendChild(d("script")).onreadystatechange=function(){Re.removeChild(this),Wn.call(e)}}:function(e){setTimeout(i(Wn,e,1),0)});var Kn={set:Fn,clear:qn},Yn=Kn.set,Gn=r.MutationObserver||r.WebKitMutationObserver,Jn=r.process,$n=r.Promise,Qn="process"==U(Jn);function Xn(e){var t,i;this.promise=new e(function(e,n){if(void 0!==t||void 0!==i)throw TypeError("Bad Promise constructor");t=e,i=n}),this.resolve=n(t),this.reject=n(i)}var Zn,ei,ti,ni,ii={f:function(e){return new Xn(e)}},ri=function(e){try{return{e:!1,v:e()}}catch(e){return{e:!0,v:e}}},ai=r.navigator,oi=ai&&ai.userAgent||"",si=M("species"),li=function(e){var t=r[e];c&&t&&!t[si]&&g.f(t,si,{configurable:!0,get:function(){return this}})},ci=Kn.set,ui=function(){var e,t,n,i=function(){var i,r;for(Qn&&(i=Jn.domain)&&i.exit();e;){r=e.fn,e=e.next;try{r()}catch(i){throw e?n():t=void 0,i}}t=void 0,i&&i.enter()};if(Qn)n=function(){Jn.nextTick(i)};else if(!Gn||r.navigator&&r.navigator.standalone)if($n&&$n.resolve){var a=$n.resolve(void 0);n=function(){a.then(i)}}else n=function(){Yn.call(r,i)};else{var o=!0,s=document.createTextNode("");new Gn(i).observe(s,{characterData:!0}),n=function(){s.data=o=!o}}return function(i){var r={fn:i,next:void 0};t&&(t.next=r),e||(e=r,n()),t=r}}(),hi=r.TypeError,di=r.process,fi=di&&di.versions,pi=fi&&fi.v8||"",mi=r.Promise,gi="process"==K(di),yi=function(){},vi=ei=ii.f,bi=!!function(){try{var e=mi.resolve(1),t=(e.constructor={})[M("species")]=function(e){e(yi,yi)};return(gi||"function"==typeof PromiseRejectionEvent)&&e.then(yi)instanceof t&&0!==pi.indexOf("6.6")&&-1===oi.indexOf("Chrome/66")}catch(e){}}(),wi=function(e){var t;return!(!o(e)||"function"!=typeof(t=e.then))&&t},ki=function(e,t){if(!e._n){e._n=!0;var n=e._c;ui(function(){for(var i=e._v,r=1==e._s,a=0,o=function(t){var n,a,o,s=r?t.ok:t.fail,l=t.resolve,c=t.reject,u=t.domain;try{s?(r||(2==e._h&&Si(e),e._h=1),!0===s?n=i:(u&&u.enter(),n=s(i),u&&(u.exit(),o=!0)),n===t.promise?c(hi("Promise-chain cycle")):(a=wi(n))?a.call(n,l,c):l(n)):c(i)}catch(e){u&&!o&&u.exit(),c(e)}};n.length>a;)o(n[a++]);e._c=[],e._n=!1,t&&!e._h&&Ti(e)})}},Ti=function(e){ci.call(r,function(){var t,n,i,a=e._v,o=Ei(e);if(o&&(t=ri(function(){gi?di.emit("unhandledRejection",a,e):(n=r.onunhandledrejection)?n({promise:e,reason:a}):(i=r.console)&&i.error&&i.error("Unhandled promise rejection",a)}),e._h=gi||Ei(e)?2:1),e._a=void 0,o&&t.e)throw t.v})},Ei=function(e){return 1!==e._h&&0===(e._a||e._c).length},Si=function(e){ci.call(r,function(){var t;gi?di.emit("rejectionHandled",e):(t=r.onrejectionhandled)&&t({promise:e,reason:e._v})})},Ai=function(e){var t=this;t._d||(t._d=!0,(t=t._w||t)._v=e,t._s=2,t._a||(t._a=t._c.slice()),ki(t,!0))},Ci=function(e){var t,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===e)throw hi("Promise can't be resolved itself");(t=wi(e))?ui(function(){var r={_w:n,_d:!1};try{t.call(e,i(Ci,r,1),i(Ai,r,1))}catch(e){Ai.call(r,e)}}):(n._v=e,n._s=1,ki(n,!1))}catch(e){Ai.call({_w:n,_d:!1},e)}}};bi||(mi=function(e){en(this,mi,"Promise","_h"),n(e),Zn.call(this);try{e(i(Ci,this,1),i(Ai,this,1))}catch(e){Ai.call(this,e)}},(Zn=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=Zt(mi.prototype,{then:function(e,t){var n=vi(bn(this,mi));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=gi?di.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&ki(this,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),ti=function(){var e=new Zn;this.promise=e,this.resolve=i(Ci,e,1),this.reject=i(Ai,e,1)},ii.f=vi=function(e){return e===mi||e===ni?new ti(e):ei(e)}),C(C.G+C.W+C.F*!bi,{Promise:mi}),At(mi,"Promise"),li("Promise"),ni=a.Promise,C(C.S+C.F*!bi,"Promise",{reject:function(e){var t=vi(this);return(0,t.reject)(e),t.promise}}),C(C.S+C.F*!bi,"Promise",{resolve:function(e){return function(e,t){if(s(e),o(t)&&t.constructor===e)return t;var n=ii.f(e);return(0,n.resolve)(t),n.promise}(this,e)}}),C(C.S+C.F*!(bi&&Q(function(e){mi.all(e).catch(yi)})),"Promise",{all:function(e){var t=this,n=vi(t),i=n.resolve,r=n.reject,a=ri(function(){var n=[],a=0,o=1;tn(e,!1,function(e){var s=a++,l=!1;n.push(void 0),o++,t.resolve(e).then(function(e){l||(l=!0,n[s]=e,--o||i(n))},r)}),--o||i(n)});return a.e&&r(a.v),n.promise},race:function(e){var t=this,n=vi(t),i=n.reject,r=ri(function(){tn(e,!1,function(e){t.resolve(e).then(n.resolve,i)})});return r.e&&i(r.v),n.promise}});var Pi="".startsWith;C(C.P+C.F*rt("startsWith"),"String",{startsWith:function(e){var t=nt(this,e,"startsWith"),n=H(Math.min(arguments.length>1?arguments[1]:void 0,t.length)),i=String(e);return Pi?Pi.call(t,i,n):t.slice(n,n+i.length)===i}}),C(C.S,"Number",{isNaN:function(e){return e!=e}});var _i=function(e){return null!=e?e.constructor:null},xi=function(e,t){return Boolean(e&&t&&e instanceof t)},Ii=function(e){return null==e},Ni=function(e){return _i(e)===Object},Mi=function(e){return _i(e)===String},Oi=function(e){return Array.isArray(e)},Li=function(e){return xi(e,NodeList)},ji=function(e){return Ii(e)||(Mi(e)||Oi(e)||Li(e))&&!e.length||Ni(e)&&!Object.keys(e).length},Ri={nullOrUndefined:Ii,object:Ni,number:function(e){return _i(e)===Number&&!Number.isNaN(e)},string:Mi,boolean:function(e){return _i(e)===Boolean},function:function(e){return _i(e)===Function},array:Oi,weakMap:function(e){return xi(e,WeakMap)},nodeList:Li,element:function(e){return xi(e,Element)},textNode:function(e){return _i(e)===Text},event:function(e){return xi(e,Event)},keyboardEvent:function(e){return xi(e,KeyboardEvent)},cue:function(e){return xi(e,window.TextTrackCue)||xi(e,window.VTTCue)},track:function(e){return xi(e,TextTrack)||!Ii(e)&&Mi(e.kind)},url:function(e){if(xi(e,window.URL))return!0;if(!Mi(e))return!1;var t=e;e.startsWith("http://")&&e.startsWith("https://")||(t="http://".concat(e));try{return!ji(new URL(t).hostname)}catch(e){return!1}},empty:ji},Di=function(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){return e=!0,null}});window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch(e){}return e}();function Fi(e,t,n){var i=this,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(e&&"addEventListener"in e&&!Ri.empty(t)&&Ri.function(n)){var s=t.split(" "),l=o;Di&&(l={passive:a,capture:o}),s.forEach(function(t){i&&i.eventListeners&&r&&i.eventListeners.push({element:e,type:t,callback:n,options:l}),e[r?"addEventListener":"removeEventListener"](t,n,l)})}}function qi(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=arguments.length>4&&void 0!==arguments[4]&&arguments[4];Fi.call(this,e,t,n,!0,i,r)}function Hi(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=arguments.length>4&&void 0!==arguments[4]&&arguments[4];Fi.call(this,e,t,n,!1,i,r)}function Vi(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=arguments.length>4&&void 0!==arguments[4]&&arguments[4];Fi.call(this,e,t,function a(){Hi(e,t,a,i,r);for(var o=arguments.length,s=new Array(o),l=0;l<o;l++)s[l]=arguments[l];n.apply(this,s)},!0,i,r)}function Bi(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(Ri.element(e)&&!Ri.empty(t)){var r=new CustomEvent(t,{bubbles:n,detail:Object.assign({},i,{plyr:this})});e.dispatchEvent(r)}}function Ui(e,t){var n=e.length?e:[e];Array.from(n).reverse().forEach(function(e,n){var i=n>0?t.cloneNode(!0):t,r=e.parentNode,a=e.nextSibling;i.appendChild(e),a?r.insertBefore(i,a):r.appendChild(i)})}function Wi(e,t){Ri.element(e)&&!Ri.empty(t)&&Object.entries(t).filter(function(e){var t=gn(e,2)[1];return!Ri.nullOrUndefined(t)}).forEach(function(t){var n=gn(t,2),i=n[0],r=n[1];return e.setAttribute(i,r)})}function zi(e,t,n){var i=document.createElement(e);return Ri.object(t)&&Wi(i,t),Ri.string(n)&&(i.innerText=n),i}function Ki(e,t,n,i){Ri.element(t)&&t.appendChild(zi(e,n,i))}function Yi(e){Ri.nodeList(e)||Ri.array(e)?Array.from(e).forEach(Yi):Ri.element(e)&&Ri.element(e.parentNode)&&e.parentNode.removeChild(e)}function Gi(e){if(Ri.element(e))for(var t=e.childNodes.length;t>0;)e.removeChild(e.lastChild),t-=1}function Ji(e,t){return Ri.element(t)&&Ri.element(t.parentNode)&&Ri.element(e)?(t.parentNode.replaceChild(e,t),e):null}function $i(e,t){if(!Ri.string(e)||Ri.empty(e))return{};var n={},i=t;return e.split(",").forEach(function(e){var t=e.trim(),r=t.replace(".",""),a=t.replace(/[[\]]/g,"").split("="),o=a[0],s=a.length>1?a[1].replace(/["']/g,""):"";switch(t.charAt(0)){case".":Ri.object(i)&&Ri.string(i.class)&&(i.class+=" ".concat(r)),n.class=r;break;case"#":n.id=t.replace("#","");break;case"[":n[o]=s}}),n}function Qi(e,t){if(Ri.element(e)){var n=t;Ri.boolean(n)||(n=!e.hidden),n?e.setAttribute("hidden",""):e.removeAttribute("hidden")}}function Xi(e,t,n){if(Ri.nodeList(e))return Array.from(e).map(function(e){return Xi(e,t,n)});if(Ri.element(e)){var i="toggle";return void 0!==n&&(i=n?"add":"remove"),e.classList[i](t),e.classList.contains(t)}return!1}function Zi(e,t){return Ri.element(e)&&e.classList.contains(t)}function er(e,t){return function(){return Array.from(document.querySelectorAll(t)).includes(this)}.call(e,t)}function tr(e){return this.elements.container.querySelectorAll(e)}function nr(e){return this.elements.container.querySelector(e)}function ir(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];Ri.element(e)&&(e.focus({preventScroll:!0}),t&&Xi(e,this.config.classNames.tabFocus))}var rr,ar,or,sr=(rr=document.createElement("span"),ar={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},or=Object.keys(ar).find(function(e){return void 0!==rr.style[e]}),!!Ri.string(or)&&ar[or]);function lr(e){setTimeout(function(){try{Qi(e,!0),e.offsetHeight,Qi(e,!1)}catch(e){}},0)}var cr,ur={isIE:!!document.documentMode,isEdge:window.navigator.userAgent.includes("Edge"),isWebkit:"WebkitAppearance"in document.documentElement.style&&!/Edge/.test(navigator.userAgent),isIPhone:/(iPhone|iPod)/gi.test(navigator.platform),isIos:/(iPad|iPhone|iPod)/gi.test(navigator.platform)},hr={"audio/ogg":"vorbis","audio/wav":"1","video/webm":"vp8, vorbis","video/mp4":"avc1.42E01E, mp4a.40.2","video/ogg":"theora"},dr={audio:"canPlayType"in document.createElement("audio"),video:"canPlayType"in document.createElement("video"),check:function(e,t,n){var i=ur.isIPhone&&n&&dr.playsinline,r=dr[e]||"html5"!==t;return{api:r,ui:r&&dr.rangeInput&&("video"!==e||!ur.isIPhone||i)}},pip:!(ur.isIPhone||!Ri.function(zi("video").webkitSetPresentationMode)&&(!document.pictureInPictureEnabled||zi("video").disablePictureInPicture)),airplay:Ri.function(window.WebKitPlaybackTargetAvailabilityEvent),playsinline:"playsInline"in document.createElement("video"),mime:function(e){if(Ri.empty(e))return!1;var t=gn(e.split("/"),1)[0],n=e;if(!this.isHTML5||t!==this.type)return!1;Object.keys(hr).includes(n)&&(n+='; codecs="'.concat(hr[e],'"'));try{return Boolean(n&&this.media.canPlayType(n).replace(/no/,""))}catch(e){return!1}},textTracks:"textTracks"in document.createElement("video"),rangeInput:(cr=document.createElement("input"),cr.type="range","range"===cr.type),touch:"ontouchstart"in document.documentElement,transitions:!1!==sr,reducedMotion:"matchMedia"in window&&window.matchMedia("(prefers-reduced-motion)").matches},fr={getSources:function(){var e=this;return this.isHTML5?Array.from(this.media.querySelectorAll("source")).filter(function(t){var n=t.getAttribute("type");return!!Ri.empty(n)||dr.mime.call(e,n)}):[]},getQualityOptions:function(){return fr.getSources.call(this).map(function(e){return Number(e.getAttribute("size"))}).filter(Boolean)},extend:function(){if(this.isHTML5){var e=this;Object.defineProperty(e.media,"quality",{get:function(){var t=fr.getSources.call(e).find(function(t){return t.getAttribute("src")===e.source});return t&&Number(t.getAttribute("size"))},set:function(t){var n=fr.getSources.call(e).find(function(e){return Number(e.getAttribute("size"))===t});if(n){var i=e.media,r=i.currentTime,a=i.paused,o=i.preload,s=i.readyState;e.media.src=n.getAttribute("src"),("none"!==o||s)&&(e.once("loadedmetadata",function(){e.currentTime=r,a||e.play()}),e.media.load()),Bi.call(e,e.media,"qualitychange",!1,{quality:t})}}})}},cancelRequests:function(){this.isHTML5&&(Yi(fr.getSources.call(this)),this.media.setAttribute("src",this.config.blankVideo),this.media.load(),this.debug.log("Cancelled network requests"))}};function pr(e){return Ri.array(e)?e.filter(function(t,n){return e.indexOf(t)===n}):e}function mr(e,t){return t.split(".").reduce(function(e,t){return e&&e[t]},e)}function gr(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];if(!n.length)return e;var r=n.shift();return Ri.object(r)?(Object.keys(r).forEach(function(t){Ri.object(r[t])?(Object.keys(e).includes(t)||Object.assign(e,mn({},t,{})),gr(e[t],r[t])):Object.assign(e,mn({},t,r[t]))}),gr.apply(void 0,[e].concat(n))):e}var yr=g.f,vr=Ae.f,br=r.RegExp,wr=br,kr=br.prototype,Tr=/a/g,Er=/a/g,Sr=new br(Tr)!==Tr;if(c&&(!Sr||l(function(){return Er[M("match")]=!1,br(Tr)!=Tr||br(Er)==Er||"/a/i"!=br(Tr,"i")}))){br=function(e,t){var n=this instanceof br,i=tt(e),r=void 0===t;return!n&&i&&e.constructor===br&&r?e:pe(Sr?new wr(i&&!r?e.source:e,t):wr((i=e instanceof br)?e.source:e,i&&r?ct.call(e):t),n?this:kr,br)};for(var Ar=function(e){e in br||yr(br,e,{configurable:!0,get:function(){return wr[e]},set:function(t){wr[e]=t}})},Cr=vr(wr),Pr=0;Cr.length>Pr;)Ar(Cr[Pr++]);kr.constructor=br,br.prototype=kr,S(r,"RegExp",br)}function _r(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return Ri.empty(e)?e:e.toString().replace(/{(\d+)}/g,function(e,t){return n[t].toString()})}function xr(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return e.replace(new RegExp(t.toString().replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1"),"g"),n.toString())}function Ir(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").toString().replace(/\w\S*/g,function(e){return e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()})}function Nr(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").toString();return(e=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").toString();return e=xr(e,"-"," "),e=xr(e,"_"," "),xr(e=Ir(e)," ","")}(e)).charAt(0).toLowerCase()+e.slice(1)}function Mr(e){var t=document.createElement("div");return t.appendChild(e),t.innerHTML}li("RegExp");var Or={pip:"PIP",airplay:"AirPlay",html5:"HTML5",vimeo:"Vimeo",youtube:"YouTube"},Lr=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(Ri.empty(e)||Ri.empty(t))return"";var n=mr(t.i18n,e);if(Ri.empty(n))return Object.keys(Or).includes(e)?Or[e]:"";var i={"{seektime}":t.seekTime,"{title}":t.title};return Object.entries(i).forEach(function(e){var t=gn(e,2),i=t[0],r=t[1];n=xr(n,i,r)}),n},jr=function(){function e(t){dn(this,e),this.enabled=t.config.storage.enabled,this.key=t.config.storage.key}return pn(e,[{key:"get",value:function(t){if(!e.supported||!this.enabled)return null;var n=window.localStorage.getItem(this.key);if(Ri.empty(n))return null;var i=JSON.parse(n);return Ri.string(t)&&t.length?i[t]:i}},{key:"set",value:function(t){if(e.supported&&this.enabled&&Ri.object(t)){var n=this.get();Ri.empty(n)&&(n={}),gr(n,t),window.localStorage.setItem(this.key,JSON.stringify(n))}}}],[{key:"supported",get:function(){try{if(!("localStorage"in window))return!1;return window.localStorage.setItem("___test","___test"),window.localStorage.removeItem("___test"),!0}catch(e){return!1}}}]),e}();function Rr(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"text";return new Promise(function(n,i){try{var r=new XMLHttpRequest;if(!("withCredentials"in r))return;r.addEventListener("load",function(){if("text"===t)try{n(JSON.parse(r.responseText))}catch(e){n(r.responseText)}else n(r.response)}),r.addEventListener("error",function(){throw new Error(r.status)}),r.open("GET",e,!0),r.responseType=t,r.send()}catch(e){i(e)}})}function Dr(e,t){if(Ri.string(e)){var n=Ri.string(t),i=function(){return null!==document.getElementById(t)},r=function(e,t){e.innerHTML=t,n&&i()||document.body.insertAdjacentElement("afterbegin",e)};if(!n||!i()){var a=jr.supported,o=document.createElement("div");if(o.setAttribute("hidden",""),n&&o.setAttribute("id",t),a){var s=window.localStorage.getItem("".concat("cache","-").concat(t));if(null!==s){var l=JSON.parse(s);r(o,l.content)}}Rr(e).then(function(e){Ri.empty(e)||(a&&window.localStorage.setItem("".concat("cache","-").concat(t),JSON.stringify({content:e})),r(o,e))}).catch(function(){})}}}C(C.S,"Math",{trunc:function(e){return(e>0?Math.floor:Math.ceil)(e)}});var Fr=function(e){return Math.trunc(e/60/60%60,10)},qr=function(e){return Math.trunc(e/60%60,10)},Hr=function(e){return Math.trunc(e%60,10)};function Vr(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!Ri.number(e))return Vr(null,t,n);var i=function(e){return"0".concat(e).slice(-2)},r=Fr(e),a=qr(e),o=Hr(e);return r=t||r>0?"".concat(r,":"):"","".concat(n&&e>0?"-":"").concat(r).concat(i(a),":").concat(i(o))}var Br={getIconUrl:function(){var e=new URL(this.config.iconUrl,window.location).host!==window.location.host||ur.isIE&&!window.svg4everybody;return{url:this.config.iconUrl,cors:e}},findElements:function(){try{return this.elements.controls=nr.call(this,this.config.selectors.controls.wrapper),this.elements.buttons={play:tr.call(this,this.config.selectors.buttons.play),pause:nr.call(this,this.config.selectors.buttons.pause),restart:nr.call(this,this.config.selectors.buttons.restart),rewind:nr.call(this,this.config.selectors.buttons.rewind),fastForward:nr.call(this,this.config.selectors.buttons.fastForward),mute:nr.call(this,this.config.selectors.buttons.mute),pip:nr.call(this,this.config.selectors.buttons.pip),airplay:nr.call(this,this.config.selectors.buttons.airplay),settings:nr.call(this,this.config.selectors.buttons.settings),captions:nr.call(this,this.config.selectors.buttons.captions),fullscreen:nr.call(this,this.config.selectors.buttons.fullscreen)},this.elements.progress=nr.call(this,this.config.selectors.progress),this.elements.inputs={seek:nr.call(this,this.config.selectors.inputs.seek),volume:nr.call(this,this.config.selectors.inputs.volume)},this.elements.display={buffer:nr.call(this,this.config.selectors.display.buffer),currentTime:nr.call(this,this.config.selectors.display.currentTime),duration:nr.call(this,this.config.selectors.display.duration)},Ri.element(this.elements.progress)&&(this.elements.display.seekTooltip=this.elements.progress.querySelector(".".concat(this.config.classNames.tooltip))),!0}catch(e){return this.debug.warn("It looks like there is a problem with your custom controls HTML",e),this.toggleNativeControls(!0),!1}},createIcon:function(e,t){var n=Br.getIconUrl.call(this),i="".concat(n.cors?"":n.url,"#").concat(this.config.iconPrefix),r=document.createElementNS("http://www.w3.org/2000/svg","svg");Wi(r,gr(t,{role:"presentation",focusable:"false"}));var a=document.createElementNS("http://www.w3.org/2000/svg","use"),o="".concat(i,"-").concat(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:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Lr(e,this.config);return zi("span",Object.assign({},t,{class:[t.class,this.config.classNames.hidden].filter(Boolean).join(" ")}),n)},createBadge:function(e){if(Ri.empty(e))return null;var t=zi("span",{class:this.config.classNames.menu.value});return t.appendChild(zi("span",{class:this.config.classNames.menu.badge},e)),t},createButton:function(e,t){var n=Object.assign({},t),i=Nr(e),r={element:"button",toggle:!1,label:null,icon:null,labelPressed:null,iconPressed:null};switch(["element","icon","label"].forEach(function(e){Object.keys(n).includes(e)&&(r[e]=n[e],delete n[e])}),"button"!==r.element||Object.keys(n).includes("type")||(n.type="button"),Object.keys(n).includes("class")?n.class.includes(this.config.classNames.control)||(n.class+=" ".concat(this.config.classNames.control)):n.class=this.config.classNames.control,e){case"play":r.toggle=!0,r.label="play",r.labelPressed="pause",r.icon="play",r.iconPressed="pause";break;case"mute":r.toggle=!0,r.label="mute",r.labelPressed="unmute",r.icon="volume",r.iconPressed="muted";break;case"captions":r.toggle=!0,r.label="enableCaptions",r.labelPressed="disableCaptions",r.icon="captions-off",r.iconPressed="captions-on";break;case"fullscreen":r.toggle=!0,r.label="enterFullscreen",r.labelPressed="exitFullscreen",r.icon="enter-fullscreen",r.iconPressed="exit-fullscreen";break;case"play-large":n.class+=" ".concat(this.config.classNames.control,"--overlaid"),i="play",r.label="play",r.icon="play";break;default:Ri.empty(r.label)&&(r.label=i),Ri.empty(r.icon)&&(r.icon=e)}var a=zi(r.element);return r.toggle?(a.appendChild(Br.createIcon.call(this,r.iconPressed,{class:"icon--pressed"})),a.appendChild(Br.createIcon.call(this,r.icon,{class:"icon--not-pressed"})),a.appendChild(Br.createLabel.call(this,r.labelPressed,{class:"label--pressed"})),a.appendChild(Br.createLabel.call(this,r.label,{class:"label--not-pressed"}))):(a.appendChild(Br.createIcon.call(this,r.icon)),a.appendChild(Br.createLabel.call(this,r.label))),gr(n,$i(this.config.selectors.buttons[i],n)),Wi(a,n),"play"===i?(Ri.array(this.elements.buttons[i])||(this.elements.buttons[i]=[]),this.elements.buttons[i].push(a)):this.elements.buttons[i]=a,a},createRange:function(e,t){var n=zi("input",gr($i(this.config.selectors.inputs[e]),{type:"range",min:0,max:100,step:.01,value:0,autocomplete:"off",role:"slider","aria-label":Lr(e,this.config),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":0},t));return this.elements.inputs[e]=n,Br.updateRangeFill.call(this,n),n},createProgress:function(e,t){var n=zi("progress",gr($i(this.config.selectors.display[e]),{min:0,max:100,value:0,role:"presentation","aria-hidden":!0},t));if("volume"!==e){n.appendChild(zi("span",null,"0"));var i={played:"played",buffer:"buffered"}[e],r=i?Lr(i,this.config):"";n.innerText="% ".concat(r.toLowerCase())}return this.elements.display[e]=n,n},createTime:function(e){var t=$i(this.config.selectors.display[e]),n=zi("div",gr(t,{class:"".concat(this.config.classNames.display.time," ").concat(t.class?t.class:"").trim(),"aria-label":Lr(e,this.config)}),"00:00");return this.elements.display[e]=n,n},bindMenuItemShortcuts:function(e,t){var n=this;qi(e,"keydown keyup",function(i){if([32,38,39,40].includes(i.which)&&(i.preventDefault(),i.stopPropagation(),"keydown"!==i.type)){var r,a=er(e,'[role="menuitemradio"]');if(!a&&[32,39].includes(i.which))Br.showMenuPanel.call(n,t,!0);else 32!==i.which&&(40===i.which||a&&39===i.which?(r=e.nextElementSibling,Ri.element(r)||(r=e.parentNode.firstElementChild)):(r=e.previousElementSibling,Ri.element(r)||(r=e.parentNode.lastElementChild)),ir.call(n,r,!0))}},!1),qi(e,"keyup",function(e){13===e.which&&Br.focusFirstMenuItem.call(n,null,!0)})},createMenuItem:function(e){var t=this,n=e.value,i=e.list,r=e.type,a=e.title,o=e.badge,s=void 0===o?null:o,l=e.checked,c=void 0!==l&&l,u=$i(this.config.selectors.inputs[r]),h=zi("button",gr(u,{type:"button",role:"menuitemradio",class:"".concat(this.config.classNames.control," ").concat(u.class?u.class:"").trim(),"aria-checked":c,value:n})),d=zi("span");d.innerHTML=a,Ri.element(s)&&d.appendChild(s),h.appendChild(d),Object.defineProperty(h,"checked",{enumerable:!0,get:function(){return"true"===h.getAttribute("aria-checked")},set:function(e){e&&Array.from(h.parentNode.children).filter(function(e){return er(e,'[role="menuitemradio"]')}).forEach(function(e){return e.setAttribute("aria-checked","false")}),h.setAttribute("aria-checked",e?"true":"false")}}),this.listeners.bind(h,"click keyup",function(e){if(!Ri.keyboardEvent(e)||32===e.which){switch(e.preventDefault(),e.stopPropagation(),h.checked=!0,r){case"language":t.currentTrack=Number(n);break;case"quality":t.quality=n;break;case"speed":t.speed=parseFloat(n)}Br.showMenuPanel.call(t,"home",Ri.keyboardEvent(e))}},r,!1),Br.bindMenuItemShortcuts.call(this,h,r),i.appendChild(h)},formatTime:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Ri.number(e)?Vr(e,Fr(this.duration)>0,t):e},updateTimeDisplay:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];Ri.element(e)&&Ri.number(t)&&(e.innerText=Br.formatTime(t,n))},updateVolume:function(){this.supported.ui&&(Ri.element(this.elements.inputs.volume)&&Br.setRange.call(this,this.elements.inputs.volume,this.muted?0:this.volume),Ri.element(this.elements.buttons.mute)&&(this.elements.buttons.mute.pressed=this.muted||0===this.volume))},setRange:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;Ri.element(e)&&(e.value=t,Br.updateRangeFill.call(this,e))},updateProgress:function(e){var t=this;if(this.supported.ui&&Ri.event(e)){var n,i,r=0;if(e)switch(e.type){case"timeupdate":case"seeking":case"seeked":n=this.currentTime,i=this.duration,r=0===n||0===i||Number.isNaN(n)||Number.isNaN(i)?0:(n/i*100).toFixed(2),"timeupdate"===e.type&&Br.setRange.call(this,this.elements.inputs.seek,r);break;case"playing":case"progress":!function(e,n){var i=Ri.number(n)?n:0,r=Ri.element(e)?e:t.elements.display.buffer;if(Ri.element(r)){r.value=i;var a=r.getElementsByTagName("span")[0];Ri.element(a)&&(a.childNodes[0].nodeValue=i)}}(this.elements.display.buffer,100*this.buffered)}}},updateRangeFill:function(e){var t=Ri.event(e)?e.target:e;if(Ri.element(t)&&"range"===t.getAttribute("type")){if(er(t,this.config.selectors.inputs.seek)){t.setAttribute("aria-valuenow",this.currentTime);var n=Br.formatTime(this.currentTime),i=Br.formatTime(this.duration),r=Lr("seekLabel",this.config);t.setAttribute("aria-valuetext",r.replace("{currentTime}",n).replace("{duration}",i))}else if(er(t,this.config.selectors.inputs.volume)){var a=100*t.value;t.setAttribute("aria-valuenow",a),t.setAttribute("aria-valuetext","".concat(a.toFixed(1),"%"))}else t.setAttribute("aria-valuenow",t.value);ur.isWebkit&&t.style.setProperty("--value","".concat(t.value/t.max*100,"%"))}},updateSeekTooltip:function(e){var t=this;if(this.config.tooltips.seek&&Ri.element(this.elements.inputs.seek)&&Ri.element(this.elements.display.seekTooltip)&&0!==this.duration){var n=0,i=this.elements.progress.getBoundingClientRect(),r="".concat(this.config.classNames.tooltip,"--visible"),a=function(e){Xi(t.elements.display.seekTooltip,r,e)};if(this.touch)a(!1);else{if(Ri.event(e))n=100/i.width*(e.pageX-i.left);else{if(!Zi(this.elements.display.seekTooltip,r))return;n=parseFloat(this.elements.display.seekTooltip.style.left,10)}n<0?n=0:n>100&&(n=100),Br.updateTimeDisplay.call(this,this.elements.display.seekTooltip,this.duration/100*n),this.elements.display.seekTooltip.style.left="".concat(n,"%"),Ri.event(e)&&["mouseenter","mouseleave"].includes(e.type)&&a("mouseenter"===e.type)}}},timeUpdate:function(e){var t=!Ri.element(this.elements.display.duration)&&this.config.invertTime;Br.updateTimeDisplay.call(this,this.elements.display.currentTime,t?this.duration-this.currentTime:this.currentTime,t),e&&"timeupdate"===e.type&&this.media.seeking||Br.updateProgress.call(this,e)},durationUpdate:function(){if(this.supported.ui&&(this.config.invertTime||!this.currentTime)){if(this.duration>=Math.pow(2,32))return Qi(this.elements.display.currentTime,!0),void Qi(this.elements.progress,!0);Ri.element(this.elements.inputs.seek)&&this.elements.inputs.seek.setAttribute("aria-valuemax",this.duration);var e=Ri.element(this.elements.display.duration);!e&&this.config.displayDuration&&this.paused&&Br.updateTimeDisplay.call(this,this.elements.display.currentTime,this.duration),e&&Br.updateTimeDisplay.call(this,this.elements.display.duration,this.duration),Br.updateSeekTooltip.call(this)}},toggleMenuButton:function(e,t){Qi(this.elements.settings.buttons[e],!t)},updateSetting:function(e,t,n){var i=this.elements.settings.panels[e],r=null,a=t;if("captions"===e)r=this.currentTrack;else{if(r=Ri.empty(n)?this[e]:n,Ri.empty(r)&&(r=this.config[e].default),!Ri.empty(this.options[e])&&!this.options[e].includes(r))return void this.debug.warn("Unsupported value of '".concat(r,"' for ").concat(e));if(!this.config[e].options.includes(r))return void this.debug.warn("Disabled value of '".concat(r,"' for ").concat(e))}if(Ri.element(a)||(a=i&&i.querySelector('[role="menu"]')),Ri.element(a)){this.elements.settings.buttons[e].querySelector(".".concat(this.config.classNames.menu.value)).innerHTML=Br.getLabel.call(this,e,r);var o=a&&a.querySelector('[value="'.concat(r,'"]'));Ri.element(o)&&(o.checked=!0)}},getLabel:function(e,t){switch(e){case"speed":return 1===t?Lr("normal",this.config):"".concat(t,"×");case"quality":if(Ri.number(t)){var n=Lr("qualityLabel.".concat(t),this.config);return n.length?n:"".concat(t,"p")}return Ir(t);case"captions":return zr.getLabel.call(this);default:return null}},setQualityMenu:function(e){var t=this;if(Ri.element(this.elements.settings.panels.quality)){var n=this.elements.settings.panels.quality.querySelector('[role="menu"]');Ri.array(e)&&(this.options.quality=pr(e).filter(function(e){return t.config.quality.options.includes(e)}));var i=!Ri.empty(this.options.quality)&&this.options.quality.length>1;if(Br.toggleMenuButton.call(this,"quality",i),Gi(n),Br.checkMenu.call(this),i){var r=function(e){var n=Lr("qualityBadge.".concat(e),t.config);return n.length?Br.createBadge.call(t,n):null};this.options.quality.sort(function(e,n){var i=t.config.quality.options;return i.indexOf(e)>i.indexOf(n)?1:-1}).forEach(function(e){Br.createMenuItem.call(t,{value:e,list:n,type:"quality",title:Br.getLabel.call(t,"quality",e),badge:r(e)})}),Br.updateSetting.call(this,"quality",n)}}},setCaptionsMenu:function(){var e=this;if(Ri.element(this.elements.settings.panels.captions)){var t=this.elements.settings.panels.captions.querySelector('[role="menu"]'),n=zr.getTracks.call(this),i=Boolean(n.length);if(Br.toggleMenuButton.call(this,"captions",i),Gi(t),Br.checkMenu.call(this),i){var r=n.map(function(n,i){return{value:i,checked:e.captions.toggled&&e.currentTrack===i,title:zr.getLabel.call(e,n),badge:n.language&&Br.createBadge.call(e,n.language.toUpperCase()),list:t,type:"language"}});r.unshift({value:-1,checked:!this.captions.toggled,title:Lr("disabled",this.config),list:t,type:"language"}),r.forEach(Br.createMenuItem.bind(this)),Br.updateSetting.call(this,"captions",t)}}},setSpeedMenu:function(e){var t=this;if(Ri.element(this.elements.settings.panels.speed)){var n=this.elements.settings.panels.speed.querySelector('[role="menu"]');Ri.array(e)?this.options.speed=e:(this.isHTML5||this.isVimeo)&&(this.options.speed=[.5,.75,1,1.25,1.5,1.75,2]),this.options.speed=this.options.speed.filter(function(e){return t.config.speed.options.includes(e)});var i=!Ri.empty(this.options.speed)&&this.options.speed.length>1;Br.toggleMenuButton.call(this,"speed",i),Gi(n),Br.checkMenu.call(this),i&&(this.options.speed.forEach(function(e){Br.createMenuItem.call(t,{value:e,list:n,type:"speed",title:Br.getLabel.call(t,"speed",e)})}),Br.updateSetting.call(this,"speed",n))}},checkMenu:function(){var e=this.elements.settings.buttons,t=!Ri.empty(e)&&Object.values(e).some(function(e){return!e.hidden});Qi(this.elements.settings.menu,!t)},focusFirstMenuItem:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.elements.settings.popup.hidden){var n=e;Ri.element(n)||(n=Object.values(this.elements.settings.panels).find(function(e){return!e.hidden}));var i=n.querySelector('[role^="menuitem"]');ir.call(this,i,t)}},toggleMenu:function(e){var t=this.elements.settings.popup,n=this.elements.buttons.settings;if(Ri.element(t)&&Ri.element(n)){var i=t.hidden,r=i;if(Ri.boolean(e))r=e;else if(Ri.keyboardEvent(e)&&27===e.which)r=!1;else if(Ri.event(e)){var a=t.contains(e.target);if(a||!a&&e.target!==n&&r)return}n.setAttribute("aria-expanded",r),Qi(t,!r),Xi(this.elements.container,this.config.classNames.menu.open,r),r&&Ri.keyboardEvent(e)?Br.focusFirstMenuItem.call(this,null,!0):r||i||ir.call(this,n,Ri.keyboardEvent(e))}},getMenuSize:function(e){var t=e.cloneNode(!0);t.style.position="absolute",t.style.opacity=0,t.removeAttribute("hidden"),e.parentNode.appendChild(t);var n=t.scrollWidth,i=t.scrollHeight;return Yi(t),{width:n,height:i}},showMenuPanel:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=document.getElementById("plyr-settings-".concat(this.id,"-").concat(t));if(Ri.element(i)){var r=i.parentNode,a=Array.from(r.children).find(function(e){return!e.hidden});if(dr.transitions&&!dr.reducedMotion){r.style.width="".concat(a.scrollWidth,"px"),r.style.height="".concat(a.scrollHeight,"px");var o=Br.getMenuSize.call(this,i);qi.call(this,r,sr,function t(n){n.target===r&&["width","height"].includes(n.propertyName)&&(r.style.width="",r.style.height="",Hi.call(e,r,sr,t))}),r.style.width="".concat(o.width,"px"),r.style.height="".concat(o.height,"px")}Qi(a,!0),Qi(i,!1),Br.focusFirstMenuItem.call(this,i,n)}},setDownloadLink:function(){var e=this.elements.buttons.download;Ri.element(e)&&e.setAttribute("href",this.download)},create:function(e){var t=this,n=zi("div",$i(this.config.selectors.controls.wrapper));if(this.config.controls.includes("restart")&&n.appendChild(Br.createButton.call(this,"restart")),this.config.controls.includes("rewind")&&n.appendChild(Br.createButton.call(this,"rewind")),this.config.controls.includes("play")&&n.appendChild(Br.createButton.call(this,"play")),this.config.controls.includes("fast-forward")&&n.appendChild(Br.createButton.call(this,"fast-forward")),this.config.controls.includes("progress")){var i=zi("div",$i(this.config.selectors.progress));if(i.appendChild(Br.createRange.call(this,"seek",{id:"plyr-seek-".concat(e.id)})),i.appendChild(Br.createProgress.call(this,"buffer")),this.config.tooltips.seek){var r=zi("span",{class:this.config.classNames.tooltip},"00:00");i.appendChild(r),this.elements.display.seekTooltip=r}this.elements.progress=i,n.appendChild(this.elements.progress)}if(this.config.controls.includes("current-time")&&n.appendChild(Br.createTime.call(this,"currentTime")),this.config.controls.includes("duration")&&n.appendChild(Br.createTime.call(this,"duration")),this.config.controls.includes("mute")||this.config.controls.includes("volume")){var a=zi("div",{class:"plyr__volume"});if(this.config.controls.includes("mute")&&a.appendChild(Br.createButton.call(this,"mute")),this.config.controls.includes("volume")){var o={max:1,step:.05,value:this.config.volume};a.appendChild(Br.createRange.call(this,"volume",gr(o,{id:"plyr-volume-".concat(e.id)}))),this.elements.volume=a}n.appendChild(a)}if(this.config.controls.includes("captions")&&n.appendChild(Br.createButton.call(this,"captions")),this.config.controls.includes("settings")&&!Ri.empty(this.config.settings)){var s=zi("div",{class:"plyr__menu",hidden:""});s.appendChild(Br.createButton.call(this,"settings",{"aria-haspopup":!0,"aria-controls":"plyr-settings-".concat(e.id),"aria-expanded":!1}));var l=zi("div",{class:"plyr__menu__container",id:"plyr-settings-".concat(e.id),hidden:""}),c=zi("div"),u=zi("div",{id:"plyr-settings-".concat(e.id,"-home")}),h=zi("div",{role:"menu"});u.appendChild(h),c.appendChild(u),this.elements.settings.panels.home=u,this.config.settings.forEach(function(n){var i=zi("button",gr($i(t.config.selectors.buttons.settings),{type:"button",class:"".concat(t.config.classNames.control," ").concat(t.config.classNames.control,"--forward"),role:"menuitem","aria-haspopup":!0,hidden:""}));Br.bindMenuItemShortcuts.call(t,i,n),qi(i,"click",function(){Br.showMenuPanel.call(t,n,!1)});var r=zi("span",null,Lr(n,t.config)),a=zi("span",{class:t.config.classNames.menu.value});a.innerHTML=e[n],r.appendChild(a),i.appendChild(r),h.appendChild(i);var o=zi("div",{id:"plyr-settings-".concat(e.id,"-").concat(n),hidden:""}),s=zi("button",{type:"button",class:"".concat(t.config.classNames.control," ").concat(t.config.classNames.control,"--back")});s.appendChild(zi("span",{"aria-hidden":!0},Lr(n,t.config))),s.appendChild(zi("span",{class:t.config.classNames.hidden},Lr("menuBack",t.config))),qi(o,"keydown",function(e){37===e.which&&(e.preventDefault(),e.stopPropagation(),Br.showMenuPanel.call(t,"home",!0))},!1),qi(s,"click",function(){Br.showMenuPanel.call(t,"home",!1)}),o.appendChild(s),o.appendChild(zi("div",{role:"menu"})),c.appendChild(o),t.elements.settings.buttons[n]=i,t.elements.settings.panels[n]=o}),l.appendChild(c),s.appendChild(l),n.appendChild(s),this.elements.settings.popup=l,this.elements.settings.menu=s}if(this.config.controls.includes("pip")&&dr.pip&&n.appendChild(Br.createButton.call(this,"pip")),this.config.controls.includes("airplay")&&dr.airplay&&n.appendChild(Br.createButton.call(this,"airplay")),this.config.controls.includes("download")){var d={element:"a",href:this.download,target:"_blank"},f=this.config.urls.download;!Ri.url(f)&&this.isEmbed&&gr(d,{icon:"logo-".concat(this.provider),label:this.provider}),n.appendChild(Br.createButton.call(this,"download",d))}return this.config.controls.includes("fullscreen")&&n.appendChild(Br.createButton.call(this,"fullscreen")),this.config.controls.includes("play-large")&&this.elements.container.appendChild(Br.createButton.call(this,"play-large")),this.elements.controls=n,this.isHTML5&&Br.setQualityMenu.call(this,fr.getQualityOptions.call(this)),Br.setSpeedMenu.call(this),n},inject:function(){var e=this;if(this.config.loadSprite){var t=Br.getIconUrl.call(this);t.cors&&Dr(t.url,"sprite-plyr")}this.id=Math.floor(1e4*Math.random());var n=null;this.elements.controls=null;var i={id:this.id,seektime:this.config.seekTime,title:this.config.title},r=!0;Ri.function(this.config.controls)&&(this.config.controls=this.config.controls.call(this,i)),this.config.controls||(this.config.controls=[]),Ri.element(this.config.controls)||Ri.string(this.config.controls)?n=this.config.controls:(n=Br.create.call(this,{id:this.id,seektime:this.config.seekTime,speed:this.speed,quality:this.quality,captions:zr.getLabel.call(this)}),r=!1);var a,o=function(e){var t=e;return Object.entries(i).forEach(function(e){var n=gn(e,2),i=n[0],r=n[1];t=xr(t,"{".concat(i,"}"),r)}),t};if(r&&(Ri.string(this.config.controls)?n=o(n):Ri.element(n)&&(n.innerHTML=o(n.innerHTML))),Ri.string(this.config.selectors.controls.container)&&(a=document.querySelector(this.config.selectors.controls.container)),Ri.element(a)||(a=this.elements.container),a[Ri.element(n)?"insertAdjacentElement":"insertAdjacentHTML"]("afterbegin",n),Ri.element(this.elements.controls)||Br.findElements.call(this),!Ri.empty(this.elements.buttons)){var s=function(t){var n=e.config.classNames.controlPressed;Object.defineProperty(t,"pressed",{enumerable:!0,get:function(){return Zi(t,n)},set:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];Xi(t,n,e)}})};Object.values(this.elements.buttons).filter(Boolean).forEach(function(e){Ri.array(e)||Ri.nodeList(e)?Array.from(e).filter(Boolean).forEach(s):s(e)})}if(ur.isEdge&&lr(a),this.config.tooltips.controls){var l=this.config,c=l.classNames,u=l.selectors,h="".concat(u.controls.wrapper," ").concat(u.labels," .").concat(c.hidden),d=tr.call(this,h);Array.from(d).forEach(function(t){Xi(t,e.config.classNames.hidden,!1),Xi(t,e.config.classNames.tooltip,!0)})}}};function Ur(e){var t=e;if(!(arguments.length>1&&void 0!==arguments[1])||arguments[1]){var n=document.createElement("a");n.href=t,t=n.href}try{return new URL(t)}catch(e){return null}}function Wr(e){var t=new URLSearchParams;return Ri.object(e)&&Object.entries(e).forEach(function(e){var n=gn(e,2),i=n[0],r=n[1];t.set(i,r)}),t}var zr={setup:function(){if(this.supported.ui)if(!this.isVideo||this.isYouTube||this.isHTML5&&!dr.textTracks)Ri.array(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&Br.setCaptionsMenu.call(this);else{var e,t;if(Ri.element(this.elements.captions)||(this.elements.captions=zi("div",$i(this.config.selectors.captions)),e=this.elements.captions,t=this.elements.wrapper,Ri.element(e)&&Ri.element(t)&&t.parentNode.insertBefore(e,t.nextSibling)),ur.isIE&&window.URL){var n=this.media.querySelectorAll("track");Array.from(n).forEach(function(e){var t=e.getAttribute("src"),n=Ur(t);null!==n&&n.hostname!==window.location.href.hostname&&["http:","https:"].includes(n.protocol)&&Rr(t,"blob").then(function(t){e.setAttribute("src",window.URL.createObjectURL(t))}).catch(function(){Yi(e)})})}var i=pr((navigator.languages||[navigator.language||navigator.userLanguage||"en"]).map(function(e){return e.split("-")[0]})),r=(this.storage.get("language")||this.config.captions.language||"auto").toLowerCase();if("auto"===r)r=gn(i,1)[0];var a=this.storage.get("captions");if(Ri.boolean(a)||(a=this.config.captions.active),Object.assign(this.captions,{toggled:!1,active:a,language:r,languages:i}),this.isHTML5){var o=this.config.captions.update?"addtrack removetrack":"removetrack";qi.call(this,this.media.textTracks,o,zr.update.bind(this))}setTimeout(zr.update.bind(this),0)}},update:function(){var e=this,t=zr.getTracks.call(this,!0),n=this.captions,i=n.active,r=n.language,a=n.meta,o=n.currentTrackNode,s=Boolean(t.find(function(e){return e.language===r}));this.isHTML5&&this.isVideo&&t.filter(function(e){return!a.get(e)}).forEach(function(t){e.debug.log("Track added",t),a.set(t,{default:"showing"===t.mode}),t.mode="hidden",qi.call(e,t,"cuechange",function(){return zr.updateCues.call(e)})}),(s&&this.language!==r||!t.includes(o))&&(zr.setLanguage.call(this,r),zr.toggle.call(this,i&&s)),Xi(this.elements.container,this.config.classNames.captions.enabled,!Ri.empty(t)),(this.config.controls||[]).includes("settings")&&this.config.settings.includes("captions")&&Br.setCaptionsMenu.call(this)},toggle:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.supported.ui){var n=this.captions.toggled,i=this.config.classNames.captions.active,r=Ri.nullOrUndefined(e)?!n:e;if(r!==n){if(t||(this.captions.active=r,this.storage.set({captions:r})),!this.language&&r&&!t){var a=zr.getTracks.call(this),o=zr.findTrack.call(this,[this.captions.language].concat(yn(this.captions.languages)),!0);return this.captions.language=o.language,void zr.set.call(this,a.indexOf(o))}this.elements.buttons.captions&&(this.elements.buttons.captions.pressed=r),Xi(this.elements.container,i,r),this.captions.toggled=r,Br.updateSetting.call(this,"captions"),Bi.call(this,this.media,r?"captionsenabled":"captionsdisabled")}}},set:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=zr.getTracks.call(this);if(-1!==e)if(Ri.number(e))if(e in n){if(this.captions.currentTrack!==e){this.captions.currentTrack=e;var i=n[e],r=(i||{}).language;this.captions.currentTrackNode=i,Br.updateSetting.call(this,"captions"),t||(this.captions.language=r,this.storage.set({language:r})),this.isVimeo&&this.embed.enableTextTrack(r),Bi.call(this,this.media,"languagechange")}zr.toggle.call(this,!0,t),this.isHTML5&&this.isVideo&&zr.updateCues.call(this)}else this.debug.warn("Track not found",e);else this.debug.warn("Invalid caption argument",e);else zr.toggle.call(this,!1,t)},setLanguage:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(Ri.string(e)){var n=e.toLowerCase();this.captions.language=n;var i=zr.getTracks.call(this),r=zr.findTrack.call(this,[n]);zr.set.call(this,i.indexOf(r),t)}else this.debug.warn("Invalid language argument",e)},getTracks:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Array.from((this.media||{}).textTracks||[]).filter(function(n){return!e.isHTML5||t||e.captions.meta.has(n)}).filter(function(e){return["captions","subtitles"].includes(e.kind)})},findTrack:function(e){var t,n=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=zr.getTracks.call(this),a=function(e){return Number((n.captions.meta.get(e)||{}).default)},o=Array.from(r).sort(function(e,t){return a(t)-a(e)});return e.every(function(e){return!(t=o.find(function(t){return t.language===e}))}),t||(i?o[0]:void 0)},getCurrentTrack:function(){return zr.getTracks.call(this)[this.currentTrack]},getLabel:function(e){var t=e;return!Ri.track(t)&&dr.textTracks&&this.captions.toggled&&(t=zr.getCurrentTrack.call(this)),Ri.track(t)?Ri.empty(t.label)?Ri.empty(t.language)?Lr("enabled",this.config):e.language.toUpperCase():t.label:Lr("disabled",this.config)},updateCues:function(e){if(this.supported.ui)if(Ri.element(this.elements.captions))if(Ri.nullOrUndefined(e)||Array.isArray(e)){var t=e;if(!t){var n=zr.getCurrentTrack.call(this);t=Array.from((n||{}).activeCues||[]).map(function(e){return e.getCueAsHTML()}).map(Mr)}var i=t.map(function(e){return e.trim()}).join("\n");if(i!==this.elements.captions.innerHTML){Gi(this.elements.captions);var r=zi("span",$i(this.config.selectors.caption));r.innerHTML=i,this.elements.captions.appendChild(r),Bi.call(this,this.media,"cuechange")}}else this.debug.warn("updateCues: Invalid input",e);else this.debug.warn("No captions element to render to")}},Kr={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:"16:9",clickToPlay:!0,hideControls:!0,resetOnEnd:!1,disableContextMenu:!0,loadSprite:!0,iconPrefix:"plyr",iconUrl:"https://cdn.plyr.io/3.4.7/plyr.svg",blankVideo:"https://cdn.plyr.io/static/blank.mp4",quality:{default:576,options:[4320,2880,2160,1440,1080,720,576,480,360,240]},loop:{active:!1},speed:{selected:1,options:[.5,.75,1,1.25,1.5,1.75,2]},keyboard:{focused:!0,global:!1},tooltips:{controls:!1,seek:!0},captions:{active:!1,language:"auto",update:!1},fullscreen:{enabled:!0,fallback:!0,iosNative:!1},storage:{enabled:!0,key:"plyr"},controls:["play-large","play","progress","current-time","mute","volume","captions","settings","pip","airplay","fullscreen"],settings:["captions","quality","speed"],i18n:{restart:"Restart",rewind:"Rewind {seektime}s",play:"Play",pause:"Pause",fastForward:"Forward {seektime}s",seek:"Seek",seekLabel:"{currentTime} of {duration}",played:"Played",buffered:"Buffered",currentTime:"Current time",duration:"Duration",volume:"Volume",mute:"Mute",unmute:"Unmute",enableCaptions:"Enable captions",disableCaptions:"Disable captions",download:"Download",enterFullscreen:"Enter fullscreen",exitFullscreen:"Exit fullscreen",frameTitle:"Player for {title}",captions:"Captions",settings:"Settings",menuBack:"Go back to previous menu",speed:"Speed",normal:"Normal",quality:"Quality",loop:"Loop",start:"Start",end:"End",all:"All",reset:"Reset",disabled:"Disabled",enabled:"Enabled",advertisement:"Ad",qualityBadge:{2160:"4K",1440:"HD",1080:"HD",720:"HD",576:"SD",480:"SD"}},urls:{download:null,vimeo:{sdk:"https://player.vimeo.com/api/player.js",iframe:"https://player.vimeo.com/video/{0}?{1}",api:"https://vimeo.com/api/v2/video/{0}.json"},youtube:{sdk:"https://www.youtube.com/iframe_api",api:"https://www.googleapis.com/youtube/v3/videos?id={0}&key={1}&fields=items(snippet(title))&part=snippet"},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",menu:{quality:".js-plyr__menu__list--quality"}},classNames:{type:"plyr--{0}",provider:"plyr--{0}",video:"plyr__video-wrapper",embed:"plyr__video-embed",embedContainer:"plyr__video-embed__container",poster:"plyr__poster",posterEnabled:"plyr__poster-enabled",ads:"plyr__ads",control:"plyr__control",controlPressed:"plyr__control--pressed",playing:"plyr--playing",paused:"plyr--paused",stopped:"plyr--stopped",loading:"plyr--loading",hover:"plyr--hover",tooltip:"plyr__tooltip",cues:"plyr__cues",hidden:"plyr__sr-only",hideControls:"plyr--hide-controls",isIos:"plyr--is-ios",isTouch:"plyr--is-touch",uiSupported:"plyr--full-ui",noTransition:"plyr--no-transition",display:{time:"plyr__time"},menu:{value:"plyr__menu__value",badge:"plyr__badge",open:"plyr--menu-open"},captions:{enabled:"plyr--captions-enabled",active:"plyr--captions-active"},fullscreen:{enabled:"plyr--fullscreen-enabled",fallback:"plyr--fullscreen-fallback"},pip:{supported:"plyr--pip-supported",active:"plyr--pip-active"},airplay:{supported:"plyr--airplay-supported",active:"plyr--airplay-active"},tabFocus:"plyr__tab-focus",previewThumbnails:{thumbnailContainer:"plyr__preview-thumbnail-container",scrubbingContainer:"plyr__preview-scrubbing-container",timeTextContainer:"plyr__preview-time-text-container"}},attributes:{embed:{provider:"data-plyr-provider",id:"data-plyr-embed-id"}},keys:{google:null},ads:{enabled:!1,publisherId:""},noCookie:!1,previewThumbnails:{enabled:!1}},Yr="picture-in-picture",Gr="inline",Jr={html5:"html5",youtube:"youtube",vimeo:"vimeo"},$r={audio:"audio",video:"video"};var Qr=function(){},Xr=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];dn(this,e),this.enabled=window.console&&t,this.enabled&&this.log("Debugging enabled")}return pn(e,[{key:"log",get:function(){return this.enabled?Function.prototype.bind.call(console.log,console):Qr}},{key:"warn",get:function(){return this.enabled?Function.prototype.bind.call(console.warn,console):Qr}},{key:"error",get:function(){return this.enabled?Function.prototype.bind.call(console.error,console):Qr}}]),e}();function Zr(){if(this.enabled){var e=this.player.elements.buttons.fullscreen;Ri.element(e)&&(e.pressed=this.active),Bi.call(this.player,this.target,this.active?"enterfullscreen":"exitfullscreen",!0),ur.isIos||function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(Ri.element(e)){var n=tr.call(this,"button:not(:disabled), input:not(:disabled), [tabindex]"),i=n[0],r=n[n.length-1];Fi.call(this,this.elements.container,"keydown",function(e){if("Tab"===e.key&&9===e.keyCode){var t=document.activeElement;t!==r||e.shiftKey?t===i&&e.shiftKey&&(r.focus(),e.preventDefault()):(i.focus(),e.preventDefault())}},t,!1)}}.call(this.player,this.target,this.active)}}function ea(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(t?this.scrollPosition={x:window.scrollX||0,y:window.scrollY||0}:window.scrollTo(this.scrollPosition.x,this.scrollPosition.y),document.body.style.overflow=t?"hidden":"",Xi(this.target,this.player.config.classNames.fullscreen.fallback,t),ur.isIos){var n=document.head.querySelector('meta[name="viewport"]'),i="viewport-fit=cover";n||(n=document.createElement("meta")).setAttribute("name","viewport");var r=Ri.string(n.content)&&n.content.includes(i);t?(this.cleanupViewport=!r,r||(n.content+=",".concat(i))):this.cleanupViewport&&(n.content=n.content.split(",").filter(function(e){return e.trim()!==i}).join(",")),setTimeout(function(){return lr(e.target)},100)}Zr.call(this)}var ta=function(){function e(t){var n=this;dn(this,e),this.player=t,this.prefix=e.prefix,this.property=e.property,this.scrollPosition={x:0,y:0},this.forceFallback="force"===t.config.fullscreen.fallback,qi.call(this.player,document,"ms"===this.prefix?"MSFullscreenChange":"".concat(this.prefix,"fullscreenchange"),function(){Zr.call(n)}),qi.call(this.player,this.player.elements.container,"dblclick",function(e){Ri.element(n.player.elements.controls)&&n.player.elements.controls.contains(e.target)||n.toggle()}),this.update()}return pn(e,[{key:"update",value:function(){var t;this.enabled?(t=this.forceFallback?"Fallback (forced)":e.native?"Native":"Fallback",this.player.debug.log("".concat(t," fullscreen enabled"))):this.player.debug.log("Fullscreen not supported and fallback disabled");Xi(this.player.elements.container,this.player.config.classNames.fullscreen.enabled,this.enabled)}},{key:"enter",value:function(){this.enabled&&(ur.isIos&&this.player.config.fullscreen.iosNative?this.target.webkitEnterFullscreen():!e.native||this.forceFallback?ea.call(this,!0):this.prefix?Ri.empty(this.prefix)||this.target["".concat(this.prefix,"Request").concat(this.property)]():this.target.requestFullscreen())}},{key:"exit",value:function(){if(this.enabled)if(ur.isIos&&this.player.config.fullscreen.iosNative)this.target.webkitExitFullscreen(),this.player.play();else if(!e.native||this.forceFallback)ea.call(this,!1);else if(this.prefix){if(!Ri.empty(this.prefix)){var t="moz"===this.prefix?"Cancel":"Exit";document["".concat(this.prefix).concat(t).concat(this.property)]()}}else(document.cancelFullScreen||document.exitFullscreen).call(document)}},{key:"toggle",value:function(){this.active?this.exit():this.enter()}},{key:"usingNative",get:function(){return e.native&&!this.forceFallback}},{key:"enabled",get:function(){return(e.native||this.player.config.fullscreen.fallback)&&this.player.config.fullscreen.enabled&&this.player.supported.ui&&this.player.isVideo}},{key:"active",get:function(){return!!this.enabled&&(!e.native||this.forceFallback?Zi(this.target,this.player.config.classNames.fullscreen.fallback):(this.prefix?document["".concat(this.prefix).concat(this.property,"Element")]:document.fullscreenElement)===this.target)}},{key:"target",get:function(){return ur.isIos&&this.player.config.fullscreen.iosNative?this.player.media:this.player.elements.container}}],[{key:"native",get:function(){return!!(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}},{key:"prefix",get:function(){if(Ri.function(document.exitFullscreen))return"";var e="";return["webkit","moz","ms"].some(function(t){return!(!Ri.function(document["".concat(t,"ExitFullscreen")])&&!Ri.function(document["".concat(t,"CancelFullScreen")]))&&(e=t,!0)}),e}},{key:"property",get:function(){return"moz"===this.prefix?"FullScreen":"Fullscreen"}}]),e}(),na=Math.sign||function(e){return 0==(e=+e)||e!=e?e:e<0?-1:1};function ia(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return new Promise(function(n,i){var r=new Image,a=function(){delete r.onload,delete r.onerror,(r.naturalWidth>=t?n:i)(r)};Object.assign(r,{onload:a,onerror:a,src:e})})}C(C.S,"Math",{sign:na});var ra={addStyleHook:function(){Xi(this.elements.container,this.config.selectors.container.replace(".",""),!0),Xi(this.elements.container,this.config.classNames.uiSupported,this.supported.ui)},toggleNativeControls:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&this.isHTML5?this.media.setAttribute("controls",""):this.media.removeAttribute("controls")},build:function(){var e=this;if(this.listeners.media(),!this.supported.ui)return this.debug.warn("Basic support only for ".concat(this.provider," ").concat(this.type)),void ra.toggleNativeControls.call(this,!0);Ri.element(this.elements.controls)||(Br.inject.call(this),this.listeners.controls()),ra.toggleNativeControls.call(this),this.isHTML5&&zr.setup.call(this),this.volume=null,this.muted=null,this.speed=null,this.loop=null,this.quality=null,Br.updateVolume.call(this),Br.timeUpdate.call(this),ra.checkPlaying.call(this),Xi(this.elements.container,this.config.classNames.pip.supported,dr.pip&&this.isHTML5&&this.isVideo),Xi(this.elements.container,this.config.classNames.airplay.supported,dr.airplay&&this.isHTML5),Xi(this.elements.container,this.config.classNames.isIos,ur.isIos),Xi(this.elements.container,this.config.classNames.isTouch,this.touch),this.ready=!0,setTimeout(function(){Bi.call(e,e.media,"ready")},0),ra.setTitle.call(this),this.poster&&ra.setPoster.call(this,this.poster,!1).catch(function(){}),this.config.duration&&Br.durationUpdate.call(this)},setTitle:function(){var e=Lr("play",this.config);if(Ri.string(this.config.title)&&!Ri.empty(this.config.title)&&(e+=", ".concat(this.config.title)),Array.from(this.elements.buttons.play||[]).forEach(function(t){t.setAttribute("aria-label",e)}),this.isEmbed){var t=nr.call(this,"iframe");if(!Ri.element(t))return;var n=Ri.empty(this.config.title)?"video":this.config.title,i=Lr("frameTitle",this.config);t.setAttribute("title",i.replace("{title}",n))}},togglePoster:function(e){Xi(this.elements.container,this.config.classNames.posterEnabled,e)},setPoster:function(e){var t=this;return arguments.length>1&&void 0!==arguments[1]&&!arguments[1]||!this.poster?(this.media.setAttribute("poster",e),function(){var e=this;return new Promise(function(t){return e.ready?setTimeout(t,0):qi.call(e,e.elements.container,"ready",t)}).then(function(){})}.call(this).then(function(){return ia(e)}).catch(function(n){throw e===t.poster&&ra.togglePoster.call(t,!1),n}).then(function(){if(e!==t.poster)throw new Error("setPoster cancelled by later call to setPoster")}).then(function(){return Object.assign(t.elements.poster.style,{backgroundImage:"url('".concat(e,"')"),backgroundSize:""}),ra.togglePoster.call(t,!0),e})):Promise.reject(new Error("Poster already set"))},checkPlaying:function(e){var t=this;Xi(this.elements.container,this.config.classNames.playing,this.playing),Xi(this.elements.container,this.config.classNames.paused,this.paused),Xi(this.elements.container,this.config.classNames.stopped,this.stopped),Array.from(this.elements.buttons.play||[]).forEach(function(e){e.pressed=t.playing}),Ri.event(e)&&"timeupdate"===e.type||ra.toggleControls.call(this)},checkLoading:function(e){var t=this;this.loading=["stalled","waiting"].includes(e.type),clearTimeout(this.timers.loading),this.timers.loading=setTimeout(function(){Xi(t.elements.container,t.config.classNames.loading,t.loading),ra.toggleControls.call(t)},this.loading?250:0)},toggleControls:function(e){var t=this.elements.controls;if(t&&this.config.hideControls){var n=this.touch&&this.lastSeekTime+2e3>Date.now();this.toggleControls(Boolean(e||this.loading||this.paused||t.pressed||t.hover||n))}}};function aa(e){var t=e;Ri.string(t)||Ri.nullOrUndefined(this.embed)||(t=this.embed.ratio),Ri.string(t)||(t=this.config.ratio);var n=gn(t.split(":").map(Number),2),i=100/n[0]*n[1];if(this.elements.wrapper.style.paddingBottom="".concat(i,"%"),this.isVimeo&&this.supported.ui){var r=(240-i)/4.8;this.media.style.transform="translateY(-".concat(r,"%)")}return{padding:i,ratio:t}}var oa=function(){function e(t){dn(this,e),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.setTabFocus=this.setTabFocus.bind(this),this.firstTouch=this.firstTouch.bind(this)}return pn(e,[{key:"handleKey",value:function(e){var t=this.player,n=t.elements,i=e.keyCode?e.keyCode:e.which,r="keydown"===e.type,a=r&&i===this.lastKey;if(!(e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)&&Ri.number(i)){if(r){var o=document.activeElement;if(Ri.element(o)){var s=t.config.selectors.editable;if(o!==n.inputs.seek&&er(o,s))return;if(32===e.which&&er(o,'button, [role^="menuitem"]'))return}switch([32,37,38,39,40,48,49,50,51,52,53,54,56,57,67,70,73,75,76,77,79].includes(i)&&(e.preventDefault(),e.stopPropagation()),i){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:a||(t.currentTime=t.duration/10*(i-48));break;case 32:case 75:a||t.togglePlay();break;case 38:t.increaseVolume(.1);break;case 40:t.decreaseVolume(.1);break;case 77:a||(t.muted=!t.muted);break;case 39:t.forward();break;case 37:t.rewind();break;case 70:t.fullscreen.toggle();break;case 67:a||t.toggleCaptions();break;case 76:t.loop=!t.loop}27===i&&!t.fullscreen.usingNative&&t.fullscreen.active&&t.fullscreen.toggle(),this.lastKey=i}else this.lastKey=null}}},{key:"toggleMenu",value:function(e){Br.toggleMenu.call(this.player,e)}},{key:"firstTouch",value:function(){var e=this.player,t=e.elements;e.touch=!0,Xi(t.container,e.config.classNames.isTouch,!0)}},{key:"setTabFocus",value:function(e){var t=this.player,n=t.elements;if(clearTimeout(this.focusTimer),"keydown"!==e.type||9===e.which){"keydown"===e.type&&(this.lastKeyDown=e.timeStamp);var i,r=e.timeStamp-this.lastKeyDown<=20;if("focus"!==e.type||r)i=t.config.classNames.tabFocus,Xi(tr.call(t,".".concat(i)),i,!1),this.focusTimer=setTimeout(function(){var e=document.activeElement;n.container.contains(e)&&Xi(document.activeElement,t.config.classNames.tabFocus,!0)},10)}}},{key:"global",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=this.player;t.config.keyboard.global&&Fi.call(t,window,"keydown keyup",this.handleKey,e,!1),Fi.call(t,document.body,"click",this.toggleMenu,e),Vi.call(t,document.body,"touchstart",this.firstTouch),Fi.call(t,document.body,"keydown focus blur",this.setTabFocus,e,!1,!0)}},{key:"container",value:function(){var e=this.player,t=e.config,n=e.elements,i=e.timers;!t.keyboard.global&&t.keyboard.focused&&qi.call(e,n.container,"keydown keyup",this.handleKey,!1),qi.call(e,n.container,"mousemove mouseleave touchstart touchmove enterfullscreen exitfullscreen",function(t){var r=n.controls;r&&"enterfullscreen"===t.type&&(r.pressed=!1,r.hover=!1);var a=0;["touchstart","touchmove","mousemove"].includes(t.type)&&(ra.toggleControls.call(e,!0),a=e.touch?3e3:2e3),clearTimeout(i.controls),i.controls=setTimeout(function(){return ra.toggleControls.call(e,!1)},a)});var r=function(t){if(!t)return aa.call(e);var i=n.container.getBoundingClientRect(),r=i.width,a=i.height;return aa.call(e,"".concat(r,":").concat(a))},a=function(){window.clearTimeout(i.resized),i.resized=window.setTimeout(r,50)};qi.call(e,n.container,"enterfullscreen exitfullscreen",function(t){var i=e.fullscreen,o=i.target,s=i.usingNative;if(e.isEmbed&&o===n.container){var l="enterfullscreen"===t.type,c=r(l);c.padding;!function(t,n,i){if(e.isVimeo){var r=e.elements.wrapper.firstChild,a=gn(t.split(":").map(Number),2)[1],o=gn(e.embed.ratio.split(":").map(Number),2),s=o[0],l=o[1];r.style.maxWidth=i?"".concat(a/l*s,"px"):null,r.style.margin=i?"0 auto":null}}(c.ratio,0,l),s||(l?qi.call(e,window,"resize",a):Hi.call(e,window,"resize",a))}})}},{key:"media",value:function(){var e=this,t=this.player,n=t.elements;if(qi.call(t,t.media,"timeupdate seeking seeked",function(e){return Br.timeUpdate.call(t,e)}),qi.call(t,t.media,"durationchange loadeddata loadedmetadata",function(e){return Br.durationUpdate.call(t,e)}),qi.call(t,t.media,"canplay loadeddata",function(){Qi(n.volume,!t.hasAudio),Qi(n.buttons.mute,!t.hasAudio)}),qi.call(t,t.media,"ended",function(){t.isHTML5&&t.isVideo&&t.config.resetOnEnd&&t.restart()}),qi.call(t,t.media,"progress playing seeking seeked",function(e){return Br.updateProgress.call(t,e)}),qi.call(t,t.media,"volumechange",function(e){return Br.updateVolume.call(t,e)}),qi.call(t,t.media,"playing play pause ended emptied timeupdate",function(e){return ra.checkPlaying.call(t,e)}),qi.call(t,t.media,"waiting canplay seeked playing",function(e){return ra.checkLoading.call(t,e)}),qi.call(t,t.media,"playing",function(){t.ads&&t.ads.enabled&&!t.ads.initialized&&t.ads.managerPromise.then(function(){return t.ads.play()}).catch(function(){return t.play()})}),t.supported.ui&&t.config.clickToPlay&&!t.isAudio){var i=nr.call(t,".".concat(t.config.classNames.video));if(!Ri.element(i))return;qi.call(t,n.container,"click",function(r){([n.container,i].includes(r.target)||i.contains(r.target))&&(t.touch&&t.config.hideControls||(t.ended?(e.proxy(r,t.restart,"restart"),e.proxy(r,t.play,"play")):e.proxy(r,t.togglePlay,"play")))})}t.supported.ui&&t.config.disableContextMenu&&qi.call(t,n.wrapper,"contextmenu",function(e){e.preventDefault()},!1),qi.call(t,t.media,"volumechange",function(){t.storage.set({volume:t.volume,muted:t.muted})}),qi.call(t,t.media,"ratechange",function(){Br.updateSetting.call(t,"speed"),t.storage.set({speed:t.speed})}),qi.call(t,t.media,"qualitychange",function(e){Br.updateSetting.call(t,"quality",null,e.detail.quality)}),qi.call(t,t.media,"ready qualitychange",function(){Br.setDownloadLink.call(t)});var r=t.config.events.concat(["keyup","keydown"]).join(" ");qi.call(t,t.media,r,function(e){var i=e.detail,r=void 0===i?{}:i;"error"===e.type&&(r=t.media.error),Bi.call(t,n.container,e.type,!0,r)})}},{key:"proxy",value:function(e,t,n){var i=this.player,r=i.config.listeners[n],a=!0;Ri.function(r)&&(a=r.call(i,e)),a&&Ri.function(t)&&t.call(i,e)}},{key:"bind",value:function(e,t,n,i){var r=this,a=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=this.player,s=o.config.listeners[i],l=Ri.function(s);qi.call(o,e,t,function(e){return r.proxy(e,n,i)},a&&!l)}},{key:"controls",value:function(){var e=this,t=this.player,n=t.elements,i=ur.isIE?"change":"input";if(n.buttons.play&&Array.from(n.buttons.play).forEach(function(n){e.bind(n,"click",t.togglePlay,"play")}),this.bind(n.buttons.restart,"click",t.restart,"restart"),this.bind(n.buttons.rewind,"click",t.rewind,"rewind"),this.bind(n.buttons.fastForward,"click",t.forward,"fastForward"),this.bind(n.buttons.mute,"click",function(){t.muted=!t.muted},"mute"),this.bind(n.buttons.captions,"click",function(){return t.toggleCaptions()}),this.bind(n.buttons.download,"click",function(){Bi.call(t,t.media,"download")},"download"),this.bind(n.buttons.fullscreen,"click",function(){t.fullscreen.toggle()},"fullscreen"),this.bind(n.buttons.pip,"click",function(){t.pip="toggle"},"pip"),this.bind(n.buttons.airplay,"click",t.airplay,"airplay"),this.bind(n.buttons.settings,"click",function(e){e.stopPropagation(),Br.toggleMenu.call(t,e)}),this.bind(n.buttons.settings,"keyup",function(e){var n=e.which;[13,32].includes(n)&&(13!==n?(e.preventDefault(),e.stopPropagation(),Br.toggleMenu.call(t,e)):Br.focusFirstMenuItem.call(t,null,!0))},null,!1),this.bind(n.settings.menu,"keydown",function(e){27===e.which&&Br.toggleMenu.call(t,e)}),this.bind(n.inputs.seek,"mousedown mousemove",function(e){var t=n.progress.getBoundingClientRect(),i=100/t.width*(e.pageX-t.left);e.currentTarget.setAttribute("seek-value",i)}),this.bind(n.inputs.seek,"mousedown mouseup keydown keyup touchstart touchend",function(e){var n=e.currentTarget,i=e.keyCode?e.keyCode:e.which;if(!Ri.keyboardEvent(e)||39===i||37===i){t.lastSeekTime=Date.now();var r=n.hasAttribute("play-on-seeked"),a=["mouseup","touchend","keyup"].includes(e.type);r&&a?(n.removeAttribute("play-on-seeked"),t.play()):!a&&t.playing&&(n.setAttribute("play-on-seeked",""),t.pause())}}),ur.isIos){var r=tr.call(t,'input[type="range"]');Array.from(r).forEach(function(t){return e.bind(t,i,function(e){return lr(e.target)})})}this.bind(n.inputs.seek,i,function(e){var n=e.currentTarget,i=n.getAttribute("seek-value");Ri.empty(i)&&(i=n.value),n.removeAttribute("seek-value"),t.currentTime=i/n.max*t.duration},"seek"),this.bind(n.progress,"mouseenter mouseleave mousemove",function(e){return Br.updateSeekTooltip.call(t,e)}),ur.isWebkit&&Array.from(tr.call(t,'input[type="range"]')).forEach(function(n){e.bind(n,"input",function(e){return Br.updateRangeFill.call(t,e.target)})}),t.config.toggleInvert&&!Ri.element(n.display.duration)&&this.bind(n.display.currentTime,"click",function(){0!==t.currentTime&&(t.config.invertTime=!t.config.invertTime,Br.timeUpdate.call(t))}),this.bind(n.inputs.volume,i,function(e){t.volume=e.target.value},"volume"),this.bind(n.controls,"mouseenter mouseleave",function(e){n.controls.hover=!t.touch&&"mouseenter"===e.type}),this.bind(n.controls,"mousedown mouseup touchstart touchend touchcancel",function(e){n.controls.pressed=["mousedown","touchstart"].includes(e.type)}),this.bind(n.controls,"focusin",function(){var n=t.config,i=t.elements,r=t.timers;Xi(i.controls,n.classNames.noTransition,!0),ra.toggleControls.call(t,!0),setTimeout(function(){Xi(i.controls,n.classNames.noTransition,!1)},0);var a=e.touch?3e3:4e3;clearTimeout(r.controls),r.controls=setTimeout(function(){return ra.toggleControls.call(t,!1)},a)}),this.bind(n.inputs.volume,"wheel",function(e){var n=e.webkitDirectionInvertedFromDevice,i=gn([e.deltaX,-e.deltaY].map(function(e){return n?-e:e}),2),r=i[0],a=i[1],o=Math.sign(Math.abs(r)>Math.abs(a)?r:a);t.increaseVolume(o/50);var s=t.media.volume;(1===o&&s<1||-1===o&&s>0)&&e.preventDefault()},"volume",!1)}}]),e}(),sa=g.f,la=Function.prototype,ca=/^\s*function ([^ (]*)/;"name"in la||c&&sa(la,"name",{configurable:!0,get:function(){try{return(""+this).match(ca)[1]}catch(e){return""}}}),bt("match",1,function(e,t,n,i){return[function(n){var i=e(this),r=null==n?void 0:n[t];return void 0!==r?r.call(n,i):new RegExp(n)[t](String(i))},function(e){var t=i(n,e,this);if(t.done)return t.value;var r=s(e),a=String(this);if(!r.global)return lt(r,a);var o=r.unicode;r.lastIndex=0;for(var l,c=[],u=0;null!==(l=lt(r,a));){var h=String(l[0]);c[u]=h,""===h&&(r.lastIndex=kn(a,H(r.lastIndex),o)),u++}return 0===u?null:c}]});var ua=t(function(e,t){e.exports=function(){var e=function(){},t={},n={},i={};function r(e,t){if(e){var r=i[e];if(n[e]=t,r)for(;r.length;)r[0](e,t),r.splice(0,1)}}function a(t,n){t.call&&(t={success:t}),n.length?(t.error||e)(n):(t.success||e)(t)}function o(t,n,i,r){var a,s,l=document,c=i.async,u=(i.numRetries||0)+1,h=i.before||e,d=t.replace(/^(css|img)!/,"");r=r||0,/(^css!|\.css$)/.test(t)?(a=!0,(s=l.createElement("link")).rel="stylesheet",s.href=d):/(^img!|\.(png|gif|jpg|svg)$)/.test(t)?(s=l.createElement("img")).src=d:((s=l.createElement("script")).src=t,s.async=void 0===c||c),s.onload=s.onerror=s.onbeforeload=function(e){var l=e.type[0];if(a&&"hideFocus"in s)try{s.sheet.cssText.length||(l="e")}catch(e){18!=e.code&&(l="e")}if("e"==l&&(r+=1)<u)return o(t,n,i,r);n(t,l,e.defaultPrevented)},!1!==h(t,s)&&l.head.appendChild(s)}function s(e,n,i){var s,l;if(n&&n.trim&&(s=n),l=(s?i:n)||{},s){if(s in t)throw"LoadJS";t[s]=!0}!function(e,t,n){var i,r,a=(e=e.push?e:[e]).length,s=a,l=[];for(i=function(e,n,i){if("e"==n&&l.push(e),"b"==n){if(!i)return;l.push(e)}--a||t(l)},r=0;r<s;r++)o(e[r],i,n)}(e,function(e){a(l,e),r(s,e)},l)}return s.ready=function(e,t){return function(e,t){e=e.push?e:[e];var r,a,o,s=[],l=e.length,c=l;for(r=function(e,n){n.length&&s.push(e),--c||t(s)};l--;)a=e[l],(o=n[a])?r(a,o):(i[a]=i[a]||[]).push(r)}(e,function(e){a(t,e)}),s},s.done=function(e){r(e,[])},s.reset=function(){t={},n={},i={}},s.isDefined=function(e){return e in t},s}()});function ha(e){return new Promise(function(t,n){ua(e,{success:t,error:n})})}function da(e){e&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===e&&(this.media.paused=!e,Bi.call(this,this.media,e?"play":"pause"))}var fa={setup:function(){var e=this;Xi(this.elements.wrapper,this.config.classNames.embed,!0),aa.call(this),Ri.object(window.Vimeo)?fa.ready.call(this):ha(this.config.urls.vimeo.sdk).then(function(){fa.ready.call(e)}).catch(function(t){e.debug.warn("Vimeo API failed to load",t)})},ready:function(){var e=this,t=this,n=Wr({loop:t.config.loop.active,autoplay:t.autoplay,muted:t.muted,byline:!1,portrait:!1,title:!1,speed:!0,transparent:0,gesture:"media",playsinline:!this.config.fullscreen.iosNative}),i=t.media.getAttribute("src");Ri.empty(i)&&(i=t.media.getAttribute(t.config.attributes.embed.id));var r,a=(r=i,Ri.empty(r)?null:Ri.number(Number(r))?r:r.match(/^.*(vimeo.com\/|video\/)(\d+).*/)?RegExp.$2:r),o=zi("iframe"),s=_r(t.config.urls.vimeo.iframe,a,n);o.setAttribute("src",s),o.setAttribute("allowfullscreen",""),o.setAttribute("allowtransparency",""),o.setAttribute("allow","autoplay");var l=zi("div",{poster:t.poster,class:t.config.classNames.embedContainer});l.appendChild(o),t.media=Ji(l,t.media),Rr(_r(t.config.urls.vimeo.api,a),"json").then(function(e){if(!Ri.empty(e)){var n=new URL(e[0].thumbnail_large);n.pathname="".concat(n.pathname.split("_")[0],".jpg"),ra.setPoster.call(t,n.href).catch(function(){})}}),t.embed=new window.Vimeo.Player(o,{autopause:t.config.autopause,muted:t.muted}),t.media.paused=!0,t.media.currentTime=0,t.supported.ui&&t.embed.disableTextTrack(),t.media.play=function(){return da.call(t,!0),t.embed.play()},t.media.pause=function(){return da.call(t,!1),t.embed.pause()},t.media.stop=function(){t.pause(),t.currentTime=0};var c=t.media.currentTime;Object.defineProperty(t.media,"currentTime",{get:function(){return c},set:function(e){var n=t.embed,i=t.media,r=t.paused,a=t.volume,o=r&&!n.hasPlayed;i.seeking=!0,Bi.call(t,i,"seeking"),Promise.resolve(o&&n.setVolume(0)).then(function(){return n.setCurrentTime(e)}).then(function(){return o&&n.pause()}).then(function(){return o&&n.setVolume(a)}).catch(function(){})}});var u=t.config.speed.selected;Object.defineProperty(t.media,"playbackRate",{get:function(){return u},set:function(e){t.embed.setPlaybackRate(e).then(function(){u=e,Bi.call(t,t.media,"ratechange")}).catch(function(e){"Error"===e.name&&Br.setSpeedMenu.call(t,[])})}});var h=t.config.volume;Object.defineProperty(t.media,"volume",{get:function(){return h},set:function(e){t.embed.setVolume(e).then(function(){h=e,Bi.call(t,t.media,"volumechange")})}});var d=t.config.muted;Object.defineProperty(t.media,"muted",{get:function(){return d},set:function(e){var n=!!Ri.boolean(e)&&e;t.embed.setVolume(n?0:t.config.volume).then(function(){d=n,Bi.call(t,t.media,"volumechange")})}});var f,p=t.config.loop;Object.defineProperty(t.media,"loop",{get:function(){return p},set:function(e){var n=Ri.boolean(e)?e:t.config.loop.active;t.embed.setLoop(n).then(function(){p=n})}}),t.embed.getVideoUrl().then(function(e){f=e,Br.setDownloadLink.call(t)}).catch(function(t){e.debug.warn(t)}),Object.defineProperty(t.media,"currentSrc",{get:function(){return f}}),Object.defineProperty(t.media,"ended",{get:function(){return t.currentTime===t.duration}}),Promise.all([t.embed.getVideoWidth(),t.embed.getVideoHeight()]).then(function(n){var i=gn(n,2),r=i[0],a=i[1];t.embed.ratio="".concat(r,":").concat(a),aa.call(e,t.embed.ratio)}),t.embed.setAutopause(t.config.autopause).then(function(e){t.config.autopause=e}),t.embed.getVideoTitle().then(function(n){t.config.title=n,ra.setTitle.call(e)}),t.embed.getCurrentTime().then(function(e){c=e,Bi.call(t,t.media,"timeupdate")}),t.embed.getDuration().then(function(e){t.media.duration=e,Bi.call(t,t.media,"durationchange")}),t.embed.getTextTracks().then(function(e){t.media.textTracks=e,zr.setup.call(t)}),t.embed.on("cuechange",function(e){var n=e.cues,i=(void 0===n?[]:n).map(function(e){return t=e.text,n=document.createDocumentFragment(),i=document.createElement("div"),n.appendChild(i),i.innerHTML=t,n.firstChild.innerText;var t,n,i});zr.updateCues.call(t,i)}),t.embed.on("loaded",function(){(t.embed.getPaused().then(function(e){da.call(t,!e),e||Bi.call(t,t.media,"playing")}),Ri.element(t.embed.element)&&t.supported.ui)&&t.embed.element.setAttribute("tabindex",-1)}),t.embed.on("play",function(){da.call(t,!0),Bi.call(t,t.media,"playing")}),t.embed.on("pause",function(){da.call(t,!1)}),t.embed.on("timeupdate",function(e){t.media.seeking=!1,c=e.seconds,Bi.call(t,t.media,"timeupdate")}),t.embed.on("progress",function(e){t.media.buffered=e.percent,Bi.call(t,t.media,"progress"),1===parseInt(e.percent,10)&&Bi.call(t,t.media,"canplaythrough"),t.embed.getDuration().then(function(e){e!==t.media.duration&&(t.media.duration=e,Bi.call(t,t.media,"durationchange"))})}),t.embed.on("seeked",function(){t.media.seeking=!1,Bi.call(t,t.media,"seeked")}),t.embed.on("ended",function(){t.media.paused=!0,Bi.call(t,t.media,"ended")}),t.embed.on("error",function(e){t.media.error=e,Bi.call(t,t.media,"error")}),setTimeout(function(){return ra.build.call(t)},0)}};function pa(e){e&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===e&&(this.media.paused=!e,Bi.call(this,this.media,e?"play":"pause"))}var ma={setup:function(){var e=this;Xi(this.elements.wrapper,this.config.classNames.embed,!0),aa.call(this),Ri.object(window.YT)&&Ri.function(window.YT.Player)?ma.ready.call(this):(ha(this.config.urls.youtube.sdk).catch(function(t){e.debug.warn("YouTube API failed to load",t)}),window.onYouTubeReadyCallbacks=window.onYouTubeReadyCallbacks||[],window.onYouTubeReadyCallbacks.push(function(){ma.ready.call(e)}),window.onYouTubeIframeAPIReady=function(){window.onYouTubeReadyCallbacks.forEach(function(e){e()})})},getTitle:function(e){var t=this;if(Ri.function(this.embed.getVideoData)){var n=this.embed.getVideoData().title;if(Ri.empty(n))return this.config.title=n,void ra.setTitle.call(this)}var i=this.config.keys.google;Ri.string(i)&&!Ri.empty(i)&&Rr(_r(this.config.urls.youtube.api,e,i)).then(function(e){Ri.object(e)&&(t.config.title=e.items[0].snippet.title,ra.setTitle.call(t))}).catch(function(){})},ready:function(){var e=this,t=e.media.getAttribute("id");if(Ri.empty(t)||!t.startsWith("youtube-")){var n=e.media.getAttribute("src");Ri.empty(n)&&(n=e.media.getAttribute(this.config.attributes.embed.id));var i,r,a=(i=n,Ri.empty(i)?null:i.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/)?RegExp.$2:i),o=(r=e.provider,"".concat(r,"-").concat(Math.floor(1e4*Math.random()))),s=zi("div",{id:o,poster:e.poster});e.media=Ji(s,e.media);var l=function(e){return"https://img.youtube.com/vi/".concat(a,"/").concat(e,"default.jpg")};ia(l("maxres"),121).catch(function(){return ia(l("sd"),121)}).catch(function(){return ia(l("hq"))}).then(function(t){return ra.setPoster.call(e,t.src)}).then(function(t){t.includes("maxres")||(e.elements.poster.style.backgroundSize="cover")}).catch(function(){}),e.embed=new window.YT.Player(o,{videoId:a,host:e.config.noCookie?"https://www.youtube-nocookie.com":void 0,playerVars:{autoplay:e.config.autoplay?1:0,hl:e.config.hl,controls:e.supported.ui?0:1,rel:0,showinfo:0,iv_load_policy:3,modestbranding:1,disablekb:1,playsinline:1,widget_referrer:window?window.location.href:null,cc_load_policy:e.captions.active?1:0,cc_lang_pref:e.config.captions.language},events:{onError:function(t){if(!e.media.error){var n=t.data,i={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."}[n]||"An unknown error occured";e.media.error={code:n,message:i},Bi.call(e,e.media,"error")}},onPlaybackRateChange:function(t){var n=t.target;e.media.playbackRate=n.getPlaybackRate(),Bi.call(e,e.media,"ratechange")},onReady:function(t){if(!Ri.function(e.media.play)){var n=t.target;ma.getTitle.call(e,a),e.media.play=function(){pa.call(e,!0),n.playVideo()},e.media.pause=function(){pa.call(e,!1),n.pauseVideo()},e.media.stop=function(){n.stopVideo()},e.media.duration=n.getDuration(),e.media.paused=!0,e.media.currentTime=0,Object.defineProperty(e.media,"currentTime",{get:function(){return Number(n.getCurrentTime())},set:function(t){e.paused&&!e.embed.hasPlayed&&e.embed.mute(),e.media.seeking=!0,Bi.call(e,e.media,"seeking"),n.seekTo(t)}}),Object.defineProperty(e.media,"playbackRate",{get:function(){return n.getPlaybackRate()},set:function(e){n.setPlaybackRate(e)}});var i=e.config.volume;Object.defineProperty(e.media,"volume",{get:function(){return i},set:function(t){i=t,n.setVolume(100*i),Bi.call(e,e.media,"volumechange")}});var r=e.config.muted;Object.defineProperty(e.media,"muted",{get:function(){return r},set:function(t){var i=Ri.boolean(t)?t:r;r=i,n[i?"mute":"unMute"](),Bi.call(e,e.media,"volumechange")}}),Object.defineProperty(e.media,"currentSrc",{get:function(){return n.getVideoUrl()}}),Object.defineProperty(e.media,"ended",{get:function(){return e.currentTime===e.duration}}),e.options.speed=n.getAvailablePlaybackRates(),e.supported.ui&&e.media.setAttribute("tabindex",-1),Bi.call(e,e.media,"timeupdate"),Bi.call(e,e.media,"durationchange"),clearInterval(e.timers.buffering),e.timers.buffering=setInterval(function(){e.media.buffered=n.getVideoLoadedFraction(),(null===e.media.lastBuffered||e.media.lastBuffered<e.media.buffered)&&Bi.call(e,e.media,"progress"),e.media.lastBuffered=e.media.buffered,1===e.media.buffered&&(clearInterval(e.timers.buffering),Bi.call(e,e.media,"canplaythrough"))},200),setTimeout(function(){return ra.build.call(e)},50)}},onStateChange:function(t){var n=t.target;switch(clearInterval(e.timers.playing),e.media.seeking&&[1,2].includes(t.data)&&(e.media.seeking=!1,Bi.call(e,e.media,"seeked")),t.data){case-1:Bi.call(e,e.media,"timeupdate"),e.media.buffered=n.getVideoLoadedFraction(),Bi.call(e,e.media,"progress");break;case 0:pa.call(e,!1),e.media.loop?(n.stopVideo(),n.playVideo()):Bi.call(e,e.media,"ended");break;case 1:e.media.paused&&!e.embed.hasPlayed?e.media.pause():(pa.call(e,!0),Bi.call(e,e.media,"playing"),e.timers.playing=setInterval(function(){Bi.call(e,e.media,"timeupdate")},50),e.media.duration!==n.getDuration()&&(e.media.duration=n.getDuration(),Bi.call(e,e.media,"durationchange")));break;case 2:e.muted||e.embed.unMute(),pa.call(e,!1)}Bi.call(e,e.elements.container,"statechange",!1,{code:t.data})}}})}}},ga={setup:function(){this.media?(Xi(this.elements.container,this.config.classNames.type.replace("{0}",this.type),!0),Xi(this.elements.container,this.config.classNames.provider.replace("{0}",this.provider),!0),this.isEmbed&&Xi(this.elements.container,this.config.classNames.type.replace("{0}","video"),!0),this.isVideo&&(this.elements.wrapper=zi("div",{class:this.config.classNames.video}),Ui(this.media,this.elements.wrapper),this.elements.poster=zi("div",{class:this.config.classNames.poster}),this.elements.wrapper.appendChild(this.elements.poster)),this.isHTML5?fr.extend.call(this):this.isYouTube?ma.setup.call(this):this.isVimeo&&fa.setup.call(this)):this.debug.warn("No media element found!")}},ya=function(){function e(t){var n=this;dn(this,e),this.player=t,this.publisherId=t.config.ads.publisherId,this.playing=!1,this.initialized=!1,this.elements={container:null,displayContainer:null},this.manager=null,this.loader=null,this.cuePoints=null,this.events={},this.safetyTimer=null,this.countdownTimer=null,this.managerPromise=new Promise(function(e,t){n.on("loaded",e),n.on("error",t)}),this.load()}return pn(e,[{key:"load",value:function(){var e=this;this.enabled&&(Ri.object(window.google)&&Ri.object(window.google.ima)?this.ready():ha(this.player.config.urls.googleIMA.sdk).then(function(){e.ready()}).catch(function(){e.trigger("error",new Error("Google IMA SDK failed to load"))}))}},{key:"ready",value:function(){var e=this;this.startSafetyTimer(12e3,"ready()"),this.managerPromise.then(function(){e.clearSafetyTimer("onAdsManagerLoaded()")}),this.listeners(),this.setupIMA()}},{key:"setupIMA",value:function(){this.elements.container=zi("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),this.elements.displayContainer=new google.ima.AdDisplayContainer(this.elements.container),this.requestAds()}},{key:"requestAds",value:function(){var e=this,t=this.player.elements.container;try{this.loader=new google.ima.AdsLoader(this.elements.displayContainer),this.loader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,function(t){return e.onAdsManagerLoaded(t)},!1),this.loader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,function(t){return e.onAdError(t)},!1);var n=new google.ima.AdsRequest;n.adTagUrl=this.tagUrl,n.linearAdSlotWidth=t.offsetWidth,n.linearAdSlotHeight=t.offsetHeight,n.nonLinearAdSlotWidth=t.offsetWidth,n.nonLinearAdSlotHeight=t.offsetHeight,n.forceNonLinearFullSlot=!1,n.setAdWillPlayMuted(!this.player.muted),this.loader.requestAds(n)}catch(e){this.onAdError(e)}}},{key:"pollCountdown",value:function(){var e=this;if(!(arguments.length>0&&void 0!==arguments[0]&&arguments[0]))return clearInterval(this.countdownTimer),void this.elements.container.removeAttribute("data-badge-text");this.countdownTimer=setInterval(function(){var t=Vr(Math.max(e.manager.getRemainingTime(),0)),n="".concat(Lr("advertisement",e.player.config)," - ").concat(t);e.elements.container.setAttribute("data-badge-text",n)},100)}},{key:"onAdsManagerLoaded",value:function(e){var t=this;if(this.enabled){var n=new google.ima.AdsRenderingSettings;n.restoreCustomPlaybackStateOnAdBreakComplete=!0,n.enablePreloading=!0,this.manager=e.getAdsManager(this.player,n),this.cuePoints=this.manager.getCuePoints(),Ri.empty(this.cuePoints)||this.cuePoints.forEach(function(e){if(0!==e&&-1!==e&&e<t.player.duration){var n=t.player.elements.progress;if(Ri.element(n)){var i=100/t.player.duration*e,r=zi("span",{class:t.player.config.classNames.cues});r.style.left="".concat(i.toString(),"%"),n.appendChild(r)}}}),this.manager.setVolume(this.player.volume),this.manager.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,function(e){return t.onAdError(e)}),Object.keys(google.ima.AdEvent.Type).forEach(function(e){t.manager.addEventListener(google.ima.AdEvent.Type[e],function(e){return t.onAdEvent(e)})}),this.trigger("loaded")}}},{key:"onAdEvent",value:function(e){var t=this,n=this.player.elements.container,i=e.getAd(),r=function(e){var n="ads".concat(e.replace(/_/g,"").toLowerCase());Bi.call(t.player,t.player.media,n)};switch(e.type){case google.ima.AdEvent.Type.LOADED:this.trigger("loaded"),r(e.type),this.pollCountdown(!0),i.isLinear()||(i.width=n.offsetWidth,i.height=n.offsetHeight);break;case google.ima.AdEvent.Type.ALL_ADS_COMPLETED:r(e.type),this.loadAds();break;case google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED:r(e.type),this.pauseContent();break;case google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED:r(e.type),this.pollCountdown(),this.resumeContent();break;case google.ima.AdEvent.Type.STARTED:case google.ima.AdEvent.Type.MIDPOINT:case google.ima.AdEvent.Type.COMPLETE:case google.ima.AdEvent.Type.IMPRESSION:case google.ima.AdEvent.Type.CLICK:r(e.type)}}},{key:"onAdError",value:function(e){this.cancel(),this.player.debug.warn("Ads error",e)}},{key:"listeners",value:function(){var e,t=this,n=this.player.elements.container;this.player.on("ended",function(){t.loader.contentComplete()}),this.player.on("seeking",function(){return e=t.player.currentTime}),this.player.on("seeked",function(){var n=t.player.currentTime;Ri.empty(t.cuePoints)||t.cuePoints.forEach(function(i,r){e<i&&i<n&&(t.manager.discardAdBreak(),t.cuePoints.splice(r,1))})}),window.addEventListener("resize",function(){t.manager&&t.manager.resize(n.offsetWidth,n.offsetHeight,google.ima.ViewMode.NORMAL)})}},{key:"play",value:function(){var e=this,t=this.player.elements.container;this.managerPromise||this.resumeContent(),this.managerPromise.then(function(){e.elements.displayContainer.initialize();try{e.initialized||(e.manager.init(t.offsetWidth,t.offsetHeight,google.ima.ViewMode.NORMAL),e.manager.start()),e.initialized=!0}catch(t){e.onAdError(t)}}).catch(function(){})}},{key:"resumeContent",value:function(){this.elements.container.style.zIndex="",this.playing=!1,this.player.currentTime<this.player.duration&&this.player.play()}},{key:"pauseContent",value:function(){this.elements.container.style.zIndex=3,this.playing=!0,this.player.pause()}},{key:"cancel",value:function(){this.initialized&&this.resumeContent(),this.trigger("error"),this.loadAds()}},{key:"loadAds",value:function(){var e=this;this.managerPromise.then(function(){e.manager&&e.manager.destroy(),e.managerPromise=new Promise(function(t){e.on("loaded",t),e.player.debug.log(e.manager)}),e.requestAds()}).catch(function(){})}},{key:"trigger",value:function(e){for(var t=this,n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];var a=this.events[e];Ri.array(a)&&a.forEach(function(e){Ri.function(e)&&e.apply(t,i)})}},{key:"on",value:function(e,t){return Ri.array(this.events[e])||(this.events[e]=[]),this.events[e].push(t),this}},{key:"startSafetyTimer",value:function(e,t){var n=this;this.player.debug.log("Safety timer invoked from: ".concat(t)),this.safetyTimer=setTimeout(function(){n.cancel(),n.clearSafetyTimer("startSafetyTimer()")},e)}},{key:"clearSafetyTimer",value:function(e){Ri.nullOrUndefined(this.safetyTimer)||(this.player.debug.log("Safety timer cleared from: ".concat(e)),clearTimeout(this.safetyTimer),this.safetyTimer=null)}},{key:"enabled",get:function(){return this.player.isHTML5&&this.player.isVideo&&this.player.config.ads.enabled&&!Ri.empty(this.publisherId)}},{key:"tagUrl",get:function(){var e={AV_PUBLISHERID:"58c25bb0073ef448b1087ad6",AV_CHANNELID:"5a0458dc28a06145e4519d21",AV_URL:window.location.hostname,cb:Date.now(),AV_WIDTH:640,AV_HEIGHT:480,AV_CDIM2:this.publisherId};return"".concat("https://go.aniview.com/api/adserver6/vast/","?").concat(Wr(e))}}]),e}(),va=ne(6),ba=!0;"findIndex"in[]&&Array(1).findIndex(function(){ba=!1}),C(C.P+C.F*ba,"Array",{findIndex:function(e){return va(this,e,arguments.length>1?arguments[1]:void 0)}}),ae("findIndex");var wa={f:M},ka=g.f,Ta=function(e){var t=a.Symbol||(a.Symbol=r.Symbol||{});"_"==e.charAt(0)||e in t||ka(t,e,{value:wa.f(e)})};Ta("asyncIterator");var Ea=Ae.f,Sa={}.toString,Aa="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],Ca={f:function(e){return Aa&&"[object Window]"==Sa.call(e)?function(e){try{return Ea(e)}catch(e){return Aa.slice()}}(e):Ea(ce(e))}},Pa=Jt.KEY,_a=he.f,xa=g.f,Ia=Ca.f,Na=r.Symbol,Ma=r.JSON,Oa=Ma&&Ma.stringify,La=M("_hidden"),ja=M("toPrimitive"),Ra={}.propertyIsEnumerable,Da=N("symbol-registry"),Fa=N("symbols"),qa=N("op-symbols"),Ha=Object.prototype,Va="function"==typeof Na,Ba=r.QObject,Ua=!Ba||!Ba.prototype||!Ba.prototype.findChild,Wa=c&&l(function(){return 7!=He(xa({},"a",{get:function(){return xa(this,"a",{value:7}).a}})).a})?function(e,t,n){var i=_a(Ha,t);i&&delete Ha[t],xa(e,t,n),i&&e!==Ha&&xa(Ha,t,i)}:xa,za=function(e){var t=Fa[e]=He(Na.prototype);return t._k=e,t},Ka=Va&&"symbol"==typeof Na.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof Na},Ya=function(e,t,n){return e===Ha&&Ya(qa,t,n),s(e),t=p(t,!0),s(n),w(Fa,t)?(n.enumerable?(w(e,La)&&e[La][t]&&(e[La][t]=!1),n=He(n,{enumerable:y(0,!1)})):(w(e,La)||xa(e,La,y(1,{})),e[La][t]=!0),Wa(e,t,n)):xa(e,t,n)},Ga=function(e,t){s(e);for(var n,i=function(e){var t=Oe(e),n=$t.f;if(n)for(var i,r=n(e),a=le.f,o=0;r.length>o;)a.call(e,i=r[o++])&&t.push(i);return t}(t=ce(t)),r=0,a=i.length;a>r;)Ya(e,n=i[r++],t[n]);return e},Ja=function(e){var t=Ra.call(this,e=p(e,!0));return!(this===Ha&&w(Fa,e)&&!w(qa,e))&&(!(t||!w(this,e)||!w(Fa,e)||w(this,La)&&this[La][e])||t)},$a=function(e,t){if(e=ce(e),t=p(t,!0),e!==Ha||!w(Fa,t)||w(qa,t)){var n=_a(e,t);return!n||!w(Fa,t)||w(e,La)&&e[La][t]||(n.enumerable=!0),n}},Qa=function(e){for(var t,n=Ia(ce(e)),i=[],r=0;n.length>r;)w(Fa,t=n[r++])||t==La||t==Pa||i.push(t);return i},Xa=function(e){for(var t,n=e===Ha,i=Ia(n?qa:ce(e)),r=[],a=0;i.length>a;)!w(Fa,t=i[a++])||n&&!w(Ha,t)||r.push(Fa[t]);return r};Va||(S((Na=function(){if(this instanceof Na)throw TypeError("Symbol is not a constructor!");var e=E(arguments.length>0?arguments[0]:void 0),t=function(n){this===Ha&&t.call(qa,n),w(this,La)&&w(this[La],e)&&(this[La][e]=!1),Wa(this,e,y(1,n))};return c&&Ua&&Wa(Ha,e,{configurable:!0,set:t}),za(e)}).prototype,"toString",function(){return this._k}),he.f=$a,g.f=Ya,Ae.f=Ca.f=Qa,le.f=Ja,$t.f=Xa,c&&S(Ha,"propertyIsEnumerable",Ja,!0),wa.f=function(e){return za(M(e))}),C(C.G+C.W+C.F*!Va,{Symbol:Na});for(var Za="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),eo=0;Za.length>eo;)M(Za[eo++]);for(var to=Oe(M.store),no=0;to.length>no;)Ta(to[no++]);C(C.S+C.F*!Va,"Symbol",{for:function(e){return w(Da,e+="")?Da[e]:Da[e]=Na(e)},keyFor:function(e){if(!Ka(e))throw TypeError(e+" is not a symbol!");for(var t in Da)if(Da[t]===e)return t},useSetter:function(){Ua=!0},useSimple:function(){Ua=!1}}),C(C.S+C.F*!Va,"Object",{create:function(e,t){return void 0===t?He(e):Ga(He(e),t)},defineProperty:Ya,defineProperties:Ga,getOwnPropertyDescriptor:$a,getOwnPropertyNames:Qa,getOwnPropertySymbols:Xa}),Ma&&C(C.S+C.F*(!Va||l(function(){var e=Na();return"[null]"!=Oa([e])||"{}"!=Oa({a:e})||"{}"!=Oa(Object(e))})),"JSON",{stringify:function(e){for(var t,n,i=[e],r=1;arguments.length>r;)i.push(arguments[r++]);if(n=t=i[1],(o(t)||void 0!==e)&&!Ka(e))return Z(t)||(t=function(e,t){if("function"==typeof n&&(t=n.call(this,e,t)),!Ka(t))return t}),i[1]=t,Oa.apply(Ma,i)}}),Na.prototype[ja]||v(Na.prototype,ja,Na.prototype.valueOf),At(Na,"Symbol"),At(Math,"Math",!0),At(r.JSON,"JSON",!0);var io,ro=function(){function e(t){dn(this,e),this.player=t,this.thumbnailsDefs=[],this.lastMousemoveEventTime=Date.now(),this.mouseDown=!1,this.loadedImages=[],this.enabled&&this.load()}return pn(e,[{key:"load",value:function(){var e=this;this.player.config.tooltips.seek=!1,this.getThumbnailsDefs().then(function(){e.listeners(),e.elements(),e.determineContainerAutoSizing()})}},{key:"getThumbnailsDefs",value:function(){var e=this;return new Promise(function(t,n){if(!e.player.config.previewThumbnails.src)throw new Error("Missing previewThumbnails.src config attribute");var i=e.player.config.previewThumbnails.src,r="string"==typeof i?[i]:i,a=[],o=!0,s=!1,l=void 0;try{for(var c,u=r[Symbol.iterator]();!(o=(c=u.next()).done);o=!0){var h=c.value;a.push(e.getThumbnailDef(h))}}catch(e){s=!0,l=e}finally{try{o||null==u.return||u.return()}finally{if(s)throw l}}Promise.all(a).then(function(){e.thumbnailsDefs.sort(function(e,t){return e.height-t.height}),e.player.debug.log("Preview thumbnails: thumbnailsDefs: "+JSON.stringify(e.thumbnailsDefs,null,4)),t()})})}},{key:"getThumbnailDef",value:function(e){var t=this;return new Promise(function(n,i){Rr(e).then(function(i){var r={frames:t.parseVtt(i),height:null,urlPrefix:""};r.frames[0].text.startsWith("/")||(r.urlPrefix=e.substring(0,e.lastIndexOf("/")+1));var a=new Image;a.src=r.urlPrefix+r.frames[0].text,a.onload=function(){r.height=a.naturalHeight,r.width=a.naturalWidth,t.thumbnailsDefs.push(r),n()}})})}},{key:"listeners",value:function(){var e=this;qi.call(this.player,this.player.elements.progress,"mousemove",function(t){if(e.player.media.duration){var n=e.player.elements.progress.getBoundingClientRect(),i=100/n.width*(t.pageX-n.left);e.seekTime=e.player.media.duration*(i/100),e.seekTime<0&&(e.seekTime=0),e.seekTime>e.player.media.duration-1&&(e.seekTime=e.player.media.duration-1),e.mousePosX=t.pageX,e.player.elements.display.previewThumbnailTimeText.innerText=Vr(e.seekTime),e.showImageAtCurrentTime()}}),qi.call(this.player,this.player.elements.progress,"touchmove",function(t){e.player.media.duration&&(e.seekTime=e.player.media.duration*(e.player.elements.inputs.seek.value/100),e.showImageAtCurrentTime())}),qi.call(this.player,this.player.elements.progress,"mouseleave click",function(){e.hideThumbContainer(!0)}),this.player.on("play",function(){e.hideThumbContainer(!0)}),this.player.on("seeked",function(){e.hideThumbContainer(!1)}),qi.call(this.player,this.player.elements.progress,"mousedown touchstart",function(t){t.button&&0!==t.button||(e.mouseDown=!0,e.player.media.duration&&(e.showScrubbingContainer(),e.hideThumbContainer(!0),e.showImageAtCurrentTime()))}),qi.call(this.player,this.player.media,"timeupdate",function(){e.timeAtLastTimeupdate=e.player.media.currentTime}),qi.call(this.player,this.player.elements.progress,"mouseup touchend",function(){e.mouseDown=!1,Math.ceil(e.timeAtLastTimeupdate)===Math.ceil(e.player.media.currentTime)?e.hideScrubbingContainer():Vi.call(e.player,e.player.media,"timeupdate",function(){e.mouseDown||e.hideScrubbingContainer()})})}},{key:"elements",value:function(){var e=zi("div",{class:this.player.config.classNames.previewThumbnails.thumbnailContainer});this.player.elements.progress.appendChild(e),this.player.elements.display.previewThumbnailContainer=e;var t=zi("div",{class:this.player.config.classNames.previewThumbnails.timeTextContainer});this.player.elements.display.previewThumbnailContainer.appendChild(t);var n=zi("span",{},"00:00");t.appendChild(n),this.player.elements.display.previewThumbnailTimeText=n;var i=zi("div",{class:this.player.config.classNames.previewThumbnails.scrubbingContainer});this.player.elements.wrapper.appendChild(i),this.player.elements.display.previewScrubbingContainer=i}},{key:"showImageAtCurrentTime",value:function(){var e=this;this.mouseDown?this.setScrubbingContainerSize():(this.showThumbContainer(),this.setThumbContainerSizeAndPos());for(var t=this.thumbnailsDefs[0].frames.findIndex(function(t){return e.seekTime>=t.startTime&&e.seekTime<=t.endTime}),n=0,i=1;i<this.thumbnailsDefs.length;i++)this.loadedImages.includes(this.thumbnailsDefs[i].frames[t].text)&&(n=i);t!==this.showingThumb&&(this.showingThumb=t,this.loadImage(n))}},{key:"loadImage",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=this.showingThumb,i=this.thumbnailsDefs[t].frames[n],r=this.thumbnailsDefs[t].frames[n].text,a=this.thumbnailsDefs[t].urlPrefix+r;if(this.currentImageElement&&this.currentImageElement.getAttribute("data-thumbfilename")===r)this.showImage(this.currentImageElement,i,t,n,r,!1),this.currentImageElement.setAttribute("data-thumbnum",n),this.removeOldImages(this.currentImageElement);else{this.loadingImage&&this.usingJpegSprites&&(this.loadingImage.onload=null);var o=new Image;o.src=a,o.setAttribute("data-thumbnum",n),o.setAttribute("data-thumbfilename",r),this.showingThumbFilename=r,o.onload=function(){return e.showImage(o,i,t,n,r,!0)},this.loadingImage=o,this.removeOldImages(o)}}},{key:"showImage",value:function(e,t,n,i,r){var a=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];this.player.debug.log("Showing thumb: "+r+". num: "+i+". qual: "+n+". newimg: "+a),this.setImageSizeAndOffset(e,t),a&&(this.currentContainer.appendChild(e),this.currentImageElement=e,this.loadedImages.includes(r)||this.loadedImages.push(r)),this.preloadNearby(i,!0).then(this.preloadNearby(i,!1)).then(this.getHigherQuality(n,e,t,r))}},{key:"removeOldImages",value:function(e){for(var t=this,n=Array.from(this.currentContainer.children),i=function(){var i=n[r];if("IMG"===i.tagName){var a=t.usingJpegSprites?500:1e3;if(i.getAttribute("data-thumbnum")!==e.getAttribute("data-thumbnum")&&!i.getAttribute("data-deleting")){i.setAttribute("data-deleting","true");var o=t.currentContainer;setTimeout(function(){o.removeChild(i),t.player.debug.log("Removing thumb: "+i.getAttribute("data-thumbfilename"))},a)}}},r=0;r<n.length;r++)i()}},{key:"preloadNearby",value:function(e){var t=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return new Promise(function(i,r){setTimeout(function(){var r=t.thumbnailsDefs[0].frames[e].text;if(t.showingThumbFilename===r){var a;a=n?t.thumbnailsDefs[0].frames.slice(e):t.thumbnailsDefs[0].frames.slice(0,e).reverse();var o=!1,s=!0,l=!1,c=void 0;try{for(var u,h=function(){var e=u.value.text;if(e!==r){if(!t.loadedImages.includes(e)){o=!0,t.player.debug.log("Preloading thumb filename: "+e);var n=t.thumbnailsDefs[0].urlPrefix+e,a=new Image;a.src=n,a.onload=function(){t.player.debug.log("Preloaded thumb filename: "+e),t.loadedImages.includes(e)||t.loadedImages.push(e),i()}}return"break"}},d=a[Symbol.iterator]();!(s=(u=d.next()).done);s=!0){if("break"===h())break}}catch(e){l=!0,c=e}finally{try{s||null==d.return||d.return()}finally{if(l)throw c}}o||i()}},300)})}},{key:"getHigherQuality",value:function(e,t,n,i){var r=this;if(e<this.thumbnailsDefs.length-1){var a=t.naturalHeight;this.usingJpegSprites&&(a=n.h),a<this.thumbContainerHeight&&setTimeout(function(){r.showingThumbFilename===i&&(r.player.debug.log("Showing higher quality thumb for: "+i),r.loadImage(e+1))},300)}}},{key:"showThumbContainer",value:function(){this.player.elements.display.previewThumbnailContainer.style.opacity=1}},{key:"hideThumbContainer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.player.elements.display.previewThumbnailContainer.style.opacity=0,e&&(this.showingThumb=null,this.showingThumbFilename=null)}},{key:"showScrubbingContainer",value:function(){this.player.elements.display.previewScrubbingContainer.style.opacity=1}},{key:"hideScrubbingContainer",value:function(){this.player.elements.display.previewScrubbingContainer.style.opacity=0,this.showingThumb=null,this.showingThumbFilename=null}},{key:"determineContainerAutoSizing",value:function(){this.player.elements.display.previewThumbnailContainer.clientHeight>20&&(this.sizeSpecifiedInCSS=!0)}},{key:"setThumbContainerSizeAndPos",value:function(){if(!this.sizeSpecifiedInCSS){var e=this.thumbContainerHeight*this.thumbAspectRatio;this.player.elements.display.previewThumbnailContainer.style.height="".concat(this.thumbContainerHeight,"px"),this.player.elements.display.previewThumbnailContainer.style.width="".concat(e,"px")}this.setThumbContainerPos()}},{key:"setThumbContainerPos",value:function(){var e=this.player.elements.progress.getBoundingClientRect(),t=this.player.elements.container.getBoundingClientRect(),n=this.player.elements.display.previewThumbnailContainer,i=t.left-e.left+10,r=t.right-e.left-n.clientWidth-10,a=this.mousePosX-e.left-n.clientWidth/2;a<i&&(a=i),a>r&&(a=r),n.style.left=a+"px"}},{key:"setScrubbingContainerSize",value:function(){this.player.elements.display.previewScrubbingContainer.style.width="".concat(this.player.media.clientWidth,"px"),this.player.elements.display.previewScrubbingContainer.style.height="".concat(this.player.media.clientWidth/this.thumbAspectRatio,"px")}},{key:"setImageSizeAndOffset",value:function(e,t){if(this.usingJpegSprites){var n=this.thumbContainerHeight/t.h;e.style.height="".concat(e.naturalHeight*n,"px"),e.style.width="".concat(e.naturalWidth*n,"px"),e.style.left="-".concat(Math.ceil(t.x*n),"px"),e.style.top="-".concat(t.y*n,"px")}}},{key:"parseVtt",value:function(e){var t=[],n=e.split(/\r\n\r\n|\n\n|\r\r/),i=!0,r=!1,a=void 0;try{for(var o,s=n[Symbol.iterator]();!(i=(o=s.next()).done);i=!0){var l=o.value,c={},u=!0,h=!1,d=void 0;try{for(var f,p=l.split(/\r\n|\n|\r/)[Symbol.iterator]();!(u=(f=p.next()).done);u=!0){var m=f.value;if(null==c.startTime){var g=m.match(/([0-9]{2}):([0-9]{2}):([0-9]{2}).([0-9]{2,3})( ?--> ?)([0-9]{2}):([0-9]{2}):([0-9]{2}).([0-9]{2,3})/);g&&(c.startTime=60*Number(g[1])*60+60*Number(g[2])+Number(g[3])+Number("0."+g[4]),c.endTime=60*Number(g[6])*60+60*Number(g[7])+Number(g[8])+Number("0."+g[9]))}else if(m.trim().length>0&&!c.text){var y=m.trim().split("#xywh=");if(c.text=y[0],y[1]){var v=y[1].split(",");c.x=v[0],c.y=v[1],c.w=v[2],c.h=v[3]}}}}catch(e){h=!0,d=e}finally{try{u||null==p.return||p.return()}finally{if(h)throw d}}c.text&&t.push(c)}}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return t}},{key:"enabled",get:function(){return this.player.isHTML5&&this.player.isVideo&&this.player.config.previewThumbnails.enabled}},{key:"currentContainer",get:function(){return this.mouseDown?this.player.elements.display.previewScrubbingContainer:this.player.elements.display.previewThumbnailContainer}},{key:"usingJpegSprites",get:function(){return!!this.thumbnailsDefs[0].frames[0].w}},{key:"thumbAspectRatio",get:function(){return this.usingJpegSprites?this.thumbnailsDefs[0].frames[0].w/this.thumbnailsDefs[0].frames[0].h:this.thumbnailsDefs[0].width/this.thumbnailsDefs[0].height}},{key:"thumbContainerHeight",get:function(){return this.mouseDown?this.player.media.clientWidth/this.thumbAspectRatio:this.player.media.clientWidth/this.thumbAspectRatio/4}},{key:"currentImageElement",get:function(){return this.mouseDown?this.currentScrubbingImageElement:this.currentThumbnailImageElement},set:function(e){this.mouseDown?this.currentScrubbingImageElement=e:this.currentThumbnailImageElement=e}}]),e}(),ao={insertElements:function(e,t){var n=this;Ri.string(t)?Ki(e,this.media,{src:t}):Ri.array(t)&&t.forEach(function(t){Ki(e,n.media,t)})},change:function(e){var t=this;mr(e,"sources.length")?(fr.cancelRequests.call(this),this.destroy.call(this,function(){t.options.quality=[],Yi(t.media),t.media=null,Ri.element(t.elements.container)&&t.elements.container.removeAttribute("class");var n=e.sources,i=e.type,r=gn(n,1)[0],a=r.provider,o=void 0===a?Jr.html5:a,s=r.src,l="html5"===o?i:"div",c="html5"===o?{}:{src:s};Object.assign(t,{provider:o,type:i,supported:dr.check(i,o,t.config.playsinline),media:zi(l,c)}),t.elements.container.appendChild(t.media),Ri.boolean(e.autoplay)&&(t.config.autoplay=e.autoplay),t.isHTML5&&(t.config.crossorigin&&t.media.setAttribute("crossorigin",""),t.config.autoplay&&t.media.setAttribute("autoplay",""),Ri.empty(e.poster)||(t.poster=e.poster),t.config.loop.active&&t.media.setAttribute("loop",""),t.config.muted&&t.media.setAttribute("muted",""),t.config.playsinline&&t.media.setAttribute("playsinline","")),ra.addStyleHook.call(t),t.isHTML5&&ao.insertElements.call(t,"source",n),t.config.title=e.title,ga.setup.call(t),t.isHTML5&&Object.keys(e).includes("tracks")&&ao.insertElements.call(t,"track",e.tracks),(t.isHTML5||t.isEmbed&&!t.supported.ui)&&ra.build.call(t),t.isHTML5&&t.media.load(),t.fullscreen.update()},!0)):this.debug.warn("Invalid source format")}},oo=function(){function e(t,n){var i=this;if(dn(this,e),this.timers={},this.ready=!1,this.loading=!1,this.failed=!1,this.touch=dr.touch,this.media=t,Ri.string(this.media)&&(this.media=document.querySelectorAll(this.media)),(window.jQuery&&this.media instanceof jQuery||Ri.nodeList(this.media)||Ri.array(this.media))&&(this.media=this.media[0]),this.config=gr({},Kr,e.defaults,n||{},function(){try{return JSON.parse(i.media.getAttribute("data-plyr-config"))}catch(e){return{}}}()),this.elements={container:null,captions:null,buttons:{},display:{},progress:{},inputs:{},settings:{popup:null,menu:null,panels:{},buttons:{}}},this.captions={active:null,currentTrack:-1,meta:new WeakMap},this.fullscreen={active:!1},this.options={speed:[],quality:[]},this.debug=new Xr(this.config.debug),this.debug.log("Config",this.config),this.debug.log("Support",dr),!Ri.nullOrUndefined(this.media)&&Ri.element(this.media))if(this.media.plyr)this.debug.warn("Target already setup");else if(this.config.enabled)if(dr.check().api){var r=this.media.cloneNode(!0);r.autoplay=!1,this.elements.original=r;var a=this.media.tagName.toLowerCase(),o=null,s=null;switch(a){case"div":if(o=this.media.querySelector("iframe"),Ri.element(o)){if(s=Ur(o.getAttribute("src")),this.provider=function(e){return/^(https?:\/\/)?(www\.)?(youtube\.com|youtube-nocookie\.com|youtu\.?be)\/.+$/.test(e)?Jr.youtube:/^https?:\/\/player.vimeo.com\/video\/\d{0,9}(?=\b|\/)/.test(e)?Jr.vimeo:null}(s.toString()),this.elements.container=this.media,this.media=o,this.elements.container.className="",s.search.length){var l=["1","true"];l.includes(s.searchParams.get("autoplay"))&&(this.config.autoplay=!0),l.includes(s.searchParams.get("loop"))&&(this.config.loop.active=!0),this.isYouTube?(this.config.playsinline=l.includes(s.searchParams.get("playsinline")),this.config.hl=s.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(Ri.empty(this.provider)||!Object.keys(Jr).includes(this.provider))return void this.debug.error("Setup failed: Invalid provider");this.type=$r.video;break;case"video":case"audio":this.type=a,this.provider=Jr.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=dr.check(this.type,this.provider,this.config.playsinline),this.supported.api?(this.eventListeners=[],this.listeners=new oa(this),this.storage=new jr(this),this.media.plyr=this,Ri.element(this.elements.container)||(this.elements.container=zi("div",{tabindex:0}),Ui(this.media,this.elements.container)),ra.addStyleHook.call(this),ga.setup.call(this),this.config.debug&&qi.call(this,this.elements.container,this.config.events.join(" "),function(e){i.debug.log("event: ".concat(e.type))}),(this.isHTML5||this.isEmbed&&!this.supported.ui)&&ra.build.call(this),this.listeners.container(),this.listeners.global(),this.fullscreen=new ta(this),this.config.ads.enabled&&(this.ads=new ya(this)),this.config.autoplay&&this.play(),this.lastSeekTime=0,this.config.previewThumbnails.enabled&&(this.previewThumbnails=new ro(this))):this.debug.error("Setup failed: no support")}else this.debug.error("Setup failed: no support");else this.debug.error("Setup failed: disabled by config");else this.debug.error("Setup failed: no suitable element passed")}return pn(e,[{key:"play",value:function(){return Ri.function(this.media.play)?this.media.play():null}},{key:"pause",value:function(){this.playing&&Ri.function(this.media.pause)&&this.media.pause()}},{key:"togglePlay",value:function(e){(Ri.boolean(e)?e:!this.playing)?this.play():this.pause()}},{key:"stop",value:function(){this.isHTML5?(this.pause(),this.restart()):Ri.function(this.media.stop)&&this.media.stop()}},{key:"restart",value:function(){this.currentTime=0}},{key:"rewind",value:function(e){this.currentTime=this.currentTime-(Ri.number(e)?e:this.config.seekTime)}},{key:"forward",value:function(e){this.currentTime=this.currentTime+(Ri.number(e)?e:this.config.seekTime)}},{key:"increaseVolume",value:function(e){var t=this.media.muted?0:this.volume;this.volume=t+(Ri.number(e)?e:0)}},{key:"decreaseVolume",value:function(e){this.increaseVolume(-e)}},{key:"toggleCaptions",value:function(e){zr.toggle.call(this,e,!1)}},{key:"airplay",value:function(){dr.airplay&&this.media.webkitShowPlaybackTargetPicker()}},{key:"toggleControls",value:function(e){if(this.supported.ui&&!this.isAudio){var t=Zi(this.elements.container,this.config.classNames.hideControls),n=void 0===e?void 0:!e,i=Xi(this.elements.container,this.config.classNames.hideControls,n);if(i&&this.config.controls.includes("settings")&&!Ri.empty(this.config.settings)&&Br.toggleMenu.call(this,!1),i!==t){var r=i?"controlshidden":"controlsshown";Bi.call(this,this.media,r)}return!i}return!1}},{key:"on",value:function(e,t){qi.call(this,this.elements.container,e,t)}},{key:"once",value:function(e,t){Vi.call(this,this.elements.container,e,t)}},{key:"off",value:function(e,t){Hi(this.elements.container,e,t)}},{key:"destroy",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.ready){var i=function(){document.body.style.overflow="",t.embed=null,n?(Object.keys(t.elements).length&&(Yi(t.elements.buttons.play),Yi(t.elements.captions),Yi(t.elements.controls),Yi(t.elements.wrapper),t.elements.buttons.play=null,t.elements.captions=null,t.elements.controls=null,t.elements.wrapper=null),Ri.function(e)&&e()):(function(){this&&this.eventListeners&&(this.eventListeners.forEach(function(e){var t=e.element,n=e.type,i=e.callback,r=e.options;t.removeEventListener(n,i,r)}),this.eventListeners=[])}.call(t),Ji(t.elements.original,t.elements.container),Bi.call(t,t.elements.original,"destroyed",!0),Ri.function(e)&&e.call(t.elements.original),t.ready=!1,setTimeout(function(){t.elements=null,t.media=null},200))};this.stop(),this.isHTML5?(clearTimeout(this.timers.loading),ra.toggleNativeControls.call(this,!0),i()):this.isYouTube?(clearInterval(this.timers.buffering),clearInterval(this.timers.playing),null!==this.embed&&Ri.function(this.embed.destroy)&&this.embed.destroy(),i()):this.isVimeo&&(null!==this.embed&&this.embed.unload().then(i),setTimeout(i,200))}}},{key:"supports",value:function(e){return dr.mime.call(this,e)}},{key:"isHTML5",get:function(){return Boolean(this.provider===Jr.html5)}},{key:"isEmbed",get:function(){return Boolean(this.isYouTube||this.isVimeo)}},{key:"isYouTube",get:function(){return Boolean(this.provider===Jr.youtube)}},{key:"isVimeo",get:function(){return Boolean(this.provider===Jr.vimeo)}},{key:"isVideo",get:function(){return Boolean(this.type===$r.video)}},{key:"isAudio",get:function(){return Boolean(this.type===$r.audio)}},{key:"playing",get:function(){return Boolean(this.ready&&!this.paused&&!this.ended)}},{key:"paused",get:function(){return Boolean(this.media.paused)}},{key:"stopped",get:function(){return Boolean(this.paused&&0===this.currentTime)}},{key:"ended",get:function(){return Boolean(this.media.ended)}},{key:"currentTime",set:function(e){if(this.duration){var t=Ri.number(e)&&e>0;this.media.currentTime=t?Math.min(e,this.duration):0,this.debug.log("Seeking to ".concat(this.currentTime," seconds"))}},get:function(){return Number(this.media.currentTime)}},{key:"buffered",get:function(){var e=this.media.buffered;return Ri.number(e)?e:e&&e.length&&this.duration>0?e.end(0)/this.duration:0}},{key:"seeking",get:function(){return Boolean(this.media.seeking)}},{key:"duration",get:function(){var e=parseFloat(this.config.duration),t=(this.media||{}).duration,n=Ri.number(t)&&t!==1/0?t:0;return e||n}},{key:"volume",set:function(e){var t=e;Ri.string(t)&&(t=Number(t)),Ri.number(t)||(t=this.storage.get("volume")),Ri.number(t)||(t=this.config.volume),t>1&&(t=1),t<0&&(t=0),this.config.volume=t,this.media.volume=t,!Ri.empty(e)&&this.muted&&t>0&&(this.muted=!1)},get:function(){return Number(this.media.volume)}},{key:"muted",set:function(e){var t=e;Ri.boolean(t)||(t=this.storage.get("muted")),Ri.boolean(t)||(t=this.config.muted),this.config.muted=t,this.media.muted=t},get:function(){return Boolean(this.media.muted)}},{key:"hasAudio",get:function(){return!this.isHTML5||(!!this.isAudio||(Boolean(this.media.mozHasAudio)||Boolean(this.media.webkitAudioDecodedByteCount)||Boolean(this.media.audioTracks&&this.media.audioTracks.length)))}},{key:"speed",set:function(e){var t=null;Ri.number(e)&&(t=e),Ri.number(t)||(t=this.storage.get("speed")),Ri.number(t)||(t=this.config.speed.selected),t<.1&&(t=.1),t>2&&(t=2),this.config.speed.options.includes(t)?(this.config.speed.selected=t,this.media.playbackRate=t):this.debug.warn("Unsupported speed (".concat(t,")"))},get:function(){return Number(this.media.playbackRate)}},{key:"quality",set:function(e){var t=this.config.quality,n=this.options.quality;if(n.length){var i=[!Ri.empty(e)&&Number(e),this.storage.get("quality"),t.selected,t.default].find(Ri.number),r=!0;if(!n.includes(i)){var a=function(e,t){return Ri.array(e)&&e.length?e.reduce(function(e,n){return Math.abs(n-t)<Math.abs(e-t)?n:e}):null}(n,i);this.debug.warn("Unsupported quality option: ".concat(i,", using ").concat(a," instead")),i=a,r=!1}t.selected=i,this.media.quality=i,r&&this.storage.set({quality:i})}},get:function(){return this.media.quality}},{key:"loop",set:function(e){var t=Ri.boolean(e)?e:this.config.loop.active;this.config.loop.active=t,this.media.loop=t},get:function(){return Boolean(this.media.loop)}},{key:"source",set:function(e){ao.change.call(this,e)},get:function(){return this.media.currentSrc}},{key:"download",get:function(){var e=this.config.urls.download;return Ri.url(e)?e:this.source}},{key:"poster",set:function(e){this.isVideo?ra.setPoster.call(this,e,!1).catch(function(){}):this.debug.warn("Poster can only be set for video")},get:function(){return this.isVideo?this.media.getAttribute("poster"):null}},{key:"autoplay",set:function(e){var t=Ri.boolean(e)?e:this.config.autoplay;this.config.autoplay=t},get:function(){return Boolean(this.config.autoplay)}},{key:"currentTrack",set:function(e){zr.set.call(this,e,!1)},get:function(){var e=this.captions,t=e.toggled,n=e.currentTrack;return t?n:-1}},{key:"language",set:function(e){zr.setLanguage.call(this,e,!1)},get:function(){return(zr.getCurrentTrack.call(this)||{}).language}},{key:"pip",set:function(e){if(dr.pip){var t=Ri.boolean(e)?e:!this.pip;Ri.function(this.media.webkitSetPresentationMode)&&this.media.webkitSetPresentationMode(t?Yr:Gr),Ri.function(this.media.requestPictureInPicture)&&(!this.pip&&t?this.media.requestPictureInPicture():this.pip&&!t&&document.exitPictureInPicture())}},get:function(){return dr.pip?Ri.empty(this.media.webkitPresentationMode)?this.media===document.pictureInPictureElement:this.media.webkitPresentationMode===Yr:null}}],[{key:"supported",value:function(e,t,n){return dr.check(e,t,n)}},{key:"loadSprite",value:function(e,t){return Dr(e,t)}},{key:"setup",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=null;return Ri.string(t)?i=Array.from(document.querySelectorAll(t)):Ri.nodeList(t)?i=Array.from(t):Ri.array(t)&&(i=t.filter(Ri.element)),Ri.empty(i)?null:i.map(function(t){return new e(t,n)})}}]),e}();return oo.defaults=(io=Kr,JSON.parse(JSON.stringify(io))),oo});
|
||
//# sourceMappingURL=plyr.polyfilled.min.js.map
|