static.kuangkie.pc.bundle.c774df7f00e7f52fd072.js Maven / Gradle / Ivy
/*! For license information please see bundle.c774df7f00e7f52fd072.js.LICENSE.txt */
(self.webpackChunkaldehyde=self.webpackChunkaldehyde||[]).push([[441],{27065:function(e,t,r){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var a=n(r(69887)),i=n(r(69272));function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function s(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function l(e){for(var t=1;t0&&(s[l]=c)}else{var p=(0,n.default)(o,l,u,s,t);p&&(s[l]=p),s=(0,r.default)(t,l,s)}}return s}};var r=o(k),n=o(L),a=o(T),i=o(w);function o(e){return e&&e.__esModule?e:{default:e}}})),R=E(A),x=S((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if("string"==typeof t&&"text"===t)return["-webkit-text","text"]}})),C=E(x),O=S((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return"string"==typeof e&&r.test(e)};var r=/-webkit-|-moz-|-ms-/;e.exports=t.default}));E(O);var P=S((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if("string"==typeof t&&!(0,n.default)(t)&&t.indexOf("calc(")>-1)return a.map((function(e){return t.replace(/calc\(/g,e+"calc(")}))};var r,n=(r=O)&&r.__esModule?r:{default:r},a=["-webkit-","-moz-",""]})),D=E(P),M=S((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if("string"==typeof t&&!(0,n.default)(t)&&t.indexOf("cross-fade(")>-1)return a.map((function(e){return t.replace(/cross-fade\(/g,e+"cross-fade(")}))};var r,n=(r=O)&&r.__esModule?r:{default:r},a=["-webkit-",""]})),B=E(M),I=S((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if("cursor"===e&&n.hasOwnProperty(t))return r.map((function(e){return e+t}))};var r=["-webkit-","-moz-",""],n={"zoom-in":!0,"zoom-out":!0,grab:!0,grabbing:!0}})),F=E(I),N=S((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if("string"==typeof t&&!(0,n.default)(t)&&t.indexOf("filter(")>-1)return a.map((function(e){return t.replace(/filter\(/g,e+"filter(")}))};var r,n=(r=O)&&r.__esModule?r:{default:r},a=["-webkit-",""]})),U=E(N),j=S((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if("display"===e&&r.hasOwnProperty(t))return r[t]};var r={flex:["-webkit-box","-moz-box","-ms-flexbox","-webkit-flex","flex"],"inline-flex":["-webkit-inline-box","-moz-inline-box","-ms-inline-flexbox","-webkit-inline-flex","inline-flex"]}})),G=E(j),z=S((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,o){if(Object.prototype.hasOwnProperty.call(n,e)&&(o[n[e]]=r[t]||t),"flex"===e){if(Object.prototype.hasOwnProperty.call(a,t))return void(o.msFlex=a[t]);if(i.test(t))return void(o.msFlex=t+" 1 0%");var s=t.split(/\s/);switch(s.length){case 1:return void(o.msFlex="1 1 "+t);case 2:return void(i.test(s[1])?o.msFlex=s[0]+" "+s[1]+" 0%":o.msFlex=s[0]+" 1 "+s[1]);default:o.msFlex=t}}};var r={"space-around":"distribute","space-between":"justify","flex-start":"start","flex-end":"end"},n={alignContent:"msFlexLinePack",alignSelf:"msFlexItemAlign",alignItems:"msFlexAlign",justifyContent:"msFlexPack",order:"msFlexOrder",flexGrow:"msFlexPositive",flexShrink:"msFlexNegative",flexBasis:"msFlexPreferredSize"},a={auto:"1 1 auto",inherit:"inherit",initial:"0 1 auto",none:"0 0 auto",unset:"unset"},i=/^\d+(\.\d+)?$/})),W=E(z),H=S((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,a){"flexDirection"===e&&"string"==typeof t&&(t.indexOf("column")>-1?a.WebkitBoxOrient="vertical":a.WebkitBoxOrient="horizontal",t.indexOf("reverse")>-1?a.WebkitBoxDirection="reverse":a.WebkitBoxDirection="normal"),n.hasOwnProperty(e)&&(a[n[e]]=r[t]||t)};var r={"space-around":"justify","space-between":"justify","flex-start":"start","flex-end":"end","wrap-reverse":"multiple",wrap:"multiple"},n={alignItems:"WebkitBoxAlign",justifyContent:"WebkitBoxPack",flexWrap:"WebkitBoxLines",flexGrow:"WebkitBoxFlex"}})),V=E(H),q=S((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if("string"==typeof t&&!(0,n.default)(t)&&i.test(t))return a.map((function(e){return t.replace(i,(function(t){return e+t}))}))};var r,n=(r=O)&&r.__esModule?r:{default:r},a=["-webkit-","-moz-",""],i=/linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient/gi})),K=E(q),Y=S((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var r=[],n=!0,a=!1,i=void 0;try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done)&&(r.push(o.value),!t||r.length!==t);n=!0);}catch(e){a=!0,i=e}finally{try{!n&&s.return&&s.return()}finally{if(a)throw i}}return r}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};function n(e){return"number"==typeof e&&!isNaN(e)}t.default=function(e,t,r){if("display"===e&&t in i)return i[t];e in o&&(0,o[e])(t,r)};var a=["center","end","start","stretch"],i={"inline-grid":["-ms-inline-grid","inline-grid"],grid:["-ms-grid","grid"]},o={alignSelf:function(e,t){a.indexOf(e)>-1&&(t.msGridRowAlign=e)},gridColumn:function(e,t){if(n(e))t.msGridColumn=e;else{var a=e.split("/").map((function(e){return+e})),i=r(a,2),s=i[0],l=i[1];o.gridColumnStart(s,t),o.gridColumnEnd(l,t)}},gridColumnEnd:function(e,t){var r=t.msGridColumn;n(e)&&n(r)&&(t.msGridColumnSpan=e-r)},gridColumnStart:function(e,t){n(e)&&(t.msGridColumn=e)},gridRow:function(e,t){if(n(e))t.msGridRow=e;else{var a=e.split("/").map((function(e){return+e})),i=r(a,2),s=i[0],l=i[1];o.gridRowStart(s,t),o.gridRowEnd(l,t)}},gridRowEnd:function(e,t){var r=t.msGridRow;n(e)&&n(r)&&(t.msGridRowSpan=e-r)},gridRowStart:function(e,t){n(e)&&(t.msGridRow=e)},gridTemplateColumns:function(e,t){t.msGridColumns=e},gridTemplateRows:function(e,t){t.msGridRows=e},justifySelf:function(e,t){a.indexOf(e)>-1&&(t.msGridColumnAlign=e)}}})),Q=E(Y),X=S((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if("string"==typeof t&&!(0,n.default)(t)&&t.indexOf("image-set(")>-1)return a.map((function(e){return t.replace(/image-set\(/g,e+"image-set(")}))};var r,n=(r=O)&&r.__esModule?r:{default:r},a=["-webkit-",""]})),$=E(X),Z=S((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){if(Object.prototype.hasOwnProperty.call(r,e))for(var a=r[e],i=0,o=a.length;i-1&&"order"!==d)for(var f=t[c],h=0,p=f.length;h-1)return c;var d=u.split(/,(?![^()]*(?:\([^()]*\))?\))/g).filter((function(e){return!/-webkit-|-ms-/.test(e)})).join(",");return e.indexOf("Moz")>-1?d:(i["Webkit"+(0,a.default)(e)]=c,i["Moz"+(0,a.default)(e)]=d,u)}};var r=i(ce),n=i(O),a=i(_);function i(e){return e&&e.__esModule?e:{default:e}}var o={transition:!0,transitionProperty:!0,WebkitTransition:!0,WebkitTransitionProperty:!0,MozTransition:!0,MozTransitionProperty:!0},s={Webkit:"-webkit-",Moz:"-moz-",ms:"-ms-"}})),fe=["Webkit"],he=["Moz"],pe=["ms"],ve=["Webkit","Moz"],ge=["Webkit","ms"],me=["Webkit","Moz","ms"],ye=R({plugins:[C,D,B,F,U,G,W,V,K,Q,$,J,te,ne,E(de)],prefixMap:{transform:ge,transformOrigin:ge,transformOriginX:ge,transformOriginY:ge,backfaceVisibility:fe,perspective:fe,perspectiveOrigin:fe,transformStyle:fe,transformOriginZ:fe,animation:fe,animationDelay:fe,animationDirection:fe,animationFillMode:fe,animationDuration:fe,animationIterationCount:fe,animationName:fe,animationPlayState:fe,animationTimingFunction:fe,appearance:ve,userSelect:me,fontKerning:fe,textEmphasisPosition:fe,textEmphasis:fe,textEmphasisStyle:fe,textEmphasisColor:fe,boxDecorationBreak:fe,clipPath:fe,maskImage:fe,maskMode:fe,maskRepeat:fe,maskPosition:fe,maskClip:fe,maskOrigin:fe,maskSize:fe,maskComposite:fe,mask:fe,maskBorderSource:fe,maskBorderMode:fe,maskBorderSlice:fe,maskBorderWidth:fe,maskBorderOutset:fe,maskBorderRepeat:fe,maskBorder:fe,maskType:fe,textDecorationStyle:ve,textDecorationSkip:ve,textDecorationLine:ve,textDecorationColor:ve,filter:fe,fontFeatureSettings:ve,breakAfter:me,breakBefore:me,breakInside:me,columnCount:ve,columnFill:ve,columnGap:ve,columnRule:ve,columnRuleColor:ve,columnRuleStyle:ve,columnRuleWidth:ve,columns:ve,columnSpan:ve,columnWidth:ve,writingMode:ge,flex:ge,flexBasis:fe,flexDirection:ge,flexGrow:fe,flexFlow:ge,flexShrink:fe,flexWrap:ge,alignContent:fe,alignItems:fe,alignSelf:fe,justifyContent:fe,order:fe,transitionDelay:fe,transitionDuration:fe,transitionProperty:fe,transitionTimingFunction:fe,backdropFilter:fe,scrollSnapType:ge,scrollSnapPointsX:ge,scrollSnapPointsY:ge,scrollSnapDestination:ge,scrollSnapCoordinate:ge,shapeImageThreshold:fe,shapeImageMargin:fe,shapeImageOutside:fe,hyphens:me,flowInto:ge,flowFrom:ge,regionFragment:ge,textOrientation:fe,boxSizing:he,textAlignLast:he,tabSize:he,wrapFlow:pe,wrapThrough:pe,wrapMargin:pe,touchAction:pe,textSizeAdjust:ge,borderImage:fe,borderImageOutset:fe,borderImageRepeat:fe,borderImageSlice:fe,borderImageSource:fe,borderImageWidth:fe}}),be=[function(e,t,r){return":"!==e[0]?null:r(t+e)},function(e,t,r){if("@"!==e[0])return null;var n=r(t);return["".concat(e,"{").concat(n.join(""),"}")]}],Ee=function e(t,r,n,a,i){for(var o=new b,s=0;s4&&void 0!==arguments[4]?arguments[4]:[];if(!we[e]){var i=Ee(t,r,a,Te,n);xe(e,i)}},Oe=function(){Ae=[],we={},Re=!1,Le=null},Pe=function(e){delete we[e]},De=function(){Re=!1;var e=Ae;return Ae=[],e},Me=function(){var e=De();e.length>0&&function(e){if(null==Le&&null==(Le=document.querySelector("style[data-aphrodite]"))){var t=document.head||document.getElementsByTagName("head")[0];(Le=document.createElement("style")).type="text/css",Le.setAttribute("data-aphrodite",""),t.appendChild(Le)}var r=Le.styleSheet||Le.sheet;if(r.insertRule){var n=r.cssRules.length;e.forEach((function(e){try{r.insertRule(e,n),n+=1}catch(e){}}))}else Le.innerText=(Le.innerText||"")+e.join("")}(e)},Be=function e(t,r,n,a){for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:[]).forEach((function(e){we[e]=!0}))}},je="undefined"!=typeof window?null:{renderStatic:function(e){return Oe(),function(){if(Re)throw new Error("Cannot buffer while already buffering");Re=!0}(),{html:e(),css:{content:De().join(""),renderedClassNames:Object.keys(we)}}}};t.makeExports=function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:be;return{StyleSheet:l({},Ue,{extend:function(n){var a=n.map((function(e){return e.selectorHandler})).filter((function(e){return e}));return e(t,r.concat(a))}}),StyleSheetServer:je,StyleSheetTestUtils:null,minify:function(e){Ne=e?g:Fe},css:function(){for(var e=arguments.length,n=new Array(e),a=0;a1024){for(var t=0,r=i.length-o;t=7,f=function(){var e=i.createElement("video"),t={request:["requestFullscreen","webkitRequestFullscreen","webkitRequestFullScreen","mozRequestFullScreen","msRequestFullscreen"],exit:["exitFullscreen","webkitCancelFullScreen","webkitExitFullscreen","mozCancelFullScreen","msExitFullscreen"],enabled:["fullscreenEnabled","webkitFullscreenEnabled","mozFullScreenEnabled","msFullscreenEnabled"],element:["fullscreenElement","webkitFullscreenElement","webkitCurrentFullScreenElement","mozFullScreenElement","msFullscreenElement"],change:["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],error:["fullscreenerror","webkitfullscreenerror","mozfullscreenerror","MSFullscreenError"]},r={};for(var n in t)for(var a=0,o=t[n].length;o>a;a++)if(t[n][a]in e||t[n][a]in i||"on"+t[n][a].toLowerCase()in i){r[n]=t[n][a];break}return r}(),h=null,p=null,v=function(){},g=[],m=!1;navigator.userAgent.indexOf("Android")>-1&&navigator.userAgent.indexOf("Chrome")>-1&&(m=parseInt(navigator.userAgent.replace(/^.*Chrome\/(\d+).*$/,"$1"),10)||!0);var y=function(e){var t=g[g.length-1];t&&(e!==t.element&&e!==h||!t.hasEntered)&&("VIDEO"===e.tagName&&(h=e),1===g.length&&S.onenter(S.element),t.enter.call(t.element,e||t.element),t.hasEntered=!0)},b=function(){!h||p||d||(h.setAttribute("controls","controls"),h.removeAttribute("controls")),h=null,p=null;var e=g.pop();e&&(e.exit.call(e.element),S.element||(g.forEach((function(e){e.exit.call(e.element)})),g=[],S.onexit()))},E=function(e,t){if(g.length>0){var r=g.pop();t=t||r.element,r.error.call(t,e),S.onerror(t,e)}},S={request:function(e,t,r,n){if(e=e||i.body,g.push({element:e,enter:t||v,exit:r||v,error:n||v}),void 0!==f.request)if(o&&!1===i[f.enabled])l(e);else if(!1!==m&&32>m)l(e);else{if(o&&void 0===f.enabled)return f.enabled="webkitFullscreenEnabled",e[f.request](),void setTimeout((function(){i[f.element]?i[f.enabled]=!0:(i[f.enabled]=!1,l(e))}),250);try{e[f.request](),setTimeout((function(){i[f.element]||E(o?"not_enabled":"not_allowed",e)}),100)}catch(t){E("not_enabled",e)}}else l(e)},exit:function(){c(),i[f.exit]()},toggle:function(e,t,r,n){S.element?S.exit():S.request(e,t,r,n)},videoEnabled:function(e){if(S.enabled)return!0;var t=s(e=e||i.body);return!(!t||void 0===t.webkitSupportsFullscreen)&&(t.readyStatem)&&(i[f.enabled]||!1)}}}),f.change&&i.addEventListener(f.change,(function(e){if(S.onchange(S.element),S.element){var t=g[g.length-2];t&&t.element===S.element?b():(y(S.element),o&&"webkitfullscreenchange"===f.change&&window.addEventListener("resize",u,!1))}else b()}),!1),i.addEventListener("webkitbeginfullscreen",(function(e){var t=!0;if(g.length>0)for(var r=0,n=g.length;n>r;r++)if(s(g[r].element)===e.srcElement){t=!1;break}t&&g.push({element:e.srcElement,enter:v,exit:v,error:v}),S.onchange(e.srcElement),y(e.srcElement)}),!0),i.addEventListener("webkitendfullscreen",(function(e){S.onchange(e.srcElement),b(e.srcElement)}),!0),f.error&&i.addEventListener(f.error,(function(e){E("not_allowed")}),!1)}catch(e){S.element=null,S.enabled=!1}void 0===(n=function(){return S}.call(t,r,t,e))||(e.exports=n)}(0,document,self!==top)},26729:function(e){"use strict";var t=Object.prototype.hasOwnProperty,r="~";function n(){}function a(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function i(e,t,n,i,o){if("function"!=typeof n)throw new TypeError("The listener must be a function");var s=new a(n,i||e,o),l=r?r+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],s]:e._events[l].push(s):(e._events[l]=s,e._eventsCount++),e}function o(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function s(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(r=!1)),s.prototype.eventNames=function(){var e,n,a=[];if(0===this._eventsCount)return a;for(n in e=this._events)t.call(e,n)&&a.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?a.concat(Object.getOwnPropertySymbols(e)):a},s.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var a=0,i=n.length,o=new Array(i);a{const r={"PROGRAM-ID":"1",BANDWIDTH:String(e.bandwidth)};if(e.resolution){const{width:t,height:n}=e.resolution;r.RESOLUTION=`${t}x${n}`}t.push(`#EXT-X-STREAM-INF:${Object.entries(r).map((([e,t])=>`${e}=${t}`)).join(",")}`),t.push(e.source)})),t.join("\n")}class O extends m.Component{constructor(){super(...arguments),this.video=null,this.manuallyBuildAdaptiveM3U8Blob=!1,this.hasLoadStarted=!1}componentDidMount(){const{src:e,sources:t,useAutoQuality:r}=this.props;this.hls=new(x())({autoStartLoad:!1}),this.hls.attachMedia(this.video);const n=Boolean(t.find((e=>"auto"===e.quality)));if(r&&!n){const e=(e=>{const t=e.map((e=>({source:e.source,bandwidth:1024*e.bitrate,resolution:{width:e.width,height:e.height}})));return new Blob([C(t)],{type:"application/vnd.apple.mpegURL"})})(t);this.src=URL.createObjectURL(e),this.manuallyBuildAdaptiveM3U8Blob=!0}else this.src=e;this.hls.loadSource(this.src)}componentDidUpdate(e){const{currentQuality:t,sources:r,paused:n,src:a}=this.props;if(this.hls){if(t!==e.currentQuality||e.src!==a){const e=r.find((e=>e.quality===t));if(e)if(this.manuallyBuildAdaptiveM3U8Blob){const t=this.hls.levels.findIndex((t=>t.url.includes(e.source)));this.hls.nextLevel=t}else{const t=this.video.currentTime;this.hls.destroy(),this.hls=new(x())({autoStartLoad:!1}),this.hls.attachMedia(this.video),this.hls.loadSource(e.source),this.video.currentTime=t,this.hls.startLoad(),n||this.video.play()}else this.hls.nextLevel=-1}n||!e.paused||this.hasLoadStarted||(this.hls.startLoad(),this.hasLoadStarted=!0)}}componentWillUnmount(){this.hls.destroy(),this.manuallyBuildAdaptiveM3U8Blob&&URL.revokeObjectURL(this.src)}render(){const e=this.props,{onRef:t,currentQuality:r,useAutoQuality:n,src:a,sources:i,paused:o}=e,s=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a{t&&t(e),this.video=e}},s))}}var P={pluginName:"griffith-hls",VideoComponent:O,willHandleSrcChange:!0},D=r(50361),M=r.n(D);class B{constructor(e,t,r,n){this.remove=()=>{B.queue=B.queue.filter((e=>e.start!==this.start))},this.start=t,B.queue.push(this);const a=new XMLHttpRequest;this.xhr=a,a.open("get",e),a.responseType="arraybuffer",a.setRequestHeader("Range",`bytes=${t}-${r}`),a.onload=()=>{200!==a.status&&206!==a.status||n(a.response),this.remove()},a.send(),a.onerror=()=>{this.remove()},a.onabort=()=>{this.remove()}}static clear(){for(;B.queue.length;)B.queue.shift().xhr.abort()}}B.queue=[];class I{constructor(e){this.buffer=e,this.position=0}readType(e=4){const t=[];for(let r=0;r>>0}readTwoByte(){return(this.buffer[this.position++]<<8|this.buffer[this.position++])>>>0}readThreeByte(){return(this.buffer[this.position++]<<16|this.buffer[this.position++]<<8|this.buffer[this.position++])>>>0}readFourByte(){return(this.buffer[this.position++]<<24|this.buffer[this.position++]<<16|this.buffer[this.position++]<<8|this.buffer[this.position++])>>>0}}const F=[null,null,null,"ESDescrTag","DecoderConfigDescrTag","DecSpecificDescrTag"];function N(e){const t={};let r=e.readByte(1);return 128===r?(e.readByte(2),r=e.readByte(1)+5):r+=2,t.size=r,t.ESID=e.readByte(2),t.streamPriority=e.readByte(1),t[F[e.readByte(1)]]=function(e){const t={};let r=e.readByte(1);128===r?(e.readByte(2),r=e.readByte(1)+5):r+=2,t.size=r,t.objectTypeIndication=e.readByte(1);const n=e.readByte(1);return t.streamType=127&n,t.upStream=2&n,t.bufferSize=e.readByte(3),t.maxBitrate=e.readByte(4),t.avgBitrate=e.readByte(4),t}(e),t[F[e.readByte(1)]]=function(e){const t={};let r=e.readByte(1),n=r;128===r?(e.readByte(2),r=e.readByte(1)+5,n=r-5):r+=2,t.size=r;const a=[];for(let t=0;tNumber(`0x${e}`))),t}(e),t}var U={ftyp:function(e){const t=new I(e),r=t.readType(),n=t.readByte(4),a=[];for(let r=t.position;r>10&31,u[1]=l>>5&31,u[2]=31&l;const c=String.fromCharCode(96+u[0],96+u[1],96+u[2]);return t.readByte(2),{version:r,flags:n,creationTime:a,modificationTime:i,timescale:o,duration:s,languageString:c}},hdlr:function(e){const t=new I(e),r=t.readByte(1),n=t.readByte(3);t.readByte(4);const a=t.readType().toString(),i=t.readType().toString();t.readByte(4),t.readByte(4);const o=[];let s;for(;0!==(s=t.readByte(1));)o.push(String.fromCharCode(s));return{version:r,flags:n,handlerType:a,handlerType2:i||0,name:o.join("")}},vmhd:function(e){const t=new I(e);return{version:t.readByte(1),flags:t.readByte(3),graphicsmode:t.readByte(2),opcolor:new Array(3).fill(t.readByte(2))}},dref:function(e){const t=new I(e),r=t.readByte(1),n=t.readByte(3),a=t.readByte(4),i=[],o=t.buffer.slice(8),s=new I(o),l=new z;for(let e=0;e>6,dependsOn:e>>4&3,isDepended:e>>2&3,hasRedundancy:3&e})}return{version:r,flags:n,samplesFlag:a}},thmb:function(e){return{data:new I(e).readByte(e.length)}}};const j=["moov","trak","edts","mdia","minf","dinf","stbl"],G=["udta","free"];class z{constructor(){this.size=0,this.type="",this.start=0,this.box={}}readSize(e){this.start=e.position,this.size=e.readByte(4)}readType(e){this.type=e.readType(),1===this.size&&(this.size=e.readByte(4)<<32,this.size|=e.readByte(4))}readBody(e){this.data=e.buffer.slice(e.position,this.size+this.start),j.find((e=>e===this.type))||G.find((e=>e===this.type))?this.parserContainerBox():U[this.type]?this.box=Object.assign(Object.assign({},this.box),U[this.type](this.data)):this.box={},e.position+=this.data.length}parserContainerBox(){const e=new I(this.data),t=e.buffer.length;for(;e.position=n?(1!==e.samples[n-1]&&(a=a+e.samples[n-1].samplesPerChunk-1),r.push(e.samples[n-1].samplesPerChunk)):r.push(e.samples[a].samplesPerChunk);return r}function J(e,t,r){let n=0;const a=Z(M()(V(e,"video"===r?"videoStsc":"audioStsc")),t);let i=0;for(let e=0;t>0&&e<=a.length;e++){if(n+=a[e],n===t){i=e+1;break}if(n>t){n-=a[e],i=e;break}}const o=[n,t];let s=0;const l=V(e,"video"===r?"videoStsz":"audioStsz").samples.slice(o[0],o[1]);for(let e=0;e=u.samples.length?Number.MAX_SAFE_INTEGER:u.samples[i].chunkOffset+s}function ee(e,t,[r,n],a){const i=[],o=V(e,a?"videoStts":"audioStts"),s=V(e,a?"videoStsz":"audioStsz"),l=V(e,a?"videoStco":"audioStco"),u=Z(M()(V(e,a?"videoStsc":"audioStsc")),n),c=function(e,t){const r=[];for(let n=0,a=0;n=e.samples.length);n++)if(r.push(e.samples[n+a].entrySize),1!==t[n]){for(let i=1;id[r-1]?e+1<=t.sampleCount&&e+1>d[r-1].sampleCount:e+1<=t.sampleCount)).sampleDelta;i.push(Object.assign(Object.assign({},a&&{compositionTimeOffset:a.length?a[e]:0}),{duration:l,size:r,start:o,end:n,bufferStart:t}))}return i}function te(e,t){let r=0,n=0;for(let a=0;ae.sampleNumber-1));else for(let e=0;e<=Math.floor(t.samples.length/5);e++)r.push(5*e);return r}class ne{constructor(e){this.updateInterval=e=>{const{videoTimescale:t,audioTimescale:r}=this.mp4Data;this.videoInterval="number"==typeof e?function(e,t=0){const r=M()(V(e,"videoStss")),n=M()(V(e,"videoStts")),a=V(e,"videoStsz"),i=te(n,a.samples.length),o=re(r,a),s=o.map((e=>te(n,e))),l={offsetInterVal:[],timeInterVal:[]};for(let e=0;ete(n,e)));let u=[];t+1>s[s.length-1]&&(u={offsetInterVal:[s[s.length-1],i],timeInterVal:[l[s.length-1],o]});for(let e=0;e=t+1){u={offsetInterVal:[s[e],s[e+1]],timeInterVal:[l[e],l[e+1]]};break}return u}(this.mp4BoxTree,this.videoInterval.offsetInterVal[1]),this.audioInterval=function(e,t){const{timeInterVal:[r,n],offsetInterVal:a}=t,i=M()(V(e,"audioStts")),{timescale:o}=V(e,"audioMdhd"),{timescale:s}=V(e,"videoMdhd"),l=V(e,"videoStsz"),u=V(e,"audioStsz"),c=V(e,"audioElst"),d=r/s*o,f=n/s*o;let h=0,p=0;const{mediaTime:v,segmentDuration:g}=c.entries[0];let m,y=-1!==v?v:g,b=0;for(let e=0;ee/t)),a=this.audioInterval.timeInterVal.map((e=>e/r));this.timeRange=[Math.min(n[0],a[0]),Math.max(n[1],a[1])]},this.isDraining=e=>e>(this.timeRange[1]-this.timeRange[0])/4+this.timeRange[0],this.getFragmentPosition=e=>{this.updateInterval(e),this.bufferStart=function(e,t=0,r=0){return Math.min(J(e,t,"video"),J(e,r,"audio"))}(this.mp4BoxTree,this.videoInterval.offsetInterVal[0],this.audioInterval.offsetInterVal[0]);const{videoSamples:t,audioSamples:r}=this.getSamples(),n=V(this.mp4BoxTree,"videoStco");let a=0;t.length>0&&(a=t[t.length-1].start);const i=a+t[t.length-1].bufferStart===n.samples[n.samples.length-1].chunkOffset;return function(e,t,r,n){const a=e[e.length-1].end;let i=0;e.length>0&&(i=e[0].start);let o=0,s=Number.MAX_SAFE_INTEGER;0!==t.length&&(o=t[t.length-1].end,s=t[0].start);const l=n?"":Math.max(a,o)+r;return[Math.min(i,s)+r,l]}(t,r,this.bufferStart,i)},this.getSamples=()=>{const e=function(e,t,r){const n=M()(V(e,"videoCtts")),a=[];if(n)for(let e=0;e{const{videoSamples:t,audioSamples:r}=this.getSamples(),n=function(e,t){return{samples:e.map((e=>Object.assign(Object.assign({},e),{buffer:t.slice(e.start,e.end)}))),trackId:1}}(t,e),a=function(e,t){return{samples:e.map((e=>Object.assign(Object.assign({},e),{buffer:t.slice(e.start,e.end)}))),trackId:2}}(r,e);return{videoTrackInfo:n,audioTrackInfo:a}},this.mp4BoxTree=e,this.mp4Data={},this.init()}init(){this.getMP4Data()}getMP4Data(){const{duration:e,timescale:t}=V(this.mp4BoxTree,"mvhd"),{channelCount:r,sampleRate:n}=V(this.mp4BoxTree,"mp4a"),{timescale:a,duration:i}=V(this.mp4BoxTree,"audioMdhd"),{ESDescrTag:{DecSpecificDescrTag:{audioConfig:o}}}=V(this.mp4BoxTree,"esds");if(this.mp4Data={duration:e,timescale:t,channelCount:r,sampleRate:n,audioConfig:o,audioDuration:i,audioTimescale:a},V(this.mp4BoxTree,"videoTrak")){const{width:e,height:t}=V(this.mp4BoxTree,"videoTkhd"),{samples:r}=V(this.mp4BoxTree,"videoStsz"),{SPS:n,PPS:a}=V(this.mp4BoxTree,"avcC"),{timescale:i,duration:o}=V(this.mp4BoxTree,"videoMdhd");this.mp4Data=Object.assign(Object.assign({},this.mp4Data),{width:e,height:t,SPS:n,PPS:a,videoDuration:o,videoTimescale:i,videoSamplesLength:r.length})}}}function ae(e,t){return new Uint8Array([255&e,t>>16&255,t>>8&255,255&t])}function ie(...e){let t=0;for(const r of e)t+=r.length;const r=new Uint8Array(t);let n=0;for(const t of e)r.set(t,n),n+=t.length;return r}function oe(e){return new Uint8Array([e>>>24&255,e>>>16&255,e>>>8&255,255&e])}function se(e){const t=e/Math.pow(2,32),r=e%Math.pow(2,32);return new Uint8Array([t>>>24&255,t>>>16&255,t>>>8&255,255&t,r>>>24&255,r>>>16&255,r>>>8&255,255&r])}const le=e=>e.charCodeAt(0),ue=e=>new Uint8Array(Array.prototype.map.call(e,le));function ce(e,t){return ie(oe(t.length+8),ue(e),t)}function de(e){return he(e)}function fe(e){return he(e)}function he(e){return new Uint8Array(e)}const pe=new Uint8Array([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]);function ve(e){const t=ie(function(e){const{type:t}=e;let r;return"video"===t?r=function(e){const{width:t,height:r}=e;let n=new Uint8Array([...fe(6),0,1,...de(16),t>>8&255,255&t,r>>8&255,255&r,0,72,0,0,0,72,0,0,...fe(4),0,1,11,87,65,78,71,76,117,118,68,65,78,71,...de(20),0,24,255,255]);return n=ie(n,function(e){const{SPS:t,PPS:r}=e;return ce("avcC",new Uint8Array([1,t[1],t[2],t[3],255,225,t.length>>8&255,255&t.length,...t,1,r.length>>8&255,255&r.length,...r]))}(e)),ce("avc1",n)}(e):"audio"===t&&(r=function(e){const{channelCount:t,sampleRate:r}=e;let n=new Uint8Array([...fe(6),0,1,...fe(8),0,t,0,16,...fe(4),r>>8&255,255&r,0,0]);return n=ie(n,function(e){const{audioConfig:t=[43,146,8,0]}=e;return ce("esds",new Uint8Array([...ae(0,0),3,23+t.length,0,1,0,4,15+t.length,64,21,0,0,0,0,0,0,0,0,0,0,0,5,t.length,...t,6,1,2]))}(e)),ce("mp4a",n)}(e)),r=ie(new Uint8Array([...ae(0,0),0,0,0,1]),r),ce("stsd",r)}(e),ye(),me(),ge(),be());return ce("stbl",t)}const ge=()=>ce("stsz",new Uint8Array([...ae(0,0),0,0,0,0,0,0,0,0])),me=()=>ce("stsc",new Uint8Array([...ae(0,0),0,0,0,0])),ye=()=>ce("stts",new Uint8Array([...ae(0,0),0,0,0,0])),be=()=>ce("stco",new Uint8Array([...ae(0,0),0,0,0,0]));function Ee(e){const{type:t}=e;let r="";switch(t){case"video":r=ce("vmhd",new Uint8Array([...ae(0,1),0,0,0,0,0,0,0,0]));break;case"audio":r=ce("smhd",[...ae(0,0),0,0,0,0])}return ce("minf",ie(r,ce("dinf",ce("dref",ie(new Uint8Array([...ae(0,0),0,0,0,1]),ce("url ",[0,0,0,1])))),ve(e)))}function Se(e){const t=ie(function(e){const{type:t,duration:r,width:n,height:a}=e;return ce("tkhd",new Uint8Array([...ae(1,7),0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,...oe("video"===t?1:2),...fe(4),...se(r),...fe(8),0,0,0,0,0,0,0,0,...pe,n>>8&255,255&n,0,0,a>>8&255,255&a,0,0]))}(e),function(e){const t=ie(function(e){const{type:t}=e;let r,n;return"video"===t?(r=e.videoDuration,n=e.videoTimescale):(r=e.audioDuration,n=e.audioTimescale),ce("mdhd",new Uint8Array([...ae(1,0),0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,...oe(n),...se(r),85,196,0,0]))}(e),function(e){let t="",r="";switch(e){case"video":t="vide",r="VideoHandler";break;case"audio":t="soun",r="SoundHandler"}return ce("hdlr",new Uint8Array([...ae(0,0),...de(4),...ue(t),...fe(12),...ue(r),0]))}(e.type),Ee(e));return ce("mdia",t)}(e));return ce("trak",t)}function _e(e){return ce("trex",new Uint8Array([...ae(0,0),...oe(e),0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}function ke(e,t){const r=ie(function(e){const{duration:t,timescale:r}=e;return ce("mvhd",new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,...oe(r),...se(t),0,1,0,0,1,0,...fe(10),...pe,...de(24),255,255,255,255]))}(e),Se(Object.assign(Object.assign({},e),{type:t})),function(e){const t=ie(function(e){const{duration:t}=e;return ce("mehd",new Uint8Array([...ae(0,0),...oe(t)]))}(e),_e(1),_e(2));return ce("mvex",t)}(e));return ce("moov",r)}function Le(e){const t=ie(function(e){const{sequenceNumber:t}=e;return ce("mfhd",new Uint8Array([...ae(0,0),...oe(t)]))}(e),function(e){const t=ie(function(e){const{trackId:t}=e;return ce("tfhd",new Uint8Array([...ae(0,0),...oe(t)]))}(e),function(e){const{baseMediaDecodeTime:t}=e;return ce("tfdt",new Uint8Array([...ae(1,0),0,0,0,0,t>>>24&255,t>>>16&255,t>>>8&255,255&t]))}(e),function(e){const{samples:t}=e;return ce("sdtp",ie([0,0,0,0],...t.map((()=>new Uint8Array([16])))))}(e),function(e){const{samples:t,trackId:r}=e,n=108+(1===r?16:12)*t.length+t.length,a=new Uint8Array([0,0,1===r?15:7,1,...oe(t.length),...oe(n),...ie(...t.map(((e,t)=>{const{duration:n,size:a,compositionTimeOffset:i}=e;return ie(oe(n),oe(a),1===r?0===t?[2,0,0,0]:[1,1,0,0]:[1,0,0,0],1===r?oe(i):[])})))]);return ce("trun",a)}(e));return ce("traf",t)}(e));return ce("moof",t)}class Te{static ftyp(){return ce("ftyp",new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]))}static moov(e,t){return ke(e,t)}static moof(e,t){return Le(Object.assign({},e,{sequenceNumber:Te.sequenceNumber++,baseMediaDecodeTime:t}))}static mdat(e){return ce("mdat",ie(...e.samples.map((e=>new Uint8Array(e.buffer)))))}}Te.sequenceNumber=1;class we{constructor(e,t){this.installSrc=()=>{this.mediaSource=new MediaSource,this.mediaSource.addEventListener("sourceopen",this.handleSourceOpen),this.video.src=URL.createObjectURL(this.mediaSource)},this.handleSourceOpen=()=>{this.sourceBuffers.video=this.mediaSource.addSourceBuffer(this.mimeTypes.video),this.sourceBuffers.audio=this.mediaSource.addSourceBuffer(this.mimeTypes.audio),this.sourceBuffers.video.addEventListener("updateend",(()=>{const e=this.videoQueue.shift();e&&"open"===this.mediaSource.readyState&&this.handleAppendBuffer(e,"video"),this.needUpdateTime&&(this.needUpdateTime=!1,this.handleTimeUpdate())})),this.sourceBuffers.audio.addEventListener("updateend",(()=>{const e=this.audioQueue.shift();e&&"open"===this.mediaSource.readyState&&this.handleAppendBuffer(e,"audio")}))},this.handleAppendBuffer=(e,t)=>{if("open"===this.mediaSource.readyState)try{this.sourceBuffers[t]&&this.sourceBuffers[t].appendBuffer(e)}catch(r){if(22!==r.code)throw r;this.handleQuotaExceededError(e,t)}else this[`${t}Queue`].push(e)},this.hasBufferedCache=e=>{const{timeRange:[t,r]}=this.mp4Probe,n=e?this.video.currentTime:Math.floor((t+r)/2),a=this.video.buffered;if(a&&a.length>0)for(let e=0;e=a.start(e)&&n<=a.end(e))return!0;return!1},this.seek=e=>{B.clear();const[t,r]=this.mp4Probe.getFragmentPosition(e);this.hasBufferedCache(e)&&!this.qualityChangeFlag||(this.handleReplayCase(),this.loadData(t,r).then((t=>{if(!t)return;const{videoTrackInfo:r,audioTrackInfo:n}=this.mp4Probe.getTrackInfo(t),{videoInterval:a,audioInterval:i}=this.mp4Probe,o=a.timeInterVal[0],s=i.timeInterVal[0],l=ie(Te.moof(r,o),Te.mdat(r));if(0!==n.samples.length){const e=ie(Te.moof(n,s),Te.mdat(n));this.handleAppendBuffer(e,"audio")}this.handleAppendBuffer(l,"video"),e&&(this.needUpdateTime=!0),this.qualityChangeFlag=!1})))},this.handleTimeUpdate=()=>{if(!this.mp4Probe)return;const{videoInterval:{offsetInterVal:e=[]}=[],mp4Data:{videoSamplesLength:t},timeRange:r=[]}=this.mp4Probe;"closed"!==this.mediaSource.readyState&&(e[1]===t&&this.video.currentTime>r[0]?this.destroy():this.shouldFetchNextSegment()&&this.seek())},this.handleReplayCase=()=>{"ended"===this.mediaSource.readyState&&(this.sourceBuffers.video.timestampOffset=0)},this.shouldFetchNextSegment=()=>(this.handleReplayCase(),!!this.mp4Probe.isDraining(this.video.currentTime)),this.destroy=()=>{this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen),URL.revokeObjectURL(this.video.src),"open"!==this.mediaSource.readyState||this.sourceBuffers.video.updating||this.sourceBuffers.audio.updating||this.mediaSource.endOfStream()},this.handleQuotaExceededError=(e,t)=>{for(const e in this.sourceBuffers){const t=this.sourceBuffers[e],r=this.video.currentTime;let n=0;t.buffered.length>0&&(n=t.buffered.start(0)+10),this.removeBuffer(n,r-10,e)}this.handleAppendBuffer(e,t)},this.video=e,this.src=t,this.qualityChangeFlag=!1,this.videoQueue=[],this.audioQueue=[],this.sourceBuffers={video:null,audio:null},this.mimeTypes={video:'video/mp4; codecs="avc1.42E01E"',audio:'audio/mp4; codecs="mp4a.40.2"'},this.installSrc()}init(){return this.loadData().then((e=>new W(new Uint8Array(e)).mp4BoxTreeObject)).then((e=>{const{moov:t,ftyp:r}=e;if(!t){let t=0;for(const r in e)t+=e[r].size;return this.loadData(t,"").then((t=>{const{moov:r}=new W(new Uint8Array(t)).mp4BoxTreeObject;if(r)return e.moov=r,e}))}{const n=t.size+r.size;if(n>2e4)return this.loadData(r.size,n).then((t=>{const{moov:r}=new W(new Uint8Array(t)).mp4BoxTreeObject;if(r)return e.moov=r,e}))}return e})).then((e=>{this.mp4Probe=new ne(e),this.mp4BoxTreeObject=e;const t=ie(Te.ftyp(),Te.moov(this.mp4Probe.mp4Data,"video")),r=ie(Te.ftyp(),Te.moov(this.mp4Probe.mp4Data,"audio"));this.qualityChangeFlag?(this.handleAppendBuffer(t,"video"),this.handleAppendBuffer(r,"audio")):this.mediaSource.addEventListener("sourceopen",(()=>{this.handleAppendBuffer(t,"video"),this.handleAppendBuffer(r,"audio")}))}))}changeQuality(e){this.src=e,this.qualityChangeFlag=!0;for(const e in this.sourceBuffers){const t=this.sourceBuffers[e],r=t.buffered.length;r>0&&this.removeBuffer(t.buffered.start(0),t.buffered.end(r-1),e)}this.init().then((()=>{this.video.currentTime=this.video.currentTime}))}removeBuffer(e,t,r){const n=this.sourceBuffers[r];if(n.updating){const{isSafari:e}=h;e&&function(){const e=MediaSource.prototype.addSourceBuffer;MediaSource.prototype.addSourceBuffer=function(...t){const r=e.apply(this,t);return r.abort=function(){},r}}(),n.abort()}n.remove(e,t)}loadData(e=0,t=2e4){return new Promise((r=>{new B(this.src,e,t,r)})).catch((()=>{}))}}const{isSafari:Ae}=h;class Re extends m.Component{constructor(){super(...arguments),this.video=null,this.useMSE=!0,this.handleTimeUpdate=e=>{var t,r;this.useMSE&&this.mse.handleTimeUpdate(),null===(r=(t=this.props).onTimeUpdate)||void 0===r||r.call(t,e)},this.handleVideoSeeking=e=>{var t,r;if(!this.video)return;const n=this.video.currentTime,a=this.video.buffered;if(Ae&&a&&a.length>0){if(n-.1>a.start(0))this.useMSE&&this.mse.seek(this.video.currentTime);else if(n{if(!this.video)return;const{currentTime:t}=this.video;0===t&&this.useMSE&&this.mse.seek(0);const{onPlay:r}=this.props;r&&r(e)},this.handleVideoProgress=e=>{var t,r;if(!this.video)return;const n=this.video.buffered,a=this.video.currentTime;Ae&&n&&n.length>0&&a{if(!this.video)return;let e=0;this.video.buffered.length>0&&(e=this.video.buffered.start(0)),this.video.currentTime=e+.1}}componentDidMount(){this.mse=new we(this.video,this.props.src),this.mse.init().then((()=>{this.mse.mp4Probe.mp4Data.videoDuration||(this.useMSE=!1,this.video.src=this.props.src)}))}componentDidUpdate(e){this.props.src!==e.src&&this.useMSE&&this.mse.changeQuality(this.props.src)}componentWillUnmount(){this.useMSE&&this.mse.destroy()}render(){const e=this.props,{src:t,onRef:r,currentQuality:n,useAutoQuality:a,onSeeking:i,onPlay:o,paused:s,onTimeUpdate:l,onProgress:u}=e,c=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a{this.video=e,r(e)}},c,{onSeeking:this.handleVideoSeeking,onTimeUpdate:this.handleTimeUpdate,onPlay:this.handlePlay,onProgress:this.handleVideoProgress}))}}var xe={pluginName:"griffith-mp4",VideoComponent:Re,willHandleSrcChange:!0};function Ce(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a{const r=(0,m.useContext)(De);return"object"==typeof r[e]?r[e][t]:r[e]},Be=({locale:e,localeConfig:t,children:r})=>{const n=(0,m.useMemo)((()=>((e,t)=>{const r=Pe[e],n=null==t?void 0:t[e];return n?Object.assign({},r,n):r})(e,t)),[e,t]);return m.createElement(De.Provider,{value:n},r)},Ie=e=>{const t=(0,m.useRef)(e);return t.current=e,(0,m.useRef)(((...e)=>t.current(...e))).current},Fe="event",Ne="action",Ue=m.createContext({});Ue.displayName="InternalMessageContext";const je=m.createContext(null);je.displayName="MessageContext";class Ge extends m.PureComponent{constructor(e){super(e),this.emitEvent=(e,t)=>{var r,n;this.emitter.emit(e,{__type__:Fe,data:t}),null===(n=(r=this.props).onEvent)||void 0===n||n.call(r,e,t),this.props.enableCrossWindow&&this.crossWindowMessager.dispatchMessage(window.parent,e,t)},this.subscribeEvent=(e,t)=>{const r=({__type__:e,data:r}={})=>{e===Fe&&t(r)};return this.emitter.on(e,r),{unsubscribe:()=>this.emitter.off(e,r)}},this.dispatchAction=(e,t)=>{this.emitter.emit(e,{__type__:Ne,data:t})},this.subscribeAction=(e,t)=>{const r=({__type__:e,data:r})=>{e===Ne&&t(r)};return this.emitter.on(e,r),{unsubscribe:()=>this.emitter.off(e,r)}},this.internalContextValue={emitEvent:this.emitEvent,subscribeAction:this.subscribeAction},this.externalContextValue={dispatchAction:this.dispatchAction,subscribeEvent:this.subscribeEvent},this.emitter=new(b());const{id:t,targetOrigin:r}=this.props;this.crossWindowMessager=function(e,t="*",r=!1){const n=new Set;return{subscribeMessage:function(a,i){const o="function"==typeof a,s=o?a:i,u=o?void 0:a;function c(n){const a=n.origin,i="*"===t||t===a,{from:c,id:d,payload:f}=n.data||{};if(i&&c===l&&(!r||e===d)&&f){const{name:e,data:t}=f;if(!e||"function"!=typeof s)return;o?s(e,t,n.source):u===e&&s(t,n.source)}}window.addEventListener("message",c);const d={unsubscribe:()=>{window.removeEventListener("message",c),n.delete(d)}};return n.add(d),d},dispatchMessage:(r,n,...a)=>{var i;null===(i=null==r?void 0:r.postMessage)||void 0===i||i.call(r,{from:l,id:e,payload:{name:n,data:a[0]}},t||"*")},dispose:()=>{n.forEach((e=>e.unsubscribe()))}}}(t,r),this.props.dispatchRef&&(this.props.dispatchRef.current=this.externalContextValue.dispatchAction),this.props.messageContextRef&&(this.props.messageContextRef.current=this.externalContextValue),Promise.resolve().then((()=>{this.emitEvent(i.SUBSCRIPTION_READY)}))}componentDidMount(){this.props.enableCrossWindow&&this.crossWindowMessager.subscribeMessage(((e,t)=>{this.dispatchAction(e,t)}))}componentWillUnmount(){this.props.dispatchRef&&(this.props.dispatchRef.current=void 0),this.props.messageContextRef&&(this.props.messageContextRef.current=void 0),this.crossWindowMessager.dispose(),this.emitter.removeAllListeners()}render(){return m.createElement(Ue.Provider,{value:this.internalContextValue},m.createElement(je.Provider,{value:this.externalContextValue},this.props.children))}}Ge.defaultProps={targetOrigin:"*"};const ze=m.createContext({});ze.displayName="ObjectFitContext";const We=({initialObjectFit:e="contain",children:t})=>{const[r,n]=(0,m.useState)(e),a=(0,m.useMemo)((()=>({objectFit:r,setObjectFit:n})),[r,n]);return(0,m.useEffect)((()=>{n(e)}),[e]),m.createElement(ze.Provider,{value:a},t)};function He(e){const t=(0,m.useRef)();return(0,m.useEffect)((()=>{t.current=e}),[e]),t.current}const Ve="function"==typeof ResizeObserver?(e,t)=>{const r=new ResizeObserver((e=>t(e[0].contentRect)));return r.observe(e),()=>{r.disconnect()}}:(e,t)=>{const r=window.MutationObserver||window.WebKitMutationObserver;let n;const a=()=>{const r=e.getBoundingClientRect();(!n||!["left","top","width","height"].every((e=>n[e]===r[e])))&&(n=r,t(r))},i=new r(S()(a,100));return i.observe(e,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),a(),window.addEventListener("resize",a),()=>{i.disconnect(),window.removeEventListener("resize",a)}},qe=m.createContext({isFullWidth:!1,updateVideoSize(){}});qe.displayName="PositionContext";var Ke=c.StyleSheet.create({root:{position:"relative",width:"100%",height:"100%"}});const Ye=({children:e})=>{const t=(0,m.useRef)(null),[r,n]=(0,m.useState)(null),[a,i]=(0,m.useState)(!1),[o,s]=(0,m.useState)({videoWidth:0,videoHeight:0}),l=Ie((()=>{const{videoWidth:e,videoHeight:t}=o;e&&t&&n(`data:image/svg+xml;utf8,`)})),u=Ie((()=>{const{videoWidth:e,videoHeight:r}=o;if(!e||!r)return;if(!t.current)return;const{width:n,height:s}=t.current.getBoundingClientRect(),l=n/s-e/r<=.01;l!==a&&i(l)}));(0,m.useEffect)((()=>{if(t.current)return Ve(t.current,u)}),[t,u]),(0,m.useEffect)((()=>{l()}),[l]);const d=He(o);(0,m.useEffect)((()=>{if(!d)return;const{videoWidth:e,videoHeight:t}=d,{videoWidth:r,videoHeight:n}=o;e===r&&t===n||(requestAnimationFrame(u),l())}),[d,l,u,o]);const f=(0,m.useMemo)((()=>({isFullWidth:a,helperImageSrc:r,updateVideoSize:s})),[r,a]);return m.createElement(qe.Provider,{value:f},m.createElement("div",{className:(0,c.css)(Ke.root),ref:t},e))},Qe=m.createContext({});Qe.displayName="VideoSourceContext";const Xe=["auto","ld","sd","hd","fhd"];var $e=e=>e.slice().reverse();const{isMobile:Ze}=h,Je=({sources:e,useAutoQuality:t,playbackRates:r,defaultPlaybackRate:n,defaultQuality:a,defaultQualityOrder:o,children:s})=>{const{emitEvent:l}=(0,m.useContext)(Ue),u=(e=>{const t=(0,m.useRef)(e);return e!==t.current&&JSON.stringify(e)!==JSON.stringify(t.current)&&(t.current=e),t.current})(e),{qualities:c,sources:d,format:f,isDescOrder:h}=(0,m.useMemo)((()=>{if(!u)return{qualities:[],sources:[]};const{format:e}=Object.values(u)[0],r="desc"===o,n=((e,t,r)=>{const n=Object.keys(e).sort(((e,t)=>r?Xe.indexOf(t)-Xe.indexOf(e):Xe.indexOf(e)-Xe.indexOf(t)));return n.length>1?t?n.slice(0,1):n.filter((e=>"ld"!==e)):n})(u,Ze,r),a=((e,t)=>e.map((e=>{const r=t[e],{play_url:n}=r,a=Ce(r,["play_url"]);return Object.assign(Object.assign({},a),{source:n,quality:e})})))(n,u);return!t||Ze||"m3u8"!==e||n.includes("auto")||n.unshift("auto"),{qualities:n,sources:a,format:e,isDescOrder:r}}),[t,u,o]),[p,v]=(0,m.useState)(a&&c.includes(a)?a:c[0]),[g,y]=(0,m.useState)(n),b=Ie((e=>{p!==e&&(v(e),l(i.QUALITY_CHANGE,{prevQuality:p,quality:e}))})),E=He(c);(0,m.useEffect)((()=>{E&&E!==c&&b(a||c[0])}),[E,c,a,b]);const S=Ie((e=>{g!==e&&(y(e),l(i.PLAYBACK_RATE_CHANGE,{prevRate:g,rate:e}))})),_=(0,m.useMemo)((()=>{if(0!==d.length)return(d.find((e=>e.quality===p))||d[0]).source}),[p,d]),k=(0,m.useMemo)((()=>({qualities:h?c:$e(c),playbackRates:r,format:f,sources:d,currentQuality:p,currentPlaybackRate:g,currentSrc:_,setCurrentQuality:b,setCurrentPlaybackRate:S})),[g,p,_,f,r,c,h,S,b,d]);return m.createElement(Qe.Provider,{value:k},s)},et=(e=!1)=>{const[t,r]=(0,m.useState)(e);return[t,(0,m.useRef)({on:(0,m.useCallback)((()=>r(!0)),[]),off:(0,m.useCallback)((()=>r(!1)),[]),toggle:(0,m.useCallback)((()=>r((e=>!e))),[])}).current]};function tt(e){let t=String(e);return t.length<2&&(t="0"+t),t}function rt(e){if(!Number.isFinite(e))return"";const t=(e=Math.floor(e))%60;return`${tt(Math.floor(e/60))}:${tt(t)}`}class nt{constructor(){this.inited=!1}init(e,t,r){this.inited=!0,this.element=e,this.onEnter=t,this.onExit=r,this.element.addEventListener("enterpictureinpicture",this.handleEnter.bind(this)),this.element.addEventListener("leavepictureinpicture",this.handleExit.bind(this))}handleEnter(e){this.onEnter&&this.onEnter(e)}handleExit(e){this.onExit&&this.onExit(e)}get supported(){return!!this.inited&&document.pictureInPictureEnabled}get pictureInPictureElement(){return document.pictureInPictureElement}request(){this.element&&this.element.requestPictureInPicture()}exit(){document.exitPictureInPicture()}toggle(){this.pictureInPictureElement?this.exit():this.request()}}const at={store:{},setItem(e,t){this.store[e]=t},removeItem(e){return delete this.store[e]},getItem(e){return this.store[e]}},it={isSupported:k()((()=>{try{const e={key:"__test_support_key__",value:"__test_support_value__"},t=Boolean(r.g.localStorage);return localStorage.setItem(e.key,e.value),localStorage.removeItem(e.key),t}catch(e){return!1}})),getStorage:k()((()=>it.isSupported()?localStorage:at)),set(e,t){it.getStorage().setItem(e,JSON.stringify(t))},get(e){try{const t=it.getStorage().getItem(e);return JSON.parse(t)}catch(e){return null}},delete(e){it.getStorage().removeItem(e)}};var ot=c.StyleSheet.create({root:{position:"relative",overflow:"hidden",userSelect:"none",width:"100%",height:"100%",fontSize:16,backgroundColor:"#000",":focus":{outline:"none"}},fullScreened:{fontSize:24},pageFullScreen:{position:"fixed",top:0,left:0,zIndex:1e5},actionButton:{color:"#fff",width:"4.5em",height:"4.5em"},actionButtonAnimated:{animationName:{"0%":{opacity:0,transform:"scale(0)"},"50%":{opacity:.6,transform:"scale(0.8)"},"100%":{opacity:0,transform:"scale(1)"}},animationDuration:"600ms",animationFillMode:"both"},actionLabelAnimation:{animationName:{"90%":{opacity:1},"100%":{opacity:0}},animationDuration:"600ms",animationFillMode:"both"},actionIcon:{width:"4.5em",height:"4.5em",[("mobile","@media screen and (max-width: 26em)")]:{transform:"scale(0.75)"}},actionLabel:{marginTop:".5em",padding:".3em .5em",textAlign:"center",color:"#fff",background:"rgba(0,0,0,0.5)",borderRadius:5},video:{width:"100%",height:"100%"},overlay:{position:"absolute",left:0,right:0,top:0,bottom:0,overflow:"hidden"},overlayMask:{background:"rgba(0, 0, 0, 0.08)"},loader:{position:"absolute",left:"50%",top:"50%",color:"#0f88eb",transform:"translate(-50%, -50%)"},action:{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)"},actionToast:{pointerEvents:"none"},backdrop:{position:"absolute",left:0,right:0,top:0,bottom:0},title:{position:"absolute",left:0,right:0,top:0,overflow:"hidden",padding:"0 1em",lineHeight:2.5,textOverflow:"ellipsis",whiteSpace:"nowrap",color:"#fff",backgroundImage:"linear-gradient(to top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.3))",transform:"translateY(-100%)",transition:"transform 300ms"},titleShown:{transform:"translateY(0)"},controller:{position:"absolute",left:0,right:0,bottom:0,backgroundImage:"linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.3))"},volumeButton:{position:"absolute",bottom:0,right:8},cover:{position:"absolute",left:0,right:0,top:0,bottom:0,overflow:"hidden",backgroundColor:"#000",cursor:"pointer",visibility:"hidden",opacity:0,transition:"visibility 300ms, opacity 300ms"},coverShown:{visibility:"visible",opacity:1},coverImage:{position:"absolute",left:0,top:0,width:"100%",height:"100%"},coverTime:{position:"absolute",right:"0.5em",bottom:"0.5em",padding:"0.375em",fontSize:"0.875em",lineHeight:1,color:"rgba(255, 255, 255, 0.9)",backgroundColor:"transparent",textShadow:"0 0 6px rgba(0, 0, 0, 0.4)"},coverTimeMobile:{padding:0},coverAction:{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)"},coverReplayAction:{position:"absolute",left:"0",right:"0",top:"0",bottom:"0",backgroundColor:"rgba(0, 0, 0, 0.16)",animationName:{"0%":{opacity:0},"100%":{opacity:1}},animationDuration:"600ms",animationFillMode:"both"},coverReplayButton:{position:"absolute",left:"0",right:"0",top:"0",bottom:"0",height:"40px",width:"116px",margin:"auto",backgroundColor:"rgba(0, 0, 0, 0.5)",borderRadius:"4px",color:"#fff",fontSize:"16px",lineHeight:"24px",padding:"8px",boxSizing:"border-box",textAlign:"center",whiteSpace:"nowrap",transition:"transform 200ms, opacity 200ms",willChange:"transform"},coverReplayButtonHovered:{transform:"scale(1.1)"},coverReplayButtonPressed:{opacity:.7},replayIcon:{verticalAlign:"top",marginRight:"4px"},error:{position:"absolute",left:0,right:0,top:0,bottom:0,overflow:"hidden",display:"flex",flexDirection:"column",justifyContent:"center",color:"#fff",backgroundColor:"#000"},errorIcon:{width:"2.5em",height:"2.5em",margin:"0 auto",fill:"currentColor"},errorMessage:{marginTop:"1em",fontSize:"1.25em",lineHeight:1,textAlign:"center"}});const st=c.StyleSheet.create({base:{transition:"opacity .5s ease-in-out, visibility .5s ease-in-out"},hidden:{opacity:0,visibility:"hidden"},shown:{opacity:1,visibility:"visible"}});var lt=c.StyleSheet.create({root:{display:"inline-block",width:"1.5em",height:"1.5em"},svg:{display:"block",width:"100%",height:"100%",fill:"currentColor"}});function ut({icon:e,styles:t}){const r=(0,m.cloneElement)(e,{className:(0,c.css)(lt.svg)});return m.createElement("span",{className:(0,c.css)(lt.root,t)},r)}const ct=(0,m.createContext)(void 0),dt=(0,m.createContext)((()=>{})),ft=()=>(0,m.useContext)(dt),ht=({children:e})=>{const[t,r]=(0,m.useState)(),n=(0,m.useRef)(0),a=(0,m.useCallback)((e=>{n.current+=1,r(Object.assign(Object.assign({},e),{key:String(n.current)}))}),[]);return m.createElement(ct.Provider,{value:t},m.createElement(dt.Provider,{value:a},e))},pt=m.memo((()=>{const e=(0,m.useContext)(ct);if(!e)return null;const{key:t,icon:r,label:n}=e;return m.createElement("div",{className:(0,c.css)(ot.action,ot.actionToast),key:t},m.createElement("div",{className:(0,c.css)(ot.actionButton,ot.actionButtonAnimated)},r&&m.createElement(ut,{icon:r,styles:ot.actionIcon})),n&&m.createElement("div",{className:(0,c.css)(ot.actionLabel,ot.actionLabelAnimation)},n))}));var vt=m.createElement("svg",{viewBox:"0 0 24 24"},m.createElement("path",{d:"M19.7180574,15 C20.1638168,15 20.3254599,15.0464128 20.4884229,15.1335664 C20.6513858,15.2207199 20.7792801,15.3486142 20.8664336,15.5115771 C20.9535872,15.6745401 21,15.8361832 21,16.2819426 L21,19.7180574 C21,20.1638168 20.9535872,20.3254599 20.8664336,20.4884229 C20.7792801,20.6513858 20.6513858,20.7792801 20.4884229,20.8664336 C20.3254599,20.9535872 20.1638168,21 19.7180574,21 L16.2819426,21 C15.8361832,21 15.6745401,20.9535872 15.5115771,20.8664336 C15.3486142,20.7792801 15.2207199,20.6513858 15.1335664,20.4884229 C15.0464128,20.3254599 15,20.1638168 15,19.7180574 L15,16.2819426 C15,15.8361832 15.0464128,15.6745401 15.1335664,15.5115771 C15.2207199,15.3486142 15.3486142,15.2207199 15.5115771,15.1335664 C15.6745401,15.0464128 15.8361832,15 16.2819426,15 L19.7180574,15 Z M18.5,4 C19.3284271,4 20,4.67157288 20,5.5 L20,11.75 C20,11.8880712 19.8880712,12 19.75,12 L18.25,12 C18.1119288,12 18,11.8880712 18,11.75 L18,6.5 C18,6.24358208 17.8069799,6.03224642 17.5583106,6.00336387 L17.5,6 L6.5,6 C6.24358208,6 6.03224642,6.1930201 6.00336387,6.44168944 L6,6.5 L6,17.5 C6,17.7564179 6.1930201,17.9677536 6.44168944,17.9966361 L6.5,18 L11.75,18 C11.8880712,18 12,18.1119288 12,18.25 L12,19.75 C12,19.8880712 11.8880712,20 11.75,20 L5.5,20 C4.67157288,20 4,19.3284271 4,18.5 L4,5.5 C4,4.67157288 4.67157288,4 5.5,4 L18.5,4 Z M12.263324,13.6777091 L9.53508966,10.956021 L9.55615206,13.2225752 C9.55502994,13.3470231 9.46566931,13.4482773 9.34885743,13.4683645 L9.30388492,13.4719793 L7.79658322,13.4583417 C7.67542934,13.4572455 7.57490537,13.3702653 7.5531943,13.2554476 L7.54886064,13.2111995 L7.49923911,7.74790313 C7.50035209,7.62546574 7.5897117,7.52443494 7.70652348,7.50437256 L7.75149597,7.50076089 L13.2230869,7.55026617 C13.3442408,7.55136234 13.4447648,7.6383426 13.4664758,7.75316028 L13.4708095,7.79740841 L13.4844791,9.30570263 C13.4833661,9.42814002 13.3940065,9.52917082 13.2771947,9.5492332 L13.2322222,9.55284487 L10.9362217,9.53206969 L13.6775376,12.2668086 C13.7751687,12.364211 13.7751687,12.5221314 13.6775376,12.6195338 L12.6168774,13.6777091 C12.5192463,13.7751115 12.3609551,13.7751115 12.263324,13.6777091 Z"})),gt=m.createElement("svg",{viewBox:"0 0 24 24"},m.createElement("path",{d:"M20,10 L20,5 C20,4.44771525 19.5490248,4 19.009222,4 L14,4 L14,6 L18,6 L18,10 L20,10 Z M19.7115371,19.7068284 C19.8902571,19.5277733 20,19.2813055 20,19.009222 L20,14 L18,14 L18,18 L14,18 L14,20 L19.009222,20 C19.2776249,20 19.5240668,19.8893106 19.7040291,19.7101145 L19.7115371,19.7068284 Z M6,18 L6,14 L4,14 L4,19.009222 C4,19.2813055 4.10974288,19.5277733 4.28846285,19.7068284 C4.47593315,19.8893106 4.72237506,20 4.99077797,20 L10,20 L10,18 L6,18 Z M4.28846285,4.29317155 C4.10974288,4.47222673 4,4.71869448 4,4.99077797 L4,10 L6,10 L6,6 L10,6 L10,4 L4.99077797,4 C4.72237506,4 4.47593315,4.11068941 4.29597088,4.28988548 L4.28846285,4.29317155 Z"})),mt=m.createElement("svg",{viewBox:"0 0 24 24"},m.createElement("path",{d:"M7.38001507,9.5 L5,9.5 L5,12.0119396 L5,14.5238791 L8.33098415,14.5238791 L8.33098415,14.5238791 C8.39017333,14.520451 8.4497727,14.5223174 8.50904598,14.5296109 C8.72475585,14.5524598 8.91816198,14.6424266 9.06920843,14.7779841 L13,17.4293365 L13,15.1199849 L7.38001507,9.5 Z M15,17.1199849 L15,19.251289 C15,19.8045373 14.5522847,20.25 14,20.25 C13.98423,20.25 13.9685502,20.2496405 13.9529683,20.2489292 C13.7472793,20.2584936 13.5372091,20.2041245 13.3535806,20.0802655 L8.08102098,16.5238791 L4.00000001,16.5238791 C3.71994909,16.5238791 3.46994918,16.4119504 3.29196292,16.2310404 C3.11117675,16.0497507 3,15.7991447 3,15.5223056 L3,12.0119396 L3,8.50157356 C3,8.2247344 3.11117675,7.97412842 3.29196292,7.79283868 C3.46994918,7.61192872 3.71994909,7.5 4.00000001,7.5 L5.38001507,7.5 L3.38382011,5.50380504 C2.99233448,5.1123194 2.98883249,4.48109777 3.38207944,4.08785081 C3.77260374,3.69732652 4.3999302,3.691488 4.79803367,4.08959148 L18.936688,18.2282458 C19.3281736,18.6197314 19.3316756,19.250953 18.9384286,19.6442 C18.5479043,20.0347243 17.9205779,20.0405628 17.5224744,19.6424593 L15,17.1199849 Z M10.792179,8.08373676 L9.35149599,6.64305379 L13.3535806,3.94361361 C13.5372091,3.81975463 13.7472793,3.76538554 13.9529683,3.77494994 C13.9685502,3.77423867 13.98423,3.77387913 14,3.77387913 C14.5522847,3.77387913 15,4.21934183 15,4.77259008 L15,12.0119396 L15,12.2915578 L13,10.2915578 L13,6.59454265 L10.792179,8.08373676 Z M18.0173138,15.3088716 C18.8917509,14.408489 19.4301566,13.1799808 19.4301566,11.8257212 C19.4301566,10.2214787 18.6746368,8.79369726 17.5,7.87877967 L17.5067574,7.87009164 C17.2041341,7.69816923 17,7.37292366 17,7 C17,6.44771525 17.4477153,6 18,6 C18.2836948,6 18.5397977,6.11813499 18.721799,6.30789526 L18.7279374,6.30000305 C20.3724289,7.58088767 21.4301566,9.57978168 21.4301566,11.8257212 C21.4301566,13.7322659 20.6679517,15.4607882 19.431636,16.7231938 L18.0173138,15.3088716 Z"})),yt=m.createElement("svg",{viewBox:"0 0 24 24"},m.createElement("path",{d:"M9,5 C10,5 10,6 10,6 C10,6 10,17 10,18 C10,19 9,19 9,19 L7,19 C6,19 6,18 6,18 L6,6 C6,5 7,5 7,5 C7,5 8,5 9,5 Z M17,5 C18,5 18,6 18,6 C18,6 18,17 18,18 C18,19 17,19 17,19 L15,19 C14,19 14,18 14,18 L14,6 C14,5 15,5 15,5 C15,5 16,5 17,5 Z"})),bt=m.createElement("svg",{viewBox:"0 0 24 24"},m.createElement("path",{d:"M19.7180574,15 C20.1638168,15 20.3254599,15.0464128 20.4884229,15.1335664 C20.6513858,15.2207199 20.7792801,15.3486142 20.8664336,15.5115771 C20.9535872,15.6745401 21,15.8361832 21,16.2819426 L21,19.7180574 C21,20.1638168 20.9535872,20.3254599 20.8664336,20.4884229 C20.7792801,20.6513858 20.6513858,20.7792801 20.4884229,20.8664336 C20.3254599,20.9535872 20.1638168,21 19.7180574,21 L16.2819426,21 C15.8361832,21 15.6745401,20.9535872 15.5115771,20.8664336 C15.3486142,20.7792801 15.2207199,20.6513858 15.1335664,20.4884229 C15.0464128,20.3254599 15,20.1638168 15,19.7180574 L15,16.2819426 C15,15.8361832 15.0464128,15.6745401 15.1335664,15.5115771 C15.2207199,15.3486142 15.3486142,15.2207199 15.5115771,15.1335664 C15.6745401,15.0464128 15.8361832,15 16.2819426,15 L19.7180574,15 Z M18.5,4 C19.3284271,4 20,4.67157288 20,5.5 L20,11.75 C20,11.8880712 19.8880712,12 19.75,12 L18.25,12 C18.1119288,12 18,11.8880712 18,11.75 L18,6.5 C18,6.24358208 17.8069799,6.03224642 17.5583106,6.00336387 L17.5,6 L6.5,6 C6.24358208,6 6.03224642,6.1930201 6.00336387,6.44168944 L6,6.5 L6,17.5 C6,17.7564179 6.1930201,17.9677536 6.44168944,17.9966361 L6.5,18 L11.75,18 C11.8880712,18 12,18.1119288 12,18.25 L12,19.75 C12,19.8880712 11.8880712,20 11.75,20 L5.5,20 C4.67157288,20 4,19.3284271 4,18.5 L4,5.5 C4,4.67157288 4.67157288,4 5.5,4 L18.5,4 Z M8.98667598,7.57381266 L11.7149103,10.2955008 L11.6938479,8.02894655 C11.6949701,7.90449864 11.7843307,7.80324445 11.9011426,7.78315725 L11.9461151,7.77954248 L13.4534168,7.79318008 C13.5745707,7.79427625 13.6750946,7.88125651 13.6968057,7.99607419 L13.7011394,8.04032232 L13.7507609,13.5036187 C13.7496479,13.626056 13.6602883,13.7270868 13.5434765,13.7471492 L13.498504,13.7507609 L8.0269131,13.7012556 C7.90575922,13.7001594 7.80523525,13.6131792 7.78352418,13.4983615 L7.77919052,13.4541134 L7.76552089,11.9458192 C7.76663388,11.8233818 7.85599349,11.722351 7.97280526,11.7022886 L8.01777775,11.6986769 L10.3137783,11.7194521 L7.57246241,8.98471315 C7.47483134,8.8873108 7.47483134,8.72939038 7.57246241,8.63198803 L8.63312259,7.57381266 C8.73075366,7.4764103 8.8890449,7.4764103 8.98667598,7.57381266 Z"})),Et=m.createElement("svg",{viewBox:"0 0 24 24"},m.createElement("path",{d:"M8.03610236,19.7012935 C6.93281899,20.3993842 6,19.8347521 6,18.4154722 L6,5.59575582 C6,4.14567779 6.91151094,3.59901121 8.03610236,4.30993442 L18.1645278,10.7185093 C19.2678112,11.4166 19.2891193,12.5817954 18.1645278,13.2927186 L8.03610236,19.7012935 Z"})),St=m.createElement("svg",{viewBox:"0 0 24 24"},m.createElement("path",{d:"M14.2884629,14.2931716 C14.1097429,14.4722267 14,14.7186945 14,14.990778 L14,20 L16,20 L16,16 L20,16 L20,14 L14.990778,14 C14.7223751,14 14.4759332,14.1106894 14.2959709,14.2898855 L14.2884629,14.2931716 Z M16,8 L16,4 L14,4 L14,9.00922203 C14,9.28130552 14.1097429,9.52777327 14.2884629,9.70682845 C14.4759332,9.88931059 14.7223751,10 14.990778,10 L20,10 L20,8 L16,8 Z M8,16 L8,20 L10,20 L10,14.990778 C10,14.7186945 9.89025712,14.4722267 9.71153715,14.2931716 C9.52406685,14.1106894 9.27762494,14 9.00922203,14 L4,14 L4,16 L8,16 L8,16 Z M9.71153715,9.70682845 C9.89025712,9.52777327 10,9.28130552 10,9.00922203 L10,4 L8,4 L8,8 L4,8 L4,10 L9.00922203,10 C9.27762494,10 9.52406685,9.88931059 9.70402912,9.71011452 L9.71153715,9.70682845 Z"})),_t=m.createElement("svg",{viewBox:"0 0 24 24"},m.createElement("path",{d:"M5,12.0119396 L5,14.5238791 L8.33098415,14.5238791 L8.33098415,14.5238791 C8.39017333,14.520451 8.4497727,14.5223174 8.50904598,14.5296109 C8.72475585,14.5524598 8.91816198,14.6424266 9.06920843,14.7779841 L13,17.4293365 L13,12.0119396 L13,6.59454265 L9.06920843,9.24589504 C8.91816198,9.38145255 8.72475585,9.47141933 8.50904598,9.49426822 C8.4497727,9.50156175 8.39017333,9.5034281 8.33098415,9.5 L8.33098415,9.5 L5,9.5 L5,12.0119396 Z M3,12.0119396 L3,8.50157356 C3,8.2247344 3.11117675,7.97412842 3.29196292,7.79283868 C3.46994918,7.61192872 3.71994909,7.5 4.00000001,7.5 L8.08102098,7.5 L13.3535806,3.94361361 C13.5372091,3.81975463 13.7472793,3.76538554 13.9529683,3.77494994 C13.9685502,3.77423867 13.98423,3.77387913 14,3.77387913 C14.5522847,3.77387913 15,4.21934183 15,4.77259008 L15,12.0119396 L15,19.251289 C15,19.8045373 14.5522847,20.25 14,20.25 C13.98423,20.25 13.9685502,20.2496405 13.9529683,20.2489292 C13.7472793,20.2584936 13.5372091,20.2041245 13.3535806,20.0802655 L8.08102098,16.5238791 L4.00000001,16.5238791 C3.71994909,16.5238791 3.46994918,16.4119504 3.29196292,16.2310404 C3.11117675,16.0497507 3,15.7991447 3,15.5223056 L3,12.0119396 Z M17.5059844,15.7803571 L17.5,15.7726628 C18.6746368,14.8577452 19.4301566,13.4299638 19.4301566,11.8257212 C19.4301566,10.2214787 18.6746368,8.79369726 17.5,7.87877967 L17.5067574,7.87009164 C17.2041341,7.69816923 17,7.37292366 17,7 C17,6.44771525 17.4477153,6 18,6 C18.2836948,6 18.5397977,6.11813499 18.721799,6.30789526 L18.7279374,6.30000305 C20.3724289,7.58088767 21.4301566,9.57978168 21.4301566,11.8257212 C21.4301566,14.0716608 20.3724289,16.0705548 18.7279374,17.3514394 L18.7211832,17.3427554 C18.5392202,17.5321404 18.283375,17.6500092 18,17.6500092 C17.4477153,17.6500092 17,17.2022939 17,16.6500092 C17,16.2774031 17.2037866,15.9523939 17.5059844,15.7803571 L17.5059844,15.7803571 Z"})),kt=m.createElement("svg",{viewBox:"0 -4 16 24"},m.createElement("path",{d:"M15.9964 0.207284C15.9763 0.0904726 15.8753 0.00111298 15.7529 0L10.2896 0.0496215L10.2453 0.0539552C10.1305 0.0756663 10.0435 0.17619 10.0424 0.297344L10.0288 1.80465L10.0324 1.84962C10.0525 1.96643 10.1537 2.05579 10.2782 2.05691L12.5447 2.03585L9.82305 4.76408C9.72565 4.86172 9.72565 5.02001 9.82305 5.11764L10.8812 6.1783C10.9786 6.27593 11.1365 6.27593 11.234 6.1783L13.9687 3.43698L13.9479 5.73298L13.9515 5.77796C13.9716 5.89477 14.0726 5.98413 14.1951 5.98524L15.7034 5.97157L15.7476 5.96724C15.8624 5.94553 15.9494 5.845 15.9505 5.72385L16 0.252257L15.9964 0.207284ZM0.00361156 15.7942C0.0236739 15.911 0.124705 16.0004 0.247142 16.0015L5.71044 15.9519L5.75469 15.9476C5.8695 15.9259 5.95648 15.8253 5.95758 15.7042L5.97122 14.1969L5.9676 14.1519C5.94752 14.0351 5.84626 13.9457 5.72181 13.9446L3.45526 13.9657L6.17695 11.2374C6.27435 11.1398 6.27435 10.9815 6.17695 10.8839L5.11877 9.82322C5.02137 9.72559 4.86345 9.72559 4.76605 9.82322L2.03131 12.5645L2.05208 10.2685L2.04847 10.2236C2.02841 10.1068 1.92738 10.0174 1.80494 10.0163L0.296648 10.03L0.252399 10.0343C0.137582 10.056 0.0506014 10.1565 0.0495052 10.2777L0 15.7493L0.00361156 15.7942Z"})),Lt=m.createElement("svg",{viewBox:"0 -4 16 24"},m.createElement("path",{d:"M9.75361 6.04424C9.77367 6.16105 9.87471 6.25041 9.99714 6.25152L15.4604 6.2019L15.5047 6.19757C15.6195 6.17586 15.7065 6.07533 15.7076 5.95418L15.7212 4.44688L15.7176 4.4019C15.6975 4.28509 15.5963 4.19573 15.4718 4.19461L13.2053 4.21567L15.9269 1.48744C16.0244 1.38981 16.0244 1.23151 15.9269 1.13388L14.8688 0.0732233C14.7714 -0.0244078 14.6135 -0.0244078 14.516 0.0732233L11.7813 2.81454L11.8021 0.518539L11.7985 0.473566C11.7784 0.356754 11.6774 0.267395 11.5549 0.266282L10.0466 0.279951L10.0024 0.284285C9.88758 0.305996 9.8006 0.40652 9.79951 0.527674L9.75 5.99926L9.75361 6.04424ZM6.24639 9.95728C6.22633 9.84047 6.1253 9.75111 6.00286 9.75L0.539561 9.79962L0.495313 9.80396C0.380496 9.82567 0.293515 9.92619 0.292419 10.0473L0.278782 11.5546L0.282396 11.5996C0.302484 11.7164 0.403738 11.8058 0.528186 11.8069L2.79474 11.7859L0.0730518 14.5141C-0.0243506 14.6117 -0.0243506 14.77 0.0730518 14.8676L1.13123 15.9283C1.22863 16.0259 1.38655 16.0259 1.48395 15.9283L4.21869 13.187L4.19792 15.483L4.20153 15.528C4.22159 15.6448 4.32262 15.7341 4.44506 15.7352L5.95335 15.7216L5.9976 15.7172C6.11242 15.6955 6.1994 15.595 6.20049 15.4738L6.25 10.0023L6.24639 9.95728Z"})),Tt=c.StyleSheet.create({root:{padding:"0 0.5em"},rootTop:{height:"2em"},rootBottom:{height:"2.5em",display:"flex",alignItems:"center",justifyContent:"space-between"},rootBottomLeft:{display:"flex"},rootBottomRight:{display:"flex"},button:{display:"block",width:"2.5em",height:"2.5em",margin:0,padding:"0.5em",border:"none",borderRadius:0,fontSize:"inherit",color:"rgba(255, 255, 255, 0.7)",background:"none",cursor:"pointer",transition:"color 300ms",":hover":{color:"#fff"},":focus":{outline:"none"}},menuContainer:{position:"relative"},menu:{position:"absolute",left:"50%",bottom:"100%",visibility:"hidden",opacity:0,transform:"translateX(-50%)",transition:"visibility 300ms, opacity 300ms",backgroundColor:"rgba(0, 0, 0, 0.5)",borderRadius:"4px"},menuShown:{visibility:"visible",opacity:1},timeline:{flex:1},timelineHolder:{flex:1},time:{display:"flex",alignItems:"center",justifyContent:"center",padding:"0 0.5em",minWidth:"100px",fontSize:"0.875em",color:"rgba(255, 255, 255, 0.9)",boxSizing:"content-box",fontVariantNumeric:"tabular-nums"},labelButton:{width:"auto",lineHeight:1.5},labelButtonText:{fontSize:"0.875em"},qualityMenu:{padding:"0.25em 0"},qualityMenuItem:{display:"block",width:"100%",boxSizing:"border-box",height:"2em",margin:0,padding:"0 0.75em",border:"none",borderRadius:0,fontSize:"0.875em",lineHeight:2,whiteSpace:"nowrap",color:"rgba(255, 255, 255, 0.5)",background:"none",cursor:"pointer",transition:"color 300ms, background-color 300ms",":hover":{backgroundColor:"rgba(255, 255, 255, 0.2)"},":focus":{outline:"none"}},qualityMenuActiveItem:{color:"#fff"},fullScreenedTime:{width:"150px"},tooltipContent:{pointerEvents:"none",padding:"0.25em 0.5em",fontSize:"0.875em",whiteSpace:"nowrap",color:"#fff"}});const wt=e=>{var{icon:t,label:r}=e,n=Ce(e,["icon","label"]);return m.createElement("button",Object.assign({},n,{className:(0,c.css)(Tt.button,r?Tt.labelButton:null),type:"button"}),t&&m.createElement(ut,{icon:t}),r&&m.createElement("span",{className:(0,c.css)(Tt.labelButtonText)},r))},At="undefined"!=typeof document&&"ontouchstart"in document.documentElement,Rt=({localeKey:e,hotkey:t,children:r})=>{const n=Me(e),[a,i]=et();return m.createElement("div",{className:(0,c.css)(Tt.menuContainer),onMouseEnter:i.on,onMouseLeave:i.off},(0,m.cloneElement)(r,{"aria-label":n}),!At&&m.createElement("div",{className:(0,c.css)(Tt.menu,a&&Tt.menuShown,Tt.tooltipContent)},n,t&&` (${t})`))},xt=({isPlaying:e,onClick:t})=>m.createElement(Rt,{localeKey:e?"pause":"play",hotkey:"k"},m.createElement(wt,{icon:e?yt:Et,onClick:t}));function Ct(e,t){return t?100*T()(e/t,0,1)+"%":"0%"}var Ot=c.StyleSheet.create({root:{position:"absolute",display:"flex",top:0,bottom:0,width:"100%"},item:{position:"absolute",width:12,height:"100%",transform:"translate(-50%)",":hover":{height:6,top:-1}},innerItem:{width:6,backgroundColor:"#ff9607",height:"100%",margin:"0 auto"}});const Pt=({startTime:e,total:t,onProgressDotHover:r,onProgressDotLeave:n})=>{const a=(0,m.useRef)(null);return m.createElement("div",{className:(0,c.css)(Ot.item),style:{left:Ct(e,t)},onMouseEnter:()=>{if(!a.current)return;const{left:t,top:n}=a.current.getBoundingClientRect();null==r||r({startTime:e,left:t,top:n})},onMouseLeave:n},m.createElement("div",{ref:a,className:(0,c.css)(Ot.innerItem)}))},Dt=({progressDots:e=[],total:t,onProgressDotHover:r,onProgressDotLeave:n})=>m.createElement("div",{className:(0,c.css)(Ot.root)},e.map(((e,a)=>m.createElement(Pt,{key:a,startTime:e.startTime,total:t,onProgressDotHover:r,onProgressDotLeave:n}))));var Mt=c.StyleSheet.create({root:{overflow:"hidden",userSelect:"none",cursor:"pointer",touchAction:"none",WebkitTapHighlightColor:"transparent",":focus":{outline:"none"}},inner:{position:"relative",display:"flex",alignItems:"center",width:"100%",height:"100%"},track:{position:"relative",flex:1,overflow:"hidden",backgroundColor:"rgba(255, 255, 255, 0.3)",borderRadius:"2px"},bar:{position:"absolute",backgroundColor:"#fff",borderRadius:"2px 0 0 2px"},thumbWrapper:{position:"absolute"},thumb:{width:"1em",height:"1em",margin:"-0.5em",borderRadius:"50%",backgroundColor:"#fff"}});const Bt=c.StyleSheet.create({root:{height:"1em",padding:"0 0.5em"},inner:{flexDirection:"row"},track:{height:4},bar:{top:0,bottom:0},thumbWrapper:{top:"50%"}}),It=c.StyleSheet.create({root:{width:"1em",padding:"0.5em 0"},inner:{flexDirection:"column"},track:{width:4},bar:{left:0,right:0},thumbWrapper:{left:"50%"}}),Ft=(e,t)=>t?T()(e/t,0,1):0,Nt=e=>100*e+"%";function Ut(e){const{orientation:t,reverse:r,onFocus:n,onBlur:a,onChange:i,onDragStart:o,onDragEnd:s,noInteraction:l,progressDots:u,value:d=0,buffered:f=0,total:h=0,step:p=1,onProgressDotHover:v,onProgressDotLeave:g}=e,[{isSlideActive:y,isSliding:b,slidingValue:E},S]=((e={})=>{const[t,r]=(0,m.useState)(e);return[t,(0,m.useCallback)((e=>r((t=>Object.assign(Object.assign({},t),e)))),[])]})({isSlideActive:!1,isSliding:!1,slidingValue:null}),_="horizontal"===t,k=(0,m.useRef)(null),L=(...t)=>(0,c.css)(...t.map((t=>(t=>{const r=_?Bt:It;let n=e.styles;return Array.isArray(n)||(n=[n]),n=n.filter(Boolean),[Mt[t],r[t],...n.map((e=>e[t]))]})(t)))),w=_?r?"right":"left":r?"top":"bottom",A=_?"width":"height",R=e=>({[A]:"100%",transform:`${_?"scaleX":"scaleY"}(${e})`,transformOrigin:w}),x=e=>{const t=k.current;if(!t)return 0;const n=t.getBoundingClientRect();let a;return a=_?(e.clientX-n.left)/n.width:(n.bottom-e.clientY)/n.height,a=T()(a,0,1),r&&(a=1-a),a*h},C=Ie((e=>{const t=x(e);S({slidingValue:t,isSliding:!0}),P(t)})),O=Ie((e=>{null==s||s(),b&&P(x(e)),S({isSlideActive:!1,slidingValue:null,isSliding:!1})}));(0,m.useEffect)((()=>{if(y)return document.addEventListener("mousemove",C),document.addEventListener("mouseup",O),()=>{document.removeEventListener("mousemove",C),document.removeEventListener("mouseup",O)}}),[O,C,y]);const P=e=>{null==i||i(e)},D=l?{}:{tabIndex:0,onFocus:n,onBlur:a,onKeyDown:e=>{let t=0,n=!1;if("ArrowLeft"===e.key||"ArrowDown"===e.key?(n=!0,t=-1):"ArrowRight"!==e.key&&"ArrowUp"!==e.key||(n=!0,t=1),n){e.preventDefault(),r&&(t=-t);const n=T()(d+p*t,0,h);n!==d&&P(n)}},onMouseDown:e=>{if(0!==e.button)return;const t=x(e);S({isSlideActive:!0,slidingValue:t}),null==o||o(),P(t)}},M=Ft(y?E:d,h),B=Ft(f,h);return m.createElement("div",Object.assign({className:L("root")},D,{role:"slider"}),m.createElement("div",{className:L("inner")},m.createElement("div",{ref:k,className:L("track")},Boolean(f)&&m.createElement("div",{className:L("bar","buffered"),style:R(B)}),m.createElement("div",{className:L("bar"),style:R(M)}),Boolean(null==u?void 0:u.length)&&m.createElement(Dt,{progressDots:u,total:h,onProgressDotHover:v,onProgressDotLeave:g})),!l&&m.createElement("div",{className:L("thumbWrapper"),style:(e=>({[A]:"100%",transform:`${_?"translateX":"translateY"}(${Nt(_?e:1-e)})`,transformOrigin:w}))(M)},m.createElement("div",{className:L("thumb",y&&"thumbSliding")}))))}Ut.defaultProps={orientation:"horizontal",reverse:!1,progressDots:[]};var jt=c.StyleSheet.create({root:{}});const Gt=c.StyleSheet.create({root:{},track:{transition:"transform 300ms"},bar:{backgroundColor:"#0f88eb"},thumb:{transform:"scale(0)",transition:"transform 300ms"},buffered:{backgroundColor:"rgba(255, 255, 255, 0.6)",borderRadius:"2px 0 0 2px"}}),zt=c.StyleSheet.create({thumb:{transform:"scale(1)"}}),Wt=c.StyleSheet.create({track:{overflow:"visible"}}),Ht=c.StyleSheet.create({root:{position:"absolute",bottom:0,left:0,right:0,padding:0,height:"3px"},track:{borderRadius:0},thumb:{display:"none"},buffered:{backgroundColor:"rgba(255, 255, 255, 0.3)",borderRadius:"2px 0 0 2px"}}),Vt=(...e)=>(0,m.useCallback)(((...t)=>e.forEach((e=>e(...t)))),[]),qt=e=>{var{value:t,onDragStart:r,onDragEnd:n,onSeek:a,onChange:i,onProgressDotHover:o,onProgressDotLeave:s}=e,l=Ce(e,["value","onDragStart","onDragEnd","onSeek","onChange","onProgressDotHover","onProgressDotLeave"]);const[u,d]=et(),[f,h]=et(),[p,v]=et(),[g,y]=et(),b=Ie((e=>{e!==t&&(null==i||i(e)),p||null==a||a(e)}));return m.createElement("div",{className:(0,c.css)(jt.root),onMouseEnter:h.on,onMouseLeave:Vt(h.off,d.off)},m.createElement(Ut,Object.assign({},l,{styles:[Gt,(f||u||p)&&zt,g&&Wt].filter(Boolean),value:t,onChange:b,onFocus:d.on,onBlur:d.off,onDragStart:Vt(v.on,Ie(r||A())),onDragEnd:Vt(v.off,Ie(n||A())),onProgressDotHover:Vt(y.on,Ie(o||A())),onProgressDotLeave:Vt(y.off,Ie(s||A()))})))},Kt=e=>m.createElement("div",{className:(0,c.css)(Tt.timeline)},m.createElement(qt,Object.assign({},e))),Yt=({isFullScreen:e,currentTime:t,duration:r})=>m.createElement("div",{className:(0,c.css)(Tt.time,e&&Tt.fullScreenedTime)},`${rt(t)} / ${rt(r)}`),Qt=({name:e,style:t="text"})=>m.createElement(m.Fragment,null,Me(e,t)),Xt={auto:"quality-auto",ld:"quality-ld",sd:"quality-sd",hd:"quality-hd",fhd:"quality-fhd"};class $t extends m.PureComponent{constructor(){super(...arguments),this.state={isQualityHovered:!1},this.handleQualityPointerEnter=()=>{this.setState({isQualityHovered:!0})},this.handleQualityPointerLeave=()=>{this.setState({isQualityHovered:!1})}}render(){const{isQualityHovered:e}=this.state;return m.createElement(Qe.Consumer,null,(({qualities:t,setCurrentQuality:r,currentQuality:n})=>(null==t?void 0:t.length)>1&&m.createElement("div",{className:(0,c.css)(Tt.menuContainer),onMouseEnter:this.handleQualityPointerEnter,onMouseLeave:this.handleQualityPointerLeave},m.createElement(wt,{label:m.createElement(Qt,{style:"narrow",name:Xt[n]})}),m.createElement("div",{className:(0,c.css)(Tt.menu,e&&Tt.menuShown)},m.createElement("div",{className:(0,c.css)(Tt.qualityMenu)},t.map((e=>m.createElement("button",{key:e,className:(0,c.css)(Tt.qualityMenuItem,n===e&&Tt.qualityMenuActiveItem),onClick:()=>{this.handleQualityPointerLeave(),r(e)}},m.createElement(Qt,{name:Xt[e]})))))))))}}var Zt=c.StyleSheet.create({root:{padding:"0.375em 0"}});const Jt=c.StyleSheet.create({root:{width:"2.5em",height:"4em"},track:{margin:"-0.4em 0",transform:"translate3d(0, 0, 0)"},thumb:{transform:"scale(0.8)",transition:"transform 300ms",":hover":{transform:"scale(1)"}},thumbSliding:{transform:"scale(1)"}}),er=e=>m.createElement("div",{className:(0,c.css)(Zt.root)},m.createElement(Ut,Object.assign({},e,{styles:Jt,orientation:"vertical",step:.1}))),tr=({volume:e,menuShown:t,onMouseEnter:r,onMouseLeave:n,onDragStart:a,onDragEnd:i,onChange:o,onToggleMuted:s})=>m.createElement("div",{className:(0,c.css)(Tt.menuContainer),onMouseEnter:r,onMouseLeave:n},m.createElement(wt,{"aria-label":Me(0===e?"unmute":"mute"),icon:0===e?mt:_t,onClick:()=>null==s?void 0:s()}),m.createElement("div",{className:(0,c.css)(Tt.menu,t&&Tt.menuShown)},m.createElement(er,{value:e,total:1,onDragStart:a,onDragEnd:i,onChange:o}))),rr=({isFullScreen:e,onClick:t})=>m.createElement(Rt,{localeKey:e?"action-exit-fullscreen":"action-enter-fullscreen",hotkey:"f"},m.createElement(wt,{icon:e?St:gt,onClick:t})),nr=({isPip:e,onClick:t})=>m.createElement(Rt,{localeKey:e?"action-exit-pip":"action-enter-pip",hotkey:"p"},m.createElement(wt,{icon:e?vt:bt,onClick:t}));class ar extends m.PureComponent{constructor(){super(...arguments),this.state={isPlaybackRateHovered:!1},this.handlePlaybackRatePointerEnter=()=>{this.setState({isPlaybackRateHovered:!0})},this.handlePlaybackRatePointerLeave=()=>{this.setState({isPlaybackRateHovered:!1})}}render(){const{isPlaybackRateHovered:e}=this.state;return m.createElement(Qe.Consumer,null,(({playbackRates:t,setCurrentPlaybackRate:r,currentPlaybackRate:n})=>(null==t?void 0:t.length)>1&&m.createElement("div",{className:(0,c.css)(Tt.menuContainer),onMouseEnter:this.handlePlaybackRatePointerEnter,onMouseLeave:this.handlePlaybackRatePointerLeave},m.createElement(wt,{label:1===n.value?m.createElement(Qt,{name:"playback-rate"}):`${n.text}`}),m.createElement("div",{className:(0,c.css)(Tt.menu,e&&Tt.menuShown)},m.createElement("div",{className:(0,c.css)(Tt.qualityMenu)},$e(t).map((e=>m.createElement("button",{key:e.value,className:(0,c.css)(Tt.qualityMenuItem,n.value===e.value&&Tt.qualityMenuActiveItem),onClick:()=>{this.handlePlaybackRatePointerLeave(),r(e)}},e.text))))))))}}const ir=({isFullScreen:e,onClick:t})=>m.createElement(Rt,{localeKey:e?"action-exit-page-fullscreen":"action-enter-page-fullscreen",hotkey:"t"},m.createElement(wt,{icon:e?Lt:kt,onClick:t}));function or(e){const{isPlaying:t=!1,buffered:r,duration:n,currentTime:a,volume:i,isFullScreen:o=!1,isPageFullScreen:s,isPip:l,onDragStart:u,onDragEnd:d,onToggleFullScreen:f,onTogglePageFullScreen:h,onTogglePip:p,showPip:v,progressDots:g,hiddenPlayButton:y,hiddenTimeline:b,hiddenTime:E,hiddenQualityMenu:S,hiddenVolumeItem:_,hiddenPlaybackRateItem:k,hiddenFullScreenButton:L,shouldShowPageFullScreenButton:w,onProgressDotHover:A,onProgressDotLeave:R,onTogglePlay:x,onSeek:C,onToggleMuted:O,onVolumeChange:P}=e,[D,M]=et(),[B,I]=(0,m.useState)(),F=Ie((e=>{I(T()(e,0,n))})),N=Ie((e=>{null==C||C(T()(e,0,n)),I(void 0)})),U=B||a;return m.createElement("div",{className:(0,c.css)(Tt.root)},!b&&m.createElement(Kt,{value:a,total:n,buffered:r,progressDots:g,onDragStart:u,onDragEnd:d,onChange:F,onSeek:N,onProgressDotHover:A,onProgressDotLeave:R}),m.createElement("div",{className:(0,c.css)(Tt.rootBottom)},m.createElement("div",{className:(0,c.css)(Tt.rootBottomLeft)},!y&&m.createElement(xt,{isPlaying:t,onClick:()=>null==x?void 0:x()}),b&&m.createElement("div",{className:(0,c.css)(Tt.timelineHolder)}),!E&&m.createElement(Yt,{isFullScreen:o,currentTime:U,duration:n})),m.createElement("div",{className:(0,c.css)(Tt.rootBottomRight)},!k&&m.createElement(ar,null),!S&&m.createElement($t,null),v&&m.createElement(nr,{isPip:l,onClick:p}),w&&m.createElement(ir,{isFullScreen:s,onClick:h}),!L&&m.createElement(rr,{isFullScreen:o,onClick:f}),!_&&m.createElement(tr,{volume:i,menuShown:D,onMouseEnter:M.on,onMouseLeave:M.off,onToggleMuted:O,onChange:P}))))}or.defaultProps={show:!1,standalone:!1,duration:0,currentTime:0,volume:.5,buffered:0,isPageFullScreen:!1,showPip:!1,hiddenPlayButton:!1,hiddenTimeline:!1,hiddenTime:!1,hiddenQualityMenu:!1,hiddenPlaybackRateItem:!1,hiddenVolumeItem:!1,hiddenFullScreenButton:!1,progressDots:[]};var sr=m.memo(or),lr=m.createElement("svg",{viewBox:"0 0 20 20"},m.createElement("path",{d:"M10 0C4.477 0 0 4.477 0 10s4.477 10 10 10 10-4.477 10-10S15.523 0 10 0zm-.034 2.966c1.95 0 1.485 1.807 1.485 2.21 0 .116-.784 7.79-.784 7.79h-1.4S8.48 5.344 8.48 5.23c0-.417-.462-2.264 1.486-2.264zm1.057 13.522c-.294.287-.647.43-1.056.43-.41 0-.762-.142-1.058-.43-.296-.286-.444-.643-.444-1.07 0-.41.148-.762.443-1.057.294-.294.647-.44 1.057-.44.41 0 .762.142 1.056.43.296.286.443.643.443 1.07 0 .426-.147.782-.443 1.068z"})),ur=m.createElement("svg",{viewBox:"0 0 72 72"},m.createElement("g",{fill:"none",fillRule:"evenodd"},m.createElement("circle",{cx:"36",cy:"36",r:"36",fill:"#FFF",fillOpacity:".95"}),m.createElement("path",{fill:"#444",fillRule:"nonzero",d:"M41.143 22.5h5.786v27h-5.786zM25.071 22.5h5.786v27h-5.786z"}))),cr=m.createElement("svg",{viewBox:"0 0 72 72"},m.createElement("g",{fill:"none",fillRule:"evenodd"},m.createElement("circle",{cx:"36",cy:"36",r:"36",fill:"#FFF",fillOpacity:".95"}),m.createElement("path",{fill:"#444",fillRule:"nonzero",d:"M50.8350169,37.0602664 L29.4767217,49.9693832 C28.900608,50.3175908 28.1558807,50.1251285 27.8133266,49.5395068 C27.701749,49.3487566 27.6428571,49.1309436 27.6428571,48.9090213 L27.6428571,23.0907876 C27.6428571,22.4094644 28.1862113,21.8571429 28.8564727,21.8571429 C29.0747919,21.8571429 29.2890685,21.9170066 29.4767217,22.0304257 L50.8350169,34.9395425 C51.4111306,35.28775 51.6004681,36.0447682 51.257914,36.6303899 C51.154433,36.8072984 51.0090531,36.9550776 50.8350169,37.0602664 Z"}))),dr=m.createElement("svg",{viewBox:"0 0 24 24"},m.createElement("g",{fill:"none",fillRule:"evenodd"},m.createElement("rect",{width:"24",height:"24"}),m.createElement("path",{fill:"#FFF",d:"M12.4049973,3.62840003 C17.1876069,3.84468032 21,7.87252205 21,12.8096305 C21,17.8853314 16.9705627,22 12,22 C7.02943725,22 3,17.8853314 3,12.8096305 C3,12.0229797 3.624497,11.3852732 4.39485308,11.3852732 C5.16520917,11.3852732 5.78970616,12.0229797 5.78970616,12.8096305 C5.78970616,16.3120298 8.57014942,19.1512855 12,19.1512855 C15.4298506,19.1512855 18.2102938,16.3120298 18.2102938,12.8096305 C18.2102938,9.44617464 15.6460805,6.69429107 12.4049973,6.4812447 L12.4049973,8.30324795 C12.4049973,8.71101381 12.0954942,9.04157334 11.7137028,9.04157334 C11.5841406,9.04157334 11.457186,9.00268616 11.3473174,8.92934663 L6.42999892,5.64693477 C6.10624047,5.4308193 6.00781868,4.97530916 6.21016772,4.62952441 C6.26580359,4.53445089 6.34098153,4.45415835 6.42999892,4.3947374 L11.3473174,1.11232554 C11.6710759,0.896210069 12.0975703,1.00132779 12.2999193,1.34711255 C12.3685872,1.46445578 12.4049973,1.60004749 12.4049973,1.73842422 L12.4049973,3.62840003 Z"}))),fr=c.StyleSheet.create({container:{position:"absolute",pointerEvents:"none",overflow:"hidden"},containerFullWidth:{width:"100%",height:"auto",top:"50%",left:0,transform:"translate(0, -50%)"},containerFullHeight:{width:"auto",height:"100%",top:0,left:"50%",transform:"translate(-50%)"},image:{display:"block",visibility:"hidden"},imageFullWidth:{width:"100%",height:"auto"},imageFullHeight:{width:"auto",height:"100%"},layer:{position:"absolute",top:0,left:0,right:0,bottom:0,overflow:"hidden",pointerEvents:"none"}});const hr=e=>(0,c.css)(fr.container,e?fr.containerFullWidth:fr.containerFullHeight),pr=e=>(0,c.css)(fr.image,e?fr.imageFullWidth:fr.imageFullHeight),vr=({children:e})=>{const{isFullWidth:t,helperImageSrc:r}=(0,m.useContext)(qe);return r?m.createElement("div",{className:hr(t)},m.createElement("img",{src:r,className:pr(t)}),e):null},gr=({children:e})=>{const{objectFit:t}=(0,m.useContext)(ze);if(e){const r=m.createElement("div",{className:(0,c.css)(fr.layer)},e);return"cover"===t?r:m.createElement(vr,null,r)}return null},mr=2*Math.PI*30.5,yr={"0%":{strokeDashoffset:mr,transform:"rotate(0deg)"},"50%":{strokeDashoffset:mr/4,transform:"rotate(90deg)"},"100%":{strokeDashoffset:mr,transform:"rotate(360deg)"}};var br=c.StyleSheet.create({root:{width:"4em",height:"4em"},svg:{display:"block",width:"100%",height:"100%",animationName:{"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}},animationDuration:"2s",animationIterationCount:"infinite",animationTimingFunction:"linear"},circle:{cx:"50%",cy:"50%",r:30.5,strokeDasharray:mr,stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",fill:"none",transformOrigin:"center",animationName:yr,animationDuration:"1.5s",animationIterationCount:"infinite",animationTimingFunction:"ease-in-out"}});const Er=()=>m.createElement("div",{className:(0,c.css)(br.root)},m.createElement("svg",{viewBox:"0 0 64 64",className:(0,c.css)(br.svg)},m.createElement("circle",{className:(0,c.css)(br.circle)})));class Sr extends m.Component{shouldComponentUpdate(e){return this.props.show||e.show}render(){const{duration:e,currentTime:t,buffered:r,progressDots:n}=this.props;return m.createElement(Ut,{value:t,total:e,buffered:r,progressDots:n,styles:[Gt,Ht],noInteraction:!0})}}Sr.defaultProps={show:!1,duration:0,currentTime:0,buffered:0,progressDots:[]};const _r=({root:e,prevVolumeRef:t,isPlaying:r,isPageFullScreen:n,volume:a,duration:i,currentTime:o,standalone:s,onVolumeChange:l,onTogglePlay:u,onTogglePip:c,onToggleFullScreen:d,onTogglePageFullScreen:f,onSeek:h})=>{const p=ft(),{playbackRates:v,currentPlaybackRate:g,setCurrentPlaybackRate:y}=(0,m.useContext)(Qe),b=e=>{const t=null==v?void 0:v.findIndex((e=>e.value===g.value));if(t>=0){const r=v[t+("next"===e?1:-1)];p({icon:cr,label:(r||g).text}),r&&y(r)}},E=Ie(((e,t=!1)=>{e=T()(e,0,1),t&&p({icon:e?_t:mt,label:`${(100*e).toFixed(0)}%`}),null==l||l(e)})),S=Ie((e=>{h(T()(e,0,i))})),_=Ie((e=>{if(e.defaultPrevented)return;if(e.altKey||e.ctrlKey||e.metaKey)return;if(e.target&&(s=e.target,/^(input|textarea|select)$/i.test(s.tagName)||s.isContentEditable))return;var s;let l=!0;switch(e.key){case" ":case"k":case"K":p({icon:r?ur:cr}),u();break;case"p":case"P":c();break;case"t":case"T":f();break;case"f":case"F":d();break;case"Escape":n&&f();break;case"ArrowLeft":S(o-5);break;case"ArrowRight":S(o+5);break;case"ArrowUp":E(a+.05,!0);break;case"ArrowDown":E(a-.05,!0);break;case"j":case"J":S(o-10);break;case"l":case"L":S(o+10);break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":S(i/10*Number(e.key));break;case"m":case"M":E(a?0:t.current,!0);break;case"<":b("prev");break;case">":b("next");break;default:l=!1}l&&e.preventDefault()}));(0,m.useEffect)((()=>s?(document.addEventListener("keydown",_),()=>{document.removeEventListener("keydown",_)}):e?(e.addEventListener("keydown",_),()=>{e.removeEventListener("keydown",_)}):void 0),[_,e,s])},kr=[[i.PLAY,"onPlay"],[i.PLAYING,"onPlaying"],[i.PAUSE,"onPause"],[i.ENDED,"onEnded"],[i.TIMEUPDATE,"onTimeUpdate"],[i.ERROR,"onError"],[i.WAITING,"onWaiting"],[i.CANPLAY,"onCanPlay"],[i.LOADEDDATA,"onLoadedData"],[i.PROGRESS,"onProgress"]];function Lr(e){if(!e)return null;const{code:t,message:r}=e;return{code:t,message:r,name:e.name}}const Tr=m.forwardRef(((e,t)=>{const{updateVideoSize:r}=(0,m.useContext)(qe),{objectFit:n}=(0,m.useContext)(ze),{emitEvent:a}=(0,m.useContext)(Ue),i=(0,m.useRef)(e);(0,m.useEffect)((()=>{i.current=e}),[e]);const o=(0,m.useMemo)((()=>{const e={};return kr.forEach((([t,r])=>{e[r]=(e,...n)=>{var o,s;a(t,function(e){const{currentTime:t,duration:r,error:n,videoWidth:a,videoHeight:i}=e.currentTarget;return{currentTime:t,duration:r,videoWidth:a,videoHeight:i,error:Lr(n)}}(e));const l=i.current[r];return null===(s=(o=i.current).onNativeEvent)||void 0===s||s.call(o,e),null==l?void 0:l(e,...n)}})),e}),[a]),s=(0,m.useCallback)((e=>{var t,n;const a=e.currentTarget;if(a){const{videoWidth:e,videoHeight:t}=a;r({videoWidth:e,videoHeight:t})}null===(n=(t=i.current).onLoadedMetadata)||void 0===n||n.call(t,e)}),[r]),{Video:l,onNativeEvent:u}=e,c=Ce(e,["Video","onNativeEvent"]);return m.createElement(l,Object.assign({},c,o,{ref:t,style:{objectFit:n},onLoadedMetadata:s}))}));var wr={pluginName:"native",VideoComponent:e=>{const{onRef:t,paused:r,currentQuality:n,useAutoQuality:a,sources:i}=e,o=Ce(e,["onRef","paused","currentQuality","useAutoQuality","sources"]);return m.createElement("video",Object.assign({},o,{ref:t}))},willHandleSrcChange:!1},Ar=k()((function(e,t){return"m3u8"===e&&(null==P?void 0:P.VideoComponent)&&p()&&!function(){const e=document.createElement("video");return Boolean(e.canPlayType("application/vnd.apple.mpegURL"))}()?P:"mp4"===e&&(null==xe?void 0:xe.VideoComponent)&&p()&&t?xe:wr}),((...e)=>String(e))),Rr=c.StyleSheet.create({root:{display:"block",width:"100%",height:"100%"}});const{isMobile:xr}=h;class Cr extends m.Component{constructor(){super(...arguments),this.isMetadataLoaded=!1,this.pendingAction=null,this.loading=!1,this.isSwitchDefinition=!1,this.root=null,this.safeExecute=e=>{void 0!==this.playPromise?this.playPromise.then((()=>{e()})):e()},this.handleMetadataLoaded=()=>{this.isMetadataLoaded=!0,this.applyPendingAction(),this.isSwitchDefinition&&(this.isSwitchDefinition=!1,this.setRate(this.props.currentPlaybackRate),this.props.onEvent(i.CHANGE_QUALITY_SUCCESS,this.props.currentQuality))},this.handleDurationChange=()=>{const{onDurationUpdate:e}=this.props;e&&e(this.root.duration)},this.prevLoadingEvent=void 0,this.handleNativeEvent=e=>{var t,r,n,a;const i=e.type;"waiting"!==i&&"canplay"!==i&&"playing"!==i&&"error"!==i||("waiting"===i?(this.loading=!0,null===(r=(t=this.props).onLoadingChange)||void 0===r||r.call(t,this.loading)):("canplay"===i&&"waiting"===this.prevLoadingEvent||"playing"===i||"error"===i)&&(this.loading=!1,null===(a=(n=this.props).onLoadingChange)||void 0===a||a.call(n,this.loading)),this.prevLoadingEvent=i)},this.handleTimeUpdate=()=>{this.notifyTimeUpdate(!1)},this.notifyTimeUpdate=e=>{var t;const{onCurrentTimeUpdate:r,paused:n}=this.props;if(void 0!==this._timeUpdateRafId&&window.cancelAnimationFrame(this._timeUpdateRafId),n||this.loading)return;const a=null===(t=this.root)||void 0===t?void 0:t.currentTime;r&&a&&(r(a,e),xr||(this._timeUpdateRafId=window.requestAnimationFrame((()=>this.notifyTimeUpdate(!0)))))},this.handleProgress=()=>{const{onProgressUpdate:e}=this.props,t=this.root.buffered,r=[];for(let e=0;e{const{error:e,currentTime:t}=this.root||{};if(!e)return;const{code:r,message:n}=e;d.debug("Error: %o",{code:r,message:n,name:e.name});const a=(e=>e&&"NotAllowedError"===e.name)(e)||(e=>e&&"AbortError"===e.name||e instanceof MediaError&&e.code===MediaError.MEDIA_ERR_ABORTED)(e);a||this.props.onEvent(i.PLAY_FAILED,{currentTime:t}),this.isSwitchDefinition&&(this.isSwitchDefinition=!1,this.setRate(this.props.currentPlaybackRate),this.props.onEvent(i.CHANGE_QUALITY_FAIL,this.props.currentQuality)),this.props.onError(e)}}componentDidMount(){this.root.volume=Math.pow(this.props.volume,2)}getSnapshotBeforeUpdate(){return{paused:this.root.paused,currentTime:this.root.currentTime}}componentDidUpdate(e,t,r){const{src:n,paused:a,volume:o,format:s,useMSE:l,currentPlaybackRate:u,currentQuality:c,onEvent:d}=this.props;if(e.src&&n!==e.src){this.isSwitchDefinition=!0,d(i.CHANGE_QUALITY_START,c);const{willHandleSrcChange:e}=Ar(s,l);e||this.safeExecute((()=>{this.isMetadataLoaded=!1,this.seek(r.currentTime),r.paused||this.play()}))}a!==e.paused&&this.root&&a!==this.root.paused&&(a?this.pause():this.play()),this.root&&this.root.volume!==Math.pow(o,2)&&!xr&&(this.root.volume=Math.pow(o,2)),e.currentPlaybackRate.value!==u.value&&this.setRate(u)}pending(e){this.pendingAction=Object.assign(Object.assign({},this.pendingAction),e)}applyPendingAction(){if(!this.pendingAction)return;const e=this.pendingAction;this.pendingAction=null,void 0!==e.currentTime&&this.seek(e.currentTime),void 0!==e.paused&&this.root&&e.paused!==this.root.paused&&(e.paused?this.pause():this.play())}setRate(e){xr||this.isMetadataLoaded?this.safeExecute((()=>this.root.playbackRate=Number(e.value))):this.pending({paused:!0})}play(){var e;if(!xr&&!this.isMetadataLoaded)return this.pending({paused:!1}),void((null===(e=this.root)||void 0===e?void 0:e.load)&&this.safeExecute((()=>this.root.load())));this.playPromise=Promise.resolve(this.root.play()).catch((e=>{const{onError:t}=this.props;t&&t(e)}))}pause(){xr||this.isMetadataLoaded?this.safeExecute((()=>this.root.pause())):this.pending({paused:!0})}seek(e){var t;Number.isFinite(e)&&(this.isMetadataLoaded?(null===(t=this.root)||void 0===t?void 0:t.duration)&&(this.root.currentTime=e):this.pending({currentTime:e}))}render(){const{src:e,controls:t,loop:r,paused:n,volume:a,onPlay:i,onPause:o,onEnded:s,onLoadedData:l,onSeeking:u,onSeeked:d,format:f,useMSE:h,sources:p,currentQuality:v}=this.props,{VideoComponent:g}=Ar(f,h);return m.createElement(Tr,{onRef:e=>{this.root=e},className:(0,c.css)(Rr.root),preload:"metadata",playsInline:!0,"webkit-playsinline":"","x-webkit-airplay":"deny",muted:!a,controls:t,loop:r,src:e,onPlay:i,onPause:o,onEnded:s,onLoadedData:l,onSeeking:u,onSeeked:d,onClick:this.handleClick,onLoadedMetadata:this.handleMetadataLoaded,onError:this.handleError,onDurationChange:this.handleDurationChange,onTimeUpdate:this.handleTimeUpdate,onProgress:this.handleProgress,onNativeEvent:this.handleNativeEvent,paused:n,sources:p,currentQuality:v,Video:g})}}Cr.defaultProps={paused:!0,volume:.5};var Or=m.forwardRef(((e,t)=>m.createElement(Qe.Consumer,null,(({currentSrc:r,sources:n,currentQuality:a,format:i,currentPlaybackRate:o})=>m.createElement(Cr,Object.assign({ref:t},e,{src:r,format:i,sources:n,currentQuality:a,currentPlaybackRate:o}))))));const Pr=[],Dr=({autoplay:e,muted:t,error:r,title:n,cover:a,standalone:o,loop:l,duration:u=0,onBeforePlay:d,useMSE:f,useAutoQuality:p,alwaysShowVolumeButton:v,disablePictureInPicture:y,progressDots:b=Pr,hiddenPlayButton:E,hiddenTimeline:S,hiddenTime:_,hiddenQualityMenu:k,hiddenVolume:L,hiddenFullScreenButton:T,shouldShowPageFullScreenButton:w,children:A,hiddenPlaybackRateItem:R,hideMobileControls:x,hideCover:C,noWriteDocTitle:O,layerContent:P})=>{var D,M;const{emitEvent:B,subscribeAction:I}=(0,m.useContext)(Ue),{currentSrc:F,sources:N}=(0,m.useContext)(Qe),[U,j]=(0,m.useState)(null),G=(0,m.useRef)(),z=ft(),[W,H]=(0,m.useState)([]),[V,q]=(0,m.useState)(.5),[K,Y]=(0,m.useState)(u),[Q,X]=(0,m.useState)(0),[$,Z]=et(),[J,ee]=et(),[te,re]=et(),[ne,ae]=et(!0),[ie,oe]=et(),[se,le]=et(),[ue,ce]=et(),[de,fe]=et(),[he,pe]=et(),[ve,ge]=et(),[me,ye]=et(),be=(0,m.useRef)();var Ee;(0,m.useEffect)((()=>{u&&!K&&Y(u)}),[K,u]),Ee=()=>{const r=it.get("@griffith/history-volume");r&&q(r);const n=[I(s.PLAY,ke),I(s.PAUSE,_e),I(s.TIME_UPDATE,(({currentTime:e})=>we(e))),I(s.SHOW_CONTROLLER,Pe),I(s.SET_VOLUME,(({volume:e})=>Te(e)))];return G.current.root&&(t&&Te(0),e&&ke()),()=>{n.forEach((e=>e.unsubscribe()))}},(0,m.useEffect)(Ee,[]);const Se=te?!J||ie||se||ue:0!==Q;(0,m.useEffect)((()=>{B(Se?i.SHOW_CONTROLLER:i.HIDE_CONTROLLER)}),[B,Se]),(0,m.useEffect)((()=>{o&&"string"==typeof n&&n!==document.title&&!O&&(document.title=n)}),[O,o,n]),(0,m.useEffect)((()=>{y||!G.current.root||be.current||(be.current=new nt,be.current.init(G.current.root,(()=>B(i.ENTER_PIP)),(()=>B(i.EXIT_PIP))))}),[y,B]);const _e=Ie((({dontApplyOnFullScreen:e}={})=>{J&&(e&&Boolean(g().element)||Le())})),ke=Ie((()=>{B(i.REQUEST_PLAY),Promise.resolve(null==d?void 0:d(F)).then((()=>{te||(B(i.PLAY_COUNT),re.on(),$||ye.on(),h.isIE&&0!==Q&&we(0)),ee.on(),ae.off()})).catch((()=>{B(i.PLAY_REJECTED)}))})),Le=Ie((()=>{B(i.REQUEST_PAUSE),ee.off()})),Te=Ie((e=>{e=Math.round(100*e)/100,q(e),it.set("@griffith/history-volume",e)})),we=Ie((e=>{var t;X(e),null===(t=G.current)||void 0===t||t.seek(e)})),Ae=(0,m.useRef)(!1),Re=Ie((()=>{if(g().enabled){const e=()=>B(i.ENTER_FULLSCREEN),t=()=>B(i.EXIT_FULLSCREEN);null===g()||void 0===g()||g().toggle(U,e,t)}})),xe=Ie((()=>{var e;Boolean(g().element)&&!(null===(e=be.current)||void 0===e?void 0:e.pictureInPictureElement)&&Re(),ve?(ge.off(),B(i.EXIT_PAGE_FULLSCREEN)):(ge.on(),B(i.ENTER_PAGE_FULLSCREEN))})),Ce=Ie((()=>{var e;ve&&(ge.off(),B(i.EXIT_PAGE_FULLSCREEN)),null===(e=be.current)||void 0===e||e.toggle()})),Oe=(0,m.useRef)(null),Pe=Ie((()=>{ie||oe.on(),null!==Oe.current&&clearTimeout(Oe.current),Oe.current=setTimeout((()=>{Oe.current=null,oe.off()}),3e3)})),De=Ie((()=>{J?Le():ke()})),Me=(0,m.useRef)(V),Be=Ie((()=>{V&&(Me.current=V),Te(V?0:Me.current)}));_r({root:U,prevVolumeRef:Me,isPlaying:J,volume:V,currentTime:Q,duration:K,standalone:o,isPageFullScreen:ve,onTogglePlay:De,onToggleFullScreen:Re,onTogglePageFullScreen:xe,onTogglePip:Ce,onVolumeChange:Te,onSeek:we});const Fe=He(N);(0,m.useEffect)((()=>{Fe&&Fe!==N&&(we(0),Le(),e&&ke())}),[e,ke,we,Le,Fe,N]);const Ne=Boolean(null===(D=be.current)||void 0===D?void 0:D.pictureInPictureElement),je=Boolean(g().element)&&!Ne,Ge=(0,m.useMemo)((()=>function(e,t){const r=t.find((t=>t.start<=e&&e<=t.end));return r?r.end:0}(Q,W)),[W,Q]),We=!me||0!==Q,Ve=We&&te,qe=!h.isMobile&&m.createElement("div",{className:(0,c.css)(ot.overlay,ne&&ot.overlayMask)},te&&me&&m.createElement("div",{className:(0,c.css)(ot.loader)},m.createElement(Er,null)),m.createElement("div",{className:(0,c.css)(ot.backdrop),onTouchStart:e=>{e.preventDefault()},onClick:()=>{z({icon:J?ur:cr}),De()}}),n&&je&&m.createElement("div",{className:(0,c.css)(ot.title,Se&&ot.titleShown)},n),!S&&J&&We&&m.createElement("div",{className:(0,c.css)(st.base,Se?st.hidden:st.shown)},m.createElement(Sr,{progressDots:b,buffered:Ge,duration:K,currentTime:Q,show:!Se})),v&&Ve&&m.createElement("div",{className:(0,c.css)(ot.volumeButton,st.base,Se?st.hidden:st.shown)},m.createElement(tr,{volume:V})),Ve&&m.createElement("div",{className:(0,c.css)(ot.controller,st.base,Se?st.shown:st.hidden),onMouseEnter:le.on,onMouseLeave:le.off},m.createElement(sr,{standalone:o,isPlaying:J,duration:K,currentTime:Q,volume:V,progressDots:b,buffered:Ge,isFullScreen:je,isPageFullScreen:ve,isPip:Ne,onDragStart:ce.on,onDragEnd:ce.off,onTogglePlay:De,onToggleMuted:Be,onSeek:we,onVolumeChange:Te,onToggleFullScreen:Re,onTogglePageFullScreen:xe,onTogglePip:Ce,onProgressDotHover:e=>{B(i.HOVER_PROGRESS_DOT,e)},onProgressDotLeave:()=>{B(i.LEAVE_PROGRESS_DOT)},show:Se,showPip:!y&&(null===(M=be.current)||void 0===M?void 0:M.supported),hiddenPlayButton:E,hiddenTimeline:S,hiddenTime:_,hiddenQualityMenu:k,hiddenVolumeItem:L,hiddenPlaybackRateItem:R,hiddenFullScreenButton:T,shouldShowPageFullScreenButton:w})));return m.createElement("div",{className:(0,c.css)(ot.root,je&&ot.fullScreened,ve&&ot.pageFullScreen),onMouseLeave:()=>{fe.off(),null!==Oe.current&&(clearTimeout(Oe.current),Oe.current=null),oe.off()},onMouseEnter:()=>{fe.on(),Pe()},onMouseDown:()=>{pe.on(),Pe()},onMouseUp:()=>{pe.off(),Pe()},onMouseMove:Pe,ref:j,tabIndex:-1,"aria-label":n},m.createElement("div",{className:(0,c.css)(ot.video)},m.createElement(Or,{ref:G,controls:h.isMobile&&te&&!x,paused:!J,volume:V,loop:l,onPlay:()=>{J||ee.on()},onPause:()=>{J&&ee.off()},onEnded:()=>{re.off(),ee.off(),ye.off()},onLoadedData:()=>{Z.on(),ye.off()},onError:()=>{ee.off()},onLoadingChange:e=>{e?ye.on():ye.off()},onDurationUpdate:e=>{Y(e)},onCurrentTimeUpdate:e=>{me||Ae.current||X(e)},onSeeking:()=>{Ae.current=!0},onSeeked:()=>{Ae.current=!1},onProgressUpdate:e=>{H(e)},onEvent:B,useMSE:f,useAutoQuality:p})),x&&te&&me&&m.createElement("div",{className:(0,c.css)(ot.loader)},m.createElement(Er,null)),!C&&m.createElement("div",{className:(0,c.css)(ot.cover,!te&&ot.coverShown),onClick:()=>ke()},a&&m.createElement(ze.Consumer,null,(({objectFit:e})=>m.createElement("img",{className:(0,c.css)(ot.coverImage),src:a,style:{objectFit:e}}))),K&&0===Q&&m.createElement("div",{className:(0,c.css)(ot.coverTime,h.isMobile&&ot.coverTimeMobile)},rt(K)),ne&&m.createElement("div",{className:(0,c.css)(ot.coverAction)},m.createElement("div",{className:(0,c.css)(ot.actionButton)},m.createElement(ut,{icon:cr,styles:ot.actionIcon}))),!ne&&0!==Q&&m.createElement("div",{className:(0,c.css)(ot.coverReplayAction)},m.createElement("div",{className:(0,c.css)(ot.coverReplayButton,de&&ot.coverReplayButtonHovered,he&&ot.coverReplayButtonPressed)},m.createElement(ut,{icon:dr,styles:ot.replayIcon}),m.createElement(Qt,{name:"replay"})))),qe,m.createElement(pt,null),P&&m.createElement(gr,null,P),r&&m.createElement("div",{className:(0,c.css)(ot.error)},m.createElement(ut,{icon:lr,styles:ot.errorIcon}),r.message&&m.createElement("div",{className:(0,c.css)(ot.errorMessage)},r.message)),A)},Mr={value:1,text:"1.0x"},Br=[{value:.5,text:"0.5x"},{value:.75,text:"0.75x"},{value:1,text:"1.0x"},{value:1.25,text:"1.25x"},{value:1.5,text:"1.5x"},{value:2,text:"2.0x"}];var Ir=m.memo((e=>{var{standalone:t,id:r,sources:n,onEvent:a,dispatchRef:i,enableCrossWindowMessage:o,messageContextRef:s,shouldObserveResize:l,initialObjectFit:u,locale:c=Oe,localeConfig:d,defaultQuality:f,defaultQualityOrder:h="asc",defaultPlaybackRate:p=Mr,playbackRates:v=Br,useAutoQuality:g=!1}=e,y=Ce(e,["standalone","id","sources","onEvent","dispatchRef","enableCrossWindowMessage","messageContextRef","shouldObserveResize","initialObjectFit","locale","localeConfig","defaultQuality","defaultQualityOrder","defaultPlaybackRate","playbackRates","useAutoQuality"]);return m.createElement(We,{initialObjectFit:u},m.createElement(Ye,{shouldObserveResize:l},m.createElement(Ge,{id:r,enableCrossWindow:void 0!==o?o:t,onEvent:a,dispatchRef:i,messageContextRef:s},m.createElement(Je,{sources:n,defaultQuality:f,useAutoQuality:g,defaultPlaybackRate:p,defaultQualityOrder:h,playbackRates:v},m.createElement(Be,{locale:c,localeConfig:d},m.createElement(ht,null,m.createElement(Dr,Object.assign({},y,{useAutoQuality:g,standalone:t}))))))))}))},39182:function(e){e.exports=function e(t,r,n){function a(o,s){if(!r[o]){if(!t[o]){if(i)return i(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var u=r[o]={exports:{}};t[o][0].call(u.exports,(function(e){return a(t[o][1][e]||e)}),u,u.exports,e,t,r,n)}return r[o].exports}for(var i=void 0,o=0;o0&&this._events[e].length>r&&(this._events[e].warned=!0,console.trace),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(e,t){function r(){this.removeListener(e,r),n||(n=!0,t.apply(this,arguments))}if(!a(t))throw TypeError("listener must be a function");var n=!1;return r.listener=t,this.on(e,r),this},n.prototype.removeListener=function(e,t){var r,n,o,s;if(!a(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(o=(r=this._events[e]).length,n=-1,r===t||a(r.listener)&&r.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(i(r)){for(s=o;s-- >0;)if(r[s]===t||r[s].listener&&r[s].listener===t){n=s;break}if(n<0)return this;1===r.length?(r.length=0,delete this._events[e]):r.splice(n,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},n.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(a(r=this._events[e]))this.removeListener(e,r);else if(r)for(;r.length;)this.removeListener(e,r[r.length-1]);return delete this._events[e],this},n.prototype.listeners=function(e){return this._events&&this._events[e]?a(this._events[e])?[this._events[e]]:this._events[e].slice():[]},n.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(a(t))return 1;if(t)return t.length}return 0},n.listenerCount=function(e,t){return e.listenerCount(t)}},{}],2:[function(e,t,r){!function(e){var n=/^((?:[^\/;?#]+:)?)(\/\/[^\/\;?#]*)?(.*?)??(;.*?)?(\?.*?)?(#.*?)?$/,a=/^([^\/;?#]*)(.*)$/,i=/(?:\/|^)\.(?=\/)/g,o=/(?:\/|^)\.\.\/(?!\.\.\/).*?(?=\/)/g,s={buildAbsoluteURL:function(e,t,r){if(r=r||{},e=e.trim(),!(t=t.trim())){if(!r.alwaysNormalize)return e;var n=this.parseURL(e);if(!o)throw new Error("Error trying to parse base URL.");return n.path=s.normalizePath(n.path),s.buildURLFromParts(n)}var i=this.parseURL(t);if(!i)throw new Error("Error trying to parse relative URL.");if(i.scheme)return r.alwaysNormalize?(i.path=s.normalizePath(i.path),s.buildURLFromParts(i)):t;var o=this.parseURL(e);if(!o)throw new Error("Error trying to parse base URL.");if(!o.netLoc&&o.path&&"/"!==o.path[0]){var l=a.exec(o.path);o.netLoc=l[1],o.path=l[2]}o.netLoc&&!o.path&&(o.path="/");var u={scheme:o.scheme,netLoc:i.netLoc,path:null,params:i.params,query:i.query,fragment:i.fragment};if(!i.netLoc&&(u.netLoc=o.netLoc,"/"!==i.path[0]))if(i.path){var c=o.path,d=c.substring(0,c.lastIndexOf("/")+1)+i.path;u.path=s.normalizePath(d)}else u.path=o.path,i.params||(u.params=o.params,i.query||(u.query=o.query));return null===u.path&&(u.path=r.alwaysNormalize?s.normalizePath(i.path):i.path),s.buildURLFromParts(u)},parseURL:function(e){var t=n.exec(e);return t?{scheme:t[1]||"",netLoc:t[2]||"",path:t[3]||"",params:t[4]||"",query:t[5]||"",fragment:t[6]||""}:null},normalizePath:function(e){for(e=e.split("").reverse().join("").replace(i,"");e.length!==(e=e.replace(o,"")).length;);return e.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}};"object"==typeof r&&"object"==typeof t?t.exports=s:"object"==typeof r?r.URLToolkit=s:e.URLToolkit=s}(this)},{}],3:[function(e,t,r){var n=arguments[3],a=arguments[4],i=arguments[5],o=JSON.stringify;t.exports=function(e,t){for(var r,s=Object.keys(i),l=0,u=s.length;l500*r.duration/c){var d=e.levels,f=Math.max(1,o.bw?o.bw/8:1e3*o.loaded/l),h=d[r.level],p=h.realBitrate?Math.max(h.realBitrate,h.bitrate):h.bitrate,v=o.total?o.total:Math.max(o.loaded,Math.round(r.duration*p/8)),g=t.currentTime,m=(v-o.loaded)/f,y=(s.default.bufferInfo(t,g,e.config.maxBufferHole).end-g)/c;if(y<2*r.duration/c&&m>y){var b=void 0,E=void 0;for(E=r.level-1;E>a;E--){var S=d[E].realBitrate?Math.max(d[E].realBitrate,d[E].bitrate):d[E].bitrate;if((b=r.duration*S/(6.4*f))=n;c--){var d,f=l[c].details,h=f?f.totalduration/f.fragments.length:t,p=!!f&&f.live;d=c<=e?o*r:s*r;var v=l[c].realBitrate?Math.max(l[c].realBitrate,l[c].bitrate):l[c].bitrate,g=v*h/d;if(u.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+c+"/"+Math.round(d)+"/"+v+"/"+h+"/"+i+"/"+g),d>v&&(!g||p&&!this.bitrateTestDelay||g=0)return p;u.logger.trace("rebuffering expected to happen, lets try to find a quality level minimizing the rebuffering");var v=l?Math.min(l,n.maxStarvationDelay):n.maxStarvationDelay,g=n.abrBandWidthFactor,m=n.abrBandWidthUpFactor;if(0===h){var y=this.bitrateTestDelay;y&&(v=(l?Math.min(l,n.maxLoadingDelay):n.maxLoadingDelay)-y,u.logger.trace("bitrate test took "+Math.round(1e3*y)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*v)+" ms"),g=m=1)}return p=this._findBestLevel(o,l,f,a,t,h+v,g,m,r),Math.max(p,0)}}]),t}(o.default);r.default=d},{28:28,29:29,30:30,32:32,44:44,46:46}],6:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r.1){var a=n.updating;try{n.abort()}catch(e){a=!0,s.logger.warn("can not abort audio buffer: "+e)}a?this.audioTimestampOffset=e.start:(s.logger.warn("change mpeg audio timestamp offset from "+n.timestampOffset+" to "+e.start),n.timestampOffset=e.start)}}}},{key:"onManifestParsed",value:function(e){var t=e.audio,r=e.video||e.levels.length&&e.audio,n=0;e.altAudio&&(t||r)&&(n=(t?1:0)+(r?1:0),s.logger.log(n+" sourceBuffer(s) expected")),this.sourceBufferNb=n}},{key:"onMediaAttaching",value:function(e){var t=this.media=e.media;if(t){var r=this.mediaSource=new MediaSource;this.onmso=this.onMediaSourceOpen.bind(this),this.onmse=this.onMediaSourceEnded.bind(this),this.onmsc=this.onMediaSourceClose.bind(this),r.addEventListener("sourceopen",this.onmso),r.addEventListener("sourceended",this.onmse),r.addEventListener("sourceclose",this.onmsc),t.src=URL.createObjectURL(r)}}},{key:"onMediaDetaching",value:function(){s.logger.log("media source detaching");var e=this.mediaSource;if(e){if("open"===e.readyState)try{e.endOfStream()}catch(e){s.logger.warn("onMediaDetaching:"+e.message+" while calling endOfStream")}e.removeEventListener("sourceopen",this.onmso),e.removeEventListener("sourceended",this.onmse),e.removeEventListener("sourceclose",this.onmsc),this.media&&(URL.revokeObjectURL(this.media.src),this.media.removeAttribute("src"),this.media.load()),this.mediaSource=null,this.media=null,this.pendingTracks={},this.tracks={},this.sourceBuffer={},this.flushRange=[],this.segments=[],this.appended=0}this.onmso=this.onmse=this.onmsc=null,this.hls.trigger(i.default.MEDIA_DETACHED)}},{key:"onMediaSourceOpen",value:function(){s.logger.log("media source opened"),this.hls.trigger(i.default.MEDIA_ATTACHED,{media:this.media});var e=this.mediaSource;e&&e.removeEventListener("sourceopen",this.onmso),this.checkPendingTracks()}},{key:"checkPendingTracks",value:function(){var e=this.pendingTracks,t=Object.keys(e).length;t&&(this.sourceBufferNb<=t||0===this.sourceBufferNb)&&(this.createSourceBuffers(e),this.pendingTracks={},this.doAppending())}},{key:"onMediaSourceClose",value:function(){s.logger.log("media source closed")}},{key:"onMediaSourceEnded",value:function(){s.logger.log("media source ended")}},{key:"onSBUpdateEnd",value:function(){if(this.audioTimestampOffset){var e=this.sourceBuffer.audio;s.logger.warn("change mpeg audio timestamp offset from "+e.timestampOffset+" to "+this.audioTimestampOffset),e.timestampOffset=this.audioTimestampOffset,delete this.audioTimestampOffset}this._needsFlush&&this.doFlush(),this._needsEos&&this.checkEos(),this.appending=!1;var t=this.parent,r=this.segments.reduce((function(e,r){return r.parent===t?e+1:e}),0);this.hls.trigger(i.default.BUFFER_APPENDED,{parent:t,pending:r}),this._needsFlush||this.doAppending(),this.updateMediaElementDuration()}},{key:"onSBUpdateError",value:function(e){s.logger.error("sourceBuffer error:",e),this.hls.trigger(i.default.ERROR,{type:l.ErrorTypes.MEDIA_ERROR,details:l.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1})}},{key:"onBufferReset",value:function(){var e=this.sourceBuffer;for(var t in e){var r=e[t];try{this.mediaSource.removeSourceBuffer(r),r.removeEventListener("updateend",this.onsbue),r.removeEventListener("error",this.onsbe)}catch(e){}}this.sourceBuffer={},this.flushRange=[],this.segments=[],this.appended=0}},{key:"onBufferCodecs",value:function(e){if(0===Object.keys(this.sourceBuffer).length){for(var t in e)this.pendingTracks[t]=e[t];var r=this.mediaSource;r&&"open"===r.readyState&&this.checkPendingTracks()}}},{key:"createSourceBuffers",value:function(e){var t=this.sourceBuffer,r=this.mediaSource;for(var n in e)if(!t[n]){var a=e[n],o=a.levelCodec||a.codec,u=a.container+";codecs="+o;s.logger.log("creating sourceBuffer("+u+")");try{var c=t[n]=r.addSourceBuffer(u);c.addEventListener("updateend",this.onsbue),c.addEventListener("error",this.onsbe),this.tracks[n]={codec:o,container:a.container},a.buffer=c}catch(e){s.logger.error("error while trying to add sourceBuffer:"+e.message),this.hls.trigger(i.default.ERROR,{type:l.ErrorTypes.MEDIA_ERROR,details:l.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,err:e,mimeType:u})}}this.hls.trigger(i.default.BUFFER_CREATED,{tracks:e})}},{key:"onBufferAppending",value:function(e){this._needsFlush||(this.segments?this.segments.push(e):this.segments=[e],this.doAppending())}},{key:"onBufferAppendFail",value:function(e){s.logger.error("sourceBuffer error:",e.event),this.hls.trigger(i.default.ERROR,{type:l.ErrorTypes.MEDIA_ERROR,details:l.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1})}},{key:"onBufferEos",value:function(e){var t=this.sourceBuffer,r=e.type;for(var n in t)r&&n!==r||t[n].ended||(t[n].ended=!0,s.logger.log(n+" sourceBuffer now EOS"));this.checkEos()}},{key:"checkEos",value:function(){var e=this.sourceBuffer,t=this.mediaSource;if(t&&"open"===t.readyState){for(var r in e){var n=e[r];if(!n.ended)return;if(n.updating)return void(this._needsEos=!0)}s.logger.log("all media data available, signal endOfStream() to MediaSource and stop loading fragment");try{t.endOfStream()}catch(e){s.logger.warn("exception while calling mediaSource.endOfStream()")}this._needsEos=!1}else this._needsEos=!1}},{key:"onBufferFlushing",value:function(e){this.flushRange.push({start:e.startOffset,end:e.endOffset,type:e.type}),this.flushBufferCounter=0,this.doFlush()}},{key:"onLevelUpdated",value:function(e){var t=e.details;0!==t.fragments.length&&(this._levelDuration=t.totalduration+t.fragments[0].start,this.updateMediaElementDuration())}},{key:"updateMediaElementDuration",value:function(){var e=this.media,t=this.mediaSource,r=this.sourceBuffer,n=this._levelDuration;if(null!==n&&e&&t&&r&&0!==e.readyState&&"open"===t.readyState){for(var a in r)if(r[a].updating)return;null===this._msDuration&&(this._msDuration=t.duration);var i=e.duration;(n>this._msDuration&&n>i||i===1/0||isNaN(i))&&(s.logger.log("Updating mediasource duration to "+n.toFixed(3)),this._msDuration=t.duration=n)}}},{key:"doFlush",value:function(){for(;this.flushRange.length;){var e=this.flushRange[0];if(!this.flushBuffer(e.start,e.end,e.type))return void(this._needsFlush=!0);this.flushRange.shift(),this.flushBufferCounter=0}if(0===this.flushRange.length){this._needsFlush=!1;var t=0,r=this.sourceBuffer;try{for(var n in r)t+=r[n].buffered.length}catch(e){s.logger.error("error while accessing sourceBuffer.buffered")}this.appended=t,this.hls.trigger(i.default.BUFFER_FLUSHED)}}},{key:"doAppending",value:function(){var e=this.hls,t=this.sourceBuffer,r=this.segments;if(Object.keys(t).length){if(this.media.error)return this.segments=[],void s.logger.error("trying to append although a media error occured, flush segment and abort");if(this.appending)return;if(r&&r.length){var n=r.shift();try{var a=t[n.type];a?a.updating?r.unshift(n):(a.ended=!1,this.parent=n.parent,a.appendBuffer(n.data),this.appendError=0,this.appended++,this.appending=!0):this.onSBUpdateEnd()}catch(t){s.logger.error("error while trying to append buffer:"+t.message),r.unshift(n);var o={type:l.ErrorTypes.MEDIA_ERROR,parent:n.parent};if(22===t.code)return this.segments=[],o.details=l.ErrorDetails.BUFFER_FULL_ERROR,o.fatal=!1,void e.trigger(i.default.ERROR,o);if(this.appendError?this.appendError++:this.appendError=1,o.details=l.ErrorDetails.BUFFER_APPEND_ERROR,this.appendError>e.config.appendErrorMaxRetry)return s.logger.log("fail "+e.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),r=[],o.fatal=!0,void e.trigger(i.default.ERROR,o);o.fatal=!1,e.trigger(i.default.ERROR,o)}}}}},{key:"flushBuffer",value:function(e,t,r){var n,a,i,o,l,u,c=this.sourceBuffer;if(Object.keys(c).length){if(s.logger.log("flushBuffer,pos/start/end: "+this.media.currentTime.toFixed(3)+"/"+e+"/"+t),this.flushBufferCounter.5)return this.flushBufferCounter++,s.logger.log("flush "+d+" ["+l+","+u+"], of ["+i+","+o+"], pos:"+this.media.currentTime),n.remove(l,u),!1}catch(e){s.logger.warn("exception while accessing sourcebuffer, it might have been removed from MediaSource")}}}else s.logger.warn("abort flushing too many retries");s.logger.log("buffer flushed")}return!0}}]),t}(o.default);r.default=u},{28:28,29:29,30:30,46:46}],7:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;rthis.autoLevelCapping&&t.streamController.nextLevelSwitch(),this.autoLevelCapping=t.autoLevelCapping}}}},{key:"getMaxLevel",value:function(e){var r=this;if(!this.levels)return-1;var n=this.levels.filter((function(n,a){return t.isLevelAllowed(a,r.restrictedLevels)&&a<=e}));return t.getMaxLevelByMediaSize(n,this.mediaWidth,this.mediaHeight)}},{key:"mediaWidth",get:function(){var e=void 0,r=this.media;return r&&(e=r.width||r.clientWidth||r.offsetWidth,e*=t.contentScaleFactor),e}},{key:"mediaHeight",get:function(){var e=void 0,r=this.media;return r&&(e=r.height||r.clientHeight||r.offsetHeight,e*=t.contentScaleFactor),e}}],[{key:"isLevelAllowed",value:function(e){return-1===(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]).indexOf(e)}},{key:"getMaxLevelByMediaSize",value:function(e,t,r){if(!e||e&&!e.length)return-1;for(var n=e.length-1,a=0;a=t||i.height>=r)&&function(e,t){return!t||e.width!==t.width||e.height!==t.height}(i,e[a+1])){n=a;break}}return n}},{key:"contentScaleFactor",get:function(){var e=1;try{e=window.devicePixelRatio}catch(e){}return e}}]),t}(n(e(29)).default);r.default=o},{29:29,30:30}],8:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r0&&o>c.config.fpsDroppedMonitoringThreshold*l){var d=c.currentLevel;s.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+d),d>0&&(-1===c.autoLevelCapping||c.autoLevelCapping>=d)&&(d-=1,c.trigger(i.default.FPS_DROP_LEVEL_CAPPING,{level:d,droppedLevel:c.currentLevel}),c.autoLevelCapping=d,c.streamController.nextLevelSwitch())}}this.lastTime=n,this.lastDroppedFrames=r,this.lastDecodedFrames=t}}},{key:"checkFPSInterval",value:function(){var e=this.video;if(e)if(this.isVideoPlaybackQualityAvailable){var t=e.getVideoPlaybackQuality();this.checkFPS(e,t.totalVideoFrames,t.droppedVideoFrames)}else this.checkFPS(e,e.webkitDecodedFrameCount,e.webkitDroppedFrameCount)}}]),t}(o.default);r.default=l},{29:29,30:30,46:46}],9:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r0})}else c.trigger(i.default.ERROR,{type:l.ErrorTypes.MEDIA_ERROR,details:l.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:c.url,reason:"no level with compatible codecs found in manifest"})}},{key:"setLevelInternal",value:function(e){var t=this._levels,r=this.hls;if(e>=0&&e1&&a.loadErrore&&(this._level===e&&void 0!==t[e].details||this.setLevelInternal(e))}},{key:"manualLevel",get:function(){return this._manualLevel},set:function(e){this._manualLevel=e,void 0===this._startLevel&&(this._startLevel=e),-1!==e&&(this.level=e)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(e){this._firstLevel=e}},{key:"startLevel",get:function(){if(void 0===this._startLevel){var e=this.hls.config.startLevel;return void 0!==e?e:this._firstLevel}return this._startLevel},set:function(e){this._startLevel=e}},{key:"nextLoadLevel",get:function(){return-1!==this._manualLevel?this._manualLevel:this.hls.nextAutoLevel},set:function(e){this.level=e,-1===this._manualLevel&&(this.hls.nextAutoLevel=e)}}]),t}(o.default);r.default=c},{28:28,29:29,30:30,32:32,46:46}],11:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r0&&-1===e&&(h.logger.log("override startPosition with lastCurrentTime @"+t.toFixed(3)),e=t),this.state=v,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}else this.forceStartLoad=!0,this.state=p}},{key:"stopLoad",value:function(){var e=this.fragCurrent;e&&(e.loader&&e.loader.abort(),this.fragCurrent=null),this.fragPrevious=null,this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),this.state=p,this.forceStartLoad=!1}},{key:"tick",value:function(){1==++this.ticks&&(this.doTick(),this.ticks>1&&setTimeout(this.tick,1),this.ticks=0)}},{key:"doTick",value:function(){switch(this.state){case L:break;case _:this.fragLoadError=0;break;case v:this._doTickIdle();break;case b:var e=this.levels[this.level];e&&e.details&&(this.state=v);break;case y:var t=performance.now(),r=this.retryDate;(!r||t>=r||this.media&&this.media.seeking)&&(h.logger.log("mediaController: retryDate reached, switch back to IDLE state"),this.state=v)}this._checkBuffer(),this._checkFragmentChanged()}},{key:"_doTickIdle",value:function(){var e=this.hls,t=e.config,r=this.media;if(void 0===this.levelLastLoaded||r||!this.startFragRequested&&t.startFragPrefetch){var n;n=this.loadedmetadata?r.currentTime:this.nextLoadPosition;var a=e.nextLoadLevel,i=this.levels[a];if(i){var s=i.bitrate,u=void 0;u=s?Math.max(8*t.maxBufferSize/s,t.maxBufferLength):t.maxBufferLength,u=Math.min(u,t.maxMaxBufferLength);var c=o.default.bufferInfo(this.mediaBuffer?this.mediaBuffer:r,n,t.maxBufferHole),d=c.len;if(!(d>=u)){h.logger.trace("buffer length of "+d.toFixed(3)+" is below max of "+u.toFixed(3)+". checking for more payload ..."),this.level=e.nextLoadLevel=a;var f=i.details;if(void 0===f||f.live&&this.levelLastLoaded!==a)this.state=b;else{var p=this.fragPrevious;if(!f.live&&p&&p.sn===f.endSN&&d&&!c.nextStart&&Math.min(r.duration,p.start+p.duration)-Math.max(c.end,p.start)<=Math.max(.2,p.duration)){var v={};return this.altAudio&&(v.type="video"),this.hls.trigger(l.default.BUFFER_EOS,v),void(this.state=k)}this._fetchPayloadOrEos(n,c,f)}}}}}},{key:"_fetchPayloadOrEos",value:function(e,t,r){var n=this.fragPrevious,a=this.level,i=r.fragments,o=i.length;if(0!==o){var s=i[0].start,l=i[o-1].start+i[o-1].duration,u=t.end,c=void 0;if(r.initSegment&&!r.initSegment.data)c=r.initSegment;else if(r.live){var d=this.config.initialLiveManifestSize;if(of&&(u.currentTime=f),this.nextLoadPosition=f}if(e.PTSKnown&&t>n&&u&&u.readyState)return null;if(this.startFragRequested&&!e.PTSKnown){if(a){var p=a.sn+1;if(p>=e.startSN&&p<=e.endSN){var v=o[p-e.startSN];a.cc===v.cc&&(c=v,h.logger.log("live playlist, switching playlist, load frag with next SN: "+c.sn))}c||(c=i.default.search(o,(function(e){return a.cc-e.cc})))&&h.logger.log("live playlist, switching playlist, load frag with same CC: "+c.sn)}c||(c=o[Math.min(s-1,Math.round(s/2))],h.logger.log("live playlist, switching playlist, unknown, load middle frag : "+c.sn))}return c}},{key:"_findFragment",value:function(e,t,r,n,a,o,s){var l=this.hls.config,u=void 0,c=void 0,d=l.maxFragLookUpTolerance,f=t?n[t.sn-n[0].sn+1]:void 0,p=function(e){var t=Math.min(d,e.duration);return e.start+e.duration-t<=a?1:e.start-t>a&&e.start?-1:0};if(ao-d&&(d=0),c=f&&!p(f)?f:i.default.search(n,p)):c=n[r-1],c){var v=(u=c).sn-s.startSN,g=t&&u.level===t.level,m=n[v-1],y=n[v+1];if(t&&u.sn===t.sn)if(g&&!u.backtracked)if(u.snl.maxBufferHole&&t.dropped&&v?(u=m,h.logger.warn("SN just loaded, with large PTS gap between audio and video, maybe frag is not starting with a keyframe ? load previous one to try to overcome this"),t.loadCounter--):(u=y,h.logger.log("SN just loaded, load next one: "+u.sn))}else u=null;else u.backtracked&&(y&&y.backtracked?(h.logger.warn("Already backtracked from fragment "+y.sn+", will not backtrack to fragment "+u.sn+". Loading fragment "+y.sn),u=y):(h.logger.warn("Loaded fragment with dropped frames, backtracking 1 segment to find a keyframe"),u.dropped=0,m?(m.loadCounter&&m.loadCounter--,(u=m).backtracked=!0):v&&(u=null)))}return u}},{key:"_loadFragmentOrKey",value:function(e,t,r,n,a){var i=this.hls,o=i.config;if(!e.decryptdata||null==e.decryptdata.uri||null!=e.decryptdata.key){if(h.logger.log("Loading "+e.sn+" of ["+r.startSN+" ,"+r.endSN+"],level "+t+", currentTime:"+n.toFixed(3)+",bufferEnd:"+a.toFixed(3)),void 0!==this.fragLoadIdx?this.fragLoadIdx++:this.fragLoadIdx=0,e.loadCounter){e.loadCounter++;var u=o.fragLoadingLoopThreshold;if(e.loadCounter>u&&Math.abs(this.fragLoadIdx-e.loadIdx)t.endPTS?1:0}))}},{key:"followingBufferedFrag",value:function(e){return e?this.getBufferedFrag(e.endPTS+.5):null}},{key:"_checkFragmentChanged",value:function(){var e,t,r=this.media;if(r&&r.readyState&&!1===r.seeking&&((t=r.currentTime)>r.playbackRate*this.lastCurrentTime&&(this.lastCurrentTime=t),o.default.isBuffered(r,t)?e=this.getBufferedFrag(t):o.default.isBuffered(r,t+.1)&&(e=this.getBufferedFrag(t+.1)),e)){var n=e;if(n!==this.fragPlaying){this.hls.trigger(l.default.FRAG_CHANGED,{frag:n});var a=n.level;this.fragPlaying&&this.fragPlaying.level===a||this.hls.trigger(l.default.LEVEL_SWITCHED,{level:a}),this.fragPlaying=n}}}},{key:"immediateLevelSwitch",value:function(){if(h.logger.log("immediateLevelSwitch"),!this.immediateSwitch){this.immediateSwitch=!0;var e=this.media,t=void 0;e?(t=e.paused,e.pause()):t=!0,this.previouslyPaused=t}var r=this.fragCurrent;r&&r.loader&&r.loader.abort(),this.fragCurrent=null,this.fragLoadIdx+=2*this.config.fragLoadingLoopThreshold,this.flushMainBuffer(0,Number.POSITIVE_INFINITY)}},{key:"immediateLevelSwitchEnd",value:function(){var e=this.media;e&&e.buffered.length&&(this.immediateSwitch=!1,o.default.isBuffered(e,e.currentTime)&&(e.currentTime-=1e-4),this.previouslyPaused||e.play())}},{key:"nextLevelSwitch",value:function(){var e=this.media;if(e&&e.readyState){var t,r=void 0,n=void 0;if(this.fragLoadIdx+=2*this.config.fragLoadingLoopThreshold,(t=this.getBufferedFrag(e.currentTime))&&t.startPTS>1&&this.flushMainBuffer(0,t.startPTS-1),e.paused)r=0;else{var a=this.hls.nextLoadLevel,i=this.levels[a],o=this.fragLastKbps;r=o&&this.fragCurrent?this.fragCurrent.duration*i.bitrate/(1e3*o)+1:0}if((n=this.getBufferedFrag(e.currentTime+r))&&(n=this.followingBufferedFrag(n))){var s=this.fragCurrent;s&&s.loader&&s.loader.abort(),this.fragCurrent=null,this.flushMainBuffer(n.maxStartPTS,Number.POSITIVE_INFINITY)}}}},{key:"flushMainBuffer",value:function(e,t){this.state=_;var r={startOffset:e,endOffset:t};this.altAudio&&(r.type="video"),this.hls.trigger(l.default.BUFFER_FLUSHING,r)}},{key:"onMediaAttached",value:function(e){var t=this.media=this.mediaBuffer=e.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),this.onvended=this.onMediaEnded.bind(this),t.addEventListener("seeking",this.onvseeking),t.addEventListener("seeked",this.onvseeked),t.addEventListener("ended",this.onvended);var r=this.config;this.levels&&r.autoStartLoad&&this.hls.startLoad(r.startPosition)}},{key:"onMediaDetaching",value:function(){var e=this.media;e&&e.ended&&(h.logger.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0);var t=this.levels;t&&t.forEach((function(e){e.details&&e.details.fragments.forEach((function(e){e.loadCounter=void 0,e.backtracked=void 0}))})),e&&(e.removeEventListener("seeking",this.onvseeking),e.removeEventListener("seeked",this.onvseeked),e.removeEventListener("ended",this.onvended),this.onvseeking=this.onvseeked=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.stopLoad()}},{key:"onMediaSeeking",value:function(){var e=this.media,t=e?e.currentTime:void 0,r=this.config;isNaN(t)||h.logger.log("media seeking to "+t.toFixed(3));var n=this.mediaBuffer?this.mediaBuffer:e,a=o.default.bufferInfo(n,t,this.config.maxBufferHole);if(this.state===m){var i=this.fragCurrent;if(0===a.len&&i){var s=r.maxFragLookUpTolerance,l=i.start-s,u=i.start+i.duration+s;tu?(i.loader&&(h.logger.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),i.loader.abort()),this.fragCurrent=null,this.fragPrevious=null,this.state=v):h.logger.log("seeking outside of buffer but within currently loaded fragment range")}}else this.state===k&&(0===a.len&&(this.fragPrevious=0),this.state=v);e&&(this.lastCurrentTime=t),this.state!==m&&void 0!==this.fragLoadIdx&&(this.fragLoadIdx+=2*r.fragLoadingLoopThreshold),this.loadedmetadata||(this.nextLoadPosition=this.startPosition=t),this.tick()}},{key:"onMediaSeeked",value:function(){var e=this.media,t=e?e.currentTime:void 0;isNaN(t)||h.logger.log("media seeked to "+t.toFixed(3)),this.tick()}},{key:"onMediaEnded",value:function(){h.logger.log("media ended"),this.startPosition=this.lastCurrentTime=0}},{key:"onManifestLoading",value:function(){h.logger.log("trigger BUFFER_RESET"),this.hls.trigger(l.default.BUFFER_RESET),this._bufferedFrags=[],this.stalled=!1,this.startPosition=this.lastCurrentTime=0}},{key:"onManifestParsed",value:function(e){var t,r=!1,n=!1;e.levels.forEach((function(e){(t=e.audioCodec)&&(-1!==t.indexOf("mp4a.40.2")&&(r=!0),-1!==t.indexOf("mp4a.40.5")&&(n=!0))})),this.audioCodecSwitch=r&&n,this.audioCodecSwitch&&h.logger.log("both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=e.levels,this.startLevelLoaded=!1,this.startFragRequested=!1;var a=this.config;(a.autoStartLoad||this.forceStartLoad)&&this.hls.startLoad(a.startPosition)}},{key:"onLevelLoaded",value:function(e){var t=e.details,r=e.level,n=this.levels[r],a=t.totalduration,i=0;if(h.logger.log("level "+r+" loaded ["+t.startSN+","+t.endSN+"],duration:"+a),this.levelLastLoaded=r,t.live){var o=n.details;o&&t.fragments.length>0?(c.default.mergeDetails(o,t),i=t.fragments[0].start,this.liveSyncPosition=this.computeLivePosition(i,o),t.PTSKnown?h.logger.log("live playlist sliding:"+i.toFixed(3)):h.logger.log("live playlist - outdated PTS, unknown sliding")):(t.PTSKnown=!1,h.logger.log("live playlist - first load, unknown sliding"))}else t.PTSKnown=!1;if(n.details=t,this.hls.trigger(l.default.LEVEL_UPDATED,{details:t,level:r}),!1===this.startFragRequested){if(-1===this.startPosition||-1===this.lastCurrentTime){var s=t.startTimeOffset;isNaN(s)?t.live?(this.startPosition=this.computeLivePosition(i,t),h.logger.log("configure startPosition to "+this.startPosition)):this.startPosition=0:(s<0&&(h.logger.log("negative start time offset "+s+", count from end of last fragment"),s=i+a+s),h.logger.log("start time offset found in playlist, adjust startPosition to "+s),this.startPosition=s),this.lastCurrentTime=this.startPosition}this.nextLoadPosition=this.startPosition}this.state===b&&(this.state=v),this.tick()}},{key:"onKeyLoaded",value:function(){this.state===g&&(this.state=v,this.tick())}},{key:"onFragLoaded",value:function(e){var t=this.fragCurrent,r=e.frag;if(this.state===m&&t&&"main"===r.type&&r.level===t.level&&r.sn===t.sn){var n=e.stats,a=this.levels[t.level],i=a.details;if(h.logger.log("Loaded "+t.sn+" of ["+i.startSN+" ,"+i.endSN+"],level "+t.level),this.bitrateTest=!1,this.stats=n,!0===r.bitrateTest&&this.hls.nextLoadLevel)this.state=v,this.startFragRequested=!1,n.tparsed=n.tbuffered=performance.now(),this.hls.trigger(l.default.FRAG_BUFFERED,{stats:n,frag:t,id:"main"}),this.tick();else if("initSegment"===r.sn)this.state=v,n.tparsed=n.tbuffered=performance.now(),i.initSegment.data=e.payload,this.hls.trigger(l.default.FRAG_BUFFERED,{stats:n,frag:t,id:"main"}),this.tick();else{this.state=E;var o=i.totalduration,u=t.level,c=t.sn,d=this.config.defaultAudioCodec||a.audioCodec;this.audioCodecSwap&&(h.logger.log("swapping playlist audio codec"),void 0===d&&(d=this.lastAudioCodec),d&&(d=-1!==d.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5")),this.pendingBuffering=!0,this.appended=!1,h.logger.log("Parsing "+c+" of ["+i.startSN+" ,"+i.endSN+"],level "+u+", cc "+t.cc);var f=this.demuxer;f||(f=this.demuxer=new s.default(this.hls,"main"));var p=this.media,g=!(p&&p.seeking)&&(i.PTSKnown||!i.live),y=i.initSegment?i.initSegment.data:[];f.push(e.payload,y,d,a.videoCodec,t,o,g,void 0)}}this.fragLoadError=0}},{key:"onFragParsingInitSegment",value:function(e){var t=this.fragCurrent,r=e.frag;if(t&&"main"===e.id&&r.sn===t.sn&&r.level===t.level&&this.state===E){var n,a,i=e.tracks;if(i.audio&&this.altAudio&&delete i.audio,a=i.audio){var o=this.levels[this.level].audioCodec,s=navigator.userAgent.toLowerCase();o&&this.audioCodecSwap&&(h.logger.log("swapping playlist audio codec"),o=-1!==o.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5"),this.audioCodecSwitch&&1!==a.metadata.channelCount&&-1===s.indexOf("firefox")&&(o="mp4a.40.5"),-1!==s.indexOf("android")&&"audio/mpeg"!==a.container&&(o="mp4a.40.2",h.logger.log("Android: force audio codec to "+o)),a.levelCodec=o,a.id=e.id}for(n in(a=i.video)&&(a.levelCodec=this.levels[this.level].videoCodec,a.id=e.id),this.hls.trigger(l.default.BUFFER_CODECS,i),i){a=i[n],h.logger.log("main track:"+n+",container:"+a.container+",codecs[level/parsed]=["+a.levelCodec+"/"+a.codec+"]");var u=a.initSegment;u&&(this.appended=!0,this.pendingBuffering=!0,this.hls.trigger(l.default.BUFFER_APPENDING,{type:n,data:u,parent:"main",content:"initSegment"}))}this.tick()}}},{key:"onFragParsingData",value:function(e){var t=this,r=this.fragCurrent,n=e.frag;if(r&&"main"===e.id&&n.sn===r.sn&&n.level===r.level&&("audio"!==e.type||!this.altAudio)&&this.state===E){var a=this.levels[this.level],i=r;if(isNaN(e.endPTS)&&(e.endPTS=e.startPTS+r.duration,e.endDTS=e.startDTS+r.duration),h.logger.log("Parsed "+e.type+",PTS:["+e.startPTS.toFixed(3)+","+e.endPTS.toFixed(3)+"],DTS:["+e.startDTS.toFixed(3)+"/"+e.endDTS.toFixed(3)+"],nb:"+e.nb+",dropped:"+(e.dropped||0)),"video"===e.type)if(i.dropped=e.dropped,i.dropped){if(!i.backtracked)return h.logger.warn("missing video frame(s), backtracking fragment"),i.backtracked=!0,this.nextLoadPosition=e.startPTS,this.state=v,this.fragPrevious=i,void this.tick();h.logger.warn("Already backtracked on this fragment, appending with the gap")}else i.backtracked=!1;var o=c.default.updateFragPTSDTS(a.details,i,e.startPTS,e.endPTS,e.startDTS,e.endDTS),s=this.hls;s.trigger(l.default.LEVEL_PTS_UPDATED,{details:a.details,level:this.level,drift:o,type:e.type,start:e.startPTS,end:e.endPTS}),[e.data1,e.data2].forEach((function(r){r&&r.length&&t.state===E&&(t.appended=!0,t.pendingBuffering=!0,s.trigger(l.default.BUFFER_APPENDING,{type:e.type,data:r,parent:"main",content:"data"}))})),this.tick()}}},{key:"onFragParsed",value:function(e){var t=this.fragCurrent,r=e.frag;t&&"main"===e.id&&r.sn===t.sn&&r.level===t.level&&this.state===E&&(this.stats.tparsed=performance.now(),this.state=S,this._checkAppendedParsed())}},{key:"onAudioTrackSwitching",value:function(e){var t=!!e.url,r=e.id;if(!t){if(this.mediaBuffer!==this.media){h.logger.log("switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var n=this.fragCurrent;n.loader&&(h.logger.log("switching to main audio track, cancel main fragment load"),n.loader.abort()),this.fragCurrent=null,this.fragPrevious=null,this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),this.state=v}var a=this.hls;a.trigger(l.default.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),a.trigger(l.default.AUDIO_TRACK_SWITCHED,{id:r}),this.altAudio=!1}}},{key:"onAudioTrackSwitched",value:function(e){var t=e.id,r=!!this.hls.audioTracks[t].url;if(r){var n=this.videoBuffer;n&&this.mediaBuffer!==n&&(h.logger.log("switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=n)}this.altAudio=r,this.tick()}},{key:"onBufferCreated",value:function(e){var t=e.tracks,r=void 0,n=void 0,a=!1;for(var i in t){var o=t[i];"main"===o.id?(n=i,r=o,"video"===i&&(this.videoBuffer=t[i].buffer)):a=!0}a&&r?(h.logger.log("alternate track found, use "+n+".buffered to schedule main fragment loading"),this.mediaBuffer=r.buffer):this.mediaBuffer=this.media}},{key:"onBufferAppended",value:function(e){if("main"===e.parent){var t=this.state;t!==E&&t!==S||(this.pendingBuffering=e.pending>0,this._checkAppendedParsed())}}},{key:"_checkAppendedParsed",value:function(){if(!(this.state!==S||this.appended&&this.pendingBuffering)){var e=this.fragCurrent;if(e){var t=this.mediaBuffer?this.mediaBuffer:this.media;h.logger.log("main buffered : "+d.default.toString(t.buffered));var r=this._bufferedFrags.filter((function(e){return o.default.isBuffered(t,(e.startPTS+e.endPTS)/2)}));r.push(e),this._bufferedFrags=r.sort((function(e,t){return e.startPTS-t.startPTS})),this.fragPrevious=e;var n=this.stats;n.tbuffered=performance.now(),this.fragLastKbps=Math.round(8*n.total/(n.tbuffered-n.tfirst)),this.hls.trigger(l.default.FRAG_BUFFERED,{stats:n,frag:e,id:"main"}),this.state=v}this.tick()}}},{key:"onError",value:function(e){var t=e.frag||this.fragCurrent;if(!t||"main"===t.type){var r=this.media,n=r&&o.default.isBuffered(r,r.currentTime)&&o.default.isBuffered(r,r.currentTime+.5);switch(e.details){case f.ErrorDetails.FRAG_LOAD_ERROR:case f.ErrorDetails.FRAG_LOAD_TIMEOUT:case f.ErrorDetails.KEY_LOAD_ERROR:case f.ErrorDetails.KEY_LOAD_TIMEOUT:if(!e.fatal){var a=this.fragLoadError;a?a++:a=1;var i=this.config;if(a<=i.fragLoadingMaxRetry||n||t.autoLevel&&t.level){this.fragLoadError=a,t.loadCounter=0;var s=Math.min(Math.pow(2,a-1)*i.fragLoadingRetryDelay,i.fragLoadingMaxRetryTimeout);h.logger.warn("mediaController: frag loading failed, retry in "+s+" ms"),this.retryDate=performance.now()+s,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.state=y}else h.logger.error("mediaController: "+e.details+" reaches max retry, redispatch as fatal ..."),e.fatal=!0,this.state=L}break;case f.ErrorDetails.FRAG_LOOP_LOADING_ERROR:e.fatal||(n?(this._reduceMaxBufferLength(t.duration),this.state=v):t.autoLevel&&0!==t.level||(e.fatal=!0,this.state=L));break;case f.ErrorDetails.LEVEL_LOAD_ERROR:case f.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==L&&(e.fatal?(this.state=L,h.logger.warn("streamController: "+e.details+",switch to "+this.state+" state ...")):e.levelRetry||this.state!==b||(this.state=v));break;case f.ErrorDetails.BUFFER_FULL_ERROR:"main"!==e.parent||this.state!==E&&this.state!==S||(n?(this._reduceMaxBufferLength(this.config.maxBufferLength),this.state=v):(h.logger.warn("buffer full error also media.currentTime is not buffered, flush everything"),this.fragCurrent=null,this.flushMainBuffer(0,Number.POSITIVE_INFINITY)))}}}},{key:"_reduceMaxBufferLength",value:function(e){var t=this.config;t.maxMaxBufferLength>=e&&(t.maxMaxBufferLength/=2,h.logger.warn("main:reduce max buffer length to "+t.maxMaxBufferLength+"s"),this.fragLoadIdx+=2*t.fragLoadingLoopThreshold)}},{key:"_checkBuffer",value:function(){var e=this.media,t=this.config;if(e&&e.readyState){var r=e.currentTime,n=this.mediaBuffer?this.mediaBuffer:e,a=n.buffered;if(!this.loadedmetadata&&a.length){this.loadedmetadata=!0;var i=e.seeking?r:this.startPosition,s=o.default.isBuffered(n,i),u=a.start(0);(r!==i||!s&&Math.abs(i-u)1e3*t.lowBufferWatchdogPeriod){this.stallReported||(this.stallReported=!0,h.logger.warn("playback stalling in low buffer @"+r),v.trigger(l.default.ERROR,{type:f.ErrorTypes.MEDIA_ERROR,details:f.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:m}));var b=c.nextStart,E=b-r;if(b&&E0){this.nudgeRetry=++y;var S=y*t.nudgeOffset;h.logger.log("adjust currentTime from "+e.currentTime+" to next buffered @ "+b+" + nudge "+S),e.currentTime=b+S,this.stalled=void 0,v.trigger(l.default.ERROR,{type:f.ErrorTypes.MEDIA_ERROR,details:f.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,hole:b+S-r})}}else if(m>.5&&g>1e3*t.highBufferWatchdogPeriod)if(this.stallReported||(this.stallReported=!0,h.logger.warn("playback stalling in high buffer @"+r),v.trigger(l.default.ERROR,{type:f.ErrorTypes.MEDIA_ERROR,details:f.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:m})),this.stalled=void 0,this.nudgeRetry=++y,y"+e),this.hls.trigger(l.default.STREAM_STATE_TRANSITION,{previousState:t,nextState:e})}},get:function(){return this._state}},{key:"currentLevel",get:function(){var e=this.media;if(e){var t=this.getBufferedFrag(e.currentTime);if(t)return t.level}return-1}},{key:"nextBufferedFrag",get:function(){var e=this.media;return e?this.followingBufferedFrag(this.getBufferedFrag(e.currentTime)):null}},{key:"nextLevel",get:function(){var e=this.nextBufferedFrag;return e?e.level:-1}},{key:"liveSyncPosition",get:function(){return this._liveSyncPosition},set:function(e){this._liveSyncPosition=e}}]),t}(u.default);r.default=T},{20:20,28:28,29:29,30:30,32:32,33:33,43:43,46:46,47:47}],12:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r>>8^255&g^99,e[h]=g,t[g]=h;var m=f[h],y=f[m],b=f[y],E=257*f[g]^16843008*g;n[h]=E<<24|E>>>8,a[h]=E<<16|E>>>16,i[h]=E<<8|E>>>24,o[h]=E,E=16843009*b^65537*y^257*m^16843008*h,l[g]=E<<24|E>>>8,u[g]=E<<16|E>>>16,c[g]=E<<8|E>>>24,d[g]=E,h?(h=m^f[f[f[b^m]]],p^=f[f[p]]):h=p=1}}},{key:"expandKey",value:function(e){for(var t=this.uint8ArrayToUint32Array_(e),r=!0,n=0;n>8|e>>>24}},{key:"decrypt",value:function(e,t,r){for(var n,a,i=this.keySize+6,o=this.invKeySchedule,s=this.invSBox,l=this.invSubMix,u=l[0],c=l[1],d=l[2],f=l[3],h=this.uint8ArrayToUint32Array_(r),p=h[0],v=h[1],g=h[2],m=h[3],y=new Int32Array(e),b=new Int32Array(y.length),E=void 0,S=void 0,_=void 0,k=void 0,L=void 0,T=void 0,w=void 0,A=void 0,R=void 0,x=void 0,C=void 0,O=void 0,P=this.networkToHostOrderSwap;t>>24]^c[T>>16&255]^d[w>>8&255]^f[255&A]^o[n],S=u[T>>>24]^c[w>>16&255]^d[A>>8&255]^f[255&L]^o[n+1],_=u[w>>>24]^c[A>>16&255]^d[L>>8&255]^f[255&T]^o[n+2],k=u[A>>>24]^c[L>>16&255]^d[T>>8&255]^f[255&w]^o[n+3],L=E,T=S,w=_,A=k,n+=4;E=s[L>>>24]<<24^s[T>>16&255]<<16^s[w>>8&255]<<8^s[255&A]^o[n],S=s[T>>>24]<<24^s[w>>16&255]<<16^s[A>>8&255]<<8^s[255&L]^o[n+1],_=s[w>>>24]<<24^s[A>>16&255]<<16^s[L>>8&255]<<8^s[255&T]^o[n+2],k=s[A>>>24]<<24^s[L>>16&255]<<16^s[T>>8&255]<<8^s[255&w]^o[n+3],n+=3,b[t]=P(E^p),b[t+1]=P(k^v),b[t+2]=P(_^g),b[t+3]=P(S^m),p=R,v=x,g=C,m=O,t+=4}return b.buffer}},{key:"destroy",value:function(){this.key=void 0,this.keySize=void 0,this.ksRows=void 0,this.sBox=void 0,this.invSBox=void 0,this.subMix=void 0,this.invSubMix=void 0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.rcon=void 0}}]),e}();r.default=a},{}],14:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r>>6),!((s=(60&t[r+2])>>>2)>h.length-1))return u=(1&t[r+2])<<2,u|=(192&t[r+3])>>>6,n.logger.log("manifest codec:"+i+",ADTS data:type:"+o+",sampleingIndex:"+s+"["+h[s]+"Hz],channelConfig:"+u),/firefox/i.test(d)?s>=6?(o=5,c=new Array(4),l=s-3):(o=2,c=new Array(2),l=s):-1!==d.indexOf("android")?(o=2,c=new Array(2),l=s):(o=5,c=new Array(4),i&&(-1!==i.indexOf("mp4a.40.29")||-1!==i.indexOf("mp4a.40.5"))||!i&&s>=6?l=s-3:((i&&-1!==i.indexOf("mp4a.40.2")&&(s>=6&&1===u||/vivaldi/i.test(d))||!i&&1===u)&&(o=2,c=new Array(2)),l=s)),c[0]=o<<3,c[0]|=(14&s)>>1,c[1]|=(1&s)<<7,c[1]|=u<<3,5===o&&(c[1]|=(14&l)>>1,c[2]=(1&l)<<7,c[2]|=8,c[3]=0),{config:c,samplerate:h[s],channelCount:u,codec:"mp4a.40."+o,manifestCodec:f};e.trigger(Event.ERROR,{type:a.ErrorTypes.MEDIA_ERROR,details:a.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+s})},isHeaderPattern:function(e,t){return 255===e[t]&&240==(246&e[t+1])},getHeaderLength:function(e,t){return 1&e[t+1]?7:9},getFullFrameLength:function(e,t){return(3&e[t+3])<<11|e[t+4]<<3|(224&e[t+5])>>>5},isHeader:function(e,t){return!!(t+10&&t+i+o<=s)return{headerLength:i,frameLength:o,stamp:r+n*a}}};t.exports=i},{28:28,46:46}],18:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r0&&null!=t&&null!=t.key&&"AES-128"===t.method){var p=this.decrypter;null==p&&(p=this.decrypter=new s.default(this.observer,this.config));var v,g=this;try{v=performance.now()}catch(e){v=Date.now()}p.decrypt(e,t.key.buffer,t.iv.buffer,(function(e){var s;try{s=performance.now()}catch(e){s=Date.now()}g.observer.trigger(i.default.FRAG_DECRYPTED,{stats:{tstart:v,tdecrypt:s}}),g.pushDecrypted(new Uint8Array(e),t,new Uint8Array(r),n,a,o,l,u,c,d,f,h)}))}else this.pushDecrypted(new Uint8Array(e),t,new Uint8Array(r),n,a,o,l,u,c,d,f,h)}},{key:"pushDecrypted",value:function(e,t,r,n,a,s,p,v,g,m,y,b){var E=this.demuxer;if(!E||p&&!this.probe(e)){for(var S=this.observer,_=this.typeSupported,k=this.config,L=[{demux:l.default,remux:f.default},{demux:d.default,remux:f.default},{demux:c.default,remux:f.default},{demux:u.default,remux:h.default}],T=0,w=L.length;T1?r-1:0),a=1;a1?r-1:0),a=1;a1?t-1:0),n=1;n1?t-1:0),n=1;ne?(this.word<<=e,this.bitsAvailable-=e):(e-=this.bitsAvailable,e-=(t=e>>3)>>3,this.bytesAvailable-=t,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)}},{key:"readBits",value:function(e){var t=Math.min(this.bitsAvailable,e),r=this.word>>>32-t;return e>32&&a.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=t,this.bitsAvailable>0?this.word<<=t:this.bytesAvailable>0&&this.loadWord(),(t=e-t)>0&&this.bitsAvailable?r<>>e))return this.word<<=e,this.bitsAvailable-=e,e;return this.loadWord(),e+this.skipLZ()}},{key:"skipUEG",value:function(){this.skipBits(1+this.skipLZ())}},{key:"skipEG",value:function(){this.skipBits(1+this.skipLZ())}},{key:"readUEG",value:function(){var e=this.skipLZ();return this.readBits(e+1)-1}},{key:"readEG",value:function(){var e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)}},{key:"readBoolean",value:function(){return 1===this.readBits(1)}},{key:"readUByte",value:function(){return this.readBits(8)}},{key:"readUShort",value:function(){return this.readBits(16)}},{key:"readUInt",value:function(){return this.readBits(32)}},{key:"skipScalingList",value:function(e){var t,r=8,n=8;for(t=0;t0)return t.subarray(n,n+a)}},{key:"_readSize",value:function(e,t){var r=0;return r=(127&e[t])<<21,r|=(127&e[t+1])<<14,(r|=(127&e[t+2])<<7)|127&e[t+3]}},{key:"getTimeStamp",value:function(t){for(var r=e.getID3Frames(t),n=0;n>4){case 0:return n;case 1:case 2:case 3:case 4:case 5:case 6:case 7:n+=String.fromCharCode(o);break;case 12:case 13:t=e[a++],n+=String.fromCharCode((31&o)<<6|63&t);break;case 14:t=e[a++],r=e[a++],n+=String.fromCharCode((15&o)<<12|(63&t)<<6|(63&r)<<0)}}return n}}]),e}();r.default=a},{}],23:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r=8){var r=e.bin2str(t.subarray(4,8));return["moof","ftyp","styp"].indexOf(r)>=0}return!1}},{key:"bin2str",value:function(e){return String.fromCharCode.apply(null,e)}},{key:"readUint32",value:function(e,t){e.data&&(t+=e.start,e=e.data);var r=e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3];return r<0?4294967296+r:r}},{key:"writeUint32",value:function(e,t,r){e.data&&(t+=e.start,e=e.data),e[t]=r>>24,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=255&r}},{key:"findBox",value:function(t,r){var n,a,i,o,s,l,u=[];if(t.data?(s=t.start,i=t.end,t=t.data):(s=0,i=t.byteLength),!r.length)return null;for(n=s;n1?n+a:i,e.bin2str(t.subarray(n+4,n+8))===r[0]&&(1===r.length?u.push({data:t,start:n+8,end:l}):(o=e.findBox({data:t,start:n+8,end:l},r.slice(1))).length&&(u=u.concat(o))),n=l;return u}},{key:"parseInitSegment",value:function(t){var r=[];return e.findBox(t,["moov","trak"]).forEach((function(t){var n=e.findBox(t,["tkhd"])[0];if(n){var a=n.data[n.start],i=0===a?12:20,o=e.readUint32(n,i),s=e.findBox(t,["mdia","mdhd"])[0];if(s){i=0===(a=s.data[s.start])?12:20;var l=e.readUint32(s,i),u=e.findBox(t,["mdia","hdlr"])[0];if(u){var c={soun:"audio",vide:"video"}[e.bin2str(u.data.subarray(u.start+8,u.start+12))];c&&(r[o]={timescale:l,type:c},r[c]={timescale:l,id:o})}}}})),r}},{key:"getStartDTS",value:function(t,r){var n,a,i;return n=e.findBox(r,["moof","traf"]),a=[].concat.apply([],n.map((function(r){return e.findBox(r,["tfhd"]).map((function(n){var a,i,o;return a=e.readUint32(n,4),i=t[a].timescale||9e4,o=e.findBox(r,["tfdt"]).map((function(t){var r,n;return r=t.data[t.start],n=e.readUint32(t,4),1===r&&(n*=Math.pow(2,32),n+=e.readUint32(t,8)),n}))[0],(o=o||1/0)/i}))}))),i=Math.min.apply(null,a),isFinite(i)?i:0}},{key:"offsetStartDTS",value:function(t,r,n){e.findBox(r,["moof","traf"]).map((function(r){return e.findBox(r,["tfhd"]).map((function(a){var o=e.readUint32(a,4),s=t[o].timescale||9e4;e.findBox(r,["tfdt"]).map((function(t){var r=t.data[t.start],a=e.readUint32(t,4);if(0===r)e.writeUint32(t,4,a-n*s);else{a*=Math.pow(2,32),a+=e.readUint32(t,8),a-=n*s;var o=Math.floor(a/(i+1)),l=Math.floor(a%(i+1));e.writeUint32(t,4,o),e.writeUint32(t,8,l)}}))}))}))}}]),e}();r.default=o},{30:30}],25:[function(e,t,r){"use strict";var n={BitratesMap:[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],SamplingRateMap:[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],appendFrame:function(e,t,r,n,a){if(!(r+24>t.length)){var i=this.parseHeader(t,r);if(i&&r+i.frameLength<=t.length){var o=n+a*(10368e4/i.sampleRate),s={unit:t.subarray(r,r+i.frameLength),pts:o,dts:o};return e.config=[],e.channelCount=i.channelCount,e.samplerate=i.sampleRate,e.samples.push(s),e.len+=i.frameLength,{sample:s,length:i.frameLength}}}},parseHeader:function(e,t){var r=e[t+1]>>3&3,a=e[t+1]>>1&3,i=e[t+2]>>4&15,o=e[t+2]>>2&3,s=!!(2&e[t+2]);if(1!==r&&0!==i&&15!==i&&3!==o){var l=3===r?3-a:3===a?3:4,u=1e3*n.BitratesMap[14*l+i-1],c=3===r?0:2===r?1:2,d=n.SamplingRateMap[3*c+o],f=s?1:0;return{sampleRate:d,channelCount:e[t+3]>>6==3?1:2,frameLength:3===a?(3===r?12:6)*u/d+f<<2:(3===r?144:72)*u/d+f|0}}},isHeaderPattern:function(e,t){return 255===e[t]&&224==(224&e[t+1])&&0!=(6&e[t+1])},isHeader:function(e,t){return!!(t+1=e.length)return void r();if(!(e[t].unit.length<32)){var n=this.decrypter.isSync();if(this.decryptAacSample(e,t,r,n),!n)return}}}},{key:"getAvcEncryptedData",value:function(e){for(var t=16*Math.floor((e.length-48)/160)+16,r=new Int8Array(t),n=0,a=32;a<=e.length-16;a+=160,n+=16)r.set(e.subarray(a,a+16),n);return r}},{key:"getAvcDecryptedUnit",value:function(e,t){t=new Uint8Array(t);for(var r=0,n=32;n<=e.length-16;n+=160,r+=16)e.set(t.subarray(r,r+16),n);return e}},{key:"decryptAvcSample",value:function(e,t,r,n,a,i){var o=this.discardEPB(a.data),s=this.getAvcEncryptedData(o),l=this;this.decryptBuffer(s.buffer,(function(s){a.data=l.getAvcDecryptedUnit(o,s),i||l.decryptAvcSamples(e,t,r+1,n)}))}},{key:"decryptAvcSamples",value:function(e,t,r,n){for(;;t++,r=0){if(t>=e.length)return void n();for(var a=e[t].units;!(r>=a.length);r++){var i=a[r];if(!(i.length<=48||1!==i.type&&5!==i.type)){var o=this.decrypter.isSync();if(this.decryptAvcSample(e,t,r,n,i,o),!o)return}}}}}]),e}();r.default=i},{14:14}],27:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r>4>1){if((l=a+5+e[a+4])===a+188)continue}else l=a+4;switch(o){case y:i&&(_&&(u=A(_))&&R(u,!1),_={data:[],size:0}),_&&(_.data.push(e.subarray(l,a+188)),_.size+=a+188-l);break;case b:i&&(k&&(u=A(k))&&(g.isAAC?x(u):C(u)),k={data:[],size:0}),k&&(k.data.push(e.subarray(l,a+188)),k.size+=a+188-l);break;case E:i&&(L&&(u=A(L))&&O(u),L={data:[],size:0}),L&&(L.data.push(e.subarray(l,a+188)),L.size+=a+188-l);break;case 0:i&&(l+=e[l]+1),S=this._pmtId=T(e,l);break;case S:i&&(l+=e[l]+1);var P=w(e,l,!0===this.typeSupported.mpeg||!0===this.typeSupported.mp3,null!=this.sampleAes);(y=P.avc)>0&&(v.id=y),(b=P.audio)>0&&(g.id=b,g.isAAC=P.isAAC),(E=P.id3)>0&&(m.id=E),h&&!p&&(c.logger.log("reparse from beginning"),h=!1,a=-188),p=this.pmtParsed=!0;break;case 17:case 8191:break;default:h=!0}}else this.observer.trigger(s.default.ERROR,{type:d.ErrorTypes.MEDIA_ERROR,details:d.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});_&&(u=A(_))?(R(u,!0),v.pesData=null):v.pesData=_,k&&(u=A(k))?(g.isAAC?x(u):C(u),g.pesData=null):(k&&k.size&&c.logger.log("last AAC PES packet truncated,might overlap between fragments"),g.pesData=k),L&&(u=A(L))?(O(u),m.pesData=null):m.pesData=L,null==this.sampleAes?this.remuxer.remux(g,v,m,this._txtTrack,t,r,n):this.decryptAndRemux(g,v,m,this._txtTrack,t,r,n)}},{key:"decryptAndRemux",value:function(e,t,r,n,a,i,o){if(e.samples&&e.isAAC){var s=this;this.sampleAes.decryptAacSamples(e.samples,0,(function(){s.decryptAndRemuxAvc(e,t,r,n,a,i,o)}))}else this.decryptAndRemuxAvc(e,t,r,n,a,i,o)}},{key:"decryptAndRemuxAvc",value:function(e,t,r,n,a,i,o){if(t.samples){var s=this;this.sampleAes.decryptAvcSamples(t.samples,0,0,(function(){s.remuxer.remux(e,t,r,n,a,i,o)}))}else this.remuxer.remux(e,t,r,n,a,i,o)}},{key:"destroy",value:function(){this._initPTS=this._initDTS=void 0,this._duration=0}},{key:"_parsePAT",value:function(e,t){return(31&e[t+10])<<8|e[t+11]}},{key:"_parsePMT",value:function(e,t,r,n){var a,i,o={audio:-1,avc:-1,id3:-1,isAAC:!0};for(a=t+3+((15&e[t+1])<<8|e[t+2])-4,t+=12+((15&e[t+10])<<8|e[t+11]);t1;){var f=new Uint8Array(d[0].length+d[1].length);f.set(d[0]),f.set(d[1],d[0].length),d[0]=f,d.splice(1,1)}if(1===((t=d[0])[0]<<16)+(t[1]<<8)+t[2]){if((n=(t[4]<<8)+t[5])&&n>e.size-6)return null;192&(r=t[7])&&((o=536870912*(14&t[9])+4194304*(255&t[10])+16384*(254&t[11])+128*(255&t[12])+(254&t[13])/2)>4294967295&&(o-=8589934592),64&r?((s=536870912*(14&t[14])+4194304*(255&t[15])+16384*(254&t[16])+128*(255&t[17])+(254&t[18])/2)>4294967295&&(s-=8589934592),o-s>54e5&&(c.logger.warn(Math.round((o-s)/9e4)+"s delta between PTS and DTS, align them"),o=s)):s=o),l=(a=t[8])+9,e.size-=l,i=new Uint8Array(e.size);for(var h=0,p=d.length;hv){l-=v;continue}t=t.subarray(l),v-=l,l=0}i.set(t,u),u+=v}return n&&(n-=a+3),{data:i,pts:o,dts:s,len:n}}return null}},{key:"pushAccesUnit",value:function(e,t){if(e.units.length&&e.frame){var r=t.samples,n=r.length;!this.config.forceKeyFrameOnDiscontinuity||!0===e.key||t.sps&&(n||this.contiguous)?(e.id=n,r.push(e)):t.dropped++}e.debug.length&&c.logger.log(e.pts+"/"+e.dts+":"+e.debug)}},{key:"_parseAVCPES",value:function(e,t){var r,n,a,i=this,o=this._avcTrack,s=this._parseAVCNALu(e.data),u=this.avcSample,c=!1,d=this.pushAccesUnit.bind(this),f=function(e,t,r,n){return{key:e,pts:t,dts:r,units:[],debug:n}};e.data=null,u&&s.length&&(d(u,o),u=this.avcSample=f(!1,e.pts,e.dts,"")),s.forEach((function(t){switch(t.type){case 1:n=!0,u.frame=!0;var s=t.data;if(c&&s.length>4){var h=new l.default(s).readSliceType();2!==h&&4!==h&&7!==h&&9!==h||(u.key=!0)}break;case 5:n=!0,u||(u=i.avcSample=f(!0,e.pts,e.dts,"")),u.key=!0,u.frame=!0;break;case 6:n=!0,(r=new l.default(i.discardEPB(t.data))).readUByte();for(var p=0,v=0,g=!1,m=0;!g&&r.bytesAvailable>1;){p=0;do{p+=m=r.readUByte()}while(255===m);v=0;do{v+=m=r.readUByte()}while(255===m);if(4===p&&0!==r.bytesAvailable){if(g=!0,181===r.readUByte()&&49===r.readUShort()&&1195456820===r.readUInt()&&3===r.readUByte()){var y=r.readUByte(),b=31&y,E=[y,r.readUByte()];for(a=0;a0){if(t.pts>=e[r-1].pts)e.push(t);else for(var n=r-1;n>=0;n--)if(t.pts=0)n={data:e.subarray(d,i-l-1),type:a},c.push(n);else{var f=this._getLastNalUnit();if(f&&(u&&i<=4-u&&f.state&&(f.data=f.data.subarray(0,f.data.byteLength-u)),(r=i-l-1)>0)){var h=new Uint8Array(f.data.byteLength+r);h.set(f.data,0),h.set(e.subarray(0,r),f.data.byteLength),f.data=h}}i=0&&l>=0&&(n={data:e.subarray(d,o),type:a,state:l},c.push(n)),0===c.length){var p=this._getLastNalUnit();if(p){var v=new Uint8Array(p.data.byteLength+e.byteLength);v.set(p.data,0),v.set(e,p.data.byteLength),p.data=v}}return s.naluState=l,c}},{key:"discardEPB",value:function(e){for(var t,r,n=e.byteLength,a=[],i=1;i1&&(c.logger.log("AAC: align PTS for overlapping frames by "+Math.round((y-p)/90)),p=y)}for(;n=564&&71===e[0]&&71===e[188]&&71===e[376]}}]),e}();r.default=f},{17:17,21:21,25:25,26:26,28:28,30:30,46:46}],28:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.ErrorTypes={NETWORK_ERROR:"networkError",MEDIA_ERROR:"mediaError",MUX_ERROR:"muxError",OTHER_ERROR:"otherError"},r.ErrorDetails={MANIFEST_LOAD_ERROR:"manifestLoadError",MANIFEST_LOAD_TIMEOUT:"manifestLoadTimeOut",MANIFEST_PARSING_ERROR:"manifestParsingError",MANIFEST_INCOMPATIBLE_CODECS_ERROR:"manifestIncompatibleCodecsError",LEVEL_LOAD_ERROR:"levelLoadError",LEVEL_LOAD_TIMEOUT:"levelLoadTimeOut",LEVEL_SWITCH_ERROR:"levelSwitchError",AUDIO_TRACK_LOAD_ERROR:"audioTrackLoadError",AUDIO_TRACK_LOAD_TIMEOUT:"audioTrackLoadTimeOut",FRAG_LOAD_ERROR:"fragLoadError",FRAG_LOOP_LOADING_ERROR:"fragLoopLoadingError",FRAG_LOAD_TIMEOUT:"fragLoadTimeOut",FRAG_DECRYPT_ERROR:"fragDecryptError",FRAG_PARSING_ERROR:"fragParsingError",REMUX_ALLOC_ERROR:"remuxAllocError",KEY_LOAD_ERROR:"keyLoadError",KEY_LOAD_TIMEOUT:"keyLoadTimeOut",BUFFER_ADD_CODEC_ERROR:"bufferAddCodecError",BUFFER_APPEND_ERROR:"bufferAppendError",BUFFER_APPENDING_ERROR:"bufferAppendingError",BUFFER_STALLED_ERROR:"bufferStalledError",BUFFER_FULL_ERROR:"bufferFullError",BUFFER_SEEK_OVER_HOLE:"bufferSeekOverHole",BUFFER_NUDGE_ON_STALL:"bufferNudgeOnStall",INTERNAL_EXCEPTION:"internalException",WEBVTT_EXCEPTION:"webVTTException"}},{}],29:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a=function(){function e(e,t){for(var r=0;r1?r-1:0),a=1;a=r.start(n)&&t<=r.end(n))return!0;return!1},bufferInfo:function(e,t,r){if(e){var n,a=e.buffered,i=[];for(n=0;nc&&(l[u-1].end=e[s].end):l.push(e[s])}else l.push(e[s])}for(s=0,n=0,a=i=t;s=d&&t=0&&se.endSN)return 0;for(c=h-e.startSN,(d=e.fragments)[c]=t,f=c;f>0;f--)a.updatePTS(d,f,f-1);for(f=c;ft?a.start+a.duration:Math.max(a.start-i.duration,0):r>t?(a.duration=o-a.start,a.duration<0&&n.logger.warn("negative duration computed for frag "+a.sn+",level "+a.level+", there should be some duration drift between playlist and fragment!")):(i.duration=a.start-o,i.duration<0&&n.logger.warn("negative duration computed for frag "+i.sn+",level "+i.level+", there should be some duration drift between playlist and fragment!"))}};t.exports=a},{46:46}],34:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var n=e.DefaultConfig;if((r.liveSyncDurationCount||r.liveMaxLatencyDurationCount)&&(r.liveSyncDuration||r.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");for(var a in n)a in r||(r[a]=n[a]);if(void 0!==r.liveMaxLatencyDurationCount&&r.liveMaxLatencyDurationCount<=r.liveSyncDurationCount)throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be gt "liveSyncDurationCount"');if(void 0!==r.liveMaxLatencyDuration&&(r.liveMaxLatencyDuration<=r.liveSyncDuration||void 0===r.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be gt "liveSyncDuration"');(0,p.enableLogs)(r.debug),this.config=r,this._autoLevelCapping=-1;var i=this.observer=new v.default;i.trigger=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n1?t-1:0),n=1;n0&&void 0!==arguments[0]?arguments[0]:-1;p.logger.log("startLoad("+e+")"),this.networkControllers.forEach((function(t){t.startLoad(e)}))}},{key:"stopLoad",value:function(){p.logger.log("stopLoad"),this.networkControllers.forEach((function(e){e.stopLoad()}))}},{key:"swapAudioCodec",value:function(){p.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()}},{key:"recoverMediaError",value:function(){p.logger.log("recoverMediaError");var e=this.media;this.detachMedia(),this.attachMedia(e)}},{key:"levels",get:function(){return this.levelController.levels}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(e){p.logger.log("set currentLevel:"+e),this.loadLevel=e,this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(e){p.logger.log("set nextLevel:"+e),this.levelController.manualLevel=e,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(e){p.logger.log("set loadLevel:"+e),this.levelController.manualLevel=e}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(e){this.levelController.nextLoadLevel=e}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(e){p.logger.log("set firstLevel:"+e),this.levelController.firstLevel=e}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(e){p.logger.log("set startLevel:"+e);-1!==e&&(e=Math.max(e,this.minAutoLevel)),this.levelController.startLevel=e}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(e){p.logger.log("set autoLevelCapping:"+e),this._autoLevelCapping=e}},{key:"autoLevelEnabled",get:function(){return-1===this.levelController.manualLevel}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){for(var e=this.levels,t=this.config.minAutoBitrate,r=e?e.length:0,n=0;nt)return n;return 0}},{key:"maxAutoLevel",get:function(){var e=this.levels,t=this.autoLevelCapping;return-1===t&&e&&e.length?e.length-1:t}},{key:"nextAutoLevel",get:function(){var e=this;return Math.min(Math.max(e.abrController.nextAutoLevel,e.minAutoLevel),e.maxAutoLevel)},set:function(e){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,e)}},{key:"audioTracks",get:function(){var e=this.audioTrackController;return e?e.audioTracks:[]}},{key:"audioTrack",get:function(){var e=this.audioTrackController;return e?e.audioTrack:-1},set:function(e){var t=this.audioTrackController;t&&(t.audioTrack=e)}},{key:"liveSyncPosition",get:function(){return this.streamController.liveSyncPosition}},{key:"subtitleTracks",get:function(){var e=this.subtitleTrackController;return e?e.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var e=this.subtitleTrackController;return e?e.subtitleTrack:-1},set:function(e){var t=this.subtitleTrackController;t&&(t.subtitleTrack=e)}}]),e}();r.default=m},{1:1,10:10,11:11,2:2,28:28,30:30,36:36,37:37,38:38,4:4,46:46,9:9}],35:[function(e,t,r){"use strict";t.exports=e(34).default},{34:34}],36:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r3&&void 0!==arguments[3]?arguments[3]:null,a=e.data,o=r.frag;o.loader=void 0,this.loaders[o.type]=void 0,this.hls.trigger(i.default.FRAG_LOADED,{payload:a,frag:o,stats:t,networkDetails:n})}},{key:"loaderror",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=t.loader;n&&n.abort(),this.loaders[t.type]=void 0,this.hls.trigger(i.default.ERROR,{type:s.ErrorTypes.NETWORK_ERROR,details:s.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:t.frag,response:e,networkDetails:r})}},{key:"loadtimeout",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=t.loader;n&&n.abort(),this.loaders[t.type]=void 0,this.hls.trigger(i.default.ERROR,{type:s.ErrorTypes.NETWORK_ERROR,details:s.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t.frag,networkDetails:r})}},{key:"loadprogress",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,a=t.frag;a.loaded=e.loaded,this.hls.trigger(i.default.FRAG_LOAD_PROGRESS,{frag:a,stats:e,networkDetails:n})}}]),t}(o.default);r.default=u},{28:28,29:29,30:30,46:46}],37:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r>8*(15-r)&255;return t}},{key:"fragmentDecryptdataFromLevelkey",value:function(e,t){var r=e;return e&&e.method&&e.uri&&!e.iv&&((r=new g).method=e.method,r.baseuri=e.baseuri,r.reluri=e.reluri,r.iv=this.createInitializationVector(t)),r}},{key:"cloneObj",value:function(e){return JSON.parse(JSON.stringify(e))}},{key:"url",get:function(){return!this._url&&this.relurl&&(this._url=o.default.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url},set:function(e){this._url=e}},{key:"programDateTime",get:function(){return!this._programDateTime&&this.rawProgramDateTime&&(this._programDateTime=new Date(Date.parse(this.rawProgramDateTime))),this._programDateTime}},{key:"byteRange",get:function(){if(!this._byteRange){var e=this._byteRange=[];if(this.rawByteRange){var t=this.rawByteRange.split("@",2);if(1===t.length){var r=this.lastByteRangeEndOffset;e[0]=r||0}else e[0]=parseInt(t[1]);e[1]=parseInt(t[0])+e[0]}}return this._byteRange}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"decryptdata",get:function(){return this._decryptdata||(this._decryptdata=this.fragmentDecryptdataFromLevelkey(this.levelkey,this.sn)),this._decryptdata}}]),e}(),y=function(e){function t(e){a(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,s.default.MANIFEST_LOADING,s.default.LEVEL_LOADING,s.default.AUDIO_TRACK_LOADING,s.default.SUBTITLE_TRACK_LOADING));return r.loaders={},r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"destroy",value:function(){for(var e in this.loaders){var t=this.loaders[e];t&&t.destroy()}this.loaders={},l.default.prototype.destroy.call(this)}},{key:"onManifestLoading",value:function(e){this.load(e.url,{type:"manifest"})}},{key:"onLevelLoading",value:function(e){this.load(e.url,{type:"level",level:e.level,id:e.id})}},{key:"onAudioTrackLoading",value:function(e){this.load(e.url,{type:"audioTrack",id:e.id})}},{key:"onSubtitleTrackLoading",value:function(e){this.load(e.url,{type:"subtitleTrack",id:e.id})}},{key:"load",value:function(e,t){var r=this.loaders[t.type];if(r){var n=r.context;if(n&&n.url===e)return void d.logger.trace("playlist request ongoing");d.logger.warn("abort previous loader for type:"+t.type),r.abort()}var a=this.hls.config,i=void 0,o=void 0,s=void 0,l=void 0;"manifest"===t.type?(i=a.manifestLoadingMaxRetry,o=a.manifestLoadingTimeOut,s=a.manifestLoadingRetryDelay,l=a.manifestLoadingMaxRetryTimeout):(i=a.levelLoadingMaxRetry,o=a.levelLoadingTimeOut,s=a.levelLoadingRetryDelay,l=a.levelLoadingMaxRetryTimeout,d.logger.log("loading playlist for "+t.type+" "+(t.level||t.id))),r=this.loaders[t.type]=t.loader=void 0!==a.pLoader?new a.pLoader(a):new a.loader(a),t.url=e,t.responseType="";var u,c;u={timeout:o,maxRetry:i,retryDelay:s,maxRetryDelay:l},c={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)},r.load(t,u,c)}},{key:"resolve",value:function(e,t){return o.default.buildAbsoluteURL(t,e,{alwaysNormalize:!0})}},{key:"parseMasterPlaylist",value:function(e,t){var r=[],n=void 0;for(f.lastIndex=0;null!=(n=f.exec(e));){var a={},i=a.attrs=new c.default(n[1]);a.url=this.resolve(n[2],t);var o=i.decimalResolution("RESOLUTION");o&&(a.width=o.width,a.height=o.height),a.bitrate=i.decimalInteger("AVERAGE-BANDWIDTH")||i.decimalInteger("BANDWIDTH"),a.name=i.NAME;var s=i.CODECS;if(s){s=s.split(/[ ,]+/);for(var l=0;l3&&void 0!==arguments[3]?arguments[3]:null,a=void 0,i=[],o=0;for(h.lastIndex=0;null!=(a=h.exec(e));){var s={},l=new c.default(a[1]);l.TYPE===r&&(s.groupId=l["GROUP-ID"],s.name=l.NAME,s.type=r,s.default="YES"===l.DEFAULT,s.autoselect="YES"===l.AUTOSELECT,s.forced="YES"===l.FORCED,l.URI&&(s.url=this.resolve(l.URI,t)),s.lang=l.LANGUAGE,s.name||(s.name=s.lang),n&&(s.audioCodec=n),s.id=o++,i.push(s))}return i}},{key:"avc1toavcoti",value:function(e){var t,r=e.split(".");return r.length>2?(t=r.shift()+".",t+=parseInt(r.shift()).toString(16),t+=("000"+parseInt(r.shift()).toString(16)).substr(-4)):t=e,t}},{key:"parseLevelPlaylist",value:function(e,t,r,n){var a,i,o=0,s=0,l={type:null,version:null,url:t,fragments:[],live:!0,startSN:0},u=new g,f=0,h=null,y=new m;for(p.lastIndex=0;null!==(a=p.exec(e));){var b=a[1];if(b){y.duration=parseFloat(b);var E=(" "+a[2]).slice(1);y.title=E||null,y.tagList.push(E?["INF",b,E]:["INF",b])}else if(a[3]){if(!isNaN(y.duration)){var S=o++;y.type=n,y.start=s,y.levelkey=u,y.sn=S,y.level=r,y.cc=f,y.baseurl=t,y.relurl=(" "+a[3]).slice(1),l.fragments.push(y),h=y,s+=y.duration,y=new m}}else if(a[4]){if(y.rawByteRange=(" "+a[4]).slice(1),h){var _=h.byteRangeEndOffset;_&&(y.lastByteRangeEndOffset=_)}}else if(a[5])y.rawProgramDateTime=(" "+a[5]).slice(1),y.tagList.push(["PROGRAM-DATE-TIME",y.rawProgramDateTime]);else{for(a=a[0].match(v),i=1;i=0&&(u.method=A,u.baseuri=t,u.reluri=R,u.key=null,u.iv=x));break;case"START":var C=k,O=new c.default(C).decimalFloatingPoint("TIME-OFFSET");isNaN(O)||(l.startTimeOffset=O);break;case"MAP":var P=new c.default(k);y.relurl=P.URI,y.rawByteRange=P.BYTERANGE,y.baseurl=t,y.level=r,y.type=n,y.sn="initSegment",l.initSegment=y,y=new m;break;default:d.logger.warn("line parsed but not handled: "+a)}}}return(y=h)&&!y.relurl&&(l.fragments.pop(),s-=y.duration),l.totalduration=s,l.averagetargetduration=s/l.fragments.length,l.endSN=o-1,l}},{key:"loadsuccess",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,a=e.data,i=e.url,o=r.type,l=r.id,c=r.level,f=this.hls;if(this.loaders[o]=void 0,void 0!==i&&0!==i.indexOf("data:")||(i=r.url),t.tload=performance.now(),0===a.indexOf("#EXTM3U"))if(a.indexOf("#EXTINF:")>0){var h="audioTrack"!==o&&"subtitleTrack"!==o,p=isNaN(c)?isNaN(l)?0:l:c,v=this.parseLevelPlaylist(a,i,p,"audioTrack"===o?"audio":"subtitleTrack"===o?"subtitle":"main");v.tload=t.tload,"manifest"===o&&f.trigger(s.default.MANIFEST_LOADED,{levels:[{url:i,details:v}],audioTracks:[],url:i,stats:t,networkDetails:n}),t.tparsed=performance.now(),v.targetduration?h?f.trigger(s.default.LEVEL_LOADED,{details:v,level:c||0,id:l||0,stats:t,networkDetails:n}):"audioTrack"===o?f.trigger(s.default.AUDIO_TRACK_LOADED,{details:v,id:l,stats:t,networkDetails:n}):"subtitleTrack"===o&&f.trigger(s.default.SUBTITLE_TRACK_LOADED,{details:v,id:l,stats:t,networkDetails:n}):f.trigger(s.default.ERROR,{type:u.ErrorTypes.NETWORK_ERROR,details:u.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:!0,url:i,reason:"invalid targetduration",networkDetails:n})}else{var g=this.parseMasterPlaylist(a,i);if(g.length){var m=this.parseMasterPlaylistMedia(a,i,"AUDIO",g[0].audioCodec),y=this.parseMasterPlaylistMedia(a,i,"SUBTITLES");if(m.length){var b=!1;m.forEach((function(e){e.url||(b=!0)})),!1===b&&g[0].audioCodec&&!g[0].attrs.AUDIO&&(d.logger.log("audio codec signaled in quality level, but no embedded audio track signaled, create one"),m.unshift({type:"main",name:"main"}))}f.trigger(s.default.MANIFEST_LOADED,{levels:g,audioTracks:m,subtitles:y,url:i,stats:t,networkDetails:n})}else f.trigger(s.default.ERROR,{type:u.ErrorTypes.NETWORK_ERROR,details:u.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:!0,url:i,reason:"no level found in manifest",networkDetails:n})}else f.trigger(s.default.ERROR,{type:u.ErrorTypes.NETWORK_ERROR,details:u.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:!0,url:i,reason:"no EXTM3U delimiter",networkDetails:n})}},{key:"loaderror",value:function(e,t){var r,n,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=t.loader;switch(t.type){case"manifest":r=u.ErrorDetails.MANIFEST_LOAD_ERROR,n=!0;break;case"level":r=u.ErrorDetails.LEVEL_LOAD_ERROR,n=!1;break;case"audioTrack":r=u.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,n=!1}i&&(i.abort(),this.loaders[t.type]=void 0),this.hls.trigger(s.default.ERROR,{type:u.ErrorTypes.NETWORK_ERROR,details:r,fatal:n,url:i.url,loader:i,response:e,context:t,networkDetails:a})}},{key:"loadtimeout",value:function(e,t){var r,n,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=t.loader;switch(t.type){case"manifest":r=u.ErrorDetails.MANIFEST_LOAD_TIMEOUT,n=!0;break;case"level":r=u.ErrorDetails.LEVEL_LOAD_TIMEOUT,n=!1;break;case"audioTrack":r=u.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT,n=!1}i&&(i.abort(),this.loaders[t.type]=void 0),this.hls.trigger(s.default.ERROR,{type:u.ErrorTypes.NETWORK_ERROR,details:r,fatal:n,url:i.url,loader:i,context:t,networkDetails:a})}}]),t}(l.default);r.default=y},{2:2,28:28,29:29,30:30,42:42,46:46}],39:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r>24&255,t[1]=n>>16&255,t[2]=n>>8&255,t[3]=255&n,t.set(e,4),a=0,n=8;a>24&255,t>>16&255,t>>8&255,255&t,n>>24,n>>16&255,n>>8&255,255&n,i>>24,i>>16&255,i>>8&255,255&i,85,196,0,0]))}},{key:"mdia",value:function(t){return e.box(e.types.mdia,e.mdhd(t.timescale,t.duration),e.hdlr(t.type),e.minf(t))}},{key:"mfhd",value:function(t){return e.box(e.types.mfhd,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t]))}},{key:"minf",value:function(t){return"audio"===t.type?e.box(e.types.minf,e.box(e.types.smhd,e.SMHD),e.DINF,e.stbl(t)):e.box(e.types.minf,e.box(e.types.vmhd,e.VMHD),e.DINF,e.stbl(t))}},{key:"moof",value:function(t,r,n){return e.box(e.types.moof,e.mfhd(t),e.traf(n,r))}},{key:"moov",value:function(t){for(var r=t.length,n=[];r--;)n[r]=e.trak(t[r]);return e.box.apply(null,[e.types.moov,e.mvhd(t[0].timescale,t[0].duration)].concat(n).concat(e.mvex(t)))}},{key:"mvex",value:function(t){for(var r=t.length,n=[];r--;)n[r]=e.trex(t[r]);return e.box.apply(null,[e.types.mvex].concat(n))}},{key:"mvhd",value:function(t,r){r*=t;var n=Math.floor(r/(a+1)),i=Math.floor(r%(a+1)),o=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,255&t,n>>24,n>>16&255,n>>8&255,255&n,i>>24,i>>16&255,i>>8&255,255&i,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]);return e.box(e.types.mvhd,o)}},{key:"sdtp",value:function(t){var r,n,a=t.samples||[],i=new Uint8Array(4+a.length);for(n=0;n>>8&255),i.push(255&a),i=i.concat(Array.prototype.slice.call(n));for(r=0;r>>8&255),o.push(255&a),o=o.concat(Array.prototype.slice.call(n));var s=e.box(e.types.avcC,new Uint8Array([1,i[3],i[4],i[5],255,224|t.sps.length].concat(i).concat([t.pps.length]).concat(o))),l=t.width,u=t.height,c=t.pixelRatio[0],d=t.pixelRatio[1];return e.box(e.types.avc1,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,l>>8&255,255&l,u>>8&255,255&u,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),s,e.box(e.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),e.box(e.types.pasp,new Uint8Array([c>>24,c>>16&255,c>>8&255,255&c,d>>24,d>>16&255,d>>8&255,255&d])))}},{key:"esds",value:function(e){var t=e.config.length;return new Uint8Array([0,0,0,0,3,23+t,0,1,0,4,15+t,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([t]).concat(e.config).concat([6,1,2]))}},{key:"mp4a",value:function(t){var r=t.samplerate;return e.box(e.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t.channelCount,0,16,0,0,0,0,r>>8&255,255&r,0,0]),e.box(e.types.esds,e.esds(t)))}},{key:"mp3",value:function(t){var r=t.samplerate;return e.box(e.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t.channelCount,0,16,0,0,0,0,r>>8&255,255&r,0,0]))}},{key:"stsd",value:function(t){return"audio"===t.type?t.isAAC||"mp3"!==t.codec?e.box(e.types.stsd,e.STSD,e.mp4a(t)):e.box(e.types.stsd,e.STSD,e.mp3(t)):e.box(e.types.stsd,e.STSD,e.avc1(t))}},{key:"tkhd",value:function(t){var r=t.id,n=t.duration*t.timescale,i=t.width,o=t.height,s=Math.floor(n/(a+1)),l=Math.floor(n%(a+1));return e.box(e.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,r>>24&255,r>>16&255,r>>8&255,255&r,0,0,0,0,s>>24,s>>16&255,s>>8&255,255&s,l>>24,l>>16&255,l>>8&255,255&l,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,i>>8&255,255&i,0,0,o>>8&255,255&o,0,0]))}},{key:"traf",value:function(t,r){var n=e.sdtp(t),i=t.id,o=Math.floor(r/(a+1)),s=Math.floor(r%(a+1));return e.box(e.types.traf,e.box(e.types.tfhd,new Uint8Array([0,0,0,0,i>>24,i>>16&255,i>>8&255,255&i])),e.box(e.types.tfdt,new Uint8Array([1,0,0,0,o>>24,o>>16&255,o>>8&255,255&o,s>>24,s>>16&255,s>>8&255,255&s])),e.trun(t,n.length+16+20+8+16+8+8),n)}},{key:"trak",value:function(t){return t.duration=t.duration||4294967295,e.box(e.types.trak,e.tkhd(t),e.mdia(t))}},{key:"trex",value:function(t){var r=t.id;return e.box(e.types.trex,new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}},{key:"trun",value:function(t,r){var n,a,i,o,s,l,u=t.samples||[],c=u.length,d=12+16*c,f=new Uint8Array(d);for(r+=8+d,f.set([0,0,15,1,c>>>24&255,c>>>16&255,c>>>8&255,255&c,r>>>24&255,r>>>16&255,r>>>8&255,255&r],0),n=0;n>>24&255,i>>>16&255,i>>>8&255,255&i,o>>>24&255,o>>>16&255,o>>>8&255,255&o,s.isLeading<<2|s.dependsOn,s.isDependedOn<<6|s.hasRedundancy<<4|s.paddingValue<<1|s.isNonSync,61440&s.degradPrio,15&s.degradPrio,l>>>24&255,l>>>16&255,l>>>8&255,255&l],12+16*n);return e.box(e.types.trun,f)}},{key:"initSegment",value:function(t){e.types||e.init();var r,n=e.moov(t);return(r=new Uint8Array(e.FTYP.byteLength+n.byteLength)).set(e.FTYP),r.set(n,e.FTYP.byteLength),r}}]),e}();r.default=i},{}],40:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r-1&&i&&!i.match("CriOS"),this.ISGenerated=!1}return a(e,[{key:"destroy",value:function(){}},{key:"resetTimeStamp",value:function(e){this._initPTS=this._initDTS=e}},{key:"resetInitSegment",value:function(){this.ISGenerated=!1}},{key:"remux",value:function(e,t,r,n,a,i,l){if(this.ISGenerated){if(l){var u=this._initPTS,c=this._PTSNormalize,d=e.inputTimeScale||t.inputTimeScale,f=1/0,h=1/0,p=e.samples;if(p.length&&(f=h=c(p[0].pts-d*a,u)),(p=t.samples).length){var v=p[0];f=Math.min(f,c(v.pts-d*a,u)),h=Math.min(h,c(v.dts-d*a,u))}if(f!==1/0){var g=u-f;Math.abs(g)>10*d&&(s.logger.warn("timestamp inconsistency, "+(g/d).toFixed(3)+"s delta against expected value: missing discontinuity ? reset initPTS/initDTS"),this._initPTS=f,this._initDTS=h,this.observer.trigger(o.default.INIT_PTS_FOUND,{initPTS:f}))}}}else this.generateIS(e,t,a);if(this.ISGenerated)if(e.samples.length){e.timescale||(s.logger.warn("regenerate InitSegment as audio detected"),this.generateIS(e,t,a));var m=this.remuxAudio(e,a,i,l);if(t.samples.length){var y=void 0;m&&(y=m.endPTS-m.startPTS),t.timescale||(s.logger.warn("regenerate InitSegment as video detected"),this.generateIS(e,t,a)),this.remuxVideo(t,a,i,y,l)}}else{var b=void 0;t.samples.length&&(b=this.remuxVideo(t,a,i,l)),b&&e.codec&&this.remuxEmptyAudio(e,a,i,b)}r.samples.length&&this.remuxID3(r,a),n.samples.length&&this.remuxText(n,a),this.observer.trigger(o.default.FRAG_PARSED)}},{key:"generateIS",value:function(e,t,r){var n,a,i=this.observer,c=e.samples,d=t.samples,f=this.typeSupported,h="audio/mp4",p={},v={tracks:p},g=void 0===this._initPTS;if(g&&(n=a=1/0),e.config&&c.length&&(e.timescale=e.samplerate,s.logger.log("audio sampling rate : "+e.samplerate),e.isAAC||(f.mpeg?(h="audio/mpeg",e.codec=""):f.mp3&&(e.codec="mp3")),p.audio={container:h,codec:e.codec,initSegment:!e.isAAC&&f.mpeg?new Uint8Array:l.default.initSegment([e]),metadata:{channelCount:e.channelCount}},g&&(n=a=c[0].pts-e.inputTimeScale*r)),t.sps&&t.pps&&d.length){var m=t.inputTimeScale;t.timescale=m,p.video={container:"video/mp4",codec:t.codec,initSegment:l.default.initSegment([t]),metadata:{width:t.width,height:t.height}},g&&(n=Math.min(n,d[0].pts-m*r),a=Math.min(a,d[0].dts-m*r),this.observer.trigger(o.default.INIT_PTS_FOUND,{initPTS:n}))}Object.keys(p).length?(i.trigger(o.default.FRAG_PARSING_INIT_SEGMENT,v),this.ISGenerated=!0,g&&(this._initPTS=n,this._initDTS=a)):i.trigger(o.default.ERROR,{type:u.ErrorTypes.MEDIA_ERROR,details:u.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"no audio/video samples found"})}},{key:"remuxVideo",value:function(e,t,r,n,a){var i,c,d,f,h,p,v,g=8,m=e.timescale,y=e.samples,b=[],E=y.length,S=this._PTSNormalize,_=this._initDTS,k=this.nextAvcDts,L=this.isSafari;L&&(r|=y.length&&k&&(a&&Math.abs(t-k/m)<.1||Math.abs(y[0].pts-k-_)1?s.logger.log("AVC:"+R+" ms hole between fragments detected,filling it"):R<-1&&s.logger.log("AVC:"+-R+" ms overlapping between fragments detected"),h=k,y[0].dts=h,f=Math.max(f-R,k),y[0].pts=f,s.logger.log("Video/PTS/DTS adjusted: "+Math.round(f/90)+"/"+Math.round(h/90)+",delta:"+R+" ms")),A=y[y.length-1],v=Math.max(A.dts,0),p=Math.max(A.pts,0,v),L&&(i=Math.round((v-h)/(y.length-1)));for(var x=0,C=0,O=0;O0?U-1:U].dts;if(Q.stretchShortVideoTrack){var $=Q.maxBufferHole,Z=Q.maxSeekHole,J=Math.floor(Math.min($,Z)*m),ee=(n?f+n*m:this.nextAudioPts)-j.pts;ee>J?((i=ee-X)<0&&(i=X),s.logger.log("It is approximately "+ee/90+" ms to the next segment; using duration "+i/90+" ms for the last video frame.")):i=X}else i=X}W=Math.round(j.pts-j.dts)}b.push({size:z,duration:i,cts:W,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:j.key?2:1,isNonSync:j.key?0:1}})}this.nextAvcDts=v+i;var te=e.dropped;if(e.len=0,e.nbNalu=0,e.dropped=0,b.length&&navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var re=b[0].flags;re.dependsOn=2,re.isNonSync=0}e.samples=b,d=l.default.moof(e.sequenceNumber++,h,e),e.samples=[];var ne={data1:d,data2:c,startPTS:f/m,endPTS:(p+i)/m,startDTS:h/m,endDTS:this.nextAvcDts/m,type:"video",nb:b.length,dropped:te};return this.observer.trigger(o.default.FRAG_PARSING_DATA,ne),ne}},{key:"remuxAudio",value:function(e,t,r,n){var a,c,d,f,h,p,v,g=e.inputTimeScale,m=g/e.timescale,y=(e.isAAC?1024:1152)*m,b=this._PTSNormalize,E=this._initDTS,S=!e.isAAC&&this.typeSupported.mpeg,_=e.samples,k=[],L=this.nextAudioPts;if((r|=_.length&&L&&(n&&Math.abs(t-L/g)<.1||Math.abs(_[0].pts-L-E)<20*y))||(L=t*g),_.forEach((function(e){e.pts=e.dts=b(e.pts-E,L)})),_.sort((function(e,t){return e.pts-t.pts})),n&&e.isAAC)for(var T=0,w=L;T<_.length;){var A,R=_[T];A=R.pts-w;var x=Math.abs(1e3*A/g);if(A<=-y)s.logger.warn("Dropping 1 audio frame @ "+(w/g).toFixed(3)+"s due to "+x+" ms overlap."),_.splice(T,1),e.len-=R.unit.length;else if(A>=y&&x<1e4&&w){var C=Math.round(A/y);s.logger.warn("Injecting "+C+" audio frame @ "+(w/g).toFixed(3)+"s due to "+Math.round(1e3*A/g)+" ms gap.");for(var O=0;O0&&N<1e4)U=Math.round((F-L)/y),s.logger.log(N+" ms hole between AAC samples detected,filling it"),U>0&&((d=i.default.getSilentFrame(e.manifestCodec||e.codec,e.channelCount))||(d=I.subarray()),e.len+=U*d.length);else if(N<-12){s.logger.log("drop overlapping AAC sample, expected/parsed/delta:"+(L/g).toFixed(3)+"s/"+(F/g).toFixed(3)+"s/"+-N+"ms"),e.len-=I.byteLength;continue}F=L}if(p=Math.max(0,F),!(e.len>0))return;var j=S?e.len:e.len+8;a=S?0:8;try{f=new Uint8Array(j)}catch(e){return void this.observer.trigger(o.default.ERROR,{type:u.ErrorTypes.MUX_ERROR,details:u.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:j,reason:"fail allocating audio mdat "+j})}S||(new DataView(f.buffer).setUint32(0,j),f.set(l.default.types.mdat,4));for(var G=0;G=2&&(W=k[H-2].duration,c.duration=W),H){this.nextAudioPts=L=v+m*W,e.len=0,e.samples=k,h=S?new Uint8Array:l.default.moof(e.sequenceNumber++,p/m,e),e.samples=[];var V=p/g,q=L/g,K={data1:h,data2:f,startPTS:V,endPTS:q,startDTS:V,endDTS:q,type:"audio",nb:H};return this.observer.trigger(o.default.FRAG_PARSING_DATA,K),K}return null}},{key:"remuxEmptyAudio",value:function(e,t,r,n){var a=e.inputTimeScale,o=a/(e.samplerate?e.samplerate:a),l=this.nextAudioPts,u=(void 0!==l?l:n.startDTS*a)+this._initDTS,c=n.endDTS*a+this._initDTS,d=1024*o,f=Math.ceil((c-u)/d),h=i.default.getSilentFrame(e.manifestCodec||e.codec,e.channelCount);if(s.logger.warn("remux empty Audio"),h){for(var p=[],v=0;v4294967296;)e+=r;return e}}]),e}();r.default=c},{28:28,30:30,31:31,39:39,46:46}],41:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;rNumber.MAX_SAFE_INTEGER?1/0:t}},{key:"hexadecimalInteger",value:function(e){if(this[e]){var t=(this[e]||"0x").slice(2);t=(1&t.length?"0":"")+t;for(var r=new Uint8Array(t.length/2),n=0;nNumber.MAX_SAFE_INTEGER?1/0:t}},{key:"decimalFloatingPoint",value:function(e){return parseFloat(this[e])}},{key:"enumeratedString",value:function(e){return this[e]}},{key:"decimalResolution",value:function(e){var t=a.exec(this[e]);if(null!==t)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}}}],[{key:"parseAttrList",value:function(e){var t,r={};for(i.lastIndex=0;null!==(t=i.exec(e));){var n=t[2];0===n.indexOf('"')&&n.lastIndexOf('"')===n.length-1&&(n=n.slice(1,-1)),r[t[1]]=n}return r}}]),e}();r.default=o},{}],43:[function(e,t,r){"use strict";t.exports={search:function(e,t){for(var r=0,n=e.length-1,a=null,i=null;r<=n;){var o=t(i=e[a=(r+n)/2|0]);if(o>0)r=a+1;else{if(!(o<0))return i;n=a-1}}return null}}},{}],44:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r=this.minWeight_}},{key:"getEstimate",value:function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_}},{key:"destroy",value:function(){}}]),e}();r.default=i},{45:45}],45:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r "+t}(e,n[0])),t.apply(self.console,n)}:n}Object.defineProperty(r,"__esModule",{value:!0});var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o={trace:n,debug:n,log:n,warn:n,info:n,error:n},s=o;r.enableLogs=function(e){if(!0===e||"object"===(void 0===e?"undefined":i(e))){!function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n=2)if(window.clearTimeout(this.requestTimeout),0===n.tfirst&&(n.tfirst=Math.max(performance.now(),n.trequest)),4===r){var s=t.status;if(s>=200&&s<300){n.tload=Math.max(n.tfirst,performance.now());var l,u=void 0;l="arraybuffer"===i.responseType?(u=t.response).byteLength:(u=t.responseText).length,n.loaded=n.total=l;var c={url:t.responseURL,data:u};this.callbacks.onSuccess(c,n,i,t)}else n.retry>=o.maxRetry||s>=400&&s<499?(a.logger.error(s+" while loading "+i.url),this.callbacks.onError({code:s,text:t.statusText},i,t)):(a.logger.warn(s+" while loading "+i.url+", retrying in "+this.retryDelay+"..."),this.destroy(),this.retryTimeout=window.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,o.maxRetryDelay),n.retry++)}else this.requestTimeout=window.setTimeout(this.loadtimeout.bind(this),o.timeout)}},{key:"loadtimeout",value:function(){a.logger.warn("timeout while loading "+this.context.url),this.callbacks.onTimeout(this.stats,this.context,null)}},{key:"loadprogress",value:function(e){var t=e.currentTarget,r=this.stats;r.loaded=e.loaded,e.lengthComputable&&(r.total=e.total);var n=this.callbacks.onProgress;n&&n(r,this.context,null,t)}}]),e}();r.default=i},{46:46}]},{},[35])(35)},61454:function(e,t,r){e.exports=r(82225)},18552:function(e,t,r){var n=r(10852)(r(55639),"DataView");e.exports=n},1989:function(e,t,r){var n=r(51789),a=r(80401),i=r(57667),o=r(21327),s=r(81866);function l(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}},85990:function(e,t,r){var n=r(46384),a=r(77412),i=r(34865),o=r(44037),s=r(63886),l=r(64626),u=r(6450),c=r(18805),d=r(1911),f=r(58234),h=r(46904),p=r(64160),v=r(43824),g=r(29148),m=r(38517),y=r(1469),b=r(44144),E=r(56688),S=r(13218),_=r(72928),k=r(3674),L=r(81704),T="[object Arguments]",w="[object Function]",A="[object Object]",R={};R[T]=R["[object Array]"]=R["[object ArrayBuffer]"]=R["[object DataView]"]=R["[object Boolean]"]=R["[object Date]"]=R["[object Float32Array]"]=R["[object Float64Array]"]=R["[object Int8Array]"]=R["[object Int16Array]"]=R["[object Int32Array]"]=R["[object Map]"]=R["[object Number]"]=R[A]=R["[object RegExp]"]=R["[object Set]"]=R["[object String]"]=R["[object Symbol]"]=R["[object Uint8Array]"]=R["[object Uint8ClampedArray]"]=R["[object Uint16Array]"]=R["[object Uint32Array]"]=!0,R["[object Error]"]=R[w]=R["[object WeakMap]"]=!1,e.exports=function e(t,r,x,C,O,P){var D,M=1&r,B=2&r,I=4&r;if(x&&(D=O?x(t,C,O,P):x(t)),void 0!==D)return D;if(!S(t))return t;var F=y(t);if(F){if(D=v(t),!M)return u(t,D)}else{var N=p(t),U=N==w||"[object GeneratorFunction]"==N;if(b(t))return l(t,M);if(N==A||N==T||U&&!O){if(D=B||U?{}:m(t),!M)return B?d(t,s(D,t)):c(t,o(D,t))}else{if(!R[N])return O?t:{};D=g(t,N,M)}}P||(P=new n);var j=P.get(t);if(j)return j;P.set(t,D),_(t)?t.forEach((function(n){D.add(e(n,r,x,n,t,P))})):E(t)&&t.forEach((function(n,a){D.set(a,e(n,r,x,a,t,P))}));var G=F?void 0:(I?B?h:f:B?L:k)(t);return a(G||t,(function(n,a){G&&(n=t[a=n]),i(D,a,e(n,r,x,a,t,P))})),D}},3118:function(e,t,r){var n=r(13218),a=Object.create,i=function(){function e(){}return function(t){if(!n(t))return{};if(a)return a(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();e.exports=i},68866:function(e,t,r){var n=r(62488),a=r(1469);e.exports=function(e,t,r){var i=t(e);return a(e)?i:n(i,r(e))}},9454:function(e,t,r){var n=r(44239),a=r(37005);e.exports=function(e){return a(e)&&"[object Arguments]"==n(e)}},25588:function(e,t,r){var n=r(64160),a=r(37005);e.exports=function(e){return a(e)&&"[object Map]"==n(e)}},28458:function(e,t,r){var n=r(23560),a=r(15346),i=r(13218),o=r(80346),s=/^\[object .+?Constructor\]$/,l=Function.prototype,u=Object.prototype,c=l.toString,d=u.hasOwnProperty,f=RegExp("^"+c.call(d).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!i(e)||a(e))&&(n(e)?f:s).test(o(e))}},29221:function(e,t,r){var n=r(64160),a=r(37005);e.exports=function(e){return a(e)&&"[object Set]"==n(e)}},38749:function(e,t,r){var n=r(44239),a=r(41780),i=r(37005),o={};o["[object Float32Array]"]=o["[object Float64Array]"]=o["[object Int8Array]"]=o["[object Int16Array]"]=o["[object Int32Array]"]=o["[object Uint8Array]"]=o["[object Uint8ClampedArray]"]=o["[object Uint16Array]"]=o["[object Uint32Array]"]=!0,o["[object Arguments]"]=o["[object Array]"]=o["[object ArrayBuffer]"]=o["[object Boolean]"]=o["[object DataView]"]=o["[object Date]"]=o["[object Error]"]=o["[object Function]"]=o["[object Map]"]=o["[object Number]"]=o["[object Object]"]=o["[object RegExp]"]=o["[object Set]"]=o["[object String]"]=o["[object WeakMap]"]=!1,e.exports=function(e){return i(e)&&a(e.length)&&!!o[n(e)]}},280:function(e,t,r){var n=r(25726),a=r(86916),i=Object.prototype.hasOwnProperty;e.exports=function(e){if(!n(e))return a(e);var t=[];for(var r in Object(e))i.call(e,r)&&"constructor"!=r&&t.push(r);return t}},10313:function(e,t,r){var n=r(13218),a=r(25726),i=r(33498),o=Object.prototype.hasOwnProperty;e.exports=function(e){if(!n(e))return i(e);var t=a(e),r=[];for(var s in e)("constructor"!=s||!t&&o.call(e,s))&&r.push(s);return r}},22545:function(e){e.exports=function(e,t){for(var r=-1,n=Array(e);++r-1&&e%1==0&&e-1}},54705:function(e,t,r){var n=r(18470);e.exports=function(e,t){var r=this.__data__,a=n(r,e);return a<0?(++this.size,r.push([e,t])):r[a][1]=t,this}},24785:function(e,t,r){var n=r(1989),a=r(38407),i=r(57071);e.exports=function(){this.size=0,this.__data__={hash:new n,map:new(i||a),string:new n}}},11285:function(e,t,r){var n=r(45050);e.exports=function(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}},96e3:function(e,t,r){var n=r(45050);e.exports=function(e){return n(this,e).get(e)}},49916:function(e,t,r){var n=r(45050);e.exports=function(e){return n(this,e).has(e)}},95265:function(e,t,r){var n=r(45050);e.exports=function(e,t){var r=n(this,e),a=r.size;return r.set(e,t),this.size+=r.size==a?0:1,this}},94536:function(e,t,r){var n=r(10852)(Object,"create");e.exports=n},86916:function(e,t,r){var n=r(5569)(Object.keys,Object);e.exports=n},33498:function(e){e.exports=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}},31167:function(e,t,r){e=r.nmd(e);var n=r(31957),a=t&&!t.nodeType&&t,i=a&&e&&!e.nodeType&&e,o=i&&i.exports===a&&n.process,s=function(){try{return i&&i.require&&i.require("util").types||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=s},5569:function(e){e.exports=function(e,t){return function(r){return e(t(r))}}},37465:function(e,t,r){var n=r(38407);e.exports=function(){this.__data__=new n,this.size=0}},63779:function(e){e.exports=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}},67599:function(e){e.exports=function(e){return this.__data__.get(e)}},44758:function(e){e.exports=function(e){return this.__data__.has(e)}},34309:function(e,t,r){var n=r(38407),a=r(57071),i=r(83369);e.exports=function(e,t){var r=this.__data__;if(r instanceof n){var o=r.__data__;if(!a||o.length<199)return o.push([e,t]),this.size=++r.size,this;r=this.__data__=new i(o)}return r.set(e,t),this.size=r.size,this}},80346:function(e){var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},74691:function(e,t,r){var n=r(29750),a=r(14841);e.exports=function(e,t,r){return void 0===r&&(r=t,t=void 0),void 0!==r&&(r=(r=a(r))==r?r:0),void 0!==t&&(t=(t=a(t))==t?t:0),n(a(e),t,r)}},50361:function(e,t,r){var n=r(85990);e.exports=function(e){return n(e,5)}},77813:function(e){e.exports=function(e,t){return e===t||e!=e&&t!=t}},35694:function(e,t,r){var n=r(9454),a=r(37005),i=Object.prototype,o=i.hasOwnProperty,s=i.propertyIsEnumerable,l=n(function(){return arguments}())?n:function(e){return a(e)&&o.call(e,"callee")&&!s.call(e,"callee")};e.exports=l},1469:function(e){var t=Array.isArray;e.exports=t},98612:function(e,t,r){var n=r(23560),a=r(41780);e.exports=function(e){return null!=e&&a(e.length)&&!n(e)}},44144:function(e,t,r){e=r.nmd(e);var n=r(55639),a=r(95062),i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,s=o&&o.exports===i?n.Buffer:void 0,l=(s?s.isBuffer:void 0)||a;e.exports=l},23560:function(e,t,r){var n=r(44239),a=r(13218);e.exports=function(e){if(!a(e))return!1;var t=n(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},41780:function(e){e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},56688:function(e,t,r){var n=r(25588),a=r(51717),i=r(31167),o=i&&i.isMap,s=o?a(o):n;e.exports=s},72928:function(e,t,r){var n=r(29221),a=r(51717),i=r(31167),o=i&&i.isSet,s=o?a(o):n;e.exports=s},36719:function(e,t,r){var n=r(38749),a=r(51717),i=r(31167),o=i&&i.isTypedArray,s=o?a(o):n;e.exports=s},3674:function(e,t,r){var n=r(14636),a=r(280),i=r(98612);e.exports=function(e){return i(e)?n(e):a(e)}},81704:function(e,t,r){var n=r(14636),a=r(10313),i=r(98612);e.exports=function(e){return i(e)?n(e,!0):a(e)}},15644:function(e,t,r){var n=r(83369);function a(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var r=function(){var n=arguments,a=t?t.apply(this,n):n[0],i=r.cache;if(i.has(a))return i.get(a);var o=e.apply(this,n);return r.cache=i.set(a,o)||i,o};return r.cache=new(a.Cache||n),r}a.Cache=n,e.exports=a},50308:function(e){e.exports=function(){}},70479:function(e){e.exports=function(){return[]}},95062:function(e){e.exports=function(){return!1}},69887:function(e){"use strict";e.exports=function(e){for(var t=5381,r=e.length;r;)t=33*t^e.charCodeAt(--r);return t>>>0}}}]);