From 58ebd3bc0f00c532e97e9a5571471ffab87934ba Mon Sep 17 00:00:00 2001 From: AL-LCL Date: Fri, 19 May 2023 10:39:49 +0200 Subject: GOD-VIEW --- gui/static/js/2.a739d3d0.chunk.js | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 gui/static/js/2.a739d3d0.chunk.js (limited to 'gui/static/js/2.a739d3d0.chunk.js') diff --git a/gui/static/js/2.a739d3d0.chunk.js b/gui/static/js/2.a739d3d0.chunk.js new file mode 100644 index 0000000..6186de5 --- /dev/null +++ b/gui/static/js/2.a739d3d0.chunk.js @@ -0,0 +1,3 @@ +/*! For license information please see 2.a739d3d0.chunk.js.LICENSE.txt */ +(this["webpackJsonpgod-view-gui"]=this["webpackJsonpgod-view-gui"]||[]).push([[2],[function(e,t,n){"use strict";e.exports=n(38)},function(e,t,n){"use strict";function i(e,t){for(var n=0;n1?t-1:0),i=1;i0?" Args: "+n.join(", "):""))}var C=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}var t=e.prototype;return t.indexOfGroup=function(e){for(var t=0,n=0;n=this.groupSizes.length){for(var n=this.groupSizes,i=n.length,r=i;e>=r;)(r<<=1)<0&&T(16,""+e);this.groupSizes=new Uint32Array(r),this.groupSizes.set(n),this.length=r;for(var a=i;a=this.length||0===this.groupSizes[e])return t;for(var n=this.groupSizes[e],i=this.indexOfGroup(e),r=i+n,a=i;a=0;n--){var i=t[n];if(i&&1===i.nodeType&&i.hasAttribute(k))return i}}(n),a=void 0!==r?r.nextSibling:null;i.setAttribute(k,"active"),i.setAttribute("data-styled-version","5.2.1");var o=j();return o&&i.setAttribute("nonce",o),n.insertBefore(i,a),i},U=function(){function e(e){var t=this.element=B(e);t.appendChild(document.createTextNode("")),this.sheet=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,n=0,i=t.length;n=0){var n=document.createTextNode(t),i=this.nodes[e];return this.element.insertBefore(n,i||null),this.length++,!0}return!1},t.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},t.getRule=function(e){return e0&&(u+=e+",")})),i+=""+s+l+'{content:"'+u+'"}/*!sc*/\n'}}}return i}(this)},e}(),G=/(a)(d)/gi,q=function(e){return String.fromCharCode(e+(e>25?39:97))};function K(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=q(t%52)+n;return(q(t%52)+n).replace(G,"$1-$2")}var $=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},Y=function(e){return $(5381,e)};function Q(e){for(var t=0;t>>0);if(!t.hasNameForId(i,o)){var s=n(a,"."+o,void 0,i);t.insertRules(i,o,s)}r.push(o),this.staticRulesId=o}else{for(var l=this.rules.length,u=$(this.baseHash,n.hash),c="",d=0;d>>0);if(!t.hasNameForId(i,m)){var g=n(c,"."+m,void 0,i);t.insertRules(i,m,g)}r.push(m)}}return r.join(" ")},e}(),Z=/^\s*\/\/.*$/gm,ee=[":","[",".","#"];function te(e){var t,n,i,r,a=void 0===e?v:e,o=a.options,s=void 0===o?v:o,u=a.plugins,c=void 0===u?g:u,d=new l.a(s),f=[],h=function(e){function t(t){if(t)try{e(t+"}")}catch(e){}}return function(n,i,r,a,o,s,l,u,c,d){switch(n){case 1:if(0===c&&64===i.charCodeAt(0))return e(i+";"),"";break;case 2:if(0===u)return i+"/*|*/";break;case 3:switch(u){case 102:case 112:return e(r[0]+i),"";default:return i+(0===d?"/*|*/":"")}case-2:i.split("/*|*/}").forEach(t)}}}((function(e){f.push(e)})),p=function(e,i,a){return 0===i&&ee.includes(a[n.length])||a.match(r)?e:"."+t};function m(e,a,o,s){void 0===s&&(s="&");var l=e.replace(Z,""),u=a&&o?o+" "+a+" { "+l+" }":l;return t=s,n=a,i=new RegExp("\\"+n+"\\b","g"),r=new RegExp("(\\"+n+"\\b){2,}"),d(o||!a?"":a,u)}return d.use([].concat(c,[function(e,t,r){2===e&&r.length&&r[0].lastIndexOf(n)>0&&(r[0]=r[0].replace(i,p))},h,function(e){if(-2===e){var t=f;return f=[],t}}])),m.hash=c.length?c.reduce((function(e,t){return t.name||T(15),$(e,t.name)}),5381).toString():"",m}var ne=a.a.createContext(),ie=(ne.Consumer,a.a.createContext()),re=(ie.Consumer,new W),ae=te();function oe(){return Object(r.useContext)(ne)||re}function se(){return Object(r.useContext)(ie)||ae}function le(e){var t=Object(r.useState)(e.stylisPlugins),n=t[0],i=t[1],o=oe(),l=Object(r.useMemo)((function(){var t=o;return e.sheet?t=e.sheet:e.target&&(t=t.reconstructWithOptions({target:e.target},!1)),e.disableCSSOMInjection&&(t=t.reconstructWithOptions({useCSSOMInjection:!1})),t}),[e.disableCSSOMInjection,e.sheet,e.target]),u=Object(r.useMemo)((function(){return te({options:{prefix:!e.disableVendorPrefixes},plugins:n})}),[e.disableVendorPrefixes,n]);return Object(r.useEffect)((function(){s()(n,e.stylisPlugins)||i(e.stylisPlugins)}),[e.stylisPlugins]),a.a.createElement(ne.Provider,{value:l},a.a.createElement(ie.Provider,{value:u},e.children))}var ue=function(){function e(e,t){var n=this;this.inject=function(e,t){void 0===t&&(t=ae);var i=n.name+t.hash;e.hasNameForId(n.id,i)||e.insertRules(n.id,i,t(n.rules,i,"@keyframes"))},this.toString=function(){return T(12,String(n.name))},this.name=e,this.id="sc-keyframes-"+e,this.rules=t}return e.prototype.getName=function(e){return void 0===e&&(e=ae),this.name+e.hash},e}(),ce=/([A-Z])/,de=/([A-Z])/g,fe=/^ms-/,he=function(e){return"-"+e.toLowerCase()};function pe(e){return ce.test(e)?e.replace(de,he).replace(fe,"-ms-"):e}var me=function(e){return null==e||!1===e||""===e};function ge(e,t,n,i){if(Array.isArray(e)){for(var r,a=[],o=0,s=e.length;o1?t-1:0),i=1;i?@[\\\]^`{|}~-]+/g,_e=/(^-|-$)/g;function ke(e){return e.replace(be,"-").replace(_e,"")}var we=function(e){return K(Y(e)>>>0)};function Ee(e){return"string"==typeof e&&!0}var Se=function(e){return"function"==typeof e||"object"==typeof e&&null!==e&&!Array.isArray(e)},Te=function(e){return"__proto__"!==e&&"constructor"!==e&&"prototype"!==e};function Ce(e,t,n){var i=e[n];Se(t)&&Se(i)?xe(i,t):e[n]=t}function xe(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i=0||(r[n]=e[n]);return r}(t,["componentId"]),a=i&&i+"-"+(Ee(e)?e:ke(b(e)));return Re(e,h({},r,{attrs:w,componentId:a}),n)},Object.defineProperty(S,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(t){this._foldedDefaultProps=i?xe({},e.defaultProps,t):t}}),S.toString=function(){return"."+S.styledComponentId},o&&f()(S,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),S}var Le=function(e){return function e(t,n,r){if(void 0===r&&(r=v),!Object(i.isValidElementType)(n))return T(1,String(n));var a=function(){return t(n,r,ve.apply(void 0,arguments))};return a.withConfig=function(i){return e(t,n,h({},r,{},i))},a.attrs=function(i){return e(t,n,h({},r,{attrs:Array.prototype.concat(r.attrs,i).filter(Boolean)}))},a}(Re,e)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"].forEach((function(e){Le[e]=Le(e)}));var Pe=function(){function e(e,t){this.rules=e,this.componentId=t,this.isStatic=Q(e),W.registerId(this.componentId+1)}var t=e.prototype;return t.createStyles=function(e,t,n,i){var r=i(ge(this.rules,t,n,i).join(""),""),a=this.componentId+e;n.insertRules(a,a,r)},t.removeStyles=function(e,t){t.clearRules(this.componentId+e)},t.renderStyles=function(e,t,n,i){e>2&&W.registerId(this.componentId+e),this.removeStyles(e,n),this.createStyles(e,t,n,i)},e}();function Ie(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i"+t+""},this.getStyleTags=function(){return e.sealed?T(2):e._emitSheetCSS()},this.getStyleElement=function(){var t;if(e.sealed)return T(2);var n=((t={})[k]="",t["data-styled-version"]="5.2.1",t.dangerouslySetInnerHTML={__html:e.instance.toString()},t),i=j();return i&&(n.nonce=i),[a.a.createElement("style",h({},n,{key:"sc-0-0"}))]},this.seal=function(){e.sealed=!0},this.instance=new W({isServer:!0}),this.sealed=!1}var t=e.prototype;t.collectStyles=function(e){return this.sealed?T(2):a.a.createElement(le,{sheet:this.instance},e)},t.interleaveWithNodeStream=function(e){return T(3)}}();t.c=Le}).call(this,n(28))},function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return d})),n.d(t,"c",(function(){return f})),n.d(t,"d",(function(){return h})),n.d(t,"e",(function(){return p})),n.d(t,"f",(function(){return m})),n.d(t,"g",(function(){return g})),n.d(t,"i",(function(){return v})),n.d(t,"h",(function(){return y})),n.d(t,"j",(function(){return b})),n.d(t,"k",(function(){return _})),n.d(t,"l",(function(){return k})),n.d(t,"m",(function(){return w})),n.d(t,"n",(function(){return E})),n.d(t,"o",(function(){return S})),n.d(t,"p",(function(){return T})),n.d(t,"q",(function(){return C})),n.d(t,"r",(function(){return x})),n.d(t,"s",(function(){return O}));var i=n(0),r={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},a=i.createContext&&i.createContext(r),o=function(){return(o=Object.assign||function(e){for(var t,n=1,i=arguments.length;n0&&o.length>r&&!o.warned){o.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=o.length,s=l,console&&console.warn&&console.warn(s)}return e}function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(e,t,n){var i={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},r=f.bind(i);return r.listener=n,i.wrapFn=r,r}function p(e,t,n){var i=e._events;if(void 0===i)return[];var r=i[t];return void 0===r?[]:"function"===typeof r?n?[r.listener||r]:[r]:n?function(e){for(var t=new Array(e.length),n=0;n0&&(o=t[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var l=r[e];if(void 0===l)return!1;if("function"===typeof l)a(l,this,t);else{var u=l.length,c=g(l,u);for(n=0;n=0;a--)if(n[a]===t||n[a].listener===t){o=n[a].listener,r=a;break}if(r<0)return this;0===r?n.shift():function(e,t){for(;t+1=0;i--)this.removeListener(e,t[i]);return this},s.prototype.listeners=function(e){return p(this,e,!0)},s.prototype.rawListeners=function(e){return p(this,e,!1)},s.listenerCount=function(e,t){return"function"===typeof e.listenerCount?e.listenerCount(t):m.call(e,t)},s.prototype.listenerCount=m,s.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]}},function(e,t,n){"use strict";function i(e,t){if(null==e)return{};var n,i,r={},a=Object.keys(e);for(i=0;i=0||(r[n]=e[n]);return r}n.d(t,"a",(function(){return i}))},function(e,t,n){"use strict";function i(){return(i=Object.assign||function(e){for(var t=1;t=0;i--){var r=t[i](e);if(r)return r}return function(t,i){throw new Error("Invalid value of type "+typeof e+" for "+n+" argument when connecting component "+i.wrappedComponentName+".")}}function U(e,t){return e===t}function F(e){var t=void 0===e?{}:e,n=t.connectHOC,i=void 0===n?S:n,r=t.mapStateToPropsFactories,a=void 0===r?P:r,o=t.mapDispatchToPropsFactories,s=void 0===o?L:o,l=t.mergePropsFactories,u=void 0===l?M:l,c=t.selectorFactory,h=void 0===c?j:c;return function(e,t,n,r){void 0===r&&(r={});var o=r,l=o.pure,c=void 0===l||l,p=o.areStatesEqual,m=void 0===p?U:p,g=o.areOwnPropsEqual,v=void 0===g?C:g,y=o.areStatePropsEqual,b=void 0===y?C:y,_=o.areMergedPropsEqual,k=void 0===_?C:_,w=Object(f.a)(o,["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"]),E=B(e,a,"mapStateToProps"),S=B(t,s,"mapDispatchToProps"),T=B(n,u,"mergeProps");return i(h,Object(d.a)({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:Boolean(e),initMapStateToProps:E,initMapDispatchToProps:S,initMergeProps:T,pure:c,areStatesEqual:m,areOwnPropsEqual:v,areStatePropsEqual:b,areMergedPropsEqual:k},w))}}var z=F();function V(){return Object(i.useContext)(a)}function H(e){void 0===e&&(e=a);var t=e===a?V:function(){return Object(i.useContext)(e)};return function(){return t().store}}var W=H();function G(e){void 0===e&&(e=a);var t=e===a?W:H(e);return function(){return t().dispatch}}var q=G(),K=function(e,t){return e===t};function $(e){void 0===e&&(e=a);var t=e===a?V:function(){return Object(i.useContext)(e)};return function(e,n){void 0===n&&(n=K);var r=t(),a=function(e,t,n,r){var a,o=Object(i.useReducer)((function(e){return e+1}),0)[1],s=Object(i.useMemo)((function(){return new u(n,r)}),[n,r]),l=Object(i.useRef)(),c=Object(i.useRef)(),d=Object(i.useRef)(),f=Object(i.useRef)(),h=n.getState();try{a=e!==c.current||h!==d.current||l.current?e(h):f.current}catch(p){throw l.current&&(p.message+="\nThe error may be correlated with this previous error:\n"+l.current.stack+"\n\n"),p}return g((function(){c.current=e,d.current=h,f.current=a,l.current=void 0})),g((function(){function e(){try{var e=c.current(n.getState());if(t(e,f.current))return;f.current=e}catch(p){l.current=p}o()}return s.onStateChange=e,s.trySubscribe(),e(),function(){return s.tryUnsubscribe()}}),[n,s]),a}(e,n,r.store,r.subscription);return Object(i.useDebugValue)(a),a}}var Y,Q=$(),X=n(14);Y=X.unstable_batchedUpdates,o=Y},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var i=n(18);function r(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e)){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(l){r=!0,a=l}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return n}}(e,t)||Object(i.a)(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},function(e,t,n){"use strict";e.exports=n(44)},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var i=n(22);function r(e,t){if(e){if("string"===typeof e)return Object(i.a)(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Object(i.a)(e,t):void 0}}},function(e,t,n){"use strict";var i=n(17),r={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},a={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},o={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function l(e){return i.isMemo(e)?o:s[e.$$typeof]||r}s[i.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[i.Memo]=o;var u=Object.defineProperty,c=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,h=Object.getPrototypeOf,p=Object.prototype;e.exports=function e(t,n,i){if("string"!==typeof n){if(p){var r=h(n);r&&r!==p&&e(t,r,i)}var o=c(n);d&&(o=o.concat(d(n)));for(var s=l(t),m=l(n),g=0;g=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function O(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e))&&"[object Arguments]"!==Object.prototype.toString.call(e))return;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(l){r=!0,a=l}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")}()}var A,R,L=Object(i.createContext)(),P={TOP_LEFT:"top left",TOP_CENTER:"top center",TOP_RIGHT:"top right",MIDDLE_LEFT:"middle left",MIDDLE:"middle",MIDDLE_RIGHT:"middle right",BOTTOM_LEFT:"bottom left",BOTTOM_CENTER:"bottom center",BOTTOM_RIGHT:"bottom right"},I={INFO:"info",SUCCESS:"success",ERROR:"error"},M={FADE:"fade",SCALE:"scale"},D=function(e){var t=e.children,n=e.options,a=n.position,o=n.containerStyle,s=x(e,["children","options"]),l=Object(i.useMemo)((function(){return function(e){var t={left:0,position:"fixed",display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"column",width:"100%",pointerEvents:"none"};switch(e){case P.TOP_LEFT:return C({},t,{top:0,alignItems:"flex-start"});case P.TOP_CENTER:return C({},t,{top:0});case P.TOP_RIGHT:return C({},t,{top:0,alignItems:"flex-end"});case P.MIDDLE_LEFT:return C({},t,{top:"50%",alignItems:"flex-start"});case P.MIDDLE:return C({},t,{top:"50%"});case P.MIDDLE_RIGHT:return C({},t,{top:"50%",alignItems:"flex-end"});case P.BOTTOM_LEFT:return C({},t,{bottom:0,alignItems:"flex-start"});case P.BOTTOM_CENTER:return C({},t,{bottom:0});case P.BOTTOM_RIGHT:return C({},t,{bottom:0,alignItems:"flex-end"});default:return t}}(a)}),[a]);return t.length>0&&r.a.createElement("div",S({style:C({},l,{},o)},s),t)},N=(E(A={},M.FADE,{transition:"opacity ".concat(250,"ms ease"),opacity:0}),E(A,M.SCALE,{transform:"scale(1)",transition:"all ".concat(250,"ms ease-in-out")}),A),j=(E(R={},M.FADE,{entering:{opacity:0},entered:{opacity:1}}),E(R,M.SCALE,{entering:{transform:"scale(0)"},entered:{transform:"scale(1)"},exiting:{transform:"scale(0)"},exited:{transform:"scale(1)"}}),R),B=function(e){var t=e.children,n=e.type,a=x(e,["children","type"]),o=Object(i.useRef)(null);return r.a.createElement(m,S({nodeRef:o},a,{timeout:250}),(function(e){return r.a.createElement("div",{ref:o,style:C({},N[n],{},j[n][e])},t)}))},U=function(e){var t=e.children,n=e.offset,a=e.position,o=e.timeout,s=e.type,l=e.transition,c=e.containerStyle,d=e.template,f=e.context,h=x(e,["children","offset","position","timeout","type","transition","containerStyle","template","context"]),p=Object(i.useRef)(null),m=Object(i.useRef)(null),g=Object(i.useRef)([]),v=O(Object(i.useState)([]),2),y=v[0],b=v[1];Object(i.useEffect)((function(){p.current=document.createElement("div"),p.current.id="__react-alert__",document.body.appendChild(p.current);var e=g.current;return function(){e.forEach(clearTimeout),p.current&&document.body.removeChild(p.current)}}),[]);var _=Object(i.useCallback)((function(e){b((function(t){var n=t.length,i=t.filter((function(t){return t.id!==e.id}));return n>i.length&&e.options.onClose&&e.options.onClose(),i}))}),[]),k=Object(i.useCallback)((function(){m.current.alerts.forEach(_)}),[_]),E=Object(i.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Math.random().toString(36).substr(2,9),i=C({position:t.position||a,timeout:o,type:s},t),r={id:n,message:e,options:i,close:function(){return _(r)}};if(r.options.timeout){var l=setTimeout((function(){_(r),g.current.splice(g.current.indexOf(l),1)}),r.options.timeout);g.current.push(l)}return b((function(e){return e.concat(r)})),r.options.onOpen&&r.options.onOpen(),r}),[a,_,o,s]),T=Object(i.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.type=I.SUCCESS,E(e,t)}),[E]),A=Object(i.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.type=I.ERROR,E(e,t)}),[E]),R=Object(i.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.type=I.INFO,E(e,t)}),[E]);m.current={alerts:y,show:E,remove:_,removeAll:k,success:T,error:A,info:R};var L,M=(L=function(e){return e.options.position},y.reduce((function(e,t){var n=L(t);return e[n]||(e[n]=[]),e[n].push(t),e}),{}));return r.a.createElement(f.Provider,{value:m},t,p.current&&Object(u.createPortal)(r.a.createElement(i.Fragment,null,Object.keys(P).map((function(e){var t=P[e];return r.a.createElement(w,S({appear:!0,key:t,options:{position:t,containerStyle:c},component:D},h),M[t]?M[t].map((function(e){return r.a.createElement(B,{type:l,key:e.id},r.a.createElement(d,S({style:{margin:n,pointerEvents:"all"}},e)))})):null)}))),p.current))};U.propTypes={offset:o.a.string,position:o.a.oneOf(Object.keys(P).map((function(e){return P[e]}))),timeout:o.a.number,type:o.a.oneOf(Object.keys(I).map((function(e){return I[e]}))),transition:o.a.oneOf(Object.keys(M).map((function(e){return M[e]}))),containerStyle:o.a.object,template:o.a.oneOfType([o.a.element,o.a.func,o.a.elementType]).isRequired,context:o.a.shape({Provider:o.a.object,Consumer:o.a.object})},U.defaultProps={offset:"10px",position:P.TOP_CENTER,timeout:0,type:I.INFO,transition:M.FADE,containerStyle:{zIndex:100},context:L};var F=function(e){var t=Object(i.useContext)(e||L);return Object(i.useMemo)((function(){return t.current}),[t])}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var i=n(22);var r=n(18);function a(e){return function(e){if(Array.isArray(e))return Object(i.a)(e)}(e)||function(e){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||Object(r.a)(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},function(e,t,n){"use strict";function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n1)for(var n=1;ni&&(i=(t=t.trim()).charCodeAt(0)),i){case 38:return t.replace(m,"$1"+e.trim());case 58:return e.trim()+t.replace(m,"$1"+e.trim());default:if(0<1*n&&0l.charCodeAt(8))break;case 115:o=o.replace(l,"-webkit-"+l)+";"+o;break;case 207:case 102:o=o.replace(l,"-webkit-"+(102s.charCodeAt(0)&&(s=s.trim()),s=[s],0h)&&(U=(V=V.replace(" ",":")).length),0=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,a,o=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}},function(e,t,n){e.exports=n.p+"static/media/plyr.3a727a9b.svg"},function(e,t,n){(function(t){"object"==typeof navigator&&(e.exports=function(){"use strict";function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,i=new Array(t);n(n=100/l.width*(r.clientX-l.left))?n=0:100n?n-=(100-2*n)*u:50t){var n=function(e){var t="".concat(e).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return t?Math.max(0,(t[1]?t[1].length:0)-(t[2]?+t[2]:0)):0}(t);return parseFloat(e.toFixed(n))}return Math.round(e/t)*t}(n/100*(o-a),s)}},{key:"set",value:function(t){e.enabled&&A(t)&&!t.target.disabled&&(t.preventDefault(),t.target.value=this.get(t),function(e,t){if(e&&t){var n=new Event(t,{bubbles:!0});e.dispatchEvent(n)}}(t.target,"touchend"===t.type?"change":"input"))}}],[{key:"setup",value:function(t){var n=10&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length,n=new Array(t>1?t-1:0),i=1;i0?t.cloneNode(!0):t,r=e.parentNode,a=e.nextSibling;i.appendChild(e),a?r.insertBefore(i,a):r.appendChild(i)}))}function se(e,t){Y(e)&&!ee(t)&&Object.entries(t).filter((function(e){var t=s(e,2)[1];return!z(t)})).forEach((function(t){var n=s(t,2),i=n[0],r=n[1];return e.setAttribute(i,r)}))}function le(e,t,n){var i=document.createElement(e);return V(t)&&se(i,t),W(n)&&(i.innerText=n),i}function ue(e,t,n,i){Y(t)&&t.appendChild(le(e,n,i))}function ce(e){$(e)||K(e)?Array.from(e).forEach(ce):Y(e)&&Y(e.parentNode)&&e.parentNode.removeChild(e)}function de(e){if(Y(e))for(var t=e.childNodes.length;t>0;)e.removeChild(e.lastChild),t-=1}function fe(e,t){return Y(t)&&Y(t.parentNode)&&Y(e)?(t.parentNode.replaceChild(e,t),e):null}function he(e,t){if(!W(e)||ee(e))return{};var n={},i=ae({},t);return e.split(",").forEach((function(e){var t=e.trim(),r=t.replace(".",""),a=t.replace(/[[\]]/g,"").split("="),o=s(a,1)[0],l=a.length>1?a[1].replace(/["']/g,""):"";switch(t.charAt(0)){case".":W(i.class)?n.class="".concat(i.class," ").concat(r):n.class=r;break;case"#":n.id=t.replace("#","");break;case"[":n[o]=l}})),ae(i,n)}function pe(e,t){if(Y(e)){var n=t;G(n)||(n=!e.hidden),e.hidden=n}}function me(e,t,n){if($(e))return Array.from(e).map((function(e){return me(e,t,n)}));if(Y(e)){var i="toggle";return void 0!==n&&(i=n?"add":"remove"),e.classList[i](t),e.classList.contains(t)}return!1}function ge(e,t){return Y(e)&&e.classList.contains(t)}function ve(e,t){var n=Element.prototype;return(n.matches||n.webkitMatchesSelector||n.mozMatchesSelector||n.msMatchesSelector||function(){return Array.from(document.querySelectorAll(t)).includes(this)}).call(e,t)}function ye(e){return this.elements.container.querySelectorAll(e)}function be(e){return this.elements.container.querySelector(e)}function _e(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];Y(e)&&(e.focus({preventScroll:!0}),t&&me(e,this.config.classNames.tabFocus))}var ke,we={"audio/ogg":"vorbis","audio/wav":"1","video/webm":"vp8, vorbis","video/mp4":"avc1.42E01E, mp4a.40.2","video/ogg":"theora"},Ee={audio:"canPlayType"in document.createElement("audio"),video:"canPlayType"in document.createElement("video"),check:function(e,t,n){var i=ie.isIPhone&&n&&Ee.playsinline,r=Ee[e]||"html5"!==t;return{api:r,ui:r&&Ee.rangeInput&&("video"!==e||!ie.isIPhone||i)}},pip:!(ie.isIPhone||!q(le("video").webkitSetPresentationMode)&&(!document.pictureInPictureEnabled||le("video").disablePictureInPicture)),airplay:q(window.WebKitPlaybackTargetAvailabilityEvent),playsinline:"playsInline"in document.createElement("video"),mime:function(e){if(ee(e))return!1;var t=s(e.split("/"),1)[0],n=e;if(!this.isHTML5||t!==this.type)return!1;Object.keys(we).includes(n)&&(n+='; codecs="'.concat(we[e],'"'));try{return Boolean(n&&this.media.canPlayType(n).replace(/no/,""))}catch(e){return!1}},textTracks:"textTracks"in document.createElement("video"),rangeInput:(ke=document.createElement("input"),ke.type="range","range"===ke.type),touch:"ontouchstart"in document.documentElement,transitions:!1!==te,reducedMotion:"matchMedia"in window&&window.matchMedia("(prefers-reduced-motion)").matches},Se=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 Te(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&&!ee(t)&&q(n)){var s=t.split(" "),l=o;Se&&(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 Ce(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];Te.call(this,e,t,n,!0,i,r)}function xe(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];Te.call(this,e,t,n,!1,i,r)}function Oe(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2?arguments[2]:void 0,r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=function o(){xe(e,n,o,r,a);for(var s=arguments.length,l=new Array(s),u=0;u1&&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(Y(e)&&!ee(t)){var r=new CustomEvent(t,{bubbles:n,detail:o(o({},i),{},{plyr:this})});e.dispatchEvent(r)}}function Re(){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=[])}function Le(){var e=this;return new Promise((function(t){return e.ready?setTimeout(t,0):Ce.call(e,e.elements.container,"ready",t)})).then((function(){}))}function Pe(e){(function(e){return I(e,Promise)&&j(e.then)})(e)&&e.then(null,(function(){}))}function Ie(e){return!!(K(e)||W(e)&&e.includes(":"))&&(K(e)?e:e.split(":")).map(Number).every(H)}function Me(e){if(!K(e)||!e.every(H))return null;var t=s(e,2),n=t[0],i=t[1],r=function e(t,n){return 0===n?t:e(n,t%n)}(n,i);return[n/r,i/r]}function De(e){var t=function(e){return Ie(e)?e.split(":").map(Number):null},n=t(e);if(null===n&&(n=t(this.config.ratio)),null===n&&!ee(this.embed)&&K(this.embed.ratio)&&(n=this.embed.ratio),null===n&&this.isHTML5){var i=this.media;n=Me([i.videoWidth,i.videoHeight])}return n}function Ne(e){if(!this.isVideo)return{};var t=this.elements.wrapper,n=De.call(this,e),i=s(K(n)?n:[0,0],2),r=100/i[0]*i[1];if(t.style.paddingBottom="".concat(r,"%"),this.isVimeo&&!this.config.vimeo.premium&&this.supported.ui){var a=100/this.media.offsetWidth*parseInt(window.getComputedStyle(this.media).paddingBottom,10),o=(a-r)/(a/50);this.fullscreen.active?t.style.paddingBottom=null:this.media.style.transform="translateY(-".concat(o,"%)")}else this.isHTML5&&t.classList.toggle(this.config.classNames.videoFixedRatio,null!==n);return{padding:r,ratio:n}}var je={getSources:function(){var e=this;return this.isHTML5?Array.from(this.media.querySelectorAll("source")).filter((function(t){var n=t.getAttribute("type");return!!ee(n)||Ee.mime.call(e,n)})):[]},getQualityOptions:function(){return this.config.quality.forced?this.config.quality.options:je.getSources.call(this).map((function(e){return Number(e.getAttribute("size"))})).filter(Boolean)},setup:function(){if(this.isHTML5){var e=this;e.options.speed=e.config.speed.options,ee(this.config.ratio)||Ne.call(e),Object.defineProperty(e.media,"quality",{get:function(){var t=je.getSources.call(e).find((function(t){return t.getAttribute("src")===e.source}));return t&&Number(t.getAttribute("size"))},set:function(t){if(e.quality!==t){if(e.config.quality.forced&&q(e.config.quality.onChange))e.config.quality.onChange(t);else{var n=je.getSources.call(e).find((function(e){return Number(e.getAttribute("size"))===t}));if(!n)return;var i=e.media,r=i.currentTime,a=i.paused,o=i.preload,s=i.readyState,l=i.playbackRate;e.media.src=n.getAttribute("src"),("none"!==o||s)&&(e.once("loadedmetadata",(function(){e.speed=l,e.currentTime=r,a||Pe(e.play())})),e.media.load())}Ae.call(e,e.media,"qualitychange",!1,{quality:t})}}})}},cancelRequests:function(){this.isHTML5&&(ce(je.getSources.call(this)),this.media.setAttribute("src",this.config.blankVideo),this.media.load(),this.debug.log("Cancelled network requests"))}};function Be(e){return K(e)?e.filter((function(t,n){return e.indexOf(t)===n})):e}function Ue(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i0&&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())},ze=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e.toString().replace(/\w\S*/g,(function(e){return e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()}))};function Ve(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=e.toString();return t=Fe(t,"-"," "),t=Fe(t,"_"," "),t=ze(t),Fe(t," ","")}function He(e){var t=document.createElement("div");return t.appendChild(e),t.innerHTML}var We={pip:"PIP",airplay:"AirPlay",html5:"HTML5",vimeo:"Vimeo",youtube:"YouTube"},Ge=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(ee(e)||ee(t))return"";var n=re(t.i18n,e);if(ee(n))return Object.keys(We).includes(e)?We[e]:"";var i={"{seektime}":t.seekTime,"{title}":t.title};return Object.entries(i).forEach((function(e){var t=s(e,2),i=t[0],r=t[1];n=Fe(n,i,r)})),n},qe=function(){function t(n){e(this,t),this.enabled=n.config.storage.enabled,this.key=n.config.storage.key}return i(t,[{key:"get",value:function(e){if(!t.supported||!this.enabled)return null;var n=window.localStorage.getItem(this.key);if(ee(n))return null;var i=JSON.parse(n);return W(e)&&e.length?i[e]:i}},{key:"set",value:function(e){if(t.supported&&this.enabled&&V(e)){var n=this.get();ee(n)&&(n={}),ae(n,e),window.localStorage.setItem(this.key,JSON.stringify(n))}}}],[{key:"supported",get:function(){try{if(!("localStorage"in window))return!1;var e="___test";return window.localStorage.setItem(e,e),window.localStorage.removeItem(e),!0}catch(e){return!1}}}]),t}();function Ke(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 $e(e,t){if(W(e)){var n="cache",i=W(t),r=function(){return null!==document.getElementById(t)},a=function(e,t){e.innerHTML=t,i&&r()||document.body.insertAdjacentElement("afterbegin",e)};if(!i||!r()){var o=qe.supported,s=document.createElement("div");if(s.setAttribute("hidden",""),i&&s.setAttribute("id",t),o){var l=window.localStorage.getItem("".concat(n,"-").concat(t));if(null!==l){var u=JSON.parse(l);a(s,u.content)}}Ke(e).then((function(e){ee(e)||(o&&window.localStorage.setItem("".concat(n,"-").concat(t),JSON.stringify({content:e})),a(s,e))})).catch((function(){}))}}}var Ye=function(e){return Math.trunc(e/60/60%60,10)},Qe=function(e){return Math.trunc(e/60%60,10)},Xe=function(e){return Math.trunc(e%60,10)};function Je(){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(!H(e))return Je(void 0,t,n);var i=function(e){return"0".concat(e).slice(-2)},r=Ye(e),a=Qe(e),o=Xe(e);return r=t||r>0?"".concat(r,":"):"","".concat(n&&e>0?"-":"").concat(r).concat(i(a),":").concat(i(o))}var Ze={getIconUrl:function(){var e=new URL(this.config.iconUrl,window.location).host!==window.location.host||ie.isIE&&!window.svg4everybody;return{url:this.config.iconUrl,cors:e}},findElements:function(){try{return this.elements.controls=be.call(this,this.config.selectors.controls.wrapper),this.elements.buttons={play:ye.call(this,this.config.selectors.buttons.play),pause:be.call(this,this.config.selectors.buttons.pause),restart:be.call(this,this.config.selectors.buttons.restart),rewind:be.call(this,this.config.selectors.buttons.rewind),fastForward:be.call(this,this.config.selectors.buttons.fastForward),mute:be.call(this,this.config.selectors.buttons.mute),pip:be.call(this,this.config.selectors.buttons.pip),airplay:be.call(this,this.config.selectors.buttons.airplay),settings:be.call(this,this.config.selectors.buttons.settings),captions:be.call(this,this.config.selectors.buttons.captions),fullscreen:be.call(this,this.config.selectors.buttons.fullscreen)},this.elements.progress=be.call(this,this.config.selectors.progress),this.elements.inputs={seek:be.call(this,this.config.selectors.inputs.seek),volume:be.call(this,this.config.selectors.inputs.volume)},this.elements.display={buffer:be.call(this,this.config.selectors.display.buffer),currentTime:be.call(this,this.config.selectors.display.currentTime),duration:be.call(this,this.config.selectors.display.duration)},Y(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="http://www.w3.org/2000/svg",i=Ze.getIconUrl.call(this),r="".concat(i.cors?"":i.url,"#").concat(this.config.iconPrefix),a=document.createElementNS(n,"svg");se(a,ae(t,{"aria-hidden":"true",focusable:"false"}));var o=document.createElementNS(n,"use"),s="".concat(r,"-").concat(e);return"href"in o&&o.setAttributeNS("http://www.w3.org/1999/xlink","href",s),o.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s),a.appendChild(o),a},createLabel:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Ge(e,this.config),i=o(o({},t),{},{class:[t.class,this.config.classNames.hidden].filter(Boolean).join(" ")});return le("span",i,n)},createBadge:function(e){if(ee(e))return null;var t=le("span",{class:this.config.classNames.menu.value});return t.appendChild(le("span",{class:this.config.classNames.menu.badge},e)),t},createButton:function(e,t){var n=this,i=ae({},t),r=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").toString();return(e=Ve(e)).charAt(0).toLowerCase()+e.slice(1)}(e),a={element:"button",toggle:!1,label:null,icon:null,labelPressed:null,iconPressed:null};switch(["element","icon","label"].forEach((function(e){Object.keys(i).includes(e)&&(a[e]=i[e],delete i[e])})),"button"!==a.element||Object.keys(i).includes("type")||(i.type="button"),Object.keys(i).includes("class")?i.class.split(" ").some((function(e){return e===n.config.classNames.control}))||ae(i,{class:"".concat(i.class," ").concat(this.config.classNames.control)}):i.class=this.config.classNames.control,e){case"play":a.toggle=!0,a.label="play",a.labelPressed="pause",a.icon="play",a.iconPressed="pause";break;case"mute":a.toggle=!0,a.label="mute",a.labelPressed="unmute",a.icon="volume",a.iconPressed="muted";break;case"captions":a.toggle=!0,a.label="enableCaptions",a.labelPressed="disableCaptions",a.icon="captions-off",a.iconPressed="captions-on";break;case"fullscreen":a.toggle=!0,a.label="enterFullscreen",a.labelPressed="exitFullscreen",a.icon="enter-fullscreen",a.iconPressed="exit-fullscreen";break;case"play-large":i.class+=" ".concat(this.config.classNames.control,"--overlaid"),r="play",a.label="play",a.icon="play";break;default:ee(a.label)&&(a.label=r),ee(a.icon)&&(a.icon=e)}var o=le(a.element);return a.toggle?(o.appendChild(Ze.createIcon.call(this,a.iconPressed,{class:"icon--pressed"})),o.appendChild(Ze.createIcon.call(this,a.icon,{class:"icon--not-pressed"})),o.appendChild(Ze.createLabel.call(this,a.labelPressed,{class:"label--pressed"})),o.appendChild(Ze.createLabel.call(this,a.label,{class:"label--not-pressed"}))):(o.appendChild(Ze.createIcon.call(this,a.icon)),o.appendChild(Ze.createLabel.call(this,a.label))),ae(i,he(this.config.selectors.buttons[r],i)),se(o,i),"play"===r?(K(this.elements.buttons[r])||(this.elements.buttons[r]=[]),this.elements.buttons[r].push(o)):this.elements.buttons[r]=o,o},createRange:function(e,t){var n=le("input",ae(he(this.config.selectors.inputs[e]),{type:"range",min:0,max:100,step:.01,value:0,autocomplete:"off",role:"slider","aria-label":Ge(e,this.config),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":0},t));return this.elements.inputs[e]=n,Ze.updateRangeFill.call(this,n),L.setup(n),n},createProgress:function(e,t){var n=le("progress",ae(he(this.config.selectors.display[e]),{min:0,max:100,value:0,role:"progressbar","aria-hidden":!0},t));if("volume"!==e){n.appendChild(le("span",null,"0"));var i={played:"played",buffer:"buffered"}[e],r=i?Ge(i,this.config):"";n.innerText="% ".concat(r.toLowerCase())}return this.elements.display[e]=n,n},createTime:function(e,t){var n=he(this.config.selectors.display[e],t),i=le("div",ae(n,{class:"".concat(n.class?n.class:""," ").concat(this.config.classNames.display.time," ").trim(),"aria-label":Ge(e,this.config)}),"00:00");return this.elements.display[e]=i,i},bindMenuItemShortcuts:function(e,t){var n=this;Ce.call(this,e,"keydown keyup",(function(i){if([32,38,39,40].includes(i.which)&&(i.preventDefault(),i.stopPropagation(),"keydown"!==i.type)){var r,a=ve(e,'[role="menuitemradio"]');!a&&[32,39].includes(i.which)?Ze.showMenuPanel.call(n,t,!0):32!==i.which&&(40===i.which||a&&39===i.which?(r=e.nextElementSibling,Y(r)||(r=e.parentNode.firstElementChild)):(r=e.previousElementSibling,Y(r)||(r=e.parentNode.lastElementChild)),_e.call(n,r,!0))}}),!1),Ce.call(this,e,"keyup",(function(e){13===e.which&&Ze.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,u=void 0!==l&&l,c=he(this.config.selectors.inputs[r]),d=le("button",ae(c,{type:"button",role:"menuitemradio",class:"".concat(this.config.classNames.control," ").concat(c.class?c.class:"").trim(),"aria-checked":u,value:n})),f=le("span");f.innerHTML=a,Y(s)&&f.appendChild(s),d.appendChild(f),Object.defineProperty(d,"checked",{enumerable:!0,get:function(){return"true"===d.getAttribute("aria-checked")},set:function(e){e&&Array.from(d.parentNode.children).filter((function(e){return ve(e,'[role="menuitemradio"]')})).forEach((function(e){return e.setAttribute("aria-checked","false")})),d.setAttribute("aria-checked",e?"true":"false")}}),this.listeners.bind(d,"click keyup",(function(e){if(!X(e)||32===e.which){switch(e.preventDefault(),e.stopPropagation(),d.checked=!0,r){case"language":t.currentTrack=Number(n);break;case"quality":t.quality=n;break;case"speed":t.speed=parseFloat(n)}Ze.showMenuPanel.call(t,"home",X(e))}}),r,!1),Ze.bindMenuItemShortcuts.call(this,d,r),i.appendChild(d)},formatTime:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!H(e))return e;var n=Ye(this.duration)>0;return Je(e,n,t)},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];Y(e)&&H(t)&&(e.innerText=Ze.formatTime(t,n))},updateVolume:function(){this.supported.ui&&(Y(this.elements.inputs.volume)&&Ze.setRange.call(this,this.elements.inputs.volume,this.muted?0:this.volume),Y(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;Y(e)&&(e.value=t,Ze.updateRangeFill.call(this,e))},updateProgress:function(e){var t=this;if(this.supported.ui&&Q(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&&Ze.setRange.call(this,this.elements.inputs.seek,r);break;case"playing":case"progress":!function(e,n){var i=H(n)?n:0,r=Y(e)?e:t.elements.display.buffer;if(Y(r)){r.value=i;var a=r.getElementsByTagName("span")[0];Y(a)&&(a.childNodes[0].nodeValue=i)}}(this.elements.display.buffer,100*this.buffered)}}},updateRangeFill:function(e){var t=Q(e)?e.target:e;if(Y(t)&&"range"===t.getAttribute("type")){if(ve(t,this.config.selectors.inputs.seek)){t.setAttribute("aria-valuenow",this.currentTime);var n=Ze.formatTime(this.currentTime),i=Ze.formatTime(this.duration),r=Ge("seekLabel",this.config);t.setAttribute("aria-valuetext",r.replace("{currentTime}",n).replace("{duration}",i))}else if(ve(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);ie.isWebkit&&t.style.setProperty("--value","".concat(t.value/t.max*100,"%"))}},updateSeekTooltip:function(e){var t=this;if(this.config.tooltips.seek&&Y(this.elements.inputs.seek)&&Y(this.elements.display.seekTooltip)&&0!==this.duration){var n="".concat(this.config.classNames.tooltip,"--visible"),i=function(e){return me(t.elements.display.seekTooltip,n,e)};if(this.touch)i(!1);else{var r=0,a=this.elements.progress.getBoundingClientRect();if(Q(e))r=100/a.width*(e.pageX-a.left);else{if(!ge(this.elements.display.seekTooltip,n))return;r=parseFloat(this.elements.display.seekTooltip.style.left,10)}r<0?r=0:r>100&&(r=100),Ze.updateTimeDisplay.call(this,this.elements.display.seekTooltip,this.duration/100*r),this.elements.display.seekTooltip.style.left="".concat(r,"%"),Q(e)&&["mouseenter","mouseleave"].includes(e.type)&&i("mouseenter"===e.type)}}},timeUpdate:function(e){var t=!Y(this.elements.display.duration)&&this.config.invertTime;Ze.updateTimeDisplay.call(this,this.elements.display.currentTime,t?this.duration-this.currentTime:this.currentTime,t),e&&"timeupdate"===e.type&&this.media.seeking||Ze.updateProgress.call(this,e)},durationUpdate:function(){if(this.supported.ui&&(this.config.invertTime||!this.currentTime)){if(this.duration>=Math.pow(2,32))return pe(this.elements.display.currentTime,!0),void pe(this.elements.progress,!0);Y(this.elements.inputs.seek)&&this.elements.inputs.seek.setAttribute("aria-valuemax",this.duration);var e=Y(this.elements.display.duration);!e&&this.config.displayDuration&&this.paused&&Ze.updateTimeDisplay.call(this,this.elements.display.currentTime,this.duration),e&&Ze.updateTimeDisplay.call(this,this.elements.display.duration,this.duration),Ze.updateSeekTooltip.call(this)}},toggleMenuButton:function(e,t){pe(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=ee(n)?this[e]:n,ee(r)&&(r=this.config[e].default),!ee(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(Y(a)||(a=i&&i.querySelector('[role="menu"]')),Y(a)){this.elements.settings.buttons[e].querySelector(".".concat(this.config.classNames.menu.value)).innerHTML=Ze.getLabel.call(this,e,r);var o=a&&a.querySelector('[value="'.concat(r,'"]'));Y(o)&&(o.checked=!0)}},getLabel:function(e,t){switch(e){case"speed":return 1===t?Ge("normal",this.config):"".concat(t,"×");case"quality":if(H(t)){var n=Ge("qualityLabel.".concat(t),this.config);return n.length?n:"".concat(t,"p")}return ze(t);case"captions":return nt.getLabel.call(this);default:return null}},setQualityMenu:function(e){var t=this;if(Y(this.elements.settings.panels.quality)){var n="quality",i=this.elements.settings.panels.quality.querySelector('[role="menu"]');K(e)&&(this.options.quality=Be(e).filter((function(e){return t.config.quality.options.includes(e)})));var r=!ee(this.options.quality)&&this.options.quality.length>1;if(Ze.toggleMenuButton.call(this,n,r),de(i),Ze.checkMenu.call(this),r){var a=function(e){var n=Ge("qualityBadge.".concat(e),t.config);return n.length?Ze.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){Ze.createMenuItem.call(t,{value:e,list:i,type:n,title:Ze.getLabel.call(t,"quality",e),badge:a(e)})})),Ze.updateSetting.call(this,n,i)}}},setCaptionsMenu:function(){var e=this;if(Y(this.elements.settings.panels.captions)){var t="captions",n=this.elements.settings.panels.captions.querySelector('[role="menu"]'),i=nt.getTracks.call(this),r=Boolean(i.length);if(Ze.toggleMenuButton.call(this,t,r),de(n),Ze.checkMenu.call(this),r){var a=i.map((function(t,i){return{value:i,checked:e.captions.toggled&&e.currentTrack===i,title:nt.getLabel.call(e,t),badge:t.language&&Ze.createBadge.call(e,t.language.toUpperCase()),list:n,type:"language"}}));a.unshift({value:-1,checked:!this.captions.toggled,title:Ge("disabled",this.config),list:n,type:"language"}),a.forEach(Ze.createMenuItem.bind(this)),Ze.updateSetting.call(this,t,n)}}},setSpeedMenu:function(){var e=this;if(Y(this.elements.settings.panels.speed)){var t="speed",n=this.elements.settings.panels.speed.querySelector('[role="menu"]');this.options.speed=this.options.speed.filter((function(t){return t>=e.minimumSpeed&&t<=e.maximumSpeed}));var i=!ee(this.options.speed)&&this.options.speed.length>1;Ze.toggleMenuButton.call(this,t,i),de(n),Ze.checkMenu.call(this),i&&(this.options.speed.forEach((function(i){Ze.createMenuItem.call(e,{value:i,list:n,type:t,title:Ze.getLabel.call(e,"speed",i)})})),Ze.updateSetting.call(this,t,n))}},checkMenu:function(){var e=this.elements.settings.buttons,t=!ee(e)&&Object.values(e).some((function(e){return!e.hidden}));pe(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;Y(n)||(n=Object.values(this.elements.settings.panels).find((function(e){return!e.hidden})));var i=n.querySelector('[role^="menuitem"]');_e.call(this,i,t)}},toggleMenu:function(e){var t=this.elements.settings.popup,n=this.elements.buttons.settings;if(Y(t)&&Y(n)){var i=t.hidden,r=i;if(G(e))r=e;else if(X(e)&&27===e.which)r=!1;else if(Q(e)){var a=q(e.composedPath)?e.composedPath()[0]:e.target,o=t.contains(a);if(o||!o&&e.target!==n&&r)return}n.setAttribute("aria-expanded",r),pe(t,!r),me(this.elements.container,this.config.classNames.menu.open,r),r&&X(e)?Ze.focusFirstMenuItem.call(this,null,!0):r||i||_e.call(this,n,X(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 ce(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=this.elements.container.querySelector("#plyr-settings-".concat(this.id,"-").concat(t));if(Y(i)){var r=i.parentNode,a=Array.from(r.children).find((function(e){return!e.hidden}));if(Ee.transitions&&!Ee.reducedMotion){r.style.width="".concat(a.scrollWidth,"px"),r.style.height="".concat(a.scrollHeight,"px");var o=Ze.getMenuSize.call(this,i),s=function t(n){n.target===r&&["width","height"].includes(n.propertyName)&&(r.style.width="",r.style.height="",xe.call(e,r,te,t))};Ce.call(this,r,te,s),r.style.width="".concat(o.width,"px"),r.style.height="".concat(o.height,"px")}pe(a,!0),pe(i,!1),Ze.focusFirstMenuItem.call(this,i,n)}},setDownloadUrl:function(){var e=this.elements.buttons.download;Y(e)&&e.setAttribute("href",this.download)},create:function(e){var t=this,n=Ze.bindMenuItemShortcuts,i=Ze.createButton,r=Ze.createProgress,a=Ze.createRange,o=Ze.createTime,s=Ze.setQualityMenu,l=Ze.setSpeedMenu,u=Ze.showMenuPanel;this.elements.controls=null,K(this.config.controls)&&this.config.controls.includes("play-large")&&this.elements.container.appendChild(i.call(this,"play-large"));var c=le("div",he(this.config.selectors.controls.wrapper));this.elements.controls=c;var d={class:"plyr__controls__item"};return Be(K(this.config.controls)?this.config.controls:[]).forEach((function(s){if("restart"===s&&c.appendChild(i.call(t,"restart",d)),"rewind"===s&&c.appendChild(i.call(t,"rewind",d)),"play"===s&&c.appendChild(i.call(t,"play",d)),"fast-forward"===s&&c.appendChild(i.call(t,"fast-forward",d)),"progress"===s){var l=le("div",{class:"".concat(d.class," plyr__progress__container")}),f=le("div",he(t.config.selectors.progress));if(f.appendChild(a.call(t,"seek",{id:"plyr-seek-".concat(e.id)})),f.appendChild(r.call(t,"buffer")),t.config.tooltips.seek){var h=le("span",{class:t.config.classNames.tooltip},"00:00");f.appendChild(h),t.elements.display.seekTooltip=h}t.elements.progress=f,l.appendChild(t.elements.progress),c.appendChild(l)}if("current-time"===s&&c.appendChild(o.call(t,"currentTime",d)),"duration"===s&&c.appendChild(o.call(t,"duration",d)),"mute"===s||"volume"===s){var p=t.elements.volume;if(Y(p)&&c.contains(p)||(p=le("div",ae({},d,{class:"".concat(d.class," plyr__volume").trim()})),t.elements.volume=p,c.appendChild(p)),"mute"===s&&p.appendChild(i.call(t,"mute")),"volume"===s&&!ie.isIos){var m={max:1,step:.05,value:t.config.volume};p.appendChild(a.call(t,"volume",ae(m,{id:"plyr-volume-".concat(e.id)})))}}if("captions"===s&&c.appendChild(i.call(t,"captions",d)),"settings"===s&&!ee(t.config.settings)){var g=le("div",ae({},d,{class:"".concat(d.class," plyr__menu").trim(),hidden:""}));g.appendChild(i.call(t,"settings",{"aria-haspopup":!0,"aria-controls":"plyr-settings-".concat(e.id),"aria-expanded":!1}));var v=le("div",{class:"plyr__menu__container",id:"plyr-settings-".concat(e.id),hidden:""}),y=le("div"),b=le("div",{id:"plyr-settings-".concat(e.id,"-home")}),_=le("div",{role:"menu"});b.appendChild(_),y.appendChild(b),t.elements.settings.panels.home=b,t.config.settings.forEach((function(i){var r=le("button",ae(he(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:""}));n.call(t,r,i),Ce.call(t,r,"click",(function(){u.call(t,i,!1)}));var a=le("span",null,Ge(i,t.config)),o=le("span",{class:t.config.classNames.menu.value});o.innerHTML=e[i],a.appendChild(o),r.appendChild(a),_.appendChild(r);var s=le("div",{id:"plyr-settings-".concat(e.id,"-").concat(i),hidden:""}),l=le("button",{type:"button",class:"".concat(t.config.classNames.control," ").concat(t.config.classNames.control,"--back")});l.appendChild(le("span",{"aria-hidden":!0},Ge(i,t.config))),l.appendChild(le("span",{class:t.config.classNames.hidden},Ge("menuBack",t.config))),Ce.call(t,s,"keydown",(function(e){37===e.which&&(e.preventDefault(),e.stopPropagation(),u.call(t,"home",!0))}),!1),Ce.call(t,l,"click",(function(){u.call(t,"home",!1)})),s.appendChild(l),s.appendChild(le("div",{role:"menu"})),y.appendChild(s),t.elements.settings.buttons[i]=r,t.elements.settings.panels[i]=s})),v.appendChild(y),g.appendChild(v),c.appendChild(g),t.elements.settings.popup=v,t.elements.settings.menu=g}if("pip"===s&&Ee.pip&&c.appendChild(i.call(t,"pip",d)),"airplay"===s&&Ee.airplay&&c.appendChild(i.call(t,"airplay",d)),"download"===s){var k=ae({},d,{element:"a",href:t.download,target:"_blank"});t.isHTML5&&(k.download="");var w=t.config.urls.download;!Z(w)&&t.isEmbed&&ae(k,{icon:"logo-".concat(t.provider),label:t.provider}),c.appendChild(i.call(t,"download",k))}"fullscreen"===s&&c.appendChild(i.call(t,"fullscreen",d))})),this.isHTML5&&s.call(this,je.getQualityOptions.call(this)),l.call(this),c},inject:function(){var e=this;if(this.config.loadSprite){var t=Ze.getIconUrl.call(this);t.cors&&$e(t.url,"sprite-plyr")}this.id=Math.floor(1e4*Math.random());var n=null;this.elements.controls=null;var i,r,a={id:this.id,seektime:this.config.seekTime,title:this.config.title},o=!0;if(q(this.config.controls)&&(this.config.controls=this.config.controls.call(this,a)),this.config.controls||(this.config.controls=[]),Y(this.config.controls)||W(this.config.controls)?n=this.config.controls:(n=Ze.create.call(this,{id:this.id,seektime:this.config.seekTime,speed:this.speed,quality:this.quality,captions:nt.getLabel.call(this)}),o=!1),o&&W(this.config.controls)&&(i=n,Object.entries(a).forEach((function(e){var t=s(e,2),n=t[0],r=t[1];i=Fe(i,"{".concat(n,"}"),r)})),n=i),W(this.config.selectors.controls.container)&&(r=document.querySelector(this.config.selectors.controls.container)),Y(r)||(r=this.elements.container),r[Y(n)?"insertAdjacentElement":"insertAdjacentHTML"]("afterbegin",n),Y(this.elements.controls)||Ze.findElements.call(this),!ee(this.elements.buttons)){var l=function(t){var n=e.config.classNames.controlPressed;Object.defineProperty(t,"pressed",{enumerable:!0,get:function(){return ge(t,n)},set:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];me(t,n,e)}})};Object.values(this.elements.buttons).filter(Boolean).forEach((function(e){K(e)||$(e)?Array.from(e).filter(Boolean).forEach(l):l(e)}))}if(ie.isEdge&&ne(r),this.config.tooltips.controls){var u=this.config,c=u.classNames,d=u.selectors,f="".concat(d.controls.wrapper," ").concat(d.labels," .").concat(c.hidden),h=ye.call(this,f);Array.from(h).forEach((function(t){me(t,e.config.classNames.hidden,!1),me(t,e.config.classNames.tooltip,!0)}))}}};function et(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=e;if(t){var i=document.createElement("a");i.href=n,n=i.href}try{return new URL(n)}catch(e){return null}}function tt(e){var t=new URLSearchParams;return V(e)&&Object.entries(e).forEach((function(e){var n=s(e,2),i=n[0],r=n[1];t.set(i,r)})),t}var nt={setup:function(){if(this.supported.ui)if(!this.isVideo||this.isYouTube||this.isHTML5&&!Ee.textTracks)K(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&Ze.setCaptionsMenu.call(this);else{if(Y(this.elements.captions)||(this.elements.captions=le("div",he(this.config.selectors.captions)),function(e,t){Y(e)&&Y(t)&&t.parentNode.insertBefore(e,t.nextSibling)}(this.elements.captions,this.elements.wrapper)),ie.isIE&&window.URL){var e=this.media.querySelectorAll("track");Array.from(e).forEach((function(e){var t=e.getAttribute("src"),n=et(t);null!==n&&n.hostname!==window.location.href.hostname&&["http:","https:"].includes(n.protocol)&&Ke(t,"blob").then((function(t){e.setAttribute("src",window.URL.createObjectURL(t))})).catch((function(){ce(e)}))}))}var t=Be((navigator.languages||[navigator.language||navigator.userLanguage||"en"]).map((function(e){return e.split("-")[0]}))),n=(this.storage.get("language")||this.config.captions.language||"auto").toLowerCase();"auto"===n&&(n=s(t,1)[0]);var i=this.storage.get("captions");if(G(i)||(i=this.config.captions.active),Object.assign(this.captions,{toggled:!1,active:i,language:n,languages:t}),this.isHTML5){var r=this.config.captions.update?"addtrack removetrack":"removetrack";Ce.call(this,this.media.textTracks,r,nt.update.bind(this))}setTimeout(nt.update.bind(this),0)}},update:function(){var e=this,t=nt.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}),"showing"===t.mode&&(t.mode="hidden"),Ce.call(e,t,"cuechange",(function(){return nt.updateCues.call(e)}))})),(s&&this.language!==r||!t.includes(o))&&(nt.setLanguage.call(this,r),nt.toggle.call(this,i&&s)),me(this.elements.container,this.config.classNames.captions.enabled,!ee(t)),K(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&Ze.setCaptionsMenu.call(this)},toggle:function(e){var t=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.supported.ui){var i=this.captions.toggled,r=this.config.classNames.captions.active,a=z(e)?!i:e;if(a!==i){if(n||(this.captions.active=a,this.storage.set({captions:a})),!this.language&&a&&!n){var o=nt.getTracks.call(this),s=nt.findTrack.call(this,[this.captions.language].concat(l(this.captions.languages)),!0);return this.captions.language=s.language,void nt.set.call(this,o.indexOf(s))}this.elements.buttons.captions&&(this.elements.buttons.captions.pressed=a),me(this.elements.container,r,a),this.captions.toggled=a,Ze.updateSetting.call(this,"captions"),Ae.call(this,this.media,a?"captionsenabled":"captionsdisabled")}setTimeout((function(){a&&t.captions.toggled&&(t.captions.currentTrackNode.mode="hidden")}))}},set:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=nt.getTracks.call(this);if(-1!==e)if(H(e))if(e in n){if(this.captions.currentTrack!==e){this.captions.currentTrack=e;var i=n[e],r=i||{},a=r.language;this.captions.currentTrackNode=i,Ze.updateSetting.call(this,"captions"),t||(this.captions.language=a,this.storage.set({language:a})),this.isVimeo&&this.embed.enableTextTrack(a),Ae.call(this,this.media,"languagechange")}nt.toggle.call(this,!0,t),this.isHTML5&&this.isVideo&&nt.updateCues.call(this)}else this.debug.warn("Track not found",e);else this.debug.warn("Invalid caption argument",e);else nt.toggle.call(this,!1,t)},setLanguage:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(W(e)){var n=e.toLowerCase();this.captions.language=n;var i=nt.getTracks.call(this),r=nt.findTrack.call(this,[n]);nt.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],n=Array.from((this.media||{}).textTracks||[]);return n.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=nt.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 nt.getTracks.call(this)[this.currentTrack]},getLabel:function(e){var t=e;return!J(t)&&Ee.textTracks&&this.captions.toggled&&(t=nt.getCurrentTrack.call(this)),J(t)?ee(t.label)?ee(t.language)?Ge("enabled",this.config):e.language.toUpperCase():t.label:Ge("disabled",this.config)},updateCues:function(e){if(this.supported.ui)if(Y(this.elements.captions))if(z(e)||Array.isArray(e)){var t=e;if(!t){var n=nt.getCurrentTrack.call(this);t=Array.from((n||{}).activeCues||[]).map((function(e){return e.getCueAsHTML()})).map(He)}var i=t.map((function(e){return e.trim()})).join("\n");if(i!==this.elements.captions.innerHTML){de(this.elements.captions);var r=le("span",he(this.config.selectors.caption));r.innerHTML=i,this.elements.captions.appendChild(r),Ae.call(this,this.media,"cuechange")}}else this.debug.warn("updateCues: Invalid input",e);else this.debug.warn("No captions element to render to")}},it={enabled:!0,title:"",debug:!1,autoplay:!1,autopause:!0,playsinline:!0,seekTime:10,volume:1,muted:!1,duration:null,displayDuration:!0,invertTime:!0,toggleInvert:!0,ratio:null,clickToPlay:!0,hideControls:!0,resetOnEnd:!1,disableContextMenu:!0,loadSprite:!0,iconPrefix:"plyr",iconUrl:"https://cdn.plyr.io/3.6.3/plyr.svg",blankVideo:"https://cdn.plyr.io/static/blank.mp4",quality:{default:576,options:[4320,2880,2160,1440,1080,720,576,480,360,240],forced:!1,onChange:null},loop:{active:!1},speed:{selected:1,options:[.5,.75,1,1.25,1.5,1.75,2,4]},keyboard:{focused:!0,global:!1},tooltips:{controls:!1,seek:!0},captions:{active:!1,language:"auto",update:!1},fullscreen:{enabled:!0,fallback:!0,iosNative:!1},storage:{enabled:!0,key:"plyr"},controls:["play-large","play","progress","current-time","mute","volume","captions","settings","pip","airplay","fullscreen"],settings:["captions","quality","speed"],i18n:{restart:"Restart",rewind:"Rewind {seektime}s",play:"Play",pause:"Pause",fastForward:"Forward {seektime}s",seek:"Seek",seekLabel:"{currentTime} of {duration}",played:"Played",buffered:"Buffered",currentTime:"Current time",duration:"Duration",volume:"Volume",mute:"Mute",unmute:"Unmute",enableCaptions:"Enable captions",disableCaptions:"Disable captions",download:"Download",enterFullscreen:"Enter fullscreen",exitFullscreen:"Exit fullscreen",frameTitle:"Player for {title}",captions:"Captions",settings:"Settings",pip:"PIP",menuBack:"Go back to previous menu",speed:"Speed",normal:"Normal",quality:"Quality",loop:"Loop",start:"Start",end:"End",all:"All",reset:"Reset",disabled:"Disabled",enabled:"Enabled",advertisement:"Ad",qualityBadge:{2160:"4K",1440:"HD",1080:"HD",720:"HD",576:"SD",480:"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/oembed.json?url={0}"},youtube:{sdk:"https://www.youtube.com/iframe_api",api:"https://noembed.com/embed?url=https://www.youtube.com/watch?v={0}"},googleIMA:{sdk:"https://imasdk.googleapis.com/js/sdkloader/ima3.js"}},listeners:{seek:null,play:null,pause:null,restart:null,rewind:null,fastForward:null,mute:null,volume:null,captions:null,download:null,fullscreen:null,pip:null,airplay:null,speed:null,quality:null,loop:null,language:null},events:["ended","progress","stalled","playing","waiting","canplay","canplaythrough","loadstart","loadeddata","loadedmetadata","timeupdate","volumechange","play","pause","error","seeking","seeked","emptied","ratechange","cuechange","download","enterfullscreen","exitfullscreen","captionsenabled","captionsdisabled","languagechange","controlshidden","controlsshown","ready","statechange","qualitychange","adsloaded","adscontentpause","adscontentresume","adstarted","adsmidpoint","adscomplete","adsallcomplete","adsimpression","adsclick"],selectors:{editable:"input, textarea, select, [contenteditable]",container:".plyr",controls:{container:null,wrapper:".plyr__controls"},labels:"[data-plyr]",buttons:{play:'[data-plyr="play"]',pause:'[data-plyr="pause"]',restart:'[data-plyr="restart"]',rewind:'[data-plyr="rewind"]',fastForward:'[data-plyr="fast-forward"]',mute:'[data-plyr="mute"]',captions:'[data-plyr="captions"]',download:'[data-plyr="download"]',fullscreen:'[data-plyr="fullscreen"]',pip:'[data-plyr="pip"]',airplay:'[data-plyr="airplay"]',settings:'[data-plyr="settings"]',loop:'[data-plyr="loop"]'},inputs:{seek:'[data-plyr="seek"]',volume:'[data-plyr="volume"]',speed:'[data-plyr="speed"]',language:'[data-plyr="language"]',quality:'[data-plyr="quality"]'},display:{currentTime:".plyr__time--current",duration:".plyr__time--duration",buffer:".plyr__progress__buffer",loop:".plyr__progress__loop",volume:".plyr__volume--display"},progress:".plyr__progress",captions:".plyr__captions",caption:".plyr__caption"},classNames:{type:"plyr--{0}",provider:"plyr--{0}",video:"plyr__video-wrapper",embed:"plyr__video-embed",videoFixedRatio:"plyr__video-wrapper--fixed-ratio",embedContainer:"plyr__video-embed__container",poster:"plyr__poster",posterEnabled:"plyr__poster-enabled",ads:"plyr__ads",control:"plyr__control",controlPressed:"plyr__control--pressed",playing:"plyr--playing",paused:"plyr--paused",stopped:"plyr--stopped",loading:"plyr--loading",hover:"plyr--hover",tooltip:"plyr__tooltip",cues:"plyr__cues",hidden:"plyr__sr-only",hideControls:"plyr--hide-controls",isIos:"plyr--is-ios",isTouch:"plyr--is-touch",uiSupported:"plyr--full-ui",noTransition:"plyr--no-transition",display:{time:"plyr__time"},menu:{value:"plyr__menu__value",badge:"plyr__badge",open:"plyr--menu-open"},captions:{enabled:"plyr--captions-enabled",active:"plyr--captions-active"},fullscreen:{enabled:"plyr--fullscreen-enabled",fallback:"plyr--fullscreen-fallback"},pip:{supported:"plyr--pip-supported",active:"plyr--pip-active"},airplay:{supported:"plyr--airplay-supported",active:"plyr--airplay-active"},tabFocus:"plyr__tab-focus",previewThumbnails:{thumbContainer:"plyr__preview-thumb",thumbContainerShown:"plyr__preview-thumb--is-shown",imageContainer:"plyr__preview-thumb__image-container",timeContainer:"plyr__preview-thumb__time-container",scrubbingContainer:"plyr__preview-scrubbing",scrubbingContainerShown:"plyr__preview-scrubbing--is-shown"}},attributes:{embed:{provider:"data-plyr-provider",id:"data-plyr-embed-id"}},ads:{enabled:!1,publisherId:"",tagUrl:""},previewThumbnails:{enabled:!1,src:""},vimeo:{byline:!1,portrait:!1,title:!1,speed:!0,transparent:!1,customControls:!0,referrerPolicy:null,premium:!1},youtube:{rel:0,showinfo:0,iv_load_policy:3,modestbranding:1,customControls:!0,noCookie:!1}},rt="picture-in-picture",at={html5:"html5",youtube:"youtube",vimeo:"vimeo"},ot=function(){},st=function(){function t(){var n=arguments.length>0&&void 0!==arguments[0]&&arguments[0];e(this,t),this.enabled=window.console&&n,this.enabled&&this.log("Debugging enabled")}return i(t,[{key:"log",get:function(){return this.enabled?Function.prototype.bind.call(console.log,console):ot}},{key:"warn",get:function(){return this.enabled?Function.prototype.bind.call(console.warn,console):ot}},{key:"error",get:function(){return this.enabled?Function.prototype.bind.call(console.error,console):ot}}]),t}(),lt=function(){function t(n){var i=this;e(this,t),this.player=n,this.prefix=t.prefix,this.property=t.property,this.scrollPosition={x:0,y:0},this.forceFallback="force"===n.config.fullscreen.fallback,this.player.elements.fullscreen=n.config.fullscreen.container&&function(e,t){return(Element.prototype.closest||function(){var e=this;do{if(ve.matches(e,t))return e;e=e.parentElement||e.parentNode}while(null!==e&&1===e.nodeType);return null}).call(e,t)}(this.player.elements.container,n.config.fullscreen.container),Ce.call(this.player,document,"ms"===this.prefix?"MSFullscreenChange":"".concat(this.prefix,"fullscreenchange"),(function(){i.onChange()})),Ce.call(this.player,this.player.elements.container,"dblclick",(function(e){Y(i.player.elements.controls)&&i.player.elements.controls.contains(e.target)||i.player.listeners.proxy(e,i.toggle,"fullscreen")})),Ce.call(this,this.player.elements.container,"keydown",(function(e){return i.trapFocus(e)})),this.update()}return i(t,[{key:"onChange",value:function(){if(this.enabled){var e=this.player.elements.buttons.fullscreen;Y(e)&&(e.pressed=this.active);var t=this.target===this.player.media?this.target:this.player.elements.container;Ae.call(this.player,t,this.active?"enterfullscreen":"exitfullscreen",!0)}}},{key:"toggleFallback",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(e?this.scrollPosition={x:window.scrollX||0,y:window.scrollY||0}:window.scrollTo(this.scrollPosition.x,this.scrollPosition.y),document.body.style.overflow=e?"hidden":"",me(this.target,this.player.config.classNames.fullscreen.fallback,e),ie.isIos){var t=document.head.querySelector('meta[name="viewport"]'),n="viewport-fit=cover";t||(t=document.createElement("meta")).setAttribute("name","viewport");var i=W(t.content)&&t.content.includes(n);e?(this.cleanupViewport=!i,i||(t.content+=",".concat(n))):this.cleanupViewport&&(t.content=t.content.split(",").filter((function(e){return e.trim()!==n})).join(","))}this.onChange()}},{key:"trapFocus",value:function(e){if(!ie.isIos&&this.active&&"Tab"===e.key&&9===e.keyCode){var t=document.activeElement,n=ye.call(this.player,"a[href], button:not(:disabled), input:not(:disabled), [tabindex]"),i=s(n,1)[0],r=n[n.length-1];t!==r||e.shiftKey?t===i&&e.shiftKey&&(r.focus(),e.preventDefault()):(i.focus(),e.preventDefault())}}},{key:"update",value:function(){var e;this.enabled?(e=this.forceFallback?"Fallback (forced)":t.native?"Native":"Fallback",this.player.debug.log("".concat(e," fullscreen enabled"))):this.player.debug.log("Fullscreen not supported and fallback disabled"),me(this.player.elements.container,this.player.config.classNames.fullscreen.enabled,this.enabled)}},{key:"enter",value:function(){this.enabled&&(ie.isIos&&this.player.config.fullscreen.iosNative?this.target.webkitEnterFullscreen():!t.native||this.forceFallback?this.toggleFallback(!0):this.prefix?ee(this.prefix)||this.target["".concat(this.prefix,"Request").concat(this.property)]():this.target.requestFullscreen({navigationUI:"hide"}))}},{key:"exit",value:function(){if(this.enabled)if(ie.isIos&&this.player.config.fullscreen.iosNative)this.target.webkitExitFullscreen(),Pe(this.player.play());else if(!t.native||this.forceFallback)this.toggleFallback(!1);else if(this.prefix){if(!ee(this.prefix)){var e="moz"===this.prefix?"Cancel":"Exit";document["".concat(this.prefix).concat(e).concat(this.property)]()}}else(document.cancelFullScreen||document.exitFullscreen).call(document)}},{key:"toggle",value:function(){this.active?this.exit():this.enter()}},{key:"usingNative",get:function(){return t.native&&!this.forceFallback}},{key:"enabled",get:function(){return(t.native||this.player.config.fullscreen.fallback)&&this.player.config.fullscreen.enabled&&this.player.supported.ui&&this.player.isVideo}},{key:"active",get:function(){if(!this.enabled)return!1;if(!t.native||this.forceFallback)return ge(this.target,this.player.config.classNames.fullscreen.fallback);var e=this.prefix?document["".concat(this.prefix).concat(this.property,"Element")]:document.fullscreenElement;return e&&e.shadowRoot?e===this.target.getRootNode().host:e===this.target}},{key:"target",get:function(){return ie.isIos&&this.player.config.fullscreen.iosNative?this.player.media:this.player.elements.fullscreen||this.player.elements.container}}],[{key:"native",get:function(){return!!(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}},{key:"prefix",get:function(){if(q(document.exitFullscreen))return"";var e="";return["webkit","moz","ms"].some((function(t){return!(!q(document["".concat(t,"ExitFullscreen")])&&!q(document["".concat(t,"CancelFullScreen")]))&&(e=t,!0)})),e}},{key:"property",get:function(){return"moz"===this.prefix?"FullScreen":"Fullscreen"}}]),t}();function ut(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})}))}var ct={addStyleHook:function(){me(this.elements.container,this.config.selectors.container.replace(".",""),!0),me(this.elements.container,this.config.classNames.uiSupported,this.supported.ui)},toggleNativeControls:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];e&&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 ct.toggleNativeControls.call(this,!0);Y(this.elements.controls)||(Ze.inject.call(this),this.listeners.controls()),ct.toggleNativeControls.call(this),this.isHTML5&&nt.setup.call(this),this.volume=null,this.muted=null,this.loop=null,this.quality=null,this.speed=null,Ze.updateVolume.call(this),Ze.timeUpdate.call(this),ct.checkPlaying.call(this),me(this.elements.container,this.config.classNames.pip.supported,Ee.pip&&this.isHTML5&&this.isVideo),me(this.elements.container,this.config.classNames.airplay.supported,Ee.airplay&&this.isHTML5),me(this.elements.container,this.config.classNames.isIos,ie.isIos),me(this.elements.container,this.config.classNames.isTouch,this.touch),this.ready=!0,setTimeout((function(){Ae.call(e,e.media,"ready")}),0),ct.setTitle.call(this),this.poster&&ct.setPoster.call(this,this.poster,!1).catch((function(){})),this.config.duration&&Ze.durationUpdate.call(this)},setTitle:function(){var e=Ge("play",this.config);if(W(this.config.title)&&!ee(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=be.call(this,"iframe");if(!Y(t))return;var n=ee(this.config.title)?"video":this.config.title,i=Ge("frameTitle",this.config);t.setAttribute("title",i.replace("{title}",n))}},togglePoster:function(e){me(this.elements.container,this.config.classNames.posterEnabled,e)},setPoster:function(e){var t=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return n&&this.poster?Promise.reject(new Error("Poster already set")):(this.media.setAttribute("data-poster",e),this.elements.poster.removeAttribute("hidden"),Le.call(this).then((function(){return ut(e)})).catch((function(n){throw e===t.poster&&ct.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:""}),ct.togglePoster.call(t,!0),e})))},checkPlaying:function(e){var t=this;me(this.elements.container,this.config.classNames.playing,this.playing),me(this.elements.container,this.config.classNames.paused,this.paused),me(this.elements.container,this.config.classNames.stopped,this.stopped),Array.from(this.elements.buttons.play||[]).forEach((function(e){Object.assign(e,{pressed:t.playing}),e.setAttribute("aria-label",Ge(t.playing?"pause":"play",t.config))})),Q(e)&&"timeupdate"===e.type||ct.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(){me(t.elements.container,t.config.classNames.loading,t.loading),ct.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))}},migrateStyles:function(){var e=this;Object.values(o({},this.media.style)).filter((function(e){return!ee(e)&&W(e)&&e.startsWith("--plyr")})).forEach((function(t){e.elements.container.style.setProperty(t,e.media.style.getPropertyValue(t)),e.media.style.removeProperty(t)})),ee(this.media.style)&&this.media.removeAttribute("style")}},dt=function(){function t(n){e(this,t),this.player=n,this.lastKey=null,this.focusTimer=null,this.lastKeyDown=null,this.handleKey=this.handleKey.bind(this),this.toggleMenu=this.toggleMenu.bind(this),this.setTabFocus=this.setTabFocus.bind(this),this.firstTouch=this.firstTouch.bind(this)}return i(t,[{key:"handleKey",value:function(e){var t=this.player,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)&&H(i))if(r){var o=document.activeElement;if(Y(o)){var s=t.config.selectors.editable;if(o!==n.inputs.seek&&ve(o,s))return;if(32===e.which&&ve(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||Pe(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){Ze.toggleMenu.call(this.player,e)}},{key:"firstTouch",value:function(){var e=this.player,t=e.elements;e.touch=!0,me(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;("focus"!==e.type||r)&&(i=t.config.classNames.tabFocus,me(ye.call(t,".".concat(i)),i,!1),"focusout"!==e.type&&(this.focusTimer=setTimeout((function(){var e=document.activeElement;n.container.contains(e)&&me(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&&Te.call(t,window,"keydown keyup",this.handleKey,e,!1),Te.call(t,document.body,"click",this.toggleMenu,e),Oe.call(t,document.body,"touchstart",this.firstTouch),Te.call(t,document.body,"keydown focus blur focusout",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&&Ce.call(e,n.container,"keydown keyup",this.handleKey,!1),Ce.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)&&(ct.toggleControls.call(e,!0),a=e.touch?3e3:2e3),clearTimeout(i.controls),i.controls=setTimeout((function(){return ct.toggleControls.call(e,!1)}),a)}));var r=function(t){if(!t)return Ne.call(e);var i=n.container.getBoundingClientRect(),r=i.width,a=i.height;return Ne.call(e,"".concat(r,":").concat(a))},a=function(){clearTimeout(i.resized),i.resized=setTimeout(r,50)};Ce.call(e,n.container,"enterfullscreen exitfullscreen",(function(t){var i=e.fullscreen,o=i.target,l=i.usingNative;if(o===n.container&&(e.isEmbed||!ee(e.config.ratio))){var u="enterfullscreen"===t.type,c=r(u);c.padding,function(t,n,i){if(e.isVimeo&&!e.config.vimeo.premium){var r=e.elements.wrapper.firstChild,a=s(t,2)[1],o=s(De.call(e),2),l=o[0],u=o[1];r.style.maxWidth=i?"".concat(a/u*l,"px"):null,r.style.margin=i?"0 auto":null}}(c.ratio,0,u),u&&setTimeout((function(){return ne(n.container)}),100),l||(u?Ce.call(e,window,"resize",a):xe.call(e,window,"resize",a))}}))}},{key:"media",value:function(){var e=this,t=this.player,n=t.elements;if(Ce.call(t,t.media,"timeupdate seeking seeked",(function(e){return Ze.timeUpdate.call(t,e)})),Ce.call(t,t.media,"durationchange loadeddata loadedmetadata",(function(e){return Ze.durationUpdate.call(t,e)})),Ce.call(t,t.media,"ended",(function(){t.isHTML5&&t.isVideo&&t.config.resetOnEnd&&(t.restart(),t.pause())})),Ce.call(t,t.media,"progress playing seeking seeked",(function(e){return Ze.updateProgress.call(t,e)})),Ce.call(t,t.media,"volumechange",(function(e){return Ze.updateVolume.call(t,e)})),Ce.call(t,t.media,"playing play pause ended emptied timeupdate",(function(e){return ct.checkPlaying.call(t,e)})),Ce.call(t,t.media,"waiting canplay seeked playing",(function(e){return ct.checkLoading.call(t,e)})),t.supported.ui&&t.config.clickToPlay&&!t.isAudio){var i=be.call(t,".".concat(t.config.classNames.video));if(!Y(i))return;Ce.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,(function(){Pe(t.play())}),"play")):e.proxy(r,(function(){Pe(t.togglePlay())}),"play")))}))}t.supported.ui&&t.config.disableContextMenu&&Ce.call(t,n.wrapper,"contextmenu",(function(e){e.preventDefault()}),!1),Ce.call(t,t.media,"volumechange",(function(){t.storage.set({volume:t.volume,muted:t.muted})})),Ce.call(t,t.media,"ratechange",(function(){Ze.updateSetting.call(t,"speed"),t.storage.set({speed:t.speed})})),Ce.call(t,t.media,"qualitychange",(function(e){Ze.updateSetting.call(t,"quality",null,e.detail.quality)})),Ce.call(t,t.media,"ready qualitychange",(function(){Ze.setDownloadUrl.call(t)}));var r=t.config.events.concat(["keyup","keydown"]).join(" ");Ce.call(t,t.media,r,(function(e){var i=e.detail,r=void 0===i?{}:i;"error"===e.type&&(r=t.media.error),Ae.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;q(r)&&(a=r.call(i,e)),!1!==a&&q(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=q(s);Ce.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=ie.isIE?"change":"input";if(n.buttons.play&&Array.from(n.buttons.play).forEach((function(n){e.bind(n,"click",(function(){Pe(t.togglePlay())}),"play")})),this.bind(n.buttons.restart,"click",t.restart,"restart"),this.bind(n.buttons.rewind,"click",(function(){t.lastSeekTime=Date.now(),t.rewind()}),"rewind"),this.bind(n.buttons.fastForward,"click",(function(){t.lastSeekTime=Date.now(),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(){Ae.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(),e.preventDefault(),Ze.toggleMenu.call(t,e)}),null,!1),this.bind(n.buttons.settings,"keyup",(function(e){var n=e.which;[13,32].includes(n)&&(13!==n?(e.preventDefault(),e.stopPropagation(),Ze.toggleMenu.call(t,e)):Ze.focusFirstMenuItem.call(t,null,!0))}),null,!1),this.bind(n.settings.menu,"keydown",(function(e){27===e.which&&Ze.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,r="play-on-seeked";if(!X(e)||39===i||37===i){t.lastSeekTime=Date.now();var a=n.hasAttribute(r),o=["mouseup","touchend","keyup"].includes(e.type);a&&o?(n.removeAttribute(r),Pe(t.play())):!o&&t.playing&&(n.setAttribute(r,""),t.pause())}})),ie.isIos){var r=ye.call(t,'input[type="range"]');Array.from(r).forEach((function(t){return e.bind(t,i,(function(e){return ne(e.target)}))}))}this.bind(n.inputs.seek,i,(function(e){var n=e.currentTarget,i=n.getAttribute("seek-value");ee(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 Ze.updateSeekTooltip.call(t,e)})),this.bind(n.progress,"mousemove touchmove",(function(e){var n=t.previewThumbnails;n&&n.loaded&&n.startMove(e)})),this.bind(n.progress,"mouseleave touchend click",(function(){var e=t.previewThumbnails;e&&e.loaded&&e.endMove(!1,!0)})),this.bind(n.progress,"mousedown touchstart",(function(e){var n=t.previewThumbnails;n&&n.loaded&&n.startScrubbing(e)})),this.bind(n.progress,"mouseup touchend",(function(e){var n=t.previewThumbnails;n&&n.loaded&&n.endScrubbing(e)})),ie.isWebkit&&Array.from(ye.call(t,'input[type="range"]')).forEach((function(n){e.bind(n,"input",(function(e){return Ze.updateRangeFill.call(t,e.target)}))})),t.config.toggleInvert&&!Y(n.display.duration)&&this.bind(n.display.currentTime,"click",(function(){0!==t.currentTime&&(t.config.invertTime=!t.config.invertTime,Ze.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})),n.fullscreen&&Array.from(n.fullscreen.children).filter((function(e){return!e.contains(n.container)})).forEach((function(i){e.bind(i,"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 i=t.config,r=t.timers;me(n.controls,i.classNames.noTransition,!0),ct.toggleControls.call(t,!0),setTimeout((function(){me(n.controls,i.classNames.noTransition,!1)}),0);var a=e.touch?3e3:4e3;clearTimeout(r.controls),r.controls=setTimeout((function(){return ct.toggleControls.call(t,!1)}),a)})),this.bind(n.inputs.volume,"wheel",(function(e){var n=e.webkitDirectionInvertedFromDevice,i=s([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 l=t.media.volume;(1===o&&l<1||-1===o&&l>0)&&e.preventDefault()}),"volume",!1)}}]),t}();"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof t||"undefined"!=typeof self&&self;var ft=function(e,t){return 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,u=i.async,c=(i.numRetries||0)+1,d=i.before||e,f=t.replace(/[\?|#].*$/,""),h=t.replace(/^(css|img)!/,"");r=r||0,/(^css!|\.css$)/.test(f)?((s=l.createElement("link")).rel="stylesheet",s.href=h,(a="hideFocus"in s)&&s.relList&&(a=0,s.rel="preload",s.as="style")):/(^img!|\.(png|gif|jpg|svg|webp)$)/.test(f)?(s=l.createElement("img")).src=h:((s=l.createElement("script")).src=t,s.async=void 0===u||u),s.onload=s.onerror=s.onbeforeload=function(e){var l=e.type[0];if(a)try{s.sheet.cssText.length||(l="e")}catch(e){18!=e.code&&(l="e")}if("e"==l){if((r+=1)=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}(n,["premium","referrerPolicy"]);i&&Object.assign(a,{controls:!1,sidedock:!1});var l=tt(o({loop:t.config.loop.active,autoplay:t.autoplay,muted:t.muted,gesture:"media",playsinline:!this.config.fullscreen.iosNative},a)),u=t.media.getAttribute("src");ee(u)&&(u=t.media.getAttribute(t.config.attributes.embed.id));var c,d=ee(c=u)?null:H(Number(c))?c:c.match(/^.*(vimeo.com\/|video\/)(\d+).*/)?RegExp.$2:c,f=le("iframe"),h=Ue(t.config.urls.vimeo.iframe,d,l);if(f.setAttribute("src",h),f.setAttribute("allowfullscreen",""),f.setAttribute("allow","autoplay,fullscreen,picture-in-picture"),ee(r)||f.setAttribute("referrerPolicy",r),i||!n.customControls)f.setAttribute("data-poster",t.poster),t.media=fe(f,t.media);else{var p=le("div",{class:t.config.classNames.embedContainer,"data-poster":t.poster});p.appendChild(f),t.media=fe(p,t.media)}n.customControls||Ke(Ue(t.config.urls.vimeo.api,h)).then((function(e){!ee(e)&&e.thumbnail_url&&ct.setPoster.call(t,e.thumbnail_url).catch((function(){}))})),t.embed=new window.Vimeo.Player(f,{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 pt.call(t,!0),t.embed.play()},t.media.pause=function(){return pt.call(t,!1),t.embed.pause()},t.media.stop=function(){t.pause(),t.currentTime=0};var m=t.media.currentTime;Object.defineProperty(t.media,"currentTime",{get:function(){return m},set:function(e){var n=t.embed,i=t.media,r=t.paused,a=t.volume,o=r&&!n.hasPlayed;i.seeking=!0,Ae.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 g=t.config.speed.selected;Object.defineProperty(t.media,"playbackRate",{get:function(){return g},set:function(e){t.embed.setPlaybackRate(e).then((function(){g=e,Ae.call(t,t.media,"ratechange")})).catch((function(){t.options.speed=[1]}))}});var v=t.config.volume;Object.defineProperty(t.media,"volume",{get:function(){return v},set:function(e){t.embed.setVolume(e).then((function(){v=e,Ae.call(t,t.media,"volumechange")}))}});var y=t.config.muted;Object.defineProperty(t.media,"muted",{get:function(){return y},set:function(e){var n=!!G(e)&&e;t.embed.setVolume(n?0:t.config.volume).then((function(){y=n,Ae.call(t,t.media,"volumechange")}))}});var b,_=t.config.loop;Object.defineProperty(t.media,"loop",{get:function(){return _},set:function(e){var n=G(e)?e:t.config.loop.active;t.embed.setLoop(n).then((function(){_=n}))}}),t.embed.getVideoUrl().then((function(e){b=e,Ze.setDownloadUrl.call(t)})).catch((function(t){e.debug.warn(t)})),Object.defineProperty(t.media,"currentSrc",{get:function(){return b}}),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=s(n,2),r=i[0],a=i[1];t.embed.ratio=[r,a],Ne.call(e)})),t.embed.setAutopause(t.config.autopause).then((function(e){t.config.autopause=e})),t.embed.getVideoTitle().then((function(n){t.config.title=n,ct.setTitle.call(e)})),t.embed.getCurrentTime().then((function(e){m=e,Ae.call(t,t.media,"timeupdate")})),t.embed.getDuration().then((function(e){t.media.duration=e,Ae.call(t,t.media,"durationchange")})),t.embed.getTextTracks().then((function(e){t.media.textTracks=e,nt.setup.call(t)})),t.embed.on("cuechange",(function(e){var n=e.cues,i=(void 0===n?[]:n).map((function(e){return function(e){var t=document.createDocumentFragment(),n=document.createElement("div");return t.appendChild(n),n.innerHTML=e,t.firstChild.innerText}(e.text)}));nt.updateCues.call(t,i)})),t.embed.on("loaded",(function(){t.embed.getPaused().then((function(e){pt.call(t,!e),e||Ae.call(t,t.media,"playing")})),Y(t.embed.element)&&t.supported.ui&&t.embed.element.setAttribute("tabindex",-1)})),t.embed.on("bufferstart",(function(){Ae.call(t,t.media,"waiting")})),t.embed.on("bufferend",(function(){Ae.call(t,t.media,"playing")})),t.embed.on("play",(function(){pt.call(t,!0),Ae.call(t,t.media,"playing")})),t.embed.on("pause",(function(){pt.call(t,!1)})),t.embed.on("timeupdate",(function(e){t.media.seeking=!1,m=e.seconds,Ae.call(t,t.media,"timeupdate")})),t.embed.on("progress",(function(e){t.media.buffered=e.percent,Ae.call(t,t.media,"progress"),1===parseInt(e.percent,10)&&Ae.call(t,t.media,"canplaythrough"),t.embed.getDuration().then((function(e){e!==t.media.duration&&(t.media.duration=e,Ae.call(t,t.media,"durationchange"))}))})),t.embed.on("seeked",(function(){t.media.seeking=!1,Ae.call(t,t.media,"seeked")})),t.embed.on("ended",(function(){t.media.paused=!0,Ae.call(t,t.media,"ended")})),t.embed.on("error",(function(e){t.media.error=e,Ae.call(t,t.media,"error")})),n.customControls&&setTimeout((function(){return ct.build.call(t)}),0)}};function gt(e){e&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===e&&(this.media.paused=!e,Ae.call(this,this.media,e?"play":"pause"))}function vt(e){return e.noCookie?"https://www.youtube-nocookie.com":"http:"===window.location.protocol?"http://www.youtube.com":void 0}var yt,bt={setup:function(){var e=this;if(me(this.elements.wrapper,this.config.classNames.embed,!0),V(window.YT)&&q(window.YT.Player))bt.ready.call(this);else{var t=window.onYouTubeIframeAPIReady;window.onYouTubeIframeAPIReady=function(){q(t)&&t(),bt.ready.call(e)},ht(this.config.urls.youtube.sdk).catch((function(t){e.debug.warn("YouTube API failed to load",t)}))}},getTitle:function(e){var t=this;Ke(Ue(this.config.urls.youtube.api,e)).then((function(e){if(V(e)){var n=e.title,i=e.height,r=e.width;t.config.title=n,ct.setTitle.call(t),t.embed.ratio=[r,i]}Ne.call(t)})).catch((function(){Ne.call(t)}))},ready:function(){var e=this,t=e.config.youtube,n=e.media&&e.media.getAttribute("id");if(ee(n)||!n.startsWith("youtube-")){var i=e.media.getAttribute("src");ee(i)&&(i=e.media.getAttribute(this.config.attributes.embed.id));var r,a,o=ee(r=i)?null:r.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/)?RegExp.$2:r,s=le("div",{id:(a=e.provider,"".concat(a,"-").concat(Math.floor(1e4*Math.random()))),"data-poster":t.customControls?e.poster:void 0});if(e.media=fe(s,e.media),t.customControls){var l=function(e){return"https://i.ytimg.com/vi/".concat(o,"/").concat(e,"default.jpg")};ut(l("maxres"),121).catch((function(){return ut(l("sd"),121)})).catch((function(){return ut(l("hq"))})).then((function(t){return ct.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(e.media,{videoId:o,host:vt(t),playerVars:ae({},{autoplay:e.config.autoplay?1:0,hl:e.config.hl,controls:e.supported.ui&&t.customControls?0:1,disablekb:1,playsinline:e.config.fullscreen.iosNative?0:1,cc_load_policy:e.captions.active?1:0,cc_lang_pref:e.config.captions.language,widget_referrer:window?window.location.href:null},t),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},Ae.call(e,e.media,"error")}},onPlaybackRateChange:function(t){var n=t.target;e.media.playbackRate=n.getPlaybackRate(),Ae.call(e,e.media,"ratechange")},onReady:function(n){if(!q(e.media.play)){var i=n.target;bt.getTitle.call(e,o),e.media.play=function(){gt.call(e,!0),i.playVideo()},e.media.pause=function(){gt.call(e,!1),i.pauseVideo()},e.media.stop=function(){i.stopVideo()},e.media.duration=i.getDuration(),e.media.paused=!0,e.media.currentTime=0,Object.defineProperty(e.media,"currentTime",{get:function(){return Number(i.getCurrentTime())},set:function(t){e.paused&&!e.embed.hasPlayed&&e.embed.mute(),e.media.seeking=!0,Ae.call(e,e.media,"seeking"),i.seekTo(t)}}),Object.defineProperty(e.media,"playbackRate",{get:function(){return i.getPlaybackRate()},set:function(e){i.setPlaybackRate(e)}});var r=e.config.volume;Object.defineProperty(e.media,"volume",{get:function(){return r},set:function(t){r=t,i.setVolume(100*r),Ae.call(e,e.media,"volumechange")}});var a=e.config.muted;Object.defineProperty(e.media,"muted",{get:function(){return a},set:function(t){var n=G(t)?t:a;a=n,i[n?"mute":"unMute"](),i.setVolume(100*r),Ae.call(e,e.media,"volumechange")}}),Object.defineProperty(e.media,"currentSrc",{get:function(){return i.getVideoUrl()}}),Object.defineProperty(e.media,"ended",{get:function(){return e.currentTime===e.duration}});var s=i.getAvailablePlaybackRates();e.options.speed=s.filter((function(t){return e.config.speed.options.includes(t)})),e.supported.ui&&t.customControls&&e.media.setAttribute("tabindex",-1),Ae.call(e,e.media,"timeupdate"),Ae.call(e,e.media,"durationchange"),clearInterval(e.timers.buffering),e.timers.buffering=setInterval((function(){e.media.buffered=i.getVideoLoadedFraction(),(null===e.media.lastBuffered||e.media.lastBuffered0&&void 0!==arguments[0]&&arguments[0];if(!t)return clearInterval(this.countdownTimer),void this.elements.container.removeAttribute("data-badge-text");var n=function(){var t=Je(Math.max(e.manager.getRemainingTime(),0)),n="".concat(Ge("advertisement",e.player.config)," - ").concat(t);e.elements.container.setAttribute("data-badge-text",n)};this.countdownTimer=setInterval(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(),this.manager.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,(function(e){return t.onAdError(e)})),Object.keys(google.ima.AdEvent.Type).forEach((function(e){t.manager.addEventListener(google.ima.AdEvent.Type[e],(function(e){return t.onAdEvent(e)}))})),this.trigger("loaded")}}},{key:"addCuePoints",value:function(){var e=this;ee(this.cuePoints)||this.cuePoints.forEach((function(t){if(0!==t&&-1!==t&&t1?n-1:0),r=1;rt.width/t.height?(n.width=t.width,n.height=1/e*t.width):(n.height=t.height,n.width=e*t.height),n},Et=function(){function t(n){e(this,t),this.player=n,this.thumbnails=[],this.loaded=!1,this.lastMouseMoveTime=Date.now(),this.mouseDown=!1,this.loadedImages=[],this.elements={thumb:{},scrubbing:{}},this.load()}return i(t,[{key:"load",value:function(){var e=this;this.player.elements.display.seekTooltip&&(this.player.elements.display.seekTooltip.hidden=this.enabled),this.enabled&&this.getThumbnails().then((function(){e.enabled&&(e.render(),e.determineContainerAutoSizing(),e.loaded=!0)}))}},{key:"getThumbnails",value:function(){var e=this;return new Promise((function(t){var n=e.player.config.previewThumbnails.src;if(ee(n))throw new Error("Missing previewThumbnails.src config attribute");var i=function(){e.thumbnails.sort((function(e,t){return e.height-t.height})),e.player.debug.log("Preview thumbnails",e.thumbnails),t()};if(q(n))n((function(t){e.thumbnails=t,i()}));else{var r=(W(n)?[n]:n).map((function(t){return e.getThumbnail(t)}));Promise.all(r).then(i)}}))}},{key:"getThumbnail",value:function(e){var t=this;return new Promise((function(n){Ke(e).then((function(i){var r,a,o={frames:(r=i,a=[],r.split(/\r\n\r\n|\n\n|\r\r/).forEach((function(e){var t={};e.split(/\r\n|\n|\r/).forEach((function(e){if(H(t.startTime)){if(!ee(e.trim())&&ee(t.text)){var n=e.trim().split("#xywh="),i=s(n,1);if(t.text=i[0],n[1]){var r=s(n[1].split(","),4);t.x=r[0],t.y=r[1],t.w=r[2],t.h=r[3]}}}else{var a=e.match(/([0-9]{2})?:?([0-9]{2}):([0-9]{2}).([0-9]{2,3})( ?--> ?)([0-9]{2})?:?([0-9]{2}):([0-9]{2}).([0-9]{2,3})/);a&&(t.startTime=60*Number(a[1]||0)*60+60*Number(a[2])+Number(a[3])+Number("0.".concat(a[4])),t.endTime=60*Number(a[6]||0)*60+60*Number(a[7])+Number(a[8])+Number("0.".concat(a[9])))}})),t.text&&a.push(t)})),a),height:null,urlPrefix:""};o.frames[0].text.startsWith("/")||o.frames[0].text.startsWith("http://")||o.frames[0].text.startsWith("https://")||(o.urlPrefix=e.substring(0,e.lastIndexOf("/")+1));var l=new Image;l.onload=function(){o.height=l.naturalHeight,o.width=l.naturalWidth,t.thumbnails.push(o),n()},l.src=o.urlPrefix+o.frames[0].text}))}))}},{key:"startMove",value:function(e){if(this.loaded&&Q(e)&&["touchmove","mousemove"].includes(e.type)&&this.player.media.duration){if("touchmove"===e.type)this.seekTime=this.player.media.duration*(this.player.elements.inputs.seek.value/100);else{var t=this.player.elements.progress.getBoundingClientRect(),n=100/t.width*(e.pageX-t.left);this.seekTime=this.player.media.duration*(n/100),this.seekTime<0&&(this.seekTime=0),this.seekTime>this.player.media.duration-1&&(this.seekTime=this.player.media.duration-1),this.mousePosX=e.pageX,this.elements.thumb.time.innerText=Je(this.seekTime)}this.showImageAtCurrentTime()}}},{key:"endMove",value:function(){this.toggleThumbContainer(!1,!0)}},{key:"startScrubbing",value:function(e){(z(e.button)||!1===e.button||0===e.button)&&(this.mouseDown=!0,this.player.media.duration&&(this.toggleScrubbingContainer(!0),this.toggleThumbContainer(!1,!0),this.showImageAtCurrentTime()))}},{key:"endScrubbing",value:function(){var e=this;this.mouseDown=!1,Math.ceil(this.lastTime)===Math.ceil(this.player.media.currentTime)?this.toggleScrubbingContainer(!1):Oe.call(this.player,this.player.media,"timeupdate",(function(){e.mouseDown||e.toggleScrubbingContainer(!1)}))}},{key:"listeners",value:function(){var e=this;this.player.on("play",(function(){e.toggleThumbContainer(!1,!0)})),this.player.on("seeked",(function(){e.toggleThumbContainer(!1)})),this.player.on("timeupdate",(function(){e.lastTime=e.player.media.currentTime}))}},{key:"render",value:function(){this.elements.thumb.container=le("div",{class:this.player.config.classNames.previewThumbnails.thumbContainer}),this.elements.thumb.imageContainer=le("div",{class:this.player.config.classNames.previewThumbnails.imageContainer}),this.elements.thumb.container.appendChild(this.elements.thumb.imageContainer);var e=le("div",{class:this.player.config.classNames.previewThumbnails.timeContainer});this.elements.thumb.time=le("span",{},"00:00"),e.appendChild(this.elements.thumb.time),this.elements.thumb.container.appendChild(e),Y(this.player.elements.progress)&&this.player.elements.progress.appendChild(this.elements.thumb.container),this.elements.scrubbing.container=le("div",{class:this.player.config.classNames.previewThumbnails.scrubbingContainer}),this.player.elements.wrapper.appendChild(this.elements.scrubbing.container)}},{key:"destroy",value:function(){this.elements.thumb.container&&this.elements.thumb.container.remove(),this.elements.scrubbing.container&&this.elements.scrubbing.container.remove()}},{key:"showImageAtCurrentTime",value:function(){var e=this;this.mouseDown?this.setScrubbingContainerSize():this.setThumbContainerSizeAndPos();var t=this.thumbnails[0].frames.findIndex((function(t){return e.seekTime>=t.startTime&&e.seekTime<=t.endTime})),n=t>=0,i=0;this.mouseDown||this.toggleThumbContainer(n),n&&(this.thumbnails.forEach((function(n,r){e.loadedImages.includes(n.frames[t].text)&&(i=r)})),t!==this.showingThumb&&(this.showingThumb=t,this.loadImage(i)))}},{key:"loadImage",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=this.showingThumb,i=this.thumbnails[t],r=i.urlPrefix,a=i.frames[n],o=i.frames[n].text,s=r+o;if(this.currentImageElement&&this.currentImageElement.dataset.filename===o)this.showImage(this.currentImageElement,a,t,n,o,!1),this.currentImageElement.dataset.index=n,this.removeOldImages(this.currentImageElement);else{this.loadingImage&&this.usingSprites&&(this.loadingImage.onload=null);var l=new Image;l.src=s,l.dataset.index=n,l.dataset.filename=o,this.showingThumbFilename=o,this.player.debug.log("Loading image: ".concat(s)),l.onload=function(){return e.showImage(l,a,t,n,o,!0)},this.loadingImage=l,this.removeOldImages(l)}}},{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: ".concat(r,". num: ").concat(i,". qual: ").concat(n,". newimg: ").concat(a)),this.setImageSizeAndOffset(e,t),a&&(this.currentImageContainer.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){var t=this;Array.from(this.currentImageContainer.children).forEach((function(n){if("img"===n.tagName.toLowerCase()){var i=t.usingSprites?500:1e3;if(n.dataset.index!==e.dataset.index&&!n.dataset.deleting){n.dataset.deleting=!0;var r=t.currentImageContainer;setTimeout((function(){r.removeChild(n),t.player.debug.log("Removing thumb: ".concat(n.dataset.filename))}),i)}}}))}},{key:"preloadNearby",value:function(e){var t=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return new Promise((function(i){setTimeout((function(){var r=t.thumbnails[0].frames[e].text;if(t.showingThumbFilename===r){var a;a=n?t.thumbnails[0].frames.slice(e):t.thumbnails[0].frames.slice(0,e).reverse();var o=!1;a.forEach((function(e){var n=e.text;if(n!==r&&!t.loadedImages.includes(n)){o=!0,t.player.debug.log("Preloading thumb filename: ".concat(n));var a=t.thumbnails[0].urlPrefix+n,s=new Image;s.src=a,s.onload=function(){t.player.debug.log("Preloaded thumb filename: ".concat(n)),t.loadedImages.includes(n)||t.loadedImages.push(n),i()}}})),o||i()}}),300)}))}},{key:"getHigherQuality",value:function(e,t,n,i){var r=this;if(e0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.player.config.classNames.previewThumbnails.thumbContainerShown;this.elements.thumb.container.classList.toggle(n,e),!e&&t&&(this.showingThumb=null,this.showingThumbFilename=null)}},{key:"toggleScrubbingContainer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.player.config.classNames.previewThumbnails.scrubbingContainerShown;this.elements.scrubbing.container.classList.toggle(t,e),e||(this.showingThumb=null,this.showingThumbFilename=null)}},{key:"determineContainerAutoSizing",value:function(){(this.elements.thumb.imageContainer.clientHeight>20||this.elements.thumb.imageContainer.clientWidth>20)&&(this.sizeSpecifiedInCSS=!0)}},{key:"setThumbContainerSizeAndPos",value:function(){if(this.sizeSpecifiedInCSS){if(this.elements.thumb.imageContainer.clientHeight>20&&this.elements.thumb.imageContainer.clientWidth<20){var e=Math.floor(this.elements.thumb.imageContainer.clientHeight*this.thumbAspectRatio);this.elements.thumb.imageContainer.style.width="".concat(e,"px")}else if(this.elements.thumb.imageContainer.clientHeight<20&&this.elements.thumb.imageContainer.clientWidth>20){var t=Math.floor(this.elements.thumb.imageContainer.clientWidth/this.thumbAspectRatio);this.elements.thumb.imageContainer.style.height="".concat(t,"px")}}else{var n=Math.floor(this.thumbContainerHeight*this.thumbAspectRatio);this.elements.thumb.imageContainer.style.height="".concat(this.thumbContainerHeight,"px"),this.elements.thumb.imageContainer.style.width="".concat(n,"px")}this.setThumbContainerPos()}},{key:"setThumbContainerPos",value:function(){var e=this.player.elements.progress.getBoundingClientRect(),t=this.player.elements.container.getBoundingClientRect(),n=this.elements.thumb.container,i=t.left-e.left+10,r=t.right-e.left-n.clientWidth-10,a=this.mousePosX-e.left-n.clientWidth/2;ar&&(a=r),n.style.left="".concat(a,"px")}},{key:"setScrubbingContainerSize",value:function(){var e=wt(this.thumbAspectRatio,{width:this.player.media.clientWidth,height:this.player.media.clientHeight}),t=e.width,n=e.height;this.elements.scrubbing.container.style.width="".concat(t,"px"),this.elements.scrubbing.container.style.height="".concat(n,"px")}},{key:"setImageSizeAndOffset",value:function(e,t){if(this.usingSprites){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(t.x*n,"px"),e.style.top="-".concat(t.y*n,"px")}}},{key:"enabled",get:function(){return this.player.isHTML5&&this.player.isVideo&&this.player.config.previewThumbnails.enabled}},{key:"currentImageContainer",get:function(){return this.mouseDown?this.elements.scrubbing.container:this.elements.thumb.imageContainer}},{key:"usingSprites",get:function(){return Object.keys(this.thumbnails[0].frames[0]).includes("w")}},{key:"thumbAspectRatio",get:function(){return this.usingSprites?this.thumbnails[0].frames[0].w/this.thumbnails[0].frames[0].h:this.thumbnails[0].width/this.thumbnails[0].height}},{key:"thumbContainerHeight",get:function(){return this.mouseDown?wt(this.thumbAspectRatio,{width:this.player.media.clientWidth,height:this.player.media.clientHeight}).height:this.sizeSpecifiedInCSS?this.elements.thumb.imageContainer.clientHeight:Math.floor(this.player.media.clientWidth/this.thumbAspectRatio/4)}},{key:"currentImageElement",get:function(){return this.mouseDown?this.currentScrubbingImageElement:this.currentThumbnailImageElement},set:function(e){this.mouseDown?this.currentScrubbingImageElement=e:this.currentThumbnailImageElement=e}}]),t}(),St={insertElements:function(e,t){var n=this;W(t)?ue(e,this.media,{src:t}):K(t)&&t.forEach((function(t){ue(e,n.media,t)}))},change:function(e){var t=this;re(e,"sources.length")?(je.cancelRequests.call(this),this.destroy.call(this,(function(){t.options.quality=[],ce(t.media),t.media=null,Y(t.elements.container)&&t.elements.container.removeAttribute("class");var n=e.sources,i=e.type,r=s(n,1)[0],a=r.provider,o=void 0===a?at.html5:a,l=r.src,u="html5"===o?i:"div",c="html5"===o?{}:{src:l};Object.assign(t,{provider:o,type:i,supported:Ee.check(i,o,t.config.playsinline),media:le(u,c)}),t.elements.container.appendChild(t.media),G(e.autoplay)&&(t.config.autoplay=e.autoplay),t.isHTML5&&(t.config.crossorigin&&t.media.setAttribute("crossorigin",""),t.config.autoplay&&t.media.setAttribute("autoplay",""),ee(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","")),ct.addStyleHook.call(t),t.isHTML5&&St.insertElements.call(t,"source",n),t.config.title=e.title,_t.setup.call(t),t.isHTML5&&Object.keys(e).includes("tracks")&&St.insertElements.call(t,"track",e.tracks),(t.isHTML5||t.isEmbed&&!t.supported.ui)&&ct.build.call(t),t.isHTML5&&t.media.load(),ee(e.previewThumbnails)||(Object.assign(t.config.previewThumbnails,e.previewThumbnails),t.previewThumbnails&&t.previewThumbnails.loaded&&(t.previewThumbnails.destroy(),t.previewThumbnails=null),t.config.previewThumbnails.enabled&&(t.previewThumbnails=new Et(t))),t.fullscreen.update()}),!0)):this.debug.warn("Invalid source format")}},Tt=function(){function t(n,i){var r=this;if(e(this,t),this.timers={},this.ready=!1,this.loading=!1,this.failed=!1,this.touch=Ee.touch,this.media=n,W(this.media)&&(this.media=document.querySelectorAll(this.media)),(window.jQuery&&this.media instanceof jQuery||$(this.media)||K(this.media))&&(this.media=this.media[0]),this.config=ae({},it,t.defaults,i||{},function(){try{return JSON.parse(r.media.getAttribute("data-plyr-config"))}catch(e){return{}}}()),this.elements={container:null,fullscreen:null,captions:null,buttons:{},display:{},progress:{},inputs:{},settings:{popup:null,menu:null,panels:{},buttons:{}}},this.captions={active:null,currentTrack:-1,meta:new WeakMap},this.fullscreen={active:!1},this.options={speed:[],quality:[]},this.debug=new st(this.config.debug),this.debug.log("Config",this.config),this.debug.log("Support",Ee),!z(this.media)&&Y(this.media))if(this.media.plyr)this.debug.warn("Target already setup");else if(this.config.enabled)if(Ee.check().api){var a=this.media.cloneNode(!0);a.autoplay=!1,this.elements.original=a;var o=this.media.tagName.toLowerCase(),s=null,l=null;switch(o){case"div":if(s=this.media.querySelector("iframe"),Y(s)){if(l=et(s.getAttribute("src")),this.provider=function(e){return/^(https?:\/\/)?(www\.)?(youtube\.com|youtube-nocookie\.com|youtu\.?be)\/.+$/.test(e)?at.youtube:/^https?:\/\/player.vimeo.com\/video\/\d{0,9}(?=\b|\/)/.test(e)?at.vimeo:null}(l.toString()),this.elements.container=this.media,this.media=s,this.elements.container.className="",l.search.length){var u=["1","true"];u.includes(l.searchParams.get("autoplay"))&&(this.config.autoplay=!0),u.includes(l.searchParams.get("loop"))&&(this.config.loop.active=!0),this.isYouTube?(this.config.playsinline=u.includes(l.searchParams.get("playsinline")),this.config.youtube.hl=l.searchParams.get("hl")):this.config.playsinline=!0}}else this.provider=this.media.getAttribute(this.config.attributes.embed.provider),this.media.removeAttribute(this.config.attributes.embed.provider);if(ee(this.provider)||!Object.keys(at).includes(this.provider))return void this.debug.error("Setup failed: Invalid provider");this.type="video";break;case"video":case"audio":this.type=o,this.provider=at.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=Ee.check(this.type,this.provider,this.config.playsinline),this.supported.api?(this.eventListeners=[],this.listeners=new dt(this),this.storage=new qe(this),this.media.plyr=this,Y(this.elements.container)||(this.elements.container=le("div",{tabindex:0}),oe(this.media,this.elements.container)),ct.migrateStyles.call(this),ct.addStyleHook.call(this),_t.setup.call(this),this.config.debug&&Ce.call(this,this.elements.container,this.config.events.join(" "),(function(e){r.debug.log("event: ".concat(e.type))})),this.fullscreen=new lt(this),(this.isHTML5||this.isEmbed&&!this.supported.ui)&&ct.build.call(this),this.listeners.container(),this.listeners.global(),this.config.ads.enabled&&(this.ads=new kt(this)),this.isHTML5&&this.config.autoplay&&this.once("canplay",(function(){return Pe(r.play())})),this.lastSeekTime=0,this.config.previewThumbnails.enabled&&(this.previewThumbnails=new Et(this))):this.debug.error("Setup failed: no support")}else this.debug.error("Setup failed: no support");else this.debug.error("Setup failed: disabled by config");else this.debug.error("Setup failed: no suitable element passed")}return i(t,[{key:"play",value:function(){var e=this;return q(this.media.play)?(this.ads&&this.ads.enabled&&this.ads.managerPromise.then((function(){return e.ads.play()})).catch((function(){return Pe(e.media.play())})),this.media.play()):null}},{key:"pause",value:function(){return this.playing&&q(this.media.pause)?this.media.pause():null}},{key:"togglePlay",value:function(e){return(G(e)?e:!this.playing)?this.play():this.pause()}},{key:"stop",value:function(){this.isHTML5?(this.pause(),this.restart()):q(this.media.stop)&&this.media.stop()}},{key:"restart",value:function(){this.currentTime=0}},{key:"rewind",value:function(e){this.currentTime-=H(e)?e:this.config.seekTime}},{key:"forward",value:function(e){this.currentTime+=H(e)?e:this.config.seekTime}},{key:"increaseVolume",value:function(e){var t=this.media.muted?0:this.volume;this.volume=t+(H(e)?e:0)}},{key:"decreaseVolume",value:function(e){this.increaseVolume(-e)}},{key:"toggleCaptions",value:function(e){nt.toggle.call(this,e,!1)}},{key:"airplay",value:function(){Ee.airplay&&this.media.webkitShowPlaybackTargetPicker()}},{key:"toggleControls",value:function(e){if(this.supported.ui&&!this.isAudio){var t=ge(this.elements.container,this.config.classNames.hideControls),n=void 0===e?void 0:!e,i=me(this.elements.container,this.config.classNames.hideControls,n);if(i&&K(this.config.controls)&&this.config.controls.includes("settings")&&!ee(this.config.settings)&&Ze.toggleMenu.call(this,!1),i!==t){var r=i?"controlshidden":"controlsshown";Ae.call(this,this.media,r)}return!i}return!1}},{key:"on",value:function(e,t){Ce.call(this,this.elements.container,e,t)}},{key:"once",value:function(e,t){Oe.call(this,this.elements.container,e,t)}},{key:"off",value:function(e,t){xe(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&&(ce(t.elements.buttons.play),ce(t.elements.captions),ce(t.elements.controls),ce(t.elements.wrapper),t.elements.buttons.play=null,t.elements.captions=null,t.elements.controls=null,t.elements.wrapper=null),q(e)&&e()):(Re.call(t),je.cancelRequests.call(t),fe(t.elements.original,t.elements.container),Ae.call(t,t.elements.original,"destroyed",!0),q(e)&&e.call(t.elements.original),t.ready=!1,setTimeout((function(){t.elements=null,t.media=null}),200))};this.stop(),clearTimeout(this.timers.loading),clearTimeout(this.timers.controls),clearTimeout(this.timers.resized),this.isHTML5?(ct.toggleNativeControls.call(this,!0),i()):this.isYouTube?(clearInterval(this.timers.buffering),clearInterval(this.timers.playing),null!==this.embed&&q(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 Ee.mime.call(this,e)}},{key:"isHTML5",get:function(){return this.provider===at.html5}},{key:"isEmbed",get:function(){return this.isYouTube||this.isVimeo}},{key:"isYouTube",get:function(){return this.provider===at.youtube}},{key:"isVimeo",get:function(){return this.provider===at.vimeo}},{key:"isVideo",get:function(){return"video"===this.type}},{key:"isAudio",get:function(){return"audio"===this.type}},{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=H(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 H(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=H(t)&&t!==1/0?t:0;return e||n}},{key:"volume",set:function(e){var t=e;W(t)&&(t=Number(t)),H(t)||(t=this.storage.get("volume")),H(t)||(t=this.config.volume),t>1&&(t=1),t<0&&(t=0),this.config.volume=t,this.media.volume=t,!ee(e)&&this.muted&&t>0&&(this.muted=!1)},get:function(){return Number(this.media.volume)}},{key:"muted",set:function(e){var t=e;G(t)||(t=this.storage.get("muted")),G(t)||(t=this.config.muted),this.config.muted=t,this.media.muted=t},get:function(){return Boolean(this.media.muted)}},{key:"hasAudio",get:function(){return!this.isHTML5||!!this.isAudio||Boolean(this.media.mozHasAudio)||Boolean(this.media.webkitAudioDecodedByteCount)||Boolean(this.media.audioTracks&&this.media.audioTracks.length)}},{key:"speed",set:function(e){var t=this,n=null;H(e)&&(n=e),H(n)||(n=this.storage.get("speed")),H(n)||(n=this.config.speed.selected);var i=this.minimumSpeed,r=this.maximumSpeed;n=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:255;return Math.min(Math.max(e,t),n)}(n,i,r),this.config.speed.selected=n,setTimeout((function(){t.media.playbackRate=n}),0)},get:function(){return Number(this.media.playbackRate)}},{key:"minimumSpeed",get:function(){return this.isYouTube?Math.min.apply(Math,l(this.options.speed)):this.isVimeo?.5:.0625}},{key:"maximumSpeed",get:function(){return this.isYouTube?Math.max.apply(Math,l(this.options.speed)):this.isVimeo?2:16}},{key:"quality",set:function(e){var t=this.config.quality,n=this.options.quality;if(n.length){var i=[!ee(e)&&Number(e),this.storage.get("quality"),t.selected,t.default].find(H),r=!0;if(!n.includes(i)){var a=function(e,t){return K(e)&&e.length?e.reduce((function(e,n){return Math.abs(n-t)1&&void 0!==arguments[1]?arguments[1]:{},i=null;return W(e)?i=Array.from(document.querySelectorAll(e)):$(e)?i=Array.from(e):K(e)&&(i=e.filter(Y)),ee(i)?null:i.map((function(e){return new t(e,n)}))}}]),t}();return Tt.defaults=(yt=it,JSON.parse(JSON.stringify(yt))),Tt}())}).call(this,n(24))},function(e,t,n){"use strict";var i=n(2),r=n(1),a=function(){function e(){Object(i.a)(this,e)}return Object(r.a)(e,null,[{key:"install",value:function(){Object.setPrototypeOf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Object.assign=Object.assign||function(e){if(void 0===e||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n ").concat(n);e.ENABLE_CALLBACK&&e.emitter.emit("log","error",i),e.ENABLE_ERROR&&(console.error?console.error(i):console.warn?console.warn(i):console.log(i))}},{key:"i",value:function(t,n){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var i="[".concat(t,"] > ").concat(n);e.ENABLE_CALLBACK&&e.emitter.emit("log","info",i),e.ENABLE_INFO&&(console.info?console.info(i):console.log(i))}},{key:"w",value:function(t,n){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var i="[".concat(t,"] > ").concat(n);e.ENABLE_CALLBACK&&e.emitter.emit("log","warn",i),e.ENABLE_WARN&&(console.warn?console.warn(i):console.log(i))}},{key:"d",value:function(t,n){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var i="[".concat(t,"] > ").concat(n);e.ENABLE_CALLBACK&&e.emitter.emit("log","debug",i),e.ENABLE_DEBUG&&(console.debug?console.debug(i):console.log(i))}},{key:"v",value:function(t,n){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var i="[".concat(t,"] > ").concat(n);e.ENABLE_CALLBACK&&e.emitter.emit("log","verbose",i),e.ENABLE_VERBOSE&&console.log(i)}}]),e}();u.GLOBAL_TAG="flv.js",u.FORCE_GLOBAL_TAG=!1,u.ENABLE_ERROR=!0,u.ENABLE_INFO=!0,u.ENABLE_WARN=!0,u.ENABLE_DEBUG=!0,u.ENABLE_VERBOSE=!0,u.ENABLE_CALLBACK=!1,u.emitter=new l.a;var c=u,d=function(){function e(){Object(i.a)(this,e),this._firstCheckpoint=0,this._lastCheckpoint=0,this._intervalBytes=0,this._totalBytes=0,this._lastSecondBytes=0,self.performance&&self.performance.now?this._now=self.performance.now.bind(self.performance):this._now=Date.now}return Object(r.a)(e,[{key:"reset",value:function(){this._firstCheckpoint=this._lastCheckpoint=0,this._totalBytes=this._intervalBytes=0,this._lastSecondBytes=0}},{key:"addBytes",value:function(e){0===this._firstCheckpoint?(this._firstCheckpoint=this._now(),this._lastCheckpoint=this._firstCheckpoint,this._intervalBytes+=e,this._totalBytes+=e):this._now()-this._lastCheckpoint<1e3?(this._intervalBytes+=e,this._totalBytes+=e):(this._lastSecondBytes=this._intervalBytes,this._intervalBytes=e,this._totalBytes+=e,this._lastCheckpoint=this._now())}},{key:"currentKBps",get:function(){this.addBytes(0);var e=(this._now()-this._lastCheckpoint)/1e3;return 0==e&&(e=1),this._intervalBytes/e/1024}},{key:"lastSecondKBps",get:function(){return this.addBytes(0),0!==this._lastSecondBytes?this._lastSecondBytes/1024:this._now()-this._lastCheckpoint>=500?this.currentKBps:0}},{key:"averageKBps",get:function(){var e=(this._now()-this._firstCheckpoint)/1e3;return this._totalBytes/e/1024}}]),e}(),f=n(7),h=n(6),p=function(){function e(t){Object(i.a)(this,e),this._message=t}return Object(r.a)(e,[{key:"toString",value:function(){return this.name+": "+this.message}},{key:"name",get:function(){return"RuntimeException"}},{key:"message",get:function(){return this._message}}]),e}(),m=function(e){Object(f.a)(n,e);var t=Object(h.a)(n);function n(e){return Object(i.a)(this,n),t.call(this,e)}return Object(r.a)(n,[{key:"name",get:function(){return"IllegalStateException"}}]),n}(p),g=function(e){Object(f.a)(n,e);var t=Object(h.a)(n);function n(e){return Object(i.a)(this,n),t.call(this,e)}return Object(r.a)(n,[{key:"name",get:function(){return"InvalidArgumentException"}}]),n}(p),v=function(e){Object(f.a)(n,e);var t=Object(h.a)(n);function n(e){return Object(i.a)(this,n),t.call(this,e)}return Object(r.a)(n,[{key:"name",get:function(){return"NotImplementedException"}}]),n}(p),y={kIdle:0,kConnecting:1,kBuffering:2,kError:3,kComplete:4},b={OK:"OK",EXCEPTION:"Exception",HTTP_STATUS_CODE_INVALID:"HttpStatusCodeInvalid",CONNECTING_TIMEOUT:"ConnectingTimeout",EARLY_EOF:"EarlyEof",UNRECOVERABLE_EARLY_EOF:"UnrecoverableEarlyEof"},_=function(){function e(t){Object(i.a)(this,e),this._type=t||"undefined",this._status=y.kIdle,this._needStash=!1,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}return Object(r.a)(e,[{key:"destroy",value:function(){this._status=y.kIdle,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}},{key:"isWorking",value:function(){return this._status===y.kConnecting||this._status===y.kBuffering}},{key:"open",value:function(e,t){throw new v("Unimplemented abstract function!")}},{key:"abort",value:function(){throw new v("Unimplemented abstract function!")}},{key:"type",get:function(){return this._type}},{key:"status",get:function(){return this._status}},{key:"needStashBuffer",get:function(){return this._needStash}},{key:"onContentLengthKnown",get:function(){return this._onContentLengthKnown},set:function(e){this._onContentLengthKnown=e}},{key:"onURLRedirect",get:function(){return this._onURLRedirect},set:function(e){this._onURLRedirect=e}},{key:"onDataArrival",get:function(){return this._onDataArrival},set:function(e){this._onDataArrival=e}},{key:"onError",get:function(){return this._onError},set:function(e){this._onError=e}},{key:"onComplete",get:function(){return this._onComplete},set:function(e){this._onComplete=e}}]),e}(),k=n(10);function w(e,t,n){return(w="undefined"!==typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var i=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Object(k.a)(e)););return e}(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(n):r.value}})(e,t,n||e)}var E={};!function(){var e=self.navigator.userAgent.toLowerCase(),t=/(edge)\/([\w.]+)/.exec(e)||/(opr)[\/]([\w.]+)/.exec(e)||/(chrome)[ \/]([\w.]+)/.exec(e)||/(iemobile)[\/]([\w.]+)/.exec(e)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("trident")>=0&&/(rv)(?::| )([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(firefox)[ \/]([\w.]+)/.exec(e)||[],n=/(ipad)/.exec(e)||/(ipod)/.exec(e)||/(windows phone)/.exec(e)||/(iphone)/.exec(e)||/(kindle)/.exec(e)||/(android)/.exec(e)||/(windows)/.exec(e)||/(mac)/.exec(e)||/(linux)/.exec(e)||/(cros)/.exec(e)||[],i={browser:t[5]||t[3]||t[1]||"",version:t[2]||t[4]||"0",majorVersion:t[4]||t[2]||"0",platform:n[0]||""},r={};if(i.browser){r[i.browser]=!0;var a=i.majorVersion.split(".");r.version={major:parseInt(i.majorVersion,10),string:i.version},a.length>1&&(r.version.minor=parseInt(a[1],10)),a.length>2&&(r.version.build=parseInt(a[2],10))}if(i.platform&&(r[i.platform]=!0),(r.chrome||r.opr||r.safari)&&(r.webkit=!0),r.rv||r.iemobile){r.rv&&delete r.rv;i.browser="msie",r.msie=!0}if(r.edge){delete r.edge;i.browser="msedge",r.msedge=!0}if(r.opr){i.browser="opera",r.opera=!0}if(r.safari&&r.android){i.browser="android",r.android=!0}for(var o in r.name=i.browser,r.platform=i.platform,E)E.hasOwnProperty(o)&&delete E[o];Object.assign(E,r)}();var S=E,T=function(e){Object(f.a)(n,e);var t=Object(h.a)(n);function n(e,r){var a;return Object(i.a)(this,n),(a=t.call(this,"fetch-stream-loader")).TAG="FetchStreamLoader",a._seekHandler=e,a._config=r,a._needStash=!0,a._requestAbort=!1,a._contentLength=null,a._receivedLength=0,a}return Object(r.a)(n,null,[{key:"isSupported",value:function(){try{var e=S.msedge&&S.version.minor>=15048,t=!S.msedge||e;return self.fetch&&self.ReadableStream&&t}catch(n){return!1}}}]),Object(r.a)(n,[{key:"destroy",value:function(){this.isWorking()&&this.abort(),w(Object(k.a)(n.prototype),"destroy",this).call(this)}},{key:"open",value:function(e,t){var n=this;this._dataSource=e,this._range=t;var i=e.url;this._config.reuseRedirectedURL&&void 0!=e.redirectedURL&&(i=e.redirectedURL);var r=this._seekHandler.getConfig(i,t),a=new self.Headers;if("object"===typeof r.headers){var o=r.headers;for(var s in o)o.hasOwnProperty(s)&&a.append(s,o[s])}var l={method:"GET",headers:a,mode:"cors",cache:"default",referrerPolicy:"no-referrer-when-downgrade"};if("object"===typeof this._config.headers)for(var u in this._config.headers)a.append(u,this._config.headers[u]);!1===e.cors&&(l.mode="same-origin"),e.withCredentials&&(l.credentials="include"),e.referrerPolicy&&(l.referrerPolicy=e.referrerPolicy),this._status=y.kConnecting,self.fetch(r.url,l).then((function(e){if(n._requestAbort)return n._requestAbort=!1,void(n._status=y.kIdle);if(e.ok&&e.status>=200&&e.status<=299){if(e.url!==r.url&&n._onURLRedirect){var t=n._seekHandler.removeURLParameters(e.url);n._onURLRedirect(t)}var i=e.headers.get("Content-Length");return null!=i&&(n._contentLength=parseInt(i),0!==n._contentLength&&n._onContentLengthKnown&&n._onContentLengthKnown(n._contentLength)),n._pump.call(n,e.body.getReader())}if(n._status=y.kError,!n._onError)throw new p("FetchStreamLoader: Http code invalid, "+e.status+" "+e.statusText);n._onError(b.HTTP_STATUS_CODE_INVALID,{code:e.status,msg:e.statusText})})).catch((function(e){if(n._status=y.kError,!n._onError)throw e;n._onError(b.EXCEPTION,{code:-1,msg:e.message})}))}},{key:"abort",value:function(){this._requestAbort=!0}},{key:"_pump",value:function(e){var t=this;return e.read().then((function(n){if(n.done)if(null!==t._contentLength&&t._receivedLength299)){if(this._status=y.kError,!this._onError)throw new p("MozChunkedLoader: Http code invalid, "+t.status+" "+t.statusText);this._onError(b.HTTP_STATUS_CODE_INVALID,{code:t.status,msg:t.statusText})}else this._status=y.kBuffering}}},{key:"_onProgress",value:function(e){if(this._status!==y.kError){null===this._contentLength&&null!==e.total&&0!==e.total&&(this._contentLength=e.total,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength));var t=e.target.response,n=this._range.from+this._receivedLength;this._receivedLength+=t.byteLength,this._onDataArrival&&this._onDataArrival(t,n,this._receivedLength)}}},{key:"_onLoadEnd",value:function(e){!0!==this._requestAbort?this._status!==y.kError&&(this._status=y.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1)):this._requestAbort=!1}},{key:"_onXhrError",value:function(e){this._status=y.kError;var t=0,n=null;if(this._contentLength&&e.loaded=this._contentLength&&(n=this._range.from+this._contentLength-1),this._currentRequestRange={from:t,to:n},this._internalOpen(this._dataSource,this._currentRequestRange)}},{key:"_internalOpen",value:function(e,t){this._lastTimeLoaded=0;var n=e.url;this._config.reuseRedirectedURL&&(void 0!=this._currentRedirectedURL?n=this._currentRedirectedURL:void 0!=e.redirectedURL&&(n=e.redirectedURL));var i=this._seekHandler.getConfig(n,t);this._currentRequestURL=i.url;var r=this._xhr=new XMLHttpRequest;if(r.open("GET",i.url,!0),r.responseType="arraybuffer",r.onreadystatechange=this._onReadyStateChange.bind(this),r.onprogress=this._onProgress.bind(this),r.onload=this._onLoad.bind(this),r.onerror=this._onXhrError.bind(this),e.withCredentials&&(r.withCredentials=!0),"object"===typeof i.headers){var a=i.headers;for(var o in a)a.hasOwnProperty(o)&&r.setRequestHeader(o,a[o])}if("object"===typeof this._config.headers){var s=this._config.headers;for(var l in s)s.hasOwnProperty(l)&&r.setRequestHeader(l,s[l])}r.send()}},{key:"abort",value:function(){this._requestAbort=!0,this._internalAbort(),this._status=y.kComplete}},{key:"_internalAbort",value:function(){this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr.abort(),this._xhr=null)}},{key:"_onReadyStateChange",value:function(e){var t=e.target;if(2===t.readyState){if(void 0!=t.responseURL){var n=this._seekHandler.removeURLParameters(t.responseURL);t.responseURL!==this._currentRequestURL&&n!==this._currentRedirectedURL&&(this._currentRedirectedURL=n,this._onURLRedirect&&this._onURLRedirect(n))}if(t.status>=200&&t.status<=299){if(this._waitForTotalLength)return;this._status=y.kBuffering}else{if(this._status=y.kError,!this._onError)throw new p("RangeLoader: Http code invalid, "+t.status+" "+t.statusText);this._onError(b.HTTP_STATUS_CODE_INVALID,{code:t.status,msg:t.statusText})}}}},{key:"_onProgress",value:function(e){if(this._status!==y.kError){if(null===this._contentLength){var t=!1;if(this._waitForTotalLength){this._waitForTotalLength=!1,this._totalLengthReceived=!0,t=!0;var n=e.total;this._internalAbort(),null!=n&0!==n&&(this._totalLength=n)}if(-1===this._range.to?this._contentLength=this._totalLength-this._range.from:this._contentLength=this._range.to-this._range.from+1,t)return void this._openSubRange();this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)}var i=e.loaded-this._lastTimeLoaded;this._lastTimeLoaded=e.loaded,this._speedSampler.addBytes(i)}}},{key:"_normalizeSpeed",value:function(e){var t=this._chunkSizeKBList,n=t.length-1,i=0,r=0,a=n;if(e=t[i]&&e=3&&(t=this._speedSampler.currentKBps)),0!==t){var n=this._normalizeSpeed(t);this._currentSpeedNormalized!==n&&(this._currentSpeedNormalized=n,this._currentChunkSizeKB=n)}var i=e.target.response,r=this._range.from+this._receivedLength;this._receivedLength+=i.byteLength;var a=!1;null!=this._contentLength&&this._receivedLength0&&this._receivedLength0)for(var a=n.split("&"),o=0;o0;s[0]!==this._startName&&s[0]!==this._endName&&(l&&(r+="&"),r+=a[o])}return 0===r.length?t:t+"?"+r}}]),e}(),L=function(){function e(t,n,r){Object(i.a)(this,e),this.TAG="IOController",this._config=n,this._extraData=r,this._stashInitialSize=393216,void 0!=n.stashInitialSize&&n.stashInitialSize>0&&(this._stashInitialSize=n.stashInitialSize),this._stashUsed=0,this._stashSize=this._stashInitialSize,this._bufferSize=3145728,this._stashBuffer=new ArrayBuffer(this._bufferSize),this._stashByteStart=0,this._enableStash=!0,!1===n.enableStashBuffer&&(this._enableStash=!1),this._loader=null,this._loaderClass=null,this._seekHandler=null,this._dataSource=t,this._isWebSocketURL=/wss?:\/\/(.+?)/.test(t.url),this._refTotalLength=t.filesize?t.filesize:null,this._totalLength=this._refTotalLength,this._fullRequestFlag=!1,this._currentRange=null,this._redirectedURL=null,this._speedNormalized=0,this._speedSampler=new d,this._speedNormalizeList=[64,128,256,384,512,768,1024,1536,2048,3072,4096],this._isEarlyEofReconnecting=!1,this._paused=!1,this._resumeFrom=0,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._selectSeekHandler(),this._selectLoader(),this._createLoader()}return Object(r.a)(e,[{key:"destroy",value:function(){this._loader.isWorking()&&this._loader.abort(),this._loader.destroy(),this._loader=null,this._loaderClass=null,this._dataSource=null,this._stashBuffer=null,this._stashUsed=this._stashSize=this._bufferSize=this._stashByteStart=0,this._currentRange=null,this._speedSampler=null,this._isEarlyEofReconnecting=!1,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._extraData=null}},{key:"isWorking",value:function(){return this._loader&&this._loader.isWorking()&&!this._paused}},{key:"isPaused",value:function(){return this._paused}},{key:"_selectSeekHandler",value:function(){var e=this._config;if("range"===e.seekType)this._seekHandler=new A(this._config.rangeLoadZeroStart);else if("param"===e.seekType){var t=e.seekParamStart||"bstart",n=e.seekParamEnd||"bend";this._seekHandler=new R(t,n)}else{if("custom"!==e.seekType)throw new g("Invalid seekType in config: ".concat(e.seekType));if("function"!==typeof e.customSeekHandler)throw new g("Custom seekType specified in config but invalid customSeekHandler!");this._seekHandler=new e.customSeekHandler}}},{key:"_selectLoader",value:function(){if(null!=this._config.customLoader)this._loaderClass=this._config.customLoader;else if(this._isWebSocketURL)this._loaderClass=O;else if(T.isSupported())this._loaderClass=T;else if(C.isSupported())this._loaderClass=C;else{if(!x.isSupported())throw new p("Your browser doesn't support xhr with arraybuffer responseType!");this._loaderClass=x}}},{key:"_createLoader",value:function(){this._loader=new this._loaderClass(this._seekHandler,this._config),!1===this._loader.needStashBuffer&&(this._enableStash=!1),this._loader.onContentLengthKnown=this._onContentLengthKnown.bind(this),this._loader.onURLRedirect=this._onURLRedirect.bind(this),this._loader.onDataArrival=this._onLoaderChunkArrival.bind(this),this._loader.onComplete=this._onLoaderComplete.bind(this),this._loader.onError=this._onLoaderError.bind(this)}},{key:"open",value:function(e){this._currentRange={from:0,to:-1},e&&(this._currentRange.from=e),this._speedSampler.reset(),e||(this._fullRequestFlag=!0),this._loader.open(this._dataSource,Object.assign({},this._currentRange))}},{key:"abort",value:function(){this._loader.abort(),this._paused&&(this._paused=!1,this._resumeFrom=0)}},{key:"pause",value:function(){this.isWorking()&&(this._loader.abort(),0!==this._stashUsed?(this._resumeFrom=this._stashByteStart,this._currentRange.to=this._stashByteStart-1):this._resumeFrom=this._currentRange.to+1,this._stashUsed=0,this._stashByteStart=0,this._paused=!0)}},{key:"resume",value:function(){if(this._paused){this._paused=!1;var e=this._resumeFrom;this._resumeFrom=0,this._internalSeek(e,!0)}}},{key:"seek",value:function(e){this._paused=!1,this._stashUsed=0,this._stashByteStart=0,this._internalSeek(e,!0)}},{key:"_internalSeek",value:function(e,t){this._loader.isWorking()&&this._loader.abort(),this._flushStashBuffer(t),this._loader.destroy(),this._loader=null;var n={from:e,to:-1};this._currentRange={from:n.from,to:-1},this._speedSampler.reset(),this._stashSize=this._stashInitialSize,this._createLoader(),this._loader.open(this._dataSource,n),this._onSeeked&&this._onSeeked()}},{key:"updateUrl",value:function(e){if(!e||"string"!==typeof e||0===e.length)throw new g("Url must be a non-empty string!");this._dataSource.url=e}},{key:"_expandBuffer",value:function(e){for(var t=this._stashSize;t+10485760){var i=new Uint8Array(this._stashBuffer,0,this._stashUsed);new Uint8Array(n,0,t).set(i,0)}this._stashBuffer=n,this._bufferSize=t}}},{key:"_normalizeSpeed",value:function(e){var t=this._speedNormalizeList,n=t.length-1,i=0,r=0,a=n;if(e=t[i]&&e=512&&e<=1024?Math.floor(1.5*e):2*e)>8192&&(t=8192);var n=1024*t+1048576;this._bufferSize0){var o=this._stashBuffer.slice(0,this._stashUsed),s=this._dispatchChunks(o,this._stashByteStart);if(s0){var l=new Uint8Array(o,s);a.set(l,0),this._stashUsed=l.byteLength,this._stashByteStart+=s}}else this._stashUsed=0,this._stashByteStart+=s;this._stashUsed+e.byteLength>this._bufferSize&&(this._expandBuffer(this._stashUsed+e.byteLength),a=new Uint8Array(this._stashBuffer,0,this._bufferSize)),a.set(new Uint8Array(e),this._stashUsed),this._stashUsed+=e.byteLength}else{var u=this._dispatchChunks(e,t);if(uthis._bufferSize&&(this._expandBuffer(c),a=new Uint8Array(this._stashBuffer,0,this._bufferSize)),a.set(new Uint8Array(e,u),0),this._stashUsed+=c,this._stashByteStart=t+u}}}else if(0===this._stashUsed){var d=this._dispatchChunks(e,t);if(dthis._bufferSize&&this._expandBuffer(f),new Uint8Array(this._stashBuffer,0,this._bufferSize).set(new Uint8Array(e,d),0),this._stashUsed+=f,this._stashByteStart=t+d}}else{this._stashUsed+e.byteLength>this._bufferSize&&this._expandBuffer(this._stashUsed+e.byteLength);var h=new Uint8Array(this._stashBuffer,0,this._bufferSize);h.set(new Uint8Array(e),this._stashUsed),this._stashUsed+=e.byteLength;var p=this._dispatchChunks(this._stashBuffer.slice(0,this._stashUsed),this._stashByteStart);if(p0){var g=new Uint8Array(this._stashBuffer,p);h.set(g,0)}this._stashUsed-=p,this._stashByteStart+=p}}}},{key:"_flushStashBuffer",value:function(e){if(this._stashUsed>0){var t=this._stashBuffer.slice(0,this._stashUsed),n=this._dispatchChunks(t,this._stashByteStart),i=t.byteLength-n;if(n0){var r=new Uint8Array(this._stashBuffer,0,this._bufferSize),a=new Uint8Array(t,n);r.set(a,0),this._stashUsed=a.byteLength,this._stashByteStart+=n}return 0}c.w(this.TAG,"".concat(i," bytes unconsumed data remain when flush buffer, dropped"))}return this._stashUsed=0,this._stashByteStart=0,i}return 0}},{key:"_onLoaderComplete",value:function(e,t){this._flushStashBuffer(!0),this._onComplete&&this._onComplete(this._extraData)}},{key:"_onLoaderError",value:function(e,t){switch(c.e(this.TAG,"Loader error, code = ".concat(t.code,", msg = ").concat(t.msg)),this._flushStashBuffer(!1),this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,e=b.UNRECOVERABLE_EARLY_EOF),e){case b.EARLY_EOF:if(!this._config.isLive&&this._totalLength){var n=this._currentRange.to+1;return void(n0){var n=e.getConfig();t.emit("change",n)}}},{key:"registerListener",value:function(t){e.emitter.addListener("change",t)}},{key:"removeListener",value:function(t){e.emitter.removeListener("change",t)}},{key:"addLogListener",value:function(t){c.emitter.addListener("log",t),c.emitter.listenerCount("log")>0&&(c.ENABLE_CALLBACK=!0,e._notifyChange())}},{key:"removeLogListener",value:function(t){c.emitter.removeListener("log",t),0===c.emitter.listenerCount("log")&&(c.ENABLE_CALLBACK=!1,e._notifyChange())}},{key:"forceGlobalTag",get:function(){return c.FORCE_GLOBAL_TAG},set:function(t){c.FORCE_GLOBAL_TAG=t,e._notifyChange()}},{key:"globalTag",get:function(){return c.GLOBAL_TAG},set:function(t){c.GLOBAL_TAG=t,e._notifyChange()}},{key:"enableAll",get:function(){return c.ENABLE_VERBOSE&&c.ENABLE_DEBUG&&c.ENABLE_INFO&&c.ENABLE_WARN&&c.ENABLE_ERROR},set:function(t){c.ENABLE_VERBOSE=t,c.ENABLE_DEBUG=t,c.ENABLE_INFO=t,c.ENABLE_WARN=t,c.ENABLE_ERROR=t,e._notifyChange()}},{key:"enableDebug",get:function(){return c.ENABLE_DEBUG},set:function(t){c.ENABLE_DEBUG=t,e._notifyChange()}},{key:"enableVerbose",get:function(){return c.ENABLE_VERBOSE},set:function(t){c.ENABLE_VERBOSE=t,e._notifyChange()}},{key:"enableInfo",get:function(){return c.ENABLE_INFO},set:function(t){c.ENABLE_INFO=t,e._notifyChange()}},{key:"enableWarn",get:function(){return c.ENABLE_WARN},set:function(t){c.ENABLE_WARN=t,e._notifyChange()}},{key:"enableError",get:function(){return c.ENABLE_ERROR},set:function(t){c.ENABLE_ERROR=t,e._notifyChange()}}]),e}();N.emitter=new l.a;var j=N,B=function(){function e(){Object(i.a)(this,e),this.mimeType=null,this.duration=null,this.hasAudio=null,this.hasVideo=null,this.audioCodec=null,this.videoCodec=null,this.audioDataRate=null,this.videoDataRate=null,this.audioSampleRate=null,this.audioChannelCount=null,this.width=null,this.height=null,this.fps=null,this.profile=null,this.level=null,this.refFrames=null,this.chromaFormat=null,this.sarNum=null,this.sarDen=null,this.metadata=null,this.segments=null,this.segmentCount=null,this.hasKeyframesIndex=null,this.keyframesIndex=null}return Object(r.a)(e,[{key:"isComplete",value:function(){var e=!1===this.hasAudio||!0===this.hasAudio&&null!=this.audioCodec&&null!=this.audioSampleRate&&null!=this.audioChannelCount,t=!1===this.hasVideo||!0===this.hasVideo&&null!=this.videoCodec&&null!=this.width&&null!=this.height&&null!=this.fps&&null!=this.profile&&null!=this.level&&null!=this.refFrames&&null!=this.chromaFormat&&null!=this.sarNum&&null!=this.sarDen;return null!=this.mimeType&&null!=this.duration&&null!=this.metadata&&null!=this.hasKeyframesIndex&&e&&t}},{key:"isSeekable",value:function(){return!0===this.hasKeyframesIndex}},{key:"getNearestKeyframe",value:function(e){if(null==this.keyframesIndex)return null;var t=this.keyframesIndex,n=this._search(t.times,e);return{index:n,milliseconds:t.times[n],fileposition:t.filepositions[n]}}},{key:"_search",value:function(e,t){var n=0,i=e.length-1,r=0,a=0,o=i;for(t=e[r]&&t=128){t.push(String.fromCharCode(65535&a)),i+=2;continue}}}else if(n[i]<240){if(U(n,i,2)){var o=(15&n[i])<<12|(63&n[i+1])<<6|63&n[i+2];if(o>=2048&&55296!==(63488&o)){t.push(String.fromCharCode(65535&o)),i+=3;continue}}}else if(n[i]<248&&U(n,i,3)){var s=(7&n[i])<<18|(63&n[i+1])<<12|(63&n[i+2])<<6|63&n[i+3];if(s>65536&&s<1114112){s-=65536,t.push(String.fromCharCode(s>>>10|55296)),t.push(String.fromCharCode(1023&s|56320)),i+=4;continue}}t.push(String.fromCharCode(65533)),++i}return t.join("")},z=function(){var e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),256===new Int16Array(e)[0]}(),V=function(){function e(){Object(i.a)(this,e)}return Object(r.a)(e,null,[{key:"parseScriptData",value:function(t,n,i){var r={};try{var a=e.parseValue(t,n,i),o=e.parseValue(t,n+a.size,i-a.size);r[a.data]=o.data}catch(s){c.e("AMF",s.toString())}return r}},{key:"parseObject",value:function(t,n,i){if(i<3)throw new m("Data not enough when parse ScriptDataObject");var r=e.parseString(t,n,i),a=e.parseValue(t,n+r.size,i-r.size),o=a.objectEnd;return{data:{name:r.data,value:a.data},size:r.size+a.size,objectEnd:o}}},{key:"parseVariable",value:function(t,n,i){return e.parseObject(t,n,i)}},{key:"parseString",value:function(e,t,n){if(n<2)throw new m("Data not enough when parse String");var i=new DataView(e,t,n).getUint16(0,!z);return{data:i>0?F(new Uint8Array(e,t+2,i)):"",size:2+i}}},{key:"parseLongString",value:function(e,t,n){if(n<4)throw new m("Data not enough when parse LongString");var i=new DataView(e,t,n).getUint32(0,!z);return{data:i>0?F(new Uint8Array(e,t+4,i)):"",size:4+i}}},{key:"parseDate",value:function(e,t,n){if(n<10)throw new m("Data size invalid when parse Date");var i=new DataView(e,t,n),r=i.getFloat64(0,!z),a=i.getInt16(8,!z);return{data:new Date(r+=60*a*1e3),size:10}}},{key:"parseValue",value:function(t,n,i){if(i<1)throw new m("Data not enough when parse Value");var r,a=new DataView(t,n,i),o=1,s=a.getUint8(0),l=!1;try{switch(s){case 0:r=a.getFloat64(1,!z),o+=8;break;case 1:r=!!a.getUint8(1),o+=1;break;case 2:var u=e.parseString(t,n+1,i-1);r=u.data,o+=u.size;break;case 3:r={};var d=0;for(9===(16777215&a.getUint32(i-4,!z))&&(d=3);o32)throw new g("ExpGolomb: readBits() bits exceeded max 32bits!");if(e<=this._current_word_bits_left){var t=this._current_word>>>32-e;return this._current_word<<=e,this._current_word_bits_left-=e,t}var n=this._current_word_bits_left?this._current_word:0;n>>>=32-this._current_word_bits_left;var i=e-this._current_word_bits_left;this._fillCurrentWord();var r=Math.min(i,this._current_word_bits_left),a=this._current_word>>>32-r;return this._current_word<<=r,this._current_word_bits_left-=r,n=n<>>e))return this._current_word<<=e,this._current_word_bits_left-=e,e;return this._fillCurrentWord(),e+this._skipLeadingZero()}},{key:"readUEG",value:function(){var e=this._skipLeadingZero();return this.readBits(e+1)-1}},{key:"readSEG",value:function(){var e=this.readUEG();return 1&e?e+1>>>1:-1*(e>>>1)}}]),e}(),W=function(){function e(){Object(i.a)(this,e)}return Object(r.a)(e,null,[{key:"_ebsp2rbsp",value:function(e){for(var t=e,n=t.byteLength,i=new Uint8Array(n),r=0,a=0;a=2&&3===t[a]&&0===t[a-1]&&0===t[a-2]||(i[r]=t[a],r++);return new Uint8Array(i.buffer,0,r)}},{key:"parseSPS",value:function(t){var n=e._ebsp2rbsp(t),i=new H(n);i.readByte();var r=i.readByte();i.readByte();var a=i.readByte();i.readUEG();var o=e.getProfileString(r),s=e.getLevelString(a),l=1,u=420,c=8;if((100===r||110===r||122===r||244===r||44===r||83===r||86===r||118===r||128===r||138===r||144===r)&&(3===(l=i.readUEG())&&i.readBits(1),l<=3&&(u=[0,420,422,444][l]),c=i.readUEG()+8,i.readUEG(),i.readBits(1),i.readBool()))for(var d=3!==l?8:12,f=0;f0&&R<16?(S=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2][R-1],T=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1][R-1]):255===R&&(S=i.readByte()<<8|i.readByte(),T=i.readByte()<<8|i.readByte())}if(i.readBool()&&i.readBool(),i.readBool()&&(i.readBits(4),i.readBool()&&i.readBits(24)),i.readBool()&&(i.readUEG(),i.readUEG()),i.readBool()){var L=i.readBits(32),P=i.readBits(32);x=i.readBool(),C=(O=P)/(A=2*L)}}var I=1;1===S&&1===T||(I=S/T);var M=0,D=0;0===l?(M=1,D=2-b):(M=3===l?1:2,D=(1===l?2:1)*(2-b));var N=16*(v+1),j=16*(y+1)*(2-b);N-=(_+k)*M,j-=(w+E)*D;var B=Math.ceil(N*I);return i.destroy(),i=null,{profile_string:o,level_string:s,bit_depth:c,ref_frames:g,chroma_format:u,chroma_format_string:e.getChromaFormatString(u),frame_rate:{fixed:x,fps:C,fps_den:A,fps_num:O},sar_ratio:{width:S,height:T},codec_size:{width:N,height:j},present_size:{width:B,height:j}}}},{key:"_skipScalingList",value:function(e,t){for(var n=8,i=8,r=0;r13))return 0;i=e.probe(t).dataOffset}this._firstParse&&(this._firstParse=!1,n+i!==this._dataOffset&&c.w(this.TAG,"First time parsing but chunk byteStart invalid!"),0!==new DataView(t,i).getUint32(0,!r)&&c.w(this.TAG,"PrevTagSize0 !== 0 !!!"),i+=4);for(;it.byteLength)break;var o=a.getUint8(0),s=16777215&a.getUint32(0,!r);if(i+11+s+4>t.byteLength)break;if(8===o||9===o||18===o){var l=a.getUint8(4),u=a.getUint8(5),d=a.getUint8(6)|u<<8|l<<16|a.getUint8(7)<<24;0!==(16777215&a.getUint32(7,!r))&&c.w(this.TAG,"Meet tag which has StreamID != 0!");var f=i+11;switch(o){case 8:this._parseAudioData(t,f,s,d);break;case 9:this._parseVideoData(t,f,s,d,n+i);break;case 18:this._parseScriptData(t,f,s)}var h=a.getUint32(11+s,!r);h!==11+s&&c.w(this.TAG,"Invalid PrevTagSize ".concat(h)),i+=11+s+4}else c.w(this.TAG,"Unsupported tag type ".concat(o,", skipped")),i+=11+s+4}return this._isInitialMetadataDispatched()&&this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack),i}},{key:"_parseScriptData",value:function(e,t,n){var i=V.parseScriptData(e,t,n);if(i.hasOwnProperty("onMetaData")){if(null==i.onMetaData||"object"!==typeof i.onMetaData)return void c.w(this.TAG,"Invalid onMetaData structure!");this._metadata&&c.w(this.TAG,"Found another onMetaData tag!"),this._metadata=i;var r=this._metadata.onMetaData;if(this._onMetaDataArrived&&this._onMetaDataArrived(Object.assign({},r)),"boolean"===typeof r.hasAudio&&!1===this._hasAudioFlagOverrided&&(this._hasAudio=r.hasAudio,this._mediaInfo.hasAudio=this._hasAudio),"boolean"===typeof r.hasVideo&&!1===this._hasVideoFlagOverrided&&(this._hasVideo=r.hasVideo,this._mediaInfo.hasVideo=this._hasVideo),"number"===typeof r.audiodatarate&&(this._mediaInfo.audioDataRate=r.audiodatarate),"number"===typeof r.videodatarate&&(this._mediaInfo.videoDataRate=r.videodatarate),"number"===typeof r.width&&(this._mediaInfo.width=r.width),"number"===typeof r.height&&(this._mediaInfo.height=r.height),"number"===typeof r.duration){if(!this._durationOverrided){var a=Math.floor(r.duration*this._timescale);this._duration=a,this._mediaInfo.duration=a}}else this._mediaInfo.duration=0;if("number"===typeof r.framerate){var o=Math.floor(1e3*r.framerate);if(o>0){var s=o/1e3;this._referenceFrameRate.fixed=!0,this._referenceFrameRate.fps=s,this._referenceFrameRate.fps_num=o,this._referenceFrameRate.fps_den=1e3,this._mediaInfo.fps=s}}if("object"===typeof r.keyframes){this._mediaInfo.hasKeyframesIndex=!0;var l=r.keyframes;this._mediaInfo.keyframesIndex=this._parseKeyframesIndex(l),r.keyframes=null}else this._mediaInfo.hasKeyframesIndex=!1;this._dispatch=!1,this._mediaInfo.metadata=r,c.v(this.TAG,"Parsed onMetaData"),this._mediaInfo.isComplete()&&this._onMediaInfo(this._mediaInfo)}Object.keys(i).length>0&&this._onScriptDataArrived&&this._onScriptDataArrived(Object.assign({},i))}},{key:"_parseKeyframesIndex",value:function(e){for(var t=[],n=[],i=1;i>>4;if(2===a||10===a){var o=0,s=(12&r)>>>2;if(s>=0&&s<=4){o=this._flvSoundRateTable[s];var l=1&r,u=this._audioMetadata,d=this._audioTrack;if(u||(!1===this._hasAudio&&!1===this._hasAudioFlagOverrided&&(this._hasAudio=!0,this._mediaInfo.hasAudio=!0),(u=this._audioMetadata={}).type="audio",u.id=d.id,u.timescale=this._timescale,u.duration=this._duration,u.audioSampleRate=o,u.channelCount=0===l?1:2),10===a){var f=this._parseAACAudioData(e,t+1,n-1);if(void 0==f)return;if(0===f.packetType){u.config&&c.w(this.TAG,"Found another AudioSpecificConfig!");var h=f.data;u.audioSampleRate=h.samplingRate,u.channelCount=h.channelCount,u.codec=h.codec,u.originalCodec=h.originalCodec,u.config=h.config,u.refSampleDuration=1024/u.audioSampleRate*u.timescale,c.v(this.TAG,"Parsed AudioSpecificConfig"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._audioInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("audio",u);var p=this._mediaInfo;p.audioCodec=u.originalCodec,p.audioSampleRate=u.audioSampleRate,p.audioChannelCount=u.channelCount,p.hasVideo?null!=p.videoCodec&&(p.mimeType='video/x-flv; codecs="'+p.videoCodec+","+p.audioCodec+'"'):p.mimeType='video/x-flv; codecs="'+p.audioCodec+'"',p.isComplete()&&this._onMediaInfo(p)}else if(1===f.packetType){var m=this._timestampBase+i,g={unit:f.data,length:f.data.byteLength,dts:m,pts:m};d.samples.push(g),d.length+=f.data.length}else c.e(this.TAG,"Flv: Unsupported AAC data type ".concat(f.packetType))}else if(2===a){if(!u.codec){var v=this._parseMP3AudioData(e,t+1,n-1,!0);if(void 0==v)return;u.audioSampleRate=v.samplingRate,u.channelCount=v.channelCount,u.codec=v.codec,u.originalCodec=v.originalCodec,u.refSampleDuration=1152/u.audioSampleRate*u.timescale,c.v(this.TAG,"Parsed MPEG Audio Frame Header"),this._audioInitialMetadataDispatched=!0,this._onTrackMetadata("audio",u);var y=this._mediaInfo;y.audioCodec=u.codec,y.audioSampleRate=u.audioSampleRate,y.audioChannelCount=u.channelCount,y.audioDataRate=v.bitRate,y.hasVideo?null!=y.videoCodec&&(y.mimeType='video/x-flv; codecs="'+y.videoCodec+","+y.audioCodec+'"'):y.mimeType='video/x-flv; codecs="'+y.audioCodec+'"',y.isComplete()&&this._onMediaInfo(y)}var b=this._parseMP3AudioData(e,t+1,n-1,!1);if(void 0==b)return;var _=this._timestampBase+i,k={unit:b,length:b.byteLength,dts:_,pts:_};d.samples.push(k),d.length+=b.length}}else this._onError(G.FORMAT_ERROR,"Flv: Invalid audio sample rate idx: "+s)}else this._onError(G.CODEC_UNSUPPORTED,"Flv: Unsupported audio codec idx: "+a)}}},{key:"_parseAACAudioData",value:function(e,t,n){if(!(n<=1)){var i={},r=new Uint8Array(e,t,n);return i.packetType=r[0],0===r[0]?i.data=this._parseAACAudioSpecificConfig(e,t+1,n-1):i.data=r.subarray(1),i}c.w(this.TAG,"Flv: Invalid AAC packet, missing AACPacketType or/and Data!")}},{key:"_parseAACAudioSpecificConfig",value:function(e,t,n){var i,r,a=new Uint8Array(e,t,n),o=null,s=0,l=null;if(s=i=a[0]>>>3,(r=(7&a[0])<<1|a[1]>>>7)<0||r>=this._mpegSamplingRates.length)this._onError(G.FORMAT_ERROR,"Flv: AAC invalid sampling frequency index!");else{var u=this._mpegSamplingRates[r],c=(120&a[1])>>>3;if(!(c<0||c>=8)){5===s&&(l=(7&a[1])<<1|a[2]>>>7,(124&a[2])>>>2);var d=self.navigator.userAgent.toLowerCase();return-1!==d.indexOf("firefox")?r>=6?(s=5,o=new Array(4),l=r-3):(s=2,o=new Array(2),l=r):-1!==d.indexOf("android")?(s=2,o=new Array(2),l=r):(s=5,l=r,o=new Array(4),r>=6?l=r-3:1===c&&(s=2,o=new Array(2),l=r)),o[0]=s<<3,o[0]|=(15&r)>>>1,o[1]=(15&r)<<7,o[1]|=(15&c)<<3,5===s&&(o[1]|=(15&l)>>>1,o[2]=(1&l)<<7,o[2]|=8,o[3]=0),{config:o,samplingRate:u,channelCount:c,codec:"mp4a.40."+s,originalCodec:"mp4a.40."+i}}this._onError(G.FORMAT_ERROR,"Flv: AAC invalid channel configuration")}}},{key:"_parseMP3AudioData",value:function(e,t,n,i){if(!(n<4)){this._littleEndian;var r=new Uint8Array(e,t,n),a=null;if(i){if(255!==r[0])return;var o=r[1]>>>3&3,s=(6&r[1])>>1,l=(240&r[2])>>>4,u=(12&r[2])>>>2,d=3!==(r[3]>>>6&3)?2:1,f=0,h=0;switch(o){case 0:f=this._mpegAudioV25SampleRateTable[u];break;case 2:f=this._mpegAudioV20SampleRateTable[u];break;case 3:f=this._mpegAudioV10SampleRateTable[u]}switch(s){case 1:34,l>>4,s=15&a;7===s?this._parseAVCVideoPacket(e,t+1,n-1,i,r,o):this._onError(G.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: ".concat(s))}}},{key:"_parseAVCVideoPacket",value:function(e,t,n,i,r,a){if(n<4)c.w(this.TAG,"Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime");else{var o=this._littleEndian,s=new DataView(e,t,n),l=s.getUint8(0),u=(16777215&s.getUint32(0,!o))<<8>>8;if(0===l)this._parseAVCDecoderConfigurationRecord(e,t+4,n-4);else if(1===l)this._parseAVCVideoData(e,t+4,n-4,i,r,a,u);else if(2!==l)return void this._onError(G.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(l))}}},{key:"_parseAVCDecoderConfigurationRecord",value:function(e,t,n){if(n<7)c.w(this.TAG,"Flv: Invalid AVCDecoderConfigurationRecord, lack of data!");else{var i=this._videoMetadata,r=this._videoTrack,a=this._littleEndian,o=new DataView(e,t,n);i?"undefined"!==typeof i.avcc&&c.w(this.TAG,"Found another AVCDecoderConfigurationRecord!"):(!1===this._hasVideo&&!1===this._hasVideoFlagOverrided&&(this._hasVideo=!0,this._mediaInfo.hasVideo=!0),(i=this._videoMetadata={}).type="video",i.id=r.id,i.timescale=this._timescale,i.duration=this._duration);var s=o.getUint8(0),l=o.getUint8(1);o.getUint8(2),o.getUint8(3);if(1===s&&0!==l)if(this._naluLengthSize=1+(3&o.getUint8(4)),3===this._naluLengthSize||4===this._naluLengthSize){var u=31&o.getUint8(5);if(0!==u){u>1&&c.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: SPS Count = ".concat(u));for(var d=6,f=0;f1&&c.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: PPS Count = ".concat(E)),d++;for(var S=0;S=n){c.w(this.TAG,"Malformed Nalu near timestamp ".concat(p,", offset = ").concat(f,", dataSize = ").concat(n));break}var g=l.getUint32(f,!s);if(3===h&&(g>>>=8),g>n-h)return void c.w(this.TAG,"Malformed Nalus near timestamp ".concat(p,", NaluSize > DataSize!"));var v=31&l.getUint8(f+h);5===v&&(m=!0);var y=new Uint8Array(e,t+f,h+g),b={type:v,data:y};u.push(b),d+=y.byteLength,f+=h+g}if(u.length){var _=this._videoTrack,k={units:u,length:d,isKeyframe:m,dts:p,cts:o,pts:p+o};m&&(k.fileposition=r),_.samples.push(k),_.length+=d}}},{key:"onTrackMetadata",get:function(){return this._onTrackMetadata},set:function(e){this._onTrackMetadata=e}},{key:"onMediaInfo",get:function(){return this._onMediaInfo},set:function(e){this._onMediaInfo=e}},{key:"onMetaDataArrived",get:function(){return this._onMetaDataArrived},set:function(e){this._onMetaDataArrived=e}},{key:"onScriptDataArrived",get:function(){return this._onScriptDataArrived},set:function(e){this._onScriptDataArrived=e}},{key:"onError",get:function(){return this._onError},set:function(e){this._onError=e}},{key:"onDataAvailable",get:function(){return this._onDataAvailable},set:function(e){this._onDataAvailable=e}},{key:"timestampBase",get:function(){return this._timestampBase},set:function(e){this._timestampBase=e}},{key:"overridedDuration",get:function(){return this._duration},set:function(e){this._durationOverrided=!0,this._duration=e,this._mediaInfo.duration=e}},{key:"overridedHasAudio",set:function(e){this._hasAudioFlagOverrided=!0,this._hasAudio=e,this._mediaInfo.hasAudio=e}},{key:"overridedHasVideo",set:function(e){this._hasVideoFlagOverrided=!0,this._hasVideo=e,this._mediaInfo.hasVideo=e}}],[{key:"probe",value:function(e){var t=new Uint8Array(e),n={match:!1};if(70!==t[0]||76!==t[1]||86!==t[2]||1!==t[3])return n;var i,r,a=(4&t[4])>>>2!==0,o=0!==(1&t[4]),s=(i=t)[r=5]<<24|i[r+1]<<16|i[r+2]<<8|i[r+3];return s<9?n:{match:!0,consumed:s,dataOffset:s,hasAudioTrack:a,hasVideoTrack:o}}}]),e}(),K=function(){function e(){Object(i.a)(this,e)}return Object(r.a)(e,null,[{key:"init",value:function(){for(var t in e.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[],".mp3":[]},e.types)e.types.hasOwnProperty(t)&&(e.types[t]=[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3)]);var n=e.constants={};n.FTYP=new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]),n.STSD_PREFIX=new Uint8Array([0,0,0,0,0,0,0,1]),n.STTS=new Uint8Array([0,0,0,0,0,0,0,0]),n.STSC=n.STCO=n.STTS,n.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),n.HDLR_VIDEO=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),n.HDLR_AUDIO=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),n.DREF=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),n.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),n.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}},{key:"box",value:function(e){for(var t=8,n=null,i=Array.prototype.slice.call(arguments,1),r=i.length,a=0;a>>24&255,n[1]=t>>>16&255,n[2]=t>>>8&255,n[3]=255&t,n.set(e,4);for(var o=8,s=0;s>>24&255,t>>>16&255,t>>>8&255,255&t,n>>>24&255,n>>>16&255,n>>>8&255,255&n,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]))}},{key:"trak",value:function(t){return e.box(e.types.trak,e.tkhd(t),e.mdia(t))}},{key:"tkhd",value:function(t){var n=t.id,i=t.duration,r=t.presentWidth,a=t.presentHeight;return e.box(e.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,n>>>24&255,n>>>16&255,n>>>8&255,255&n,0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,r>>>8&255,255&r,0,0,a>>>8&255,255&a,0,0]))}},{key:"mdia",value:function(t){return e.box(e.types.mdia,e.mdhd(t),e.hdlr(t),e.minf(t))}},{key:"mdhd",value:function(t){var n=t.timescale,i=t.duration;return e.box(e.types.mdhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,n>>>24&255,n>>>16&255,n>>>8&255,255&n,i>>>24&255,i>>>16&255,i>>>8&255,255&i,85,196,0,0]))}},{key:"hdlr",value:function(t){var n=null;return n="audio"===t.type?e.constants.HDLR_AUDIO:e.constants.HDLR_VIDEO,e.box(e.types.hdlr,n)}},{key:"minf",value:function(t){var n=null;return n="audio"===t.type?e.box(e.types.smhd,e.constants.SMHD):e.box(e.types.vmhd,e.constants.VMHD),e.box(e.types.minf,n,e.dinf(),e.stbl(t))}},{key:"dinf",value:function(){return e.box(e.types.dinf,e.box(e.types.dref,e.constants.DREF))}},{key:"stbl",value:function(t){return e.box(e.types.stbl,e.stsd(t),e.box(e.types.stts,e.constants.STTS),e.box(e.types.stsc,e.constants.STSC),e.box(e.types.stsz,e.constants.STSZ),e.box(e.types.stco,e.constants.STCO))}},{key:"stsd",value:function(t){return"audio"===t.type?"mp3"===t.codec?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.mp3(t)):e.box(e.types.stsd,e.constants.STSD_PREFIX,e.mp4a(t)):e.box(e.types.stsd,e.constants.STSD_PREFIX,e.avc1(t))}},{key:"mp3",value:function(t){var n=t.channelCount,i=t.audioSampleRate,r=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,n,0,16,0,0,0,0,i>>>8&255,255&i,0,0]);return e.box(e.types[".mp3"],r)}},{key:"mp4a",value:function(t){var n=t.channelCount,i=t.audioSampleRate,r=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,n,0,16,0,0,0,0,i>>>8&255,255&i,0,0]);return e.box(e.types.mp4a,r,e.esds(t))}},{key:"esds",value:function(t){var n=t.config||[],i=n.length,r=new Uint8Array([0,0,0,0,3,23+i,0,1,0,4,15+i,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([i]).concat(n).concat([6,1,2]));return e.box(e.types.esds,r)}},{key:"avc1",value:function(t){var n=t.avcc,i=t.codecWidth,r=t.codecHeight,a=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,i>>>8&255,255&i,r>>>8&255,255&r,0,72,0,0,0,72,0,0,0,0,0,0,0,1,10,120,113,113,47,102,108,118,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,255,255]);return e.box(e.types.avc1,a,e.box(e.types.avcC,n))}},{key:"mvex",value:function(t){return e.box(e.types.mvex,e.trex(t))}},{key:"trex",value:function(t){var n=t.id,i=new Uint8Array([0,0,0,0,n>>>24&255,n>>>16&255,n>>>8&255,255&n,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return e.box(e.types.trex,i)}},{key:"moof",value:function(t,n){return e.box(e.types.moof,e.mfhd(t.sequenceNumber),e.traf(t,n))}},{key:"mfhd",value:function(t){var n=new Uint8Array([0,0,0,0,t>>>24&255,t>>>16&255,t>>>8&255,255&t]);return e.box(e.types.mfhd,n)}},{key:"traf",value:function(t,n){var i=t.id,r=e.box(e.types.tfhd,new Uint8Array([0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i])),a=e.box(e.types.tfdt,new Uint8Array([0,0,0,0,n>>>24&255,n>>>16&255,n>>>8&255,255&n])),o=e.sdtp(t),s=e.trun(t,o.byteLength+16+16+8+16+8+8);return e.box(e.types.traf,r,a,s,o)}},{key:"sdtp",value:function(t){for(var n=t.samples||[],i=n.length,r=new Uint8Array(4+i),a=0;a>>24&255,r>>>16&255,r>>>8&255,255&r,n>>>24&255,n>>>16&255,n>>>8&255,255&n],0);for(var s=0;s>>24&255,l>>>16&255,l>>>8&255,255&l,u>>>24&255,u>>>16&255,u>>>8&255,255&u,c.isLeading<<2|c.dependsOn,c.isDependedOn<<6|c.hasRedundancy<<4|c.isNonSync,0,0,d>>>24&255,d>>>16&255,d>>>8&255,255&d],12+16*s)}return e.box(e.types.trun,o)}},{key:"mdat",value:function(t){return e.box(e.types.mdat,t)}}]),e}();K.init();var $=K,Y=function(){function e(){Object(i.a)(this,e)}return Object(r.a)(e,null,[{key:"getSilentFrame",value:function(e,t){if("mp4a.40.2"===e){if(1===t)return new Uint8Array([0,200,0,128,35,128]);if(2===t)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(6===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224])}else{if(1===t)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(2===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(3===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}return null}}]),e}(),Q=function e(t,n,r,a,o){Object(i.a)(this,e),this.dts=t,this.pts=n,this.duration=r,this.originalDts=a,this.isSyncPoint=o,this.fileposition=null},X=function(){function e(){Object(i.a)(this,e),this.beginDts=0,this.endDts=0,this.beginPts=0,this.endPts=0,this.originalBeginDts=0,this.originalEndDts=0,this.syncPoints=[],this.firstSample=null,this.lastSample=null}return Object(r.a)(e,[{key:"appendSyncPoint",value:function(e){e.isSyncPoint=!0,this.syncPoints.push(e)}}]),e}(),J=function(){function e(){Object(i.a)(this,e),this._list=[]}return Object(r.a)(e,[{key:"clear",value:function(){this._list=[]}},{key:"appendArray",value:function(e){var t=this._list;0!==e.length&&(t.length>0&&e[0].originalDts=t[r].dts&&et[i].lastSample.originalDts&&e=t[i].lastSample.originalDts&&(i===t.length-1||i0&&(r=this._searchNearestSegmentBefore(n.originalBeginDts)+1),this._lastAppendLocation=r,this._list.splice(r,0,n)}},{key:"getLastSegmentBefore",value:function(e){var t=this._searchNearestSegmentBefore(e);return t>=0?this._list[t]:null}},{key:"getLastSampleBefore",value:function(e){var t=this.getLastSegmentBefore(e);return null!=t?t.lastSample:null}},{key:"getLastSyncPointBefore",value:function(e){for(var t=this._searchNearestSegmentBefore(e),n=this._list[t].syncPoints;0===n.length&&t>0;)t--,n=this._list[t].syncPoints;return n.length>0?n[n.length-1]:null}},{key:"type",get:function(){return this._type}},{key:"length",get:function(){return this._list.length}}]),e}(),ee=function(){function e(t){Object(i.a)(this,e),this.TAG="MP4Remuxer",this._config=t,this._isLive=!0===t.isLive,this._dtsBase=-1,this._dtsBaseInited=!1,this._audioDtsBase=1/0,this._videoDtsBase=1/0,this._audioNextDts=void 0,this._videoNextDts=void 0,this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList=new Z("audio"),this._videoSegmentInfoList=new Z("video"),this._onInitSegment=null,this._onMediaSegment=null,this._forceFirstIDR=!(!S.chrome||!(S.version.major<50||50===S.version.major&&S.version.build<2661)),this._fillSilentAfterSeek=S.msedge||S.msie,this._mp3UseMpegAudio=!S.firefox,this._fillAudioTimestampGap=this._config.fixAudioTimestampGap}return Object(r.a)(e,[{key:"destroy",value:function(){this._dtsBase=-1,this._dtsBaseInited=!1,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList.clear(),this._audioSegmentInfoList=null,this._videoSegmentInfoList.clear(),this._videoSegmentInfoList=null,this._onInitSegment=null,this._onMediaSegment=null}},{key:"bindDataSource",value:function(e){return e.onDataAvailable=this.remux.bind(this),e.onTrackMetadata=this._onTrackMetadataReceived.bind(this),this}},{key:"insertDiscontinuity",value:function(){this._audioNextDts=this._videoNextDts=void 0}},{key:"seek",value:function(e){this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._videoSegmentInfoList.clear(),this._audioSegmentInfoList.clear()}},{key:"remux",value:function(e,t){if(!this._onMediaSegment)throw new m("MP4Remuxer: onMediaSegment callback must be specificed!");this._dtsBaseInited||this._calculateDtsBase(e,t),this._remuxVideo(t),this._remuxAudio(e)}},{key:"_onTrackMetadataReceived",value:function(e,t){var n=null,i="mp4",r=t.codec;if("audio"===e)this._audioMeta=t,"mp3"===t.codec&&this._mp3UseMpegAudio?(i="mpeg",r="",n=new Uint8Array):n=$.generateInitSegment(t);else{if("video"!==e)return;this._videoMeta=t,n=$.generateInitSegment(t)}if(!this._onInitSegment)throw new m("MP4Remuxer: onInitSegment callback must be specified!");this._onInitSegment(e,{type:e,data:n.buffer,codec:r,container:"".concat(e,"/").concat(i),mediaDuration:t.duration})}},{key:"_calculateDtsBase",value:function(e,t){this._dtsBaseInited||(e.samples&&e.samples.length&&(this._audioDtsBase=e.samples[0].dts),t.samples&&t.samples.length&&(this._videoDtsBase=t.samples[0].dts),this._dtsBase=Math.min(this._audioDtsBase,this._videoDtsBase),this._dtsBaseInited=!0)}},{key:"flushStashedSamples",value:function(){var e=this._videoStashedLastSample,t=this._audioStashedLastSample,n={type:"video",id:1,sequenceNumber:0,samples:[],length:0};null!=e&&(n.samples.push(e),n.length=e.length);var i={type:"audio",id:2,sequenceNumber:0,samples:[],length:0};null!=t&&(i.samples.push(t),i.length=t.length),this._videoStashedLastSample=null,this._audioStashedLastSample=null,this._remuxVideo(n,!0),this._remuxAudio(i,!0)}},{key:"_remuxAudio",value:function(e,t){if(null!=this._audioMeta){var n,i=e,r=i.samples,a=void 0,o=-1,s=this._audioMeta.refSampleDuration,l="mp3"===this._audioMeta.codec&&this._mp3UseMpegAudio,u=this._dtsBaseInited&&void 0===this._audioNextDts,d=!1;if(r&&0!==r.length&&(1!==r.length||t)){var f=0,h=null,p=0;l?(f=0,p=i.length):(f=8,p=8+i.length);var m=null;if(r.length>1&&(p-=(m=r.pop()).length),null!=this._audioStashedLastSample){var g=this._audioStashedLastSample;this._audioStashedLastSample=null,r.unshift(g),p+=g.length}null!=m&&(this._audioStashedLastSample=m);var v=r[0].dts-this._dtsBase;if(this._audioNextDts)a=v-this._audioNextDts;else if(this._audioSegmentInfoList.isEmpty())a=0,this._fillSilentAfterSeek&&!this._videoSegmentInfoList.isEmpty()&&"mp3"!==this._audioMeta.originalCodec&&(d=!0);else{var y=this._audioSegmentInfoList.getLastSampleBefore(v);if(null!=y){var b=v-(y.originalDts+y.duration);b<=3&&(b=0),a=v-(y.dts+y.duration+b)}else a=0}if(d){var _=v-a,k=this._videoSegmentInfoList.getLastSegmentBefore(v);if(null!=k&&k.beginDts<_){var w=Y.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);if(w){var E=k.beginDts,T=_-k.beginDts;c.v(this.TAG,"InsertPrefixSilentAudio: dts: ".concat(E,", duration: ").concat(T)),r.unshift({unit:w,dts:E,pts:E}),p+=w.byteLength}}else d=!1}for(var C=[],x=0;x=1?C[C.length-1].duration:Math.floor(s);var I=!1,M=null;if(P>1.5*s&&"mp3"!==this._audioMeta.codec&&this._fillAudioTimestampGap&&!S.safari){I=!0;var D=Math.abs(P-s),N=Math.ceil(D/s),j=L+s;c.w(this.TAG,"Large audio timestamp gap detected, may cause AV sync to drift. Silent frames will be generated to avoid unsync.\n"+"dts: ".concat(L+P," ms, expected: ").concat(L+Math.round(s)," ms, ")+"delta: ".concat(Math.round(D)," ms, generate: ").concat(N," frames"));var B=Y.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);null==B&&(c.w(this.TAG,"Unable to generate silent frame for "+"".concat(this._audioMeta.originalCodec," with ").concat(this._audioMeta.channelCount," channels, repeat last frame")),B=A),M=[];for(var U=0;U0){var z=M[M.length-1];z.duration=F-z.dts}var V={dts:F,pts:F,cts:0,unit:B,size:B.byteLength,duration:0,originalDts:R,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}};M.push(V),p+=V.size,j+=s}var H=M[M.length-1];H.duration=L+P-H.dts,P=Math.round(s)}C.push({dts:L,pts:L,cts:0,unit:O.unit,size:O.unit.byteLength,duration:P,originalDts:R,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}}),I&&C.push.apply(C,M)}l?h=new Uint8Array(p):((h=new Uint8Array(p))[0]=p>>>24&255,h[1]=p>>>16&255,h[2]=p>>>8&255,h[3]=255&p,h.set($.types.mdat,4));for(var W=0;W1&&(d-=(f=a.pop()).length),null!=this._videoStashedLastSample){var h=this._videoStashedLastSample;this._videoStashedLastSample=null,a.unshift(h),d+=h.length}null!=f&&(this._videoStashedLastSample=f);var p=a[0].dts-this._dtsBase;if(this._videoNextDts)o=p-this._videoNextDts;else if(this._videoSegmentInfoList.isEmpty())o=0;else{var m=this._videoSegmentInfoList.getLastSampleBefore(p);if(null!=m){var g=p-(m.originalDts+m.duration);g<=3&&(g=0),o=p-(m.dts+m.duration+g)}else o=0}for(var v=new X,y=[],b=0;b=1?y[y.length-1].duration:Math.floor(this._videoMeta.refSampleDuration);if(w){var x=new Q(E,T,C,_.dts,!0);x.fileposition=_.fileposition,v.appendSyncPoint(x)}y.push({dts:E,pts:T,cts:S,units:_.units,size:_.length,isKeyframe:w,duration:C,originalDts:k,flags:{isLeading:0,dependsOn:w?2:1,isDependedOn:w?1:0,hasRedundancy:0,isNonSync:w?0:1}})}(c=new Uint8Array(d))[0]=d>>>24&255,c[1]=d>>>16&255,c[2]=d>>>8&255,c[3]=255&d,c.set($.types.mdat,4);for(var O=0;O0)this._demuxer.bindDataSource(this._ioctl),this._demuxer.timestampBase=this._mediaDataSource.segments[this._currentSegmentIndex].timestampBase,r=this._demuxer.parseChunks(e,t);else if((i=q.probe(e)).match){this._demuxer=new q(i,this._config),this._remuxer||(this._remuxer=new ee(this._config));var a=this._mediaDataSource;void 0==a.duration||isNaN(a.duration)||(this._demuxer.overridedDuration=a.duration),"boolean"===typeof a.hasAudio&&(this._demuxer.overridedHasAudio=a.hasAudio),"boolean"===typeof a.hasVideo&&(this._demuxer.overridedHasVideo=a.hasVideo),this._demuxer.timestampBase=a.segments[this._currentSegmentIndex].timestampBase,this._demuxer.onError=this._onDemuxException.bind(this),this._demuxer.onMediaInfo=this._onMediaInfo.bind(this),this._demuxer.onMetaDataArrived=this._onMetaDataArrived.bind(this),this._demuxer.onScriptDataArrived=this._onScriptDataArrived.bind(this),this._remuxer.bindDataSource(this._demuxer.bindDataSource(this._ioctl)),this._remuxer.onInitSegment=this._onRemuxerInitSegmentArrival.bind(this),this._remuxer.onMediaSegment=this._onRemuxerMediaSegmentArrival.bind(this),r=this._demuxer.parseChunks(e,t)}else i=null,c.e(this.TAG,"Non-FLV, Unsupported media type!"),Promise.resolve().then((function(){n._internalAbort()})),this._emitter.emit(te.DEMUX_ERROR,G.FORMAT_UNSUPPORTED,"Non-FLV, Unsupported media type"),r=0;return r}},{key:"_onMediaInfo",value:function(e){var t=this;null==this._mediaInfo&&(this._mediaInfo=Object.assign({},e),this._mediaInfo.keyframesIndex=null,this._mediaInfo.segments=[],this._mediaInfo.segmentCount=this._mediaDataSource.segments.length,Object.setPrototypeOf(this._mediaInfo,B.prototype));var n=Object.assign({},e);Object.setPrototypeOf(n,B.prototype),this._mediaInfo.segments[this._currentSegmentIndex]=n,this._reportSegmentMediaInfo(this._currentSegmentIndex),null!=this._pendingSeekTime&&Promise.resolve().then((function(){var e=t._pendingSeekTime;t._pendingSeekTime=null,t.seek(e)}))}},{key:"_onMetaDataArrived",value:function(e){this._emitter.emit(te.METADATA_ARRIVED,e)}},{key:"_onScriptDataArrived",value:function(e){this._emitter.emit(te.SCRIPTDATA_ARRIVED,e)}},{key:"_onIOSeeked",value:function(){this._remuxer.insertDiscontinuity()}},{key:"_onIOComplete",value:function(e){var t=e+1;t0&&n[0].originalDts===i&&(i=n[0].pts),this._emitter.emit(te.RECOMMEND_SEEKPOINT,i)}}},{key:"_enableStatisticsReporter",value:function(){null==this._statisticsReporter&&(this._statisticsReporter=self.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval))}},{key:"_disableStatisticsReporter",value:function(){this._statisticsReporter&&(self.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}},{key:"_reportSegmentMediaInfo",value:function(e){var t=this._mediaInfo.segments[e],n=Object.assign({},t);n.duration=this._mediaInfo.duration,n.segmentCount=this._mediaInfo.segmentCount,delete n.segments,delete n.keyframesIndex,this._emitter.emit(te.MEDIA_INFO,n)}},{key:"_reportStatisticsInfo",value:function(){var e={};e.url=this._ioctl.currentURL,e.hasRedirect=this._ioctl.hasRedirect,e.hasRedirect&&(e.redirectedURL=this._ioctl.currentRedirectedURL),e.speed=this._ioctl.currentSpeed,e.loaderType=this._ioctl.loaderType,e.currentSegmentIndex=this._currentSegmentIndex,e.totalSegmentCount=this._mediaDataSource.segments.length,this._emitter.emit(te.STATISTICS_INFO,e)}}]),e}(),ie=function(e){var t=null,n=function(t,n){e.postMessage({msg:"logcat_callback",data:{type:t,logcat:n}})}.bind(this);function i(t,n){var i={msg:te.INIT_SEGMENT,data:{type:t,data:n}};e.postMessage(i,[n.data])}function r(t,n){var i={msg:te.MEDIA_SEGMENT,data:{type:t,data:n}};e.postMessage(i,[n.data])}function a(){var t={msg:te.LOADING_COMPLETE};e.postMessage(t)}function s(){var t={msg:te.RECOVERED_EARLY_EOF};e.postMessage(t)}function l(t){var n={msg:te.MEDIA_INFO,data:t};e.postMessage(n)}function u(t){var n={msg:te.METADATA_ARRIVED,data:t};e.postMessage(n)}function c(t){var n={msg:te.SCRIPTDATA_ARRIVED,data:t};e.postMessage(n)}function d(t){var n={msg:te.STATISTICS_INFO,data:t};e.postMessage(n)}function f(t,n){e.postMessage({msg:te.IO_ERROR,data:{type:t,info:n}})}function h(t,n){e.postMessage({msg:te.DEMUX_ERROR,data:{type:t,info:n}})}function p(t){e.postMessage({msg:te.RECOMMEND_SEEKPOINT,data:t})}o.install(),e.addEventListener("message",(function(o){switch(o.data.cmd){case"init":(t=new ne(o.data.param[0],o.data.param[1])).on(te.IO_ERROR,f.bind(this)),t.on(te.DEMUX_ERROR,h.bind(this)),t.on(te.INIT_SEGMENT,i.bind(this)),t.on(te.MEDIA_SEGMENT,r.bind(this)),t.on(te.LOADING_COMPLETE,a.bind(this)),t.on(te.RECOVERED_EARLY_EOF,s.bind(this)),t.on(te.MEDIA_INFO,l.bind(this)),t.on(te.METADATA_ARRIVED,u.bind(this)),t.on(te.SCRIPTDATA_ARRIVED,c.bind(this)),t.on(te.STATISTICS_INFO,d.bind(this)),t.on(te.RECOMMEND_SEEKPOINT,p.bind(this));break;case"destroy":t&&(t.destroy(),t=null),e.postMessage({msg:"destroyed"});break;case"start":t.start();break;case"stop":t.stop();break;case"seek":t.seek(o.data.param);break;case"pause":t.pause();break;case"resume":t.resume();break;case"logging_config":var m=o.data.param;j.applyConfig(m),!0===m.enableCallback?j.addLogListener(n):j.removeLogListener(n)}}))},re=function(){function e(t,r){if(Object(i.a)(this,e),this.TAG="Transmuxer",this._emitter=new l.a,r.enableWorker&&"undefined"!==typeof Worker)try{var a=n(48);this._worker=a(ie),this._workerDestroying=!1,this._worker.addEventListener("message",this._onWorkerMessage.bind(this)),this._worker.postMessage({cmd:"init",param:[t,r]}),this.e={onLoggingConfigChanged:this._onLoggingConfigChanged.bind(this)},j.registerListener(this.e.onLoggingConfigChanged),this._worker.postMessage({cmd:"logging_config",param:j.getConfig()})}catch(s){c.e(this.TAG,"Error while initialize transmuxing worker, fallback to inline transmuxing"),this._worker=null,this._controller=new ne(t,r)}else this._controller=new ne(t,r);if(this._controller){var o=this._controller;o.on(te.IO_ERROR,this._onIOError.bind(this)),o.on(te.DEMUX_ERROR,this._onDemuxError.bind(this)),o.on(te.INIT_SEGMENT,this._onInitSegment.bind(this)),o.on(te.MEDIA_SEGMENT,this._onMediaSegment.bind(this)),o.on(te.LOADING_COMPLETE,this._onLoadingComplete.bind(this)),o.on(te.RECOVERED_EARLY_EOF,this._onRecoveredEarlyEof.bind(this)),o.on(te.MEDIA_INFO,this._onMediaInfo.bind(this)),o.on(te.METADATA_ARRIVED,this._onMetaDataArrived.bind(this)),o.on(te.SCRIPTDATA_ARRIVED,this._onScriptDataArrived.bind(this)),o.on(te.STATISTICS_INFO,this._onStatisticsInfo.bind(this)),o.on(te.RECOMMEND_SEEKPOINT,this._onRecommendSeekpoint.bind(this))}}return Object(r.a)(e,[{key:"destroy",value:function(){this._worker?this._workerDestroying||(this._workerDestroying=!0,this._worker.postMessage({cmd:"destroy"}),j.removeListener(this.e.onLoggingConfigChanged),this.e=null):(this._controller.destroy(),this._controller=null),this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(e,t){this._emitter.addListener(e,t)}},{key:"off",value:function(e,t){this._emitter.removeListener(e,t)}},{key:"hasWorker",value:function(){return null!=this._worker}},{key:"open",value:function(){this._worker?this._worker.postMessage({cmd:"start"}):this._controller.start()}},{key:"close",value:function(){this._worker?this._worker.postMessage({cmd:"stop"}):this._controller.stop()}},{key:"seek",value:function(e){this._worker?this._worker.postMessage({cmd:"seek",param:e}):this._controller.seek(e)}},{key:"pause",value:function(){this._worker?this._worker.postMessage({cmd:"pause"}):this._controller.pause()}},{key:"resume",value:function(){this._worker?this._worker.postMessage({cmd:"resume"}):this._controller.resume()}},{key:"_onInitSegment",value:function(e,t){var n=this;Promise.resolve().then((function(){n._emitter.emit(te.INIT_SEGMENT,e,t)}))}},{key:"_onMediaSegment",value:function(e,t){var n=this;Promise.resolve().then((function(){n._emitter.emit(te.MEDIA_SEGMENT,e,t)}))}},{key:"_onLoadingComplete",value:function(){var e=this;Promise.resolve().then((function(){e._emitter.emit(te.LOADING_COMPLETE)}))}},{key:"_onRecoveredEarlyEof",value:function(){var e=this;Promise.resolve().then((function(){e._emitter.emit(te.RECOVERED_EARLY_EOF)}))}},{key:"_onMediaInfo",value:function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(te.MEDIA_INFO,e)}))}},{key:"_onMetaDataArrived",value:function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(te.METADATA_ARRIVED,e)}))}},{key:"_onScriptDataArrived",value:function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(te.SCRIPTDATA_ARRIVED,e)}))}},{key:"_onStatisticsInfo",value:function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(te.STATISTICS_INFO,e)}))}},{key:"_onIOError",value:function(e,t){var n=this;Promise.resolve().then((function(){n._emitter.emit(te.IO_ERROR,e,t)}))}},{key:"_onDemuxError",value:function(e,t){var n=this;Promise.resolve().then((function(){n._emitter.emit(te.DEMUX_ERROR,e,t)}))}},{key:"_onRecommendSeekpoint",value:function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(te.RECOMMEND_SEEKPOINT,e)}))}},{key:"_onLoggingConfigChanged",value:function(e){this._worker&&this._worker.postMessage({cmd:"logging_config",param:e})}},{key:"_onWorkerMessage",value:function(e){var t=e.data,n=t.data;if("destroyed"===t.msg||this._workerDestroying)return this._workerDestroying=!1,this._worker.terminate(),void(this._worker=null);switch(t.msg){case te.INIT_SEGMENT:case te.MEDIA_SEGMENT:this._emitter.emit(t.msg,n.type,n.data);break;case te.LOADING_COMPLETE:case te.RECOVERED_EARLY_EOF:this._emitter.emit(t.msg);break;case te.MEDIA_INFO:Object.setPrototypeOf(n,B.prototype),this._emitter.emit(t.msg,n);break;case te.METADATA_ARRIVED:case te.SCRIPTDATA_ARRIVED:case te.STATISTICS_INFO:this._emitter.emit(t.msg,n);break;case te.IO_ERROR:case te.DEMUX_ERROR:this._emitter.emit(t.msg,n.type,n.info);break;case te.RECOMMEND_SEEKPOINT:this._emitter.emit(t.msg,n);break;case"logcat_callback":c.emitter.emit("log",n.type,n.logcat)}}}]),e}(),ae={ERROR:"error",SOURCE_OPEN:"source_open",UPDATE_END:"update_end",BUFFER_FULL:"buffer_full"},oe=function(){function e(t){Object(i.a)(this,e),this.TAG="MSEController",this._config=t,this._emitter=new l.a,this._config.isLive&&void 0==this._config.autoCleanupSourceBuffer&&(this._config.autoCleanupSourceBuffer=!0),this.e={onSourceOpen:this._onSourceOpen.bind(this),onSourceEnded:this._onSourceEnded.bind(this),onSourceClose:this._onSourceClose.bind(this),onSourceBufferError:this._onSourceBufferError.bind(this),onSourceBufferUpdateEnd:this._onSourceBufferUpdateEnd.bind(this)},this._mediaSource=null,this._mediaSourceObjectURL=null,this._mediaElement=null,this._isBufferFull=!1,this._hasPendingEos=!1,this._requireSetMediaDuration=!1,this._pendingMediaDuration=0,this._pendingSourceBufferInit=[],this._mimeTypes={video:null,audio:null},this._sourceBuffers={video:null,audio:null},this._lastInitSegments={video:null,audio:null},this._pendingSegments={video:[],audio:[]},this._pendingRemoveRanges={video:[],audio:[]},this._idrList=new J}return Object(r.a)(e,[{key:"destroy",value:function(){(this._mediaElement||this._mediaSource)&&this.detachMediaElement(),this.e=null,this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(e,t){this._emitter.addListener(e,t)}},{key:"off",value:function(e,t){this._emitter.removeListener(e,t)}},{key:"attachMediaElement",value:function(e){if(this._mediaSource)throw new m("MediaSource has been attached to an HTMLMediaElement!");var t=this._mediaSource=new window.MediaSource;t.addEventListener("sourceopen",this.e.onSourceOpen),t.addEventListener("sourceended",this.e.onSourceEnded),t.addEventListener("sourceclose",this.e.onSourceClose),this._mediaElement=e,this._mediaSourceObjectURL=window.URL.createObjectURL(this._mediaSource),e.src=this._mediaSourceObjectURL}},{key:"detachMediaElement",value:function(){if(this._mediaSource){var e=this._mediaSource;for(var t in this._sourceBuffers){var n=this._pendingSegments[t];n.splice(0,n.length),this._pendingSegments[t]=null,this._pendingRemoveRanges[t]=null,this._lastInitSegments[t]=null;var i=this._sourceBuffers[t];if(i){if("closed"!==e.readyState){try{e.removeSourceBuffer(i)}catch(r){c.e(this.TAG,r.message)}i.removeEventListener("error",this.e.onSourceBufferError),i.removeEventListener("updateend",this.e.onSourceBufferUpdateEnd)}this._mimeTypes[t]=null,this._sourceBuffers[t]=null}}if("open"===e.readyState)try{e.endOfStream()}catch(r){c.e(this.TAG,r.message)}e.removeEventListener("sourceopen",this.e.onSourceOpen),e.removeEventListener("sourceended",this.e.onSourceEnded),e.removeEventListener("sourceclose",this.e.onSourceClose),this._pendingSourceBufferInit=[],this._isBufferFull=!1,this._idrList.clear(),this._mediaSource=null}this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement=null),this._mediaSourceObjectURL&&(window.URL.revokeObjectURL(this._mediaSourceObjectURL),this._mediaSourceObjectURL=null)}},{key:"appendInitSegment",value:function(e,t){if(!this._mediaSource||"open"!==this._mediaSource.readyState)return this._pendingSourceBufferInit.push(e),void this._pendingSegments[e.type].push(e);var n=e,i="".concat(n.container);n.codec&&n.codec.length>0&&(i+=";codecs=".concat(n.codec));var r=!1;if(c.v(this.TAG,"Received Initialization Segment, mimeType: "+i),this._lastInitSegments[n.type]=n,i!==this._mimeTypes[n.type]){if(this._mimeTypes[n.type])c.v(this.TAG,"Notice: ".concat(n.type," mimeType changed, origin: ").concat(this._mimeTypes[n.type],", target: ").concat(i));else{r=!0;try{var a=this._sourceBuffers[n.type]=this._mediaSource.addSourceBuffer(i);a.addEventListener("error",this.e.onSourceBufferError),a.addEventListener("updateend",this.e.onSourceBufferUpdateEnd)}catch(o){return c.e(this.TAG,o.message),void this._emitter.emit(ae.ERROR,{code:o.code,msg:o.message})}}this._mimeTypes[n.type]=i}t||this._pendingSegments[n.type].push(n),r||this._sourceBuffers[n.type]&&!this._sourceBuffers[n.type].updating&&this._doAppendSegments(),S.safari&&"audio/mpeg"===n.container&&n.mediaDuration>0&&(this._requireSetMediaDuration=!0,this._pendingMediaDuration=n.mediaDuration/1e3,this._updateMediaSourceDuration())}},{key:"appendMediaSegment",value:function(e){var t=e;this._pendingSegments[t.type].push(t),this._config.autoCleanupSourceBuffer&&this._needCleanupSourceBuffer()&&this._doCleanupSourceBuffer();var n=this._sourceBuffers[t.type];!n||n.updating||this._hasPendingRemoveRanges()||this._doAppendSegments()}},{key:"seek",value:function(e){for(var t in this._sourceBuffers)if(this._sourceBuffers[t]){var n=this._sourceBuffers[t];if("open"===this._mediaSource.readyState)try{n.abort()}catch(l){c.e(this.TAG,l.message)}this._idrList.clear();var i=this._pendingSegments[t];if(i.splice(0,i.length),"closed"!==this._mediaSource.readyState){for(var r=0;r=1&&e-i.start(0)>=this._config.autoCleanupMaxBackwardDuration)return!0}}return!1}},{key:"_doCleanupSourceBuffer",value:function(){var e=this._mediaElement.currentTime;for(var t in this._sourceBuffers){var n=this._sourceBuffers[t];if(n){for(var i=n.buffered,r=!1,a=0;a=this._config.autoCleanupMaxBackwardDuration){r=!0;var l=e-this._config.autoCleanupMinBackwardDuration;this._pendingRemoveRanges[t].push({start:o,end:l})}}else s0&&(isNaN(t)||n>t)&&(c.v(this.TAG,"Update MediaSource duration from ".concat(t," to ").concat(n)),this._mediaSource.duration=n),this._requireSetMediaDuration=!1,this._pendingMediaDuration=0}}},{key:"_doRemoveRanges",value:function(){for(var e in this._pendingRemoveRanges)if(this._sourceBuffers[e]&&!this._sourceBuffers[e].updating)for(var t=this._sourceBuffers[e],n=this._pendingRemoveRanges[e];n.length&&!t.updating;){var i=n.shift();t.remove(i.start,i.end)}}},{key:"_doAppendSegments",value:function(){var e=this._pendingSegments;for(var t in e)if(this._sourceBuffers[t]&&!this._sourceBuffers[t].updating&&e[t].length>0){var n=e[t].shift();if(n.timestampOffset){var i=this._sourceBuffers[t].timestampOffset,r=n.timestampOffset/1e3;Math.abs(i-r)>.1&&(c.v(this.TAG,"Update MPEG audio timestampOffset from ".concat(i," to ").concat(r)),this._sourceBuffers[t].timestampOffset=r),delete n.timestampOffset}if(!n.data||0===n.data.byteLength)continue;try{this._sourceBuffers[t].appendBuffer(n.data),this._isBufferFull=!1,"video"===t&&n.hasOwnProperty("info")&&this._idrList.appendArray(n.info.syncPoints)}catch(a){this._pendingSegments[t].unshift(n),22===a.code?(this._isBufferFull||this._emitter.emit(ae.BUFFER_FULL),this._isBufferFull=!0):(c.e(this.TAG,a.message),this._emitter.emit(ae.ERROR,{code:a.code,msg:a.message}))}}}},{key:"_onSourceOpen",value:function(){if(c.v(this.TAG,"MediaSource onSourceOpen"),this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._pendingSourceBufferInit.length>0)for(var e=this._pendingSourceBufferInit;e.length;){var t=e.shift();this.appendInitSegment(t,!0)}this._hasPendingSegments()&&this._doAppendSegments(),this._emitter.emit(ae.SOURCE_OPEN)}},{key:"_onSourceEnded",value:function(){c.v(this.TAG,"MediaSource onSourceEnded")}},{key:"_onSourceClose",value:function(){c.v(this.TAG,"MediaSource onSourceClose"),this._mediaSource&&null!=this.e&&(this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._mediaSource.removeEventListener("sourceended",this.e.onSourceEnded),this._mediaSource.removeEventListener("sourceclose",this.e.onSourceClose))}},{key:"_hasPendingSegments",value:function(){var e=this._pendingSegments;return e.video.length>0||e.audio.length>0}},{key:"_hasPendingRemoveRanges",value:function(){var e=this._pendingRemoveRanges;return e.video.length>0||e.audio.length>0}},{key:"_onSourceBufferUpdateEnd",value:function(){this._requireSetMediaDuration?this._updateMediaSourceDuration():this._hasPendingRemoveRanges()?this._doRemoveRanges():this._hasPendingSegments()?this._doAppendSegments():this._hasPendingEos&&this.endOfStream(),this._emitter.emit(ae.UPDATE_END)}},{key:"_onSourceBufferError",value:function(e){c.e(this.TAG,"SourceBuffer Error: ".concat(e))}}]),e}(),se={NETWORK_ERROR:"NetworkError",MEDIA_ERROR:"MediaError",OTHER_ERROR:"OtherError"},le={NETWORK_EXCEPTION:b.EXCEPTION,NETWORK_STATUS_CODE_INVALID:b.HTTP_STATUS_CODE_INVALID,NETWORK_TIMEOUT:b.CONNECTING_TIMEOUT,NETWORK_UNRECOVERABLE_EARLY_EOF:b.UNRECOVERABLE_EARLY_EOF,MEDIA_MSE_ERROR:"MediaMSEError",MEDIA_FORMAT_ERROR:G.FORMAT_ERROR,MEDIA_FORMAT_UNSUPPORTED:G.FORMAT_UNSUPPORTED,MEDIA_CODEC_UNSUPPORTED:G.CODEC_UNSUPPORTED},ue=function(){function e(t,n){if(Object(i.a)(this,e),this.TAG="FlvPlayer",this._type="FlvPlayer",this._emitter=new l.a,this._config=I(),"object"===typeof n&&Object.assign(this._config,n),"flv"!==t.type.toLowerCase())throw new g("FlvPlayer requires an flv MediaDataSource input!");!0===t.isLive&&(this._config.isLive=!0),this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this),onvSeeking:this._onvSeeking.bind(this),onvCanPlay:this._onvCanPlay.bind(this),onvStalled:this._onvStalled.bind(this),onvProgress:this._onvProgress.bind(this)},self.performance&&self.performance.now?this._now=self.performance.now.bind(self.performance):this._now=Date.now,this._pendingSeekTime=null,this._requestSetTime=!1,this._seekpointRecord=null,this._progressChecker=null,this._mediaDataSource=t,this._mediaElement=null,this._msectl=null,this._transmuxer=null,this._mseSourceOpened=!1,this._hasPendingLoad=!1,this._receivedCanPlay=!1,this._mediaInfo=null,this._statisticsInfo=null;var r=S.chrome&&(S.version.major<50||50===S.version.major&&S.version.build<2661);this._alwaysSeekKeyframe=!!(r||S.msedge||S.msie),this._alwaysSeekKeyframe&&(this._config.accurateSeek=!1)}return Object(r.a)(e,[{key:"destroy",value:function(){null!=this._progressChecker&&(window.clearInterval(this._progressChecker),this._progressChecker=null),this._transmuxer&&this.unload(),this._mediaElement&&this.detachMediaElement(),this.e=null,this._mediaDataSource=null,this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(e,t){var n=this;e===D.MEDIA_INFO?null!=this._mediaInfo&&Promise.resolve().then((function(){n._emitter.emit(D.MEDIA_INFO,n.mediaInfo)})):e===D.STATISTICS_INFO&&null!=this._statisticsInfo&&Promise.resolve().then((function(){n._emitter.emit(D.STATISTICS_INFO,n.statisticsInfo)})),this._emitter.addListener(e,t)}},{key:"off",value:function(e,t){this._emitter.removeListener(e,t)}},{key:"attachMediaElement",value:function(e){var t=this;if(this._mediaElement=e,e.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),e.addEventListener("seeking",this.e.onvSeeking),e.addEventListener("canplay",this.e.onvCanPlay),e.addEventListener("stalled",this.e.onvStalled),e.addEventListener("progress",this.e.onvProgress),this._msectl=new oe(this._config),this._msectl.on(ae.UPDATE_END,this._onmseUpdateEnd.bind(this)),this._msectl.on(ae.BUFFER_FULL,this._onmseBufferFull.bind(this)),this._msectl.on(ae.SOURCE_OPEN,(function(){t._mseSourceOpened=!0,t._hasPendingLoad&&(t._hasPendingLoad=!1,t.load())})),this._msectl.on(ae.ERROR,(function(e){t._emitter.emit(D.ERROR,se.MEDIA_ERROR,le.MEDIA_MSE_ERROR,e)})),this._msectl.attachMediaElement(e),null!=this._pendingSeekTime)try{e.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(n){}}},{key:"detachMediaElement",value:function(){this._mediaElement&&(this._msectl.detachMediaElement(),this._mediaElement.removeEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._mediaElement.removeEventListener("seeking",this.e.onvSeeking),this._mediaElement.removeEventListener("canplay",this.e.onvCanPlay),this._mediaElement.removeEventListener("stalled",this.e.onvStalled),this._mediaElement.removeEventListener("progress",this.e.onvProgress),this._mediaElement=null),this._msectl&&(this._msectl.destroy(),this._msectl=null)}},{key:"load",value:function(){var e=this;if(!this._mediaElement)throw new m("HTMLMediaElement must be attached before load()!");if(this._transmuxer)throw new m("FlvPlayer.load() has been called, please call unload() first!");this._hasPendingLoad||(this._config.deferLoadAfterSourceOpen&&!1===this._mseSourceOpened?this._hasPendingLoad=!0:(this._mediaElement.readyState>0&&(this._requestSetTime=!0,this._mediaElement.currentTime=0),this._transmuxer=new re(this._mediaDataSource,this._config),this._transmuxer.on(te.INIT_SEGMENT,(function(t,n){e._msectl.appendInitSegment(n)})),this._transmuxer.on(te.MEDIA_SEGMENT,(function(t,n){if(e._msectl.appendMediaSegment(n),e._config.lazyLoad&&!e._config.isLive){var i=e._mediaElement.currentTime;n.info.endDts>=1e3*(i+e._config.lazyLoadMaxDuration)&&null==e._progressChecker&&(c.v(e.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),e._suspendTransmuxer())}})),this._transmuxer.on(te.LOADING_COMPLETE,(function(){e._msectl.endOfStream(),e._emitter.emit(D.LOADING_COMPLETE)})),this._transmuxer.on(te.RECOVERED_EARLY_EOF,(function(){e._emitter.emit(D.RECOVERED_EARLY_EOF)})),this._transmuxer.on(te.IO_ERROR,(function(t,n){e._emitter.emit(D.ERROR,se.NETWORK_ERROR,t,n)})),this._transmuxer.on(te.DEMUX_ERROR,(function(t,n){e._emitter.emit(D.ERROR,se.MEDIA_ERROR,t,{code:-1,msg:n})})),this._transmuxer.on(te.MEDIA_INFO,(function(t){e._mediaInfo=t,e._emitter.emit(D.MEDIA_INFO,Object.assign({},t))})),this._transmuxer.on(te.METADATA_ARRIVED,(function(t){e._emitter.emit(D.METADATA_ARRIVED,t)})),this._transmuxer.on(te.SCRIPTDATA_ARRIVED,(function(t){e._emitter.emit(D.SCRIPTDATA_ARRIVED,t)})),this._transmuxer.on(te.STATISTICS_INFO,(function(t){e._statisticsInfo=e._fillStatisticsInfo(t),e._emitter.emit(D.STATISTICS_INFO,Object.assign({},e._statisticsInfo))})),this._transmuxer.on(te.RECOMMEND_SEEKPOINT,(function(t){e._mediaElement&&!e._config.accurateSeek&&(e._requestSetTime=!0,e._mediaElement.currentTime=t/1e3)})),this._transmuxer.open()))}},{key:"unload",value:function(){this._mediaElement&&this._mediaElement.pause(),this._msectl&&this._msectl.seek(0),this._transmuxer&&(this._transmuxer.close(),this._transmuxer.destroy(),this._transmuxer=null)}},{key:"play",value:function(){return this._mediaElement.play()}},{key:"pause",value:function(){this._mediaElement.pause()}},{key:"_fillStatisticsInfo",value:function(e){if(e.playerType=this._type,!(this._mediaElement instanceof HTMLVideoElement))return e;var t=!0,n=0,i=0;if(this._mediaElement.getVideoPlaybackQuality){var r=this._mediaElement.getVideoPlaybackQuality();n=r.totalVideoFrames,i=r.droppedVideoFrames}else void 0!=this._mediaElement.webkitDecodedFrameCount?(n=this._mediaElement.webkitDecodedFrameCount,i=this._mediaElement.webkitDroppedFrameCount):t=!1;return t&&(e.decodedFrames=n,e.droppedFrames=i),e}},{key:"_onmseUpdateEnd",value:function(){if(this._config.lazyLoad&&!this._config.isLive){for(var e=this._mediaElement.buffered,t=this._mediaElement.currentTime,n=0,i=0;i=t+this._config.lazyLoadMaxDuration&&null==this._progressChecker&&(c.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}}},{key:"_onmseBufferFull",value:function(){c.v(this.TAG,"MSE SourceBuffer is full, suspend transmuxing task"),null==this._progressChecker&&this._suspendTransmuxer()}},{key:"_suspendTransmuxer",value:function(){this._transmuxer&&(this._transmuxer.pause(),null==this._progressChecker&&(this._progressChecker=window.setInterval(this._checkProgressAndResume.bind(this),1e3)))}},{key:"_checkProgressAndResume",value:function(){for(var e=this._mediaElement.currentTime,t=this._mediaElement.buffered,n=!1,i=0;i=r&&e=a-this._config.lazyLoadRecoverDuration&&(n=!0);break}}n&&(window.clearInterval(this._progressChecker),this._progressChecker=null,n&&(c.v(this.TAG,"Continue loading from paused position"),this._transmuxer.resume()))}},{key:"_isTimepointBuffered",value:function(e){for(var t=this._mediaElement.buffered,n=0;n=i&&e0){var r=this._mediaElement.buffered.start(0);(r<1&&e0&&t.currentTime0){var i=n.start(0);if(i<1&&t0&&(this._mediaElement.currentTime=0),this._mediaElement.preload="auto",this._mediaElement.load(),this._statisticsReporter=window.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval)}},{key:"unload",value:function(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src")),null!=this._statisticsReporter&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}},{key:"play",value:function(){return this._mediaElement.play()}},{key:"pause",value:function(){this._mediaElement.pause()}},{key:"_onvLoadedMetadata",value:function(e){null!=this._pendingSeekTime&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null),this._emitter.emit(D.MEDIA_INFO,this.mediaInfo)}},{key:"_reportStatisticsInfo",value:function(){this._emitter.emit(D.STATISTICS_INFO,this.statisticsInfo)}},{key:"type",get:function(){return this._type}},{key:"buffered",get:function(){return this._mediaElement.buffered}},{key:"duration",get:function(){return this._mediaElement.duration}},{key:"volume",get:function(){return this._mediaElement.volume},set:function(e){this._mediaElement.volume=e}},{key:"muted",get:function(){return this._mediaElement.muted},set:function(e){this._mediaElement.muted=e}},{key:"currentTime",get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(e){this._mediaElement?this._mediaElement.currentTime=e:this._pendingSeekTime=e}},{key:"mediaInfo",get:function(){var e={mimeType:(this._mediaElement instanceof HTMLAudioElement?"audio/":"video/")+this._mediaDataSource.type};return this._mediaElement&&(e.duration=Math.floor(1e3*this._mediaElement.duration),this._mediaElement instanceof HTMLVideoElement&&(e.width=this._mediaElement.videoWidth,e.height=this._mediaElement.videoHeight)),e}},{key:"statisticsInfo",get:function(){var e={playerType:this._type,url:this._mediaDataSource.url};if(!(this._mediaElement instanceof HTMLVideoElement))return e;var t=!0,n=0,i=0;if(this._mediaElement.getVideoPlaybackQuality){var r=this._mediaElement.getVideoPlaybackQuality();n=r.totalVideoFrames,i=r.droppedVideoFrames}else void 0!=this._mediaElement.webkitDecodedFrameCount?(n=this._mediaElement.webkitDecodedFrameCount,i=this._mediaElement.webkitDroppedFrameCount):t=!1;return t&&(e.decodedFrames=n,e.droppedFrames=i),e}}]),e}();o.install();var de={createPlayer:function(e,t){var n=e;if(null==n||"object"!==typeof n)throw new g("MediaDataSource must be an javascript object!");if(!n.hasOwnProperty("type"))throw new g("MediaDataSource must has type field to indicate video file type!");switch(n.type){case"flv":return new ue(n,t);default:return new ce(n,t)}},isSupported:function(){return M.supportMSEH264Playback()},getFeatureList:function(){return M.getFeatureList()}};de.BaseLoader=_,de.LoaderStatus=y,de.LoaderErrors=b,de.Events=D,de.ErrorTypes=se,de.ErrorDetails=le,de.FlvPlayer=ue,de.NativePlayer=ce,de.LoggingControl=j,Object.defineProperty(de,"version",{enumerable:!0,get:function(){return"__VERSION__"}});t.a=de},,function(e,t,n){"use strict";var i=n(27),r="function"===typeof Symbol&&Symbol.for,a=r?Symbol.for("react.element"):60103,o=r?Symbol.for("react.portal"):60106,s=r?Symbol.for("react.fragment"):60107,l=r?Symbol.for("react.strict_mode"):60108,u=r?Symbol.for("react.profiler"):60114,c=r?Symbol.for("react.provider"):60109,d=r?Symbol.for("react.context"):60110,f=r?Symbol.for("react.forward_ref"):60112,h=r?Symbol.for("react.suspense"):60113,p=r?Symbol.for("react.memo"):60115,m=r?Symbol.for("react.lazy"):60116,g="function"===typeof Symbol&&Symbol.iterator;function v(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;nR.length&&R.push(e)}function I(e,t,n){return null==e?0:function e(t,n,i,r){var s=typeof t;"undefined"!==s&&"boolean"!==s||(t=null);var l=!1;if(null===t)l=!0;else switch(s){case"string":case"number":l=!0;break;case"object":switch(t.$$typeof){case a:case o:l=!0}}if(l)return i(r,t,""===n?"."+M(t,0):n),1;if(l=0,n=""===n?".":n+":",Array.isArray(t))for(var u=0;u