|
|
(window.webpackJsonp=window.webpackJsonp||[]).push([[291,6,7,11],{"+QRC":function(Ze,Qe,ye){"use strict";var Se=ye("E9nw"),Z={"text/plain":"Text","text/html":"Url",default:"Text"},U="Copy to clipboard: #{key}, Enter";function _(E){var A=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return E.replace(/#{\s*key\s*}/g,A)}function L(E,A){var w,v,u,f,o,t,i=!1;A||(A={}),w=A.debug||!1;try{u=Se(),f=document.createRange(),o=document.getSelection(),t=document.createElement("span"),t.textContent=E,t.style.all="unset",t.style.position="fixed",t.style.top=0,t.style.clip="rect(0, 0, 0, 0)",t.style.whiteSpace="pre",t.style.webkitUserSelect="text",t.style.MozUserSelect="text",t.style.msUserSelect="text",t.style.userSelect="text",t.addEventListener("copy",function(h){if(h.stopPropagation(),A.format)if(h.preventDefault(),typeof h.clipboardData=="undefined"){w&&console.warn("unable to use e.clipboardData"),w&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var a=Z[A.format]||Z.default;window.clipboardData.setData(a,E)}else h.clipboardData.clearData(),h.clipboardData.setData(A.format,E);A.onCopy&&(h.preventDefault(),A.onCopy(h.clipboardData))}),document.body.appendChild(t),f.selectNodeContents(t),o.addRange(f);var s=document.execCommand("copy");if(!s)throw new Error("copy command was unsuccessful");i=!0}catch(h){w&&console.error("unable to copy using execCommand: ",h),w&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(A.format||"text",E),A.onCopy&&A.onCopy(window.clipboardData),i=!0}catch(a){w&&console.error("unable to copy using clipboardData: ",a),w&&console.error("falling back to prompt"),v=_("message"in A?A.message:U),window.prompt(v,E)}}finally{o&&(typeof o.removeRange=="function"?o.removeRange(f):o.removeAllRanges()),t&&document.body.removeChild(t),u()}return i}Ze.exports=L},"0r65":function(Ze,Qe){var ye=arguments[3],Se=arguments[4],Z=arguments[5],U=JSON.stringify;Ze.exports=function(_,L){for(var E,A=Object.keys(Z),w=0,v=A.length;w<v;w++){var u=A[w],f=Z[u].exports;if(f===_||f&&f.default===_){E=u;break}}if(!E){E=Math.floor(Math.pow(16,8)*Math.random()).toString(16);for(var o={},w=0,v=A.length;w<v;w++){var u=A[w];o[u]=u}Se[E]=["function(require,module,exports){"+_+"(self); }",o]}var t=Math.floor(Math.pow(16,8)*Math.random()).toString(16),i={};i[E]=E,Se[t]=["function(require,module,exports){var f = require("+U(E)+");(f.default ? f.default : f)(self);}",i];var s={};h(t);function h(c){s[c]=!0;for(var g in Se[c][1]){var p=Se[c][1][g];s[p]||h(p)}}var a="("+ye+")({"+Object.keys(s).map(function(c){return U(c)+":["+Se[c][0]+","+U(Se[c][1])+"]"}).join(",")+"},{},["+U(t)+"])",e=window.URL||window.webkitURL||window.mozURL||window.msURL,l=new Blob([a],{type:"text/javascript"});if(L&&L.bare)return l;var n=e.createObjectURL(l),d=new Worker(n);return d.objectURL=n,d}},"1ZF9":function(Ze,Qe,ye){Ze.exports=ye.p+"static/Authorize.cc9c212f.png"},"4xil":function(Ze,Qe,ye){Ze.exports={watermark:"watermark___2DVjg",videovideo:"videovideo___3jScv",animate__loop:"animate__loop___36IZ1",upDown:"upDown___3FGkz",container:"container___GV_Ds","video-container":"video-container___35tqx","video-controls":"video-controls___u99fM",hide:"hide___2GDit","video-progress":"video-progress___2LKQJ",seek:"seek___3b-US","seek-tooltip":"seek-tooltip___bZ9sZ","bottom-controls":"bottom-controls___74sQw","left-controls":"left-controls___2kBb3","right-controls":"right-controls___3oxDi","volume-controls":"volume-controls___QLaWH","fullscreen-button":"fullscreen-button___2nHzc","fullscreen-button1":"fullscreen-button1___1murk","pip-button":"pip-button___18qQG","playback-animation":"playback-animation___gCL6X",volume:"volume___10eUe",hidden:"hidden___2JBJW"}},"55Ip":function(Ze,Qe,ye){"use strict";ye.d(Qe,"a",function(){return l});var Se=ye("Ty5D"),Z=ye("dI71"),U=ye("cDcd"),_=ye.n(U),L=ye("YS25"),E=ye("17x9"),A=ye.n(E),w=ye("wx14"),v=ye("zLVn"),u=ye("9R94"),f=function(y){Object(Z.a)(r,y);function r(){for(var S,T=arguments.length,R=new Array(T),D=0;D<T;D++)R[D]=arguments[D];return S=y.call.apply(y,[this].concat(R))||this,S.history=Object(L.a)(S.props),S}var x=r.prototype;return x.render=function(){return _.a.createElement(Se.c,{history:this.history,children:this.props.children})},r}(_.a.Component),o=function(y){Object(Z.a)(r,y);function r(){for(var S,T=arguments.length,R=new Array(T),D=0;D<T;D++)R[D]=arguments[D];return S=y.call.apply(y,[this].concat(R))||this,S.history=Object(L.b)(S.props),S}var x=r.prototype;return x.render=function(){return _.a.createElement(Se.c,{history:this.history,children:this.props.children})},r}(_.a.Component),t=function(r,x){return typeof r=="function"?r(x):r},i=function(r,x){return typeof r=="string"?Object(L.c)(r,null,null,x):r},s=function(r){return r},h=_.a.forwardRef;typeof h=="undefined"&&(h=s);function a(y){return!!(y.metaKey||y.altKey||y.ctrlKey||y.shiftKey)}var e=h(function(y,r){var x=y.innerRef,S=y.navigate,T=y.onClick,R=Object(v.a)(y,["innerRef","navigate","onClick"]),D=R.target,k=Object(w.a)({},R,{onClick:function(G){try{T&&T(G)}catch(P){throw G.preventDefault(),P}!G.defaultPrevented&&G.button===0&&(!D||D==="_self")&&!a(G)&&(G.preventDefault(),S())}});return s!==h?k.ref=r||x:k.ref=x,_.a.createElement("a",k)}),l=h(function(y,r){var x=y.component,S=x===void 0?e:x,T=y.replace,R=y.to,D=y.innerRef,k=Object(v.a)(y,["component","replace","to","innerRef"]);return _.a.createElement(Se.e.Consumer,null,function(B){B||Object(u.a)(!1);var G=B.history,P=i(t(R,B.location),B.location),$=P?G.createHref(P):"",X=Object(w.a)({},k,{href:$,navigate:function(){var N=t(R,B.location),H=T?G.replace:G.push;H(N)}});return s!==h?X.ref=r||D:X.innerRef=D,_.a.createElement(S,X)})});if(!1)var n,d;var c=function(r){return r},g=_.a.forwardRef;typeof g=="undefined"&&(g=c);function p(){for(var y=arguments.length,r=new Array(y),x=0;x<y;x++)r[x]=arguments[x];return r.filter(function(S){return S}).join(" ")}var m=g(function(y,r){var x=y["aria-current"],S=x===void 0?"page":x,T=y.activeClassName,R=T===void 0?"active":T,D=y.activeStyle,k=y.className,B=y.exact,G=y.isActive,P=y.location,$=y.sensitive,X=y.strict,z=y.style,N=y.to,H=y.innerRef,q=Object(v.a)(y,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return _.a.createElement(Se.e.Consumer,null,function(ee){ee||Object(u.a)(!1);var fe=P||ee.location,oe=i(t(N,fe),fe),he=oe.pathname,se=he&&he.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),ge=se?Object(Se.f)(fe.pathname,{path:se,exact:B,sensitive:$,strict:X}):null,ie=!!(G?G(ge,fe):ge),re=ie?p(k,R):k,Q=ie?Object(w.a)({},z,{},D):z,pe=Object(w.a)({"aria-current":ie&&S||null,className:re,style:Q,to:oe},q);return c!==g?pe.ref=r||H:pe.innerRef=H,_.a.createElement(l,pe)})});if(!1)var b},"7ixt":function(Ze,Qe,ye){"use strict";ye.d(Qe,"a",function(){return U});var Se={adjustX:1,adjustY:1},Z=[0,0],U={left:{points:["cr","cl"],overflow:Se,offset:[-4,0],targetOffset:Z},right:{points:["cl","cr"],overflow:Se,offset:[4,0],targetOffset:Z},top:{points:["bc","tc"],overflow:Se,offset:[0,-4],targetOffset:Z},bottom:{points:["tc","bc"],overflow:Se,offset:[0,4],targetOffset:Z},topLeft:{points:["bl","tl"],overflow:Se,offset:[0,-4],targetOffset:Z},leftTop:{points:["tr","tl"],overflow:Se,offset:[-4,0],targetOffset:Z},topRight:{points:["br","tr"],overflow:Se,offset:[0,-4],targetOffset:Z},rightTop:{points:["tl","tr"],overflow:Se,offset:[4,0],targetOffset:Z},bottomRight:{points:["tr","br"],overflow:Se,offset:[0,4],targetOffset:Z},rightBottom:{points:["bl","br"],overflow:Se,offset:[4,0],targetOffset:Z},bottomLeft:{points:["tl","bl"],overflow:Se,offset:[0,4],targetOffset:Z},leftBottom:{points:["br","bl"],overflow:Se,offset:[-4,0],targetOffset:Z}},_=U},"8hTe":function(Ze,Qe,ye){Ze.exports={button:"button___1wy9m"}},"8mKB":function(Ze,Qe,ye){"use strict";var Se=ye("rePB"),Z=ye("1OyB"),U=ye("vuIU"),_=ye("Ji7U"),L=ye("md7G"),E=ye("foSv"),A=ye("cDcd"),w=ye.n(A),v=ye("m+aA"),u=ye("TSYQ"),f=ye.n(u),o=ye("4IlW");function t(y){var r=y.pageXOffset,x="scrollLeft";if(typeof r!="number"){var S=y.document;r=S.documentElement[x],typeof r!="number"&&(r=S.body[x])}return r}function i(y){var r,x,S=y.ownerDocument,T=S.body,R=S&&S.documentElement,D=y.getBoundingClientRect();return r=D.left,x=D.top,r-=R.clientLeft||T.clientLeft||0,x-=R.clientTop||T.clientTop||0,{left:r,top:x}}function s(y){var r=i(y),x=y.ownerDocument,S=x.defaultView||x.parentWindow;return r.left+=t(S),r.left}function h(y){var r=a();return function(){var S=Object(E.a)(y),T;if(r){var R=Object(E.a)(this).constructor;T=Reflect.construct(S,arguments,R)}else T=S.apply(this,arguments);return Object(L.a)(this,T)}}function a(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(y){return!1}}var e=function(y){Object(_.a)(x,y);var r=h(x);function x(){var S;return Object(Z.a)(this,x),S=r.apply(this,arguments),S.onHover=function(T){var R=S.props,D=R.onHover,k=R.index;D(T,k)},S.onClick=function(T){var R=S.props,D=R.onClick,k=R.index;D(T,k)},S.onKeyDown=function(T){var R=S.props,D=R.onClick,k=R.index;T.keyCode===13&&D(T,k)},S}return Object(U.a)(x,[{key:"getClassName",value:function(){var T=this.props,R=T.prefixCls,D=T.index,k=T.value,B=T.allowHalf,G=T.focused,P=D+1,$=R;return k===0&&D===0&&G?$+=" ".concat(R,"-focused"):B&&k+.5>=P&&k<P?($+=" ".concat(R,"-half ").concat(R,"-active"),G&&($+=" ".concat(R,"-focused"))):($+=P<=k?" ".concat(R,"-full"):" ".concat(R,"-zero"),P===k&&G&&($+=" ".concat(R,"-focused"))),$}},{key:"render",value:function(){var T=this.onHover,R=this.onClick,D=this.onKeyDown,k=this.props,B=k.disabled,G=k.prefixCls,P=k.character,$=k.characterRender,X=k.index,z=k.count,N=k.value,H=typeof P=="function"?P(this.props):P,q=w.a.createElement("li",{className:this.getClassName()},w.a.createElement("div",{onClick:B?null:R,onKeyDown:B?null:D,onMouseMove:B?null:T,role:"radio","aria-checked":N>X?"true":"false","aria-posinset":X+1,"aria-setsize":z,tabIndex:B?-1:0},w.a.createElement("div",{className:"".concat(G,"-first")},H),w.a.createElement("div",{className:"".concat(G,"-second")},H)));return $&&(q=$(q,this.props)),q}}]),x}(w.a.Component);function l(y,r){var x=Object.keys(y);if(Object.getOwnPropertySymbols){var S=Object.getOwnPropertySymbols(y);r&&(S=S.filter(function(T){return Object.getOwnPropertyDescriptor(y,T).enumerable})),x.push.apply(x,S)}return x}function n(y){for(var r=1;r<arguments.length;r++){var x=arguments[r]!=null?arguments[r]:{};r%2?l(Object(x),!0).forEach(function(S){Object(Se.a)(y,S,x[S])}):Object.getOwnPropertyDescriptors?Object.defineProperties(y,Object.getOwnPropertyDescriptors(x)):l(Object(x)).forEach(function(S){Object.defineProperty(y,S,Object.getOwnPropertyDescriptor(x,S))})}return y}function d(y){var r=c();return function(){var S=Object(E.a)(y),T;if(r){var R=Object(E.a)(this).constructor;T=Reflect.construct(S,arguments,R)}else T=S.apply(this,arguments);return Object(L.a)(this,T)}}function c(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(y){return!1}}function g(){}var p=function(y){Object(_.a)(x,y);var r=d(x);function x(S){var T;Object(Z.a)(this,x),T=r.call(this,S),T.onHover=function(D,k){var B=T.props.onHoverChange,G=T.getStarValue(k,D.pageX),P=T.state.cleanedValue;G!==P&&T.setState({hoverValue:G,cleanedValue:null}),B(G)},T.onMouseLeave=function(){var D=T.props.onHoverChange;T.setState({hoverValue:void 0,cleanedValue:null}),D(void 0)},T.onClick=function(D,k){var B=T.props.allowClear,G=T.state.value,P=T.getStarValue(k,D.pageX),$=!1;B&&($=P===G),T.onMouseLeave(),T.changeValue($?0:P),T.setState({cleanedValue:$?P:null})},T.onFocus=function(){var D=T.props.onFocus;T.setState({focused:!0}),D&&D()},T.onBlur=function(){var D=T.props.onBlur;T.setState({focused:!1}),D&&D()},T.onKeyDown=function(D){var k=D.keyCode,B=T.props,G=B.count,P=B.allowHalf,$=B.onKeyDown,X=B.direction,z=X==="rtl",N=T.state.value;k===o.a.RIGHT&&N<G&&!z?(P?N+=.5:N+=1,T.changeValue(N),D.preventDefault()):k===o.a.LEFT&&N>0&&!z||k===o.a.RIGHT&&N>0&&z?(P?N-=.5:N-=1,T.changeValue(N),D.preventDefault()):k===o.a.LEFT&&N<G&&z&&(P?N+=.5:N+=1,T.changeValue(N),D.preventDefault()),$&&$(D)},T.saveRef=function(D){return function(k){T.stars[D]=k}},T.saveRate=function(D){T.rate=D};var R=S.value;return R===void 0&&(R=S.defaultValue),T.stars={},T.state={value:R,focused:!1,cleanedValue:null},T}return Object(U.a)(x,[{key:"componentDidMount",value:function(){var T=this.props,R=T.autoFocus,D=T.disabled;R&&!D&&this.focus()}},{key:"getStarDOM",value:function(T){return Object(v.a)(this.stars[T])}},{key:"getStarValue",value:function(T,R){var D=this.props,k=D.allowHalf,B=D.direction,G=B==="rtl",P=T+1;if(k){var $=this.getStarDOM(T),X=s($),z=$.clientWidth;(G&&R-X>z/2||!G&&R-X<z/2)&&(P-=.5)}return P}},{key:"focus",value:function(){var T=this.props.disabled;T||this.rate.focus()}},{key:"blur",value:function(){var T=this.props.disabled;T||this.rate.blur()}},{key:"changeValue",value:function(T){var R=this.props.onChange;"value"in this.props||this.setState({value:T}),R(T)}},{key:"render",value:function(){for(var T=this.props,R=T.count,D=T.allowHalf,k=T.style,B=T.prefixCls,G=T.disabled,P=T.className,$=T.character,X=T.characterRender,z=T.tabIndex,N=T.direction,H=this.state,q=H.value,ee=H.hoverValue,fe=H.focused,oe=[],he=G?"".concat(B,"-disabled"):"",se=0;se<R;se+=1)oe.push(w.a.createElement(e,{ref:this.saveRef(se),index:se,count:R,disabled:G,prefixCls:"".concat(B,"-star"),allowHalf:D,value:ee===void 0?q:ee,onClick:this.onClick,onHover:this.onHover,key:se,character:$,characterRender:X,focused:fe}));var ge=f()(B,he,P,Object(Se.a)({},"".concat(B,"-rtl"),N==="rtl"));return w.a.createElement("ul",{className:ge,style:k,onMouseLeave:G?null:this.onMouseLeave,tabIndex:G?-1:z,onFocus:G?null:this.onFocus,onBlur:G?null:this.onBlur,onKeyDown:G?null:this.onKeyDown,ref:this.saveRate,role:"radiogroup"},oe)}}],[{key:"getDerivedStateFromProps",value:function(T,R){return"value"in T&&T.value!==void 0?n(n({},R),{},{value:T.value}):R}}]),x}(w.a.Component);p.defaultProps={defaultValue:0,count:5,allowHalf:!1,allowClear:!0,style:{},prefixCls:"rc-rate",onChange:g,character:"\u2605",onHoverChange:g,tabIndex:0,direction:"ltr"};var m=p,b=Qe.a=m},"96GE":function(Ze,Qe,ye){"use strict";ye.r(Qe),ye.d(Qe,"formatQuery",function(){return Me});var Se=ye("T2oS"),Z=ye("W9HT"),U=ye("k1fw"),_=ye("PpiC"),L=ye("cDcd"),E=ye.n(L),A=ye("9kvl"),w=ye("JqQi"),v=ye.n(w),u=ye("pC0b"),f=ye("GzdX"),o=ye("9og8"),t=ye("tJVT"),i=ye("WmNS"),s=ye.n(i),h=ye("nUhQ"),a=ye.n(h),e=ye("2qtc"),l=ye("kLXV"),n=ye("7Kak"),d=ye("9yH6"),c=ye("miYZ"),g=ye("tsqr"),p=ye("5NDa"),m=ye("5rEg"),b=ye("Ty5D"),y=ye("sWEp"),r=ye.n(y),x=ye("qdXH"),S=m.a.Search,T=function(Ge){var Je,$e=Ge.videoDetail,et=Ge.globalSetting,nt=Ge.loading,at=Ge.dispatch,ft=Object(_.a)(Ge,["videoDetail","globalSetting","loading","dispatch"]),yt=Object(b.i)(),mt=Object(b.h)(),pt=Object(L.useState)([]),vt=Object(t.a)(pt,2),ut=vt[0],dt=vt[1],gt=Object(L.useState)(""),st=Object(t.a)(gt,2),ht=st[0],ce=st[1],te=Object(L.useState)(),I=Object(t.a)(te,2),W=I[0],K=I[1],Y=Object(L.useState)(!1),le=Object(t.a)(Y,2),Ae=le[0],Ce=le[1],Fe=Object(L.useState)(!1),We=Object(t.a)(Fe,2),Be=We[0],Ye=We[1];Object(L.useEffect)(function(){$e.actionTabs.key==="Banner-SendToClass"&&ze()},[$e.actionTabs.key]);var ze=function(){var He=Object(o.a)(s.a.mark(function je(){var rt,ct;return s.a.wrap(function(lt){for(;;)switch(lt.prev=lt.next){case 0:return lt.next=2,Object(x.h)({});case 2:if(ct=lt.sent,!(ct!=null&&(rt=ct.courses)!==null&&rt!==void 0&&rt.length)){lt.next=8;break}dt((ct==null?void 0:ct.courses)||[]),Ye(!0),lt.next=11;break;case 8:return Xe(),g.b.info("\u60A8\u5F53\u524D\u6CA1\u6709\u7BA1\u7406\u4EFB\u4F55\u8BFE\u5802\uFF0C\u4E0D\u53EF\u53D1\u9001"),lt.abrupt("return");case 11:case"end":return lt.stop()}},je)}));return function(){return He.apply(this,arguments)}}(),Ue=function(je){dt(ut==null?void 0:ut.map(function(rt){return Object(U.a)(Object(U.a)({},rt),{},{hide:!rt.course_name.includes(je)})}))},qe=function(){var He=Object(o.a)(s.a.mark(function je(){var rt;return s.a.wrap(function(it){for(;;)switch(it.prev=it.next){case 0:if(W){it.next=3;break}return Ce(!0),it.abrupt("return");case 3:return it.next=5,Object(x.m)({id:yt.videoId,course_id:W});case 5:rt=it.sent,(rt==null?void 0:rt.status)===0&&(g.b.success("\u53D1\u9001\u6210\u529F"),Xe(),A.d===null||A.d===void 0||A.d.replace("/classrooms/".concat(W,"/shixun_homework")));case 7:case"end":return it.stop()}},je)}));return function(){return He.apply(this,arguments)}}(),Xe=function(){ce(""),K(null),Ce(!1),at({type:"videoDetail/setActionTabs",payload:{}}),Ye(!1)};return E.a.createElement(l.a,{centered:!0,keyboard:!1,closable:!1,title:"\u53D1\u9001\u81F3\u8BFE\u5802",visible:Be,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:qe,onCancel:Xe},E.a.createElement("div",{className:r.a.wrap},E.a.createElement("div",{className:"mb10"},E.a.createElement(S,{placeholder:"\u8F93\u5165\u8BFE\u5802\u540D\u79F0\u7684\u5173\u952E\u5B57\u8FDB\u884C\u641C\u7D22",value:ht,onChange:function(je){return ce(je.target.value)},onSearch:function(je){ce(je),Ue(je)}})),E.a.createElement("div",{className:r.a.radioWrap},E.a.createElement(d.a.Group,{value:W,onChange:function(je){K(je.target.value),Ce(!1)}},ut==null||((Je=ut.filter(function(He){return!(He!=null&&He.hide)}))===null||Je===void 0)?void 0:Je.map(function(He,je){return E.a.createElement(d.a,{className:r.a.radio,value:He.course_id,key:je},He.course_name)}))),Ae&&E.a.createElement("div",{className:r.a.colorFF0000},"\u8BF7\u9009\u62E9\u4F60\u8981\u53D1\u9001\u7684\u8BFE\u5802"),E.a.createElement("div",{className:r.a.title},"\u6E29\u99A8\u63D0\u793A\uFF1A\u5F53\u524D\u89C6\u9891\u9879\u76EE\u5C06\u4F1A\u53D1\u9001\u5230\u6307\u5B9A\u8BFE\u5802")))},R=Object(A.a)(function(tt){var Ge=tt.videoDetail,Je=tt.loading,$e=tt.globalSetting;return{videoDetail:Ge,globalSetting:$e,loading:Je.models.index}})(T),D=ye("sBCT"),k=ye("Mgx3"),B=ye("1vsH"),G=ye("NLgs"),P=ye("Awhp"),$=ye("KrTs"),X=ye("+L6B"),z=ye("2/Rp"),N=ye("O3gP"),H=ye("lrIw"),q=ye("oBTY"),ee=ye("eoI0"),fe=ye.n(ee),oe=ye("HBuW"),he=function(Ge){var Je,$e,et=Ge.videoDetail,nt=Ge.dispatch,at=nt===void 0?function(){}:nt,ft=Ge.visible,yt=Ge.onClose,mt=yt===void 0?function(){}:yt,pt=et.queryParams,vt=et.queryParams,ut=vt.subject_id,dt=vt.videoId,gt={videoId:dt},st=Object(L.useState)(0),ht=Object(t.a)(st,2),ce=ht[0],te=ht[1],I=Object(L.useState)(""),W=Object(t.a)(I,2),K=W[0],Y=W[1],le=Object(L.useState)([]),Ae=Object(t.a)(le,2),Ce=Ae[0],Fe=Ae[1],We=Object(L.useState)([]),Be=Object(t.a)(We,2),Ye=Be[0],ze=Be[1];Object(L.useEffect)(function(){var je,rt,ct=((je=et.detail)===null||je===void 0||((rt=je.video_item)===null||rt===void 0)?void 0:rt.schools)||[];te(ct!=null&&ct.length?1:0),ze(ct)},[(Je=et.detail)===null||Je===void 0||(($e=Je.video_item)===null||$e===void 0)?void 0:$e.schools]);var Ue=function(){var je=Object(o.a)(s.a.mark(function rt(ct){var it;return s.a.wrap(function(_t){for(;;)switch(_t.prev=_t.next){case 0:return _t.next=2,Object(oe.P)({q:ct});case 2:it=_t.sent,it&&Fe(it.shools_name||[]);case 4:case"end":return _t.stop()}},rt)}));return function(ct){return je.apply(this,arguments)}}(),qe=function(rt){if(Ye.includes(rt)){g.b.info("\u8BF7\u52FF\u6307\u5B9A\u76F8\u540C\u7684\u5355\u4F4D");return}Y(""),ze([].concat(Object(q.a)(Ye),[rt]))},Xe=function(){var je=Object(o.a)(s.a.mark(function rt(){var ct;return s.a.wrap(function(lt){for(;;)switch(lt.prev=lt.next){case 0:if(!(ce===1&&!(Ye!=null&&Ye.length))){lt.next=2;break}return lt.abrupt("return",g.b.info("\u8BF7\u9009\u62E9\u6307\u5B9A\u5355\u4F4D\u516C\u5F00"));case 2:return lt.next=4,Object(x.a)(Object(U.a)(Object(U.a)({},pt),{},{id:gt.videoId,schools:ce===0?[]:Ye,is_public:!(ce===2)}));case 4:ct=lt.sent,(ct==null?void 0:ct.status)===0&&(g.b.success("\u8BBE\u7F6E\u6210\u529F"),He());case 6:case"end":return lt.stop()}},rt)}));return function(){return je.apply(this,arguments)}}(),He=function(){mt(),at({type:"videoDetail/getVideoDetail",payload:Object(U.a)(Object(U.a)({},pt),{},{id:gt.videoId})})};return E.a.createElement(l.a,{centered:!0,maskClosable:!1,title:"\u6743\u9650\u8BBE\u7F6E",width:530,className:fe.a.modal,visible:ft,onOk:Xe,onCancel:He},E.a.createElement(E.a.Fragment,null,E.a.createElement(d.a.Group,{value:ce,onChange:function(rt){return te(rt.target.value)}},E.a.createElement(d.a,{value:0},"\u5BF9\u6240\u6709\u5355\u4F4D\u516C\u5F00",E.a.createElement("span",null,"\uFF08\u9009\u4E2D\u540E\uFF0C\u5BF9\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09")),E.a.createElement(d.a,{value:1},"\u5BF9\u6307\u5B9A\u5355\u4F4D\u516C\u5F00",E.a.createElement("span",null,"\uFF08\u9009\u4E2D\u540E\uFF0C\u4EC5\u5BF9\u4E0B\u65B9\u6307\u5B9A\u5355\u4F4D\u7528\u6237\u53EF\u89C1\uFF09")),E.a.createElement(d.a,{value:2},"\u4E0D\u516C\u5F00",E.a.createElement("span",null,"\uFF08\u9009\u4E2D\u540E\uFF0C\u5BF9\u6240\u6709\u7528\u6237\u4E0D\u53EF\u89C1\uFF09"))),ce===1&&E.a.createElement(E.a.Fragment,null,E.a.createElement("div",{className:"mt10"},E.a.createElement(H.a,{showSearch:!0,className:fe.a.selectSchool,placeholder:"\u8BF7\u8F93\u5165\u5E76\u9009\u62E9\u5355\u4F4D\u540D\u79F0",value:K,onChange:function(rt){Y(rt),Ue(rt)},onSelect:qe,options:Ce==null?void 0:Ce.map(function(je){return{value:je}})})),E.a.createElement("div",{className:"mt10"},Ye==null?void 0:Ye.map(function(je,rt){return E.a.createElement($.a,{count:E.a.createElement("span",{className:fe.a.delete,onClick:function(){return ze(Ye.filter(function(it){return it!==je}))}},"x"),className:"mt10 mr20 current",key:rt},E.a.createElement(z.a,{type:"primary",ghost:!0},je))})))))},se=he,ge=function(Ge){var Je=Ge.user,$e=Ge.videoDetail,et=Ge.dispatch,nt=$e.queryParams,at=$e.queryParams,ft=at.subject_id,yt=at.videoId,mt={videoId:yt},pt=Object(L.useState)(),vt=Object(t.a)(pt,2),ut=vt[0],dt=vt[1],gt=Object(L.useState)(),st=Object(t.a)(gt,2),ht=st[0],ce=st[1],te=Object(L.useState)(!1),I=Object(t.a)(te,2),W=I[0],K=I[1],Y=$e.detail||{},le=Y.video_item,Ae=$e||{},Ce=Ae.stages,Fe=function(){et({type:"videoDetail/setActionTabs",payload:{key:"Banner-SendToClass"}})},We=function(){var Ye=Object(o.a)(s.a.mark(function ze(){var Ue,qe,Xe,He,je,rt;return s.a.wrap(function(it){for(;;)switch(it.prev=it.next){case 0:if(!((Ue=Je.userInfo)!==null&&Ue!==void 0&&Ue.admin||(qe=Je.userInfo)!==null&&qe!==void 0&&qe.is_teacher&&Object(G.d)())){it.next=9;break}return He=[],Ce.map(function(lt){lt.items.map(function(_t){He.push(_t)})}),je=He.filter(function(lt){return lt.id===le.id}),it.next=6,Object(x.g)(Object(U.a)({id:je==null||((Xe=je[0])===null||Xe===void 0)?void 0:Xe.stage_item_id},nt));case 6:rt=it.sent,ce(rt),dt(!0);case 9:case"end":return it.stop()}},ze)}));return function(){return Ye.apply(this,arguments)}}(),Be=function(){var Ye=Object(o.a)(s.a.mark(function ze(Ue){var qe,Xe,He;return s.a.wrap(function(rt){for(;;)switch(rt.prev=rt.next){case 0:return rt.next=2,Object(k.S)(Object(U.a)(Object(U.a)({id:ht==null?void 0:ht.id},Ue),{},{video_id:(Ue==null?void 0:Ue.video_id)||(ht==null||((qe=ht.video_item)===null||qe===void 0)?void 0:qe.video_id),link:(Ue==null?void 0:Ue.link)||(ht==null||((Xe=ht.video_item)===null||Xe===void 0)?void 0:Xe.link)}));case 2:return He=rt.sent,He&&(dt(!1),et({type:"videoDetail/getVideoDetail",payload:Object(U.a)({id:mt.videoId},nt)})),rt.abrupt("return",He);case 5:case"end":return rt.stop()}},ze)}));return function(Ue){return Ye.apply(this,arguments)}}();return E.a.createElement("aside",{className:a.a.banner},E.a.createElement("aside",{className:a.a.wrap},E.a.createElement("p",{className:a.a.title},le==null?void 0:le.name),E.a.createElement("div",{className:a.a.contentWrap},E.a.createElement("span",{className:"font14 c-white"},E.a.createElement("span",{className:"mr10"},"\u5B66\u4E60\u4EBA\u6570\uFF1A"),E.a.createElement("span",null,(le==null?void 0:le.study_video_items_count)||0),E.a.createElement("span",{className:"ml100 mr10"},"\u5B66\u5458\u8BC4\u5206\uFF1A"),E.a.createElement(f.a,{allowHalf:!0,value:Object(B.D)(le==null?void 0:le.star),disabled:!0,className:a.a.rating})))),E.a.createElement(R,null),E.a.createElement(D.a,{editData:ht,visible:ut,onCancel:function(){return dt(!1)},onOk:Be,queryParams:nt}),E.a.createElement(se,{dispatch:et,videoDetail:$e,visible:W,onClose:function(){return K(!1)}}))},ie=Object(A.a)(function(tt){var Ge=tt.user,Je=tt.videoDetail;return{user:Ge,videoDetail:Je}})(ge),re=ye("R9oj"),Q=ye("ECub"),pe=ye("sRBo"),ne=ye("kaz8"),J=ye("J66h"),be=ye("hgre"),Ee=ye("9Bee"),Le=ye("vZDz"),V=ye.n(Le),C=ye("9VGf"),O=function(Ge){var Je=Ge.videoDetail,$e=Ge.globalSetting,et=Ge.loading,nt=Ge.dispatch,at=Object(_.a)(Ge,["videoDetail","globalSetting","loading","dispatch"]),ft=Je.queryParams,yt=Je.selectParams,mt=Je.videoList,pt=ft.subject_id,vt=ft.videoId,ut=yt.checkBoxValue,dt=yt.radioValue,gt={videoId:vt},st={query:ft},ht=Object(L.useRef)(),ce=Object(L.useRef)(),te=Object(L.useRef)(),I=Object(L.useRef)(5),W=Je.detail||{},K=W.video_item;Object(C.a)(Object(o.a)(s.a.mark(function ze(){return s.a.wrap(function(qe){for(;;)switch(qe.prev=qe.next){case 0:if(!ce.current){qe.next=5;break}return console.log("videoRef lastUpdatedTime: ",ht.current.getLastUpdatedTime()),console.log(ht.current),qe.next=5,Y();case 5:case"end":return qe.stop()}},ze)})),I.current*1e3);var Y=function(){var Ue=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,qe=Ue?{is_f:1}:{};return Object(x.n)(Object(U.a)(Object(U.a)({},qe),{id:gt.videoId,point:ht.current.getLastUpdatedTime(),total:ht.current.getDuration()}))},le=function(Ue){return Ue.ed==="1"&&(ce.current=!1,Y(!0)),!ce.current&&!Ue.ed&&(ce.current=!0,I.current=ht.current.getDuration()<=5?1:5,Y()),nt({type:"userDetail/logWatchHistory",payload:Ue})},Ae=function(){ce.current=!1},Ce=function(){ce.current=!0},Fe=function(){te.current=5,l.a.confirm({width:600,centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u8BF7\u7ED9\u672C\u89C6\u9891\u8BC4\u5206",content:E.a.createElement("div",{className:"tc font14"},E.a.createElement(f.a,{defaultValue:te.current,onChange:function(qe){return te.current=qe},className:V.a.modalRating})),onOk:function(){var Ue=Object(o.a)(s.a.mark(function Xe(){var He,je,rt;return s.a.wrap(function(it){for(;;)switch(it.prev=it.next){case 0:return it.next=2,Object(x.l)({id:gt.videoId,star:te.current});case 2:He=it.sent,He.status===0&&(je=Object(B.J)(),rt=je.course_id,nt({type:"videoDetail/getVideoDetail",payload:{id:gt.videoId,videoId:gt.videoId,course_id:rt}}));case 4:case"end":return it.stop()}},Xe)}));function qe(){return Ue.apply(this,arguments)}return qe}()})},We=function(Ue){var qe=window.filterVideoSign,Xe=qe.findIndex(function(lt){return lt.id===vt}),He=Xe===qe.length-1;if(He)return;var je=qe[Xe+1].id,rt=qe[Xe+1].can_view,ct=qe[Xe+1].link,it=qe[Xe+1].is_public;if(window.checkBoxValue){if(ct){window.open(ct);return}if(!rt){l.a.info({centered:!0,width:400,okText:"\u77E5\u9053\u5566",icon:null,content:E.a.createElement("div",{className:"tc font14"},"\u4E0B\u4E00\u6761\u89C6\u9891\u4E3A\u521B\u5EFA\u8005\u6240\u5C5E\u5355\u4F4D\u5185\u90E8\u6559\u5B66\u8D44\u6599\uFF0C\u5916\u5355\u4F4D\u7528\u6237\u65E0\u89C2\u770B\u6743\u9650")});return}if(!it){l.a.info({centered:!0,width:400,okText:"\u77E5\u9053\u5566",icon:null,content:E.a.createElement("div",{className:"tc font14"},"\u4E0B\u4E00\u6761\u89C6\u9891\u6682\u672A\u516C\u5F00\uFF0C\u656C\u8BF7\u671F\u5F85")});return}nt({type:"videoDetail/handleListItemClick",payload:{videoId:je}}),window.videoTimer=setTimeout(function(){Ue.current.play()},2e3)}},Be=function(Ue,qe){if(Ue==="checkBox"){var Xe=qe.target.checked;window.checkBoxValue=Xe,nt({type:"videoDetail/setSelectValue",payload:{radioValue:dt,checkBoxValue:Xe}});return}nt({type:"videoDetail/setSelectValue",payload:{checkBoxValue:ut,radioValue:qe.target.value}})},Ye=function(){var Ue=mt.findIndex(function(Xe){return Xe.id===vt}),qe=Ue===mt.length-1;return qe?E.a.createElement("div",null,"\u5F53\u524D\u5DF2\u662F\u6700\u540E\u4E00\u4E2A\u89C6\u9891"):E.a.createElement(ne.a,{onChange:function(He){Be("checkBox",He)},checked:ut},"\u81EA\u52A8\u64AD\u653E\u4E0B\u4E00\u4E2A\u89C6\u9891")};return E.a.createElement("aside",{className:V.a.contentWrap},E.a.createElement("aside",{className:V.a.wrap},E.a.createElement("header",null,(K==null?void 0:K.description)&&E.a.createElement("span",{className:V.a.introName},"\u7B80\u4ECB"),Object(B.R)(K==null?void 0:K.my_star)?E.a.createElement(z.a,{type:"primary",ghost:!0,onClick:Fe},"\u8BC4\u5206"):E.a.createElement("span",null,E.a.createElement("span",{className:"ml100 mr10 font14"},"\u6211\u7684\u8BC4\u5206\uFF1A"),E.a.createElement(f.a,{value:K==null?void 0:K.my_star,disabled:!0,className:V.a.rating}))),E.a.createElement("div",{className:"mt20"},E.a.createElement(Ee.a,{value:(K==null?void 0:K.description)||""})),!(K!=null&&K.can_edit)&&!(K!=null&&K.is_public)?E.a.createElement(Q.a,{description:"\u5F53\u524D\u89C6\u9891\u6682\u672A\u516C\u5F00\uFF0C\u656C\u8BF7\u671F\u5F85"}):E.a.createElement(be.a,{ref:ht,startTime:K==null?void 0:K.last_point,src:K!=null&&K.is_link?K==null?void 0:K.link:(K==null?void 0:K.play_url)&&J.Base64.decode(K==null?void 0:K.play_url),videoId:K==null?void 0:K.video_id,logWatchHistory:le,handlePause:Ae,handlePlay:Ce,videoSpeed:dt,handlePlayEnded:We,toLog:function(){}}),!(K!=null&&K.can_edit)&&!(K!=null&&K.is_public)?null:E.a.createElement("div",{className:V.a.footer},E.a.createElement("div",{className:V.a.checkBox},Ye()),E.a.createElement("div",{className:V.a.radioGroup},E.a.createElement(d.a.Group,{onChange:function(Ue){Be("radio",Ue)},value:dt},E.a.createElement(d.a,{value:1},"1.0X"),E.a.createElement(d.a,{value:1.5},"1.5X"),E.a.createElement(d.a,{value:2},"2.0X"))))))},j=Object(A.a)(function(tt){var Ge=tt.videoDetail,Je=tt.loading,$e=tt.globalSetting;return{videoDetail:Ge,globalSetting:$e,loading:Je}})(O),M=ye("MRWH"),F=ye.n(M),ae=ye("V0Rq"),ve=ye("m3rI"),Pe=[{name:"\u5B9E\u8DF5\u9879\u76EE",type:"Shixun",icon:E.a.createElement("i",{className:"iconfont icon-shixun2 font20"})},{name:"\u89C6\u9891\u9879\u76EE",type:"VideoItem",icon:E.a.createElement("i",{className:"iconfont icon-shipin font20"})},{name:"\u6559\u5B66\u8BFE\u4EF6",type:"Attachment",icon:E.a.createElement("i",{className:"iconfont icon-jiaoxueanli font20"})},{name:"\u7A7A\u76EE\u5F55",type:"StageCatalog",icon:E.a.createElement("i",{className:"iconfont icon-kongbai font20"})}],Oe=function(Ge){var Je=Ge.dispatch,$e=Ge.videoDetail,et=Ge.user,nt=Object(_.a)(Ge,["dispatch","videoDetail","user"]),at=$e.queryParams,ft=$e.stages,yt=$e.cust_seq,mt=$e.active,pt=at.subject_id,vt=at.course_id;Object(L.useEffect)(function(){Je(pt?{type:"videoDetail/getStageData",payload:{subject_id:pt}}:{type:"videoDetail/getCourseStageData",payload:{coursesId:vt}})},[]);var ut=function(){var I=Object(o.a)(s.a.mark(function W(K,Y){var le;return s.a.wrap(function(Ce){for(;;)switch(Ce.prev=Ce.next){case 0:if(Je({type:"globalSetting/setGlobalLoading",payload:{show:!0,text:"\u6B63\u5728\u8FDB\u5165\u5B9E\u8BAD\uFF0C\u8BF7\u7A0D\u540E..."}}),!Y){Ce.next=7;break}return Ce.next=4,Object(oe.D)({id:K});case 4:Ce.t0=Ce.sent,Ce.next=10;break;case 7:return Ce.next=9,Object(oe.E)({id:K});case 9:Ce.t0=Ce.sent;case 10:if(le=Ce.t0,Je({type:"globalSetting/setGlobalLoading",payload:{show:!1,text:""}}),!(le!=null&&le.game_identifier||le!=null&&le.identifier)){Ce.next=15;break}return Object(B.U)(Y?"/tasks/".concat(le==null?void 0:le.identifier,"/jupyter"):"/tasks/".concat(le.game_identifier)),Ce.abrupt("return");case 15:(le==null?void 0:le.status)===2?gt(le==null?void 0:le.message):(le==null?void 0:le.status)===3&&dt(le==null?void 0:le.message);case 16:case"end":return Ce.stop()}},W)}));return function(K,Y){return I.apply(this,arguments)}}(),dt=function(W){l.a.confirm({centered:!0,title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:E.a.createElement("div",{className:"tc font16"},"\u76EE\u524D\u8BE5\u5B9E\u8DF5\u9879\u76EE\u5C1A\u5728\u5185\u6D4B\u4E2D\uFF0C\u5C06\u4E8E",W,"\u4E4B\u540E\u5F00\u653E\uFF0C\u8C22\u8C22\uFF01")})},gt=function I(W){var K;W=(K=W)!==null&&K!==void 0&&K.includes(".json")?W:"".concat(W,".json"),l.a.confirm({centered:!0,title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:E.a.createElement("div",{className:"tc font16"},"\u5B9E\u8BAD\u5DF2\u7ECF\u66F4\u65B0\u4E86\uFF0C\u6B63\u5728\u4E3A\u60A8\u91CD\u7F6E!"),onOk:function(){var Y=Object(o.a)(s.a.mark(function Ae(){var Ce,Fe;return s.a.wrap(function(Be){for(;;)switch(Be.prev=Be.next){case 0:return Be.next=2,Object(ae.T)({url:W});case 2:if(Ce=Be.sent,Ce){Be.next=5;break}return Be.abrupt("return");case 5:return g.b.success("\u91CD\u7F6E\u6210\u529F\uFF0C\u6B63\u5728\u8FDB\u5165\u5B9E\u8BAD\uFF01"),Be.next=8,Object(oe.E)({id:Ce.shixun_identifier});case 8:if(Fe=Be.sent,!(Fe!=null&&Fe.game_identifier)){Be.next=12;break}return Object(B.U)("/tasks/".concat(Fe.game_identifier)),Be.abrupt("return");case 12:(Fe==null?void 0:Fe.status)===2?I(Fe==null?void 0:Fe.message):(Fe==null?void 0:Fe.status)===3&&dt(Fe==null?void 0:Fe.message);case 13:case"end":return Be.stop()}},Ae)}));function le(){return Y.apply(this,arguments)}return le}()})},st=function(W){if((W==null?void 0:W.item_type)==="StageCatalog")return;clearTimeout(window.videoTimer);var K=W.id,Y=W.item_type,le=W.identifier,Ae=W.is_jupyter,Ce=W.url,Fe=W.link;if(Y==="VideoItem"&&!Fe){var We,Be;if(!((We=et.userInfo)!==null&&We!==void 0&&We.admin)&&!((Be=et.userInfo)!==null&&Be!==void 0&&Be.business)&&!W.can_view){l.a.info({centered:!0,width:400,okText:"\u77E5\u9053\u5566",icon:null,content:E.a.createElement("div",{className:"tc font14"},"\u5F53\u524D\u89C6\u9891\u4E3A\u521B\u5EFA\u8005\u6240\u5C5E\u5355\u4F4D\u5185\u90E8\u6559\u5B66\u8D44\u6599\uFF0C\u5916\u5355\u4F4D\u7528\u6237\u65E0\u89C2\u770B\u6743\u9650")});return}Je({type:"videoDetail/handleListItemClick",payload:{videoId:K}}),Je({type:"videoDetail/getVideoDetail",payload:Object(U.a)(Object(U.a)({id:K},at),{},{videoId:K}),callback:function(Xe){if(Xe&&Xe.video_item&&!Xe.video_item.can_edit&&!W.is_public){l.a.info({centered:!0,width:400,okText:"\u77E5\u9053\u5566",icon:null,content:E.a.createElement("div",{className:"tc font14"},"\u5F53\u524D\u89C6\u9891\u6682\u672A\u516C\u5F00\uFF0C\u656C\u8BF7\u671F\u5F85")});return}}});return}if(Y==="VideoItem"&&!!Fe){W.link&&Object(x.n)({is_f:1,id:W.id,point:0,total:0}),window.open(Fe);return}if(Y==="Shixun"){ut(le,Ae);return}if(Y==="Attachment"){var Ye,ze,Ue=W==null||((Ye=W.name)===null||Ye===void 0)?void 0:Ye.substr(W==null||((ze=W.name)===null||ze===void 0)?void 0:ze.lastIndexOf("."));if(Ue.toUpperCase()===".ZIP")Object(B.v)(W.name,ve.a.API_SERVER+W.url);else{Je({type:"videoDetail/handleListItemClick",payload:{attachmentId:K}});return}}window.open(ve.a.IMG_SERVER+Ce)},ht=function(W){var K=["\u96F6","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D","\u4E03","\u516B","\u4E5D"],Y=["","\u5341","\u767E","\u5343","\u4E07"];W=parseInt(W);var le=function(We){for(var Be=We.toString().split("").reverse(),Ye="",ze=0;ze<Be.length;ze++)Ye=(ze==0&&Be[ze]==0||ze>0&&Be[ze]==0&&Be[ze-1]==0?"":K[Be[ze]]+(Be[ze]==0?Y[0]:Y[ze]))+Ye;return Ye},Ae=Math.floor(W/1e4),Ce=W%1e4;return Ce.toString().length<4&&(Ce="0"+Ce),Ae?le(Ae)+"\u4E07"+le(Ce):le(W)},ce=function(W,K,Y,le){var Ae,Ce=W.name,Fe=W.item_type,We=W.id,Be="".concat(K+1,"-").concat(Y+1,"-").concat(le+1),Ye=(Ae=Pe.find(function(qe){return qe.type===Fe}))===null||Ae===void 0?void 0:Ae.icon,ze=F.a.brght,Ue=mt.id===We?"".concat(ze," ").concat(F.a.active):ze;return E.a.createElement("div",{key:Be,onClick:function(){return st(W)},className:Ue,style:{paddingLeft:52}},E.a.createElement("span",{className:F.a.s1},Ye),!!yt&&E.a.createElement("span",{className:F.a.s2},Be),E.a.createElement("span",{className:F.a.s3},"\u203B ",Ce))},te=function(W,K,Y){var le,Ae=W.name,Ce=W.item_type,Fe=W.id,We=W.children,Be="".concat(K+1,"-").concat(Y+1),Ye=(le=Pe.find(function(qe){return qe.type===Ce}))===null||le===void 0?void 0:le.icon,ze=F.a.brght,Ue=mt.id===Fe?"".concat(ze," ").concat(F.a.active):ze;return E.a.createElement(L.Fragment,{key:Be},E.a.createElement("div",{onClick:function(){return st(W)},className:Ue},E.a.createElement("span",{className:F.a.s1},Ye),!!yt&&E.a.createElement("span",{className:F.a.s2},Be),E.a.createElement("span",{className:F.a.s3},"\u203B ",Ae)),!!We.length&&We.map(function(qe,Xe){return ce(qe,K,Y,Xe)}))};return E.a.createElement("aside",{className:F.a.list},ft.map(function(I,W){var K=I.stage_name,Y=I.items,le=Y===void 0?[]:Y;return E.a.createElement("aside",{key:W,className:F.a.box},E.a.createElement("div",{className:F.a.title},ht(W+1),"\u3001",K),le.map(function(Ae,Ce){return te(Ae,W,Ce)}),W!==ft.length-1&&E.a.createElement("div",{className:F.a.line}))}))},De=Object(A.a)(function(tt){var Ge=tt.user,Je=tt.videoDetail,$e=tt.loading,et=tt.globalSetting;return{user:Ge,videoDetail:Je,globalSetting:et,loading:$e}})(Oe),Ne=ye("lppi"),Ke=ye.n(Ne),ke=ye("fWQN"),Re=function tt(){var Ge=this;Object(ke.a)(this,tt),this.conversion_getDPI=function(){var Je=new Array;if(window.screen.deviceXDPI)Je[0]=window.screen.deviceXDPI,Je[1]=window.screen.deviceXDPI;else{var $e=document.createElement("DIV");$e.style.cssText="width:1in;height:1in;position:absolute;left:0px;top:0px;z-index:99;visibility:hidden",document.body.appendChild($e),Je[0]=parseInt(String($e.offsetWidth)),Je[1]=parseInt(String($e.offsetHeight)),$e.parentNode.removeChild($e)}return Je},this.pxConversionMm=function(Je){var $e=Je/Ge.conversion_getDPI()[0],et=$e*25.4;return et},this.mmConversionPx=function(Je){var $e=Je/25.4,et=$e*Ge.conversion_getDPI()[0];return et}},Te=new Re,we=Te.mmConversionPx(297),xe=function(Ge){var Je=Ge.url,$e=Object(L.useState)(""),et=Object(t.a)($e,2),nt=et[0],at=et[1],ft=Object(L.useState)(!0),yt=Object(t.a)(ft,2),mt=yt[0],pt=yt[1];return Object(L.useEffect)(function(){var vt="".concat(ve.a.API_SERVER).concat(Je);nt!==vt&&(pt(!1),setTimeout(function(){pt(!0)},500)),at(vt)},[Je]),nt?E.a.createElement("div",{className:Ke.a.pdfContainer},E.a.createElement("div",{className:Ke.a.loading},E.a.createElement(Z.a,{tip:"\u6B63\u5728\u52A0\u8F7D"})),mt&&E.a.createElement("embed",{src:nt,height:we,width:"100%"})):E.a.createElement(E.a.Fragment,null)},ue=xe,de=ye("b57q"),_e=ye.n(de),me=function(Ge){var Je=Ge.url,$e=Object(B.V)(Je).filesize,et=1024*1024,nt=10*et;return E.a.createElement("div",{className:_e.a.officeContainer},$e>nt&&E.a.createElement("div",{className:"tc mt100 font16"},"\u5F53\u524D\u6587\u4EF6(",parseInt($e/et),"MB)\uFF0C\u5DF2\u8D85\u51FA\u6700\u5927\u9650\u5236\uFF0C\u8BF7\u4E0B\u8F7D\u540E\u9884\u89C8\uFF01",E.a.createElement("br",null),E.a.createElement(z.a,{type:"primary",className:"mt20"},E.a.createElement("a",{href:"".concat(ve.a.IMG_SERVER).concat(Je)},"\u70B9\u51FB\u4E0B\u8F7D"))),$e<=nt&&E.a.createElement("iframe",{frameBorder:0,width:"100%",height,src:"https://view.officeapps.live.com/op/view.aspx?src=".concat(encodeURIComponent("".concat(ve.a.IMG_SERVER).concat(Je,"?disposition=inline")))}))},Ie=me,Me=function(Ge){var Je=Ge.subject_id;return{subject_id:Je,course_id:Je}},Ve=function(Ge){var Je=Ge.videoDetail,$e=Ge.globalSetting,et=Ge.loading,nt=Ge.dispatch,at=Object(_.a)(Ge,["videoDetail","globalSetting","loading","dispatch"]),ft=Je.queryParams,yt=Je.videoList,mt=Je.attachmentList,pt=Je.active,vt=ft.subject_id,ut=ft.videoId,dt={videoId:ut};Object(L.useEffect)(function(){if(pt){var st=pt.item_type,ht=pt.id;st==="VideoItem"&&nt({type:"videoDetail/getVideoDetail",payload:Object(U.a)(Object(U.a)({},ft),{},{id:ht})})}},[pt.id]),Object(L.useEffect)(function(){var st,ht;Object(B.Z)((st=Je.detail)===null||st===void 0||((ht=st.video_item)===null||ht===void 0)?void 0:ht.name)},[Je]);var gt={width:1200};return pt&&pt.item_type==="Attachment"&&pt.content_type==="application/pdf"&&(gt={width:1250,marginLeft:(document.body.clientWidth-1200)/2}),console.log("active:",pt),E.a.createElement(Z.a,{spinning:!1},E.a.createElement("section",{className:v.a.bg},E.a.createElement(ie,null),E.a.createElement("div",{className:v.a.container,style:gt},E.a.createElement(De,null),pt&&pt.item_type==="VideoItem"&&E.a.createElement(j,null),pt&&pt.item_type==="Attachment"&&pt.content_type==="application/pdf"&&pt.url&&E.a.createElement(ue,{url:pt.url}),pt&&pt.item_type==="Attachment"&&["application/msword","application/vnd.ms-excel","application/vnd.ms-powerpoint","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.wordprocessingml.document"].includes(pt.content_type)&&pt.url&&E.a.createElement(Ie,{url:pt.url,name:pt.name}))))},ot=Qe.default=Object(A.a)(function(tt){var Ge=tt.videoDetail,Je=tt.loading,$e=tt.globalSetting;return{videoDetail:Ge,globalSetting:$e,loading:Je}})(Ve)},"9Bee":function(Ze,Qe,ye){"use strict";var Se=ye("DYRE"),Z=ye("zeV3"),U=ye("+L6B"),_=ye("2/Rp"),L=ye("k1fw"),E=ye("tJVT"),A=ye("cDcd"),w=ye.n(A),v=ye("vg9a"),u=ye("DlQD"),f=ye.n(u),o=ye("rUJ1");function t(fe,oe){var he=fe.match(/^(\s+)(?:```)/);if(he===null)return oe;var se=he[1];return oe.split(`
|
|
|
`).map(function(ge){var ie=ge.match(/^\s+/);if(ie===null)return ge;var re=Object(E.a)(ie,1),Q=re[0];return Q.length>=se.length?ge.slice(se.length):ge}).join(`
|
|
|
`)}var i=[],s=["<ul>"],h=new f.a.Renderer,a=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function e(){i.length=0,s=["<ul>"]}var l={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function n(fe,oe,he,se){if(oe>=fe.length||fe[oe].level<=he)return oe;var ge=fe[oe];se.push("<li><a href='#"+ge.anchor+"'>"+ge.text+"</a>"),oe++;var ie=[];return oe=n(fe,oe,ge.level,ie),ie.length>0&&(se.push("<ul>"),ie.forEach(function(re){se.push(re)}),se.push("</ul>")),se.push("</li>"),oe=n(fe,oe,he,se),oe}function d(){return n(i,0,0,s),s.push("</ul>"),s.join("")}var c={heading:function(oe){var he=a.exec(oe);if(he)return{type:"heading",raw:he[0],depth:he[1].length,text:he[2]}},fences:function(oe){var he=this.rules.block.fences.exec(oe);if(he){var se=he[0],ge=t(se,he[3]||""),ie=he[2]?he[2].trim():he[2];if(["latex","katex","math"].indexOf(ie)>=0){var re=m(),Q=ge;ge=re,b[re]={type:"block",expression:Q}}return{type:"code",raw:se,lang:ie,text:ge}}}},g=/(?:\${2})([^\n`]+?)(?:\${2})/gi,p=0,m=function(){return"__special_katext_id_".concat(p++,"__")},b={};function y(){return b}function r(){p=0,b={}}function x(fe){return fe=fe.replace(g,function(oe,he){var se=m();return b[se]={type:"inline",expression:he},se}),fe}var S=h.listitem;h.listitem=function(fe){return S(x(fe))};var T=h.paragraph;h.paragraph=function(fe){return T(x(fe))};var R=h.tablecell;h.tablecell=function(fe,oe){return R(x(fe),oe)},h.code=function(fe,oe,he){var se=(oe||"").match(/\S*/)[0];return se?["latex","katex","math"].indexOf(se)>=0?"<p class='editormd-tex'>".concat(fe,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(oe,'">').concat(he?fe:Object(o.escape)(fe,!0),`</code></pre>
|
|
|
`):'<pre class="prettyprint linenums"><code>'+(he?fe:Object(o.escape)(fe,!0))+"</code></pre>"},h.heading=function(fe,oe,he){var se=this.options.headerPrefix+he.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return i.push({anchor:se,level:oe,text:fe}),"<h"+oe+' id="'+se+'">'+fe+"</h"+oe+">"},f.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),f.a.use({tokenizer:c,renderer:h});var D=f.a,k=ye("SJMd"),B=ye("ulZh"),G=ye.n(B),P=ye("m3rI"),$=ye("Oy/b"),X=ye("p5ED"),z=ye("8hTe"),N=ye.n(z),H=/<pre[^>]*>/g;function q(fe){var oe=document.createElement("div");return oe.innerHTML=fe,oe.childNodes.length===0?"":oe.childNodes[0].nodeValue}var ee=Qe.a=function(fe){var oe=fe.value,he=oe===void 0?"":oe,se=fe.edit,ge=se===void 0?!1:se,ie=fe.className,re=fe.showTextOnly,Q=fe.showLines,pe=fe.replaces,ne=fe.zoomImg,J=fe.hasMask,be=fe.style,Ee=be===void 0?{}:be,Le=fe.stylesPrev,V=Le===void 0?{}:Le,C=String(he),O=Object(A.useRef)(),j=Object(A.useRef)(),M=Object(A.useState)(""),F=Object(E.a)(M,2),ae=F[0],ve=F[1],Pe=Object(A.useState)("office"),Oe=Object(E.a)(Pe,2),De=Oe[0],Ne=Oe[1],Ke=Object(A.useMemo)(function(){try{var xe=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,ue=/\"\/api\/attachments\/|\"\/attachments\/download\//g,de=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;C=C.replace(xe,"("+P.a.API_SERVER+"/api/attachments/").replace(ue,'"'+P.a.API_SERVER+"/api/attachments/").replace(de,'"'+P.a.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
|
|
|
`)}catch(Me){}var _e=D(C),me=y();if(C.match(/\[TOC\]/)&&(_e=_e.replace("<p>[TOC]</p>",d()),e()),_e=_e.replace(/(__special_katext_id_\d+__)/g,function(Me,Ve){var ot=me[Ve],tt=ot.type,Ge=ot.expression;return Object($.renderToString)(q(Ge)||"",{displayMode:tt==="block",throwOnError:!1,output:"html"})}),_e=_e.replace(/▁/g,"\u2581\u2581\u2581"),r(),re){var Ie=document.createElement("div");return Ie.innerHTML=_e,Ie.innerText}return setTimeout(function(){return Te()},500),_e},[C]),ke=Object(A.useRef)();l.WebkitLineClamp=Q,Q&&(Ee=Object(L.a)(Object(L.a)({},Ee),l));function Re(xe){var ue=xe.target;if(ue.tagName.toUpperCase()==="IMG"){if(ne){var de=ue.getAttribute("src");ve(de),Ne("image")}}else if(ue.tagName.toUpperCase()==="A"){var _e=ue.getAttribute("href");if(_e.indexOf("office")>-1)xe.preventDefault(),ve(_e),Ne("office");else if(_e.indexOf("application/pdf")>-1)xe.preventDefault(),ve(_e),Ne("pdf");else if(_e.indexOf("text/html")>-1)xe.preventDefault(),ve(_e),Ne("html");else if(_e.startsWith("#")){xe.preventDefault();var me=document.getElementById(_e.replace("#",""));me&&me.scrollIntoView(!0)}}}var Te=function(){var ue,de=(ue=ke.current)===null||ue===void 0?void 0:ue.querySelectorAll("video");de==null||de.forEach(function(_e){if(_e.oncontextmenu=function(){return!1},_e.src.indexOf(".m3u8")>-1&&!_e.canPlayType("application/vnd.apple.mpegurl")){if(G.a.isSupported()){var me=new G.a;me.loadSource(_e.src),me.attachMedia(_e)}}})};Object(A.useEffect)(function(){if(ke.current&&Ke&&(Ke.match(H)&&window.PR.prettyPrint()),ke.current)return ke.current.addEventListener("click",Re),function(){ke.current.removeEventListener("click",Re),r(),e()}},[Ke,ke.current,Re]);var we=function(ue){if(!ge)return;ue.target.nodeName==="IMG"?(O.current.style.display="flex",O.current.style.width=ue.target.clientWidth+"px",O.current.style.height=ue.target.clientHeight+"px",O.current.style.top=ue.target.offsetTop+"px",O.current.style.left=ue.target.offsetLeft+"px",j.current.src=ue.target.getAttribute("src")):O.current.style.display="none"};return w.a.createElement("div",{style:{position:"relative"}},w.a.createElement("div",{ref:ke,style:Object(L.a)({},Ee),className:"".concat(ie||""," markdown-body ").concat(N.a.mdBody),onMouseOver:we,dangerouslySetInnerHTML:{__html:Ke}}),w.a.createElement("div",{ref:O,className:N.a.button},w.a.createElement(Z.a,null,w.a.createElement(_.a,{onClick:function(){return openCrop()}},"\u88C1\u526A"),w.a.createElement(_.a,{onClick:function(){return openEditor()}},"\u7F16\u8F91"))),w.a.createElement("img",{ref:j,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1,top:"-10000px"}}),w.a.createElement(X.a,{close:!0,data:ae,type:ae!=null&&ae.length?De:"",style:Object(L.a)({},V),onClose:function(){return ve("")}}))}},"9VGf":function(Ze,Qe,ye){"use strict";ye.d(Qe,"a",function(){return U});var Se=ye("cDcd"),Z=ye.n(Se);function U(_,L){var E=Object(Se.useRef)();Object(Se.useEffect)(function(){E.current=_}),Object(Se.useEffect)(function(){function A(){E.current()}if(L!==null){var w=setInterval(A,L);return function(){return clearInterval(w)}}},[L])}},Aky1:function(Ze,Qe,ye){"use strict";ye.d(Qe,"a",function(){return v});var Se=ye("ErOA"),Z=ye("ppsT"),U=ye.n(Z),_="",L,E="";function A(u){w(u)}function w(u){L=new U.a.Vod({timeout:6e4,partSize:1048576,parallel:5,retryCount:3,retryDuration:2,region:"ap-southeast-1",userId:1829848226361863,enableUploadProgress:!1,addFileSuccess:function(o){console.log("addFileSuccess: "+o.file.name),u.addFileSuccess&&u.addFileSuccess(o),L.startUpload()},onUploadstarted:function(o){var t=o.file.name;if(o.videoId){var h="/api/users/".concat(_,"/video_auths.json");Object(Se.a)(h,{method:"put",body:{video_id:o.videoId,title:t,file_name:t,virtual_classroom_id:E}}).then(function(a){if(a.status==-1){u.onUploadError&&u.onUploadError(o);return}var e=a.data,l=e.UploadAuth,n=e.UploadAddress,d=e.VideoId;L.setUploadAuthAndAddress(o,l,n)}).catch(function(a){L.deleteFile(L._curIndex),L.nextUpload(),console.log(a)})}else{var i="/api/users/".concat(_,"/video_auths.json"),s="";Object(Se.a)(i,{method:"Post",body:{title:s+t,file_name:s+t,virtual_classroom_id:E}}).then(function(a){if(a){var e=a.data,l=e.UploadAuth,n=e.UploadAddress,d=e.VideoId;L.setUploadAuthAndAddress(o,l,n,d)}}).catch(function(a){L.deleteFile(L._curIndex),L.nextUpload(),console.log(a)}),console.log("\u6587\u4EF6\u5F00\u59CB\u4E0A\u4F20...")}},onUploadSucceed:function(o){u.onUploadSucceed&&u.onUploadSucceed(o),console.log("\u6587\u4EF6\u4E0A\u4F20\u6210\u529F!")},onUploadFailed:function(o,t,i){u.onUploadFailed&&u.onUploadFailed(o),console.log("\u6587\u4EF6\u4E0A\u4F20\u5931\u8D25!")},onUploadCanceled:function(o,t,i){console.log("\u6587\u4EF6\u4E0A\u4F20\u5DF2\u6682\u505C!")},onUploadProgress:function(o,t,i){u.onUploadProgress&&u.onUploadProgress(o,t,i);var s=Math.ceil(i*100);console.log("\u6587\u4EF6\u4E0A\u4F20\u4E2D...")},onUploadTokenExpired:function(o){console.log("\u6587\u4EF6\u4E0A\u4F20\u8D85\u65F6!");var t="/api/users/".concat(_,"/video_auths.json");Object(Se.a)(t,{method:"put",body:{video_id:o.videoId}}).then(function(i){var s=i.data,h=s.UploadAuth;L.resumeUploadWithAuth(h)}).catch(function(i){console.log(i)})},onUploadEnd:function(o){u.onUploadEnd&&u.onUploadEnd(o),console.log("onUploadEnd: uploaded all the files")}}),u.gotUploader&&u.gotUploader(L)}function v(u,f,o){u&&(_=u),f&&(E=f),A(o)}},DlQD:function(Ze,Qe,ye){(function(Se,Z){Ze.exports=Z()})(this,function(){"use strict";function Se(Te,we){for(var xe=0;xe<we.length;xe++){var ue=we[xe];ue.enumerable=ue.enumerable||!1,ue.configurable=!0,"value"in ue&&(ue.writable=!0),Object.defineProperty(Te,ue.key,ue)}}function Z(Te,we,xe){return we&&Se(Te.prototype,we),xe&&Se(Te,xe),Te}function U(Te,we){if(!Te)return;if(typeof Te=="string")return _(Te,we);var xe=Object.prototype.toString.call(Te).slice(8,-1);if(xe==="Object"&&Te.constructor&&(xe=Te.constructor.name),xe==="Map"||xe==="Set")return Array.from(Te);if(xe==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(xe))return _(Te,we)}function _(Te,we){(we==null||we>Te.length)&&(we=Te.length);for(var xe=0,ue=new Array(we);xe<we;xe++)ue[xe]=Te[xe];return ue}function L(Te,we){var xe;if(typeof Symbol=="undefined"||Te[Symbol.iterator]==null){if(Array.isArray(Te)||(xe=U(Te))||we&&Te&&typeof Te.length=="number"){xe&&(Te=xe);var ue=0;return function(){return ue>=Te.length?{done:!0}:{done:!1,value:Te[ue++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return xe=Te[Symbol.iterator](),xe.next.bind(xe)}function E(Te,we){return we={exports:{}},Te(we,we.exports),we.exports}var A=E(function(Te){function we(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function xe(ue){Te.exports.defaults=ue}Te.exports={defaults:we(),getDefaults:we,changeDefaults:xe}}),w=A.defaults,v=A.getDefaults,u=A.changeDefaults,f=/[&<>"']/,o=/[&<>"']/g,t=/[<>"']|&(?!#?\w+;)/,i=/[<>"']|&(?!#?\w+;)/g,s={"&":"&","<":"<",">":">",'"':""","'":"'"},h=function(we){return s[we]};function a(Te,we){if(we){if(f.test(Te))return Te.replace(o,h)}else if(t.test(Te))return Te.replace(i,h);return Te}var e=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function l(Te){return Te.replace(e,function(we,xe){return xe=xe.toLowerCase(),xe==="colon"?":":xe.charAt(0)==="#"?xe.charAt(1)==="x"?String.fromCharCode(parseInt(xe.substring(2),16)):String.fromCharCode(+xe.substring(1)):""})}var n=/(^|[^\[])\^/g;function d(Te,we){Te=Te.source||Te,we=we||"";var xe={replace:function(de,_e){return _e=_e.source||_e,_e=_e.replace(n,"$1"),Te=Te.replace(de,_e),xe},getRegex:function(){return new RegExp(Te,we)}};return xe}var c=/[^\w:]/g,g=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function p(Te,we,xe){if(Te){var ue;try{ue=decodeURIComponent(l(xe)).replace(c,"").toLowerCase()}catch(de){return null}if(ue.indexOf("javascript:")===0||ue.indexOf("vbscript:")===0||ue.indexOf("data:")===0)return null}we&&!g.test(xe)&&(xe=x(we,xe));try{xe=encodeURI(xe).replace(/%25/g,"%")}catch(de){return null}return xe}var m={},b=/^[^:]+:\/*[^/]*$/,y=/^([^:]+:)[\s\S]*$/,r=/^([^:]+:\/*[^/]*)[\s\S]*$/;function x(Te,we){m[" "+Te]||(b.test(Te)?m[" "+Te]=Te+"/":m[" "+Te]=D(Te,"/",!0)),Te=m[" "+Te];var xe=Te.indexOf(":")===-1;return we.substring(0,2)==="//"?xe?we:Te.replace(y,"$1")+we:we.charAt(0)==="/"?xe?we:Te.replace(r,"$1")+we:Te+we}var S={exec:function(){}};function T(Te){for(var we=1,xe,ue;we<arguments.length;we++){xe=arguments[we];for(ue in xe)Object.prototype.hasOwnProperty.call(xe,ue)&&(Te[ue]=xe[ue])}return Te}function R(Te,we){var xe=Te.replace(/\|/g,function(_e,me,Ie){for(var Me=!1,Ve=me;--Ve>=0&&Ie[Ve]==="\\";)Me=!Me;return Me?"|":" |"}),ue=xe.split(/ \|/),de=0;if(ue.length>we)ue.splice(we);else for(;ue.length<we;)ue.push("");for(;de<ue.length;de++)ue[de]=ue[de].trim().replace(/\\\|/g,"|");return ue}function D(Te,we,xe){var ue=Te.length;if(ue===0)return"";for(var de=0;de<ue;){var _e=Te.charAt(ue-de-1);if(_e===we&&!xe)de++;else if(_e!==we&&xe)de++;else break}return Te.substr(0,ue-de)}function k(Te,we){if(Te.indexOf(we[1])===-1)return-1;for(var xe=Te.length,ue=0,de=0;de<xe;de++)if(Te[de]==="\\")de++;else if(Te[de]===we[0])ue++;else if(Te[de]===we[1]&&(ue--,ue<0))return de;return-1}function B(Te){Te&&Te.sanitize&&!Te.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}var G={escape:a,unescape:l,edit:d,cleanUrl:p,resolveUrl:x,noopTest:S,merge:T,splitCells:R,rtrim:D,findClosingBracket:k,checkSanitizeDeprecation:B},P=A.defaults,$=G.rtrim,X=G.splitCells,z=G.escape,N=G.findClosingBracket;function H(Te,we,xe){var ue=we.href,de=we.title?z(we.title):null,_e=Te[1].replace(/\\([\[\]])/g,"$1");return Te[0].charAt(0)!=="!"?{type:"link",raw:xe,href:ue,title:de,text:_e}:{type:"image",raw:xe,href:ue,title:de,text:z(_e)}}function q(Te,we){var xe=Te.match(/^(\s+)(?:```)/);if(xe===null)return we;var ue=xe[1];return we.split(`
|
|
|
`).map(function(de){var _e=de.match(/^\s+/);if(_e===null)return de;var me=_e[0];return me.length>=ue.length?de.slice(ue.length):de}).join(`
|
|
|
`)}var ee=function(){function Te(xe){this.options=xe||P}var we=Te.prototype;return we.space=function(ue){var de=this.rules.block.newline.exec(ue);if(de)return de[0].length>1?{type:"space",raw:de[0]}:{raw:`
|
|
|
`}},we.code=function(ue,de){var _e=this.rules.block.code.exec(ue);if(_e){var me=de[de.length-1];if(me&&me.type==="paragraph")return{raw:_e[0],text:_e[0].trimRight()};var Ie=_e[0].replace(/^ {4}/gm,"");return{type:"code",raw:_e[0],codeBlockStyle:"indented",text:this.options.pedantic?Ie:$(Ie,`
|
|
|
`)}}},we.fences=function(ue){var de=this.rules.block.fences.exec(ue);if(de){var _e=de[0],me=q(_e,de[3]||"");return{type:"code",raw:_e,lang:de[2]?de[2].trim():de[2],text:me}}},we.heading=function(ue){var de=this.rules.block.heading.exec(ue);if(de)return{type:"heading",raw:de[0],depth:de[1].length,text:de[2]}},we.nptable=function(ue){var de=this.rules.block.nptable.exec(ue);if(de){var _e={type:"table",header:X(de[1].replace(/^ *| *\| *$/g,"")),align:de[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:de[3]?de[3].replace(/\n$/,"").split(`
|
|
|
`):[],raw:de[0]};if(_e.header.length===_e.align.length){var me=_e.align.length,Ie;for(Ie=0;Ie<me;Ie++)/^ *-+: *$/.test(_e.align[Ie])?_e.align[Ie]="right":/^ *:-+: *$/.test(_e.align[Ie])?_e.align[Ie]="center":/^ *:-+ *$/.test(_e.align[Ie])?_e.align[Ie]="left":_e.align[Ie]=null;for(me=_e.cells.length,Ie=0;Ie<me;Ie++)_e.cells[Ie]=X(_e.cells[Ie],_e.header.length);return _e}}},we.hr=function(ue){var de=this.rules.block.hr.exec(ue);if(de)return{type:"hr",raw:de[0]}},we.blockquote=function(ue){var de=this.rules.block.blockquote.exec(ue);if(de){var _e=de[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:de[0],text:_e}}},we.list=function(ue){var de=this.rules.block.list.exec(ue);if(de){for(var _e=de[0],me=de[2],Ie=me.length>1,Me=me[me.length-1]===")",Ve={type:"list",raw:_e,ordered:Ie,start:Ie?+me.slice(0,-1):"",loose:!1,items:[]},ot=de[0].match(this.rules.block.item),tt=!1,Ge,Je,$e,et,nt,at,ft,yt=ot.length,mt=0;mt<yt;mt++)Ge=ot[mt],_e=Ge,Je=Ge.length,Ge=Ge.replace(/^ *([*+-]|\d+[.)]) */,""),~Ge.indexOf(`
|
|
|
`)&&(Je-=Ge.length,Ge=this.options.pedantic?Ge.replace(/^ {1,4}/gm,""):Ge.replace(new RegExp("^ {1,"+Je+"}","gm"),"")),mt!==yt-1&&($e=this.rules.block.bullet.exec(ot[mt+1])[0],(Ie?$e.length===1||!Me&&$e[$e.length-1]===")":$e.length>1||this.options.smartLists&&$e!==me)&&(et=ot.slice(mt+1).join(`
|
|
|
`),Ve.raw=Ve.raw.substring(0,Ve.raw.length-et.length),mt=yt-1)),nt=tt||/\n\n(?!\s*$)/.test(Ge),mt!==yt-1&&(tt=Ge.charAt(Ge.length-1)===`
|
|
|
`,nt||(nt=tt)),nt&&(Ve.loose=!0),at=/^\[[ xX]\] /.test(Ge),ft=void 0,at&&(ft=Ge[1]!==" ",Ge=Ge.replace(/^\[[ xX]\] +/,"")),Ve.items.push({type:"list_item",raw:_e,task:at,checked:ft,loose:nt,text:Ge});return Ve}},we.html=function(ue){var de=this.rules.block.html.exec(ue);if(de)return{type:this.options.sanitize?"paragraph":"html",raw:de[0],pre:!this.options.sanitizer&&(de[1]==="pre"||de[1]==="script"||de[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(de[0]):z(de[0]):de[0]}},we.def=function(ue){var de=this.rules.block.def.exec(ue);if(de){de[3]&&(de[3]=de[3].substring(1,de[3].length-1));var _e=de[1].toLowerCase().replace(/\s+/g," ");return{tag:_e,raw:de[0],href:de[2],title:de[3]}}},we.table=function(ue){var de=this.rules.block.table.exec(ue);if(de){var _e={type:"table",header:X(de[1].replace(/^ *| *\| *$/g,"")),align:de[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:de[3]?de[3].replace(/\n$/,"").split(`
|
|
|
`):[]};if(_e.header.length===_e.align.length){_e.raw=de[0];var me=_e.align.length,Ie;for(Ie=0;Ie<me;Ie++)/^ *-+: *$/.test(_e.align[Ie])?_e.align[Ie]="right":/^ *:-+: *$/.test(_e.align[Ie])?_e.align[Ie]="center":/^ *:-+ *$/.test(_e.align[Ie])?_e.align[Ie]="left":_e.align[Ie]=null;for(me=_e.cells.length,Ie=0;Ie<me;Ie++)_e.cells[Ie]=X(_e.cells[Ie].replace(/^ *\| *| *\| *$/g,""),_e.header.length);return _e}}},we.lheading=function(ue){var de=this.rules.block.lheading.exec(ue);if(de)return{type:"heading",raw:de[0],depth:de[2].charAt(0)==="="?1:2,text:de[1]}},we.paragraph=function(ue){var de=this.rules.block.paragraph.exec(ue);if(de)return{type:"paragraph",raw:de[0],text:de[1].charAt(de[1].length-1)===`
|
|
|
`?de[1].slice(0,-1):de[1]}},we.text=function(ue,de){var _e=this.rules.block.text.exec(ue);if(_e){var me=de[de.length-1];return me&&me.type==="text"?{raw:_e[0],text:_e[0]}:{type:"text",raw:_e[0],text:_e[0]}}},we.escape=function(ue){var de=this.rules.inline.escape.exec(ue);if(de)return{type:"escape",raw:de[0],text:z(de[1])}},we.tag=function(ue,de,_e){var me=this.rules.inline.tag.exec(ue);if(me)return!de&&/^<a /i.test(me[0])?de=!0:de&&/^<\/a>/i.test(me[0])&&(de=!1),!_e&&/^<(pre|code|kbd|script)(\s|>)/i.test(me[0])?_e=!0:_e&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(me[0])&&(_e=!1),{type:this.options.sanitize?"text":"html",raw:me[0],inLink:de,inRawBlock:_e,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(me[0]):z(me[0]):me[0]}},we.link=function(ue){var de=this.rules.inline.link.exec(ue);if(de){var _e=N(de[2],"()");if(_e>-1){var me=de[0].indexOf("!")===0?5:4,Ie=me+de[1].length+_e;de[2]=de[2].substring(0,_e),de[0]=de[0].substring(0,Ie).trim(),de[3]=""}var Me=de[2],Ve="";if(this.options.pedantic){var ot=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Me);ot?(Me=ot[1],Ve=ot[3]):Ve=""}else Ve=de[3]?de[3].slice(1,-1):"";Me=Me.trim().replace(/^<([\s\S]*)>$/,"$1");var tt=H(de,{href:Me&&Me.replace(this.rules.inline._escapes,"$1"),title:Ve&&Ve.replace(this.rules.inline._escapes,"$1")},de[0]);return tt}},we.reflink=function(ue,de){var _e;if((_e=this.rules.inline.reflink.exec(ue))||(_e=this.rules.inline.nolink.exec(ue))){var me=(_e[2]||_e[1]).replace(/\s+/g," ");if(me=de[me.toLowerCase()],!me||!me.href){var Ie=_e[0].charAt(0);return{type:"text",raw:Ie,text:Ie}}var Me=H(_e,me,_e[0]);return Me}},we.strong=function(ue,de,_e){_e===void 0&&(_e="");var me=this.rules.inline.strong.start.exec(ue);if(me&&(!me[1]||me[1]&&(_e===""||this.rules.inline.punctuation.exec(_e)))){de=de.slice(-1*ue.length);var Ie=me[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Ie.lastIndex=0;for(var Me;(me=Ie.exec(de))!=null;)if(Me=this.rules.inline.strong.middle.exec(de.slice(0,me.index+3)),Me)return{type:"strong",raw:ue.slice(0,Me[0].length),text:ue.slice(2,Me[0].length-2)}}},we.em=function(ue,de,_e){_e===void 0&&(_e="");var me=this.rules.inline.em.start.exec(ue);if(me&&(!me[1]||me[1]&&(_e===""||this.rules.inline.punctuation.exec(_e)))){de=de.slice(-1*ue.length);var Ie=me[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Ie.lastIndex=0;for(var Me;(me=Ie.exec(de))!=null;)if(Me=this.rules.inline.em.middle.exec(de.slice(0,me.index+2)),Me)return{type:"em",raw:ue.slice(0,Me[0].length),text:ue.slice(1,Me[0].length-1)}}},we.codespan=function(ue){var de=this.rules.inline.code.exec(ue);if(de){var _e=de[2].replace(/\n/g," "),me=/[^ ]/.test(_e),Ie=_e.startsWith(" ")&&_e.endsWith(" ");return me&&Ie&&(_e=_e.substring(1,_e.length-1)),_e=z(_e,!0),{type:"codespan",raw:de[0],text:_e}}},we.br=function(ue){var de=this.rules.inline.br.exec(ue);if(de)return{type:"br",raw:de[0]}},we.del=function(ue){var de=this.rules.inline.del.exec(ue);if(de)return{type:"del",raw:de[0],text:de[1]}},we.autolink=function(ue,de){var _e=this.rules.inline.autolink.exec(ue);if(_e){var me,Ie;return _e[2]==="@"?(me=z(this.options.mangle?de(_e[1]):_e[1]),Ie="mailto:"+me):(me=z(_e[1]),Ie=me),{type:"link",raw:_e[0],text:me,href:Ie,tokens:[{type:"text",raw:me,text:me}]}}},we.url=function(ue,de){var _e;if(_e=this.rules.inline.url.exec(ue)){var me,Ie;if(_e[2]==="@")me=z(this.options.mangle?de(_e[0]):_e[0]),Ie="mailto:"+me;else{var Me;do Me=_e[0],_e[0]=this.rules.inline._backpedal.exec(_e[0])[0];while(Me!==_e[0]);me=z(_e[0]),_e[1]==="www."?Ie="http://"+me:Ie=me}return{type:"link",raw:_e[0],text:me,href:Ie,tokens:[{type:"text",raw:me,text:me}]}}},we.inlineText=function(ue,de,_e){var me=this.rules.inline.text.exec(ue);if(me){var Ie;return de?Ie=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(me[0]):z(me[0]):me[0]:Ie=z(this.options.smartypants?_e(me[0]):me[0]),{type:"text",raw:me[0],text:Ie}}},Te}(),fe=G.noopTest,oe=G.edit,he=G.merge,se={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:fe,table:fe,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};se._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,se._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,se.def=oe(se.def).replace("label",se._label).replace("title",se._title).getRegex(),se.bullet=/(?:[*+-]|\d{1,9}[.)])/,se.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,se.item=oe(se.item,"gm").replace(/bull/g,se.bullet).getRegex(),se.list=oe(se.list).replace(/bull/g,se.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+se.def.source+")").getRegex(),se._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",se._comment=/<!--(?!-?>)[\s\S]*?-->/,se.html=oe(se.html,"i").replace("comment",se._comment).replace("tag",se._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),se.paragraph=oe(se._paragraph).replace("hr",se.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",se._tag).getRegex(),se.blockquote=oe(se.blockquote).replace("paragraph",se.paragraph).getRegex(),se.normal=he({},se),se.gfm=he({},se.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n *([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n *\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),se.gfm.nptable=oe(se.gfm.nptable).replace("hr",se.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",se._tag).getRegex(),se.gfm.table=oe(se.gfm.table).replace("hr",se.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",se._tag).getRegex(),se.pedantic=he({},se.normal,{html:oe(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",se._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:fe,paragraph:oe(se.normal._paragraph).replace("hr",se.hr).replace("heading",` *#{1,6} *[^
|
|
|
]`).replace("lheading",se.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var ge={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:fe,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:fe,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};ge._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",ge.punctuation=oe(ge.punctuation).replace(/punctuation/g,ge._punctuation).getRegex(),ge._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",ge._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",ge.em.start=oe(ge.em.start).replace(/punctuation/g,ge._punctuation).getRegex(),ge.em.middle=oe(ge.em.middle).replace(/punctuation/g,ge._punctuation).replace(/overlapSkip/g,ge._overlapSkip).getRegex(),ge.em.endAst=oe(ge.em.endAst,"g").replace(/punctuation/g,ge._punctuation).getRegex(),ge.em.endUnd=oe(ge.em.endUnd,"g").replace(/punctuation/g,ge._punctuation).getRegex(),ge.strong.start=oe(ge.strong.start).replace(/punctuation/g,ge._punctuation).getRegex(),ge.strong.middle=oe(ge.strong.middle).replace(/punctuation/g,ge._punctuation).replace(/blockSkip/g,ge._blockSkip).getRegex(),ge.strong.endAst=oe(ge.strong.endAst,"g").replace(/punctuation/g,ge._punctuation).getRegex(),ge.strong.endUnd=oe(ge.strong.endUnd,"g").replace(/punctuation/g,ge._punctuation).getRegex(),ge.blockSkip=oe(ge._blockSkip,"g").getRegex(),ge.overlapSkip=oe(ge._overlapSkip,"g").getRegex(),ge._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,ge._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,ge._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,ge.autolink=oe(ge.autolink).replace("scheme",ge._scheme).replace("email",ge._email).getRegex(),ge._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,ge.tag=oe(ge.tag).replace("comment",se._comment).replace("attribute",ge._attribute).getRegex(),ge._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ge._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,ge._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,ge.link=oe(ge.link).replace("label",ge._label).replace("href",ge._href).replace("title",ge._title).getRegex(),ge.reflink=oe(ge.reflink).replace("label",ge._label).getRegex(),ge.reflinkSearch=oe(ge.reflinkSearch,"g").replace("reflink",ge.reflink).replace("nolink",ge.nolink).getRegex(),ge.normal=he({},ge),ge.pedantic=he({},ge.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:oe(/^!?\[(label)\]\((.*?)\)/).replace("label",ge._label).getRegex(),reflink:oe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ge._label).getRegex()}),ge.gfm=he({},ge.normal,{escape:oe(ge.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*~]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))|(?= {2,}\n|[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))/}),ge.gfm.url=oe(ge.gfm.url,"i").replace("email",ge.gfm._extended_email).getRegex(),ge.breaks=he({},ge.gfm,{br:oe(ge.br).replace("{2,}","*").getRegex(),text:oe(ge.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var ie={block:se,inline:ge},re=A.defaults,Q=ie.block,pe=ie.inline;function ne(Te){return Te.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026")}function J(Te){var we="",xe,ue,de=Te.length;for(xe=0;xe<de;xe++)ue=Te.charCodeAt(xe),Math.random()>.5&&(ue="x"+ue.toString(16)),we+="&#"+ue+";";return we}var be=function(){function Te(xe){this.tokens=[],this.tokens.links=Object.create(null),this.options=xe||re,this.options.tokenizer=this.options.tokenizer||new ee,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var ue={block:Q.normal,inline:pe.normal};this.options.pedantic?(ue.block=Q.pedantic,ue.inline=pe.pedantic):this.options.gfm&&(ue.block=Q.gfm,this.options.breaks?ue.inline=pe.breaks:ue.inline=pe.gfm),this.tokenizer.rules=ue}Te.lex=function(ue,de){var _e=new Te(de);return _e.lex(ue)};var we=Te.prototype;return we.lex=function(ue){return ue=ue.replace(/\r\n|\r/g,`
|
|
|
`).replace(/\t/g," "),this.blockTokens(ue,this.tokens,!0),this.inline(this.tokens),this.tokens},we.blockTokens=function(ue,de,_e){de===void 0&&(de=[]),_e===void 0&&(_e=!0),ue=ue.replace(/^ +$/gm,"");for(var me,Ie,Me,Ve;ue;){if(me=this.tokenizer.space(ue)){ue=ue.substring(me.raw.length),me.type&&de.push(me);continue}if(me=this.tokenizer.code(ue,de)){ue=ue.substring(me.raw.length),me.type?de.push(me):(Ve=de[de.length-1],Ve.raw+=`
|
|
|
`+me.raw,Ve.text+=`
|
|
|
`+me.text);continue}if(me=this.tokenizer.fences(ue)){ue=ue.substring(me.raw.length),de.push(me);continue}if(me=this.tokenizer.heading(ue)){ue=ue.substring(me.raw.length),de.push(me);continue}if(me=this.tokenizer.nptable(ue)){ue=ue.substring(me.raw.length),de.push(me);continue}if(me=this.tokenizer.hr(ue)){ue=ue.substring(me.raw.length),de.push(me);continue}if(me=this.tokenizer.blockquote(ue)){ue=ue.substring(me.raw.length),me.tokens=this.blockTokens(me.text,[],_e),de.push(me);continue}if(me=this.tokenizer.list(ue)){for(ue=ue.substring(me.raw.length),Me=me.items.length,Ie=0;Ie<Me;Ie++)me.items[Ie].tokens=this.blockTokens(me.items[Ie].text,[],!1);de.push(me);continue}if(me=this.tokenizer.html(ue)){ue=ue.substring(me.raw.length),de.push(me);continue}if(_e&&(me=this.tokenizer.def(ue))){ue=ue.substring(me.raw.length),this.tokens.links[me.tag]||(this.tokens.links[me.tag]={href:me.href,title:me.title});continue}if(me=this.tokenizer.table(ue)){ue=ue.substring(me.raw.length),de.push(me);continue}if(me=this.tokenizer.lheading(ue)){ue=ue.substring(me.raw.length),de.push(me);continue}if(_e&&(me=this.tokenizer.paragraph(ue))){ue=ue.substring(me.raw.length),de.push(me);continue}if(me=this.tokenizer.text(ue,de)){ue=ue.substring(me.raw.length),me.type?de.push(me):(Ve=de[de.length-1],Ve.raw+=`
|
|
|
`+me.raw,Ve.text+=`
|
|
|
`+me.text);continue}if(ue){var ot="Infinite loop on byte: "+ue.charCodeAt(0);if(this.options.silent){console.error(ot);break}else throw new Error(ot)}}return de},we.inline=function(ue){var de,_e,me,Ie,Me,Ve,ot=ue.length;for(de=0;de<ot;de++){Ve=ue[de];switch(Ve.type){case"paragraph":case"text":case"heading":{Ve.tokens=[],this.inlineTokens(Ve.text,Ve.tokens);break}case"table":{for(Ve.tokens={header:[],cells:[]},Ie=Ve.header.length,_e=0;_e<Ie;_e++)Ve.tokens.header[_e]=[],this.inlineTokens(Ve.header[_e],Ve.tokens.header[_e]);for(Ie=Ve.cells.length,_e=0;_e<Ie;_e++)for(Me=Ve.cells[_e],Ve.tokens.cells[_e]=[],me=0;me<Me.length;me++)Ve.tokens.cells[_e][me]=[],this.inlineTokens(Me[me],Ve.tokens.cells[_e][me]);break}case"blockquote":{this.inline(Ve.tokens);break}case"list":{for(Ie=Ve.items.length,_e=0;_e<Ie;_e++)this.inline(Ve.items[_e].tokens);break}}}return ue},we.inlineTokens=function(ue,de,_e,me,Ie){de===void 0&&(de=[]),_e===void 0&&(_e=!1),me===void 0&&(me=!1),Ie===void 0&&(Ie="");var Me,Ve=ue,ot;if(this.tokens.links){var tt=Object.keys(this.tokens.links);if(tt.length>0)for(;(ot=this.tokenizer.rules.inline.reflinkSearch.exec(Ve))!=null;)tt.includes(ot[0].slice(ot[0].lastIndexOf("[")+1,-1))&&(Ve=Ve.slice(0,ot.index)+"["+"a".repeat(ot[0].length-2)+"]"+Ve.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(ot=this.tokenizer.rules.inline.blockSkip.exec(Ve))!=null;)Ve=Ve.slice(0,ot.index)+"["+"a".repeat(ot[0].length-2)+"]"+Ve.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;ue;){if(Me=this.tokenizer.escape(ue)){ue=ue.substring(Me.raw.length),de.push(Me);continue}if(Me=this.tokenizer.tag(ue,_e,me)){ue=ue.substring(Me.raw.length),_e=Me.inLink,me=Me.inRawBlock,de.push(Me);continue}if(Me=this.tokenizer.link(ue)){ue=ue.substring(Me.raw.length),Me.type==="link"&&(Me.tokens=this.inlineTokens(Me.text,[],!0,me)),de.push(Me);continue}if(Me=this.tokenizer.reflink(ue,this.tokens.links)){ue=ue.substring(Me.raw.length),Me.type==="link"&&(Me.tokens=this.inlineTokens(Me.text,[],!0,me)),de.push(Me);continue}if(Me=this.tokenizer.strong(ue,Ve,Ie)){ue=ue.substring(Me.raw.length),Me.tokens=this.inlineTokens(Me.text,[],_e,me),de.push(Me);continue}if(Me=this.tokenizer.em(ue,Ve,Ie)){ue=ue.substring(Me.raw.length),Me.tokens=this.inlineTokens(Me.text,[],_e,me),de.push(Me);continue}if(Me=this.tokenizer.codespan(ue)){ue=ue.substring(Me.raw.length),de.push(Me);continue}if(Me=this.tokenizer.br(ue)){ue=ue.substring(Me.raw.length),de.push(Me);continue}if(Me=this.tokenizer.del(ue)){ue=ue.substring(Me.raw.length),Me.tokens=this.inlineTokens(Me.text,[],_e,me),de.push(Me);continue}if(Me=this.tokenizer.autolink(ue,J)){ue=ue.substring(Me.raw.length),de.push(Me);continue}if(!_e&&(Me=this.tokenizer.url(ue,J))){ue=ue.substring(Me.raw.length),de.push(Me);continue}if(Me=this.tokenizer.inlineText(ue,me,ne)){ue=ue.substring(Me.raw.length),Ie=Me.raw.slice(-1),de.push(Me);continue}if(ue){var Ge="Infinite loop on byte: "+ue.charCodeAt(0);if(this.options.silent){console.error(Ge);break}else throw new Error(Ge)}}return de},Z(Te,null,[{key:"rules",get:function(){return{block:Q,inline:pe}}}]),Te}(),Ee=A.defaults,Le=G.cleanUrl,V=G.escape,C=function(){function Te(xe){this.options=xe||Ee}var we=Te.prototype;return we.code=function(ue,de,_e){var me=(de||"").match(/\S*/)[0];if(this.options.highlight){var Ie=this.options.highlight(ue,me);Ie!=null&&Ie!==ue&&(_e=!0,ue=Ie)}return me?'<pre><code class="'+this.options.langPrefix+V(me,!0)+'">'+(_e?ue:V(ue,!0))+`</code></pre>
|
|
|
`:"<pre><code>"+(_e?ue:V(ue,!0))+`</code></pre>
|
|
|
`},we.blockquote=function(ue){return`<blockquote>
|
|
|
`+ue+`</blockquote>
|
|
|
`},we.html=function(ue){return ue},we.heading=function(ue,de,_e,me){return this.options.headerIds?"<h"+de+' id="'+this.options.headerPrefix+me.slug(_e)+'">'+ue+"</h"+de+`>
|
|
|
`:"<h"+de+">"+ue+"</h"+de+`>
|
|
|
`},we.hr=function(){return this.options.xhtml?`<hr/>
|
|
|
`:`<hr>
|
|
|
`},we.list=function(ue,de,_e){var me=de?"ol":"ul",Ie=de&&_e!==1?' start="'+_e+'"':"";return"<"+me+Ie+`>
|
|
|
`+ue+"</"+me+`>
|
|
|
`},we.listitem=function(ue){return"<li>"+ue+`</li>
|
|
|
`},we.checkbox=function(ue){return"<input "+(ue?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},we.paragraph=function(ue){return"<p>"+ue+`</p>
|
|
|
`},we.table=function(ue,de){return de&&(de="<tbody>"+de+"</tbody>"),`<table>
|
|
|
<thead>
|
|
|
`+ue+`</thead>
|
|
|
`+de+`</table>
|
|
|
`},we.tablerow=function(ue){return`<tr>
|
|
|
`+ue+`</tr>
|
|
|
`},we.tablecell=function(ue,de){var _e=de.header?"th":"td",me=de.align?"<"+_e+' align="'+de.align+'">':"<"+_e+">";return me+ue+"</"+_e+`>
|
|
|
`},we.strong=function(ue){return"<strong>"+ue+"</strong>"},we.em=function(ue){return"<em>"+ue+"</em>"},we.codespan=function(ue){return"<code>"+ue+"</code>"},we.br=function(){return this.options.xhtml?"<br/>":"<br>"},we.del=function(ue){return"<del>"+ue+"</del>"},we.link=function(ue,de,_e){if(ue=Le(this.options.sanitize,this.options.baseUrl,ue),ue===null)return _e;var me='<a href="'+V(ue)+'"';return de&&(me+=' title="'+de+'"'),me+=">"+_e+"</a>",me},we.image=function(ue,de,_e){if(ue=Le(this.options.sanitize,this.options.baseUrl,ue),ue===null)return _e;var me='<img src="'+ue+'" alt="'+_e+'"';return de&&(me+=' title="'+de+'"'),me+=this.options.xhtml?"/>":">",me},we.text=function(ue){return ue},Te}(),O=function(){function Te(){}var we=Te.prototype;return we.strong=function(ue){return ue},we.em=function(ue){return ue},we.codespan=function(ue){return ue},we.del=function(ue){return ue},we.html=function(ue){return ue},we.text=function(ue){return ue},we.link=function(ue,de,_e){return""+_e},we.image=function(ue,de,_e){return""+_e},we.br=function(){return""},Te}(),j=function(){function Te(){this.seen={}}var we=Te.prototype;return we.slug=function(ue){var de=ue.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(de)){var _e=de;do this.seen[_e]++,de=_e+"-"+this.seen[_e];while(this.seen.hasOwnProperty(de))}return this.seen[de]=0,de},Te}(),M=A.defaults,F=G.unescape,ae=function(){function Te(xe){this.options=xe||M,this.options.renderer=this.options.renderer||new C,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new O,this.slugger=new j}Te.parse=function(ue,de){var _e=new Te(de);return _e.parse(ue)};var we=Te.prototype;return we.parse=function(ue,de){de===void 0&&(de=!0);var _e="",me,Ie,Me,Ve,ot,tt,Ge,Je,$e,et,nt,at,ft,yt,mt,pt,vt,ut,dt=ue.length;for(me=0;me<dt;me++){et=ue[me];switch(et.type){case"space":continue;case"hr":{_e+=this.renderer.hr();continue}case"heading":{_e+=this.renderer.heading(this.parseInline(et.tokens),et.depth,F(this.parseInline(et.tokens,this.textRenderer)),this.slugger);continue}case"code":{_e+=this.renderer.code(et.text,et.lang,et.escaped);continue}case"table":{for(Je="",Ge="",Ve=et.header.length,Ie=0;Ie<Ve;Ie++)Ge+=this.renderer.tablecell(this.parseInline(et.tokens.header[Ie]),{header:!0,align:et.align[Ie]});for(Je+=this.renderer.tablerow(Ge),$e="",Ve=et.cells.length,Ie=0;Ie<Ve;Ie++){for(tt=et.tokens.cells[Ie],Ge="",ot=tt.length,Me=0;Me<ot;Me++)Ge+=this.renderer.tablecell(this.parseInline(tt[Me]),{header:!1,align:et.align[Me]});$e+=this.renderer.tablerow(Ge)}_e+=this.renderer.table(Je,$e);continue}case"blockquote":{$e=this.parse(et.tokens),_e+=this.renderer.blockquote($e);continue}case"list":{for(nt=et.ordered,at=et.start,ft=et.loose,Ve=et.items.length,$e="",Ie=0;Ie<Ve;Ie++)mt=et.items[Ie],pt=mt.checked,vt=mt.task,yt="",mt.task&&(ut=this.renderer.checkbox(pt),ft?mt.tokens.length>0&&mt.tokens[0].type==="text"?(mt.tokens[0].text=ut+" "+mt.tokens[0].text,mt.tokens[0].tokens&&mt.tokens[0].tokens.length>0&&mt.tokens[0].tokens[0].type==="text"&&(mt.tokens[0].tokens[0].text=ut+" "+mt.tokens[0].tokens[0].text)):mt.tokens.unshift({type:"text",text:ut}):yt+=ut),yt+=this.parse(mt.tokens,ft),$e+=this.renderer.listitem(yt,vt,pt);_e+=this.renderer.list($e,nt,at);continue}case"html":{_e+=this.renderer.html(et.text);continue}case"paragraph":{_e+=this.renderer.paragraph(this.parseInline(et.tokens));continue}case"text":{for($e=et.tokens?this.parseInline(et.tokens):et.text;me+1<dt&&ue[me+1].type==="text";)et=ue[++me],$e+=`
|
|
|
`+(et.tokens?this.parseInline(et.tokens):et.text);_e+=de?this.renderer.paragraph($e):$e;continue}default:{var gt='Token with "'+et.type+'" type was not found.';if(this.options.silent){console.error(gt);return}else throw new Error(gt)}}}return _e},we.parseInline=function(ue,de){de=de||this.renderer;var _e="",me,Ie,Me=ue.length;for(me=0;me<Me;me++){Ie=ue[me];switch(Ie.type){case"escape":{_e+=de.text(Ie.text);break}case"html":{_e+=de.html(Ie.text);break}case"link":{_e+=de.link(Ie.href,Ie.title,this.parseInline(Ie.tokens,de));break}case"image":{_e+=de.image(Ie.href,Ie.title,Ie.text);break}case"strong":{_e+=de.strong(this.parseInline(Ie.tokens,de));break}case"em":{_e+=de.em(this.parseInline(Ie.tokens,de));break}case"codespan":{_e+=de.codespan(Ie.text);break}case"br":{_e+=de.br();break}case"del":{_e+=de.del(this.parseInline(Ie.tokens,de));break}case"text":{_e+=de.text(Ie.text);break}default:{var Ve='Token with "'+Ie.type+'" type was not found.';if(this.options.silent){console.error(Ve);return}else throw new Error(Ve)}}}return _e},Te}(),ve=G.merge,Pe=G.checkSanitizeDeprecation,Oe=G.escape,De=A.getDefaults,Ne=A.changeDefaults,Ke=A.defaults;function ke(Te,we,xe){if(typeof Te=="undefined"||Te===null)throw new Error("marked(): input parameter is undefined or null");if(typeof Te!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(Te)+", string expected");if(typeof we=="function"&&(xe=we,we=null),we=ve({},ke.defaults,we||{}),Pe(we),xe){var ue=we.highlight,de;try{de=be.lex(Te,we)}catch(Me){return xe(Me)}var _e=function(Ve){var ot;if(!Ve)try{ot=ae.parse(de,we)}catch(tt){Ve=tt}return we.highlight=ue,Ve?xe(Ve):xe(null,ot)};if(!ue||ue.length<3)return _e();if(delete we.highlight,!de.length)return _e();var me=0;ke.walkTokens(de,function(Me){Me.type==="code"&&(me++,setTimeout(function(){ue(Me.text,Me.lang,function(Ve,ot){if(Ve)return _e(Ve);ot!=null&&ot!==Me.text&&(Me.text=ot,Me.escaped=!0),me--,me===0&&_e()})},0))}),me===0&&_e();return}try{var Ie=be.lex(Te,we);return we.walkTokens&&ke.walkTokens(Ie,we.walkTokens),ae.parse(Ie,we)}catch(Me){if(Me.message+=`
|
|
|
Please report this to https://github.com/markedjs/marked.`,we.silent)return"<p>An error occurred:</p><pre>"+Oe(Me.message+"",!0)+"</pre>";throw Me}}ke.options=ke.setOptions=function(Te){return ve(ke.defaults,Te),Ne(ke.defaults),ke},ke.getDefaults=De,ke.defaults=Ke,ke.use=function(Te){var we=ve({},Te);if(Te.renderer&&function(){var ue=ke.defaults.renderer||new C,de=function(Ie){var Me=ue[Ie];ue[Ie]=function(){for(var Ve=arguments.length,ot=new Array(Ve),tt=0;tt<Ve;tt++)ot[tt]=arguments[tt];var Ge=Te.renderer[Ie].apply(ue,ot);return Ge===!1&&(Ge=Me.apply(ue,ot)),Ge}};for(var _e in Te.renderer)de(_e);we.renderer=ue}(),Te.tokenizer&&function(){var ue=ke.defaults.tokenizer||new ee,de=function(Ie){var Me=ue[Ie];ue[Ie]=function(){for(var Ve=arguments.length,ot=new Array(Ve),tt=0;tt<Ve;tt++)ot[tt]=arguments[tt];var Ge=Te.tokenizer[Ie].apply(ue,ot);return Ge===!1&&(Ge=Me.apply(ue,ot)),Ge}};for(var _e in Te.tokenizer)de(_e);we.tokenizer=ue}(),Te.walkTokens){var xe=ke.defaults.walkTokens;we.walkTokens=function(ue){Te.walkTokens(ue),xe&&xe(ue)}}ke.setOptions(we)},ke.walkTokens=function(Te,we){for(var xe=L(Te),ue;!(ue=xe()).done;){var de=ue.value;we(de);switch(de.type){case"table":{for(var _e=L(de.tokens.header),me;!(me=_e()).done;){var Ie=me.value;ke.walkTokens(Ie,we)}for(var Me=L(de.tokens.cells),Ve;!(Ve=Me()).done;)for(var ot=Ve.value,tt=L(ot),Ge;!(Ge=tt()).done;){var Je=Ge.value;ke.walkTokens(Je,we)}break}case"list":{ke.walkTokens(de.items,we);break}default:de.tokens&&ke.walkTokens(de.tokens,we)}}},ke.Parser=ae,ke.parser=ae.parse,ke.Renderer=C,ke.TextRenderer=O,ke.Lexer=be,ke.lexer=be.lex,ke.Tokenizer=ee,ke.Slugger=j,ke.parse=ke;var Re=ke;return Re})},E2g8:function(Ze,Qe,ye){(function(Se,Z){/*!
|
|
|
* @overview es6-promise - a tiny implementation of Promises/A+.
|
|
|
* @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
|
|
|
* @license Licensed under MIT license
|
|
|
* See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
|
|
|
* @version v4.2.8+1e68dce6
|
|
|
*/(function(U,_){Ze.exports=_()})(this,function(){"use strict";function U(C){var O=typeof C;return C!==null&&(O==="object"||O==="function")}function _(C){return typeof C=="function"}var L=void 0;Array.isArray?L=Array.isArray:L=function(C){return Object.prototype.toString.call(C)==="[object Array]"};var E=L,A=0,w=void 0,v=void 0,u=function(O,j){g[A]=O,g[A+1]=j,A+=2,A===2&&(v?v(p):b())};function f(C){v=C}function o(C){u=C}var t=typeof window!="undefined"?window:void 0,i=t||{},s=i.MutationObserver||i.WebKitMutationObserver,h=typeof self=="undefined"&&typeof Se!="undefined"&&{}.toString.call(Se)==="[object process]",a=typeof Uint8ClampedArray!="undefined"&&typeof importScripts!="undefined"&&typeof MessageChannel!="undefined";function e(){return function(){return Se.nextTick(p)}}function l(){return typeof w!="undefined"?function(){w(p)}:c()}function n(){var C=0,O=new s(p),j=document.createTextNode("");return O.observe(j,{characterData:!0}),function(){j.data=C=++C%2}}function d(){var C=new MessageChannel;return C.port1.onmessage=p,function(){return C.port2.postMessage(0)}}function c(){var C=setTimeout;return function(){return C(p,1)}}var g=new Array(1e3);function p(){for(var C=0;C<A;C+=2){var O=g[C],j=g[C+1];O(j),g[C]=void 0,g[C+1]=void 0}A=0}function m(){try{var C=Function("return this")().require("vertx");return w=C.runOnLoop||C.runOnContext,l()}catch(O){return c()}}var b=void 0;h?b=e():s?b=n():a?b=d():t===void 0&&!0?b=m():b=c();function y(C,O){var j=this,M=new this.constructor(S);M[x]===void 0&&ie(M);var F=j._state;if(F){var ae=arguments[F-1];u(function(){return oe(F,M,ae,j._result)})}else ee(j,M,C,O);return M}function r(C){var O=this;if(C&&typeof C=="object"&&C.constructor===O)return C;var j=new O(S);return z(j,C),j}var x=Math.random().toString(36).substring(2);function S(){}var T=void 0,R=1,D=2;function k(){return new TypeError("You cannot resolve a promise with itself")}function B(){return new TypeError("A promises callback cannot return that same promise.")}function G(C,O,j,M){try{C.call(O,j,M)}catch(F){return F}}function P(C,O,j){u(function(M){var F=!1,ae=G(j,O,function(ve){if(F)return;F=!0,O!==ve?z(M,ve):H(M,ve)},function(ve){if(F)return;F=!0,q(M,ve)},"Settle: "+(M._label||" unknown promise"));!F&&ae&&(F=!0,q(M,ae))},C)}function $(C,O){O._state===R?H(C,O._result):O._state===D?q(C,O._result):ee(O,void 0,function(j){return z(C,j)},function(j){return q(C,j)})}function X(C,O,j){O.constructor===C.constructor&&j===y&&O.constructor.resolve===r?$(C,O):j===void 0?H(C,O):_(j)?P(C,O,j):H(C,O)}function z(C,O){if(C===O)q(C,k());else if(U(O)){var j=void 0;try{j=O.then}catch(M){q(C,M);return}X(C,O,j)}else H(C,O)}function N(C){C._onerror&&C._onerror(C._result),fe(C)}function H(C,O){if(C._state!==T)return;C._result=O,C._state=R,C._subscribers.length!==0&&u(fe,C)}function q(C,O){if(C._state!==T)return;C._state=D,C._result=O,u(N,C)}function ee(C,O,j,M){var F=C._subscribers,ae=F.length;C._onerror=null,F[ae]=O,F[ae+R]=j,F[ae+D]=M,ae===0&&C._state&&u(fe,C)}function fe(C){var O=C._subscribers,j=C._state;if(O.length===0)return;for(var M=void 0,F=void 0,ae=C._result,ve=0;ve<O.length;ve+=3)M=O[ve],F=O[ve+j],M?oe(j,M,F,ae):F(ae);C._subscribers.length=0}function oe(C,O,j,M){var F=_(j),ae=void 0,ve=void 0,Pe=!0;if(F){try{ae=j(M)}catch(Oe){Pe=!1,ve=Oe}if(O===ae){q(O,B());return}}else ae=M;O._state!==T||(F&&Pe?z(O,ae):Pe===!1?q(O,ve):C===R?H(O,ae):C===D&&q(O,ae))}function he(C,O){try{O(function(M){z(C,M)},function(M){q(C,M)})}catch(j){q(C,j)}}var se=0;function ge(){return se++}function ie(C){C[x]=se++,C._state=void 0,C._result=void 0,C._subscribers=[]}function re(){return new Error("Array Methods must be provided an Array")}var Q=function(){function C(O,j){this._instanceConstructor=O,this.promise=new O(S),this.promise[x]||ie(this.promise),E(j)?(this.length=j.length,this._remaining=j.length,this._result=new Array(this.length),this.length===0?H(this.promise,this._result):(this.length=this.length||0,this._enumerate(j),this._remaining===0&&H(this.promise,this._result))):q(this.promise,re())}return C.prototype._enumerate=function(j){for(var M=0;this._state===T&&M<j.length;M++)this._eachEntry(j[M],M)},C.prototype._eachEntry=function(j,M){var F=this._instanceConstructor,ae=F.resolve;if(ae===r){var ve=void 0,Pe=void 0,Oe=!1;try{ve=j.then}catch(Ne){Oe=!0,Pe=Ne}if(ve===y&&j._state!==T)this._settledAt(j._state,M,j._result);else if(typeof ve!="function")this._remaining--,this._result[M]=j;else if(F===Le){var De=new F(S);Oe?q(De,Pe):X(De,j,ve),this._willSettleAt(De,M)}else this._willSettleAt(new F(function(Ne){return Ne(j)}),M)}else this._willSettleAt(ae(j),M)},C.prototype._settledAt=function(j,M,F){var ae=this.promise;ae._state===T&&(this._remaining--,j===D?q(ae,F):this._result[M]=F),this._remaining===0&&H(ae,this._result)},C.prototype._willSettleAt=function(j,M){var F=this;ee(j,void 0,function(ae){return F._settledAt(R,M,ae)},function(ae){return F._settledAt(D,M,ae)})},C}();function pe(C){return new Q(this,C).promise}function ne(C){var O=this;return E(C)?new O(function(j,M){for(var F=C.length,ae=0;ae<F;ae++)O.resolve(C[ae]).then(j,M)}):new O(function(j,M){return M(new TypeError("You must pass an array to race."))})}function J(C){var O=this,j=new O(S);return q(j,C),j}function be(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function Ee(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}var Le=function(){function C(O){this[x]=ge(),this._result=this._state=void 0,this._subscribers=[],S!==O&&(typeof O!="function"&&be(),this instanceof C?he(this,O):Ee())}return C.prototype.catch=function(j){return this.then(null,j)},C.prototype.finally=function(j){var M=this,F=M.constructor;return _(j)?M.then(function(ae){return F.resolve(j()).then(function(){return ae})},function(ae){return F.resolve(j()).then(function(){throw ae})}):M.then(j,j)},C}();Le.prototype.then=y,Le.all=pe,Le.race=ne,Le.resolve=r,Le.reject=J,Le._setScheduler=f,Le._setAsap=o,Le._asap=u;function V(){var C=void 0;if(typeof Z!="undefined")C=Z;else if(typeof self!="undefined")C=self;else try{C=Function("return this")()}catch(M){throw new Error("polyfill failed because global object is unavailable in this environment")}var O=C.Promise;if(O){var j=null;try{j=Object.prototype.toString.call(O.resolve())}catch(M){}if(j==="[object Promise]"&&!O.cast)return}C.Promise=Le}return Le.polyfill=V,Le.Promise=Le,Le})}).call(this,ye("Q2Ig"),ye("IyRk"))},E9nw:function(Ze,Qe){Ze.exports=function(){var ye=document.getSelection();if(!ye.rangeCount)return function(){};for(var Se=document.activeElement,Z=[],U=0;U<ye.rangeCount;U++)Z.push(ye.getRangeAt(U));switch(Se.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":Se.blur();break;default:Se=null;break}return ye.removeAllRanges(),function(){ye.type==="Caret"&&ye.removeAllRanges(),ye.rangeCount||Z.forEach(function(_){ye.addRange(_)}),Se&&Se.focus()}}},GUcZ:function(Ze,Qe,ye){"use strict";var Se=ye("fWQN"),Z=ye("mtLc"),U=function(){function ce(){Object(Se.a)(this,ce)}return Object(Z.a)(ce,null,[{key:"install",value:function(){Object.setPrototypeOf=Object.setPrototypeOf||function(I,W){return I.__proto__=W,I},Object.assign=Object.assign||function(I){if(I==null)throw new TypeError("Cannot convert undefined or null to object");for(var W=Object(I),K=1;K<arguments.length;K++){var Y=arguments[K];if(Y!=null)for(var le in Y)Y.hasOwnProperty(le)&&(W[le]=Y[le])}return W},typeof self.Promise!="function"&&ye("E2g8").polyfill()}}]),ce}();U.install();var _=U,L=ye("+qE3"),E=ye.n(L),A=function(){function ce(){Object(Se.a)(this,ce)}return Object(Z.a)(ce,null,[{key:"e",value:function(I,W){(!I||ce.FORCE_GLOBAL_TAG)&&(I=ce.GLOBAL_TAG);var K="[".concat(I,"] > ").concat(W);if(ce.ENABLE_CALLBACK&&ce.emitter.emit("log","error",K),!ce.ENABLE_ERROR)return;console.error?console.error(K):console.warn?console.warn(K):console.log(K)}},{key:"i",value:function(I,W){(!I||ce.FORCE_GLOBAL_TAG)&&(I=ce.GLOBAL_TAG);var K="[".concat(I,"] > ").concat(W);if(ce.ENABLE_CALLBACK&&ce.emitter.emit("log","info",K),!ce.ENABLE_INFO)return;console.info?console.info(K):console.log(K)}},{key:"w",value:function(I,W){(!I||ce.FORCE_GLOBAL_TAG)&&(I=ce.GLOBAL_TAG);var K="[".concat(I,"] > ").concat(W);if(ce.ENABLE_CALLBACK&&ce.emitter.emit("log","warn",K),!ce.ENABLE_WARN)return;console.warn?console.warn(K):console.log(K)}},{key:"d",value:function(I,W){(!I||ce.FORCE_GLOBAL_TAG)&&(I=ce.GLOBAL_TAG);var K="[".concat(I,"] > ").concat(W);if(ce.ENABLE_CALLBACK&&ce.emitter.emit("log","debug",K),!ce.ENABLE_DEBUG)return;console.debug?console.debug(K):console.log(K)}},{key:"v",value:function(I,W){(!I||ce.FORCE_GLOBAL_TAG)&&(I=ce.GLOBAL_TAG);var K="[".concat(I,"] > ").concat(W);if(ce.ENABLE_CALLBACK&&ce.emitter.emit("log","verbose",K),!ce.ENABLE_VERBOSE)return;console.log(K)}}]),ce}();A.GLOBAL_TAG="flv.js",A.FORCE_GLOBAL_TAG=!1,A.ENABLE_ERROR=!0,A.ENABLE_INFO=!0,A.ENABLE_WARN=!0,A.ENABLE_DEBUG=!0,A.ENABLE_VERBOSE=!0,A.ENABLE_CALLBACK=!1,A.emitter=new E.a;var w=A,v=function(){function ce(){Object(Se.a)(this,ce),this._firstCheckpoint=0,this._lastCheckpoint=0,this._intervalBytes=0,this._totalBytes=0,this._lastSecondBytes=0,self.performance&&self.performance.now?this._now=self.performance.now.bind(self.performance):this._now=Date.now}return Object(Z.a)(ce,[{key:"reset",value:function(){this._firstCheckpoint=this._lastCheckpoint=0,this._totalBytes=this._intervalBytes=0,this._lastSecondBytes=0}},{key:"addBytes",value:function(I){this._firstCheckpoint===0?(this._firstCheckpoint=this._now(),this._lastCheckpoint=this._firstCheckpoint,this._intervalBytes+=I,this._totalBytes+=I):this._now()-this._lastCheckpoint<1e3?(this._intervalBytes+=I,this._totalBytes+=I):(this._lastSecondBytes=this._intervalBytes,this._intervalBytes=I,this._totalBytes+=I,this._lastCheckpoint=this._now())}},{key:"currentKBps",get:function(){this.addBytes(0);var I=(this._now()-this._lastCheckpoint)/1e3;return I==0&&(I=1),this._intervalBytes/I/1024}},{key:"lastSecondKBps",get:function(){return this.addBytes(0),this._lastSecondBytes!==0?this._lastSecondBytes/1024:this._now()-this._lastCheckpoint>=500?this.currentKBps:0}},{key:"averageKBps",get:function(){var I=(this._now()-this._firstCheckpoint)/1e3;return this._totalBytes/I/1024}}]),ce}(),u=v,f=ye("yKVA"),o=ye("879j"),t=function(){function ce(te){Object(Se.a)(this,ce),this._message=te}return Object(Z.a)(ce,[{key:"name",get:function(){return"RuntimeException"}},{key:"message",get:function(){return this._message}},{key:"toString",value:function(){return this.name+": "+this.message}}]),ce}(),i=function(ce){Object(f.a)(I,ce);var te=Object(o.a)(I);function I(W){return Object(Se.a)(this,I),te.call(this,W)}return Object(Z.a)(I,[{key:"name",get:function(){return"IllegalStateException"}}]),I}(t),s=function(ce){Object(f.a)(I,ce);var te=Object(o.a)(I);function I(W){return Object(Se.a)(this,I),te.call(this,W)}return Object(Z.a)(I,[{key:"name",get:function(){return"InvalidArgumentException"}}]),I}(t),h=function(ce){Object(f.a)(I,ce);var te=Object(o.a)(I);function I(W){return Object(Se.a)(this,I),te.call(this,W)}return Object(Z.a)(I,[{key:"name",get:function(){return"NotImplementedException"}}]),I}(t),a={kIdle:0,kConnecting:1,kBuffering:2,kError:3,kComplete:4},e={OK:"OK",EXCEPTION:"Exception",HTTP_STATUS_CODE_INVALID:"HttpStatusCodeInvalid",CONNECTING_TIMEOUT:"ConnectingTimeout",EARLY_EOF:"EarlyEof",UNRECOVERABLE_EARLY_EOF:"UnrecoverableEarlyEof"},l=function(){function ce(te){Object(Se.a)(this,ce),this._type=te||"undefined",this._status=a.kIdle,this._needStash=!1,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}return Object(Z.a)(ce,[{key:"destroy",value:function(){this._status=a.kIdle,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}},{key:"isWorking",value:function(){return this._status===a.kConnecting||this._status===a.kBuffering}},{key:"type",get:function(){return this._type}},{key:"status",get:function(){return this._status}},{key:"needStashBuffer",get:function(){return this._needStash}},{key:"onContentLengthKnown",get:function(){return this._onContentLengthKnown},set:function(I){this._onContentLengthKnown=I}},{key:"onURLRedirect",get:function(){return this._onURLRedirect},set:function(I){this._onURLRedirect=I}},{key:"onDataArrival",get:function(){return this._onDataArrival},set:function(I){this._onDataArrival=I}},{key:"onError",get:function(){return this._onError},set:function(I){this._onError=I}},{key:"onComplete",get:function(){return this._onComplete},set:function(I){this._onComplete=I}},{key:"open",value:function(I,W){throw new h("Unimplemented abstract function!")}},{key:"abort",value:function(){throw new h("Unimplemented abstract function!")}}]),ce}(),n=ye("oZsa");function d(ce,te){for(;!Object.prototype.hasOwnProperty.call(ce,te)&&!(ce=Object(n.a)(ce),ce===null););return ce}function c(ce,te,I){return typeof Reflect!="undefined"&&Reflect.get?c=Reflect.get:c=function(K,Y,le){var Ae=d(K,Y);if(!Ae)return;var Ce=Object.getOwnPropertyDescriptor(Ae,Y);return Ce.get?Ce.get.call(le):Ce.value},c(ce,te,I||ce)}var g={};function p(){var ce=self.navigator.userAgent.toLowerCase(),te=/(edge)\/([\w.]+)/.exec(ce)||/(opr)[\/]([\w.]+)/.exec(ce)||/(chrome)[ \/]([\w.]+)/.exec(ce)||/(iemobile)[\/]([\w.]+)/.exec(ce)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(ce)||/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(ce)||/(webkit)[ \/]([\w.]+)/.exec(ce)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ce)||/(msie) ([\w.]+)/.exec(ce)||ce.indexOf("trident")>=0&&/(rv)(?::| )([\w.]+)/.exec(ce)||ce.indexOf("compatible")<0&&/(firefox)[ \/]([\w.]+)/.exec(ce)||[],I=/(ipad)/.exec(ce)||/(ipod)/.exec(ce)||/(windows phone)/.exec(ce)||/(iphone)/.exec(ce)||/(kindle)/.exec(ce)||/(android)/.exec(ce)||/(windows)/.exec(ce)||/(mac)/.exec(ce)||/(linux)/.exec(ce)||/(cros)/.exec(ce)||[],W={browser:te[5]||te[3]||te[1]||"",version:te[2]||te[4]||"0",majorVersion:te[4]||te[2]||"0",platform:I[0]||""},K={};if(W.browser){K[W.browser]=!0;var Y=W.majorVersion.split(".");K.version={major:parseInt(W.majorVersion,10),string:W.version},Y.length>1&&(K.version.minor=parseInt(Y[1],10)),Y.length>2&&(K.version.build=parseInt(Y[2],10))}if(W.platform&&(K[W.platform]=!0),(K.chrome||K.opr||K.safari)&&(K.webkit=!0),K.rv||K.iemobile){K.rv&&delete K.rv;var le="msie";W.browser=le,K[le]=!0}if(K.edge){delete K.edge;var Ae="msedge";W.browser=Ae,K[Ae]=!0}if(K.opr){var Ce="opera";W.browser=Ce,K[Ce]=!0}if(K.safari&&K.android){var Fe="android";W.browser=Fe,K[Fe]=!0}K.name=W.browser,K.platform=W.platform;for(var We in g)g.hasOwnProperty(We)&&delete g[We];Object.assign(g,K)}p();var m=g,b=function(ce){Object(f.a)(I,ce);var te=Object(o.a)(I);function I(W,K){var Y;return Object(Se.a)(this,I),Y=te.call(this,"fetch-stream-loader"),Y.TAG="FetchStreamLoader",Y._seekHandler=W,Y._config=K,Y._needStash=!0,Y._requestAbort=!1,Y._contentLength=null,Y._receivedLength=0,Y}return Object(Z.a)(I,[{key:"destroy",value:function(){this.isWorking()&&this.abort(),c(Object(n.a)(I.prototype),"destroy",this).call(this)}},{key:"open",value:function(K,Y){var le=this;this._dataSource=K,this._range=Y;var Ae=K.url;this._config.reuseRedirectedURL&&K.redirectedURL!=null&&(Ae=K.redirectedURL);var Ce=this._seekHandler.getConfig(Ae,Y),Fe=new self.Headers;if(typeof Ce.headers=="object"){var We=Ce.headers;for(var Be in We)We.hasOwnProperty(Be)&&Fe.append(Be,We[Be])}var Ye={method:"GET",headers:Fe,mode:"cors",cache:"default",referrerPolicy:"no-referrer-when-downgrade"};if(typeof this._config.headers=="object")for(var ze in this._config.headers)Fe.append(ze,this._config.headers[ze]);K.cors===!1&&(Ye.mode="same-origin"),K.withCredentials&&(Ye.credentials="include"),K.referrerPolicy&&(Ye.referrerPolicy=K.referrerPolicy),this._status=a.kConnecting,self.fetch(Ce.url,Ye).then(function(Ue){if(le._requestAbort){le._requestAbort=!1,le._status=a.kIdle;return}if(Ue.ok&&Ue.status>=200&&Ue.status<=299){if(Ue.url!==Ce.url&&le._onURLRedirect){var qe=le._seekHandler.removeURLParameters(Ue.url);le._onURLRedirect(qe)}var Xe=Ue.headers.get("Content-Length");return Xe!=null&&(le._contentLength=parseInt(Xe),le._contentLength!==0&&(le._onContentLengthKnown&&le._onContentLengthKnown(le._contentLength))),le._pump.call(le,Ue.body.getReader())}else if(le._status=a.kError,le._onError)le._onError(e.HTTP_STATUS_CODE_INVALID,{code:Ue.status,msg:Ue.statusText});else throw new t("FetchStreamLoader: Http code invalid, "+Ue.status+" "+Ue.statusText)}).catch(function(Ue){if(le._status=a.kError,le._onError)le._onError(e.EXCEPTION,{code:-1,msg:Ue.message});else throw Ue})}},{key:"abort",value:function(){this._requestAbort=!0}},{key:"_pump",value:function(K){var Y=this;return K.read().then(function(le){if(le.done)if(Y._contentLength!==null&&Y._receivedLength<Y._contentLength){Y._status=a.kError;var Ae=e.EARLY_EOF,Ce={code:-1,msg:"Fetch stream meet Early-EOF"};if(Y._onError)Y._onError(Ae,Ce);else throw new t(Ce.msg)}else Y._status=a.kComplete,Y._onComplete&&Y._onComplete(Y._range.from,Y._range.from+Y._receivedLength-1);else{if(Y._requestAbort===!0)return Y._requestAbort=!1,Y._status=a.kComplete,K.cancel();Y._status=a.kBuffering;var Fe=le.value.buffer,We=Y._range.from+Y._receivedLength;Y._receivedLength+=Fe.byteLength,Y._onDataArrival&&Y._onDataArrival(Fe,We,Y._receivedLength),Y._pump(K)}}).catch(function(le){if(le.code===11&&m.msedge)return;Y._status=a.kError;var Ae=0,Ce=null;if((le.code===19||le.message==="network error")&&(Y._contentLength===null||Y._contentLength!==null&&Y._receivedLength<Y._contentLength)?(Ae=e.EARLY_EOF,Ce={code:le.code,msg:"Fetch stream meet Early-EOF"}):(Ae=e.EXCEPTION,Ce={code:le.code,msg:le.message}),Y._onError)Y._onError(Ae,Ce);else throw new t(Ce.msg)})}}],[{key:"isSupported",value:function(){try{var K=m.msedge&&m.version.minor>=15048,Y=m.msedge?K:!0;return self.fetch&&self.ReadableStream&&Y}catch(le){return!1}}}]),I}(l),y=b,r=function(ce){Object(f.a)(I,ce);var te=Object(o.a)(I);function I(W,K){var Y;return Object(Se.a)(this,I),Y=te.call(this,"xhr-moz-chunked-loader"),Y.TAG="MozChunkedLoader",Y._seekHandler=W,Y._config=K,Y._needStash=!0,Y._xhr=null,Y._requestAbort=!1,Y._contentLength=null,Y._receivedLength=0,Y}return Object(Z.a)(I,[{key:"destroy",value:function(){this.isWorking()&&this.abort(),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onloadend=null,this._xhr.onerror=null,this._xhr=null),c(Object(n.a)(I.prototype),"destroy",this).call(this)}},{key:"open",value:function(K,Y){this._dataSource=K,this._range=Y;var le=K.url;this._config.reuseRedirectedURL&&K.redirectedURL!=null&&(le=K.redirectedURL);var Ae=this._seekHandler.getConfig(le,Y);this._requestURL=Ae.url;var Ce=this._xhr=new XMLHttpRequest;if(Ce.open("GET",Ae.url,!0),Ce.responseType="moz-chunked-arraybuffer",Ce.onreadystatechange=this._onReadyStateChange.bind(this),Ce.onprogress=this._onProgress.bind(this),Ce.onloadend=this._onLoadEnd.bind(this),Ce.onerror=this._onXhrError.bind(this),K.withCredentials&&(Ce.withCredentials=!0),typeof Ae.headers=="object"){var Fe=Ae.headers;for(var We in Fe)Fe.hasOwnProperty(We)&&Ce.setRequestHeader(We,Fe[We])}if(typeof this._config.headers=="object"){var Be=this._config.headers;for(var Ye in Be)Be.hasOwnProperty(Ye)&&Ce.setRequestHeader(Ye,Be[Ye])}this._status=a.kConnecting,Ce.send()}},{key:"abort",value:function(){this._requestAbort=!0,this._xhr&&this._xhr.abort(),this._status=a.kComplete}},{key:"_onReadyStateChange",value:function(K){var Y=K.target;if(Y.readyState===2){if(Y.responseURL!=null&&Y.responseURL!==this._requestURL&&this._onURLRedirect){var le=this._seekHandler.removeURLParameters(Y.responseURL);this._onURLRedirect(le)}if(Y.status!==0&&(Y.status<200||Y.status>299))if(this._status=a.kError,this._onError)this._onError(e.HTTP_STATUS_CODE_INVALID,{code:Y.status,msg:Y.statusText});else throw new t("MozChunkedLoader: Http code invalid, "+Y.status+" "+Y.statusText);else this._status=a.kBuffering}}},{key:"_onProgress",value:function(K){if(this._status===a.kError)return;this._contentLength===null&&(K.total!==null&&K.total!==0&&(this._contentLength=K.total,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)));var Y=K.target.response,le=this._range.from+this._receivedLength;this._receivedLength+=Y.byteLength,this._onDataArrival&&this._onDataArrival(Y,le,this._receivedLength)}},{key:"_onLoadEnd",value:function(K){if(this._requestAbort===!0){this._requestAbort=!1;return}else if(this._status===a.kError)return;this._status=a.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1)}},{key:"_onXhrError",value:function(K){this._status=a.kError;var Y=0,le=null;if(this._contentLength&&K.loaded<this._contentLength?(Y=e.EARLY_EOF,le={code:-1,msg:"Moz-Chunked stream meet Early-Eof"}):(Y=e.EXCEPTION,le={code:-1,msg:K.constructor.name+" "+K.type}),this._onError)this._onError(Y,le);else throw new t(le.msg)}}],[{key:"isSupported",value:function(){try{var K=new XMLHttpRequest;return K.open("GET","https://example.com",!0),K.responseType="moz-chunked-arraybuffer",K.responseType==="moz-chunked-arraybuffer"}catch(Y){return w.w("MozChunkedLoader",Y.message),!1}}}]),I}(l),x=r,S=function(ce){Object(f.a)(I,ce);var te=Object(o.a)(I);function I(W,K){var Y;return Object(Se.a)(this,I),Y=te.call(this,"xhr-msstream-loader"),Y.TAG="MSStreamLoader",Y._seekHandler=W,Y._config=K,Y._needStash=!0,Y._xhr=null,Y._reader=null,Y._totalRange=null,Y._currentRange=null,Y._currentRequestURL=null,Y._currentRedirectedURL=null,Y._contentLength=null,Y._receivedLength=0,Y._bufferLimit=16*1024*1024,Y._lastTimeBufferSize=0,Y._isReconnecting=!1,Y}return Object(Z.a)(I,[{key:"destroy",value:function(){this.isWorking()&&this.abort(),this._reader&&(this._reader.onprogress=null,this._reader.onload=null,this._reader.onerror=null,this._reader=null),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr=null),c(Object(n.a)(I.prototype),"destroy",this).call(this)}},{key:"open",value:function(K,Y){this._internalOpen(K,Y,!1)}},{key:"_internalOpen",value:function(K,Y,le){this._dataSource=K,le?this._currentRange=Y:this._totalRange=Y;var Ae=K.url;this._config.reuseRedirectedURL&&(this._currentRedirectedURL!=null?Ae=this._currentRedirectedURL:K.redirectedURL!=null&&(Ae=K.redirectedURL));var Ce=this._seekHandler.getConfig(Ae,Y);this._currentRequestURL=Ce.url;var Fe=this._reader=new self.MSStreamReader;Fe.onprogress=this._msrOnProgress.bind(this),Fe.onload=this._msrOnLoad.bind(this),Fe.onerror=this._msrOnError.bind(this);var We=this._xhr=new XMLHttpRequest;if(We.open("GET",Ce.url,!0),We.responseType="ms-stream",We.onreadystatechange=this._xhrOnReadyStateChange.bind(this),We.onerror=this._xhrOnError.bind(this),K.withCredentials&&(We.withCredentials=!0),typeof Ce.headers=="object"){var Be=Ce.headers;for(var Ye in Be)Be.hasOwnProperty(Ye)&&We.setRequestHeader(Ye,Be[Ye])}if(typeof this._config.headers=="object"){var ze=this._config.headers;for(var Ue in ze)ze.hasOwnProperty(Ue)&&We.setRequestHeader(Ue,ze[Ue])}this._isReconnecting?this._isReconnecting=!1:this._status=a.kConnecting,We.send()}},{key:"abort",value:function(){this._internalAbort(),this._status=a.kComplete}},{key:"_internalAbort",value:function(){this._reader&&(this._reader.readyState===1&&this._reader.abort(),this._reader.onprogress=null,this._reader.onload=null,this._reader.onerror=null,this._reader=null),this._xhr&&(this._xhr.abort(),this._xhr.onreadystatechange=null,this._xhr=null)}},{key:"_xhrOnReadyStateChange",value:function(K){var Y=K.target;if(Y.readyState===2)if(Y.status>=200&&Y.status<=299){if(this._status=a.kBuffering,Y.responseURL!=null){var le=this._seekHandler.removeURLParameters(Y.responseURL);Y.responseURL!==this._currentRequestURL&&le!==this._currentRedirectedURL&&(this._currentRedirectedURL=le,this._onURLRedirect&&this._onURLRedirect(le))}var Ae=Y.getResponseHeader("Content-Length");if(Ae!=null&&this._contentLength==null){var Ce=parseInt(Ae);Ce>0&&(this._contentLength=Ce,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength))}}else if(this._status=a.kError,this._onError)this._onError(e.HTTP_STATUS_CODE_INVALID,{code:Y.status,msg:Y.statusText});else throw new t("MSStreamLoader: Http code invalid, "+Y.status+" "+Y.statusText);else if(Y.readyState===3&&(Y.status>=200&&Y.status<=299)){this._status=a.kBuffering;var Fe=Y.response;this._reader.readAsArrayBuffer(Fe)}}},{key:"_xhrOnError",value:function(K){this._status=a.kError;var Y=e.EXCEPTION,le={code:-1,msg:K.constructor.name+" "+K.type};if(this._onError)this._onError(Y,le);else throw new t(le.msg)}},{key:"_msrOnProgress",value:function(K){var Y=K.target,le=Y.result;if(le==null){this._doReconnectIfNeeded();return}var Ae=le.slice(this._lastTimeBufferSize);this._lastTimeBufferSize=le.byteLength;var Ce=this._totalRange.from+this._receivedLength;this._receivedLength+=Ae.byteLength,this._onDataArrival&&this._onDataArrival(Ae,Ce,this._receivedLength),le.byteLength>=this._bufferLimit&&(w.v(this.TAG,"MSStream buffer exceeded max size near ".concat(Ce+Ae.byteLength,", reconnecting...")),this._doReconnectIfNeeded())}},{key:"_doReconnectIfNeeded",value:function(){if(this._contentLength==null||this._receivedLength<this._contentLength){this._isReconnecting=!0,this._lastTimeBufferSize=0,this._internalAbort();var K={from:this._totalRange.from+this._receivedLength,to:-1};this._internalOpen(this._dataSource,K,!0)}}},{key:"_msrOnLoad",value:function(K){this._status=a.kComplete,this._onComplete&&this._onComplete(this._totalRange.from,this._totalRange.from+this._receivedLength-1)}},{key:"_msrOnError",value:function(K){this._status=a.kError;var Y=0,le=null;if(this._contentLength&&this._receivedLength<this._contentLength?(Y=e.EARLY_EOF,le={code:-1,msg:"MSStream meet Early-Eof"}):(Y=e.EARLY_EOF,le={code:-1,msg:K.constructor.name+" "+K.type}),this._onError)this._onError(Y,le);else throw new t(le.msg)}}],[{key:"isSupported",value:function(){try{if(typeof self.MSStream=="undefined"||typeof self.MSStreamReader=="undefined")return!1;var K=new XMLHttpRequest;return K.open("GET","https://example.com",!0),K.responseType="ms-stream",K.responseType==="ms-stream"}catch(Y){return w.w("MSStreamLoader",Y.message),!1}}}]),I}(l),T=S,R=function(ce){Object(f.a)(I,ce);var te=Object(o.a)(I);function I(W,K){var Y;return Object(Se.a)(this,I),Y=te.call(this,"xhr-range-loader"),Y.TAG="RangeLoader",Y._seekHandler=W,Y._config=K,Y._needStash=!1,Y._chunkSizeKBList=[128,256,384,512,768,1024,1536,2048,3072,4096,5120,6144,7168,8192],Y._currentChunkSizeKB=384,Y._currentSpeedNormalized=0,Y._zeroSpeedChunkCount=0,Y._xhr=null,Y._speedSampler=new u,Y._requestAbort=!1,Y._waitForTotalLength=!1,Y._totalLengthReceived=!1,Y._currentRequestURL=null,Y._currentRedirectedURL=null,Y._currentRequestRange=null,Y._totalLength=null,Y._contentLength=null,Y._receivedLength=0,Y._lastTimeLoaded=0,Y}return Object(Z.a)(I,[{key:"destroy",value:function(){this.isWorking()&&this.abort(),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr=null),c(Object(n.a)(I.prototype),"destroy",this).call(this)}},{key:"currentSpeed",get:function(){return this._speedSampler.lastSecondKBps}},{key:"open",value:function(K,Y){this._dataSource=K,this._range=Y,this._status=a.kConnecting;var le=!1;this._dataSource.filesize!=null&&this._dataSource.filesize!==0&&(le=!0,this._totalLength=this._dataSource.filesize),!this._totalLengthReceived&&!le?(this._waitForTotalLength=!0,this._internalOpen(this._dataSource,{from:0,to:-1})):this._openSubRange()}},{key:"_openSubRange",value:function(){var K=this._currentChunkSizeKB*1024,Y=this._range.from+this._receivedLength,le=Y+K;this._contentLength!=null&&(le-this._range.from>=this._contentLength&&(le=this._range.from+this._contentLength-1)),this._currentRequestRange={from:Y,to:le},this._internalOpen(this._dataSource,this._currentRequestRange)}},{key:"_internalOpen",value:function(K,Y){this._lastTimeLoaded=0;var le=K.url;this._config.reuseRedirectedURL&&(this._currentRedirectedURL!=null?le=this._currentRedirectedURL:K.redirectedURL!=null&&(le=K.redirectedURL));var Ae=this._seekHandler.getConfig(le,Y);this._currentRequestURL=Ae.url;var Ce=this._xhr=new XMLHttpRequest;if(Ce.open("GET",Ae.url,!0),Ce.responseType="arraybuffer",Ce.onreadystatechange=this._onReadyStateChange.bind(this),Ce.onprogress=this._onProgress.bind(this),Ce.onload=this._onLoad.bind(this),Ce.onerror=this._onXhrError.bind(this),K.withCredentials&&(Ce.withCredentials=!0),typeof Ae.headers=="object"){var Fe=Ae.headers;for(var We in Fe)Fe.hasOwnProperty(We)&&Ce.setRequestHeader(We,Fe[We])}if(typeof this._config.headers=="object"){var Be=this._config.headers;for(var Ye in Be)Be.hasOwnProperty(Ye)&&Ce.setRequestHeader(Ye,Be[Ye])}Ce.send()}},{key:"abort",value:function(){this._requestAbort=!0,this._internalAbort(),this._status=a.kComplete}},{key:"_internalAbort",value:function(){this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr.abort(),this._xhr=null)}},{key:"_onReadyStateChange",value:function(K){var Y=K.target;if(Y.readyState===2){if(Y.responseURL!=null){var le=this._seekHandler.removeURLParameters(Y.responseURL);Y.responseURL!==this._currentRequestURL&&le!==this._currentRedirectedURL&&(this._currentRedirectedURL=le,this._onURLRedirect&&this._onURLRedirect(le))}if(Y.status>=200&&Y.status<=299){if(this._waitForTotalLength)return;this._status=a.kBuffering}else if(this._status=a.kError,this._onError)this._onError(e.HTTP_STATUS_CODE_INVALID,{code:Y.status,msg:Y.statusText});else throw new t("RangeLoader: Http code invalid, "+Y.status+" "+Y.statusText)}}},{key:"_onProgress",value:function(K){if(this._status===a.kError)return;if(this._contentLength===null){var Y=!1;if(this._waitForTotalLength){this._waitForTotalLength=!1,this._totalLengthReceived=!0,Y=!0;var le=K.total;this._internalAbort(),le!=null&le!==0&&(this._totalLength=le)}if(this._range.to===-1?this._contentLength=this._totalLength-this._range.from:this._contentLength=this._range.to-this._range.from+1,Y){this._openSubRange();return}this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)}var Ae=K.loaded-this._lastTimeLoaded;this._lastTimeLoaded=K.loaded,this._speedSampler.addBytes(Ae)}},{key:"_normalizeSpeed",value:function(K){var Y=this._chunkSizeKBList,le=Y.length-1,Ae=0,Ce=0,Fe=le;if(K<Y[0])return Y[0];for(;Ce<=Fe;){if(Ae=Ce+Math.floor((Fe-Ce)/2),Ae===le||K>=Y[Ae]&&K<Y[Ae+1])return Y[Ae];Y[Ae]<K?Ce=Ae+1:Fe=Ae-1}}},{key:"_onLoad",value:function(K){if(this._status===a.kError)return;if(this._waitForTotalLength){this._waitForTotalLength=!1;return}this._lastTimeLoaded=0;var Y=this._speedSampler.lastSecondKBps;if(Y===0&&(this._zeroSpeedChunkCount++,this._zeroSpeedChunkCount>=3&&(Y=this._speedSampler.currentKBps)),Y!==0){var le=this._normalizeSpeed(Y);this._currentSpeedNormalized!==le&&(this._currentSpeedNormalized=le,this._currentChunkSizeKB=le)}var Ae=K.target.response,Ce=this._range.from+this._receivedLength;this._receivedLength+=Ae.byteLength;var Fe=!1;this._contentLength!=null&&this._receivedLength<this._contentLength?this._openSubRange():Fe=!0,this._onDataArrival&&this._onDataArrival(Ae,Ce,this._receivedLength),Fe&&(this._status=a.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1))}},{key:"_onXhrError",value:function(K){this._status=a.kError;var Y=0,le=null;if(this._contentLength&&this._receivedLength>0&&this._receivedLength<this._contentLength?(Y=e.EARLY_EOF,le={code:-1,msg:"RangeLoader meet Early-Eof"}):(Y=e.EXCEPTION,le={code:-1,msg:K.constructor.name+" "+K.type}),this._onError)this._onError(Y,le);else throw new t(le.msg)}}],[{key:"isSupported",value:function(){try{var K=new XMLHttpRequest;return K.open("GET","https://example.com",!0),K.responseType="arraybuffer",K.responseType==="arraybuffer"}catch(Y){return w.w("RangeLoader",Y.message),!1}}}]),I}(l),D=R,k=function(ce){Object(f.a)(I,ce);var te=Object(o.a)(I);function I(){var W;return Object(Se.a)(this,I),W=te.call(this,"websocket-loader"),W.TAG="WebSocketLoader",W._needStash=!0,W._ws=null,W._requestAbort=!1,W._receivedLength=0,W}return Object(Z.a)(I,[{key:"destroy",value:function(){this._ws&&this.abort(),c(Object(n.a)(I.prototype),"destroy",this).call(this)}},{key:"open",value:function(K){try{var Y=this._ws=new self.WebSocket(K.url);Y.binaryType="arraybuffer",Y.onopen=this._onWebSocketOpen.bind(this),Y.onclose=this._onWebSocketClose.bind(this),Y.onmessage=this._onWebSocketMessage.bind(this),Y.onerror=this._onWebSocketError.bind(this),this._status=a.kConnecting}catch(Ae){this._status=a.kError;var le={code:Ae.code,msg:Ae.message};if(this._onError)this._onError(e.EXCEPTION,le);else throw new t(le.msg)}}},{key:"abort",value:function(){var K=this._ws;K&&(K.readyState===0||K.readyState===1)&&(this._requestAbort=!0,K.close()),this._ws=null,this._status=a.kComplete}},{key:"_onWebSocketOpen",value:function(K){this._status=a.kBuffering}},{key:"_onWebSocketClose",value:function(K){if(this._requestAbort===!0){this._requestAbort=!1;return}this._status=a.kComplete,this._onComplete&&this._onComplete(0,this._receivedLength-1)}},{key:"_onWebSocketMessage",value:function(K){var Y=this;if(K.data instanceof ArrayBuffer)this._dispatchArrayBuffer(K.data);else if(K.data instanceof Blob){var le=new FileReader;le.onload=function(){Y._dispatchArrayBuffer(le.result)},le.readAsArrayBuffer(K.data)}else{this._status=a.kError;var Ae={code:-1,msg:"Unsupported WebSocket message type: "+K.data.constructor.name};if(this._onError)this._onError(e.EXCEPTION,Ae);else throw new t(Ae.msg)}}},{key:"_dispatchArrayBuffer",value:function(K){var Y=K,le=this._receivedLength;this._receivedLength+=Y.byteLength,this._onDataArrival&&this._onDataArrival(Y,le,this._receivedLength)}},{key:"_onWebSocketError",value:function(K){this._status=a.kError;var Y={code:K.code,msg:K.message};if(this._onError)this._onError(e.EXCEPTION,Y);else throw new t(Y.msg)}}],[{key:"isSupported",value:function(){try{return typeof self.WebSocket!="undefined"}catch(K){return!1}}}]),I}(l),B=k,G=function(){function ce(te){Object(Se.a)(this,ce),this._zeroStart=te||!1}return Object(Z.a)(ce,[{key:"getConfig",value:function(I,W){var K={};if(W.from!==0||W.to!==-1){var Y;W.to!==-1?Y="bytes=".concat(W.from.toString(),"-").concat(W.to.toString()):Y="bytes=".concat(W.from.toString(),"-"),K.Range=Y}else this._zeroStart&&(K.Range="bytes=0-");return{url:I,headers:K}}},{key:"removeURLParameters",value:function(I){return I}}]),ce}(),P=G,$=function(){function ce(te,I){Object(Se.a)(this,ce),this._startName=te,this._endName=I}return Object(Z.a)(ce,[{key:"getConfig",value:function(I,W){var K=I;if(W.from!==0||W.to!==-1){var Y=!0;K.indexOf("?")===-1&&(K+="?",Y=!1),Y&&(K+="&"),K+="".concat(this._startName,"=").concat(W.from.toString()),W.to!==-1&&(K+="&".concat(this._endName,"=").concat(W.to.toString()))}return{url:K,headers:{}}}},{key:"removeURLParameters",value:function(I){var W=I.split("?")[0],K=void 0,Y=I.indexOf("?");Y!==-1&&(K=I.substring(Y+1));var le="";if(K!=null&&K.length>0)for(var Ae=K.split("&"),Ce=0;Ce<Ae.length;Ce++){var Fe=Ae[Ce].split("="),We=Ce>0;Fe[0]!==this._startName&&Fe[0]!==this._endName&&(We&&(le+="&"),le+=Ae[Ce])}return le.length===0?W:W+"?"+le}}]),ce}(),X=$,z=function(){function ce(te,I,W){Object(Se.a)(this,ce),this.TAG="IOController",this._config=I,this._extraData=W,this._stashInitialSize=1024*384,I.stashInitialSize!=null&&I.stashInitialSize>0&&(this._stashInitialSize=I.stashInitialSize),this._stashUsed=0,this._stashSize=this._stashInitialSize,this._bufferSize=1024*1024*3,this._stashBuffer=new ArrayBuffer(this._bufferSize),this._stashByteStart=0,this._enableStash=!0,I.enableStashBuffer===!1&&(this._enableStash=!1),this._loader=null,this._loaderClass=null,this._seekHandler=null,this._dataSource=te,this._isWebSocketURL=/wss?:\/\/(.+?)/.test(te.url),this._refTotalLength=te.filesize?te.filesize:null,this._totalLength=this._refTotalLength,this._fullRequestFlag=!1,this._currentRange=null,this._redirectedURL=null,this._speedNormalized=0,this._speedSampler=new u,this._speedNormalizeList=[64,128,256,384,512,768,1024,1536,2048,3072,4096],this._isEarlyEofReconnecting=!1,this._paused=!1,this._resumeFrom=0,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._selectSeekHandler(),this._selectLoader(),this._createLoader()}return Object(Z.a)(ce,[{key:"destroy",value:function(){this._loader.isWorking()&&this._loader.abort(),this._loader.destroy(),this._loader=null,this._loaderClass=null,this._dataSource=null,this._stashBuffer=null,this._stashUsed=this._stashSize=this._bufferSize=this._stashByteStart=0,this._currentRange=null,this._speedSampler=null,this._isEarlyEofReconnecting=!1,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._extraData=null}},{key:"isWorking",value:function(){return this._loader&&this._loader.isWorking()&&!this._paused}},{key:"isPaused",value:function(){return this._paused}},{key:"status",get:function(){return this._loader.status}},{key:"extraData",get:function(){return this._extraData},set:function(I){this._extraData=I}},{key:"onDataArrival",get:function(){return this._onDataArrival},set:function(I){this._onDataArrival=I}},{key:"onSeeked",get:function(){return this._onSeeked},set:function(I){this._onSeeked=I}},{key:"onError",get:function(){return this._onError},set:function(I){this._onError=I}},{key:"onComplete",get:function(){return this._onComplete},set:function(I){this._onComplete=I}},{key:"onRedirect",get:function(){return this._onRedirect},set:function(I){this._onRedirect=I}},{key:"onRecoveredEarlyEof",get:function(){return this._onRecoveredEarlyEof},set:function(I){this._onRecoveredEarlyEof=I}},{key:"currentURL",get:function(){return this._dataSource.url}},{key:"hasRedirect",get:function(){return this._redirectedURL!=null||this._dataSource.redirectedURL!=null}},{key:"currentRedirectedURL",get:function(){return this._redirectedURL||this._dataSource.redirectedURL}},{key:"currentSpeed",get:function(){return this._loaderClass===D?this._loader.currentSpeed:this._speedSampler.lastSecondKBps}},{key:"loaderType",get:function(){return this._loader.type}},{key:"_selectSeekHandler",value:function(){var I=this._config;if(I.seekType==="range")this._seekHandler=new P(this._config.rangeLoadZeroStart);else if(I.seekType==="param"){var W=I.seekParamStart||"bstart",K=I.seekParamEnd||"bend";this._seekHandler=new X(W,K)}else if(I.seekType==="custom"){if(typeof I.customSeekHandler!="function")throw new s("Custom seekType specified in config but invalid customSeekHandler!");this._seekHandler=new I.customSeekHandler}else throw new s("Invalid seekType in config: ".concat(I.seekType))}},{key:"_selectLoader",value:function(){if(this._config.customLoader!=null)this._loaderClass=this._config.customLoader;else if(this._isWebSocketURL)this._loaderClass=B;else if(y.isSupported())this._loaderClass=y;else if(x.isSupported())this._loaderClass=x;else if(D.isSupported())this._loaderClass=D;else throw new t("Your browser doesn't support xhr with arraybuffer responseType!")}},{key:"_createLoader",value:function(){this._loader=new this._loaderClass(this._seekHandler,this._config),this._loader.needStashBuffer===!1&&(this._enableStash=!1),this._loader.onContentLengthKnown=this._onContentLengthKnown.bind(this),this._loader.onURLRedirect=this._onURLRedirect.bind(this),this._loader.onDataArrival=this._onLoaderChunkArrival.bind(this),this._loader.onComplete=this._onLoaderComplete.bind(this),this._loader.onError=this._onLoaderError.bind(this)}},{key:"open",value:function(I){this._currentRange={from:0,to:-1},I&&(this._currentRange.from=I),this._speedSampler.reset(),I||(this._fullRequestFlag=!0),this._loader.open(this._dataSource,Object.assign({},this._currentRange))}},{key:"abort",value:function(){this._loader.abort(),this._paused&&(this._paused=!1,this._resumeFrom=0)}},{key:"pause",value:function(){this.isWorking()&&(this._loader.abort(),this._stashUsed!==0?(this._resumeFrom=this._stashByteStart,this._currentRange.to=this._stashByteStart-1):this._resumeFrom=this._currentRange.to+1,this._stashUsed=0,this._stashByteStart=0,this._paused=!0)}},{key:"resume",value:function(){if(this._paused){this._paused=!1;var I=this._resumeFrom;this._resumeFrom=0,this._internalSeek(I,!0)}}},{key:"seek",value:function(I){this._paused=!1,this._stashUsed=0,this._stashByteStart=0,this._internalSeek(I,!0)}},{key:"_internalSeek",value:function(I,W){this._loader.isWorking()&&this._loader.abort(),this._flushStashBuffer(W),this._loader.destroy(),this._loader=null;var K={from:I,to:-1};this._currentRange={from:K.from,to:-1},this._speedSampler.reset(),this._stashSize=this._stashInitialSize,this._createLoader(),this._loader.open(this._dataSource,K),this._onSeeked&&this._onSeeked()}},{key:"updateUrl",value:function(I){if(!I||typeof I!="string"||I.length===0)throw new s("Url must be a non-empty string!");this._dataSource.url=I}},{key:"_expandBuffer",value:function(I){for(var W=this._stashSize;W+1024*1024*1<I;)W*=2;if(W+=1024*1024*1,W===this._bufferSize)return;var K=new ArrayBuffer(W);if(this._stashUsed>0){var Y=new Uint8Array(this._stashBuffer,0,this._stashUsed),le=new Uint8Array(K,0,W);le.set(Y,0)}this._stashBuffer=K,this._bufferSize=W}},{key:"_normalizeSpeed",value:function(I){var W=this._speedNormalizeList,K=W.length-1,Y=0,le=0,Ae=K;if(I<W[0])return W[0];for(;le<=Ae;){if(Y=le+Math.floor((Ae-le)/2),Y===K||I>=W[Y]&&I<W[Y+1])return W[Y];W[Y]<I?le=Y+1:Ae=Y-1}}},{key:"_adjustStashSize",value:function(I){var W=0;this._config.isLive||I<512?W=I:I>=512&&I<=1024?W=Math.floor(I*1.5):W=I*2,W>8192&&(W=8192);var K=W*1024+1024*1024*1;this._bufferSize<K&&this._expandBuffer(K),this._stashSize=W*1024}},{key:"_dispatchChunks",value:function(I,W){return this._currentRange.to=W+I.byteLength-1,this._onDataArrival(I,W)}},{key:"_onURLRedirect",value:function(I){this._redirectedURL=I,this._onRedirect&&this._onRedirect(I)}},{key:"_onContentLengthKnown",value:function(I){I&&this._fullRequestFlag&&(this._totalLength=I,this._fullRequestFlag=!1)}},{key:"_onLoaderChunkArrival",value:function(I,W,K){if(!this._onDataArrival)throw new i("IOController: No existing consumer (onDataArrival) callback!");if(this._paused)return;this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,this._onRecoveredEarlyEof&&this._onRecoveredEarlyEof()),this._speedSampler.addBytes(I.byteLength);var Y=this._speedSampler.lastSecondKBps;if(Y!==0){var le=this._normalizeSpeed(Y);this._speedNormalized!==le&&(this._speedNormalized=le,this._adjustStashSize(le))}if(this._enableStash)if(this._stashUsed===0&&this._stashByteStart===0&&(this._stashByteStart=W),this._stashUsed+I.byteLength<=this._stashSize){var ze=new Uint8Array(this._stashBuffer,0,this._stashSize);ze.set(new Uint8Array(I),this._stashUsed),this._stashUsed+=I.byteLength}else{var Ue=new Uint8Array(this._stashBuffer,0,this._bufferSize);if(this._stashUsed>0){var qe=this._stashBuffer.slice(0,this._stashUsed),Xe=this._dispatchChunks(qe,this._stashByteStart);if(Xe<qe.byteLength){if(Xe>0){var He=new Uint8Array(qe,Xe);Ue.set(He,0),this._stashUsed=He.byteLength,this._stashByteStart+=Xe}}else this._stashUsed=0,this._stashByteStart+=Xe;this._stashUsed+I.byteLength>this._bufferSize&&(this._expandBuffer(this._stashUsed+I.byteLength),Ue=new Uint8Array(this._stashBuffer,0,this._bufferSize)),Ue.set(new Uint8Array(I),this._stashUsed),this._stashUsed+=I.byteLength}else{var je=this._dispatchChunks(I,W);if(je<I.byteLength){var rt=I.byteLength-je;rt>this._bufferSize&&(this._expandBuffer(rt),Ue=new Uint8Array(this._stashBuffer,0,this._bufferSize)),Ue.set(new Uint8Array(I,je),0),this._stashUsed+=rt,this._stashByteStart=W+je}}}else if(this._stashUsed===0){var Ae=this._dispatchChunks(I,W);if(Ae<I.byteLength){var Ce=I.byteLength-Ae;Ce>this._bufferSize&&this._expandBuffer(Ce);var Fe=new Uint8Array(this._stashBuffer,0,this._bufferSize);Fe.set(new Uint8Array(I,Ae),0),this._stashUsed+=Ce,this._stashByteStart=W+Ae}}else{this._stashUsed+I.byteLength>this._bufferSize&&this._expandBuffer(this._stashUsed+I.byteLength);var We=new Uint8Array(this._stashBuffer,0,this._bufferSize);We.set(new Uint8Array(I),this._stashUsed),this._stashUsed+=I.byteLength;var Be=this._dispatchChunks(this._stashBuffer.slice(0,this._stashUsed),this._stashByteStart);if(Be<this._stashUsed&&Be>0){var Ye=new Uint8Array(this._stashBuffer,Be);We.set(Ye,0)}this._stashUsed-=Be,this._stashByteStart+=Be}}},{key:"_flushStashBuffer",value:function(I){if(this._stashUsed>0){var W=this._stashBuffer.slice(0,this._stashUsed),K=this._dispatchChunks(W,this._stashByteStart),Y=W.byteLength-K;if(K<W.byteLength)if(I)w.w(this.TAG,"".concat(Y," bytes unconsumed data remain when flush buffer, dropped"));else{if(K>0){var le=new Uint8Array(this._stashBuffer,0,this._bufferSize),Ae=new Uint8Array(W,K);le.set(Ae,0),this._stashUsed=Ae.byteLength,this._stashByteStart+=K}return 0}return this._stashUsed=0,this._stashByteStart=0,Y}return 0}},{key:"_onLoaderComplete",value:function(I,W){this._flushStashBuffer(!0),this._onComplete&&this._onComplete(this._extraData)}},{key:"_onLoaderError",value:function(I,W){w.e(this.TAG,"Loader error, code = ".concat(W.code,", msg = ").concat(W.msg)),this._flushStashBuffer(!1),this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,I=e.UNRECOVERABLE_EARLY_EOF);switch(I){case e.EARLY_EOF:{if(!this._config.isLive&&this._totalLength){var K=this._currentRange.to+1;K<this._totalLength&&(w.w(this.TAG,"Connection lost, trying reconnect..."),this._isEarlyEofReconnecting=!0,this._internalSeek(K,!1));return}I=e.UNRECOVERABLE_EARLY_EOF;break}case e.UNRECOVERABLE_EARLY_EOF:case e.CONNECTING_TIMEOUT:case e.HTTP_STATUS_CODE_INVALID:case e.EXCEPTION:break}if(this._onError)this._onError(I,W);else throw new t("IOException: "+W.msg)}}]),ce}(),N=z,H={enableWorker:!1,enableStashBuffer:!0,stashInitialSize:void 0,isLive:!1,lazyLoad:!0,lazyLoadMaxDuration:3*60,lazyLoadRecoverDuration:30,deferLoadAfterSourceOpen:!0,autoCleanupMaxBackwardDuration:3*60,autoCleanupMinBackwardDuration:2*60,statisticsInfoReportInterval:600,fixAudioTimestampGap:!0,accurateSeek:!1,seekType:"range",seekParamStart:"bstart",seekParamEnd:"bend",rangeLoadZeroStart:!1,customSeekHandler:void 0,reuseRedirectedURL:!1,headers:void 0,customLoader:void 0};function q(){return Object.assign({},H)}var ee=function(){function ce(){Object(Se.a)(this,ce)}return Object(Z.a)(ce,null,[{key:"supportMSEH264Playback",value:function(){return window.MediaSource&&window.MediaSource.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"')}},{key:"supportNetworkStreamIO",value:function(){var I=new N({},q()),W=I.loaderType;return I.destroy(),W=="fetch-stream-loader"||W=="xhr-moz-chunked-loader"}},{key:"getNetworkLoaderTypeName",value:function(){var I=new N({},q()),W=I.loaderType;return I.destroy(),W}},{key:"supportNativeMediaPlayback",value:function(I){ce.videoElement==null&&(ce.videoElement=window.document.createElement("video"));var W=ce.videoElement.canPlayType(I);return W==="probably"||W=="maybe"}},{key:"getFeatureList",value:function(){var I={mseFlvPlayback:!1,mseLiveFlvPlayback:!1,networkStreamIO:!1,networkLoaderName:"",nativeMP4H264Playback:!1,nativeWebmVP8Playback:!1,nativeWebmVP9Playback:!1};return I.mseFlvPlayback=ce.supportMSEH264Playback(),I.networkStreamIO=ce.supportNetworkStreamIO(),I.networkLoaderName=ce.getNetworkLoaderTypeName(),I.mseLiveFlvPlayback=I.mseFlvPlayback&&I.networkStreamIO,I.nativeMP4H264Playback=ce.supportNativeMediaPlayback('video/mp4; codecs="avc1.42001E, mp4a.40.2"'),I.nativeWebmVP8Playback=ce.supportNativeMediaPlayback('video/webm; codecs="vp8.0, vorbis"'),I.nativeWebmVP9Playback=ce.supportNativeMediaPlayback('video/webm; codecs="vp9"'),I}}]),ce}(),fe=ee,oe={ERROR:"error",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",METADATA_ARRIVED:"metadata_arrived",SCRIPTDATA_ARRIVED:"scriptdata_arrived",STATISTICS_INFO:"statistics_info"},he=oe,se=function(){function ce(){Object(Se.a)(this,ce)}return Object(Z.a)(ce,null,[{key:"forceGlobalTag",get:function(){return w.FORCE_GLOBAL_TAG},set:function(I){w.FORCE_GLOBAL_TAG=I,ce._notifyChange()}},{key:"globalTag",get:function(){return w.GLOBAL_TAG},set:function(I){w.GLOBAL_TAG=I,ce._notifyChange()}},{key:"enableAll",get:function(){return w.ENABLE_VERBOSE&&w.ENABLE_DEBUG&&w.ENABLE_INFO&&w.ENABLE_WARN&&w.ENABLE_ERROR},set:function(I){w.ENABLE_VERBOSE=I,w.ENABLE_DEBUG=I,w.ENABLE_INFO=I,w.ENABLE_WARN=I,w.ENABLE_ERROR=I,ce._notifyChange()}},{key:"enableDebug",get:function(){return w.ENABLE_DEBUG},set:function(I){w.ENABLE_DEBUG=I,ce._notifyChange()}},{key:"enableVerbose",get:function(){return w.ENABLE_VERBOSE},set:function(I){w.ENABLE_VERBOSE=I,ce._notifyChange()}},{key:"enableInfo",get:function(){return w.ENABLE_INFO},set:function(I){w.ENABLE_INFO=I,ce._notifyChange()}},{key:"enableWarn",get:function(){return w.ENABLE_WARN},set:function(I){w.ENABLE_WARN=I,ce._notifyChange()}},{key:"enableError",get:function(){return w.ENABLE_ERROR},set:function(I){w.ENABLE_ERROR=I,ce._notifyChange()}},{key:"getConfig",value:function(){return{globalTag:w.GLOBAL_TAG,forceGlobalTag:w.FORCE_GLOBAL_TAG,enableVerbose:w.ENABLE_VERBOSE,enableDebug:w.ENABLE_DEBUG,enableInfo:w.ENABLE_INFO,enableWarn:w.ENABLE_WARN,enableError:w.ENABLE_ERROR,enableCallback:w.ENABLE_CALLBACK}}},{key:"applyConfig",value:function(I){w.GLOBAL_TAG=I.globalTag,w.FORCE_GLOBAL_TAG=I.forceGlobalTag,w.ENABLE_VERBOSE=I.enableVerbose,w.ENABLE_DEBUG=I.enableDebug,w.ENABLE_INFO=I.enableInfo,w.ENABLE_WARN=I.enableWarn,w.ENABLE_ERROR=I.enableError,w.ENABLE_CALLBACK=I.enableCallback}},{key:"_notifyChange",value:function(){var I=ce.emitter;if(I.listenerCount("change")>0){var W=ce.getConfig();I.emit("change",W)}}},{key:"registerListener",value:function(I){ce.emitter.addListener("change",I)}},{key:"removeListener",value:function(I){ce.emitter.removeListener("change",I)}},{key:"addLogListener",value:function(I){w.emitter.addListener("log",I),w.emitter.listenerCount("log")>0&&(w.ENABLE_CALLBACK=!0,ce._notifyChange())}},{key:"removeLogListener",value:function(I){w.emitter.removeListener("log",I),w.emitter.listenerCount("log")===0&&(w.ENABLE_CALLBACK=!1,ce._notifyChange())}}]),ce}();se.emitter=new E.a;var ge=se,ie=function(){function ce(){Object(Se.a)(this,ce),this.mimeType=null,this.duration=null,this.hasAudio=null,this.hasVideo=null,this.audioCodec=null,this.videoCodec=null,this.audioDataRate=null,this.videoDataRate=null,this.audioSampleRate=null,this.audioChannelCount=null,this.width=null,this.height=null,this.fps=null,this.profile=null,this.level=null,this.refFrames=null,this.chromaFormat=null,this.sarNum=null,this.sarDen=null,this.metadata=null,this.segments=null,this.segmentCount=null,this.hasKeyframesIndex=null,this.keyframesIndex=null}return Object(Z.a)(ce,[{key:"isComplete",value:function(){var I=this.hasAudio===!1||this.hasAudio===!0&&this.audioCodec!=null&&this.audioSampleRate!=null&&this.audioChannelCount!=null,W=this.hasVideo===!1||this.hasVideo===!0&&this.videoCodec!=null&&this.width!=null&&this.height!=null&&this.fps!=null&&this.profile!=null&&this.level!=null&&this.refFrames!=null&&this.chromaFormat!=null&&this.sarNum!=null&&this.sarDen!=null;return this.mimeType!=null&&this.duration!=null&&this.metadata!=null&&this.hasKeyframesIndex!=null&&I&&W}},{key:"isSeekable",value:function(){return this.hasKeyframesIndex===!0}},{key:"getNearestKeyframe",value:function(I){if(this.keyframesIndex==null)return null;var W=this.keyframesIndex,K=this._search(W.times,I);return{index:K,milliseconds:W.times[K],fileposition:W.filepositions[K]}}},{key:"_search",value:function(I,W){var K=0,Y=I.length-1,le=0,Ae=0,Ce=Y;for(W<I[0]&&(K=0,Ae=Ce+1);Ae<=Ce;)if(le=Ae+Math.floor((Ce-Ae)/2),le===Y||W>=I[le]&&W<I[le+1]){K=le;break}else I[le]<W?Ae=le+1:Ce=le-1;return K}}]),ce}(),re=ie;function Q(ce,te,I){var W=ce;if(te+I<W.length){for(;I--;)if((W[++te]&192)!==128)return!1;return!0}else return!1}function pe(ce){for(var te=[],I=ce,W=0,K=ce.length;W<K;){if(I[W]<128){te.push(String.fromCharCode(I[W])),++W;continue}else if(!(I[W]<192)){if(I[W]<224){if(Q(I,W,1)){var Y=(I[W]&31)<<6|I[W+1]&63;if(Y>=128){te.push(String.fromCharCode(Y&65535)),W+=2;continue}}}else if(I[W]<240){if(Q(I,W,2)){var le=(I[W]&15)<<12|(I[W+1]&63)<<6|I[W+2]&63;if(le>=2048&&(le&63488)!==55296){te.push(String.fromCharCode(le&65535)),W+=3;continue}}}else if(I[W]<248&&Q(I,W,3)){var Ae=(I[W]&7)<<18|(I[W+1]&63)<<12|(I[W+2]&63)<<6|I[W+3]&63;if(Ae>65536&&Ae<1114112){Ae-=65536,te.push(String.fromCharCode(Ae>>>10|55296)),te.push(String.fromCharCode(Ae&1023|56320)),W+=4;continue}}}te.push(String.fromCharCode(65533)),++W}return te.join("")}var ne=pe,J=function(){var ce=new ArrayBuffer(2);return new DataView(ce).setInt16(0,256,!0),new Int16Array(ce)[0]===256}(),be=function(){function ce(){Object(Se.a)(this,ce)}return Object(Z.a)(ce,null,[{key:"parseScriptData",value:function(I,W,K){var Y={};try{var le=ce.parseValue(I,W,K),Ae=ce.parseValue(I,W+le.size,K-le.size);Y[le.data]=Ae.data}catch(Ce){w.e("AMF",Ce.toString())}return Y}},{key:"parseObject",value:function(I,W,K){if(K<3)throw new i("Data not enough when parse ScriptDataObject");var Y=ce.parseString(I,W,K),le=ce.parseValue(I,W+Y.size,K-Y.size),Ae=le.objectEnd;return{data:{name:Y.data,value:le.data},size:Y.size+le.size,objectEnd:Ae}}},{key:"parseVariable",value:function(I,W,K){return ce.parseObject(I,W,K)}},{key:"parseString",value:function(I,W,K){if(K<2)throw new i("Data not enough when parse String");var Y=new DataView(I,W,K),le=Y.getUint16(0,!J),Ae;return le>0?Ae=ne(new Uint8Array(I,W+2,le)):Ae="",{data:Ae,size:2+le}}},{key:"parseLongString",value:function(I,W,K){if(K<4)throw new i("Data not enough when parse LongString");var Y=new DataView(I,W,K),le=Y.getUint32(0,!J),Ae;return le>0?Ae=ne(new Uint8Array(I,W+4,le)):Ae="",{data:Ae,size:4+le}}},{key:"parseDate",value:function(I,W,K){if(K<10)throw new i("Data size invalid when parse Date");var Y=new DataView(I,W,K),le=Y.getFloat64(0,!J),Ae=Y.getInt16(8,!J);return le+=Ae*60*1e3,{data:new Date(le),size:8+2}}},{key:"parseValue",value:function(I,W,K){if(K<1)throw new i("Data not enough when parse Value");var Y=new DataView(I,W,K),le=1,Ae=Y.getUint8(0),Ce,Fe=!1;try{switch(Ae){case 0:Ce=Y.getFloat64(1,!J),le+=8;break;case 1:{var We=Y.getUint8(1);Ce=!!We,le+=1;break}case 2:{var Be=ce.parseString(I,W+1,K-1);Ce=Be.data,le+=Be.size;break}case 3:{Ce={};var Ye=0;for((Y.getUint32(K-4,!J)&16777215)===9&&(Ye=3);le<K-4;){var ze=ce.parseObject(I,W+le,K-le-Ye);if(ze.objectEnd)break;Ce[ze.data.name]=ze.data.value,le+=ze.size}if(le<=K-3){var Ue=Y.getUint32(le-1,!J)&16777215;Ue===9&&(le+=3)}break}case 8:{Ce={},le+=4;var qe=0;for((Y.getUint32(K-4,!J)&16777215)===9&&(qe=3);le<K-8;){var Xe=ce.parseVariable(I,W+le,K-le-qe);if(Xe.objectEnd)break;Ce[Xe.data.name]=Xe.data.value,le+=Xe.size}if(le<=K-3){var He=Y.getUint32(le-1,!J)&16777215;He===9&&(le+=3)}break}case 9:Ce=void 0,le=1,Fe=!0;break;case 10:{Ce=[];var je=Y.getUint32(1,!J);le+=4;for(var rt=0;rt<je;rt++){var ct=ce.parseValue(I,W+le,K-le);Ce.push(ct.data),le+=ct.size}break}case 11:{var it=ce.parseDate(I,W+1,K-1);Ce=it.data,le+=it.size;break}case 12:{var lt=ce.parseString(I,W+1,K-1);Ce=lt.data,le+=lt.size;break}default:le=K,w.w("AMF","Unsupported AMF value type "+Ae)}}catch(_t){w.e("AMF",_t.toString())}return{data:Ce,size:le,objectEnd:Fe}}}]),ce}(),Ee=be,Le=function(){function ce(te){Object(Se.a)(this,ce),this.TAG="ExpGolomb",this._buffer=te,this._buffer_index=0,this._total_bytes=te.byteLength,this._total_bits=te.byteLength*8,this._current_word=0,this._current_word_bits_left=0}return Object(Z.a)(ce,[{key:"destroy",value:function(){this._buffer=null}},{key:"_fillCurrentWord",value:function(){var I=this._total_bytes-this._buffer_index;if(I<=0)throw new i("ExpGolomb: _fillCurrentWord() but no bytes available");var W=Math.min(4,I),K=new Uint8Array(4);K.set(this._buffer.subarray(this._buffer_index,this._buffer_index+W)),this._current_word=new DataView(K.buffer).getUint32(0,!1),this._buffer_index+=W,this._current_word_bits_left=W*8}},{key:"readBits",value:function(I){if(I>32)throw new s("ExpGolomb: readBits() bits exceeded max 32bits!");if(I<=this._current_word_bits_left){var W=this._current_word>>>32-I;return this._current_word<<=I,this._current_word_bits_left-=I,W}var K=this._current_word_bits_left?this._current_word:0;K=K>>>32-this._current_word_bits_left;var Y=I-this._current_word_bits_left;this._fillCurrentWord();var le=Math.min(Y,this._current_word_bits_left),Ae=this._current_word>>>32-le;return this._current_word<<=le,this._current_word_bits_left-=le,K=K<<le|Ae,K}},{key:"readBool",value:function(){return this.readBits(1)===1}},{key:"readByte",value:function(){return this.readBits(8)}},{key:"_skipLeadingZero",value:function(){var I;for(I=0;I<this._current_word_bits_left;I++)if((this._current_word&2147483648>>>I)!==0)return this._current_word<<=I,this._current_word_bits_left-=I,I;return this._fillCurrentWord(),I+this._skipLeadingZero()}},{key:"readUEG",value:function(){var I=this._skipLeadingZero();return this.readBits(I+1)-1}},{key:"readSEG",value:function(){var I=this.readUEG();return I&1?I+1>>>1:-1*(I>>>1)}}]),ce}(),V=Le,C=function(){function ce(){Object(Se.a)(this,ce)}return Object(Z.a)(ce,null,[{key:"_ebsp2rbsp",value:function(I){for(var W=I,K=W.byteLength,Y=new Uint8Array(K),le=0,Ae=0;Ae<K;Ae++){if(Ae>=2&&(W[Ae]===3&&W[Ae-1]===0&&W[Ae-2]===0))continue;Y[le]=W[Ae],le++}return new Uint8Array(Y.buffer,0,le)}},{key:"parseSPS",value:function(I){var W=ce._ebsp2rbsp(I),K=new V(W);K.readByte();var Y=K.readByte();K.readByte();var le=K.readByte();K.readUEG();var Ae=ce.getProfileString(Y),Ce=ce.getLevelString(le),Fe=1,We=420,Be=[0,420,422,444],Ye=8;if((Y===100||Y===110||Y===122||Y===244||Y===44||Y===83||Y===86||Y===118||Y===128||Y===138||Y===144)&&(Fe=K.readUEG(),Fe===3&&K.readBits(1),Fe<=3&&(We=Be[Fe]),Ye=K.readUEG()+8,K.readUEG(),K.readBits(1),K.readBool()))for(var ze=Fe!==3?8:12,Ue=0;Ue<ze;Ue++)K.readBool()&&(Ue<6?ce._skipScalingList(K,16):ce._skipScalingList(K,64));K.readUEG();var qe=K.readUEG();if(qe===0)K.readUEG();else if(qe===1){K.readBits(1),K.readSEG(),K.readSEG();for(var Xe=K.readUEG(),He=0;He<Xe;He++)K.readSEG()}var je=K.readUEG();K.readBits(1);var rt=K.readUEG(),ct=K.readUEG(),it=K.readBits(1);it===0&&K.readBits(1),K.readBits(1);var lt=0,_t=0,Tt=0,bt=0,St=K.readBool();St&&(lt=K.readUEG(),_t=K.readUEG(),Tt=K.readUEG(),bt=K.readUEG());var Lt=1,Et=1,At=0,It=!0,Pt=0,Ot=0,Ct=K.readBool();if(Ct){if(K.readBool()){var xt=K.readByte(),Kt=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2],Nt=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1];xt>0&&xt<16?(Lt=Kt[xt-1],Et=Nt[xt-1]):xt===255&&(Lt=K.readByte()<<8|K.readByte(),Et=K.readByte()<<8|K.readByte())}if(K.readBool()&&K.readBool(),K.readBool()&&(K.readBits(4),K.readBool()&&K.readBits(24)),K.readBool()&&(K.readUEG(),K.readUEG()),K.readBool()){var wt=K.readBits(32),Rt=K.readBits(32);It=K.readBool(),Pt=Rt,Ot=wt*2,At=Pt/Ot}}var Mt=1;(Lt!==1||Et!==1)&&(Mt=Lt/Et);var Ft=0,Bt=0;if(Fe===0)Ft=1,Bt=2-it;else{var jt=Fe===3?1:2,Gt=Fe===1?2:1;Ft=jt,Bt=Gt*(2-it)}var Ut=(rt+1)*16,Wt=(2-it)*((ct+1)*16);Ut-=(lt+_t)*Ft,Wt-=(Tt+bt)*Bt;var Ht=Math.ceil(Ut*Mt);return K.destroy(),K=null,{profile_string:Ae,level_string:Ce,bit_depth:Ye,ref_frames:je,chroma_format:We,chroma_format_string:ce.getChromaFormatString(We),frame_rate:{fixed:It,fps:At,fps_den:Ot,fps_num:Pt},sar_ratio:{width:Lt,height:Et},codec_size:{width:Ut,height:Wt},present_size:{width:Ht,height:Wt}}}},{key:"_skipScalingList",value:function(I,W){for(var K=8,Y=8,le=0,Ae=0;Ae<W;Ae++)Y!==0&&(le=I.readSEG(),Y=(K+le+256)%256),K=Y===0?K:Y}},{key:"getProfileString",value:function(I){switch(I){case 66:return"Baseline";case 77:return"Main";case 88:return"Extended";case 100:return"High";case 110:return"High10";case 122:return"High422";case 244:return"High444";default:return"Unknown"}}},{key:"getLevelString",value:function(I){return(I/10).toFixed(1)}},{key:"getChromaFormatString",value:function(I){switch(I){case 420:return"4:2:0";case 422:return"4:2:2";case 444:return"4:4:4";default:return"Unknown"}}}]),ce}(),O=C,j={OK:"OK",FORMAT_ERROR:"FormatError",FORMAT_UNSUPPORTED:"FormatUnsupported",CODEC_UNSUPPORTED:"CodecUnsupported"},M=j;function F(ce){return ce>>>8&255|(ce&255)<<8}function ae(ce){return(ce&4278190080)>>>24|(ce&16711680)>>>8|(ce&65280)<<8|(ce&255)<<24}function ve(ce,te){return ce[te]<<24|ce[te+1]<<16|ce[te+2]<<8|ce[te+3]}var Pe=function(){function ce(te,I){Object(Se.a)(this,ce),this.TAG="FLVDemuxer",this._config=I,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null,this._dataOffset=te.dataOffset,this._firstParse=!0,this._dispatch=!1,this._hasAudio=te.hasAudioTrack,this._hasVideo=te.hasVideoTrack,this._hasAudioFlagOverrided=!1,this._hasVideoFlagOverrided=!1,this._audioInitialMetadataDispatched=!1,this._videoInitialMetadataDispatched=!1,this._mediaInfo=new re,this._mediaInfo.hasAudio=this._hasAudio,this._mediaInfo.hasVideo=this._hasVideo,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._naluLengthSize=4,this._timestampBase=0,this._timescale=1e3,this._duration=0,this._durationOverrided=!1,this._referenceFrameRate={fixed:!0,fps:23.976,fps_num:23976,fps_den:1e3},this._flvSoundRateTable=[5500,11025,22050,44100,48e3],this._mpegSamplingRates=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],this._mpegAudioV10SampleRateTable=[44100,48e3,32e3,0],this._mpegAudioV20SampleRateTable=[22050,24e3,16e3,0],this._mpegAudioV25SampleRateTable=[11025,12e3,8e3,0],this._mpegAudioL1BitRateTable=[0,32,64,96,128,160,192,224,256,288,320,352,384,416,448,-1],this._mpegAudioL2BitRateTable=[0,32,48,56,64,80,96,112,128,160,192,224,256,320,384,-1],this._mpegAudioL3BitRateTable=[0,32,40,48,56,64,80,96,112,128,160,192,224,256,320,-1],this._videoTrack={type:"video",id:1,sequenceNumber:0,samples:[],length:0},this._audioTrack={type:"audio",id:2,sequenceNumber:0,samples:[],length:0},this._littleEndian=function(){var W=new ArrayBuffer(2);return new DataView(W).setInt16(0,256,!0),new Int16Array(W)[0]===256}()}return Object(Z.a)(ce,[{key:"destroy",value:function(){this._mediaInfo=null,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._videoTrack=null,this._audioTrack=null,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null}},{key:"bindDataSource",value:function(I){return I.onDataArrival=this.parseChunks.bind(this),this}},{key:"onTrackMetadata",get:function(){return this._onTrackMetadata},set:function(I){this._onTrackMetadata=I}},{key:"onMediaInfo",get:function(){return this._onMediaInfo},set:function(I){this._onMediaInfo=I}},{key:"onMetaDataArrived",get:function(){return this._onMetaDataArrived},set:function(I){this._onMetaDataArrived=I}},{key:"onScriptDataArrived",get:function(){return this._onScriptDataArrived},set:function(I){this._onScriptDataArrived=I}},{key:"onError",get:function(){return this._onError},set:function(I){this._onError=I}},{key:"onDataAvailable",get:function(){return this._onDataAvailable},set:function(I){this._onDataAvailable=I}},{key:"timestampBase",get:function(){return this._timestampBase},set:function(I){this._timestampBase=I}},{key:"overridedDuration",get:function(){return this._duration},set:function(I){this._durationOverrided=!0,this._duration=I,this._mediaInfo.duration=I}},{key:"overridedHasAudio",set:function(I){this._hasAudioFlagOverrided=!0,this._hasAudio=I,this._mediaInfo.hasAudio=I}},{key:"overridedHasVideo",set:function(I){this._hasVideoFlagOverrided=!0,this._hasVideo=I,this._mediaInfo.hasVideo=I}},{key:"resetMediaInfo",value:function(){this._mediaInfo=new re}},{key:"_isInitialMetadataDispatched",value:function(){return this._hasAudio&&this._hasVideo?this._audioInitialMetadataDispatched&&this._videoInitialMetadataDispatched:this._hasAudio&&!this._hasVideo?this._audioInitialMetadataDispatched:!this._hasAudio&&this._hasVideo?this._videoInitialMetadataDispatched:!1}},{key:"parseChunks",value:function(I,W){if(!this._onError||!this._onMediaInfo||!this._onTrackMetadata||!this._onDataAvailable)throw new i("Flv: onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");var K=0,Y=this._littleEndian;if(W===0)if(I.byteLength>13){var le=ce.probe(I);K=le.dataOffset}else return 0;if(this._firstParse){this._firstParse=!1,W+K!==this._dataOffset&&w.w(this.TAG,"First time parsing but chunk byteStart invalid!");var Ae=new DataView(I,K),Ce=Ae.getUint32(0,!Y);Ce!==0&&w.w(this.TAG,"PrevTagSize0 !== 0 !!!"),K+=4}for(;K<I.byteLength;){this._dispatch=!0;var Fe=new DataView(I,K);if(K+11+4>I.byteLength)break;var We=Fe.getUint8(0),Be=Fe.getUint32(0,!Y)&16777215;if(K+11+Be+4>I.byteLength)break;if(We!==8&&We!==9&&We!==18){w.w(this.TAG,"Unsupported tag type ".concat(We,", skipped")),K+=11+Be+4;continue}var Ye=Fe.getUint8(4),ze=Fe.getUint8(5),Ue=Fe.getUint8(6),qe=Fe.getUint8(7),Xe=Ue|ze<<8|Ye<<16|qe<<24,He=Fe.getUint32(7,!Y)&16777215;He!==0&&w.w(this.TAG,"Meet tag which has StreamID != 0!");var je=K+11;switch(We){case 8:this._parseAudioData(I,je,Be,Xe);break;case 9:this._parseVideoData(I,je,Be,Xe,W+K);break;case 18:this._parseScriptData(I,je,Be);break}var rt=Fe.getUint32(11+Be,!Y);rt!==11+Be&&w.w(this.TAG,"Invalid PrevTagSize ".concat(rt)),K+=11+Be+4}return this._isInitialMetadataDispatched()&&(this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack)),K}},{key:"_parseScriptData",value:function(I,W,K){var Y=Ee.parseScriptData(I,W,K);if(Y.hasOwnProperty("onMetaData")){if(Y.onMetaData==null||typeof Y.onMetaData!="object"){w.w(this.TAG,"Invalid onMetaData structure!");return}this._metadata&&w.w(this.TAG,"Found another onMetaData tag!"),this._metadata=Y;var le=this._metadata.onMetaData;if(this._onMetaDataArrived&&this._onMetaDataArrived(Object.assign({},le)),typeof le.hasAudio=="boolean"&&(this._hasAudioFlagOverrided===!1&&(this._hasAudio=le.hasAudio,this._mediaInfo.hasAudio=this._hasAudio)),typeof le.hasVideo=="boolean"&&(this._hasVideoFlagOverrided===!1&&(this._hasVideo=le.hasVideo,this._mediaInfo.hasVideo=this._hasVideo)),typeof le.audiodatarate=="number"&&(this._mediaInfo.audioDataRate=le.audiodatarate),typeof le.videodatarate=="number"&&(this._mediaInfo.videoDataRate=le.videodatarate),typeof le.width=="number"&&(this._mediaInfo.width=le.width),typeof le.height=="number"&&(this._mediaInfo.height=le.height),typeof le.duration=="number"){if(!this._durationOverrided){var Ae=Math.floor(le.duration*this._timescale);this._duration=Ae,this._mediaInfo.duration=Ae}}else this._mediaInfo.duration=0;if(typeof le.framerate=="number"){var Ce=Math.floor(le.framerate*1e3);if(Ce>0){var Fe=Ce/1e3;this._referenceFrameRate.fixed=!0,this._referenceFrameRate.fps=Fe,this._referenceFrameRate.fps_num=Ce,this._referenceFrameRate.fps_den=1e3,this._mediaInfo.fps=Fe}}if(typeof le.keyframes=="object"){this._mediaInfo.hasKeyframesIndex=!0;var We=le.keyframes;this._mediaInfo.keyframesIndex=this._parseKeyframesIndex(We),le.keyframes=null}else this._mediaInfo.hasKeyframesIndex=!1;this._dispatch=!1,this._mediaInfo.metadata=le,w.v(this.TAG,"Parsed onMetaData"),this._mediaInfo.isComplete()&&this._onMediaInfo(this._mediaInfo)}Object.keys(Y).length>0&&(this._onScriptDataArrived&&this._onScriptDataArrived(Object.assign({},Y)))}},{key:"_parseKeyframesIndex",value:function(I){for(var W=[],K=[],Y=1;Y<I.times.length;Y++){var le=this._timestampBase+Math.floor(I.times[Y]*1e3);W.push(le),K.push(I.filepositions[Y])}return{times:W,filepositions:K}}},{key:"_parseAudioData",value:function(I,W,K,Y){if(K<=1){w.w(this.TAG,"Flv: Invalid audio packet, missing SoundData payload!");return}if(this._hasAudioFlagOverrided===!0&&this._hasAudio===!1)return;var le=this._littleEndian,Ae=new DataView(I,W,K),Ce=Ae.getUint8(0),Fe=Ce>>>4;if(Fe!==2&&Fe!==10){this._onError(M.CODEC_UNSUPPORTED,"Flv: Unsupported audio codec idx: "+Fe);return}var We=0,Be=(Ce&12)>>>2;if(Be>=0&&Be<=4)We=this._flvSoundRateTable[Be];else{this._onError(M.FORMAT_ERROR,"Flv: Invalid audio sample rate idx: "+Be);return}var Ye=(Ce&2)>>>1,ze=Ce&1,Ue=this._audioMetadata,qe=this._audioTrack;if(Ue||(this._hasAudio===!1&&this._hasAudioFlagOverrided===!1&&(this._hasAudio=!0,this._mediaInfo.hasAudio=!0),Ue=this._audioMetadata={},Ue.type="audio",Ue.id=qe.id,Ue.timescale=this._timescale,Ue.duration=this._duration,Ue.audioSampleRate=We,Ue.channelCount=ze===0?1:2),Fe===10){var Xe=this._parseAACAudioData(I,W+1,K-1);if(Xe==null)return;if(Xe.packetType===0){Ue.config&&w.w(this.TAG,"Found another AudioSpecificConfig!");var He=Xe.data;Ue.audioSampleRate=He.samplingRate,Ue.channelCount=He.channelCount,Ue.codec=He.codec,Ue.originalCodec=He.originalCodec,Ue.config=He.config,Ue.refSampleDuration=1024/Ue.audioSampleRate*Ue.timescale,w.v(this.TAG,"Parsed AudioSpecificConfig"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._audioInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("audio",Ue);var je=this._mediaInfo;je.audioCodec=Ue.originalCodec,je.audioSampleRate=Ue.audioSampleRate,je.audioChannelCount=Ue.channelCount,je.hasVideo?je.videoCodec!=null&&(je.mimeType='video/x-flv; codecs="'+je.videoCodec+","+je.audioCodec+'"'):je.mimeType='video/x-flv; codecs="'+je.audioCodec+'"',je.isComplete()&&this._onMediaInfo(je)}else if(Xe.packetType===1){var rt=this._timestampBase+Y,ct={unit:Xe.data,length:Xe.data.byteLength,dts:rt,pts:rt};qe.samples.push(ct),qe.length+=Xe.data.length}else w.e(this.TAG,"Flv: Unsupported AAC data type ".concat(Xe.packetType))}else if(Fe===2){if(!Ue.codec){var it=this._parseMP3AudioData(I,W+1,K-1,!0);if(it==null)return;Ue.audioSampleRate=it.samplingRate,Ue.channelCount=it.channelCount,Ue.codec=it.codec,Ue.originalCodec=it.originalCodec,Ue.refSampleDuration=1152/Ue.audioSampleRate*Ue.timescale,w.v(this.TAG,"Parsed MPEG Audio Frame Header"),this._audioInitialMetadataDispatched=!0,this._onTrackMetadata("audio",Ue);var lt=this._mediaInfo;lt.audioCodec=Ue.codec,lt.audioSampleRate=Ue.audioSampleRate,lt.audioChannelCount=Ue.channelCount,lt.audioDataRate=it.bitRate,lt.hasVideo?lt.videoCodec!=null&&(lt.mimeType='video/x-flv; codecs="'+lt.videoCodec+","+lt.audioCodec+'"'):lt.mimeType='video/x-flv; codecs="'+lt.audioCodec+'"',lt.isComplete()&&this._onMediaInfo(lt)}var _t=this._parseMP3AudioData(I,W+1,K-1,!1);if(_t==null)return;var Tt=this._timestampBase+Y,bt={unit:_t,length:_t.byteLength,dts:Tt,pts:Tt};qe.samples.push(bt),qe.length+=_t.length}}},{key:"_parseAACAudioData",value:function(I,W,K){if(K<=1){w.w(this.TAG,"Flv: Invalid AAC packet, missing AACPacketType or/and Data!");return}var Y={},le=new Uint8Array(I,W,K);return Y.packetType=le[0],le[0]===0?Y.data=this._parseAACAudioSpecificConfig(I,W+1,K-1):Y.data=le.subarray(1),Y}},{key:"_parseAACAudioSpecificConfig",value:function(I,W,K){var Y=new Uint8Array(I,W,K),le=null,Ae=0,Ce=0,Fe=null,We=0,Be=null;if(Ae=Ce=Y[0]>>>3,We=(Y[0]&7)<<1|Y[1]>>>7,We<0||We>=this._mpegSamplingRates.length){this._onError(M.FORMAT_ERROR,"Flv: AAC invalid sampling frequency index!");return}var Ye=this._mpegSamplingRates[We],ze=(Y[1]&120)>>>3;if(ze<0||ze>=8){this._onError(M.FORMAT_ERROR,"Flv: AAC invalid channel configuration");return}Ae===5&&(Be=(Y[1]&7)<<1|Y[2]>>>7,Fe=(Y[2]&124)>>>2);var Ue=self.navigator.userAgent.toLowerCase();return Ue.indexOf("firefox")!==-1?We>=6?(Ae=5,le=new Array(4),Be=We-3):(Ae=2,le=new Array(2),Be=We):Ue.indexOf("android")!==-1?(Ae=2,le=new Array(2),Be=We):(Ae=5,Be=We,le=new Array(4),We>=6?Be=We-3:ze===1&&(Ae=2,le=new Array(2),Be=We)),le[0]=Ae<<3,le[0]|=(We&15)>>>1,le[1]=(We&15)<<7,le[1]|=(ze&15)<<3,Ae===5&&(le[1]|=(Be&15)>>>1,le[2]=(Be&1)<<7,le[2]|=2<<2,le[3]=0),{config:le,samplingRate:Ye,channelCount:ze,codec:"mp4a.40."+Ae,originalCodec:"mp4a.40."+Ce}}},{key:"_parseMP3AudioData",value:function(I,W,K,Y){if(K<4){w.w(this.TAG,"Flv: Invalid MP3 packet, header missing!");return}var le=this._littleEndian,Ae=new Uint8Array(I,W,K),Ce=null;if(Y){if(Ae[0]!==255)return;var Fe=Ae[1]>>>3&3,We=(Ae[1]&6)>>1,Be=(Ae[2]&240)>>>4,Ye=(Ae[2]&12)>>>2,ze=Ae[3]>>>6&3,Ue=ze!==3?2:1,qe=0,Xe=0,He=34,je="mp3";switch(Fe){case 0:qe=this._mpegAudioV25SampleRateTable[Ye];break;case 2:qe=this._mpegAudioV20SampleRateTable[Ye];break;case 3:qe=this._mpegAudioV10SampleRateTable[Ye];break}switch(We){case 1:He=34,Be<this._mpegAudioL3BitRateTable.length&&(Xe=this._mpegAudioL3BitRateTable[Be]);break;case 2:He=33,Be<this._mpegAudioL2BitRateTable.length&&(Xe=this._mpegAudioL2BitRateTable[Be]);break;case 3:He=32,Be<this._mpegAudioL1BitRateTable.length&&(Xe=this._mpegAudioL1BitRateTable[Be]);break}Ce={bitRate:Xe,samplingRate:qe,channelCount:Ue,codec:je,originalCodec:je}}else Ce=Ae;return Ce}},{key:"_parseVideoData",value:function(I,W,K,Y,le){if(K<=1){w.w(this.TAG,"Flv: Invalid video packet, missing VideoData payload!");return}if(this._hasVideoFlagOverrided===!0&&this._hasVideo===!1)return;var Ae=new Uint8Array(I,W,K)[0],Ce=(Ae&240)>>>4,Fe=Ae&15;if(Fe!==7){this._onError(M.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: ".concat(Fe));return}this._parseAVCVideoPacket(I,W+1,K-1,Y,le,Ce)}},{key:"_parseAVCVideoPacket",value:function(I,W,K,Y,le,Ae){if(K<4){w.w(this.TAG,"Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime");return}var Ce=this._littleEndian,Fe=new DataView(I,W,K),We=Fe.getUint8(0),Be=Fe.getUint32(0,!Ce)&16777215,Ye=Be<<8>>8;if(We===0)this._parseAVCDecoderConfigurationRecord(I,W+4,K-4);else if(We===1)this._parseAVCVideoData(I,W+4,K-4,Y,le,Ae,Ye);else if(!(We===2)){this._onError(M.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(We));return}}},{key:"_parseAVCDecoderConfigurationRecord",value:function(I,W,K){if(K<7){w.w(this.TAG,"Flv: Invalid AVCDecoderConfigurationRecord, lack of data!");return}var Y=this._videoMetadata,le=this._videoTrack,Ae=this._littleEndian,Ce=new DataView(I,W,K);Y?typeof Y.avcc!="undefined"&&w.w(this.TAG,"Found another AVCDecoderConfigurationRecord!"):(this._hasVideo===!1&&this._hasVideoFlagOverrided===!1&&(this._hasVideo=!0,this._mediaInfo.hasVideo=!0),Y=this._videoMetadata={},Y.type="video",Y.id=le.id,Y.timescale=this._timescale,Y.duration=this._duration);var Fe=Ce.getUint8(0),We=Ce.getUint8(1),Be=Ce.getUint8(2),Ye=Ce.getUint8(3);if(Fe!==1||We===0){this._onError(M.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord");return}if(this._naluLengthSize=(Ce.getUint8(4)&3)+1,this._naluLengthSize!==3&&this._naluLengthSize!==4){this._onError(M.FORMAT_ERROR,"Flv: Strange NaluLengthSizeMinusOne: ".concat(this._naluLengthSize-1));return}var ze=Ce.getUint8(5)&31;if(ze===0){this._onError(M.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No SPS");return}else ze>1&&w.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: SPS Count = ".concat(ze));for(var Ue=6,qe=0;qe<ze;qe++){var Xe=Ce.getUint16(Ue,!Ae);if(Ue+=2,Xe===0)continue;var He=new Uint8Array(I,W+Ue,Xe);Ue+=Xe;var je=O.parseSPS(He);if(qe!==0)continue;Y.codecWidth=je.codec_size.width,Y.codecHeight=je.codec_size.height,Y.presentWidth=je.present_size.width,Y.presentHeight=je.present_size.height,Y.profile=je.profile_string,Y.level=je.level_string,Y.bitDepth=je.bit_depth,Y.chromaFormat=je.chroma_format,Y.sarRatio=je.sar_ratio,Y.frameRate=je.frame_rate,(je.frame_rate.fixed===!1||je.frame_rate.fps_num===0||je.frame_rate.fps_den===0)&&(Y.frameRate=this._referenceFrameRate);var rt=Y.frameRate.fps_den,ct=Y.frameRate.fps_num;Y.refSampleDuration=Y.timescale*(rt/ct);for(var it=He.subarray(1,4),lt="avc1.",_t=0;_t<3;_t++){var Tt=it[_t].toString(16);Tt.length<2&&(Tt="0"+Tt),lt+=Tt}Y.codec=lt;var bt=this._mediaInfo;bt.width=Y.codecWidth,bt.height=Y.codecHeight,bt.fps=Y.frameRate.fps,bt.profile=Y.profile,bt.level=Y.level,bt.refFrames=je.ref_frames,bt.chromaFormat=je.chroma_format_string,bt.sarNum=Y.sarRatio.width,bt.sarDen=Y.sarRatio.height,bt.videoCodec=lt,bt.hasAudio?bt.audioCodec!=null&&(bt.mimeType='video/x-flv; codecs="'+bt.videoCodec+","+bt.audioCodec+'"'):bt.mimeType='video/x-flv; codecs="'+bt.videoCodec+'"',bt.isComplete()&&this._onMediaInfo(bt)}var St=Ce.getUint8(Ue);if(St===0){this._onError(M.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No PPS");return}else St>1&&w.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: PPS Count = ".concat(St));Ue++;for(var Lt=0;Lt<St;Lt++){var Et=Ce.getUint16(Ue,!Ae);if(Ue+=2,Et===0)continue;Ue+=Et}Y.avcc=new Uint8Array(K),Y.avcc.set(new Uint8Array(I,W,K),0),w.v(this.TAG,"Parsed AVCDecoderConfigurationRecord"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._videoInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("video",Y)}},{key:"_parseAVCVideoData",value:function(I,W,K,Y,le,Ae,Ce){for(var Fe=this._littleEndian,We=new DataView(I,W,K),Be=[],Ye=0,ze=0,Ue=this._naluLengthSize,qe=this._timestampBase+Y,Xe=Ae===1;ze<K;){if(ze+4>=K){w.w(this.TAG,"Malformed Nalu near timestamp ".concat(qe,", offset = ").concat(ze,", dataSize = ").concat(K));break}var He=We.getUint32(ze,!Fe);if(Ue===3&&(He>>>=8),He>K-Ue){w.w(this.TAG,"Malformed Nalus near timestamp ".concat(qe,", NaluSize > DataSize!"));return}var je=We.getUint8(ze+Ue)&31;je===5&&(Xe=!0);var rt=new Uint8Array(I,W+ze,Ue+He),ct={type:je,data:rt};Be.push(ct),Ye+=rt.byteLength,ze+=Ue+He}if(Be.length){var it=this._videoTrack,lt={units:Be,length:Ye,isKeyframe:Xe,dts:qe,cts:Ce,pts:qe+Ce};Xe&&(lt.fileposition=le),it.samples.push(lt),it.length+=Ye}}}],[{key:"probe",value:function(I){var W=new Uint8Array(I),K={match:!1};if(W[0]!==70||W[1]!==76||W[2]!==86||W[3]!==1)return K;var Y=(W[4]&4)>>>2!==0,le=(W[4]&1)!==0,Ae=ve(W,5);return Ae<9?K:{match:!0,consumed:Ae,dataOffset:Ae,hasAudioTrack:Y,hasVideoTrack:le}}}]),ce}(),Oe=Pe,De=function(){function ce(){Object(Se.a)(this,ce)}return Object(Z.a)(ce,null,[{key:"init",value:function(){ce.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[],".mp3":[]};for(var I in ce.types)ce.types.hasOwnProperty(I)&&(ce.types[I]=[I.charCodeAt(0),I.charCodeAt(1),I.charCodeAt(2),I.charCodeAt(3)]);var W=ce.constants={};W.FTYP=new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]),W.STSD_PREFIX=new Uint8Array([0,0,0,0,0,0,0,1]),W.STTS=new Uint8Array([0,0,0,0,0,0,0,0]),W.STSC=W.STCO=W.STTS,W.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),W.HDLR_VIDEO=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),W.HDLR_AUDIO=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),W.DREF=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),W.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),W.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}},{key:"box",value:function(I){for(var W=8,K=null,Y=Array.prototype.slice.call(arguments,1),le=Y.length,Ae=0;Ae<le;Ae++)W+=Y[Ae].byteLength;K=new Uint8Array(W),K[0]=W>>>24&255,K[1]=W>>>16&255,K[2]=W>>>8&255,K[3]=W&255,K.set(I,4);for(var Ce=8,Fe=0;Fe<le;Fe++)K.set(Y[Fe],Ce),Ce+=Y[Fe].byteLength;return K}},{key:"generateInitSegment",value:function(I){var W=ce.box(ce.types.ftyp,ce.constants.FTYP),K=ce.moov(I),Y=new Uint8Array(W.byteLength+K.byteLength);return Y.set(W,0),Y.set(K,W.byteLength),Y}},{key:"moov",value:function(I){var W=ce.mvhd(I.timescale,I.duration),K=ce.trak(I),Y=ce.mvex(I);return ce.box(ce.types.moov,W,K,Y)}},{key:"mvhd",value:function(I,W){return ce.box(ce.types.mvhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,I>>>24&255,I>>>16&255,I>>>8&255,I&255,W>>>24&255,W>>>16&255,W>>>8&255,W&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]))}},{key:"trak",value:function(I){return ce.box(ce.types.trak,ce.tkhd(I),ce.mdia(I))}},{key:"tkhd",value:function(I){var W=I.id,K=I.duration,Y=I.presentWidth,le=I.presentHeight;return ce.box(ce.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,W>>>24&255,W>>>16&255,W>>>8&255,W&255,0,0,0,0,K>>>24&255,K>>>16&255,K>>>8&255,K&255,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,Y>>>8&255,Y&255,0,0,le>>>8&255,le&255,0,0]))}},{key:"mdia",value:function(I){return ce.box(ce.types.mdia,ce.mdhd(I),ce.hdlr(I),ce.minf(I))}},{key:"mdhd",value:function(I){var W=I.timescale,K=I.duration;return ce.box(ce.types.mdhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,W>>>24&255,W>>>16&255,W>>>8&255,W&255,K>>>24&255,K>>>16&255,K>>>8&255,K&255,85,196,0,0]))}},{key:"hdlr",value:function(I){var W=null;return I.type==="audio"?W=ce.constants.HDLR_AUDIO:W=ce.constants.HDLR_VIDEO,ce.box(ce.types.hdlr,W)}},{key:"minf",value:function(I){var W=null;return I.type==="audio"?W=ce.box(ce.types.smhd,ce.constants.SMHD):W=ce.box(ce.types.vmhd,ce.constants.VMHD),ce.box(ce.types.minf,W,ce.dinf(),ce.stbl(I))}},{key:"dinf",value:function(){var I=ce.box(ce.types.dinf,ce.box(ce.types.dref,ce.constants.DREF));return I}},{key:"stbl",value:function(I){var W=ce.box(ce.types.stbl,ce.stsd(I),ce.box(ce.types.stts,ce.constants.STTS),ce.box(ce.types.stsc,ce.constants.STSC),ce.box(ce.types.stsz,ce.constants.STSZ),ce.box(ce.types.stco,ce.constants.STCO));return W}},{key:"stsd",value:function(I){return I.type==="audio"?I.codec==="mp3"?ce.box(ce.types.stsd,ce.constants.STSD_PREFIX,ce.mp3(I)):ce.box(ce.types.stsd,ce.constants.STSD_PREFIX,ce.mp4a(I)):ce.box(ce.types.stsd,ce.constants.STSD_PREFIX,ce.avc1(I))}},{key:"mp3",value:function(I){var W=I.channelCount,K=I.audioSampleRate,Y=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,W,0,16,0,0,0,0,K>>>8&255,K&255,0,0]);return ce.box(ce.types[".mp3"],Y)}},{key:"mp4a",value:function(I){var W=I.channelCount,K=I.audioSampleRate,Y=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,W,0,16,0,0,0,0,K>>>8&255,K&255,0,0]);return ce.box(ce.types.mp4a,Y,ce.esds(I))}},{key:"esds",value:function(I){var W=I.config||[],K=W.length,Y=new Uint8Array([0,0,0,0,3,23+K,0,1,0,4,15+K,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([K]).concat(W).concat([6,1,2]));return ce.box(ce.types.esds,Y)}},{key:"avc1",value:function(I){var W=I.avcc,K=I.codecWidth,Y=I.codecHeight,le=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,K>>>8&255,K&255,Y>>>8&255,Y&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,10,120,113,113,47,102,108,118,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,255,255]);return ce.box(ce.types.avc1,le,ce.box(ce.types.avcC,W))}},{key:"mvex",value:function(I){return ce.box(ce.types.mvex,ce.trex(I))}},{key:"trex",value:function(I){var W=I.id,K=new Uint8Array([0,0,0,0,W>>>24&255,W>>>16&255,W>>>8&255,W&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return ce.box(ce.types.trex,K)}},{key:"moof",value:function(I,W){return ce.box(ce.types.moof,ce.mfhd(I.sequenceNumber),ce.traf(I,W))}},{key:"mfhd",value:function(I){var W=new Uint8Array([0,0,0,0,I>>>24&255,I>>>16&255,I>>>8&255,I&255]);return ce.box(ce.types.mfhd,W)}},{key:"traf",value:function(I,W){var K=I.id,Y=ce.box(ce.types.tfhd,new Uint8Array([0,0,0,0,K>>>24&255,K>>>16&255,K>>>8&255,K&255])),le=ce.box(ce.types.tfdt,new Uint8Array([0,0,0,0,W>>>24&255,W>>>16&255,W>>>8&255,W&255])),Ae=ce.sdtp(I),Ce=ce.trun(I,Ae.byteLength+16+16+8+16+8+8);return ce.box(ce.types.traf,Y,le,Ce,Ae)}},{key:"sdtp",value:function(I){for(var W=I.samples||[],K=W.length,Y=new Uint8Array(4+K),le=0;le<K;le++){var Ae=W[le].flags;Y[le+4]=Ae.isLeading<<6|Ae.dependsOn<<4|Ae.isDependedOn<<2|Ae.hasRedundancy}return ce.box(ce.types.sdtp,Y)}},{key:"trun",value:function(I,W){var K=I.samples||[],Y=K.length,le=12+16*Y,Ae=new Uint8Array(le);W+=8+le,Ae.set([0,0,15,1,Y>>>24&255,Y>>>16&255,Y>>>8&255,Y&255,W>>>24&255,W>>>16&255,W>>>8&255,W&255],0);for(var Ce=0;Ce<Y;Ce++){var Fe=K[Ce].duration,We=K[Ce].size,Be=K[Ce].flags,Ye=K[Ce].cts;Ae.set([Fe>>>24&255,Fe>>>16&255,Fe>>>8&255,Fe&255,We>>>24&255,We>>>16&255,We>>>8&255,We&255,Be.isLeading<<2|Be.dependsOn,Be.isDependedOn<<6|Be.hasRedundancy<<4|Be.isNonSync,0,0,Ye>>>24&255,Ye>>>16&255,Ye>>>8&255,Ye&255],12+16*Ce)}return ce.box(ce.types.trun,Ae)}},{key:"mdat",value:function(I){return ce.box(ce.types.mdat,I)}}]),ce}();De.init();var Ne=De,Ke=function(){function ce(){Object(Se.a)(this,ce)}return Object(Z.a)(ce,null,[{key:"getSilentFrame",value:function(I,W){if(I==="mp4a.40.2"){if(W===1)return new Uint8Array([0,200,0,128,35,128]);if(W===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(W===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(W===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(W===5)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(W===6)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224])}else{if(W===1)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(W===2)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(W===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}return null}}]),ce}(),ke=Ke,Re=function ce(te,I,W,K,Y){Object(Se.a)(this,ce),this.dts=te,this.pts=I,this.duration=W,this.originalDts=K,this.isSyncPoint=Y,this.fileposition=null},Te=function(){function ce(){Object(Se.a)(this,ce),this.beginDts=0,this.endDts=0,this.beginPts=0,this.endPts=0,this.originalBeginDts=0,this.originalEndDts=0,this.syncPoints=[],this.firstSample=null,this.lastSample=null}return Object(Z.a)(ce,[{key:"appendSyncPoint",value:function(I){I.isSyncPoint=!0,this.syncPoints.push(I)}}]),ce}(),we=function(){function ce(){Object(Se.a)(this,ce),this._list=[]}return Object(Z.a)(ce,[{key:"clear",value:function(){this._list=[]}},{key:"appendArray",value:function(I){var W=this._list;if(I.length===0)return;W.length>0&&I[0].originalDts<W[W.length-1].originalDts&&this.clear(),Array.prototype.push.apply(W,I)}},{key:"getLastSyncPointBeforeDts",value:function(I){if(this._list.length==0)return null;var W=this._list,K=0,Y=W.length-1,le=0,Ae=0,Ce=Y;for(I<W[0].dts&&(K=0,Ae=Ce+1);Ae<=Ce;)if(le=Ae+Math.floor((Ce-Ae)/2),le===Y||I>=W[le].dts&&I<W[le+1].dts){K=le;break}else W[le].dts<I?Ae=le+1:Ce=le-1;return this._list[K]}}]),ce}(),xe=function(){function ce(te){Object(Se.a)(this,ce),this._type=te,this._list=[],this._lastAppendLocation=-1}return Object(Z.a)(ce,[{key:"type",get:function(){return this._type}},{key:"length",get:function(){return this._list.length}},{key:"isEmpty",value:function(){return this._list.length===0}},{key:"clear",value:function(){this._list=[],this._lastAppendLocation=-1}},{key:"_searchNearestSegmentBefore",value:function(I){var W=this._list;if(W.length===0)return-2;var K=W.length-1,Y=0,le=0,Ae=K,Ce=0;if(I<W[0].originalBeginDts)return Ce=-1,Ce;for(;le<=Ae;)if(Y=le+Math.floor((Ae-le)/2),Y===K||I>W[Y].lastSample.originalDts&&I<W[Y+1].originalBeginDts){Ce=Y;break}else W[Y].originalBeginDts<I?le=Y+1:Ae=Y-1;return Ce}},{key:"_searchNearestSegmentAfter",value:function(I){return this._searchNearestSegmentBefore(I)+1}},{key:"append",value:function(I){var W=this._list,K=I,Y=this._lastAppendLocation,le=0;Y!==-1&&Y<W.length&&K.originalBeginDts>=W[Y].lastSample.originalDts&&(Y===W.length-1||Y<W.length-1&&K.originalBeginDts<W[Y+1].originalBeginDts)?le=Y+1:W.length>0&&(le=this._searchNearestSegmentBefore(K.originalBeginDts)+1),this._lastAppendLocation=le,this._list.splice(le,0,K)}},{key:"getLastSegmentBefore",value:function(I){var W=this._searchNearestSegmentBefore(I);return W>=0?this._list[W]:null}},{key:"getLastSampleBefore",value:function(I){var W=this.getLastSegmentBefore(I);return W!=null?W.lastSample:null}},{key:"getLastSyncPointBefore",value:function(I){for(var W=this._searchNearestSegmentBefore(I),K=this._list[W].syncPoints;K.length===0&&W>0;)W--,K=this._list[W].syncPoints;return K.length>0?K[K.length-1]:null}}]),ce}(),ue=function(){function ce(te){Object(Se.a)(this,ce),this.TAG="MP4Remuxer",this._config=te,this._isLive=te.isLive===!0,this._dtsBase=-1,this._dtsBaseInited=!1,this._audioDtsBase=Infinity,this._videoDtsBase=Infinity,this._audioNextDts=void 0,this._videoNextDts=void 0,this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList=new xe("audio"),this._videoSegmentInfoList=new xe("video"),this._onInitSegment=null,this._onMediaSegment=null,this._forceFirstIDR=!!(m.chrome&&(m.version.major<50||m.version.major===50&&m.version.build<2661)),this._fillSilentAfterSeek=m.msedge||m.msie,this._mp3UseMpegAudio=!m.firefox,this._fillAudioTimestampGap=this._config.fixAudioTimestampGap}return Object(Z.a)(ce,[{key:"destroy",value:function(){this._dtsBase=-1,this._dtsBaseInited=!1,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList.clear(),this._audioSegmentInfoList=null,this._videoSegmentInfoList.clear(),this._videoSegmentInfoList=null,this._onInitSegment=null,this._onMediaSegment=null}},{key:"bindDataSource",value:function(I){return I.onDataAvailable=this.remux.bind(this),I.onTrackMetadata=this._onTrackMetadataReceived.bind(this),this}},{key:"onInitSegment",get:function(){return this._onInitSegment},set:function(I){this._onInitSegment=I}},{key:"onMediaSegment",get:function(){return this._onMediaSegment},set:function(I){this._onMediaSegment=I}},{key:"insertDiscontinuity",value:function(){this._audioNextDts=this._videoNextDts=void 0}},{key:"seek",value:function(I){this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._videoSegmentInfoList.clear(),this._audioSegmentInfoList.clear()}},{key:"remux",value:function(I,W){if(!this._onMediaSegment)throw new i("MP4Remuxer: onMediaSegment callback must be specificed!");this._dtsBaseInited||this._calculateDtsBase(I,W),this._remuxVideo(W),this._remuxAudio(I)}},{key:"_onTrackMetadataReceived",value:function(I,W){var K=null,Y="mp4",le=W.codec;if(I==="audio")this._audioMeta=W,W.codec==="mp3"&&this._mp3UseMpegAudio?(Y="mpeg",le="",K=new Uint8Array):K=Ne.generateInitSegment(W);else if(I==="video")this._videoMeta=W,K=Ne.generateInitSegment(W);else return;if(!this._onInitSegment)throw new i("MP4Remuxer: onInitSegment callback must be specified!");this._onInitSegment(I,{type:I,data:K.buffer,codec:le,container:"".concat(I,"/").concat(Y),mediaDuration:W.duration})}},{key:"_calculateDtsBase",value:function(I,W){if(this._dtsBaseInited)return;I.samples&&I.samples.length&&(this._audioDtsBase=I.samples[0].dts),W.samples&&W.samples.length&&(this._videoDtsBase=W.samples[0].dts),this._dtsBase=Math.min(this._audioDtsBase,this._videoDtsBase),this._dtsBaseInited=!0}},{key:"flushStashedSamples",value:function(){var I=this._videoStashedLastSample,W=this._audioStashedLastSample,K={type:"video",id:1,sequenceNumber:0,samples:[],length:0};I!=null&&(K.samples.push(I),K.length=I.length);var Y={type:"audio",id:2,sequenceNumber:0,samples:[],length:0};W!=null&&(Y.samples.push(W),Y.length=W.length),this._videoStashedLastSample=null,this._audioStashedLastSample=null,this._remuxVideo(K,!0),this._remuxAudio(Y,!0)}},{key:"_remuxAudio",value:function(I,W){if(this._audioMeta==null)return;var K=I,Y=K.samples,le=void 0,Ae=-1,Ce=-1,Fe=-1,We=this._audioMeta.refSampleDuration,Be=this._audioMeta.codec==="mp3"&&this._mp3UseMpegAudio,Ye=this._dtsBaseInited&&this._audioNextDts===void 0,ze=!1;if(!Y||Y.length===0)return;if(Y.length===1&&!W)return;var Ue=0,qe=null,Xe=0;Be?(Ue=0,Xe=K.length):(Ue=8,Xe=8+K.length);var He=null;if(Y.length>1&&(He=Y.pop(),Xe-=He.length),this._audioStashedLastSample!=null){var je=this._audioStashedLastSample;this._audioStashedLastSample=null,Y.unshift(je),Xe+=je.length}He!=null&&(this._audioStashedLastSample=He);var rt=Y[0].dts-this._dtsBase;if(this._audioNextDts)le=rt-this._audioNextDts;else if(this._audioSegmentInfoList.isEmpty())le=0,this._fillSilentAfterSeek&&!this._videoSegmentInfoList.isEmpty()&&(this._audioMeta.originalCodec!=="mp3"&&(ze=!0));else{var ct=this._audioSegmentInfoList.getLastSampleBefore(rt);if(ct!=null){var it=rt-(ct.originalDts+ct.duration);it<=3&&(it=0);var lt=ct.dts+ct.duration+it;le=rt-lt}else le=0}if(ze){var _t=rt-le,Tt=this._videoSegmentInfoList.getLastSegmentBefore(rt);if(Tt!=null&&Tt.beginDts<_t){var bt=ke.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);if(bt){var St=Tt.beginDts,Lt=_t-Tt.beginDts;w.v(this.TAG,"InsertPrefixSilentAudio: dts: ".concat(St,", duration: ").concat(Lt)),Y.unshift({unit:bt,dts:St,pts:St}),Xe+=bt.byteLength}}else ze=!1}for(var Et=[],At=0;At<Y.length;At++){var It=Y[At],Pt=It.unit,Ot=It.dts-this._dtsBase,Ct=Ot-le;Ae===-1&&(Ae=Ct);var xt=0;if(At!==Y.length-1){var Kt=Y[At+1].dts-this._dtsBase-le;xt=Kt-Ct}else if(He!=null){var Nt=He.dts-this._dtsBase-le;xt=Nt-Ct}else Et.length>=1?xt=Et[Et.length-1].duration:xt=Math.floor(We);var wt=!1,Rt=null;if(xt>We*1.5&&this._audioMeta.codec!=="mp3"&&this._fillAudioTimestampGap&&!m.safari){wt=!0;var Mt=Math.abs(xt-We),Ft=Math.ceil(Mt/We),Bt=Ct+We;w.w(this.TAG,`Large audio timestamp gap detected, may cause AV sync to drift. Silent frames will be generated to avoid unsync.
|
|
|
`+"dts: ".concat(Ct+xt," ms, expected: ").concat(Ct+Math.round(We)," ms, ")+"delta: ".concat(Math.round(Mt)," ms, generate: ").concat(Ft," frames"));var jt=ke.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);jt==null&&(w.w(this.TAG,"Unable to generate silent frame for "+"".concat(this._audioMeta.originalCodec," with ").concat(this._audioMeta.channelCount," channels, repeat last frame")),jt=Pt),Rt=[];for(var Gt=0;Gt<Ft;Gt++){var Ut=Math.round(Bt);if(Rt.length>0){var Wt=Rt[Rt.length-1];Wt.duration=Ut-Wt.dts}var Ht={dts:Ut,pts:Ut,cts:0,unit:jt,size:jt.byteLength,duration:0,originalDts:Ot,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}};Rt.push(Ht),Xe+=Ht.size,Bt+=We}var Xt=Rt[Rt.length-1];Xt.duration=Ct+xt-Xt.dts,xt=Math.round(We)}Et.push({dts:Ct,pts:Ct,cts:0,unit:It.unit,size:It.unit.byteLength,duration:xt,originalDts:Ot,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}}),wt&&Et.push.apply(Et,Rt)}Be?qe=new Uint8Array(Xe):(qe=new Uint8Array(Xe),qe[0]=Xe>>>24&255,qe[1]=Xe>>>16&255,qe[2]=Xe>>>8&255,qe[3]=Xe&255,qe.set(Ne.types.mdat,4));for(var Vt=0;Vt<Et.length;Vt++){var Yt=Et[Vt].unit;qe.set(Yt,Ue),Ue+=Yt.byteLength}var kt=Et[Et.length-1];Ce=kt.dts+kt.duration,this._audioNextDts=Ce;var Dt=new Te;Dt.beginDts=Ae,Dt.endDts=Ce,Dt.beginPts=Ae,Dt.endPts=Ce,Dt.originalBeginDts=Et[0].originalDts,Dt.originalEndDts=kt.originalDts+kt.duration,Dt.firstSample=new Re(Et[0].dts,Et[0].pts,Et[0].duration,Et[0].originalDts,!1),Dt.lastSample=new Re(kt.dts,kt.pts,kt.duration,kt.originalDts,!1),this._isLive||this._audioSegmentInfoList.append(Dt),K.samples=Et,K.sequenceNumber++;var zt=null;Be?zt=new Uint8Array:zt=Ne.moof(K,Ae),K.samples=[],K.length=0;var qt={type:"audio",data:this._mergeBoxes(zt,qe).buffer,sampleCount:Et.length,info:Dt};Be&&Ye&&(qt.timestampOffset=Ae),this._onMediaSegment("audio",qt)}},{key:"_remuxVideo",value:function(I,W){if(this._videoMeta==null)return;var K=I,Y=K.samples,le=void 0,Ae=-1,Ce=-1,Fe=-1,We=-1;if(!Y||Y.length===0)return;if(Y.length===1&&!W)return;var Be=8,Ye=null,ze=8+I.length,Ue=null;if(Y.length>1&&(Ue=Y.pop(),ze-=Ue.length),this._videoStashedLastSample!=null){var qe=this._videoStashedLastSample;this._videoStashedLastSample=null,Y.unshift(qe),ze+=qe.length}Ue!=null&&(this._videoStashedLastSample=Ue);var Xe=Y[0].dts-this._dtsBase;if(this._videoNextDts)le=Xe-this._videoNextDts;else if(this._videoSegmentInfoList.isEmpty())le=0;else{var He=this._videoSegmentInfoList.getLastSampleBefore(Xe);if(He!=null){var je=Xe-(He.originalDts+He.duration);je<=3&&(je=0);var rt=He.dts+He.duration+je;le=Xe-rt}else le=0}for(var ct=new Te,it=[],lt=0;lt<Y.length;lt++){var _t=Y[lt],Tt=_t.dts-this._dtsBase,bt=_t.isKeyframe,St=Tt-le,Lt=_t.cts,Et=St+Lt;Ae===-1&&(Ae=St,Fe=Et);var At=0;if(lt!==Y.length-1){var It=Y[lt+1].dts-this._dtsBase-le;At=It-St}else if(Ue!=null){var Pt=Ue.dts-this._dtsBase-le;At=Pt-St}else it.length>=1?At=it[it.length-1].duration:At=Math.floor(this._videoMeta.refSampleDuration);if(bt){var Ot=new Re(St,Et,At,_t.dts,!0);Ot.fileposition=_t.fileposition,ct.appendSyncPoint(Ot)}it.push({dts:St,pts:Et,cts:Lt,units:_t.units,size:_t.length,isKeyframe:bt,duration:At,originalDts:Tt,flags:{isLeading:0,dependsOn:bt?2:1,isDependedOn:bt?1:0,hasRedundancy:0,isNonSync:bt?0:1}})}Ye=new Uint8Array(ze),Ye[0]=ze>>>24&255,Ye[1]=ze>>>16&255,Ye[2]=ze>>>8&255,Ye[3]=ze&255,Ye.set(Ne.types.mdat,4);for(var Ct=0;Ct<it.length;Ct++)for(var xt=it[Ct].units;xt.length;){var Kt=xt.shift(),Nt=Kt.data;Ye.set(Nt,Be),Be+=Nt.byteLength}var wt=it[it.length-1];if(Ce=wt.dts+wt.duration,We=wt.pts+wt.duration,this._videoNextDts=Ce,ct.beginDts=Ae,ct.endDts=Ce,ct.beginPts=Fe,ct.endPts=We,ct.originalBeginDts=it[0].originalDts,ct.originalEndDts=wt.originalDts+wt.duration,ct.firstSample=new Re(it[0].dts,it[0].pts,it[0].duration,it[0].originalDts,it[0].isKeyframe),ct.lastSample=new Re(wt.dts,wt.pts,wt.duration,wt.originalDts,wt.isKeyframe),this._isLive||this._videoSegmentInfoList.append(ct),K.samples=it,K.sequenceNumber++,this._forceFirstIDR){var Rt=it[0].flags;Rt.dependsOn=2,Rt.isNonSync=0}var Mt=Ne.moof(K,Ae);K.samples=[],K.length=0,this._onMediaSegment("video",{type:"video",data:this._mergeBoxes(Mt,Ye).buffer,sampleCount:it.length,info:ct})}},{key:"_mergeBoxes",value:function(I,W){var K=new Uint8Array(I.byteLength+W.byteLength);return K.set(I,0),K.set(W,I.byteLength),K}}]),ce}(),de=ue,_e={IO_ERROR:"io_error",DEMUX_ERROR:"demux_error",INIT_SEGMENT:"init_segment",MEDIA_SEGMENT:"media_segment",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",METADATA_ARRIVED:"metadata_arrived",SCRIPTDATA_ARRIVED:"scriptdata_arrived",STATISTICS_INFO:"statistics_info",RECOMMEND_SEEKPOINT:"recommend_seekpoint"},me=_e,Ie=function(){function ce(te,I){Object(Se.a)(this,ce),this.TAG="TransmuxingController",this._emitter=new E.a,this._config=I,te.segments||(te.segments=[{duration:te.duration,filesize:te.filesize,url:te.url}]),typeof te.cors!="boolean"&&(te.cors=!0),typeof te.withCredentials!="boolean"&&(te.withCredentials=!1),this._mediaDataSource=te,this._currentSegmentIndex=0;var W=0;this._mediaDataSource.segments.forEach(function(K){K.timestampBase=W,W+=K.duration,K.cors=te.cors,K.withCredentials=te.withCredentials,I.referrerPolicy&&(K.referrerPolicy=I.referrerPolicy)}),!isNaN(W)&&this._mediaDataSource.duration!==W&&(this._mediaDataSource.duration=W),this._mediaInfo=null,this._demuxer=null,this._remuxer=null,this._ioctl=null,this._pendingSeekTime=null,this._pendingResolveSeekPoint=null,this._statisticsReporter=null}return Object(Z.a)(ce,[{key:"destroy",value:function(){this._mediaInfo=null,this._mediaDataSource=null,this._statisticsReporter&&this._disableStatisticsReporter(),this._ioctl&&(this._ioctl.destroy(),this._ioctl=null),this._demuxer&&(this._demuxer.destroy(),this._demuxer=null),this._remuxer&&(this._remuxer.destroy(),this._remuxer=null),this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(I,W){this._emitter.addListener(I,W)}},{key:"off",value:function(I,W){this._emitter.removeListener(I,W)}},{key:"start",value:function(){this._loadSegment(0),this._enableStatisticsReporter()}},{key:"_loadSegment",value:function(I,W){this._currentSegmentIndex=I;var K=this._mediaDataSource.segments[I],Y=this._ioctl=new N(K,this._config,I);Y.onError=this._onIOException.bind(this),Y.onSeeked=this._onIOSeeked.bind(this),Y.onComplete=this._onIOComplete.bind(this),Y.onRedirect=this._onIORedirect.bind(this),Y.onRecoveredEarlyEof=this._onIORecoveredEarlyEof.bind(this),W?this._demuxer.bindDataSource(this._ioctl):Y.onDataArrival=this._onInitChunkArrival.bind(this),Y.open(W)}},{key:"stop",value:function(){this._internalAbort(),this._disableStatisticsReporter()}},{key:"_internalAbort",value:function(){this._ioctl&&(this._ioctl.destroy(),this._ioctl=null)}},{key:"pause",value:function(){this._ioctl&&this._ioctl.isWorking()&&(this._ioctl.pause(),this._disableStatisticsReporter())}},{key:"resume",value:function(){this._ioctl&&this._ioctl.isPaused()&&(this._ioctl.resume(),this._enableStatisticsReporter())}},{key:"seek",value:function(I){if(this._mediaInfo==null||!this._mediaInfo.isSeekable())return;var W=this._searchSegmentIndexContains(I);if(W===this._currentSegmentIndex){var K=this._mediaInfo.segments[W];if(K==null)this._pendingSeekTime=I;else{var Y=K.getNearestKeyframe(I);this._remuxer.seek(Y.milliseconds),this._ioctl.seek(Y.fileposition),this._pendingResolveSeekPoint=Y.milliseconds}}else{var le=this._mediaInfo.segments[W];if(le==null)this._pendingSeekTime=I,this._internalAbort(),this._remuxer.seek(),this._remuxer.insertDiscontinuity(),this._loadSegment(W);else{var Ae=le.getNearestKeyframe(I);this._internalAbort(),this._remuxer.seek(I),this._remuxer.insertDiscontinuity(),this._demuxer.resetMediaInfo(),this._demuxer.timestampBase=this._mediaDataSource.segments[W].timestampBase,this._loadSegment(W,Ae.fileposition),this._pendingResolveSeekPoint=Ae.milliseconds,this._reportSegmentMediaInfo(W)}}this._enableStatisticsReporter()}},{key:"_searchSegmentIndexContains",value:function(I){for(var W=this._mediaDataSource.segments,K=W.length-1,Y=0;Y<W.length;Y++)if(I<W[Y].timestampBase){K=Y-1;break}return K}},{key:"_onInitChunkArrival",value:function(I,W){var K=this,Y=null,le=0;if(W>0)this._demuxer.bindDataSource(this._ioctl),this._demuxer.timestampBase=this._mediaDataSource.segments[this._currentSegmentIndex].timestampBase,le=this._demuxer.parseChunks(I,W);else if((Y=Oe.probe(I)).match){this._demuxer=new Oe(Y,this._config),this._remuxer||(this._remuxer=new de(this._config));var Ae=this._mediaDataSource;Ae.duration!=null&&!isNaN(Ae.duration)&&(this._demuxer.overridedDuration=Ae.duration),typeof Ae.hasAudio=="boolean"&&(this._demuxer.overridedHasAudio=Ae.hasAudio),typeof Ae.hasVideo=="boolean"&&(this._demuxer.overridedHasVideo=Ae.hasVideo),this._demuxer.timestampBase=Ae.segments[this._currentSegmentIndex].timestampBase,this._demuxer.onError=this._onDemuxException.bind(this),this._demuxer.onMediaInfo=this._onMediaInfo.bind(this),this._demuxer.onMetaDataArrived=this._onMetaDataArrived.bind(this),this._demuxer.onScriptDataArrived=this._onScriptDataArrived.bind(this),this._remuxer.bindDataSource(this._demuxer.bindDataSource(this._ioctl)),this._remuxer.onInitSegment=this._onRemuxerInitSegmentArrival.bind(this),this._remuxer.onMediaSegment=this._onRemuxerMediaSegmentArrival.bind(this),le=this._demuxer.parseChunks(I,W)}else Y=null,w.e(this.TAG,"Non-FLV, Unsupported media type!"),Promise.resolve().then(function(){K._internalAbort()}),this._emitter.emit(me.DEMUX_ERROR,M.FORMAT_UNSUPPORTED,"Non-FLV, Unsupported media type"),le=0;return le}},{key:"_onMediaInfo",value:function(I){var W=this;this._mediaInfo==null&&(this._mediaInfo=Object.assign({},I),this._mediaInfo.keyframesIndex=null,this._mediaInfo.segments=[],this._mediaInfo.segmentCount=this._mediaDataSource.segments.length,Object.setPrototypeOf(this._mediaInfo,re.prototype));var K=Object.assign({},I);Object.setPrototypeOf(K,re.prototype),this._mediaInfo.segments[this._currentSegmentIndex]=K,this._reportSegmentMediaInfo(this._currentSegmentIndex),this._pendingSeekTime!=null&&Promise.resolve().then(function(){var Y=W._pendingSeekTime;W._pendingSeekTime=null,W.seek(Y)})}},{key:"_onMetaDataArrived",value:function(I){this._emitter.emit(me.METADATA_ARRIVED,I)}},{key:"_onScriptDataArrived",value:function(I){this._emitter.emit(me.SCRIPTDATA_ARRIVED,I)}},{key:"_onIOSeeked",value:function(){this._remuxer.insertDiscontinuity()}},{key:"_onIOComplete",value:function(I){var W=I,K=W+1;K<this._mediaDataSource.segments.length?(this._internalAbort(),this._remuxer.flushStashedSamples(),this._loadSegment(K)):(this._remuxer.flushStashedSamples(),this._emitter.emit(me.LOADING_COMPLETE),this._disableStatisticsReporter())}},{key:"_onIORedirect",value:function(I){var W=this._ioctl.extraData;this._mediaDataSource.segments[W].redirectedURL=I}},{key:"_onIORecoveredEarlyEof",value:function(){this._emitter.emit(me.RECOVERED_EARLY_EOF)}},{key:"_onIOException",value:function(I,W){w.e(this.TAG,"IOException: type = ".concat(I,", code = ").concat(W.code,", msg = ").concat(W.msg)),this._emitter.emit(me.IO_ERROR,I,W),this._disableStatisticsReporter()}},{key:"_onDemuxException",value:function(I,W){w.e(this.TAG,"DemuxException: type = ".concat(I,", info = ").concat(W)),this._emitter.emit(me.DEMUX_ERROR,I,W)}},{key:"_onRemuxerInitSegmentArrival",value:function(I,W){this._emitter.emit(me.INIT_SEGMENT,I,W)}},{key:"_onRemuxerMediaSegmentArrival",value:function(I,W){if(this._pendingSeekTime!=null)return;if(this._emitter.emit(me.MEDIA_SEGMENT,I,W),this._pendingResolveSeekPoint!=null&&I==="video"){var K=W.info.syncPoints,Y=this._pendingResolveSeekPoint;this._pendingResolveSeekPoint=null,m.safari&&K.length>0&&K[0].originalDts===Y&&(Y=K[0].pts),this._emitter.emit(me.RECOMMEND_SEEKPOINT,Y)}}},{key:"_enableStatisticsReporter",value:function(){this._statisticsReporter==null&&(this._statisticsReporter=self.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval))}},{key:"_disableStatisticsReporter",value:function(){this._statisticsReporter&&(self.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}},{key:"_reportSegmentMediaInfo",value:function(I){var W=this._mediaInfo.segments[I],K=Object.assign({},W);K.duration=this._mediaInfo.duration,K.segmentCount=this._mediaInfo.segmentCount,delete K.segments,delete K.keyframesIndex,this._emitter.emit(me.MEDIA_INFO,K)}},{key:"_reportStatisticsInfo",value:function(){var I={};I.url=this._ioctl.currentURL,I.hasRedirect=this._ioctl.hasRedirect,I.hasRedirect&&(I.redirectedURL=this._ioctl.currentRedirectedURL),I.speed=this._ioctl.currentSpeed,I.loaderType=this._ioctl.loaderType,I.currentSegmentIndex=this._currentSegmentIndex,I.totalSegmentCount=this._mediaDataSource.segments.length,this._emitter.emit(me.STATISTICS_INFO,I)}}]),ce}(),Me=Ie,Ve=function(te){var I="TransmuxingWorker",W=null,K=Xe.bind(this);_.install(),te.addEventListener("message",function(He){switch(He.data.cmd){case"init":W=new Me(He.data.param[0],He.data.param[1]),W.on(me.IO_ERROR,ze.bind(this)),W.on(me.DEMUX_ERROR,Ue.bind(this)),W.on(me.INIT_SEGMENT,Y.bind(this)),W.on(me.MEDIA_SEGMENT,le.bind(this)),W.on(me.LOADING_COMPLETE,Ae.bind(this)),W.on(me.RECOVERED_EARLY_EOF,Ce.bind(this)),W.on(me.MEDIA_INFO,Fe.bind(this)),W.on(me.METADATA_ARRIVED,We.bind(this)),W.on(me.SCRIPTDATA_ARRIVED,Be.bind(this)),W.on(me.STATISTICS_INFO,Ye.bind(this)),W.on(me.RECOMMEND_SEEKPOINT,qe.bind(this));break;case"destroy":W&&(W.destroy(),W=null),te.postMessage({msg:"destroyed"});break;case"start":W.start();break;case"stop":W.stop();break;case"seek":W.seek(He.data.param);break;case"pause":W.pause();break;case"resume":W.resume();break;case"logging_config":{var je=He.data.param;ge.applyConfig(je),je.enableCallback===!0?ge.addLogListener(K):ge.removeLogListener(K);break}}});function Y(He,je){var rt={msg:me.INIT_SEGMENT,data:{type:He,data:je}};te.postMessage(rt,[je.data])}function le(He,je){var rt={msg:me.MEDIA_SEGMENT,data:{type:He,data:je}};te.postMessage(rt,[je.data])}function Ae(){var He={msg:me.LOADING_COMPLETE};te.postMessage(He)}function Ce(){var He={msg:me.RECOVERED_EARLY_EOF};te.postMessage(He)}function Fe(He){var je={msg:me.MEDIA_INFO,data:He};te.postMessage(je)}function We(He){var je={msg:me.METADATA_ARRIVED,data:He};te.postMessage(je)}function Be(He){var je={msg:me.SCRIPTDATA_ARRIVED,data:He};te.postMessage(je)}function Ye(He){var je={msg:me.STATISTICS_INFO,data:He};te.postMessage(je)}function ze(He,je){te.postMessage({msg:me.IO_ERROR,data:{type:He,info:je}})}function Ue(He,je){te.postMessage({msg:me.DEMUX_ERROR,data:{type:He,info:je}})}function qe(He){te.postMessage({msg:me.RECOMMEND_SEEKPOINT,data:He})}function Xe(He,je){te.postMessage({msg:"logcat_callback",data:{type:He,logcat:je}})}},ot=Ve,tt=function(){function ce(te,I){if(Object(Se.a)(this,ce),this.TAG="Transmuxer",this._emitter=new E.a,I.enableWorker&&typeof Worker!="undefined")try{var W=ye("0r65");this._worker=W(ot),this._workerDestroying=!1,this._worker.addEventListener("message",this._onWorkerMessage.bind(this)),this._worker.postMessage({cmd:"init",param:[te,I]}),this.e={onLoggingConfigChanged:this._onLoggingConfigChanged.bind(this)},ge.registerListener(this.e.onLoggingConfigChanged),this._worker.postMessage({cmd:"logging_config",param:ge.getConfig()})}catch(Y){w.e(this.TAG,"Error while initialize transmuxing worker, fallback to inline transmuxing"),this._worker=null,this._controller=new Me(te,I)}else this._controller=new Me(te,I);if(this._controller){var K=this._controller;K.on(me.IO_ERROR,this._onIOError.bind(this)),K.on(me.DEMUX_ERROR,this._onDemuxError.bind(this)),K.on(me.INIT_SEGMENT,this._onInitSegment.bind(this)),K.on(me.MEDIA_SEGMENT,this._onMediaSegment.bind(this)),K.on(me.LOADING_COMPLETE,this._onLoadingComplete.bind(this)),K.on(me.RECOVERED_EARLY_EOF,this._onRecoveredEarlyEof.bind(this)),K.on(me.MEDIA_INFO,this._onMediaInfo.bind(this)),K.on(me.METADATA_ARRIVED,this._onMetaDataArrived.bind(this)),K.on(me.SCRIPTDATA_ARRIVED,this._onScriptDataArrived.bind(this)),K.on(me.STATISTICS_INFO,this._onStatisticsInfo.bind(this)),K.on(me.RECOMMEND_SEEKPOINT,this._onRecommendSeekpoint.bind(this))}}return Object(Z.a)(ce,[{key:"destroy",value:function(){this._worker?this._workerDestroying||(this._workerDestroying=!0,this._worker.postMessage({cmd:"destroy"}),ge.removeListener(this.e.onLoggingConfigChanged),this.e=null):(this._controller.destroy(),this._controller=null),this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(I,W){this._emitter.addListener(I,W)}},{key:"off",value:function(I,W){this._emitter.removeListener(I,W)}},{key:"hasWorker",value:function(){return this._worker!=null}},{key:"open",value:function(){this._worker?this._worker.postMessage({cmd:"start"}):this._controller.start()}},{key:"close",value:function(){this._worker?this._worker.postMessage({cmd:"stop"}):this._controller.stop()}},{key:"seek",value:function(I){this._worker?this._worker.postMessage({cmd:"seek",param:I}):this._controller.seek(I)}},{key:"pause",value:function(){this._worker?this._worker.postMessage({cmd:"pause"}):this._controller.pause()}},{key:"resume",value:function(){this._worker?this._worker.postMessage({cmd:"resume"}):this._controller.resume()}},{key:"_onInitSegment",value:function(I,W){var K=this;Promise.resolve().then(function(){K._emitter.emit(me.INIT_SEGMENT,I,W)})}},{key:"_onMediaSegment",value:function(I,W){var K=this;Promise.resolve().then(function(){K._emitter.emit(me.MEDIA_SEGMENT,I,W)})}},{key:"_onLoadingComplete",value:function(){var I=this;Promise.resolve().then(function(){I._emitter.emit(me.LOADING_COMPLETE)})}},{key:"_onRecoveredEarlyEof",value:function(){var I=this;Promise.resolve().then(function(){I._emitter.emit(me.RECOVERED_EARLY_EOF)})}},{key:"_onMediaInfo",value:function(I){var W=this;Promise.resolve().then(function(){W._emitter.emit(me.MEDIA_INFO,I)})}},{key:"_onMetaDataArrived",value:function(I){var W=this;Promise.resolve().then(function(){W._emitter.emit(me.METADATA_ARRIVED,I)})}},{key:"_onScriptDataArrived",value:function(I){var W=this;Promise.resolve().then(function(){W._emitter.emit(me.SCRIPTDATA_ARRIVED,I)})}},{key:"_onStatisticsInfo",value:function(I){var W=this;Promise.resolve().then(function(){W._emitter.emit(me.STATISTICS_INFO,I)})}},{key:"_onIOError",value:function(I,W){var K=this;Promise.resolve().then(function(){K._emitter.emit(me.IO_ERROR,I,W)})}},{key:"_onDemuxError",value:function(I,W){var K=this;Promise.resolve().then(function(){K._emitter.emit(me.DEMUX_ERROR,I,W)})}},{key:"_onRecommendSeekpoint",value:function(I){var W=this;Promise.resolve().then(function(){W._emitter.emit(me.RECOMMEND_SEEKPOINT,I)})}},{key:"_onLoggingConfigChanged",value:function(I){this._worker&&this._worker.postMessage({cmd:"logging_config",param:I})}},{key:"_onWorkerMessage",value:function(I){var W=I.data,K=W.data;if(W.msg==="destroyed"||this._workerDestroying){this._workerDestroying=!1,this._worker.terminate(),this._worker=null;return}switch(W.msg){case me.INIT_SEGMENT:case me.MEDIA_SEGMENT:this._emitter.emit(W.msg,K.type,K.data);break;case me.LOADING_COMPLETE:case me.RECOVERED_EARLY_EOF:this._emitter.emit(W.msg);break;case me.MEDIA_INFO:Object.setPrototypeOf(K,re.prototype),this._emitter.emit(W.msg,K);break;case me.METADATA_ARRIVED:case me.SCRIPTDATA_ARRIVED:case me.STATISTICS_INFO:this._emitter.emit(W.msg,K);break;case me.IO_ERROR:case me.DEMUX_ERROR:this._emitter.emit(W.msg,K.type,K.info);break;case me.RECOMMEND_SEEKPOINT:this._emitter.emit(W.msg,K);break;case"logcat_callback":w.emitter.emit("log",K.type,K.logcat);break;default:break}}}]),ce}(),Ge=tt,Je={ERROR:"error",SOURCE_OPEN:"source_open",UPDATE_END:"update_end",BUFFER_FULL:"buffer_full"},$e=Je,et=function(){function ce(te){Object(Se.a)(this,ce),this.TAG="MSEController",this._config=te,this._emitter=new E.a,this._config.isLive&&this._config.autoCleanupSourceBuffer==null&&(this._config.autoCleanupSourceBuffer=!0),this.e={onSourceOpen:this._onSourceOpen.bind(this),onSourceEnded:this._onSourceEnded.bind(this),onSourceClose:this._onSourceClose.bind(this),onSourceBufferError:this._onSourceBufferError.bind(this),onSourceBufferUpdateEnd:this._onSourceBufferUpdateEnd.bind(this)},this._mediaSource=null,this._mediaSourceObjectURL=null,this._mediaElement=null,this._isBufferFull=!1,this._hasPendingEos=!1,this._requireSetMediaDuration=!1,this._pendingMediaDuration=0,this._pendingSourceBufferInit=[],this._mimeTypes={video:null,audio:null},this._sourceBuffers={video:null,audio:null},this._lastInitSegments={video:null,audio:null},this._pendingSegments={video:[],audio:[]},this._pendingRemoveRanges={video:[],audio:[]},this._idrList=new we}return Object(Z.a)(ce,[{key:"destroy",value:function(){(this._mediaElement||this._mediaSource)&&this.detachMediaElement(),this.e=null,this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(I,W){this._emitter.addListener(I,W)}},{key:"off",value:function(I,W){this._emitter.removeListener(I,W)}},{key:"attachMediaElement",value:function(I){if(this._mediaSource)throw new i("MediaSource has been attached to an HTMLMediaElement!");var W=this._mediaSource=new window.MediaSource;W.addEventListener("sourceopen",this.e.onSourceOpen),W.addEventListener("sourceended",this.e.onSourceEnded),W.addEventListener("sourceclose",this.e.onSourceClose),this._mediaElement=I,this._mediaSourceObjectURL=window.URL.createObjectURL(this._mediaSource),I.src=this._mediaSourceObjectURL}},{key:"detachMediaElement",value:function(){if(this._mediaSource){var I=this._mediaSource;for(var W in this._sourceBuffers){var K=this._pendingSegments[W];K.splice(0,K.length),this._pendingSegments[W]=null,this._pendingRemoveRanges[W]=null,this._lastInitSegments[W]=null;var Y=this._sourceBuffers[W];if(Y){if(I.readyState!=="closed"){try{I.removeSourceBuffer(Y)}catch(le){w.e(this.TAG,le.message)}Y.removeEventListener("error",this.e.onSourceBufferError),Y.removeEventListener("updateend",this.e.onSourceBufferUpdateEnd)}this._mimeTypes[W]=null,this._sourceBuffers[W]=null}}if(I.readyState==="open")try{I.endOfStream()}catch(le){w.e(this.TAG,le.message)}I.removeEventListener("sourceopen",this.e.onSourceOpen),I.removeEventListener("sourceended",this.e.onSourceEnded),I.removeEventListener("sourceclose",this.e.onSourceClose),this._pendingSourceBufferInit=[],this._isBufferFull=!1,this._idrList.clear(),this._mediaSource=null}this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement=null),this._mediaSourceObjectURL&&(window.URL.revokeObjectURL(this._mediaSourceObjectURL),this._mediaSourceObjectURL=null)}},{key:"appendInitSegment",value:function(I,W){if(!this._mediaSource||this._mediaSource.readyState!=="open"){this._pendingSourceBufferInit.push(I),this._pendingSegments[I.type].push(I);return}var K=I,Y="".concat(K.container);K.codec&&K.codec.length>0&&(Y+=";codecs=".concat(K.codec));var le=!1;if(w.v(this.TAG,"Received Initialization Segment, mimeType: "+Y),this._lastInitSegments[K.type]=K,Y!==this._mimeTypes[K.type]){if(this._mimeTypes[K.type])w.v(this.TAG,"Notice: ".concat(K.type," mimeType changed, origin: ").concat(this._mimeTypes[K.type],", target: ").concat(Y));else{le=!0;try{var Ae=this._sourceBuffers[K.type]=this._mediaSource.addSourceBuffer(Y);Ae.addEventListener("error",this.e.onSourceBufferError),Ae.addEventListener("updateend",this.e.onSourceBufferUpdateEnd)}catch(Ce){w.e(this.TAG,Ce.message),this._emitter.emit($e.ERROR,{code:Ce.code,msg:Ce.message});return}}this._mimeTypes[K.type]=Y}W||this._pendingSegments[K.type].push(K),le||this._sourceBuffers[K.type]&&!this._sourceBuffers[K.type].updating&&this._doAppendSegments(),m.safari&&K.container==="audio/mpeg"&&K.mediaDuration>0&&(this._requireSetMediaDuration=!0,this._pendingMediaDuration=K.mediaDuration/1e3,this._updateMediaSourceDuration())}},{key:"appendMediaSegment",value:function(I){var W=I;this._pendingSegments[W.type].push(W),this._config.autoCleanupSourceBuffer&&this._needCleanupSourceBuffer()&&this._doCleanupSourceBuffer();var K=this._sourceBuffers[W.type];K&&!K.updating&&!this._hasPendingRemoveRanges()&&this._doAppendSegments()}},{key:"seek",value:function(I){for(var W in this._sourceBuffers){if(!this._sourceBuffers[W])continue;var K=this._sourceBuffers[W];if(this._mediaSource.readyState==="open")try{K.abort()}catch(We){w.e(this.TAG,We.message)}this._idrList.clear();var Y=this._pendingSegments[W];if(Y.splice(0,Y.length),this._mediaSource.readyState==="closed")continue;for(var le=0;le<K.buffered.length;le++){var Ae=K.buffered.start(le),Ce=K.buffered.end(le);this._pendingRemoveRanges[W].push({start:Ae,end:Ce})}if(K.updating||this._doRemoveRanges(),m.safari){var Fe=this._lastInitSegments[W];Fe&&(this._pendingSegments[W].push(Fe),K.updating||this._doAppendSegments())}}}},{key:"endOfStream",value:function(){var I=this._mediaSource,W=this._sourceBuffers;if(!I||I.readyState!=="open"){I&&I.readyState==="closed"&&this._hasPendingSegments()&&(this._hasPendingEos=!0);return}W.video&&W.video.updating||W.audio&&W.audio.updating?this._hasPendingEos=!0:(this._hasPendingEos=!1,I.endOfStream())}},{key:"getNearestKeyframe",value:function(I){return this._idrList.getLastSyncPointBeforeDts(I)}},{key:"_needCleanupSourceBuffer",value:function(){if(!this._config.autoCleanupSourceBuffer)return!1;var I=this._mediaElement.currentTime;for(var W in this._sourceBuffers){var K=this._sourceBuffers[W];if(K){var Y=K.buffered;if(Y.length>=1&&I-Y.start(0)>=this._config.autoCleanupMaxBackwardDuration)return!0}}return!1}},{key:"_doCleanupSourceBuffer",value:function(){var I=this._mediaElement.currentTime;for(var W in this._sourceBuffers){var K=this._sourceBuffers[W];if(K){for(var Y=K.buffered,le=!1,Ae=0;Ae<Y.length;Ae++){var Ce=Y.start(Ae),Fe=Y.end(Ae);if(Ce<=I&&I<Fe+3){if(I-Ce>=this._config.autoCleanupMaxBackwardDuration){le=!0;var We=I-this._config.autoCleanupMinBackwardDuration;this._pendingRemoveRanges[W].push({start:Ce,end:We})}}else Fe<I&&(le=!0,this._pendingRemoveRanges[W].push({start:Ce,end:Fe}))}le&&!K.updating&&this._doRemoveRanges()}}}},{key:"_updateMediaSourceDuration",value:function(){var I=this._sourceBuffers;if(this._mediaElement.readyState===0||this._mediaSource.readyState!=="open")return;if(I.video&&I.video.updating||I.audio&&I.audio.updating)return;var W=this._mediaSource.duration,K=this._pendingMediaDuration;K>0&&(isNaN(W)||K>W)&&(w.v(this.TAG,"Update MediaSource duration from ".concat(W," to ").concat(K)),this._mediaSource.duration=K),this._requireSetMediaDuration=!1,this._pendingMediaDuration=0}},{key:"_doRemoveRanges",value:function(){for(var I in this._pendingRemoveRanges){if(!this._sourceBuffers[I]||this._sourceBuffers[I].updating)continue;for(var W=this._sourceBuffers[I],K=this._pendingRemoveRanges[I];K.length&&!W.updating;){var Y=K.shift();W.remove(Y.start,Y.end)}}}},{key:"_doAppendSegments",value:function(){var I=this._pendingSegments;for(var W in I){if(!this._sourceBuffers[W]||this._sourceBuffers[W].updating)continue;if(I[W].length>0){var K=I[W].shift();if(K.timestampOffset){var Y=this._sourceBuffers[W].timestampOffset,le=K.timestampOffset/1e3,Ae=Math.abs(Y-le);Ae>.1&&(w.v(this.TAG,"Update MPEG audio timestampOffset from ".concat(Y," to ").concat(le)),this._sourceBuffers[W].timestampOffset=le),delete K.timestampOffset}if(!K.data||K.data.byteLength===0)continue;try{this._sourceBuffers[W].appendBuffer(K.data),this._isBufferFull=!1,W==="video"&&K.hasOwnProperty("info")&&this._idrList.appendArray(K.info.syncPoints)}catch(Ce){this._pendingSegments[W].unshift(K),Ce.code===22?(this._isBufferFull||this._emitter.emit($e.BUFFER_FULL),this._isBufferFull=!0):(w.e(this.TAG,Ce.message),this._emitter.emit($e.ERROR,{code:Ce.code,msg:Ce.message}))}}}}},{key:"_onSourceOpen",value:function(){if(w.v(this.TAG,"MediaSource onSourceOpen"),this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._pendingSourceBufferInit.length>0)for(var I=this._pendingSourceBufferInit;I.length;){var W=I.shift();this.appendInitSegment(W,!0)}this._hasPendingSegments()&&this._doAppendSegments(),this._emitter.emit($e.SOURCE_OPEN)}},{key:"_onSourceEnded",value:function(){w.v(this.TAG,"MediaSource onSourceEnded")}},{key:"_onSourceClose",value:function(){w.v(this.TAG,"MediaSource onSourceClose"),this._mediaSource&&this.e!=null&&(this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._mediaSource.removeEventListener("sourceended",this.e.onSourceEnded),this._mediaSource.removeEventListener("sourceclose",this.e.onSourceClose))}},{key:"_hasPendingSegments",value:function(){var I=this._pendingSegments;return I.video.length>0||I.audio.length>0}},{key:"_hasPendingRemoveRanges",value:function(){var I=this._pendingRemoveRanges;return I.video.length>0||I.audio.length>0}},{key:"_onSourceBufferUpdateEnd",value:function(){this._requireSetMediaDuration?this._updateMediaSourceDuration():this._hasPendingRemoveRanges()?this._doRemoveRanges():this._hasPendingSegments()?this._doAppendSegments():this._hasPendingEos&&this.endOfStream(),this._emitter.emit($e.UPDATE_END)}},{key:"_onSourceBufferError",value:function(I){w.e(this.TAG,"SourceBuffer Error: ".concat(I))}}]),ce}(),nt=et,at={NETWORK_ERROR:"NetworkError",MEDIA_ERROR:"MediaError",OTHER_ERROR:"OtherError"},ft={NETWORK_EXCEPTION:e.EXCEPTION,NETWORK_STATUS_CODE_INVALID:e.HTTP_STATUS_CODE_INVALID,NETWORK_TIMEOUT:e.CONNECTING_TIMEOUT,NETWORK_UNRECOVERABLE_EARLY_EOF:e.UNRECOVERABLE_EARLY_EOF,MEDIA_MSE_ERROR:"MediaMSEError",MEDIA_FORMAT_ERROR:M.FORMAT_ERROR,MEDIA_FORMAT_UNSUPPORTED:M.FORMAT_UNSUPPORTED,MEDIA_CODEC_UNSUPPORTED:M.CODEC_UNSUPPORTED},yt=function(){function ce(te,I){if(Object(Se.a)(this,ce),this.TAG="FlvPlayer",this._type="FlvPlayer",this._emitter=new E.a,this._config=q(),typeof I=="object"&&Object.assign(this._config,I),te.type.toLowerCase()!=="flv")throw new s("FlvPlayer requires an flv MediaDataSource input!");te.isLive===!0&&(this._config.isLive=!0),this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this),onvSeeking:this._onvSeeking.bind(this),onvCanPlay:this._onvCanPlay.bind(this),onvStalled:this._onvStalled.bind(this),onvProgress:this._onvProgress.bind(this)},self.performance&&self.performance.now?this._now=self.performance.now.bind(self.performance):this._now=Date.now,this._pendingSeekTime=null,this._requestSetTime=!1,this._seekpointRecord=null,this._progressChecker=null,this._mediaDataSource=te,this._mediaElement=null,this._msectl=null,this._transmuxer=null,this._mseSourceOpened=!1,this._hasPendingLoad=!1,this._receivedCanPlay=!1,this._mediaInfo=null,this._statisticsInfo=null;var W=m.chrome&&(m.version.major<50||m.version.major===50&&m.version.build<2661);this._alwaysSeekKeyframe=!!(W||m.msedge||m.msie),this._alwaysSeekKeyframe&&(this._config.accurateSeek=!1)}return Object(Z.a)(ce,[{key:"destroy",value:function(){this._progressChecker!=null&&(window.clearInterval(this._progressChecker),this._progressChecker=null),this._transmuxer&&this.unload(),this._mediaElement&&this.detachMediaElement(),this.e=null,this._mediaDataSource=null,this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(I,W){var K=this;I===he.MEDIA_INFO?this._mediaInfo!=null&&Promise.resolve().then(function(){K._emitter.emit(he.MEDIA_INFO,K.mediaInfo)}):I===he.STATISTICS_INFO&&(this._statisticsInfo!=null&&Promise.resolve().then(function(){K._emitter.emit(he.STATISTICS_INFO,K.statisticsInfo)})),this._emitter.addListener(I,W)}},{key:"off",value:function(I,W){this._emitter.removeListener(I,W)}},{key:"attachMediaElement",value:function(I){var W=this;if(this._mediaElement=I,I.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),I.addEventListener("seeking",this.e.onvSeeking),I.addEventListener("canplay",this.e.onvCanPlay),I.addEventListener("stalled",this.e.onvStalled),I.addEventListener("progress",this.e.onvProgress),this._msectl=new nt(this._config),this._msectl.on($e.UPDATE_END,this._onmseUpdateEnd.bind(this)),this._msectl.on($e.BUFFER_FULL,this._onmseBufferFull.bind(this)),this._msectl.on($e.SOURCE_OPEN,function(){W._mseSourceOpened=!0,W._hasPendingLoad&&(W._hasPendingLoad=!1,W.load())}),this._msectl.on($e.ERROR,function(K){W._emitter.emit(he.ERROR,at.MEDIA_ERROR,ft.MEDIA_MSE_ERROR,K)}),this._msectl.attachMediaElement(I),this._pendingSeekTime!=null)try{I.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(K){}}},{key:"detachMediaElement",value:function(){this._mediaElement&&(this._msectl.detachMediaElement(),this._mediaElement.removeEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._mediaElement.removeEventListener("seeking",this.e.onvSeeking),this._mediaElement.removeEventListener("canplay",this.e.onvCanPlay),this._mediaElement.removeEventListener("stalled",this.e.onvStalled),this._mediaElement.removeEventListener("progress",this.e.onvProgress),this._mediaElement=null),this._msectl&&(this._msectl.destroy(),this._msectl=null)}},{key:"load",value:function(){var I=this;if(!this._mediaElement)throw new i("HTMLMediaElement must be attached before load()!");if(this._transmuxer)throw new i("FlvPlayer.load() has been called, please call unload() first!");if(this._hasPendingLoad)return;if(this._config.deferLoadAfterSourceOpen&&this._mseSourceOpened===!1){this._hasPendingLoad=!0;return}this._mediaElement.readyState>0&&(this._requestSetTime=!0,this._mediaElement.currentTime=0),this._transmuxer=new Ge(this._mediaDataSource,this._config),this._transmuxer.on(me.INIT_SEGMENT,function(W,K){I._msectl.appendInitSegment(K)}),this._transmuxer.on(me.MEDIA_SEGMENT,function(W,K){if(I._msectl.appendMediaSegment(K),I._config.lazyLoad&&!I._config.isLive){var Y=I._mediaElement.currentTime;K.info.endDts>=(Y+I._config.lazyLoadMaxDuration)*1e3&&(I._progressChecker==null&&(w.v(I.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),I._suspendTransmuxer()))}}),this._transmuxer.on(me.LOADING_COMPLETE,function(){I._msectl.endOfStream(),I._emitter.emit(he.LOADING_COMPLETE)}),this._transmuxer.on(me.RECOVERED_EARLY_EOF,function(){I._emitter.emit(he.RECOVERED_EARLY_EOF)}),this._transmuxer.on(me.IO_ERROR,function(W,K){I._emitter.emit(he.ERROR,at.NETWORK_ERROR,W,K)}),this._transmuxer.on(me.DEMUX_ERROR,function(W,K){I._emitter.emit(he.ERROR,at.MEDIA_ERROR,W,{code:-1,msg:K})}),this._transmuxer.on(me.MEDIA_INFO,function(W){I._mediaInfo=W,I._emitter.emit(he.MEDIA_INFO,Object.assign({},W))}),this._transmuxer.on(me.METADATA_ARRIVED,function(W){I._emitter.emit(he.METADATA_ARRIVED,W)}),this._transmuxer.on(me.SCRIPTDATA_ARRIVED,function(W){I._emitter.emit(he.SCRIPTDATA_ARRIVED,W)}),this._transmuxer.on(me.STATISTICS_INFO,function(W){I._statisticsInfo=I._fillStatisticsInfo(W),I._emitter.emit(he.STATISTICS_INFO,Object.assign({},I._statisticsInfo))}),this._transmuxer.on(me.RECOMMEND_SEEKPOINT,function(W){I._mediaElement&&!I._config.accurateSeek&&(I._requestSetTime=!0,I._mediaElement.currentTime=W/1e3)}),this._transmuxer.open()}},{key:"unload",value:function(){this._mediaElement&&this._mediaElement.pause(),this._msectl&&this._msectl.seek(0),this._transmuxer&&(this._transmuxer.close(),this._transmuxer.destroy(),this._transmuxer=null)}},{key:"play",value:function(){return this._mediaElement.play()}},{key:"pause",value:function(){this._mediaElement.pause()}},{key:"type",get:function(){return this._type}},{key:"buffered",get:function(){return this._mediaElement.buffered}},{key:"duration",get:function(){return this._mediaElement.duration}},{key:"volume",get:function(){return this._mediaElement.volume},set:function(I){this._mediaElement.volume=I}},{key:"muted",get:function(){return this._mediaElement.muted},set:function(I){this._mediaElement.muted=I}},{key:"currentTime",get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(I){this._mediaElement?this._internalSeek(I):this._pendingSeekTime=I}},{key:"mediaInfo",get:function(){return Object.assign({},this._mediaInfo)}},{key:"statisticsInfo",get:function(){return this._statisticsInfo==null&&(this._statisticsInfo={}),this._statisticsInfo=this._fillStatisticsInfo(this._statisticsInfo),Object.assign({},this._statisticsInfo)}},{key:"_fillStatisticsInfo",value:function(I){if(I.playerType=this._type,!(this._mediaElement instanceof HTMLVideoElement))return I;var W=!0,K=0,Y=0;if(this._mediaElement.getVideoPlaybackQuality){var le=this._mediaElement.getVideoPlaybackQuality();K=le.totalVideoFrames,Y=le.droppedVideoFrames}else this._mediaElement.webkitDecodedFrameCount!=null?(K=this._mediaElement.webkitDecodedFrameCount,Y=this._mediaElement.webkitDroppedFrameCount):W=!1;return W&&(I.decodedFrames=K,I.droppedFrames=Y),I}},{key:"_onmseUpdateEnd",value:function(){if(!this._config.lazyLoad||this._config.isLive)return;for(var I=this._mediaElement.buffered,W=this._mediaElement.currentTime,K=0,Y=0,le=0;le<I.length;le++){var Ae=I.start(le),Ce=I.end(le);if(Ae<=W&&W<Ce){K=Ae,Y=Ce;break}}Y>=W+this._config.lazyLoadMaxDuration&&this._progressChecker==null&&(w.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}},{key:"_onmseBufferFull",value:function(){w.v(this.TAG,"MSE SourceBuffer is full, suspend transmuxing task"),this._progressChecker==null&&this._suspendTransmuxer()}},{key:"_suspendTransmuxer",value:function(){this._transmuxer&&(this._transmuxer.pause(),this._progressChecker==null&&(this._progressChecker=window.setInterval(this._checkProgressAndResume.bind(this),1e3)))}},{key:"_checkProgressAndResume",value:function(){for(var I=this._mediaElement.currentTime,W=this._mediaElement.buffered,K=!1,Y=0;Y<W.length;Y++){var le=W.start(Y),Ae=W.end(Y);if(I>=le&&I<Ae){I>=Ae-this._config.lazyLoadRecoverDuration&&(K=!0);break}}K&&(window.clearInterval(this._progressChecker),this._progressChecker=null,K&&(w.v(this.TAG,"Continue loading from paused position"),this._transmuxer.resume()))}},{key:"_isTimepointBuffered",value:function(I){for(var W=this._mediaElement.buffered,K=0;K<W.length;K++){var Y=W.start(K),le=W.end(K);if(I>=Y&&I<le)return!0}return!1}},{key:"_internalSeek",value:function(I){var W=this._isTimepointBuffered(I),K=!1,Y=0;if(I<1&&this._mediaElement.buffered.length>0){var le=this._mediaElement.buffered.start(0);(le<1&&I<le||m.safari)&&(K=!0,Y=m.safari?.1:le)}if(K)this._requestSetTime=!0,this._mediaElement.currentTime=Y;else if(W){if(!this._alwaysSeekKeyframe)this._requestSetTime=!0,this._mediaElement.currentTime=I;else{var Ae=this._msectl.getNearestKeyframe(Math.floor(I*1e3));this._requestSetTime=!0,Ae!=null?this._mediaElement.currentTime=Ae.dts/1e3:this._mediaElement.currentTime=I}this._progressChecker!=null&&this._checkProgressAndResume()}else this._progressChecker!=null&&(window.clearInterval(this._progressChecker),this._progressChecker=null),this._msectl.seek(I),this._transmuxer.seek(Math.floor(I*1e3)),this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement.currentTime=I)}},{key:"_checkAndApplyUnbufferedSeekpoint",value:function(){if(this._seekpointRecord)if(this._seekpointRecord.recordTime<=this._now()-100){var I=this._mediaElement.currentTime;this._seekpointRecord=null,this._isTimepointBuffered(I)||(this._progressChecker!=null&&(window.clearTimeout(this._progressChecker),this._progressChecker=null),this._msectl.seek(I),this._transmuxer.seek(Math.floor(I*1e3)),this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement.currentTime=I))}else window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this),50)}},{key:"_checkAndResumeStuckPlayback",value:function(I){var W=this._mediaElement;if(I||!this._receivedCanPlay||W.readyState<2){var K=W.buffered;K.length>0&&W.currentTime<K.start(0)&&(w.w(this.TAG,"Playback seems stuck at ".concat(W.currentTime,", seek to ").concat(K.start(0))),this._requestSetTime=!0,this._mediaElement.currentTime=K.start(0),this._mediaElement.removeEventListener("progress",this.e.onvProgress))}else this._mediaElement.removeEventListener("progress",this.e.onvProgress)}},{key:"_onvLoadedMetadata",value:function(I){this._pendingSeekTime!=null&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null)}},{key:"_onvSeeking",value:function(I){var W=this._mediaElement.currentTime,K=this._mediaElement.buffered;if(this._requestSetTime){this._requestSetTime=!1;return}if(W<1&&K.length>0){var Y=K.start(0);if(Y<1&&W<Y||m.safari){this._requestSetTime=!0,this._mediaElement.currentTime=m.safari?.1:Y;return}}if(this._isTimepointBuffered(W)){if(this._alwaysSeekKeyframe){var le=this._msectl.getNearestKeyframe(Math.floor(W*1e3));le!=null&&(this._requestSetTime=!0,this._mediaElement.currentTime=le.dts/1e3)}this._progressChecker!=null&&this._checkProgressAndResume();return}this._seekpointRecord={seekPoint:W,recordTime:this._now()},window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this),50)}},{key:"_onvCanPlay",value:function(I){this._receivedCanPlay=!0,this._mediaElement.removeEventListener("canplay",this.e.onvCanPlay)}},{key:"_onvStalled",value:function(I){this._checkAndResumeStuckPlayback(!0)}},{key:"_onvProgress",value:function(I){this._checkAndResumeStuckPlayback()}}]),ce}(),mt=yt,pt=function(){function ce(te,I){if(Object(Se.a)(this,ce),this.TAG="NativePlayer",this._type="NativePlayer",this._emitter=new E.a,this._config=q(),typeof I=="object"&&Object.assign(this._config,I),te.type.toLowerCase()==="flv")throw new s("NativePlayer does't support flv MediaDataSource input!");if(te.hasOwnProperty("segments"))throw new s("NativePlayer(".concat(te.type,") doesn't support multipart playback!"));this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this)},this._pendingSeekTime=null,this._statisticsReporter=null,this._mediaDataSource=te,this._mediaElement=null}return Object(Z.a)(ce,[{key:"destroy",value:function(){this._mediaElement&&(this.unload(),this.detachMediaElement()),this.e=null,this._mediaDataSource=null,this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(I,W){var K=this;I===he.MEDIA_INFO?this._mediaElement!=null&&this._mediaElement.readyState!==0&&Promise.resolve().then(function(){K._emitter.emit(he.MEDIA_INFO,K.mediaInfo)}):I===he.STATISTICS_INFO&&(this._mediaElement!=null&&this._mediaElement.readyState!==0&&Promise.resolve().then(function(){K._emitter.emit(he.STATISTICS_INFO,K.statisticsInfo)})),this._emitter.addListener(I,W)}},{key:"off",value:function(I,W){this._emitter.removeListener(I,W)}},{key:"attachMediaElement",value:function(I){if(this._mediaElement=I,I.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._pendingSeekTime!=null)try{I.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(W){}}},{key:"detachMediaElement",value:function(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement.removeEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._mediaElement=null),this._statisticsReporter!=null&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}},{key:"load",value:function(){if(!this._mediaElement)throw new i("HTMLMediaElement must be attached before load()!");this._mediaElement.src=this._mediaDataSource.url,this._mediaElement.readyState>0&&(this._mediaElement.currentTime=0),this._mediaElement.preload="auto",this._mediaElement.load(),this._statisticsReporter=window.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval)}},{key:"unload",value:function(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src")),this._statisticsReporter!=null&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}},{key:"play",value:function(){return this._mediaElement.play()}},{key:"pause",value:function(){this._mediaElement.pause()}},{key:"type",get:function(){return this._type}},{key:"buffered",get:function(){return this._mediaElement.buffered}},{key:"duration",get:function(){return this._mediaElement.duration}},{key:"volume",get:function(){return this._mediaElement.volume},set:function(I){this._mediaElement.volume=I}},{key:"muted",get:function(){return this._mediaElement.muted},set:function(I){this._mediaElement.muted=I}},{key:"currentTime",get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(I){this._mediaElement?this._mediaElement.currentTime=I:this._pendingSeekTime=I}},{key:"mediaInfo",get:function(){var I=this._mediaElement instanceof HTMLAudioElement?"audio/":"video/",W={mimeType:I+this._mediaDataSource.type};return this._mediaElement&&(W.duration=Math.floor(this._mediaElement.duration*1e3),this._mediaElement instanceof HTMLVideoElement&&(W.width=this._mediaElement.videoWidth,W.height=this._mediaElement.videoHeight)),W}},{key:"statisticsInfo",get:function(){var I={playerType:this._type,url:this._mediaDataSource.url};if(!(this._mediaElement instanceof HTMLVideoElement))return I;var W=!0,K=0,Y=0;if(this._mediaElement.getVideoPlaybackQuality){var le=this._mediaElement.getVideoPlaybackQuality();K=le.totalVideoFrames,Y=le.droppedVideoFrames}else this._mediaElement.webkitDecodedFrameCount!=null?(K=this._mediaElement.webkitDecodedFrameCount,Y=this._mediaElement.webkitDroppedFrameCount):W=!1;return W&&(I.decodedFrames=K,I.droppedFrames=Y),I}},{key:"_onvLoadedMetadata",value:function(I){this._pendingSeekTime!=null&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null),this._emitter.emit(he.MEDIA_INFO,this.mediaInfo)}},{key:"_reportStatisticsInfo",value:function(){this._emitter.emit(he.STATISTICS_INFO,this.statisticsInfo)}}]),ce}(),vt=pt;_.install();function ut(ce,te){var I=ce;if(I==null||typeof I!="object")throw new s("MediaDataSource must be an javascript object!");if(!I.hasOwnProperty("type"))throw new s("MediaDataSource must has type field to indicate video file type!");switch(I.type){case"flv":return new mt(I,te);default:return new vt(I,te)}}function dt(){return fe.supportMSEH264Playback()}function gt(){return fe.getFeatureList()}var st={};st.createPlayer=ut,st.isSupported=dt,st.getFeatureList=gt,st.BaseLoader=l,st.LoaderStatus=a,st.LoaderErrors=e,st.Events=he,st.ErrorTypes=at,st.ErrorDetails=ft,st.FlvPlayer=mt,st.NativePlayer=vt,st.LoggingControl=ge,Object.defineProperty(st,"version",{enumerable:!0,get:function(){return"__VERSION__"}});var ht=Qe.a=st},GfqC:function(Ze,Qe,ye){"use strict";var Se=ye("cDcd"),Z=ye.n(Se),U=ye("TSYQ"),_=ye.n(U);function L(G,P){var $="cannot "+G.method+" "+G.action+" "+P.status+"'",X=new Error($);return X.status=P.status,X.method=G.method,X.url=G.action,X}function E(G){var P=G.responseText||G.response;if(!P)return P;try{return JSON.parse(P)}catch($){return P}}function A(G){var P=new XMLHttpRequest;G.onProgress&&P.upload&&(P.upload.onprogress=function(N){N.total>0&&(N.percent=N.loaded/N.total*100),G.onProgress(N)});var $=new FormData;G.data&&Object.keys(G.data).forEach(function(z){var N=G.data[z];if(Array.isArray(N)){N.forEach(function(H){$.append(z+"[]",H)});return}$.append(z,G.data[z])}),G.file instanceof Blob?$.append(G.filename,G.file,G.file.name):$.append(G.filename,G.file),P.onerror=function(N){G.onError(N)},P.onload=function(){return P.status<200||P.status>=300?G.onError(L(G,P),E(P)):G.onSuccess(E(P),P)},P.open(G.method,G.action,!0),G.withCredentials&&"withCredentials"in P&&(P.withCredentials=!0);var X=G.headers||{};return X["X-Requested-With"]!==null&&P.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(X).forEach(function(z){X[z]!==null&&P.setRequestHeader(z,X[z])}),P.send($),{abort:function(){P.abort()}}}var w=+new Date,v=0;function u(){return"rc-upload-"+w+"-"+ ++v}function f(G,P){return G.indexOf(P,G.length-P.length)!==-1}var o=function(G,P){if(G&&P){var $=Array.isArray(P)?P:P.split(","),X=G.name||"",z=G.type||"",N=z.replace(/\/.*$/,"");return $.some(function(H){var q=H.trim();return q.charAt(0)==="."?f(X.toLowerCase(),q.toLowerCase()):/\/\*$/.test(q)?N===q.replace(/\/.*$/,""):z===q})}return!0};function t(G,P){var $=G.createReader(),X=[];function z(){$.readEntries(function(N){var H=Array.prototype.slice.apply(N);X=X.concat(H);var q=!H.length;q?P(X):z()})}z()}var i=function(P,$,X){var z=function N(H,q){q=q||"",H.isFile?H.file(function(ee){X(ee)&&(H.fullPath&&!ee.webkitRelativePath&&(Object.defineProperties(ee,{webkitRelativePath:{writable:!0}}),ee.webkitRelativePath=H.fullPath.replace(/^\//,""),Object.defineProperties(ee,{webkitRelativePath:{writable:!1}})),$([ee]))}):H.isDirectory&&t(H,function(ee){ee.forEach(function(fe){N(fe,""+q+H.name+"/")})})};P.forEach(function(N){z(N.webkitGetAsEntry())})},s=i,h=Object.assign||function(G){for(var P=1;P<arguments.length;P++){var $=arguments[P];for(var X in $)Object.prototype.hasOwnProperty.call($,X)&&(G[X]=$[X])}return G},a=function(){function G(P,$){var X=[],z=!0,N=!1,H=void 0;try{for(var q=P[Symbol.iterator](),ee;!(z=(ee=q.next()).done)&&!(X.push(ee.value),$&&X.length===$);z=!0);}catch(fe){N=!0,H=fe}finally{try{!z&&q.return&&q.return()}finally{if(N)throw H}}return X}return function(P,$){if(Array.isArray(P))return P;if(Symbol.iterator in Object(P))return G(P,$);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),e=function(){function G(P,$){for(var X=0;X<$.length;X++){var z=$[X];z.enumerable=z.enumerable||!1,z.configurable=!0,"value"in z&&(z.writable=!0),Object.defineProperty(P,z.key,z)}}return function(P,$,X){return $&&G(P.prototype,$),X&&G(P,X),P}}();function l(G,P,$){return P in G?Object.defineProperty(G,P,{value:$,enumerable:!0,configurable:!0,writable:!0}):G[P]=$,G}function n(G,P){var $={};for(var X in G){if(P.indexOf(X)>=0)continue;if(!Object.prototype.hasOwnProperty.call(G,X))continue;$[X]=G[X]}return $}function d(G,P){if(!(G instanceof P))throw new TypeError("Cannot call a class as a function")}function c(G,P){if(!G)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return P&&(typeof P=="object"||typeof P=="function")?P:G}function g(G,P){if(typeof P!="function"&&P!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof P);G.prototype=Object.create(P&&P.prototype,{constructor:{value:G,enumerable:!1,writable:!0,configurable:!0}}),P&&(Object.setPrototypeOf?Object.setPrototypeOf(G,P):G.__proto__=P)}var p=function(P){return Object.keys(P).reduce(function($,X){return(X.substr(0,5)==="data-"||X.substr(0,5)==="aria-"||X==="role")&&($[X]=P[X]),$},{})},m=function(G){g(P,G);function P(){var $,X,z,N;d(this,P);for(var H=arguments.length,q=Array(H),ee=0;ee<H;ee++)q[ee]=arguments[ee];return N=(X=(z=c(this,($=P.__proto__||Object.getPrototypeOf(P)).call.apply($,[this].concat(q))),z),z.state={uid:u()},z.reqs={},z.onChange=function(fe){var oe=fe.target.files;z.uploadFiles(oe),z.reset()},z.onClick=function(fe){var oe=z.fileInput;if(!oe)return;var he=z.props,se=he.children,ge=he.onClick;se&&se.type==="button"&&(oe.parentNode.focus(),oe.parentNode.querySelector("button").blur()),oe.click(),ge&&ge(fe)},z.onKeyDown=function(fe){fe.key==="Enter"&&z.onClick()},z.onFileDrop=function(fe){var oe=z.props.multiple;if(fe.preventDefault(),fe.type==="dragover")return;if(z.props.directory)s(Array.prototype.slice.call(fe.dataTransfer.items),z.uploadFiles,function(se){return o(se,z.props.accept)});else{var he=Array.prototype.slice.call(fe.dataTransfer.files).filter(function(se){return o(se,z.props.accept)});oe===!1&&(he=he.slice(0,1)),z.uploadFiles(he)}},z.uploadFiles=function(fe){var oe=Array.prototype.slice.call(fe);oe.map(function(he){return he.uid=u(),he}).forEach(function(he){z.upload(he,oe)})},z.saveFileInput=function(fe){z.fileInput=fe},X),c(z,N)}return e(P,[{key:"componentDidMount",value:function(){this._isMounted=!0}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.abort()}},{key:"upload",value:function(X,z){var N=this,H=this.props;if(!H.beforeUpload)return setTimeout(function(){return N.post(X)},0);var q=H.beforeUpload(X,z);q&&q.then?q.then(function(ee){var fe=Object.prototype.toString.call(ee);return fe==="[object File]"||fe==="[object Blob]"?N.post(ee):N.post(X)}).catch(function(ee){console.log(ee)}):q!==!1&&setTimeout(function(){return N.post(X)},0);return}},{key:"post",value:function(X){var z=this;if(!this._isMounted)return;var N=this.props,H=N.onStart,q=N.onProgress,ee=N.transformFile,fe=ee===void 0?function(oe){return oe}:ee;new Promise(function(oe){var he=N.action;return typeof he=="function"&&(he=he(X)),oe(he)}).then(function(oe){var he=X.uid,se=N.customRequest||A,ge=Promise.resolve(fe(X)).then(function(ie){var re=N.data;return typeof re=="function"&&(re=re(ie)),Promise.all([ie,re])}).catch(function(ie){console.error(ie)});ge.then(function(ie){var re=a(ie,2),Q=re[0],pe=re[1],ne={action:oe,filename:N.name,data:pe,file:Q,headers:N.headers,withCredentials:N.withCredentials,method:N.method||"post",onProgress:q?function(J){q(J,X)}:null,onSuccess:function(be,Ee){delete z.reqs[he],N.onSuccess(be,X,Ee)},onError:function(be,Ee){delete z.reqs[he],N.onError(be,Ee,X)}};H(X),z.reqs[he]=se(ne)})})}},{key:"reset",value:function(){this.setState({uid:u()})}},{key:"abort",value:function(X){var z=this.reqs;if(X){var N=X;X&&X.uid&&(N=X.uid),z[N]&&z[N].abort&&z[N].abort(),delete z[N]}else Object.keys(z).forEach(function(H){z[H]&&z[H].abort&&z[H].abort(),delete z[H]})}},{key:"render",value:function(){var X,z=this.props,N=z.component,H=z.prefixCls,q=z.className,ee=z.disabled,fe=z.id,oe=z.style,he=z.multiple,se=z.accept,ge=z.children,ie=z.directory,re=z.openFileDialogOnClick,Q=z.onMouseEnter,pe=z.onMouseLeave,ne=n(z,["component","prefixCls","className","disabled","id","style","multiple","accept","children","directory","openFileDialogOnClick","onMouseEnter","onMouseLeave"]),J=_()((X={},l(X,H,!0),l(X,H+"-disabled",ee),l(X,q,q),X)),be=ee?{}:{onClick:re?this.onClick:function(){},onKeyDown:re?this.onKeyDown:function(){},onMouseEnter:Q,onMouseLeave:pe,onDrop:this.onFileDrop,onDragOver:this.onFileDrop,tabIndex:"0"};return Z.a.createElement(N,h({},be,{className:J,role:"button",style:oe}),Z.a.createElement("input",h({},p(ne),{id:fe,type:"file",ref:this.saveFileInput,onClick:function(Le){return Le.stopPropagation()},key:this.state.uid,style:{display:"none"},accept:se,directory:ie?"directory":null,webkitdirectory:ie?"webkitdirectory":null,multiple:he,onChange:this.onChange})),ge)}}]),P}(Se.Component),b=m,y=Object.assign||function(G){for(var P=1;P<arguments.length;P++){var $=arguments[P];for(var X in $)Object.prototype.hasOwnProperty.call($,X)&&(G[X]=$[X])}return G},r=function(){function G(P,$){for(var X=0;X<$.length;X++){var z=$[X];z.enumerable=z.enumerable||!1,z.configurable=!0,"value"in z&&(z.writable=!0),Object.defineProperty(P,z.key,z)}}return function(P,$,X){return $&&G(P.prototype,$),X&&G(P,X),P}}();function x(G,P){if(!(G instanceof P))throw new TypeError("Cannot call a class as a function")}function S(G,P){if(!G)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return P&&(typeof P=="object"||typeof P=="function")?P:G}function T(G,P){if(typeof P!="function"&&P!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof P);G.prototype=Object.create(P&&P.prototype,{constructor:{value:G,enumerable:!1,writable:!0,configurable:!0}}),P&&(Object.setPrototypeOf?Object.setPrototypeOf(G,P):G.__proto__=P)}function R(){}var D=function(G){T(P,G);function P(){var $,X,z,N;x(this,P);for(var H=arguments.length,q=Array(H),ee=0;ee<H;ee++)q[ee]=arguments[ee];return N=(X=(z=S(this,($=P.__proto__||Object.getPrototypeOf(P)).call.apply($,[this].concat(q))),z),z.saveUploader=function(fe){z.uploader=fe},X),S(z,N)}return r(P,[{key:"abort",value:function(X){this.uploader.abort(X)}},{key:"render",value:function(){return Z.a.createElement(b,y({},this.props,{ref:this.saveUploader}))}}]),P}(Se.Component);D.defaultProps={component:"span",prefixCls:"rc-upload",data:{},headers:{},name:"file",multipart:!1,onStart:R,onError:R,onSuccess:R,multiple:!1,beforeUpload:null,customRequest:null,withCredentials:!1,openFileDialogOnClick:!0};var k=D,B=Qe.a=k},Gytx:function(Ze,Qe){Ze.exports=function(Se,Z,U,_){var L=U?U.call(_,Se,Z):void 0;if(L!==void 0)return!!L;if(Se===Z)return!0;if(typeof Se!="object"||!Se||typeof Z!="object"||!Z)return!1;var E=Object.keys(Se),A=Object.keys(Z);if(E.length!==A.length)return!1;for(var w=Object.prototype.hasOwnProperty.bind(Z),v=0;v<E.length;v++){var u=E[v];if(!w(u))return!1;var f=Se[u],o=Z[u];if(L=U?U.call(_,f,o,u):void 0,L===!1||L===void 0&&f!==o)return!1}return!0}},J66h:function(Ze,Qe,ye){(function(Se){var Z,U;(function(_,L){Ze.exports=L(_)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof Se!="undefined"?Se:this,function(_){"use strict";_=_||{};var L=_.Base64,E="2.6.4",A="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",w=function(R){for(var D={},k=0,B=R.length;k<B;k++)D[R.charAt(k)]=k;return D}(A),v=String.fromCharCode,u=function(R){if(R.length<2){var D=R.charCodeAt(0);return D<128?R:D<2048?v(192|D>>>6)+v(128|D&63):v(224|D>>>12&15)+v(128|D>>>6&63)+v(128|D&63)}else{var D=65536+(R.charCodeAt(0)-55296)*1024+(R.charCodeAt(1)-56320);return v(240|D>>>18&7)+v(128|D>>>12&63)+v(128|D>>>6&63)+v(128|D&63)}},f=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,o=function(R){return R.replace(f,u)},t=function(R){var D=[0,2,1][R.length%3],k=R.charCodeAt(0)<<16|(R.length>1?R.charCodeAt(1):0)<<8|(R.length>2?R.charCodeAt(2):0),B=[A.charAt(k>>>18),A.charAt(k>>>12&63),D>=2?"=":A.charAt(k>>>6&63),D>=1?"=":A.charAt(k&63)];return B.join("")},i=_.btoa&&typeof _.btoa=="function"?function(R){return _.btoa(R)}:function(R){if(R.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return R.replace(/[\s\S]{1,3}/g,t)},s=function(R){return i(o(String(R)))},h=function(R){return R.replace(/[+\/]/g,function(D){return D=="+"?"-":"_"}).replace(/=/g,"")},a=function(R,D){return D?h(s(R)):s(R)},e=function(R){return a(R,!0)},l;_.Uint8Array&&(l=function(R,D){for(var k="",B=0,G=R.length;B<G;B+=3){var P=R[B],$=R[B+1],X=R[B+2],z=P<<16|$<<8|X;k+=A.charAt(z>>>18)+A.charAt(z>>>12&63)+(typeof $!="undefined"?A.charAt(z>>>6&63):"=")+(typeof X!="undefined"?A.charAt(z&63):"=")}return D?h(k):k});var n=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,d=function(R){switch(R.length){case 4:var D=(7&R.charCodeAt(0))<<18|(63&R.charCodeAt(1))<<12|(63&R.charCodeAt(2))<<6|63&R.charCodeAt(3),k=D-65536;return v((k>>>10)+55296)+v((k&1023)+56320);case 3:return v((15&R.charCodeAt(0))<<12|(63&R.charCodeAt(1))<<6|63&R.charCodeAt(2));default:return v((31&R.charCodeAt(0))<<6|63&R.charCodeAt(1))}},c=function(R){return R.replace(n,d)},g=function(R){var D=R.length,k=D%4,B=(D>0?w[R.charAt(0)]<<18:0)|(D>1?w[R.charAt(1)]<<12:0)|(D>2?w[R.charAt(2)]<<6:0)|(D>3?w[R.charAt(3)]:0),G=[v(B>>>16),v(B>>>8&255),v(B&255)];return G.length-=[0,0,2,1][k],G.join("")},p=_.atob&&typeof _.atob=="function"?function(R){return _.atob(R)}:function(R){return R.replace(/\S{1,4}/g,g)},m=function(R){return p(String(R).replace(/[^A-Za-z0-9\+\/]/g,""))},b=function(R){return c(p(R))},y=function(R){return String(R).replace(/[-_]/g,function(D){return D=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},r=function(R){return b(y(R))},x;_.Uint8Array&&(x=function(R){return Uint8Array.from(m(y(R)),function(D){return D.charCodeAt(0)})});var S=function(){var R=_.Base64;return _.Base64=L,R};if(_.Base64={VERSION:E,atob:m,btoa:i,fromBase64:r,toBase64:a,utob:o,encode:a,encodeURI:e,btou:c,decode:r,noConflict:S,fromUint8Array:l,toUint8Array:x},typeof Object.defineProperty=="function"){var T=function(R){return{value:R,enumerable:!1,writable:!0,configurable:!0}};_.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",T(function(){return r(this)})),Object.defineProperty(String.prototype,"toBase64",T(function(R){return a(this,R)})),Object.defineProperty(String.prototype,"toBase64URI",T(function(){return a(this,!0)}))}}return _.Meteor&&(Base64=_.Base64),Ze.exports?Ze.exports.Base64=_.Base64:!(Z=[],U=function(){return _.Base64}.apply(Qe,Z),U!==void 0&&(Ze.exports=U)),{Base64:_.Base64}})}).call(this,ye("IyRk"))},JqQi:function(Ze,Qe,ye){Ze.exports={bg:"bg___31owl",container:"container___2NGOo"}},LdHM:function(Ze,Qe,ye){"use strict";ye.d(Qe,"b",function(){return n}),ye.d(Qe,"a",function(){return c});var Se=ye("1OyB"),Z=ye("vuIU"),U=ye("Ji7U"),_=ye("LK+K"),L=ye("cDcd"),E=ye("rePB"),A=ye("Ff2n"),w=ye("ODXe"),v=ye("4IlW"),u=ye("bX4T"),f=ye("YrtM"),o=ye("TSYQ"),t=ye.n(o),i=ye("+nKL"),s=ye("8OUc"),h=function(X,z){var N=X.prefixCls,H=X.id,q=X.flattenOptions,ee=X.childrenAsData,fe=X.values,oe=X.searchValue,he=X.multiple,se=X.defaultActiveFirstOption,ge=X.height,ie=X.itemHeight,re=X.notFoundContent,Q=X.open,pe=X.menuItemSelectedIcon,ne=X.virtual,J=X.onSelect,be=X.onToggleOpen,Ee=X.onActiveValue,Le=X.onScroll,V=X.onMouseEnter,C="".concat(N,"-item"),O=Object(f.a)(function(){return q},[Q,q],function(Re,Te){return Te[0]&&Re[1]!==Te[1]}),j=L.useRef(null),M=function(Te){Te.preventDefault()},F=function(Te){j.current&&j.current.scrollTo({index:Te})},ae=function(Te){for(var we=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,xe=O.length,ue=0;ue<xe;ue+=1){var de=(Te+ue*we+xe)%xe,_e=O[de],me=_e.group,Ie=_e.data;if(!me&&!Ie.disabled)return de}return-1},ve=L.useState(function(){return ae(0)}),Pe=Object(w.a)(ve,2),Oe=Pe[0],De=Pe[1],Ne=function(Te){De(Te);var we=O[Te];if(!we){Ee(null,-1);return}Ee(we.data.value,Te)};L.useEffect(function(){Ne(se!==!1?ae(0):-1)},[O.length,oe]),L.useEffect(function(){var Re=setTimeout(function(){if(!he&&Q&&fe.size===1){var Te=Array.from(fe)[0],we=O.findIndex(function(xe){var ue=xe.data;return ue.value===Te});Ne(we),F(we)}});return function(){return clearTimeout(Re)}},[Q]);var Ke=function(Te){Te!==void 0&&J(Te,{selected:!fe.has(Te)}),he||be(!1)};if(L.useImperativeHandle(z,function(){return{onKeyDown:function(Te){var we=Te.which;switch(we){case v.a.UP:case v.a.DOWN:{var xe=0;if(we===v.a.UP?xe=-1:we===v.a.DOWN&&(xe=1),xe!==0){var ue=ae(Oe+xe,xe);F(ue),Ne(ue)}break}case v.a.ENTER:{var de=O[Oe];de&&!de.data.disabled?Ke(de.data.value):Ke(void 0),Q&&Te.preventDefault();break}case v.a.ESC:be(!1)}},onKeyUp:function(){},scrollTo:function(Te){F(Te)}}}),O.length===0)return L.createElement("div",{role:"listbox",id:"".concat(H,"_list"),className:"".concat(C,"-empty"),onMouseDown:M},re);function ke(Re){var Te=O[Re];if(!Te)return null;var we=Te.data||{},xe=we.value,ue=we.label,de=we.children,_e=Object(u.a)(we,!0),me=ee?de:ue;return Te?L.createElement("div",Object.assign({"aria-label":typeof me=="string"?me:null},_e,{key:Re,role:"option",id:"".concat(H,"_list_").concat(Re),"aria-selected":fe.has(xe)}),xe):null}return L.createElement(L.Fragment,null,L.createElement("div",{role:"listbox",id:"".concat(H,"_list"),style:{height:0,width:0,overflow:"hidden"}},ke(Oe-1),ke(Oe),ke(Oe+1)),L.createElement(i.a,{itemKey:"key",ref:j,data:O,height:ge,itemHeight:ie,fullHeight:!1,onMouseDown:M,onScroll:Le,virtual:ne,onMouseEnter:V},function(Re,Te){var we,xe=Re.group,ue=Re.groupOption,de=Re.data,_e=de.label,me=de.key;if(xe)return L.createElement("div",{className:t()(C,"".concat(C,"-group"))},_e!==void 0?_e:me);var Ie=de.disabled,Me=de.value,Ve=de.title,ot=de.children,tt=de.style,Ge=de.className,Je=Object(A.a)(de,["disabled","value","title","children","style","className"]),$e=fe.has(Me),et="".concat(C,"-option"),nt=t()(C,et,Ge,(we={},Object(E.a)(we,"".concat(et,"-grouped"),ue),Object(E.a)(we,"".concat(et,"-active"),Oe===Te&&!Ie),Object(E.a)(we,"".concat(et,"-disabled"),Ie),Object(E.a)(we,"".concat(et,"-selected"),$e),we)),at=ee?ot:_e,ft=!pe||typeof pe=="function"||$e;return L.createElement("div",Object.assign({},Je,{"aria-selected":$e,className:nt,title:Ve,onMouseMove:function(){if(Oe===Te||Ie)return;Ne(Te)},onClick:function(){Ie||Ke(Me)},style:tt}),L.createElement("div",{className:"".concat(et,"-content")},at||Me),L.isValidElement(pe)||$e,ft&&L.createElement(s.a,{className:"".concat(C,"-option-state"),customizeIcon:pe,customizeIconProps:{isSelected:$e}},$e?"\u2713":null))}))},a=L.forwardRef(h);a.displayName="OptionList";var e=a,l=function(){return null};l.isSelectOption=!0;var n=l,d=function(){return null};d.isSelectOptGroup=!0;var c=d,g=ye("VTBJ"),p=ye("Zm9Q");function m($){var X=$.key,z=$.props,N=z.children,H=z.value,q=Object(A.a)(z,["children","value"]);return Object(g.a)({key:X,value:H!==void 0?H:X,children:N},q)}function b($){var X=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(p.a)($).map(function(z,N){if(!L.isValidElement(z)||!z.type)return null;var H=z.type.isSelectOptGroup,q=z.key,ee=z.props,fe=ee.children,oe=Object(A.a)(ee,["children"]);return X||!H?m(z):Object(g.a)(Object(g.a)({key:"__RC_SELECT_GRP__".concat(q===null?N:q,"__"),label:q},oe),{},{options:b(fe)})}).filter(function(z){return z})}var y=ye("2Qr1"),r=ye("qNPg"),x=ye("U8pU"),S=ye("Kwbf"),T=ye("WKfj");function R($){var X=$.mode,z=$.options,N=$.children,H=$.backfill,q=$.allowClear,ee=$.placeholder,fe=$.getInputElement,oe=$.showSearch,he=$.onSearch,se=$.defaultOpen,ge=$.autoFocus,ie=$.labelInValue,re=$.value,Q=$.inputValue,pe=$.optionLabelProp,ne=X==="multiple"||X==="tags",J=oe!==void 0?oe:ne||X==="combobox",be=z||b(N);if(Object(S.a)(X!=="tags"||be.every(function(C){return!C.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),X==="tags"||X==="combobox"){var Ee=be.some(function(C){return C.options?C.options.some(function(O){return typeof("value"in O?O.value:O.key)=="number"}):typeof("value"in C?C.value:C.key)=="number"});Object(S.a)(!Ee,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(S.a)(X!=="combobox"||!pe,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(S.a)(X==="combobox"||!H,"`backfill` only works with `combobox` mode."),Object(S.a)(X==="combobox"||!fe,"`getInputElement` only work with `combobox` mode."),Object(S.b)(X!=="combobox"||!fe||!q||!ee,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),he&&!J&&X!=="combobox"&&X!=="tags"&&Object(S.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(S.b)(!se||ge,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),re!=null){var Le=Object(T.d)(re);Object(S.a)(!ie||Le.every(function(C){return Object(x.a)(C)==="object"&&("key"in C||"value"in C)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(S.a)(!ne||Array.isArray(re),"`value` should be array when `mode` is `multiple` or `tags`")}if(N){var V=null;Object(p.a)(N).some(function(C){if(!L.isValidElement(C)||!C.type)return!1;var O=C.type;if(O.isSelectOption)return!1;if(O.isSelectOptGroup){var j=Object(p.a)(C.props.children).every(function(M){return!L.isValidElement(M)||!C.type||M.type.isSelectOption?!0:(V=M.type,!1)});return!j}return V=O,!0}),V&&Object(S.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(V.displayName||V.name||V,"`.")),Object(S.a)(Q===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var D=R,k=Object(r.a)({prefixCls:"rc-select",components:{optionList:e},convertChildrenToData:b,flattenOptions:y.d,getLabeledValue:y.e,filterOptions:y.b,isValueDisabled:y.g,findValueOption:y.c,warningProps:D,fillOptionsWithMissingValue:y.a}),B=function($){Object(U.a)(z,$);var X=Object(_.a)(z);function z(){var N;return Object(Se.a)(this,z),N=X.apply(this,arguments),N.selectRef=L.createRef(),N.focus=function(){N.selectRef.current.focus()},N.blur=function(){N.selectRef.current.blur()},N}return Object(Z.a)(z,[{key:"render",value:function(){return L.createElement(k,Object.assign({ref:this.selectRef},this.props))}}]),z}(L.Component);B.Option=n,B.OptGroup=c;var G=B,P=Qe.c=G},MRWH:function(Ze,Qe,ye){Ze.exports={flex_box_center:"flex_box_center___30XbU",flex_space_between:"flex_space_between___3jfWA",flex_box_vertical_center:"flex_box_vertical_center___27kWs",flex_box_center_end:"flex_box_center_end___1RoAS",flex_box_column:"flex_box_column____3Jvr",list:"list___2NJ_T",box:"box___36KCF",title:"title___Kd2ce",gray:"gray___14ob6",brght:"brght___GgzyD",s1:"s1___IhDpz",s2:"s2___3hR0s",s3:"s3___23SCF",active:"active___2_5D5",line:"line___3Croa"}},NLgs:function(Ze,Qe,ye){"use strict";ye.d(Qe,"e",function(){return n}),ye.d(Qe,"f",function(){return d}),ye.d(Qe,"d",function(){return g}),ye.d(Qe,"c",function(){return p}),ye.d(Qe,"a",function(){return m}),ye.d(Qe,"b",function(){return b});var Se=ye("miYZ"),Z=ye("tsqr"),U=ye("9og8"),_=ye("2qtc"),L=ye("kLXV"),E=ye("WmNS"),A=ye.n(E),w=ye("cDcd"),v=ye.n(w),u=ye("9kvl"),f=ye("xKgJ"),o=ye("1vsH"),t=ye("RCxd"),i=ye("mOS8"),s=ye.n(i),h=ye("1ZF9"),a=ye.n(h),e=ye("NoGO"),l=ye.n(e),n=function(r){var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!!(d(r)&&c(x))},d=function(r){return Object(f.p)()?!0:(r({type:"user/showPopLogin",payload:{showPopLogin:!0,showClosable:!0}}),!1)},c=function(){var r,x=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,S=Object(u.c)()._store.getState(),T=S.user;return(r=T.userInfo)!==null&&r!==void 0&&r.profile_completed?!0:(L.a.confirm({title:"\u63D0\u793A",width:530,centered:!0,content:x?"\u6309\u7167\u6709\u5173\u653F\u7B56\u89C4\u5B9A\uFF0C\u7279\u6B8A\u5B9E\u9A8C\u9700\u8981\u5148\u7ED1\u5B9A\u624B\u673A\u53F7\u624D\u80FD\u4F7F\u7528\uFF0C\u8BF7\u5148\u7ED1\u5B9A\u624B\u673A\u53F7\u7801":"\u60A8\u9700\u8981\u53BB\u5B8C\u5584\u60A8\u7684\u4E2A\u4EBA\u8D44\u6599\uFF0C\u624D\u80FD\u4F7F\u7528\u6B64\u529F\u80FD",okText:"\u7ACB\u5373\u5B8C\u5584",cancelText:"\u7A0D\u540E\u5B8C\u5584",onOk:function(){u.d.push("/account/profile/edit")}}),!1)},g=function(){var r,x=Object(u.c)()._store.getState(),S=x.user;return(r=S.userInfo)!==null&&r!==void 0&&r.professional_certification?!0:(L.a.confirm({title:"\u63D0\u793A",centered:!0,content:v.a.createElement("div",{className:"tc"},"\u60A8\u9700\u8981\u53BB\u5B8C\u6210\u60A8\u7684\u804C\u4E1A\u8BA4\u8BC1\uFF0C\u624D\u80FD\u4F7F\u7528\u6B64\u529F\u80FD"),okText:"\u7ACB\u5373\u5B8C\u5584",cancelText:"\u7A0D\u540E\u5B8C\u5584",onOk:function(){Object(o.U)("/account/certification")}}),!1)},p=function(){return Object(f.a)()?!0:(L.a.warning({centered:!0,width:530,title:"\u63D0\u793A",content:v.a.createElement("div",{className:"tc",style:{marginLeft:-38}},v.a.createElement("p",null,"\u626B\u7801\u52A0\u5934\u6B4C\u52A9\u6559\uFF0C\u7533\u8BF7\u64CD\u4F5C\u6743\u9650"),v.a.createElement("img",{src:l.a,width:200})),okText:"\u6211\u77E5\u9053\u4E86",maskClosable:!0}),!1)},m=function(r,x){return r?!0:(L.a.confirm({centered:!0,zIndex:1e4,width:530,title:"\u63D0\u793A",content:v.a.createElement("div",null,v.a.createElement("p",null,x||"\u8BE5\u5B9E\u8DF5\u8D44\u6E90\u9700\u6388\u6743\u540E\u624D\u53EF\u4F7F\u7528\u3002 \u60A8\u53EF\u4EE5\u5728QQ\u670D\u52A1\u7FA4\u5411\u7BA1\u7406\u5458\u7533\u8BF7\uFF0C\u83B7\u5F97\u7EE7\u7EED\u64CD\u4F5C\u7684\u6743\u9650\u3002"),v.a.createElement("div",{style:{marginLeft:"110px"}},v.a.createElement("img",{src:a.a,width:200}),v.a.createElement("div",{style:{marginLeft:"35px"}},"\u7FA4\u53F7\uFF1A","714336072"))),okText:"\u7ACB\u5373\u8054\u7CFB",cancelText:"\u53D6\u6D88",onOk:function(){Object(o.U)("https://qm.qq.com/cgi-bin/qm/qr?k=tIyDPXUtE0yEk-MOJxhH55lTUJS-nYAM&jump_from=webapi")}}),!1)},b=function(r){var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",S=Object(u.c)()._store.getState(),T=S.shixunsDetail.detail;return(T==null?void 0:T.public)===2||(T==null?void 0:T.public)===1||(T==null?void 0:T.shixun_status)===3?(L.a.info({centered:!0,icon:v.a.createElement(t.a,{style:{color:"#faad14"}}),width:460,title:"\u63D0\u793A",content:v.a.createElement("div",{className:"tc",style:{marginLeft:-38}},v.a.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",paddingLeft:38,margin:"12px 0"}},v.a.createElement("span",null,"\u8BE5\u5B9E\u8DF5\u9879\u76EE\u7684\u72B6\u6001\u4E3A",(T==null?void 0:T.public)===2?"\u5DF2\u516C\u5F00":(T==null?void 0:T.public)===1?"\u5F85\u5BA1\u6838":"\u5DF2\u5173\u95ED","\uFF0C",x,"\u3002"),v.a.createElement("p",null,"\u5982\u6709\u9700\u8981\uFF0C\u8BF7\u8054\u7CFB\u5E73\u53F0\u7BA1\u7406\u5458\u8FDB\u884C\u6280\u672F\u652F\u6301\u3002")),v.a.createElement("img",{style:{border:"4px solid #0152d9",borderRadius:"4px"},src:s.a,alt:"\u4E8C\u7EF4\u7801",width:160})),okText:"\u6211\u77E5\u9053\u4E86"}),!0):(T==null?void 0:T.shixun_status)===2?(L.a.confirm({centered:!0,icon:v.a.createElement(t.a,null),title:"\u63D0\u793A",content:v.a.createElement("div",null,v.a.createElement("span",null,"\u8BE5\u5B9E\u8DF5\u9879\u76EE\u5DF2\u53D1\u5E03\uFF0C",x,"\u3002"),v.a.createElement("br",null),v.a.createElement("span",null,"\u5982\u6709\u9700\u8981\uFF0C\u60A8\u53EF\u4EE5\u64A4\u9500\u53D1\u5E03\u540E\uFF0C\u518D\u8FDB\u884C\u64CD\u4F5C\u3002")),okText:"\u64A4\u9500\u53D1\u5E03",cancelText:"\u53D6\u6D88",onOk:function(){L.a.confirm({width:440,centered:!0,icon:v.a.createElement(t.a,{style:{color:"#faad14"}}),title:"\u63D0\u793A",content:"\u64A4\u9500\u53D1\u5E03\u540E\uFF0C\u5B66\u5458\u5C06\u65E0\u6CD5\u8FDB\u884C\u7EC3\u4E60\u3002\u662F\u5426\u786E\u8BA4\u64A4\u9500\u53D1\u5E03\uFF1F",okText:"\u786E\u5B9A\u64A4\u9500\u53D1\u5E03",cancelText:"\u53D6\u6D88",onOk:function(){var D=Object(U.a)(A.a.mark(function B(){var G;return A.a.wrap(function($){for(;;)switch($.prev=$.next){case 0:return $.next=2,r({type:"shixunsDetail/cancelRelease",payload:{id:T==null?void 0:T.identifier}});case 2:G=$.sent,G.status!==401&&(Z.b.success("\u64A4\u9500\u53D1\u5E03\u6210\u529F\u3002\u5B9E\u8BAD\u56DE\u5230\u672A\u53D1\u5E03\u7684\u72B6\u6001\u3002"),r({type:"shixunsDetail/getShixunsDetail",payload:{id:T==null?void 0:T.identifier}}),r({type:"practiceSetting/getCommonData",payload:{id:T==null?void 0:T.identifier}}));case 4:case"end":return $.stop()}},B)}));function k(){return D.apply(this,arguments)}return k}()})}}),!0):!1}},NoGO:function(Ze,Qe,ye){Ze.exports=ye.p+"static/newqrcode.9bae6615.png"},OLES:function(Ze,Qe,ye){"use strict";var Se=ye("U8pU"),Z=ye("VTBJ"),U=ye("Ff2n"),_=ye("cDcd"),L=ye("uciX"),E=ye("7ixt"),A=function(t){var i=t.overlay,s=t.prefixCls,h=t.id,a=t.overlayInnerStyle;return _.createElement("div",{className:"".concat(s,"-inner"),id:h,role:"tooltip",style:a},typeof i=="function"?i():i)},w=A,v=function(t,i){var s=t.overlayClassName,h=t.trigger,a=h===void 0?["hover"]:h,e=t.mouseEnterDelay,l=e===void 0?0:e,n=t.mouseLeaveDelay,d=n===void 0?.1:n,c=t.overlayStyle,g=t.prefixCls,p=g===void 0?"rc-tooltip":g,m=t.children,b=t.onVisibleChange,y=t.afterVisibleChange,r=t.transitionName,x=t.animation,S=t.placement,T=S===void 0?"right":S,R=t.align,D=R===void 0?{}:R,k=t.destroyTooltipOnHide,B=k===void 0?!1:k,G=t.defaultVisible,P=t.getTooltipContainer,$=t.overlayInnerStyle,X=Object(U.a)(t,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),z=Object(_.useRef)(null);Object(_.useImperativeHandle)(i,function(){return z.current});var N=Object(Z.a)({},X);"visible"in t&&(N.popupVisible=t.visible);var H=function(){var he=t.arrowContent,se=he===void 0?null:he,ge=t.overlay,ie=t.id;return[_.createElement("div",{className:"".concat(p,"-arrow"),key:"arrow"},se),_.createElement(w,{key:"content",prefixCls:p,id:ie,overlay:ge,overlayInnerStyle:$})]},q=!1,ee=!1;if(typeof B=="boolean")q=B;else if(B&&Object(Se.a)(B)==="object"){var fe=B.keepParent;q=fe===!0,ee=fe===!1}return _.createElement(L.a,Object.assign({popupClassName:s,prefixCls:p,popup:H,action:a,builtinPlacements:E.a,popupPlacement:T,ref:z,popupAlign:D,getPopupContainer:P,onPopupVisibleChange:b,afterPopupVisibleChange:y,popupTransitionName:r,popupAnimation:x,defaultPopupVisible:G,destroyPopupOnHide:q,autoDestroy:ee,mouseLeaveDelay:d,popupStyle:c,mouseEnterDelay:l},N),m)},u=Object(_.forwardRef)(v),f=Qe.a=u},P5Jw:function(Ze,Qe,ye){"use strict";var Se=ye("rHrb"),Z=Se.CopyToClipboard;Z.CopyToClipboard=Z,Ze.exports=Z},SJMd:function(Ze,Qe){/**
|
|
|
* @license
|
|
|
* Copyright (C) 2006 Google Inc.
|
|
|
*
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
* You may obtain a copy of the License at
|
|
|
*
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
*
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
* See the License for the specific language governing permissions and
|
|
|
* limitations under the License.
|
|
|
*/var ye,Se,Z,U=!1,_,L;window.PR_SHOULD_USE_CONTINUATION=!0;var E,A;(function(){var w=window,v=["break,continue,do,else,for,if,return,while"],u=[v,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],f=[u,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],o=[f,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],t=[f,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],i=[f,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",h=[f,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],a="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",e=[v,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],l=[v,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],n=[v,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],d=[o,i,t,h,a,e,l,n],c=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,g="str",p="kwd",m="com",b="typ",y="lit",r="pun",x="pln",S="tag",T="dec",R="src",D="atn",k="atv",B="nocode",G="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function P(J){for(var be=0,Ee=!1,Le=!1,V=0,C=J.length;V<C;++V){var O=J[V];if(O.ignoreCase)Le=!0;else if(/[a-z]/i.test(O.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Ee=!0,Le=!1;break}}var j={b:8,t:9,n:10,v:11,f:12,r:13};function M(Oe){var De=Oe.charCodeAt(0);if(De!==92)return De;var Ne=Oe.charAt(1);return De=j[Ne],De||("0"<=Ne&&Ne<="7"?parseInt(Oe.substring(1),8):Ne==="u"||Ne==="x"?parseInt(Oe.substring(2),16):Oe.charCodeAt(1))}function F(Oe){if(Oe<32)return(Oe<16?"\\x0":"\\x")+Oe.toString(16);var De=String.fromCharCode(Oe);return De==="\\"||De==="-"||De==="]"||De==="^"?"\\"+De:De}function ae(Oe){var De=Oe.substring(1,Oe.length-1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g")),Ne=[],Ke=De[0]==="^",ke=["["];Ke&&ke.push("^");for(var Re=Ke?1:0,Te=De.length;Re<Te;++Re){var we=De[Re];if(/\\[bdsw]/i.test(we))ke.push(we);else{var xe=M(we),ue;Re+2<Te&&De[Re+1]==="-"?(ue=M(De[Re+2]),Re+=2):ue=xe,Ne.push([xe,ue]),ue<65||xe>122||(ue<65||xe>90||Ne.push([Math.max(65,xe)|32,Math.min(ue,90)|32]),ue<97||xe>122||Ne.push([Math.max(97,xe)&~32,Math.min(ue,122)&~32]))}}Ne.sort(function(Ie,Me){return Ie[0]-Me[0]||Me[1]-Ie[1]});for(var de=[],_e=[],Re=0;Re<Ne.length;++Re){var me=Ne[Re];me[0]<=_e[1]+1?_e[1]=Math.max(_e[1],me[1]):de.push(_e=me)}for(var Re=0;Re<de.length;++Re){var me=de[Re];ke.push(F(me[0])),me[1]>me[0]&&(me[1]+1>me[0]&&ke.push("-"),ke.push(F(me[1])))}return ke.push("]"),ke.join("")}function ve(Oe){for(var De=Oe.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),Ne=De.length,Ke=[],ke=0,Re=0;ke<Ne;++ke){var Te=De[ke];if(Te==="(")++Re;else if(Te.charAt(0)==="\\"){var we=+Te.substring(1);we&&(we<=Re?Ke[we]=-1:De[ke]=F(we))}}for(var ke=1;ke<Ke.length;++ke)Ke[ke]===-1&&(Ke[ke]=++be);for(var ke=0,Re=0;ke<Ne;++ke){var Te=De[ke];if(Te==="(")++Re,Ke[Re]||(De[ke]="(?:");else if(Te.charAt(0)==="\\"){var we=+Te.substring(1);we&&we<=Re&&(De[ke]="\\"+Ke[we])}}for(var ke=0;ke<Ne;++ke)De[ke]==="^"&&De[ke+1]!=="^"&&(De[ke]="");if(Oe.ignoreCase&&Ee)for(var ke=0;ke<Ne;++ke){var Te=De[ke],xe=Te.charAt(0);Te.length>=2&&xe==="["?De[ke]=ae(Te):xe!=="\\"&&(De[ke]=Te.replace(/[a-zA-Z]/g,function(_e){var me=_e.charCodeAt(0);return"["+String.fromCharCode(me&~32,me|32)+"]"}))}return De.join("")}for(var Pe=[],V=0,C=J.length;V<C;++V){var O=J[V];if(O.global||O.multiline)throw new Error(""+O);Pe.push("(?:"+ve(O)+")")}return new RegExp(Pe.join("|"),Le?"gi":"g")}function $(J,be){var Ee=/(?:^|\s)nocode(?:\s|$)/,Le=[],V=0,C=[],O=0;function j(M){var F=M.nodeType;if(F==1){if(Ee.test(M.className))return;for(var ae=M.firstChild;ae;ae=ae.nextSibling)j(ae);var ve=M.nodeName.toLowerCase();(ve==="br"||ve==="li")&&(Le[O]=`
|
|
|
`,C[O<<1]=V++,C[O++<<1|1]=M)}else if(F==3||F==4){var Pe=M.nodeValue;Pe.length&&(be?Pe=Pe.replace(/\r\n?/g,`
|
|
|
`):Pe=Pe.replace(/[ \t\r\n]+/g," "),Le[O]=Pe,C[O<<1]=V,V+=Pe.length,C[O++<<1|1]=M)}}return j(J),{sourceCode:Le.join("").replace(/\n$/,""),spans:C}}function X(J,be,Ee,Le,V){if(!Ee)return;var C={sourceNode:J,pre:1,langExtension:null,numberLines:null,sourceCode:Ee,spans:null,basePos:be,decorations:null};Le(C),V.push.apply(V,C.decorations)}var z=/\S/;function N(J){for(var be=void 0,Ee=J.firstChild;Ee;Ee=Ee.nextSibling){var Le=Ee.nodeType;be=Le===1?be?J:Ee:Le===3&&z.test(Ee.nodeValue)?J:be}return be===J?void 0:be}function H(J,be){var Ee={},Le;(function(){for(var O=J.concat(be),j=[],M={},F=0,ae=O.length;F<ae;++F){var ve=O[F],Pe=ve[3];if(Pe)for(var Oe=Pe.length;--Oe>=0;)Ee[Pe.charAt(Oe)]=ve;var De=ve[1],Ne=""+De;M.hasOwnProperty(Ne)||(j.push(De),M[Ne]=null)}j.push(/[\0-\uffff]/),Le=P(j)})();var V=be.length,C=function(O){for(var j=O.sourceCode,M=O.basePos,F=O.sourceNode,ae=[M,x],ve=0,Pe=j.match(Le)||[],Oe={},De=0,Ne=Pe.length;De<Ne;++De){var Ke=Pe[De],ke=Oe[Ke],Re=void 0,Te;if(typeof ke=="string")Te=!1;else{var we=Ee[Ke.charAt(0)];if(we)Re=Ke.match(we[1]),ke=we[0];else{for(var xe=0;xe<V;++xe)if(we=be[xe],Re=Ke.match(we[1]),Re){ke=we[0];break}Re||(ke=x)}Te=ke.length>=5&&ke.substring(0,5)==="lang-",Te&&!(Re&&typeof Re[1]=="string")&&(Te=!1,ke=R),Te||(Oe[Ke]=ke)}var ue=ve;if(ve+=Ke.length,!Te)ae.push(M+ue,ke);else{var de=Re[1],_e=Ke.indexOf(de),me=_e+de.length;Re[2]&&(me=Ke.length-Re[2].length,_e=me-de.length);var Ie=ke.substring(5);X(F,M+ue,Ke.substring(0,_e),C,ae),X(F,M+ue+_e,de,ge(Ie,de),ae),X(F,M+ue+me,Ke.substring(me),C,ae)}}O.decorations=ae};return C}function q(J){var be=[],Ee=[];J.tripleQuotedStrings?be.push([g,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):J.multiLineStrings?be.push([g,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):be.push([g,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),J.verbatimStrings&&Ee.push([g,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Le=J.hashComments;Le&&(J.cStyleComments?(Le>1?be.push([m,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):be.push([m,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Ee.push([g,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):be.push([m,/^#[^\r\n]*/,null,"#"])),J.cStyleComments&&(Ee.push([m,/^\/\/[^\r\n]*/,null]),Ee.push([m,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var V=J.regexLiterals;if(V){var C=V>1?"":`
|
|
|
\r`,O=C?".":"[\\S\\s]",j="/(?=[^/*"+C+"])(?:[^/\\x5B\\x5C"+C+"]|\\x5C"+O+"|\\x5B(?:[^\\x5C\\x5D"+C+"]|\\x5C"+O+")*(?:\\x5D|$))+/";Ee.push(["lang-regex",RegExp("^"+G+"("+j+")")])}var M=J.types;M&&Ee.push([b,M]);var F=(""+J.keywords).replace(/^ | $/g,"");F.length&&Ee.push([p,new RegExp("^(?:"+F.replace(/[\s,]+/g,"|")+")\\b"),null]),be.push([x,/^\s+/,null,` \r
|
|
|
\xA0`]);var ae="^.[^\\s\\w.$@'\"`/\\\\]*";return J.regexLiterals&&(ae+="(?!s*/)"),Ee.push([y,/^@[a-z_$][a-z_$@0-9]*/i,null],[b,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[x,/^[a-z_$][a-z_$@0-9]*/i,null],[y,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[x,/^\\[\s\S]?/,null],[r,new RegExp(ae),null]),H(be,Ee)}var ee=q({keywords:d,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function fe(J,be,Ee){for(var Le=/(?:^|\s)nocode(?:\s|$)/,V=/\r\n?|\n/,C=J.ownerDocument,O=C.createElement("li");J.firstChild;)O.appendChild(J.firstChild);var j=[O];function M(De){var Ne=De.nodeType;if(Ne==1&&!Le.test(De.className))if(De.nodeName==="br")F(De),De.parentNode&&De.parentNode.removeChild(De);else for(var Ke=De.firstChild;Ke;Ke=Ke.nextSibling)M(Ke);else if((Ne==3||Ne==4)&&Ee){var ke=De.nodeValue,Re=ke.match(V);if(Re){var Te=ke.substring(0,Re.index);De.nodeValue=Te;var we=ke.substring(Re.index+Re[0].length);if(we){var xe=De.parentNode;xe.insertBefore(C.createTextNode(we),De.nextSibling)}F(De),Te||De.parentNode.removeChild(De)}}}function F(De){for(;!De.nextSibling;)if(De=De.parentNode,!De)return;function Ne(Re,Te){var we=Te?Re.cloneNode(!1):Re,xe=Re.parentNode;if(xe){var ue=Ne(xe,1),de=Re.nextSibling;ue.appendChild(we);for(var _e=de;_e;_e=de)de=_e.nextSibling,ue.appendChild(_e)}return we}for(var Ke=Ne(De.nextSibling,0),ke;(ke=Ke.parentNode)&&ke.nodeType===1;)Ke=ke;j.push(Ke)}for(var ae=0;ae<j.length;++ae)M(j[ae]);be===(be|0)&&j[0].setAttribute("value",be);var ve=C.createElement("ol");ve.className="linenums";for(var Pe=Math.max(0,be-1|0)||0,ae=0,Oe=j.length;ae<Oe;++ae)O=j[ae],O.className="L"+(ae+Pe)%10,O.firstChild||O.appendChild(C.createTextNode("\xA0")),ve.appendChild(O);J.appendChild(ve)}function oe(J){var be=/\bMSIE\s(\d+)/.exec(navigator.userAgent);be=be&&+be[1]<=8;var Ee=/\n/g,Le=J.sourceCode,V=Le.length,C=0,O=J.spans,j=O.length,M=0,F=J.decorations,ae=F.length,ve=0;F[ae]=V;var Pe,Oe;for(Oe=Pe=0;Oe<ae;)F[Oe]!==F[Oe+2]?(F[Pe++]=F[Oe++],F[Pe++]=F[Oe++]):Oe+=2;for(ae=Pe,Oe=Pe=0;Oe<ae;){for(var De=F[Oe],Ne=F[Oe+1],Ke=Oe+2;Ke+2<=ae&&F[Ke+1]===Ne;)Ke+=2;F[Pe++]=De,F[Pe++]=Ne,Oe=Ke}ae=F.length=Pe;var ke=J.sourceNode,Re="";ke&&(Re=ke.style.display,ke.style.display="none");try{for(var Te=null;M<j;){var we=O[M],xe=O[M+2]||V,ue=F[ve+2]||V,Ke=Math.min(xe,ue),de=O[M+1],_e;if(de.nodeType!==1&&(_e=Le.substring(C,Ke))){be&&(_e=_e.replace(Ee,"\r")),de.nodeValue=_e;var me=de.ownerDocument,Ie=me.createElement("span");Ie.className=F[ve+1];var Me=de.parentNode;Me.replaceChild(Ie,de),Ie.appendChild(de),C<xe&&(O[M+1]=de=me.createTextNode(Le.substring(Ke,xe)),Me.insertBefore(de,Ie.nextSibling))}C=Ke,C>=xe&&(M+=2),C>=ue&&(ve+=2)}}finally{ke&&(ke.style.display=Re)}}var he={};function se(J,be){for(var Ee=be.length;--Ee>=0;){var Le=be[Ee];he.hasOwnProperty(Le)?w.console&&console.warn("cannot override language handler %s",Le):he[Le]=J}}function ge(J,be){return J&&he.hasOwnProperty(J)||(J=/^\s*</.test(be)?"default-markup":"default-code"),he[J]}se(ee,["default-code"]),se(H([],[[x,/^[^<?]+/],[T,/^<!\w[^>]*(?:>|$)/],[m,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[r,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),se(H([[x,/^[\s]+/,null,` \r
|
|
|
`],[k,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[S,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[D,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[r,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),se(H([],[[k,/^[\s\S]+/]]),["uq.val"]),se(q({keywords:o,hashComments:!0,cStyleComments:!0,types:c}),["c","cc","cpp","cxx","cyc","m"]),se(q({keywords:"null,true,false"}),["json"]),se(q({keywords:i,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:c}),["cs"]),se(q({keywords:t,cStyleComments:!0}),["java"]),se(q({keywords:n,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),se(q({keywords:e,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),se(q({keywords:a,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),se(q({keywords:l,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),se(q({keywords:h,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),se(q({keywords:s,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),se(H([],[[g,/^[\s\S]+/]]),["regex"]);function ie(J){var be=J.langExtension;try{var Ee=$(J.sourceNode,J.pre),Le=Ee.sourceCode;J.sourceCode=Le,J.spans=Ee.spans,J.basePos=0,ge(be,Le)(J),oe(J)}catch(V){w.console&&console.log(V&&V.stack||V)}}function re(J,be,Ee){var Le=Ee||!1,V=be||null,C=document.createElement("div");C.innerHTML="<pre>"+J+"</pre>",C=C.firstChild,Le&&fe(C,Le,!0);var O={langExtension:V,numberLines:Le,sourceNode:C,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return ie(O),C.innerHTML}function Q(J,be){var Ee=be||document.body,Le=Ee.ownerDocument||document;function V(we){return Ee.getElementsByTagName(we)}for(var C=[V("pre"),V("code"),V("xmp")],O=[],j=0;j<C.length;++j)for(var M=0,F=C[j].length;M<F;++M)O.push(C[j][M]);C=null;var ae=Date;ae.now||(ae={now:function(){return+new Date}});var ve=0,Pe=/\blang(?:uage)?-([\w.]+)(?!\S)/,Oe=/\bprettyprint\b/,De=/\bprettyprinted\b/,Ne=/pre|xmp/i,Ke=/^code$/i,ke=/^(?:pre|code|xmp)$/i,Re={};function Te(){for(var we=w.PR_SHOULD_USE_CONTINUATION?ae.now()+250:Infinity;ve<O.length&&ae.now()<we;ve++){for(var xe=O[ve],ue=Re,de=xe;de=de.previousSibling;){var _e=de.nodeType,me=(_e===7||_e===8)&&de.nodeValue;if(me?!/^\??prettify\b/.test(me):_e!==3||/\S/.test(de.nodeValue))break;if(me){ue={},me.replace(/\b(\w+)=([\w:.%+-]+)/g,function(yt,mt,pt){ue[mt]=pt});break}}var Ie=xe.className;if((ue!==Re||Oe.test(Ie))&&!De.test(Ie)){for(var Me=!1,Ve=xe.parentNode;Ve;Ve=Ve.parentNode){var ot=Ve.tagName;if(ke.test(ot)&&Ve.className&&Oe.test(Ve.className)){Me=!0;break}}if(!Me){xe.className+=" prettyprinted";var tt=ue.lang;if(!tt){tt=Ie.match(Pe);var Ge;!tt&&(Ge=N(xe))&&Ke.test(Ge.tagName)&&(tt=Ge.className.match(Pe)),tt&&(tt=tt[1])}var Je;if(Ne.test(xe.tagName))Je=1;else{var $e=xe.currentStyle,et=Le.defaultView,nt=$e?$e.whiteSpace:et&&et.getComputedStyle?et.getComputedStyle(xe,null).getPropertyValue("white-space"):0;Je=nt&&nt.substring(0,3)==="pre"}var at=ue.linenums;(at=at==="true"||+at)||(at=Ie.match(/\blinenums\b(?::(\d+))?/),at=at?at[1]&&at[1].length?+at[1]:!0:!1),at&&fe(xe,at,Je);var ft={langExtension:tt,sourceNode:xe,numberLines:at,pre:Je,sourceCode:null,basePos:null,spans:null,decorations:null};ie(ft)}}}ve<O.length?w.setTimeout(Te,250):typeof J=="function"&&J()}Te()}var pe=w.PR={createSimpleLexer:H,registerLangHandler:se,sourceDecorator:q,PR_ATTRIB_NAME:D,PR_ATTRIB_VALUE:k,PR_COMMENT:m,PR_DECLARATION:T,PR_KEYWORD:p,PR_LITERAL:y,PR_NOCODE:B,PR_PLAIN:x,PR_PUNCTUATION:r,PR_SOURCE:R,PR_STRING:g,PR_TAG:S,PR_TYPE:b,prettyPrintOne:U?w.prettyPrintOne=re:E=re,prettyPrint:A=U?w.prettyPrint=Q:A=Q},ne=w.define;typeof ne=="function"&&ne.amd&&ne("google-code-prettify",[],function(){return pe})})()},Y1PL:function(Ze,Qe,ye){"use strict";ye.r(Qe),ye.d(Qe,"ResizableTextArea",function(){return N});var Se=ye("wx14"),Z=ye("1OyB"),U=ye("vuIU"),_=ye("Ji7U"),L=ye("LK+K"),E=ye("cDcd"),A=ye("VTBJ"),w=ye("rePB"),v=ye("Zm9Q"),u=ye("Kwbf"),f=ye("c+Xe"),o=ye("m+aA"),t=ye("bdgK"),i=new Map;function s(ee){ee.forEach(function(fe){var oe,he=fe.target;(oe=i.get(he))===null||oe===void 0||oe.forEach(function(se){return se(he)})})}var h=new t.default(s),a=null,e=null;function l(ee,fe){i.has(ee)||(i.set(ee,new Set),h.observe(ee)),i.get(ee).add(fe)}function n(ee,fe){i.has(ee)&&(i.get(ee).delete(fe),i.get(ee).size||(h.unobserve(ee),i.delete(ee)))}var d=function(ee){Object(_.a)(oe,ee);var fe=Object(L.a)(oe);function oe(){return Object(Z.a)(this,oe),fe.apply(this,arguments)}return Object(U.a)(oe,[{key:"render",value:function(){return this.props.children}}]),oe}(E.Component),c=E.createContext(null);function g(ee){var fe=ee.children,oe=ee.onBatchResize,he=E.useRef(0),se=E.useRef([]),ge=E.useContext(c),ie=E.useCallback(function(re,Q,pe){he.current+=1;var ne=he.current;se.current.push({size:re,element:Q,data:pe}),Promise.resolve().then(function(){ne===he.current&&(oe==null||oe(se.current),se.current=[])}),ge==null||ge(re,Q,pe)},[oe,ge]);return E.createElement(c.Provider,{value:ie},fe)}function p(ee){var fe=ee.children,oe=ee.disabled,he=E.useRef(null),se=E.useRef(null),ge=E.useContext(c),ie=E.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),re=E.isValidElement(fe)&&Object(f.c)(fe),Q=re?fe.ref:null,pe=E.useMemo(function(){return Object(f.a)(Q,he)},[Q,he]),ne=E.useRef(ee);ne.current=ee;var J=E.useCallback(function(be){var Ee=ne.current,Le=Ee.onResize,V=Ee.data,C=be.getBoundingClientRect(),O=C.width,j=C.height,M=be.offsetWidth,F=be.offsetHeight,ae=Math.floor(O),ve=Math.floor(j);if(ie.current.width!==ae||ie.current.height!==ve||ie.current.offsetWidth!==M||ie.current.offsetHeight!==F){var Pe={width:ae,height:ve,offsetWidth:M,offsetHeight:F};ie.current=Pe;var Oe=M===Math.round(O)?O:M,De=F===Math.round(j)?j:F,Ne=Object(A.a)(Object(A.a)({},Pe),{},{offsetWidth:Oe,offsetHeight:De});ge==null||ge(Ne,be,V),Le&&Promise.resolve().then(function(){Le(Ne,be)})}},[]);return E.useEffect(function(){var be=Object(o.a)(he.current)||Object(o.a)(se.current);return be&&!oe&&l(be,J),function(){return n(be,J)}},[he.current,oe]),E.createElement(d,{ref:se},re?E.cloneElement(fe,{ref:pe}):fe)}var m="rc-observer-key";function b(ee){var fe=ee.children,oe=Object(v.a)(fe);return oe.map(function(he,se){var ge=(he==null?void 0:he.key)||"".concat(m,"-").concat(se);return E.createElement(p,Object(Se.a)({},ee,{key:ge}),he)})}b.Collection=g;var y=b,r=ye("bT9E"),x=ye("TSYQ"),S=ye.n(x),T=`
|
|
|
min-height:0 !important;
|
|
|
max-height:none !important;
|
|
|
height:0 !important;
|
|
|
visibility:hidden !important;
|
|
|
overflow:hidden !important;
|
|
|
position:absolute !important;
|
|
|
z-index:-1000 !important;
|
|
|
top:0 !important;
|
|
|
right:0 !important
|
|
|
`,R=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],D={},k;function B(ee){var fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,oe=ee.getAttribute("id")||ee.getAttribute("data-reactid")||ee.getAttribute("name");if(fe&&D[oe])return D[oe];var he=window.getComputedStyle(ee),se=he.getPropertyValue("box-sizing")||he.getPropertyValue("-moz-box-sizing")||he.getPropertyValue("-webkit-box-sizing"),ge=parseFloat(he.getPropertyValue("padding-bottom"))+parseFloat(he.getPropertyValue("padding-top")),ie=parseFloat(he.getPropertyValue("border-bottom-width"))+parseFloat(he.getPropertyValue("border-top-width")),re=R.map(function(pe){return"".concat(pe,":").concat(he.getPropertyValue(pe))}).join(";"),Q={sizingStyle:re,paddingSize:ge,borderSize:ie,boxSizing:se};return fe&&oe&&(D[oe]=Q),Q}function G(ee){var fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,oe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,he=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;k||(k=document.createElement("textarea"),k.setAttribute("tab-index","-1"),k.setAttribute("aria-hidden","true"),document.body.appendChild(k)),ee.getAttribute("wrap")?k.setAttribute("wrap",ee.getAttribute("wrap")):k.removeAttribute("wrap");var se=B(ee,fe),ge=se.paddingSize,ie=se.borderSize,re=se.boxSizing,Q=se.sizingStyle;k.setAttribute("style","".concat(Q,";").concat(T)),k.value=ee.value||ee.placeholder||"";var pe=Number.MIN_SAFE_INTEGER,ne=Number.MAX_SAFE_INTEGER,J=k.scrollHeight,be;if(re==="border-box"?J+=ie:re==="content-box"&&(J-=ge),oe!==null||he!==null){k.value=" ";var Ee=k.scrollHeight-ge;oe!==null&&(pe=Ee*oe,re==="border-box"&&(pe=pe+ge+ie),J=Math.max(pe,J)),he!==null&&(ne=Ee*he,re==="border-box"&&(ne=ne+ge+ie),be=J>ne?"":"hidden",J=Math.min(ne,J))}return{height:J,minHeight:pe,maxHeight:ne,overflowY:be,resize:"none"}}var P=ye("Gytx"),$=ye.n(P),X;(function(ee){ee[ee.NONE=0]="NONE",ee[ee.RESIZING=1]="RESIZING",ee[ee.RESIZED=2]="RESIZED"})(X||(X={}));var z=function(ee){Object(_.a)(oe,ee);var fe=Object(L.a)(oe);function oe(he){var se;return Object(Z.a)(this,oe),se=fe.call(this,he),se.nextFrameActionId=void 0,se.resizeFrameId=void 0,se.textArea=void 0,se.saveTextArea=function(ge){se.textArea=ge},se.handleResize=function(ge){var ie=se.state.resizeStatus,re=se.props,Q=re.autoSize,pe=re.onResize;if(ie!==X.NONE)return;typeof pe=="function"&&pe(ge),Q&&se.resizeOnNextFrame()},se.resizeOnNextFrame=function(){cancelAnimationFrame(se.nextFrameActionId),se.nextFrameActionId=requestAnimationFrame(se.resizeTextarea)},se.resizeTextarea=function(){var ge=se.props.autoSize;if(!ge||!se.textArea)return;var ie=ge.minRows,re=ge.maxRows,Q=G(se.textArea,!1,ie,re);se.setState({textareaStyles:Q,resizeStatus:X.RESIZING},function(){cancelAnimationFrame(se.resizeFrameId),se.resizeFrameId=requestAnimationFrame(function(){se.setState({resizeStatus:X.RESIZED},function(){se.resizeFrameId=requestAnimationFrame(function(){se.setState({resizeStatus:X.NONE}),se.fixFirefoxAutoScroll()})})})})},se.renderTextArea=function(){var ge=se.props,ie=ge.prefixCls,re=ie===void 0?"rc-textarea":ie,Q=ge.autoSize,pe=ge.onResize,ne=ge.className,J=ge.disabled,be=se.state,Ee=be.textareaStyles,Le=be.resizeStatus,V=Object(r.a)(se.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),C=S()(re,ne,Object(w.a)({},"".concat(re,"-disabled"),J));"value"in V&&(V.value=V.value||"");var O=Object(A.a)(Object(A.a)(Object(A.a)({},se.props.style),Ee),Le===X.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return E.createElement(y,{onResize:se.handleResize,disabled:!(Q||pe)},E.createElement("textarea",Object(Se.a)({},V,{className:C,style:O,ref:se.saveTextArea})))},se.state={textareaStyles:{},resizeStatus:X.NONE},se}return Object(U.a)(oe,[{key:"componentDidUpdate",value:function(se){(se.value!==this.props.value||!$()(se.autoSize,this.props.autoSize))&&this.resizeTextarea()}},{key:"componentWillUnmount",value:function(){cancelAnimationFrame(this.nextFrameActionId),cancelAnimationFrame(this.resizeFrameId)}},{key:"fixFirefoxAutoScroll",value:function(){try{if(document.activeElement===this.textArea){var se=this.textArea.selectionStart,ge=this.textArea.selectionEnd;this.textArea.setSelectionRange(se,ge)}}catch(ie){}}},{key:"render",value:function(){return this.renderTextArea()}}]),oe}(E.Component),N=z,H=function(ee){Object(_.a)(oe,ee);var fe=Object(L.a)(oe);function oe(he){var se;Object(Z.a)(this,oe),se=fe.call(this,he),se.resizableTextArea=void 0,se.focus=function(){se.resizableTextArea.textArea.focus()},se.saveTextArea=function(ie){se.resizableTextArea=ie},se.handleChange=function(ie){var re=se.props.onChange;se.setValue(ie.target.value,function(){se.resizableTextArea.resizeTextarea()}),re&&re(ie)},se.handleKeyDown=function(ie){var re=se.props,Q=re.onPressEnter,pe=re.onKeyDown;ie.keyCode===13&&Q&&Q(ie),pe&&pe(ie)};var ge=typeof he.value=="undefined"||he.value===null?he.defaultValue:he.value;return se.state={value:ge},se}return Object(U.a)(oe,[{key:"setValue",value:function(se,ge){"value"in this.props||this.setState({value:se},ge)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return E.createElement(N,Object(Se.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(se){return"value"in se?{value:se.value}:null}}]),oe}(E.Component),q=Qe.default=H},ZpRC:function(Ze,Qe,ye){"use strict";function Se(f){return typeof f=="object"&&f!=null&&f.nodeType===1}function Z(f,o){return(!o||f!=="hidden")&&f!=="visible"&&f!=="clip"}function U(f,o){if(f.clientHeight<f.scrollHeight||f.clientWidth<f.scrollWidth){var t=getComputedStyle(f,null);return Z(t.overflowY,o)||Z(t.overflowX,o)||function(i){var s=function(h){if(!h.ownerDocument||!h.ownerDocument.defaultView)return null;try{return h.ownerDocument.defaultView.frameElement}catch(a){return null}}(i);return!!s&&(s.clientHeight<i.scrollHeight||s.clientWidth<i.scrollWidth)}(f)}return!1}function _(f,o,t,i,s,h,a,e){return h<f&&a>o||h>f&&a<o?0:h<=f&&e<=t||a>=o&&e>=t?h-f-i:a>o&&e<t||h<f&&e>t?a-o+s:0}var L=function(f,o){var t=window,i=o.scrollMode,s=o.block,h=o.inline,a=o.boundary,e=o.skipOverflowHiddenElements,l=typeof a=="function"?a:function(Ee){return Ee!==a};if(!Se(f))throw new TypeError("Invalid target");for(var n=document.scrollingElement||document.documentElement,d=[],c=f;Se(c)&&l(c);){if((c=c.parentElement)===n){d.push(c);break}c!=null&&c===document.body&&U(c)&&!U(document.documentElement)||c!=null&&U(c,e)&&d.push(c)}for(var g=t.visualViewport?t.visualViewport.width:innerWidth,p=t.visualViewport?t.visualViewport.height:innerHeight,m=window.scrollX||pageXOffset,b=window.scrollY||pageYOffset,y=f.getBoundingClientRect(),r=y.height,x=y.width,S=y.top,T=y.right,R=y.bottom,D=y.left,k=s==="start"||s==="nearest"?S:s==="end"?R:S+r/2,B=h==="center"?D+x/2:h==="end"?T:D,G=[],P=0;P<d.length;P++){var $=d[P],X=$.getBoundingClientRect(),z=X.height,N=X.width,H=X.top,q=X.right,ee=X.bottom,fe=X.left;if(i==="if-needed"&&S>=0&&D>=0&&R<=p&&T<=g&&S>=H&&R<=ee&&D>=fe&&T<=q)return G;var oe=getComputedStyle($),he=parseInt(oe.borderLeftWidth,10),se=parseInt(oe.borderTopWidth,10),ge=parseInt(oe.borderRightWidth,10),ie=parseInt(oe.borderBottomWidth,10),re=0,Q=0,pe="offsetWidth"in $?$.offsetWidth-$.clientWidth-he-ge:0,ne="offsetHeight"in $?$.offsetHeight-$.clientHeight-se-ie:0;if(n===$)re=s==="start"?k:s==="end"?k-p:s==="nearest"?_(b,b+p,p,se,ie,b+k,b+k+r,r):k-p/2,Q=h==="start"?B:h==="center"?B-g/2:h==="end"?B-g:_(m,m+g,g,he,ge,m+B,m+B+x,x),re=Math.max(0,re+b),Q=Math.max(0,Q+m);else{re=s==="start"?k-H-se:s==="end"?k-ee+ie+ne:s==="nearest"?_(H,ee,z,se,ie+ne,k,k+r,r):k-(H+z/2)+ne/2,Q=h==="start"?B-fe-he:h==="center"?B-(fe+N/2)+pe/2:h==="end"?B-q+ge+pe:_(fe,q,N,he,ge+pe,B,B+x,x);var J=$.scrollLeft,be=$.scrollTop;k+=be-(re=Math.max(0,Math.min(be+re,$.scrollHeight-z+ne))),B+=J-(Q=Math.max(0,Math.min(J+Q,$.scrollWidth-N+pe)))}G.push({el:$,top:re,left:Q})}return G};function E(f){return f===Object(f)&&Object.keys(f).length!==0}function A(f,o){o===void 0&&(o="auto");var t="scrollBehavior"in document.body.style;f.forEach(function(i){var s=i.el,h=i.top,a=i.left;s.scroll&&t?s.scroll({top:h,left:a,behavior:o}):(s.scrollTop=h,s.scrollLeft=a)})}function w(f){return f===!1?{block:"end",inline:"nearest"}:E(f)?f:{block:"start",inline:"nearest"}}function v(f,o){var t=!f.ownerDocument.documentElement.contains(f);if(E(o)&&typeof o.behavior=="function")return o.behavior(t?[]:L(f,o));if(t)return;var i=w(o);return A(L(f,i),i.behavior)}var u=Qe.a=v},Zss7:function(Ze,Qe,ye){var Se;(function(Z){var U=/^\s+/,_=/\s+$/,L=0,E=Z.round,A=Z.min,w=Z.max,v=Z.random;function u(ie,re){if(ie=ie||"",re=re||{},ie instanceof u)return ie;if(!(this instanceof u))return new u(ie,re);var Q=f(ie);this._originalInput=ie,this._r=Q.r,this._g=Q.g,this._b=Q.b,this._a=Q.a,this._roundA=E(100*this._a)/100,this._format=re.format||Q.format,this._gradientType=re.gradientType,this._r<1&&(this._r=E(this._r)),this._g<1&&(this._g=E(this._g)),this._b<1&&(this._b=E(this._b)),this._ok=Q.ok,this._tc_id=L++}u.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var ie=this.toRgb();return(ie.r*299+ie.g*587+ie.b*114)/1e3},getLuminance:function(){var ie=this.toRgb(),re,Q,pe,ne,J,be;return re=ie.r/255,Q=ie.g/255,pe=ie.b/255,re<=.03928?ne=re/12.92:ne=Z.pow((re+.055)/1.055,2.4),Q<=.03928?J=Q/12.92:J=Z.pow((Q+.055)/1.055,2.4),pe<=.03928?be=pe/12.92:be=Z.pow((pe+.055)/1.055,2.4),.2126*ne+.7152*J+.0722*be},setAlpha:function(ie){return this._a=G(ie),this._roundA=E(100*this._a)/100,this},toHsv:function(){var ie=s(this._r,this._g,this._b);return{h:ie.h*360,s:ie.s,v:ie.v,a:this._a}},toHsvString:function(){var ie=s(this._r,this._g,this._b),re=E(ie.h*360),Q=E(ie.s*100),pe=E(ie.v*100);return this._a==1?"hsv("+re+", "+Q+"%, "+pe+"%)":"hsva("+re+", "+Q+"%, "+pe+"%, "+this._roundA+")"},toHsl:function(){var ie=t(this._r,this._g,this._b);return{h:ie.h*360,s:ie.s,l:ie.l,a:this._a}},toHslString:function(){var ie=t(this._r,this._g,this._b),re=E(ie.h*360),Q=E(ie.s*100),pe=E(ie.l*100);return this._a==1?"hsl("+re+", "+Q+"%, "+pe+"%)":"hsla("+re+", "+Q+"%, "+pe+"%, "+this._roundA+")"},toHex:function(ie){return a(this._r,this._g,this._b,ie)},toHexString:function(ie){return"#"+this.toHex(ie)},toHex8:function(ie){return e(this._r,this._g,this._b,this._a,ie)},toHex8String:function(ie){return"#"+this.toHex8(ie)},toRgb:function(){return{r:E(this._r),g:E(this._g),b:E(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+E(this._r)+", "+E(this._g)+", "+E(this._b)+")":"rgba("+E(this._r)+", "+E(this._g)+", "+E(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:E(P(this._r,255)*100)+"%",g:E(P(this._g,255)*100)+"%",b:E(P(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+E(P(this._r,255)*100)+"%, "+E(P(this._g,255)*100)+"%, "+E(P(this._b,255)*100)+"%)":"rgba("+E(P(this._r,255)*100)+"%, "+E(P(this._g,255)*100)+"%, "+E(P(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:k[a(this._r,this._g,this._b,!0)]||!1},toFilter:function(ie){var re="#"+l(this._r,this._g,this._b,this._a),Q=re,pe=this._gradientType?"GradientType = 1, ":"";if(ie){var ne=u(ie);Q="#"+l(ne._r,ne._g,ne._b,ne._a)}return"progid:DXImageTransform.Microsoft.gradient("+pe+"startColorstr="+re+",endColorstr="+Q+")"},toString:function(ie){var re=!!ie;ie=ie||this._format;var Q=!1,pe=this._a<1&&this._a>=0,ne=!re&&pe&&(ie==="hex"||ie==="hex6"||ie==="hex3"||ie==="hex4"||ie==="hex8"||ie==="name");return ne?ie==="name"&&this._a===0?this.toName():this.toRgbString():(ie==="rgb"&&(Q=this.toRgbString()),ie==="prgb"&&(Q=this.toPercentageRgbString()),(ie==="hex"||ie==="hex6")&&(Q=this.toHexString()),ie==="hex3"&&(Q=this.toHexString(!0)),ie==="hex4"&&(Q=this.toHex8String(!0)),ie==="hex8"&&(Q=this.toHex8String()),ie==="name"&&(Q=this.toName()),ie==="hsl"&&(Q=this.toHslString()),ie==="hsv"&&(Q=this.toHsvString()),Q||this.toHexString())},clone:function(){return u(this.toString())},_applyModification:function(ie,re){var Q=ie.apply(null,[this].concat([].slice.call(re)));return this._r=Q._r,this._g=Q._g,this._b=Q._b,this.setAlpha(Q._a),this},lighten:function(){return this._applyModification(g,arguments)},brighten:function(){return this._applyModification(p,arguments)},darken:function(){return this._applyModification(m,arguments)},desaturate:function(){return this._applyModification(n,arguments)},saturate:function(){return this._applyModification(d,arguments)},greyscale:function(){return this._applyModification(c,arguments)},spin:function(){return this._applyModification(b,arguments)},_applyCombination:function(ie,re){return ie.apply(null,[this].concat([].slice.call(re)))},analogous:function(){return this._applyCombination(T,arguments)},complement:function(){return this._applyCombination(y,arguments)},monochromatic:function(){return this._applyCombination(R,arguments)},splitcomplement:function(){return this._applyCombination(S,arguments)},triad:function(){return this._applyCombination(r,arguments)},tetrad:function(){return this._applyCombination(x,arguments)}},u.fromRatio=function(ie,re){if(typeof ie=="object"){var Q={};for(var pe in ie)ie.hasOwnProperty(pe)&&(pe==="a"?Q[pe]=ie[pe]:Q[pe]=q(ie[pe]));ie=Q}return u(ie,re)};function f(ie){var re={r:0,g:0,b:0},Q=1,pe=null,ne=null,J=null,be=!1,Ee=!1;return typeof ie=="string"&&(ie=se(ie)),typeof ie=="object"&&(he(ie.r)&&he(ie.g)&&he(ie.b)?(re=o(ie.r,ie.g,ie.b),be=!0,Ee=String(ie.r).substr(-1)==="%"?"prgb":"rgb"):he(ie.h)&&he(ie.s)&&he(ie.v)?(pe=q(ie.s),ne=q(ie.v),re=h(ie.h,pe,ne),be=!0,Ee="hsv"):he(ie.h)&&he(ie.s)&&he(ie.l)&&(pe=q(ie.s),J=q(ie.l),re=i(ie.h,pe,J),be=!0,Ee="hsl"),ie.hasOwnProperty("a")&&(Q=ie.a)),Q=G(Q),{ok:be,format:ie.format||Ee,r:A(255,w(re.r,0)),g:A(255,w(re.g,0)),b:A(255,w(re.b,0)),a:Q}}function o(ie,re,Q){return{r:P(ie,255)*255,g:P(re,255)*255,b:P(Q,255)*255}}function t(ie,re,Q){ie=P(ie,255),re=P(re,255),Q=P(Q,255);var pe=w(ie,re,Q),ne=A(ie,re,Q),J,be,Ee=(pe+ne)/2;if(pe==ne)J=be=0;else{var Le=pe-ne;be=Ee>.5?Le/(2-pe-ne):Le/(pe+ne);switch(pe){case ie:J=(re-Q)/Le+(re<Q?6:0);break;case re:J=(Q-ie)/Le+2;break;case Q:J=(ie-re)/Le+4;break}J/=6}return{h:J,s:be,l:Ee}}function i(ie,re,Q){var pe,ne,J;ie=P(ie,360),re=P(re,100),Q=P(Q,100);function be(V,C,O){return O<0&&(O+=1),O>1&&(O-=1),O<1/6?V+(C-V)*6*O:O<1/2?C:O<2/3?V+(C-V)*(2/3-O)*6:V}if(re===0)pe=ne=J=Q;else{var Ee=Q<.5?Q*(1+re):Q+re-Q*re,Le=2*Q-Ee;pe=be(Le,Ee,ie+1/3),ne=be(Le,Ee,ie),J=be(Le,Ee,ie-1/3)}return{r:pe*255,g:ne*255,b:J*255}}function s(ie,re,Q){ie=P(ie,255),re=P(re,255),Q=P(Q,255);var pe=w(ie,re,Q),ne=A(ie,re,Q),J,be,Ee=pe,Le=pe-ne;if(be=pe===0?0:Le/pe,pe==ne)J=0;else{switch(pe){case ie:J=(re-Q)/Le+(re<Q?6:0);break;case re:J=(Q-ie)/Le+2;break;case Q:J=(ie-re)/Le+4;break}J/=6}return{h:J,s:be,v:Ee}}function h(ie,re,Q){ie=P(ie,360)*6,re=P(re,100),Q=P(Q,100);var pe=Z.floor(ie),ne=ie-pe,J=Q*(1-re),be=Q*(1-ne*re),Ee=Q*(1-(1-ne)*re),Le=pe%6,V=[Q,be,J,J,Ee,Q][Le],C=[Ee,Q,Q,be,J,J][Le],O=[J,J,Ee,Q,Q,be][Le];return{r:V*255,g:C*255,b:O*255}}function a(ie,re,Q,pe){var ne=[H(E(ie).toString(16)),H(E(re).toString(16)),H(E(Q).toString(16))];return pe&&ne[0].charAt(0)==ne[0].charAt(1)&&ne[1].charAt(0)==ne[1].charAt(1)&&ne[2].charAt(0)==ne[2].charAt(1)?ne[0].charAt(0)+ne[1].charAt(0)+ne[2].charAt(0):ne.join("")}function e(ie,re,Q,pe,ne){var J=[H(E(ie).toString(16)),H(E(re).toString(16)),H(E(Q).toString(16)),H(ee(pe))];return ne&&J[0].charAt(0)==J[0].charAt(1)&&J[1].charAt(0)==J[1].charAt(1)&&J[2].charAt(0)==J[2].charAt(1)&&J[3].charAt(0)==J[3].charAt(1)?J[0].charAt(0)+J[1].charAt(0)+J[2].charAt(0)+J[3].charAt(0):J.join("")}function l(ie,re,Q,pe){var ne=[H(ee(pe)),H(E(ie).toString(16)),H(E(re).toString(16)),H(E(Q).toString(16))];return ne.join("")}u.equals=function(ie,re){return!ie||!re?!1:u(ie).toRgbString()==u(re).toRgbString()},u.random=function(){return u.fromRatio({r:v(),g:v(),b:v()})};function n(ie,re){re=re===0?0:re||10;var Q=u(ie).toHsl();return Q.s-=re/100,Q.s=$(Q.s),u(Q)}function d(ie,re){re=re===0?0:re||10;var Q=u(ie).toHsl();return Q.s+=re/100,Q.s=$(Q.s),u(Q)}function c(ie){return u(ie).desaturate(100)}function g(ie,re){re=re===0?0:re||10;var Q=u(ie).toHsl();return Q.l+=re/100,Q.l=$(Q.l),u(Q)}function p(ie,re){re=re===0?0:re||10;var Q=u(ie).toRgb();return Q.r=w(0,A(255,Q.r-E(255*-(re/100)))),Q.g=w(0,A(255,Q.g-E(255*-(re/100)))),Q.b=w(0,A(255,Q.b-E(255*-(re/100)))),u(Q)}function m(ie,re){re=re===0?0:re||10;var Q=u(ie).toHsl();return Q.l-=re/100,Q.l=$(Q.l),u(Q)}function b(ie,re){var Q=u(ie).toHsl(),pe=(Q.h+re)%360;return Q.h=pe<0?360+pe:pe,u(Q)}function y(ie){var re=u(ie).toHsl();return re.h=(re.h+180)%360,u(re)}function r(ie){var re=u(ie).toHsl(),Q=re.h;return[u(ie),u({h:(Q+120)%360,s:re.s,l:re.l}),u({h:(Q+240)%360,s:re.s,l:re.l})]}function x(ie){var re=u(ie).toHsl(),Q=re.h;return[u(ie),u({h:(Q+90)%360,s:re.s,l:re.l}),u({h:(Q+180)%360,s:re.s,l:re.l}),u({h:(Q+270)%360,s:re.s,l:re.l})]}function S(ie){var re=u(ie).toHsl(),Q=re.h;return[u(ie),u({h:(Q+72)%360,s:re.s,l:re.l}),u({h:(Q+216)%360,s:re.s,l:re.l})]}function T(ie,re,Q){re=re||6,Q=Q||30;var pe=u(ie).toHsl(),ne=360/Q,J=[u(ie)];for(pe.h=(pe.h-(ne*re>>1)+720)%360;--re;)pe.h=(pe.h+ne)%360,J.push(u(pe));return J}function R(ie,re){re=re||6;for(var Q=u(ie).toHsv(),pe=Q.h,ne=Q.s,J=Q.v,be=[],Ee=1/re;re--;)be.push(u({h:pe,s:ne,v:J})),J=(J+Ee)%1;return be}u.mix=function(ie,re,Q){Q=Q===0?0:Q||50;var pe=u(ie).toRgb(),ne=u(re).toRgb(),J=Q/100,be={r:(ne.r-pe.r)*J+pe.r,g:(ne.g-pe.g)*J+pe.g,b:(ne.b-pe.b)*J+pe.b,a:(ne.a-pe.a)*J+pe.a};return u(be)},u.readability=function(ie,re){var Q=u(ie),pe=u(re);return(Z.max(Q.getLuminance(),pe.getLuminance())+.05)/(Z.min(Q.getLuminance(),pe.getLuminance())+.05)},u.isReadable=function(ie,re,Q){var pe=u.readability(ie,re),ne,J;J=!1,ne=ge(Q);switch(ne.level+ne.size){case"AAsmall":case"AAAlarge":J=pe>=4.5;break;case"AAlarge":J=pe>=3;break;case"AAAsmall":J=pe>=7;break}return J},u.mostReadable=function(ie,re,Q){var pe=null,ne=0,J,be,Ee,Le;Q=Q||{},be=Q.includeFallbackColors,Ee=Q.level,Le=Q.size;for(var V=0;V<re.length;V++)J=u.readability(ie,re[V]),J>ne&&(ne=J,pe=u(re[V]));return u.isReadable(ie,pe,{level:Ee,size:Le})||!be?pe:(Q.includeFallbackColors=!1,u.mostReadable(ie,["#fff","#000"],Q))};var D=u.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},k=u.hexNames=B(D);function B(ie){var re={};for(var Q in ie)ie.hasOwnProperty(Q)&&(re[ie[Q]]=Q);return re}function G(ie){return ie=parseFloat(ie),(isNaN(ie)||ie<0||ie>1)&&(ie=1),ie}function P(ie,re){z(ie)&&(ie="100%");var Q=N(ie);return ie=A(re,w(0,parseFloat(ie))),Q&&(ie=parseInt(ie*re,10)/100),Z.abs(ie-re)<1e-6?1:ie%re/parseFloat(re)}function $(ie){return A(1,w(0,ie))}function X(ie){return parseInt(ie,16)}function z(ie){return typeof ie=="string"&&ie.indexOf(".")!=-1&&parseFloat(ie)===1}function N(ie){return typeof ie=="string"&&ie.indexOf("%")!=-1}function H(ie){return ie.length==1?"0"+ie:""+ie}function q(ie){return ie<=1&&(ie=ie*100+"%"),ie}function ee(ie){return Z.round(parseFloat(ie)*255).toString(16)}function fe(ie){return X(ie)/255}var oe=function(){var ie="[-\\+]?\\d+%?",re="[-\\+]?\\d*\\.\\d+%?",Q="(?:"+re+")|(?:"+ie+")",pe="[\\s|\\(]+("+Q+")[,|\\s]+("+Q+")[,|\\s]+("+Q+")\\s*\\)?",ne="[\\s|\\(]+("+Q+")[,|\\s]+("+Q+")[,|\\s]+("+Q+")[,|\\s]+("+Q+")\\s*\\)?";return{CSS_UNIT:new RegExp(Q),rgb:new RegExp("rgb"+pe),rgba:new RegExp("rgba"+ne),hsl:new RegExp("hsl"+pe),hsla:new RegExp("hsla"+ne),hsv:new RegExp("hsv"+pe),hsva:new RegExp("hsva"+ne),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function he(ie){return!!oe.CSS_UNIT.exec(ie)}function se(ie){ie=ie.replace(U,"").replace(_,"").toLowerCase();var re=!1;if(D[ie])ie=D[ie],re=!0;else if(ie=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var Q;return(Q=oe.rgb.exec(ie))?{r:Q[1],g:Q[2],b:Q[3]}:(Q=oe.rgba.exec(ie))?{r:Q[1],g:Q[2],b:Q[3],a:Q[4]}:(Q=oe.hsl.exec(ie))?{h:Q[1],s:Q[2],l:Q[3]}:(Q=oe.hsla.exec(ie))?{h:Q[1],s:Q[2],l:Q[3],a:Q[4]}:(Q=oe.hsv.exec(ie))?{h:Q[1],s:Q[2],v:Q[3]}:(Q=oe.hsva.exec(ie))?{h:Q[1],s:Q[2],v:Q[3],a:Q[4]}:(Q=oe.hex8.exec(ie))?{r:X(Q[1]),g:X(Q[2]),b:X(Q[3]),a:fe(Q[4]),format:re?"name":"hex8"}:(Q=oe.hex6.exec(ie))?{r:X(Q[1]),g:X(Q[2]),b:X(Q[3]),format:re?"name":"hex"}:(Q=oe.hex4.exec(ie))?{r:X(Q[1]+""+Q[1]),g:X(Q[2]+""+Q[2]),b:X(Q[3]+""+Q[3]),a:fe(Q[4]+""+Q[4]),format:re?"name":"hex8"}:(Q=oe.hex3.exec(ie))?{r:X(Q[1]+""+Q[1]),g:X(Q[2]+""+Q[2]),b:X(Q[3]+""+Q[3]),format:re?"name":"hex"}:!1}function ge(ie){var re,Q;return ie=ie||{level:"AA",size:"small"},re=(ie.level||"AA").toUpperCase(),Q=(ie.size||"small").toLowerCase(),re!=="AA"&&re!=="AAA"&&(re="AA"),Q!=="small"&&Q!=="large"&&(Q="small"),{level:re,size:Q}}Ze.exports?Ze.exports=u:!(Se=function(){return u}.call(Qe,ye,Qe,Ze),Se!==void 0&&(Ze.exports=Se))})(Math)},b57q:function(Ze,Qe,ye){Ze.exports={officeContainer:"officeContainer___z7fd9"}},bT9E:function(Ze,Qe,ye){"use strict";ye.d(Qe,"a",function(){return Z});var Se=ye("VTBJ");function Z(U,_){var L=Object(Se.a)({},U);return Array.isArray(_)&&_.forEach(function(E){delete L[E]}),L}},eoI0:function(Ze,Qe,ye){Ze.exports={selectSchool:"selectSchool___2Vrh7",delete:"delete___qM8Jm"}},"h/US":function(Ze,Qe,ye){"use strict";var Se=ye("DZo9"),Z=ye("8z0m"),U=ye("miYZ"),_=ye("tsqr"),L=ye("+L6B"),E=ye("2/Rp"),A=ye("tJVT"),w=ye("cDcd"),v=ye.n(w),u=ye("z7Xi"),f=ye("jN4g"),o=ye("m3rI"),t=ye("w8Aa"),i=ye.n(t),s=function(a){var e=a.value,l=a.onChange,n=a.getFileProgress,d=Object(w.useState)(!1),c=Object(A.a)(d,2),g=c[0],p=c[1],m=v.a.createElement(E.a,{loading:g,icon:v.a.createElement(u.a,null)},"\u9009\u62E9\u4E0A\u4F20\u6587\u4EF6"),b=function(){return v.a.createElement("div",{className:i.a.img},v.a.createElement("img",{src:o.a.API_SERVER+"/api/attachments/"+e,alt:"avatar",style:{width:288}}),v.a.createElement("div",null,v.a.createElement(f.a,{onClick:function(){return l("")},style:{fontSize:"16px",color:"red"}})))},y=function(x){if(n&&n(x),x.file.status==="uploading"){p(!0);return}if(x.file.status==="done"){var S,T,R,D;if(p(!1),x.file.status==="done"&&((S=x.file)===null||S===void 0||((T=S.response)===null||T===void 0)?void 0:T.status)===-1){var k,B;_.b.error((k=x.file)===null||k===void 0||((B=k.response)===null||B===void 0)?void 0:B.message);return}l(x==null||((R=x.file)===null||R===void 0||((D=R.response)===null||D===void 0))?void 0:D.id)}};return v.a.createElement(v.a.Fragment,null,e?b():v.a.createElement("div",null,v.a.createElement(Z.a,{withCredentials:!0,name:"file",showUploadList:!1,action:"".concat(o.a.API_SERVER,"/api/attachments.json"),onChange:y,accept:"image/*"},m),v.a.createElement("div",{className:"mt20 c-light-black"},"\u8BF4\u660E\uFF1A\u652F\u6301\u4E0A\u4F20jpg/png\u7B49\u683C\u5F0F\u6587\u4EF6\uFF0C\u6587\u4EF6\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC72M,\u5EFA\u8BAE\u4F7F\u7528288*158\u50CF\u7D20\uFF1B"),v.a.createElement("div",{className:"c-light-black"},"\u5982\u4E0D\u4E0A\u4F20\uFF0C\u9ED8\u8BA4\u4F7F\u7528\u7CFB\u7EDF\u56FE\u7247\u3002")))};Qe.a=s},h78n:function(Ze,Qe,ye){"use strict";ye.d(Qe,"a",function(){return R});var Se=ye("cDcd"),Z=ye.n(Se),U=ye("TSYQ"),_=ye.n(U),L={className:"",percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,style:{},trailColor:"#D9D9D9",trailWidth:1},E=function(B){var G=B.map(function(){return Object(Se.useRef)()}),P=Object(Se.useRef)();return Object(Se.useEffect)(function(){var $=Date.now(),X=!1;Object.keys(G).forEach(function(z){var N=G[z].current;if(!N)return;X=!0;var H=N.style;H.transitionDuration=".3s, .3s, .3s, .06s",P.current&&$-P.current<100&&(H.transitionDuration="0s, 0s")}),X&&(P.current=Date.now())}),[G]};function A(){return A=Object.assign||function(k){for(var B=1;B<arguments.length;B++){var G=arguments[B];for(var P in G)Object.prototype.hasOwnProperty.call(G,P)&&(k[P]=G[P])}return k},A.apply(this,arguments)}function w(k,B){return t(k)||o(k,B)||u(k,B)||v()}function v(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function u(k,B){if(!k)return;if(typeof k=="string")return f(k,B);var G=Object.prototype.toString.call(k).slice(8,-1);if(G==="Object"&&k.constructor&&(G=k.constructor.name),G==="Map"||G==="Set")return Array.from(k);if(G==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(G))return f(k,B)}function f(k,B){(B==null||B>k.length)&&(B=k.length);for(var G=0,P=new Array(B);G<B;G++)P[G]=k[G];return P}function o(k,B){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(k)))return;var G=[],P=!0,$=!1,X=void 0;try{for(var z=k[Symbol.iterator](),N;!(P=(N=z.next()).done)&&!(G.push(N.value),B&&G.length===B);P=!0);}catch(H){$=!0,X=H}finally{try{!P&&z.return!=null&&z.return()}finally{if($)throw X}}return G}function t(k){if(Array.isArray(k))return k}function i(k,B){if(k==null)return{};var G=s(k,B),P,$;if(Object.getOwnPropertySymbols){var X=Object.getOwnPropertySymbols(k);for($=0;$<X.length;$++){if(P=X[$],B.indexOf(P)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(k,P))continue;G[P]=k[P]}}return G}function s(k,B){if(k==null)return{};var G={},P=Object.keys(k),$,X;for(X=0;X<P.length;X++){if($=P[X],B.indexOf($)>=0)continue;G[$]=k[$]}return G}var h=function(B){var G=B.className,P=B.percent,$=B.prefixCls,X=B.strokeColor,z=B.strokeLinecap,N=B.strokeWidth,H=B.style,q=B.trailColor,ee=B.trailWidth,fe=B.transition,oe=i(B,["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"]);delete oe.gapPosition;var he=Array.isArray(P)?P:[P],se=Array.isArray(X)?X:[X],ge=E(he),ie=w(ge,1),re=ie[0],Q=N/2,pe=100-N/2,ne="M ".concat(z==="round"?Q:0,",").concat(Q,`
|
|
|
L `).concat(z==="round"?pe:100,",").concat(Q),J="0 0 100 ".concat(N),be=0;return Z.a.createElement("svg",A({className:_()("".concat($,"-line"),G),viewBox:J,preserveAspectRatio:"none",style:H},oe),Z.a.createElement("path",{className:"".concat($,"-line-trail"),d:ne,strokeLinecap:z,stroke:q,strokeWidth:ee||N,fillOpacity:"0"}),he.map(function(Ee,Le){var V={strokeDasharray:"".concat(Ee,"px, 100px"),strokeDashoffset:"-".concat(be,"px"),transition:fe||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},C=se[Le]||se[se.length-1];return be+=Ee,Z.a.createElement("path",{key:Le,className:"".concat($,"-line-path"),d:ne,strokeLinecap:z,stroke:C,strokeWidth:N,fillOpacity:"0",ref:re[Le],style:V})}))};h.defaultProps=L;var a=h;function e(){return e=Object.assign||function(k){for(var B=1;B<arguments.length;B++){var G=arguments[B];for(var P in G)Object.prototype.hasOwnProperty.call(G,P)&&(k[P]=G[P])}return k},e.apply(this,arguments)}function l(k,B){return p(k)||g(k,B)||d(k,B)||n()}function n(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function d(k,B){if(!k)return;if(typeof k=="string")return c(k,B);var G=Object.prototype.toString.call(k).slice(8,-1);if(G==="Object"&&k.constructor&&(G=k.constructor.name),G==="Map"||G==="Set")return Array.from(k);if(G==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(G))return c(k,B)}function c(k,B){(B==null||B>k.length)&&(B=k.length);for(var G=0,P=new Array(B);G<B;G++)P[G]=k[G];return P}function g(k,B){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(k)))return;var G=[],P=!0,$=!1,X=void 0;try{for(var z=k[Symbol.iterator](),N;!(P=(N=z.next()).done)&&!(G.push(N.value),B&&G.length===B);P=!0);}catch(H){$=!0,X=H}finally{try{!P&&z.return!=null&&z.return()}finally{if($)throw X}}return G}function p(k){if(Array.isArray(k))return k}function m(k,B){if(k==null)return{};var G=b(k,B),P,$;if(Object.getOwnPropertySymbols){var X=Object.getOwnPropertySymbols(k);for($=0;$<X.length;$++){if(P=X[$],B.indexOf(P)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(k,P))continue;G[P]=k[P]}}return G}function b(k,B){if(k==null)return{};var G={},P=Object.keys(k),$,X;for(X=0;X<P.length;X++){if($=P[X],B.indexOf($)>=0)continue;G[$]=k[$]}return G}var y=0;function r(k){return+k.replace("%","")}function x(k){return Array.isArray(k)?k:[k]}function S(k,B,G,P){var $=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,X=arguments.length>5?arguments[5]:void 0,z=50-P/2,N=0,H=-z,q=0,ee=-2*z;switch(X){case"left":N=-z,H=0,q=2*z,ee=0;break;case"right":N=z,H=0,q=-2*z,ee=0;break;case"bottom":H=z,ee=2*z;break;default:}var fe="M 50,50 m ".concat(N,",").concat(H,`
|
|
|
a `).concat(z,",").concat(z," 0 1 1 ").concat(q,",").concat(-ee,`
|
|
|
a `).concat(z,",").concat(z," 0 1 1 ").concat(-q,",").concat(ee),oe=Math.PI*2*z,he={stroke:G,strokeDasharray:"".concat(B/100*(oe-$),"px ").concat(oe,"px"),strokeDashoffset:"-".concat($/2+k/100*(oe-$),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"};return{pathString:fe,pathStyle:he}}var T=function(B){var G=B.prefixCls,P=B.strokeWidth,$=B.trailWidth,X=B.gapDegree,z=B.gapPosition,N=B.trailColor,H=B.strokeLinecap,q=B.style,ee=B.className,fe=B.strokeColor,oe=B.percent,he=m(B,["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"]),se=Object(Se.useMemo)(function(){return y+=1,y},[]),ge=S(0,100,N,P,X,z),ie=ge.pathString,re=ge.pathStyle,Q=x(oe),pe=x(fe),ne=pe.find(function(V){return Object.prototype.toString.call(V)==="[object Object]"}),J=E(Q),be=l(J,1),Ee=be[0],Le=function(){var C=0;return Q.map(function(O,j){var M=pe[j]||pe[pe.length-1],F=Object.prototype.toString.call(M)==="[object Object]"?"url(#".concat(G,"-gradient-").concat(se,")"):"",ae=S(C,O,M,P,X,z);return C+=O,Z.a.createElement("path",{key:j,className:"".concat(G,"-circle-path"),d:ae.pathString,stroke:F,strokeLinecap:H,strokeWidth:P,opacity:O===0?0:1,fillOpacity:"0",style:ae.pathStyle,ref:Ee[j]})})};return Z.a.createElement("svg",e({className:_()("".concat(G,"-circle"),ee),viewBox:"0 0 100 100",style:q},he),ne&&Z.a.createElement("defs",null,Z.a.createElement("linearGradient",{id:"".concat(G,"-gradient-").concat(se),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(ne).sort(function(V,C){return r(V)-r(C)}).map(function(V,C){return Z.a.createElement("stop",{key:C,offset:V,stopColor:ne[V]})}))),Z.a.createElement("path",{className:"".concat(G,"-circle-trail"),d:ie,stroke:N,strokeLinecap:H,strokeWidth:$||P,fillOpacity:"0",style:re}),Le().reverse())};T.defaultProps=L;var R=T,D={Line:a,Circle:R}},hgre:function(Ze,Qe,ye){"use strict";var Se=ye("miYZ"),Z=ye("tsqr"),U=ye("9og8"),_=ye("WmNS"),L=ye.n(_),E=ye("cDcd"),A=ye.n(E),w=ye("GUcZ"),v=ye("ulZh"),u=ye.n(v),f=ye("xKgJ"),o=ye("P5Jw"),t=ye.n(o),i=ye("bntm"),s=ye("4xil"),h=ye.n(s);function a(d){if(isNaN(d))return{minutes:"00",seconds:"00"};var c=new Date(d*1e3).toISOString().substr(11,8);return{hour:c.substr(0,2),minutes:c.substr(3,2),seconds:c.substr(6,2)}}Object.defineProperty(HTMLMediaElement.prototype,"playing",{get:function(){return this.currentTime>0&&!this.paused&&!this.ended&&this.readyState>2}});function e(d,c){return d-c}function l(d){d.sort(e);for(var c=0,g=0;g<d.length-1;g++){var p=Math.abs(d[g+1]-d[g]);p<21&&(c+=p)}return c}var n=/(android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini)/i;Qe.a=Object(E.forwardRef)(function(d,c){var g,p=d.src,m=d.toLog,b=d.videoId,y=d.logWatchHistory,r=d.courseId,x=r===void 0?null:r,S=d.startTime,T=d.handlePause,R=T===void 0?function(){}:T,D=d.handlePlay,k=D===void 0?function(){}:D,B=d.handlePlayEnded,G=B===void 0?function(){}:B,P=d.videoSpeed,$=P===void 0?1:P,X=p==null||((g=p.split("."))===null||g===void 0)?void 0:g.pop(),z=X==="flv",N=Object(E.useRef)(),H=Object(E.useRef)(),q=Object(E.useRef)(),ee=Object(E.useRef)(),fe=Object(E.useRef)(),oe=Object(E.useRef)(),he=Object(E.useRef)(),se=Object(E.useRef)(),ge=Object(E.useRef)(),ie=Object(E.useRef)(),re=Object(E.useRef)(),Q=Object(E.useRef)(),pe=Object(E.useRef)(),ne=Object(E.useRef)(),J=navigator.userAgent.toLowerCase().match(n),be=J?J[0]:"pc",Ee=Object(E.useRef)(!1),Le=Object(f.x)(),V=0,C=0,O=0,j=null,M=!1,F=20,ae=1,ve=!1,Pe=!1,Oe=[];Object(E.useImperativeHandle)(c,function(){return{getLastUpdatedTime:function(){return N.current.currentTime},getDuration:function(){return N.current.duration}}});var De=Object(E.useCallback)(function(Te){var we=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,xe={point:N.current.currentTime};j?(xe.log_id=j,xe.watch_duration=l(Oe),xe.total_duration=C):(x?(xe.video_id=parseInt(b,10),xe.course_id=x):xe.video_id=b,xe.duration=V,xe.device=be),we&&(xe.ed="1");function ue(){return de.apply(this,arguments)}function de(){return de=Object(U.a)(L.a.mark(function _e(){var me;return L.a.wrap(function(Me){for(;;)switch(Me.prev=Me.next){case 0:return ve=!0,Me.next=3,y(xe);case 3:me=Me.sent,j=me,ve=!1,Te&&Te();case 7:case"end":return Me.stop()}},_e)})),de.apply(this,arguments)}ue()},[b,x]);Object(E.useEffect)(function(){Z.b.destroy();var Te=null;return w.a.isSupported&&z&&p&&(p==null?void 0:p.indexOf(".m3u8"))<0?(Te=w.a.createPlayer({type:"flv",volume:.8,cors:!0,url:p,muted:!1}),N.current&&(Te.attachMediaElement(N.current),Te.load())):N.current.setAttribute("src",p),Ke(),function(){Te&&(Te.unload(),Te.pause(),Te.destroy(),Te=null)}},[N,z,p]);function Ne(){N.current.paused?(ee.current.style.display="none",fe.current.style.display="block"):(ee.current.style.display="block",fe.current.style.display="none")}function Ke(){re.current.style.display="none",pe.current.style.display="none",Q.current.style.display="none",N.current.muted||N.current.volume===0?re.current.style.display="block":N.current.volume>0&&N.current.volume<=.5?pe.current.style.display="block":Q.current.style.display="block"}Object(E.useEffect)(function(){var Te=document.getElementById("play"),we=document.querySelectorAll(".playback-icons use");function xe(){k(),S&&!Ee.current&&(N.current.currentTime=S),Ee.current=!0,Oe.push(N.current.currentTime),M||(M=!0,m&&De())}function ue(){return de.apply(this,arguments)}function de(){return de=Object(U.a)(L.a.mark(function nt(){return L.a.wrap(function(ft){for(;;)switch(ft.prev=ft.next){case 0:Ne(),Oe.push(N.current.currentTime),m&&De(function(){j=null,O=0,M=!1,ve=!1,Pe=!1,Oe=[],C=0,ae=1},!0);case 3:case"end":return ft.stop()}},nt)})),de.apply(this,arguments)}function _e(){oe.current.value=Math.round(N.current.currentTime),he.current.value=Math.round(N.current.currentTime)}function me(){var nt=a(Math.round(N.current.currentTime));ge.current.innerText="".concat(nt.hour>0?nt.hour+":":"").concat(nt.minutes,":").concat(nt.seconds),ge.current.setAttribute("datetime","".concat(nt.hour>0?" "+nt.hour+" ":"").concat(nt.minutes,"m ").concat(nt.seconds,"s"))}function Ie(){var nt=Math.round(N.current.duration);oe.current.setAttribute("max",nt),he.current.setAttribute("max",nt);var at=a(nt);se.current.innerText="".concat(at.hour>0?at.hour+":":"").concat(at.minutes,":").concat(at.seconds),se.current.setAttribute("datetime","".concat(at.hour>0?" "+at.hour+" ":"").concat(at.minutes,"m ").concat(at.seconds,"s"))}function Me(){var nt=Math.round(N.current.duration);oe.current.setAttribute("max",nt),he.current.setAttribute("max",nt);var at=a(nt);se.current.innerText="".concat(at.hour>0?at.hour+":":"").concat(at.minutes,":").concat(at.seconds),se.current.setAttribute("datetime","".concat(at.hour>0?" "+at.hour+" ":"").concat(at.minutes,"m ").concat(at.seconds,"s")),_e(),me();var ft=H.current.getBoundingClientRect(),yt=ft.width,mt=ft.height,pt=ft.x,vt=ft.y;if(pt<0||vt<0||!yt)return;if(!Pe){var ut=N.current.currentTime,dt=ut-O;Math.abs(dt)<10?(C+=Math.abs(dt),O=ut,ve||C-ae*F>=0&&(ae++,Oe.push(O),m&&De())):(O=ut,m&&De())}}function Ve(){Pe=!0}function ot(){N.current.playing&&Oe.push(N.current.currentTime,O),O=N.current.currentTime,Pe=!1}function tt(){V=N.current.duration,V<=20&&(F=V/3),N.current.addEventListener("play",xe)}function Ge(nt){nt.preventDefault(),Object(i.a)()?(N.current.style.width="100%",N.current.style.height="100%"):N.current.style.cssText=""}function Je(){R()}function $e(nt){var at=nt.target.dataset.seek?nt.target.dataset.seek:nt.target.value;N.current.currentTime=at,he.current.value=at,oe.current.value=at}function et(nt){var at=Math.round(nt.offsetX/nt.target.clientWidth*parseInt(nt.target.getAttribute("max"),10));oe.current.setAttribute("data-seek",at);var ft=a(at);ie.current.textContent="".concat(ft.hour>0?ft.hour+":":"").concat(ft.minutes,":").concat(ft.seconds);var yt=N.current.getBoundingClientRect();ie.current.style.left="".concat(nt.pageX-yt.left,"px")}return q.current.addEventListener(Object(i.c)(),Ge),N.current.addEventListener("canplay",tt),N.current.addEventListener("ended",ue),N.current.addEventListener("seeking",Ve),N.current.addEventListener("seeked",ot),N.current.addEventListener("loadedmetadata",Ie),oe.current.addEventListener("mousemove",et),oe.current.addEventListener("input",$e),N.current.addEventListener("timeupdate",Me),N.current.addEventListener("pause",Je),N.current.addEventListener("volumechange",Ke),function(){N.current.removeEventListener("canplay",tt),N.current.removeEventListener("play",xe),N.current.removeEventListener("ended",ue),N.current.removeEventListener("seeking",Ve),N.current.removeEventListener("seeked",ot),oe.current.removeEventListener("mousemove",et),oe.current.removeEventListener("input",$e),N.current.removeEventListener("timeupdate",Me),N.current.removeEventListener("pause",Je),N.current.removeEventListener("loadedmetadata",Ie),N.current.removeEventListener("volumechange",Ke),N.current.playing&&(Oe.push(O,N.current.currentTime),m&&De())}},[N,p]),Object(E.useEffect)(function(){if(N.current.onended=function(){G(N)},N.current.oncontextmenu=function(){return!1},(p==null?void 0:p.indexOf(".m3u8"))>-1){if(N.current.canPlayType("application/vnd.apple.mpegurl"))N.current.src=p;else if(u.a.isSupported()){var Te=new u.a;Te.loadSource(p),Te.attachMedia(N.current)}}},[p]),Object(E.useEffect)(function(){N.current.playbackRate=$},[$]);var ke=function(){N.current.paused||N.current.ended?N.current.play():N.current.pause(),Ne()};function Re(){N.current.muted=!N.current.muted,N.current.muted?(ne.current.setAttribute("data-volume",volume.value),ne.current.value=0):ne.current.value=ne.current.dataset.volume}return A.a.createElement("div",{style:{position:"relative"},ref:q},A.a.createElement("div",{ref:H,className:"".concat(h.a.watermark," animated_alternate animate__animated_10s animate__infinite animate__stepstart ").concat(h.a.animate__loop)},Le?Le.login:" "),A.a.createElement("div",{className:h.a.container},A.a.createElement("div",{className:h.a["video-container"],id:"video-container"},A.a.createElement("div",{className:h.a["playback-animation"],id:"playback-animation"},A.a.createElement("svg",{className:h.a["playback-icons"]},A.a.createElement("use",{className:"hidden",href:"#play-icon"}),A.a.createElement("use",{href:"#pause"}))),A.a.createElement("video",{className:h.a.video,id:"video",preload:"auto",disablePictureInPicture:!0,ref:N,autoPlay:!1}),A.a.createElement("div",{className:"".concat(h.a["video-controls"]," "),id:"video-controls"},A.a.createElement("div",{className:h.a["bottom-controls"]},A.a.createElement("div",{className:h.a["left-controls"]},A.a.createElement("button",{"data-title":"\u64AD\u653E/\u6682\u505C",id:"play",onClick:ke},A.a.createElement("svg",{className:h.a["playback-icons"]},A.a.createElement("use",{ref:fe,href:"#play-icon"}),A.a.createElement("use",{ref:ee,style:{display:"none"},href:"#pause"}))),A.a.createElement("div",{className:h.a.time},A.a.createElement("time",{id:"time-elapsed",ref:ge},"00:00"),A.a.createElement("span",null," / "),A.a.createElement("time",{id:"duration",ref:se},"00:00"))),A.a.createElement("div",{className:h.a["right-controls"]},A.a.createElement(o.CopyToClipboard,{text:p,onCopy:function(){return Z.b.success("\u590D\u5236\u6210\u529F")}},A.a.createElement("button",{"data-title":"\u590D\u5236\u94FE\u63A5"},A.a.createElement("i",{className:"icon-lianjie2 iconfont",style:{fontSize:"12px",color:"white"}}))),A.a.createElement("div",{className:h.a["volume-controls"]},A.a.createElement("button",{"data-title":"\u5F00\u542F/\u5173\u95ED\u58F0\u97F3",className:h.a["volume-button"],id:"volume-button",onClick:Re},A.a.createElement("i",{ref:re,className:"icon-a-bianzu8 iconfont",style:{fontSize:"14px",color:"white"}}),A.a.createElement("i",{ref:pe,className:"icon-shengyinkaibeifen iconfont",style:{fontSize:"14px",color:"white"}}),A.a.createElement("i",{ref:Q,className:"icon-shengyinkai iconfont",style:{fontSize:"14px",color:"white"}})),A.a.createElement("input",{className:h.a.volume,id:"volume",value:"1","data-mute":"0.5",type:"range",max:"1",min:"0",step:"0.01",ref:ne,style:{display:"none"},onClick:Ke})),A.a.createElement("button",{"data-title":"\u5168\u5C4F/\u9000\u51FA\u5168\u5C4F",className:h.a["fullscreen-button"],onClick:function(){Object(i.a)()?Object(i.b)():Object(i.d)(q.current)}},A.a.createElement("i",{className:"icon-fangda1 iconfont",style:{fontSize:"12px",color:"white"}})))),A.a.createElement("div",{className:h.a["video-progress"]},A.a.createElement("progress",{ref:he,value:"0",min:"0"}),A.a.createElement("input",{className:h.a.seek,ref:oe,value:"0",min:"0",type:"range",step:"1"}),A.a.createElement("div",{className:h.a["seek-tooltip"],ref:ie,id:"seek-tooltip"},"00:00"))))),A.a.createElement("svg",{style:{display:"none"}},A.a.createElement("defs",null,A.a.createElement("symbol",{id:"pause",viewBox:"0 0 24 24"},A.a.createElement("path",{d:"M14.016 5.016h3.984v13.969h-3.984v-13.969zM6 18.984v-13.969h3.984v13.969h-3.984z"})),A.a.createElement("symbol",{id:"play-icon",viewBox:"0 0 24 24"},A.a.createElement("path",{d:"M8.016 5.016l10.969 6.984-10.969 6.984v-13.969z"})),A.a.createElement("symbol",{id:"volume-high",viewBox:"0 0 24 24"},A.a.createElement("path",{d:"M14.016 3.234q3.047 0.656 5.016 3.117t1.969 5.648-1.969 5.648-5.016 3.117v-2.063q2.203-0.656 3.586-2.484t1.383-4.219-1.383-4.219-3.586-2.484v-2.063zM16.5 12q0 2.813-2.484 4.031v-8.063q1.031 0.516 1.758 1.688t0.727 2.344zM3 9h3.984l5.016-5.016v16.031l-5.016-5.016h-3.984v-6z"})),A.a.createElement("symbol",{id:"volume-low",viewBox:"0 0 24 24"},A.a.createElement("path",{d:"M5.016 9h3.984l5.016-5.016v16.031l-5.016-5.016h-3.984v-6zM18.516 12q0 2.766-2.531 4.031v-8.063q1.031 0.516 1.781 1.711t0.75 2.32z"})),A.a.createElement("symbol",{id:"volume-mute",viewBox:"0 0 24 24"},A.a.createElement("path",{d:"M12 3.984v4.219l-2.109-2.109zM4.266 3l16.734 16.734-1.266 1.266-2.063-2.063q-1.547 1.313-3.656 1.828v-2.063q1.172-0.328 2.25-1.172l-4.266-4.266v6.75l-5.016-5.016h-3.984v-6h4.734l-4.734-4.734zM18.984 12q0-2.391-1.383-4.219t-3.586-2.484v-2.063q3.047 0.656 5.016 3.117t1.969 5.648q0 2.203-1.031 4.172l-1.5-1.547q0.516-1.266 0.516-2.625zM16.5 12q0 0.422-0.047 0.609l-2.438-2.438v-2.203q1.031 0.516 1.758 1.688t0.727 2.344z"})),A.a.createElement("symbol",{id:"fullscreen",viewBox:"0 0 24 24"},A.a.createElement("path",{d:"M14.016 5.016h4.969v4.969h-1.969v-3h-3v-1.969zM17.016 17.016v-3h1.969v4.969h-4.969v-1.969h3zM5.016 9.984v-4.969h4.969v1.969h-3v3h-1.969zM6.984 14.016v3h3v1.969h-4.969v-4.969h1.969z"})),A.a.createElement("symbol",{id:"fullscreen-exit",viewBox:"0 0 24 24"},A.a.createElement("path",{d:"M15.984 8.016h3v1.969h-4.969v-4.969h1.969v3zM14.016 18.984v-4.969h4.969v1.969h-3v3h-1.969zM8.016 8.016v-3h1.969v4.969h-4.969v-1.969h3zM5.016 15.984v-1.969h4.969v4.969h-1.969v-3h-3z"})),A.a.createElement("symbol",{id:"pip",viewBox:"0 0 24 24"},A.a.createElement("path",{d:"M21 19.031v-14.063h-18v14.063h18zM23.016 18.984q0 0.797-0.609 1.406t-1.406 0.609h-18q-0.797 0-1.406-0.609t-0.609-1.406v-14.016q0-0.797 0.609-1.383t1.406-0.586h18q0.797 0 1.406 0.586t0.609 1.383v14.016zM18.984 11.016v6h-7.969v-6h7.969z"})))))})},kwm0:function(Ze,Qe,ye){Ze.exports={modal:"modal___1jX7c",uploadWrap:"uploadWrap___3-sVK",upload:"upload___2LemY",uploadLink:"uploadLink___j9Fsx",fileProgress:"fileProgress___11p3K",fileCancel:"fileCancel___3Mx9l",videoName:"videoName___2a-ZN",contentItem:"contentItem___1gUuj","tagsList-content":"tagsList-content___3Yj4d"}},lppi:function(Ze,Qe,ye){Ze.exports={pdfContainer:"pdfContainer___ECPbw",loading:"loading___2tzD5"}},mOS8:function(Ze,Qe,ye){Ze.exports=ye.p+"static/403Qrcode.6c17b6f4.png"},nUhQ:function(Ze,Qe,ye){Ze.exports={flex_box_center:"flex_box_center___1OQ1z",flex_space_between:"flex_space_between___22uwF",flex_box_vertical_center:"flex_box_vertical_center___1xWAr",flex_box_center_end:"flex_box_center_end___1QTe3",flex_box_column:"flex_box_column___lWxZG",banner:"banner___1Hzq6",wrap:"wrap___1D5RS",title:"title___1LzGm",contentWrap:"contentWrap___19oxo",button:"button___3chJs",rating:"rating___3ODxx"}},ppsT:function(Ze,Qe,ye){(function(Se){var Z,Z;!function(U){if(!0)window.OSS=U(),Ze.exports=U();else var _}(function(){var U;return function(){function _(L,E,A){function w(f,o){if(!E[f]){if(!L[f]){var t=typeof Z=="function"&&Z;if(!o&&t)return Z(f,!0);if(v)return v(f,!0);var i=new Error("Cannot find module '"+f+"'");throw i.code="MODULE_NOT_FOUND",i}var s=E[f]={exports:{}};L[f][0].call(s.exports,function(h){return w(L[f][1][h]||h)},s,s.exports,_,L,E,A)}return E[f].exports}for(var v=typeof Z=="function"&&Z,u=0;u<A.length;u++)w(A[u]);return w}return _}()({1:[function(_,L,E){"use strict";var A=_("./browser/client");A.Buffer=_("buffer").Buffer,A.co=_("co"),A.urllib=_("../shims/xhr"),A.version=_("./browser/version").version,L.exports=A},{"../shims/xhr":244,"./browser/client":2,"./browser/version":5,buffer:38,co:41}],2:[function(_,L,E){(function(A,w){"use strict";function v(z){return z&&z.__esModule?z:{default:z}}function u(z,N){return z[N]||z[N.toLowerCase()]}function f(z,N){var H=r.parse(z);if(!H.protocol){var q=N?"https://":"http://";H=r.parse(q+z)}if(H.protocol!=="http:"&&H.protocol!=="https:")throw new Error("Endpoint protocol must be http or https.");return H}function o(z,N,H){var q=H?"https://":"http://",ee=N?"-internal.aliyuncs.com":".aliyuncs.com";return z.substr(0,"vpc100-oss-cn-".length)==="vpc100-oss-cn-"&&(ee=".aliyuncs.com"),r.parse(q+z+ee)}function t(){return document&&document.location&&document.location.protocol==="https:"}function i(z,N){if(!(this instanceof i))return new i(z,N);z&&z.inited?this.options=z:this.options=i.initOptions(z),this.options.cancelFlag=!1,this.options.urllib?this.urllib=this.options.urllib:(this.urllib=R,this.agent=this.options.agent||$),this.ctx=N,this.userAgent=this._getUserAgent(),this.options.amendTimeSkewed=0}var s=_("babel-runtime/regenerator"),h=v(s),a=_("babel-runtime/core-js/object/keys"),e=v(a),l=_("debug")("ali-oss"),n=_("./../../shims/crypto/crypto.js"),d=_("path"),c=_("copy-to"),g=_("mime"),p=_("xml2js"),m=_("humanize-ms"),b=_("agentkeepalive"),y=_("merge-descriptors"),r=_("url"),x=_("is-type-of"),S=_("platform"),T=_("utility"),R=_("urllib"),D=_("./version"),k=_("dateformat"),B=_("bowser"),G=_("../common/signUtils"),P=_("../common/utils"),$=new b;L.exports=i,i.initOptions=function(z){if(!z||!z.accessKeyId||!z.accessKeySecret)throw new Error("require accessKeyId, accessKeySecret");var N=t(),H={region:"oss-cn-hangzhou",internal:!1,secure:N,bucket:null,endpoint:null,cname:!1};if((0,e.default)(z).forEach(function(q){z[q]!==void 0&&(H[q]=z[q])}),H.accessKeyId=H.accessKeyId.trim(),H.accessKeySecret=H.accessKeySecret.trim(),H.timeout&&(H.timeout=m(H.timeout)),H.endpoint)H.endpoint=f(H.endpoint,H.secure);else{if(!H.region)throw new Error("require options.endpoint or options.region");H.endpoint=o(H.region,H.internal,H.secure)}return H.inited=!0,H};var X=i.prototype;y(X,_("./object")),y(X,_("./managed_upload")),y(X,_("../common/multipart")),y(X,_("../common/thunkpool.js")),i.Wrapper=_("./wrapper"),X.signature=function(z){return l("authorization stringToSign: %s",z),G.computeSignature(this.options.accessKeySecret,z)},X.authorization=function(z,N,H,q){var ee=G.buildCanonicalString(z.toUpperCase(),N,{headers:q,parameters:H});return G.authorization(this.options.accessKeyId,this.options.accessKeySecret,ee)},X.createRequest=function(z){var N={"x-oss-date":k(+new Date+this.options.amendTimeSkewed,"UTC:ddd, dd mmm yyyy HH:MM:ss 'GMT'"),"x-oss-user-agent":this.userAgent};this.options.stsToken&&(N["x-oss-security-token"]=this.options.stsToken),c(z.headers).to(N),u(N,"Content-Type")||(z.mime===g.default_type&&(z.mime=""),z.mime&&z.mime.indexOf("/")>0?N["Content-Type"]=z.mime:N["Content-Type"]=g.getType(z.mime||d.extname(z.object||""))||"application/octet-stream"),z.content&&(N["Content-Md5"]=n.createHash("md5").update(new w(z.content,"utf8")).digest("base64"),N["Content-Length"]||(N["Content-Length"]=z.content.length));var H=this._getResource(z);N.authorization=this.authorization(z.method,H,z.subres,N);var q=this._getReqUrl(z);l("request %s %s, with headers %j, !!stream: %s",z.method,q,N,!!z.stream);var ee=z.timeout||this.options.timeout;return{url:q,params:{agent:this.agent,method:z.method,content:z.content,stream:z.stream,headers:N,timeout:ee,writeStream:z.writeStream,customResponse:z.customResponse,ctx:z.ctx||this.ctx}}},X.request=h.default.mark(function z(N){var H,q,ee,fe;return h.default.wrap(function(oe){for(;;)switch(oe.prev=oe.next){case 0:return H=this.createRequest(N),q=void 0,ee=void 0,oe.prev=3,oe.next=6,this.urllib.request(H.url,H.params);case 6:q=oe.sent,l("response %s %s, got %s, headers: %j",N.method,H.url,q.status,q.headers),oe.next=13;break;case 10:oe.prev=10,oe.t0=oe.catch(3),ee=oe.t0;case 13:if(fe=void 0,!q||!N.successStatuses||N.successStatuses.indexOf(q.status)!==-1){oe.next=26;break}return oe.next=17,this.requestError(q);case 17:if(fe=oe.sent,fe.code!=="RequestTimeTooSkewed"){oe.next=23;break}return this.options.amendTimeSkewed=+new Date(fe.serverTime)-new Date,oe.next=22,this.request(N);case 22:return oe.abrupt("return",oe.sent);case 23:fe.params=N,oe.next=30;break;case 26:if(!ee){oe.next=30;break}return oe.next=29,this.requestError(ee);case 29:fe=oe.sent;case 30:if(!fe){oe.next=32;break}throw fe;case 32:if(!N.xmlResponse){oe.next=36;break}return oe.next=35,this.parseXML(q.data);case 35:q.data=oe.sent;case 36:return oe.abrupt("return",q);case 37:case"end":return oe.stop()}},z,this,[[3,10]])}),X._getResource=function(z){var N="/";return z.bucket&&(N+=z.bucket+"/"),z.object&&(N+=z.object),N},X._isIP=function(z){return P._isIP(z)},X._escape=function(z){return T.encodeURIComponent(z).replace(/%2F/g,"/")},X._getReqUrl=function(z){var N={};c(this.options.endpoint).to(N);var H=this._isIP(N.hostname),q=this.options.cname;!z.bucket||q||H||(N.host=z.bucket+"."+N.host);var ee="/";z.bucket&&H&&(ee+=z.bucket+"/"),z.object&&(ee+=this._escape(z.object).replace(/\+/g,"%2B")),N.pathname=ee;var fe={};if(z.query&&y(fe,z.query),z.subres){var oe={};x.string(z.subres)?oe[z.subres]="":x.array(z.subres)?z.subres.forEach(function(he){oe[he]=""}):oe=z.subres,y(fe,oe)}return N.query=fe,r.format(N)},X._getUserAgent=function(){var z=A&&A.browser?"js":"nodejs",N="aliyun-sdk-"+z+"/"+D.version,H=S.description;return!H&&A&&(H="Node.js "+A.version.slice(1)+" on "+A.platform+" "+A.arch),this._checkUserAgent(N+" "+H)},X._checkUserAgent=function(z){return z.replace(/\u03b1/,"alpha").replace(/\u03b2/,"beta")},X.checkBrowserAndVersion=function(z,N){return B.name===z&&B.version.split(".")[0]===N},X.parseXML=function(z){return function(N){w.isBuffer(z)&&(z=z.toString()),p.parseString(z,{explicitRoot:!1,explicitArray:!1},N)}},X.requestError=h.default.mark(function z(N){var H,q,ee,fe;return h.default.wrap(function(oe){for(;;)switch(oe.prev=oe.next){case 0:if(H=null,N.data&&N.data.length){oe.next=5;break}N.status===-1||N.status===-2?(H=new Error(N.message),H.name=N.name,H.status=N.status,H.code=N.name):(N.status===404?(H=new Error("Object not exists"),H.name="NoSuchKeyError",H.status=404,H.code="NoSuchKey"):N.status===412?(H=new Error("Pre condition failed"),H.name="PreconditionFailedError",H.status=412,H.code="PreconditionFailed"):(H=new Error("Unknow error, status: "+N.status),H.name="UnknowError",H.status=N.status),H.requestId=N.headers["x-oss-request-id"],H.host=""),oe.next=30;break;case 5:return q=String(N.data),l("request response error data: %s",q),ee=void 0,oe.prev=8,oe.next=11,this.parseXML(q)||{};case 11:ee=oe.sent,oe.next=21;break;case 14:return oe.prev=14,oe.t0=oe.catch(8),l(q),oe.t0.message+=`
|
|
|
raw xml: `+q,oe.t0.status=N.status,oe.t0.requestId=N.headers["x-oss-request-id"],oe.abrupt("return",oe.t0);case 21:fe=ee.Message||"unknow request error, status: "+N.status,ee.Condition&&(fe+=" (condition: "+ee.Condition+")"),H=new Error(fe),H.name=ee.Code?ee.Code+"Error":"UnknowError",H.status=N.status,H.code=ee.Code,H.requestId=ee.RequestId,H.hostId=ee.HostId,H.serverTime=ee.ServerTime;case 30:return l("generate error %j",H),oe.abrupt("return",H);case 32:case"end":return oe.stop()}},z,this,[[8,14]])})}).call(this,_("_process"),_("buffer").Buffer)},{"../common/multipart":8,"../common/signUtils":9,"../common/thunkpool.js":10,"../common/utils":11,"./../../shims/crypto/crypto.js":237,"./managed_upload":3,"./object":4,"./version":5,"./wrapper":6,_process:173,agentkeepalive:12,"babel-runtime/core-js/object/keys":23,"babel-runtime/regenerator":33,bowser:35,buffer:38,"copy-to":43,dateformat:154,debug:155,"humanize-ms":160,"is-type-of":165,"merge-descriptors":168,mime:242,path:170,platform:171,url:203,urllib:244,utility:243,xml2js:213}],3:[function(_,L,E){(function(A){"use strict";function w(c){return c&&c.__esModule?c:{default:c}}function v(c,g){if(!(this instanceof v))return new v(c,g);d.call(this,g),this.file=c,this.reader=new FileReader,this.start=0,this.finish=!1,this.fileBuffer=null}var u=_("babel-runtime/core-js/array/from"),f=w(u),o=_("babel-runtime/regenerator"),t=w(o),i=_("is-type-of"),s=_("util"),h=_("path"),a=_("mime"),e=_("copy-to"),l=E;l.multipartUpload=t.default.mark(function c(g,p,m){var b,y,r,x,S,T,R,D,k;return t.default.wrap(function(B){for(;;)switch(B.prev=B.next){case 0:if(this.resetCancelFlag(),m=m||{},!m.checkpoint||!m.checkpoint.uploadId){B.next=6;break}return B.next=5,this._resumeMultipart(m.checkpoint,m);case 5:return B.abrupt("return",B.sent);case 6:return b=102400,m.mime||(i.file(p)?m.mime=a.getType(h.extname(p.name)):i.blob(p)?m.mime=p.type:m.mime=a.getType(h.extname(p))),m.headers=m.headers||{},this._convertMetaToHeaders(m.meta,m.headers),B.next=12,this._getFileSize(p);case 12:if(!((y=B.sent)<b)){B.next=25;break}return r=this._createStream(p,0,y),m.contentLength=y,B.next=18,this.putStream(g,r,m);case 18:if(x=B.sent,!m||!m.progress){B.next=22;break}return B.next=22,m.progress(1);case 22:return S={res:x.res,bucket:this.options.bucket,name:g,etag:x.res.headers.etag},(m.headers&&m.headers["x-oss-callback"]||m.callback)&&(S.data=x.data),B.abrupt("return",S);case 25:if(!(m.partSize&&m.partSize<b)){B.next=27;break}throw new Error("partSize must not be smaller than "+b);case 27:return B.next=29,this.initMultipartUpload(g,m);case 29:if(T=B.sent,R=T.uploadId,D=this._getPartSize(y,m.partSize),k={file:p,name:g,fileSize:y,partSize:D,uploadId:R,doneParts:[]},!m||!m.progress){B.next=36;break}return B.next=36,m.progress(0,k,T.res);case 36:return B.next=38,this._resumeMultipart(k,m);case 38:return B.abrupt("return",B.sent);case 39:case"end":return B.stop()}},c,this)}),l._resumeMultipart=t.default.mark(function c(g,p){var m,b,y,r,x,S,T,R,D,k,B,G,P,$,X,z,N,H,q,ee,fe;return t.default.wrap(function(oe){for(;;)switch(oe.prev=oe.next){case 0:if(!this.isCancel()){oe.next=2;break}throw this._makeCancelEvent();case 2:if(m=g.file,b=g.fileSize,y=g.partSize,r=g.uploadId,x=g.doneParts,S=g.name,T=[],x.length>0&&e(x).to(T),R=this._divideParts(b,y),D=R.length,k=!1,B=t.default.mark(function he(se,ge){var ie,re,Q;return t.default.wrap(function(pe){for(;;)switch(pe.prev=pe.next){case 0:if(se.isCancel()){pe.next=21;break}return pe.prev=1,ie=R[ge-1],re={stream:se._createStream(m,ie.start,ie.end),size:ie.end-ie.start},pe.next=6,se._uploadPart(S,r,ge,re);case 6:if(Q=pe.sent,se.isCancel()||k){pe.next=13;break}if(g.doneParts.push({number:ge,etag:Q.res.headers.etag}),T.push({number:ge,etag:Q.res.headers.etag}),!p||!p.progress){pe.next=13;break}return pe.next=13,p.progress(x.length/D,g,Q.res);case 13:pe.next=21;break;case 15:if(pe.prev=15,pe.t0=pe.catch(1),se.isCancel()){pe.next=21;break}throw se.cancel(),pe.t0.partNum=ge,pe.t0;case 21:case"end":return pe.stop()}},he,this,[[1,15]])}),G=(0,f.default)(new Array(D),function(he,se){return se+1}),P=T.map(function(he){return he.number}),$=G.filter(function(he){return P.indexOf(he)<0}),X=5,z=p.parallel||X,!this.checkBrowserAndVersion("Internet Explorer","10")&&z!==1){oe.next=26;break}N=0;case 16:if(!(N<$.length)){oe.next=24;break}if(!this.isCancel()){oe.next=19;break}throw this._makeCancelEvent();case 19:return oe.next=21,B(this,$[N]);case 21:N++,oe.next=16;break;case 24:oe.next=40;break;case 26:for(H=[],q=0;q<$.length;q++)H.push(B(this,$[q]));return oe.next=30,this._thunkPool(H,z);case 30:if(ee=oe.sent,k=!0,!(ee&&ee.length>0)){oe.next=37;break}throw this.resetCancelFlag(),fe=ee[0],fe.message="Failed to upload some parts with error: "+fe.toString()+" part_num: "+fe.partNum,fe;case 37:if(!this.isCancel()){oe.next=40;break}throw H=null,this._makeCancelEvent();case 40:return oe.next=42,this.completeMultipartUpload(S,r,T,p);case 42:return oe.abrupt("return",oe.sent);case 43:case"end":return oe.stop()}},c,this)}),i.file=function(c){return typeof File!="undefined"&&c instanceof File},i.blob=function(c){return typeof Blob!="undefined"&&c instanceof Blob},l._getFileSize=t.default.mark(function c(g){var p;return t.default.wrap(function(m){for(;;)switch(m.prev=m.next){case 0:if(!i.buffer(g)){m.next=4;break}return m.abrupt("return",g.length);case 4:if(!i.blob(g)&&!i.file(g)){m.next=6;break}return m.abrupt("return",g.size);case 6:if(!i.string(g)){m.next=11;break}return m.next=9,this._statFile(g);case 9:return p=m.sent,m.abrupt("return",p.size);case 11:throw new Error("_getFileSize requires Buffer/File/String.");case 12:case"end":return m.stop()}},c,this)});var n=_("stream"),d=n.Readable;s.inherits(v,d),v.prototype.readFileAndPush=function(c){if(this.fileBuffer)for(var g=!0;g&&this.fileBuffer&&this.start<this.fileBuffer.length;){var p=this.start,m=p+c;m=m>this.fileBuffer.length?this.fileBuffer.length:m,this.start=m,g=this.push(this.fileBuffer.slice(p,m))}},v.prototype._read=function(c){if(this.file&&this.start>=this.file.size||this.fileBuffer&&this.start>=this.fileBuffer.length||this.finish||this.start===0&&!this.file)return this.finish||(this.fileBuffer=null,this.finish=!0),void this.push(null);c=c||16384;var g=this;this.reader.onload=function(p){g.fileBuffer=new A(new Uint8Array(p.target.result)),g.file=null,g.readFileAndPush(c)},this.start===0?this.reader.readAsArrayBuffer(this.file):this.readFileAndPush(c)},l._createStream=function(c,g,p){if(i.blob(c)||i.file(c))return new v(c.slice(g,p));throw new Error("_createStream requires File/String.")},l._getPartSize=function(c,g){return g?Math.max(Math.ceil(c/1e4),g):1048576},l._divideParts=function(c,g){for(var p=Math.ceil(c/g),m=[],b=0;b<p;b++){var y=g*b,r=Math.min(y+g,c);m.push({start:y,end:r})}return m},l._makeCancelEvent=function(){return{status:0,name:"cancel"}}}).call(this,_("buffer").Buffer)},{"babel-runtime/core-js/array/from":16,"babel-runtime/regenerator":33,buffer:38,"copy-to":43,"is-type-of":165,mime:242,path:170,stream:195,util:207}],4:[function(_,L,E){"use strict";function A(g){return g&&g.__esModule?g:{default:g}}var w=_("babel-runtime/core-js/object/keys"),v=A(w),u=_("babel-runtime/regenerator"),f=A(u),o=_("debug")("ali-oss:object"),t=_("utility"),i=_("fs"),s=_("is-type-of"),h=_("url"),a=_("copy-to"),e=_("path"),l=_("mime"),n=_("../common/callback"),d=_("../common/signUtils"),c=E;c.append=f.default.mark(function g(p,m,b){var y;return f.default.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return b=b||{},b.position===void 0&&(b.position="0"),b.subres={append:"",position:b.position},b.method="POST",r.next=6,this.put(p,m,b);case 6:return y=r.sent,y.nextAppendPosition=y.res.headers["x-oss-next-append-position"],r.abrupt("return",y);case 9:case"end":return r.stop()}},g,this)}),c.put=f.default.mark(function g(p,m,b){var y,r,x,S,T,R;return f.default.wrap(function(D){for(;;)switch(D.prev=D.next){case 0:if(y=void 0,b=b||{},!s.buffer(m)){D.next=6;break}y=m,D.next=18;break;case 6:if(!s.blob(m)&&!s.file(m)){D.next=17;break}return b.mime||(s.file(m)?b.mime=l.getType(e.extname(m.name)):b.mime=m.type),r=this._createStream(m,0,m.size),D.next=11,this._getFileSize(m);case 11:return b.contentLength=D.sent,D.next=14,this.putStream(p,r,b);case 14:return D.abrupt("return",D.sent);case 17:throw new TypeError("Must provide Buffer/Blob for put.");case 18:return b.headers=b.headers||{},this._convertMetaToHeaders(b.meta,b.headers),x=b.method||"PUT",S=this._objectRequestParams(x,p,b),n.encodeCallback(S,b),S.mime=b.mime,S.content=y,S.successStatuses=[200],D.next=28,this.request(S);case 28:return T=D.sent,R={name:p,url:this._objectUrl(p),res:T.res},S.headers&&S.headers["x-oss-callback"]&&(R.data=JSON.parse(T.data.toString())),D.abrupt("return",R);case 32:case"end":return D.stop()}},g,this)}),c.putStream=f.default.mark(function g(p,m,b){var y,r,x,S;return f.default.wrap(function(T){for(;;)switch(T.prev=T.next){case 0:return b=b||{},b.headers=b.headers||{},b.contentLength?b.headers["Content-Length"]=b.contentLength:b.headers["Transfer-Encoding"]="chunked",this._convertMetaToHeaders(b.meta,b.headers),y=b.method||"PUT",r=this._objectRequestParams(y,p,b),n.encodeCallback(r,b),r.mime=b.mime,r.stream=m,r.successStatuses=[200],T.next=12,this.request(r);case 12:return x=T.sent,S={name:p,url:this._objectUrl(p),res:x.res},r.headers&&r.headers["x-oss-callback"]&&(S.data=JSON.parse(x.data.toString())),T.abrupt("return",S);case 16:case"end":return T.stop()}},g,this)}),c.head=f.default.mark(function g(p,m){var b,y,r;return f.default.wrap(function(x){for(;;)switch(x.prev=x.next){case 0:return b=this._objectRequestParams("HEAD",p,m),b.successStatuses=[200,304],x.next=4,this.request(b);case 4:return y=x.sent,r={meta:null,res:y.res,status:y.status},y.status===200&&(0,v.default)(y.headers).forEach(function(S){S.indexOf("x-oss-meta-")===0&&(r.meta||(r.meta={}),r.meta[S.substring(11)]=y.headers[S])}),x.abrupt("return",r);case 8:case"end":return x.stop()}},g,this)}),c.get=f.default.mark(function g(p,m,b){var y,r,x,S;return f.default.wrap(function(T){for(;;)switch(T.prev=T.next){case 0:return y=null,r=!1,s.writableStream(m)?y=m:s.string(m)?(y=i.createWriteStream(m),r=!0):b=m,b=b||{},b.process&&(b.subres=b.subres||{},b.subres["x-oss-process"]=b.process),x=void 0,T.prev=6,S=this._objectRequestParams("GET",p,b),S.writeStream=y,S.successStatuses=[200,206,304],T.next=12,this.request(S);case 12:x=T.sent,r&&y.destroy(),T.next=24;break;case 16:if(T.prev=16,T.t0=T.catch(6),!r){T.next=23;break}return y.destroy(),o("get error: %s, delete the exists file %s",T.t0,m),T.next=23,this._deleteFileSafe(m);case 23:throw T.t0;case 24:return T.abrupt("return",{res:x.res,content:x.data});case 25:case"end":return T.stop()}},g,this,[[6,16]])}),c.getStream=f.default.mark(function g(p,m){var b,y;return f.default.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return m=m||{},b=this._objectRequestParams("GET",p,m),b.customResponse=!0,b.successStatuses=[200,206,304],r.next=6,this.request(b);case 6:return y=r.sent,r.abrupt("return",{stream:y.res,res:{status:y.status,headers:y.headers}});case 8:case"end":return r.stop()}},g,this)}),c.delete=f.default.mark(function g(p,m){var b,y;return f.default.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return b=this._objectRequestParams("DELETE",p,m),b.successStatuses=[204],r.next=4,this.request(b);case 4:return y=r.sent,r.abrupt("return",{res:y.res});case 6:case"end":return r.stop()}},g,this)}),c.deleteMulti=f.default.mark(function g(p,m){var b,y,r,x,S,T;return f.default.wrap(function(R){for(;;)switch(R.prev=R.next){case 0:for(m=m||{},b=`<?xml version="1.0" encoding="UTF-8"?>
|
|
|
<Delete>
|
|
|
`,m.quiet?b+=` <Quiet>true</Quiet>
|
|
|
`:b+=` <Quiet>false</Quiet>
|
|
|
`,y=0;y<p.length;y++)b+=" <Object><Key>"+t.escape(this._objectName(p[y]))+`</Key></Object>
|
|
|
`;return b+="</Delete>",o("delete multi objects: %s",b),m.subres="delete",r=this._objectRequestParams("POST","",m),r.mime="xml",r.content=b,r.xmlResponse=!0,r.successStatuses=[200],R.next=14,this.request(r);case 14:return x=R.sent,S=x.data,T=S&&S.Deleted||null,T&&(Array.isArray(T)||(T=[T]),T=T.map(function(D){return D.Key})),R.abrupt("return",{res:x.res,deleted:T});case 19:case"end":return R.stop()}},g,this)}),c.copy=f.default.mark(function g(p,m,b){var y,r,x;return f.default.wrap(function(S){for(;;)switch(S.prev=S.next){case 0:return b=b||{},b.headers=b.headers||{},(0,v.default)(b.headers).forEach(function(T){b.headers["x-oss-copy-source-"+T.toLowerCase()]=b.headers[T]}),b.meta&&(b.headers["x-oss-metadata-directive"]="REPLACE"),this._convertMetaToHeaders(b.meta,b.headers),m=m[0]!=="/"?"/"+this.options.bucket+"/"+encodeURIComponent(m):"/"+encodeURIComponent(m.slice(1)),b.headers["x-oss-copy-source"]=m,y=this._objectRequestParams("PUT",p,b),y.xmlResponse=!0,y.successStatuses=[200,304],S.next=12,this.request(y);case 12:return r=S.sent,x=r.data,x&&(x={etag:x.ETag,lastModified:x.LastModified}),S.abrupt("return",{data:x,res:r.res});case 16:case"end":return S.stop()}},g,this)}),c.putMeta=f.default.mark(function g(p,m,b){return f.default.wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.next=2,this.copy(p,p,{meta:m||{},timeout:b&&b.timeout,ctx:b&&b.ctx});case 2:return y.abrupt("return",y.sent);case 3:case"end":return y.stop()}},g,this)}),c.list=f.default.mark(function g(p,m){var b,y,r,x,S;return f.default.wrap(function(T){for(;;)switch(T.prev=T.next){case 0:return b=this._objectRequestParams("GET","",m),b.query=p,b.xmlResponse=!0,b.successStatuses=[200],T.next=6,this.request(b);case 6:return y=T.sent,r=y.data.Contents,x=this,r&&(Array.isArray(r)||(r=[r]),r=r.map(function(R){return{name:R.Key,url:x._objectUrl(R.Key),lastModified:R.LastModified,etag:R.ETag,type:R.Type,size:Number(R.Size),storageClass:R.StorageClass,owner:{id:R.Owner.ID,displayName:R.Owner.DisplayName}}})),S=y.data.CommonPrefixes||null,S&&(Array.isArray(S)||(S=[S]),S=S.map(function(R){return R.Prefix})),T.abrupt("return",{res:y.res,objects:r,prefixes:S,nextMarker:y.data.NextMarker||null,isTruncated:y.data.IsTruncated==="true"});case 13:case"end":return T.stop()}},g,this)}),c.putACL=f.default.mark(function g(p,m,b){var y,r;return f.default.wrap(function(x){for(;;)switch(x.prev=x.next){case 0:return b=b||{},b.subres="acl",b.headers=b.headers||{},b.headers["x-oss-object-acl"]=m,p=this._objectName(p),y=this._objectRequestParams("PUT",p,b),y.successStatuses=[200],x.next=9,this.request(y);case 9:return r=x.sent,x.abrupt("return",{res:r.res});case 11:case"end":return x.stop()}},g,this)}),c.getACL=f.default.mark(function g(p,m){var b,y;return f.default.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return m=m||{},m.subres="acl",p=this._objectName(p),b=this._objectRequestParams("GET",p,m),b.successStatuses=[200],b.xmlResponse=!0,r.next=8,this.request(b);case 8:return y=r.sent,r.abrupt("return",{acl:y.data.AccessControlList.Grant,owner:{id:y.data.Owner.ID,displayName:y.data.Owner.DisplayName},res:y.res});case 10:case"end":return r.stop()}},g,this)}),c.restore=f.default.mark(function g(p,m){var b,y;return f.default.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return m=m||{},m.subres="restore",b=this._objectRequestParams("POST",p,m),b.successStatuses=[202],r.next=6,this.request(b);case 6:return y=r.sent,r.abrupt("return",{res:y.res});case 8:case"end":return r.stop()}},g,this)}),c.signatureUrl=function(g,p){p=p||{},g=this._objectName(g),p.method=p.method||"GET";var m=t.timestamp()+(p.expires||1800),b={bucket:this.options.bucket,object:g},y=this._getResource(b);this.options.stsToken&&(p["security-token"]=this.options.stsToken);var r=d._signatureForURL(this.options.accessKeySecret,p,y,m),x=h.parse(this._getReqUrl(b));return x.query={OSSAccessKeyId:this.options.accessKeyId,Expires:m,Signature:r.Signature},a(r.subResource).to(x.query),x.format()},c.getObjectUrl=function(g,p){return p?p[p.length-1]!=="/"&&(p+="/"):p=this.options.endpoint.format(),p+this._escape(this._objectName(g))},c._objectUrl=function(g){return this._getReqUrl({bucket:this.options.bucket,object:g})},c.generateObjectUrl=function(g,p){if(p)p[p.length-1]!=="/"&&(p+="/");else{p=this.options.endpoint.format();var m=h.parse(p),b=this.options.bucket;m.hostname=b+"."+m.hostname,m.host=b+"."+m.host,p=m.format()}return p+this._escape(this._objectName(g))},c._objectRequestParams=function(g,p,m){if(!this.options.bucket)throw new Error("Please create a bucket first");m=m||{},p=this._objectName(p);var b={object:p,bucket:this.options.bucket,method:g,subres:m&&m.subres,timeout:m&&m.timeout,ctx:m&&m.ctx};return m.headers&&(b.headers={},a(m.headers).to(b.headers)),b},c._objectName=function(g){return g.replace(/^\/+/,"")},c._statFile=function(g){return function(p){i.stat(g,p)}},c._convertMetaToHeaders=function(g,p){g&&(0,v.default)(g).forEach(function(m){p["x-oss-meta-"+m]=g[m]})},c._deleteFileSafe=function(g){return function(p){i.exists(g,function(m){m?i.unlink(g,function(b){b&&o("unlink %j error: %s",g,b),p()}):p()})}}},{"../common/callback":7,"../common/signUtils":9,"babel-runtime/core-js/object/keys":23,"babel-runtime/regenerator":33,"copy-to":43,debug:155,fs:36,"is-type-of":165,mime:242,path:170,url:203,utility:243}],5:[function(_,L,E){"use strict";E.version="5.3.1"},{}],6:[function(_,L,E){"use strict";function A(e){return e&&e.__esModule?e:{default:e}}function w(e){return e&&typeof e.next=="function"&&typeof e.throw=="function"}function v(e){if(!e)return!1;var l=e.constructor;return!!l&&(l.name==="GeneratorFunction"||l.displayName==="GeneratorFunction"||w(l.prototype)||w(e.prototype))}function u(e,l){var n=new e(l),d=(0,s.default)(n),c=(0,s.default)((0,t.default)(n));d.concat(c).forEach(function(g){v(n[g])?this[g]=h.wrap(n[g]).bind(n):this[g]=n[g]},this)}function f(e){if(!(this instanceof f))return new f(e);u.call(this,a,e)}var o=_("babel-runtime/core-js/object/get-prototype-of"),t=A(o),i=_("babel-runtime/core-js/object/keys"),s=A(i),h=_("co"),a=_("./client");L.exports=f,f.STS=function e(l){if(!(this instanceof e))return new e(l);u.call(this,a.STS,l)}},{"./client":2,"babel-runtime/core-js/object/get-prototype-of":22,"babel-runtime/core-js/object/keys":23,co:41}],7:[function(_,L,E){(function(A){"use strict";function w(t){return t&&t.__esModule?t:{default:t}}var v=_("babel-runtime/core-js/object/keys"),u=w(v),f=_("babel-runtime/core-js/json/stringify"),o=w(f);E.encodeCallback=function(t,i){if(t.headers=t.headers||{},!Object.prototype.hasOwnProperty.call(t.headers,"x-oss-callback")&&i.callback){var s={callbackUrl:encodeURI(i.callback.url),callbackBody:i.callback.body};i.callback.host&&(s.callbackHost=i.callback.host),i.callback.contentType&&(s.callbackBodyType=i.callback.contentType);var h=new A((0,o.default)(s)).toString("base64");if(t.headers["x-oss-callback"]=h,i.callback.customValue){var a={};(0,u.default)(i.callback.customValue).forEach(function(e){a["x:"+e]=i.callback.customValue[e]}),t.headers["x-oss-callback-var"]=new A((0,o.default)(a)).toString("base64")}}}}).call(this,_("buffer").Buffer)},{"babel-runtime/core-js/json/stringify":17,"babel-runtime/core-js/object/keys":23,buffer:38}],8:[function(_,L,E){"use strict";var A=_("babel-runtime/regenerator"),w=function(o){return o&&o.__esModule?o:{default:o}}(A),v=_("copy-to"),u=_("./callback"),f=E;f.listUploads=w.default.mark(function o(t,i){var s,h,a,e;return w.default.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return i=i||{},s={},v(i).to(s),s.subres="uploads",h=this._objectRequestParams("GET","",s),h.query=t,h.xmlResponse=!0,h.successStatuses=[200],l.next=10,this.request(h);case 10:return a=l.sent,e=a.data.Upload||[],Array.isArray(e)||(e=[e]),e=e.map(function(n){return{name:n.Key,uploadId:n.UploadId,initiated:n.Initiated}}),l.abrupt("return",{res:a.res,uploads:e,bucket:a.data.Bucket,nextKeyMarker:a.data.NextKeyMarker,nextUploadIdMarker:a.data.NextUploadIdMarker,isTruncated:a.data.IsTruncated==="true"});case 15:case"end":return l.stop()}},o,this)}),f.listParts=w.default.mark(function o(t,i,s,h){var a,e,l;return w.default.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return h=h||{},a={},v(h).to(a),a.subres={uploadId:i},e=this._objectRequestParams("GET",t,a),e.query=s,e.xmlResponse=!0,e.successStatuses=[200],n.next=10,this.request(e);case 10:return l=n.sent,n.abrupt("return",{res:l.res,uploadId:l.data.UploadId,bucket:l.data.Bucket,name:l.data.Key,partNumberMarker:l.data.PartNumberMarker,nextPartNumberMarker:l.data.NextPartNumberMarker,maxParts:l.data.MaxParts,isTruncated:l.data.IsTruncated,parts:l.data.Part||[]});case 12:case"end":return n.stop()}},o,this)}),f.abortMultipartUpload=w.default.mark(function o(t,i,s){var h,a,e;return w.default.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return this.cancel(),s=s||{},h={},v(s).to(h),h.subres={uploadId:i},a=this._objectRequestParams("DELETE",t,h),a.successStatuses=[204],l.next=9,this.request(a);case 9:return e=l.sent,l.abrupt("return",{res:e.res});case 11:case"end":return l.stop()}},o,this)}),f.initMultipartUpload=w.default.mark(function o(t,i){var s,h,a;return w.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=i||{},s={},v(i).to(s),s.headers=s.headers||{},this._convertMetaToHeaders(i.meta,s.headers),s.subres="uploads",h=this._objectRequestParams("POST",t,s),h.mime=i.mime,h.xmlResponse=!0,h.successStatuses=[200],e.next=12,this.request(h);case 12:return a=e.sent,e.abrupt("return",{res:a.res,bucket:a.data.Bucket,name:a.data.Key,uploadId:a.data.UploadId});case 14:case"end":return e.stop()}},o,this)}),f.uploadPart=w.default.mark(function o(t,i,s,h,a,e,l){var n;return w.default.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return n={stream:this._createStream(h,a,e),size:e-a},d.next=3,this._uploadPart(t,i,s,n,l);case 3:return d.abrupt("return",d.sent);case 4:case"end":return d.stop()}},o,this)}),f.completeMultipartUpload=w.default.mark(function o(t,i,s,h){var a,e,l,n,d,c,g,p;return w.default.wrap(function(m){for(;;)switch(m.prev=m.next){case 0:for(a=s.concat().sort(function(b,y){return b.number-y.number}).filter(function(b,y,r){return!y||b.number!==r[y-1].number}),e=`<?xml version="1.0" encoding="UTF-8"?>
|
|
|
<CompleteMultipartUpload>
|
|
|
`,l=0;l<a.length;l++)n=a[l],e+=`<Part>
|
|
|
`,e+="<PartNumber>"+n.number+`</PartNumber>
|
|
|
`,e+="<ETag>"+n.etag+`</ETag>
|
|
|
`,e+=`</Part>
|
|
|
`;return e+="</CompleteMultipartUpload>",h=h||{},d={},v(h).to(d),d.subres={uploadId:i},c=this._objectRequestParams("POST",t,d),u.encodeCallback(c,d),c.mime="xml",c.content=e,c.headers&&c.headers["x-oss-callback"]||(c.xmlResponse=!0),c.successStatuses=[200],m.next=16,this.request(c);case 16:return g=m.sent,p={res:g.res,bucket:c.bucket,name:t,etag:g.res.headers.etag},c.headers&&c.headers["x-oss-callback"]&&(p.data=JSON.parse(g.data.toString())),m.abrupt("return",p);case 20:case"end":return m.stop()}},o,this)}),f._uploadPart=w.default.mark(function o(t,i,s,h,a){var e,l,n;return w.default.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return a=a||{},e={},v(a).to(e),e.headers={"Content-Length":h.size},e.subres={partNumber:s,uploadId:i},l=this._objectRequestParams("PUT",t,e),l.mime=e.mime,l.stream=h.stream,l.successStatuses=[200],d.next=11,this.request(l);case 11:return n=d.sent,h.stream=null,l.stream=null,d.abrupt("return",{name:t,etag:n.res.headers.etag,res:n.res});case 15:case"end":return d.stop()}},o,this)})},{"./callback":7,"babel-runtime/regenerator":33,"copy-to":43}],9:[function(_,L,E){(function(A){"use strict";function w(s){return s&&s.__esModule?s:{default:s}}var v=_("babel-runtime/core-js/json/stringify"),u=w(v),f=_("babel-runtime/core-js/object/keys"),o=w(f),t=_("./../../shims/crypto/crypto.js"),i=_("is-type-of");E.buildCanonicalizedResource=function(s,h){var a=""+s,e="?";if(i.string(h)&&h.trim()!=="")a+=e+h;else if(i.array(h))h.sort(),a+=e+h.join("&");else if(h){var l=function(d,c){return d[0]>c[0]?1:d[0]<c[0]?-1:0},n=function(d){a+=e+d,h[d]&&(a+="="+h[d]),e="&"};(0,o.default)(h).sort(l).forEach(n)}return a},E.buildCanonicalString=function(s,h,a,e){a=a||{};var l=a.headers||{},n=[],d={},c=[s.toUpperCase(),l["Content-Md5"]||"",l["Content-Type"]||l["Content-Type".toLowerCase()],e||l["x-oss-date"]];return(0,o.default)(l).forEach(function(g){var p=g.toLowerCase();p.indexOf("x-oss-")===0&&(d[p]=String(l[g]).trim())}),(0,o.default)(d).sort().forEach(function(g){n.push(g+":"+d[g])}),c=c.concat(n),c.push(this.buildCanonicalizedResource(h,a.parameters)),c.join(`
|
|
|
`)},E.computeSignature=function(s,h){return t.createHmac("sha1",s).update(new A(h,"utf8")).digest("base64")},E.authorization=function(s,h,a){return"OSS "+s+":"+this.computeSignature(h,a)},E._signatureForURL=function(s,h,a,e){var l={},n={};if(h.process&&(n["x-oss-process"]=h.process),h.response&&(0,o.default)(h.response).forEach(function(p){var m="response-"+p.toLowerCase();n[m]=h.response[p]}),(0,o.default)(h).forEach(function(p){var m=p.toLowerCase(),b=h[p];m.indexOf("x-oss-")===0?l[m]=b:m.indexOf("content-md5")===0||m.indexOf("content-type")===0?l[p]=b:m!=="expires"&&m!=="response"&&m!=="process"&&m!=="method"&&(n[m]=b)}),Object.prototype.hasOwnProperty.call(h,"security-token")&&(n["security-token"]=h["security-token"]),Object.prototype.hasOwnProperty.call(h,"callback")){var d={callbackUrl:encodeURI(h.callback.url),callbackBody:h.callback.body};if(h.callback.host&&(d.callbackHost=h.callback.host),h.callback.contentType&&(d.callbackBodyType=h.callback.contentType),n.callback=new A((0,u.default)(d)).toString("base64"),h.callback.customValue){var c={};(0,o.default)(h.callback.customValue).forEach(function(p){c["x:"+p]=h.callback.customValue[p]}),n["callback-var"]=new A((0,u.default)(c)).toString("base64")}}var g=this.buildCanonicalString(h.method,a,{headers:l,parameters:n},e.toString());return{Signature:this.computeSignature(s,g),subResource:n}}}).call(this,_("buffer").Buffer)},{"./../../shims/crypto/crypto.js":237,"babel-runtime/core-js/json/stringify":17,"babel-runtime/core-js/object/keys":23,buffer:38,"is-type-of":165}],10:[function(_,L,E){"use strict";var A=_("babel-runtime/regenerator"),w=function(t){return t&&t.__esModule?t:{default:t}}(A),v=_("co"),u=_("co-priority-queue"),f=_("any-promise"),o=E;o._thunkPool=function(t,i){function s(n,d){++e===n.length&&d(l)}function h(n,d){function c(){var r;return w.default.wrap(function(x){for(;;)switch(x.prev=x.next){case 0:r=void 0;case 1:if(a.isCancel()){x.next=9;break}return x.next=4,m.next();case 4:return r=x.sent,x.next=7,r();case 7:x.next=1;break;case 9:b+=1,b===n&&(m.fns=[],m.buffer=[],d(l));case 11:case"end":return x.stop()}},p,this)}function g(r){console.error(r.stack)}for(var p=w.default.mark(c),m=new u,b=0,y=0;y<n;y++)v(c).catch(g);return function(r,x){return function(S){m.push(w.default.mark(function T(){return w.default.wrap(function(R){for(;;)switch(R.prev=R.next){case 0:return R.prev=0,R.t0=S,R.next=4,r;case 4:R.t1=R.sent,(0,R.t0)(null,R.t1),R.next=11;break;case 8:R.prev=8,R.t2=R.catch(0),S(R.t2);case 11:case"end":return R.stop()}},T,this,[[0,8]])}),x)}}}var a=this,e=0,l=[];return new f(function(n){function d(b){return w.default.wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.next=2,p(t[b]);case 2:s(t,n);case 3:case"end":return y.stop()}},g,this)}function c(b){l.push(b),s(t,n)}for(var g=w.default.mark(d),p=new h(i,n),m=0;m<t.length;m++)v(d(m)).catch(c)})},o.cancel=function(){this.options.cancelFlag=!0},o.isCancel=function(){return this.options.cancelFlag},o.resetCancelFlag=function(){this.options.cancelFlag=!1}},{"any-promise":13,"babel-runtime/regenerator":33,co:41,"co-priority-queue":40}],11:[function(_,L,E){"use strict";E._isIP=function(A){var w=/^(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}$/,v=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/;return w.test(A)||v.test(A)}},{}],12:[function(_,L,E){function A(){}L.exports=A,L.exports.HttpsAgent=A},{}],13:[function(_,L,E){L.exports=_("./register")().Promise},{"./register":15}],14:[function(_,L,E){"use strict";var A=null;L.exports=function(w,v){return function(u,f){u=u||null,f=f||{};var o=f.global!==!1;if(A===null&&o&&(A=w["@@any-promise/REGISTRATION"]||null),A!==null&&u!==null&&A.implementation!==u)throw new Error('any-promise already defined as "'+A.implementation+'". You can only register an implementation before the first call to require("any-promise") and an implementation cannot be changed');return A===null&&(A=u!==null&&f.Promise!==void 0?{Promise:f.Promise,implementation:u}:v(u),o&&(w["@@any-promise/REGISTRATION"]=A)),A}}},{}],15:[function(_,L,E){"use strict";function A(){if(window.Promise===void 0)throw new Error("any-promise browser requires a polyfill or explicit registration e.g: require('any-promise/register/bluebird')");return{Promise:window.Promise,implementation:"window.Promise"}}L.exports=_("./loader")(window,A)},{"./loader":14}],16:[function(_,L,E){L.exports={default:_("core-js/library/fn/array/from"),__esModule:!0}},{"core-js/library/fn/array/from":44}],17:[function(_,L,E){L.exports={default:_("core-js/library/fn/json/stringify"),__esModule:!0}},{"core-js/library/fn/json/stringify":45}],18:[function(_,L,E){L.exports={default:_("core-js/library/fn/object/assign"),__esModule:!0}},{"core-js/library/fn/object/assign":46}],19:[function(_,L,E){L.exports={default:_("core-js/library/fn/object/create"),__esModule:!0}},{"core-js/library/fn/object/create":47}],20:[function(_,L,E){L.exports={default:_("core-js/library/fn/object/define-property"),__esModule:!0}},{"core-js/library/fn/object/define-property":48}],21:[function(_,L,E){L.exports={default:_("core-js/library/fn/object/get-own-property-names"),__esModule:!0}},{"core-js/library/fn/object/get-own-property-names":49}],22:[function(_,L,E){L.exports={default:_("core-js/library/fn/object/get-prototype-of"),__esModule:!0}},{"core-js/library/fn/object/get-prototype-of":50}],23:[function(_,L,E){L.exports={default:_("core-js/library/fn/object/keys"),__esModule:!0}},{"core-js/library/fn/object/keys":51}],24:[function(_,L,E){L.exports={default:_("core-js/library/fn/promise"),__esModule:!0}},{"core-js/library/fn/promise":52}],25:[function(_,L,E){L.exports={default:_("core-js/library/fn/set-immediate"),__esModule:!0}},{"core-js/library/fn/set-immediate":53}],26:[function(_,L,E){L.exports={default:_("core-js/library/fn/string/from-code-point"),__esModule:!0}},{"core-js/library/fn/string/from-code-point":54}],27:[function(_,L,E){L.exports={default:_("core-js/library/fn/symbol"),__esModule:!0}},{"core-js/library/fn/symbol":56}],28:[function(_,L,E){L.exports={default:_("core-js/library/fn/symbol/has-instance"),__esModule:!0}},{"core-js/library/fn/symbol/has-instance":55}],29:[function(_,L,E){L.exports={default:_("core-js/library/fn/symbol/iterator"),__esModule:!0}},{"core-js/library/fn/symbol/iterator":57}],30:[function(_,L,E){"use strict";E.__esModule=!0,E.default=function(A,w){if(!(A instanceof w))throw new TypeError("Cannot call a class as a function")}},{}],31:[function(_,L,E){"use strict";E.__esModule=!0;var A=_("../core-js/object/define-property"),w=function(v){return v&&v.__esModule?v:{default:v}}(A);E.default=function(){function v(u,f){for(var o=0;o<f.length;o++){var t=f[o];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),(0,w.default)(u,t.key,t)}}return function(u,f,o){return f&&v(u.prototype,f),o&&v(u,o),u}}()},{"../core-js/object/define-property":20}],32:[function(_,L,E){"use strict";function A(t){return t&&t.__esModule?t:{default:t}}E.__esModule=!0;var w=_("../core-js/symbol/iterator"),v=A(w),u=_("../core-js/symbol"),f=A(u),o=typeof f.default=="function"&&typeof v.default=="symbol"?function(t){return typeof t}:function(t){return t&&typeof f.default=="function"&&t.constructor===f.default&&t!==f.default.prototype?"symbol":typeof t};E.default=typeof f.default=="function"&&o(v.default)==="symbol"?function(t){return t===void 0?"undefined":o(t)}:function(t){return t&&typeof f.default=="function"&&t.constructor===f.default&&t!==f.default.prototype?"symbol":t===void 0?"undefined":o(t)}},{"../core-js/symbol":27,"../core-js/symbol/iterator":29}],33:[function(_,L,E){L.exports=_("regenerator-runtime")},{"regenerator-runtime":191}],34:[function(_,L,E){"use strict";function A(n){var d=n.length;if(d%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var c=n.indexOf("=");return c===-1&&(c=d),[c,c===d?0:4-c%4]}function w(n){var d=A(n),c=d[0],g=d[1];return 3*(c+g)/4-g}function v(n,d,c){return 3*(d+c)/4-c}function u(n){for(var d,c=A(n),g=c[0],p=c[1],m=new h(v(n,g,p)),b=0,y=p>0?g-4:g,r=0;r<y;r+=4)d=s[n.charCodeAt(r)]<<18|s[n.charCodeAt(r+1)]<<12|s[n.charCodeAt(r+2)]<<6|s[n.charCodeAt(r+3)],m[b++]=d>>16&255,m[b++]=d>>8&255,m[b++]=255&d;return p===2&&(d=s[n.charCodeAt(r)]<<2|s[n.charCodeAt(r+1)]>>4,m[b++]=255&d),p===1&&(d=s[n.charCodeAt(r)]<<10|s[n.charCodeAt(r+1)]<<4|s[n.charCodeAt(r+2)]>>2,m[b++]=d>>8&255,m[b++]=255&d),m}function f(n){return i[n>>18&63]+i[n>>12&63]+i[n>>6&63]+i[63&n]}function o(n,d,c){for(var g,p=[],m=d;m<c;m+=3)g=(n[m]<<16&16711680)+(n[m+1]<<8&65280)+(255&n[m+2]),p.push(f(g));return p.join("")}function t(n){for(var d,c=n.length,g=c%3,p=[],m=0,b=c-g;m<b;m+=16383)p.push(o(n,m,m+16383>b?b:m+16383));return g===1?(d=n[c-1],p.push(i[d>>2]+i[d<<4&63]+"==")):g===2&&(d=(n[c-2]<<8)+n[c-1],p.push(i[d>>10]+i[d>>4&63]+i[d<<2&63]+"=")),p.join("")}E.byteLength=w,E.toByteArray=u,E.fromByteArray=t;for(var i=[],s=[],h=typeof Uint8Array!="undefined"?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0,l=a.length;e<l;++e)i[e]=a[e],s[a.charCodeAt(e)]=e;s["-".charCodeAt(0)]=62,s["_".charCodeAt(0)]=63},{}],35:[function(_,L,E){!function(A,w,v){L!==void 0&&L.exports?L.exports=v():typeof U=="function"&&U.amd?U("bowser",v):A.bowser=v()}(this,0,function(){function A(s){function h(z){var N=s.match(z);return N&&N.length>1&&N[1]||""}function a(z){var N=s.match(z);return N&&N.length>1&&N[2]||""}var e,l=h(/(ipod|iphone|ipad)/i).toLowerCase(),n=/like android/i.test(s),d=!n&&/android/i.test(s),c=/nexus\s*[0-6]\s*/i.test(s),g=!c&&/nexus\s*[0-9]+/i.test(s),p=/CrOS/.test(s),m=/silk/i.test(s),b=/sailfish/i.test(s),y=/tizen/i.test(s),r=/(web|hpw)os/i.test(s),x=/windows phone/i.test(s),S=(/SamsungBrowser/i.test(s),!x&&/windows/i.test(s)),T=!l&&!m&&/macintosh/i.test(s),R=!d&&!b&&!y&&!r&&/linux/i.test(s),D=a(/edg([ea]|ios)\/(\d+(\.\d+)?)/i),k=h(/version\/(\d+(\.\d+)?)/i),B=/tablet/i.test(s)&&!/tablet pc/i.test(s),G=!B&&/[^-]mobi/i.test(s),P=/xbox/i.test(s);/opera/i.test(s)?e={name:"Opera",opera:t,version:k||h(/(?:opera|opr|opios)[\s\/](\d+(\.\d+)?)/i)}:/opr\/|opios/i.test(s)?e={name:"Opera",opera:t,version:h(/(?:opr|opios)[\s\/](\d+(\.\d+)?)/i)||k}:/SamsungBrowser/i.test(s)?e={name:"Samsung Internet for Android",samsungBrowser:t,version:k||h(/(?:SamsungBrowser)[\s\/](\d+(\.\d+)?)/i)}:/coast/i.test(s)?e={name:"Opera Coast",coast:t,version:k||h(/(?:coast)[\s\/](\d+(\.\d+)?)/i)}:/yabrowser/i.test(s)?e={name:"Yandex Browser",yandexbrowser:t,version:k||h(/(?:yabrowser)[\s\/](\d+(\.\d+)?)/i)}:/ucbrowser/i.test(s)?e={name:"UC Browser",ucbrowser:t,version:h(/(?:ucbrowser)[\s\/](\d+(?:\.\d+)+)/i)}:/mxios/i.test(s)?e={name:"Maxthon",maxthon:t,version:h(/(?:mxios)[\s\/](\d+(?:\.\d+)+)/i)}:/epiphany/i.test(s)?e={name:"Epiphany",epiphany:t,version:h(/(?:epiphany)[\s\/](\d+(?:\.\d+)+)/i)}:/puffin/i.test(s)?e={name:"Puffin",puffin:t,version:h(/(?:puffin)[\s\/](\d+(?:\.\d+)?)/i)}:/sleipnir/i.test(s)?e={name:"Sleipnir",sleipnir:t,version:h(/(?:sleipnir)[\s\/](\d+(?:\.\d+)+)/i)}:/k-meleon/i.test(s)?e={name:"K-Meleon",kMeleon:t,version:h(/(?:k-meleon)[\s\/](\d+(?:\.\d+)+)/i)}:x?(e={name:"Windows Phone",osname:"Windows Phone",windowsphone:t},D?(e.msedge=t,e.version=D):(e.msie=t,e.version=h(/iemobile\/(\d+(\.\d+)?)/i))):/msie|trident/i.test(s)?e={name:"Internet Explorer",msie:t,version:h(/(?:msie |rv:)(\d+(\.\d+)?)/i)}:p?e={name:"Chrome",osname:"Chrome OS",chromeos:t,chromeBook:t,chrome:t,version:h(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:/edg([ea]|ios)/i.test(s)?e={name:"Microsoft Edge",msedge:t,version:D}:/vivaldi/i.test(s)?e={name:"Vivaldi",vivaldi:t,version:h(/vivaldi\/(\d+(\.\d+)?)/i)||k}:b?e={name:"Sailfish",osname:"Sailfish OS",sailfish:t,version:h(/sailfish\s?browser\/(\d+(\.\d+)?)/i)}:/seamonkey\//i.test(s)?e={name:"SeaMonkey",seamonkey:t,version:h(/seamonkey\/(\d+(\.\d+)?)/i)}:/firefox|iceweasel|fxios/i.test(s)?(e={name:"Firefox",firefox:t,version:h(/(?:firefox|iceweasel|fxios)[ \/](\d+(\.\d+)?)/i)},/\((mobile|tablet);[^\)]*rv:[\d\.]+\)/i.test(s)&&(e.firefoxos=t,e.osname="Firefox OS")):m?e={name:"Amazon Silk",silk:t,version:h(/silk\/(\d+(\.\d+)?)/i)}:/phantom/i.test(s)?e={name:"PhantomJS",phantom:t,version:h(/phantomjs\/(\d+(\.\d+)?)/i)}:/slimerjs/i.test(s)?e={name:"SlimerJS",slimer:t,version:h(/slimerjs\/(\d+(\.\d+)?)/i)}:/blackberry|\bbb\d+/i.test(s)||/rim\stablet/i.test(s)?e={name:"BlackBerry",osname:"BlackBerry OS",blackberry:t,version:k||h(/blackberry[\d]+\/(\d+(\.\d+)?)/i)}:r?(e={name:"WebOS",osname:"WebOS",webos:t,version:k||h(/w(?:eb)?osbrowser\/(\d+(\.\d+)?)/i)},/touchpad\//i.test(s)&&(e.touchpad=t)):/bada/i.test(s)?e={name:"Bada",osname:"Bada",bada:t,version:h(/dolfin\/(\d+(\.\d+)?)/i)}:y?e={name:"Tizen",osname:"Tizen",tizen:t,version:h(/(?:tizen\s?)?browser\/(\d+(\.\d+)?)/i)||k}:/qupzilla/i.test(s)?e={name:"QupZilla",qupzilla:t,version:h(/(?:qupzilla)[\s\/](\d+(?:\.\d+)+)/i)||k}:/chromium/i.test(s)?e={name:"Chromium",chromium:t,version:h(/(?:chromium)[\s\/](\d+(?:\.\d+)?)/i)||k}:/chrome|crios|crmo/i.test(s)?e={name:"Chrome",chrome:t,version:h(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:d?e={name:"Android",version:k}:/safari|applewebkit/i.test(s)?(e={name:"Safari",safari:t},k&&(e.version=k)):l?(e={name:l=="iphone"?"iPhone":l=="ipad"?"iPad":"iPod"},k&&(e.version=k)):e=/googlebot/i.test(s)?{name:"Googlebot",googlebot:t,version:h(/googlebot\/(\d+(\.\d+))/i)||k}:{name:h(/^(.*)\/(.*) /),version:a(/^(.*)\/(.*) /)},!e.msedge&&/(apple)?webkit/i.test(s)?(/(apple)?webkit\/537\.36/i.test(s)?(e.name=e.name||"Blink",e.blink=t):(e.name=e.name||"Webkit",e.webkit=t),!e.version&&k&&(e.version=k)):!e.opera&&/gecko\//i.test(s)&&(e.name=e.name||"Gecko",e.gecko=t,e.version=e.version||h(/gecko\/(\d+(\.\d+)?)/i)),e.windowsphone||!d&&!e.silk?!e.windowsphone&&l?(e[l]=t,e.ios=t,e.osname="iOS"):T?(e.mac=t,e.osname="macOS"):P?(e.xbox=t,e.osname="Xbox"):S?(e.windows=t,e.osname="Windows"):R&&(e.linux=t,e.osname="Linux"):(e.android=t,e.osname="Android");var $="";e.windows?$=function(z){switch(z){case"NT":return"NT";case"XP":return"XP";case"NT 5.0":return"2000";case"NT 5.1":return"XP";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}}(h(/Windows ((NT|XP)( \d\d?.\d)?)/i)):e.windowsphone?$=h(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i):e.mac?($=h(/Mac OS X (\d+([_\.\s]\d+)*)/i),$=$.replace(/[_\s]/g,".")):l?($=h(/os (\d+([_\s]\d+)*) like mac os x/i),$=$.replace(/[_\s]/g,".")):d?$=h(/android[ \/-](\d+(\.\d+)*)/i):e.webos?$=h(/(?:web|hpw)os\/(\d+(\.\d+)*)/i):e.blackberry?$=h(/rim\stablet\sos\s(\d+(\.\d+)*)/i):e.bada?$=h(/bada\/(\d+(\.\d+)*)/i):e.tizen&&($=h(/tizen[\/\s](\d+(\.\d+)*)/i)),$&&(e.osversion=$);var X=!e.windows&&$.split(".")[0];return B||g||l=="ipad"||d&&(X==3||X>=4&&!G)||e.silk?e.tablet=t:(G||l=="iphone"||l=="ipod"||d||c||e.blackberry||e.webos||e.bada)&&(e.mobile=t),e.msedge||e.msie&&e.version>=10||e.yandexbrowser&&e.version>=15||e.vivaldi&&e.version>=1||e.chrome&&e.version>=20||e.samsungBrowser&&e.version>=4||e.firefox&&e.version>=20||e.safari&&e.version>=6||e.opera&&e.version>=10||e.ios&&e.osversion&&e.osversion.split(".")[0]>=6||e.blackberry&&e.version>=10.1||e.chromium&&e.version>=20?e.a=t:e.msie&&e.version<10||e.chrome&&e.version<20||e.firefox&&e.version<20||e.safari&&e.version<6||e.opera&&e.version<10||e.ios&&e.osversion&&e.osversion.split(".")[0]<6||e.chromium&&e.version<20?e.c=t:e.x=t,e}function w(s){return s.split(".").length}function v(s,h){var a,e=[];if(Array.prototype.map)return Array.prototype.map.call(s,h);for(a=0;a<s.length;a++)e.push(h(s[a]));return e}function u(s){for(var h=Math.max(w(s[0]),w(s[1])),a=v(s,function(e){var l=h-w(e);return e+=new Array(l+1).join(".0"),v(e.split("."),function(n){return new Array(20-n.length).join("0")+n}).reverse()});--h>=0;){if(a[0][h]>a[1][h])return 1;if(a[0][h]!==a[1][h])return-1;if(h===0)return 0}}function f(s,h,a){var e=i;typeof h=="string"&&(a=h,h=void 0),h===void 0&&(h=!1),a&&(e=A(a));var l=""+e.version;for(var n in s)if(s.hasOwnProperty(n)&&e[n]){if(typeof s[n]!="string")throw new Error("Browser version in the minVersion map should be a string: "+n+": "+String(s));return u([l,s[n]])<0}return h}function o(s,h,a){return!f(s,h,a)}var t=!0,i=A(typeof navigator!="undefined"&&navigator.userAgent||"");return i.test=function(s){for(var h=0;h<s.length;++h){var a=s[h];if(typeof a=="string"&&a in i)return!0}return!1},i.isUnsupportedBrowser=f,i.compareVersions=u,i.check=o,i._detect=A,i.detect=A,i})},{}],36:[function(_,L,E){},{}],37:[function(_,L,E){function A(i){if(i&&!o(i))throw new Error("Unknown encoding: "+i)}function w(i){return i.toString(this.encoding)}function v(i){this.charReceived=i.length%2,this.charLength=this.charReceived?2:0}function u(i){this.charReceived=i.length%3,this.charLength=this.charReceived?3:0}var f=_("buffer").Buffer,o=f.isEncoding||function(i){switch(i&&i.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}},t=E.StringDecoder=function(i){switch(this.encoding=(i||"utf8").toLowerCase().replace(/[-_]/,""),A(i),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=v;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=u;break;default:return void(this.write=w)}this.charBuffer=new f(6),this.charReceived=0,this.charLength=0};t.prototype.write=function(i){for(var s="";this.charLength;){var h=i.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:i.length;if(i.copy(this.charBuffer,this.charReceived,0,h),this.charReceived+=h,this.charReceived<this.charLength)return"";i=i.slice(h,i.length),s=this.charBuffer.slice(0,this.charLength).toString(this.encoding);var e=s.charCodeAt(s.length-1);if(!(e>=55296&&e<=56319)){if(this.charReceived=this.charLength=0,i.length===0)return s;break}this.charLength+=this.surrogateSize,s=""}this.detectIncompleteChar(i);var a=i.length;this.charLength&&(i.copy(this.charBuffer,0,i.length-this.charReceived,a),a-=this.charReceived),s+=i.toString(this.encoding,0,a);var a=s.length-1,e=s.charCodeAt(a);if(e>=55296&&e<=56319){var l=this.surrogateSize;return this.charLength+=l,this.charReceived+=l,this.charBuffer.copy(this.charBuffer,l,0,l),i.copy(this.charBuffer,0,0,l),s.substring(0,a)}return s},t.prototype.detectIncompleteChar=function(i){for(var s=i.length>=3?3:i.length;s>0;s--){var h=i[i.length-s];if(s==1&&h>>5==6){this.charLength=2;break}if(s<=2&&h>>4==14){this.charLength=3;break}if(s<=3&&h>>3==30){this.charLength=4;break}}this.charReceived=s},t.prototype.end=function(i){var s="";if(i&&i.length&&(s=this.write(i)),this.charReceived){var h=this.charReceived,a=this.charBuffer,e=this.encoding;s+=a.slice(0,h).toString(e)}return s}},{buffer:38}],38:[function(_,L,E){(function(A){"use strict";function w(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function v(C,O){if(w()<O)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(C=new Uint8Array(O),C.__proto__=u.prototype):(C===null&&(C=new u(O)),C.length=O),C}function u(C,O,j){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(C,O,j);if(typeof C=="number"){if(typeof O=="string")throw new Error("If encoding is specified then the first argument must be a string");return i(this,C)}return f(this,C,O,j)}function f(C,O,j,M){if(typeof O=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer!="undefined"&&O instanceof ArrayBuffer?a(C,O,j,M):typeof O=="string"?s(C,O,j):e(C,O)}function o(C){if(typeof C!="number")throw new TypeError('"size" argument must be a number');if(C<0)throw new RangeError('"size" argument must not be negative')}function t(C,O,j,M){return o(O),O<=0?v(C,O):j!==void 0?typeof M=="string"?v(C,O).fill(j,M):v(C,O).fill(j):v(C,O)}function i(C,O){if(o(O),C=v(C,O<0?0:0|l(O)),!u.TYPED_ARRAY_SUPPORT)for(var j=0;j<O;++j)C[j]=0;return C}function s(C,O,j){if(typeof j=="string"&&j!==""||(j="utf8"),!u.isEncoding(j))throw new TypeError('"encoding" must be a valid string encoding');var M=0|d(O,j);C=v(C,M);var F=C.write(O,j);return F!==M&&(C=C.slice(0,F)),C}function h(C,O){var j=O.length<0?0:0|l(O.length);C=v(C,j);for(var M=0;M<j;M+=1)C[M]=255&O[M];return C}function a(C,O,j,M){if(O.byteLength,j<0||O.byteLength<j)throw new RangeError("'offset' is out of bounds");if(O.byteLength<j+(M||0))throw new RangeError("'length' is out of bounds");return O=j===void 0&&M===void 0?new Uint8Array(O):M===void 0?new Uint8Array(O,j):new Uint8Array(O,j,M),u.TYPED_ARRAY_SUPPORT?(C=O,C.__proto__=u.prototype):C=h(C,O),C}function e(C,O){if(u.isBuffer(O)){var j=0|l(O.length);return C=v(C,j),C.length===0||O.copy(C,0,0,j),C}if(O){if(typeof ArrayBuffer!="undefined"&&O.buffer instanceof ArrayBuffer||"length"in O)return typeof O.length!="number"||ne(O.length)?v(C,0):h(C,O);if(O.type==="Buffer"&&Ee(O.data))return h(C,O.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function l(C){if(C>=w())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+w().toString(16)+" bytes");return 0|C}function n(C){return+C!=C&&(C=0),u.alloc(+C)}function d(C,O){if(u.isBuffer(C))return C.length;if(typeof ArrayBuffer!="undefined"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(C)||C instanceof ArrayBuffer))return C.byteLength;typeof C!="string"&&(C=""+C);var j=C.length;if(j===0)return 0;for(var M=!1;;)switch(O){case"ascii":case"latin1":case"binary":return j;case"utf8":case"utf-8":case void 0:return ge(C).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*j;case"hex":return j>>>1;case"base64":return Q(C).length;default:if(M)return ge(C).length;O=(""+O).toLowerCase(),M=!0}}function c(C,O,j){var M=!1;if((O===void 0||O<0)&&(O=0),O>this.length)return"";if((j===void 0||j>this.length)&&(j=this.length),j<=0)return"";if(j>>>=0,O>>>=0,j<=O)return"";for(C||(C="utf8");;)switch(C){case"hex":return P(this,O,j);case"utf8":case"utf-8":return D(this,O,j);case"ascii":return B(this,O,j);case"latin1":case"binary":return G(this,O,j);case"base64":return R(this,O,j);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return $(this,O,j);default:if(M)throw new TypeError("Unknown encoding: "+C);C=(C+"").toLowerCase(),M=!0}}function g(C,O,j){var M=C[O];C[O]=C[j],C[j]=M}function p(C,O,j,M,F){if(C.length===0)return-1;if(typeof j=="string"?(M=j,j=0):j>2147483647?j=2147483647:j<-2147483648&&(j=-2147483648),j=+j,isNaN(j)&&(j=F?0:C.length-1),j<0&&(j=C.length+j),j>=C.length){if(F)return-1;j=C.length-1}else if(j<0){if(!F)return-1;j=0}if(typeof O=="string"&&(O=u.from(O,M)),u.isBuffer(O))return O.length===0?-1:m(C,O,j,M,F);if(typeof O=="number")return O&=255,u.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?F?Uint8Array.prototype.indexOf.call(C,O,j):Uint8Array.prototype.lastIndexOf.call(C,O,j):m(C,[O],j,M,F);throw new TypeError("val must be string, number or Buffer")}function m(C,O,j,M,F){function ae(Re,Te){return ve===1?Re[Te]:Re.readUInt16BE(Te*ve)}var ve=1,Pe=C.length,Oe=O.length;if(M!==void 0&&((M=String(M).toLowerCase())==="ucs2"||M==="ucs-2"||M==="utf16le"||M==="utf-16le")){if(C.length<2||O.length<2)return-1;ve=2,Pe/=2,Oe/=2,j/=2}var De;if(F){var Ne=-1;for(De=j;De<Pe;De++)if(ae(C,De)===ae(O,Ne===-1?0:De-Ne)){if(Ne===-1&&(Ne=De),De-Ne+1===Oe)return Ne*ve}else Ne!==-1&&(De-=De-Ne),Ne=-1}else for(j+Oe>Pe&&(j=Pe-Oe),De=j;De>=0;De--){for(var Ke=!0,ke=0;ke<Oe;ke++)if(ae(C,De+ke)!==ae(O,ke)){Ke=!1;break}if(Ke)return De}return-1}function b(C,O,j,M){j=Number(j)||0;var F=C.length-j;M?(M=Number(M))>F&&(M=F):M=F;var ae=O.length;if(ae%2!=0)throw new TypeError("Invalid hex string");M>ae/2&&(M=ae/2);for(var ve=0;ve<M;++ve){var Pe=parseInt(O.substr(2*ve,2),16);if(isNaN(Pe))return ve;C[j+ve]=Pe}return ve}function y(C,O,j,M){return pe(ge(O,C.length-j),C,j,M)}function r(C,O,j,M){return pe(ie(O),C,j,M)}function x(C,O,j,M){return r(C,O,j,M)}function S(C,O,j,M){return pe(Q(O),C,j,M)}function T(C,O,j,M){return pe(re(O,C.length-j),C,j,M)}function R(C,O,j){return O===0&&j===C.length?J.fromByteArray(C):J.fromByteArray(C.slice(O,j))}function D(C,O,j){j=Math.min(C.length,j);for(var M=[],F=O;F<j;){var ae=C[F],ve=null,Pe=ae>239?4:ae>223?3:ae>191?2:1;if(F+Pe<=j){var Oe,De,Ne,Ke;switch(Pe){case 1:ae<128&&(ve=ae);break;case 2:Oe=C[F+1],(192&Oe)==128&&(Ke=(31&ae)<<6|63&Oe)>127&&(ve=Ke);break;case 3:Oe=C[F+1],De=C[F+2],(192&Oe)==128&&(192&De)==128&&(Ke=(15&ae)<<12|(63&Oe)<<6|63&De)>2047&&(Ke<55296||Ke>57343)&&(ve=Ke);break;case 4:Oe=C[F+1],De=C[F+2],Ne=C[F+3],(192&Oe)==128&&(192&De)==128&&(192&Ne)==128&&(Ke=(15&ae)<<18|(63&Oe)<<12|(63&De)<<6|63&Ne)>65535&&Ke<1114112&&(ve=Ke)}}ve===null?(ve=65533,Pe=1):ve>65535&&(ve-=65536,M.push(ve>>>10&1023|55296),ve=56320|1023&ve),M.push(ve),F+=Pe}return k(M)}function k(C){var O=C.length;if(O<=Le)return String.fromCharCode.apply(String,C);for(var j="",M=0;M<O;)j+=String.fromCharCode.apply(String,C.slice(M,M+=Le));return j}function B(C,O,j){var M="";j=Math.min(C.length,j);for(var F=O;F<j;++F)M+=String.fromCharCode(127&C[F]);return M}function G(C,O,j){var M="";j=Math.min(C.length,j);for(var F=O;F<j;++F)M+=String.fromCharCode(C[F]);return M}function P(C,O,j){var M=C.length;(!O||O<0)&&(O=0),(!j||j<0||j>M)&&(j=M);for(var F="",ae=O;ae<j;++ae)F+=se(C[ae]);return F}function $(C,O,j){for(var M=C.slice(O,j),F="",ae=0;ae<M.length;ae+=2)F+=String.fromCharCode(M[ae]+256*M[ae+1]);return F}function X(C,O,j){if(C%1!=0||C<0)throw new RangeError("offset is not uint");if(C+O>j)throw new RangeError("Trying to access beyond buffer length")}function z(C,O,j,M,F,ae){if(!u.isBuffer(C))throw new TypeError('"buffer" argument must be a Buffer instance');if(O>F||O<ae)throw new RangeError('"value" argument is out of bounds');if(j+M>C.length)throw new RangeError("Index out of range")}function N(C,O,j,M){O<0&&(O=65535+O+1);for(var F=0,ae=Math.min(C.length-j,2);F<ae;++F)C[j+F]=(O&255<<8*(M?F:1-F))>>>8*(M?F:1-F)}function H(C,O,j,M){O<0&&(O=4294967295+O+1);for(var F=0,ae=Math.min(C.length-j,4);F<ae;++F)C[j+F]=O>>>8*(M?F:3-F)&255}function q(C,O,j,M,F,ae){if(j+M>C.length)throw new RangeError("Index out of range");if(j<0)throw new RangeError("Index out of range")}function ee(C,O,j,M,F){return F||q(C,O,j,4,34028234663852886e22,-34028234663852886e22),be.write(C,O,j,M,23,4),j+4}function fe(C,O,j,M,F){return F||q(C,O,j,8,17976931348623157e292,-17976931348623157e292),be.write(C,O,j,M,52,8),j+8}function oe(C){if(C=he(C).replace(V,""),C.length<2)return"";for(;C.length%4!=0;)C+="=";return C}function he(C){return C.trim?C.trim():C.replace(/^\s+|\s+$/g,"")}function se(C){return C<16?"0"+C.toString(16):C.toString(16)}function ge(C,O){O=O||1/0;for(var j,M=C.length,F=null,ae=[],ve=0;ve<M;++ve){if((j=C.charCodeAt(ve))>55295&&j<57344){if(!F){if(j>56319){(O-=3)>-1&&ae.push(239,191,189);continue}if(ve+1===M){(O-=3)>-1&&ae.push(239,191,189);continue}F=j;continue}if(j<56320){(O-=3)>-1&&ae.push(239,191,189),F=j;continue}j=65536+(F-55296<<10|j-56320)}else F&&(O-=3)>-1&&ae.push(239,191,189);if(F=null,j<128){if((O-=1)<0)break;ae.push(j)}else if(j<2048){if((O-=2)<0)break;ae.push(j>>6|192,63&j|128)}else if(j<65536){if((O-=3)<0)break;ae.push(j>>12|224,j>>6&63|128,63&j|128)}else{if(!(j<1114112))throw new Error("Invalid code point");if((O-=4)<0)break;ae.push(j>>18|240,j>>12&63|128,j>>6&63|128,63&j|128)}}return ae}function ie(C){for(var O=[],j=0;j<C.length;++j)O.push(255&C.charCodeAt(j));return O}function re(C,O){for(var j,M,F,ae=[],ve=0;ve<C.length&&!((O-=2)<0);++ve)j=C.charCodeAt(ve),M=j>>8,F=j%256,ae.push(F),ae.push(M);return ae}function Q(C){return J.toByteArray(oe(C))}function pe(C,O,j,M){for(var F=0;F<M&&!(F+j>=O.length||F>=C.length);++F)O[F+j]=C[F];return F}function ne(C){return C!==C}var J=_("base64-js"),be=_("ieee754"),Ee=_("isarray");E.Buffer=u,E.SlowBuffer=n,E.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=A.TYPED_ARRAY_SUPPORT!==void 0?A.TYPED_ARRAY_SUPPORT:function(){try{var C=new Uint8Array(1);return C.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},C.foo()===42&&typeof C.subarray=="function"&&C.subarray(1,1).byteLength===0}catch(O){return!1}}(),E.kMaxLength=w(),u.poolSize=8192,u._augment=function(C){return C.__proto__=u.prototype,C},u.from=function(C,O,j){return f(null,C,O,j)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(C,O,j){return t(null,C,O,j)},u.allocUnsafe=function(C){return i(null,C)},u.allocUnsafeSlow=function(C){return i(null,C)},u.isBuffer=function(C){return!(C==null||!C._isBuffer)},u.compare=function(C,O){if(!u.isBuffer(C)||!u.isBuffer(O))throw new TypeError("Arguments must be Buffers");if(C===O)return 0;for(var j=C.length,M=O.length,F=0,ae=Math.min(j,M);F<ae;++F)if(C[F]!==O[F]){j=C[F],M=O[F];break}return j<M?-1:M<j?1:0},u.isEncoding=function(C){switch(String(C).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(C,O){if(!Ee(C))throw new TypeError('"list" argument must be an Array of Buffers');if(C.length===0)return u.alloc(0);var j;if(O===void 0)for(O=0,j=0;j<C.length;++j)O+=C[j].length;var M=u.allocUnsafe(O),F=0;for(j=0;j<C.length;++j){var ae=C[j];if(!u.isBuffer(ae))throw new TypeError('"list" argument must be an Array of Buffers');ae.copy(M,F),F+=ae.length}return M},u.byteLength=d,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var C=this.length;if(C%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var O=0;O<C;O+=2)g(this,O,O+1);return this},u.prototype.swap32=function(){var C=this.length;if(C%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var O=0;O<C;O+=4)g(this,O,O+3),g(this,O+1,O+2);return this},u.prototype.swap64=function(){var C=this.length;if(C%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var O=0;O<C;O+=8)g(this,O,O+7),g(this,O+1,O+6),g(this,O+2,O+5),g(this,O+3,O+4);return this},u.prototype.toString=function(){var C=0|this.length;return C===0?"":arguments.length===0?D(this,0,C):c.apply(this,arguments)},u.prototype.equals=function(C){if(!u.isBuffer(C))throw new TypeError("Argument must be a Buffer");return this===C||u.compare(this,C)===0},u.prototype.inspect=function(){var C="",O=E.INSPECT_MAX_BYTES;return this.length>0&&(C=this.toString("hex",0,O).match(/.{2}/g).join(" "),this.length>O&&(C+=" ... ")),"<Buffer "+C+">"},u.prototype.compare=function(C,O,j,M,F){if(!u.isBuffer(C))throw new TypeError("Argument must be a Buffer");if(O===void 0&&(O=0),j===void 0&&(j=C?C.length:0),M===void 0&&(M=0),F===void 0&&(F=this.length),O<0||j>C.length||M<0||F>this.length)throw new RangeError("out of range index");if(M>=F&&O>=j)return 0;if(M>=F)return-1;if(O>=j)return 1;if(O>>>=0,j>>>=0,M>>>=0,F>>>=0,this===C)return 0;for(var ae=F-M,ve=j-O,Pe=Math.min(ae,ve),Oe=this.slice(M,F),De=C.slice(O,j),Ne=0;Ne<Pe;++Ne)if(Oe[Ne]!==De[Ne]){ae=Oe[Ne],ve=De[Ne];break}return ae<ve?-1:ve<ae?1:0},u.prototype.includes=function(C,O,j){return this.indexOf(C,O,j)!==-1},u.prototype.indexOf=function(C,O,j){return p(this,C,O,j,!0)},u.prototype.lastIndexOf=function(C,O,j){return p(this,C,O,j,!1)},u.prototype.write=function(C,O,j,M){if(O===void 0)M="utf8",j=this.length,O=0;else if(j===void 0&&typeof O=="string")M=O,j=this.length,O=0;else{if(!isFinite(O))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");O|=0,isFinite(j)?(j|=0,M===void 0&&(M="utf8")):(M=j,j=void 0)}var F=this.length-O;if((j===void 0||j>F)&&(j=F),C.length>0&&(j<0||O<0)||O>this.length)throw new RangeError("Attempt to write outside buffer bounds");M||(M="utf8");for(var ae=!1;;)switch(M){case"hex":return b(this,C,O,j);case"utf8":case"utf-8":return y(this,C,O,j);case"ascii":return r(this,C,O,j);case"latin1":case"binary":return x(this,C,O,j);case"base64":return S(this,C,O,j);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,C,O,j);default:if(ae)throw new TypeError("Unknown encoding: "+M);M=(""+M).toLowerCase(),ae=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Le=4096;u.prototype.slice=function(C,O){var j=this.length;C=~~C,O=O===void 0?j:~~O,C<0?(C+=j)<0&&(C=0):C>j&&(C=j),O<0?(O+=j)<0&&(O=0):O>j&&(O=j),O<C&&(O=C);var M;if(u.TYPED_ARRAY_SUPPORT)M=this.subarray(C,O),M.__proto__=u.prototype;else{var F=O-C;M=new u(F,void 0);for(var ae=0;ae<F;++ae)M[ae]=this[ae+C]}return M},u.prototype.readUIntLE=function(C,O,j){C|=0,O|=0,j||X(C,O,this.length);for(var M=this[C],F=1,ae=0;++ae<O&&(F*=256);)M+=this[C+ae]*F;return M},u.prototype.readUIntBE=function(C,O,j){C|=0,O|=0,j||X(C,O,this.length);for(var M=this[C+--O],F=1;O>0&&(F*=256);)M+=this[C+--O]*F;return M},u.prototype.readUInt8=function(C,O){return O||X(C,1,this.length),this[C]},u.prototype.readUInt16LE=function(C,O){return O||X(C,2,this.length),this[C]|this[C+1]<<8},u.prototype.readUInt16BE=function(C,O){return O||X(C,2,this.length),this[C]<<8|this[C+1]},u.prototype.readUInt32LE=function(C,O){return O||X(C,4,this.length),(this[C]|this[C+1]<<8|this[C+2]<<16)+16777216*this[C+3]},u.prototype.readUInt32BE=function(C,O){return O||X(C,4,this.length),16777216*this[C]+(this[C+1]<<16|this[C+2]<<8|this[C+3])},u.prototype.readIntLE=function(C,O,j){C|=0,O|=0,j||X(C,O,this.length);for(var M=this[C],F=1,ae=0;++ae<O&&(F*=256);)M+=this[C+ae]*F;return F*=128,M>=F&&(M-=Math.pow(2,8*O)),M},u.prototype.readIntBE=function(C,O,j){C|=0,O|=0,j||X(C,O,this.length);for(var M=O,F=1,ae=this[C+--M];M>0&&(F*=256);)ae+=this[C+--M]*F;return F*=128,ae>=F&&(ae-=Math.pow(2,8*O)),ae},u.prototype.readInt8=function(C,O){return O||X(C,1,this.length),128&this[C]?-1*(255-this[C]+1):this[C]},u.prototype.readInt16LE=function(C,O){O||X(C,2,this.length);var j=this[C]|this[C+1]<<8;return 32768&j?4294901760|j:j},u.prototype.readInt16BE=function(C,O){O||X(C,2,this.length);var j=this[C+1]|this[C]<<8;return 32768&j?4294901760|j:j},u.prototype.readInt32LE=function(C,O){return O||X(C,4,this.length),this[C]|this[C+1]<<8|this[C+2]<<16|this[C+3]<<24},u.prototype.readInt32BE=function(C,O){return O||X(C,4,this.length),this[C]<<24|this[C+1]<<16|this[C+2]<<8|this[C+3]},u.prototype.readFloatLE=function(C,O){return O||X(C,4,this.length),be.read(this,C,!0,23,4)},u.prototype.readFloatBE=function(C,O){return O||X(C,4,this.length),be.read(this,C,!1,23,4)},u.prototype.readDoubleLE=function(C,O){return O||X(C,8,this.length),be.read(this,C,!0,52,8)},u.prototype.readDoubleBE=function(C,O){return O||X(C,8,this.length),be.read(this,C,!1,52,8)},u.prototype.writeUIntLE=function(C,O,j,M){(C=+C,O|=0,j|=0,!M)&&z(this,C,O,j,Math.pow(2,8*j)-1,0);var F=1,ae=0;for(this[O]=255&C;++ae<j&&(F*=256);)this[O+ae]=C/F&255;return O+j},u.prototype.writeUIntBE=function(C,O,j,M){(C=+C,O|=0,j|=0,!M)&&z(this,C,O,j,Math.pow(2,8*j)-1,0);var F=j-1,ae=1;for(this[O+F]=255&C;--F>=0&&(ae*=256);)this[O+F]=C/ae&255;return O+j},u.prototype.writeUInt8=function(C,O,j){return C=+C,O|=0,j||z(this,C,O,1,255,0),u.TYPED_ARRAY_SUPPORT||(C=Math.floor(C)),this[O]=255&C,O+1},u.prototype.writeUInt16LE=function(C,O,j){return C=+C,O|=0,j||z(this,C,O,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[O]=255&C,this[O+1]=C>>>8):N(this,C,O,!0),O+2},u.prototype.writeUInt16BE=function(C,O,j){return C=+C,O|=0,j||z(this,C,O,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[O]=C>>>8,this[O+1]=255&C):N(this,C,O,!1),O+2},u.prototype.writeUInt32LE=function(C,O,j){return C=+C,O|=0,j||z(this,C,O,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[O+3]=C>>>24,this[O+2]=C>>>16,this[O+1]=C>>>8,this[O]=255&C):H(this,C,O,!0),O+4},u.prototype.writeUInt32BE=function(C,O,j){return C=+C,O|=0,j||z(this,C,O,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[O]=C>>>24,this[O+1]=C>>>16,this[O+2]=C>>>8,this[O+3]=255&C):H(this,C,O,!1),O+4},u.prototype.writeIntLE=function(C,O,j,M){if(C=+C,O|=0,!M){var F=Math.pow(2,8*j-1);z(this,C,O,j,F-1,-F)}var ae=0,ve=1,Pe=0;for(this[O]=255&C;++ae<j&&(ve*=256);)C<0&&Pe===0&&this[O+ae-1]!==0&&(Pe=1),this[O+ae]=(C/ve>>0)-Pe&255;return O+j},u.prototype.writeIntBE=function(C,O,j,M){if(C=+C,O|=0,!M){var F=Math.pow(2,8*j-1);z(this,C,O,j,F-1,-F)}var ae=j-1,ve=1,Pe=0;for(this[O+ae]=255&C;--ae>=0&&(ve*=256);)C<0&&Pe===0&&this[O+ae+1]!==0&&(Pe=1),this[O+ae]=(C/ve>>0)-Pe&255;return O+j},u.prototype.writeInt8=function(C,O,j){return C=+C,O|=0,j||z(this,C,O,1,127,-128),u.TYPED_ARRAY_SUPPORT||(C=Math.floor(C)),C<0&&(C=255+C+1),this[O]=255&C,O+1},u.prototype.writeInt16LE=function(C,O,j){return C=+C,O|=0,j||z(this,C,O,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[O]=255&C,this[O+1]=C>>>8):N(this,C,O,!0),O+2},u.prototype.writeInt16BE=function(C,O,j){return C=+C,O|=0,j||z(this,C,O,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[O]=C>>>8,this[O+1]=255&C):N(this,C,O,!1),O+2},u.prototype.writeInt32LE=function(C,O,j){return C=+C,O|=0,j||z(this,C,O,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[O]=255&C,this[O+1]=C>>>8,this[O+2]=C>>>16,this[O+3]=C>>>24):H(this,C,O,!0),O+4},u.prototype.writeInt32BE=function(C,O,j){return C=+C,O|=0,j||z(this,C,O,4,2147483647,-2147483648),C<0&&(C=4294967295+C+1),u.TYPED_ARRAY_SUPPORT?(this[O]=C>>>24,this[O+1]=C>>>16,this[O+2]=C>>>8,this[O+3]=255&C):H(this,C,O,!1),O+4},u.prototype.writeFloatLE=function(C,O,j){return ee(this,C,O,!0,j)},u.prototype.writeFloatBE=function(C,O,j){return ee(this,C,O,!1,j)},u.prototype.writeDoubleLE=function(C,O,j){return fe(this,C,O,!0,j)},u.prototype.writeDoubleBE=function(C,O,j){return fe(this,C,O,!1,j)},u.prototype.copy=function(C,O,j,M){if(j||(j=0),M||M===0||(M=this.length),O>=C.length&&(O=C.length),O||(O=0),M>0&&M<j&&(M=j),M===j)return 0;if(C.length===0||this.length===0)return 0;if(O<0)throw new RangeError("targetStart out of bounds");if(j<0||j>=this.length)throw new RangeError("sourceStart out of bounds");if(M<0)throw new RangeError("sourceEnd out of bounds");M>this.length&&(M=this.length),C.length-O<M-j&&(M=C.length-O+j);var F,ae=M-j;if(this===C&&j<O&&O<M)for(F=ae-1;F>=0;--F)C[F+O]=this[F+j];else if(ae<1e3||!u.TYPED_ARRAY_SUPPORT)for(F=0;F<ae;++F)C[F+O]=this[F+j];else Uint8Array.prototype.set.call(C,this.subarray(j,j+ae),O);return ae},u.prototype.fill=function(C,O,j,M){if(typeof C=="string"){if(typeof O=="string"?(M=O,O=0,j=this.length):typeof j=="string"&&(M=j,j=this.length),C.length===1){var F=C.charCodeAt(0);F<256&&(C=F)}if(M!==void 0&&typeof M!="string")throw new TypeError("encoding must be a string");if(typeof M=="string"&&!u.isEncoding(M))throw new TypeError("Unknown encoding: "+M)}else typeof C=="number"&&(C&=255);if(O<0||this.length<O||this.length<j)throw new RangeError("Out of range index");if(j<=O)return this;O>>>=0,j=j===void 0?this.length:j>>>0,C||(C=0);var ae;if(typeof C=="number")for(ae=O;ae<j;++ae)this[ae]=C;else{var ve=u.isBuffer(C)?C:ge(new u(C,M).toString()),Pe=ve.length;for(ae=0;ae<j-O;++ae)this[ae+O]=ve[ae%Pe]}return this};var V=/[^+\/0-9A-Za-z-_]/g}).call(this,typeof Se!="undefined"?Se:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"base64-js":34,ieee754:161,isarray:166}],39:[function(_,L,E){L.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},{}],40:[function(_,L,E){"use strict";var A=function(){this.buffer=[],this.fns=[]};A.prototype.push=function(v,u){if(this.fns.length)return this.fns.shift()(null,v);var f={data:v,priority:u},o=w(this.buffer,f,function(t){return t.priority});this.buffer.splice(o,0,f)},A.prototype.next=function(){var v=this;return function(u){if(v.buffer.length)return u(null,v.buffer.pop().data);v.fns.push(u)}};var w=function(v,u,f){u=f(u);for(var o=0,t=v?v.length:o;o<t;){var i=o+t>>>1;f(v[i])<u?o=i+1:t=i}return o};L.exports=A},{}],41:[function(_,L,E){function A(a){var e=this,l=h.call(arguments,1);return new Promise(function(n,d){function c(m){var b;try{b=a.next(m)}catch(y){return d(y)}p(b)}function g(m){var b;try{b=a.throw(m)}catch(y){return d(y)}p(b)}function p(m){if(m.done)return n(m.value);var b=w.call(e,m.value);return b&&o(b)?b.then(c,g):g(new TypeError('You may only yield a function, promise, generator, array, or object, but the following object was passed: "'+String(m.value)+'"'))}if(typeof a=="function"&&(a=a.apply(e,l)),!a||typeof a.next!="function")return n(a);c()})}function w(a){return a&&(o(a)?a:i(a)||t(a)?A.call(this,a):typeof a=="function"?v.call(this,a):Array.isArray(a)?u.call(this,a):s(a)?f.call(this,a):a)}function v(a){var e=this;return new Promise(function(l,n){a.call(e,function(d,c){if(d)return n(d);arguments.length>2&&(c=h.call(arguments,1)),l(c)})})}function u(a){return Promise.all(a.map(w,this))}function f(a){for(var e=new a.constructor,l=Object.keys(a),n=[],d=0;d<l.length;d++){var c=l[d],g=w.call(this,a[c]);g&&o(g)?function(p,m){e[m]=void 0,n.push(p.then(function(b){e[m]=b}))}(g,c):e[c]=a[c]}return Promise.all(n).then(function(){return e})}function o(a){return typeof a.then=="function"}function t(a){return typeof a.next=="function"&&typeof a.throw=="function"}function i(a){var e=a.constructor;return!!e&&(e.name==="GeneratorFunction"||e.displayName==="GeneratorFunction"||t(e.prototype))}function s(a){return Object==a.constructor}var h=Array.prototype.slice;L.exports=A.default=A.co=A,A.wrap=function(a){function e(){return A.call(this,a.apply(this,arguments))}return e.__generatorFunction__=a,e}},{}],42:[function(_,L,E){L.exports={O_RDONLY:0,O_WRONLY:1,O_RDWR:2,S_IFMT:61440,S_IFREG:32768,S_IFDIR:16384,S_IFCHR:8192,S_IFBLK:24576,S_IFIFO:4096,S_IFLNK:40960,S_IFSOCK:49152,O_CREAT:512,O_EXCL:2048,O_NOCTTY:131072,O_TRUNC:1024,O_APPEND:8,O_DIRECTORY:1048576,O_NOFOLLOW:256,O_SYNC:128,O_SYMLINK:2097152,O_NONBLOCK:4,S_IRWXU:448,S_IRUSR:256,S_IWUSR:128,S_IXUSR:64,S_IRWXG:56,S_IRGRP:32,S_IWGRP:16,S_IXGRP:8,S_IRWXO:7,S_IROTH:4,S_IWOTH:2,S_IXOTH:1,E2BIG:7,EACCES:13,EADDRINUSE:48,EADDRNOTAVAIL:49,EAFNOSUPPORT:47,EAGAIN:35,EALREADY:37,EBADF:9,EBADMSG:94,EBUSY:16,ECANCELED:89,ECHILD:10,ECONNABORTED:53,ECONNREFUSED:61,ECONNRESET:54,EDEADLK:11,EDESTADDRREQ:39,EDOM:33,EDQUOT:69,EEXIST:17,EFAULT:14,EFBIG:27,EHOSTUNREACH:65,EIDRM:90,EILSEQ:92,EINPROGRESS:36,EINTR:4,EINVAL:22,EIO:5,EISCONN:56,EISDIR:21,ELOOP:62,EMFILE:24,EMLINK:31,EMSGSIZE:40,EMULTIHOP:95,ENAMETOOLONG:63,ENETDOWN:50,ENETRESET:52,ENETUNREACH:51,ENFILE:23,ENOBUFS:55,ENODATA:96,ENODEV:19,ENOENT:2,ENOEXEC:8,ENOLCK:77,ENOLINK:97,ENOMEM:12,ENOMSG:91,ENOPROTOOPT:42,ENOSPC:28,ENOSR:98,ENOSTR:99,ENOSYS:78,ENOTCONN:57,ENOTDIR:20,ENOTEMPTY:66,ENOTSOCK:38,ENOTSUP:45,ENOTTY:25,ENXIO:6,EOPNOTSUPP:102,EOVERFLOW:84,EPERM:1,EPIPE:32,EPROTO:100,EPROTONOSUPPORT:43,EPROTOTYPE:41,ERANGE:34,EROFS:30,ESPIPE:29,ESRCH:3,ESTALE:70,ETIME:101,ETIMEDOUT:60,ETXTBSY:26,EWOULDBLOCK:35,EXDEV:18,SIGHUP:1,SIGINT:2,SIGQUIT:3,SIGILL:4,SIGTRAP:5,SIGABRT:6,SIGIOT:6,SIGBUS:10,SIGFPE:8,SIGKILL:9,SIGUSR1:30,SIGSEGV:11,SIGUSR2:31,SIGPIPE:13,SIGALRM:14,SIGTERM:15,SIGCHLD:20,SIGCONT:19,SIGSTOP:17,SIGTSTP:18,SIGTTIN:21,SIGTTOU:22,SIGURG:16,SIGXCPU:24,SIGXFSZ:25,SIGVTALRM:26,SIGPROF:27,SIGWINCH:28,SIGIO:23,SIGSYS:12,SSL_OP_ALL:2147486719,SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION:262144,SSL_OP_CIPHER_SERVER_PREFERENCE:4194304,SSL_OP_CISCO_ANYCONNECT:32768,SSL_OP_COOKIE_EXCHANGE:8192,SSL_OP_CRYPTOPRO_TLSEXT_BUG:2147483648,SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS:2048,SSL_OP_EPHEMERAL_RSA:0,SSL_OP_LEGACY_SERVER_CONNECT:4,SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER:32,SSL_OP_MICROSOFT_SESS_ID_BUG:1,SSL_OP_MSIE_SSLV2_RSA_PADDING:0,SSL_OP_NETSCAPE_CA_DN_BUG:536870912,SSL_OP_NETSCAPE_CHALLENGE_BUG:2,SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG:1073741824,SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG:8,SSL_OP_NO_COMPRESSION:131072,SSL_OP_NO_QUERY_MTU:4096,SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION:65536,SSL_OP_NO_SSLv2:16777216,SSL_OP_NO_SSLv3:33554432,SSL_OP_NO_TICKET:16384,SSL_OP_NO_TLSv1:67108864,SSL_OP_NO_TLSv1_1:268435456,SSL_OP_NO_TLSv1_2:134217728,SSL_OP_PKCS1_CHECK_1:0,SSL_OP_PKCS1_CHECK_2:0,SSL_OP_SINGLE_DH_USE:1048576,SSL_OP_SINGLE_ECDH_USE:524288,SSL_OP_SSLEAY_080_CLIENT_DH_BUG:128,SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG:0,SSL_OP_TLS_BLOCK_PADDING_BUG:512,SSL_OP_TLS_D5_BUG:256,SSL_OP_TLS_ROLLBACK_BUG:8388608,ENGINE_METHOD_DSA:2,ENGINE_METHOD_DH:4,ENGINE_METHOD_RAND:8,ENGINE_METHOD_ECDH:16,ENGINE_METHOD_ECDSA:32,ENGINE_METHOD_CIPHERS:64,ENGINE_METHOD_DIGESTS:128,ENGINE_METHOD_STORE:256,ENGINE_METHOD_PKEY_METHS:512,ENGINE_METHOD_PKEY_ASN1_METHS:1024,ENGINE_METHOD_ALL:65535,ENGINE_METHOD_NONE:0,DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6,F_OK:0,R_OK:4,W_OK:2,X_OK:1,UV_UDP_REUSEADDR:4}},{}],43:[function(_,L,E){"use strict";function A(u,f){if(!(this instanceof A))return new A(u,f);this.src=u,this._withAccess=f}function w(u,f){return u[f]===void 0&&u.__lookupGetter__(f)===void 0&&u.__lookupSetter__(f)===void 0}var v=Array.prototype.slice;L.exports=A,A.prototype.withAccess=function(u){return this._withAccess=u!==!1,this},A.prototype.pick=function(u){return Array.isArray(u)||(u=v.call(arguments)),u.length&&(this.keys=u),this},A.prototype.to=function(u){if(u=u||{},!this.src)return u;var f=this.keys||Object.keys(this.src);if(!this._withAccess){for(var o=0;o<f.length;o++)t=f[o],u[t]===void 0&&(u[t]=this.src[t]);return u}for(var o=0;o<f.length;o++){var t=f[o];if(w(u,t)){var i=this.src.__lookupGetter__(t),s=this.src.__lookupSetter__(t);i&&u.__defineGetter__(t,i),s&&u.__defineSetter__(t,s),i||s||(u[t]=this.src[t])}}return u},A.prototype.toCover=function(u){for(var f=this.keys||Object.keys(this.src),o=0;o<f.length;o++){var t=f[o];delete u[t];var i=this.src.__lookupGetter__(t),s=this.src.__lookupSetter__(t);i&&u.__defineGetter__(t,i),s&&u.__defineSetter__(t,s),i||s||(u[t]=this.src[t])}},A.prototype.override=A.prototype.toCover,A.prototype.and=function(u){var f={};return this.to(f),this.src=u,this.to(f),this.src=f,this}},{}],44:[function(_,L,E){_("../../modules/es6.string.iterator"),_("../../modules/es6.array.from"),L.exports=_("../../modules/_core").Array.from},{"../../modules/_core":65,"../../modules/es6.array.from":133,"../../modules/es6.string.iterator":145}],45:[function(_,L,E){var A=_("../../modules/_core"),w=A.JSON||(A.JSON={stringify:JSON.stringify});L.exports=function(v){return w.stringify.apply(w,arguments)}},{"../../modules/_core":65}],46:[function(_,L,E){_("../../modules/es6.object.assign"),L.exports=_("../../modules/_core").Object.assign},{"../../modules/_core":65,"../../modules/es6.object.assign":136}],47:[function(_,L,E){_("../../modules/es6.object.create");var A=_("../../modules/_core").Object;L.exports=function(w,v){return A.create(w,v)}},{"../../modules/_core":65,"../../modules/es6.object.create":137}],48:[function(_,L,E){_("../../modules/es6.object.define-property");var A=_("../../modules/_core").Object;L.exports=function(w,v,u){return A.defineProperty(w,v,u)}},{"../../modules/_core":65,"../../modules/es6.object.define-property":138}],49:[function(_,L,E){_("../../modules/es6.object.get-own-property-names");var A=_("../../modules/_core").Object;L.exports=function(w){return A.getOwnPropertyNames(w)}},{"../../modules/_core":65,"../../modules/es6.object.get-own-property-names":139}],50:[function(_,L,E){_("../../modules/es6.object.get-prototype-of"),L.exports=_("../../modules/_core").Object.getPrototypeOf},{"../../modules/_core":65,"../../modules/es6.object.get-prototype-of":140}],51:[function(_,L,E){_("../../modules/es6.object.keys"),L.exports=_("../../modules/_core").Object.keys},{"../../modules/_core":65,"../../modules/es6.object.keys":141}],52:[function(_,L,E){_("../modules/es6.object.to-string"),_("../modules/es6.string.iterator"),_("../modules/web.dom.iterable"),_("../modules/es6.promise"),_("../modules/es7.promise.finally"),_("../modules/es7.promise.try"),L.exports=_("../modules/_core").Promise},{"../modules/_core":65,"../modules/es6.object.to-string":142,"../modules/es6.promise":143,"../modules/es6.string.iterator":145,"../modules/es7.promise.finally":147,"../modules/es7.promise.try":148,"../modules/web.dom.iterable":151}],53:[function(_,L,E){_("../modules/web.immediate"),L.exports=_("../modules/_core").setImmediate},{"../modules/_core":65,"../modules/web.immediate":152}],54:[function(_,L,E){_("../../modules/es6.string.from-code-point"),L.exports=_("../../modules/_core").String.fromCodePoint},{"../../modules/_core":65,"../../modules/es6.string.from-code-point":144}],55:[function(_,L,E){_("../../modules/es6.function.has-instance"),L.exports=_("../../modules/_wks-ext").f("hasInstance")},{"../../modules/_wks-ext":130,"../../modules/es6.function.has-instance":135}],56:[function(_,L,E){_("../../modules/es6.symbol"),_("../../modules/es6.object.to-string"),_("../../modules/es7.symbol.async-iterator"),_("../../modules/es7.symbol.observable"),L.exports=_("../../modules/_core").Symbol},{"../../modules/_core":65,"../../modules/es6.object.to-string":142,"../../modules/es6.symbol":146,"../../modules/es7.symbol.async-iterator":149,"../../modules/es7.symbol.observable":150}],57:[function(_,L,E){_("../../modules/es6.string.iterator"),_("../../modules/web.dom.iterable"),L.exports=_("../../modules/_wks-ext").f("iterator")},{"../../modules/_wks-ext":130,"../../modules/es6.string.iterator":145,"../../modules/web.dom.iterable":151}],58:[function(_,L,E){L.exports=function(A){if(typeof A!="function")throw TypeError(A+" is not a function!");return A}},{}],59:[function(_,L,E){L.exports=function(){}},{}],60:[function(_,L,E){L.exports=function(A,w,v,u){if(!(A instanceof w)||u!==void 0&&u in A)throw TypeError(v+": incorrect invocation!");return A}},{}],61:[function(_,L,E){var A=_("./_is-object");L.exports=function(w){if(!A(w))throw TypeError(w+" is not an object!");return w}},{"./_is-object":85}],62:[function(_,L,E){var A=_("./_to-iobject"),w=_("./_to-length"),v=_("./_to-absolute-index");L.exports=function(u){return function(f,o,t){var i,s=A(f),h=w(s.length),a=v(t,h);if(u&&o!=o){for(;h>a;)if((i=s[a++])!=i)return!0}else for(;h>a;a++)if((u||a in s)&&s[a]===o)return u||a||0;return!u&&-1}}},{"./_to-absolute-index":121,"./_to-iobject":123,"./_to-length":124}],63:[function(_,L,E){var A=_("./_cof"),w=_("./_wks")("toStringTag"),v=A(function(){return arguments}())=="Arguments",u=function(f,o){try{return f[o]}catch(t){}};L.exports=function(f){var o,t,i;return f===void 0?"Undefined":f===null?"Null":typeof(t=u(o=Object(f),w))=="string"?t:v?A(o):(i=A(o))=="Object"&&typeof o.callee=="function"?"Arguments":i}},{"./_cof":64,"./_wks":131}],64:[function(_,L,E){var A={}.toString;L.exports=function(w){return A.call(w).slice(8,-1)}},{}],65:[function(_,L,E){var A=L.exports={version:"2.5.7"};typeof __e=="number"&&(__e=A)},{}],66:[function(_,L,E){"use strict";var A=_("./_object-dp"),w=_("./_property-desc");L.exports=function(v,u,f){u in v?A.f(v,u,w(0,f)):v[u]=f}},{"./_object-dp":98,"./_property-desc":111}],67:[function(_,L,E){var A=_("./_a-function");L.exports=function(w,v,u){if(A(w),v===void 0)return w;switch(u){case 1:return function(f){return w.call(v,f)};case 2:return function(f,o){return w.call(v,f,o)};case 3:return function(f,o,t){return w.call(v,f,o,t)}}return function(){return w.apply(v,arguments)}}},{"./_a-function":58}],68:[function(_,L,E){L.exports=function(A){if(A==null)throw TypeError("Can't call method on "+A);return A}},{}],69:[function(_,L,E){L.exports=!_("./_fails")(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7})},{"./_fails":74}],70:[function(_,L,E){var A=_("./_is-object"),w=_("./_global").document,v=A(w)&&A(w.createElement);L.exports=function(u){return v?w.createElement(u):{}}},{"./_global":76,"./_is-object":85}],71:[function(_,L,E){L.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},{}],72:[function(_,L,E){var A=_("./_object-keys"),w=_("./_object-gops"),v=_("./_object-pie");L.exports=function(u){var f=A(u),o=w.f;if(o)for(var t,i=o(u),s=v.f,h=0;i.length>h;)s.call(u,t=i[h++])&&f.push(t);return f}},{"./_object-gops":103,"./_object-keys":106,"./_object-pie":107}],73:[function(_,L,E){var A=_("./_global"),w=_("./_core"),v=_("./_ctx"),u=_("./_hide"),f=_("./_has"),o=function(t,i,s){var h,a,e,l=t&o.F,n=t&o.G,d=t&o.S,c=t&o.P,g=t&o.B,p=t&o.W,m=n?w:w[i]||(w[i]={}),b=m.prototype,y=n?A:d?A[i]:(A[i]||{}).prototype;n&&(s=i);for(h in s)(a=!l&&y&&y[h]!==void 0)&&f(m,h)||(e=a?y[h]:s[h],m[h]=n&&typeof y[h]!="function"?s[h]:g&&a?v(e,A):p&&y[h]==e?function(r){var x=function(S,T,R){if(this instanceof r){switch(arguments.length){case 0:return new r;case 1:return new r(S);case 2:return new r(S,T)}return new r(S,T,R)}return r.apply(this,arguments)};return x.prototype=r.prototype,x}(e):c&&typeof e=="function"?v(Function.call,e):e,c&&((m.virtual||(m.virtual={}))[h]=e,t&o.R&&b&&!b[h]&&u(b,h,e)))};o.F=1,o.G=2,o.S=4,o.P=8,o.B=16,o.W=32,o.U=64,o.R=128,L.exports=o},{"./_core":65,"./_ctx":67,"./_global":76,"./_has":77,"./_hide":78}],74:[function(_,L,E){L.exports=function(A){try{return!!A()}catch(w){return!0}}},{}],75:[function(_,L,E){var A=_("./_ctx"),w=_("./_iter-call"),v=_("./_is-array-iter"),u=_("./_an-object"),f=_("./_to-length"),o=_("./core.get-iterator-method"),t={},i={},E=L.exports=function(s,h,a,e,l){var n,d,c,g,p=l?function(){return s}:o(s),m=A(a,e,h?2:1),b=0;if(typeof p!="function")throw TypeError(s+" is not iterable!");if(v(p)){for(n=f(s.length);n>b;b++)if((g=h?m(u(d=s[b])[0],d[1]):m(s[b]))===t||g===i)return g}else for(c=p.call(s);!(d=c.next()).done;)if((g=w(c,m,d.value,h))===t||g===i)return g};E.BREAK=t,E.RETURN=i},{"./_an-object":61,"./_ctx":67,"./_is-array-iter":83,"./_iter-call":86,"./_to-length":124,"./core.get-iterator-method":132}],76:[function(_,L,E){var A=L.exports=typeof window!="undefined"&&window.Math==Math?window:typeof self!="undefined"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=A)},{}],77:[function(_,L,E){var A={}.hasOwnProperty;L.exports=function(w,v){return A.call(w,v)}},{}],78:[function(_,L,E){var A=_("./_object-dp"),w=_("./_property-desc");L.exports=_("./_descriptors")?function(v,u,f){return A.f(v,u,w(1,f))}:function(v,u,f){return v[u]=f,v}},{"./_descriptors":69,"./_object-dp":98,"./_property-desc":111}],79:[function(_,L,E){var A=_("./_global").document;L.exports=A&&A.documentElement},{"./_global":76}],80:[function(_,L,E){L.exports=!_("./_descriptors")&&!_("./_fails")(function(){return Object.defineProperty(_("./_dom-create")("div"),"a",{get:function(){return 7}}).a!=7})},{"./_descriptors":69,"./_dom-create":70,"./_fails":74}],81:[function(_,L,E){L.exports=function(A,w,v){var u=v===void 0;switch(w.length){case 0:return u?A():A.call(v);case 1:return u?A(w[0]):A.call(v,w[0]);case 2:return u?A(w[0],w[1]):A.call(v,w[0],w[1]);case 3:return u?A(w[0],w[1],w[2]):A.call(v,w[0],w[1],w[2]);case 4:return u?A(w[0],w[1],w[2],w[3]):A.call(v,w[0],w[1],w[2],w[3])}return A.apply(v,w)}},{}],82:[function(_,L,E){var A=_("./_cof");L.exports=Object("z").propertyIsEnumerable(0)?Object:function(w){return A(w)=="String"?w.split(""):Object(w)}},{"./_cof":64}],83:[function(_,L,E){var A=_("./_iterators"),w=_("./_wks")("iterator"),v=Array.prototype;L.exports=function(u){return u!==void 0&&(A.Array===u||v[w]===u)}},{"./_iterators":91,"./_wks":131}],84:[function(_,L,E){var A=_("./_cof");L.exports=Array.isArray||function(w){return A(w)=="Array"}},{"./_cof":64}],85:[function(_,L,E){L.exports=function(A){return typeof A=="object"?A!==null:typeof A=="function"}},{}],86:[function(_,L,E){var A=_("./_an-object");L.exports=function(w,v,u,f){try{return f?v(A(u)[0],u[1]):v(u)}catch(t){var o=w.return;throw o!==void 0&&A(o.call(w)),t}}},{"./_an-object":61}],87:[function(_,L,E){"use strict";var A=_("./_object-create"),w=_("./_property-desc"),v=_("./_set-to-string-tag"),u={};_("./_hide")(u,_("./_wks")("iterator"),function(){return this}),L.exports=function(f,o,t){f.prototype=A(u,{next:w(1,t)}),v(f,o+" Iterator")}},{"./_hide":78,"./_object-create":97,"./_property-desc":111,"./_set-to-string-tag":115,"./_wks":131}],88:[function(_,L,E){"use strict";var A=_("./_library"),w=_("./_export"),v=_("./_redefine"),u=_("./_hide"),f=_("./_iterators"),o=_("./_iter-create"),t=_("./_set-to-string-tag"),i=_("./_object-gpo"),s=_("./_wks")("iterator"),h=!([].keys&&"next"in[].keys()),a=function(){return this};L.exports=function(e,l,n,d,c,g,p){o(n,l,d);var m,b,y,r=function(P){if(!h&&P in R)return R[P];switch(P){case"keys":case"values":return function(){return new n(this,P)}}return function(){return new n(this,P)}},x=l+" Iterator",S=c=="values",T=!1,R=e.prototype,D=R[s]||R["@@iterator"]||c&&R[c],k=D||r(c),B=c?S?r("entries"):k:void 0,G=l=="Array"&&R.entries||D;if(G&&(y=i(G.call(new e)))!==Object.prototype&&y.next&&(t(y,x,!0),A||typeof y[s]=="function"||u(y,s,a)),S&&D&&D.name!=="values"&&(T=!0,k=function(){return D.call(this)}),A&&!p||!h&&!T&&R[s]||u(R,s,k),f[l]=k,f[x]=a,c)if(m={values:S?k:r("values"),keys:g?k:r("keys"),entries:B},p)for(b in m)b in R||v(R,b,m[b]);else w(w.P+w.F*(h||T),l,m);return m}},{"./_export":73,"./_hide":78,"./_iter-create":87,"./_iterators":91,"./_library":92,"./_object-gpo":104,"./_redefine":113,"./_set-to-string-tag":115,"./_wks":131}],89:[function(_,L,E){var A=_("./_wks")("iterator"),w=!1;try{var v=[7][A]();v.return=function(){w=!0},Array.from(v,function(){throw 2})}catch(u){}L.exports=function(u,f){if(!f&&!w)return!1;var o=!1;try{var t=[7],i=t[A]();i.next=function(){return{done:o=!0}},t[A]=function(){return i},u(t)}catch(s){}return o}},{"./_wks":131}],90:[function(_,L,E){L.exports=function(A,w){return{value:w,done:!!A}}},{}],91:[function(_,L,E){L.exports={}},{}],92:[function(_,L,E){L.exports=!0},{}],93:[function(_,L,E){var A=_("./_uid")("meta"),w=_("./_is-object"),v=_("./_has"),u=_("./_object-dp").f,f=0,o=Object.isExtensible||function(){return!0},t=!_("./_fails")(function(){return o(Object.preventExtensions({}))}),i=function(l){u(l,A,{value:{i:"O"+ ++f,w:{}}})},s=function(l,n){if(!w(l))return typeof l=="symbol"?l:(typeof l=="string"?"S":"P")+l;if(!v(l,A)){if(!o(l))return"F";if(!n)return"E";i(l)}return l[A].i},h=function(l,n){if(!v(l,A)){if(!o(l))return!0;if(!n)return!1;i(l)}return l[A].w},a=function(l){return t&&e.NEED&&o(l)&&!v(l,A)&&i(l),l},e=L.exports={KEY:A,NEED:!1,fastKey:s,getWeak:h,onFreeze:a}},{"./_fails":74,"./_has":77,"./_is-object":85,"./_object-dp":98,"./_uid":127}],94:[function(_,L,E){var A=_("./_global"),w=_("./_task").set,v=A.MutationObserver||A.WebKitMutationObserver,u=A.process,f=A.Promise,o=_("./_cof")(u)=="process";L.exports=function(){var t,i,s,h=function(){var n,d;for(o&&(n=u.domain)&&n.exit();t;){d=t.fn,t=t.next;try{d()}catch(c){throw t?s():i=void 0,c}}i=void 0,n&&n.enter()};if(o)s=function(){u.nextTick(h)};else if(!v||A.navigator&&A.navigator.standalone)if(f&&f.resolve){var a=f.resolve(void 0);s=function(){a.then(h)}}else s=function(){w.call(A,h)};else{var e=!0,l=document.createTextNode("");new v(h).observe(l,{characterData:!0}),s=function(){l.data=e=!e}}return function(n){var d={fn:n,next:void 0};i&&(i.next=d),t||(t=d,s()),i=d}}},{"./_cof":64,"./_global":76,"./_task":120}],95:[function(_,L,E){"use strict";function A(v){var u,f;this.promise=new v(function(o,t){if(u!==void 0||f!==void 0)throw TypeError("Bad Promise constructor");u=o,f=t}),this.resolve=w(u),this.reject=w(f)}var w=_("./_a-function");L.exports.f=function(v){return new A(v)}},{"./_a-function":58}],96:[function(_,L,E){"use strict";var A=_("./_object-keys"),w=_("./_object-gops"),v=_("./_object-pie"),u=_("./_to-object"),f=_("./_iobject"),o=Object.assign;L.exports=!o||_("./_fails")(function(){var t={},i={},s=Symbol(),h="abcdefghijklmnopqrst";return t[s]=7,h.split("").forEach(function(a){i[a]=a}),o({},t)[s]!=7||Object.keys(o({},i)).join("")!=h})?function(t,i){for(var s=u(t),h=arguments.length,a=1,e=w.f,l=v.f;h>a;)for(var n,d=f(arguments[a++]),c=e?A(d).concat(e(d)):A(d),g=c.length,p=0;g>p;)l.call(d,n=c[p++])&&(s[n]=d[n]);return s}:o},{"./_fails":74,"./_iobject":82,"./_object-gops":103,"./_object-keys":106,"./_object-pie":107,"./_to-object":125}],97:[function(_,L,E){var A=_("./_an-object"),w=_("./_object-dps"),v=_("./_enum-bug-keys"),u=_("./_shared-key")("IE_PROTO"),f=function(){},o=function(){var t,i=_("./_dom-create")("iframe"),s=v.length;for(i.style.display="none",_("./_html").appendChild(i),i.src="javascript:",t=i.contentWindow.document,t.open(),t.write("<script>document.F=Object</script>"),t.close(),o=t.F;s--;)delete o.prototype[v[s]];return o()};L.exports=Object.create||function(t,i){var s;return t!==null?(f.prototype=A(t),s=new f,f.prototype=null,s[u]=t):s=o(),i===void 0?s:w(s,i)}},{"./_an-object":61,"./_dom-create":70,"./_enum-bug-keys":71,"./_html":79,"./_object-dps":99,"./_shared-key":116}],98:[function(_,L,E){var A=_("./_an-object"),w=_("./_ie8-dom-define"),v=_("./_to-primitive"),u=Object.defineProperty;E.f=_("./_descriptors")?Object.defineProperty:function(f,o,t){if(A(f),o=v(o,!0),A(t),w)try{return u(f,o,t)}catch(i){}if("get"in t||"set"in t)throw TypeError("Accessors not supported!");return"value"in t&&(f[o]=t.value),f}},{"./_an-object":61,"./_descriptors":69,"./_ie8-dom-define":80,"./_to-primitive":126}],99:[function(_,L,E){var A=_("./_object-dp"),w=_("./_an-object"),v=_("./_object-keys");L.exports=_("./_descriptors")?Object.defineProperties:function(u,f){w(u);for(var o,t=v(f),i=t.length,s=0;i>s;)A.f(u,o=t[s++],f[o]);return u}},{"./_an-object":61,"./_descriptors":69,"./_object-dp":98,"./_object-keys":106}],100:[function(_,L,E){var A=_("./_object-pie"),w=_("./_property-desc"),v=_("./_to-iobject"),u=_("./_to-primitive"),f=_("./_has"),o=_("./_ie8-dom-define"),t=Object.getOwnPropertyDescriptor;E.f=_("./_descriptors")?t:function(i,s){if(i=v(i),s=u(s,!0),o)try{return t(i,s)}catch(h){}if(f(i,s))return w(!A.f.call(i,s),i[s])}},{"./_descriptors":69,"./_has":77,"./_ie8-dom-define":80,"./_object-pie":107,"./_property-desc":111,"./_to-iobject":123,"./_to-primitive":126}],101:[function(_,L,E){var A=_("./_to-iobject"),w=_("./_object-gopn").f,v={}.toString,u=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],f=function(o){try{return w(o)}catch(t){return u.slice()}};L.exports.f=function(o){return u&&v.call(o)=="[object Window]"?f(o):w(A(o))}},{"./_object-gopn":102,"./_to-iobject":123}],102:[function(_,L,E){var A=_("./_object-keys-internal"),w=_("./_enum-bug-keys").concat("length","prototype");E.f=Object.getOwnPropertyNames||function(v){return A(v,w)}},{"./_enum-bug-keys":71,"./_object-keys-internal":105}],103:[function(_,L,E){E.f=Object.getOwnPropertySymbols},{}],104:[function(_,L,E){var A=_("./_has"),w=_("./_to-object"),v=_("./_shared-key")("IE_PROTO"),u=Object.prototype;L.exports=Object.getPrototypeOf||function(f){return f=w(f),A(f,v)?f[v]:typeof f.constructor=="function"&&f instanceof f.constructor?f.constructor.prototype:f instanceof Object?u:null}},{"./_has":77,"./_shared-key":116,"./_to-object":125}],105:[function(_,L,E){var A=_("./_has"),w=_("./_to-iobject"),v=_("./_array-includes")(!1),u=_("./_shared-key")("IE_PROTO");L.exports=function(f,o){var t,i=w(f),s=0,h=[];for(t in i)t!=u&&A(i,t)&&h.push(t);for(;o.length>s;)A(i,t=o[s++])&&(~v(h,t)||h.push(t));return h}},{"./_array-includes":62,"./_has":77,"./_shared-key":116,"./_to-iobject":123}],106:[function(_,L,E){var A=_("./_object-keys-internal"),w=_("./_enum-bug-keys");L.exports=Object.keys||function(v){return A(v,w)}},{"./_enum-bug-keys":71,"./_object-keys-internal":105}],107:[function(_,L,E){E.f={}.propertyIsEnumerable},{}],108:[function(_,L,E){var A=_("./_export"),w=_("./_core"),v=_("./_fails");L.exports=function(u,f){var o=(w.Object||{})[u]||Object[u],t={};t[u]=f(o),A(A.S+A.F*v(function(){o(1)}),"Object",t)}},{"./_core":65,"./_export":73,"./_fails":74}],109:[function(_,L,E){L.exports=function(A){try{return{e:!1,v:A()}}catch(w){return{e:!0,v:w}}}},{}],110:[function(_,L,E){var A=_("./_an-object"),w=_("./_is-object"),v=_("./_new-promise-capability");L.exports=function(u,f){if(A(u),w(f)&&f.constructor===u)return f;var o=v.f(u);return(0,o.resolve)(f),o.promise}},{"./_an-object":61,"./_is-object":85,"./_new-promise-capability":95}],111:[function(_,L,E){L.exports=function(A,w){return{enumerable:!(1&A),configurable:!(2&A),writable:!(4&A),value:w}}},{}],112:[function(_,L,E){var A=_("./_hide");L.exports=function(w,v,u){for(var f in v)u&&w[f]?w[f]=v[f]:A(w,f,v[f]);return w}},{"./_hide":78}],113:[function(_,L,E){L.exports=_("./_hide")},{"./_hide":78}],114:[function(_,L,E){"use strict";var A=_("./_global"),w=_("./_core"),v=_("./_object-dp"),u=_("./_descriptors"),f=_("./_wks")("species");L.exports=function(o){var t=typeof w[o]=="function"?w[o]:A[o];u&&t&&!t[f]&&v.f(t,f,{configurable:!0,get:function(){return this}})}},{"./_core":65,"./_descriptors":69,"./_global":76,"./_object-dp":98,"./_wks":131}],115:[function(_,L,E){var A=_("./_object-dp").f,w=_("./_has"),v=_("./_wks")("toStringTag");L.exports=function(u,f,o){u&&!w(u=o?u:u.prototype,v)&&A(u,v,{configurable:!0,value:f})}},{"./_has":77,"./_object-dp":98,"./_wks":131}],116:[function(_,L,E){var A=_("./_shared")("keys"),w=_("./_uid");L.exports=function(v){return A[v]||(A[v]=w(v))}},{"./_shared":117,"./_uid":127}],117:[function(_,L,E){var A=_("./_core"),w=_("./_global"),v=w["__core-js_shared__"]||(w["__core-js_shared__"]={});(L.exports=function(u,f){return v[u]||(v[u]=f!==void 0?f:{})})("versions",[]).push({version:A.version,mode:_("./_library")?"pure":"global",copyright:"\u6F0F 2018 Denis Pushkarev (zloirock.ru)"})},{"./_core":65,"./_global":76,"./_library":92}],118:[function(_,L,E){var A=_("./_an-object"),w=_("./_a-function"),v=_("./_wks")("species");L.exports=function(u,f){var o,t=A(u).constructor;return t===void 0||(o=A(t)[v])==null?f:w(o)}},{"./_a-function":58,"./_an-object":61,"./_wks":131}],119:[function(_,L,E){var A=_("./_to-integer"),w=_("./_defined");L.exports=function(v){return function(u,f){var o,t,i=String(w(u)),s=A(f),h=i.length;return s<0||s>=h?v?"":void 0:(o=i.charCodeAt(s),o<55296||o>56319||s+1===h||(t=i.charCodeAt(s+1))<56320||t>57343?v?i.charAt(s):o:v?i.slice(s,s+2):t-56320+(o-55296<<10)+65536)}}},{"./_defined":68,"./_to-integer":122}],120:[function(_,L,E){var A,w,v,u=_("./_ctx"),f=_("./_invoke"),o=_("./_html"),t=_("./_dom-create"),i=_("./_global"),s=i.process,h=i.setImmediate,a=i.clearImmediate,e=i.MessageChannel,l=i.Dispatch,n=0,d={},c=function(){var p=+this;if(d.hasOwnProperty(p)){var m=d[p];delete d[p],m()}},g=function(p){c.call(p.data)};h&&a||(h=function(p){for(var m=[],b=1;arguments.length>b;)m.push(arguments[b++]);return d[++n]=function(){f(typeof p=="function"?p:Function(p),m)},A(n),n},a=function(p){delete d[p]},_("./_cof")(s)=="process"?A=function(p){s.nextTick(u(c,p,1))}:l&&l.now?A=function(p){l.now(u(c,p,1))}:e?(w=new e,v=w.port2,w.port1.onmessage=g,A=u(v.postMessage,v,1)):i.addEventListener&&typeof postMessage=="function"&&!i.importScripts?(A=function(p){i.postMessage(p+"","*")},i.addEventListener("message",g,!1)):A="onreadystatechange"in t("script")?function(p){o.appendChild(t("script")).onreadystatechange=function(){o.removeChild(this),c.call(p)}}:function(p){setTimeout(u(c,p,1),0)}),L.exports={set:h,clear:a}},{"./_cof":64,"./_ctx":67,"./_dom-create":70,"./_global":76,"./_html":79,"./_invoke":81}],121:[function(_,L,E){var A=_("./_to-integer"),w=Math.max,v=Math.min;L.exports=function(u,f){return u=A(u),u<0?w(u+f,0):v(u,f)}},{"./_to-integer":122}],122:[function(_,L,E){var A=Math.ceil,w=Math.floor;L.exports=function(v){return isNaN(v=+v)?0:(v>0?w:A)(v)}},{}],123:[function(_,L,E){var A=_("./_iobject"),w=_("./_defined");L.exports=function(v){return A(w(v))}},{"./_defined":68,"./_iobject":82}],124:[function(_,L,E){var A=_("./_to-integer"),w=Math.min;L.exports=function(v){return v>0?w(A(v),9007199254740991):0}},{"./_to-integer":122}],125:[function(_,L,E){var A=_("./_defined");L.exports=function(w){return Object(A(w))}},{"./_defined":68}],126:[function(_,L,E){var A=_("./_is-object");L.exports=function(w,v){if(!A(w))return w;var u,f;if(v&&typeof(u=w.toString)=="function"&&!A(f=u.call(w)))return f;if(typeof(u=w.valueOf)=="function"&&!A(f=u.call(w)))return f;if(!v&&typeof(u=w.toString)=="function"&&!A(f=u.call(w)))return f;throw TypeError("Can't convert object to primitive value")}},{"./_is-object":85}],127:[function(_,L,E){var A=0,w=Math.random();L.exports=function(v){return"Symbol(".concat(v===void 0?"":v,")_",(++A+w).toString(36))}},{}],128:[function(_,L,E){var A=_("./_global"),w=A.navigator;L.exports=w&&w.userAgent||""},{"./_global":76}],129:[function(_,L,E){var A=_("./_global"),w=_("./_core"),v=_("./_library"),u=_("./_wks-ext"),f=_("./_object-dp").f;L.exports=function(o){var t=w.Symbol||(w.Symbol=v?{}:A.Symbol||{});o.charAt(0)=="_"||o in t||f(t,o,{value:u.f(o)})}},{"./_core":65,"./_global":76,"./_library":92,"./_object-dp":98,"./_wks-ext":130}],130:[function(_,L,E){E.f=_("./_wks")},{"./_wks":131}],131:[function(_,L,E){var A=_("./_shared")("wks"),w=_("./_uid"),v=_("./_global").Symbol,u=typeof v=="function";(L.exports=function(f){return A[f]||(A[f]=u&&v[f]||(u?v:w)("Symbol."+f))}).store=A},{"./_global":76,"./_shared":117,"./_uid":127}],132:[function(_,L,E){var A=_("./_classof"),w=_("./_wks")("iterator"),v=_("./_iterators");L.exports=_("./_core").getIteratorMethod=function(u){if(u!=null)return u[w]||u["@@iterator"]||v[A(u)]}},{"./_classof":63,"./_core":65,"./_iterators":91,"./_wks":131}],133:[function(_,L,E){"use strict";var A=_("./_ctx"),w=_("./_export"),v=_("./_to-object"),u=_("./_iter-call"),f=_("./_is-array-iter"),o=_("./_to-length"),t=_("./_create-property"),i=_("./core.get-iterator-method");w(w.S+w.F*!_("./_iter-detect")(function(s){Array.from(s)}),"Array",{from:function(s){var h,a,e,l,n=v(s),d=typeof this=="function"?this:Array,c=arguments.length,g=c>1?arguments[1]:void 0,p=g!==void 0,m=0,b=i(n);if(p&&(g=A(g,c>2?arguments[2]:void 0,2)),b==null||d==Array&&f(b))for(h=o(n.length),a=new d(h);h>m;m++)t(a,m,p?g(n[m],m):n[m]);else for(l=b.call(n),a=new d;!(e=l.next()).done;m++)t(a,m,p?u(l,g,[e.value,m],!0):e.value);return a.length=m,a}})},{"./_create-property":66,"./_ctx":67,"./_export":73,"./_is-array-iter":83,"./_iter-call":86,"./_iter-detect":89,"./_to-length":124,"./_to-object":125,"./core.get-iterator-method":132}],134:[function(_,L,E){"use strict";var A=_("./_add-to-unscopables"),w=_("./_iter-step"),v=_("./_iterators"),u=_("./_to-iobject");L.exports=_("./_iter-define")(Array,"Array",function(f,o){this._t=u(f),this._i=0,this._k=o},function(){var f=this._t,o=this._k,t=this._i++;return!f||t>=f.length?(this._t=void 0,w(1)):o=="keys"?w(0,t):o=="values"?w(0,f[t]):w(0,[t,f[t]])},"values"),v.Arguments=v.Array,A("keys"),A("values"),A("entries")},{"./_add-to-unscopables":59,"./_iter-define":88,"./_iter-step":90,"./_iterators":91,"./_to-iobject":123}],135:[function(_,L,E){"use strict";var A=_("./_is-object"),w=_("./_object-gpo"),v=_("./_wks")("hasInstance"),u=Function.prototype;v in u||_("./_object-dp").f(u,v,{value:function(f){if(typeof this!="function"||!A(f))return!1;if(!A(this.prototype))return f instanceof this;for(;f=w(f);)if(this.prototype===f)return!0;return!1}})},{"./_is-object":85,"./_object-dp":98,"./_object-gpo":104,"./_wks":131}],136:[function(_,L,E){var A=_("./_export");A(A.S+A.F,"Object",{assign:_("./_object-assign")})},{"./_export":73,"./_object-assign":96}],137:[function(_,L,E){var A=_("./_export");A(A.S,"Object",{create:_("./_object-create")})},{"./_export":73,"./_object-create":97}],138:[function(_,L,E){var A=_("./_export");A(A.S+A.F*!_("./_descriptors"),"Object",{defineProperty:_("./_object-dp").f})},{"./_descriptors":69,"./_export":73,"./_object-dp":98}],139:[function(_,L,E){_("./_object-sap")("getOwnPropertyNames",function(){return _("./_object-gopn-ext").f})},{"./_object-gopn-ext":101,"./_object-sap":108}],140:[function(_,L,E){var A=_("./_to-object"),w=_("./_object-gpo");_("./_object-sap")("getPrototypeOf",function(){return function(v){return w(A(v))}})},{"./_object-gpo":104,"./_object-sap":108,"./_to-object":125}],141:[function(_,L,E){var A=_("./_to-object"),w=_("./_object-keys");_("./_object-sap")("keys",function(){return function(v){return w(A(v))}})},{"./_object-keys":106,"./_object-sap":108,"./_to-object":125}],142:[function(_,L,E){arguments[4][36][0].apply(E,arguments)},{dup:36}],143:[function(_,L,E){"use strict";var A,w,v,u,f=_("./_library"),o=_("./_global"),t=_("./_ctx"),i=_("./_classof"),s=_("./_export"),h=_("./_is-object"),a=_("./_a-function"),e=_("./_an-instance"),l=_("./_for-of"),n=_("./_species-constructor"),d=_("./_task").set,c=_("./_microtask")(),g=_("./_new-promise-capability"),p=_("./_perform"),m=_("./_user-agent"),b=_("./_promise-resolve"),y=o.TypeError,r=o.process,x=r&&r.versions,S=x&&x.v8||"",T=o.Promise,R=i(r)=="process",D=function(){},k=w=g.f,B=!!function(){try{var q=T.resolve(1),ee=(q.constructor={})[_("./_wks")("species")]=function(fe){fe(D,D)};return(R||typeof PromiseRejectionEvent=="function")&&q.then(D)instanceof ee&&S.indexOf("6.6")!==0&&m.indexOf("Chrome/66")===-1}catch(fe){}}(),G=function(q){var ee;return!(!h(q)||typeof(ee=q.then)!="function")&&ee},P=function(q,ee){if(!q._n){q._n=!0;var fe=q._c;c(function(){for(var oe=q._v,he=q._s==1,se=0;fe.length>se;)!function(ge){var ie,re,Q,pe=he?ge.ok:ge.fail,ne=ge.resolve,J=ge.reject,be=ge.domain;try{pe?(he||(q._h==2&&z(q),q._h=1),pe===!0?ie=oe:(be&&be.enter(),ie=pe(oe),be&&(be.exit(),Q=!0)),ie===ge.promise?J(y("Promise-chain cycle")):(re=G(ie))?re.call(ie,ne,J):ne(ie)):J(oe)}catch(Ee){be&&!Q&&be.exit(),J(Ee)}}(fe[se++]);q._c=[],q._n=!1,ee&&!q._h&&$(q)})}},$=function(q){d.call(o,function(){var ee,fe,oe,he=q._v,se=X(q);if(se&&(ee=p(function(){R?r.emit("unhandledRejection",he,q):(fe=o.onunhandledrejection)?fe({promise:q,reason:he}):(oe=o.console)&&oe.error&&oe.error("Unhandled promise rejection",he)}),q._h=R||X(q)?2:1),q._a=void 0,se&&ee.e)throw ee.v})},X=function(q){return q._h!==1&&(q._a||q._c).length===0},z=function(q){d.call(o,function(){var ee;R?r.emit("rejectionHandled",q):(ee=o.onrejectionhandled)&&ee({promise:q,reason:q._v})})},N=function(q){var ee=this;ee._d||(ee._d=!0,ee=ee._w||ee,ee._v=q,ee._s=2,ee._a||(ee._a=ee._c.slice()),P(ee,!0))},H=function(q){var ee,fe=this;if(!fe._d){fe._d=!0,fe=fe._w||fe;try{if(fe===q)throw y("Promise can't be resolved itself");(ee=G(q))?c(function(){var oe={_w:fe,_d:!1};try{ee.call(q,t(H,oe,1),t(N,oe,1))}catch(he){N.call(oe,he)}}):(fe._v=q,fe._s=1,P(fe,!1))}catch(oe){N.call({_w:fe,_d:!1},oe)}}};B||(T=function(q){e(this,T,"Promise","_h"),a(q),A.call(this);try{q(t(H,this,1),t(N,this,1))}catch(ee){N.call(this,ee)}},A=function(q){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},A.prototype=_("./_redefine-all")(T.prototype,{then:function(q,ee){var fe=k(n(this,T));return fe.ok=typeof q!="function"||q,fe.fail=typeof ee=="function"&&ee,fe.domain=R?r.domain:void 0,this._c.push(fe),this._a&&this._a.push(fe),this._s&&P(this,!1),fe.promise},catch:function(q){return this.then(void 0,q)}}),v=function(){var q=new A;this.promise=q,this.resolve=t(H,q,1),this.reject=t(N,q,1)},g.f=k=function(q){return q===T||q===u?new v(q):w(q)}),s(s.G+s.W+s.F*!B,{Promise:T}),_("./_set-to-string-tag")(T,"Promise"),_("./_set-species")("Promise"),u=_("./_core").Promise,s(s.S+s.F*!B,"Promise",{reject:function(q){var ee=k(this);return(0,ee.reject)(q),ee.promise}}),s(s.S+s.F*(f||!B),"Promise",{resolve:function(q){return b(f&&this===u?T:this,q)}}),s(s.S+s.F*!(B&&_("./_iter-detect")(function(q){T.all(q).catch(D)})),"Promise",{all:function(q){var ee=this,fe=k(ee),oe=fe.resolve,he=fe.reject,se=p(function(){var ge=[],ie=0,re=1;l(q,!1,function(Q){var pe=ie++,ne=!1;ge.push(void 0),re++,ee.resolve(Q).then(function(J){ne||(ne=!0,ge[pe]=J,--re||oe(ge))},he)}),--re||oe(ge)});return se.e&&he(se.v),fe.promise},race:function(q){var ee=this,fe=k(ee),oe=fe.reject,he=p(function(){l(q,!1,function(se){ee.resolve(se).then(fe.resolve,oe)})});return he.e&&oe(he.v),fe.promise}})},{"./_a-function":58,"./_an-instance":60,"./_classof":63,"./_core":65,"./_ctx":67,"./_export":73,"./_for-of":75,"./_global":76,"./_is-object":85,"./_iter-detect":89,"./_library":92,"./_microtask":94,"./_new-promise-capability":95,"./_perform":109,"./_promise-resolve":110,"./_redefine-all":112,"./_set-species":114,"./_set-to-string-tag":115,"./_species-constructor":118,"./_task":120,"./_user-agent":128,"./_wks":131}],144:[function(_,L,E){var A=_("./_export"),w=_("./_to-absolute-index"),v=String.fromCharCode,u=String.fromCodePoint;A(A.S+A.F*(!!u&&u.length!=1),"String",{fromCodePoint:function(f){for(var o,t=[],i=arguments.length,s=0;i>s;){if(o=+arguments[s++],w(o,1114111)!==o)throw RangeError(o+" is not a valid code point");t.push(o<65536?v(o):v(55296+((o-=65536)>>10),o%1024+56320))}return t.join("")}})},{"./_export":73,"./_to-absolute-index":121}],145:[function(_,L,E){"use strict";var A=_("./_string-at")(!0);_("./_iter-define")(String,"String",function(w){this._t=String(w),this._i=0},function(){var w,v=this._t,u=this._i;return u>=v.length?{value:void 0,done:!0}:(w=A(v,u),this._i+=w.length,{value:w,done:!1})})},{"./_iter-define":88,"./_string-at":119}],146:[function(_,L,E){"use strict";var A=_("./_global"),w=_("./_has"),v=_("./_descriptors"),u=_("./_export"),f=_("./_redefine"),o=_("./_meta").KEY,t=_("./_fails"),i=_("./_shared"),s=_("./_set-to-string-tag"),h=_("./_uid"),a=_("./_wks"),e=_("./_wks-ext"),l=_("./_wks-define"),n=_("./_enum-keys"),d=_("./_is-array"),c=_("./_an-object"),g=_("./_is-object"),p=_("./_to-iobject"),m=_("./_to-primitive"),b=_("./_property-desc"),y=_("./_object-create"),r=_("./_object-gopn-ext"),x=_("./_object-gopd"),S=_("./_object-dp"),T=_("./_object-keys"),R=x.f,D=S.f,k=r.f,B=A.Symbol,G=A.JSON,P=G&&G.stringify,$=a("_hidden"),X=a("toPrimitive"),z={}.propertyIsEnumerable,N=i("symbol-registry"),H=i("symbols"),q=i("op-symbols"),ee=Object.prototype,fe=typeof B=="function",oe=A.QObject,he=!oe||!oe.prototype||!oe.prototype.findChild,se=v&&t(function(){return y(D({},"a",{get:function(){return D(this,"a",{value:7}).a}})).a!=7})?function(j,M,F){var ae=R(ee,M);ae&&delete ee[M],D(j,M,F),ae&&j!==ee&&D(ee,M,ae)}:D,ge=function(j){var M=H[j]=y(B.prototype);return M._k=j,M},ie=fe&&typeof B.iterator=="symbol"?function(j){return typeof j=="symbol"}:function(j){return j instanceof B},re=function(j,M,F){return j===ee&&re(q,M,F),c(j),M=m(M,!0),c(F),w(H,M)?(F.enumerable?(w(j,$)&&j[$][M]&&(j[$][M]=!1),F=y(F,{enumerable:b(0,!1)})):(w(j,$)||D(j,$,b(1,{})),j[$][M]=!0),se(j,M,F)):D(j,M,F)},Q=function(j,M){c(j);for(var F,ae=n(M=p(M)),ve=0,Pe=ae.length;Pe>ve;)re(j,F=ae[ve++],M[F]);return j},pe=function(j,M){return M===void 0?y(j):Q(y(j),M)},ne=function(j){var M=z.call(this,j=m(j,!0));return!(this===ee&&w(H,j)&&!w(q,j))&&(!(M||!w(this,j)||!w(H,j)||w(this,$)&&this[$][j])||M)},J=function(j,M){if(j=p(j),M=m(M,!0),j!==ee||!w(H,M)||w(q,M)){var F=R(j,M);return!F||!w(H,M)||w(j,$)&&j[$][M]||(F.enumerable=!0),F}},be=function(j){for(var M,F=k(p(j)),ae=[],ve=0;F.length>ve;)w(H,M=F[ve++])||M==$||M==o||ae.push(M);return ae},Ee=function(j){for(var M,F=j===ee,ae=k(F?q:p(j)),ve=[],Pe=0;ae.length>Pe;)!w(H,M=ae[Pe++])||F&&!w(ee,M)||ve.push(H[M]);return ve};fe||(B=function(){if(this instanceof B)throw TypeError("Symbol is not a constructor!");var j=h(arguments.length>0?arguments[0]:void 0),M=function(F){this===ee&&M.call(q,F),w(this,$)&&w(this[$],j)&&(this[$][j]=!1),se(this,j,b(1,F))};return v&&he&&se(ee,j,{configurable:!0,set:M}),ge(j)},f(B.prototype,"toString",function(){return this._k}),x.f=J,S.f=re,_("./_object-gopn").f=r.f=be,_("./_object-pie").f=ne,_("./_object-gops").f=Ee,v&&!_("./_library")&&f(ee,"propertyIsEnumerable",ne,!0),e.f=function(j){return ge(a(j))}),u(u.G+u.W+u.F*!fe,{Symbol:B});for(var Le="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),V=0;Le.length>V;)a(Le[V++]);for(var C=T(a.store),O=0;C.length>O;)l(C[O++]);u(u.S+u.F*!fe,"Symbol",{for:function(j){return w(N,j+="")?N[j]:N[j]=B(j)},keyFor:function(j){if(!ie(j))throw TypeError(j+" is not a symbol!");for(var M in N)if(N[M]===j)return M},useSetter:function(){he=!0},useSimple:function(){he=!1}}),u(u.S+u.F*!fe,"Object",{create:pe,defineProperty:re,defineProperties:Q,getOwnPropertyDescriptor:J,getOwnPropertyNames:be,getOwnPropertySymbols:Ee}),G&&u(u.S+u.F*(!fe||t(function(){var j=B();return P([j])!="[null]"||P({a:j})!="{}"||P(Object(j))!="{}"})),"JSON",{stringify:function(j){for(var M,F,ae=[j],ve=1;arguments.length>ve;)ae.push(arguments[ve++]);if(F=M=ae[1],(g(M)||j!==void 0)&&!ie(j))return d(M)||(M=function(Pe,Oe){if(typeof F=="function"&&(Oe=F.call(this,Pe,Oe)),!ie(Oe))return Oe}),ae[1]=M,P.apply(G,ae)}}),B.prototype[X]||_("./_hide")(B.prototype,X,B.prototype.valueOf),s(B,"Symbol"),s(Math,"Math",!0),s(A.JSON,"JSON",!0)},{"./_an-object":61,"./_descriptors":69,"./_enum-keys":72,"./_export":73,"./_fails":74,"./_global":76,"./_has":77,"./_hide":78,"./_is-array":84,"./_is-object":85,"./_library":92,"./_meta":93,"./_object-create":97,"./_object-dp":98,"./_object-gopd":100,"./_object-gopn":102,"./_object-gopn-ext":101,"./_object-gops":103,"./_object-keys":106,"./_object-pie":107,"./_property-desc":111,"./_redefine":113,"./_set-to-string-tag":115,"./_shared":117,"./_to-iobject":123,"./_to-primitive":126,"./_uid":127,"./_wks":131,"./_wks-define":129,"./_wks-ext":130}],147:[function(_,L,E){"use strict";var A=_("./_export"),w=_("./_core"),v=_("./_global"),u=_("./_species-constructor"),f=_("./_promise-resolve");A(A.P+A.R,"Promise",{finally:function(o){var t=u(this,w.Promise||v.Promise),i=typeof o=="function";return this.then(i?function(s){return f(t,o()).then(function(){return s})}:o,i?function(s){return f(t,o()).then(function(){throw s})}:o)}})},{"./_core":65,"./_export":73,"./_global":76,"./_promise-resolve":110,"./_species-constructor":118}],148:[function(_,L,E){"use strict";var A=_("./_export"),w=_("./_new-promise-capability"),v=_("./_perform");A(A.S,"Promise",{try:function(u){var f=w.f(this),o=v(u);return(o.e?f.reject:f.resolve)(o.v),f.promise}})},{"./_export":73,"./_new-promise-capability":95,"./_perform":109}],149:[function(_,L,E){_("./_wks-define")("asyncIterator")},{"./_wks-define":129}],150:[function(_,L,E){_("./_wks-define")("observable")},{"./_wks-define":129}],151:[function(_,L,E){_("./es6.array.iterator");for(var A=_("./_global"),w=_("./_hide"),v=_("./_iterators"),u=_("./_wks")("toStringTag"),f="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),o=0;o<f.length;o++){var t=f[o],i=A[t],s=i&&i.prototype;s&&!s[u]&&w(s,u,t),v[t]=v.Array}},{"./_global":76,"./_hide":78,"./_iterators":91,"./_wks":131,"./es6.array.iterator":134}],152:[function(_,L,E){var A=_("./_export"),w=_("./_task");A(A.G+A.B,{setImmediate:w.set,clearImmediate:w.clear})},{"./_export":73,"./_task":120}],153:[function(_,L,E){(function(A){"use strict";function w(m){return Array.isArray?Array.isArray(m):c(m)==="[object Array]"}function v(m){return typeof m=="boolean"}function u(m){return m===null}function f(m){return m==null}function o(m){return typeof m=="number"}function t(m){return typeof m=="string"}function i(m){return(m===void 0?"undefined":(0,p.default)(m))==="symbol"}function s(m){return m===void 0}function h(m){return c(m)==="[object RegExp]"}function a(m){return(m===void 0?"undefined":(0,p.default)(m))==="object"&&m!==null}function e(m){return c(m)==="[object Date]"}function l(m){return c(m)==="[object Error]"||m instanceof Error}function n(m){return typeof m=="function"}function d(m){return m===null||typeof m=="boolean"||typeof m=="number"||typeof m=="string"||(m===void 0?"undefined":(0,p.default)(m))==="symbol"||m===void 0}function c(m){return Object.prototype.toString.call(m)}var g=_("babel-runtime/helpers/typeof"),p=function(m){return m&&m.__esModule?m:{default:m}}(g);E.isArray=w,E.isBoolean=v,E.isNull=u,E.isNullOrUndefined=f,E.isNumber=o,E.isString=t,E.isSymbol=i,E.isUndefined=s,E.isRegExp=h,E.isObject=a,E.isDate=e,E.isError=l,E.isFunction=n,E.isPrimitive=d,E.isBuffer=A.isBuffer}).call(this,{isBuffer:_("../../is-buffer/index.js")})},{"../../is-buffer/index.js":163,"babel-runtime/helpers/typeof":32}],154:[function(_,L,E){"use strict";var A=_("babel-runtime/helpers/typeof"),w=function(v){return v&&v.__esModule?v:{default:v}}(A);!function(v){function u(s,h){for(s=String(s),h=h||2;s.length<h;)s="0"+s;return s}function f(s){var h=new Date(s.getFullYear(),s.getMonth(),s.getDate());h.setDate(h.getDate()-(h.getDay()+6)%7+3);var a=new Date(h.getFullYear(),0,4);a.setDate(a.getDate()-(a.getDay()+6)%7+3);var e=h.getTimezoneOffset()-a.getTimezoneOffset();h.setHours(h.getHours()-e);var l=(h-a)/6048e5;return 1+Math.floor(l)}function o(s){var h=s.getDay();return h===0&&(h=7),h}function t(s){return s===null?"null":s===void 0?"undefined":(s===void 0?"undefined":(0,w.default)(s))!=="object"?s===void 0?"undefined":(0,w.default)(s):Array.isArray(s)?"array":{}.toString.call(s).slice(8,-1).toLowerCase()}var i=function(){var s=/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZWN]|'[^']*'|'[^']*'/g,h=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,a=/[^-+\dA-Z]/g;return function(e,l,n,d){if(arguments.length!==1||t(e)!=="string"||/\d/.test(e)||(l=e,e=void 0),e=e||new Date,e instanceof Date||(e=new Date(e)),isNaN(e))throw TypeError("Invalid date");l=String(i.masks[l]||l||i.masks.default);var c=l.slice(0,4);c!=="UTC:"&&c!=="GMT:"||(l=l.slice(4),n=!0,c==="GMT:"&&(d=!0));var g=n?"getUTC":"get",p=e[g+"Date"](),m=e[g+"Day"](),b=e[g+"Month"](),y=e[g+"FullYear"](),r=e[g+"Hours"](),x=e[g+"Minutes"](),S=e[g+"Seconds"](),T=e[g+"Milliseconds"](),R=n?0:e.getTimezoneOffset(),D=f(e),k=o(e),B={d:p,dd:u(p),ddd:i.i18n.dayNames[m],dddd:i.i18n.dayNames[m+7],m:b+1,mm:u(b+1),mmm:i.i18n.monthNames[b],mmmm:i.i18n.monthNames[b+12],yy:String(y).slice(2),yyyy:y,h:r%12||12,hh:u(r%12||12),H:r,HH:u(r),M:x,MM:u(x),s:S,ss:u(S),l:u(T,3),L:u(Math.round(T/10)),t:r<12?"a":"p",tt:r<12?"am":"pm",T:r<12?"A":"P",TT:r<12?"AM":"PM",Z:d?"GMT":n?"UTC":(String(e).match(h)||[""]).pop().replace(a,""),o:(R>0?"-":"+")+u(100*Math.floor(Math.abs(R)/60)+Math.abs(R)%60,4),S:["th","st","nd","rd"][p%10>3?0:(p%100-p%10!=10)*p%10],W:D,N:k};return l.replace(s,function(G){return G in B?B[G]:G.slice(1,G.length-1)})}}();i.masks={default:"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:sso",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'",expiresHeaderFormat:"ddd, dd mmm yyyy HH:MM:ss Z"},i.i18n={dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"]},typeof U=="function"&&U.amd?U(function(){return i}):(E===void 0?"undefined":(0,w.default)(E))==="object"?L.exports=i:v.dateFormat=i}(void 0)},{"babel-runtime/helpers/typeof":32}],155:[function(_,L,E){(function(A){function w(){return!(typeof window=="undefined"||!window.process||window.process.type!=="renderer")||typeof document!="undefined"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window!="undefined"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function v(t){var i=this.useColors;if(t[0]=(i?"%c":"")+this.namespace+(i?" %c":" ")+t[0]+(i?"%c ":" ")+"+"+E.humanize(this.diff),i){var s="color: "+this.color;t.splice(1,0,s,"color: inherit");var h=0,a=0;t[0].replace(/%[a-zA-Z%]/g,function(e){e!=="%%"&&(h++,e==="%c"&&(a=h))}),t.splice(a,0,s)}}function u(){return typeof console=="object"&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function f(t){try{t==null?E.storage.removeItem("debug"):E.storage.debug=t}catch(i){}}function o(){var t;try{t=E.storage.debug}catch(i){}return!t&&A!==void 0&&"env"in A&&(t=A.env.DEBUG),t}E=L.exports=_("./debug"),E.log=u,E.formatArgs=v,E.save=f,E.load=o,E.useColors=w,E.storage=typeof chrome!="undefined"&&chrome.storage!==void 0?chrome.storage.local:function(){try{return window.localStorage}catch(t){}}(),E.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],E.formatters.j=function(t){try{return JSON.stringify(t)}catch(i){return"[UnexpectedJSONParseError]: "+i.message}},E.enable(o())}).call(this,_("_process"))},{"./debug":156,_process:173}],156:[function(_,L,E){function A(i){var s,h=0;for(s in i)h=(h<<5)-h+i.charCodeAt(s),h|=0;return E.colors[Math.abs(h)%E.colors.length]}function w(i){function s(){if(s.enabled){var h=s,a=+new Date,e=a-(t||a);h.diff=e,h.prev=t,h.curr=a,t=a;for(var l=new Array(arguments.length),n=0;n<l.length;n++)l[n]=arguments[n];l[0]=E.coerce(l[0]),typeof l[0]!="string"&&l.unshift("%O");var d=0;l[0]=l[0].replace(/%([a-zA-Z%])/g,function(c,g){if(c==="%%")return c;d++;var p=E.formatters[g];if(typeof p=="function"){var m=l[d];c=p.call(h,m),l.splice(d,1),d--}return c}),E.formatArgs.call(h,l),(s.log||E.log||console.log.bind(console)).apply(h,l)}}return s.namespace=i,s.enabled=E.enabled(i),s.useColors=E.useColors(),s.color=A(i),typeof E.init=="function"&&E.init(s),s}function v(i){E.save(i),E.names=[],E.skips=[];for(var s=(typeof i=="string"?i:"").split(/[\s,]+/),h=s.length,a=0;a<h;a++)s[a]&&(i=s[a].replace(/\*/g,".*?"),i[0]==="-"?E.skips.push(new RegExp("^"+i.substr(1)+"$")):E.names.push(new RegExp("^"+i+"$")))}function u(){E.enable("")}function f(i){var s,h;for(s=0,h=E.skips.length;s<h;s++)if(E.skips[s].test(i))return!1;for(s=0,h=E.names.length;s<h;s++)if(E.names[s].test(i))return!0;return!1}function o(i){return i instanceof Error?i.stack||i.message:i}E=L.exports=w.debug=w.default=w,E.coerce=o,E.disable=u,E.enable=v,E.enabled=f,E.humanize=_("ms"),E.names=[],E.skips=[],E.formatters={};var t},{ms:169}],157:[function(_,L,E){"use strict";function A(v){var u=""+v,f=w.exec(u);if(!f)return u;var o,t="",i=0,s=0;for(i=f.index;i<u.length;i++){switch(u.charCodeAt(i)){case 34:o=""";break;case 38:o="&";break;case 39:o="'";break;case 60:o="<";break;case 62:o=">";break;default:continue}s!==i&&(t+=u.substring(s,i)),s=i+1,t+=o}return s!==i?t+u.substring(s,i):t}var w=/["'&<>]/;L.exports=A},{}],158:[function(_,L,E){function A(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function w(o){return typeof o=="function"}function v(o){return typeof o=="number"}function u(o){return typeof o=="object"&&o!==null}function f(o){return o===void 0}L.exports=A,A.EventEmitter=A,A.prototype._events=void 0,A.prototype._maxListeners=void 0,A.defaultMaxListeners=10,A.prototype.setMaxListeners=function(o){if(!v(o)||o<0||isNaN(o))throw TypeError("n must be a positive number");return this._maxListeners=o,this},A.prototype.emit=function(o){var t,i,s,h,a,e;if(this._events||(this._events={}),o==="error"&&(!this._events.error||u(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var l=new Error('Uncaught, unspecified "error" event. ('+t+")");throw l.context=t,l}if(i=this._events[o],f(i))return!1;if(w(i))switch(arguments.length){case 1:i.call(this);break;case 2:i.call(this,arguments[1]);break;case 3:i.call(this,arguments[1],arguments[2]);break;default:h=Array.prototype.slice.call(arguments,1),i.apply(this,h)}else if(u(i))for(h=Array.prototype.slice.call(arguments,1),e=i.slice(),s=e.length,a=0;a<s;a++)e[a].apply(this,h);return!0},A.prototype.addListener=function(o,t){var i;if(!w(t))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",o,w(t.listener)?t.listener:t),this._events[o]?u(this._events[o])?this._events[o].push(t):this._events[o]=[this._events[o],t]:this._events[o]=t,u(this._events[o])&&!this._events[o].warned&&(i=f(this._maxListeners)?A.defaultMaxListeners:this._maxListeners)&&i>0&&this._events[o].length>i&&(this._events[o].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[o].length),typeof console.trace=="function"&&console.trace()),this},A.prototype.on=A.prototype.addListener,A.prototype.once=function(o,t){function i(){this.removeListener(o,i),s||(s=!0,t.apply(this,arguments))}if(!w(t))throw TypeError("listener must be a function");var s=!1;return i.listener=t,this.on(o,i),this},A.prototype.removeListener=function(o,t){var i,s,h,a;if(!w(t))throw TypeError("listener must be a function");if(!this._events||!this._events[o])return this;if(i=this._events[o],h=i.length,s=-1,i===t||w(i.listener)&&i.listener===t)delete this._events[o],this._events.removeListener&&this.emit("removeListener",o,t);else if(u(i)){for(a=h;a-- >0;)if(i[a]===t||i[a].listener&&i[a].listener===t){s=a;break}if(s<0)return this;i.length===1?(i.length=0,delete this._events[o]):i.splice(s,1),this._events.removeListener&&this.emit("removeListener",o,t)}return this},A.prototype.removeAllListeners=function(o){var t,i;if(!this._events)return this;if(!this._events.removeListener)return arguments.length===0?this._events={}:this._events[o]&&delete this._events[o],this;if(arguments.length===0){for(t in this._events)t!=="removeListener"&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(i=this._events[o],w(i))this.removeListener(o,i);else if(i)for(;i.length;)this.removeListener(o,i[i.length-1]);return delete this._events[o],this},A.prototype.listeners=function(o){return this._events&&this._events[o]?w(this._events[o])?[this._events[o]]:this._events[o].slice():[]},A.prototype.listenerCount=function(o){if(this._events){var t=this._events[o];if(w(t))return 1;if(t)return t.length}return 0},A.listenerCount=function(o,t){return o.listenerCount(t)}},{}],159:[function(_,L,E){var A=_("http"),w=L.exports;for(var v in A)A.hasOwnProperty(v)&&(w[v]=A[v]);w.request=function(u,f){return u||(u={}),u.scheme="https",u.protocol="https:",A.request.call(this,u,f)}},{http:196}],160:[function(_,L,E){"use strict";var A=_("util"),w=_("ms");L.exports=function(v){if(typeof v=="number")return v;var u=w(v);if(u===void 0){var f=new Error(A.format("humanize-ms(%j) result undefined",v));console.warn(f.stack)}return u}},{ms:169,util:207}],161:[function(_,L,E){E.read=function(A,w,v,u,f){var o,t,i=8*f-u-1,s=(1<<i)-1,h=s>>1,a=-7,e=v?f-1:0,l=v?-1:1,n=A[w+e];for(e+=l,o=n&(1<<-a)-1,n>>=-a,a+=i;a>0;o=256*o+A[w+e],e+=l,a-=8);for(t=o&(1<<-a)-1,o>>=-a,a+=u;a>0;t=256*t+A[w+e],e+=l,a-=8);if(o===0)o=1-h;else{if(o===s)return t?NaN:1/0*(n?-1:1);t+=Math.pow(2,u),o-=h}return(n?-1:1)*t*Math.pow(2,o-u)},E.write=function(A,w,v,u,f,o){var t,i,s,h=8*o-f-1,a=(1<<h)-1,e=a>>1,l=f===23?Math.pow(2,-24)-Math.pow(2,-77):0,n=u?0:o-1,d=u?1:-1,c=w<0||w===0&&1/w<0?1:0;for(w=Math.abs(w),isNaN(w)||w===1/0?(i=isNaN(w)?1:0,t=a):(t=Math.floor(Math.log(w)/Math.LN2),w*(s=Math.pow(2,-t))<1&&(t--,s*=2),w+=t+e>=1?l/s:l*Math.pow(2,1-e),w*s>=2&&(t++,s/=2),t+e>=a?(i=0,t=a):t+e>=1?(i=(w*s-1)*Math.pow(2,f),t+=e):(i=w*Math.pow(2,e-1)*Math.pow(2,f),t=0));f>=8;A[v+n]=255&i,n+=d,i/=256,f-=8);for(t=t<<f|i,h+=f;h>0;A[v+n]=255&t,n+=d,t/=256,h-=8);A[v+n-d]|=128*c}},{}],162:[function(_,L,E){typeof Object.create=="function"?L.exports=function(A,w){A.super_=w,A.prototype=Object.create(w.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}})}:L.exports=function(A,w){A.super_=w;var v=function(){};v.prototype=w.prototype,A.prototype=new v,A.prototype.constructor=A}},{}],163:[function(_,L,E){function A(v){return!!v.constructor&&typeof v.constructor.isBuffer=="function"&&v.constructor.isBuffer(v)}function w(v){return typeof v.readFloatLE=="function"&&typeof v.slice=="function"&&A(v.slice(0,0))}L.exports=function(v){return v!=null&&(A(v)||w(v)||!!v._isBuffer)}},{}],164:[function(_,L,E){!function(A){function w(f){return u.call(f).replace(/^[^{]*{\s*/,"").replace(/\s*}[^}]*$/,"")}function v(f){return typeof f=="function"&&(/^class(\s|\{\}$)/.test(u.call(f))||/^.*classCallCheck\(/.test(w(f)))}var u=Function.prototype.toString;E!==void 0?(L!==void 0&&L.exports&&(E=L.exports=v),E.isClass=v):typeof U=="function"&&U.amd?U([],function(){return v}):A.isClass=v}(this)},{}],165:[function(_,L,E){"use strict";function A(o){var t=o.slice(2);return t=t[0].toLowerCase()+t.slice(1)}var w=_("core-util-is"),v=_("isstream"),u=_("is-class");Object.keys(w).map(function(o){E[A(o)]=w[o]}),E.stream=v,E.readableStream=v.isReadable,E.writableStream=v.isWritable,E.duplexStream=v.isDuplex,E.class=u,E.finite=function(o){return Number.isFinite(o)},E.NaN=function(o){return Number.isNaN(o)},E.generator=function(o){return o&&typeof o.next=="function"&&typeof o.throw=="function"},E.generatorFunction=function(o){return o&&o.constructor&&o.constructor.name==="GeneratorFunction"},E.asyncFunction=function(o){return o&&o.constructor&&o.constructor.name==="AsyncFunction"},E.promise=function(o){return o&&typeof o.then=="function"};var f=Math.pow(2,31);E.int=function(o){return w.isNumber(o)&&o%1==0},E.int32=function(o){return E.int(o)&&o<f&&o>=-f},E.long=function(o){return E.int(o)&&(o>=f||o<-f)},E.Long=function(o){return E.object(o)&&E.number(o.high)&&E.number(o.low)},E.double=function(o){return w.isNumber(o)&&!isNaN(o)&&o%1!=0},E.date=function(o){return o instanceof Date},E.regExp=function(o){return o instanceof RegExp},E.regexp=E.regExp,E.error=function(o){return o instanceof Error},E.array=function(o){return Array.isArray(o)}},{"core-util-is":153,"is-class":164,isstream:167}],166:[function(_,L,E){var A={}.toString;L.exports=Array.isArray||function(w){return A.call(w)=="[object Array]"}},{}],167:[function(_,L,E){function A(o){return o instanceof f.Stream}function w(o){return A(o)&&typeof o._read=="function"&&typeof o._readableState=="object"}function v(o){return A(o)&&typeof o._write=="function"&&typeof o._writableState=="object"}function u(o){return w(o)&&v(o)}var f=_("stream");L.exports=A,L.exports.isReadable=w,L.exports.isWritable=v,L.exports.isDuplex=u},{stream:195}],168:[function(_,L,E){"use strict";function A(v,u,f){if(!v)throw new TypeError("argument dest is required");if(!u)throw new TypeError("argument src is required");return f===void 0&&(f=!0),Object.getOwnPropertyNames(u).forEach(function(o){if(f||!w.call(v,o)){var t=Object.getOwnPropertyDescriptor(u,o);Object.defineProperty(v,o,t)}}),v}L.exports=A;var w=Object.prototype.hasOwnProperty},{}],169:[function(_,L,E){function A(h){if(h=String(h),!(h.length>100)){var a=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(h);if(a){var e=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return e*s;case"days":case"day":case"d":return e*i;case"hours":case"hour":case"hrs":case"hr":case"h":return e*t;case"minutes":case"minute":case"mins":case"min":case"m":return e*o;case"seconds":case"second":case"secs":case"sec":case"s":return e*f;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return e;default:return}}}}function w(h){return h>=i?Math.round(h/i)+"d":h>=t?Math.round(h/t)+"h":h>=o?Math.round(h/o)+"m":h>=f?Math.round(h/f)+"s":h+"ms"}function v(h){return u(h,i,"day")||u(h,t,"hour")||u(h,o,"minute")||u(h,f,"second")||h+" ms"}function u(h,a,e){if(!(h<a))return h<1.5*a?Math.floor(h/a)+" "+e:Math.ceil(h/a)+" "+e+"s"}var f=1e3,o=60*f,t=60*o,i=24*t,s=365.25*i;L.exports=function(h,a){a=a||{};var e=typeof h;if(e==="string"&&h.length>0)return A(h);if(e==="number"&&isNaN(h)===!1)return a.long?v(h):w(h);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(h))}},{}],170:[function(_,L,E){(function(A){function w(o,t){for(var i=0,s=o.length-1;s>=0;s--){var h=o[s];h==="."?o.splice(s,1):h===".."?(o.splice(s,1),i++):i&&(o.splice(s,1),i--)}if(t)for(;i--;i)o.unshift("..");return o}function v(o){typeof o!="string"&&(o+="");var t,i=0,s=-1,h=!0;for(t=o.length-1;t>=0;--t)if(o.charCodeAt(t)===47){if(!h){i=t+1;break}}else s===-1&&(h=!1,s=t+1);return s===-1?"":o.slice(i,s)}function u(o,t){if(o.filter)return o.filter(t);for(var i=[],s=0;s<o.length;s++)t(o[s],s,o)&&i.push(o[s]);return i}E.resolve=function(){for(var o="",t=!1,i=arguments.length-1;i>=-1&&!t;i--){var s=i>=0?arguments[i]:A.cwd();if(typeof s!="string")throw new TypeError("Arguments to path.resolve must be strings");s&&(o=s+"/"+o,t=s.charAt(0)==="/")}return o=w(u(o.split("/"),function(h){return!!h}),!t).join("/"),(t?"/":"")+o||"."},E.normalize=function(o){var t=E.isAbsolute(o),i=f(o,-1)==="/";return o=w(u(o.split("/"),function(s){return!!s}),!t).join("/"),o||t||(o="."),o&&i&&(o+="/"),(t?"/":"")+o},E.isAbsolute=function(o){return o.charAt(0)==="/"},E.join=function(){var o=Array.prototype.slice.call(arguments,0);return E.normalize(u(o,function(t,i){if(typeof t!="string")throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},E.relative=function(o,t){function i(d){for(var c=0;c<d.length&&d[c]==="";c++);for(var g=d.length-1;g>=0&&d[g]==="";g--);return c>g?[]:d.slice(c,g-c+1)}o=E.resolve(o).substr(1),t=E.resolve(t).substr(1);for(var s=i(o.split("/")),h=i(t.split("/")),a=Math.min(s.length,h.length),e=a,l=0;l<a;l++)if(s[l]!==h[l]){e=l;break}for(var n=[],l=e;l<s.length;l++)n.push("..");return n=n.concat(h.slice(e)),n.join("/")},E.sep="/",E.delimiter=":",E.dirname=function(o){if(typeof o!="string"&&(o+=""),o.length===0)return".";for(var t=o.charCodeAt(0),i=t===47,s=-1,h=!0,a=o.length-1;a>=1;--a)if((t=o.charCodeAt(a))===47){if(!h){s=a;break}}else h=!1;return s===-1?i?"/":".":i&&s===1?"/":o.slice(0,s)},E.basename=function(o,t){var i=v(o);return t&&i.substr(-1*t.length)===t&&(i=i.substr(0,i.length-t.length)),i},E.extname=function(o){typeof o!="string"&&(o+="");for(var t=-1,i=0,s=-1,h=!0,a=0,e=o.length-1;e>=0;--e){var l=o.charCodeAt(e);if(l!==47)s===-1&&(h=!1,s=e+1),l===46?t===-1?t=e:a!==1&&(a=1):t!==-1&&(a=-1);else if(!h){i=e+1;break}}return t===-1||s===-1||a===0||a===1&&t===s-1&&t===i+1?"":o.slice(t,s)};var f="ab".substr(-1)==="b"?function(o,t,i){return o.substr(t,i)}:function(o,t,i){return t<0&&(t=o.length+t),o.substr(t,i)}}).call(this,_("_process"))},{_process:173}],171:[function(_,L,E){(function(A){(function(){"use strict";function w(S){return S=String(S),S.charAt(0).toUpperCase()+S.slice(1)}function v(S,T,R){var D={"10.0":"10",6.4:"10 Technical Preview",6.3:"8.1",6.2:"8",6.1:"Server 2008 R2 / 7","6.0":"Server 2008 / Vista",5.2:"Server 2003 / XP 64-bit",5.1:"XP",5.01:"2000 SP1","5.0":"2000","4.0":"NT","4.90":"ME"};return T&&R&&/^Win/i.test(S)&&!/^Windows Phone /i.test(S)&&(D=D[/[\d.]+$/.exec(S)])&&(S="Windows "+D),S=String(S),T&&R&&(S=S.replace(RegExp(T,"i"),R)),S=f(S.replace(/ ce$/i," CE").replace(/\bhpw/i,"web").replace(/\bMacintosh\b/,"Mac OS").replace(/_PowerPC\b/i," OS").replace(/\b(OS X) [^ \d]+/i,"$1").replace(/\bMac (OS X)\b/,"$1").replace(/\/(\d)/," $1").replace(/_/g,".").replace(/(?: BePC|[ .]*fc[ \d.]+)$/i,"").replace(/\bx86\.64\b/gi,"x86_64").replace(/\b(Windows Phone) OS\b/,"$1").replace(/\b(Chrome OS \w+) [\d.]+\b/,"$1").split(" on ")[0])}function u(S,T){var R=-1,D=S?S.length:0;if(typeof D=="number"&&D>-1&&D<=p)for(;++R<D;)T(S[R],R,S);else o(S,T)}function f(S){return S=a(S),/^(?:webOS|i(?:OS|P))/.test(S)?S:w(S)}function o(S,T){for(var R in S)y.call(S,R)&&T(S[R],R,S)}function t(S){return S==null?w(S):r.call(S).slice(8,-1)}function i(S,T){var R=S!=null?typeof S[T]:"number";return!(/^(?:boolean|number|string|undefined)$/.test(R)||R=="object"&&!S[T])}function s(S){return String(S).replace(/([ -])(?!$)/g,"$1?")}function h(S,T){var R=null;return u(S,function(D,k){R=T(R,D,k,S)}),R}function a(S){return String(S).replace(/^ +| +$/g,"")}function e(S){function T(j){return h(j,function(M,F){var ae=F.pattern||s(F);return!M&&(M=RegExp("\\b"+ae+" *\\d+[.\\w_]*","i").exec(S)||RegExp("\\b"+ae+" *\\w+-[\\w]*","i").exec(S)||RegExp("\\b"+ae+"(?:; *(?:[a-z]+[_-])?[a-z]+\\d+|[^ ();-]*)","i").exec(S))&&((M=String(F.label&&!RegExp(ae,"i").test(F.label)?F.label:M).split("/"))[1]&&!/[\d.]+/.test(M[0])&&(M[0]+=" "+M[1]),F=F.label||F,M=f(M[0].replace(RegExp(ae,"i"),F).replace(RegExp("; *(?:"+F+"[_-])?","i")," ").replace(RegExp("("+F+")[-_.]?(\\w)","i"),"$1 $2"))),M})}function R(){return this.description||""}var D=n,k=S&&typeof S=="object"&&t(S)!="String";k&&(D=S,S=null);var B=D.navigator||{},G=B.userAgent||"";S||(S=G);var P,$,X=k?!!B.likeChrome:/\bChrome\b/.test(S)&&!/internal|\n/i.test(r.toString()),z=k?"Object":"ScriptBridgingProxyObject",N=k?"Object":"Environment",H=k&&D.java?"JavaPackage":t(D.java),q=k?"Object":"RuntimeObject",ee=/\bJava/.test(H)&&D.java,fe=ee&&t(D.environment)==N,oe=ee?"a":"\u4F2A",he=ee?"b":"\u5C3E",se=D.document||{},ge=D.operamini||D.opera,ie=m.test(ie=k&&ge?ge["[[Class]]"]:t(ge))?ie:ge=null,re=S,Q=[],pe=null,ne=S==G,J=ne&&ge&&typeof ge.version=="function"&&ge.version(),be=function(j){return h(j,function(M,F){return M||RegExp("\\b"+(F.pattern||s(F))+"\\b","i").exec(S)&&(F.label||F)})}([{label:"EdgeHTML",pattern:"Edge"},"Trident",{label:"WebKit",pattern:"AppleWebKit"},"iCab","Presto","NetFront","Tasman","KHTML","Gecko"]),Ee=function(j){return h(j,function(M,F){return M||RegExp("\\b"+(F.pattern||s(F))+"\\b","i").exec(S)&&(F.label||F)})}(["Adobe AIR","Arora","Avant Browser","Breach","Camino","Electron","Epiphany","Fennec","Flock","Galeon","GreenBrowser","iCab","Iceweasel","K-Meleon","Konqueror","Lunascape","Maxthon",{label:"Microsoft Edge",pattern:"Edge"},"Midori","Nook Browser","PaleMoon","PhantomJS","Raven","Rekonq","RockMelt",{label:"Samsung Internet",pattern:"SamsungBrowser"},"SeaMonkey",{label:"Silk",pattern:"(?:Cloud9|Silk-Accelerated)"},"Sleipnir","SlimBrowser",{label:"SRWare Iron",pattern:"Iron"},"Sunrise","Swiftfox","Waterfox","WebPositive","Opera Mini",{label:"Opera Mini",pattern:"OPiOS"},"Opera",{label:"Opera",pattern:"OPR"},"Chrome",{label:"Chrome Mobile",pattern:"(?:CriOS|CrMo)"},{label:"Firefox",pattern:"(?:Firefox|Minefield)"},{label:"Firefox for iOS",pattern:"FxiOS"},{label:"IE",pattern:"IEMobile"},{label:"IE",pattern:"MSIE"},"Safari"]),Le=T([{label:"BlackBerry",pattern:"BB10"},"BlackBerry",{label:"Galaxy S",pattern:"GT-I9000"},{label:"Galaxy S2",pattern:"GT-I9100"},{label:"Galaxy S3",pattern:"GT-I9300"},{label:"Galaxy S4",pattern:"GT-I9500"},{label:"Galaxy S5",pattern:"SM-G900"},{label:"Galaxy S6",pattern:"SM-G920"},{label:"Galaxy S6 Edge",pattern:"SM-G925"},{label:"Galaxy S7",pattern:"SM-G930"},{label:"Galaxy S7 Edge",pattern:"SM-G935"},"Google TV","Lumia","iPad","iPod","iPhone","Kindle",{label:"Kindle Fire",pattern:"(?:Cloud9|Silk-Accelerated)"},"Nexus","Nook","PlayBook","PlayStation Vita","PlayStation","TouchPad","Transformer",{label:"Wii U",pattern:"WiiU"},"Wii","Xbox One",{label:"Xbox 360",pattern:"Xbox"},"Xoom"]),V=function(j){return h(j,function(M,F,ae){return M||(F[Le]||F[/^[a-z]+(?: +[a-z]+\b)*/i.exec(Le)]||RegExp("\\b"+s(ae)+"(?:\\b|\\w*\\d)","i").exec(S))&&ae})}({Apple:{iPad:1,iPhone:1,iPod:1},Archos:{},Amazon:{Kindle:1,"Kindle Fire":1},Asus:{Transformer:1},"Barnes & Noble":{Nook:1},BlackBerry:{PlayBook:1},Google:{"Google TV":1,Nexus:1},HP:{TouchPad:1},HTC:{},LG:{},Microsoft:{Xbox:1,"Xbox One":1},Motorola:{Xoom:1},Nintendo:{"Wii U":1,Wii:1},Nokia:{Lumia:1},Samsung:{"Galaxy S":1,"Galaxy S2":1,"Galaxy S3":1,"Galaxy S4":1},Sony:{PlayStation:1,"PlayStation Vita":1}}),C=function(j){return h(j,function(M,F){var ae=F.pattern||s(F);return!M&&(M=RegExp("\\b"+ae+"(?:/[\\d.]+|[ \\w.]*)","i").exec(S))&&(M=v(M,ae,F.label||F)),M})}(["Windows Phone","Android","CentOS",{label:"Chrome OS",pattern:"CrOS"},"Debian","Fedora","FreeBSD","Gentoo","Haiku","Kubuntu","Linux Mint","OpenBSD","Red Hat","SuSE","Ubuntu","Xubuntu","Cygwin","Symbian OS","hpwOS","webOS ","webOS","Tablet OS","Tizen","Linux","Mac OS X","Macintosh","Mac","Windows 98;","Windows "]);if(be&&(be=[be]),V&&!Le&&(Le=T([V])),(P=/\bGoogle TV\b/.exec(Le))&&(Le=P[0]),/\bSimulator\b/i.test(S)&&(Le=(Le?Le+" ":"")+"Simulator"),Ee=="Opera Mini"&&/\bOPiOS\b/.test(S)&&Q.push("running in Turbo/Uncompressed mode"),Ee=="IE"&&/\blike iPhone OS\b/.test(S)?(P=e(S.replace(/like iPhone OS/,"")),V=P.manufacturer,Le=P.product):/^iP/.test(Le)?(Ee||(Ee="Safari"),C="iOS"+((P=/ OS ([\d_]+)/i.exec(S))?" "+P[1].replace(/_/g,"."):"")):Ee!="Konqueror"||/buntu/i.test(C)?V&&V!="Google"&&(/Chrome/.test(Ee)&&!/\bMobile Safari\b/i.test(S)||/\bVita\b/.test(Le))||/\bAndroid\b/.test(C)&&/^Chrome/.test(Ee)&&/\bVersion\//i.test(S)?(Ee="Android Browser",C=/\bAndroid\b/.test(C)?C:"Android"):Ee=="Silk"?(/\bMobi/i.test(S)||(C="Android",Q.unshift("desktop mode")),/Accelerated *= *true/i.test(S)&&Q.unshift("accelerated")):Ee=="PaleMoon"&&(P=/\bFirefox\/([\d.]+)\b/.exec(S))?Q.push("identifying as Firefox "+P[1]):Ee=="Firefox"&&(P=/\b(Mobile|Tablet|TV)\b/i.exec(S))?(C||(C="Firefox OS"),Le||(Le=P[1])):!Ee||(P=!/\bMinefield\b/i.test(S)&&/\b(?:Firefox|Safari)\b/.exec(Ee))?(Ee&&!Le&&/[\/,]|^[^(]+?\)/.test(S.slice(S.indexOf(P+"/")+8))&&(Ee=null),(P=Le||V||C)&&(Le||V||/\b(?:Android|Symbian OS|Tablet OS|webOS)\b/.test(C))&&(Ee=/[a-z]+(?: Hat)?/i.exec(/\bAndroid\b/.test(C)?C:P)+" Browser")):Ee=="Electron"&&(P=(/\bChrome\/([\d.]+)\b/.exec(S)||0)[1])&&Q.push("Chromium "+P):C="Kubuntu",J||(J=function(j){return h(j,function(M,F){return M||(RegExp(F+"(?:-[\\d.]+/|(?: for [\\w-]+)?[ /-])([\\d.]+[^ ();/_-]*)","i").exec(S)||0)[1]||null})}(["(?:Cloud9|CriOS|CrMo|Edge|FxiOS|IEMobile|Iron|Opera ?Mini|OPiOS|OPR|Raven|SamsungBrowser|Silk(?!/[\\d.]+$))","Version",s(Ee),"(?:Firefox|Minefield|NetFront)"])),(P=be=="iCab"&&parseFloat(J)>3&&"WebKit"||/\bOpera\b/.test(Ee)&&(/\bOPR\b/.test(S)?"Blink":"Presto")||/\b(?:Midori|Nook|Safari)\b/i.test(S)&&!/^(?:Trident|EdgeHTML)$/.test(be)&&"WebKit"||!be&&/\bMSIE\b/i.test(S)&&(C=="Mac OS"?"Tasman":"Trident")||be=="WebKit"&&/\bPlayStation\b(?! Vita\b)/i.test(Ee)&&"NetFront")&&(be=[P]),Ee=="IE"&&(P=(/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(S)||0)[1])?(Ee+=" Mobile",C="Windows Phone "+(/\+$/.test(P)?P:P+".x"),Q.unshift("desktop mode")):/\bWPDesktop\b/i.test(S)?(Ee="IE Mobile",C="Windows Phone 8.x",Q.unshift("desktop mode"),J||(J=(/\brv:([\d.]+)/.exec(S)||0)[1])):Ee!="IE"&&be=="Trident"&&(P=/\brv:([\d.]+)/.exec(S))&&(Ee&&Q.push("identifying as "+Ee+(J?" "+J:"")),Ee="IE",J=P[1]),ne){if(i(D,"global"))if(ee&&(P=ee.lang.System,re=P.getProperty("os.arch"),C=C||P.getProperty("os.name")+" "+P.getProperty("os.version")),fe){try{J=D.require("ringo/engine").version.join("."),Ee="RingoJS"}catch(j){(P=D.system)&&P.global.system==D.system&&(Ee="Narwhal",C||(C=P[0].os||null))}Ee||(Ee="Rhino")}else typeof D.process=="object"&&!D.process.browser&&(P=D.process)&&(typeof P.versions=="object"&&(typeof P.versions.electron=="string"?(Q.push("Node "+P.versions.node),Ee="Electron",J=P.versions.electron):typeof P.versions.nw=="string"&&(Q.push("Chromium "+J,"Node "+P.versions.node),Ee="NW.js",J=P.versions.nw)),Ee||(Ee="Node.js",re=P.arch,C=P.platform,J=/[\d.]+/.exec(P.version),J=J?J[0]:null));else t(P=D.runtime)==z?(Ee="Adobe AIR",C=P.flash.system.Capabilities.os):t(P=D.phantom)==q?(Ee="PhantomJS",J=(P=P.version||null)&&P.major+"."+P.minor+"."+P.patch):typeof se.documentMode=="number"&&(P=/\bTrident\/(\d+)/i.exec(S))?(J=[J,se.documentMode],(P=+P[1]+4)!=J[1]&&(Q.push("IE "+J[1]+" mode"),be&&(be[1]=""),J[1]=P),J=Ee=="IE"?String(J[1].toFixed(1)):J[0]):typeof se.documentMode=="number"&&/^(?:Chrome|Firefox)\b/.test(Ee)&&(Q.push("masking as "+Ee+" "+J),Ee="IE",J="11.0",be=["Trident"],C="Windows");C=C&&f(C)}if(J&&(P=/(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(J)||/(?:alpha|beta)(?: ?\d)?/i.exec(S+";"+(ne&&B.appMinorVersion))||/\bMinefield\b/i.test(S)&&"a")&&(pe=/b/i.test(P)?"beta":"alpha",J=J.replace(RegExp(P+"\\+?$"),"")+(pe=="beta"?he:oe)+(/\d+\+?/.exec(P)||"")),Ee=="Fennec"||Ee=="Firefox"&&/\b(?:Android|Firefox OS)\b/.test(C))Ee="Firefox Mobile";else if(Ee=="Maxthon"&&J)J=J.replace(/\.[\d.]+/,".x");else if(/\bXbox\b/i.test(Le))Le=="Xbox 360"&&(C=null),Le=="Xbox 360"&&/\bIEMobile\b/.test(S)&&Q.unshift("mobile mode");else if(!/^(?:Chrome|IE|Opera)$/.test(Ee)&&(!Ee||Le||/Browser|Mobi/.test(Ee))||C!="Windows CE"&&!/Mobi/i.test(S))if(Ee=="IE"&&ne)try{D.external===null&&Q.unshift("platform preview")}catch(j){Q.unshift("embedded")}else(/\bBlackBerry\b/.test(Le)||/\bBB10\b/.test(S))&&(P=(RegExp(Le.replace(/ +/g," *")+"/([.\\d]+)","i").exec(S)||0)[1]||J)?(P=[P,/BB10/.test(S)],C=(P[1]?(Le=null,V="BlackBerry"):"Device Software")+" "+P[0],J=null):this!=o&&Le!="Wii"&&(ne&&ge||/Opera/.test(Ee)&&/\b(?:MSIE|Firefox)\b/i.test(S)||Ee=="Firefox"&&/\bOS X (?:\d+\.){2,}/.test(C)||Ee=="IE"&&(C&&!/^Win/.test(C)&&J>5.5||/\bWindows XP\b/.test(C)&&J>8||J==8&&!/\bTrident\b/.test(S)))&&!m.test(P=e.call(o,S.replace(m,"")+";"))&&P.name&&(P="ing as "+P.name+((P=P.version)?" "+P:""),m.test(Ee)?(/\bIE\b/.test(P)&&C=="Mac OS"&&(C=null),P="identify"+P):(P="mask"+P,Ee=ie?f(ie.replace(/([a-z])([A-Z])/g,"$1 $2")):"Opera",/\bIE\b/.test(P)&&(C=null),ne||(J=null)),be=["Presto"],Q.push(P));else Ee+=" Mobile";(P=(/\bAppleWebKit\/([\d.]+\+?)/i.exec(S)||0)[1])&&(P=[parseFloat(P.replace(/\.(\d)$/,".0$1")),P],Ee=="Safari"&&P[1].slice(-1)=="+"?(Ee="WebKit Nightly",pe="alpha",J=P[1].slice(0,-1)):J!=P[1]&&J!=(P[2]=(/\bSafari\/([\d.]+\+?)/i.exec(S)||0)[1])||(J=null),P[1]=(/\bChrome\/([\d.]+)/i.exec(S)||0)[1],P[0]==537.36&&P[2]==537.36&&parseFloat(P[1])>=28&&be=="WebKit"&&(be=["Blink"]),ne&&(X||P[1])?(be&&(be[1]="like Chrome"),P=P[1]||(P=P[0],P<530?1:P<532?2:P<532.05?3:P<533?4:P<534.03?5:P<534.07?6:P<534.1?7:P<534.13?8:P<534.16?9:P<534.24?10:P<534.3?11:P<535.01?12:P<535.02?"13+":P<535.07?15:P<535.11?16:P<535.19?17:P<536.05?18:P<536.1?19:P<537.01?20:P<537.11?"21+":P<537.13?23:P<537.18?24:P<537.24?25:P<537.36?26:be!="Blink"?"27":"28")):(be&&(be[1]="like Safari"),P=P[0],P=P<400?1:P<500?2:P<526?3:P<533?4:P<534?"4+":P<535?5:P<537?6:P<538?7:P<601?8:"8"),be&&(be[1]+=" "+(P+=typeof P=="number"?".x":/[.+]/.test(P)?"":"+")),Ee=="Safari"&&(!J||parseInt(J)>45)&&(J=P)),Ee=="Opera"&&(P=/\bzbov|zvav$/.exec(C))?(Ee+=" ",Q.unshift("desktop mode"),P=="zvav"?(Ee+="Mini",J=null):Ee+="Mobile",C=C.replace(RegExp(" *"+P+"$"),"")):Ee=="Safari"&&/\bChrome\b/.exec(be&&be[1])&&(Q.unshift("desktop mode"),Ee="Chrome Mobile",J=null,/\bOS X\b/.test(C)?(V="Apple",C="iOS 4.3+"):C=null),J&&J.indexOf(P=/[\d.]+$/.exec(C))==0&&S.indexOf("/"+P+"-")>-1&&(C=a(C.replace(P,""))),be&&!/\b(?:Avant|Nook)\b/.test(Ee)&&(/Browser|Lunascape|Maxthon/.test(Ee)||Ee!="Safari"&&/^iOS/.test(C)&&/\bSafari\b/.test(be[1])||/^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|Web)/.test(Ee)&&be[1])&&(P=be[be.length-1])&&Q.push(P),Q.length&&(Q=["("+Q.join("; ")+")"]),V&&Le&&Le.indexOf(V)<0&&Q.push("on "+V),Le&&Q.push((/^on /.test(Q[Q.length-1])?"":"on ")+Le),C&&(P=/ ([\d.+]+)$/.exec(C),$=P&&C.charAt(C.length-P[0].length-1)=="/",C={architecture:32,family:P&&!$?C.replace(P[0],""):C,version:P?P[1]:null,toString:function(){var j=this.version;return this.family+(j&&!$?" "+j:"")+(this.architecture==64?" 64-bit":"")}}),(P=/\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(re))&&!/\bi686\b/i.test(re)?(C&&(C.architecture=64,C.family=C.family.replace(RegExp(" *"+P),"")),Ee&&(/\bWOW64\b/i.test(S)||ne&&/\w(?:86|32)$/.test(B.cpuClass||B.platform)&&!/\bWin64; x64\b/i.test(S))&&Q.unshift("32-bit")):C&&/^OS X/.test(C.family)&&Ee=="Chrome"&&parseFloat(J)>=39&&(C.architecture=64),S||(S=null);var O={};return O.description=S,O.layout=be&&be[0],O.manufacturer=V,O.name=Ee,O.prerelease=pe,O.product=Le,O.ua=S,O.version=Ee&&J,O.os=C||{architecture:null,family:null,version:null,toString:function(){return"null"}},O.parse=e,O.toString=R,O.version&&Q.unshift(J),O.name&&Q.unshift(Ee),C&&Ee&&(C!=String(C).split(" ")[0]||C!=Ee.split(" ")[0]&&!Le)&&Q.push(Le?"("+C+")":"on "+C),Q.length&&(O.description=Q.join(" ")),O}var l={function:!0,object:!0},n=l[typeof window]&&window||this,d=l[typeof E]&&E,c=l[typeof L]&&L&&!L.nodeType&&L,g=d&&c&&typeof A=="object"&&A;!g||g.global!==g&&g.window!==g&&g.self!==g||(n=g);var p=Math.pow(2,53)-1,m=/\bOpera/,b=Object.prototype,y=b.hasOwnProperty,r=b.toString,x=e();typeof U=="function"&&typeof U.amd=="object"&&U.amd?(n.platform=x,U(function(){return x})):d&&c?o(x,function(S,T){d[T]=S}):n.platform=x}).call(this)}).call(this,typeof Se!="undefined"?Se:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],172:[function(_,L,E){(function(A){"use strict";function w(v,u,f,o){if(typeof v!="function")throw new TypeError('"callback" argument must be a function');var t,i,s=arguments.length;switch(s){case 0:case 1:return A.nextTick(v);case 2:return A.nextTick(function(){v.call(null,u)});case 3:return A.nextTick(function(){v.call(null,u,f)});case 4:return A.nextTick(function(){v.call(null,u,f,o)});default:for(t=new Array(s-1),i=0;i<t.length;)t[i++]=arguments[i];return A.nextTick(function(){v.apply(null,t)})}}!A.version||A.version.indexOf("v0.")===0||A.version.indexOf("v1.")===0&&A.version.indexOf("v1.8.")!==0?L.exports={nextTick:w}:L.exports=A}).call(this,_("_process"))},{_process:173}],173:[function(_,L,E){function A(){throw new Error("setTimeout has not been defined")}function w(){throw new Error("clearTimeout has not been defined")}function v(c){if(s===setTimeout)return setTimeout(c,0);if((s===A||!s)&&setTimeout)return s=setTimeout,setTimeout(c,0);try{return s(c,0)}catch(g){try{return s.call(null,c,0)}catch(p){return s.call(this,c,0)}}}function u(c){if(h===clearTimeout)return clearTimeout(c);if((h===w||!h)&&clearTimeout)return h=clearTimeout,clearTimeout(c);try{return h(c)}catch(g){try{return h.call(null,c)}catch(p){return h.call(this,c)}}}function f(){n&&e&&(n=!1,e.length?l=e.concat(l):d=-1,l.length&&o())}function o(){if(!n){var c=v(f);n=!0;for(var g=l.length;g;){for(e=l,l=[];++d<g;)e&&e[d].run();d=-1,g=l.length}e=null,n=!1,u(c)}}function t(c,g){this.fun=c,this.array=g}function i(){}var s,h,a=L.exports={};!function(){try{s=typeof setTimeout=="function"?setTimeout:A}catch(c){s=A}try{h=typeof clearTimeout=="function"?clearTimeout:w}catch(c){h=w}}();var e,l=[],n=!1,d=-1;a.nextTick=function(c){var g=new Array(arguments.length-1);if(arguments.length>1)for(var p=1;p<arguments.length;p++)g[p-1]=arguments[p];l.push(new t(c,g)),l.length!==1||n||v(o)},t.prototype.run=function(){this.fun.apply(null,this.array)},a.title="browser",a.browser=!0,a.env={},a.argv=[],a.version="",a.versions={},a.on=i,a.addListener=i,a.once=i,a.off=i,a.removeListener=i,a.removeAllListeners=i,a.emit=i,a.prependListener=i,a.prependOnceListener=i,a.listeners=function(c){return[]},a.binding=function(c){throw new Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function(c){throw new Error("process.chdir is not supported")},a.umask=function(){return 0}},{}],174:[function(_,L,E){(function(A){!function(w){function v(H){throw new RangeError($[H])}function u(H,q){for(var ee=H.length,fe=[];ee--;)fe[ee]=q(H[ee]);return fe}function f(H,q){var ee=H.split("@"),fe="";return ee.length>1&&(fe=ee[0]+"@",H=ee[1]),H=H.replace(P,"."),fe+u(H.split("."),q).join(".")}function o(H){for(var q,ee,fe=[],oe=0,he=H.length;oe<he;)q=H.charCodeAt(oe++),q>=55296&&q<=56319&&oe<he?(ee=H.charCodeAt(oe++),(64512&ee)==56320?fe.push(((1023&q)<<10)+(1023&ee)+65536):(fe.push(q),oe--)):fe.push(q);return fe}function t(H){return u(H,function(q){var ee="";return q>65535&&(q-=65536,ee+=N(q>>>10&1023|55296),q=56320|1023&q),ee+=N(q)}).join("")}function i(H){return H-48<10?H-22:H-65<26?H-65:H-97<26?H-97:y}function s(H,q){return H+22+75*(H<26)-((q!=0)<<5)}function h(H,q,ee){var fe=0;for(H=ee?z(H/T):H>>1,H+=z(H/q);H>X*x>>1;fe+=y)H=z(H/X);return z(fe+(X+1)*H/(H+S))}function a(H){var q,ee,fe,oe,he,se,ge,ie,re,Q,pe=[],ne=H.length,J=0,be=D,Ee=R;for(ee=H.lastIndexOf(k),ee<0&&(ee=0),fe=0;fe<ee;++fe)H.charCodeAt(fe)>=128&&v("not-basic"),pe.push(H.charCodeAt(fe));for(oe=ee>0?ee+1:0;oe<ne;){for(he=J,se=1,ge=y;oe>=ne&&v("invalid-input"),ie=i(H.charCodeAt(oe++)),(ie>=y||ie>z((b-J)/se))&&v("overflow"),J+=ie*se,re=ge<=Ee?r:ge>=Ee+x?x:ge-Ee,!(ie<re);ge+=y)Q=y-re,se>z(b/Q)&&v("overflow"),se*=Q;q=pe.length+1,Ee=h(J-he,q,he==0),z(J/q)>b-be&&v("overflow"),be+=z(J/q),J%=q,pe.splice(J++,0,be)}return t(pe)}function e(H){var q,ee,fe,oe,he,se,ge,ie,re,Q,pe,ne,J,be,Ee,Le=[];for(H=o(H),ne=H.length,q=D,ee=0,he=R,se=0;se<ne;++se)(pe=H[se])<128&&Le.push(N(pe));for(fe=oe=Le.length,oe&&Le.push(k);fe<ne;){for(ge=b,se=0;se<ne;++se)(pe=H[se])>=q&&pe<ge&&(ge=pe);for(J=fe+1,ge-q>z((b-ee)/J)&&v("overflow"),ee+=(ge-q)*J,q=ge,se=0;se<ne;++se)if(pe=H[se],pe<q&&++ee>b&&v("overflow"),pe==q){for(ie=ee,re=y;Q=re<=he?r:re>=he+x?x:re-he,!(ie<Q);re+=y)Ee=ie-Q,be=y-Q,Le.push(N(s(Q+Ee%be,0))),ie=z(Ee/be);Le.push(N(s(ie,0))),he=h(ee,J,fe==oe),ee=0,++fe}++ee,++q}return Le.join("")}function l(H){return f(H,function(q){return B.test(q)?a(q.slice(4).toLowerCase()):q})}function n(H){return f(H,function(q){return G.test(q)?"xn--"+e(q):q})}var d=typeof E=="object"&&E&&!E.nodeType&&E,c=typeof L=="object"&&L&&!L.nodeType&&L,g=typeof A=="object"&&A;g.global!==g&&g.window!==g&&g.self!==g||(w=g);var p,m,b=2147483647,y=36,r=1,x=26,S=38,T=700,R=72,D=128,k="-",B=/^xn--/,G=/[^\x20-\x7E]/,P=/[\x2E\u3002\uFF0E\uFF61]/g,$={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},X=y-r,z=Math.floor,N=String.fromCharCode;if(p={version:"1.4.1",ucs2:{decode:o,encode:t},decode:a,encode:e,toASCII:n,toUnicode:l},typeof U=="function"&&typeof U.amd=="object"&&U.amd)U("punycode",function(){return p});else if(d&&c)if(L.exports==d)c.exports=p;else for(m in p)p.hasOwnProperty(m)&&(d[m]=p[m]);else w.punycode=p}(this)}).call(this,typeof Se!="undefined"?Se:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],175:[function(_,L,E){"use strict";function A(v,u){return Object.prototype.hasOwnProperty.call(v,u)}L.exports=function(v,u,f,o){u=u||"&",f=f||"=";var t={};if(typeof v!="string"||v.length===0)return t;var i=/\+/g;v=v.split(u);var s=1e3;o&&typeof o.maxKeys=="number"&&(s=o.maxKeys);var h=v.length;s>0&&h>s&&(h=s);for(var a=0;a<h;++a){var e,l,n,d,c=v[a].replace(i,"%20"),g=c.indexOf(f);g>=0?(e=c.substr(0,g),l=c.substr(g+1)):(e=c,l=""),n=decodeURIComponent(e),d=decodeURIComponent(l),A(t,n)?w(t[n])?t[n].push(d):t[n]=[t[n],d]:t[n]=d}return t};var w=Array.isArray||function(v){return Object.prototype.toString.call(v)==="[object Array]"}},{}],176:[function(_,L,E){"use strict";function A(f,o){if(f.map)return f.map(o);for(var t=[],i=0;i<f.length;i++)t.push(o(f[i],i));return t}var w=function(f){switch(typeof f){case"string":return f;case"boolean":return f?"true":"false";case"number":return isFinite(f)?f:"";default:return""}};L.exports=function(f,o,t,i){return o=o||"&",t=t||"=",f===null&&(f=void 0),typeof f=="object"?A(u(f),function(s){var h=encodeURIComponent(w(s))+t;return v(f[s])?A(f[s],function(a){return h+encodeURIComponent(w(a))}).join(o):h+encodeURIComponent(w(f[s]))}).join(o):i?encodeURIComponent(w(i))+t+encodeURIComponent(w(f)):""};var v=Array.isArray||function(f){return Object.prototype.toString.call(f)==="[object Array]"},u=Object.keys||function(f){var o=[];for(var t in f)Object.prototype.hasOwnProperty.call(f,t)&&o.push(t);return o}},{}],177:[function(_,L,E){"use strict";E.decode=E.parse=_("./decode"),E.encode=E.stringify=_("./encode")},{"./decode":175,"./encode":176}],178:[function(_,L,E){L.exports=_("./lib/_stream_duplex.js")},{"./lib/_stream_duplex.js":179}],179:[function(_,L,E){"use strict";function A(n){if(!(this instanceof A))return new A(n);s.call(this,n),h.call(this,n),n&&n.readable===!1&&(this.readable=!1),n&&n.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,n&&n.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",w)}function w(){this.allowHalfOpen||this._writableState.ended||o.nextTick(v,this)}function v(n){n.end()}var u=_("babel-runtime/core-js/object/keys"),f=function(n){return n&&n.__esModule?n:{default:n}}(u),o=_("process-nextick-args"),t=f.default||function(n){var d=[];for(var c in n)d.push(c);return d};L.exports=A;var i=_("core-util-is");i.inherits=_("inherits");var s=_("./_stream_readable"),h=_("./_stream_writable");i.inherits(A,s);for(var a=t(h.prototype),e=0;e<a.length;e++){var l=a[e];A.prototype[l]||(A.prototype[l]=h.prototype[l])}Object.defineProperty(A.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(A.prototype,"destroyed",{get:function(){return this._readableState!==void 0&&this._writableState!==void 0&&this._readableState.destroyed&&this._writableState.destroyed},set:function(n){this._readableState!==void 0&&this._writableState!==void 0&&(this._readableState.destroyed=n,this._writableState.destroyed=n)}}),A.prototype._destroy=function(n,d){this.push(null),this.end(),o.nextTick(d,n)}},{"./_stream_readable":181,"./_stream_writable":183,"babel-runtime/core-js/object/keys":23,"core-util-is":153,inherits:162,"process-nextick-args":172}],180:[function(_,L,E){"use strict";function A(u){if(!(this instanceof A))return new A(u);w.call(this,u)}L.exports=A;var w=_("./_stream_transform"),v=_("core-util-is");v.inherits=_("inherits"),v.inherits(A,w),A.prototype._transform=function(u,f,o){o(null,u)}},{"./_stream_transform":182,"core-util-is":153,inherits:162}],181:[function(_,L,E){(function(A,w){"use strict";function v(ne){return ee.from(ne)}function u(ne){return ee.isBuffer(ne)||ne instanceof fe}function f(ne,J,be){if(typeof ne.prependListener=="function")return ne.prependListener(J,be);ne._events&&ne._events[J]?N(ne._events[J])?ne._events[J].unshift(be):ne._events[J]=[be,ne._events[J]]:ne.on(J,be)}function o(ne,J){z=z||_("./_stream_duplex"),ne=ne||{};var be=J instanceof z;this.objectMode=!!ne.objectMode,be&&(this.objectMode=this.objectMode||!!ne.readableObjectMode);var Ee=ne.highWaterMark,Le=ne.readableHighWaterMark,V=this.objectMode?16:16384;this.highWaterMark=Ee||Ee===0?Ee:be&&(Le||Le===0)?Le:V,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new ie,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=ne.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,ne.encoding&&(ge||(ge=_("string_decoder/").StringDecoder),this.decoder=new ge(ne.encoding),this.encoding=ne.encoding)}function t(ne){if(z=z||_("./_stream_duplex"),!(this instanceof t))return new t(ne);this._readableState=new o(ne,this),this.readable=!0,ne&&(typeof ne.read=="function"&&(this._read=ne.read),typeof ne.destroy=="function"&&(this._destroy=ne.destroy)),q.call(this)}function i(ne,J,be,Ee,Le){var V=ne._readableState;if(J===null)V.reading=!1,n(ne,V);else{var C;Le||(C=h(V,J)),C?ne.emit("error",C):V.objectMode||J&&J.length>0?(typeof J=="string"||V.objectMode||(0,$.default)(J)===ee.prototype||(J=v(J)),Ee?V.endEmitted?ne.emit("error",new Error("stream.unshift() after end event")):s(ne,V,J,!0):V.ended?ne.emit("error",new Error("stream.push() after EOF")):(V.reading=!1,V.decoder&&!be?(J=V.decoder.write(J),V.objectMode||J.length!==0?s(ne,V,J,!1):g(ne,V)):s(ne,V,J,!1))):Ee||(V.reading=!1)}return a(V)}function s(ne,J,be,Ee){J.flowing&&J.length===0&&!J.sync?(ne.emit("data",be),ne.read(0)):(J.length+=J.objectMode?1:be.length,Ee?J.buffer.unshift(be):J.buffer.push(be),J.needReadable&&d(ne)),g(ne,J)}function h(ne,J){var be;return u(J)||typeof J=="string"||J===void 0||ne.objectMode||(be=new TypeError("Invalid non-string/buffer chunk")),be}function a(ne){return!ne.ended&&(ne.needReadable||ne.length<ne.highWaterMark||ne.length===0)}function e(ne){return ne>=pe?ne=pe:(ne--,ne|=ne>>>1,ne|=ne>>>2,ne|=ne>>>4,ne|=ne>>>8,ne|=ne>>>16,ne++),ne}function l(ne,J){return ne<=0||J.length===0&&J.ended?0:J.objectMode?1:ne!==ne?J.flowing&&J.length?J.buffer.head.data.length:J.length:(ne>J.highWaterMark&&(J.highWaterMark=e(ne)),ne<=J.length?ne:J.ended?J.length:(J.needReadable=!0,0))}function n(ne,J){if(!J.ended){if(J.decoder){var be=J.decoder.end();be&&be.length&&(J.buffer.push(be),J.length+=J.objectMode?1:be.length)}J.ended=!0,d(ne)}}function d(ne){var J=ne._readableState;J.needReadable=!1,J.emittedReadable||(se("emitReadable",J.flowing),J.emittedReadable=!0,J.sync?X.nextTick(c,ne):c(ne))}function c(ne){se("emit readable"),ne.emit("readable"),x(ne)}function g(ne,J){J.readingMore||(J.readingMore=!0,X.nextTick(p,ne,J))}function p(ne,J){for(var be=J.length;!J.reading&&!J.flowing&&!J.ended&&J.length<J.highWaterMark&&(se("maybeReadMore read 0"),ne.read(0),be!==J.length);)be=J.length;J.readingMore=!1}function m(ne){return function(){var J=ne._readableState;se("pipeOnDrain",J.awaitDrain),J.awaitDrain&&J.awaitDrain--,J.awaitDrain===0&&H(ne,"data")&&(J.flowing=!0,x(ne))}}function b(ne){se("readable nexttick read 0"),ne.read(0)}function y(ne,J){J.resumeScheduled||(J.resumeScheduled=!0,X.nextTick(r,ne,J))}function r(ne,J){J.reading||(se("resume read 0"),ne.read(0)),J.resumeScheduled=!1,J.awaitDrain=0,ne.emit("resume"),x(ne),J.flowing&&!J.reading&&ne.read(0)}function x(ne){var J=ne._readableState;for(se("flow",J.flowing);J.flowing&&ne.read()!==null;);}function S(ne,J){if(J.length===0)return null;var be;return J.objectMode?be=J.buffer.shift():!ne||ne>=J.length?(be=J.decoder?J.buffer.join(""):J.buffer.length===1?J.buffer.head.data:J.buffer.concat(J.length),J.buffer.clear()):be=T(ne,J.buffer,J.decoder),be}function T(ne,J,be){var Ee;return ne<J.head.data.length?(Ee=J.head.data.slice(0,ne),J.head.data=J.head.data.slice(ne)):Ee=ne===J.head.data.length?J.shift():be?R(ne,J):D(ne,J),Ee}function R(ne,J){var be=J.head,Ee=1,Le=be.data;for(ne-=Le.length;be=be.next;){var V=be.data,C=ne>V.length?V.length:ne;if(C===V.length?Le+=V:Le+=V.slice(0,ne),(ne-=C)===0){C===V.length?(++Ee,be.next?J.head=be.next:J.head=J.tail=null):(J.head=be,be.data=V.slice(C));break}++Ee}return J.length-=Ee,Le}function D(ne,J){var be=ee.allocUnsafe(ne),Ee=J.head,Le=1;for(Ee.data.copy(be),ne-=Ee.data.length;Ee=Ee.next;){var V=Ee.data,C=ne>V.length?V.length:ne;if(V.copy(be,be.length-ne,0,C),(ne-=C)===0){C===V.length?(++Le,Ee.next?J.head=Ee.next:J.head=J.tail=null):(J.head=Ee,Ee.data=V.slice(C));break}++Le}return J.length-=Le,be}function k(ne){var J=ne._readableState;if(J.length>0)throw new Error('"endReadable()" called on non-empty stream');J.endEmitted||(J.ended=!0,X.nextTick(B,J,ne))}function B(ne,J){ne.endEmitted||ne.length!==0||(ne.endEmitted=!0,J.readable=!1,J.emit("end"))}function G(ne,J){for(var be=0,Ee=ne.length;be<Ee;be++)if(ne[be]===J)return be;return-1}var P=_("babel-runtime/core-js/object/get-prototype-of"),$=function(ne){return ne&&ne.__esModule?ne:{default:ne}}(P),X=_("process-nextick-args");L.exports=t;var z,N=_("isarray");t.ReadableState=o;var H=(_("events").EventEmitter,function(ne,J){return ne.listeners(J).length}),q=_("./internal/streams/stream"),ee=_("safe-buffer").Buffer,fe=w.Uint8Array||function(){},oe=_("core-util-is");oe.inherits=_("inherits");var he=_("util"),se=void 0;se=he&&he.debuglog?he.debuglog("stream"):function(){};var ge,ie=_("./internal/streams/BufferList"),re=_("./internal/streams/destroy");oe.inherits(t,q);var Q=["error","close","destroy","pause","resume"];Object.defineProperty(t.prototype,"destroyed",{get:function(){return this._readableState!==void 0&&this._readableState.destroyed},set:function(ne){this._readableState&&(this._readableState.destroyed=ne)}}),t.prototype.destroy=re.destroy,t.prototype._undestroy=re.undestroy,t.prototype._destroy=function(ne,J){this.push(null),J(ne)},t.prototype.push=function(ne,J){var be,Ee=this._readableState;return Ee.objectMode?be=!0:typeof ne=="string"&&(J=J||Ee.defaultEncoding,J!==Ee.encoding&&(ne=ee.from(ne,J),J=""),be=!0),i(this,ne,J,!1,be)},t.prototype.unshift=function(ne){return i(this,ne,null,!0,!1)},t.prototype.isPaused=function(){return this._readableState.flowing===!1},t.prototype.setEncoding=function(ne){return ge||(ge=_("string_decoder/").StringDecoder),this._readableState.decoder=new ge(ne),this._readableState.encoding=ne,this};var pe=8388608;t.prototype.read=function(ne){se("read",ne),ne=parseInt(ne,10);var J=this._readableState,be=ne;if(ne!==0&&(J.emittedReadable=!1),ne===0&&J.needReadable&&(J.length>=J.highWaterMark||J.ended))return se("read: emitReadable",J.length,J.ended),J.length===0&&J.ended?k(this):d(this),null;if((ne=l(ne,J))===0&&J.ended)return J.length===0&&k(this),null;var Ee=J.needReadable;se("need readable",Ee),(J.length===0||J.length-ne<J.highWaterMark)&&(Ee=!0,se("length less than watermark",Ee)),J.ended||J.reading?(Ee=!1,se("reading or ended",Ee)):Ee&&(se("do read"),J.reading=!0,J.sync=!0,J.length===0&&(J.needReadable=!0),this._read(J.highWaterMark),J.sync=!1,J.reading||(ne=l(be,J)));var Le;return Le=ne>0?S(ne,J):null,Le===null?(J.needReadable=!0,ne=0):J.length-=ne,J.length===0&&(J.ended||(J.needReadable=!0),be!==ne&&J.ended&&k(this)),Le!==null&&this.emit("data",Le),Le},t.prototype._read=function(ne){this.emit("error",new Error("_read() is not implemented"))},t.prototype.pipe=function(ne,J){function be(Ke,ke){se("onunpipe"),Ke===F&&ke&&ke.hasUnpiped===!1&&(ke.hasUnpiped=!0,Le())}function Ee(){se("onend"),ne.end()}function Le(){se("cleanup"),ne.removeListener("close",O),ne.removeListener("finish",j),ne.removeListener("drain",Oe),ne.removeListener("error",C),ne.removeListener("unpipe",be),F.removeListener("end",Ee),F.removeListener("end",M),F.removeListener("data",V),De=!0,!ae.awaitDrain||ne._writableState&&!ne._writableState.needDrain||Oe()}function V(Ke){se("ondata"),Ne=!1,ne.write(Ke)!==!1||Ne||((ae.pipesCount===1&&ae.pipes===ne||ae.pipesCount>1&&G(ae.pipes,ne)!==-1)&&!De&&(se("false write response, pause",F._readableState.awaitDrain),F._readableState.awaitDrain++,Ne=!0),F.pause())}function C(Ke){se("onerror",Ke),M(),ne.removeListener("error",C),H(ne,"error")===0&&ne.emit("error",Ke)}function O(){ne.removeListener("finish",j),M()}function j(){se("onfinish"),ne.removeListener("close",O),M()}function M(){se("unpipe"),F.unpipe(ne)}var F=this,ae=this._readableState;switch(ae.pipesCount){case 0:ae.pipes=ne;break;case 1:ae.pipes=[ae.pipes,ne];break;default:ae.pipes.push(ne)}ae.pipesCount+=1,se("pipe count=%d opts=%j",ae.pipesCount,J);var ve=(!J||J.end!==!1)&&ne!==A.stdout&&ne!==A.stderr,Pe=ve?Ee:M;ae.endEmitted?X.nextTick(Pe):F.once("end",Pe),ne.on("unpipe",be);var Oe=m(F);ne.on("drain",Oe);var De=!1,Ne=!1;return F.on("data",V),f(ne,"error",C),ne.once("close",O),ne.once("finish",j),ne.emit("pipe",F),ae.flowing||(se("pipe resume"),F.resume()),ne},t.prototype.unpipe=function(ne){var J=this._readableState,be={hasUnpiped:!1};if(J.pipesCount===0)return this;if(J.pipesCount===1)return ne&&ne!==J.pipes?this:(ne||(ne=J.pipes),J.pipes=null,J.pipesCount=0,J.flowing=!1,ne&&ne.emit("unpipe",this,be),this);if(!ne){var Ee=J.pipes,Le=J.pipesCount;J.pipes=null,J.pipesCount=0,J.flowing=!1;for(var V=0;V<Le;V++)Ee[V].emit("unpipe",this,be);return this}var C=G(J.pipes,ne);return C===-1?this:(J.pipes.splice(C,1),J.pipesCount-=1,J.pipesCount===1&&(J.pipes=J.pipes[0]),ne.emit("unpipe",this,be),this)},t.prototype.on=function(ne,J){var be=q.prototype.on.call(this,ne,J);if(ne==="data")this._readableState.flowing!==!1&&this.resume();else if(ne==="readable"){var Ee=this._readableState;Ee.endEmitted||Ee.readableListening||(Ee.readableListening=Ee.needReadable=!0,Ee.emittedReadable=!1,Ee.reading?Ee.length&&d(this):X.nextTick(b,this))}return be},t.prototype.addListener=t.prototype.on,t.prototype.resume=function(){var ne=this._readableState;return ne.flowing||(se("resume"),ne.flowing=!0,y(this,ne)),this},t.prototype.pause=function(){return se("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(se("pause"),this._readableState.flowing=!1,this.emit("pause")),this},t.prototype.wrap=function(ne){var J=this,be=this._readableState,Ee=!1;ne.on("end",function(){if(se("wrapped end"),be.decoder&&!be.ended){var C=be.decoder.end();C&&C.length&&J.push(C)}J.push(null)}),ne.on("data",function(C){(se("wrapped data"),be.decoder&&(C=be.decoder.write(C)),(!be.objectMode||C!=null)&&(be.objectMode||C&&C.length))&&(J.push(C)||(Ee=!0,ne.pause()))});for(var Le in ne)this[Le]===void 0&&typeof ne[Le]=="function"&&(this[Le]=function(C){return function(){return ne[C].apply(ne,arguments)}}(Le));for(var V=0;V<Q.length;V++)ne.on(Q[V],this.emit.bind(this,Q[V]));return this._read=function(C){se("wrapped _read",C),Ee&&(Ee=!1,ne.resume())},this},Object.defineProperty(t.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),t._fromList=S}).call(this,_("_process"),typeof Se!="undefined"?Se:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"./_stream_duplex":179,"./internal/streams/BufferList":184,"./internal/streams/destroy":185,"./internal/streams/stream":186,_process:173,"babel-runtime/core-js/object/get-prototype-of":22,"core-util-is":153,events:158,inherits:162,isarray:166,"process-nextick-args":172,"safe-buffer":193,"string_decoder/":200,util:36}],182:[function(_,L,E){"use strict";function A(t,i){var s=this._transformState;s.transforming=!1;var h=s.writecb;if(!h)return this.emit("error",new Error("write callback called multiple times"));s.writechunk=null,s.writecb=null,i!=null&&this.push(i),h(t);var a=this._readableState;a.reading=!1,(a.needReadable||a.length<a.highWaterMark)&&this._read(a.highWaterMark)}function w(t){if(!(this instanceof w))return new w(t);f.call(this,t),this._transformState={afterTransform:A.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",v)}function v(){var t=this;typeof this._flush=="function"?this._flush(function(i,s){u(t,i,s)}):u(this,null,null)}function u(t,i,s){if(i)return t.emit("error",i);if(s!=null&&t.push(s),t._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(t._transformState.transforming)throw new Error("Calling transform done when still transforming");return t.push(null)}L.exports=w;var f=_("./_stream_duplex"),o=_("core-util-is");o.inherits=_("inherits"),o.inherits(w,f),w.prototype.push=function(t,i){return this._transformState.needTransform=!1,f.prototype.push.call(this,t,i)},w.prototype._transform=function(t,i,s){throw new Error("_transform() is not implemented")},w.prototype._write=function(t,i,s){var h=this._transformState;if(h.writecb=s,h.writechunk=t,h.writeencoding=i,!h.transforming){var a=this._readableState;(h.needTransform||a.needReadable||a.length<a.highWaterMark)&&this._read(a.highWaterMark)}},w.prototype._read=function(t){var i=this._transformState;i.writechunk!==null&&i.writecb&&!i.transforming?(i.transforming=!0,this._transform(i.writechunk,i.writeencoding,i.afterTransform)):i.needTransform=!0},w.prototype._destroy=function(t,i){var s=this;f.prototype._destroy.call(this,t,function(h){i(h),s.emit("close")})}},{"./_stream_duplex":179,"core-util-is":153,inherits:162}],183:[function(_,L,E){(function(A,w){"use strict";function v(re){return re&&re.__esModule?re:{default:re}}function u(re){var Q=this;this.next=null,this.entry=null,this.finish=function(){R(Q,re)}}function f(re){return he.from(re)}function o(re){return he.isBuffer(re)||re instanceof se}function t(){}function i(re,Q){H=H||_("./_stream_duplex"),re=re||{};var pe=Q instanceof H;this.objectMode=!!re.objectMode,pe&&(this.objectMode=this.objectMode||!!re.writableObjectMode);var ne=re.highWaterMark,J=re.writableHighWaterMark,be=this.objectMode?16:16384;this.highWaterMark=ne||ne===0?ne:pe&&(J||J===0)?J:be,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var Ee=re.decodeStrings===!1;this.decodeStrings=!Ee,this.defaultEncoding=re.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(Le){g(Q,Le)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new u(this)}function s(re){if(H=H||_("./_stream_duplex"),!(ie.call(s,this)||this instanceof H))return new s(re);this._writableState=new i(re,this),this.writable=!0,re&&(typeof re.write=="function"&&(this._write=re.write),typeof re.writev=="function"&&(this._writev=re.writev),typeof re.destroy=="function"&&(this._destroy=re.destroy),typeof re.final=="function"&&(this._final=re.final)),oe.call(this)}function h(re,Q){var pe=new Error("write after end");re.emit("error",pe),N.nextTick(Q,pe)}function a(re,Q,pe,ne){var J=!0,be=!1;return pe===null?be=new TypeError("May not write null values to stream"):typeof pe=="string"||pe===void 0||Q.objectMode||(be=new TypeError("Invalid non-string/buffer chunk")),be&&(re.emit("error",be),N.nextTick(ne,be),J=!1),J}function e(re,Q,pe){return re.objectMode||re.decodeStrings===!1||typeof Q!="string"||(Q=he.from(Q,pe)),Q}function l(re,Q,pe,ne,J,be){if(!pe){var Ee=e(Q,ne,J);ne!==Ee&&(pe=!0,J="buffer",ne=Ee)}var Le=Q.objectMode?1:ne.length;Q.length+=Le;var V=Q.length<Q.highWaterMark;if(V||(Q.needDrain=!0),Q.writing||Q.corked){var C=Q.lastBufferedRequest;Q.lastBufferedRequest={chunk:ne,encoding:J,isBuf:pe,callback:be,next:null},C?C.next=Q.lastBufferedRequest:Q.bufferedRequest=Q.lastBufferedRequest,Q.bufferedRequestCount+=1}else n(re,Q,!1,Le,ne,J,be);return V}function n(re,Q,pe,ne,J,be,Ee){Q.writelen=ne,Q.writecb=Ee,Q.writing=!0,Q.sync=!0,pe?re._writev(J,Q.onwrite):re._write(J,be,Q.onwrite),Q.sync=!1}function d(re,Q,pe,ne,J){--Q.pendingcb,pe?(N.nextTick(J,ne),N.nextTick(S,re,Q),re._writableState.errorEmitted=!0,re.emit("error",ne)):(J(ne),re._writableState.errorEmitted=!0,re.emit("error",ne),S(re,Q))}function c(re){re.writing=!1,re.writecb=null,re.length-=re.writelen,re.writelen=0}function g(re,Q){var pe=re._writableState,ne=pe.sync,J=pe.writecb;if(c(pe),Q)d(re,pe,ne,Q,J);else{var be=y(pe);be||pe.corked||pe.bufferProcessing||!pe.bufferedRequest||b(re,pe),ne?q(p,re,pe,be,J):p(re,pe,be,J)}}function p(re,Q,pe,ne){pe||m(re,Q),Q.pendingcb--,ne(),S(re,Q)}function m(re,Q){Q.length===0&&Q.needDrain&&(Q.needDrain=!1,re.emit("drain"))}function b(re,Q){Q.bufferProcessing=!0;var pe=Q.bufferedRequest;if(re._writev&&pe&&pe.next){var ne=Q.bufferedRequestCount,J=new Array(ne),be=Q.corkedRequestsFree;be.entry=pe;for(var Ee=0,Le=!0;pe;)J[Ee]=pe,pe.isBuf||(Le=!1),pe=pe.next,Ee+=1;J.allBuffers=Le,n(re,Q,!0,Q.length,J,"",be.finish),Q.pendingcb++,Q.lastBufferedRequest=null,be.next?(Q.corkedRequestsFree=be.next,be.next=null):Q.corkedRequestsFree=new u(Q),Q.bufferedRequestCount=0}else{for(;pe;){var V=pe.chunk,C=pe.encoding,O=pe.callback;if(n(re,Q,!1,Q.objectMode?1:V.length,V,C,O),pe=pe.next,Q.bufferedRequestCount--,Q.writing)break}pe===null&&(Q.lastBufferedRequest=null)}Q.bufferedRequest=pe,Q.bufferProcessing=!1}function y(re){return re.ending&&re.length===0&&re.bufferedRequest===null&&!re.finished&&!re.writing}function r(re,Q){re._final(function(pe){Q.pendingcb--,pe&&re.emit("error",pe),Q.prefinished=!0,re.emit("prefinish"),S(re,Q)})}function x(re,Q){Q.prefinished||Q.finalCalled||(typeof re._final=="function"?(Q.pendingcb++,Q.finalCalled=!0,N.nextTick(r,re,Q)):(Q.prefinished=!0,re.emit("prefinish")))}function S(re,Q){var pe=y(Q);return pe&&(x(re,Q),Q.pendingcb===0&&(Q.finished=!0,re.emit("finish"))),pe}function T(re,Q,pe){Q.ending=!0,S(re,Q),pe&&(Q.finished?N.nextTick(pe):re.once("finish",pe)),Q.ended=!0,re.writable=!1}function R(re,Q,pe){var ne=re.entry;for(re.entry=null;ne;){var J=ne.callback;Q.pendingcb--,J(pe),ne=ne.next}Q.corkedRequestsFree?Q.corkedRequestsFree.next=re:Q.corkedRequestsFree=re}var D=_("babel-runtime/core-js/object/define-property"),k=v(D),B=_("babel-runtime/core-js/symbol/has-instance"),G=v(B),P=_("babel-runtime/core-js/symbol"),$=v(P),X=_("babel-runtime/core-js/set-immediate"),z=v(X),N=_("process-nextick-args");L.exports=s;var H,q=!A.browser&&["v0.10","v0.9."].indexOf(A.version.slice(0,5))>-1?z.default:N.nextTick;s.WritableState=i;var ee=_("core-util-is");ee.inherits=_("inherits");var fe={deprecate:_("util-deprecate")},oe=_("./internal/streams/stream"),he=_("safe-buffer").Buffer,se=w.Uint8Array||function(){},ge=_("./internal/streams/destroy");ee.inherits(s,oe),i.prototype.getBuffer=function(){for(var re=this.bufferedRequest,Q=[];re;)Q.push(re),re=re.next;return Q},function(){try{Object.defineProperty(i.prototype,"buffer",{get:fe.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(re){}}();var ie;typeof $.default=="function"&&G.default&&typeof Function.prototype[G.default]=="function"?(ie=Function.prototype[G.default],(0,k.default)(s,G.default,{value:function(re){return!!ie.call(this,re)||this===s&&re&&re._writableState instanceof i}})):ie=function(re){return re instanceof this},s.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},s.prototype.write=function(re,Q,pe){var ne=this._writableState,J=!1,be=!ne.objectMode&&o(re);return be&&!he.isBuffer(re)&&(re=f(re)),typeof Q=="function"&&(pe=Q,Q=null),be?Q="buffer":Q||(Q=ne.defaultEncoding),typeof pe!="function"&&(pe=t),ne.ended?h(this,pe):(be||a(this,ne,re,pe))&&(ne.pendingcb++,J=l(this,ne,be,re,Q,pe)),J},s.prototype.cork=function(){this._writableState.corked++},s.prototype.uncork=function(){var re=this._writableState;re.corked&&(re.corked--,re.writing||re.corked||re.finished||re.bufferProcessing||!re.bufferedRequest||b(this,re))},s.prototype.setDefaultEncoding=function(re){if(typeof re=="string"&&(re=re.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((re+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+re);return this._writableState.defaultEncoding=re,this},Object.defineProperty(s.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),s.prototype._write=function(re,Q,pe){pe(new Error("_write() is not implemented"))},s.prototype._writev=null,s.prototype.end=function(re,Q,pe){var ne=this._writableState;typeof re=="function"?(pe=re,re=null,Q=null):typeof Q=="function"&&(pe=Q,Q=null),re!=null&&this.write(re,Q),ne.corked&&(ne.corked=1,this.uncork()),ne.ending||ne.finished||T(this,ne,pe)},Object.defineProperty(s.prototype,"destroyed",{get:function(){return this._writableState!==void 0&&this._writableState.destroyed},set:function(re){this._writableState&&(this._writableState.destroyed=re)}}),s.prototype.destroy=ge.destroy,s.prototype._undestroy=ge.undestroy,s.prototype._destroy=function(re,Q){this.end(),Q(re)}}).call(this,_("_process"),typeof Se!="undefined"?Se:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"./_stream_duplex":179,"./internal/streams/destroy":185,"./internal/streams/stream":186,_process:173,"babel-runtime/core-js/object/define-property":20,"babel-runtime/core-js/set-immediate":25,"babel-runtime/core-js/symbol":27,"babel-runtime/core-js/symbol/has-instance":28,"core-util-is":153,inherits:162,"process-nextick-args":172,"safe-buffer":193,"util-deprecate":205}],184:[function(_,L,E){"use strict";function A(f,o){if(!(f instanceof o))throw new TypeError("Cannot call a class as a function")}function w(f,o,t){f.copy(o,t)}var v=_("safe-buffer").Buffer,u=_("util");L.exports=function(){function f(){A(this,f),this.head=null,this.tail=null,this.length=0}return f.prototype.push=function(o){var t={data:o,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},f.prototype.unshift=function(o){var t={data:o,next:this.head};this.length===0&&(this.tail=t),this.head=t,++this.length},f.prototype.shift=function(){if(this.length!==0){var o=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,o}},f.prototype.clear=function(){this.head=this.tail=null,this.length=0},f.prototype.join=function(o){if(this.length===0)return"";for(var t=this.head,i=""+t.data;t=t.next;)i+=o+t.data;return i},f.prototype.concat=function(o){if(this.length===0)return v.alloc(0);if(this.length===1)return this.head.data;for(var t=v.allocUnsafe(o>>>0),i=this.head,s=0;i;)w(i.data,t,s),s+=i.data.length,i=i.next;return t},f}(),u&&u.inspect&&u.inspect.custom&&(L.exports.prototype[u.inspect.custom]=function(){var f=u.inspect({length:this.length});return this.constructor.name+" "+f})},{"safe-buffer":193,util:36}],185:[function(_,L,E){"use strict";function A(f,o){var t=this,i=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return i||s?(o?o(f):!f||this._writableState&&this._writableState.errorEmitted||u.nextTick(v,this,f),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(f||null,function(h){!o&&h?(u.nextTick(v,t,h),t._writableState&&(t._writableState.errorEmitted=!0)):o&&o(h)}),this)}function w(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function v(f,o){f.emit("error",o)}var u=_("process-nextick-args");L.exports={destroy:A,undestroy:w}},{"process-nextick-args":172}],186:[function(_,L,E){"use strict";L.exports=_("events").EventEmitter},{events:158}],187:[function(_,L,E){L.exports=_("./readable").PassThrough},{"./readable":188}],188:[function(_,L,E){E=L.exports=_("./lib/_stream_readable.js"),E.Stream=E,E.Readable=E,E.Writable=_("./lib/_stream_writable.js"),E.Duplex=_("./lib/_stream_duplex.js"),E.Transform=_("./lib/_stream_transform.js"),E.PassThrough=_("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":179,"./lib/_stream_passthrough.js":180,"./lib/_stream_readable.js":181,"./lib/_stream_transform.js":182,"./lib/_stream_writable.js":183}],189:[function(_,L,E){L.exports=_("./readable").Transform},{"./readable":188}],190:[function(_,L,E){L.exports=_("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":183}],191:[function(_,L,E){var A=function(){return this}()||Function("return this")(),w=A.regeneratorRuntime&&Object.getOwnPropertyNames(A).indexOf("regeneratorRuntime")>=0,v=w&&A.regeneratorRuntime;if(A.regeneratorRuntime=void 0,L.exports=_("./runtime"),w)A.regeneratorRuntime=v;else try{delete A.regeneratorRuntime}catch(u){A.regeneratorRuntime=void 0}},{"./runtime":192}],192:[function(_,L,E){!function(A){"use strict";function w(z,N,H,q){var ee=N&&N.prototype instanceof u?N:u,fe=Object.create(ee.prototype),oe=new l(q||[]);return fe._invoke=s(z,H,oe),fe}function v(z,N,H){try{return{type:"normal",arg:z.call(N,H)}}catch(q){return{type:"throw",arg:q}}}function u(){}function f(){}function o(){}function t(z){["next","throw","return"].forEach(function(N){z[N]=function(H){return this._invoke(N,H)}})}function i(z){function N(ee,fe,oe,he){var se=v(z[ee],z,fe);if(se.type!=="throw"){var ge=se.arg,ie=ge.value;return ie&&typeof ie=="object"&&p.call(ie,"__await")?Promise.resolve(ie.__await).then(function(re){N("next",re,oe,he)},function(re){N("throw",re,oe,he)}):Promise.resolve(ie).then(function(re){ge.value=re,oe(ge)},he)}he(se.arg)}function H(ee,fe){function oe(){return new Promise(function(he,se){N(ee,fe,he,se)})}return q=q?q.then(oe,oe):oe()}var q;this._invoke=H}function s(z,N,H){var q=T;return function(ee,fe){if(q===D)throw new Error("Generator is already running");if(q===k){if(ee==="throw")throw fe;return d()}for(H.method=ee,H.arg=fe;;){var oe=H.delegate;if(oe){var he=h(oe,H);if(he){if(he===B)continue;return he}}if(H.method==="next")H.sent=H._sent=H.arg;else if(H.method==="throw"){if(q===T)throw q=k,H.arg;H.dispatchException(H.arg)}else H.method==="return"&&H.abrupt("return",H.arg);q=D;var se=v(z,N,H);if(se.type==="normal"){if(q=H.done?k:R,se.arg===B)continue;return{value:se.arg,done:H.done}}se.type==="throw"&&(q=k,H.method="throw",H.arg=se.arg)}}}function h(z,N){var H=z.iterator[N.method];if(H===c){if(N.delegate=null,N.method==="throw"){if(z.iterator.return&&(N.method="return",N.arg=c,h(z,N),N.method==="throw"))return B;N.method="throw",N.arg=new TypeError("The iterator does not provide a 'throw' method")}return B}var q=v(H,z.iterator,N.arg);if(q.type==="throw")return N.method="throw",N.arg=q.arg,N.delegate=null,B;var ee=q.arg;return ee?ee.done?(N[z.resultName]=ee.value,N.next=z.nextLoc,N.method!=="return"&&(N.method="next",N.arg=c),N.delegate=null,B):ee:(N.method="throw",N.arg=new TypeError("iterator result is not an object"),N.delegate=null,B)}function a(z){var N={tryLoc:z[0]};1 in z&&(N.catchLoc=z[1]),2 in z&&(N.finallyLoc=z[2],N.afterLoc=z[3]),this.tryEntries.push(N)}function e(z){var N=z.completion||{};N.type="normal",delete N.arg,z.completion=N}function l(z){this.tryEntries=[{tryLoc:"root"}],z.forEach(a,this),this.reset(!0)}function n(z){if(z){var N=z[b];if(N)return N.call(z);if(typeof z.next=="function")return z;if(!isNaN(z.length)){var H=-1,q=function ee(){for(;++H<z.length;)if(p.call(z,H))return ee.value=z[H],ee.done=!1,ee;return ee.value=c,ee.done=!0,ee};return q.next=q}}return{next:d}}function d(){return{value:c,done:!0}}var c,g=Object.prototype,p=g.hasOwnProperty,m=typeof Symbol=="function"?Symbol:{},b=m.iterator||"@@iterator",y=m.asyncIterator||"@@asyncIterator",r=m.toStringTag||"@@toStringTag",x=typeof L=="object",S=A.regeneratorRuntime;if(S)return void(x&&(L.exports=S));S=A.regeneratorRuntime=x?L.exports:{},S.wrap=w;var T="suspendedStart",R="suspendedYield",D="executing",k="completed",B={},G={};G[b]=function(){return this};var P=Object.getPrototypeOf,$=P&&P(P(n([])));$&&$!==g&&p.call($,b)&&(G=$);var X=o.prototype=u.prototype=Object.create(G);f.prototype=X.constructor=o,o.constructor=f,o[r]=f.displayName="GeneratorFunction",S.isGeneratorFunction=function(z){var N=typeof z=="function"&&z.constructor;return!!N&&(N===f||(N.displayName||N.name)==="GeneratorFunction")},S.mark=function(z){return Object.setPrototypeOf?Object.setPrototypeOf(z,o):(z.__proto__=o,r in z||(z[r]="GeneratorFunction")),z.prototype=Object.create(X),z},S.awrap=function(z){return{__await:z}},t(i.prototype),i.prototype[y]=function(){return this},S.AsyncIterator=i,S.async=function(z,N,H,q){var ee=new i(w(z,N,H,q));return S.isGeneratorFunction(N)?ee:ee.next().then(function(fe){return fe.done?fe.value:ee.next()})},t(X),X[r]="Generator",X[b]=function(){return this},X.toString=function(){return"[object Generator]"},S.keys=function(z){var N=[];for(var H in z)N.push(H);return N.reverse(),function q(){for(;N.length;){var ee=N.pop();if(ee in z)return q.value=ee,q.done=!1,q}return q.done=!0,q}},S.values=n,l.prototype={constructor:l,reset:function(z){if(this.prev=0,this.next=0,this.sent=this._sent=c,this.done=!1,this.delegate=null,this.method="next",this.arg=c,this.tryEntries.forEach(e),!z)for(var N in this)N.charAt(0)==="t"&&p.call(this,N)&&!isNaN(+N.slice(1))&&(this[N]=c)},stop:function(){this.done=!0;var z=this.tryEntries[0],N=z.completion;if(N.type==="throw")throw N.arg;return this.rval},dispatchException:function(z){function N(se,ge){return fe.type="throw",fe.arg=z,H.next=se,ge&&(H.method="next",H.arg=c),!!ge}if(this.done)throw z;for(var H=this,q=this.tryEntries.length-1;q>=0;--q){var ee=this.tryEntries[q],fe=ee.completion;if(ee.tryLoc==="root")return N("end");if(ee.tryLoc<=this.prev){var oe=p.call(ee,"catchLoc"),he=p.call(ee,"finallyLoc");if(oe&&he){if(this.prev<ee.catchLoc)return N(ee.catchLoc,!0);if(this.prev<ee.finallyLoc)return N(ee.finallyLoc)}else if(oe){if(this.prev<ee.catchLoc)return N(ee.catchLoc,!0)}else{if(!he)throw new Error("try statement without catch or finally");if(this.prev<ee.finallyLoc)return N(ee.finallyLoc)}}}},abrupt:function(z,N){for(var H=this.tryEntries.length-1;H>=0;--H){var q=this.tryEntries[H];if(q.tryLoc<=this.prev&&p.call(q,"finallyLoc")&&this.prev<q.finallyLoc){var ee=q;break}}ee&&(z==="break"||z==="continue")&&ee.tryLoc<=N&&N<=ee.finallyLoc&&(ee=null);var fe=ee?ee.completion:{};return fe.type=z,fe.arg=N,ee?(this.method="next",this.next=ee.finallyLoc,B):this.complete(fe)},complete:function(z,N){if(z.type==="throw")throw z.arg;return z.type==="break"||z.type==="continue"?this.next=z.arg:z.type==="return"?(this.rval=this.arg=z.arg,this.method="return",this.next="end"):z.type==="normal"&&N&&(this.next=N),B},finish:function(z){for(var N=this.tryEntries.length-1;N>=0;--N){var H=this.tryEntries[N];if(H.finallyLoc===z)return this.complete(H.completion,H.afterLoc),e(H),B}},catch:function(z){for(var N=this.tryEntries.length-1;N>=0;--N){var H=this.tryEntries[N];if(H.tryLoc===z){var q=H.completion;if(q.type==="throw"){var ee=q.arg;e(H)}return ee}}throw new Error("illegal catch attempt")},delegateYield:function(z,N,H){return this.delegate={iterator:n(z),resultName:N,nextLoc:H},this.method==="next"&&(this.arg=c),B}}}(function(){return this}()||Function("return this")())},{}],193:[function(_,L,E){function A(f,o){for(var t in f)o[t]=f[t]}function w(f,o,t){return u(f,o,t)}var v=_("buffer"),u=v.Buffer;u.from&&u.alloc&&u.allocUnsafe&&u.allocUnsafeSlow?L.exports=v:(A(v,E),E.Buffer=w),A(u,w),w.from=function(f,o,t){if(typeof f=="number")throw new TypeError("Argument must not be a number");return u(f,o,t)},w.alloc=function(f,o,t){if(typeof f!="number")throw new TypeError("Argument must be a number");var i=u(f);return o!==void 0?typeof t=="string"?i.fill(o,t):i.fill(o):i.fill(0),i},w.allocUnsafe=function(f){if(typeof f!="number")throw new TypeError("Argument must be a number");return u(f)},w.allocUnsafeSlow=function(f){if(typeof f!="number")throw new TypeError("Argument must be a number");return v.SlowBuffer(f)}},{buffer:38}],194:[function(_,L,E){(function(A){"use strict";function w(d){return d&&d.__esModule?d:{default:d}}var v=_("babel-runtime/core-js/string/from-code-point"),u=w(v),f=_("babel-runtime/core-js/json/stringify"),o=w(f),t=_("babel-runtime/helpers/typeof"),i=w(t),s=_("babel-runtime/core-js/object/define-property"),h=w(s),a=_("babel-runtime/core-js/object/keys"),e=w(a),l=_("babel-runtime/core-js/object/create"),n=w(l);!function(d){function c(M,F){if(!(this instanceof c))return new c(M,F);var ae=this;p(ae),ae.q=ae.c="",ae.bufferCheckPosition=d.MAX_BUFFER_LENGTH,ae.opt=F||{},ae.opt.lowercase=ae.opt.lowercase||ae.opt.lowercasetags,ae.looseCase=ae.opt.lowercase?"toLowerCase":"toUpperCase",ae.tags=[],ae.closed=ae.closedRoot=ae.sawRoot=!1,ae.tag=ae.error=null,ae.strict=!!M,ae.noscript=!(!M&&!ae.opt.noscript),ae.state=O.BEGIN,ae.strictEntities=ae.opt.strictEntities,ae.ENTITIES=ae.strictEntities?(0,n.default)(d.XML_ENTITIES):(0,n.default)(d.ENTITIES),ae.attribList=[],ae.opt.xmlns&&(ae.ns=(0,n.default)(be)),ae.trackPosition=ae.opt.position!==!1,ae.trackPosition&&(ae.position=ae.line=ae.column=0),D(ae,"onready")}function g(M){for(var F=Math.max(d.MAX_BUFFER_LENGTH,10),ae=0,ve=0,Pe=ge.length;ve<Pe;ve++){var Oe=M[ge[ve]].length;if(Oe>F)switch(ge[ve]){case"textNode":B(M);break;case"cdata":k(M,"oncdata",M.cdata),M.cdata="";break;case"script":k(M,"onscript",M.script),M.script="";break;default:P(M,"Max buffer length exceeded: "+ge[ve])}ae=Math.max(ae,Oe)}var De=d.MAX_BUFFER_LENGTH-ae;M.bufferCheckPosition=De+M.position}function p(M){for(var F=0,ae=ge.length;F<ae;F++)M[ge[F]]=""}function m(M){B(M),M.cdata!==""&&(k(M,"oncdata",M.cdata),M.cdata=""),M.script!==""&&(k(M,"onscript",M.script),M.script="")}function b(M,F){return new y(M,F)}function y(M,F){if(!(this instanceof y))return new y(M,F);ie.apply(this),this._parser=new c(M,F),this.writable=!0,this.readable=!0;var ae=this;this._parser.onend=function(){ae.emit("end")},this._parser.onerror=function(ve){ae.emit("error",ve),ae._parser.error=null},this._decoder=null,re.forEach(function(ve){(0,h.default)(ae,"on"+ve,{get:function(){return ae._parser["on"+ve]},set:function(Pe){if(!Pe)return ae.removeAllListeners(ve),ae._parser["on"+ve]=Pe,Pe;ae.on(ve,Pe)},enumerable:!0,configurable:!1})})}function r(M){return M===" "||M===`
|
|
|
`||M==="\r"||M===" "}function x(M){return M==='"'||M==="'"}function S(M){return M===">"||r(M)}function T(M,F){return M.test(F)}function R(M,F){return!T(M,F)}function D(M,F,ae){M[F]&&M[F](ae)}function k(M,F,ae){M.textNode&&B(M),D(M,F,ae)}function B(M){M.textNode=G(M.opt,M.textNode),M.textNode&&D(M,"ontext",M.textNode),M.textNode=""}function G(M,F){return M.trim&&(F=F.trim()),M.normalize&&(F=F.replace(/\s+/g," ")),F}function P(M,F){return B(M),M.trackPosition&&(F+=`
|
|
|
Line: `+M.line+`
|
|
|
Column: `+M.column+`
|
|
|
Char: `+M.c),F=new Error(F),M.error=F,D(M,"onerror",F),M}function $(M){return M.sawRoot&&!M.closedRoot&&X(M,"Unclosed root tag"),M.state!==O.BEGIN&&M.state!==O.BEGIN_WHITESPACE&&M.state!==O.TEXT&&P(M,"Unexpected end"),B(M),M.c="",M.closed=!0,D(M,"onend"),c.call(M,M.strict,M.opt),M}function X(M,F){if((M===void 0?"undefined":(0,i.default)(M))!=="object"||!(M instanceof c))throw new Error("bad call to strictFail");M.strict&&P(M,F)}function z(M){M.strict||(M.tagName=M.tagName[M.looseCase]());var F=M.tags[M.tags.length-1]||M,ae=M.tag={name:M.tagName,attributes:{}};M.opt.xmlns&&(ae.ns=F.ns),M.attribList.length=0,k(M,"onopentagstart",ae)}function N(M,F){var ae=M.indexOf(":"),ve=ae<0?["",M]:M.split(":"),Pe=ve[0],Oe=ve[1];return F&&M==="xmlns"&&(Pe="xmlns",Oe=""),{prefix:Pe,local:Oe}}function H(M){if(M.strict||(M.attribName=M.attribName[M.looseCase]()),M.attribList.indexOf(M.attribName)!==-1||M.tag.attributes.hasOwnProperty(M.attribName))return void(M.attribName=M.attribValue="");if(M.opt.xmlns){var F=N(M.attribName,!0),ae=F.prefix,ve=F.local;if(ae==="xmlns")if(ve==="xml"&&M.attribValue!==ne)X(M,"xml: prefix must be bound to "+ne+`
|
|
|
Actual: `+M.attribValue);else if(ve==="xmlns"&&M.attribValue!==J)X(M,"xmlns: prefix must be bound to "+J+`
|
|
|
Actual: `+M.attribValue);else{var Pe=M.tag,Oe=M.tags[M.tags.length-1]||M;Pe.ns===Oe.ns&&(Pe.ns=(0,n.default)(Oe.ns)),Pe.ns[ve]=M.attribValue}M.attribList.push([M.attribName,M.attribValue])}else M.tag.attributes[M.attribName]=M.attribValue,k(M,"onattribute",{name:M.attribName,value:M.attribValue});M.attribName=M.attribValue=""}function q(M,F){if(M.opt.xmlns){var ae=M.tag,ve=N(M.tagName);ae.prefix=ve.prefix,ae.local=ve.local,ae.uri=ae.ns[ve.prefix]||"",ae.prefix&&!ae.uri&&(X(M,"Unbound namespace prefix: "+(0,o.default)(M.tagName)),ae.uri=ve.prefix);var Pe=M.tags[M.tags.length-1]||M;ae.ns&&Pe.ns!==ae.ns&&(0,e.default)(ae.ns).forEach(function(de){k(M,"onopennamespace",{prefix:de,uri:ae.ns[de]})});for(var Oe=0,De=M.attribList.length;Oe<De;Oe++){var Ne=M.attribList[Oe],Ke=Ne[0],ke=Ne[1],Re=N(Ke,!0),Te=Re.prefix,we=Re.local,xe=Te===""?"":ae.ns[Te]||"",ue={name:Ke,value:ke,prefix:Te,local:we,uri:xe};Te&&Te!=="xmlns"&&!xe&&(X(M,"Unbound namespace prefix: "+(0,o.default)(Te)),ue.uri=Te),M.tag.attributes[Ke]=ue,k(M,"onattribute",ue)}M.attribList.length=0}M.tag.isSelfClosing=!!F,M.sawRoot=!0,M.tags.push(M.tag),k(M,"onopentag",M.tag),F||(M.noscript||M.tagName.toLowerCase()!=="script"?M.state=O.TEXT:M.state=O.SCRIPT,M.tag=null,M.tagName=""),M.attribName=M.attribValue="",M.attribList.length=0}function ee(M){if(!M.tagName)return X(M,"Weird empty close tag."),M.textNode+="</>",void(M.state=O.TEXT);if(M.script){if(M.tagName!=="script")return M.script+="</"+M.tagName+">",M.tagName="",void(M.state=O.SCRIPT);k(M,"onscript",M.script),M.script=""}var F=M.tags.length,ae=M.tagName;M.strict||(ae=ae[M.looseCase]());for(var ve=ae;F--&&!(M.tags[F].name===ve);)X(M,"Unexpected close tag");if(F<0)return X(M,"Unmatched closing tag: "+M.tagName),M.textNode+="</"+M.tagName+">",void(M.state=O.TEXT);M.tagName=ae;for(var Pe=M.tags.length;Pe-- >F;){var Oe=M.tag=M.tags.pop();M.tagName=M.tag.name,k(M,"onclosetag",M.tagName);var De={};for(var Ne in Oe.ns)De[Ne]=Oe.ns[Ne];var Ke=M.tags[M.tags.length-1]||M;M.opt.xmlns&&Oe.ns!==Ke.ns&&(0,e.default)(Oe.ns).forEach(function(ke){var Re=Oe.ns[ke];k(M,"onclosenamespace",{prefix:ke,uri:Re})})}F===0&&(M.closedRoot=!0),M.tagName=M.attribValue=M.attribName="",M.attribList.length=0,M.state=O.TEXT}function fe(M){var F,ae=M.entity,ve=ae.toLowerCase(),Pe="";return M.ENTITIES[ae]?M.ENTITIES[ae]:M.ENTITIES[ve]?M.ENTITIES[ve]:(ae=ve,ae.charAt(0)==="#"&&(ae.charAt(1)==="x"?(ae=ae.slice(2),F=parseInt(ae,16),Pe=F.toString(16)):(ae=ae.slice(1),F=parseInt(ae,10),Pe=F.toString(10))),ae=ae.replace(/^0+/,""),isNaN(F)||Pe.toLowerCase()!==ae?(X(M,"Invalid character entity"),"&"+M.entity+";"):(0,u.default)(F))}function oe(M,F){F==="<"?(M.state=O.OPEN_WAKA,M.startTagPosition=M.position):r(F)||(X(M,"Non-whitespace before first tag."),M.textNode=F,M.state=O.TEXT)}function he(M,F){var ae="";return F<M.length&&(ae=M.charAt(F)),ae}function se(M){var F=this;if(this.error)throw this.error;if(F.closed)return P(F,"Cannot write after close. Assign an onready handler.");if(M===null)return $(F);(M===void 0?"undefined":(0,i.default)(M))==="object"&&(M=M.toString());for(var ae=0,ve="";!(ve=he(M,ae++),F.c=ve,!ve);)switch(F.trackPosition&&(F.position++,ve===`
|
|
|
`?(F.line++,F.column=0):F.column++),F.state){case O.BEGIN:if(F.state=O.BEGIN_WHITESPACE,ve==="\uFEFF")continue;oe(F,ve);continue;case O.BEGIN_WHITESPACE:oe(F,ve);continue;case O.TEXT:if(F.sawRoot&&!F.closedRoot){for(var Pe=ae-1;ve&&ve!=="<"&&ve!=="&";)(ve=he(M,ae++))&&F.trackPosition&&(F.position++,ve===`
|
|
|
`?(F.line++,F.column=0):F.column++);F.textNode+=M.substring(Pe,ae-1)}ve!=="<"||F.sawRoot&&F.closedRoot&&!F.strict?(r(ve)||F.sawRoot&&!F.closedRoot||X(F,"Text data outside of root node."),ve==="&"?F.state=O.TEXT_ENTITY:F.textNode+=ve):(F.state=O.OPEN_WAKA,F.startTagPosition=F.position);continue;case O.SCRIPT:ve==="<"?F.state=O.SCRIPT_ENDING:F.script+=ve;continue;case O.SCRIPT_ENDING:ve==="/"?F.state=O.CLOSE_TAG:(F.script+="<"+ve,F.state=O.SCRIPT);continue;case O.OPEN_WAKA:if(ve==="!")F.state=O.SGML_DECL,F.sgmlDecl="";else if(!r(ve))if(T(Ee,ve))F.state=O.OPEN_TAG,F.tagName=ve;else if(ve==="/")F.state=O.CLOSE_TAG,F.tagName="";else if(ve==="?")F.state=O.PROC_INST,F.procInstName=F.procInstBody="";else{if(X(F,"Unencoded <"),F.startTagPosition+1<F.position){var Oe=F.position-F.startTagPosition;ve=new Array(Oe).join(" ")+ve}F.textNode+="<"+ve,F.state=O.TEXT}continue;case O.SGML_DECL:(F.sgmlDecl+ve).toUpperCase()===Q?(k(F,"onopencdata"),F.state=O.CDATA,F.sgmlDecl="",F.cdata=""):F.sgmlDecl+ve==="--"?(F.state=O.COMMENT,F.comment="",F.sgmlDecl=""):(F.sgmlDecl+ve).toUpperCase()===pe?(F.state=O.DOCTYPE,(F.doctype||F.sawRoot)&&X(F,"Inappropriately located doctype declaration"),F.doctype="",F.sgmlDecl=""):ve===">"?(k(F,"onsgmldeclaration",F.sgmlDecl),F.sgmlDecl="",F.state=O.TEXT):(x(ve)&&(F.state=O.SGML_DECL_QUOTED),F.sgmlDecl+=ve);continue;case O.SGML_DECL_QUOTED:ve===F.q&&(F.state=O.SGML_DECL,F.q=""),F.sgmlDecl+=ve;continue;case O.DOCTYPE:ve===">"?(F.state=O.TEXT,k(F,"ondoctype",F.doctype),F.doctype=!0):(F.doctype+=ve,ve==="["?F.state=O.DOCTYPE_DTD:x(ve)&&(F.state=O.DOCTYPE_QUOTED,F.q=ve));continue;case O.DOCTYPE_QUOTED:F.doctype+=ve,ve===F.q&&(F.q="",F.state=O.DOCTYPE);continue;case O.DOCTYPE_DTD:F.doctype+=ve,ve==="]"?F.state=O.DOCTYPE:x(ve)&&(F.state=O.DOCTYPE_DTD_QUOTED,F.q=ve);continue;case O.DOCTYPE_DTD_QUOTED:F.doctype+=ve,ve===F.q&&(F.state=O.DOCTYPE_DTD,F.q="");continue;case O.COMMENT:ve==="-"?F.state=O.COMMENT_ENDING:F.comment+=ve;continue;case O.COMMENT_ENDING:ve==="-"?(F.state=O.COMMENT_ENDED,F.comment=G(F.opt,F.comment),F.comment&&k(F,"oncomment",F.comment),F.comment=""):(F.comment+="-"+ve,F.state=O.COMMENT);continue;case O.COMMENT_ENDED:ve!==">"?(X(F,"Malformed comment"),F.comment+="--"+ve,F.state=O.COMMENT):F.state=O.TEXT;continue;case O.CDATA:ve==="]"?F.state=O.CDATA_ENDING:F.cdata+=ve;continue;case O.CDATA_ENDING:ve==="]"?F.state=O.CDATA_ENDING_2:(F.cdata+="]"+ve,F.state=O.CDATA);continue;case O.CDATA_ENDING_2:ve===">"?(F.cdata&&k(F,"oncdata",F.cdata),k(F,"onclosecdata"),F.cdata="",F.state=O.TEXT):ve==="]"?F.cdata+="]":(F.cdata+="]]"+ve,F.state=O.CDATA);continue;case O.PROC_INST:ve==="?"?F.state=O.PROC_INST_ENDING:r(ve)?F.state=O.PROC_INST_BODY:F.procInstName+=ve;continue;case O.PROC_INST_BODY:if(!F.procInstBody&&r(ve))continue;ve==="?"?F.state=O.PROC_INST_ENDING:F.procInstBody+=ve;continue;case O.PROC_INST_ENDING:ve===">"?(k(F,"onprocessinginstruction",{name:F.procInstName,body:F.procInstBody}),F.procInstName=F.procInstBody="",F.state=O.TEXT):(F.procInstBody+="?"+ve,F.state=O.PROC_INST_BODY);continue;case O.OPEN_TAG:T(Le,ve)?F.tagName+=ve:(z(F),ve===">"?q(F):ve==="/"?F.state=O.OPEN_TAG_SLASH:(r(ve)||X(F,"Invalid character in tag name"),F.state=O.ATTRIB));continue;case O.OPEN_TAG_SLASH:ve===">"?(q(F,!0),ee(F)):(X(F,"Forward-slash in opening tag not followed by >"),F.state=O.ATTRIB);continue;case O.ATTRIB:if(r(ve))continue;ve===">"?q(F):ve==="/"?F.state=O.OPEN_TAG_SLASH:T(Ee,ve)?(F.attribName=ve,F.attribValue="",F.state=O.ATTRIB_NAME):X(F,"Invalid attribute name");continue;case O.ATTRIB_NAME:ve==="="?F.state=O.ATTRIB_VALUE:ve===">"?(X(F,"Attribute without value"),F.attribValue=F.attribName,H(F),q(F)):r(ve)?F.state=O.ATTRIB_NAME_SAW_WHITE:T(Le,ve)?F.attribName+=ve:X(F,"Invalid attribute name");continue;case O.ATTRIB_NAME_SAW_WHITE:if(ve==="=")F.state=O.ATTRIB_VALUE;else{if(r(ve))continue;X(F,"Attribute without value"),F.tag.attributes[F.attribName]="",F.attribValue="",k(F,"onattribute",{name:F.attribName,value:""}),F.attribName="",ve===">"?q(F):T(Ee,ve)?(F.attribName=ve,F.state=O.ATTRIB_NAME):(X(F,"Invalid attribute name"),F.state=O.ATTRIB)}continue;case O.ATTRIB_VALUE:if(r(ve))continue;x(ve)?(F.q=ve,F.state=O.ATTRIB_VALUE_QUOTED):(X(F,"Unquoted attribute value"),F.state=O.ATTRIB_VALUE_UNQUOTED,F.attribValue=ve);continue;case O.ATTRIB_VALUE_QUOTED:if(ve!==F.q){ve==="&"?F.state=O.ATTRIB_VALUE_ENTITY_Q:F.attribValue+=ve;continue}H(F),F.q="",F.state=O.ATTRIB_VALUE_CLOSED;continue;case O.ATTRIB_VALUE_CLOSED:r(ve)?F.state=O.ATTRIB:ve===">"?q(F):ve==="/"?F.state=O.OPEN_TAG_SLASH:T(Ee,ve)?(X(F,"No whitespace between attributes"),F.attribName=ve,F.attribValue="",F.state=O.ATTRIB_NAME):X(F,"Invalid attribute name");continue;case O.ATTRIB_VALUE_UNQUOTED:if(!S(ve)){ve==="&"?F.state=O.ATTRIB_VALUE_ENTITY_U:F.attribValue+=ve;continue}H(F),ve===">"?q(F):F.state=O.ATTRIB;continue;case O.CLOSE_TAG:if(F.tagName)ve===">"?ee(F):T(Le,ve)?F.tagName+=ve:F.script?(F.script+="</"+F.tagName,F.tagName="",F.state=O.SCRIPT):(r(ve)||X(F,"Invalid tagname in closing tag"),F.state=O.CLOSE_TAG_SAW_WHITE);else{if(r(ve))continue;R(Ee,ve)?F.script?(F.script+="</"+ve,F.state=O.SCRIPT):X(F,"Invalid tagname in closing tag."):F.tagName=ve}continue;case O.CLOSE_TAG_SAW_WHITE:if(r(ve))continue;ve===">"?ee(F):X(F,"Invalid characters in closing tag");continue;case O.TEXT_ENTITY:case O.ATTRIB_VALUE_ENTITY_Q:case O.ATTRIB_VALUE_ENTITY_U:var De,Ne;switch(F.state){case O.TEXT_ENTITY:De=O.TEXT,Ne="textNode";break;case O.ATTRIB_VALUE_ENTITY_Q:De=O.ATTRIB_VALUE_QUOTED,Ne="attribValue";break;case O.ATTRIB_VALUE_ENTITY_U:De=O.ATTRIB_VALUE_UNQUOTED,Ne="attribValue"}ve===";"?(F[Ne]+=fe(F),F.entity="",F.state=De):T(F.entity.length?C:V,ve)?F.entity+=ve:(X(F,"Invalid character in entity name"),F[Ne]+="&"+F.entity+ve,F.entity="",F.state=De);continue;default:throw new Error(F,"Unknown state: "+F.state)}return F.position>=F.bufferCheckPosition&&g(F),F}d.parser=function(M,F){return new c(M,F)},d.SAXParser=c,d.SAXStream=y,d.createStream=b,d.MAX_BUFFER_LENGTH=65536;var ge=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];d.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"],n.default||(Object.create=function(M){function F(){}return F.prototype=M,new F}),e.default||(Object.keys=function(M){var F=[];for(var ae in M)M.hasOwnProperty(ae)&&F.push(ae);return F}),c.prototype={end:function(){$(this)},write:se,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){m(this)}};var ie;try{ie=_("stream").Stream}catch(M){ie=function(){}}var re=d.EVENTS.filter(function(M){return M!=="error"&&M!=="end"});y.prototype=(0,n.default)(ie.prototype,{constructor:{value:y}}),y.prototype.write=function(M){if(typeof A=="function"&&typeof A.isBuffer=="function"&&A.isBuffer(M)){if(!this._decoder){var F=_("string_decoder").StringDecoder;this._decoder=new F("utf8")}M=this._decoder.write(M)}return this._parser.write(M.toString()),this.emit("data",M),!0},y.prototype.end=function(M){return M&&M.length&&this.write(M),this._parser.end(),!0},y.prototype.on=function(M,F){var ae=this;return ae._parser["on"+M]||re.indexOf(M)===-1||(ae._parser["on"+M]=function(){var ve=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);ve.splice(0,0,M),ae.emit.apply(ae,ve)}),ie.prototype.on.call(ae,M,F)};var Q="[CDATA[",pe="DOCTYPE",ne="http://www.w3.org/XML/1998/namespace",J="http://www.w3.org/2000/xmlns/",be={xml:ne,xmlns:J},Ee=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,Le=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,V=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,C=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,O=0;d.STATE={BEGIN:O++,BEGIN_WHITESPACE:O++,TEXT:O++,TEXT_ENTITY:O++,OPEN_WAKA:O++,SGML_DECL:O++,SGML_DECL_QUOTED:O++,DOCTYPE:O++,DOCTYPE_QUOTED:O++,DOCTYPE_DTD:O++,DOCTYPE_DTD_QUOTED:O++,COMMENT_STARTING:O++,COMMENT:O++,COMMENT_ENDING:O++,COMMENT_ENDED:O++,CDATA:O++,CDATA_ENDING:O++,CDATA_ENDING_2:O++,PROC_INST:O++,PROC_INST_BODY:O++,PROC_INST_ENDING:O++,OPEN_TAG:O++,OPEN_TAG_SLASH:O++,ATTRIB:O++,ATTRIB_NAME:O++,ATTRIB_NAME_SAW_WHITE:O++,ATTRIB_VALUE:O++,ATTRIB_VALUE_QUOTED:O++,ATTRIB_VALUE_CLOSED:O++,ATTRIB_VALUE_UNQUOTED:O++,ATTRIB_VALUE_ENTITY_Q:O++,ATTRIB_VALUE_ENTITY_U:O++,CLOSE_TAG:O++,CLOSE_TAG_SAW_WHITE:O++,SCRIPT:O++,SCRIPT_ENDING:O++},d.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},d.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},(0,e.default)(d.ENTITIES).forEach(function(M){var F=d.ENTITIES[M],ae=typeof F=="number"?String.fromCharCode(F):F;d.ENTITIES[M]=ae});for(var j in d.STATE)d.STATE[d.STATE[j]]=j;O=d.STATE,u.default||function(){var M=String.fromCharCode,F=Math.floor,ae=function(){var ve,Pe,Oe=[],De=-1,Ne=arguments.length;if(!Ne)return"";for(var Ke="";++De<Ne;){var ke=Number(arguments[De]);if(!isFinite(ke)||ke<0||ke>1114111||F(ke)!==ke)throw RangeError("Invalid code point: "+ke);ke<=65535?Oe.push(ke):(ke-=65536,ve=55296+(ke>>10),Pe=ke%1024+56320,Oe.push(ve,Pe)),(De+1===Ne||Oe.length>16384)&&(Ke+=M.apply(null,Oe),Oe.length=0)}return Ke};h.default?Object.defineProperty(String,"fromCodePoint",{value:ae,configurable:!0,writable:!0}):String.fromCodePoint=ae}()}(E===void 0?(void 0).sax={}:E)}).call(this,_("buffer").Buffer)},{"babel-runtime/core-js/json/stringify":17,"babel-runtime/core-js/object/create":19,"babel-runtime/core-js/object/define-property":20,"babel-runtime/core-js/object/keys":23,"babel-runtime/core-js/string/from-code-point":26,"babel-runtime/helpers/typeof":32,buffer:38,stream:195,string_decoder:37}],195:[function(_,L,E){function A(){w.call(this)}L.exports=A;var w=_("events").EventEmitter;_("inherits")(A,w),A.Readable=_("readable-stream/readable.js"),A.Writable=_("readable-stream/writable.js"),A.Duplex=_("readable-stream/duplex.js"),A.Transform=_("readable-stream/transform.js"),A.PassThrough=_("readable-stream/passthrough.js"),A.Stream=A,A.prototype.pipe=function(v,u){function f(l){v.writable&&v.write(l)===!1&&a.pause&&a.pause()}function o(){a.readable&&a.resume&&a.resume()}function t(){e||(e=!0,v.end())}function i(){e||(e=!0,typeof v.destroy=="function"&&v.destroy())}function s(l){if(h(),w.listenerCount(this,"error")===0)throw l}function h(){a.removeListener("data",f),v.removeListener("drain",o),a.removeListener("end",t),a.removeListener("close",i),a.removeListener("error",s),v.removeListener("error",s),a.removeListener("end",h),a.removeListener("close",h),v.removeListener("close",h)}var a=this;a.on("data",f),v.on("drain",o),v._isStdio||u&&u.end===!1||(a.on("end",t),a.on("close",i));var e=!1;return a.on("error",s),v.on("error",s),a.on("end",h),a.on("close",h),v.on("close",h),v.emit("pipe",a),v}},{events:158,inherits:162,"readable-stream/duplex.js":178,"readable-stream/passthrough.js":187,"readable-stream/readable.js":188,"readable-stream/transform.js":189,"readable-stream/writable.js":190}],196:[function(_,L,E){(function(A){var w=_("./lib/request"),v=_("./lib/response"),u=_("xtend"),f=_("builtin-status-codes"),o=_("url"),t=E;t.request=function(i,s){i=typeof i=="string"?o.parse(i):u(i);var h=A.location.protocol.search(/^https?:$/)===-1?"http:":"",a=i.protocol||h,e=i.hostname||i.host,l=i.port,n=i.path||"/";e&&e.indexOf(":")!==-1&&(e="["+e+"]"),i.url=(e?a+"//"+e:"")+(l?":"+l:"")+n,i.method=(i.method||"GET").toUpperCase(),i.headers=i.headers||{};var d=new w(i);return s&&d.on("response",s),d},t.get=function(i,s){var h=t.request(i,s);return h.end(),h},t.ClientRequest=w,t.IncomingMessage=v.IncomingMessage,t.Agent=function(){},t.Agent.defaultMaxSockets=4,t.globalAgent=new t.Agent,t.STATUS_CODES=f,t.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]}).call(this,typeof Se!="undefined"?Se:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"./lib/request":198,"./lib/response":199,"builtin-status-codes":39,url:203,xtend:236}],197:[function(_,L,E){(function(A){"use strict";function w(){if(f!==void 0)return f;if(A.XMLHttpRequest){f=new A.XMLHttpRequest;try{f.open("GET",A.XDomainRequest?"/":"https://example.com")}catch(i){f=null}}else f=null;return f}function v(i){var s=w();if(!s)return!1;try{return s.responseType=i,s.responseType===i}catch(h){}return!1}function u(i){return typeof i=="function"}E.fetch=u(A.fetch)&&u(A.ReadableStream),E.writableStream=u(A.WritableStream),E.abortController=u(A.AbortController),E.blobConstructor=!1;try{new Blob([new ArrayBuffer(1)]),E.blobConstructor=!0}catch(i){}var f,o=A.ArrayBuffer!==void 0,t=o&&u(A.ArrayBuffer.prototype.slice);E.arraybuffer=E.fetch||o&&v("arraybuffer"),E.msstream=!E.fetch&&t&&v("ms-stream"),E.mozchunkedarraybuffer=!E.fetch&&o&&v("moz-chunked-arraybuffer"),E.overrideMimeType=E.fetch||!!w()&&u(w().overrideMimeType),E.vbArray=u(A.VBArray),f=null}).call(this,typeof Se!="undefined"?Se:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],198:[function(_,L,E){(function(A,w,v){"use strict";function u(g,p){return i.fetch&&p?"fetch":i.mozchunkedarraybuffer?"moz-chunked-arraybuffer":i.msstream?"ms-stream":i.arraybuffer&&g?"arraybuffer":i.vbArray&&g?"text:vbarray":"text"}function f(g){try{var p=g.status;return p!==null&&p!==0}catch(m){return!1}}var o=_("babel-runtime/core-js/object/keys"),t=function(g){return g&&g.__esModule?g:{default:g}}(o),i=_("./capability"),s=_("inherits"),h=_("./response"),a=_("readable-stream"),e=_("to-arraybuffer"),l=h.IncomingMessage,n=h.readyStates,d=L.exports=function(g){var p=this;a.Writable.call(p),p._opts=g,p._body=[],p._headers={},g.auth&&p.setHeader("Authorization","Basic "+new v(g.auth).toString("base64")),(0,t.default)(g.headers).forEach(function(y){p.setHeader(y,g.headers[y])});var m,b=!0;if(g.mode==="disable-fetch"||"requestTimeout"in g&&!i.abortController)b=!1,m=!0;else if(g.mode==="prefer-streaming")m=!1;else if(g.mode==="allow-wrong-content-type")m=!i.overrideMimeType;else{if(g.mode&&g.mode!=="default"&&g.mode!=="prefer-fast")throw new Error("Invalid value for opts.mode");m=!0}p._mode=u(m,b),p._fetchTimer=null,p.on("finish",function(){p._onFinish()})};s(d,a.Writable),d.prototype.setHeader=function(g,p){var m=this,b=g.toLowerCase();c.indexOf(b)===-1&&(m._headers[b]={name:g,value:p})},d.prototype.getHeader=function(g){var p=this._headers[g.toLowerCase()];return p?p.value:null},d.prototype.removeHeader=function(g){delete this._headers[g.toLowerCase()]},d.prototype._onFinish=function(){var g=this;if(!g._destroyed){var p=g._opts,m=g._headers,b=null;p.method!=="GET"&&p.method!=="HEAD"&&(b=i.arraybuffer?e(v.concat(g._body)):i.blobConstructor?new w.Blob(g._body.map(function(T){return e(T)}),{type:(m["content-type"]||{}).value||""}):v.concat(g._body).toString());var y=[];if((0,t.default)(m).forEach(function(T){var R=m[T].name,D=m[T].value;Array.isArray(D)?D.forEach(function(k){y.push([R,k])}):y.push([R,D])}),g._mode==="fetch"){var r=null;if(i.abortController){var x=new AbortController;r=x.signal,g._fetchAbortController=x,"requestTimeout"in p&&p.requestTimeout!==0&&(g._fetchTimer=w.setTimeout(function(){g.emit("requestTimeout"),g._fetchAbortController&&g._fetchAbortController.abort()},p.requestTimeout))}w.fetch(g._opts.url,{method:g._opts.method,headers:y,body:b||void 0,mode:"cors",credentials:p.withCredentials?"include":"same-origin",signal:r}).then(function(T){g._fetchResponse=T,g._connect()},function(T){w.clearTimeout(g._fetchTimer),g._destroyed||g.emit("error",T)})}else{var S=g._xhr=new w.XMLHttpRequest;try{S.open(g._opts.method,g._opts.url,!0)}catch(T){return void A.nextTick(function(){g.emit("error",T)})}"responseType"in S&&(S.responseType=g._mode.split(":")[0]),"withCredentials"in S&&(S.withCredentials=!!p.withCredentials),g._mode==="text"&&"overrideMimeType"in S&&S.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in p&&(S.timeout=p.requestTimeout,S.ontimeout=function(){g.emit("requestTimeout")}),y.forEach(function(T){S.setRequestHeader(T[0],T[1])}),g._response=null,S.onreadystatechange=function(){switch(S.readyState){case n.LOADING:case n.DONE:g._onXHRProgress()}},g._mode==="moz-chunked-arraybuffer"&&(S.onprogress=function(){g._onXHRProgress()}),S.onerror=function(){g._destroyed||g.emit("error",new Error("XHR error"))};try{S.send(b)}catch(T){return void A.nextTick(function(){g.emit("error",T)})}}}},d.prototype._onXHRProgress=function(){var g=this;f(g._xhr)&&!g._destroyed&&(g._response||g._connect(),g._response._onXHRProgress())},d.prototype._connect=function(){var g=this;g._destroyed||(g._response=new l(g._xhr,g._fetchResponse,g._mode,g._fetchTimer),g._response.on("error",function(p){g.emit("error",p)}),g.emit("response",g._response))},d.prototype._write=function(g,p,m){this._body.push(g),m()},d.prototype.abort=d.prototype.destroy=function(){var g=this;g._destroyed=!0,w.clearTimeout(g._fetchTimer),g._response&&(g._response._destroyed=!0),g._xhr?g._xhr.abort():g._fetchAbortController&&g._fetchAbortController.abort()},d.prototype.end=function(g,p,m){var b=this;typeof g=="function"&&(m=g,g=void 0),a.Writable.prototype.end.call(b,g,p,m)},d.prototype.flushHeaders=function(){},d.prototype.setTimeout=function(){},d.prototype.setNoDelay=function(){},d.prototype.setSocketKeepAlive=function(){};var c=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","user-agent","via"]}).call(this,_("_process"),typeof Se!="undefined"?Se:typeof self!="undefined"?self:typeof window!="undefined"?window:{},_("buffer").Buffer)},{"./capability":197,"./response":199,_process:173,"babel-runtime/core-js/object/keys":23,buffer:38,inherits:162,"readable-stream":188,"to-arraybuffer":202}],199:[function(_,L,E){(function(A,w,v){"use strict";var u=_("babel-runtime/core-js/promise"),f=function(a){return a&&a.__esModule?a:{default:a}}(u),o=_("./capability"),t=_("inherits"),i=_("readable-stream"),s=E.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},h=E.IncomingMessage=function(a,e,l,n){var d=this;if(i.Readable.call(d),d._mode=l,d.headers={},d.rawHeaders=[],d.trailers={},d.rawTrailers=[],d.on("end",function(){A.nextTick(function(){d.emit("close")})}),l==="fetch"){if(d._fetchResponse=e,d.url=e.url,d.statusCode=e.status,d.statusMessage=e.statusText,e.headers.forEach(function(b,y){d.headers[y.toLowerCase()]=b,d.rawHeaders.push(y,b)}),o.writableStream){var c=new WritableStream({write:function(b){return new f.default(function(y,r){d._destroyed?r():d.push(new v(b))?y():d._resumeFetch=y})},close:function(){w.clearTimeout(n),d._destroyed||d.push(null)},abort:function(b){d._destroyed||d.emit("error",b)}});try{return void e.body.pipeTo(c).catch(function(b){w.clearTimeout(n),d._destroyed||d.emit("error",b)})}catch(b){}}var g=e.body.getReader();!function b(){g.read().then(function(y){if(!d._destroyed){if(y.done)return w.clearTimeout(n),void d.push(null);d.push(new v(y.value)),b()}}).catch(function(y){w.clearTimeout(n),d._destroyed||d.emit("error",y)})}()}else if(d._xhr=a,d._pos=0,d.url=a.responseURL,d.statusCode=a.status,d.statusMessage=a.statusText,a.getAllResponseHeaders().split(/\r?\n/).forEach(function(b){var y=b.match(/^([^:]+):\s*(.*)/);if(y){var r=y[1].toLowerCase();r==="set-cookie"?(d.headers[r]===void 0&&(d.headers[r]=[]),d.headers[r].push(y[2])):d.headers[r]!==void 0?d.headers[r]+=", "+y[2]:d.headers[r]=y[2],d.rawHeaders.push(y[1],y[2])}}),d._charset="x-user-defined",!o.overrideMimeType){var p=d.rawHeaders["mime-type"];if(p){var m=p.match(/;\s*charset=([^;])(;|$)/);m&&(d._charset=m[1].toLowerCase())}d._charset||(d._charset="utf-8")}};t(h,i.Readable),h.prototype._read=function(){var a=this,e=a._resumeFetch;e&&(a._resumeFetch=null,e())},h.prototype._onXHRProgress=function(){var a=this,e=a._xhr,l=null;switch(a._mode){case"text:vbarray":if(e.readyState!==s.DONE)break;try{l=new w.VBArray(e.responseBody).toArray()}catch(p){}if(l!==null){a.push(new v(l));break}case"text":try{l=e.responseText}catch(p){a._mode="text:vbarray";break}if(l.length>a._pos){var n=l.substr(a._pos);if(a._charset==="x-user-defined"){for(var d=new v(n.length),c=0;c<n.length;c++)d[c]=255&n.charCodeAt(c);a.push(d)}else a.push(n,a._charset);a._pos=l.length}break;case"arraybuffer":if(e.readyState!==s.DONE||!e.response)break;l=e.response,a.push(new v(new Uint8Array(l)));break;case"moz-chunked-arraybuffer":if(l=e.response,e.readyState!==s.LOADING||!l)break;a.push(new v(new Uint8Array(l)));break;case"ms-stream":if(l=e.response,e.readyState!==s.LOADING)break;var g=new w.MSStreamReader;g.onprogress=function(){g.result.byteLength>a._pos&&(a.push(new v(new Uint8Array(g.result.slice(a._pos)))),a._pos=g.result.byteLength)},g.onload=function(){a.push(null)},g.readAsArrayBuffer(l)}a._xhr.readyState===s.DONE&&a._mode!=="ms-stream"&&a.push(null)}}).call(this,_("_process"),typeof Se!="undefined"?Se:typeof self!="undefined"?self:typeof window!="undefined"?window:{},_("buffer").Buffer)},{"./capability":197,_process:173,"babel-runtime/core-js/promise":24,buffer:38,inherits:162,"readable-stream":188}],200:[function(_,L,E){"use strict";function A(p){if(!p)return"utf8";for(var m;;)switch(p){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return p;default:if(m)return;p=(""+p).toLowerCase(),m=!0}}function w(p){var m=A(p);if(typeof m!="string"&&(c.isEncoding===g||!g(p)))throw new Error("Unknown encoding: "+p);return m||p}function v(p){this.encoding=w(p);var m;switch(this.encoding){case"utf16le":this.text=h,this.end=a,m=4;break;case"utf8":this.fillLast=t,m=4;break;case"base64":this.text=e,this.end=l,m=3;break;default:return this.write=n,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=c.allocUnsafe(m)}function u(p){return p<=127?0:p>>5==6?2:p>>4==14?3:p>>3==30?4:p>>6==2?-1:-2}function f(p,m,b){var y=m.length-1;if(y<b)return 0;var r=u(m[y]);return r>=0?(r>0&&(p.lastNeed=r-1),r):--y<b||r===-2?0:(r=u(m[y]))>=0?(r>0&&(p.lastNeed=r-2),r):--y<b||r===-2?0:(r=u(m[y]),r>=0?(r>0&&(r===2?r=0:p.lastNeed=r-3),r):0)}function o(p,m,b){if((192&m[0])!=128)return p.lastNeed=0,"\u951F\uFFFD";if(p.lastNeed>1&&m.length>1){if((192&m[1])!=128)return p.lastNeed=1,"\u951F\uFFFD";if(p.lastNeed>2&&m.length>2&&(192&m[2])!=128)return p.lastNeed=2,"\u951F\uFFFD"}}function t(p){var m=this.lastTotal-this.lastNeed,b=o(this,p,m);return b!==void 0?b:this.lastNeed<=p.length?(p.copy(this.lastChar,m,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(p.copy(this.lastChar,m,0,p.length),void(this.lastNeed-=p.length))}function i(p,m){var b=f(this,p,m);if(!this.lastNeed)return p.toString("utf8",m);this.lastTotal=b;var y=p.length-(b-this.lastNeed);return p.copy(this.lastChar,0,y),p.toString("utf8",m,y)}function s(p){var m=p&&p.length?this.write(p):"";return this.lastNeed?m+"\u951F\uFFFD":m}function h(p,m){if((p.length-m)%2==0){var b=p.toString("utf16le",m);if(b){var y=b.charCodeAt(b.length-1);if(y>=55296&&y<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=p[p.length-2],this.lastChar[1]=p[p.length-1],b.slice(0,-1)}return b}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=p[p.length-1],p.toString("utf16le",m,p.length-1)}function a(p){var m=p&&p.length?this.write(p):"";if(this.lastNeed){var b=this.lastTotal-this.lastNeed;return m+this.lastChar.toString("utf16le",0,b)}return m}function e(p,m){var b=(p.length-m)%3;return b===0?p.toString("base64",m):(this.lastNeed=3-b,this.lastTotal=3,b===1?this.lastChar[0]=p[p.length-1]:(this.lastChar[0]=p[p.length-2],this.lastChar[1]=p[p.length-1]),p.toString("base64",m,p.length-b))}function l(p){var m=p&&p.length?this.write(p):"";return this.lastNeed?m+this.lastChar.toString("base64",0,3-this.lastNeed):m}function n(p){return p.toString(this.encoding)}function d(p){return p&&p.length?this.write(p):""}var c=_("safe-buffer").Buffer,g=c.isEncoding||function(p){switch((p=""+p)&&p.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};E.StringDecoder=v,v.prototype.write=function(p){if(p.length===0)return"";var m,b;if(this.lastNeed){if((m=this.fillLast(p))===void 0)return"";b=this.lastNeed,this.lastNeed=0}else b=0;return b<p.length?m?m+this.text(p,b):this.text(p,b):m||""},v.prototype.end=s,v.prototype.text=i,v.prototype.fillLast=function(p){if(this.lastNeed<=p.length)return p.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);p.copy(this.lastChar,this.lastTotal-this.lastNeed,0,p.length),this.lastNeed-=p.length}},{"safe-buffer":193}],201:[function(_,L,E){(function(A,w){function v(s,h){this._id=s,this._clearFn=h}var u=_("process/browser.js").nextTick,f=Function.prototype.apply,o=Array.prototype.slice,t={},i=0;E.setTimeout=function(){return new v(f.call(setTimeout,window,arguments),clearTimeout)},E.setInterval=function(){return new v(f.call(setInterval,window,arguments),clearInterval)},E.clearTimeout=E.clearInterval=function(s){s.close()},v.prototype.unref=v.prototype.ref=function(){},v.prototype.close=function(){this._clearFn.call(window,this._id)},E.enroll=function(s,h){clearTimeout(s._idleTimeoutId),s._idleTimeout=h},E.unenroll=function(s){clearTimeout(s._idleTimeoutId),s._idleTimeout=-1},E._unrefActive=E.active=function(s){clearTimeout(s._idleTimeoutId);var h=s._idleTimeout;h>=0&&(s._idleTimeoutId=setTimeout(function(){s._onTimeout&&s._onTimeout()},h))},E.setImmediate=typeof A=="function"?A:function(s){var h=i++,a=!(arguments.length<2)&&o.call(arguments,1);return t[h]=!0,u(function(){t[h]&&(a?s.apply(null,a):s.call(null),E.clearImmediate(h))}),h},E.clearImmediate=typeof w=="function"?w:function(s){delete t[s]}}).call(this,_("timers").setImmediate,_("timers").clearImmediate)},{"process/browser.js":173,timers:201}],202:[function(_,L,E){var A=_("buffer").Buffer;L.exports=function(w){if(w instanceof Uint8Array){if(w.byteOffset===0&&w.byteLength===w.buffer.byteLength)return w.buffer;if(typeof w.buffer.slice=="function")return w.buffer.slice(w.byteOffset,w.byteOffset+w.byteLength)}if(A.isBuffer(w)){for(var v=new Uint8Array(w.length),u=w.length,f=0;f<u;f++)v[f]=w[f];return v.buffer}throw new Error("Argument must be a Buffer")}},{buffer:38}],203:[function(_,L,E){"use strict";function A(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function w(r,x,S){if(r&&t.isObject(r)&&r instanceof A)return r;var T=new A;return T.parse(r,x,S),T}function v(r){return t.isString(r)&&(r=w(r)),r instanceof A?r.format():A.prototype.format.call(r)}function u(r,x){return w(r,!1,!0).resolve(x)}function f(r,x){return r?w(r,!1,!0).resolveObject(x):x}var o=_("punycode"),t=_("./util");E.parse=w,E.resolve=u,E.resolveObject=f,E.format=v,E.Url=A;var i=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,h=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,a=["<",">",'"',"`"," ","\r",`
|
|
|
`," "],e=["{","}","|","\\","^","`"].concat(a),l=["'"].concat(e),n=["%","/","?",";","#"].concat(l),d=["/","?","#"],c=/^[+a-z0-9A-Z_-]{0,63}$/,g=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,p={javascript:!0,"javascript:":!0},m={javascript:!0,"javascript:":!0},b={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},y=_("querystring");A.prototype.parse=function(r,x,S){if(!t.isString(r))throw new TypeError("Parameter 'url' must be a string, not "+typeof r);var T=r.indexOf("?"),R=T!==-1&&T<r.indexOf("#")?"?":"#",D=r.split(R),k=/\\/g;D[0]=D[0].replace(k,"/"),r=D.join(R);var B=r;if(B=B.trim(),!S&&r.split("#").length===1){var G=h.exec(B);if(G)return this.path=B,this.href=B,this.pathname=G[1],G[2]?(this.search=G[2],this.query=x?y.parse(this.search.substr(1)):this.search.substr(1)):x&&(this.search="",this.query={}),this}var P=i.exec(B);if(P){P=P[0];var $=P.toLowerCase();this.protocol=$,B=B.substr(P.length)}if(S||P||B.match(/^\/\/[^@\/]+@[^@\/]+/)){var X=B.substr(0,2)==="//";!X||P&&m[P]||(B=B.substr(2),this.slashes=!0)}if(!m[P]&&(X||P&&!b[P])){for(var z=-1,N=0;N<d.length;N++){var H=B.indexOf(d[N]);H!==-1&&(z===-1||H<z)&&(z=H)}var q,ee;ee=z===-1?B.lastIndexOf("@"):B.lastIndexOf("@",z),ee!==-1&&(q=B.slice(0,ee),B=B.slice(ee+1),this.auth=decodeURIComponent(q)),z=-1;for(var N=0;N<n.length;N++){var H=B.indexOf(n[N]);H!==-1&&(z===-1||H<z)&&(z=H)}z===-1&&(z=B.length),this.host=B.slice(0,z),B=B.slice(z),this.parseHost(),this.hostname=this.hostname||"";var fe=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!fe)for(var oe=this.hostname.split(/\./),N=0,he=oe.length;N<he;N++){var se=oe[N];if(se&&!se.match(c)){for(var ge="",ie=0,re=se.length;ie<re;ie++)se.charCodeAt(ie)>127?ge+="x":ge+=se[ie];if(!ge.match(c)){var Q=oe.slice(0,N),pe=oe.slice(N+1),ne=se.match(g);ne&&(Q.push(ne[1]),pe.unshift(ne[2])),pe.length&&(B="/"+pe.join(".")+B),this.hostname=Q.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),fe||(this.hostname=o.toASCII(this.hostname));var J=this.port?":"+this.port:"",be=this.hostname||"";this.host=be+J,this.href+=this.host,fe&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),B[0]!=="/"&&(B="/"+B))}if(!p[$])for(var N=0,he=l.length;N<he;N++){var Ee=l[N];if(B.indexOf(Ee)!==-1){var Le=encodeURIComponent(Ee);Le===Ee&&(Le=escape(Ee)),B=B.split(Ee).join(Le)}}var V=B.indexOf("#");V!==-1&&(this.hash=B.substr(V),B=B.slice(0,V));var C=B.indexOf("?");if(C!==-1?(this.search=B.substr(C),this.query=B.substr(C+1),x&&(this.query=y.parse(this.query)),B=B.slice(0,C)):x&&(this.search="",this.query={}),B&&(this.pathname=B),b[$]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var J=this.pathname||"",O=this.search||"";this.path=J+O}return this.href=this.format(),this},A.prototype.format=function(){var r=this.auth||"";r&&(r=encodeURIComponent(r),r=r.replace(/%3A/i,":"),r+="@");var x=this.protocol||"",S=this.pathname||"",T=this.hash||"",R=!1,D="";this.host?R=r+this.host:this.hostname&&(R=r+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(R+=":"+this.port)),this.query&&t.isObject(this.query)&&Object.keys(this.query).length&&(D=y.stringify(this.query));var k=this.search||D&&"?"+D||"";return x&&x.substr(-1)!==":"&&(x+=":"),this.slashes||(!x||b[x])&&R!==!1?(R="//"+(R||""),S&&S.charAt(0)!=="/"&&(S="/"+S)):R||(R=""),T&&T.charAt(0)!=="#"&&(T="#"+T),k&&k.charAt(0)!=="?"&&(k="?"+k),S=S.replace(/[?#]/g,function(B){return encodeURIComponent(B)}),k=k.replace("#","%23"),x+R+S+k+T},A.prototype.resolve=function(r){return this.resolveObject(w(r,!1,!0)).format()},A.prototype.resolveObject=function(r){if(t.isString(r)){var x=new A;x.parse(r,!1,!0),r=x}for(var S=new A,T=Object.keys(this),R=0;R<T.length;R++){var D=T[R];S[D]=this[D]}if(S.hash=r.hash,r.href==="")return S.href=S.format(),S;if(r.slashes&&!r.protocol){for(var k=Object.keys(r),B=0;B<k.length;B++){var G=k[B];G!=="protocol"&&(S[G]=r[G])}return b[S.protocol]&&S.hostname&&!S.pathname&&(S.path=S.pathname="/"),S.href=S.format(),S}if(r.protocol&&r.protocol!==S.protocol){if(!b[r.protocol]){for(var P=Object.keys(r),$=0;$<P.length;$++){var X=P[$];S[X]=r[X]}return S.href=S.format(),S}if(S.protocol=r.protocol,r.host||m[r.protocol])S.pathname=r.pathname;else{for(var he=(r.pathname||"").split("/");he.length&&!(r.host=he.shift()););r.host||(r.host=""),r.hostname||(r.hostname=""),he[0]!==""&&he.unshift(""),he.length<2&&he.unshift(""),S.pathname=he.join("/")}if(S.search=r.search,S.query=r.query,S.host=r.host||"",S.auth=r.auth,S.hostname=r.hostname||r.host,S.port=r.port,S.pathname||S.search){var z=S.pathname||"",N=S.search||"";S.path=z+N}return S.slashes=S.slashes||r.slashes,S.href=S.format(),S}var H=S.pathname&&S.pathname.charAt(0)==="/",q=r.host||r.pathname&&r.pathname.charAt(0)==="/",ee=q||H||S.host&&r.pathname,fe=ee,oe=S.pathname&&S.pathname.split("/")||[],he=r.pathname&&r.pathname.split("/")||[],se=S.protocol&&!b[S.protocol];if(se&&(S.hostname="",S.port=null,S.host&&(oe[0]===""?oe[0]=S.host:oe.unshift(S.host)),S.host="",r.protocol&&(r.hostname=null,r.port=null,r.host&&(he[0]===""?he[0]=r.host:he.unshift(r.host)),r.host=null),ee=ee&&(he[0]===""||oe[0]==="")),q)S.host=r.host||r.host===""?r.host:S.host,S.hostname=r.hostname||r.hostname===""?r.hostname:S.hostname,S.search=r.search,S.query=r.query,oe=he;else if(he.length)oe||(oe=[]),oe.pop(),oe=oe.concat(he),S.search=r.search,S.query=r.query;else if(!t.isNullOrUndefined(r.search)){if(se){S.hostname=S.host=oe.shift();var ge=!!(S.host&&S.host.indexOf("@")>0)&&S.host.split("@");ge&&(S.auth=ge.shift(),S.host=S.hostname=ge.shift())}return S.search=r.search,S.query=r.query,t.isNull(S.pathname)&&t.isNull(S.search)||(S.path=(S.pathname?S.pathname:"")+(S.search?S.search:"")),S.href=S.format(),S}if(!oe.length)return S.pathname=null,S.search?S.path="/"+S.search:S.path=null,S.href=S.format(),S;for(var ie=oe.slice(-1)[0],re=(S.host||r.host||oe.length>1)&&(ie==="."||ie==="..")||ie==="",Q=0,pe=oe.length;pe>=0;pe--)ie=oe[pe],ie==="."?oe.splice(pe,1):ie===".."?(oe.splice(pe,1),Q++):Q&&(oe.splice(pe,1),Q--);if(!ee&&!fe)for(;Q--;Q)oe.unshift("..");!ee||oe[0]===""||oe[0]&&oe[0].charAt(0)==="/"||oe.unshift(""),re&&oe.join("/").substr(-1)!=="/"&&oe.push("");var ne=oe[0]===""||oe[0]&&oe[0].charAt(0)==="/";if(se){S.hostname=S.host=ne?"":oe.length?oe.shift():"";var ge=!!(S.host&&S.host.indexOf("@")>0)&&S.host.split("@");ge&&(S.auth=ge.shift(),S.host=S.hostname=ge.shift())}return ee=ee||S.host&&oe.length,ee&&!ne&&oe.unshift(""),oe.length?S.pathname=oe.join("/"):(S.pathname=null,S.path=null),t.isNull(S.pathname)&&t.isNull(S.search)||(S.path=(S.pathname?S.pathname:"")+(S.search?S.search:"")),S.auth=r.auth||S.auth,S.slashes=S.slashes||r.slashes,S.href=S.format(),S},A.prototype.parseHost=function(){var r=this.host,x=s.exec(r);x&&(x=x[0],x!==":"&&(this.port=x.substr(1)),r=r.substr(0,r.length-x.length)),r&&(this.hostname=r)}},{"./util":204,punycode:174,querystring:177}],204:[function(_,L,E){"use strict";L.exports={isString:function(A){return typeof A=="string"},isObject:function(A){return typeof A=="object"&&A!==null},isNull:function(A){return A===null},isNullOrUndefined:function(A){return A==null}}},{}],205:[function(_,L,E){(function(A){function w(u,f){function o(){if(!t){if(v("throwDeprecation"))throw new Error(f);v("traceDeprecation")?console.trace(f):console.warn(f),t=!0}return u.apply(this,arguments)}if(v("noDeprecation"))return u;var t=!1;return o}function v(u){try{if(!A.localStorage)return!1}catch(o){return!1}var f=A.localStorage[u];return f!=null&&String(f).toLowerCase()==="true"}L.exports=w}).call(this,typeof Se!="undefined"?Se:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],206:[function(_,L,E){L.exports=function(A){return A&&typeof A=="object"&&typeof A.copy=="function"&&typeof A.fill=="function"&&typeof A.readUInt8=="function"}},{}],207:[function(_,L,E){(function(A,w){function v(N,H){var q={seen:[],stylize:f};return arguments.length>=3&&(q.depth=arguments[2]),arguments.length>=4&&(q.colors=arguments[3]),n(H)?q.showHidden=H:H&&E._extend(q,H),b(q.showHidden)&&(q.showHidden=!1),b(q.depth)&&(q.depth=2),b(q.colors)&&(q.colors=!1),b(q.customInspect)&&(q.customInspect=!0),q.colors&&(q.stylize=u),t(q,N,q.depth)}function u(N,H){var q=v.styles[H];return q?"["+v.colors[q][0]+"m"+N+"["+v.colors[q][1]+"m":N}function f(N,H){return N}function o(N){var H={};return N.forEach(function(q,ee){H[q]=!0}),H}function t(N,H,q){if(N.customInspect&&H&&T(H.inspect)&&H.inspect!==E.inspect&&(!H.constructor||H.constructor.prototype!==H)){var ee=H.inspect(q,N);return p(ee)||(ee=t(N,ee,q)),ee}var fe=i(N,H);if(fe)return fe;var oe=Object.keys(H),he=o(oe);if(N.showHidden&&(oe=Object.getOwnPropertyNames(H)),S(H)&&(oe.indexOf("message")>=0||oe.indexOf("description")>=0))return s(H);if(oe.length===0){if(T(H)){var se=H.name?": "+H.name:"";return N.stylize("[Function"+se+"]","special")}if(y(H))return N.stylize(RegExp.prototype.toString.call(H),"regexp");if(x(H))return N.stylize(Date.prototype.toString.call(H),"date");if(S(H))return s(H)}var ge="",ie=!1,re=["{","}"];if((l(H)&&(ie=!0,re=["[","]"]),T(H))&&(ge=" [Function"+(H.name?": "+H.name:"")+"]"),y(H)&&(ge=" "+RegExp.prototype.toString.call(H)),x(H)&&(ge=" "+Date.prototype.toUTCString.call(H)),S(H)&&(ge=" "+s(H)),oe.length===0&&(!ie||H.length==0))return re[0]+ge+re[1];if(q<0)return y(H)?N.stylize(RegExp.prototype.toString.call(H),"regexp"):N.stylize("[Object]","special");N.seen.push(H);var Q;return Q=ie?h(N,H,q,he,oe):oe.map(function(pe){return a(N,H,q,he,pe,ie)}),N.seen.pop(),e(Q,ge,re)}function i(N,H){if(b(H))return N.stylize("undefined","undefined");if(p(H)){var q="'"+JSON.stringify(H).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return N.stylize(q,"string")}return g(H)?N.stylize(""+H,"number"):n(H)?N.stylize(""+H,"boolean"):d(H)?N.stylize("null","null"):void 0}function s(N){return"["+Error.prototype.toString.call(N)+"]"}function h(N,H,q,ee,fe){for(var oe=[],he=0,se=H.length;he<se;++he)G(H,String(he))?oe.push(a(N,H,q,ee,String(he),!0)):oe.push("");return fe.forEach(function(ge){ge.match(/^\d+$/)||oe.push(a(N,H,q,ee,ge,!0))}),oe}function a(N,H,q,ee,fe,oe){var he,se,ge;if(ge=Object.getOwnPropertyDescriptor(H,fe)||{value:H[fe]},ge.get?se=ge.set?N.stylize("[Getter/Setter]","special"):N.stylize("[Getter]","special"):ge.set&&(se=N.stylize("[Setter]","special")),G(ee,fe)||(he="["+fe+"]"),se||(N.seen.indexOf(ge.value)<0?(se=d(q)?t(N,ge.value,null):t(N,ge.value,q-1),se.indexOf(`
|
|
|
`)>-1&&(se=oe?se.split(`
|
|
|
`).map(function(ie){return" "+ie}).join(`
|
|
|
`).substr(2):`
|
|
|
`+se.split(`
|
|
|
`).map(function(ie){return" "+ie}).join(`
|
|
|
`))):se=N.stylize("[Circular]","special")),b(he)){if(oe&&fe.match(/^\d+$/))return se;he=JSON.stringify(""+fe),he.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(he=he.substr(1,he.length-2),he=N.stylize(he,"name")):(he=he.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),he=N.stylize(he,"string"))}return he+": "+se}function e(N,H,q){var ee=0;return N.reduce(function(fe,oe){return ee++,oe.indexOf(`
|
|
|
`)>=0&&ee++,fe+oe.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?q[0]+(H===""?"":H+`
|
|
|
`)+" "+N.join(`,
|
|
|
`)+" "+q[1]:q[0]+H+" "+N.join(", ")+" "+q[1]}function l(N){return Array.isArray(N)}function n(N){return typeof N=="boolean"}function d(N){return N===null}function c(N){return N==null}function g(N){return typeof N=="number"}function p(N){return typeof N=="string"}function m(N){return typeof N=="symbol"}function b(N){return N===void 0}function y(N){return r(N)&&D(N)==="[object RegExp]"}function r(N){return typeof N=="object"&&N!==null}function x(N){return r(N)&&D(N)==="[object Date]"}function S(N){return r(N)&&(D(N)==="[object Error]"||N instanceof Error)}function T(N){return typeof N=="function"}function R(N){return N===null||typeof N=="boolean"||typeof N=="number"||typeof N=="string"||typeof N=="symbol"||N===void 0}function D(N){return Object.prototype.toString.call(N)}function k(N){return N<10?"0"+N.toString(10):N.toString(10)}function B(){var N=new Date,H=[k(N.getHours()),k(N.getMinutes()),k(N.getSeconds())].join(":");return[N.getDate(),z[N.getMonth()],H].join(" ")}function G(N,H){return Object.prototype.hasOwnProperty.call(N,H)}var P=/%[sdj%]/g;E.format=function(N){if(!p(N)){for(var H=[],q=0;q<arguments.length;q++)H.push(v(arguments[q]));return H.join(" ")}for(var q=1,ee=arguments,fe=ee.length,oe=String(N).replace(P,function(ge){if(ge==="%%")return"%";if(q>=fe)return ge;switch(ge){case"%s":return String(ee[q++]);case"%d":return Number(ee[q++]);case"%j":try{return JSON.stringify(ee[q++])}catch(ie){return"[Circular]"}default:return ge}}),he=ee[q];q<fe;he=ee[++q])d(he)||!r(he)?oe+=" "+he:oe+=" "+v(he);return oe},E.deprecate=function(N,H){function q(){if(!ee){if(A.throwDeprecation)throw new Error(H);A.traceDeprecation?console.trace(H):console.error(H),ee=!0}return N.apply(this,arguments)}if(b(w.process))return function(){return E.deprecate(N,H).apply(this,arguments)};if(A.noDeprecation===!0)return N;var ee=!1;return q};var $,X={};E.debuglog=function(N){if(b($)&&($=A.env.NODE_DEBUG||""),N=N.toUpperCase(),!X[N])if(new RegExp("\\b"+N+"\\b","i").test($)){var H=A.pid;X[N]=function(){var q=E.format.apply(E,arguments);console.error("%s %d: %s",N,H,q)}}else X[N]=function(){};return X[N]},E.inspect=v,v.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},v.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},E.isArray=l,E.isBoolean=n,E.isNull=d,E.isNullOrUndefined=c,E.isNumber=g,E.isString=p,E.isSymbol=m,E.isUndefined=b,E.isRegExp=y,E.isObject=r,E.isDate=x,E.isError=S,E.isFunction=T,E.isPrimitive=R,E.isBuffer=_("./support/isBuffer");var z=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];E.log=function(){console.log("%s - %s",B(),E.format.apply(E,arguments))},E.inherits=_("inherits"),E._extend=function(N,H){if(!H||!r(H))return N;for(var q=Object.keys(H),ee=q.length;ee--;)N[q[ee]]=H[q[ee]];return N}}).call(this,_("_process"),typeof Se!="undefined"?Se:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"./support/isBuffer":206,_process:173,inherits:162}],208:[function(_,L,E){"use strict";(function(){E.stripBOM=function(A){return A[0]==="\uFEFF"?A.substring(1):A}}).call(void 0)},{}],209:[function(_,L,E){"use strict";function A(o){return o&&o.__esModule?o:{default:o}}var w=_("babel-runtime/helpers/typeof"),v=A(w),u=_("babel-runtime/core-js/object/keys"),f=A(u);(function(){var o,t,i,s,h,a={}.hasOwnProperty;o=_("xmlbuilder"),t=_("./defaults").defaults,s=function(e){return typeof e=="string"&&(e.indexOf("&")>=0||e.indexOf(">")>=0||e.indexOf("<")>=0)},h=function(e){return"<![CDATA["+i(e)+"]]>"},i=function(e){return e.replace("]]>","]]]]><![CDATA[>")},E.Builder=function(){function e(l){var n,d,c;this.options={},d=t[.2];for(n in d)a.call(d,n)&&(c=d[n],this.options[n]=c);for(n in l)a.call(l,n)&&(c=l[n],this.options[n]=c)}return e.prototype.buildObject=function(l){var n,d,c,g,p;return n=this.options.attrkey,d=this.options.charkey,(0,f.default)(l).length===1&&this.options.rootName===t[.2].rootName?(p=(0,f.default)(l)[0],l=l[p]):p=this.options.rootName,c=function(m){return function(b,y){var r,x,S,T,R,D;if((y===void 0?"undefined":(0,v.default)(y))!=="object")m.options.cdata&&s(y)?b.raw(h(y)):b.txt(y);else if(Array.isArray(y)){for(T in y)if(a.call(y,T)){x=y[T];for(R in x)S=x[R],b=c(b.ele(R),S).up()}}else for(R in y)if(a.call(y,R))if(x=y[R],R===n){if((x===void 0?"undefined":(0,v.default)(x))==="object")for(r in x)D=x[r],b=b.att(r,D)}else if(R===d)b=m.options.cdata&&s(x)?b.raw(h(x)):b.txt(x);else if(Array.isArray(x))for(T in x)a.call(x,T)&&(S=x[T],b=typeof S=="string"?m.options.cdata&&s(S)?b.ele(R).raw(h(S)).up():b.ele(R,S).up():c(b.ele(R),S).up());else(x===void 0?"undefined":(0,v.default)(x))==="object"?b=c(b.ele(R),x).up():typeof x=="string"&&m.options.cdata&&s(x)?b=b.ele(R).raw(h(x)).up():(x==null&&(x=""),b=b.ele(R,x.toString()).up());return b}}(this),g=o.create(p,this.options.xmldec,this.options.doctype,{headless:this.options.headless,allowSurrogateChars:this.options.allowSurrogateChars}),c(g,l).end(this.options.renderOpts)},e}()}).call(void 0)},{"./defaults":210,"babel-runtime/core-js/object/keys":23,"babel-runtime/helpers/typeof":32,xmlbuilder:235}],210:[function(_,L,E){"use strict";(function(){E.defaults={.1:{explicitCharkey:!1,trim:!0,normalize:!0,normalizeTags:!1,attrkey:"@",charkey:"#",explicitArray:!1,ignoreAttrs:!1,mergeAttrs:!1,explicitRoot:!1,validator:null,xmlns:!1,explicitChildren:!1,childkey:"@@",charsAsChildren:!1,includeWhiteChars:!1,async:!1,strict:!0,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,emptyTag:""},.2:{explicitCharkey:!1,trim:!1,normalize:!1,normalizeTags:!1,attrkey:"$",charkey:"_",explicitArray:!0,ignoreAttrs:!1,mergeAttrs:!1,explicitRoot:!0,validator:null,xmlns:!1,explicitChildren:!1,preserveChildrenOrder:!1,childkey:"$$",charsAsChildren:!1,includeWhiteChars:!1,async:!1,strict:!0,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,rootName:"root",xmldec:{version:"1.0",encoding:"UTF-8",standalone:!0},doctype:null,renderOpts:{pretty:!0,indent:" ",newline:`
|
|
|
`},headless:!1,chunkSize:1e4,emptyTag:"",cdata:!1}}}).call(void 0)},{}],211:[function(_,L,E){"use strict";function A(i){return i&&i.__esModule?i:{default:i}}var w=_("babel-runtime/core-js/object/get-own-property-names"),v=A(w),u=_("babel-runtime/core-js/object/keys"),f=A(u),o=_("babel-runtime/helpers/typeof"),t=A(o);(function(){var i,s,h,a,e,l,n,d,c=function(m,b){return function(){return m.apply(b,arguments)}},g=function(m,b){function y(){this.constructor=m}for(var r in b)p.call(b,r)&&(m[r]=b[r]);return y.prototype=b.prototype,m.prototype=new y,m.__super__=b.prototype,m},p={}.hasOwnProperty;n=_("sax"),h=_("events"),i=_("./bom"),l=_("./processors"),d=_("timers").setImmediate,s=_("./defaults").defaults,a=function(m){return(m===void 0?"undefined":(0,t.default)(m))==="object"&&m!=null&&(0,f.default)(m).length===0},e=function(m,b,y){var r,x,S;for(r=0,x=m.length;r<x;r++)S=m[r],b=S(b,y);return b},E.Parser=function(m){function b(y){this.parseString=c(this.parseString,this),this.reset=c(this.reset,this),this.assignOrPush=c(this.assignOrPush,this),this.processAsync=c(this.processAsync,this);var r,x,S;if(!(this instanceof E.Parser))return new E.Parser(y);this.options={},x=s[.2];for(r in x)p.call(x,r)&&(S=x[r],this.options[r]=S);for(r in y)p.call(y,r)&&(S=y[r],this.options[r]=S);this.options.xmlns&&(this.options.xmlnskey=this.options.attrkey+"ns"),this.options.normalizeTags&&(this.options.tagNameProcessors||(this.options.tagNameProcessors=[]),this.options.tagNameProcessors.unshift(l.normalize)),this.reset()}return g(b,m),b.prototype.processAsync=function(){var y,r;try{return this.remaining.length<=this.options.chunkSize?(y=this.remaining,this.remaining="",this.saxParser=this.saxParser.write(y),this.saxParser.close()):(y=this.remaining.substr(0,this.options.chunkSize),this.remaining=this.remaining.substr(this.options.chunkSize,this.remaining.length),this.saxParser=this.saxParser.write(y),d(this.processAsync))}catch(x){if(r=x,!this.saxParser.errThrown)return this.saxParser.errThrown=!0,this.emit(r)}},b.prototype.assignOrPush=function(y,r,x){return r in y?(y[r]instanceof Array||(y[r]=[y[r]]),y[r].push(x)):this.options.explicitArray?y[r]=[x]:y[r]=x},b.prototype.reset=function(){var y,r,x,S;return this.removeAllListeners(),this.saxParser=n.parser(this.options.strict,{trim:!1,normalize:!1,xmlns:this.options.xmlns}),this.saxParser.errThrown=!1,this.saxParser.onerror=function(T){return function(R){if(T.saxParser.resume(),!T.saxParser.errThrown)return T.saxParser.errThrown=!0,T.emit("error",R)}}(this),this.saxParser.onend=function(T){return function(){if(!T.saxParser.ended)return T.saxParser.ended=!0,T.emit("end",T.resultObject)}}(this),this.saxParser.ended=!1,this.EXPLICIT_CHARKEY=this.options.explicitCharkey,this.resultObject=null,S=[],y=this.options.attrkey,r=this.options.charkey,this.saxParser.onopentag=function(T){return function(R){var D,k,B,G,P;if(B={},B[r]="",!T.options.ignoreAttrs){P=R.attributes;for(D in P)p.call(P,D)&&(y in B||T.options.mergeAttrs||(B[y]={}),k=T.options.attrValueProcessors?e(T.options.attrValueProcessors,R.attributes[D],D):R.attributes[D],G=T.options.attrNameProcessors?e(T.options.attrNameProcessors,D):D,T.options.mergeAttrs?T.assignOrPush(B,G,k):B[y][G]=k)}return B["#name"]=T.options.tagNameProcessors?e(T.options.tagNameProcessors,R.name):R.name,T.options.xmlns&&(B[T.options.xmlnskey]={uri:R.uri,local:R.local}),S.push(B)}}(this),this.saxParser.onclosetag=function(T){return function(){var R,D,k,B,G,P,$,X,z,N;if(P=S.pop(),G=P["#name"],T.options.explicitChildren&&T.options.preserveChildrenOrder||delete P["#name"],P.cdata===!0&&(R=P.cdata,delete P.cdata),z=S[S.length-1],P[r].match(/^\s*$/)&&!R?(D=P[r],delete P[r]):(T.options.trim&&(P[r]=P[r].trim()),T.options.normalize&&(P[r]=P[r].replace(/\s{2,}/g," ").trim()),P[r]=T.options.valueProcessors?e(T.options.valueProcessors,P[r],G):P[r],(0,f.default)(P).length===1&&r in P&&!T.EXPLICIT_CHARKEY&&(P=P[r])),a(P)&&(P=T.options.emptyTag!==""?T.options.emptyTag:D),T.options.validator!=null&&(N="/"+function(){var H,q,ee;for(ee=[],H=0,q=S.length;H<q;H++)B=S[H],ee.push(B["#name"]);return ee}().concat(G).join("/"),function(){var H;try{P=T.options.validator(N,z&&z[G],P)}catch(q){return H=q,T.emit("error",H)}}()),T.options.explicitChildren&&!T.options.mergeAttrs&&(P===void 0?"undefined":(0,t.default)(P))==="object")if(T.options.preserveChildrenOrder){if(z){z[T.options.childkey]=z[T.options.childkey]||[],$={};for(k in P)p.call(P,k)&&($[k]=P[k]);z[T.options.childkey].push($),delete P["#name"],(0,f.default)(P).length===1&&r in P&&!T.EXPLICIT_CHARKEY&&(P=P[r])}}else B={},T.options.attrkey in P&&(B[T.options.attrkey]=P[T.options.attrkey],delete P[T.options.attrkey]),!T.options.charsAsChildren&&T.options.charkey in P&&(B[T.options.charkey]=P[T.options.charkey],delete P[T.options.charkey]),(0,v.default)(P).length>0&&(B[T.options.childkey]=P),P=B;return S.length>0?T.assignOrPush(z,G,P):(T.options.explicitRoot&&(X=P,P={},P[G]=X),T.resultObject=P,T.saxParser.ended=!0,T.emit("end",T.resultObject))}}(this),x=function(T){return function(R){var D,k;if(k=S[S.length-1])return k[r]+=R,T.options.explicitChildren&&T.options.preserveChildrenOrder&&T.options.charsAsChildren&&(T.options.includeWhiteChars||R.replace(/\\n/g,"").trim()!=="")&&(k[T.options.childkey]=k[T.options.childkey]||[],D={"#name":"__text__"},D[r]=R,T.options.normalize&&(D[r]=D[r].replace(/\s{2,}/g," ").trim()),k[T.options.childkey].push(D)),k}}(this),this.saxParser.ontext=x,this.saxParser.oncdata=function(T){return function(R){var D;if(D=x(R))return D.cdata=!0}}()},b.prototype.parseString=function(y,r){var x;r!=null&&typeof r=="function"&&(this.on("end",function(S){return this.reset(),r(null,S)}),this.on("error",function(S){return this.reset(),r(S)}));try{return y=y.toString(),y.trim()===""?(this.emit("end",null),!0):(y=i.stripBOM(y),this.options.async?(this.remaining=y,d(this.processAsync),this.saxParser):this.saxParser.write(y).close())}catch(S){if(x=S,!this.saxParser.errThrown&&!this.saxParser.ended)return this.emit("error",x),this.saxParser.errThrown=!0;if(this.saxParser.ended)throw x}},b}(h.EventEmitter),E.parseString=function(m,b,y){var r,x,S;return y!=null?(typeof y=="function"&&(r=y),(b===void 0?"undefined":(0,t.default)(b))==="object"&&(x=b)):(typeof b=="function"&&(r=b),x={}),S=new E.Parser(x),S.parseString(m,r)}}).call(void 0)},{"./bom":208,"./defaults":210,"./processors":212,"babel-runtime/core-js/object/get-own-property-names":21,"babel-runtime/core-js/object/keys":23,"babel-runtime/helpers/typeof":32,events:158,sax:194,timers:201}],212:[function(_,L,E){"use strict";(function(){var A;A=new RegExp(/(?!xmlns)^.*:/),E.normalize=function(w){return w.toLowerCase()},E.firstCharLowerCase=function(w){return w.charAt(0).toLowerCase()+w.slice(1)},E.stripPrefix=function(w){return w.replace(A,"")},E.parseNumbers=function(w){return isNaN(w)||(w=w%1==0?parseInt(w,10):parseFloat(w)),w},E.parseBooleans=function(w){return/^(?:true|false)$/i.test(w)&&(w=w.toLowerCase()==="true"),w}}).call(void 0)},{}],213:[function(_,L,E){"use strict";(function(){var A,w,v,u,f=function(t,i){function s(){this.constructor=t}for(var h in i)o.call(i,h)&&(t[h]=i[h]);return s.prototype=i.prototype,t.prototype=new s,t.__super__=i.prototype,t},o={}.hasOwnProperty;w=_("./defaults"),A=_("./builder"),v=_("./parser"),u=_("./processors"),E.defaults=w.defaults,E.processors=u,E.ValidationError=function(t){function i(s){this.message=s}return f(i,t),i}(Error),E.Builder=A.Builder,E.Parser=v.Parser,E.parseString=v.parseString}).call(void 0)},{"./builder":209,"./defaults":210,"./parser":211,"./processors":212}],214:[function(_,L,E){"use strict";function A(i){return i&&i.__esModule?i:{default:i}}var w=_("babel-runtime/core-js/object/get-prototype-of"),v=A(w),u=_("babel-runtime/helpers/typeof"),f=A(u),o=_("babel-runtime/core-js/object/assign"),t=A(o);(function(){var i,s,h,a,e,l,n=[].slice,d={}.hasOwnProperty;i=function(){var c,g,p,m,b,y;if(y=arguments[0],b=2<=arguments.length?n.call(arguments,1):[],a(t.default))t.default.apply(null,arguments);else for(c=0,p=b.length;c<p;c++)if((m=b[c])!=null)for(g in m)d.call(m,g)&&(y[g]=m[g]);return y},a=function(c){return!!c&&Object.prototype.toString.call(c)==="[object Function]"},e=function(c){var g;return!!c&&((g=c===void 0?"undefined":(0,f.default)(c))==="function"||g==="object")},s=function(c){return a(Array.isArray)?Array.isArray(c):Object.prototype.toString.call(c)==="[object Array]"},h=function(c){var g;if(s(c))return!c.length;for(g in c)if(d.call(c,g))return!1;return!0},l=function(c){var g,p;return e(c)&&(p=(0,v.default)(c))&&(g=p.constructor)&&typeof g=="function"&&g instanceof g&&Function.prototype.toString.call(g)===Function.prototype.toString.call(Object)},L.exports.assign=i,L.exports.isFunction=a,L.exports.isObject=e,L.exports.isArray=s,L.exports.isEmpty=h,L.exports.isPlainObject=l}).call(void 0)},{"babel-runtime/core-js/object/assign":18,"babel-runtime/core-js/object/get-prototype-of":22,"babel-runtime/helpers/typeof":32}],215:[function(_,L,E){"use strict";var A=_("babel-runtime/core-js/object/create"),w=function(v){return v&&v.__esModule?v:{default:v}}(A);(function(){L.exports=function(){function v(u,f,o){if(this.options=u.options,this.stringify=u.stringify,f==null)throw new Error("Missing attribute name of element "+u.name);if(o==null)throw new Error("Missing attribute value for attribute "+f+" of element "+u.name);this.name=this.stringify.attName(f),this.value=this.stringify.attValue(o)}return v.prototype.clone=function(){return(0,w.default)(this)},v.prototype.toString=function(u){return this.options.writer.set(u).attribute(this)},v}()}).call(void 0)},{"babel-runtime/core-js/object/create":19}],216:[function(_,L,E){"use strict";var A=_("babel-runtime/core-js/object/create"),w=function(v){return v&&v.__esModule?v:{default:v}}(A);(function(){var v,u=function(o,t){function i(){this.constructor=o}for(var s in t)f.call(t,s)&&(o[s]=t[s]);return i.prototype=t.prototype,o.prototype=new i,o.__super__=t.prototype,o},f={}.hasOwnProperty;v=_("./XMLNode"),L.exports=function(o){function t(i,s){if(t.__super__.constructor.call(this,i),s==null)throw new Error("Missing CDATA text");this.text=this.stringify.cdata(s)}return u(t,o),t.prototype.clone=function(){return(0,w.default)(this)},t.prototype.toString=function(i){return this.options.writer.set(i).cdata(this)},t}(v)}).call(void 0)},{"./XMLNode":227,"babel-runtime/core-js/object/create":19}],217:[function(_,L,E){"use strict";var A=_("babel-runtime/core-js/object/create"),w=function(v){return v&&v.__esModule?v:{default:v}}(A);(function(){var v,u=function(o,t){function i(){this.constructor=o}for(var s in t)f.call(t,s)&&(o[s]=t[s]);return i.prototype=t.prototype,o.prototype=new i,o.__super__=t.prototype,o},f={}.hasOwnProperty;v=_("./XMLNode"),L.exports=function(o){function t(i,s){if(t.__super__.constructor.call(this,i),s==null)throw new Error("Missing comment text");this.text=this.stringify.comment(s)}return u(t,o),t.prototype.clone=function(){return(0,w.default)(this)},t.prototype.toString=function(i){return this.options.writer.set(i).comment(this)},t}(v)}).call(void 0)},{"./XMLNode":227,"babel-runtime/core-js/object/create":19}],218:[function(_,L,E){"use strict";(function(){var A,w=function(u,f){function o(){this.constructor=u}for(var t in f)v.call(f,t)&&(u[t]=f[t]);return o.prototype=f.prototype,u.prototype=new o,u.__super__=f.prototype,u},v={}.hasOwnProperty;A=_("./XMLNode"),L.exports=function(u){function f(o,t,i,s,h,a){if(f.__super__.constructor.call(this,o),t==null)throw new Error("Missing DTD element name");if(i==null)throw new Error("Missing DTD attribute name");if(!s)throw new Error("Missing DTD attribute type");if(!h)throw new Error("Missing DTD attribute default");if(h.indexOf("#")!==0&&(h="#"+h),!h.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/))throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT");if(a&&!h.match(/^(#FIXED|#DEFAULT)$/))throw new Error("Default value only applies to #FIXED or #DEFAULT");this.elementName=this.stringify.eleName(t),this.attributeName=this.stringify.attName(i),this.attributeType=this.stringify.dtdAttType(s),this.defaultValue=this.stringify.dtdAttDefault(a),this.defaultValueType=h}return w(f,u),f.prototype.toString=function(o){return this.options.writer.set(o).dtdAttList(this)},f}(A)}).call(void 0)},{"./XMLNode":227}],219:[function(_,L,E){"use strict";(function(){var A,w=function(u,f){function o(){this.constructor=u}for(var t in f)v.call(f,t)&&(u[t]=f[t]);return o.prototype=f.prototype,u.prototype=new o,u.__super__=f.prototype,u},v={}.hasOwnProperty;A=_("./XMLNode"),L.exports=function(u){function f(o,t,i){if(f.__super__.constructor.call(this,o),t==null)throw new Error("Missing DTD element name");i||(i="(#PCDATA)"),Array.isArray(i)&&(i="("+i.join(",")+")"),this.name=this.stringify.eleName(t),this.value=this.stringify.dtdElementValue(i)}return w(f,u),f.prototype.toString=function(o){return this.options.writer.set(o).dtdElement(this)},f}(A)}).call(void 0)},{"./XMLNode":227}],220:[function(_,L,E){"use strict";(function(){var A,w,v=function(f,o){function t(){this.constructor=f}for(var i in o)u.call(o,i)&&(f[i]=o[i]);return t.prototype=o.prototype,f.prototype=new t,f.__super__=o.prototype,f},u={}.hasOwnProperty;w=_("./Utility").isObject,A=_("./XMLNode"),L.exports=function(f){function o(t,i,s,h){if(o.__super__.constructor.call(this,t),s==null)throw new Error("Missing entity name");if(h==null)throw new Error("Missing entity value");if(this.pe=!!i,this.name=this.stringify.eleName(s),w(h)){if(!h.pubID&&!h.sysID)throw new Error("Public and/or system identifiers are required for an external entity");if(h.pubID&&!h.sysID)throw new Error("System identifier is required for a public external entity");if(h.pubID!=null&&(this.pubID=this.stringify.dtdPubID(h.pubID)),h.sysID!=null&&(this.sysID=this.stringify.dtdSysID(h.sysID)),h.nData!=null&&(this.nData=this.stringify.dtdNData(h.nData)),this.pe&&this.nData)throw new Error("Notation declaration is not allowed in a parameter entity")}else this.value=this.stringify.dtdEntityValue(h)}return v(o,f),o.prototype.toString=function(t){return this.options.writer.set(t).dtdEntity(this)},o}(A)}).call(void 0)},{"./Utility":214,"./XMLNode":227}],221:[function(_,L,E){"use strict";(function(){var A,w=function(u,f){function o(){this.constructor=u}for(var t in f)v.call(f,t)&&(u[t]=f[t]);return o.prototype=f.prototype,u.prototype=new o,u.__super__=f.prototype,u},v={}.hasOwnProperty;A=_("./XMLNode"),L.exports=function(u){function f(o,t,i){if(f.__super__.constructor.call(this,o),t==null)throw new Error("Missing notation name");if(!i.pubID&&!i.sysID)throw new Error("Public or system identifiers are required for an external entity");this.name=this.stringify.eleName(t),i.pubID!=null&&(this.pubID=this.stringify.dtdPubID(i.pubID)),i.sysID!=null&&(this.sysID=this.stringify.dtdSysID(i.sysID))}return w(f,u),f.prototype.toString=function(o){return this.options.writer.set(o).dtdNotation(this)},f}(A)}).call(void 0)},{"./XMLNode":227}],222:[function(_,L,E){"use strict";(function(){var A,w,v=function(f,o){function t(){this.constructor=f}for(var i in o)u.call(o,i)&&(f[i]=o[i]);return t.prototype=o.prototype,f.prototype=new t,f.__super__=o.prototype,f},u={}.hasOwnProperty;w=_("./Utility").isObject,A=_("./XMLNode"),L.exports=function(f){function o(t,i,s,h){var a;o.__super__.constructor.call(this,t),w(i)&&(a=i,i=a.version,s=a.encoding,h=a.standalone),i||(i="1.0"),this.version=this.stringify.xmlVersion(i),s!=null&&(this.encoding=this.stringify.xmlEncoding(s)),h!=null&&(this.standalone=this.stringify.xmlStandalone(h))}return v(o,f),o.prototype.toString=function(t){return this.options.writer.set(t).declaration(this)},o}(A)}).call(void 0)},{"./Utility":214,"./XMLNode":227}],223:[function(_,L,E){"use strict";(function(){var A,w,v,u,f,o,t=function(s,h){function a(){this.constructor=s}for(var e in h)i.call(h,e)&&(s[e]=h[e]);return a.prototype=h.prototype,s.prototype=new a,s.__super__=h.prototype,s},i={}.hasOwnProperty;o=_("./Utility").isObject,f=_("./XMLNode"),A=_("./XMLDTDAttList"),v=_("./XMLDTDEntity"),w=_("./XMLDTDElement"),u=_("./XMLDTDNotation"),L.exports=function(s){function h(a,e,l){var n,d;h.__super__.constructor.call(this,a),this.documentObject=a,o(e)&&(n=e,e=n.pubID,l=n.sysID),l==null&&(d=[e,l],l=d[0],e=d[1]),e!=null&&(this.pubID=this.stringify.dtdPubID(e)),l!=null&&(this.sysID=this.stringify.dtdSysID(l))}return t(h,s),h.prototype.element=function(a,e){var l;return l=new w(this,a,e),this.children.push(l),this},h.prototype.attList=function(a,e,l,n,d){var c;return c=new A(this,a,e,l,n,d),this.children.push(c),this},h.prototype.entity=function(a,e){var l;return l=new v(this,!1,a,e),this.children.push(l),this},h.prototype.pEntity=function(a,e){var l;return l=new v(this,!0,a,e),this.children.push(l),this},h.prototype.notation=function(a,e){var l;return l=new u(this,a,e),this.children.push(l),this},h.prototype.toString=function(a){return this.options.writer.set(a).docType(this)},h.prototype.ele=function(a,e){return this.element(a,e)},h.prototype.att=function(a,e,l,n,d){return this.attList(a,e,l,n,d)},h.prototype.ent=function(a,e){return this.entity(a,e)},h.prototype.pent=function(a,e){return this.pEntity(a,e)},h.prototype.not=function(a,e){return this.notation(a,e)},h.prototype.up=function(){return this.root()||this.documentObject},h}(f)}).call(void 0)},{"./Utility":214,"./XMLDTDAttList":218,"./XMLDTDElement":219,"./XMLDTDEntity":220,"./XMLDTDNotation":221,"./XMLNode":227}],224:[function(_,L,E){"use strict";(function(){var A,w,v,u,f=function(t,i){function s(){this.constructor=t}for(var h in i)o.call(i,h)&&(t[h]=i[h]);return s.prototype=i.prototype,t.prototype=new s,t.__super__=i.prototype,t},o={}.hasOwnProperty;u=_("./Utility").isPlainObject,A=_("./XMLNode"),v=_("./XMLStringifier"),w=_("./XMLStringWriter"),L.exports=function(t){function i(s){i.__super__.constructor.call(this,null),s||(s={}),s.writer||(s.writer=new w),this.options=s,this.stringify=new v(s),this.isDocument=!0}return f(i,t),i.prototype.end=function(s){var h;return s?u(s)&&(h=s,s=this.options.writer.set(h)):s=this.options.writer,s.document(this)},i.prototype.toString=function(s){return this.options.writer.set(s).document(this)},i}(A)}).call(void 0)},{"./Utility":214,"./XMLNode":227,"./XMLStringWriter":231,"./XMLStringifier":232}],225:[function(_,L,E){"use strict";(function(){var A,w,v,u,f,o,t,i,s,h,a,e,l,n,d,c,g,p,m,b={}.hasOwnProperty;m=_("./Utility"),g=m.isObject,c=m.isFunction,p=m.isPlainObject,h=_("./XMLElement"),w=_("./XMLCData"),v=_("./XMLComment"),e=_("./XMLRaw"),d=_("./XMLText"),a=_("./XMLProcessingInstruction"),i=_("./XMLDeclaration"),s=_("./XMLDocType"),u=_("./XMLDTDAttList"),o=_("./XMLDTDEntity"),f=_("./XMLDTDElement"),t=_("./XMLDTDNotation"),A=_("./XMLAttribute"),n=_("./XMLStringifier"),l=_("./XMLStringWriter"),L.exports=function(){function y(r,x,S){var T;r||(r={}),r.writer?p(r.writer)&&(T=r.writer,r.writer=new l(T)):r.writer=new l(r),this.options=r,this.writer=r.writer,this.stringify=new n(r),this.onDataCallback=x||function(){},this.onEndCallback=S||function(){},this.currentNode=null,this.currentLevel=-1,this.openTags={},this.documentStarted=!1,this.documentCompleted=!1,this.root=null}return y.prototype.node=function(r,x,S){var T;if(r==null)throw new Error("Missing node name");if(this.root&&this.currentLevel===-1)throw new Error("Document can only have one root node");return this.openCurrent(),r=r.valueOf(),x==null&&(x={}),x=x.valueOf(),g(x)||(T=[x,S],S=T[0],x=T[1]),this.currentNode=new h(this,r,x),this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,S!=null&&this.text(S),this},y.prototype.element=function(r,x,S){return this.currentNode&&this.currentNode instanceof s?this.dtdElement.apply(this,arguments):this.node(r,x,S)},y.prototype.attribute=function(r,x){var S,T;if(!this.currentNode||this.currentNode.children)throw new Error("att() can only be used immediately after an ele() call in callback mode");if(r!=null&&(r=r.valueOf()),g(r))for(S in r)b.call(r,S)&&(T=r[S],this.attribute(S,T));else c(x)&&(x=x.apply()),this.options.skipNullAttributes&&x==null||(this.currentNode.attributes[r]=new A(this,r,x));return this},y.prototype.text=function(r){var x;return this.openCurrent(),x=new d(this,r),this.onData(this.writer.text(x,this.currentLevel+1)),this},y.prototype.cdata=function(r){var x;return this.openCurrent(),x=new w(this,r),this.onData(this.writer.cdata(x,this.currentLevel+1)),this},y.prototype.comment=function(r){var x;return this.openCurrent(),x=new v(this,r),this.onData(this.writer.comment(x,this.currentLevel+1)),this},y.prototype.raw=function(r){var x;return this.openCurrent(),x=new e(this,r),this.onData(this.writer.raw(x,this.currentLevel+1)),this},y.prototype.instruction=function(r,x){var S,T,R,D,k;if(this.openCurrent(),r!=null&&(r=r.valueOf()),x!=null&&(x=x.valueOf()),Array.isArray(r))for(S=0,D=r.length;S<D;S++)T=r[S],this.instruction(T);else if(g(r))for(T in r)b.call(r,T)&&(R=r[T],this.instruction(T,R));else c(x)&&(x=x.apply()),k=new a(this,r,x),this.onData(this.writer.processingInstruction(k,this.currentLevel+1));return this},y.prototype.declaration=function(r,x,S){var T;if(this.openCurrent(),this.documentStarted)throw new Error("declaration() must be the first node");return T=new i(this,r,x,S),this.onData(this.writer.declaration(T,this.currentLevel+1)),this},y.prototype.doctype=function(r,x,S){if(this.openCurrent(),r==null)throw new Error("Missing root node name");if(this.root)throw new Error("dtd() must come before the root node");return this.currentNode=new s(this,x,S),this.currentNode.rootNodeName=r,this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,this},y.prototype.dtdElement=function(r,x){var S;return this.openCurrent(),S=new f(this,r,x),this.onData(this.writer.dtdElement(S,this.currentLevel+1)),this},y.prototype.attList=function(r,x,S,T,R){var D;return this.openCurrent(),D=new u(this,r,x,S,T,R),this.onData(this.writer.dtdAttList(D,this.currentLevel+1)),this},y.prototype.entity=function(r,x){var S;return this.openCurrent(),S=new o(this,!1,r,x),this.onData(this.writer.dtdEntity(S,this.currentLevel+1)),this},y.prototype.pEntity=function(r,x){var S;return this.openCurrent(),S=new o(this,!0,r,x),this.onData(this.writer.dtdEntity(S,this.currentLevel+1)),this},y.prototype.notation=function(r,x){var S;return this.openCurrent(),S=new t(this,r,x),this.onData(this.writer.dtdNotation(S,this.currentLevel+1)),this},y.prototype.up=function(){if(this.currentLevel<0)throw new Error("The document node has no parent");return this.currentNode?(this.currentNode.children?this.closeNode(this.currentNode):this.openNode(this.currentNode),this.currentNode=null):this.closeNode(this.openTags[this.currentLevel]),delete this.openTags[this.currentLevel],this.currentLevel--,this},y.prototype.end=function(){for(;this.currentLevel>=0;)this.up();return this.onEnd()},y.prototype.openCurrent=function(){if(this.currentNode)return this.currentNode.children=!0,this.openNode(this.currentNode)},y.prototype.openNode=function(r){if(!r.isOpen)return!this.root&&this.currentLevel===0&&r instanceof h&&(this.root=r),this.onData(this.writer.openNode(r,this.currentLevel)),r.isOpen=!0},y.prototype.closeNode=function(r){if(!r.isClosed)return this.onData(this.writer.closeNode(r,this.currentLevel)),r.isClosed=!0},y.prototype.onData=function(r){return this.documentStarted=!0,this.onDataCallback(r)},y.prototype.onEnd=function(){return this.documentCompleted=!0,this.onEndCallback()},y.prototype.ele=function(){return this.element.apply(this,arguments)},y.prototype.nod=function(r,x,S){return this.node(r,x,S)},y.prototype.txt=function(r){return this.text(r)},y.prototype.dat=function(r){return this.cdata(r)},y.prototype.com=function(r){return this.comment(r)},y.prototype.ins=function(r,x){return this.instruction(r,x)},y.prototype.dec=function(r,x,S){return this.declaration(r,x,S)},y.prototype.dtd=function(r,x,S){return this.doctype(r,x,S)},y.prototype.e=function(r,x,S){return this.element(r,x,S)},y.prototype.n=function(r,x,S){return this.node(r,x,S)},y.prototype.t=function(r){return this.text(r)},y.prototype.d=function(r){return this.cdata(r)},y.prototype.c=function(r){return this.comment(r)},y.prototype.r=function(r){return this.raw(r)},y.prototype.i=function(r,x){return this.instruction(r,x)},y.prototype.att=function(){return this.currentNode&&this.currentNode instanceof s?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},y.prototype.a=function(){return this.currentNode&&this.currentNode instanceof s?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},y.prototype.ent=function(r,x){return this.entity(r,x)},y.prototype.pent=function(r,x){return this.pEntity(r,x)},y.prototype.not=function(r,x){return this.notation(r,x)},y}()}).call(void 0)},{"./Utility":214,"./XMLAttribute":215,"./XMLCData":216,"./XMLComment":217,"./XMLDTDAttList":218,"./XMLDTDElement":219,"./XMLDTDEntity":220,"./XMLDTDNotation":221,"./XMLDeclaration":222,"./XMLDocType":223,"./XMLElement":226,"./XMLProcessingInstruction":228,"./XMLRaw":229,"./XMLStringWriter":231,"./XMLStringifier":232,"./XMLText":233}],226:[function(_,L,E){"use strict";var A=_("babel-runtime/core-js/object/create"),w=function(v){return v&&v.__esModule?v:{default:v}}(A);(function(){var v,u,f,o,t,i=function(h,a){function e(){this.constructor=h}for(var l in a)s.call(a,l)&&(h[l]=a[l]);return e.prototype=a.prototype,h.prototype=new e,h.__super__=a.prototype,h},s={}.hasOwnProperty;t=_("./Utility"),o=t.isObject,f=t.isFunction,u=_("./XMLNode"),v=_("./XMLAttribute"),L.exports=function(h){function a(e,l,n){if(a.__super__.constructor.call(this,e),l==null)throw new Error("Missing element name");this.name=this.stringify.eleName(l),this.attributes={},n!=null&&this.attribute(n),e.isDocument&&(this.isRoot=!0,this.documentObject=e,e.rootObject=this)}return i(a,h),a.prototype.clone=function(){var e,l,n,d;n=(0,w.default)(this),n.isRoot&&(n.documentObject=null),n.attributes={},d=this.attributes;for(l in d)s.call(d,l)&&(e=d[l],n.attributes[l]=e.clone());return n.children=[],this.children.forEach(function(c){var g;return g=c.clone(),g.parent=n,n.children.push(g)}),n},a.prototype.attribute=function(e,l){var n,d;if(e!=null&&(e=e.valueOf()),o(e))for(n in e)s.call(e,n)&&(d=e[n],this.attribute(n,d));else f(l)&&(l=l.apply()),this.options.skipNullAttributes&&l==null||(this.attributes[e]=new v(this,e,l));return this},a.prototype.removeAttribute=function(e){var l,n,d;if(e==null)throw new Error("Missing attribute name");if(e=e.valueOf(),Array.isArray(e))for(n=0,d=e.length;n<d;n++)l=e[n],delete this.attributes[l];else delete this.attributes[e];return this},a.prototype.toString=function(e){return this.options.writer.set(e).element(this)},a.prototype.att=function(e,l){return this.attribute(e,l)},a.prototype.a=function(e,l){return this.attribute(e,l)},a}(u)}).call(void 0)},{"./Utility":214,"./XMLAttribute":215,"./XMLNode":227,"babel-runtime/core-js/object/create":19}],227:[function(_,L,E){"use strict";(function(){var A,w,v,u,f,o,t,i,s,h,a,e,l={}.hasOwnProperty;e=_("./Utility"),a=e.isObject,h=e.isFunction,s=e.isEmpty,f=null,A=null,w=null,v=null,u=null,t=null,i=null,o=null,L.exports=function(){function n(d){this.parent=d,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),this.children=[],f||(f=_("./XMLElement"),A=_("./XMLCData"),w=_("./XMLComment"),v=_("./XMLDeclaration"),u=_("./XMLDocType"),t=_("./XMLRaw"),i=_("./XMLText"),o=_("./XMLProcessingInstruction"))}return n.prototype.element=function(d,c,g){var p,m,b,y,r,x,S,T,R,D;if(x=null,c==null&&(c={}),c=c.valueOf(),a(c)||(R=[c,g],g=R[0],c=R[1]),d!=null&&(d=d.valueOf()),Array.isArray(d))for(b=0,S=d.length;b<S;b++)m=d[b],x=this.element(m);else if(h(d))x=this.element(d.apply());else if(a(d)){for(r in d)if(l.call(d,r))if(D=d[r],h(D)&&(D=D.apply()),a(D)&&s(D)&&(D=null),!this.options.ignoreDecorators&&this.stringify.convertAttKey&&r.indexOf(this.stringify.convertAttKey)===0)x=this.attribute(r.substr(this.stringify.convertAttKey.length),D);else if(!this.options.separateArrayItems&&Array.isArray(D))for(y=0,T=D.length;y<T;y++)m=D[y],p={},p[r]=m,x=this.element(p);else a(D)?(x=this.element(r),x.element(D)):x=this.element(r,D)}else x=!this.options.ignoreDecorators&&this.stringify.convertTextKey&&d.indexOf(this.stringify.convertTextKey)===0?this.text(g):!this.options.ignoreDecorators&&this.stringify.convertCDataKey&&d.indexOf(this.stringify.convertCDataKey)===0?this.cdata(g):!this.options.ignoreDecorators&&this.stringify.convertCommentKey&&d.indexOf(this.stringify.convertCommentKey)===0?this.comment(g):!this.options.ignoreDecorators&&this.stringify.convertRawKey&&d.indexOf(this.stringify.convertRawKey)===0?this.raw(g):!this.options.ignoreDecorators&&this.stringify.convertPIKey&&d.indexOf(this.stringify.convertPIKey)===0?this.instruction(d.substr(this.stringify.convertPIKey.length),g):this.node(d,c,g);if(x==null)throw new Error("Could not create any elements with: "+d);return x},n.prototype.insertBefore=function(d,c,g){var p,m,b;if(this.isRoot)throw new Error("Cannot insert elements at root level");return m=this.parent.children.indexOf(this),b=this.parent.children.splice(m),p=this.parent.element(d,c,g),Array.prototype.push.apply(this.parent.children,b),p},n.prototype.insertAfter=function(d,c,g){var p,m,b;if(this.isRoot)throw new Error("Cannot insert elements at root level");return m=this.parent.children.indexOf(this),b=this.parent.children.splice(m+1),p=this.parent.element(d,c,g),Array.prototype.push.apply(this.parent.children,b),p},n.prototype.remove=function(){var d;if(this.isRoot)throw new Error("Cannot remove the root element");return d=this.parent.children.indexOf(this),[].splice.apply(this.parent.children,[d,d-d+1].concat([])),this.parent},n.prototype.node=function(d,c,g){var p,m;return d!=null&&(d=d.valueOf()),c||(c={}),c=c.valueOf(),a(c)||(m=[c,g],g=m[0],c=m[1]),p=new f(this,d,c),g!=null&&p.text(g),this.children.push(p),p},n.prototype.text=function(d){var c;return c=new i(this,d),this.children.push(c),this},n.prototype.cdata=function(d){var c;return c=new A(this,d),this.children.push(c),this},n.prototype.comment=function(d){var c;return c=new w(this,d),this.children.push(c),this},n.prototype.commentBefore=function(d){var c,g;return c=this.parent.children.indexOf(this),g=this.parent.children.splice(c),this.parent.comment(d),Array.prototype.push.apply(this.parent.children,g),this},n.prototype.commentAfter=function(d){var c,g;return c=this.parent.children.indexOf(this),g=this.parent.children.splice(c+1),this.parent.comment(d),Array.prototype.push.apply(this.parent.children,g),this},n.prototype.raw=function(d){var c;return c=new t(this,d),this.children.push(c),this},n.prototype.instruction=function(d,c){var g,p,m,b,y;if(d!=null&&(d=d.valueOf()),c!=null&&(c=c.valueOf()),Array.isArray(d))for(b=0,y=d.length;b<y;b++)g=d[b],this.instruction(g);else if(a(d))for(g in d)l.call(d,g)&&(p=d[g],this.instruction(g,p));else h(c)&&(c=c.apply()),m=new o(this,d,c),this.children.push(m);return this},n.prototype.instructionBefore=function(d,c){var g,p;return g=this.parent.children.indexOf(this),p=this.parent.children.splice(g),this.parent.instruction(d,c),Array.prototype.push.apply(this.parent.children,p),this},n.prototype.instructionAfter=function(d,c){var g,p;return g=this.parent.children.indexOf(this),p=this.parent.children.splice(g+1),this.parent.instruction(d,c),Array.prototype.push.apply(this.parent.children,p),this},n.prototype.declaration=function(d,c,g){var p,m;return p=this.document(),m=new v(p,d,c,g),p.children[0]instanceof v?p.children[0]=m:p.children.unshift(m),p.root()||p},n.prototype.doctype=function(d,c){var g,p,m,b,y,r,x,S,T,R;for(p=this.document(),m=new u(p,d,c),T=p.children,b=y=0,x=T.length;y<x;b=++y)if((g=T[b])instanceof u)return p.children[b]=m,m;for(R=p.children,b=r=0,S=R.length;r<S;b=++r)if(g=R[b],g.isRoot)return p.children.splice(b,0,m),m;return p.children.push(m),m},n.prototype.up=function(){if(this.isRoot)throw new Error("The root node has no parent. Use doc() if you need to get the document object.");return this.parent},n.prototype.root=function(){var d;for(d=this;d;){if(d.isDocument)return d.rootObject;if(d.isRoot)return d;d=d.parent}},n.prototype.document=function(){var d;for(d=this;d;){if(d.isDocument)return d;d=d.parent}},n.prototype.end=function(d){return this.document().end(d)},n.prototype.prev=function(){var d;if((d=this.parent.children.indexOf(this))<1)throw new Error("Already at the first node");return this.parent.children[d-1]},n.prototype.next=function(){var d;if((d=this.parent.children.indexOf(this))===-1||d===this.parent.children.length-1)throw new Error("Already at the last node");return this.parent.children[d+1]},n.prototype.importDocument=function(d){var c;return c=d.root().clone(),c.parent=this,c.isRoot=!1,this.children.push(c),this},n.prototype.ele=function(d,c,g){return this.element(d,c,g)},n.prototype.nod=function(d,c,g){return this.node(d,c,g)},n.prototype.txt=function(d){return this.text(d)},n.prototype.dat=function(d){return this.cdata(d)},n.prototype.com=function(d){return this.comment(d)},n.prototype.ins=function(d,c){return this.instruction(d,c)},n.prototype.doc=function(){return this.document()},n.prototype.dec=function(d,c,g){return this.declaration(d,c,g)},n.prototype.dtd=function(d,c){return this.doctype(d,c)},n.prototype.e=function(d,c,g){return this.element(d,c,g)},n.prototype.n=function(d,c,g){return this.node(d,c,g)},n.prototype.t=function(d){return this.text(d)},n.prototype.d=function(d){return this.cdata(d)},n.prototype.c=function(d){return this.comment(d)},n.prototype.r=function(d){return this.raw(d)},n.prototype.i=function(d,c){return this.instruction(d,c)},n.prototype.u=function(){return this.up()},n.prototype.importXMLBuilder=function(d){return this.importDocument(d)},n}()}).call(void 0)},{"./Utility":214,"./XMLCData":216,"./XMLComment":217,"./XMLDeclaration":222,"./XMLDocType":223,"./XMLElement":226,"./XMLProcessingInstruction":228,"./XMLRaw":229,"./XMLText":233}],228:[function(_,L,E){"use strict";var A=_("babel-runtime/core-js/object/create"),w=function(v){return v&&v.__esModule?v:{default:v}}(A);(function(){var v,u=function(o,t){function i(){this.constructor=o}for(var s in t)f.call(t,s)&&(o[s]=t[s]);return i.prototype=t.prototype,o.prototype=new i,o.__super__=t.prototype,o},f={}.hasOwnProperty;v=_("./XMLNode"),L.exports=function(o){function t(i,s,h){if(t.__super__.constructor.call(this,i),s==null)throw new Error("Missing instruction target");this.target=this.stringify.insTarget(s),h&&(this.value=this.stringify.insValue(h))}return u(t,o),t.prototype.clone=function(){return(0,w.default)(this)},t.prototype.toString=function(i){return this.options.writer.set(i).processingInstruction(this)},t}(v)}).call(void 0)},{"./XMLNode":227,"babel-runtime/core-js/object/create":19}],229:[function(_,L,E){"use strict";var A=_("babel-runtime/core-js/object/create"),w=function(v){return v&&v.__esModule?v:{default:v}}(A);(function(){var v,u=function(o,t){function i(){this.constructor=o}for(var s in t)f.call(t,s)&&(o[s]=t[s]);return i.prototype=t.prototype,o.prototype=new i,o.__super__=t.prototype,o},f={}.hasOwnProperty;v=_("./XMLNode"),L.exports=function(o){function t(i,s){if(t.__super__.constructor.call(this,i),s==null)throw new Error("Missing raw text");this.value=this.stringify.raw(s)}return u(t,o),t.prototype.clone=function(){return(0,w.default)(this)},t.prototype.toString=function(i){return this.options.writer.set(i).raw(this)},t}(v)}).call(void 0)},{"./XMLNode":227,"babel-runtime/core-js/object/create":19}],230:[function(_,L,E){"use strict";(function(){var A,w,v,u,f,o,t,i,s,h,a,e,l,n=function(c,g){function p(){this.constructor=c}for(var m in g)d.call(g,m)&&(c[m]=g[m]);return p.prototype=g.prototype,c.prototype=new p,c.__super__=g.prototype,c},d={}.hasOwnProperty;t=_("./XMLDeclaration"),i=_("./XMLDocType"),A=_("./XMLCData"),w=_("./XMLComment"),s=_("./XMLElement"),a=_("./XMLRaw"),e=_("./XMLText"),h=_("./XMLProcessingInstruction"),v=_("./XMLDTDAttList"),u=_("./XMLDTDElement"),f=_("./XMLDTDEntity"),o=_("./XMLDTDNotation"),l=_("./XMLWriterBase"),L.exports=function(c){function g(p,m){g.__super__.constructor.call(this,m),this.stream=p}return n(g,c),g.prototype.document=function(p){var m,b,y,r,x,S,T,R;for(S=p.children,b=0,r=S.length;b<r;b++)m=S[b],m.isLastRootNode=!1;for(p.children[p.children.length-1].isLastRootNode=!0,T=p.children,R=[],y=0,x=T.length;y<x;y++)switch(m=T[y],!1){case!(m instanceof t):R.push(this.declaration(m));break;case!(m instanceof i):R.push(this.docType(m));break;case!(m instanceof w):R.push(this.comment(m));break;case!(m instanceof h):R.push(this.processingInstruction(m));break;default:R.push(this.element(m))}return R},g.prototype.attribute=function(p){return this.stream.write(" "+p.name+'="'+p.value+'"')},g.prototype.cdata=function(p,m){return this.stream.write(this.space(m)+"<![CDATA["+p.text+"]]>"+this.endline(p))},g.prototype.comment=function(p,m){return this.stream.write(this.space(m)+"<!-- "+p.text+" -->"+this.endline(p))},g.prototype.declaration=function(p,m){return this.stream.write(this.space(m)),this.stream.write('<?xml version="'+p.version+'"'),p.encoding!=null&&this.stream.write(' encoding="'+p.encoding+'"'),p.standalone!=null&&this.stream.write(' standalone="'+p.standalone+'"'),this.stream.write(this.spacebeforeslash+"?>"),this.stream.write(this.endline(p))},g.prototype.docType=function(p,m){var b,y,r,x;if(m||(m=0),this.stream.write(this.space(m)),this.stream.write("<!DOCTYPE "+p.root().name),p.pubID&&p.sysID?this.stream.write(' PUBLIC "'+p.pubID+'" "'+p.sysID+'"'):p.sysID&&this.stream.write(' SYSTEM "'+p.sysID+'"'),p.children.length>0){for(this.stream.write(" ["),this.stream.write(this.endline(p)),x=p.children,y=0,r=x.length;y<r;y++)switch(b=x[y],!1){case!(b instanceof v):this.dtdAttList(b,m+1);break;case!(b instanceof u):this.dtdElement(b,m+1);break;case!(b instanceof f):this.dtdEntity(b,m+1);break;case!(b instanceof o):this.dtdNotation(b,m+1);break;case!(b instanceof A):this.cdata(b,m+1);break;case!(b instanceof w):this.comment(b,m+1);break;case!(b instanceof h):this.processingInstruction(b,m+1);break;default:throw new Error("Unknown DTD node type: "+b.constructor.name)}this.stream.write("]")}return this.stream.write(this.spacebeforeslash+">"),this.stream.write(this.endline(p))},g.prototype.element=function(p,m){var b,y,r,x,S,T,R,D;m||(m=0),D=this.space(m),this.stream.write(D+"<"+p.name),T=p.attributes;for(S in T)d.call(T,S)&&(b=T[S],this.attribute(b));if(p.children.length===0||p.children.every(function(k){return k.value===""}))this.allowEmpty?this.stream.write("></"+p.name+">"):this.stream.write(this.spacebeforeslash+"/>");else if(this.pretty&&p.children.length===1&&p.children[0].value!=null)this.stream.write(">"),this.stream.write(p.children[0].value),this.stream.write("</"+p.name+">");else{for(this.stream.write(">"+this.newline),R=p.children,r=0,x=R.length;r<x;r++)switch(y=R[r],!1){case!(y instanceof A):this.cdata(y,m+1);break;case!(y instanceof w):this.comment(y,m+1);break;case!(y instanceof s):this.element(y,m+1);break;case!(y instanceof a):this.raw(y,m+1);break;case!(y instanceof e):this.text(y,m+1);break;case!(y instanceof h):this.processingInstruction(y,m+1);break;default:throw new Error("Unknown XML node type: "+y.constructor.name)}this.stream.write(D+"</"+p.name+">")}return this.stream.write(this.endline(p))},g.prototype.processingInstruction=function(p,m){return this.stream.write(this.space(m)+"<?"+p.target),p.value&&this.stream.write(" "+p.value),this.stream.write(this.spacebeforeslash+"?>"+this.endline(p))},g.prototype.raw=function(p,m){return this.stream.write(this.space(m)+p.value+this.endline(p))},g.prototype.text=function(p,m){return this.stream.write(this.space(m)+p.value+this.endline(p))},g.prototype.dtdAttList=function(p,m){return this.stream.write(this.space(m)+"<!ATTLIST "+p.elementName+" "+p.attributeName+" "+p.attributeType),p.defaultValueType!=="#DEFAULT"&&this.stream.write(" "+p.defaultValueType),p.defaultValue&&this.stream.write(' "'+p.defaultValue+'"'),this.stream.write(this.spacebeforeslash+">"+this.endline(p))},g.prototype.dtdElement=function(p,m){return this.stream.write(this.space(m)+"<!ELEMENT "+p.name+" "+p.value),this.stream.write(this.spacebeforeslash+">"+this.endline(p))},g.prototype.dtdEntity=function(p,m){return this.stream.write(this.space(m)+"<!ENTITY"),p.pe&&this.stream.write(" %"),this.stream.write(" "+p.name),p.value?this.stream.write(' "'+p.value+'"'):(p.pubID&&p.sysID?this.stream.write(' PUBLIC "'+p.pubID+'" "'+p.sysID+'"'):p.sysID&&this.stream.write(' SYSTEM "'+p.sysID+'"'),p.nData&&this.stream.write(" NDATA "+p.nData)),this.stream.write(this.spacebeforeslash+">"+this.endline(p))},g.prototype.dtdNotation=function(p,m){return this.stream.write(this.space(m)+"<!NOTATION "+p.name),p.pubID&&p.sysID?this.stream.write(' PUBLIC "'+p.pubID+'" "'+p.sysID+'"'):p.pubID?this.stream.write(' PUBLIC "'+p.pubID+'"'):p.sysID&&this.stream.write(' SYSTEM "'+p.sysID+'"'),this.stream.write(this.spacebeforeslash+">"+this.endline(p))},g.prototype.endline=function(p){return p.isLastRootNode?"":this.newline},g}(l)}).call(void 0)},{"./XMLCData":216,"./XMLComment":217,"./XMLDTDAttList":218,"./XMLDTDElement":219,"./XMLDTDEntity":220,"./XMLDTDNotation":221,"./XMLDeclaration":222,"./XMLDocType":223,"./XMLElement":226,"./XMLProcessingInstruction":228,"./XMLRaw":229,"./XMLText":233,"./XMLWriterBase":234}],231:[function(_,L,E){"use strict";(function(){var A,w,v,u,f,o,t,i,s,h,a,e,l,n=function(c,g){function p(){this.constructor=c}for(var m in g)d.call(g,m)&&(c[m]=g[m]);return p.prototype=g.prototype,c.prototype=new p,c.__super__=g.prototype,c},d={}.hasOwnProperty;t=_("./XMLDeclaration"),i=_("./XMLDocType"),A=_("./XMLCData"),w=_("./XMLComment"),s=_("./XMLElement"),a=_("./XMLRaw"),e=_("./XMLText"),h=_("./XMLProcessingInstruction"),v=_("./XMLDTDAttList"),u=_("./XMLDTDElement"),f=_("./XMLDTDEntity"),o=_("./XMLDTDNotation"),l=_("./XMLWriterBase"),L.exports=function(c){function g(p){g.__super__.constructor.call(this,p)}return n(g,c),g.prototype.document=function(p){var m,b,y,r,x;for(this.textispresent=!1,r="",x=p.children,b=0,y=x.length;b<y;b++)m=x[b],r+=function(){switch(!1){case!(m instanceof t):return this.declaration(m);case!(m instanceof i):return this.docType(m);case!(m instanceof w):return this.comment(m);case!(m instanceof h):return this.processingInstruction(m);default:return this.element(m,0)}}.call(this);return this.pretty&&r.slice(-this.newline.length)===this.newline&&(r=r.slice(0,-this.newline.length)),r},g.prototype.attribute=function(p){return" "+p.name+'="'+p.value+'"'},g.prototype.cdata=function(p,m){return this.space(m)+"<![CDATA["+p.text+"]]>"+this.newline},g.prototype.comment=function(p,m){return this.space(m)+"<!-- "+p.text+" -->"+this.newline},g.prototype.declaration=function(p,m){var b;return b=this.space(m),b+='<?xml version="'+p.version+'"',p.encoding!=null&&(b+=' encoding="'+p.encoding+'"'),p.standalone!=null&&(b+=' standalone="'+p.standalone+'"'),b+=this.spacebeforeslash+"?>",b+=this.newline},g.prototype.docType=function(p,m){var b,y,r,x,S;if(m||(m=0),x=this.space(m),x+="<!DOCTYPE "+p.root().name,p.pubID&&p.sysID?x+=' PUBLIC "'+p.pubID+'" "'+p.sysID+'"':p.sysID&&(x+=' SYSTEM "'+p.sysID+'"'),p.children.length>0){for(x+=" [",x+=this.newline,S=p.children,y=0,r=S.length;y<r;y++)b=S[y],x+=function(){switch(!1){case!(b instanceof v):return this.dtdAttList(b,m+1);case!(b instanceof u):return this.dtdElement(b,m+1);case!(b instanceof f):return this.dtdEntity(b,m+1);case!(b instanceof o):return this.dtdNotation(b,m+1);case!(b instanceof A):return this.cdata(b,m+1);case!(b instanceof w):return this.comment(b,m+1);case!(b instanceof h):return this.processingInstruction(b,m+1);default:throw new Error("Unknown DTD node type: "+b.constructor.name)}}.call(this);x+="]"}return x+=this.spacebeforeslash+">",x+=this.newline},g.prototype.element=function(p,m){var b,y,r,x,S,T,R,D,k,B,G,P,$;m||(m=0),$=!1,this.textispresent?(this.newline="",this.pretty=!1):(this.newline=this.newlinedefault,this.pretty=this.prettydefault),P=this.space(m),D="",D+=P+"<"+p.name,k=p.attributes;for(R in k)d.call(k,R)&&(b=k[R],D+=this.attribute(b));if(p.children.length===0||p.children.every(function(X){return X.value===""}))this.allowEmpty?D+="></"+p.name+">"+this.newline:D+=this.spacebeforeslash+"/>"+this.newline;else if(this.pretty&&p.children.length===1&&p.children[0].value!=null)D+=">",D+=p.children[0].value,D+="</"+p.name+">"+this.newline;else{if(this.dontprettytextnodes){for(B=p.children,r=0,S=B.length;r<S;r++)if(y=B[r],y.value!=null){this.textispresent++,$=!0;break}}for(this.textispresent&&(this.newline="",this.pretty=!1,P=this.space(m)),D+=">"+this.newline,G=p.children,x=0,T=G.length;x<T;x++)y=G[x],D+=function(){switch(!1){case!(y instanceof A):return this.cdata(y,m+1);case!(y instanceof w):return this.comment(y,m+1);case!(y instanceof s):return this.element(y,m+1);case!(y instanceof a):return this.raw(y,m+1);case!(y instanceof e):return this.text(y,m+1);case!(y instanceof h):return this.processingInstruction(y,m+1);default:throw new Error("Unknown XML node type: "+y.constructor.name)}}.call(this);$&&this.textispresent--,this.textispresent||(this.newline=this.newlinedefault,this.pretty=this.prettydefault),D+=P+"</"+p.name+">"+this.newline}return D},g.prototype.processingInstruction=function(p,m){var b;return b=this.space(m)+"<?"+p.target,p.value&&(b+=" "+p.value),b+=this.spacebeforeslash+"?>"+this.newline},g.prototype.raw=function(p,m){return this.space(m)+p.value+this.newline},g.prototype.text=function(p,m){return this.space(m)+p.value+this.newline},g.prototype.dtdAttList=function(p,m){var b;return b=this.space(m)+"<!ATTLIST "+p.elementName+" "+p.attributeName+" "+p.attributeType,p.defaultValueType!=="#DEFAULT"&&(b+=" "+p.defaultValueType),p.defaultValue&&(b+=' "'+p.defaultValue+'"'),b+=this.spacebeforeslash+">"+this.newline},g.prototype.dtdElement=function(p,m){return this.space(m)+"<!ELEMENT "+p.name+" "+p.value+this.spacebeforeslash+">"+this.newline},g.prototype.dtdEntity=function(p,m){var b;return b=this.space(m)+"<!ENTITY",p.pe&&(b+=" %"),b+=" "+p.name,p.value?b+=' "'+p.value+'"':(p.pubID&&p.sysID?b+=' PUBLIC "'+p.pubID+'" "'+p.sysID+'"':p.sysID&&(b+=' SYSTEM "'+p.sysID+'"'),p.nData&&(b+=" NDATA "+p.nData)),b+=this.spacebeforeslash+">"+this.newline},g.prototype.dtdNotation=function(p,m){var b;return b=this.space(m)+"<!NOTATION "+p.name,p.pubID&&p.sysID?b+=' PUBLIC "'+p.pubID+'" "'+p.sysID+'"':p.pubID?b+=' PUBLIC "'+p.pubID+'"':p.sysID&&(b+=' SYSTEM "'+p.sysID+'"'),b+=this.spacebeforeslash+">"+this.newline},g.prototype.openNode=function(p,m){var b,y,r,x;if(m||(m=0),p instanceof s){r=this.space(m)+"<"+p.name,x=p.attributes;for(y in x)d.call(x,y)&&(b=x[y],r+=this.attribute(b));return r+=(p.children?">":"/>")+this.newline}return r=this.space(m)+"<!DOCTYPE "+p.rootNodeName,p.pubID&&p.sysID?r+=' PUBLIC "'+p.pubID+'" "'+p.sysID+'"':p.sysID&&(r+=' SYSTEM "'+p.sysID+'"'),r+=(p.children?" [":">")+this.newline},g.prototype.closeNode=function(p,m){switch(m||(m=0),!1){case!(p instanceof s):return this.space(m)+"</"+p.name+">"+this.newline;case!(p instanceof i):return this.space(m)+"]>"+this.newline}},g}(l)}).call(void 0)},{"./XMLCData":216,"./XMLComment":217,"./XMLDTDAttList":218,"./XMLDTDElement":219,"./XMLDTDEntity":220,"./XMLDTDNotation":221,"./XMLDeclaration":222,"./XMLDocType":223,"./XMLElement":226,"./XMLProcessingInstruction":228,"./XMLRaw":229,"./XMLText":233,"./XMLWriterBase":234}],232:[function(_,L,E){"use strict";(function(){var A=function(v,u){return function(){return v.apply(u,arguments)}},w={}.hasOwnProperty;L.exports=function(){function v(u){this.assertLegalChar=A(this.assertLegalChar,this);var f,o,t;u||(u={}),this.noDoubleEncoding=u.noDoubleEncoding,o=u.stringify||{};for(f in o)w.call(o,f)&&(t=o[f],this[f]=t)}return v.prototype.eleName=function(u){return u=""+u||"",this.assertLegalChar(u)},v.prototype.eleText=function(u){return u=""+u||"",this.assertLegalChar(this.elEscape(u))},v.prototype.cdata=function(u){return u=""+u||"",u=u.replace("]]>","]]]]><![CDATA[>"),this.assertLegalChar(u)},v.prototype.comment=function(u){if(u=""+u||"",u.match(/--/))throw new Error("Comment text cannot contain double-hypen: "+u);return this.assertLegalChar(u)},v.prototype.raw=function(u){return""+u||""},v.prototype.attName=function(u){return u=""+u||""},v.prototype.attValue=function(u){return u=""+u||"",this.attEscape(u)},v.prototype.insTarget=function(u){return""+u||""},v.prototype.insValue=function(u){if(u=""+u||"",u.match(/\?>/))throw new Error("Invalid processing instruction value: "+u);return u},v.prototype.xmlVersion=function(u){if(u=""+u||"",!u.match(/1\.[0-9]+/))throw new Error("Invalid version number: "+u);return u},v.prototype.xmlEncoding=function(u){if(u=""+u||"",!u.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/))throw new Error("Invalid encoding: "+u);return u},v.prototype.xmlStandalone=function(u){return u?"yes":"no"},v.prototype.dtdPubID=function(u){return""+u||""},v.prototype.dtdSysID=function(u){return""+u||""},v.prototype.dtdElementValue=function(u){return""+u||""},v.prototype.dtdAttType=function(u){return""+u||""},v.prototype.dtdAttDefault=function(u){return u!=null?""+u||"":u},v.prototype.dtdEntityValue=function(u){return""+u||""},v.prototype.dtdNData=function(u){return""+u||""},v.prototype.convertAttKey="@",v.prototype.convertPIKey="?",v.prototype.convertTextKey="#text",v.prototype.convertCDataKey="#cdata",v.prototype.convertCommentKey="#comment",v.prototype.convertRawKey="#raw",v.prototype.assertLegalChar=function(u){var f;if(f=u.match(/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/))throw new Error("Invalid character in string: "+u+" at index "+f.index);return u},v.prototype.elEscape=function(u){var f;return f=this.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,u.replace(f,"&").replace(/</g,"<").replace(/>/g,">").replace(/\r/g,"
")},v.prototype.attEscape=function(u){var f;return f=this.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,u.replace(f,"&").replace(/</g,"<").replace(/"/g,""").replace(/\t/g,"	").replace(/\n/g,"
").replace(/\r/g,"
")},v}()}).call(void 0)},{}],233:[function(_,L,E){"use strict";var A=_("babel-runtime/core-js/object/create"),w=function(v){return v&&v.__esModule?v:{default:v}}(A);(function(){var v,u=function(o,t){function i(){this.constructor=o}for(var s in t)f.call(t,s)&&(o[s]=t[s]);return i.prototype=t.prototype,o.prototype=new i,o.__super__=t.prototype,o},f={}.hasOwnProperty;v=_("./XMLNode"),L.exports=function(o){function t(i,s){if(t.__super__.constructor.call(this,i),s==null)throw new Error("Missing element text");this.value=this.stringify.eleText(s)}return u(t,o),t.prototype.clone=function(){return(0,w.default)(this)},t.prototype.toString=function(i){return this.options.writer.set(i).text(this)},t}(v)}).call(void 0)},{"./XMLNode":227,"babel-runtime/core-js/object/create":19}],234:[function(_,L,E){"use strict";(function(){var A={}.hasOwnProperty;L.exports=function(){function w(v){var u,f,o,t,i,s,h,a,e;v||(v={}),this.pretty=v.pretty||!1,this.allowEmpty=(f=v.allowEmpty)!=null&&f,this.pretty?(this.indent=(o=v.indent)!=null?o:" ",this.newline=(t=v.newline)!=null?t:`
|
|
|
`,this.offset=(i=v.offset)!=null?i:0,this.dontprettytextnodes=(s=v.dontprettytextnodes)!=null?s:0):(this.indent="",this.newline="",this.offset=0,this.dontprettytextnodes=0),this.spacebeforeslash=(h=v.spacebeforeslash)!=null?h:"",this.spacebeforeslash===!0&&(this.spacebeforeslash=" "),this.newlinedefault=this.newline,this.prettydefault=this.pretty,a=v.writer||{};for(u in a)A.call(a,u)&&(e=a[u],this[u]=e)}return w.prototype.set=function(v){var u,f,o;v||(v={}),"pretty"in v&&(this.pretty=v.pretty),"allowEmpty"in v&&(this.allowEmpty=v.allowEmpty),this.pretty?(this.indent="indent"in v?v.indent:" ",this.newline="newline"in v?v.newline:`
|
|
|
`,this.offset="offset"in v?v.offset:0,this.dontprettytextnodes="dontprettytextnodes"in v?v.dontprettytextnodes:0):(this.indent="",this.newline="",this.offset=0,this.dontprettytextnodes=0),this.spacebeforeslash="spacebeforeslash"in v?v.spacebeforeslash:"",this.spacebeforeslash===!0&&(this.spacebeforeslash=" "),this.newlinedefault=this.newline,this.prettydefault=this.pretty,f=v.writer||{};for(u in f)A.call(f,u)&&(o=f[u],this[u]=o);return this},w.prototype.space=function(v){var u;return this.pretty?(u=(v||0)+this.offset+1,u>0?new Array(u).join(this.indent):""):""},w}()}).call(void 0)},{}],235:[function(_,L,E){"use strict";(function(){var A,w,v,u,f,o,t;t=_("./Utility"),f=t.assign,o=t.isFunction,A=_("./XMLDocument"),w=_("./XMLDocumentCB"),u=_("./XMLStringWriter"),v=_("./XMLStreamWriter"),L.exports.create=function(i,s,h,a){var e,l;if(i==null)throw new Error("Root element needs a name");return a=f({},s,h,a),e=new A(a),l=e.element(i),a.headless||(e.declaration(a),a.pubID==null&&a.sysID==null||e.doctype(a)),l},L.exports.begin=function(i,s,h){var a;return o(i)&&(a=[i,s],s=a[0],h=a[1],i={}),s?new w(i,s,h):new A(i)},L.exports.stringWriter=function(i){return new u(i)},L.exports.streamWriter=function(i,s){return new v(i,s)}}).call(void 0)},{"./Utility":214,"./XMLDocument":224,"./XMLDocumentCB":225,"./XMLStreamWriter":230,"./XMLStringWriter":231}],236:[function(_,L,E){function A(){for(var v={},u=0;u<arguments.length;u++){var f=arguments[u];for(var o in f)w.call(f,o)&&(v[o]=f[o])}return v}L.exports=A;var w=Object.prototype.hasOwnProperty},{}],237:[function(_,L,E){"use strict";function A(a,e,l){u.isBuffer(e)||(e=new u(e)),u.isBuffer(l)||(l=new u(l)),e.length>s?e=a(e):e.length<s&&(e=u.concat([e,h],s));for(var n=new u(s),d=new u(s),c=0;c<s;c++)n[c]=54^e[c],d[c]=92^e[c];var g=a(u.concat([n,l]));return a(u.concat([d,g]))}function w(a,e){a=a||"sha1";var l=i[a],n=[],d=0;return l||v("algorithm:",a,"is not yet supported"),{update:function(c){return u.isBuffer(c)||(c=new u(c)),n.push(c),d+=c.length,this},digest:function(c){var g=u.concat(n),p=e?A(l,e,g):l(g);return n=null,c?p.toString(c):p}}}function v(){var a=[].slice.call(arguments).join(" ");throw new Error([a,"we accept pull requests","http://github.com/dominictarr/crypto-browserify"].join(`
|
|
|
`))}var u=_("buffer").Buffer,f=_("./sha"),o=_("./sha256"),t=_("./md5"),i={sha1:f,sha256:o,md5:t},s=64,h=new u(s);h.fill(0),E.createHash=function(a){return w(a)},E.createHmac=function(a,e){return w(a,e)},function(a,e){for(var l in a)e(a[l],l)}(["createCredentials","createCipher","createCipheriv","createDecipher","createDecipheriv","createSign","createVerify","createDiffieHellman","pbkdf2"],function(a){E[a]=function(){v("sorry,",a,"is not implemented yet")}})},{"./md5":239,"./sha":240,"./sha256":241,buffer:38}],238:[function(_,L,E){"use strict";function A(i,s){if(i.length%f!=0){var h=i.length+(f-i.length%f);i=u.concat([i,o],h)}for(var a=[],e=s?i.readInt32BE:i.readInt32LE,l=0;l<i.length;l+=f)a.push(e.call(i,l));return a}function w(i,s,h){for(var a=new u(s),e=h?a.writeInt32BE:a.writeInt32LE,l=0;l<i.length;l++)e.call(a,i[l],4*l,!0);return a}function v(i,s,h,a){return u.isBuffer(i)||(i=new u(i)),w(s(A(i,a),i.length*t),h,a)}var u=_("buffer").Buffer,f=4,o=new u(f);o.fill(0);var t=8;L.exports={hash:v}},{buffer:38}],239:[function(_,L,E){"use strict";function A(h,a){h[a>>5]|=128<<a%32,h[14+(a+64>>>9<<4)]=a;for(var e=1732584193,l=-271733879,n=-1732584194,d=271733878,c=0;c<h.length;c+=16){var g=e,p=l,m=n,b=d;e=v(e,l,n,d,h[c+0],7,-680876936),d=v(d,e,l,n,h[c+1],12,-389564586),n=v(n,d,e,l,h[c+2],17,606105819),l=v(l,n,d,e,h[c+3],22,-1044525330),e=v(e,l,n,d,h[c+4],7,-176418897),d=v(d,e,l,n,h[c+5],12,1200080426),n=v(n,d,e,l,h[c+6],17,-1473231341),l=v(l,n,d,e,h[c+7],22,-45705983),e=v(e,l,n,d,h[c+8],7,1770035416),d=v(d,e,l,n,h[c+9],12,-1958414417),n=v(n,d,e,l,h[c+10],17,-42063),l=v(l,n,d,e,h[c+11],22,-1990404162),e=v(e,l,n,d,h[c+12],7,1804603682),d=v(d,e,l,n,h[c+13],12,-40341101),n=v(n,d,e,l,h[c+14],17,-1502002290),l=v(l,n,d,e,h[c+15],22,1236535329),e=u(e,l,n,d,h[c+1],5,-165796510),d=u(d,e,l,n,h[c+6],9,-1069501632),n=u(n,d,e,l,h[c+11],14,643717713),l=u(l,n,d,e,h[c+0],20,-373897302),e=u(e,l,n,d,h[c+5],5,-701558691),d=u(d,e,l,n,h[c+10],9,38016083),n=u(n,d,e,l,h[c+15],14,-660478335),l=u(l,n,d,e,h[c+4],20,-405537848),e=u(e,l,n,d,h[c+9],5,568446438),d=u(d,e,l,n,h[c+14],9,-1019803690),n=u(n,d,e,l,h[c+3],14,-187363961),l=u(l,n,d,e,h[c+8],20,1163531501),e=u(e,l,n,d,h[c+13],5,-1444681467),d=u(d,e,l,n,h[c+2],9,-51403784),n=u(n,d,e,l,h[c+7],14,1735328473),l=u(l,n,d,e,h[c+12],20,-1926607734),e=f(e,l,n,d,h[c+5],4,-378558),d=f(d,e,l,n,h[c+8],11,-2022574463),n=f(n,d,e,l,h[c+11],16,1839030562),l=f(l,n,d,e,h[c+14],23,-35309556),e=f(e,l,n,d,h[c+1],4,-1530992060),d=f(d,e,l,n,h[c+4],11,1272893353),n=f(n,d,e,l,h[c+7],16,-155497632),l=f(l,n,d,e,h[c+10],23,-1094730640),e=f(e,l,n,d,h[c+13],4,681279174),d=f(d,e,l,n,h[c+0],11,-358537222),n=f(n,d,e,l,h[c+3],16,-722521979),l=f(l,n,d,e,h[c+6],23,76029189),e=f(e,l,n,d,h[c+9],4,-640364487),d=f(d,e,l,n,h[c+12],11,-421815835),n=f(n,d,e,l,h[c+15],16,530742520),l=f(l,n,d,e,h[c+2],23,-995338651),e=o(e,l,n,d,h[c+0],6,-198630844),d=o(d,e,l,n,h[c+7],10,1126891415),n=o(n,d,e,l,h[c+14],15,-1416354905),l=o(l,n,d,e,h[c+5],21,-57434055),e=o(e,l,n,d,h[c+12],6,1700485571),d=o(d,e,l,n,h[c+3],10,-1894986606),n=o(n,d,e,l,h[c+10],15,-1051523),l=o(l,n,d,e,h[c+1],21,-2054922799),e=o(e,l,n,d,h[c+8],6,1873313359),d=o(d,e,l,n,h[c+15],10,-30611744),n=o(n,d,e,l,h[c+6],15,-1560198380),l=o(l,n,d,e,h[c+13],21,1309151649),e=o(e,l,n,d,h[c+4],6,-145523070),d=o(d,e,l,n,h[c+11],10,-1120210379),n=o(n,d,e,l,h[c+2],15,718787259),l=o(l,n,d,e,h[c+9],21,-343485551),e=t(e,g),l=t(l,p),n=t(n,m),d=t(d,b)}return Array(e,l,n,d)}function w(h,a,e,l,n,d){return t(i(t(t(a,h),t(l,d)),n),e)}function v(h,a,e,l,n,d,c){return w(a&e|~a&l,h,a,n,d,c)}function u(h,a,e,l,n,d,c){return w(a&l|e&~l,h,a,n,d,c)}function f(h,a,e,l,n,d,c){return w(a^e^l,h,a,n,d,c)}function o(h,a,e,l,n,d,c){return w(e^(a|~l),h,a,n,d,c)}function t(h,a){var e=(65535&h)+(65535&a);return(h>>16)+(a>>16)+(e>>16)<<16|65535&e}function i(h,a){return h<<a|h>>>32-a}var s=_("./helpers");L.exports=function(h){return s.hash(h,A,16)}},{"./helpers":238}],240:[function(_,L,E){"use strict";function A(t,i){t[i>>5]|=128<<24-i%32,t[15+(i+64>>9<<4)]=i;for(var s=Array(80),h=1732584193,a=-271733879,e=-1732584194,l=271733878,n=-1009589776,d=0;d<t.length;d+=16){for(var c=h,g=a,p=e,m=l,b=n,y=0;y<80;y++){s[y]=y<16?t[d+y]:f(s[y-3]^s[y-8]^s[y-14]^s[y-16],1);var r=u(u(f(h,5),w(y,a,e,l)),u(u(n,s[y]),v(y)));n=l,l=e,e=f(a,30),a=h,h=r}h=u(h,c),a=u(a,g),e=u(e,p),l=u(l,m),n=u(n,b)}return Array(h,a,e,l,n)}function w(t,i,s,h){return t<20?i&s|~i&h:t<40?i^s^h:t<60?i&s|i&h|s&h:i^s^h}function v(t){return t<20?1518500249:t<40?1859775393:t<60?-1894007588:-899497514}function u(t,i){var s=(65535&t)+(65535&i);return(t>>16)+(i>>16)+(s>>16)<<16|65535&s}function f(t,i){return t<<i|t>>>32-i}var o=_("./helpers");L.exports=function(t){return o.hash(t,A,20,!0)}},{"./helpers":238}],241:[function(_,L,E){"use strict";var A=_("./helpers"),w=function(e,l){var n=(65535&e)+(65535&l);return(e>>16)+(l>>16)+(n>>16)<<16|65535&n},v=function(e,l){return e>>>l|e<<32-l},u=function(e,l){return e>>>l},f=function(e,l,n){return e&l^~e&n},o=function(e,l,n){return e&l^e&n^l&n},t=function(e){return v(e,2)^v(e,13)^v(e,22)},i=function(e){return v(e,6)^v(e,11)^v(e,25)},s=function(e){return v(e,7)^v(e,18)^u(e,3)},h=function(e){return v(e,17)^v(e,19)^u(e,10)},a=function(e,l){var n,d,c,g,p,m,b,y,r,x,S,T,R=new Array(1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298),D=new Array(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225),k=new Array(64);e[l>>5]|=128<<24-l%32,e[15+(l+64>>9<<4)]=l;for(var r=0;r<e.length;r+=16){n=D[0],d=D[1],c=D[2],g=D[3],p=D[4],m=D[5],b=D[6],y=D[7];for(var x=0;x<64;x++)k[x]=x<16?e[x+r]:w(w(w(h(k[x-2]),k[x-7]),s(k[x-15])),k[x-16]),S=w(w(w(w(y,i(p)),f(p,m,b)),R[x]),k[x]),T=w(t(n),o(n,d,c)),y=b,b=m,m=p,p=w(g,S),g=c,c=d,d=n,n=w(S,T);D[0]=w(n,D[0]),D[1]=w(d,D[1]),D[2]=w(c,D[2]),D[3]=w(g,D[3]),D[4]=w(p,D[4]),D[5]=w(m,D[5]),D[6]=w(b,D[6]),D[7]=w(y,D[7])}return D};L.exports=function(e){return A.hash(e,a,32,!0)}},{"./helpers":238}],242:[function(_,L,E){(function(A){"use strict";function w(a){return a&&a.__esModule?a:{default:a}}var v=_("babel-runtime/core-js/object/create"),u=w(v),f=_("babel-runtime/helpers/classCallCheck"),o=w(f),t=_("babel-runtime/helpers/createClass"),i=w(t),s=_("babel-runtime/helpers/typeof"),h=w(s);!function(a){if((E===void 0?"undefined":(0,h.default)(E))==="object"&&L!==void 0)L.exports=a();else if(typeof U=="function"&&U.amd)U([],a);else{var e;e=typeof window!="undefined"?window:A!==void 0?A:typeof self!="undefined"?self:this,e.mime=a()}}(function(){return function a(e,l,n){function d(p,m){if(!l[p]){if(!e[p]){var b=typeof _=="function"&&_;if(!m&&b)return b(p,!0);if(c)return c(p,!0);var y=new Error("Cannot find module '"+p+"'");throw y.code="MODULE_NOT_FOUND",y}var r=l[p]={exports:{}};e[p][0].call(r.exports,function(x){var S=e[p][1][x];return d(S||x)},r,r.exports,a,e,l,n)}return l[p].exports}for(var c=typeof _=="function"&&_,g=0;g<n.length;g++)d(n[g]);return d}({1:[function(a,e,l){var n=function(){function d(){(0,o.default)(this,d),this._types=(0,u.default)(null),this._extensions=(0,u.default)(null);for(var c=0;c<arguments.length;c++)this.define(arguments[c])}return(0,i.default)(d,[{key:"define",value:function(c,g){for(var p in c){for(var m=c[p],b=0;b<m.length;b++){var y=m[b];if(!g&&y in this._types)throw new Error('Attempt to change mapping for "'+y+'" extension from "'+this._types[y]+'" to "'+p+'". Pass `force=true` to allow this, otherwise remove "'+y+'" from the list of extensions for "'+p+'".');this._types[y]=p}!g&&this._extensions[p]||(this._extensions[p]=m[0])}}},{key:"getType",value:function(c){c=String(c);var g=c.replace(/^.*[\/\\]/,"").toLowerCase(),p=g.replace(/^.*\./,"").toLowerCase(),m=g.length<c.length;return(p.length<g.length-1||!m)&&this._types[p]||null}},{key:"getExtension",value:function(c){return(c=/^\s*([^;\s]*)/.test(c)&&RegExp.$1)&&this._extensions[c.toLowerCase()]||null}}]),d}();e.exports=n},{}],2:[function(a,e,l){var n=a("./Mime");e.exports=new n(a("./types/standard"),a("./types/other"))},{"./Mime":1,"./types/other":3,"./types/standard":4}],3:[function(a,e,l){e.exports={"application/prs.cww":["cww"],"application/vnd.3gpp.pic-bw-large":["plb"],"application/vnd.3gpp.pic-bw-small":["psb"],"application/vnd.3gpp.pic-bw-var":["pvb"],"application/vnd.3gpp2.tcap":["tcap"],"application/vnd.3m.post-it-notes":["pwn"],"application/vnd.accpac.simply.aso":["aso"],"application/vnd.accpac.simply.imp":["imp"],"application/vnd.acucobol":["acu"],"application/vnd.acucorp":["atc","acutc"],"application/vnd.adobe.air-application-installer-package+zip":["air"],"application/vnd.adobe.formscentral.fcdt":["fcdt"],"application/vnd.adobe.fxp":["fxp","fxpl"],"application/vnd.adobe.xdp+xml":["xdp"],"application/vnd.adobe.xfdf":["xfdf"],"application/vnd.ahead.space":["ahead"],"application/vnd.airzip.filesecure.azf":["azf"],"application/vnd.airzip.filesecure.azs":["azs"],"application/vnd.amazon.ebook":["azw"],"application/vnd.americandynamics.acc":["acc"],"application/vnd.amiga.ami":["ami"],"application/vnd.android.package-archive":["apk"],"application/vnd.anser-web-certificate-issue-initiation":["cii"],"application/vnd.anser-web-funds-transfer-initiation":["fti"],"application/vnd.antix.game-component":["atx"],"application/vnd.apple.installer+xml":["mpkg"],"application/vnd.apple.mpegurl":["m3u8"],"application/vnd.apple.pkpass":["pkpass"],"application/vnd.aristanetworks.swi":["swi"],"application/vnd.astraea-software.iota":["iota"],"application/vnd.audiograph":["aep"],"application/vnd.blueice.multipass":["mpm"],"application/vnd.bmi":["bmi"],"application/vnd.businessobjects":["rep"],"application/vnd.chemdraw+xml":["cdxml"],"application/vnd.chipnuts.karaoke-mmd":["mmd"],"application/vnd.cinderella":["cdy"],"application/vnd.claymore":["cla"],"application/vnd.cloanto.rp9":["rp9"],"application/vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"application/vnd.cluetrust.cartomobile-config":["c11amc"],"application/vnd.cluetrust.cartomobile-config-pkg":["c11amz"],"application/vnd.commonspace":["csp"],"application/vnd.contact.cmsg":["cdbcmsg"],"application/vnd.cosmocaller":["cmc"],"application/vnd.crick.clicker":["clkx"],"application/vnd.crick.clicker.keyboard":["clkk"],"application/vnd.crick.clicker.palette":["clkp"],"application/vnd.crick.clicker.template":["clkt"],"application/vnd.crick.clicker.wordbank":["clkw"],"application/vnd.criticaltools.wbs+xml":["wbs"],"application/vnd.ctc-posml":["pml"],"application/vnd.cups-ppd":["ppd"],"application/vnd.curl.car":["car"],"application/vnd.curl.pcurl":["pcurl"],"application/vnd.dart":["dart"],"application/vnd.data-vision.rdz":["rdz"],"application/vnd.dece.data":["uvf","uvvf","uvd","uvvd"],"application/vnd.dece.ttml+xml":["uvt","uvvt"],"application/vnd.dece.unspecified":["uvx","uvvx"],"application/vnd.dece.zip":["uvz","uvvz"],"application/vnd.denovo.fcselayout-link":["fe_launch"],"application/vnd.dna":["dna"],"application/vnd.dolby.mlp":["mlp"],"application/vnd.dpgraph":["dpg"],"application/vnd.dreamfactory":["dfac"],"application/vnd.ds-keypoint":["kpxx"],"application/vnd.dvb.ait":["ait"],"application/vnd.dvb.service":["svc"],"application/vnd.dynageo":["geo"],"application/vnd.ecowin.chart":["mag"],"application/vnd.enliven":["nml"],"application/vnd.epson.esf":["esf"],"application/vnd.epson.msf":["msf"],"application/vnd.epson.quickanime":["qam"],"application/vnd.epson.salt":["slt"],"application/vnd.epson.ssf":["ssf"],"application/vnd.eszigno3+xml":["es3","et3"],"application/vnd.ezpix-album":["ez2"],"application/vnd.ezpix-package":["ez3"],"application/vnd.fdf":["fdf"],"application/vnd.fdsn.mseed":["mseed"],"application/vnd.fdsn.seed":["seed","dataless"],"application/vnd.flographit":["gph"],"application/vnd.fluxtime.clip":["ftc"],"application/vnd.framemaker":["fm","frame","maker","book"],"application/vnd.frogans.fnc":["fnc"],"application/vnd.frogans.ltf":["ltf"],"application/vnd.fsc.weblaunch":["fsc"],"application/vnd.fujitsu.oasys":["oas"],"application/vnd.fujitsu.oasys2":["oa2"],"application/vnd.fujitsu.oasys3":["oa3"],"application/vnd.fujitsu.oasysgp":["fg5"],"application/vnd.fujitsu.oasysprs":["bh2"],"application/vnd.fujixerox.ddd":["ddd"],"application/vnd.fujixerox.docuworks":["xdw"],"application/vnd.fujixerox.docuworks.binder":["xbd"],"application/vnd.fuzzysheet":["fzs"],"application/vnd.genomatix.tuxedo":["txd"],"application/vnd.geogebra.file":["ggb"],"application/vnd.geogebra.tool":["ggt"],"application/vnd.geometry-explorer":["gex","gre"],"application/vnd.geonext":["gxt"],"application/vnd.geoplan":["g2w"],"application/vnd.geospace":["g3w"],"application/vnd.gmx":["gmx"],"application/vnd.google-apps.document":["gdoc"],"application/vnd.google-apps.presentation":["gslides"],"application/vnd.google-apps.spreadsheet":["gsheet"],"application/vnd.google-earth.kml+xml":["kml"],"application/vnd.google-earth.kmz":["kmz"],"application/vnd.grafeq":["gqf","gqs"],"application/vnd.groove-account":["gac"],"application/vnd.groove-help":["ghf"],"application/vnd.groove-identity-message":["gim"],"application/vnd.groove-injector":["grv"],"application/vnd.groove-tool-message":["gtm"],"application/vnd.groove-tool-template":["tpl"],"application/vnd.groove-vcard":["vcg"],"application/vnd.hal+xml":["hal"],"application/vnd.handheld-entertainment+xml":["zmm"],"application/vnd.hbci":["hbci"],"application/vnd.hhe.lesson-player":["les"],"application/vnd.hp-hpgl":["hpgl"],"application/vnd.hp-hpid":["hpid"],"application/vnd.hp-hps":["hps"],"application/vnd.hp-jlyt":["jlt"],"application/vnd.hp-pcl":["pcl"],"application/vnd.hp-pclxl":["pclxl"],"application/vnd.hydrostatix.sof-data":["sfd-hdstx"],"application/vnd.ibm.minipay":["mpy"],"application/vnd.ibm.modcap":["afp","listafp","list3820"],"application/vnd.ibm.rights-management":["irm"],"application/vnd.ibm.secure-container":["sc"],"application/vnd.iccprofile":["icc","icm"],"application/vnd.igloader":["igl"],"application/vnd.immervision-ivp":["ivp"],"application/vnd.immervision-ivu":["ivu"],"application/vnd.insors.igm":["igm"],"application/vnd.intercon.formnet":["xpw","xpx"],"application/vnd.intergeo":["i2g"],"application/vnd.intu.qbo":["qbo"],"application/vnd.intu.qfx":["qfx"],"application/vnd.ipunplugged.rcprofile":["rcprofile"],"application/vnd.irepository.package+xml":["irp"],"application/vnd.is-xpr":["xpr"],"application/vnd.isac.fcs":["fcs"],"application/vnd.jam":["jam"],"application/vnd.jcp.javame.midlet-rms":["rms"],"application/vnd.jisp":["jisp"],"application/vnd.joost.joda-archive":["joda"],"application/vnd.kahootz":["ktz","ktr"],"application/vnd.kde.karbon":["karbon"],"application/vnd.kde.kchart":["chrt"],"application/vnd.kde.kformula":["kfo"],"application/vnd.kde.kivio":["flw"],"application/vnd.kde.kontour":["kon"],"application/vnd.kde.kpresenter":["kpr","kpt"],"application/vnd.kde.kspread":["ksp"],"application/vnd.kde.kword":["kwd","kwt"],"application/vnd.kenameaapp":["htke"],"application/vnd.kidspiration":["kia"],"application/vnd.kinar":["kne","knp"],"application/vnd.koan":["skp","skd","skt","skm"],"application/vnd.kodak-descriptor":["sse"],"application/vnd.las.las+xml":["lasxml"],"application/vnd.llamagraphics.life-balance.desktop":["lbd"],"application/vnd.llamagraphics.life-balance.exchange+xml":["lbe"],"application/vnd.lotus-1-2-3":["123"],"application/vnd.lotus-approach":["apr"],"application/vnd.lotus-freelance":["pre"],"application/vnd.lotus-notes":["nsf"],"application/vnd.lotus-organizer":["org"],"application/vnd.lotus-screencam":["scm"],"application/vnd.lotus-wordpro":["lwp"],"application/vnd.macports.portpkg":["portpkg"],"application/vnd.mcd":["mcd"],"application/vnd.medcalcdata":["mc1"],"application/vnd.mediastation.cdkey":["cdkey"],"application/vnd.mfer":["mwf"],"application/vnd.mfmp":["mfm"],"application/vnd.micrografx.flo":["flo"],"application/vnd.micrografx.igx":["igx"],"application/vnd.mif":["mif"],"application/vnd.mobius.daf":["daf"],"application/vnd.mobius.dis":["dis"],"application/vnd.mobius.mbk":["mbk"],"application/vnd.mobius.mqy":["mqy"],"application/vnd.mobius.msl":["msl"],"application/vnd.mobius.plc":["plc"],"application/vnd.mobius.txf":["txf"],"application/vnd.mophun.application":["mpn"],"application/vnd.mophun.certificate":["mpc"],"application/vnd.mozilla.xul+xml":["xul"],"application/vnd.ms-artgalry":["cil"],"application/vnd.ms-cab-compressed":["cab"],"application/vnd.ms-excel":["xls","xlm","xla","xlc","xlt","xlw"],"application/vnd.ms-excel.addin.macroenabled.12":["xlam"],"application/vnd.ms-excel.sheet.binary.macroenabled.12":["xlsb"],"application/vnd.ms-excel.sheet.macroenabled.12":["xlsm"],"application/vnd.ms-excel.template.macroenabled.12":["xltm"],"application/vnd.ms-fontobject":["eot"],"application/vnd.ms-htmlhelp":["chm"],"application/vnd.ms-ims":["ims"],"application/vnd.ms-lrm":["lrm"],"application/vnd.ms-officetheme":["thmx"],"application/vnd.ms-outlook":["msg"],"application/vnd.ms-pki.seccat":["cat"],"application/vnd.ms-pki.stl":["stl"],"application/vnd.ms-powerpoint":["ppt","pps","pot"],"application/vnd.ms-powerpoint.addin.macroenabled.12":["ppam"],"application/vnd.ms-powerpoint.presentation.macroenabled.12":["pptm"],"application/vnd.ms-powerpoint.slide.macroenabled.12":["sldm"],"application/vnd.ms-powerpoint.slideshow.macroenabled.12":["ppsm"],"application/vnd.ms-powerpoint.template.macroenabled.12":["potm"],"application/vnd.ms-project":["mpp","mpt"],"application/vnd.ms-word.document.macroenabled.12":["docm"],"application/vnd.ms-word.template.macroenabled.12":["dotm"],"application/vnd.ms-works":["wps","wks","wcm","wdb"],"application/vnd.ms-wpl":["wpl"],"application/vnd.ms-xpsdocument":["xps"],"application/vnd.mseq":["mseq"],"application/vnd.musician":["mus"],"application/vnd.muvee.style":["msty"],"application/vnd.mynfc":["taglet"],"application/vnd.neurolanguage.nlu":["nlu"],"application/vnd.nitf":["ntf","nitf"],"application/vnd.noblenet-directory":["nnd"],"application/vnd.noblenet-sealer":["nns"],"application/vnd.noblenet-web":["nnw"],"application/vnd.nokia.n-gage.data":["ngdat"],"application/vnd.nokia.n-gage.symbian.install":["n-gage"],"application/vnd.nokia.radio-preset":["rpst"],"application/vnd.nokia.radio-presets":["rpss"],"application/vnd.novadigm.edm":["edm"],"application/vnd.novadigm.edx":["edx"],"application/vnd.novadigm.ext":["ext"],"application/vnd.oasis.opendocument.chart":["odc"],"application/vnd.oasis.opendocument.chart-template":["otc"],"application/vnd.oasis.opendocument.database":["odb"],"application/vnd.oasis.opendocument.formula":["odf"],"application/vnd.oasis.opendocument.formula-template":["odft"],"application/vnd.oasis.opendocument.graphics":["odg"],"application/vnd.oasis.opendocument.graphics-template":["otg"],"application/vnd.oasis.opendocument.image":["odi"],"application/vnd.oasis.opendocument.image-template":["oti"],"application/vnd.oasis.opendocument.presentation":["odp"],"application/vnd.oasis.opendocument.presentation-template":["otp"],"application/vnd.oasis.opendocument.spreadsheet":["ods"],"application/vnd.oasis.opendocument.spreadsheet-template":["ots"],"application/vnd.oasis.opendocument.text":["odt"],"application/vnd.oasis.opendocument.text-master":["odm"],"application/vnd.oasis.opendocument.text-template":["ott"],"application/vnd.oasis.opendocument.text-web":["oth"],"application/vnd.olpc-sugar":["xo"],"application/vnd.oma.dd2+xml":["dd2"],"application/vnd.openofficeorg.extension":["oxt"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":["pptx"],"application/vnd.openxmlformats-officedocument.presentationml.slide":["sldx"],"application/vnd.openxmlformats-officedocument.presentationml.slideshow":["ppsx"],"application/vnd.openxmlformats-officedocument.presentationml.template":["potx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":["xlsx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.template":["xltx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":["docx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.template":["dotx"],"application/vnd.osgeo.mapguide.package":["mgp"],"application/vnd.osgi.dp":["dp"],"application/vnd.osgi.subsystem":["esa"],"application/vnd.palm":["pdb","pqa","oprc"],"application/vnd.pawaafile":["paw"],"application/vnd.pg.format":["str"],"application/vnd.pg.osasli":["ei6"],"application/vnd.picsel":["efif"],"application/vnd.pmi.widget":["wg"],"application/vnd.pocketlearn":["plf"],"application/vnd.powerbuilder6":["pbd"],"application/vnd.previewsystems.box":["box"],"application/vnd.proteus.magazine":["mgz"],"application/vnd.publishare-delta-tree":["qps"],"application/vnd.pvi.ptid1":["ptid"],"application/vnd.quark.quarkxpress":["qxd","qxt","qwd","qwt","qxl","qxb"],"application/vnd.realvnc.bed":["bed"],"application/vnd.recordare.musicxml":["mxl"],"application/vnd.recordare.musicxml+xml":["musicxml"],"application/vnd.rig.cryptonote":["cryptonote"],"application/vnd.rim.cod":["cod"],"application/vnd.rn-realmedia":["rm"],"application/vnd.rn-realmedia-vbr":["rmvb"],"application/vnd.route66.link66+xml":["link66"],"application/vnd.sailingtracker.track":["st"],"application/vnd.seemail":["see"],"application/vnd.sema":["sema"],"application/vnd.semd":["semd"],"application/vnd.semf":["semf"],"application/vnd.shana.informed.formdata":["ifm"],"application/vnd.shana.informed.formtemplate":["itp"],"application/vnd.shana.informed.interchange":["iif"],"application/vnd.shana.informed.package":["ipk"],"application/vnd.simtech-mindmapper":["twd","twds"],"application/vnd.smaf":["mmf"],"application/vnd.smart.teacher":["teacher"],"application/vnd.solent.sdkm+xml":["sdkm","sdkd"],"application/vnd.spotfire.dxp":["dxp"],"application/vnd.spotfire.sfs":["sfs"],"application/vnd.stardivision.calc":["sdc"],"application/vnd.stardivision.draw":["sda"],"application/vnd.stardivision.impress":["sdd"],"application/vnd.stardivision.math":["smf"],"application/vnd.stardivision.writer":["sdw","vor"],"application/vnd.stardivision.writer-global":["sgl"],"application/vnd.stepmania.package":["smzip"],"application/vnd.stepmania.stepchart":["sm"],"application/vnd.sun.wadl+xml":["wadl"],"application/vnd.sun.xml.calc":["sxc"],"application/vnd.sun.xml.calc.template":["stc"],"application/vnd.sun.xml.draw":["sxd"],"application/vnd.sun.xml.draw.template":["std"],"application/vnd.sun.xml.impress":["sxi"],"application/vnd.sun.xml.impress.template":["sti"],"application/vnd.sun.xml.math":["sxm"],"application/vnd.sun.xml.writer":["sxw"],"application/vnd.sun.xml.writer.global":["sxg"],"application/vnd.sun.xml.writer.template":["stw"],"application/vnd.sus-calendar":["sus","susp"],"application/vnd.svd":["svd"],"application/vnd.symbian.install":["sis","sisx"],"application/vnd.syncml+xml":["xsm"],"application/vnd.syncml.dm+wbxml":["bdm"],"application/vnd.syncml.dm+xml":["xdm"],"application/vnd.tao.intent-module-archive":["tao"],"application/vnd.tcpdump.pcap":["pcap","cap","dmp"],"application/vnd.tmobile-livetv":["tmo"],"application/vnd.trid.tpt":["tpt"],"application/vnd.triscape.mxs":["mxs"],"application/vnd.trueapp":["tra"],"application/vnd.ufdl":["ufd","ufdl"],"application/vnd.uiq.theme":["utz"],"application/vnd.umajin":["umj"],"application/vnd.unity":["unityweb"],"application/vnd.uoml+xml":["uoml"],"application/vnd.vcx":["vcx"],"application/vnd.visio":["vsd","vst","vss","vsw"],"application/vnd.visionary":["vis"],"application/vnd.vsf":["vsf"],"application/vnd.wap.wbxml":["wbxml"],"application/vnd.wap.wmlc":["wmlc"],"application/vnd.wap.wmlscriptc":["wmlsc"],"application/vnd.webturbo":["wtb"],"application/vnd.wolfram.player":["nbp"],"application/vnd.wordperfect":["wpd"],"application/vnd.wqd":["wqd"],"application/vnd.wt.stf":["stf"],"application/vnd.xara":["xar"],"application/vnd.xfdl":["xfdl"],"application/vnd.yamaha.hv-dic":["hvd"],"application/vnd.yamaha.hv-script":["hvs"],"application/vnd.yamaha.hv-voice":["hvp"],"application/vnd.yamaha.openscoreformat":["osf"],"application/vnd.yamaha.openscoreformat.osfpvg+xml":["osfpvg"],"application/vnd.yamaha.smaf-audio":["saf"],"application/vnd.yamaha.smaf-phrase":["spf"],"application/vnd.yellowriver-custom-menu":["cmp"],"application/vnd.zul":["zir","zirz"],"application/vnd.zzazz.deck+xml":["zaz"],"application/x-7z-compressed":["7z"],"application/x-abiword":["abw"],"application/x-ace-compressed":["ace"],"application/x-apple-diskimage":[],"application/x-arj":["arj"],"application/x-authorware-bin":["aab","x32","u32","vox"],"application/x-authorware-map":["aam"],"application/x-authorware-seg":["aas"],"application/x-bcpio":["bcpio"],"application/x-bdoc":[],"application/x-bittorrent":["torrent"],"application/x-blorb":["blb","blorb"],"application/x-bzip":["bz"],"application/x-bzip2":["bz2","boz"],"application/x-cbr":["cbr","cba","cbt","cbz","cb7"],"application/x-cdlink":["vcd"],"application/x-cfs-compressed":["cfs"],"application/x-chat":["chat"],"application/x-chess-pgn":["pgn"],"application/x-chrome-extension":["crx"],"application/x-cocoa":["cco"],"application/x-conference":["nsc"],"application/x-cpio":["cpio"],"application/x-csh":["csh"],"application/x-debian-package":["udeb"],"application/x-dgc-compressed":["dgc"],"application/x-director":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"],"application/x-doom":["wad"],"application/x-dtbncx+xml":["ncx"],"application/x-dtbook+xml":["dtb"],"application/x-dtbresource+xml":["res"],"application/x-dvi":["dvi"],"application/x-envoy":["evy"],"application/x-eva":["eva"],"application/x-font-bdf":["bdf"],"application/x-font-ghostscript":["gsf"],"application/x-font-linux-psf":["psf"],"application/x-font-otf":[],"application/x-font-pcf":["pcf"],"application/x-font-snf":["snf"],"application/x-font-ttf":["ttf","ttc"],"application/x-font-type1":["pfa","pfb","pfm","afm"],"application/x-freearc":["arc"],"application/x-futuresplash":["spl"],"application/x-gca-compressed":["gca"],"application/x-glulx":["ulx"],"application/x-gnumeric":["gnumeric"],"application/x-gramps-xml":["gramps"],"application/x-gtar":["gtar"],"application/x-hdf":["hdf"],"application/x-httpd-php":["php"],"application/x-install-instructions":["install"],"application/x-iso9660-image":[],"application/x-java-archive-diff":["jardiff"],"application/x-java-jnlp-file":["jnlp"],"application/x-latex":["latex"],"application/x-lua-bytecode":["luac"],"application/x-lzh-compressed":["lzh","lha"],"application/x-makeself":["run"],"application/x-mie":["mie"],"application/x-mobipocket-ebook":["prc","mobi"],"application/x-ms-application":["application"],"application/x-ms-shortcut":["lnk"],"application/x-ms-wmd":["wmd"],"application/x-ms-wmz":["wmz"],"application/x-ms-xbap":["xbap"],"application/x-msaccess":["mdb"],"application/x-msbinder":["obd"],"application/x-mscardfile":["crd"],"application/x-msclip":["clp"],"application/x-msdos-program":[],"application/x-msdownload":["com","bat"],"application/x-msmediaview":["mvb","m13","m14"],"application/x-msmetafile":["wmf","emf","emz"],"application/x-msmoney":["mny"],"application/x-mspublisher":["pub"],"application/x-msschedule":["scd"],"application/x-msterminal":["trm"],"application/x-mswrite":["wri"],"application/x-netcdf":["nc","cdf"],"application/x-ns-proxy-autoconfig":["pac"],"application/x-nzb":["nzb"],"application/x-perl":["pl","pm"],"application/x-pilot":[],"application/x-pkcs12":["p12","pfx"],"application/x-pkcs7-certificates":["p7b","spc"],"application/x-pkcs7-certreqresp":["p7r"],"application/x-rar-compressed":["rar"],"application/x-redhat-package-manager":["rpm"],"application/x-research-info-systems":["ris"],"application/x-sea":["sea"],"application/x-sh":["sh"],"application/x-shar":["shar"],"application/x-shockwave-flash":["swf"],"application/x-silverlight-app":["xap"],"application/x-sql":["sql"],"application/x-stuffit":["sit"],"application/x-stuffitx":["sitx"],"application/x-subrip":["srt"],"application/x-sv4cpio":["sv4cpio"],"application/x-sv4crc":["sv4crc"],"application/x-t3vm-image":["t3"],"application/x-tads":["gam"],"application/x-tar":["tar"],"application/x-tcl":["tcl","tk"],"application/x-tex":["tex"],"application/x-tex-tfm":["tfm"],"application/x-texinfo":["texinfo","texi"],"application/x-tgif":["obj"],"application/x-ustar":["ustar"],"application/x-virtualbox-hdd":["hdd"],"application/x-virtualbox-ova":["ova"],"application/x-virtualbox-ovf":["ovf"],"application/x-virtualbox-vbox":["vbox"],"application/x-virtualbox-vbox-extpack":["vbox-extpack"],"application/x-virtualbox-vdi":["vdi"],"application/x-virtualbox-vhd":["vhd"],"application/x-virtualbox-vmdk":["vmdk"],"application/x-wais-source":["src"],"application/x-web-app-manifest+json":["webapp"],"application/x-x509-ca-cert":["der","crt","pem"],"application/x-xfig":["fig"],"application/x-xliff+xml":["xlf"],"application/x-xpinstall":["xpi"],"application/x-xz":["xz"],"application/x-zmachine":["z1","z2","z3","z4","z5","z6","z7","z8"],"audio/vnd.dece.audio":["uva","uvva"],"audio/vnd.digital-winds":["eol"],"audio/vnd.dra":["dra"],"audio/vnd.dts":["dts"],"audio/vnd.dts.hd":["dtshd"],"audio/vnd.lucent.voice":["lvp"],"audio/vnd.ms-playready.media.pya":["pya"],"audio/vnd.nuera.ecelp4800":["ecelp4800"],"audio/vnd.nuera.ecelp7470":["ecelp7470"],"audio/vnd.nuera.ecelp9600":["ecelp9600"],"audio/vnd.rip":["rip"],"audio/x-aac":["aac"],"audio/x-aiff":["aif","aiff","aifc"],"audio/x-caf":["caf"],"audio/x-flac":["flac"],"audio/x-m4a":[],"audio/x-matroska":["mka"],"audio/x-mpegurl":["m3u"],"audio/x-ms-wax":["wax"],"audio/x-ms-wma":["wma"],"audio/x-pn-realaudio":["ram","ra"],"audio/x-pn-realaudio-plugin":["rmp"],"audio/x-realaudio":[],"audio/x-wav":[],"chemical/x-cdx":["cdx"],"chemical/x-cif":["cif"],"chemical/x-cmdf":["cmdf"],"chemical/x-cml":["cml"],"chemical/x-csml":["csml"],"chemical/x-xyz":["xyz"],"image/prs.btif":["btif"],"image/vnd.adobe.photoshop":["psd"],"image/vnd.dece.graphic":["uvi","uvvi","uvg","uvvg"],"image/vnd.djvu":["djvu","djv"],"image/vnd.dvb.subtitle":[],"image/vnd.dwg":["dwg"],"image/vnd.dxf":["dxf"],"image/vnd.fastbidsheet":["fbs"],"image/vnd.fpx":["fpx"],"image/vnd.fst":["fst"],"image/vnd.fujixerox.edmics-mmr":["mmr"],"image/vnd.fujixerox.edmics-rlc":["rlc"],"image/vnd.ms-modi":["mdi"],"image/vnd.ms-photo":["wdp"],"image/vnd.net-fpx":["npx"],"image/vnd.wap.wbmp":["wbmp"],"image/vnd.xiff":["xif"],"image/x-3ds":["3ds"],"image/x-cmu-raster":["ras"],"image/x-cmx":["cmx"],"image/x-freehand":["fh","fhc","fh4","fh5","fh7"],"image/x-icon":["ico"],"image/x-jng":["jng"],"image/x-mrsid-image":["sid"],"image/x-ms-bmp":[],"image/x-pcx":["pcx"],"image/x-pict":["pic","pct"],"image/x-portable-anymap":["pnm"],"image/x-portable-bitmap":["pbm"],"image/x-portable-graymap":["pgm"],"image/x-portable-pixmap":["ppm"],"image/x-rgb":["rgb"],"image/x-tga":["tga"],"image/x-xbitmap":["xbm"],"image/x-xpixmap":["xpm"],"image/x-xwindowdump":["xwd"],"model/vnd.collada+xml":["dae"],"model/vnd.dwf":["dwf"],"model/vnd.gdl":["gdl"],"model/vnd.gtw":["gtw"],"model/vnd.mts":["mts"],"model/vnd.vtu":["vtu"],"text/prs.lines.tag":["dsc"],"text/vnd.curl":["curl"],"text/vnd.curl.dcurl":["dcurl"],"text/vnd.curl.mcurl":["mcurl"],"text/vnd.curl.scurl":["scurl"],"text/vnd.dvb.subtitle":["sub"],"text/vnd.fly":["fly"],"text/vnd.fmi.flexstor":["flx"],"text/vnd.graphviz":["gv"],"text/vnd.in3d.3dml":["3dml"],"text/vnd.in3d.spot":["spot"],"text/vnd.sun.j2me.app-descriptor":["jad"],"text/vnd.wap.wml":["wml"],"text/vnd.wap.wmlscript":["wmls"],"text/x-asm":["s","asm"],"text/x-c":["c","cc","cxx","cpp","h","hh","dic"],"text/x-component":["htc"],"text/x-fortran":["f","for","f77","f90"],"text/x-handlebars-template":["hbs"],"text/x-java-source":["java"],"text/x-lua":["lua"],"text/x-markdown":["mkd"],"text/x-nfo":["nfo"],"text/x-opml":["opml"],"text/x-org":[],"text/x-pascal":["p","pas"],"text/x-processing":["pde"],"text/x-sass":["sass"],"text/x-scss":["scss"],"text/x-setext":["etx"],"text/x-sfv":["sfv"],"text/x-suse-ymp":["ymp"],"text/x-uuencode":["uu"],"text/x-vcalendar":["vcs"],"text/x-vcard":["vcf"],"video/vnd.dece.hd":["uvh","uvvh"],"video/vnd.dece.mobile":["uvm","uvvm"],"video/vnd.dece.pd":["uvp","uvvp"],"video/vnd.dece.sd":["uvs","uvvs"],"video/vnd.dece.video":["uvv","uvvv"],"video/vnd.dvb.file":["dvb"],"video/vnd.fvt":["fvt"],"video/vnd.mpegurl":["mxu","m4u"],"video/vnd.ms-playready.media.pyv":["pyv"],"video/vnd.uvvu.mp4":["uvu","uvvu"],"video/vnd.vivo":["viv"],"video/x-f4v":["f4v"],"video/x-fli":["fli"],"video/x-flv":["flv"],"video/x-m4v":["m4v"],"video/x-matroska":["mkv","mk3d","mks"],"video/x-mng":["mng"],"video/x-ms-asf":["asf","asx"],"video/x-ms-vob":["vob"],"video/x-ms-wm":["wm"],"video/x-ms-wmv":["wmv"],"video/x-ms-wmx":["wmx"],"video/x-ms-wvx":["wvx"],"video/x-msvideo":["avi"],"video/x-sgi-movie":["movie"],"video/x-smv":["smv"],"x-conference/x-cooltalk":["ice"]}},{}],4:[function(a,e,l){e.exports={"application/andrew-inset":["ez"],"application/applixware":["aw"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomsvc+xml":["atomsvc"],"application/bdoc":["bdoc"],"application/ccxml+xml":["ccxml"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cu-seeme":["cu"],"application/dash+xml":["mpd"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["ecma"],"application/emma+xml":["emma"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/font-tdpfr":["pfr"],"application/font-woff":["woff"],"application/font-woff2":["woff2"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["js","mjs"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["mp4s","m4p"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-signature":["asc","sig"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/pskc+xml":["pskcxml"],"application/rdf+xml":["rdf"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/voicexml+xml":["vxml"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/xaml+xml":["xaml"],"application/xcap-diff+xml":["xdf"],"application/xenc+xml":["xenc"],"application/xhtml+xml":["xhtml","xht"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":[],"audio/adpcm":["adp"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mp3":[],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/wav":["wav"],"audio/wave":[],"audio/webm":["weba"],"audio/xm":["xm"],"font/otf":["otf"],"image/apng":["apng"],"image/bmp":["bmp"],"image/cgm":["cgm"],"image/g3fax":["g3"],"image/gif":["gif"],"image/ief":["ief"],"image/jpeg":["jpeg","jpg","jpe"],"image/ktx":["ktx"],"image/png":["png"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/tiff":["tiff","tif"],"image/webp":["webp"],"message/rfc822":["eml","mime"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/mesh":["msh","mesh","silo"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["x3db","x3dbz"],"model/x3d+vrml":["x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/hjson":["hjson"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["markdown","md"],"text/mathml":["mml"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/richtext":["rtx"],"text/rtf":[],"text/sgml":["sgml","sgm"],"text/slim":["slim","slm"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vtt":["vtt"],"text/xml":[],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/jpeg":["jpgv"],"video/jpm":["jpm","jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/webm":["webm"]}},{}]},{},[2])(2)})}).call(this,typeof Se!="undefined"?Se:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"babel-runtime/core-js/object/create":19,"babel-runtime/helpers/classCallCheck":30,"babel-runtime/helpers/createClass":31,"babel-runtime/helpers/typeof":32}],243:[function(_,L,E){"use strict";E.encodeURIComponent=function(A){try{return encodeURIComponent(A)}catch(w){return A}},E.escape=_("escape-html"),E.timestamp=function(A){if(A){var w=A;return typeof w=="string"&&(w=Number(w)),String(A).length===10&&(w*=1e3),new Date(w)}return Math.round(Date.now()/1e3)}},{"escape-html":157}],244:[function(_,L,E){(function(A,w){"use strict";function v(y){return y&&y.__esModule?y:{default:y}}function u(y,r){return y===void 0?r:y}function f(y,r){return function(x,S,T){if(x)return r(x);y({data:S,status:T.statusCode,headers:T.headers,res:T})}}var o,t=_("babel-runtime/core-js/json/stringify"),i=v(t),s=_("babel-runtime/helpers/typeof"),h=v(s),a=_("util"),e=_("url"),l=_("http"),n=_("https"),d=_("debug")("urllib"),c=_("humanize-ms"),g=0,p=Math.pow(2,31)-10,m=/^https?:\/\//i;E.TIMEOUTS=[c("300s"),c("300s")];var b=["json","text"];E.request=function(y,r,x){return arguments.length===2&&typeof r=="function"&&(x=r,r=null),typeof x=="function"?E.requestWithCallback(y,r,x):(o||(o=_("any-promise")),new o(function(S,T){E.requestWithCallback(y,r,f(S,T))}))},E.requestWithCallback=function(y,r,x){function S(){Le&&(clearTimeout(Le),Le=null)}function T(){V&&(clearTimeout(V),V=null)}function R(Re,Te,we){if(T(),!x)return console.warn("[urllib:warn] [%s] [%s] [worker:%s] %s %s callback twice!!!",Date(),X,A.pid,se.method,y),void(Re&&console.warn(`[urllib:warn] [%s] [%s] [worker:%s] %s: %s
|
|
|
stack: %s`,Date(),X,A.pid,Re.name,Re.message,Re.stack));var xe=x;x=null;var ue={};if(we&&(F=we.statusCode,ue=we.headers),F===401&&ue["www-authenticate"]&&(!r.headers||!r.headers.Authorization)&&r.digestAuth){var de=ue["www-authenticate"];if(de.indexOf("Digest ")>=0)return d("Request#%d %s: got digest auth header WWW-Authenticate: %s",X,y,de),r.headers=r.headers||{},r.headers.Authorization=digestAuthHeader(se.method,se.path,de,r.digestAuth),d("Request#%d %s: auth with digest header: %s",X,y,r.headers.Authorization),we.headers["set-cookie"]&&(r.headers.Cookie=we.headers["set-cookie"].join(";")),E.requestWithCallback(y,r,xe)}var _e=Date.now()-H;Oe&&(Oe.contentDownload=_e),d("[%sms] done, %s bytes HTTP %s %s %s %s, keepAliveSocket: %s, timing: %j",_e,M,F,se.method,se.host,se.path,j,Oe);var me={status:F,statusCode:F,headers:ue,size:M,aborted:ae,rt:_e,keepAliveSocket:j,data:Te,requestUrls:r.requestUrls,timing:Oe,remoteAddress:ve,remotePort:Pe};if(Re){var Ie="";oe&&typeof oe.getCurrentStatus=="function"&&(Ie=", agent status: "+(0,i.default)(oe.getCurrentStatus())),Re.message+=", "+se.method+" "+y+" "+F+" (connected: "+O+", keepalive socket: "+j+Ie+`)
|
|
|
headers: `+(0,i.default)(ue),Re.data=Te,Re.path=se.path,Re.status=F,Re.headers=ue,Re.res=me}xe(Re,Te,r.streaming?we:me),r.emitter&&(z.url=y,z.socket=ke&&ke.connection,z.options=se,z.size=be,r.emitter.emit("response",{requestId:X,error:Re,ctx:r.ctx,req:z,res:me}))}function D(Re){var Te=null;if(r.followRedirect&&statuses.redirect[Re.statusCode]){r._followRedirectCount=(r._followRedirectCount||0)+1;var we=Re.headers.location;if(we){if(!(r._followRedirectCount>r.maxRedirects)){var xe=r.formatRedirectUrl?r.formatRedirectUrl(y,we):e.resolve(y,we);d("Request#%d %s: `redirected` from %s to %s",X,se.path,y,xe),T(),r.headers&&r.headers.Host&&m.test(we)&&(r.headers.Host=null);var ue=x;return x=null,E.requestWithCallback(xe,r,ue),{redirect:!0,error:null}}Te=new Error("Exceeded maxRedirects. Probably stuck in a redirect loop "+y),Te.name="MaxRedirectError"}else Te=new Error("Got statusCode "+Re.statusCode+" but cannot resolve next location from headers"),Te.name="FollowRedirectError"}return{redirect:!1,error:Te}}function k(Re,Te,we){return we(null,Te,Re.headers["content-encoding"])}function B(Re){if(Oe&&(Oe.waiting=Date.now()-H),d("Request#%d %s `req response` event emit: status %d, headers: %j",X,y,Re.statusCode,Re.headers),r.streaming){var Te=D(Re);return Te.redirect?void Re.resume():Te.error?(Re.resume(),R(Te.error,null,Re)):R(null,null,Re)}if(Re.on("close",function(){d("Request#%d %s: `res close` event emit, total size %d",X,y,M)}),Re.on("error",function(){d("Request#%d %s: `res error` event emit, total size %d",X,y,M)}),Re.on("aborted",function(){ae=!0,d("Request#%d %s: `res aborted` event emit, total size %d",X,y,M)}),De){var Te=D(Re);return Te.redirect?void Re.resume():Te.error?(Re.resume(),De.end(),R(Te.error,null,Re)):(r.consumeWriteStream===!1?Re.on("end",R.bind(null,null,null,Re)):isNode010||isNode012?first([[De,"close"],[Re,"aborted"]],function(ue,de,_e){d("Request#%d %s: writeStream or res %s event emitted",X,y,_e),R(C||null,null,Re)}):De.on("close",function(){d("Request#%d %s: writeStream close event emitted",X,y),R(C||null,null,Re)}),Re.pipe(De))}var we=[];Re.on("data",function(xe){d("Request#%d %s: `res data` event emit, size %d",X,y,xe.length),M+=xe.length,we.push(xe)}),Re.on("end",function(){var xe=w.concat(we,M);if(d("Request#%d %s: `res end` event emit, total size %d, _dumped: %s",X,y,M,Re._dumped),C)return R(C,xe,Re);var ue=D(Re);if(ue.error)return R(ue.error,xe,Re);ue.redirect||k(Re,xe,function(de,_e,me){if(de)return R(de,xe,Re);if(!me&&b.indexOf(r.dataType)>=0){try{_e=decodeBodyByCharset(_e,Re)}catch(Me){return d("decodeBodyByCharset error: %s",Me),R(null,_e,Re)}if(r.dataType==="json")if(M===0)_e=null;else{var Ie=parseJSON(_e,he);Ie.error?de=Ie.error:_e=Ie.data}}ae&&d("Request#%d %s: Remote socket was terminated before `response.end()` was called",X,y),R(de,_e,Re)})})}function G(){d("Response timer ticking, timeout: %d",Ke),V=setTimeout(function(){V=null;var Re="Response timeout for "+Ke+"ms";C=new Error(Re),C.name="ResponseTimeoutError",C.requestId=X,d("ResponseTimeout: Request#%d %s %s: %s, connected: %s",X,y,C.name,Re,O),P()},Ke)}function P(){d("Request#%d %s abort, connected: %s",X,y,O),ke.socket||(C.noSocket=!0,R(C)),ke.abort()}if(!y||typeof y!="string"&&(y===void 0?"undefined":(0,h.default)(y))!=="object"){var $=a.format("expect request url to be a string or a http request options, but got %j",y);throw new Error($)}arguments.length===2&&typeof r=="function"&&(x=r,r=null),r=r||{},g>=p&&(g=0);var X=++g;r.requestUrls=r.requestUrls||[];var z={requestId:X,url:y,args:r,ctx:r.ctx};r.emitter&&r.emitter.emit("request",z),r.timeout=r.timeout||E.TIMEOUTS,r.maxRedirects=r.maxRedirects||10,r.streaming=r.streaming||r.customResponse;var N,H=Date.now();typeof y=="string"?(m.test(y)||(y="http://"+y),N=e.parse(y)):N=y;var q=(r.type||r.method||N.method||"GET").toUpperCase(),ee=N.port||80,fe=l,oe=u(r.agent,E.agent),he=r.fixJSONCtlChars;N.protocol==="https:"&&(fe=n,oe=u(r.httpsAgent,E.httpsAgent),N.port||(ee=443));var se={host:N.hostname||N.host||"localhost",path:N.path||"/",method:q,port:ee,agent:oe,headers:r.headers||{},lookup:r.lookup};Array.isArray(r.timeout)?se.requestTimeout=r.timeout[r.timeout.length-1]:r.timeout!==void 0&&(se.requestTimeout=r.timeout);for(var ge=["pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","secureProtocol","secureOptions"],ie=0;ie<ge.length;ie++){var re=ge[ie];r.hasOwnProperty(re)&&(se[re]=r[re])}se.rejectUnauthorized!==!1||se.hasOwnProperty("secureOptions")||(se.secureOptions=_("constants").SSL_OP_NO_TLSv1_2);var Q=r.auth||N.auth;Q&&(se.auth=Q);var pe=r.content||r.data,ne=q==="GET"||q==="HEAD"||r.dataAsQueryString;if(!r.content&&pe&&typeof pe!="string"&&!w.isBuffer(pe))if(ne)pe=r.nestedQuerystring?qs.stringify(pe):querystring.stringify(pe);else{var J=se.headers["Content-Type"]||se.headers["content-type"];J||(J=r.contentType==="json"?"application/json":"application/x-www-form-urlencoded",se.headers["Content-Type"]=J),pe=parseContentType(J).type==="application/json"?(0,i.default)(pe):r.nestedQuerystring?qs.stringify(pe):querystring.stringify(pe)}ne&&pe&&(se.path+=(N.query?"&":"?")+pe,pe=null);var be=0;if(pe){var Ee=pe.length;w.isBuffer(pe)||(Ee=w.byteLength(pe)),be=se.headers["Content-Length"]=Ee}r.dataType==="json"&&(se.headers.Accept="application/json"),typeof r.beforeRequest=="function"&&r.beforeRequest(se);var Le=null,V=null,C=null,O=!1,j=!1,M=0,F=-1,ae=!1,ve="",Pe="",Oe=null;r.timing&&(Oe={queuing:0,dnslookup:0,connected:0,requestSent:0,waiting:0,contentDownload:0}),se.headers["User-Agent"]||se.headers["user-agent"]||(se.headers["User-Agent"]=navigator.userAgent),r.gzip&&(se.headers["Accept-Encoding"]||se.headers["accept-encoding"]||(se.headers["Accept-Encoding"]="gzip"));var De=r.writeStream;d("Request#%d %s %s with headers %j, options.path: %s",X,q,y,se.headers,se.path),r.requestUrls.push(y);var Ne,Ke;Array.isArray(r.timeout)?(Ne=c(r.timeout[0]),Ke=c(r.timeout[1])):Ne=Ke=c(r.timeout),d("ConnectTimeout: %d, ResponseTimeout: %d",Ne,Ke);var ke;try{ke=fe.request(se,B)}catch(Re){return R(Re)}return typeof window=="undefined"?function(){d("Connect timer ticking, timeout: %d",Ne),Le=setTimeout(function(){Le=null,F===-1&&(F=-2);var Re="Connect timeout for "+Ne+"ms",Te="ConnectionTimeoutError";ke.socket||(Te="SocketAssignTimeoutError",Re+=", working sockets is full"),C=new Error(Re),C.name=Te,C.requestId=X,d("ConnectTimeout: Request#%d %s %s: %s, connected: %s",X,y,C.name,Re,O),P()},Ne)}():ke.on("requestTimeout",function(){F===-1&&(F=-2);var Re="Connect timeout for "+Ne+"ms";C=new Error(Re),C.name="ConnectionTimeoutError",C.requestId=X,P()}),Oe&&ke.on("finish",function(){Oe.requestSent=Date.now()-H}),ke.once("socket",function(Re){Oe&&(Oe.queuing=Date.now()-H),isNode010&&Re.socket&&(Re=Re.socket);var Te=Re.readyState;if(Te==="opening")return Re.once("lookup",function(we,xe,ue){d("Request#%d %s lookup: %s, %s, %s",X,y,we,xe,ue),Oe&&(Oe.dnslookup=Date.now()-H),xe&&(ve=xe)}),void Re.once("connect",function(){Oe&&(Oe.connected=Date.now()-H),S(),G(),d("Request#%d %s new socket connected",X,y),O=!0,ve||(ve=Re.remoteAddress),Pe=Re.remotePort});d("Request#%d %s reuse socket connected, readyState: %s",X,y,Te),O=!0,j=!0,ve||(ve=Re.remoteAddress),Pe=Re.remotePort,S(),G()}),ke.on("error",function(Re){Re.name!=="Error"&&Re.name!=="TypeError"||(Re.name=O?"ResponseError":"RequestError"),Re.message+=' (req "error")',d("Request#%d %s `req error` event emit, %s: %s",X,y,Re.name,Re.message),R(C||Re)}),De&&De.once("error",function(Re){Re.message+=' (writeStream "error")',C=Re,d("Request#%d %s `writeStream error` event emit, %s: %s",X,y,Re.name,Re.message),P()}),r.stream?(r.stream.pipe(ke),r.stream.once("error",function(Re){Re.message+=' (stream "error")',C=Re,d("Request#%d %s `readStream error` event emit, %s: %s",X,y,Re.name,Re.message),P()})):ke.end(pe),ke.requestId=X,ke}}).call(this,_("_process"),_("buffer").Buffer)},{_process:173,"any-promise":13,"babel-runtime/core-js/json/stringify":17,"babel-runtime/helpers/typeof":32,buffer:38,constants:42,debug:155,http:196,https:159,"humanize-ms":160,url:203,util:207}]},{},[1])(1)}),!function(U){function _(E){if(L[E])return L[E].exports;var A=L[E]={i:E,l:!1,exports:{}};return U[E].call(A.exports,A,A.exports,_),A.l=!0,A.exports}var L={};_.m=U,_.c=L,_.d=function(E,A,w){_.o(E,A)||Object.defineProperty(E,A,{configurable:!1,enumerable:!0,get:w})},_.n=function(E){var A=E&&E.__esModule?function(){return E.default}:function(){return E};return _.d(A,"a",A),A},_.o=function(E,A){return Object.prototype.hasOwnProperty.call(E,A)},_.p="",_(_.s=12)}([function(U,_,L){!function(E,A){U.exports=_=A()}(0,function(){var E=E||function(A,w){var v=Object.create||function(){function n(){}return function(d){var c;return n.prototype=d,c=new n,n.prototype=null,c}}(),u={},f=u.lib={},o=f.Base=function(){return{extend:function(n){var d=v(this);return n&&d.mixIn(n),d.hasOwnProperty("init")&&this.init!==d.init||(d.init=function(){d.$super.init.apply(this,arguments)}),d.init.prototype=d,d.$super=this,d},create:function(){var n=this.extend();return n.init.apply(n,arguments),n},init:function(){},mixIn:function(n){for(var d in n)n.hasOwnProperty(d)&&(this[d]=n[d]);n.hasOwnProperty("toString")&&(this.toString=n.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),t=f.WordArray=o.extend({init:function(n,d){n=this.words=n||[],this.sigBytes=d!=null?d:4*n.length},toString:function(n){return(n||s).stringify(this)},concat:function(n){var d=this.words,c=n.words,g=this.sigBytes,p=n.sigBytes;if(this.clamp(),g%4)for(var m=0;m<p;m++){var b=c[m>>>2]>>>24-m%4*8&255;d[g+m>>>2]|=b<<24-(g+m)%4*8}else for(var m=0;m<p;m+=4)d[g+m>>>2]=c[m>>>2];return this.sigBytes+=p,this},clamp:function(){var n=this.words,d=this.sigBytes;n[d>>>2]&=4294967295<<32-d%4*8,n.length=A.ceil(d/4)},clone:function(){var n=o.clone.call(this);return n.words=this.words.slice(0),n},random:function(n){for(var d,c=[],g=0;g<n;g+=4){var p=function(m){var m=m,b=987654321,y=4294967295;return function(){b=36969*(65535&b)+(b>>16)&y,m=18e3*(65535&m)+(m>>16)&y;var r=(b<<16)+m&y;return r/=4294967296,(r+=.5)*(A.random()>.5?1:-1)}}(4294967296*(d||A.random()));d=987654071*p(),c.push(4294967296*p()|0)}return new t.init(c,n)}}),i=u.enc={},s=i.Hex={stringify:function(n){for(var d=n.words,c=n.sigBytes,g=[],p=0;p<c;p++){var m=d[p>>>2]>>>24-p%4*8&255;g.push((m>>>4).toString(16)),g.push((15&m).toString(16))}return g.join("")},parse:function(n){for(var d=n.length,c=[],g=0;g<d;g+=2)c[g>>>3]|=parseInt(n.substr(g,2),16)<<24-g%8*4;return new t.init(c,d/2)}},h=i.Latin1={stringify:function(n){for(var d=n.words,c=n.sigBytes,g=[],p=0;p<c;p++){var m=d[p>>>2]>>>24-p%4*8&255;g.push(String.fromCharCode(m))}return g.join("")},parse:function(n){for(var d=n.length,c=[],g=0;g<d;g++)c[g>>>2]|=(255&n.charCodeAt(g))<<24-g%4*8;return new t.init(c,d)}},a=i.Utf8={stringify:function(n){try{return decodeURIComponent(escape(h.stringify(n)))}catch(d){throw new Error("Malformed UTF-8 data")}},parse:function(n){return h.parse(unescape(encodeURIComponent(n)))}},e=f.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new t.init,this._nDataBytes=0},_append:function(n){typeof n=="string"&&(n=a.parse(n)),this._data.concat(n),this._nDataBytes+=n.sigBytes},_process:function(n){var d=this._data,c=d.words,g=d.sigBytes,p=this.blockSize,m=4*p,b=g/m;b=n?A.ceil(b):A.max((0|b)-this._minBufferSize,0);var y=b*p,r=A.min(4*y,g);if(y){for(var x=0;x<y;x+=p)this._doProcessBlock(c,x);var S=c.splice(0,y);d.sigBytes-=r}return new t.init(S,r)},clone:function(){var n=o.clone.call(this);return n._data=this._data.clone(),n},_minBufferSize:0}),l=(f.Hasher=e.extend({cfg:o.extend(),init:function(n){this.cfg=this.cfg.extend(n),this.reset()},reset:function(){e.reset.call(this),this._doReset()},update:function(n){return this._append(n),this._process(),this},finalize:function(n){return n&&this._append(n),this._doFinalize()},blockSize:16,_createHelper:function(n){return function(d,c){return new n.init(c).finalize(d)}},_createHmacHelper:function(n){return function(d,c){return new l.HMAC.init(n,c).finalize(d)}}}),u.algo={});return u}(Math);return E})},function(U,_,L){"use strict";function E(v,u){if(!(v instanceof u))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(_,"__esModule",{value:!0});var A=function(){function v(u,f){for(var o=0;o<f.length;o++){var t=f[o];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(u,t.key,t)}}return function(u,f,o){return f&&v(u.prototype,f),o&&v(u,o),u}}(),w=function(){function v(){E(this,v)}return A(v,null,[{key:"detectIEVersion",value:function(){for(var u=4,f=document.createElement("div"),o=f.getElementsByTagName("i");f.innerHTML="<!--[if gt IE "+u+"]><i></i><![endif]-->",o[0];)u++;return u>4&&u}},{key:"extend",value:function(u,f){for(var o in f)Object.prototype.hasOwnProperty.call(f,o)&&f[o]&&(u[o]=f[o])}},{key:"isArray",value:function(u){return Object.prototype.toString.call(arg)==="[object Array]"}},{key:"getFileType",value:function(u){return u=u.toLowerCase(),/.mp4|.flv|.m3u8|.avi|.rm|.rmvb|.mpeg|.mpg|.mov|.wmv|.3gp|.asf|.dat|.dv|.f4v|.gif|.m2t|.m4v|.mj2|.mjpeg|.mpe|.mts|.ogg|.qt|.swf|.ts|.vob|.wmv|.webm/.test(u)?"video":/.mp3|.wav|.ape|.cda|.au|.midi|.mac|.aac|.ac3|.acm|.amr|.caf|.flac|.m4a|.ra|.wma/.test(u)?"audio":/.bmp|.jpg|.jpeg|.png/.test(u)?"img":"other"}},{key:"isImage",value:function(u){return u=u.toLowerCase(),!!/.jpg|.jpeg|.png/.test(u)}},{key:"ISODateString",value:function(u){function f(o){return o<10?"0"+o:o}return u.getUTCFullYear()+"-"+f(u.getUTCMonth()+1)+"-"+f(u.getUTCDate())+"T"+f(u.getUTCHours())+":"+f(u.getUTCMinutes())+":"+f(u.getUTCSeconds())+"Z"}},{key:"isIntNum",value:function(u){return!!/^\d+$/.test(u)}}]),v}();_.default=w},function(U,_,L){!function(E,A){U.exports=_=A(L(0))}(0,function(E){return function(A){function w(l,n,d,c,g,p,m){var b=l+(n&d|~n&c)+g+m;return(b<<p|b>>>32-p)+n}function v(l,n,d,c,g,p,m){var b=l+(n&c|d&~c)+g+m;return(b<<p|b>>>32-p)+n}function u(l,n,d,c,g,p,m){var b=l+(n^d^c)+g+m;return(b<<p|b>>>32-p)+n}function f(l,n,d,c,g,p,m){var b=l+(d^(n|~c))+g+m;return(b<<p|b>>>32-p)+n}var o=E,t=o.lib,i=t.WordArray,s=t.Hasher,h=o.algo,a=[];!function(){for(var l=0;l<64;l++)a[l]=4294967296*A.abs(A.sin(l+1))|0}();var e=h.MD5=s.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(l,n){for(var d=0;d<16;d++){var c=n+d,g=l[c];l[c]=16711935&(g<<8|g>>>24)|4278255360&(g<<24|g>>>8)}var p=this._hash.words,m=l[n+0],b=l[n+1],y=l[n+2],r=l[n+3],x=l[n+4],S=l[n+5],T=l[n+6],R=l[n+7],D=l[n+8],k=l[n+9],B=l[n+10],G=l[n+11],P=l[n+12],$=l[n+13],X=l[n+14],z=l[n+15],N=p[0],H=p[1],q=p[2],ee=p[3];N=w(N,H,q,ee,m,7,a[0]),ee=w(ee,N,H,q,b,12,a[1]),q=w(q,ee,N,H,y,17,a[2]),H=w(H,q,ee,N,r,22,a[3]),N=w(N,H,q,ee,x,7,a[4]),ee=w(ee,N,H,q,S,12,a[5]),q=w(q,ee,N,H,T,17,a[6]),H=w(H,q,ee,N,R,22,a[7]),N=w(N,H,q,ee,D,7,a[8]),ee=w(ee,N,H,q,k,12,a[9]),q=w(q,ee,N,H,B,17,a[10]),H=w(H,q,ee,N,G,22,a[11]),N=w(N,H,q,ee,P,7,a[12]),ee=w(ee,N,H,q,$,12,a[13]),q=w(q,ee,N,H,X,17,a[14]),H=w(H,q,ee,N,z,22,a[15]),N=v(N,H,q,ee,b,5,a[16]),ee=v(ee,N,H,q,T,9,a[17]),q=v(q,ee,N,H,G,14,a[18]),H=v(H,q,ee,N,m,20,a[19]),N=v(N,H,q,ee,S,5,a[20]),ee=v(ee,N,H,q,B,9,a[21]),q=v(q,ee,N,H,z,14,a[22]),H=v(H,q,ee,N,x,20,a[23]),N=v(N,H,q,ee,k,5,a[24]),ee=v(ee,N,H,q,X,9,a[25]),q=v(q,ee,N,H,r,14,a[26]),H=v(H,q,ee,N,D,20,a[27]),N=v(N,H,q,ee,$,5,a[28]),ee=v(ee,N,H,q,y,9,a[29]),q=v(q,ee,N,H,R,14,a[30]),H=v(H,q,ee,N,P,20,a[31]),N=u(N,H,q,ee,S,4,a[32]),ee=u(ee,N,H,q,D,11,a[33]),q=u(q,ee,N,H,G,16,a[34]),H=u(H,q,ee,N,X,23,a[35]),N=u(N,H,q,ee,b,4,a[36]),ee=u(ee,N,H,q,x,11,a[37]),q=u(q,ee,N,H,R,16,a[38]),H=u(H,q,ee,N,B,23,a[39]),N=u(N,H,q,ee,$,4,a[40]),ee=u(ee,N,H,q,m,11,a[41]),q=u(q,ee,N,H,r,16,a[42]),H=u(H,q,ee,N,T,23,a[43]),N=u(N,H,q,ee,k,4,a[44]),ee=u(ee,N,H,q,P,11,a[45]),q=u(q,ee,N,H,z,16,a[46]),H=u(H,q,ee,N,y,23,a[47]),N=f(N,H,q,ee,m,6,a[48]),ee=f(ee,N,H,q,R,10,a[49]),q=f(q,ee,N,H,X,15,a[50]),H=f(H,q,ee,N,S,21,a[51]),N=f(N,H,q,ee,P,6,a[52]),ee=f(ee,N,H,q,r,10,a[53]),q=f(q,ee,N,H,B,15,a[54]),H=f(H,q,ee,N,b,21,a[55]),N=f(N,H,q,ee,D,6,a[56]),ee=f(ee,N,H,q,z,10,a[57]),q=f(q,ee,N,H,T,15,a[58]),H=f(H,q,ee,N,$,21,a[59]),N=f(N,H,q,ee,x,6,a[60]),ee=f(ee,N,H,q,G,10,a[61]),q=f(q,ee,N,H,y,15,a[62]),H=f(H,q,ee,N,k,21,a[63]),p[0]=p[0]+N|0,p[1]=p[1]+H|0,p[2]=p[2]+q|0,p[3]=p[3]+ee|0},_doFinalize:function(){var l=this._data,n=l.words,d=8*this._nDataBytes,c=8*l.sigBytes;n[c>>>5]|=128<<24-c%32;var g=A.floor(d/4294967296),p=d;n[15+(c+64>>>9<<4)]=16711935&(g<<8|g>>>24)|4278255360&(g<<24|g>>>8),n[14+(c+64>>>9<<4)]=16711935&(p<<8|p>>>24)|4278255360&(p<<24|p>>>8),l.sigBytes=4*(n.length+1),this._process();for(var m=this._hash,b=m.words,y=0;y<4;y++){var r=b[y];b[y]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8)}return m},clone:function(){var l=s.clone.call(this);return l._hash=this._hash.clone(),l}});o.MD5=s._createHelper(e),o.HmacMD5=s._createHmacHelper(e)}(Math),E.MD5})},function(U,_,L){"use strict";Object.defineProperty(_,"__esModule",{value:!0}),_.UPLOADSTATE={INIT:"init",UPLOADING:"uploading",COMPLETE:"complete",INTERRUPT:"interrupt"},_.UPLOADSTEP={INIT:"init",PART:"part",COMPLETE:"complete"},_.UPLOADDEFAULT={PARALLEL:5,PARTSIZE:1048576}},function(U,_,L){"use strict";function E(e){return e&&e.__esModule?e:{default:e}}function A(e,l){if(!(e instanceof l))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(_,"__esModule",{value:!0});var w=function(){function e(l,n){for(var d=0;d<n.length;d++){var c=n[d];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(l,c.key,c)}}return function(l,n,d){return n&&e(l.prototype,n),d&&e(l,d),l}}(),v=L(5),u=E(v),f=L(25),o=E(f),t=L(6),i=E(t),s=L(7),h=E(s),a=function(){function e(l){A(this,e);var n=h.default.os.name,d=h.default.os.version||"",c=h.default.browser.name,g=h.default.browser.version||"",p=window.location.href,m="";p&&(m=h.default.getHost(p));var b="pc";h.default.os.ipad?b="pad":(h.default.os.iphone||h.default.os.android)&&(b="phone"),this._ri=u.default.create(),this.initParam={APIVersion:"0.6.0",lv:"1",av:i.default.version,pd:"upload",sm:"upload",md:"uploader",uuid:e.getUuid(),os:n,ov:d,et:c,ev:g,uat:navigator.userAgent,app_n:m,tt:b,dm:"h5",ut:""}}return w(e,[{key:"log",value:function(l,n){n&&n.ri?(this._ri=n.ri,delete n.ri):this._ri=u.default.create(),n&&n.ut&&(this.initParam.ut=n.ut,delete n.ut),this.initParam.t=new Date().getTime(),this.initParam.ll=l=="20006"?"error":"info",this.initParam.ri=this._ri,this.initParam.e=l;var d=[];if(n)for(var c in n)d.push(c+"="+n[c]);var g=d.join("&");this.initParam.args=encodeURIComponent(g==""?"0":g);var p=[];for(var c in this.initParam)p.push(c+"="+this.initParam[c]);var m=p.join("&");AliyunUpload&&AliyunUpload.__logTestCallback__?AliyunUpload.__logTestCallback__(m):new Image(0,0).src="https://videocloud.cn-hangzhou.log.aliyuncs.com/logstores/upload/track?"+m}}],[{key:"getUuid",value:function(){var l=o.default.get("p_h5_upload_u");return l||(l=u.default.create(),o.default.set("p_h5_upload_u",l,730)),l}},{key:"getClientId",value:function(){return o.default.get("p_h5_upload_clientId")}},{key:"setClientId",value:function(l){return l||(l=u.default.create()),o.default.set("p_h5_upload_clientId",l,730),l}}]),e}();_.default=a},function(U,_,L){"use strict";function E(v,u){if(!(v instanceof u))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(_,"__esModule",{value:!0});var A=function(){function v(u,f){for(var o=0;o<f.length;o++){var t=f[o];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(u,t.key,t)}}return function(u,f,o){return f&&v(u.prototype,f),o&&v(u,o),u}}(),w=function(){function v(){E(this,v)}return A(v,null,[{key:"create",value:function(u,f){var o,t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),i=[];if(f=f||t.length,u)for(o=0;o<u;o++)i[o]=t[0|Math.random()*f];else{var s;for(i[8]=i[13]=i[18]=i[23]="-",i[14]="4",o=0;o<36;o++)i[o]||(s=0|16*Math.random(),i[o]=t[o==19?3&s|8:s])}return i.join("")}}]),v}();_.default=w},function(U,_,L){"use strict";Object.defineProperty(_,"__esModule",{value:!0});var E={version:"1.5.0"};_.default=E},function(U,_,L){"use strict";function E(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(_,"__esModule",{value:!0});var A=function(){function t(i,s){for(var h=0;h<s.length;h++){var a=s[h];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(i,a.key,a)}}return function(i,s,h){return s&&t(i.prototype,s),h&&t(i,h),i}}(),w=function(t){var i=navigator.userAgent,s="other";if(t.ios)return"iOS";if(t.android)return"android";if(i.indexOf("Baiduspider")>-1)return"Baiduspider";if(i.indexOf("PlayStation")>-1)return"PS4";var h=navigator.platform=="Win32"||navigator.platform=="Windows"||i.indexOf("Windows")>-1,a=navigator.platform=="Mac68K"||navigator.platform=="MacPPC"||navigator.platform=="Macintosh"||navigator.platform=="MacIntel";return a&&(s="macOS"),navigator.platform=="X11"&&!h&&!a&&(s="Unix"),String(navigator.platform).indexOf("Linux")>-1&&(s="Linux"),h?"windows":s},v=function(){var t=navigator.userAgent,i="";return(t.indexOf("Windows NT 5.0")>-1||t.indexOf("Windows 2000")>-1)&&(i="2000"),(t.indexOf("Windows NT 5.1")>-1||t.indexOf("Windows XP")>-1)&&(i="XP"),(t.indexOf("Windows NT 5.2")>-1||t.indexOf("Windows 2003")>-1)&&(i="2003"),(t.indexOf("Windows NT 6.0")>-1||t.indexOf("Windows Vista")>-1)&&(i="Vista"),(t.indexOf("Windows NT 6.1")>-1||t.indexOf("Windows 7")>-1)&&(i="7"),(t.indexOf("Windows NT 6.2")>-1||t.indexOf("Windows 8")>-1)&&(i="8"),(t.indexOf("Windows NT 6.3")>-1||t.indexOf("Windows 8.1")>-1)&&(i="8.1"),(t.indexOf("Windows NT 10")>-1||t.indexOf("Windows 10")>-1)&&(i="10"),i},u=function(t){var i=navigator.userAgent.toLowerCase();return t.chrome?"Chrome":t.firefox?"Firefox":t.safari?"Safari":t.webview?"webview":t.ie?/edge/.test(i)?"Edge":"IE":/baiduspider/.test(i)?"Baiduspider":/ucweb/.test(i)||/UCBrowser/.test(i)?"UC":/opera/.test(i)?"Opera":/ucweb/.test(i)?"UC":/360se/.test(i)?"360\u6D4F\u89C8\u5668":/bidubrowser/.test(i)?"\u767E\u5EA6\u6D4F\u89C8\u5668":/metasr/.test(i)?"\u641C\u72D7\u6D4F\u89C8\u5668":/lbbrowser/.test(i)?"\u730E\u8C79\u6D4F\u89C8\u5668":/micromessenger/.test(i)?"\u5FAE\u4FE1\u5185\u7F6E\u6D4F\u89C8\u5668":/qqbrowser/.test(i)?"QQ\u6D4F\u89C8\u5668":/playstation/.test(i)?"PS4\u6D4F\u89C8\u5668":void 0},f=function(){var t={},i={},s=navigator.userAgent,h=navigator.platform,a=s.match(/Web[kK]it[\/]{0,1}([\d.]+)/),e=s.match(/(Android);?[\s\/]+([\d.]+)?/),l=!!s.match(/\(Macintosh\; Intel /),n=s.match(/(iPad).*OS\s([\d_]+)/),d=s.match(/(iPod)(.*OS\s([\d_]+))?/),c=!n&&s.match(/(iPhone\sOS)\s([\d_]+)/),g=s.match(/(webOS|hpwOS)[\s\/]([\d.]+)/),p=/Win\d{2}|Windows/.test(h),m=s.match(/Windows Phone ([\d.]+)/),b=g&&s.match(/TouchPad/),y=s.match(/Kindle\/([\d.]+)/),r=s.match(/Silk\/([\d._]+)/),x=s.match(/(BlackBerry).*Version\/([\d.]+)/),S=s.match(/(BB10).*Version\/([\d.]+)/),T=s.match(/(RIM\sTablet\sOS)\s([\d.]+)/),R=s.match(/PlayBook/),D=s.match(/Chrome\/([\d.]+)/)||s.match(/CriOS\/([\d.]+)/),k=s.match(/Firefox\/([\d.]+)/),B=s.match(/\((?:Mobile|Tablet); rv:([\d.]+)\).*Firefox\/[\d.]+/),G=s.match(/MSIE\s([\d.]+)/)||s.match(/Trident\/[\d](?=[^\?]+).*rv:([0-9.].)/),P=!D&&s.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/),$=P||s.match(/Version\/([\d.]+)([^S](Safari)|[^M]*(Mobile)[^S]*(Safari))/);if((i.webkit=!!a)&&(i.version=a[1]),e&&(t.android=!0,t.version=e[2]),c&&!d&&(t.ios=t.iphone=!0,t.version=c[2].replace(/_/g,".")),n&&(t.ios=t.ipad=!0,t.version=n[2].replace(/_/g,".")),d&&(t.ios=t.ipod=!0,t.version=d[3]?d[3].replace(/_/g,"."):null),m&&(t.wp=!0,t.version=m[1]),g&&(t.webos=!0,t.version=g[2]),b&&(t.touchpad=!0),x&&(t.blackberry=!0,t.version=x[2]),S&&(t.bb10=!0,t.version=S[2]),T&&(t.rimtabletos=!0,t.version=T[2]),R&&(i.playbook=!0),y&&(t.kindle=!0,t.version=y[1]),r&&(i.silk=!0,i.version=r[1]),!r&&t.android&&s.match(/Kindle Fire/)&&(i.silk=!0),D&&(i.chrome=!0,i.version=D[1]),k&&(i.firefox=!0,i.version=k[1]),B&&(t.firefoxos=!0,t.version=B[1]),G&&(i.ie=!0,i.version=G[1]),$&&(l||t.ios||p||e)&&(i.safari=!0,t.ios||(i.version=$[1])),P&&(i.webview=!0),l){var X=s.match(/[\d]*_[\d]*_[\d]*/);X&&X.length>0&&X[0]&&(t.version=X[0].replace(/_/g,"."))}return t.tablet=!!(n||R||e&&!s.match(/Mobile/)||k&&s.match(/Tablet/)||G&&!s.match(/Phone/)&&s.match(/Touch/)),t.phone=!(t.tablet||t.ipod||!(e||c||g||x||S||D&&s.match(/Android/)||D&&s.match(/CriOS\/([\d.]+)/)||k&&s.match(/Mobile/)||G&&s.match(/Touch/))),t.pc=!t.tablet&&!t.phone,l?t.name="macOS":p?(t.name="windows",t.version=v()):t.name=w(t),i.name=u(i),{os:t,browser:i}}(),o=function(){function t(){E(this,t)}return A(t,null,[{key:"getHost",value:function(i){var s="";if(i===void 0||i==null||i=="")return"";var h=i.indexOf("//"),a=i;h>-1&&(a=i.substring(h+2));var s=a,e=a.split("/");return e&&e.length>0&&(s=e[0]),e=s.split(":"),e&&e.length>0&&(s=e[0]),s}},{key:"os",get:function(){return f.os}},{key:"browser",get:function(){var i=f.browser;return i.name||(i.name=u()),i}}]),t}();_.default=o},function(U,_,L){"use strict";function E(v,u){if(!(v instanceof u))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(_,"__esModule",{value:!0});var A=function(){function v(u,f){for(var o=0;o<f.length;o++){var t=f[o];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(u,t.key,t)}}return function(u,f,o){return f&&v(u.prototype,f),o&&v(u,o),u}}(),w=function(){function v(){E(this,v)}return A(v,null,[{key:"get",value:function(u,f,o,t,i){var s;o=o||function(){},typeof XMLHttpRequest=="undefined"&&(window.XMLHttpRequest=function(){try{return new window.ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(h){}try{return new window.ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(h){}try{return new window.ActiveXObject("Msxml2.XMLHTTP")}catch(h){}throw new Error("This browser does not support XMLHttpRequest.")}),s=new XMLHttpRequest,s.onreadystatechange=function(){s.readyState===4&&(s.status===200?f(s.responseText):o(s.responseText))};try{t===void 0&&(t=!0),s.open("GET",u,t),i&&(s.withCredentials=!0)}catch(h){return void o(h)}try{s.send()}catch(h){o(h)}}}]),v}();_.default=w},function(U,_,L){"use strict";function E(f,o){if(!(f instanceof o))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(_,"__esModule",{value:!0});var A=function(){function f(o,t){for(var i=0;i<t.length;i++){var s=t[i];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(o,s.key,s)}}return function(o,t,i){return t&&f(o.prototype,t),i&&f(o,i),o}}(),w=L(27),v=L(30),u=(L(10),function(){function f(){E(this,f)}return A(f,null,[{key:"randomUUID",value:function(){for(var o=[],t="0123456789abcdef",i=0;i<36;i++)o[i]=t.substr(Math.floor(16*Math.random()),1);return o[14]="4",o[19]=t.substr(3&o[19]|8,1),o[8]=o[13]=o[18]=o[23]="-",o.join("")}},{key:"aliyunEncodeURI",value:function(o){var t=encodeURIComponent(o);return t=t.replace(/\+/g,"%20").replace(/\*/g,"%2A").replace(/%7E/g,"~").replace(/!/g,"%21").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/'/g,"%27")}},{key:"makeUTF8sort",value:function(o,t,i){if(!o)throw new Error("PrismPlayer Error: vid should not be null!");var s=[];for(var h in o)s.push(h);for(var a=s.sort(),e="",l=a.length,h=0;h<l;h++){var n=f.aliyunEncodeURI(a[h]),d=f.aliyunEncodeURI(o[a[h]]);e==""?e=n+t+d:e+=i+n+t+d}return e}},{key:"makeChangeSiga",value:function(o,t){if(!o)throw new Error("PrismPlayer Error: vid should not be null!");return v.stringify(w("GET&"+f.aliyunEncodeURI("/")+"&"+f.aliyunEncodeURI(f.makeUTF8sort(o,"=","&")),t+"&"))}}]),f}());_.default=u},function(U,_,L){!function(E,A){U.exports=_=A(L(0))}(0,function(E){return E.enc.Utf8})},function(U,_,L){!function(E,A){U.exports=_=A(L(0))}(0,function(E){return E.enc.Hex})},function(U,_,L){U.exports=L(13)},function(U,_,L){"use strict";var E,A,w=(typeof Symbol=="function"&&Symbol.iterator,L(14)),v=function(f){return f&&f.__esModule?f:{default:f}}(w),u={Vod:v.default};E=[],(A=function(){return u}.apply(_,E))!==void 0&&(U.exports=A),window.AliyunUpload=u,Ze.exports=AliyunUpload},function(U,_,L){"use strict";function E(S){return S&&S.__esModule?S:{default:S}}function A(S,T){if(!(S instanceof T))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(_,"__esModule",{value:!0});var w=function(){function S(T,R){for(var D=0;D<R.length;D++){var k=R[D];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(T,k.key,k)}}return function(T,R,D){return R&&S(T.prototype,R),D&&S(T,D),T}}(),v=L(15),u=L(3),f=L(16),o=E(f),t=L(18),i=E(t),s=L(24),h=E(s),a=L(4),e=E(a),l=L(1),n=E(l),d=L(5),c=E(d),g=L(26),p=E(g),m=L(31),b=E(m),y=L(32),r=E(y),x=(L(2),function(){function S(T){A(this,S),this.options=T,this.options.partSize=this.options.partSize||u.UPLOADDEFAULT.PARTSIZE,this.options.parallel=this.options.parallel||u.UPLOADDEFAULT.PARALLEL,this.options.region=this.options.region||"cn-shanghai",this.options.cname=this.options.cname||!1,this.options.localCheckpoint=this.options.localCheckpoint||!1,this.options.enableUploadProgress===void 0&&(this.options.enableUploadProgress=!0),this._ossCreditor=new Object,this._state=v.VODSTATE.INIT,this._uploadList=[],this._curIndex=-1,this._ossUpload=null,this._log=new e.default,this._retryCount=0,this._retryTotal=this.options.retryCount||3,this._retryDuration=this.options.retryDuration||2,this._state=v.VODSTATE.INIT,this._uploadWay="vod",this._onbeforeunload=!1,this._invalidUserId=!1,this._initEvent()}return w(S,[{key:"init",value:function(T,R,D,k){return this._retryCount=0,!(D&&!k||!D&&k)&&!(T&&!R||!T&&R)&&(this._ossCreditor.accessKeyId=T,this._ossCreditor.accessKeySecret=R,this._ossCreditor.securityToken=D,this._ossCreditor.expireTime=k,!0)}},{key:"addFile",value:function(T,R,D,k,B,G){if(!T)return!1;if(T.size==0)try{this.options.onUploadFailed({file:T},"EmptyFile","\u6587\u4EF6\u5927\u5C0F\u4E3A0\uFF0C\u4E0D\u80FD\u4E0A\u4F20")}catch(z){console.log(z)}for(var P=(this.options,0);P<this._uploadList.length;P++)if(this._uploadList[P].file==T)return!1;var $=new Object;if($.file=T,$._endpoint=R,$._bucket=D,$._object=k,$.state=v.UPLOADSTATE.INIT,$.isImage=n.default.isImage(T.name),!$.isImage&&this.options.enableUploadProgress){var X=this;r.default.getMd5(T,function(z){$.fileHash=z;var N=X._getCheckoutpoint($);X.options.localCheckpoint||N||X._getCheckoutpointFromCloud($,function(H){if(H.UploadPoint){var q=JSON.parse(H.UploadPoint);q.loaded!=1&&($.checkpoint=q.checkpoint,$.loaded=q.loaded,$.videoId=H.VideoId,X._saveCheckoutpoint($,q.checkpoint))}},function(H){try{if((H=JSON.parse(H))&&H.Code=="InvalidParameter"&&H.Message.indexOf("UserId")>0){X._invalidUserId=!0;var q=H.Message+"\uFF0C\u6B63\u786E\u8D26\u53F7ID(userId)\u8BF7\u53C2\u8003\uFF1Ahttps://help.aliyun.com/knowledge_detail/37196.html";console.log(q)}}catch(ee){console.log(ee)}})})}B&&($.videoInfo=B?JSON.parse(B).Vod:{},$.userData=i.default.encode(B)),$.ri=c.default.create(),this._uploadList.push($),this._reportLog("20001",$,{ql:this._uploadList.length});try{this.options.addFileSuccess&&this.options.addFileSuccess($)}catch(z){console.log(z)}return!0}},{key:"deleteFile",value:function(T){return!!this.cancelFile(T)&&(this._uploadList.splice(T,1),!0)}},{key:"cleanList",value:function(){this.stopUpload(),this._uploadList.length=0,this._curIndex=-1}},{key:"cancelFile",value:function(T){if(this.options,T<0||T>=this._uploadList.length)return!1;var R=this._uploadList[T];if(T==this._curIndex&&R.state==v.UPLOADSTATE.UPLOADING){R.state=v.UPLOADSTATE.CANCELED;var D=this._getCheckoutpoint(R);D&&D.checkpoint&&(D=D.checkpoint),D&&this._ossUpload.abort(R),this._removeCheckoutpoint(R),this.nextUpload()}else R.state!=v.UPLOADSTATE.SUCCESS&&(R.state=v.UPLOADSTATE.CANCELED);return this._reportLog("20008",R),!0}},{key:"resumeFile",value:function(T){if(this.options,T<0||T>=this._uploadList.length)return!1;var R=this._uploadList[T];return R.state==v.UPLOADSTATE.CANCELED&&(R.state=v.UPLOADSTATE.INIT,!0)}},{key:"listFiles",value:function(){return this._uploadList}},{key:"getCheckpoint",value:function(T){return this._getCheckoutpoint({file:T})}},{key:"startUpload",value:function(T){if(this._retryCount=0,this.options,this._state==v.VODSTATE.START||this._state==v.VODSTATE.EXPIRE)return void console.log("already started or expired");if(this._initState(),this._curIndex=this._findUploadIndex(),this._curIndex==-1)return void(this._state=v.VODSTATE.END);var R=this._uploadList[this._curIndex];this._ossUpload=null,this._upload(R),this._state=v.VODSTATE.START}},{key:"nextUpload",value:function(){var T=this.options;if(this._state==v.VODSTATE.START)if(this._curIndex=this._findUploadIndex(),this._curIndex!=-1){var R=this._uploadList[this._curIndex];this._ossUpload=null,this._upload(R)}else{this._state=v.VODSTATE.END;try{T.onUploadEnd&&T.onUploadEnd(R)}catch(D){console.log(D)}}}},{key:"clear",value:function(T){for(var R=this.options,D=0,k=0;k<this._uploadList.length;k++)R.uploadList[k].state==v.UPLOADSTATE.SUCCESS&&D++,this._uploadList[k].state==T&&(R.uploadList.splice(k,1),k--);R.onClear&&R.onClear(R.uploadList.length,D)}},{key:"stopUpload",value:function(){if((this._state==v.VODSTATE.START||this._state==v.VODSTATE.FAILURE||this._curIndex==-1)&&this._curIndex!=-1){var T=this._uploadList[this._curIndex];this._state=v.VODSTATE.STOP,T.state=v.UPLOADSTATE.STOPED,this._changeState(T,v.UPLOADSTATE.STOPED),this._ossUpload.cancel()}}},{key:"resumeUploadWithAuth",value:function(T){var R=this;if(!T)return!1;var D=JSON.parse(i.default.decode(T));return!!(D.AccessKeyId&&D.AccessKeySecret&&D.SecurityToken&&D.Expiration)&&R.resumeUploadWithToken(D.AccessKeyId,D.AccessKeySecret,D.SecurityToken,D.Expiration)}},{key:"resumeUploadWithToken",value:function(T,R,D,k){if(this.options,!(T&&R&&D&&k))return!1;if(this._state!=v.VODSTATE.EXPIRE)return!1;if(this._curIndex==-1)return!1;var B="";return this._uploadList.length>this._curIndex&&(B=this._uploadList[this._curIndex]),B&&(this.init(T,R,D,k),this._state=v.VODSTATE.START,this._ossUpload=null,this._uploadCore(B,B.retry),B.retry=!1),!0}},{key:"resumeUploadWithSTSToken",value:function(T,R,D){if(this._curIndex==-1)return!1;if(this._state!=v.VODSTATE.EXPIRE)return!1;if(this._uploadList.length>this._curIndex){var k=this._uploadList[this._curIndex];k.object?this._refreshSTSTokenUpload(k,T,R,D):this.setSTSToken(k,T,R,D)}}},{key:"setSTSTokenDirectlyUpload",value:function(T,R,D,k,B){if(!(R&&D&&k&&B))return console.log("accessKeyId\u3001ccessKeySecret\u3001securityToken and expiration should not be empty."),!1;this._ut="oss";var G=T;this.init(R,D,k,B),G.endpoint=G._endpoint,G.bucket=G._bucket,G.object=G._object,this._ossUpload=null,this._uploadCore(G,T.retry),T.retry=!1}},{key:"setSTSToken",value:function(T,R,D,k){if(!R||!D||!k)return console.log("accessKeyId\u3001ccessKeySecret\u3001securityToken should not be empty."),!1;this._ut="vod",this._uploadWay="sts";var B=T.videoInfo,G={accessKeyId:R,securityToken:k,accessKeySecret:D,fileName:T.file.name,title:B.Title,requestId:T.ri,region:this.options.region};B.ImageType&&(G.imageType=B.ImageType),B.ImageExt&&(G.imageExt=B.ImageExt),B.FileSize&&(G.fileSize=B.FileSize),B.Description&&(G.description=B.Description),B.CateId&&(G.cateId=B.CateId),B.Tags&&(G.tags=B.Tags),B.TemplateGroupId&&(G.templateGroupId=B.TemplateGroupId),B.StorageLocation&&(G.storageLocation=B.StorageLocation),B.CoverURL&&(G.coverUrl=B.CoverURL),B.TransCodeMode&&(G.transCodeMode=B.TransCodeMode),B.UserData&&(G.userData=B.UserData);var P=this,$="getUploadAuth";T.videoId?(G.videoId=T.videoId,$="refreshUploadAuth"):T.isImage&&($="getImageUploadAuth"),p.default[$](G,function(X){T.videoId=X.VideoId?X.VideoId:T.videoId,P.setUploadAuthAndAddress(T,X.UploadAuth,X.UploadAddress),P._state=v.VODSTATE.START},function(X){P._error(T,{name:X.Code,code:X.Code,message:X.Message,requestId:X.RequestId})})}},{key:"setUploadAuthAndAddress",value:function(T,R,D,k){if(!T||!R||!D)return!1;var B=JSON.parse(i.default.decode(R));if(!(B.AccessKeyId&&B.AccessKeySecret&&B.SecurityToken&&B.Expiration))return console.error("uploadauth is invalid"),!1;var G={},P=T;if(D){if(G=JSON.parse(i.default.decode(D)),!G.Endpoint||!G.Bucket||!G.FileName)return console.error("uploadAddress is invalid"),!1}else G.Endpoint=P.endpoint,G.Bucket=P.bucket,G.FileName=P.object;this._ut="vod",this._uploadWay="vod",this.options.region=B.Region||this.options.region,this.init(B.AccessKeyId,B.AccessKeySecret,B.SecurityToken,B.Expiration),P.endpoint=P._endpoint?P._endpoint:G.Endpoint,P.bucket=P._bucket?P._bucket:G.Bucket,P.object=P._object?P._object:G.FileName,P.region=this.options.region,k&&(P.videoId=k),this._ossUpload=null,this._uploadCore(P,T.retry),T.retry=!1}},{key:"_refreshSTSTokenUpload",value:function(T,R,D,k){if(!R||!D||!k)return console.log("accessKeyId\u3001ccessKeySecret\u3001securityToken should not be empty."),!1;var B={accessKeyId:R,securityToken:k,accessKeySecret:D,videoId:T.object,requestId:T.ri,region:this.options.region},G=this,P="refreshUploadAuth";T.isImage&&(P="getImageUploadAuth"),p.default[P](B,function($){G.setUploadAuthAndAddress(T,$.UploadAuth,UploadAddress),G._state=v.VODSTATE.START},function($){G._error(T,{name:$.Code,code:$.Code,message:$.Message,requestId:$.RequestId})})}},{key:"_upload",value:function(T){var R=arguments.length>1&&arguments[1]!==void 0&&arguments[1],D=this.options;if(T.retry=R,D.onUploadstarted&&!R)try{var k=this._getCheckoutpoint(T);k&&k.state!=v.UPLOADSTATE.UPLOADING&&(T.checkpoint=k,T.videoId=k.videoId),D.onUploadstarted(T)}catch(B){console.log(B)}}},{key:"_uploadCore",value:function(T){if(arguments.length>1&&arguments[1]!==void 0&&arguments[1],!this._ossCreditor.accessKeyId||!this._ossCreditor.accessKeySecret||!this._ossCreditor.securityToken)throw new Error("AccessKeyId\u3001AccessKeySecret\u3001securityToken should not be null");if(T.state=v.UPLOADSTATE.UPLOADING,!this._ossUpload){T.endpoint=T.endpoint||"http://oss-cn-hangzhou.aliyuncs.com";var R=this;this._ossUpload=new o.default({bucket:T.bucket,endpoint:T.endpoint,AccessKeyId:this._ossCreditor.accessKeyId,AccessKeySecret:this._ossCreditor.accessKeySecret,SecurityToken:this._ossCreditor.securityToken,timeout:this.options.timeout,cname:this.options.cname},{onerror:function(X,z){R._error.call(R,X,z)},oncomplete:function(X,z){R._complete.call(R,X,z)},onprogress:function(X,z,N){R._progress.call(R,X,z,N)}})}var D=n.default.getFileType(T.file.name),k=this._getCheckoutpoint(T),B="",G="";k&&k.checkpoint&&(G=k.state,B=k.videoId,k=k.checkpoint),k&&B==T.videoId&&G!=v.UPLOADSTATE.UPLOADING&&(k.file=T.file,T.checkpoint=k,k.uploadId);var P=this._adjustPartSize(T);this._reportLog("20002",T,{ft:D,fs:T.file.size,bu:T.bucket,ok:T.object,vid:T.videoId||"",fn:T.file.name,fw:null,fh:null,ps:P});var $={headers:{"x-oss-notification":T.userData?T.userData:""},partSize:P,parallel:this.options.parallel};this._ossUpload.upload(T,$)}},{key:"_findUploadIndex",value:function(){for(var T=-1,R=0;R<this._uploadList.length;R++)if(this._uploadList[R].state==v.UPLOADSTATE.INIT){T=R;break}return T}},{key:"_error",value:function(T,R){if(R.name=="cancel")try{this.options.onUploadCanceled(T,R)}catch(k){console.log(k)}else{if(R.message.indexOf("InvalidAccessKeyIdError")>0||R.name=="SignatureDoesNotMatchError"||R.code=="SecurityTokenExpired"||R.code=="InvalidSecurityToken.Expired"||R.code=="InvalidAccessKeyId"&&this._ossCreditor.securityToken){if(this.options.onUploadTokenExpired){this._state=v.VODSTATE.EXPIRE,T.state=v.UPLOADSTATE.FAIlURE;try{this.options.onUploadTokenExpired(T,R)}catch(k){console.log(k)}}return}if((R.name=="RequestTimeoutError"||R.name=="ConnectionTimeout"||R.name=="ConnectionTimeoutError")&&this._retryTotal>this._retryCount){var D=this;return setTimeout(function(){D._uploadCore(T,!0)},1e3*D._retryDuration),void this._retryCount++}R.name=="NoSuchUploadError"&&this._removeCheckoutpoint(T),this._handleError(T,R)}}},{key:"_handleError",value:function(T,R){var D=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],k=v.UPLOADSTATE.FAIlURE;if(T.state!=v.UPLOADSTATE.CANCELED&&(T.state=v.UPLOADSTATE.FAIlURE,this._state=v.VODSTATE.FAILURE,this.options.onUploadFailed&&R&&R.code&&R.message))try{this.options.onUploadFailed(T,R.code,R.message)}catch(G){console.log(G)}if(D&&this._changeState(T,k),this._reportLog("20006",T,{code:R.name,message:R.message,requestId:R.requestId,fs:T.file.size,bu:T.bucket,ok:T.object,fn:T.file.name}),this._reportLog("20004",T,{requestId:R.requestId,fs:T.file.size,bu:T.bucket,ok:T.object,fn:T.file.name}),T.ri=c.default.create(),this._findUploadIndex()!=-1){var B=this;this._state=v.VODSTATE.START,setTimeout(function(){B.nextUpload()},100)}}},{key:"_complete",value:function(T,R){if(T.state=v.UPLOADSTATE.SUCCESS,this.options.onUploadSucceed)try{this.options.onUploadSucceed(T)}catch(B){console.log(B)}var D=0;R&&R.res&&R.res.headers&&(D=R.res.headers["x-oss-request-id"]),this._removeCheckoutpoint(T);var k=this;setTimeout(function(){k.nextUpload()},100),this._retryCount=0,this._reportLog("20003",T,{requestId:D})}},{key:"_progress",value:function(T,R,D){if(this.options.onUploadProgress)try{T.loaded=R.loaded,this.options.onUploadProgress(T,R.total,R.loaded)}catch(z){console.log(z)}var k=R.checkpoint,B=0;k&&(T.checkpoint=k,this._saveCheckoutpoint(T,k,v.UPLOADSTATE.UPLOADING),B=k.uploadId),this._retryCount=0;var G=this._getPortNumber(k),P=0;if(D&&D.headers&&(P=D.headers["x-oss-request-id"]),R.loaded!=0&&this._reportLog("20007",T,{pn:G,requestId:P}),R.loaded!=1&&this._reportLog("20005",T,{UploadId:B,pn:G+1,pr:T.retry?1:0,fs:T.file.size,bu:T.bucket,ok:T.object,fn:T.file.name}),!this._invalidUserId&&!T.isImage&&this._ut=="vod"&&this.options.enableUploadProgress){var $={file:T.file,checkpoint:R,userId:this.options.userId,videoId:T.videoId,region:this.options.region,fileHash:T.fileHash};try{var X=this;b.default.upload($,function(){},function(z){if((z=JSON.parse(z))&&z.Code=="InvalidParameter"&&z.Message.indexOf("UserId")>0){X._invalidUserId=!0;var N=z.Message+"\uFF0C\u6B63\u786E\u8D26\u53F7ID(userId)\u8BF7\u53C2\u8003\uFF1Ahttps://help.aliyun.com/knowledge_detail/37196.html";console.log(N)}})}catch(z){console.log(z)}}}},{key:"_getPortNumber",value:function(T){if(T){var R=T.doneParts;if(R&&R.length>0)return R[R.length-1].number}return 0}},{key:"_removeCheckoutpoint",value:function(T){var R=this._getCheckoutpointKey(T);h.default.remove(R)}},{key:"_getCheckoutpoint",value:function(T){var R=this._getCheckoutpointKey(T),D=h.default.get(R);if(D)try{return JSON.parse(D)}catch(k){}return""}},{key:"_saveCheckoutpoint",value:function(T,R,D){if(R){var k=this._getCheckoutpointKey(T),B=T.file,G={fileName:B.name,lastModified:B.lastModified,size:B.size,object:T.object,videoId:T.videoId,bucket:T.bucket,endpoint:T.endpoint,checkpoint:R,loaded:T.loaded,state:D};h.default.set(k,JSON.stringify(G))}}},{key:"_changeState",value:function(T,R){var D=this._getCheckoutpoint(T);D&&((this._onbeforeunload=!0)&&(R=v.UPLOADSTATE.STOPED),this._saveCheckoutpoint(T,D.checkpoint,R))}},{key:"_getCheckoutpointKey",value:function(T){return"upload_"+T.file.lastModified+"_"+T.file.name+"_"+T.file.size}},{key:"_getCheckoutpointFromCloud",value:function(T,R,D){var k={userId:this.options.userId,uploadInfoList:[{FileName:T.file.name,FileSize:T.file.size,FileCreateTime:T.file.lastModified,FileHash:T.fileHash}],region:this.options.region};b.default.get(k,function(B){R(B)},D)}},{key:"_reportLog",value:function(T,R,D){D||(D={}),D.ri=R.ri,this._ut&&(D.ut=this._ut),this._log.log(T,D)}},{key:"_initEvent",value:function(){var T=this;window&&(window.onbeforeunload=function(R){if(T._onbeforeunload=!0,T._curIndex!=-1&&T._uploadList.length>T._curIndex){var D=T._uploadList[T._curIndex];T._changeState(D,v.UPLOADSTATE.STOPED)}})}},{key:"_initState",value:function(){for(var T=0;T<this._uploadList.length;T++){var R=this._uploadList[T];R.state!=v.UPLOADSTATE.FAIlURE&&R.state!=v.UPLOADSTATE.STOPED||(R.state=v.UPLOADSTATE.INIT)}this._state=v.VODSTATE.INIT}},{key:"_adjustPartSize",value:function(T){return T.file.size/this.options.partSize>1e4?T.file.size/9999:this.options.partSize}}]),S}());_.default=x},function(U,_,L){"use strict";Object.defineProperty(_,"__esModule",{value:!0}),_.UPLOADSTATE={INIT:"Ready",UPLOADING:"Uploading",SUCCESS:"Success",FAIlURE:"Failure",CANCELED:"Canceled",STOPED:"Stoped"},_.VODSTATE={INIT:"Init",START:"Start",STOP:"Stop",FAILURE:"Failure",EXPIRE:"Expire",END:"End"}},function(U,_,L){"use strict";function E(t){return t&&t.__esModule?t:{default:t}}function A(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(_,"__esModule",{value:!0});var w=function(){function t(i,s){for(var h=0;h<s.length;h++){var a=s[h];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(i,a.key,a)}}return function(i,s,h){return s&&t(i.prototype,s),h&&t(i,h),i}}(),v=L(3),u=L(17),f=(E(u),L(1)),o=(E(f),function(){function t(i,s){if(A(this,t),i){this._config=i,this.create(this._config),this._uploadInfo=null,this._callback={};var h=function(){};this._callback.onerror=s.onerror||h,this._callback.oncomplete=s.oncomplete||h,this._callback.onprogress=s.onprogress||h}}return w(t,[{key:"create",value:function(i){if(i.endpoint=i.endpoint||this._config.endpoint,i.bucket=i.bucket||this._config.bucket,!(i.AccessKeyId&&i.AccessKeySecret&&i.endpoint&&i.SecurityToken))throw new Error("AccessKeyId\u3001AccessKeySecret\u3001endpoint should not be null");var s={accessKeyId:i.AccessKeyId,accessKeySecret:i.AccessKeySecret,stsToken:i.SecurityToken,endpoint:i.endpoint||this._config.endpoint,bucket:i.bucket||this._config.bucket,secure:!0,cname:i.cname};i.timeout&&(s.timeout=i.timeout),this.oss=new OSS.Wrapper(s)}},{key:"abort",value:function(i){if(i.checkpoint){var s=i.checkpoint.uploadId;this.oss.abortMultipartUpload(i.object,s)}}},{key:"getVersion",value:function(){}},{key:"cancel",value:function(){this.oss.cancel&&this.oss.cancel()}},{key:"upload",value:function(i,s){this._uploadInfo=i;var h=this,a=function(l,n,d){return function(c){h._progress(l,n,d),c()}},e={parallel:s.parallel||this._config.parallel||v.UPLOADDEFAULT.PARALLEL,partSize:s.partSize||this._config.partSize||v.UPLOADDEFAULT.PARTSIZE,progress:a};s.headers&&(e.headers=s.headers),i.checkpoint&&(e.checkpoint=i.checkpoint),i.bucket||(this.oss.options.bucket=i.bucket),i.endpoint||(this.oss.options.endpoint=i.endpoint),this.oss.multipartUpload(i.object,i.file,e).then(function(l,n){h._complete(l)}).catch(function(l){h.oss.cancel&&(h.oss&&h.oss.isCancel()?console.log("oss is cancel as error"):h.oss.cancel()),h._error(l)})}},{key:"header",value:function(i,s,h){this.oss.get(i.object).then(function(a){s(a)}).catch(function(a){h(a)})}},{key:"_progress",value:function(i,s,h){this._callback.onprogress(this._uploadInfo,{loaded:i,total:this._uploadInfo.file.size,checkpoint:s},h)}},{key:"_error",value:function(i){this._callback.onerror(this._uploadInfo,i)}},{key:"_complete",value:function(i){this._callback.oncomplete(this._uploadInfo,i)}}]),t}());_.default=o},function(U,_,L){"use strict";function E(v,u){if(!(v instanceof u))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(_,"__esModule",{value:!0});var A=function(){function v(u,f){for(var o=0;o<f.length;o++){var t=f[o];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(u,t.key,t)}}return function(u,f,o){return f&&v(u.prototype,f),o&&v(u,o),u}}(),w=function(){function v(){E(this,v)}return A(v,null,[{key:"format",value:function(u){if(arguments.length<2)return null;for(var f=arguments[1],o=1;o<arguments.length;o++){var t=new RegExp("\\{"+(o-1)+"\\}","gm");f=f.replace(t,arguments[o+1])}return{code:u,message:f}}},{key:"CODE",get:function(){return{SUCCESS:"Successful",EmptyValue:"InvalidParameter.EmptyValue",STSInvalid:"InvalidParameter.TokenInvalid",ReadFileError:"ReadFileError",FILEDUPLICATION:"FileDuplication",UploadALEADRYSTARTED:"UploadAlearyStarted"}}},{key:"MESSAGE",get:function(){return{SUCCESS:"Successful",EmptyValue:"\u53C2\u6570 {0} \u4E0D\u80FD\u4E3A\u7A7A\u3002",STSInvalid:"STS\u53C2\u6570\u975E\u6CD5\uFF0C accessKeyId\u3001accessKeySecret\u3001secretToken\u3001expireTime\u90FD\u4E0D\u80FD\u4E3A\u7A7A\u3002",ReadFileError:"\u8BFB\u53D6\u6587\u4EF6{0}{1}\u5931\u8D25.",FILEDUPLICATION:"\u6587\u4EF6\u91CD\u590D\u6DFB\u52A0 {0}",UploadALEADRYSTARTED:"\u91CD\u590D\u5F00\u59CB."}}}]),v}();_.default=w},function(U,_,L){"use strict";(function(E){function A(u,f){if(!(u instanceof f))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(_,"__esModule",{value:!0});var w=function(){function u(f,o){for(var t=0;t<o.length;t++){var i=o[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(f,i.key,i)}}return function(f,o,t){return o&&u(f.prototype,o),t&&u(f,t),f}}(),v=function(){function u(){A(this,u)}return w(u,null,[{key:"encode",value:function(f){return new E(f).toString("base64")}},{key:"decode",value:function(f){return new E(f,"base64").toString()}}]),u}();_.default=v}).call(_,L(19).Buffer)},function(U,_,L){"use strict";(function(E){function A(){return v.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function w(V,C){if(A()<C)throw new RangeError("Invalid typed array length");return v.TYPED_ARRAY_SUPPORT?(V=new Uint8Array(C),V.__proto__=v.prototype):(V===null&&(V=new v(C)),V.length=C),V}function v(V,C,O){if(!(v.TYPED_ARRAY_SUPPORT||this instanceof v))return new v(V,C,O);if(typeof V=="number"){if(typeof C=="string")throw new Error("If encoding is specified then the first argument must be a string");return t(this,V)}return u(this,V,C,O)}function u(V,C,O,j){if(typeof C=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer!="undefined"&&C instanceof ArrayBuffer?h(V,C,O,j):typeof C=="string"?i(V,C,O):a(V,C)}function f(V){if(typeof V!="number")throw new TypeError('"size" argument must be a number');if(V<0)throw new RangeError('"size" argument must not be negative')}function o(V,C,O,j){return f(C),C<=0?w(V,C):O!==void 0?typeof j=="string"?w(V,C).fill(O,j):w(V,C).fill(O):w(V,C)}function t(V,C){if(f(C),V=w(V,C<0?0:0|e(C)),!v.TYPED_ARRAY_SUPPORT)for(var O=0;O<C;++O)V[O]=0;return V}function i(V,C,O){if(typeof O=="string"&&O!==""||(O="utf8"),!v.isEncoding(O))throw new TypeError('"encoding" must be a valid string encoding');var j=0|n(C,O);V=w(V,j);var M=V.write(C,O);return M!==j&&(V=V.slice(0,M)),V}function s(V,C){var O=C.length<0?0:0|e(C.length);V=w(V,O);for(var j=0;j<O;j+=1)V[j]=255&C[j];return V}function h(V,C,O,j){if(C.byteLength,O<0||C.byteLength<O)throw new RangeError("'offset' is out of bounds");if(C.byteLength<O+(j||0))throw new RangeError("'length' is out of bounds");return C=O===void 0&&j===void 0?new Uint8Array(C):j===void 0?new Uint8Array(C,O):new Uint8Array(C,O,j),v.TYPED_ARRAY_SUPPORT?(V=C,V.__proto__=v.prototype):V=s(V,C),V}function a(V,C){if(v.isBuffer(C)){var O=0|e(C.length);return V=w(V,O),V.length===0||C.copy(V,0,0,O),V}if(C){if(typeof ArrayBuffer!="undefined"&&C.buffer instanceof ArrayBuffer||"length"in C)return typeof C.length!="number"||pe(C.length)?w(V,0):s(V,C);if(C.type==="Buffer"&&be(C.data))return s(V,C.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function e(V){if(V>=A())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+A().toString(16)+" bytes");return 0|V}function l(V){return+V!=V&&(V=0),v.alloc(+V)}function n(V,C){if(v.isBuffer(V))return V.length;if(typeof ArrayBuffer!="undefined"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(V)||V instanceof ArrayBuffer))return V.byteLength;typeof V!="string"&&(V=""+V);var O=V.length;if(O===0)return 0;for(var j=!1;;)switch(C){case"ascii":case"latin1":case"binary":return O;case"utf8":case"utf-8":case void 0:return se(V).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*O;case"hex":return O>>>1;case"base64":return re(V).length;default:if(j)return se(V).length;C=(""+C).toLowerCase(),j=!0}}function d(V,C,O){var j=!1;if((C===void 0||C<0)&&(C=0),C>this.length)return"";if((O===void 0||O>this.length)&&(O=this.length),O<=0)return"";if(O>>>=0,C>>>=0,O<=C)return"";for(V||(V="utf8");;)switch(V){case"hex":return G(this,C,O);case"utf8":case"utf-8":return R(this,C,O);case"ascii":return k(this,C,O);case"latin1":case"binary":return B(this,C,O);case"base64":return T(this,C,O);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,C,O);default:if(j)throw new TypeError("Unknown encoding: "+V);V=(V+"").toLowerCase(),j=!0}}function c(V,C,O){var j=V[C];V[C]=V[O],V[O]=j}function g(V,C,O,j,M){if(V.length===0)return-1;if(typeof O=="string"?(j=O,O=0):O>2147483647?O=2147483647:O<-2147483648&&(O=-2147483648),O=+O,isNaN(O)&&(O=M?0:V.length-1),O<0&&(O=V.length+O),O>=V.length){if(M)return-1;O=V.length-1}else if(O<0){if(!M)return-1;O=0}if(typeof C=="string"&&(C=v.from(C,j)),v.isBuffer(C))return C.length===0?-1:p(V,C,O,j,M);if(typeof C=="number")return C&=255,v.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?M?Uint8Array.prototype.indexOf.call(V,C,O):Uint8Array.prototype.lastIndexOf.call(V,C,O):p(V,[C],O,j,M);throw new TypeError("val must be string, number or Buffer")}function p(V,C,O,j,M){function F(ke,Re){return ae===1?ke[Re]:ke.readUInt16BE(Re*ae)}var ae=1,ve=V.length,Pe=C.length;if(j!==void 0&&((j=String(j).toLowerCase())==="ucs2"||j==="ucs-2"||j==="utf16le"||j==="utf-16le")){if(V.length<2||C.length<2)return-1;ae=2,ve/=2,Pe/=2,O/=2}var Oe;if(M){var De=-1;for(Oe=O;Oe<ve;Oe++)if(F(V,Oe)===F(C,De===-1?0:Oe-De)){if(De===-1&&(De=Oe),Oe-De+1===Pe)return De*ae}else De!==-1&&(Oe-=Oe-De),De=-1}else for(O+Pe>ve&&(O=ve-Pe),Oe=O;Oe>=0;Oe--){for(var Ne=!0,Ke=0;Ke<Pe;Ke++)if(F(V,Oe+Ke)!==F(C,Ke)){Ne=!1;break}if(Ne)return Oe}return-1}function m(V,C,O,j){O=Number(O)||0;var M=V.length-O;j?(j=Number(j))>M&&(j=M):j=M;var F=C.length;if(F%2!=0)throw new TypeError("Invalid hex string");j>F/2&&(j=F/2);for(var ae=0;ae<j;++ae){var ve=parseInt(C.substr(2*ae,2),16);if(isNaN(ve))return ae;V[O+ae]=ve}return ae}function b(V,C,O,j){return Q(se(C,V.length-O),V,O,j)}function y(V,C,O,j){return Q(ge(C),V,O,j)}function r(V,C,O,j){return y(V,C,O,j)}function x(V,C,O,j){return Q(re(C),V,O,j)}function S(V,C,O,j){return Q(ie(C,V.length-O),V,O,j)}function T(V,C,O){return C===0&&O===V.length?ne.fromByteArray(V):ne.fromByteArray(V.slice(C,O))}function R(V,C,O){O=Math.min(V.length,O);for(var j=[],M=C;M<O;){var F=V[M],ae=null,ve=F>239?4:F>223?3:F>191?2:1;if(M+ve<=O){var Pe,Oe,De,Ne;switch(ve){case 1:F<128&&(ae=F);break;case 2:Pe=V[M+1],(192&Pe)==128&&(Ne=(31&F)<<6|63&Pe)>127&&(ae=Ne);break;case 3:Pe=V[M+1],Oe=V[M+2],(192&Pe)==128&&(192&Oe)==128&&(Ne=(15&F)<<12|(63&Pe)<<6|63&Oe)>2047&&(Ne<55296||Ne>57343)&&(ae=Ne);break;case 4:Pe=V[M+1],Oe=V[M+2],De=V[M+3],(192&Pe)==128&&(192&Oe)==128&&(192&De)==128&&(Ne=(15&F)<<18|(63&Pe)<<12|(63&Oe)<<6|63&De)>65535&&Ne<1114112&&(ae=Ne)}}ae===null?(ae=65533,ve=1):ae>65535&&(ae-=65536,j.push(ae>>>10&1023|55296),ae=56320|1023&ae),j.push(ae),M+=ve}return D(j)}function D(V){var C=V.length;if(C<=Ee)return String.fromCharCode.apply(String,V);for(var O="",j=0;j<C;)O+=String.fromCharCode.apply(String,V.slice(j,j+=Ee));return O}function k(V,C,O){var j="";O=Math.min(V.length,O);for(var M=C;M<O;++M)j+=String.fromCharCode(127&V[M]);return j}function B(V,C,O){var j="";O=Math.min(V.length,O);for(var M=C;M<O;++M)j+=String.fromCharCode(V[M]);return j}function G(V,C,O){var j=V.length;(!C||C<0)&&(C=0),(!O||O<0||O>j)&&(O=j);for(var M="",F=C;F<O;++F)M+=he(V[F]);return M}function P(V,C,O){for(var j=V.slice(C,O),M="",F=0;F<j.length;F+=2)M+=String.fromCharCode(j[F]+256*j[F+1]);return M}function $(V,C,O){if(V%1!=0||V<0)throw new RangeError("offset is not uint");if(V+C>O)throw new RangeError("Trying to access beyond buffer length")}function X(V,C,O,j,M,F){if(!v.isBuffer(V))throw new TypeError('"buffer" argument must be a Buffer instance');if(C>M||C<F)throw new RangeError('"value" argument is out of bounds');if(O+j>V.length)throw new RangeError("Index out of range")}function z(V,C,O,j){C<0&&(C=65535+C+1);for(var M=0,F=Math.min(V.length-O,2);M<F;++M)V[O+M]=(C&255<<8*(j?M:1-M))>>>8*(j?M:1-M)}function N(V,C,O,j){C<0&&(C=4294967295+C+1);for(var M=0,F=Math.min(V.length-O,4);M<F;++M)V[O+M]=C>>>8*(j?M:3-M)&255}function H(V,C,O,j,M,F){if(O+j>V.length)throw new RangeError("Index out of range");if(O<0)throw new RangeError("Index out of range")}function q(V,C,O,j,M){return M||H(V,C,O,4,34028234663852886e22,-34028234663852886e22),J.write(V,C,O,j,23,4),O+4}function ee(V,C,O,j,M){return M||H(V,C,O,8,17976931348623157e292,-17976931348623157e292),J.write(V,C,O,j,52,8),O+8}function fe(V){if(V=oe(V).replace(Le,""),V.length<2)return"";for(;V.length%4!=0;)V+="=";return V}function oe(V){return V.trim?V.trim():V.replace(/^\s+|\s+$/g,"")}function he(V){return V<16?"0"+V.toString(16):V.toString(16)}function se(V,C){C=C||1/0;for(var O,j=V.length,M=null,F=[],ae=0;ae<j;++ae){if((O=V.charCodeAt(ae))>55295&&O<57344){if(!M){if(O>56319){(C-=3)>-1&&F.push(239,191,189);continue}if(ae+1===j){(C-=3)>-1&&F.push(239,191,189);continue}M=O;continue}if(O<56320){(C-=3)>-1&&F.push(239,191,189),M=O;continue}O=65536+(M-55296<<10|O-56320)}else M&&(C-=3)>-1&&F.push(239,191,189);if(M=null,O<128){if((C-=1)<0)break;F.push(O)}else if(O<2048){if((C-=2)<0)break;F.push(O>>6|192,63&O|128)}else if(O<65536){if((C-=3)<0)break;F.push(O>>12|224,O>>6&63|128,63&O|128)}else{if(!(O<1114112))throw new Error("Invalid code point");if((C-=4)<0)break;F.push(O>>18|240,O>>12&63|128,O>>6&63|128,63&O|128)}}return F}function ge(V){for(var C=[],O=0;O<V.length;++O)C.push(255&V.charCodeAt(O));return C}function ie(V,C){for(var O,j,M,F=[],ae=0;ae<V.length&&!((C-=2)<0);++ae)O=V.charCodeAt(ae),j=O>>8,M=O%256,F.push(M),F.push(j);return F}function re(V){return ne.toByteArray(fe(V))}function Q(V,C,O,j){for(var M=0;M<j&&!(M+O>=C.length||M>=V.length);++M)C[M+O]=V[M];return M}function pe(V){return V!==V}/*!
|
|
|
* The buffer module from node.js, for the browser.
|
|
|
*
|
|
|
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
|
* @license MIT
|
|
|
*/var ne=L(21),J=L(22),be=L(23);_.Buffer=v,_.SlowBuffer=l,_.INSPECT_MAX_BYTES=50,v.TYPED_ARRAY_SUPPORT=E.TYPED_ARRAY_SUPPORT!==void 0?E.TYPED_ARRAY_SUPPORT:function(){try{var V=new Uint8Array(1);return V.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},V.foo()===42&&typeof V.subarray=="function"&&V.subarray(1,1).byteLength===0}catch(C){return!1}}(),_.kMaxLength=A(),v.poolSize=8192,v._augment=function(V){return V.__proto__=v.prototype,V},v.from=function(V,C,O){return u(null,V,C,O)},v.TYPED_ARRAY_SUPPORT&&(v.prototype.__proto__=Uint8Array.prototype,v.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&v[Symbol.species]===v&&Object.defineProperty(v,Symbol.species,{value:null,configurable:!0})),v.alloc=function(V,C,O){return o(null,V,C,O)},v.allocUnsafe=function(V){return t(null,V)},v.allocUnsafeSlow=function(V){return t(null,V)},v.isBuffer=function(V){return!(V==null||!V._isBuffer)},v.compare=function(V,C){if(!v.isBuffer(V)||!v.isBuffer(C))throw new TypeError("Arguments must be Buffers");if(V===C)return 0;for(var O=V.length,j=C.length,M=0,F=Math.min(O,j);M<F;++M)if(V[M]!==C[M]){O=V[M],j=C[M];break}return O<j?-1:j<O?1:0},v.isEncoding=function(V){switch(String(V).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},v.concat=function(V,C){if(!be(V))throw new TypeError('"list" argument must be an Array of Buffers');if(V.length===0)return v.alloc(0);var O;if(C===void 0)for(C=0,O=0;O<V.length;++O)C+=V[O].length;var j=v.allocUnsafe(C),M=0;for(O=0;O<V.length;++O){var F=V[O];if(!v.isBuffer(F))throw new TypeError('"list" argument must be an Array of Buffers');F.copy(j,M),M+=F.length}return j},v.byteLength=n,v.prototype._isBuffer=!0,v.prototype.swap16=function(){var V=this.length;if(V%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var C=0;C<V;C+=2)c(this,C,C+1);return this},v.prototype.swap32=function(){var V=this.length;if(V%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var C=0;C<V;C+=4)c(this,C,C+3),c(this,C+1,C+2);return this},v.prototype.swap64=function(){var V=this.length;if(V%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var C=0;C<V;C+=8)c(this,C,C+7),c(this,C+1,C+6),c(this,C+2,C+5),c(this,C+3,C+4);return this},v.prototype.toString=function(){var V=0|this.length;return V===0?"":arguments.length===0?R(this,0,V):d.apply(this,arguments)},v.prototype.equals=function(V){if(!v.isBuffer(V))throw new TypeError("Argument must be a Buffer");return this===V||v.compare(this,V)===0},v.prototype.inspect=function(){var V="",C=_.INSPECT_MAX_BYTES;return this.length>0&&(V=this.toString("hex",0,C).match(/.{2}/g).join(" "),this.length>C&&(V+=" ... ")),"<Buffer "+V+">"},v.prototype.compare=function(V,C,O,j,M){if(!v.isBuffer(V))throw new TypeError("Argument must be a Buffer");if(C===void 0&&(C=0),O===void 0&&(O=V?V.length:0),j===void 0&&(j=0),M===void 0&&(M=this.length),C<0||O>V.length||j<0||M>this.length)throw new RangeError("out of range index");if(j>=M&&C>=O)return 0;if(j>=M)return-1;if(C>=O)return 1;if(C>>>=0,O>>>=0,j>>>=0,M>>>=0,this===V)return 0;for(var F=M-j,ae=O-C,ve=Math.min(F,ae),Pe=this.slice(j,M),Oe=V.slice(C,O),De=0;De<ve;++De)if(Pe[De]!==Oe[De]){F=Pe[De],ae=Oe[De];break}return F<ae?-1:ae<F?1:0},v.prototype.includes=function(V,C,O){return this.indexOf(V,C,O)!==-1},v.prototype.indexOf=function(V,C,O){return g(this,V,C,O,!0)},v.prototype.lastIndexOf=function(V,C,O){return g(this,V,C,O,!1)},v.prototype.write=function(V,C,O,j){if(C===void 0)j="utf8",O=this.length,C=0;else if(O===void 0&&typeof C=="string")j=C,O=this.length,C=0;else{if(!isFinite(C))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");C|=0,isFinite(O)?(O|=0,j===void 0&&(j="utf8")):(j=O,O=void 0)}var M=this.length-C;if((O===void 0||O>M)&&(O=M),V.length>0&&(O<0||C<0)||C>this.length)throw new RangeError("Attempt to write outside buffer bounds");j||(j="utf8");for(var F=!1;;)switch(j){case"hex":return m(this,V,C,O);case"utf8":case"utf-8":return b(this,V,C,O);case"ascii":return y(this,V,C,O);case"latin1":case"binary":return r(this,V,C,O);case"base64":return x(this,V,C,O);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,V,C,O);default:if(F)throw new TypeError("Unknown encoding: "+j);j=(""+j).toLowerCase(),F=!0}},v.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Ee=4096;v.prototype.slice=function(V,C){var O=this.length;V=~~V,C=C===void 0?O:~~C,V<0?(V+=O)<0&&(V=0):V>O&&(V=O),C<0?(C+=O)<0&&(C=0):C>O&&(C=O),C<V&&(C=V);var j;if(v.TYPED_ARRAY_SUPPORT)j=this.subarray(V,C),j.__proto__=v.prototype;else{var M=C-V;j=new v(M,void 0);for(var F=0;F<M;++F)j[F]=this[F+V]}return j},v.prototype.readUIntLE=function(V,C,O){V|=0,C|=0,O||$(V,C,this.length);for(var j=this[V],M=1,F=0;++F<C&&(M*=256);)j+=this[V+F]*M;return j},v.prototype.readUIntBE=function(V,C,O){V|=0,C|=0,O||$(V,C,this.length);for(var j=this[V+--C],M=1;C>0&&(M*=256);)j+=this[V+--C]*M;return j},v.prototype.readUInt8=function(V,C){return C||$(V,1,this.length),this[V]},v.prototype.readUInt16LE=function(V,C){return C||$(V,2,this.length),this[V]|this[V+1]<<8},v.prototype.readUInt16BE=function(V,C){return C||$(V,2,this.length),this[V]<<8|this[V+1]},v.prototype.readUInt32LE=function(V,C){return C||$(V,4,this.length),(this[V]|this[V+1]<<8|this[V+2]<<16)+16777216*this[V+3]},v.prototype.readUInt32BE=function(V,C){return C||$(V,4,this.length),16777216*this[V]+(this[V+1]<<16|this[V+2]<<8|this[V+3])},v.prototype.readIntLE=function(V,C,O){V|=0,C|=0,O||$(V,C,this.length);for(var j=this[V],M=1,F=0;++F<C&&(M*=256);)j+=this[V+F]*M;return M*=128,j>=M&&(j-=Math.pow(2,8*C)),j},v.prototype.readIntBE=function(V,C,O){V|=0,C|=0,O||$(V,C,this.length);for(var j=C,M=1,F=this[V+--j];j>0&&(M*=256);)F+=this[V+--j]*M;return M*=128,F>=M&&(F-=Math.pow(2,8*C)),F},v.prototype.readInt8=function(V,C){return C||$(V,1,this.length),128&this[V]?-1*(255-this[V]+1):this[V]},v.prototype.readInt16LE=function(V,C){C||$(V,2,this.length);var O=this[V]|this[V+1]<<8;return 32768&O?4294901760|O:O},v.prototype.readInt16BE=function(V,C){C||$(V,2,this.length);var O=this[V+1]|this[V]<<8;return 32768&O?4294901760|O:O},v.prototype.readInt32LE=function(V,C){return C||$(V,4,this.length),this[V]|this[V+1]<<8|this[V+2]<<16|this[V+3]<<24},v.prototype.readInt32BE=function(V,C){return C||$(V,4,this.length),this[V]<<24|this[V+1]<<16|this[V+2]<<8|this[V+3]},v.prototype.readFloatLE=function(V,C){return C||$(V,4,this.length),J.read(this,V,!0,23,4)},v.prototype.readFloatBE=function(V,C){return C||$(V,4,this.length),J.read(this,V,!1,23,4)},v.prototype.readDoubleLE=function(V,C){return C||$(V,8,this.length),J.read(this,V,!0,52,8)},v.prototype.readDoubleBE=function(V,C){return C||$(V,8,this.length),J.read(this,V,!1,52,8)},v.prototype.writeUIntLE=function(V,C,O,j){(V=+V,C|=0,O|=0,!j)&&X(this,V,C,O,Math.pow(2,8*O)-1,0);var M=1,F=0;for(this[C]=255&V;++F<O&&(M*=256);)this[C+F]=V/M&255;return C+O},v.prototype.writeUIntBE=function(V,C,O,j){(V=+V,C|=0,O|=0,!j)&&X(this,V,C,O,Math.pow(2,8*O)-1,0);var M=O-1,F=1;for(this[C+M]=255&V;--M>=0&&(F*=256);)this[C+M]=V/F&255;return C+O},v.prototype.writeUInt8=function(V,C,O){return V=+V,C|=0,O||X(this,V,C,1,255,0),v.TYPED_ARRAY_SUPPORT||(V=Math.floor(V)),this[C]=255&V,C+1},v.prototype.writeUInt16LE=function(V,C,O){return V=+V,C|=0,O||X(this,V,C,2,65535,0),v.TYPED_ARRAY_SUPPORT?(this[C]=255&V,this[C+1]=V>>>8):z(this,V,C,!0),C+2},v.prototype.writeUInt16BE=function(V,C,O){return V=+V,C|=0,O||X(this,V,C,2,65535,0),v.TYPED_ARRAY_SUPPORT?(this[C]=V>>>8,this[C+1]=255&V):z(this,V,C,!1),C+2},v.prototype.writeUInt32LE=function(V,C,O){return V=+V,C|=0,O||X(this,V,C,4,4294967295,0),v.TYPED_ARRAY_SUPPORT?(this[C+3]=V>>>24,this[C+2]=V>>>16,this[C+1]=V>>>8,this[C]=255&V):N(this,V,C,!0),C+4},v.prototype.writeUInt32BE=function(V,C,O){return V=+V,C|=0,O||X(this,V,C,4,4294967295,0),v.TYPED_ARRAY_SUPPORT?(this[C]=V>>>24,this[C+1]=V>>>16,this[C+2]=V>>>8,this[C+3]=255&V):N(this,V,C,!1),C+4},v.prototype.writeIntLE=function(V,C,O,j){if(V=+V,C|=0,!j){var M=Math.pow(2,8*O-1);X(this,V,C,O,M-1,-M)}var F=0,ae=1,ve=0;for(this[C]=255&V;++F<O&&(ae*=256);)V<0&&ve===0&&this[C+F-1]!==0&&(ve=1),this[C+F]=(V/ae>>0)-ve&255;return C+O},v.prototype.writeIntBE=function(V,C,O,j){if(V=+V,C|=0,!j){var M=Math.pow(2,8*O-1);X(this,V,C,O,M-1,-M)}var F=O-1,ae=1,ve=0;for(this[C+F]=255&V;--F>=0&&(ae*=256);)V<0&&ve===0&&this[C+F+1]!==0&&(ve=1),this[C+F]=(V/ae>>0)-ve&255;return C+O},v.prototype.writeInt8=function(V,C,O){return V=+V,C|=0,O||X(this,V,C,1,127,-128),v.TYPED_ARRAY_SUPPORT||(V=Math.floor(V)),V<0&&(V=255+V+1),this[C]=255&V,C+1},v.prototype.writeInt16LE=function(V,C,O){return V=+V,C|=0,O||X(this,V,C,2,32767,-32768),v.TYPED_ARRAY_SUPPORT?(this[C]=255&V,this[C+1]=V>>>8):z(this,V,C,!0),C+2},v.prototype.writeInt16BE=function(V,C,O){return V=+V,C|=0,O||X(this,V,C,2,32767,-32768),v.TYPED_ARRAY_SUPPORT?(this[C]=V>>>8,this[C+1]=255&V):z(this,V,C,!1),C+2},v.prototype.writeInt32LE=function(V,C,O){return V=+V,C|=0,O||X(this,V,C,4,2147483647,-2147483648),v.TYPED_ARRAY_SUPPORT?(this[C]=255&V,this[C+1]=V>>>8,this[C+2]=V>>>16,this[C+3]=V>>>24):N(this,V,C,!0),C+4},v.prototype.writeInt32BE=function(V,C,O){return V=+V,C|=0,O||X(this,V,C,4,2147483647,-2147483648),V<0&&(V=4294967295+V+1),v.TYPED_ARRAY_SUPPORT?(this[C]=V>>>24,this[C+1]=V>>>16,this[C+2]=V>>>8,this[C+3]=255&V):N(this,V,C,!1),C+4},v.prototype.writeFloatLE=function(V,C,O){return q(this,V,C,!0,O)},v.prototype.writeFloatBE=function(V,C,O){return q(this,V,C,!1,O)},v.prototype.writeDoubleLE=function(V,C,O){return ee(this,V,C,!0,O)},v.prototype.writeDoubleBE=function(V,C,O){return ee(this,V,C,!1,O)},v.prototype.copy=function(V,C,O,j){if(O||(O=0),j||j===0||(j=this.length),C>=V.length&&(C=V.length),C||(C=0),j>0&&j<O&&(j=O),j===O)return 0;if(V.length===0||this.length===0)return 0;if(C<0)throw new RangeError("targetStart out of bounds");if(O<0||O>=this.length)throw new RangeError("sourceStart out of bounds");if(j<0)throw new RangeError("sourceEnd out of bounds");j>this.length&&(j=this.length),V.length-C<j-O&&(j=V.length-C+O);var M,F=j-O;if(this===V&&O<C&&C<j)for(M=F-1;M>=0;--M)V[M+C]=this[M+O];else if(F<1e3||!v.TYPED_ARRAY_SUPPORT)for(M=0;M<F;++M)V[M+C]=this[M+O];else Uint8Array.prototype.set.call(V,this.subarray(O,O+F),C);return F},v.prototype.fill=function(V,C,O,j){if(typeof V=="string"){if(typeof C=="string"?(j=C,C=0,O=this.length):typeof O=="string"&&(j=O,O=this.length),V.length===1){var M=V.charCodeAt(0);M<256&&(V=M)}if(j!==void 0&&typeof j!="string")throw new TypeError("encoding must be a string");if(typeof j=="string"&&!v.isEncoding(j))throw new TypeError("Unknown encoding: "+j)}else typeof V=="number"&&(V&=255);if(C<0||this.length<C||this.length<O)throw new RangeError("Out of range index");if(O<=C)return this;C>>>=0,O=O===void 0?this.length:O>>>0,V||(V=0);var F;if(typeof V=="number")for(F=C;F<O;++F)this[F]=V;else{var ae=v.isBuffer(V)?V:se(new v(V,j).toString()),ve=ae.length;for(F=0;F<O-C;++F)this[F+C]=ae[F%ve]}return this};var Le=/[^+\/0-9A-Za-z-_]/g}).call(_,L(20))},function(U,_){var L;L=function(){return this}();try{L=L||Function("return this")()||(0,eval)("this")}catch(E){typeof window=="object"&&(L=window)}U.exports=L},function(U,_,L){"use strict";function E(e){var l=e.length;if(l%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return e[l-2]==="="?2:e[l-1]==="="?1:0}function A(e){return 3*e.length/4-E(e)}function w(e){var l,n,d,c,g,p=e.length;c=E(e),g=new i(3*p/4-c),n=c>0?p-4:p;var m=0;for(l=0;l<n;l+=4)d=t[e.charCodeAt(l)]<<18|t[e.charCodeAt(l+1)]<<12|t[e.charCodeAt(l+2)]<<6|t[e.charCodeAt(l+3)],g[m++]=d>>16&255,g[m++]=d>>8&255,g[m++]=255&d;return c===2?(d=t[e.charCodeAt(l)]<<2|t[e.charCodeAt(l+1)]>>4,g[m++]=255&d):c===1&&(d=t[e.charCodeAt(l)]<<10|t[e.charCodeAt(l+1)]<<4|t[e.charCodeAt(l+2)]>>2,g[m++]=d>>8&255,g[m++]=255&d),g}function v(e){return o[e>>18&63]+o[e>>12&63]+o[e>>6&63]+o[63&e]}function u(e,l,n){for(var d,c=[],g=l;g<n;g+=3)d=(e[g]<<16)+(e[g+1]<<8)+e[g+2],c.push(v(d));return c.join("")}function f(e){for(var l,n=e.length,d=n%3,c="",g=[],p=0,m=n-d;p<m;p+=16383)g.push(u(e,p,p+16383>m?m:p+16383));return d===1?(l=e[n-1],c+=o[l>>2],c+=o[l<<4&63],c+="=="):d===2&&(l=(e[n-2]<<8)+e[n-1],c+=o[l>>10],c+=o[l>>4&63],c+=o[l<<2&63],c+="="),g.push(c),g.join("")}_.byteLength=A,_.toByteArray=w,_.fromByteArray=f;for(var o=[],t=[],i=typeof Uint8Array!="undefined"?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h=0,a=s.length;h<a;++h)o[h]=s[h],t[s.charCodeAt(h)]=h;t["-".charCodeAt(0)]=62,t["_".charCodeAt(0)]=63},function(U,_){_.read=function(L,E,A,w,v){var u,f,o=8*v-w-1,t=(1<<o)-1,i=t>>1,s=-7,h=A?v-1:0,a=A?-1:1,e=L[E+h];for(h+=a,u=e&(1<<-s)-1,e>>=-s,s+=o;s>0;u=256*u+L[E+h],h+=a,s-=8);for(f=u&(1<<-s)-1,u>>=-s,s+=w;s>0;f=256*f+L[E+h],h+=a,s-=8);if(u===0)u=1-i;else{if(u===t)return f?NaN:1/0*(e?-1:1);f+=Math.pow(2,w),u-=i}return(e?-1:1)*f*Math.pow(2,u-w)},_.write=function(L,E,A,w,v,u){var f,o,t,i=8*u-v-1,s=(1<<i)-1,h=s>>1,a=v===23?Math.pow(2,-24)-Math.pow(2,-77):0,e=w?0:u-1,l=w?1:-1,n=E<0||E===0&&1/E<0?1:0;for(E=Math.abs(E),isNaN(E)||E===1/0?(o=isNaN(E)?1:0,f=s):(f=Math.floor(Math.log(E)/Math.LN2),E*(t=Math.pow(2,-f))<1&&(f--,t*=2),E+=f+h>=1?a/t:a*Math.pow(2,1-h),E*t>=2&&(f++,t/=2),f+h>=s?(o=0,f=s):f+h>=1?(o=(E*t-1)*Math.pow(2,v),f+=h):(o=E*Math.pow(2,h-1)*Math.pow(2,v),f=0));v>=8;L[A+e]=255&o,e+=l,o/=256,v-=8);for(f=f<<v|o,i+=v;i>0;L[A+e]=255&f,e+=l,f/=256,i-=8);L[A+e-l]|=128*n}},function(U,_){var L={}.toString;U.exports=Array.isArray||function(E){return L.call(E)=="[object Array]"}},function(U,_,L){"use strict";function E(v,u){if(!(v instanceof u))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(_,"__esModule",{value:!0});var A=function(){function v(u,f){for(var o=0;o<f.length;o++){var t=f[o];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(u,t.key,t)}}return function(u,f,o){return f&&v(u.prototype,f),o&&v(u,o),u}}(),w=function(){function v(){E(this,v)}return A(v,null,[{key:"set",value:function(u,f){try{window.localStorage&&localStorage.setItem(u,f)}catch(o){window[u+"_localStorage"]=f}}},{key:"get",value:function(u){try{if(window.localStorage)return localStorage.getItem(u)}catch(f){return window[u+"_localStorage"]}return""}},{key:"remove",value:function(u){try{window.localStorage&&localStorage.removeItem(u)}catch(f){delete window[u+"_localStorage"]}}}]),v}();_.default=w},function(U,_,L){"use strict";function E(v,u){if(!(v instanceof u))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(_,"__esModule",{value:!0});var A=function(){function v(u,f){for(var o=0;o<f.length;o++){var t=f[o];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(u,t.key,t)}}return function(u,f,o){return f&&v(u.prototype,f),o&&v(u,o),u}}(),w=function(){function v(){E(this,v)}return A(v,null,[{key:"get",value:function(u){for(var f=u+"",o=document.cookie.split(";"),t=0;t<o.length;t++){var i=o[t].trim();if(i.indexOf(f)==0)return unescape(i.substring(f.length+1,i.length))}return""}},{key:"set",value:function(u,f,o){var t=new Date;t.setTime(t.getTime()+24*o*60*60*1e3);var i="expires="+t.toGMTString();document.cookie=u+"="+escape(f)+"; "+i}}]),v}();_.default=w},function(U,_,L){"use strict";function E(i){return i&&i.__esModule?i:{default:i}}function A(i,s){if(!(i instanceof s))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(_,"__esModule",{value:!0});var w=function(){function i(s,h){for(var a=0;a<h.length;a++){var e=h[a];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(s,e.key,e)}}return function(s,h,a){return h&&i(s.prototype,h),a&&i(s,a),s}}(),v=L(8),u=E(v),f=L(9),o=E(f),t=function(){function i(){A(this,i)}return w(i,null,[{key:"refreshUploadAuth",value:function(s,h,a){var e=(o.default.randomUUID(),o.default.randomUUID()),l={AccessKeyId:s.accessKeyId,SecurityToken:s.securityToken,Action:"RefreshUploadVideo",VideoId:s.videoId,Version:"2017-03-21",Format:"JSON",SignatureMethod:"HMAC-SHA1",SignatureVersion:"1.0",SignatureNonce:e,RequestId:s.requestId},n=o.default.makeUTF8sort(l,"=","&")+"&Signature="+o.default.aliyunEncodeURI(o.default.makeChangeSiga(l,s.accessKeySecret)),d="https://vod."+s.region+".aliyuncs.com/?"+n;u.default.get(d,function(c){var c=JSON.parse(c);h&&h(c)},function(c){if(a){var g=JSON.parse(c);a(g)}})}},{key:"getUploadAuth",value:function(s,h,a){var e=(o.default.randomUUID(),o.default.randomUUID()),l={AccessKeyId:s.accessKeyId,SecurityToken:s.securityToken,Action:"CreateUploadVideo",Title:s.title,FileName:s.fileName,Version:"2017-03-21",Format:"JSON",SignatureMethod:"HMAC-SHA1",SignatureVersion:"1.0",SignatureNonce:e,RequestId:s.requestId};s.fileSize&&(l.FileSize=s.fileSize),s.description&&(l.Description=s.description),s.cateId&&(l.CateId=s.cateId),s.tags&&(l.Tags=s.tags),s.templateGroupId&&(l.TemplateGroupId=s.templateGroupId),s.storageLocation&&(l.StorageLocation=s.storageLocation),s.coverUrl&&(l.CoverURL=s.coverUrl),s.transCodeMode&&(l.TransCodeMode=s.transCodeMode),s.userData&&(l.UserData=JSON.stringify(s.userData));var n=o.default.makeUTF8sort(l,"=","&")+"&Signature="+o.default.aliyunEncodeURI(o.default.makeChangeSiga(l,s.accessKeySecret)),d="https://vod."+s.region+".aliyuncs.com/?"+n;u.default.get(d,function(c){try{c=JSON.parse(c)}catch(g){if(a)return void a({Code:"GetUploadAuthFailed",Message:"\u83B7\u53D6uploadauth\u5931\u8D25"})}h&&h(c)},function(c){if(a){var g={Code:"GetUploadAuthFailed",Message:"\u83B7\u53D6uploadauth\u5931\u8D25"};try{g=JSON.parse(c)}catch(p){}a(g)}})}},{key:"getImageUploadAuth",value:function(s,h,a){var e=(o.default.randomUUID(),o.default.randomUUID()),l={AccessKeyId:s.accessKeyId,SecurityToken:s.securityToken,Action:"CreateUploadImage",ImageType:s.imageType?s.imageType:"default",Version:"2017-03-21",Format:"JSON",SignatureMethod:"HMAC-SHA1",SignatureVersion:"1.0",SignatureNonce:e,RequestId:s.requestId};s.title&&(l.Title=s.title),s.imageExt&&(l.ImageExt=s.imageExt),s.tags&&(l.Tags=s.tags),s.storageLocation&&(l.StorageLocation=s.storageLocation);var n=o.default.makeUTF8sort(l,"=","&")+"&Signature="+o.default.aliyunEncodeURI(o.default.makeChangeSiga(l,s.accessKeySecret)),d="https://vod."+s.region+".aliyuncs.com/?"+n;u.default.get(d,function(c){c=JSON.parse(c),h&&h(c)},function(c){if(a){var g=JSON.parse(c);a(g)}})}}]),i}();_.default=t},function(U,_,L){!function(E,A,w){U.exports=_=A(L(0),L(28),L(29))}(0,function(E){return E.HmacSHA1})},function(U,_,L){!function(E,A){U.exports=_=A(L(0))}(0,function(E){return function(){var A=E,w=A.lib,v=w.WordArray,u=w.Hasher,f=A.algo,o=[],t=f.SHA1=u.extend({_doReset:function(){this._hash=new v.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(i,s){for(var h=this._hash.words,a=h[0],e=h[1],l=h[2],n=h[3],d=h[4],c=0;c<80;c++){if(c<16)o[c]=0|i[s+c];else{var g=o[c-3]^o[c-8]^o[c-14]^o[c-16];o[c]=g<<1|g>>>31}var p=(a<<5|a>>>27)+d+o[c];p+=c<20?1518500249+(e&l|~e&n):c<40?1859775393+(e^l^n):c<60?(e&l|e&n|l&n)-1894007588:(e^l^n)-899497514,d=n,n=l,l=e<<30|e>>>2,e=a,a=p}h[0]=h[0]+a|0,h[1]=h[1]+e|0,h[2]=h[2]+l|0,h[3]=h[3]+n|0,h[4]=h[4]+d|0},_doFinalize:function(){var i=this._data,s=i.words,h=8*this._nDataBytes,a=8*i.sigBytes;return s[a>>>5]|=128<<24-a%32,s[14+(a+64>>>9<<4)]=Math.floor(h/4294967296),s[15+(a+64>>>9<<4)]=h,i.sigBytes=4*s.length,this._process(),this._hash},clone:function(){var i=u.clone.call(this);return i._hash=this._hash.clone(),i}});A.SHA1=u._createHelper(t),A.HmacSHA1=u._createHmacHelper(t)}(),E.SHA1})},function(U,_,L){!function(E,A){U.exports=_=A(L(0))}(0,function(E){!function(){var A=E,w=A.lib,v=w.Base,u=A.enc,f=u.Utf8,o=A.algo;o.HMAC=v.extend({init:function(t,i){t=this._hasher=new t.init,typeof i=="string"&&(i=f.parse(i));var s=t.blockSize,h=4*s;i.sigBytes>h&&(i=t.finalize(i)),i.clamp();for(var a=this._oKey=i.clone(),e=this._iKey=i.clone(),l=a.words,n=e.words,d=0;d<s;d++)l[d]^=1549556828,n[d]^=909522486;a.sigBytes=e.sigBytes=h,this.reset()},reset:function(){var t=this._hasher;t.reset(),t.update(this._iKey)},update:function(t){return this._hasher.update(t),this},finalize:function(t){var i=this._hasher,s=i.finalize(t);return i.reset(),i.finalize(this._oKey.clone().concat(s))}})}()})},function(U,_,L){!function(E,A){U.exports=_=A(L(0))}(0,function(E){return function(){function A(o,t,i){for(var s=[],h=0,a=0;a<t;a++)if(a%4){var e=i[o.charCodeAt(a-1)]<<a%4*2,l=i[o.charCodeAt(a)]>>>6-a%4*2;s[h>>>2]|=(e|l)<<24-h%4*8,h++}return u.create(s,h)}var w=E,v=w.lib,u=v.WordArray,f=w.enc;f.Base64={stringify:function(o){var t=o.words,i=o.sigBytes,s=this._map;o.clamp();for(var h=[],a=0;a<i;a+=3)for(var e=t[a>>>2]>>>24-a%4*8&255,l=t[a+1>>>2]>>>24-(a+1)%4*8&255,n=t[a+2>>>2]>>>24-(a+2)%4*8&255,d=e<<16|l<<8|n,c=0;c<4&&a+.75*c<i;c++)h.push(s.charAt(d>>>6*(3-c)&63));var g=s.charAt(64);if(g)for(;h.length%4;)h.push(g);return h.join("")},parse:function(o){var t=o.length,i=this._map,s=this._reverseMap;if(!s){s=this._reverseMap=[];for(var h=0;h<i.length;h++)s[i.charCodeAt(h)]=h}var a=i.charAt(64);if(a){var e=o.indexOf(a);e!==-1&&(t=e)}return A(o,t,s)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),E.enc.Base64})},function(U,_,L){"use strict";function E(m){return m&&m.__esModule?m:{default:m}}function A(m,b){if(!(m instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(_,"__esModule",{value:!0});var w=function(){function m(b,y){for(var r=0;r<y.length;r++){var x=y[r];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(b,x.key,x)}}return function(b,y,r){return y&&m(b.prototype,y),r&&m(b,r),b}}(),v=L(8),u=E(v),f=L(7),o=E(f),t=L(4),i=E(t),s=L(6),h=E(s),a=L(1),e=E(a),l=L(9),n=E(l),d=L(2),c=L(11),g=L(10),p=function(){function m(){A(this,m)}return w(m,null,[{key:"getAuthInfo",value:function(b,y,r){var x=b+"|f#Ylm&^1TppeRhLg|"+r;return y&&(x=b+"|"+y+"|f#Ylm&^1TppeRhLg|"+r),d(g.parse(x)).toString(c)}},{key:"upload",value:function(b,y,r){var x=e.default.ISODateString(new Date),S=Math.floor(new Date().valueOf()/1e3),T=i.default.getClientId();T=i.default.setClientId(T);var R=m.getAuthInfo(b.userId,T,S),D=n.default.randomUUID(),k={Source:"WebSDK",BusinessType:"UploadVideo",Action:"ReportUploadProgress",TerminalType:"H5",DeviceModel:o.default.browser.name+(o.default.browser.version||""),AppVersion:h.default.version,AuthTimestamp:S,Timestamp:x,AuthInfo:R,FileName:b.file.name,FileSize:b.file.size,FileCreateTime:b.file.lastModified,FileHash:b.fileHash,UploadId:b.checkpoint.checkpoint.uploadId,PartSize:b.checkpoint.checkpoint.partSize,DonePartsCount:b.checkpoint.checkpoint.doneParts.length,UploadPoint:JSON.stringify(b.checkpoint),UploadRatio:b.checkpoint.loaded,UserId:b.userId,VideoId:b.videoId,Version:"2017-03-21",Format:"JSON",SignatureMethod:"HMAC-SHA1",SignatureVersion:"1.0",SignatureNonce:D};T&&(k.ClientId=T);var B=n.default.makeUTF8sort(k,"=","&")+"&Signature="+n.default.aliyunEncodeURI(n.default.makeChangeSiga(k,b.accessKeySecret)),G="https://vod."+b.region+".aliyuncs.com/?"+B;u.default.get(G,function(P){y&&y()},function(P){P&&(r(P),console.log(P))})}},{key:"get",value:function(b,y,r){var x=e.default.ISODateString(new Date),S=Math.floor(new Date().valueOf()/1e3),T=i.default.getClientId(),R=m.getAuthInfo(b.userId,T,S),D=n.default.randomUUID(),k={Source:"WebSDK",BusinessType:"UploadVideo",Action:"GetUploadProgress",TerminalType:"H5",DeviceModel:o.default.browser.name+(o.default.browser.version||""),AppVersion:h.default.version,AuthTimestamp:S,Timestamp:x,AuthInfo:R,UserId:b.userId,UploadInfoList:JSON.stringify(b.uploadInfoList),Version:"2017-03-21",Format:"JSON",SignatureMethod:"HMAC-SHA1",SignatureVersion:"1.0",SignatureNonce:D};T&&(k.ClientId=T);var B=n.default.makeUTF8sort(k,"=","&")+"&Signature="+n.default.aliyunEncodeURI(n.default.makeChangeSiga(k,b.accessKeySecret)),G="https://vod."+b.region+".aliyuncs.com/?"+B;u.default.get(G,function(P){var $={},X=T;P=P?JSON.parse(P):{},P.UploadProgress&&P.UploadProgress.UploadProgressList&&P.UploadProgress.UploadProgressList.length>0&&($=P.UploadProgress.UploadProgressList[0],X=$.ClientId),i.default.setClientId(X),y&&y($)},function(P){P&&(r(P),console.log(P))})}}]),m}();_.default=p},function(U,_,L){"use strict";function E(f,o){if(!(f instanceof o))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(_,"__esModule",{value:!0});var A=function(){function f(o,t){for(var i=0;i<t.length;i++){var s=t[i];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(o,s.key,s)}}return function(o,t,i){return t&&f(o.prototype,t),i&&f(o,i),o}}(),w=L(2),v=L(33),u=(L(11),function(){function f(){E(this,f)}return A(f,null,[{key:"getMd5",value:function(o,t,i){var s=new FileReader;s.onload=function(e){try{if(e&&e.target){var l=w(v.parse(e.target.result)),n=l.toString();t(n)}}catch(d){console.log(d)}},s.onerror=function(e){console.log(e),errorCallback(e)};var h=File.prototype.slice||File.prototype.mozSlice||File.prototype.webkitSlice,a=h.call(o,0,1024);s.readAsBinaryString(a)}}]),f}());_.default=u},function(U,_,L){!function(E,A){U.exports=_=A(L(0))}(0,function(E){return E.enc.Latin1})}])}).call(this,ye("IyRk"))},rHrb:function(Ze,Qe,ye){"use strict";Object.defineProperty(Qe,"__esModule",{value:!0}),Qe.CopyToClipboard=void 0;var Se=U(ye("cDcd")),Z=U(ye("+QRC"));function U(l){return l&&l.__esModule?l:{default:l}}function _(l){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_=function(d){return typeof d}:_=function(d){return d&&typeof Symbol=="function"&&d.constructor===Symbol&&d!==Symbol.prototype?"symbol":typeof d},_(l)}function L(l,n){var d=Object.keys(l);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(l);n&&(c=c.filter(function(g){return Object.getOwnPropertyDescriptor(l,g).enumerable})),d.push.apply(d,c)}return d}function E(l){for(var n=1;n<arguments.length;n++){var d=arguments[n]!=null?arguments[n]:{};n%2?L(d,!0).forEach(function(c){a(l,c,d[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(l,Object.getOwnPropertyDescriptors(d)):L(d).forEach(function(c){Object.defineProperty(l,c,Object.getOwnPropertyDescriptor(d,c))})}return l}function A(l,n){if(l==null)return{};var d=w(l,n),c,g;if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(l);for(g=0;g<p.length;g++){if(c=p[g],n.indexOf(c)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(l,c))continue;d[c]=l[c]}}return d}function w(l,n){if(l==null)return{};var d={},c=Object.keys(l),g,p;for(p=0;p<c.length;p++){if(g=c[p],n.indexOf(g)>=0)continue;d[g]=l[g]}return d}function v(l,n){if(!(l instanceof n))throw new TypeError("Cannot call a class as a function")}function u(l,n){for(var d=0;d<n.length;d++){var c=n[d];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(l,c.key,c)}}function f(l,n,d){return n&&u(l.prototype,n),d&&u(l,d),l}function o(l,n){return n&&(_(n)==="object"||typeof n=="function")?n:i(l)}function t(l){return t=Object.setPrototypeOf?Object.getPrototypeOf:function(d){return d.__proto__||Object.getPrototypeOf(d)},t(l)}function i(l){if(l===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return l}function s(l,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function");l.prototype=Object.create(n&&n.prototype,{constructor:{value:l,writable:!0,configurable:!0}}),n&&h(l,n)}function h(l,n){return h=Object.setPrototypeOf||function(c,g){return c.__proto__=g,c},h(l,n)}function a(l,n,d){return n in l?Object.defineProperty(l,n,{value:d,enumerable:!0,configurable:!0,writable:!0}):l[n]=d,l}var e=function(l){s(n,l);function n(){var d,c;v(this,n);for(var g=arguments.length,p=new Array(g),m=0;m<g;m++)p[m]=arguments[m];return c=o(this,(d=t(n)).call.apply(d,[this].concat(p))),a(i(c),"onClick",function(b){var y=c.props,r=y.text,x=y.onCopy,S=y.children,T=y.options,R=Se.default.Children.only(S),D=(0,Z.default)(r,T);x&&x(r,D),R&&R.props&&typeof R.props.onClick=="function"&&R.props.onClick(b)}),c}return f(n,[{key:"render",value:function(){var c=this.props,g=c.text,p=c.onCopy,m=c.options,b=c.children,y=A(c,["text","onCopy","options","children"]),r=Se.default.Children.only(b);return Se.default.cloneElement(r,E({},y,{onClick:this.onClick}))}}]),n}(Se.default.PureComponent);Qe.CopyToClipboard=e,a(e,"defaultProps",{onCopy:void 0,options:void 0})},rUJ1:function(Ze,Qe){const ye=/[&<>"']/,Se=/[&<>"']/g,Z=/[<>"']|&(?!#?\w+;)/,U=/[<>"']|&(?!#?\w+;)/g,_={"&":"&","<":"<",">":">",'"':""","'":"'"},L=m=>_[m];function E(m,b){if(b){if(ye.test(m))return m.replace(Se,L)}else if(Z.test(m))return m.replace(U,L);return m}const A=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function w(m){return m.replace(A,(b,y)=>(y=y.toLowerCase(),y==="colon"?":":y.charAt(0)==="#"?y.charAt(1)==="x"?String.fromCharCode(parseInt(y.substring(2),16)):String.fromCharCode(+y.substring(1)):""))}const v=/(^|[^\[])\^/g;function u(m,b){m=m.source||m,b=b||"";const y={replace:(r,x)=>(x=x.source||x,x=x.replace(v,"$1"),m=m.replace(r,x),y),getRegex:()=>new RegExp(m,b)};return y}const f=/[^\w:]/g,o=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function t(m,b,y){if(m){let r;try{r=decodeURIComponent(w(y)).replace(f,"").toLowerCase()}catch(x){return null}if(r.indexOf("javascript:")===0||r.indexOf("vbscript:")===0||r.indexOf("data:")===0)return null}b&&!o.test(y)&&(y=e(b,y));try{y=encodeURI(y).replace(/%25/g,"%")}catch(r){return null}return y}const i={},s=/^[^:]+:\/*[^/]*$/,h=/^([^:]+:)[\s\S]*$/,a=/^([^:]+:\/*[^/]*)[\s\S]*$/;function e(m,b){i[" "+m]||(s.test(m)?i[" "+m]=m+"/":i[" "+m]=c(m,"/",!0)),m=i[" "+m];const y=m.indexOf(":")===-1;return b.substring(0,2)==="//"?y?b:m.replace(h,"$1")+b:b.charAt(0)==="/"?y?b:m.replace(a,"$1")+b:m+b}const l={exec:function(){}};function n(m){let b=1,y,r;for(;b<arguments.length;b++){y=arguments[b];for(r in y)Object.prototype.hasOwnProperty.call(y,r)&&(m[r]=y[r])}return m}function d(m,b){const y=m.replace(/\|/g,(S,T,R)=>{let D=!1,k=T;for(;--k>=0&&R[k]==="\\";)D=!D;return D?"|":" |"}),r=y.split(/ \|/);let x=0;if(r.length>b)r.splice(b);else for(;r.length<b;)r.push("");for(;x<r.length;x++)r[x]=r[x].trim().replace(/\\\|/g,"|");return r}function c(m,b,y){const r=m.length;if(r===0)return"";let x=0;for(;x<r;){const S=m.charAt(r-x-1);if(S===b&&!y)x++;else if(S!==b&&y)x++;else break}return m.substr(0,r-x)}function g(m,b){if(m.indexOf(b[1])===-1)return-1;const y=m.length;let r=0,x=0;for(;x<y;x++)if(m[x]==="\\")x++;else if(m[x]===b[0])r++;else if(m[x]===b[1]&&(r--,r<0))return x;return-1}function p(m){m&&m.sanitize&&!m.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}Ze.exports={escape:E,unescape:w,edit:u,cleanUrl:t,resolveUrl:e,noopTest:l,merge:n,splitCells:d,rtrim:c,findClosingBracket:g,checkSanitizeDeprecation:p}},sBCT:function(Ze,Qe,ye){"use strict";var Se=ye("+BJd"),Z=ye("mr32"),U=ye("+L6B"),_=ye("2/Rp"),L=ye("MXD1"),E=ye("CFYs"),A=ye("9og8"),w=ye("2qtc"),v=ye("kLXV"),u=ye("miYZ"),f=ye("tsqr"),o=ye("y8nQ"),t=ye("Vl3Y"),i=ye("tJVT"),s=ye("k1fw"),h=ye("oBTY"),a=ye("5NDa"),e=ye("5rEg"),l=ye("WmNS"),n=ye.n(l),d=ye("cDcd"),c=ye.n(d),g=ye("Ty5D"),p=ye("55Ip"),m=ye("9kvl"),b=ye("kwm0"),y=ye.n(b),r=ye("Aky1"),x=ye("h/US"),S=e.a.TextArea,T=1024,R=function(B,G){var P,$=G.payload||{},X=$.uploadInfo,z=X===void 0?{}:X;switch(G.type){case"addVideo":return{videoList:[].concat(Object(h.a)(B.videoList),[{name:z.file.name,size:z.file.size,type:z.file.type,fileHash:z.fileHash,state:z.state,videoId:z.videoId,loaded:z.loaded||0,title:""}])};case"removeVideo":return{videoList:B.videoList.filter(function(N){return N.name!==G.payload.name})};case"removeAll":return{videoList:[]};case"updateProgress":return{videoList:B.videoList.map(function(N){return N.name===G.payload.uploadInfo.file.name?Object(s.a)(Object(s.a)({},N),{loaded:G.payload.progressPercent,videoId:z.videoId,fileHash:z.fileHash}):N})};case"updateTitle":return{videoList:(P=B.videoList)===null||P===void 0?void 0:P.map(function(N){return N.name===G.payload.item.name?Object(s.a)(Object(s.a)({},N),{title:G.payload.title}):N})};default:return{videoList:[]}}},D=function(B){var G,P=B.user,$=B.globalSetting,X=B.loading,z=B.dispatch,N=B.visible,H=B.editData,q=B.onCancel,ee=q===void 0?function(){}:q,fe=B.onOk,oe=fe===void 0?function(){}:fe,he=B.queryParams,se=he===void 0?{}:he,ge=Object(g.i)(),ie=t.a.useForm(),re=Object(i.a)(ie,1),Q=re[0],pe=Object(d.useReducer)(R,{videoList:[]}),ne=Object(i.a)(pe,2),J=ne[0],be=ne[1],Ee=Object(d.useState)(!1),Le=Object(i.a)(Ee,2),V=Le[0],C=Le[1],O=Object(d.useRef)(),j=Object(d.useState)(),M=Object(i.a)(j,2),F=M[0],ae=M[1],ve=Object(d.useState)(!1),Pe=Object(i.a)(ve,2),Oe=Pe[0],De=Pe[1],Ne=Object(d.useState)(!1),Ke=Object(i.a)(Ne,2),ke=Ke[0],Re=Ke[1],Te=Object(d.useState)([]),we=Object(i.a)(Te,2),xe=we[0],ue=we[1],de=Object(d.useState)([]),_e=Object(i.a)(de,2),me=_e[0],Ie=_e[1];Object(d.useEffect)(function(){var vt,ut;if(!N)return;if(!H)return;De(H.is_link),ae(H.link),!H.is_link&&be({type:"addVideo",payload:{uploadInfo:{file:{name:H.file_name||H.name},videoId:H.video_id,loaded:100}}}),yt((H==null||((vt=H.tags)===null||vt===void 0)?void 0:vt.map(function(dt){return dt==null?void 0:dt.name}))||[]),Q.setFieldsValue({name:H.name,description:H.description,attachment_id:H==null||((ut=H.video)===null||ut===void 0)?void 0:ut.attachment_id})},[H,N]);var Me=function(){var ut=document.getElementById("fileUpload");ut.value=""},Ve=function(ut){var dt;De(!1);var gt=ut.target.files[0];if(!gt){Me();return}var st=gt.name.toLowerCase();if(st&&st.indexOf(".avi")==-1&&st.indexOf(".flv")==-1&&st.indexOf(".f4v")==-1&&st.indexOf(".m4v")==-1&&st.indexOf(".mov")==-1&&st.indexOf(".mp4")==-1&&st.indexOf(".rmvb")==-1&&st.indexOf(".swf")==-1&&st.indexOf(".webm")==-1&&st.indexOf(".wmv")==-1){f.b.info("\u4E0D\u652F\u6301\u7684\u89C6\u9891\u683C\u5F0F"),Me();return}if(gt.size>T*1024*1024){f.b.info("\u89C6\u9891\u5927\u5C0F\u8D85\u8FC71G"),Me();return}if((dt=J.videoList)!==null&&dt!==void 0&&dt.find(function(ht){return ht.name===gt.name})){f.b.info("\u4F60\u4E0D\u80FD\u4E0A\u4F20\u540C\u4E00\u4E2A\u89C6\u9891\u6587\u4EF6\u540D\u79F0\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9\u3002"),Me();return}tt(gt)},ot=function(ut,dt){v.a.confirm({title:"\u63D0\u793A",centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:c.a.createElement("div",{className:"tc"},"\u60A8\u786E\u8BA4\u8981",dt?"\u5220\u9664":"\u53D6\u6D88\u4E0A\u4F20","\u8BE5\u89C6\u9891\u5417\uFF1F"),onOk:function(){Me(),be({type:"removeVideo",payload:{name:ut}})}})},tt=function(ut){var dt,gt='{"Vod":{}}';if(C(!0),O.current){O.current.addFile(ut,null,null,null,gt);return}Object(r.a)((dt=P.userInfo)===null||dt===void 0?void 0:dt.login,"",{create:!O,addFileSuccess:function(ht){be({type:"addVideo",payload:{uploadInfo:ht}})},onUploadProgress:function(ht,ce,te){var I=Math.ceil(te*100);be({type:"updateProgress",payload:{uploadInfo:ht,progressPercent:I}}),Me()},onUploadFailed:function(ht){f.b.info("\u89C6\u9891\u4E91\u670D\u52A1\u51FA\u73B0\u5F02\u5E38\uFF0C\u8BF7\u91CD\u65B0\u4E0A\u4F20\u3002")},onUploadEnd:function(ht){C(!1)},onUploadSucceed:function(ht){C(!1)},onUploadError:function(ht){C(!1)},gotUploader:function(ht){ht.addFile(ut,null,null,null,gt),O.current=ht}})},Ge=function(){var vt=Object(A.a)(n.a.mark(function ut(){var dt,gt,st,ht;return n.a.wrap(function(te){for(;;)switch(te.prev=te.next){case 0:return te.next=2,Q.validateFields();case 2:if(!(!Oe&&!((dt=J.videoList)!==null&&dt!==void 0&&dt.length)||Oe&&!F)){te.next=5;break}return f.b.info("\u8BF7\u5148\u4E0A\u4F20\u89C6\u9891\u6216\u8005\u6DFB\u52A0\u5916\u94FE"),te.abrupt("return");case 5:Re(!0),st=Oe?{link:F}:{video_id:(gt=J.videoList)===null||gt===void 0?void 0:gt[0].videoId};debugger;return te.next=10,oe(Object(s.a)(Object(s.a)(Object(s.a)({},st),se),{name:Q.getFieldValue("name"),attachment_id:Q.getFieldValue("attachment_id"),description:Q.getFieldValue("description"),tags:ft}));case 10:ht=te.sent,Re(!1),ht.id&&Je();case 13:case"end":return te.stop()}},ut)}));return function(){return vt.apply(this,arguments)}}(),Je=function(){Q.resetFields(),be({type:"removeAll"}),ae(null),De(null)},$e=function(){ee(),Je()},et=function(){var ut,dt,gt,st,ht,ce,te,I,W,K,Y,le;return c.a.createElement(c.a.Fragment,null,!Oe&&!!((ut=J.videoList)!==null&&ut!==void 0&&ut.length)&&c.a.createElement("div",{className:y.a.fileProgress},((dt=J.videoList)===null||dt===void 0||((gt=dt[0])===null||gt===void 0)?void 0:gt.loaded)==100?c.a.createElement("div",{className:"".concat(y.a.videoName," font14")},(st=J.videoList)===null||st===void 0||((ht=st[0])===null||ht===void 0)?void 0:ht.name):c.a.createElement(E.a,{style:{width:"80%"},percent:(ce=J.videoList)===null||ce===void 0||((te=ce[0])===null||te===void 0)?void 0:te.loaded,status:((I=J.videoList)===null||I===void 0||((W=I[0])===null||W===void 0)?void 0:W.loaded)==100?"normal":"active"}),c.a.createElement("div",{className:y.a.fileCancel,onClick:function(){var Ce,Fe,We,Be;return ot((Ce=J.videoList)===null||Ce===void 0||((Fe=Ce[0])===null||Fe===void 0)?void 0:Fe.name,((We=J.videoList)===null||We===void 0||((Be=We[0])===null||Be===void 0)?void 0:Be.loaded)==100)}},((K=J.videoList)===null||K===void 0||((Y=K[0])===null||Y===void 0)?void 0:Y.loaded)===100?"\u5220\u9664":"\u53D6\u6D88\u4E0A\u4F20")),!((le=J.videoList)!==null&&le!==void 0&&le.length)&&c.a.createElement("div",{className:y.a.uploadWrap},c.a.createElement("label",{htmlFor:"fileUpload",style:{marginRight:"30px"}},c.a.createElement(Upload,uploadProps,c.a.createElement(_.a,{className:y.a.upload,disabled:(me==null?void 0:me.length)>0},c.a.createElement("i",{className:"iconfont icon-shangchuanshipin1 mr5"}),"\u4E0A\u4F20\u89C6\u9891"))),c.a.createElement("label",{className:"".concat(y.a.upload," ").concat(y.a.uploadLink),onClick:function(){return De(!0)}},c.a.createElement("i",{className:"iconfont icon-lianjie1 mr5"}),"\u6DFB\u52A0\u5916\u94FE")),Oe&&c.a.createElement(e.a,{className:"mt5",placeholder:"\u8BF7\u8F93\u5165\u89C6\u9891\u94FE\u63A5",value:F,onChange:function(Ce){return ae(Ce.target.value)}}))},nt=Object(d.useState)([]),at=Object(i.a)(nt,2),ft=at[0],yt=at[1],mt=function(ut){if(ut.key=="Enter"){var dt=Q.getFieldValue("tag");if(Q.setFieldsValue({tag:""}),!dt){f.b.info("\u6807\u7B7E\u4E0D\u80FD\u4E3A\u7A7A");return}if(ft.filter(function(gt){return gt===dt}).length>0){f.b.info("\u5DF2\u6709\u76F8\u540C\u540D\u79F0\u6807\u7B7E");return}ft.push(dt),yt(Object(h.a)(ft))}},pt=function(ut,dt){ut.preventDefault(),yt(Object(h.a)(ft.filter(function(gt){return gt!=dt})))};return c.a.createElement(v.a,{centered:!0,maskClosable:!1,title:H?"\u7F16\u8F91\u89C6\u9891\u9879\u76EE":"\u65B0\u5EFA\u89C6\u9891\u9879\u76EE",width:740,className:y.a.modal,visible:N,confirmLoading:ke,onOk:Ge,onCancel:$e},c.a.createElement(t.a,{form:Q},c.a.createElement("input",{type:"file",id:"fileUpload",style:{display:"none"},onChange:Ve,accept:".mkv, .flv, .f4v, .rmvb, .swf, video/mp4,video/x-m4v,video/flv,video/f4v,video/rmvb,video/swf,video/*"}),c.a.createElement(t.a.Item,{label:"\u9879\u76EE\u540D\u79F0",name:"name",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u9879\u76EE\u540D\u79F0"}]},c.a.createElement(e.a,{maxLength:40,placeholder:"\u8BF7\u8F93\u5165\u4E0D\u8D85\u8FC740\u5B57\u7684\u9879\u76EE\u540D\u79F0"})),c.a.createElement(t.a.Item,{label:"\u9879\u76EE\u5185\u5BB9",name:"content",className:y.a.contentItem},et()),c.a.createElement(t.a.Item,{name:"attachment_id",label:"\u4E0A\u4F20\u5C01\u9762\u56FE:"},c.a.createElement(x.a,{getFileProgress:function(ut){if(ut.file.status==="uploading"){Re(!0);return}ut.file.status==="done"&&Re(!1)}})),c.a.createElement(t.a.Item,{label:"\u9879\u76EE\u7B80\u4ECB",name:"description",className:"ml8"},c.a.createElement(S,{rows:5,maxLength:800,placeholder:"\u8BF7\u8F93\u5165\u672C\u89C6\u9891\u7B80\u4ECB\uFF0C\u6700\u591A\u4E0D\u8D85\u8FC7800\u5B57"})),c.a.createElement(t.a.Item,{label:"\u77E5\u8BC6\u6807\u7B7E",name:"tag",className:"ml8"},c.a.createElement(e.a,{onKeyUp:mt})),c.a.createElement("div",{className:y.a["tagsList-content"]},ft.map(function(vt,ut){return c.a.createElement(Z.a,{key:ut+vt,closable:!0,onClose:function(gt){pt(gt,vt)}},vt)})),c.a.createElement("div",{className:"c-grey-999"},c.a.createElement("div",null,"\u6CE8\u610F\uFF1A"),c.a.createElement("div",null,"1\u3001\u4E0A\u4F20\u89C6\u9891\uFF0C\u5373\u8868\u793A\u60A8\u5DF2\u540C\u610F",c.a.createElement(p.a,{to:"/users/".concat((G=P.userInfo)===null||G===void 0?void 0:G.login,"/videos/protocol"),target:"_blank",className:y.a.colorBlue},"\u4E0A\u4F20\u5185\u5BB9\u534F\u8BAE"),"\uFF0C\u4E0D\u5F97\u4E0A\u4F20\u672A\u7ECF\u4ED6\u4EBA\u6388\u6743\u7684\u4F5C\u54C1\uFF1B"),c.a.createElement("div",null,"2\u3001\u4E0D\u652F\u6301\u65AD\u70B9\u7EED\u4F20\uFF0C\u6587\u4EF6\u5927\u5C0F\u8BF7\u52FF\u8D85\u8FC71G\uFF1B"),c.a.createElement("div",null,"3\u3001\u652F\u6301\u6587\u4EF6\u683C\u5F0F\uFF1Aavi\u3001flv\u3001f4v\u3001m4v\u3001mov\u3001mp4\u3001rmvb\u3001swf\u3001webm\u3001wmv\uFF1B"),c.a.createElement("div",null,"4\u3001\u5982\u679C\u89C6\u9891\u6765\u81EA\u4E8E\u5916\u90E8\u94FE\u63A5\uFF0C\u672C\u7F51\u7AD9\u4E0D\u63D0\u4F9B\u64AD\u653E\u9875\u9762\uFF0C\u65E0\u6CD5\u63D0\u4F9B\u7EDF\u8BA1\u6570\u636E\u3002"))))};Qe.a=Object(m.a)(function(k){var B=k.user,G=k.loading,P=k.globalSetting;return{user:B,globalSetting:P,loading:G}})(D)},sWEp:function(Ze,Qe,ye){Ze.exports={wrap:"wrap___3nJXB",title:"title___3AYM5",radioWrap:"radioWrap___dbSML",radio:"radio___3h-_z",colorFF0000:"colorFF0000___2d_ZE",pagination:"pagination___3WP6s"}},ulZh:function(Ze,Qe,ye){typeof window!="undefined"&&function(Z,U){Ze.exports=U()}(this,function(){return function(Se){var Z={};function U(_){if(Z[_])return Z[_].exports;var L=Z[_]={i:_,l:!1,exports:{}};return Se[_].call(L.exports,L,L.exports,U),L.l=!0,L.exports}return U.m=Se,U.c=Z,U.d=function(_,L,E){U.o(_,L)||Object.defineProperty(_,L,{enumerable:!0,get:E})},U.r=function(_){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(_,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(_,"__esModule",{value:!0})},U.t=function(_,L){if(L&1&&(_=U(_)),L&8)return _;if(L&4&&typeof _=="object"&&_&&_.__esModule)return _;var E=Object.create(null);if(U.r(E),Object.defineProperty(E,"default",{enumerable:!0,value:_}),L&2&&typeof _!="string")for(var A in _)U.d(E,A,function(w){return _[w]}.bind(null,A));return E},U.n=function(_){var L=_&&_.__esModule?function(){return _.default}:function(){return _};return U.d(L,"a",L),L},U.o=function(_,L){return Object.prototype.hasOwnProperty.call(_,L)},U.p="/dist/",U(U.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(Se,Z,U){"use strict";var _=Object.prototype.hasOwnProperty,L="~";function E(){}Object.create&&(E.prototype=Object.create(null),new E().__proto__||(L=!1));function A(f,o,t){this.fn=f,this.context=o,this.once=t||!1}function w(f,o,t,i,s){if(typeof t!="function")throw new TypeError("The listener must be a function");var h=new A(t,i||f,s),a=L?L+o:o;return f._events[a]?f._events[a].fn?f._events[a]=[f._events[a],h]:f._events[a].push(h):(f._events[a]=h,f._eventsCount++),f}function v(f,o){--f._eventsCount===0?f._events=new E:delete f._events[o]}function u(){this._events=new E,this._eventsCount=0}u.prototype.eventNames=function(){var o=[],t,i;if(this._eventsCount===0)return o;for(i in t=this._events)_.call(t,i)&&o.push(L?i.slice(1):i);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(t)):o},u.prototype.listeners=function(o){var t=L?L+o:o,i=this._events[t];if(!i)return[];if(i.fn)return[i.fn];for(var s=0,h=i.length,a=new Array(h);s<h;s++)a[s]=i[s].fn;return a},u.prototype.listenerCount=function(o){var t=L?L+o:o,i=this._events[t];return i?i.fn?1:i.length:0},u.prototype.emit=function(o,t,i,s,h,a){var e=L?L+o:o;if(!this._events[e])return!1;var l=this._events[e],n=arguments.length,d,c;if(l.fn){l.once&&this.removeListener(o,l.fn,void 0,!0);switch(n){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,t),!0;case 3:return l.fn.call(l.context,t,i),!0;case 4:return l.fn.call(l.context,t,i,s),!0;case 5:return l.fn.call(l.context,t,i,s,h),!0;case 6:return l.fn.call(l.context,t,i,s,h,a),!0}for(c=1,d=new Array(n-1);c<n;c++)d[c-1]=arguments[c];l.fn.apply(l.context,d)}else{var g=l.length,p;for(c=0;c<g;c++){l[c].once&&this.removeListener(o,l[c].fn,void 0,!0);switch(n){case 1:l[c].fn.call(l[c].context);break;case 2:l[c].fn.call(l[c].context,t);break;case 3:l[c].fn.call(l[c].context,t,i);break;case 4:l[c].fn.call(l[c].context,t,i,s);break;default:if(!d)for(p=1,d=new Array(n-1);p<n;p++)d[p-1]=arguments[p];l[c].fn.apply(l[c].context,d)}}}return!0},u.prototype.on=function(o,t,i){return w(this,o,t,i,!1)},u.prototype.once=function(o,t,i){return w(this,o,t,i,!0)},u.prototype.removeListener=function(o,t,i,s){var h=L?L+o:o;if(!this._events[h])return this;if(!t)return v(this,h),this;var a=this._events[h];if(a.fn)a.fn===t&&(!s||a.once)&&(!i||a.context===i)&&v(this,h);else{for(var e=0,l=[],n=a.length;e<n;e++)(a[e].fn!==t||s&&!a[e].once||i&&a[e].context!==i)&&l.push(a[e]);l.length?this._events[h]=l.length===1?l[0]:l:v(this,h)}return this},u.prototype.removeAllListeners=function(o){var t;return o?(t=L?L+o:o,this._events[t]&&v(this,t)):(this._events=new E,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prefixed=L,u.EventEmitter=u,Se.exports=u},"./node_modules/url-toolkit/src/url-toolkit.js":function(Se,Z,U){(function(_){var L=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,E=/^([^\/?#]*)([^]*)$/,A=/(?:\/|^)\.(?=\/)/g,w=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,v={buildAbsoluteURL:function(u,f,o){if(o=o||{},u=u.trim(),f=f.trim(),!f){if(!o.alwaysNormalize)return u;var t=v.parseURL(u);if(!t)throw new Error("Error trying to parse base URL.");return t.path=v.normalizePath(t.path),v.buildURLFromParts(t)}var i=v.parseURL(f);if(!i)throw new Error("Error trying to parse relative URL.");if(i.scheme)return o.alwaysNormalize?(i.path=v.normalizePath(i.path),v.buildURLFromParts(i)):f;var s=v.parseURL(u);if(!s)throw new Error("Error trying to parse base URL.");if(!s.netLoc&&s.path&&s.path[0]!=="/"){var h=E.exec(s.path);s.netLoc=h[1],s.path=h[2]}s.netLoc&&!s.path&&(s.path="/");var a={scheme:s.scheme,netLoc:i.netLoc,path:null,params:i.params,query:i.query,fragment:i.fragment};if(!i.netLoc&&(a.netLoc=s.netLoc,i.path[0]!=="/"))if(!i.path)a.path=s.path,i.params||(a.params=s.params,i.query||(a.query=s.query));else{var e=s.path,l=e.substring(0,e.lastIndexOf("/")+1)+i.path;a.path=v.normalizePath(l)}return a.path===null&&(a.path=o.alwaysNormalize?v.normalizePath(i.path):i.path),v.buildURLFromParts(a)},parseURL:function(u){var f=L.exec(u);return f?{scheme:f[1]||"",netLoc:f[2]||"",path:f[3]||"",params:f[4]||"",query:f[5]||"",fragment:f[6]||""}:null},normalizePath:function(u){for(u=u.split("").reverse().join("").replace(A,"");u.length!==(u=u.replace(w,"")).length;);return u.split("").reverse().join("")},buildURLFromParts:function(u){return u.scheme+u.netLoc+u.path+u.params+u.query+u.fragment}};Se.exports=v})(this)},"./node_modules/webworkify-webpack/index.js":function(Se,Z,U){function _(o){var t={};function i(h){if(t[h])return t[h].exports;var a=t[h]={i:h,l:!1,exports:{}};return o[h].call(a.exports,a,a.exports,i),a.l=!0,a.exports}i.m=o,i.c=t,i.i=function(h){return h},i.d=function(h,a,e){i.o(h,a)||Object.defineProperty(h,a,{configurable:!1,enumerable:!0,get:e})},i.r=function(h){Object.defineProperty(h,"__esModule",{value:!0})},i.n=function(h){var a=h&&h.__esModule?function(){return h.default}:function(){return h};return i.d(a,"a",a),a},i.o=function(h,a){return Object.prototype.hasOwnProperty.call(h,a)},i.p="/",i.oe=function(h){throw console.error(h),h};var s=i(i.s=ENTRY_MODULE);return s.default||s}var L="[\\.|\\-|\\+|\\w|/|@]+",E="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+L+").*?\\)";function A(o){return(o+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function w(o){return!isNaN(1*o)}function v(o,t,i){var s={};s[i]=[];var h=t.toString(),a=h.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!a)return s;for(var e=a[1],l=new RegExp("(\\\\n|\\W)"+A(e)+E,"g"),n;n=l.exec(h);){if(n[3]==="dll-reference")continue;s[i].push(n[3])}for(l=new RegExp("\\("+A(e)+'\\("(dll-reference\\s('+L+'))"\\)\\)'+E,"g");n=l.exec(h);)o[n[2]]||(s[i].push(n[1]),o[n[2]]=U(n[1]).m),s[n[2]]=s[n[2]]||[],s[n[2]].push(n[4]);for(var d=Object.keys(s),c=0;c<d.length;c++)for(var g=0;g<s[d[c]].length;g++)w(s[d[c]][g])&&(s[d[c]][g]=1*s[d[c]][g]);return s}function u(o){var t=Object.keys(o);return t.reduce(function(i,s){return i||o[s].length>0},!1)}function f(o,t){for(var i={main:[t]},s={main:[]},h={main:{}};u(i);)for(var a=Object.keys(i),e=0;e<a.length;e++){var l=a[e],n=i[l],d=n.pop();if(h[l]=h[l]||{},h[l][d]||!o[l][d])continue;h[l][d]=!0,s[l]=s[l]||[],s[l].push(d);for(var c=v(o,o[l][d],l),g=Object.keys(c),p=0;p<g.length;p++)i[g[p]]=i[g[p]]||[],i[g[p]]=i[g[p]].concat(c[g[p]])}return s}Se.exports=function(o,t){t=t||{};var i={main:U.m},s=t.all?{main:Object.keys(i.main)}:f(i,o),h="";Object.keys(s).filter(function(d){return d!=="main"}).forEach(function(d){for(var c=0;s[d][c];)c++;s[d].push(c),i[d][c]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",h=h+"var "+d+" = ("+_.toString().replace("ENTRY_MODULE",JSON.stringify(c))+")({"+s[d].map(function(g){return""+JSON.stringify(g)+": "+i[d][g].toString()}).join(",")+`});
|
|
|
`}),h=h+"new (("+_.toString().replace("ENTRY_MODULE",JSON.stringify(o))+")({"+s.main.map(function(d){return""+JSON.stringify(d)+": "+i.main[d].toString()}).join(",")+"}))(self);";var a=new window.Blob([h],{type:"text/javascript"});if(t.bare)return a;var e=window.URL||window.webkitURL||window.mozURL||window.msURL,l=e.createObjectURL(a),n=new window.Worker(l);return n.objectURL=l,n}},"./src/config.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"hlsDefaultConfig",function(){return p}),U.d(Z,"mergeConfig",function(){return b}),U.d(Z,"enableStreamingMode",function(){return y});var _=U("./src/controller/abr-controller.ts"),L=U("./src/controller/audio-stream-controller.ts"),E=U("./src/controller/audio-track-controller.ts"),A=U("./src/controller/subtitle-stream-controller.ts"),w=U("./src/controller/subtitle-track-controller.ts"),v=U("./src/controller/buffer-controller.ts"),u=U("./src/controller/timeline-controller.ts"),f=U("./src/controller/cap-level-controller.ts"),o=U("./src/controller/fps-controller.ts"),t=U("./src/controller/eme-controller.ts"),i=U("./src/controller/cmcd-controller.ts"),s=U("./src/utils/xhr-loader.ts"),h=U("./src/utils/fetch-loader.ts"),a=U("./src/utils/cues.ts"),e=U("./src/utils/mediakeys-helper.ts"),l=U("./src/utils/logger.ts");function n(){return n=Object.assign||function(r){for(var x=1;x<arguments.length;x++){var S=arguments[x];for(var T in S)Object.prototype.hasOwnProperty.call(S,T)&&(r[T]=S[T])}return r},n.apply(this,arguments)}function d(r,x){var S=Object.keys(r);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(r);x&&(T=T.filter(function(R){return Object.getOwnPropertyDescriptor(r,R).enumerable})),S.push.apply(S,T)}return S}function c(r){for(var x=1;x<arguments.length;x++){var S=arguments[x]!=null?arguments[x]:{};x%2?d(Object(S),!0).forEach(function(T){g(r,T,S[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(S)):d(Object(S)).forEach(function(T){Object.defineProperty(r,T,Object.getOwnPropertyDescriptor(S,T))})}return r}function g(r,x,S){return x in r?Object.defineProperty(r,x,{value:S,enumerable:!0,configurable:!0,writable:!0}):r[x]=S,r}var p=c(c({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:Infinity,maxBufferSize:60*1e3*1e3,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:Infinity,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,enableSoftwareAES:!0,manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,startLevel:void 0,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:s.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:_.default,bufferController:v.default,capLevelController:f.default,fpsController:o.default,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystemOptions:{},requestMediaKeySystemAccessFunc:e.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},m()),{},{subtitleStreamController:A.SubtitleStreamController,subtitleTrackController:w.default,timelineController:u.TimelineController,audioStreamController:L.default,audioTrackController:E.default,emeController:t.default,cmcdController:i.default});function m(){return{cueHandler:a.default,enableCEA708Captions:!0,enableWebVTT:!0,enableIMSC1:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function b(r,x){if((x.liveSyncDurationCount||x.liveMaxLatencyDurationCount)&&(x.liveSyncDuration||x.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(x.liveMaxLatencyDurationCount!==void 0&&(x.liveSyncDurationCount===void 0||x.liveMaxLatencyDurationCount<=x.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(x.liveMaxLatencyDuration!==void 0&&(x.liveSyncDuration===void 0||x.liveMaxLatencyDuration<=x.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return n({},r,x)}function y(r){var x=r.loader;if(x!==h.default&&x!==s.default)l.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),r.progressive=!1;else{var S=Object(h.fetchSupported)();S&&(r.loader=h.default,r.progressive=!0,r.enableSoftwareAES=!0,l.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(Se,Z,U){"use strict";U.r(Z);var _=U("./src/polyfills/number.ts"),L=U("./src/utils/ewma-bandwidth-estimator.ts"),E=U("./src/events.ts"),A=U("./src/utils/buffer-helper.ts"),w=U("./src/errors.ts"),v=U("./src/types/loader.ts"),u=U("./src/utils/logger.ts");function f(i,s){for(var h=0;h<s.length;h++){var a=s[h];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(i,a.key,a)}}function o(i,s,h){return s&&f(i.prototype,s),h&&f(i,h),i}var t=function(){function i(h){this.hls=void 0,this.lastLoadedFragLevel=0,this._nextAutoLevel=-1,this.timer=void 0,this.onCheck=this._abandonRulesCheck.bind(this),this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.bwEstimator=void 0,this.hls=h;var a=h.config;this.bwEstimator=new L.default(a.abrEwmaSlowVoD,a.abrEwmaFastVoD,a.abrEwmaDefaultEstimate),this.registerListeners()}var s=i.prototype;return s.registerListeners=function(){var a=this.hls;a.on(E.Events.FRAG_LOADING,this.onFragLoading,this),a.on(E.Events.FRAG_LOADED,this.onFragLoaded,this),a.on(E.Events.FRAG_BUFFERED,this.onFragBuffered,this),a.on(E.Events.LEVEL_LOADED,this.onLevelLoaded,this),a.on(E.Events.ERROR,this.onError,this)},s.unregisterListeners=function(){var a=this.hls;a.off(E.Events.FRAG_LOADING,this.onFragLoading,this),a.off(E.Events.FRAG_LOADED,this.onFragLoaded,this),a.off(E.Events.FRAG_BUFFERED,this.onFragBuffered,this),a.off(E.Events.LEVEL_LOADED,this.onLevelLoaded,this),a.off(E.Events.ERROR,this.onError,this)},s.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},s.onFragLoading=function(a,e){var l=e.frag;if(l.type===v.PlaylistLevelType.MAIN&&!this.timer){var n;this.fragCurrent=l,this.partCurrent=(n=e.part)!=null?n:null,this.timer=self.setInterval(this.onCheck,100)}},s.onLevelLoaded=function(a,e){var l=this.hls.config;e.details.live?this.bwEstimator.update(l.abrEwmaSlowLive,l.abrEwmaFastLive):this.bwEstimator.update(l.abrEwmaSlowVoD,l.abrEwmaFastVoD)},s._abandonRulesCheck=function(){var a=this.fragCurrent,e=this.partCurrent,l=this.hls,n=l.autoLevelEnabled,d=l.config,c=l.media;if(!a||!c)return;var g=e?e.stats:a.stats,p=e?e.duration:a.duration;if(g.aborted){u.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!n||c.paused||!c.playbackRate||!c.readyState)return;var m=performance.now()-g.loading.start,b=Math.abs(c.playbackRate);if(m<=500*p/b)return;var y=l.levels,r=l.minAutoLevel,x=y[a.level],S=g.total||Math.max(g.loaded,Math.round(p*x.maxBitrate/8)),T=Math.max(1,g.bwEstimate?g.bwEstimate/8:g.loaded*1e3/m),R=(S-g.loaded)/T,D=c.currentTime,k=(A.BufferHelper.bufferInfo(c,D,d.maxBufferHole).end-D)/b;if(k>=2*p/b||R<=k)return;var B=Number.POSITIVE_INFINITY,G;for(G=a.level-1;G>r;G--){var P=y[G].maxBitrate;if(B=p*P/(8*.8*T),B<k)break}if(B>=R)return;var $=this.bwEstimator.getEstimate();u.logger.warn("Fragment "+a.sn+(e?" part "+e.index:"")+" of level "+a.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+G+`
|
|
|
Current BW estimate: `+(Object(_.isFiniteNumber)($)?($/1024).toFixed(3):"Unknown")+` Kb/s
|
|
|
Estimated load time for current fragment: `+R.toFixed(3)+` s
|
|
|
Estimated load time for the next fragment: `+B.toFixed(3)+` s
|
|
|
Time to underbuffer: `+k.toFixed(3)+" s"),l.nextLoadLevel=G,this.bwEstimator.sample(m,g.loaded),this.clearTimer(),a.loader&&(this.fragCurrent=this.partCurrent=null,a.loader.abort()),l.trigger(E.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:a,part:e,stats:g})},s.onFragLoaded=function(a,e){var l=e.frag,n=e.part;if(l.type===v.PlaylistLevelType.MAIN&&Object(_.isFiniteNumber)(l.sn)){var d=n?n.stats:l.stats,c=n?n.duration:l.duration;if(this.clearTimer(),this.lastLoadedFragLevel=l.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var g=this.hls.levels[l.level],p=(g.loaded?g.loaded.bytes:0)+d.loaded,m=(g.loaded?g.loaded.duration:0)+c;g.loaded={bytes:p,duration:m},g.realBitrate=Math.round(8*p/m)}if(l.bitrateTest){var b={stats:d,frag:l,part:n,id:l.type};this.onFragBuffered(E.Events.FRAG_BUFFERED,b),l.bitrateTest=!1}}},s.onFragBuffered=function(a,e){var l=e.frag,n=e.part,d=n?n.stats:l.stats;if(d.aborted)return;if(l.type!==v.PlaylistLevelType.MAIN||l.sn==="initSegment")return;var c=d.parsing.end-d.loading.start;this.bwEstimator.sample(c,d.loaded),d.bwEstimate=this.bwEstimator.getEstimate(),l.bitrateTest?this.bitrateTestDelay=c/1e3:this.bitrateTestDelay=0},s.onError=function(a,e){switch(e.details){case w.ErrorDetails.FRAG_LOAD_ERROR:case w.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},s.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},s.getNextABRAutoLevel=function(){var a=this.fragCurrent,e=this.partCurrent,l=this.hls,n=l.maxAutoLevel,d=l.config,c=l.minAutoLevel,g=l.media,p=e?e.duration:a?a.duration:0,m=g?g.currentTime:0,b=g&&g.playbackRate!==0?Math.abs(g.playbackRate):1,y=this.bwEstimator?this.bwEstimator.getEstimate():d.abrEwmaDefaultEstimate,r=(A.BufferHelper.bufferInfo(g,m,d.maxBufferHole).end-m)/b,x=this.findBestLevel(y,c,n,r,d.abrBandWidthFactor,d.abrBandWidthUpFactor);if(x>=0)return x;u.logger.trace((r?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var S=p?Math.min(p,d.maxStarvationDelay):d.maxStarvationDelay,T=d.abrBandWidthFactor,R=d.abrBandWidthUpFactor;if(!r){var D=this.bitrateTestDelay;if(D){var k=p?Math.min(p,d.maxLoadingDelay):d.maxLoadingDelay;S=k-D,u.logger.trace("bitrate test took "+Math.round(1e3*D)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*S)+" ms"),T=R=1}}return x=this.findBestLevel(y,c,n,r+S,T,R),Math.max(x,0)},s.findBestLevel=function(a,e,l,n,d,c){for(var g,p=this.fragCurrent,m=this.partCurrent,b=this.lastLoadedFragLevel,y=this.hls.levels,r=y[b],x=!!(r!=null&&(g=r.details)!==null&&g!==void 0&&g.live),S=r==null?void 0:r.codecSet,T=m?m.duration:p?p.duration:0,R=l;R>=e;R--){var D=y[R];if(!D||S&&D.codecSet!==S)continue;var k=D.details,B=(m?k==null?void 0:k.partTarget:k==null?void 0:k.averagetargetduration)||T,G=void 0;R<=b?G=d*a:G=c*a;var P=y[R].maxBitrate,$=P*B/G;if(u.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+R+"/"+Math.round(G)+"/"+P+"/"+B+"/"+n+"/"+$),G>P&&(!$||x&&!this.bitrateTestDelay||$<n))return R}return-1},o(i,[{key:"nextAutoLevel",get:function(){var a=this._nextAutoLevel,e=this.bwEstimator;if(a!==-1&&(!e||!e.canEstimate()))return a;var l=this.getNextABRAutoLevel();return a!==-1&&(l=Math.min(a,l)),l},set:function(a){this._nextAutoLevel=a}}]),i}();Z.default=t},"./src/controller/audio-stream-controller.ts":function(Se,Z,U){"use strict";U.r(Z);var _=U("./src/polyfills/number.ts"),L=U("./src/controller/base-stream-controller.ts"),E=U("./src/events.ts"),A=U("./src/utils/buffer-helper.ts"),w=U("./src/controller/fragment-tracker.ts"),v=U("./src/types/level.ts"),u=U("./src/types/loader.ts"),f=U("./src/loader/fragment.ts"),o=U("./src/demux/chunk-cache.ts"),t=U("./src/demux/transmuxer-interface.ts"),i=U("./src/types/transmuxer.ts"),s=U("./src/controller/fragment-finders.ts"),h=U("./src/utils/discontinuities.ts"),a=U("./src/errors.ts"),e=U("./src/utils/logger.ts");function l(){return l=Object.assign||function(p){for(var m=1;m<arguments.length;m++){var b=arguments[m];for(var y in b)Object.prototype.hasOwnProperty.call(b,y)&&(p[y]=b[y])}return p},l.apply(this,arguments)}function n(p,m){p.prototype=Object.create(m.prototype),p.prototype.constructor=p,d(p,m)}function d(p,m){return d=Object.setPrototypeOf||function(y,r){return y.__proto__=r,y},d(p,m)}var c=100,g=function(p){n(m,p);function m(y,r){var x;return x=p.call(this,y,r,"[audio-stream-controller]")||this,x.videoBuffer=null,x.videoTrackCC=-1,x.waitingVideoCC=-1,x.audioSwitch=!1,x.trackId=-1,x.waitingData=null,x.mainDetails=null,x.bufferFlushed=!1,x._registerListeners(),x}var b=m.prototype;return b.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},b._registerListeners=function(){var r=this.hls;r.on(E.Events.MEDIA_ATTACHED,this.onMediaAttached,this),r.on(E.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.on(E.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.on(E.Events.LEVEL_LOADED,this.onLevelLoaded,this),r.on(E.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),r.on(E.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),r.on(E.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),r.on(E.Events.ERROR,this.onError,this),r.on(E.Events.BUFFER_RESET,this.onBufferReset,this),r.on(E.Events.BUFFER_CREATED,this.onBufferCreated,this),r.on(E.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),r.on(E.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),r.on(E.Events.FRAG_BUFFERED,this.onFragBuffered,this)},b._unregisterListeners=function(){var r=this.hls;r.off(E.Events.MEDIA_ATTACHED,this.onMediaAttached,this),r.off(E.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.off(E.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.off(E.Events.LEVEL_LOADED,this.onLevelLoaded,this),r.off(E.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),r.off(E.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),r.off(E.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),r.off(E.Events.ERROR,this.onError,this),r.off(E.Events.BUFFER_RESET,this.onBufferReset,this),r.off(E.Events.BUFFER_CREATED,this.onBufferCreated,this),r.off(E.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),r.off(E.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),r.off(E.Events.FRAG_BUFFERED,this.onFragBuffered,this)},b.onInitPtsFound=function(r,x){var S=x.frag,T=x.id,R=x.initPTS;if(T==="main"){var D=S.cc;this.initPTS[S.cc]=R,this.log("InitPTS for cc: "+D+" found from main: "+R),this.videoTrackCC=D,this.state===L.State.WAITING_INIT_PTS&&this.tick()}},b.startLoad=function(r){if(!this.levels){this.startPosition=r,this.state=L.State.STOPPED;return}var x=this.lastCurrentTime;this.stopLoad(),this.setInterval(c),this.fragLoadError=0,x>0&&r===-1?(this.log("Override startPosition with lastCurrentTime @"+x.toFixed(3)),this.state=L.State.IDLE):(this.loadedmetadata=!1,this.state=L.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=r,this.tick()},b.doTick=function(){switch(this.state){case L.State.IDLE:this.doTickIdle();break;case L.State.WAITING_TRACK:{var r,x=this.levels,S=this.trackId,T=x==null||((r=x[S])===null||r===void 0)?void 0:r.details;if(T){if(this.waitForCdnTuneIn(T))break;this.state=L.State.WAITING_INIT_PTS}break}case L.State.FRAG_LOADING_WAITING_RETRY:{var R,D=performance.now(),k=this.retryDate;(!k||D>=k||(R=this.media)!==null&&R!==void 0&&R.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=L.State.IDLE);break}case L.State.WAITING_INIT_PTS:{var B=this.waitingData;if(B){var G=B.frag,P=B.part,$=B.cache,X=B.complete;if(this.initPTS[G.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=L.State.FRAG_LOADING;var z=$.flush(),N={frag:G,part:P,payload:z,networkDetails:null};this._handleFragmentLoadProgress(N),X&&p.prototype._handleFragmentLoadComplete.call(this,N)}else if(this.videoTrackCC!==this.waitingVideoCC)e.logger.log("Waiting fragment cc ("+G.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var H=this.getLoadPosition(),q=A.BufferHelper.bufferInfo(this.mediaBuffer,H,this.config.maxBufferHole),ee=Object(s.fragmentWithinToleranceTest)(q.end,this.config.maxFragLookUpTolerance,G);ee<0&&(e.logger.log("Waiting fragment cc ("+G.cc+") @ "+G.start+" cancelled because another fragment at "+q.end+" is needed"),this.clearWaitingFragment())}}else this.state=L.State.IDLE}}this.onTickEnd()},b.clearWaitingFragment=function(){var r=this.waitingData;r&&(this.fragmentTracker.removeFragment(r.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=L.State.IDLE)},b.onTickEnd=function(){var r=this.media;if(!r||!r.readyState)return;var x=this.mediaBuffer?this.mediaBuffer:r,S=x.buffered;!this.loadedmetadata&&S.length&&(this.loadedmetadata=!0),this.lastCurrentTime=r.currentTime},b.doTickIdle=function(){var r,x,S=this.hls,T=this.levels,R=this.media,D=this.trackId,k=S.config;if(!T||!T[D])return;if(!R&&(this.startFragRequested||!k.startFragPrefetch))return;var B=T[D],G=B.details;if(!G||G.live&&this.levelLastLoaded!==D||this.waitForCdnTuneIn(G)){this.state=L.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,f.ElementaryStreamTypes.AUDIO,u.PlaylistLevelType.AUDIO));var P=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,u.PlaylistLevelType.AUDIO);if(P===null)return;var $=P.len,X=this.getMaxBufferLength(),z=this.audioSwitch;if($>=X&&!z)return;if(!z&&this._streamEnded(P,G)){S.trigger(E.Events.BUFFER_EOS,{type:"audio"}),this.state=L.State.ENDED;return}var N=G.fragments,H=N[0].start,q=P.end;if(z){var ee=this.getLoadPosition();q=ee,G.PTSKnown&&ee<H&&((P.end>H||P.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),R.currentTime=H+.05))}var fe=this.getNextFragment(q,G);if(!fe){this.bufferFlushed=!0;return}((r=fe.decryptdata)===null||r===void 0?void 0:r.keyFormat)==="identity"&&!((x=fe.decryptdata)!==null&&x!==void 0&&x.key)?this.loadKey(fe,G):this.loadFragment(fe,G,q)},b.getMaxBufferLength=function(){var r=p.prototype.getMaxBufferLength.call(this),x=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,u.PlaylistLevelType.MAIN);return x===null?r:Math.max(r,x.len)},b.onMediaDetaching=function(){this.videoBuffer=null,p.prototype.onMediaDetaching.call(this)},b.onAudioTracksUpdated=function(r,x){var S=x.audioTracks;this.resetTransmuxer(),this.levels=S.map(function(T){return new v.Level(T)})},b.onAudioTrackSwitching=function(r,x){var S=!!x.url;this.trackId=x.id;var T=this.fragCurrent;T!=null&&T.loader&&T.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),S?this.setInterval(c):this.resetTransmuxer(),S?(this.audioSwitch=!0,this.state=L.State.IDLE):this.state=L.State.STOPPED,this.tick()},b.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},b.onLevelLoaded=function(r,x){this.mainDetails=x.details},b.onAudioTrackLoaded=function(r,x){var S,T=this.levels,R=x.details,D=x.id;if(!T){this.warn("Audio tracks were reset while loading level "+D);return}this.log("Track "+D+" loaded ["+R.startSN+","+R.endSN+"],duration:"+R.totalduration);var k=T[D],B=0;if(R.live||(S=k.details)!==null&&S!==void 0&&S.live){var G=this.mainDetails;if(R.fragments[0]||(R.deltaUpdateFailed=!0),R.deltaUpdateFailed||!G)return;!k.details&&R.hasProgramDateTime&&G.hasProgramDateTime?(Object(h.alignMediaPlaylistByPDT)(R,G),B=R.fragments[0].start):B=this.alignPlaylists(R,k.details)}k.details=R,this.levelLastLoaded=D,!this.startFragRequested&&(this.mainDetails||!R.live)&&this.setStartPosition(k.details,B),this.state===L.State.WAITING_TRACK&&!this.waitForCdnTuneIn(R)&&(this.state=L.State.IDLE),this.tick()},b._handleFragmentLoadProgress=function(r){var x,S=r.frag,T=r.part,R=r.payload,D=this.config,k=this.trackId,B=this.levels;if(!B){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+S.sn+" of level "+S.level+" will not be buffered");return}var G=B[k];console.assert(G,"Audio track is defined on fragment load progress");var P=G.details;console.assert(P,"Audio track details are defined on fragment load progress");var $=D.defaultAudioCodec||G.audioCodec||"mp4a.40.2",X=this.transmuxer;X||(X=this.transmuxer=new t.default(this.hls,u.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var z=this.initPTS[S.cc],N=(x=S.initSegment)===null||x===void 0?void 0:x.data;if(z!==void 0){var H=!1,q=T?T.index:-1,ee=q!==-1,fe=new i.ChunkMetadata(S.level,S.sn,S.stats.chunkCount,R.byteLength,q,ee);X.push(R,N,$,"",S,T,P.totalduration,H,fe,z)}else{e.logger.log("Unknown video PTS for cc "+S.cc+", waiting for video PTS before demuxing audio frag "+S.sn+" of ["+P.startSN+" ,"+P.endSN+"],track "+k);var oe=this.waitingData=this.waitingData||{frag:S,part:T,cache:new o.default,complete:!1},he=oe.cache;he.push(new Uint8Array(R)),this.waitingVideoCC=this.videoTrackCC,this.state=L.State.WAITING_INIT_PTS}},b._handleFragmentLoadComplete=function(r){if(this.waitingData){this.waitingData.complete=!0;return}p.prototype._handleFragmentLoadComplete.call(this,r)},b.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},b.onBufferCreated=function(r,x){var S=x.tracks.audio;S&&(this.mediaBuffer=S.buffer),x.tracks.video&&(this.videoBuffer=x.tracks.video.buffer)},b.onFragBuffered=function(r,x){var S=x.frag,T=x.part;if(S.type!==u.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(S)){this.warn("Fragment "+S.sn+(T?" p: "+T.index:"")+" of level "+S.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}S.sn!=="initSegment"&&(this.fragPrevious=S,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(E.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(S,T)},b.onError=function(r,x){switch(x.details){case a.ErrorDetails.FRAG_LOAD_ERROR:case a.ErrorDetails.FRAG_LOAD_TIMEOUT:case a.ErrorDetails.KEY_LOAD_ERROR:case a.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(u.PlaylistLevelType.AUDIO,x);break;case a.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case a.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==L.State.ERROR&&this.state!==L.State.STOPPED&&(this.state=x.fatal?L.State.ERROR:L.State.IDLE,this.warn(x.details+" while loading frag, switching to "+this.state+" state"));break;case a.ErrorDetails.BUFFER_FULL_ERROR:if(x.parent==="audio"&&(this.state===L.State.PARSING||this.state===L.State.PARSED)){var S=!0,T=this.getFwdBufferInfo(this.mediaBuffer,u.PlaylistLevelType.AUDIO);T&&T.len>.5&&(S=!this.reduceMaxBufferLength(T.len)),S&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,p.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},b.onBufferFlushed=function(r,x){var S=x.type;S===f.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},b._handleTransmuxComplete=function(r){var x,S="audio",T=this.hls,R=r.remuxResult,D=r.chunkMeta,k=this.getCurrentContext(D);if(!k){this.warn("The loading context changed while buffering fragment "+D.sn+" of level "+D.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(D.level);return}var B=k.frag,G=k.part,P=R.audio,$=R.text,X=R.id3,z=R.initSegment;if(this.fragContextChanged(B))return;if(this.state=L.State.PARSING,this.audioSwitch&&P&&this.completeAudioSwitch(),z!=null&&z.tracks&&(this._bufferInitSegment(z.tracks,B,D),T.trigger(E.Events.FRAG_PARSING_INIT_SEGMENT,{frag:B,id:S,tracks:z.tracks})),P){var N=P.startPTS,H=P.endPTS,q=P.startDTS,ee=P.endDTS;G&&(G.elementaryStreams[f.ElementaryStreamTypes.AUDIO]={startPTS:N,endPTS:H,startDTS:q,endDTS:ee}),B.setElementaryStreamInfo(f.ElementaryStreamTypes.AUDIO,N,H,q,ee),this.bufferFragmentData(P,B,G,D)}if(X!=null&&(x=X.samples)!==null&&x!==void 0&&x.length){var fe=l({frag:B,id:S},X);T.trigger(E.Events.FRAG_PARSING_METADATA,fe)}if($){var oe=l({frag:B,id:S},$);T.trigger(E.Events.FRAG_PARSING_USERDATA,oe)}},b._bufferInitSegment=function(r,x,S){if(this.state!==L.State.PARSING)return;r.video&&delete r.video;var T=r.audio;if(!T)return;T.levelCodec=T.codec,T.id="audio",this.log("Init audio buffer, container:"+T.container+", codecs[parsed]=["+T.codec+"]"),this.hls.trigger(E.Events.BUFFER_CODECS,r);var R=T.initSegment;if(R!=null&&R.byteLength){var D={type:"audio",frag:x,part:null,chunkMeta:S,parent:x.type,data:R};this.hls.trigger(E.Events.BUFFER_APPENDING,D)}this.tick()},b.loadFragment=function(r,x,S){var T=this.fragmentTracker.getState(r);this.fragCurrent=r,(this.audioSwitch||T===w.FragmentState.NOT_LOADED||T===w.FragmentState.PARTIAL)&&(r.sn==="initSegment"?this._loadInitSegment(r):x.live&&!Object(_.isFiniteNumber)(this.initPTS[r.cc])?(this.log("Waiting for video PTS in continuity counter "+r.cc+" of live stream before loading audio fragment "+r.sn+" of level "+this.trackId),this.state=L.State.WAITING_INIT_PTS):(this.startFragRequested=!0,p.prototype.loadFragment.call(this,r,x,S)))},b.completeAudioSwitch=function(){var r=this.hls,x=this.media,S=this.trackId;x&&(this.log("Switching audio track : flushing all audio"),p.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,r.trigger(E.Events.AUDIO_TRACK_SWITCHED,{id:S})},m}(L.default);Z.default=g},"./src/controller/audio-track-controller.ts":function(Se,Z,U){"use strict";U.r(Z);var _=U("./src/events.ts"),L=U("./src/errors.ts"),E=U("./src/controller/base-playlist-controller.ts"),A=U("./src/types/loader.ts");function w(t,i){for(var s=0;s<i.length;s++){var h=i[s];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(t,h.key,h)}}function v(t,i,s){return i&&w(t.prototype,i),s&&w(t,s),t}function u(t,i){t.prototype=Object.create(i.prototype),t.prototype.constructor=t,f(t,i)}function f(t,i){return f=Object.setPrototypeOf||function(h,a){return h.__proto__=a,h},f(t,i)}var o=function(t){u(i,t);function i(h){var a;return a=t.call(this,h,"[audio-track-controller]")||this,a.tracks=[],a.groupId=null,a.tracksInGroup=[],a.trackId=-1,a.trackName="",a.selectDefaultTrack=!0,a.registerListeners(),a}var s=i.prototype;return s.registerListeners=function(){var a=this.hls;a.on(_.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.on(_.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.on(_.Events.LEVEL_LOADING,this.onLevelLoading,this),a.on(_.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),a.on(_.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),a.on(_.Events.ERROR,this.onError,this)},s.unregisterListeners=function(){var a=this.hls;a.off(_.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.off(_.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.off(_.Events.LEVEL_LOADING,this.onLevelLoading,this),a.off(_.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),a.off(_.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),a.off(_.Events.ERROR,this.onError,this)},s.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,t.prototype.destroy.call(this)},s.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},s.onManifestParsed=function(a,e){this.tracks=e.audioTracks||[]},s.onAudioTrackLoaded=function(a,e){var l=e.id,n=e.details,d=this.tracksInGroup[l];if(!d){this.warn("Invalid audio track id "+l);return}var c=d.details;d.details=e.details,this.log("audioTrack "+l+" loaded ["+n.startSN+"-"+n.endSN+"]"),l===this.trackId&&(this.retryCount=0,this.playlistLoaded(l,e,c))},s.onLevelLoading=function(a,e){this.switchLevel(e.level)},s.onLevelSwitching=function(a,e){this.switchLevel(e.level)},s.switchLevel=function(a){var e=this.hls.levels[a];if(!(e!=null&&e.audioGroupIds))return;var l=e.audioGroupIds[e.urlId];if(this.groupId!==l){this.groupId=l;var n=this.tracks.filter(function(c){return!l||c.groupId===l});this.selectDefaultTrack&&!n.some(function(c){return c.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=n;var d={audioTracks:n};this.log("Updating audio tracks, "+n.length+' track(s) found in "'+l+'" group-id'),this.hls.trigger(_.Events.AUDIO_TRACKS_UPDATED,d),this.selectInitialTrack()}},s.onError=function(a,e){if(t.prototype.onError.call(this,a,e),e.fatal||!e.context)return;e.context.type===A.PlaylistContextType.AUDIO_TRACK&&e.context.id===this.trackId&&e.context.groupId===this.groupId&&this.retryLoadingOrFail(e)},s.setAudioTrack=function(a){var e=this.tracksInGroup;if(a<0||a>=e.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var l=e[this.trackId];this.log("Now switching to audio-track index "+a);var n=e[a],d=n.id,c=n.groupId,g=c===void 0?"":c,p=n.name,m=n.type,b=n.url;if(this.trackId=a,this.trackName=p,this.selectDefaultTrack=!1,this.hls.trigger(_.Events.AUDIO_TRACK_SWITCHING,{id:d,groupId:g,name:p,type:m,url:b}),n.details&&!n.details.live)return;var y=this.switchParams(n.url,l==null?void 0:l.details);this.loadPlaylist(y)},s.selectInitialTrack=function(){var a=this.tracksInGroup;console.assert(a.length,"Initial audio track should be selected when tracks are known");var e=this.trackName,l=this.findTrackId(e)||this.findTrackId();l!==-1?this.setAudioTrack(l):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(_.Events.ERROR,{type:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},s.findTrackId=function(a){for(var e=this.tracksInGroup,l=0;l<e.length;l++){var n=e[l];if((!this.selectDefaultTrack||n.default)&&(!a||a===n.name))return n.id}return-1},s.loadPlaylist=function(a){var e=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(e)){var l=e.id,n=e.groupId,d=e.url;if(a)try{d=a.addDirectives(d)}catch(c){this.warn("Could not construct new URL with HLS Delivery Directives: "+c)}this.log("loading audio-track playlist for id: "+l),this.clearTimer(),this.hls.trigger(_.Events.AUDIO_TRACK_LOADING,{url:d,id:l,groupId:n,deliveryDirectives:a||null})}},v(i,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(a){this.selectDefaultTrack=!1,this.setAudioTrack(a)}}]),i}(E.default);Z.default=o},"./src/controller/base-playlist-controller.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"default",function(){return v});var _=U("./src/polyfills/number.ts"),L=U("./src/types/level.ts"),E=U("./src/controller/level-helper.ts"),A=U("./src/utils/logger.ts"),w=U("./src/errors.ts"),v=function(){function u(o,t){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=A.logger.log.bind(A.logger,t+":"),this.warn=A.logger.warn.bind(A.logger,t+":"),this.hls=o}var f=u.prototype;return f.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},f.onError=function(t,i){i.fatal&&i.type===w.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},f.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},f.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},f.stopLoad=function(){this.canLoad=!1,this.clearTimer()},f.switchParams=function(t,i){var s=i==null?void 0:i.renditionReports;if(s)for(var h=0;h<s.length;h++){var a=s[h],e=""+a.URI;if(e===t.substr(-e.length)){var l=parseInt(a["LAST-MSN"]),n=parseInt(a["LAST-PART"]);if(i&&this.hls.config.lowLatencyMode){var d=Math.min(i.age-i.partTarget,i.targetduration);n!==void 0&&d>i.partTarget&&(n+=1)}if(Object(_.isFiniteNumber)(l))return new L.HlsUrlParameters(l,Object(_.isFiniteNumber)(n)?n:void 0,L.HlsSkip.No)}}},f.loadPlaylist=function(t){},f.shouldLoadTrack=function(t){return this.canLoad&&t&&!!t.url&&(!t.details||t.details.live)},f.playlistLoaded=function(t,i,s){var h=this,a=i.details,e=i.stats,l=e.loading.end?Math.max(0,self.performance.now()-e.loading.end):0;if(a.advancedDateTime=Date.now()-l,a.live||s!=null&&s.live){if(a.reloaded(s),s&&this.log("live playlist "+t+" "+(a.advanced?"REFRESHED "+a.lastPartSn+"-"+a.lastPartIndex:"MISSED")),s&&a.fragments.length>0&&Object(E.mergeDetails)(s,a),!this.canLoad||!a.live)return;var n,d=void 0,c=void 0;if(a.canBlockReload&&a.endSN&&a.advanced){var g=this.hls.config.lowLatencyMode,p=a.lastPartSn,m=a.endSN,b=a.lastPartIndex,y=b!==-1,r=p===m,x=g?0:b;y?(d=r?m+1:p,c=r?x:b+1):d=m+1;var S=a.age,T=S+a.ageHeader,R=Math.min(T-a.partTarget,a.targetduration*1.5);if(R>0){if(s&&R>s.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+s.tuneInGoal+" to: "+R+" with playlist age: "+a.age),R=0;else{var D=Math.floor(R/a.targetduration);if(d+=D,c!==void 0){var k=Math.round(R%a.targetduration/a.partTarget);c+=k}this.log("CDN Tune-in age: "+a.ageHeader+"s last advanced "+S.toFixed(2)+"s goal: "+R+" skip sn "+D+" to part "+c)}a.tuneInGoal=R}if(n=this.getDeliveryDirectives(a,i.deliveryDirectives,d,c),g||!r){this.loadPlaylist(n);return}}else n=this.getDeliveryDirectives(a,i.deliveryDirectives,d,c);var B=Object(E.computeReloadInterval)(a,e);d!==void 0&&a.canBlockReload&&(B-=a.partTarget||1),this.log("reload live playlist "+t+" in "+Math.round(B)+" ms"),this.timer=self.setTimeout(function(){return h.loadPlaylist(n)},B)}else this.clearTimer()},f.getDeliveryDirectives=function(t,i,s,h){var a=Object(L.getSkipValue)(t,s);return i!=null&&i.skip&&t.deltaUpdateFailed&&(s=i.msn,h=i.part,a=L.HlsSkip.No),new L.HlsUrlParameters(s,h,a)},f.retryLoadingOrFail=function(t){var i=this,s=this.hls.config,h=this.retryCount<s.levelLoadingMaxRetry;if(h){var a;if(this.retryCount++,t.details.indexOf("LoadTimeOut")>-1&&(a=t.context)!==null&&a!==void 0&&a.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+t.details+'"'),this.loadPlaylist();else{var e=Math.min(Math.pow(2,this.retryCount)*s.levelLoadingRetryDelay,s.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return i.loadPlaylist()},e),this.warn("retry playlist loading #"+this.retryCount+" in "+e+' ms after "'+t.details+'"')}}else this.warn('cannot recover from error "'+t.details+'"'),this.clearTimer(),t.fatal=!0;return h},u}()},"./src/controller/base-stream-controller.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"State",function(){return m}),U.d(Z,"default",function(){return b});var _=U("./src/polyfills/number.ts"),L=U("./src/task-loop.ts"),E=U("./src/controller/fragment-tracker.ts"),A=U("./src/utils/buffer-helper.ts"),w=U("./src/utils/logger.ts"),v=U("./src/events.ts"),u=U("./src/errors.ts"),f=U("./src/types/transmuxer.ts"),o=U("./src/utils/mp4-tools.ts"),t=U("./src/utils/discontinuities.ts"),i=U("./src/controller/fragment-finders.ts"),s=U("./src/controller/level-helper.ts"),h=U("./src/loader/fragment-loader.ts"),a=U("./src/crypt/decrypter.ts"),e=U("./src/utils/time-ranges.ts"),l=U("./src/types/loader.ts");function n(y,r){for(var x=0;x<r.length;x++){var S=r[x];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(y,S.key,S)}}function d(y,r,x){return r&&n(y.prototype,r),x&&n(y,x),y}function c(y){if(y===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y}function g(y,r){y.prototype=Object.create(r.prototype),y.prototype.constructor=y,p(y,r)}function p(y,r){return p=Object.setPrototypeOf||function(S,T){return S.__proto__=T,S},p(y,r)}var m={STOPPED:"STOPPED",IDLE:"IDLE",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",BACKTRACKING:"BACKTRACKING",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"},b=function(y){g(r,y);function r(S,T,R){var D;return D=y.call(this)||this,D.hls=void 0,D.fragPrevious=null,D.fragCurrent=null,D.fragmentTracker=void 0,D.transmuxer=null,D._state=m.STOPPED,D.media=void 0,D.mediaBuffer=void 0,D.config=void 0,D.bitrateTest=!1,D.lastCurrentTime=0,D.nextLoadPosition=0,D.startPosition=0,D.loadedmetadata=!1,D.fragLoadError=0,D.retryDate=0,D.levels=null,D.fragmentLoader=void 0,D.levelLastLoaded=null,D.startFragRequested=!1,D.decrypter=void 0,D.initPTS=[],D.onvseeking=null,D.onvended=null,D.logPrefix="",D.log=void 0,D.warn=void 0,D.logPrefix=R,D.log=w.logger.log.bind(w.logger,R+":"),D.warn=w.logger.warn.bind(w.logger,R+":"),D.hls=S,D.fragmentLoader=new h.default(S.config),D.fragmentTracker=T,D.config=S.config,D.decrypter=new a.default(S,S.config),S.on(v.Events.KEY_LOADED,D.onKeyLoaded,c(D)),D}var x=r.prototype;return x.doTick=function(){this.onTickEnd()},x.onTickEnd=function(){},x.startLoad=function(T){},x.stopLoad=function(){this.fragmentLoader.abort();var T=this.fragCurrent;T&&this.fragmentTracker.removeFragment(T),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=m.STOPPED},x._streamEnded=function(T,R){var D=this.fragCurrent,k=this.fragmentTracker;if(!R.live&&D&&D.sn===R.endSN&&!T.nextStart){var B=k.getState(D);return B===E.FragmentState.PARTIAL||B===E.FragmentState.OK}return!1},x.onMediaAttached=function(T,R){var D=this.media=this.mediaBuffer=R.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),D.addEventListener("seeking",this.onvseeking),D.addEventListener("ended",this.onvended);var k=this.config;this.levels&&k.autoStartLoad&&this.state===m.STOPPED&&this.startLoad(k.startPosition)},x.onMediaDetaching=function(){var T=this.media;T!=null&&T.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),T&&(T.removeEventListener("seeking",this.onvseeking),T.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},x.onMediaSeeking=function(){var T=this.config,R=this.fragCurrent,D=this.media,k=this.mediaBuffer,B=this.state,G=D?D.currentTime:0,P=A.BufferHelper.bufferInfo(k||D,G,T.maxBufferHole);if(this.log("media seeking to "+(Object(_.isFiniteNumber)(G)?G.toFixed(3):G)+", state: "+B),B===m.ENDED)this.resetLoadingState();else if(R&&!P.len){var $=T.maxFragLookUpTolerance,X=R.start-$,z=R.start+R.duration+$,N=G>z;(G<X||N)&&(N&&R.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),R.loader.abort()),this.resetLoadingState())}D&&(this.lastCurrentTime=G),!this.loadedmetadata&&!P.len&&(this.nextLoadPosition=this.startPosition=G),this.tickImmediate()},x.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},x.onKeyLoaded=function(T,R){if(this.state!==m.KEY_LOADING||R.frag!==this.fragCurrent||!this.levels)return;this.state=m.IDLE;var D=this.levels[R.frag.level].details;D&&this.loadFragment(R.frag,D,R.frag.start)},x.onHandlerDestroying=function(){this.stopLoad(),y.prototype.onHandlerDestroying.call(this)},x.onHandlerDestroyed=function(){this.state=m.STOPPED,this.hls.off(v.Events.KEY_LOADED,this.onKeyLoaded,this),this.fragmentLoader&&this.fragmentLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.fragmentLoader=this.fragmentTracker=null,y.prototype.onHandlerDestroyed.call(this)},x.loadKey=function(T,R){this.log("Loading key for "+T.sn+" of ["+R.startSN+"-"+R.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+T.level),this.state=m.KEY_LOADING,this.fragCurrent=T,this.hls.trigger(v.Events.KEY_LOADING,{frag:T})},x.loadFragment=function(T,R,D){this._loadFragForPlayback(T,R,D)},x._loadFragForPlayback=function(T,R,D){var k=this,B=function(P){if(k.fragContextChanged(T)){k.warn("Fragment "+T.sn+(P.part?" p: "+P.part.index:"")+" of level "+T.level+" was dropped during download."),k.fragmentTracker.removeFragment(T);return}T.stats.chunkCount++,k._handleFragmentLoadProgress(P)};this._doFragLoad(T,R,D,B).then(function(G){if(!G)return;k.fragLoadError=0;var P=k.state;if(k.fragContextChanged(T)){(P===m.FRAG_LOADING||P===m.BACKTRACKING||!k.fragCurrent&&P===m.PARSING)&&(k.fragmentTracker.removeFragment(T),k.state=m.IDLE);return}if("payload"in G&&(k.log("Loaded fragment "+T.sn+" of level "+T.level),k.hls.trigger(v.Events.FRAG_LOADED,G),k.state===m.BACKTRACKING)){k.fragmentTracker.backtrack(T,G),k.resetFragmentLoading(T);return}k._handleFragmentLoadComplete(G)}).catch(function(G){k.warn(G),k.resetFragmentLoading(T)})},x.flushMainBuffer=function(T,R,D){if(D===void 0&&(D=null),!(T-R))return;var k={startOffset:T,endOffset:R,type:D};this.fragLoadError=0,this.hls.trigger(v.Events.BUFFER_FLUSHING,k)},x._loadInitSegment=function(T){var R=this;this._doFragLoad(T).then(function(D){if(!D||R.fragContextChanged(T)||!R.levels)throw new Error("init load aborted");return D}).then(function(D){var k=R.hls,B=D.payload,G=T.decryptdata;if(B&&B.byteLength>0&&G&&G.key&&G.iv&&G.method==="AES-128"){var P=self.performance.now();return R.decrypter.webCryptoDecrypt(new Uint8Array(B),G.key.buffer,G.iv.buffer).then(function($){var X=self.performance.now();return k.trigger(v.Events.FRAG_DECRYPTED,{frag:T,payload:$,stats:{tstart:P,tdecrypt:X}}),D.payload=$,D})}return D}).then(function(D){var k=R.fragCurrent,B=R.hls,G=R.levels;if(!G)throw new Error("init load aborted, missing levels");var P=G[T.level].details;console.assert(P,"Level details are defined when init segment is loaded");var $=T.stats;R.state=m.IDLE,R.fragLoadError=0,T.data=new Uint8Array(D.payload),$.parsing.start=$.buffering.start=self.performance.now(),$.parsing.end=$.buffering.end=self.performance.now(),D.frag===k&&B.trigger(v.Events.FRAG_BUFFERED,{stats:$,frag:k,part:null,id:T.type}),R.tick()}).catch(function(D){R.warn(D),R.resetFragmentLoading(T)})},x.fragContextChanged=function(T){var R=this.fragCurrent;return!T||!R||T.level!==R.level||T.sn!==R.sn||T.urlId!==R.urlId},x.fragBufferedComplete=function(T,R){var D=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+T.type+" sn: "+T.sn+(R?" part: "+R.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+T.level+" "+e.default.toString(A.BufferHelper.getBuffered(D))),this.state=m.IDLE,this.tick()},x._handleFragmentLoadComplete=function(T){var R=this.transmuxer;if(!R)return;var D=T.frag,k=T.part,B=T.partsLoaded,G=!B||B.length===0||B.some(function($){return!$}),P=new f.ChunkMetadata(D.level,D.sn,D.stats.chunkCount+1,0,k?k.index:-1,!G);R.flush(P)},x._handleFragmentLoadProgress=function(T){},x._doFragLoad=function(T,R,D,k){var B=this;if(D===void 0&&(D=null),!this.levels)throw new Error("frag load aborted, missing levels");if(D=Math.max(T.start,D||0),this.config.lowLatencyMode&&R){var G=R.partList;if(G&&k){D>T.end&&R.fragmentHint&&(T=R.fragmentHint);var P=this.getNextPart(G,T,D);if(P>-1){var $=G[P];return this.log("Loading part sn: "+T.sn+" p: "+$.index+" cc: "+T.cc+" of playlist ["+R.startSN+"-"+R.endSN+"] parts [0-"+P+"-"+(G.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+T.level+", target: "+parseFloat(D.toFixed(3))),this.nextLoadPosition=$.start+$.duration,this.state=m.FRAG_LOADING,this.hls.trigger(v.Events.FRAG_LOADING,{frag:T,part:G[P],targetBufferTime:D}),this.doFragPartsLoad(T,G,P,k).catch(function(X){return B.handleFragLoadError(X)})}else if(!T.url||this.loadedEndOfParts(G,D))return Promise.resolve(null)}}return this.log("Loading fragment "+T.sn+" cc: "+T.cc+" "+(R?"of ["+R.startSN+"-"+R.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+T.level+", target: "+parseFloat(D.toFixed(3))),Object(_.isFiniteNumber)(T.sn)&&!this.bitrateTest&&(this.nextLoadPosition=T.start+T.duration),this.state=m.FRAG_LOADING,this.hls.trigger(v.Events.FRAG_LOADING,{frag:T,targetBufferTime:D}),this.fragmentLoader.load(T,k).catch(function(X){return B.handleFragLoadError(X)})},x.doFragPartsLoad=function(T,R,D,k){var B=this;return new Promise(function(G,P){var $=[],X=function z(N){var H=R[N];B.fragmentLoader.loadPart(T,H,k).then(function(q){$[H.index]=q;var ee=q.part;B.hls.trigger(v.Events.FRAG_LOADED,q);var fe=R[N+1];if(fe&&fe.fragment===T)z(N+1);else return G({frag:T,part:ee,partsLoaded:$})}).catch(P)};X(D)})},x.handleFragLoadError=function(T){var R=T.data;return R&&R.details===u.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(R.frag,R.part):this.hls.trigger(v.Events.ERROR,R),null},x._handleTransmuxerFlush=function(T){var R=this.getCurrentContext(T);if(!R||this.state!==m.PARSING){this.fragCurrent||(this.state=m.IDLE);return}var D=R.frag,k=R.part,B=R.level,G=self.performance.now();D.stats.parsing.end=G,k&&(k.stats.parsing.end=G),this.updateLevelTiming(D,k,B,T.partial)},x.getCurrentContext=function(T){var R=this.levels,D=T.level,k=T.sn,B=T.part;if(!R||!R[D])return this.warn("Levels object was unset while buffering fragment "+k+" of level "+D+". The current chunk will not be buffered."),null;var G=R[D],P=B>-1?Object(s.getPartWith)(G,k,B):null,$=P?P.fragment:Object(s.getFragmentWithSN)(G,k,this.fragCurrent);return $?{frag:$,part:P,level:G}:null},x.bufferFragmentData=function(T,R,D,k){if(!T||this.state!==m.PARSING)return;var B=T.data1,G=T.data2,P=B;if(B&&G&&(P=Object(o.appendUint8Array)(B,G)),!P||!P.length)return;var $={type:T.type,frag:R,part:D,chunkMeta:k,parent:R.type,data:P};this.hls.trigger(v.Events.BUFFER_APPENDING,$),T.dropped&&T.independent&&!D&&this.flushBufferGap(R)},x.flushBufferGap=function(T){var R=this.media;if(!R)return;if(!A.BufferHelper.isBuffered(R,R.currentTime)){this.flushMainBuffer(0,T.start);return}var D=R.currentTime,k=A.BufferHelper.bufferInfo(R,D,0),B=T.duration,G=Math.min(this.config.maxFragLookUpTolerance*2,B*.25),P=Math.max(Math.min(T.start-G,k.end-G),D+G);T.start-P>G&&this.flushMainBuffer(P,T.start)},x.getFwdBufferInfo=function(T,R){var D=this.config,k=this.getLoadPosition();if(!Object(_.isFiniteNumber)(k))return null;var B=A.BufferHelper.bufferInfo(T,k,D.maxBufferHole);if(B.len===0&&B.nextStart!==void 0){var G=this.fragmentTracker.getBufferedFrag(k,R);if(G&&B.nextStart<G.end)return A.BufferHelper.bufferInfo(T,k,Math.max(B.nextStart,D.maxBufferHole))}return B},x.getMaxBufferLength=function(T){var R=this.config,D;return T?D=Math.max(8*R.maxBufferSize/T,R.maxBufferLength):D=R.maxBufferLength,Math.min(D,R.maxMaxBufferLength)},x.reduceMaxBufferLength=function(T){var R=this.config,D=T||R.maxBufferLength;return R.maxMaxBufferLength>=D?(R.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+R.maxMaxBufferLength+"s"),!0):!1},x.getNextFragment=function(T,R){var D,k,B=R.fragments,G=B.length;if(!G)return null;var P=this.config,$=B[0].start,X;if(R.live){var z=P.initialLiveManifestSize;if(G<z)return this.warn("Not enough fragments to start playback (have: "+G+", need: "+z+")"),null;!R.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(X=this.getInitialLiveFragment(R,B),this.startPosition=X?this.hls.liveSyncPosition||X.start:T)}else T<=$&&(X=B[0]);if(!X){var N=P.lowLatencyMode?R.partEnd:R.fragmentEnd;X=this.getFragmentAtPosition(T,N,R)}return(D=X)!==null&&D!==void 0&&D.initSegment&&!((k=X)!==null&&k!==void 0&&k.initSegment.data)&&!this.bitrateTest&&(X=X.initSegment),X},x.getNextPart=function(T,R,D){for(var k=-1,B=!1,G=!0,P=0,$=T.length;P<$;P++){var X=T[P];if(G=G&&!X.independent,k>-1&&D<X.start)break;var z=X.loaded;!z&&(B||X.independent||G)&&X.fragment===R&&(k=P),B=z}return k},x.loadedEndOfParts=function(T,R){var D=T[T.length-1];return D&&R>D.start&&D.loaded},x.getInitialLiveFragment=function(T,R){var D=this.fragPrevious,k=null;if(D){if(T.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+D.programDateTime),k=Object(i.findFragmentByPDT)(R,D.endProgramDateTime,this.config.maxFragLookUpTolerance)),!k){var B=D.sn+1;if(B>=T.startSN&&B<=T.endSN){var G=R[B-T.startSN];D.cc===G.cc&&(k=G,this.log("Live playlist, switching playlist, load frag with next SN: "+k.sn))}k||(k=Object(i.findFragWithCC)(R,D.cc),k&&this.log("Live playlist, switching playlist, load frag with same CC: "+k.sn))}}else{var P=this.hls.liveSyncPosition;P!==null&&(k=this.getFragmentAtPosition(P,this.bitrateTest?T.fragmentEnd:T.edge,T))}return k},x.getFragmentAtPosition=function(T,R,D){var k=this.config,B=this.fragPrevious,G=D.fragments,P=D.endSN,$=D.fragmentHint,X=k.maxFragLookUpTolerance,z=!!(k.lowLatencyMode&&D.partList&&$);z&&$&&!this.bitrateTest&&(G=G.concat($),P=$.sn);var N;if(T<R){var H=T>R-X?0:X;N=Object(i.findFragmentByPTS)(B,G,T,H)}else N=G[G.length-1];if(N){var q=N.sn-D.startSN,ee=B&&N.level===B.level,fe=G[q+1],oe=this.fragmentTracker.getState(N);if(oe===E.FragmentState.BACKTRACKED){N=null;for(var he=q;G[he]&&this.fragmentTracker.getState(G[he])===E.FragmentState.BACKTRACKED;)B?N=G[he--]:N=G[--he];N||(N=fe)}else B&&N.sn===B.sn&&!z&&(ee&&(N.sn<P&&this.fragmentTracker.getState(fe)!==E.FragmentState.OK?(this.log("SN "+N.sn+" just loaded, load next one: "+fe.sn),N=fe):N=null))}return N},x.synchronizeToLiveEdge=function(T){var R=this.config,D=this.media;if(!D)return;var k=this.hls.liveSyncPosition,B=D.currentTime,G=T.fragments[0].start,P=T.edge,$=B>=G-R.maxFragLookUpTolerance&&B<=P;if(k!==null&&D.duration>k&&(B<k||!$)){var X=R.liveMaxLatencyDuration!==void 0?R.liveMaxLatencyDuration:R.liveMaxLatencyDurationCount*T.targetduration;(!$&&D.readyState<4||B<P-X)&&(this.loadedmetadata||(this.nextLoadPosition=k),D.readyState&&(this.warn("Playback: "+B.toFixed(3)+" is located too far from the end of live sliding playlist: "+P+", reset currentTime to : "+k.toFixed(3)),D.currentTime=k))}},x.alignPlaylists=function(T,R){var D=this.levels,k=this.levelLastLoaded,B=this.fragPrevious,G=k!==null?D[k]:null,P=T.fragments.length;if(!P)return this.warn("No fragments in live playlist"),0;var $=T.fragments[0].start,X=!R,z=T.alignedSliding&&Object(_.isFiniteNumber)($);if(X||!z&&!$){Object(t.alignStream)(B,G,T);var N=T.fragments[0].start;return this.log("Live playlist sliding: "+N.toFixed(2)+" start-sn: "+(R?R.startSN:"na")+"->"+T.startSN+" prev-sn: "+(B?B.sn:"na")+" fragments: "+P),N}return $},x.waitForCdnTuneIn=function(T){var R=3;return T.live&&T.canBlockReload&&T.tuneInGoal>Math.max(T.partHoldBack,T.partTarget*R)},x.setStartPosition=function(T,R){var D=this.startPosition;if(D<R&&(D=-1),D===-1||this.lastCurrentTime===-1){var k=T.startTimeOffset;Object(_.isFiniteNumber)(k)?(D=R+k,k<0&&(D+=T.totalduration),D=Math.min(Math.max(R,D),R+T.totalduration),this.log("Start time offset "+k+" found in playlist, adjust startPosition to "+D),this.startPosition=D):T.live?D=this.hls.liveSyncPosition||R:this.startPosition=D=0,this.lastCurrentTime=D}this.nextLoadPosition=D},x.getLoadPosition=function(){var T=this.media,R=0;return this.loadedmetadata&&T?R=T.currentTime:this.nextLoadPosition&&(R=this.nextLoadPosition),R},x.handleFragLoadAborted=function(T,R){this.transmuxer&&T.sn!=="initSegment"&&T.stats.aborted&&(this.warn("Fragment "+T.sn+(R?" part"+R.index:"")+" of level "+T.level+" was aborted"),this.resetFragmentLoading(T))},x.resetFragmentLoading=function(T){(!this.fragCurrent||!this.fragContextChanged(T))&&(this.state=m.IDLE)},x.onFragmentOrKeyLoadError=function(T,R){if(R.fatal)return;var D=R.frag;if(!D||D.type!==T)return;var k=this.fragCurrent;console.assert(k&&D.sn===k.sn&&D.level===k.level&&D.urlId===k.urlId,"Frag load error must match current frag to retry");var B=this.config;if(this.fragLoadError+1<=B.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(D.level))return;var G=Math.min(Math.pow(2,this.fragLoadError)*B.fragLoadingRetryDelay,B.fragLoadingMaxRetryTimeout);this.warn("Fragment "+D.sn+" of "+T+" "+D.level+" failed to load, retrying in "+G+"ms"),this.retryDate=self.performance.now()+G,this.fragLoadError++,this.state=m.FRAG_LOADING_WAITING_RETRY}else R.levelRetry?(T===l.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=m.IDLE):(w.logger.error(R.details+" reaches max retry, redispatch as fatal ..."),R.fatal=!0,this.hls.stopLoad(),this.state=m.ERROR)},x.afterBufferFlushed=function(T,R,D){if(!T)return;var k=A.BufferHelper.getBuffered(T);this.fragmentTracker.detectEvictedFragments(R,k,D),this.state===m.ENDED&&this.resetLoadingState()},x.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=m.IDLE},x.resetLiveStartWhenNotLoaded=function(T){if(!this.loadedmetadata){this.startFragRequested=!1;var R=this.levels?this.levels[T].details:null;if(R!=null&&R.live)return this.startPosition=-1,this.setStartPosition(R,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},x.updateLevelTiming=function(T,R,D,k){var B=this,G=D.details;console.assert(!!G,"level.details must be defined");var P=Object.keys(T.elementaryStreams).reduce(function($,X){var z=T.elementaryStreams[X];if(z){var N=z.endPTS-z.startPTS;if(N<=0)return B.warn("Could not parse fragment "+T.sn+" "+X+" duration reliably ("+N+") resetting transmuxer to fallback to playlist timing"),B.resetTransmuxer(),$||!1;var H=k?0:Object(s.updateFragPTSDTS)(G,T,z.startPTS,z.endPTS,z.startDTS,z.endDTS);return B.hls.trigger(v.Events.LEVEL_PTS_UPDATED,{details:G,level:D,drift:H,type:X,frag:T,start:z.startPTS,end:z.endPTS}),!0}return $},!1);P?(this.state=m.PARSED,this.hls.trigger(v.Events.FRAG_PARSED,{frag:T,part:R})):this.resetLoadingState()},x.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},d(r,[{key:"state",get:function(){return this._state},set:function(T){var R=this._state;R!==T&&(this._state=T,this.log(R+"->"+T))}}]),r}(L.default)},"./src/controller/buffer-controller.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"default",function(){return i});var _=U("./src/polyfills/number.ts"),L=U("./src/events.ts"),E=U("./src/utils/logger.ts"),A=U("./src/errors.ts"),w=U("./src/utils/buffer-helper.ts"),v=U("./src/utils/mediasource-helper.ts"),u=U("./src/loader/fragment.ts"),f=U("./src/controller/buffer-operation-queue.ts"),o=Object(v.getMediaSource)(),t=/([ha]vc.)(?:\.[^.,]+)+/,i=function(){function s(a){var e=this;this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=function(){var l=e.hls,n=e.media,d=e.mediaSource;E.logger.log("[buffer-controller]: Media source opened"),n&&(e.updateMediaElementDuration(),l.trigger(L.Events.MEDIA_ATTACHED,{media:n})),d&&d.removeEventListener("sourceopen",e._onMediaSourceOpen),e.checkPendingTracks()},this._onMediaSourceClose=function(){E.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){E.logger.log("[buffer-controller]: Media source ended")},this.hls=a,this._initSourceBuffer(),this.registerListeners()}var h=s.prototype;return h.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},h.destroy=function(){this.unregisterListeners(),this.details=null},h.registerListeners=function(){var e=this.hls;e.on(L.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(L.Events.MANIFEST_PARSED,this.onManifestParsed,this),e.on(L.Events.BUFFER_RESET,this.onBufferReset,this),e.on(L.Events.BUFFER_APPENDING,this.onBufferAppending,this),e.on(L.Events.BUFFER_CODECS,this.onBufferCodecs,this),e.on(L.Events.BUFFER_EOS,this.onBufferEos,this),e.on(L.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(L.Events.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(L.Events.FRAG_PARSED,this.onFragParsed,this),e.on(L.Events.FRAG_CHANGED,this.onFragChanged,this)},h.unregisterListeners=function(){var e=this.hls;e.off(L.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(L.Events.MANIFEST_PARSED,this.onManifestParsed,this),e.off(L.Events.BUFFER_RESET,this.onBufferReset,this),e.off(L.Events.BUFFER_APPENDING,this.onBufferAppending,this),e.off(L.Events.BUFFER_CODECS,this.onBufferCodecs,this),e.off(L.Events.BUFFER_EOS,this.onBufferEos,this),e.off(L.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(L.Events.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(L.Events.FRAG_PARSED,this.onFragParsed,this),e.off(L.Events.FRAG_CHANGED,this.onFragChanged,this)},h._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new f.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},h.onManifestParsed=function(e,l){var n=2;(l.audio&&!l.video||!l.altAudio)&&(n=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=n,this.details=null,E.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},h.onMediaAttaching=function(e,l){var n=this.media=l.media;if(n&&o){var d=this.mediaSource=new o;d.addEventListener("sourceopen",this._onMediaSourceOpen),d.addEventListener("sourceended",this._onMediaSourceEnded),d.addEventListener("sourceclose",this._onMediaSourceClose),n.src=self.URL.createObjectURL(d),this._objectUrl=n.src}},h.onMediaDetaching=function(){var e=this.media,l=this.mediaSource,n=this._objectUrl;if(l){if(E.logger.log("[buffer-controller]: media source detaching"),l.readyState==="open")try{l.endOfStream()}catch(d){E.logger.warn("[buffer-controller]: onMediaDetaching: "+d.message+" while calling endOfStream")}this.onBufferReset(),l.removeEventListener("sourceopen",this._onMediaSourceOpen),l.removeEventListener("sourceended",this._onMediaSourceEnded),l.removeEventListener("sourceclose",this._onMediaSourceClose),e&&(n&&self.URL.revokeObjectURL(n),e.src===n?(e.removeAttribute("src"),e.load()):E.logger.warn("[buffer-controller]: media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(L.Events.MEDIA_DETACHED,void 0)},h.onBufferReset=function(){var e=this;this.getSourceBufferTypes().forEach(function(l){var n=e.sourceBuffer[l];try{n&&(e.removeBufferListeners(l),e.mediaSource&&e.mediaSource.removeSourceBuffer(n),e.sourceBuffer[l]=void 0)}catch(d){E.logger.warn("[buffer-controller]: Failed to reset the "+l+" buffer",d)}}),this._initSourceBuffer()},h.onBufferCodecs=function(e,l){var n=this,d=this.getSourceBufferTypes().length;if(Object.keys(l).forEach(function(c){if(d){var g=n.tracks[c];if(g&&typeof g.buffer.changeType=="function"){var p=l[c],m=p.codec,b=p.levelCodec,y=p.container,r=(g.levelCodec||g.codec).replace(t,"$1"),x=(b||m).replace(t,"$1");if(r!==x){var S=y+";codecs="+(b||m);n.appendChangeType(c,S)}}}else n.pendingTracks[c]=l[c]}),d)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},h.appendChangeType=function(e,l){var n=this,d=this.operationQueue,c={execute:function(){var p=n.sourceBuffer[e];p&&(E.logger.log("[buffer-controller]: changing "+e+" sourceBuffer type to "+l),p.changeType(l)),d.shiftAndExecuteNext(e)},onStart:function(){},onComplete:function(){},onError:function(p){E.logger.warn("[buffer-controller]: Failed to change "+e+" SourceBuffer type",p)}};d.append(c,e)},h.onBufferAppending=function(e,l){var n=this,d=this.hls,c=this.operationQueue,g=this.tracks,p=l.data,m=l.type,b=l.frag,y=l.part,r=l.chunkMeta,x=r.buffering[m],S=self.performance.now();x.start=S;var T=b.stats.buffering,R=y?y.stats.buffering:null;T.start===0&&(T.start=S),R&&R.start===0&&(R.start=S);var D=g.audio,k=m==="audio"&&r.id===1&&(D==null?void 0:D.container)==="audio/mpeg",B={execute:function(){if(x.executeStart=self.performance.now(),k){var P=n.sourceBuffer[m];if(P){var $=b.start-P.timestampOffset;Math.abs($)>=.1&&(E.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+b.start+" (delta: "+$+") sn: "+b.sn+")"),P.timestampOffset=b.start)}}n.appendExecutor(p,m)},onStart:function(){},onComplete:function(){var P=self.performance.now();x.executeEnd=x.end=P,T.first===0&&(T.first=P),R&&R.first===0&&(R.first=P);var $=n.sourceBuffer,X={};for(var z in $)X[z]=w.BufferHelper.getBuffered($[z]);n.appendError=0,n.hls.trigger(L.Events.BUFFER_APPENDED,{type:m,frag:b,part:y,chunkMeta:r,parent:b.type,timeRanges:X})},onError:function(P){E.logger.error("[buffer-controller]: Error encountered while trying to append to the "+m+" SourceBuffer",P);var $={type:A.ErrorTypes.MEDIA_ERROR,parent:b.type,details:A.ErrorDetails.BUFFER_APPEND_ERROR,err:P,fatal:!1};P.code===DOMException.QUOTA_EXCEEDED_ERR?$.details=A.ErrorDetails.BUFFER_FULL_ERROR:(n.appendError++,$.details=A.ErrorDetails.BUFFER_APPEND_ERROR,n.appendError>d.config.appendErrorMaxRetry&&(E.logger.error("[buffer-controller]: Failed "+d.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),$.fatal=!0)),d.trigger(L.Events.ERROR,$)}};c.append(B,m)},h.onBufferFlushing=function(e,l){var n=this,d=this.operationQueue,c=function(p){return{execute:n.removeExecutor.bind(n,p,l.startOffset,l.endOffset),onStart:function(){},onComplete:function(){n.hls.trigger(L.Events.BUFFER_FLUSHED,{type:p})},onError:function(b){E.logger.warn("[buffer-controller]: Failed to remove from "+p+" SourceBuffer",b)}}};l.type?d.append(c(l.type),l.type):this.getSourceBufferTypes().forEach(function(g){d.append(c(g),g)})},h.onFragParsed=function(e,l){var n=this,d=l.frag,c=l.part,g=[],p=c?c.elementaryStreams:d.elementaryStreams;p[u.ElementaryStreamTypes.AUDIOVIDEO]?g.push("audiovideo"):(p[u.ElementaryStreamTypes.AUDIO]&&g.push("audio"),p[u.ElementaryStreamTypes.VIDEO]&&g.push("video"));var m=function(){var y=self.performance.now();d.stats.buffering.end=y,c&&(c.stats.buffering.end=y);var r=c?c.stats:d.stats;n.hls.trigger(L.Events.FRAG_BUFFERED,{frag:d,part:c,stats:r,id:d.type})};g.length===0&&E.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+d.type+" level: "+d.level+" sn: "+d.sn),this.blockBuffers(m,g)},h.onFragChanged=function(e,l){this.flushBackBuffer()},h.onBufferEos=function(e,l){var n=this,d=this.getSourceBufferTypes().reduce(function(c,g){var p=n.sourceBuffer[g];return(!l.type||l.type===g)&&(p&&!p.ended&&(p.ended=!0,E.logger.log("[buffer-controller]: "+g+" sourceBuffer now EOS"))),c&&!!(!p||p.ended)},!0);d&&this.blockBuffers(function(){var c=n.mediaSource;if(!c||c.readyState!=="open")return;c.endOfStream()})},h.onLevelUpdated=function(e,l){var n=l.details;if(!n.fragments.length)return;this.details=n,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},h.flushBackBuffer=function(){var e=this.hls,l=this.details,n=this.media,d=this.sourceBuffer;if(!n||l===null)return;var c=this.getSourceBufferTypes();if(!c.length)return;var g=l.live&&e.config.liveBackBufferLength!==null?e.config.liveBackBufferLength:e.config.backBufferLength;if(!Object(_.isFiniteNumber)(g)||g<0)return;var p=n.currentTime,m=l.levelTargetDuration,b=Math.max(g,m),y=Math.floor(p/m)*m-b;c.forEach(function(r){var x=d[r];if(x){var S=w.BufferHelper.getBuffered(x);S.length>0&&y>S.start(0)&&(e.trigger(L.Events.BACK_BUFFER_REACHED,{bufferEnd:y}),l.live&&e.trigger(L.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:y}),e.trigger(L.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:y,type:r}))}})},h.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var e=this.details,l=this.hls,n=this.media,d=this.mediaSource,c=e.fragments[0].start+e.totalduration,g=n.duration,p=Object(_.isFiniteNumber)(d.duration)?d.duration:0;e.live&&l.config.liveDurationInfinity?(E.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),d.duration=Infinity,this.updateSeekableRange(e)):(c>p&&c>g||!Object(_.isFiniteNumber)(g))&&(E.logger.log("[buffer-controller]: Updating Media Source duration to "+c.toFixed(3)),d.duration=c)},h.updateSeekableRange=function(e){var l=this.mediaSource,n=e.fragments,d=n.length;if(d&&e.live&&l!==null&&l!==void 0&&l.setLiveSeekableRange){var c=Math.max(0,n[0].start),g=Math.max(c,c+e.totalduration);l.setLiveSeekableRange(c,g)}},h.checkPendingTracks=function(){var e=this.bufferCodecEventsExpected,l=this.operationQueue,n=this.pendingTracks,d=Object.keys(n).length;if(d&&!e||d===2){this.createSourceBuffers(n),this.pendingTracks={};var c=this.getSourceBufferTypes();if(c.length===0){this.hls.trigger(L.Events.ERROR,{type:A.ErrorTypes.MEDIA_ERROR,details:A.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}c.forEach(function(g){l.executeNext(g)})}},h.createSourceBuffers=function(e){var l=this.sourceBuffer,n=this.mediaSource;if(!n)throw Error("createSourceBuffers called when mediaSource was null");var d=0;for(var c in e)if(!l[c]){var g=e[c];if(!g)throw Error("source buffer exists for track "+c+", however track does not");var p=g.levelCodec||g.codec,m=g.container+";codecs="+p;E.logger.log("[buffer-controller]: creating sourceBuffer("+m+")");try{var b=l[c]=n.addSourceBuffer(m),y=c;this.addBufferListener(y,"updatestart",this._onSBUpdateStart),this.addBufferListener(y,"updateend",this._onSBUpdateEnd),this.addBufferListener(y,"error",this._onSBUpdateError),this.tracks[c]={buffer:b,codec:p,container:g.container,levelCodec:g.levelCodec,id:g.id},d++}catch(r){E.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+r.message),this.hls.trigger(L.Events.ERROR,{type:A.ErrorTypes.MEDIA_ERROR,details:A.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:r,mimeType:m})}}d&&this.hls.trigger(L.Events.BUFFER_CREATED,{tracks:this.tracks})},h._onSBUpdateStart=function(e){var l=this.operationQueue,n=l.current(e);n.onStart()},h._onSBUpdateEnd=function(e){var l=this.operationQueue,n=l.current(e);n.onComplete(),l.shiftAndExecuteNext(e)},h._onSBUpdateError=function(e,l){E.logger.error("[buffer-controller]: "+e+" SourceBuffer error",l),this.hls.trigger(L.Events.ERROR,{type:A.ErrorTypes.MEDIA_ERROR,details:A.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var n=this.operationQueue.current(e);n&&n.onError(l)},h.removeExecutor=function(e,l,n){var d=this.media,c=this.mediaSource,g=this.operationQueue,p=this.sourceBuffer,m=p[e];if(!d||!c||!m){E.logger.warn("[buffer-controller]: Attempting to remove from the "+e+" SourceBuffer, but it does not exist"),g.shiftAndExecuteNext(e);return}var b=Object(_.isFiniteNumber)(d.duration)?d.duration:Infinity,y=Object(_.isFiniteNumber)(c.duration)?c.duration:Infinity,r=Math.max(0,l),x=Math.min(n,b,y);x>r?(E.logger.log("[buffer-controller]: Removing ["+r+","+x+"] from the "+e+" SourceBuffer"),console.assert(!m.updating,e+" sourceBuffer must not be updating"),m.remove(r,x)):g.shiftAndExecuteNext(e)},h.appendExecutor=function(e,l){var n=this.operationQueue,d=this.sourceBuffer,c=d[l];if(!c){E.logger.warn("[buffer-controller]: Attempting to append to the "+l+" SourceBuffer, but it does not exist"),n.shiftAndExecuteNext(l);return}c.ended=!1,console.assert(!c.updating,l+" sourceBuffer must not be updating"),c.appendBuffer(e)},h.blockBuffers=function(e,l){var n=this;if(l===void 0&&(l=this.getSourceBufferTypes()),!l.length){E.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(e);return}var d=this.operationQueue,c=l.map(function(g){return d.appendBlocker(g)});Promise.all(c).then(function(){e(),l.forEach(function(g){var p=n.sourceBuffer[g];(!p||!p.updating)&&d.shiftAndExecuteNext(g)})})},h.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},h.addBufferListener=function(e,l,n){var d=this.sourceBuffer[e];if(!d)return;var c=n.bind(this,e);this.listeners[e].push({event:l,listener:c}),d.addEventListener(l,c)},h.removeBufferListeners=function(e){var l=this.sourceBuffer[e];if(!l)return;this.listeners[e].forEach(function(n){l.removeEventListener(n.event,n.listener)})},s}()},"./src/controller/buffer-operation-queue.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"default",function(){return L});var _=U("./src/utils/logger.ts"),L=function(){function E(w){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=w}var A=E.prototype;return A.append=function(v,u){var f=this.queues[u];f.push(v),f.length===1&&this.buffers[u]&&this.executeNext(u)},A.insertAbort=function(v,u){var f=this.queues[u];f.unshift(v),this.executeNext(u)},A.appendBlocker=function(v){var u,f=new Promise(function(t){u=t}),o={execute:u,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(o,v),f},A.executeNext=function(v){var u=this.buffers,f=this.queues,o=u[v],t=f[v];if(t.length){var i=t[0];try{i.execute()}catch(s){_.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),i.onError(s),(!o||!o.updating)&&(t.shift(),this.executeNext(v))}}},A.shiftAndExecuteNext=function(v){this.queues[v].shift(),this.executeNext(v)},A.current=function(v){return this.queues[v][0]},E}()},"./src/controller/cap-level-controller.ts":function(Se,Z,U){"use strict";U.r(Z);var _=U("./src/events.ts");function L(w,v){for(var u=0;u<v.length;u++){var f=v[u];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(w,f.key,f)}}function E(w,v,u){return v&&L(w.prototype,v),u&&L(w,u),w}var A=function(){function w(u){this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.hls=void 0,this.streamController=void 0,this.clientRect=void 0,this.hls=u,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var v=w.prototype;return v.setStreamController=function(f){this.streamController=f},v.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},v.registerListeners=function(){var f=this.hls;f.on(_.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),f.on(_.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),f.on(_.Events.MANIFEST_PARSED,this.onManifestParsed,this),f.on(_.Events.BUFFER_CODECS,this.onBufferCodecs,this),f.on(_.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},v.unregisterListener=function(){var f=this.hls;f.off(_.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),f.off(_.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),f.off(_.Events.MANIFEST_PARSED,this.onManifestParsed,this),f.off(_.Events.BUFFER_CODECS,this.onBufferCodecs,this),f.off(_.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},v.onFpsDropLevelCapping=function(f,o){w.isLevelAllowed(o.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(o.droppedLevel)},v.onMediaAttaching=function(f,o){this.media=o.media instanceof HTMLVideoElement?o.media:null},v.onManifestParsed=function(f,o){var t=this.hls;this.restrictedLevels=[],this.firstLevel=o.firstLevel,t.config.capLevelToPlayerSize&&o.video&&this.startCapping()},v.onBufferCodecs=function(f,o){var t=this.hls;t.config.capLevelToPlayerSize&&o.video&&this.startCapping()},v.onMediaDetaching=function(){this.stopCapping()},v.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var f=this.hls.levels;if(f.length){var o=this.hls;o.autoLevelCapping=this.getMaxLevel(f.length-1),o.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=o.autoLevelCapping}}},v.getMaxLevel=function(f){var o=this,t=this.hls.levels;if(!t.length)return-1;var i=t.filter(function(s,h){return w.isLevelAllowed(h,o.restrictedLevels)&&h<=f});return this.clientRect=null,w.getMaxLevelByMediaSize(i,this.mediaWidth,this.mediaHeight)},v.startCapping=function(){if(this.timer)return;this.autoLevelCapping=Number.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize()},v.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},v.getDimensions=function(){if(this.clientRect)return this.clientRect;var f=this.media,o={width:0,height:0};if(f){var t=f.getBoundingClientRect();o.width=t.width,o.height=t.height,!o.width&&!o.height&&(o.width=t.right-t.left||f.width||0,o.height=t.bottom-t.top||f.height||0)}return this.clientRect=o,o},w.isLevelAllowed=function(f,o){return o===void 0&&(o=[]),o.indexOf(f)===-1},w.getMaxLevelByMediaSize=function(f,o,t){if(!f||!f.length)return-1;for(var i=function(l,n){return n?l.width!==n.width||l.height!==n.height:!0},s=f.length-1,h=0;h<f.length;h+=1){var a=f[h];if((a.width>=o||a.height>=t)&&i(a,f[h+1])){s=h;break}}return s},E(w,[{key:"mediaWidth",get:function(){return this.getDimensions().width*w.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*w.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var f=1;try{f=self.devicePixelRatio}catch(o){}return f}}]),w}();Z.default=A},"./src/controller/cmcd-controller.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"default",function(){return i});var _=U("./src/events.ts"),L=U("./src/types/cmcd.ts"),E=U("./src/utils/buffer-helper.ts"),A=U("./src/utils/logger.ts");function w(s,h){for(var a=0;a<h.length;a++){var e=h[a];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(s,e.key,e)}}function v(s,h,a){return h&&w(s.prototype,h),a&&w(s,a),s}function u(s,h){var a=typeof Symbol!="undefined"&&s[Symbol.iterator]||s["@@iterator"];if(a)return(a=a.call(s)).next.bind(a);if(Array.isArray(s)||(a=f(s))||h&&s&&typeof s.length=="number"){a&&(s=a);var e=0;return function(){return e>=s.length?{done:!0}:{done:!1,value:s[e++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function f(s,h){if(!s)return;if(typeof s=="string")return o(s,h);var a=Object.prototype.toString.call(s).slice(8,-1);if(a==="Object"&&s.constructor&&(a=s.constructor.name),a==="Map"||a==="Set")return Array.from(s);if(a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return o(s,h)}function o(s,h){(h==null||h>s.length)&&(h=s.length);for(var a=0,e=new Array(h);a<h;a++)e[a]=s[a];return e}function t(){return t=Object.assign||function(s){for(var h=1;h<arguments.length;h++){var a=arguments[h];for(var e in a)Object.prototype.hasOwnProperty.call(a,e)&&(s[e]=a[e])}return s},t.apply(this,arguments)}var i=function(){function s(a){var e=this;this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=function(){e.initialized&&(e.starved=!0),e.buffering=!0},this.onPlaying=function(){e.initialized||(e.initialized=!0),e.buffering=!1},this.applyPlaylistData=function(d){try{e.apply(d,{ot:L.CMCDObjectType.MANIFEST,su:!e.initialized})}catch(c){A.logger.warn("Could not generate manifest CMCD data.",c)}},this.applyFragmentData=function(d){try{var c=d.frag,g=e.hls.levels[c.level],p=e.getObjectType(c),m={d:c.duration*1e3,ot:p};(p===L.CMCDObjectType.VIDEO||p===L.CMCDObjectType.AUDIO||p==L.CMCDObjectType.MUXED)&&(m.br=g.bitrate/1e3,m.tb=e.getTopBandwidth(p),m.bl=e.getBufferLength(p)),e.apply(d,m)}catch(b){A.logger.warn("Could not generate segment CMCD data.",b)}},this.hls=a;var l=this.config=a.config,n=l.cmcd;n!=null&&(l.pLoader=this.createPlaylistLoader(),l.fLoader=this.createFragmentLoader(),this.sid=n.sessionId||s.uuid(),this.cid=n.contentId,this.useHeaders=n.useHeaders===!0,this.registerListeners())}var h=s.prototype;return h.registerListeners=function(){var e=this.hls;e.on(_.Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(_.Events.MEDIA_DETACHED,this.onMediaDetached,this),e.on(_.Events.BUFFER_CREATED,this.onBufferCreated,this)},h.unregisterListeners=function(){var e=this.hls;e.off(_.Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(_.Events.MEDIA_DETACHED,this.onMediaDetached,this),e.off(_.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},h.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},h.onMediaAttached=function(e,l){this.media=l.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},h.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},h.onBufferCreated=function(e,l){var n,d;this.audioBuffer=(n=l.tracks.audio)===null||n===void 0?void 0:n.buffer,this.videoBuffer=(d=l.tracks.video)===null||d===void 0?void 0:d.buffer},h.createData=function(){var e;return{v:L.CMCDVersion,sf:L.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(e=this.media)===null||e===void 0?void 0:e.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},h.apply=function(e,l){l===void 0&&(l={}),t(l,this.createData());var n=l.ot===L.CMCDObjectType.INIT||l.ot===L.CMCDObjectType.VIDEO||l.ot===L.CMCDObjectType.MUXED;if(this.starved&&n&&(l.bs=!0,l.su=!0,this.starved=!1),l.su==null&&(l.su=this.buffering),this.useHeaders){var d=s.toHeaders(l);if(!Object.keys(d).length)return;e.headers||(e.headers={}),t(e.headers,d)}else{var c=s.toQuery(l);if(!c)return;e.url=s.appendQueryToUri(e.url,c)}},h.getObjectType=function(e){var l=e.type;return l==="subtitle"?L.CMCDObjectType.TIMED_TEXT:e.sn==="initSegment"?L.CMCDObjectType.INIT:l==="audio"?L.CMCDObjectType.AUDIO:l==="main"?this.hls.audioTracks.length?L.CMCDObjectType.VIDEO:L.CMCDObjectType.MUXED:void 0},h.getTopBandwidth=function(e){for(var l=0,n=e===L.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,d=u(n),c;!(c=d()).done;){var g=c.value;g.bitrate>l&&(l=g.bitrate)}return l>0?l:NaN},h.getBufferLength=function(e){var l=this.hls.media,n=e===L.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!n||!l)return NaN;var d=E.BufferHelper.bufferInfo(n,l.currentTime,this.config.maxBufferHole);return d.len*1e3},h.createPlaylistLoader=function(){var e=this.config.pLoader,l=this.applyPlaylistData,n=e||this.config.loader;return function(){function d(g){this.loader=void 0,this.loader=new n(g)}var c=d.prototype;return c.destroy=function(){this.loader.destroy()},c.abort=function(){this.loader.abort()},c.load=function(p,m,b){l(p),this.loader.load(p,m,b)},v(d,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),d}()},h.createFragmentLoader=function(){var e=this.config.fLoader,l=this.applyFragmentData,n=e||this.config.loader;return function(){function d(g){this.loader=void 0,this.loader=new n(g)}var c=d.prototype;return c.destroy=function(){this.loader.destroy()},c.abort=function(){this.loader.abort()},c.load=function(p,m,b){l(p),this.loader.load(p,m,b)},v(d,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),d}()},s.uuid=function(){var e=URL.createObjectURL(new Blob),l=e.toString();return URL.revokeObjectURL(e),l.substr(l.lastIndexOf("/")+1)},s.serialize=function(e){for(var l=[],n=function(k){return!Number.isNaN(k)&&k!=null&&k!==""&&k!==!1},d=function(k){return Math.round(k)},c=function(k){return d(k/100)*100},g=function(k){return encodeURIComponent(k)},p={br:d,d,bl:c,dl:c,mtp:c,nor:g,rtp:c,tb:d},m=Object.keys(e||{}).sort(),b=u(m),y;!(y=b()).done;){var r=y.value,x=e[r];if(!n(x))continue;if(r==="v"&&x===1)continue;if(r=="pr"&&x===1)continue;var S=p[r];S&&(x=S(x));var T=typeof x,R=void 0;r==="ot"||r==="sf"||r==="st"?R=r+"="+x:T==="boolean"?R=r:T==="number"?R=r+"="+x:R=r+"="+JSON.stringify(x),l.push(R)}return l.join(",")},s.toHeaders=function(e){for(var l=Object.keys(e),n={},d=["Object","Request","Session","Status"],c=[{},{},{},{}],g={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3},p=0,m=l;p<m.length;p++){var b=m[p],y=g[b]!=null?g[b]:1;c[y][b]=e[b]}for(var r=0;r<c.length;r++){var x=s.serialize(c[r]);x&&(n["CMCD-"+d[r]]=x)}return n},s.toQuery=function(e){return"CMCD="+encodeURIComponent(s.serialize(e))},s.appendQueryToUri=function(e,l){if(!l)return e;var n=e.includes("?")?"&":"?";return""+e+n+l},s}()},"./src/controller/eme-controller.ts":function(Se,Z,U){"use strict";U.r(Z);var _=U("./src/events.ts"),L=U("./src/errors.ts"),E=U("./src/utils/logger.ts"),A=U("./src/utils/mediakeys-helper.ts");function w(i,s){for(var h=0;h<s.length;h++){var a=s[h];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(i,a.key,a)}}function v(i,s,h){return s&&w(i.prototype,s),h&&w(i,h),i}var u=3,f=function(s,h,a){var e={audioCapabilities:[],videoCapabilities:[]};return s.forEach(function(l){e.audioCapabilities.push({contentType:'audio/mp4; codecs="'+l+'"',robustness:a.audioRobustness||""})}),h.forEach(function(l){e.videoCapabilities.push({contentType:'video/mp4; codecs="'+l+'"',robustness:a.videoRobustness||""})}),[e]},o=function(s,h,a,e){switch(s){case A.KeySystems.WIDEVINE:return f(h,a,e);default:throw new Error("Unknown key-system: "+s)}},t=function(){function i(h){this.hls=void 0,this._widevineLicenseUrl=void 0,this._licenseXhrSetup=void 0,this._licenseResponseCallback=void 0,this._emeEnabled=void 0,this._requestMediaKeySystemAccess=void 0,this._drmSystemOptions=void 0,this._config=void 0,this._mediaKeysList=[],this._media=null,this._hasSetMediaKeys=!1,this._requestLicenseFailureCount=0,this.mediaKeysPromise=null,this._onMediaEncrypted=this.onMediaEncrypted.bind(this),this.hls=h,this._config=h.config,this._widevineLicenseUrl=this._config.widevineLicenseUrl,this._licenseXhrSetup=this._config.licenseXhrSetup,this._licenseResponseCallback=this._config.licenseResponseCallback,this._emeEnabled=this._config.emeEnabled,this._requestMediaKeySystemAccess=this._config.requestMediaKeySystemAccessFunc,this._drmSystemOptions=this._config.drmSystemOptions,this._registerListeners()}var s=i.prototype;return s.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},s._registerListeners=function(){this.hls.on(_.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(_.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(_.Events.MANIFEST_PARSED,this.onManifestParsed,this)},s._unregisterListeners=function(){this.hls.off(_.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(_.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(_.Events.MANIFEST_PARSED,this.onManifestParsed,this)},s.getLicenseServerUrl=function(a){switch(a){case A.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+a+'"')},s._attemptKeySystemAccess=function(a,e,l){var n=this,d=o(a,e,l,this._drmSystemOptions);E.logger.log("Requesting encrypted media key-system access");var c=this.requestMediaKeySystemAccess(a,d);this.mediaKeysPromise=c.then(function(g){return n._onMediaKeySystemAccessObtained(a,g)}),c.catch(function(g){E.logger.error('Failed to obtain key-system "'+a+'" access:',g)})},s._onMediaKeySystemAccessObtained=function(a,e){var l=this;E.logger.log('Access for key-system "'+a+'" obtained');var n={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:e,mediaKeySystemDomain:a};this._mediaKeysList.push(n);var d=Promise.resolve().then(function(){return e.createMediaKeys()}).then(function(c){return n.mediaKeys=c,E.logger.log('Media-keys created for key-system "'+a+'"'),l._onMediaKeysCreated(),c});return d.catch(function(c){E.logger.error("Failed to create media-keys:",c)}),d},s._onMediaKeysCreated=function(){var a=this;this._mediaKeysList.forEach(function(e){e.mediaKeysSession||(e.mediaKeysSession=e.mediaKeys.createSession(),a._onNewMediaKeySession(e.mediaKeysSession))})},s._onNewMediaKeySession=function(a){var e=this;E.logger.log("New key-system session "+a.sessionId),a.addEventListener("message",function(l){e._onKeySessionMessage(a,l.message)},!1)},s._onKeySessionMessage=function(a,e){E.logger.log("Got EME message event, creating license request"),this._requestLicense(e,function(l){E.logger.log("Received license data (length: "+(l&&l.byteLength)+"), updating key-session"),a.update(l)})},s.onMediaEncrypted=function(a){var e=this;if(E.logger.log('Media is encrypted using "'+a.initDataType+'" init data type'),!this.mediaKeysPromise){E.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(_.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var l=function(d){if(!e._media)return;e._attemptSetMediaKeys(d),e._generateRequestWithPreferredKeySession(a.initDataType,a.initData)};this.mediaKeysPromise.then(l).catch(l)},s._attemptSetMediaKeys=function(a){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var e=this._mediaKeysList[0];if(!e||!e.mediaKeys){E.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(_.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}E.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(e.mediaKeys),this._hasSetMediaKeys=!0}},s._generateRequestWithPreferredKeySession=function(a,e){var l=this,n=this._mediaKeysList[0];if(!n){E.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(_.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(n.mediaKeysSessionInitialized){E.logger.warn("Key-Session already initialized but requested again");return}var d=n.mediaKeysSession;if(!d){E.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(_.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!e){E.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(_.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}E.logger.log('Generating key-session request for "'+a+'" init data type'),n.mediaKeysSessionInitialized=!0,d.generateRequest(a,e).then(function(){E.logger.debug("Key-session generation succeeded")}).catch(function(c){E.logger.error("Error generating key-session request:",c),l.hls.trigger(_.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},s._createLicenseXhr=function(a,e,l){var n=new XMLHttpRequest;n.responseType="arraybuffer",n.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,n,a,e,l);var d=this._licenseXhrSetup;if(d)try{d.call(this.hls,n,a),d=void 0}catch(c){E.logger.error(c)}try{n.readyState||n.open("POST",a,!0),d&&d.call(this.hls,n,a)}catch(c){throw new Error("issue setting up KeySystem license XHR "+c)}return n},s._onLicenseRequestReadyStageChange=function(a,e,l,n){switch(a.readyState){case 4:if(a.status===200){this._requestLicenseFailureCount=0,E.logger.log("License request succeeded");var d=a.response,c=this._licenseResponseCallback;if(c)try{d=c.call(this.hls,a,e)}catch(p){E.logger.error(p)}n(d)}else{if(E.logger.error("License Request XHR failed ("+e+"). Status: "+a.status+" ("+a.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>u){this.hls.trigger(_.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var g=u-this._requestLicenseFailureCount+1;E.logger.warn("Retrying license request, "+g+" attempts left"),this._requestLicense(l,n)}break}},s._generateLicenseRequestChallenge=function(a,e){switch(a.mediaKeySystemDomain){case A.KeySystems.WIDEVINE:return e}throw new Error("unsupported key-system: "+a.mediaKeySystemDomain)},s._requestLicense=function(a,e){E.logger.log("Requesting content license for key-system");var l=this._mediaKeysList[0];if(!l){E.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(_.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var n=this.getLicenseServerUrl(l.mediaKeySystemDomain),d=this._createLicenseXhr(n,a,e);E.logger.log("Sending license request to URL: "+n);var c=this._generateLicenseRequestChallenge(l,a);d.send(c)}catch(g){E.logger.error("Failure requesting DRM license: "+g),this.hls.trigger(_.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},s.onMediaAttached=function(a,e){if(!this._emeEnabled)return;var l=e.media;this._media=l,l.addEventListener("encrypted",this._onMediaEncrypted)},s.onMediaDetached=function(){var a=this._media,e=this._mediaKeysList;if(!a)return;a.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(e.map(function(l){if(l.mediaKeysSession)return l.mediaKeysSession.close().catch(function(){})})).then(function(){return a.setMediaKeys(null)}).catch(function(){})},s.onManifestParsed=function(a,e){if(!this._emeEnabled)return;var l=e.levels.map(function(d){return d.audioCodec}).filter(function(d){return!!d}),n=e.levels.map(function(d){return d.videoCodec}).filter(function(d){return!!d});this._attemptKeySystemAccess(A.KeySystems.WIDEVINE,l,n)},v(i,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),i}();Z.default=t},"./src/controller/fps-controller.ts":function(Se,Z,U){"use strict";U.r(Z);var _=U("./src/events.ts"),L=U("./src/utils/logger.ts"),E=function(){function A(v){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=v,this.registerListeners()}var w=A.prototype;return w.setStreamController=function(u){this.streamController=u},w.registerListeners=function(){this.hls.on(_.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},w.unregisterListeners=function(){this.hls.off(_.Events.MEDIA_ATTACHING,this.onMediaAttaching)},w.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},w.onMediaAttaching=function(u,f){var o=this.hls.config;if(o.capLevelOnFPSDrop){var t=f.media instanceof self.HTMLVideoElement?f.media:null;this.media=t,t&&typeof t.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),o.fpsDroppedMonitoringPeriod)}},w.checkFPS=function(u,f,o){var t=performance.now();if(f){if(this.lastTime){var i=t-this.lastTime,s=o-this.lastDroppedFrames,h=f-this.lastDecodedFrames,a=1e3*s/i,e=this.hls;if(e.trigger(_.Events.FPS_DROP,{currentDropped:s,currentDecoded:h,totalDroppedFrames:o}),a>0&&s>e.config.fpsDroppedMonitoringThreshold*h){var l=e.currentLevel;L.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+l),l>0&&(e.autoLevelCapping===-1||e.autoLevelCapping>=l)&&(l=l-1,e.trigger(_.Events.FPS_DROP_LEVEL_CAPPING,{level:l,droppedLevel:e.currentLevel}),e.autoLevelCapping=l,this.streamController.nextLevelSwitch())}}this.lastTime=t,this.lastDroppedFrames=o,this.lastDecodedFrames=f}},w.checkFPSInterval=function(){var u=this.media;if(u)if(this.isVideoPlaybackQualityAvailable){var f=u.getVideoPlaybackQuality();this.checkFPS(u,f.totalVideoFrames,f.droppedVideoFrames)}else this.checkFPS(u,u.webkitDecodedFrameCount,u.webkitDroppedFrameCount)},A}();Z.default=E},"./src/controller/fragment-finders.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"findFragmentByPDT",function(){return E}),U.d(Z,"findFragmentByPTS",function(){return A}),U.d(Z,"fragmentWithinToleranceTest",function(){return w}),U.d(Z,"pdtWithinToleranceTest",function(){return v}),U.d(Z,"findFragWithCC",function(){return u});var _=U("./src/polyfills/number.ts"),L=U("./src/utils/binary-search.ts");function E(f,o,t){if(o===null||!Array.isArray(f)||!f.length||!Object(_.isFiniteNumber)(o))return null;var i=f[0].programDateTime;if(o<(i||0))return null;var s=f[f.length-1].endProgramDateTime;if(o>=(s||0))return null;t=t||0;for(var h=0;h<f.length;++h){var a=f[h];if(v(o,t,a))return a}return null}function A(f,o,t,i){t===void 0&&(t=0),i===void 0&&(i=0);var s=null;if(f?s=o[f.sn-o[0].sn+1]||null:t===0&&o[0].start===0&&(s=o[0]),s&&w(t,i,s)===0)return s;var h=L.default.search(o,w.bind(null,t,i));return h||s}function w(f,o,t){f===void 0&&(f=0),o===void 0&&(o=0);var i=Math.min(o,t.duration+(t.deltaPTS?t.deltaPTS:0));return t.start+t.duration-i<=f?1:t.start-i>f&&t.start?-1:0}function v(f,o,t){var i=Math.min(o,t.duration+(t.deltaPTS?t.deltaPTS:0))*1e3,s=t.endProgramDateTime||0;return s-i>f}function u(f,o){return L.default.search(f,function(t){return t.cc<o?1:t.cc>o?-1:0})}},"./src/controller/fragment-tracker.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"FragmentState",function(){return E}),U.d(Z,"FragmentTracker",function(){return A});var _=U("./src/events.ts"),L=U("./src/types/loader.ts"),E;(function(u){u.NOT_LOADED="NOT_LOADED",u.BACKTRACKED="BACKTRACKED",u.APPENDING="APPENDING",u.PARTIAL="PARTIAL",u.OK="OK"})(E||(E={}));var A=function(){function u(o){this.activeFragment=null,this.activeParts=null,this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hls=o,this._registerListeners()}var f=u.prototype;return f._registerListeners=function(){var t=this.hls;t.on(_.Events.BUFFER_APPENDED,this.onBufferAppended,this),t.on(_.Events.FRAG_BUFFERED,this.onFragBuffered,this),t.on(_.Events.FRAG_LOADED,this.onFragLoaded,this)},f._unregisterListeners=function(){var t=this.hls;t.off(_.Events.BUFFER_APPENDED,this.onBufferAppended,this),t.off(_.Events.FRAG_BUFFERED,this.onFragBuffered,this),t.off(_.Events.FRAG_LOADED,this.onFragLoaded,this)},f.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},f.getAppendedFrag=function(t,i){if(i===L.PlaylistLevelType.MAIN){var s=this.activeFragment,h=this.activeParts;if(!s)return null;if(h)for(var a=h.length;a--;){var e=h[a],l=e?e.end:s.appendedPTS;if(e.start<=t&&l!==void 0&&t<=l)return a>9&&(this.activeParts=h.slice(a-9)),e}else if(s.start<=t&&s.appendedPTS!==void 0&&t<=s.appendedPTS)return s}return this.getBufferedFrag(t,i)},f.getBufferedFrag=function(t,i){for(var s=this.fragments,h=Object.keys(s),a=h.length;a--;){var e=s[h[a]];if((e==null?void 0:e.body.type)===i&&e.buffered){var l=e.body;if(l.start<=t&&t<=l.end)return l}}return null},f.detectEvictedFragments=function(t,i,s){var h=this;Object.keys(this.fragments).forEach(function(a){var e=h.fragments[a];if(!e)return;if(!e.buffered){e.body.type===s&&h.removeFragment(e.body);return}var l=e.range[t];if(!l)return;l.time.some(function(n){var d=!h.isTimeBuffered(n.startPTS,n.endPTS,i);return d&&h.removeFragment(e.body),d})})},f.detectPartialFragments=function(t){var i=this,s=this.timeRanges,h=t.frag,a=t.part;if(!s||h.sn==="initSegment")return;var e=v(h),l=this.fragments[e];if(!l)return;Object.keys(s).forEach(function(n){var d=h.elementaryStreams[n];if(!d)return;var c=s[n],g=a!==null||d.partial===!0;l.range[n]=i.getBufferedTimes(h,a,g,c)}),l.backtrack=l.loaded=null,Object.keys(l.range).length?l.buffered=!0:this.removeFragment(l.body)},f.fragBuffered=function(t){var i=v(t),s=this.fragments[i];s&&(s.backtrack=s.loaded=null,s.buffered=!0)},f.getBufferedTimes=function(t,i,s,h){for(var a={time:[],partial:s},e=i?i.start:t.start,l=i?i.end:t.end,n=t.minEndPTS||l,d=t.maxStartPTS||e,c=0;c<h.length;c++){var g=h.start(c)-this.bufferPadding,p=h.end(c)+this.bufferPadding;if(d>=g&&n<=p){a.time.push({startPTS:Math.max(e,h.start(c)),endPTS:Math.min(l,h.end(c))});break}else if(e<p&&l>g)a.partial=!0,a.time.push({startPTS:Math.max(e,h.start(c)),endPTS:Math.min(l,h.end(c))});else if(l<=g)break}return a},f.getPartialFragment=function(t){var i=null,s,h,a,e=0,l=this.bufferPadding,n=this.fragments;return Object.keys(n).forEach(function(d){var c=n[d];if(!c)return;w(c)&&(h=c.body.start-l,a=c.body.end+l,t>=h&&t<=a&&(s=Math.min(t-h,a-t),e<=s&&(i=c.body,e=s)))}),i},f.getState=function(t){var i=v(t),s=this.fragments[i];return s?s.buffered?w(s)?E.PARTIAL:E.OK:s.backtrack?E.BACKTRACKED:E.APPENDING:E.NOT_LOADED},f.backtrack=function(t,i){var s=v(t),h=this.fragments[s];if(!h||h.backtrack)return null;var a=h.backtrack=i||h.loaded;return h.loaded=null,a},f.getBacktrackData=function(t){var i=v(t),s=this.fragments[i];if(s){var h,a=s.backtrack;if(a!=null&&(h=a.payload)!==null&&h!==void 0&&h.byteLength)return a;this.removeFragment(t)}return null},f.isTimeBuffered=function(t,i,s){for(var h,a,e=0;e<s.length;e++){if(h=s.start(e)-this.bufferPadding,a=s.end(e)+this.bufferPadding,t>=h&&i<=a)return!0;if(i<=h)return!1}return!1},f.onFragLoaded=function(t,i){var s=i.frag,h=i.part;if(s.sn==="initSegment"||s.bitrateTest||h)return;var a=v(s);this.fragments[a]={body:s,loaded:i,backtrack:null,buffered:!1,range:Object.create(null)}},f.onBufferAppended=function(t,i){var s=this,h=i.frag,a=i.part,e=i.timeRanges;if(h.type===L.PlaylistLevelType.MAIN)if(this.activeFragment=h,a){var l=this.activeParts;l||(this.activeParts=l=[]),l.push(a)}else this.activeParts=null;this.timeRanges=e,Object.keys(e).forEach(function(n){var d=e[n];if(s.detectEvictedFragments(n,d),!a)for(var c=0;c<d.length;c++)h.appendedPTS=Math.max(d.end(c),h.appendedPTS||0)})},f.onFragBuffered=function(t,i){this.detectPartialFragments(i)},f.hasFragment=function(t){var i=v(t);return!!this.fragments[i]},f.removeFragmentsInRange=function(t,i,s){var h=this;Object.keys(this.fragments).forEach(function(a){var e=h.fragments[a];if(!e)return;if(e.buffered){var l=e.body;l.type===s&&l.start<i&&l.end>t&&h.removeFragment(l)}})},f.removeFragment=function(t){var i=v(t);t.stats.loaded=0,t.clearElementaryStreamInfo(),delete this.fragments[i]},f.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},u}();function w(u){var f,o;return u.buffered&&(((f=u.range.video)===null||f===void 0?void 0:f.partial)||((o=u.range.audio)===null||o===void 0?void 0:o.partial))}function v(u){return u.type+"_"+u.level+"_"+u.urlId+"_"+u.sn}},"./src/controller/gap-controller.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"STALL_MINIMUM_DURATION_MS",function(){return w}),U.d(Z,"MAX_START_GAP_JUMP",function(){return v}),U.d(Z,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return u}),U.d(Z,"SKIP_BUFFER_RANGE_START",function(){return f}),U.d(Z,"default",function(){return o});var _=U("./src/utils/buffer-helper.ts"),L=U("./src/errors.ts"),E=U("./src/events.ts"),A=U("./src/utils/logger.ts"),w=250,v=2,u=.1,f=.05,o=function(){function t(s,h,a,e){this.config=void 0,this.media=void 0,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=s,this.media=h,this.fragmentTracker=a,this.hls=e}var i=t.prototype;return i.destroy=function(){this.hls=this.fragmentTracker=this.media=null},i.poll=function(h){var a=this.config,e=this.media,l=this.stalled,n=e.currentTime,d=e.seeking,c=this.seeking&&!d,g=!this.seeking&&d;if(this.seeking=d,n!==h){if(this.moved=!0,l!==null){if(this.stallReported){var p=self.performance.now()-l;A.logger.warn("playback not stuck anymore @"+n+", after "+Math.round(p)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((g||c)&&(this.stalled=null),e.paused||e.ended||e.playbackRate===0||!_.BufferHelper.getBuffered(e).length)return;var m=_.BufferHelper.bufferInfo(e,n,0),b=m.len>0,y=m.nextStart||0;if(!b&&!y)return;if(d){var r=m.len>v,x=!y||y-n>v&&!this.fragmentTracker.getPartialFragment(n);if(r||x)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var S,T=Math.max(y,m.start||0)-n,R=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,D=R==null||((S=R.details)===null||S===void 0)?void 0:S.live,k=D?R.details.targetduration*2:v;if(T>0&&T<=k){this._trySkipBufferHole(null);return}}var B=self.performance.now();if(l===null){this.stalled=B;return}var G=B-l;!d&&G>=w&&this._reportStall(m.len);var P=_.BufferHelper.bufferInfo(e,n,a.maxBufferHole);this._tryFixBufferStall(P,G)},i._tryFixBufferStall=function(h,a){var e=this.config,l=this.fragmentTracker,n=this.media,d=n.currentTime,c=l.getPartialFragment(d);if(c){var g=this._trySkipBufferHole(c);if(g)return}h.len>e.maxBufferHole&&a>e.highBufferWatchdogPeriod*1e3&&(A.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},i._reportStall=function(h){var a=this.hls,e=this.media,l=this.stallReported;l||(this.stallReported=!0,A.logger.warn("Playback stalling at @"+e.currentTime+" due to low buffer (buffer="+h+")"),a.trigger(E.Events.ERROR,{type:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:h}))},i._trySkipBufferHole=function(h){for(var a=this.config,e=this.hls,l=this.media,n=l.currentTime,d=0,c=_.BufferHelper.getBuffered(l),g=0;g<c.length;g++){var p=c.start(g);if(n+a.maxBufferHole>=d&&n<p){var m=Math.max(p+f,l.currentTime+u);return A.logger.warn("skipping hole, adjusting currentTime from "+n+" to "+m),this.moved=!0,this.stalled=null,l.currentTime=m,h&&e.trigger(E.Events.ERROR,{type:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+n+" to "+m,frag:h}),m}d=c.end(g)}return 0},i._tryNudgeBuffer=function(){var h=this.config,a=this.hls,e=this.media,l=e.currentTime,n=(this.nudgeRetry||0)+1;if(this.nudgeRetry=n,n<h.nudgeMaxRetry){var d=l+n*h.nudgeOffset;A.logger.warn("Nudging 'currentTime' from "+l+" to "+d),e.currentTime=d,a.trigger(E.Events.ERROR,{type:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else A.logger.error("Playhead still not moving while enough data buffered @"+l+" after "+h.nudgeMaxRetry+" nudges"),a.trigger(E.Events.ERROR,{type:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},t}()},"./src/controller/id3-track-controller.ts":function(Se,Z,U){"use strict";U.r(Z);var _=U("./src/events.ts"),L=U("./src/utils/texttrack-utils.ts"),E=U("./src/demux/id3.ts"),A=.25,w=function(){function v(f){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=f,this._registerListeners()}var u=v.prototype;return u.destroy=function(){this._unregisterListeners()},u._registerListeners=function(){var o=this.hls;o.on(_.Events.MEDIA_ATTACHED,this.onMediaAttached,this),o.on(_.Events.MEDIA_DETACHING,this.onMediaDetaching,this),o.on(_.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),o.on(_.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},u._unregisterListeners=function(){var o=this.hls;o.off(_.Events.MEDIA_ATTACHED,this.onMediaAttached,this),o.off(_.Events.MEDIA_DETACHING,this.onMediaDetaching,this),o.off(_.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),o.off(_.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},u.onMediaAttached=function(o,t){this.media=t.media},u.onMediaDetaching=function(){if(!this.id3Track)return;Object(L.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},u.getID3Track=function(o){if(!this.media)return;for(var t=0;t<o.length;t++){var i=o[t];if(i.kind==="metadata"&&i.label==="id3")return Object(L.sendAddTrackEvent)(i,this.media),i}return this.media.addTextTrack("metadata","id3")},u.onFragParsingMetadata=function(o,t){if(!this.media)return;var i=t.frag,s=t.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var h=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,a=0;a<s.length;a++){var e=E.getID3Frames(s[a].data);if(e){var l=s[a].pts,n=a<s.length-1?s[a+1].pts:i.end,d=n-l;d<=0&&(n=l+A);for(var c=0;c<e.length;c++){var g=e[c];if(!E.isTimeStampFrame(g)){var p=new h(l,n,"");p.value=g,this.id3Track.addCue(p)}}}}},u.onBufferFlushing=function(o,t){var i=t.startOffset,s=t.endOffset,h=t.type;if(!h||h==="audio"){var a=this.id3Track;a&&Object(L.removeCuesInRange)(a,i,s)}},v}();Z.default=w},"./src/controller/latency-controller.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"default",function(){return v});var _=U("./src/errors.ts"),L=U("./src/events.ts"),E=U("./src/utils/logger.ts");function A(u,f){for(var o=0;o<f.length;o++){var t=f[o];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(u,t.key,t)}}function w(u,f,o){return f&&A(u.prototype,f),o&&A(u,o),u}var v=function(){function u(o){var t=this;this.hls=void 0,this.config=void 0,this.media=null,this.levelDetails=null,this.currentTime=0,this.stallCount=0,this._latency=null,this.timeupdateHandler=function(){return t.timeupdate()},this.hls=o,this.config=o.config,this.registerListeners()}var f=u.prototype;return f.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},f.registerListeners=function(){this.hls.on(L.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(L.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(L.Events.ERROR,this.onError,this)},f.unregisterListeners=function(){this.hls.off(L.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(L.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(L.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(L.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(L.Events.ERROR,this.onError)},f.onMediaAttached=function(t,i){this.media=i.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},f.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},f.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},f.onLevelUpdated=function(t,i){var s=i.details;this.levelDetails=s,s.advanced&&this.timeupdate(),!s.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},f.onError=function(t,i){if(i.details!==_.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,E.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},f.timeupdate=function(){var t=this.media,i=this.levelDetails;if(!t||!i)return;this.currentTime=t.currentTime;var s=this.computeLatency();if(s===null)return;this._latency=s;var h=this.config,a=h.lowLatencyMode,e=h.maxLiveSyncPlaybackRate;if(!a||e===1)return;var l=this.targetLatency;if(l===null)return;var n=s-l,d=Math.min(this.maxLatency,l+i.targetduration),c=n<d;if(i.live&&c&&n>.05&&this.forwardBufferLength>1){var g=Math.min(2,Math.max(1,e)),p=Math.round(2/(1+Math.exp(-.75*n-this.edgeStalled))*20)/20;t.playbackRate=Math.min(g,Math.max(1,p))}else t.playbackRate!==1&&t.playbackRate!==0&&(t.playbackRate=1)},f.estimateLiveEdge=function(){var t=this.levelDetails;return t===null?null:t.edge+t.age},f.computeLatency=function(){var t=this.estimateLiveEdge();return t===null?null:t-this.currentTime},w(u,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var t=this.config,i=this.levelDetails;return t.liveMaxLatencyDuration!==void 0?t.liveMaxLatencyDuration:i?t.liveMaxLatencyDurationCount*i.targetduration:0}},{key:"targetLatency",get:function(){var t=this.levelDetails;if(t===null)return null;var i=t.holdBack,s=t.partHoldBack,h=t.targetduration,a=this.config,e=a.liveSyncDuration,l=a.liveSyncDurationCount,n=a.lowLatencyMode,d=this.hls.userConfig,c=n&&s||i;(d.liveSyncDuration||d.liveSyncDurationCount||c===0)&&(c=e!==void 0?e:l*h);var g=h,p=1;return c+Math.min(this.stallCount*p,g)}},{key:"liveSyncPosition",get:function(){var t=this.estimateLiveEdge(),i=this.targetLatency,s=this.levelDetails;if(t===null||i===null||s===null)return null;var h=s.edge,a=t-i-this.edgeStalled,e=h-s.totalduration,l=h-(this.config.lowLatencyMode&&s.partTarget||s.targetduration);return Math.min(Math.max(e,a),l)}},{key:"drift",get:function(){var t=this.levelDetails;return t===null?1:t.drift}},{key:"edgeStalled",get:function(){var t=this.levelDetails;if(t===null)return 0;var i=(this.config.lowLatencyMode&&t.partTarget||t.targetduration)*3;return Math.max(t.age-i,0)}},{key:"forwardBufferLength",get:function(){var t=this.media,i=this.levelDetails;if(!t||!i)return 0;var s=t.buffered.length;return s?t.buffered.end(s-1):i.edge-this.currentTime}}]),u}()},"./src/controller/level-controller.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"default",function(){return a});var _=U("./src/types/level.ts"),L=U("./src/events.ts"),E=U("./src/errors.ts"),A=U("./src/utils/codecs.ts"),w=U("./src/controller/level-helper.ts"),v=U("./src/controller/base-playlist-controller.ts"),u=U("./src/types/loader.ts");function f(){return f=Object.assign||function(e){for(var l=1;l<arguments.length;l++){var n=arguments[l];for(var d in n)Object.prototype.hasOwnProperty.call(n,d)&&(e[d]=n[d])}return e},f.apply(this,arguments)}function o(e,l){for(var n=0;n<l.length;n++){var d=l[n];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(e,d.key,d)}}function t(e,l,n){return l&&o(e.prototype,l),n&&o(e,n),e}function i(e,l){e.prototype=Object.create(l.prototype),e.prototype.constructor=e,s(e,l)}function s(e,l){return s=Object.setPrototypeOf||function(d,c){return d.__proto__=c,d},s(e,l)}var h=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),a=function(e){i(l,e);function l(d){var c;return c=e.call(this,d,"[level-controller]")||this,c._levels=[],c._firstLevel=-1,c._startLevel=void 0,c.currentLevelIndex=-1,c.manualLevelIndex=-1,c.onParsedComplete=void 0,c._registerListeners(),c}var n=l.prototype;return n._registerListeners=function(){var c=this.hls;c.on(L.Events.MANIFEST_LOADED,this.onManifestLoaded,this),c.on(L.Events.LEVEL_LOADED,this.onLevelLoaded,this),c.on(L.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),c.on(L.Events.FRAG_LOADED,this.onFragLoaded,this),c.on(L.Events.ERROR,this.onError,this)},n._unregisterListeners=function(){var c=this.hls;c.off(L.Events.MANIFEST_LOADED,this.onManifestLoaded,this),c.off(L.Events.LEVEL_LOADED,this.onLevelLoaded,this),c.off(L.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),c.off(L.Events.FRAG_LOADED,this.onFragLoaded,this),c.off(L.Events.ERROR,this.onError,this)},n.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,e.prototype.destroy.call(this)},n.startLoad=function(){var c=this._levels;c.forEach(function(g){g.loadError=0}),e.prototype.startLoad.call(this)},n.onManifestLoaded=function(c,g){var p=[],m=[],b=[],y,r={},x,S=!1,T=!1,R=!1;if(g.levels.forEach(function(G){var P=G.attrs;S=S||!!(G.width&&G.height),T=T||!!G.videoCodec,R=R||!!G.audioCodec,h&&G.audioCodec&&G.audioCodec.indexOf("mp4a.40.34")!==-1&&(G.audioCodec=void 0);var $=G.bitrate+"-"+G.attrs.RESOLUTION+"-"+G.attrs.CODECS;x=r[$],x?x.url.push(G.url):(x=new _.Level(G),r[$]=x,p.push(x)),P&&(P.AUDIO&&Object(w.addGroupId)(x,"audio",P.AUDIO),P.SUBTITLES&&Object(w.addGroupId)(x,"text",P.SUBTITLES))}),(S||T)&&R&&(p=p.filter(function(G){var P=G.videoCodec,$=G.width,X=G.height;return!!P||!!($&&X)})),p=p.filter(function(G){var P=G.audioCodec,$=G.videoCodec;return(!P||Object(A.isCodecSupportedInMp4)(P,"audio"))&&(!$||Object(A.isCodecSupportedInMp4)($,"video"))}),g.audioTracks&&(m=g.audioTracks.filter(function(G){return!G.audioCodec||Object(A.isCodecSupportedInMp4)(G.audioCodec,"audio")}),Object(w.assignTrackIdsByGroup)(m)),g.subtitles&&(b=g.subtitles,Object(w.assignTrackIdsByGroup)(b)),p.length>0){y=p[0].bitrate,p.sort(function(G,P){return G.bitrate-P.bitrate}),this._levels=p;for(var D=0;D<p.length;D++)if(p[D].bitrate===y){this._firstLevel=D,this.log("manifest loaded, "+p.length+" level(s) found, first bitrate: "+y);break}var k=R&&!T,B={levels:p,audioTracks:m,subtitleTracks:b,firstLevel:this._firstLevel,stats:g.stats,audio:R,video:T,altAudio:!k&&m.some(function(G){return!!G.url})};this.hls.trigger(L.Events.MANIFEST_PARSED,B),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(L.Events.ERROR,{type:E.ErrorTypes.MEDIA_ERROR,details:E.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:g.url,reason:"no level with compatible codecs found in manifest"})},n.onError=function(c,g){if(e.prototype.onError.call(this,c,g),g.fatal)return;var p=g.context,m=this._levels[this.currentLevelIndex];if(p&&(p.type===u.PlaylistContextType.AUDIO_TRACK&&m.audioGroupIds&&p.groupId===m.audioGroupIds[m.urlId]||p.type===u.PlaylistContextType.SUBTITLE_TRACK&&m.textGroupIds&&p.groupId===m.textGroupIds[m.urlId])){this.redundantFailover(this.currentLevelIndex);return}var b=!1,y=!0,r;switch(g.details){case E.ErrorDetails.FRAG_LOAD_ERROR:case E.ErrorDetails.FRAG_LOAD_TIMEOUT:case E.ErrorDetails.KEY_LOAD_ERROR:case E.ErrorDetails.KEY_LOAD_TIMEOUT:if(g.frag){var x=this._levels[g.frag.level];x?(x.fragmentError++,x.fragmentError>this.hls.config.fragLoadingMaxRetry&&(r=g.frag.level)):r=g.frag.level}break;case E.ErrorDetails.LEVEL_LOAD_ERROR:case E.ErrorDetails.LEVEL_LOAD_TIMEOUT:p&&(p.deliveryDirectives&&(y=!1),r=p.level),b=!0;break;case E.ErrorDetails.REMUX_ALLOC_ERROR:r=g.level,b=!0;break}r!==void 0&&this.recoverLevel(g,r,b,y)},n.recoverLevel=function(c,g,p,m){var b=c.details,y=this._levels[g];if(y.loadError++,p){var r=this.retryLoadingOrFail(c);if(r)c.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(m){var x=y.url.length;if(x>1&&y.loadError<x)c.levelRetry=!0,this.redundantFailover(g);else if(this.manualLevelIndex===-1){var S=g===0?this._levels.length-1:g-1;this.currentLevelIndex!==S&&this._levels[S].loadError===0&&(this.warn(b+": switch to "+S),c.levelRetry=!0,this.hls.nextAutoLevel=S)}}},n.redundantFailover=function(c){var g=this._levels[c],p=g.url.length;if(p>1){var m=(g.urlId+1)%p;this.warn("Switching to redundant URL-id "+m),this._levels.forEach(function(b){b.urlId=m}),this.level=c}},n.onFragLoaded=function(c,g){var p=g.frag;if(p!==void 0&&p.type===u.PlaylistLevelType.MAIN){var m=this._levels[p.level];m!==void 0&&(m.fragmentError=0,m.loadError=0)}},n.onLevelLoaded=function(c,g){var p,m=g.level,b=g.details,y=this._levels[m];if(!y){var r;this.warn("Invalid level index "+m),(r=g.deliveryDirectives)!==null&&r!==void 0&&r.skip&&(b.deltaUpdateFailed=!0);return}m===this.currentLevelIndex?(y.fragmentError===0&&(y.loadError=0,this.retryCount=0),this.playlistLoaded(m,g,y.details)):(p=g.deliveryDirectives)!==null&&p!==void 0&&p.skip&&(b.deltaUpdateFailed=!0)},n.onAudioTrackSwitched=function(c,g){var p=this.hls.levels[this.currentLevelIndex];if(!p)return;if(p.audioGroupIds){for(var m=-1,b=this.hls.audioTracks[g.id].groupId,y=0;y<p.audioGroupIds.length;y++)if(p.audioGroupIds[y]===b){m=y;break}m!==p.urlId&&(p.urlId=m,this.startLoad())}},n.loadPlaylist=function(c){var g=this.currentLevelIndex,p=this._levels[g];if(this.canLoad&&p&&p.url.length>0){var m=p.urlId,b=p.url[m];if(c)try{b=c.addDirectives(b)}catch(y){this.warn("Could not construct new URL with HLS Delivery Directives: "+y)}this.log("Attempt loading level index "+g+(c?" at sn "+c.msn+" part "+c.part:"")+" with URL-id "+m+" "+b),this.clearTimer(),this.hls.trigger(L.Events.LEVEL_LOADING,{url:b,level:g,id:m,deliveryDirectives:c||null})}},n.removeLevel=function(c,g){var p=function(y,r){return r!==g},m=this._levels.filter(function(b,y){return y!==c?!0:b.url.length>1&&g!==void 0?(b.url=b.url.filter(p),b.audioGroupIds&&(b.audioGroupIds=b.audioGroupIds.filter(p)),b.textGroupIds&&(b.textGroupIds=b.textGroupIds.filter(p)),b.urlId=0,!0):!1}).map(function(b,y){var r=b.details;return r!=null&&r.fragments&&r.fragments.forEach(function(x){x.level=y}),b});this._levels=m,this.hls.trigger(L.Events.LEVELS_UPDATED,{levels:m})},t(l,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(c){var g,p=this._levels;if(p.length===0)return;if(this.currentLevelIndex===c&&(g=p[c])!==null&&g!==void 0&&g.details)return;if(c<0||c>=p.length){var m=c<0;if(this.hls.trigger(L.Events.ERROR,{type:E.ErrorTypes.OTHER_ERROR,details:E.ErrorDetails.LEVEL_SWITCH_ERROR,level:c,fatal:m,reason:"invalid level idx"}),m)return;c=Math.min(c,p.length-1)}this.clearTimer();var b=this.currentLevelIndex,y=p[b],r=p[c];this.log("switching to level "+c+" from "+b),this.currentLevelIndex=c;var x=f({},r,{level:c,maxBitrate:r.maxBitrate,uri:r.uri,urlId:r.urlId});delete x._urlId,this.hls.trigger(L.Events.LEVEL_SWITCHING,x);var S=r.details;if(!S||S.live){var T=this.switchParams(r.uri,y==null?void 0:y.details);this.loadPlaylist(T)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(c){this.manualLevelIndex=c,this._startLevel===void 0&&(this._startLevel=c),c!==-1&&(this.level=c)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(c){this._firstLevel=c}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var c=this.hls.config.startLevel;return c!==void 0?c:this._firstLevel}else return this._startLevel},set:function(c){this._startLevel=c}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(c){this.level=c,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=c)}}]),l}(v.default)},"./src/controller/level-helper.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"addGroupId",function(){return E}),U.d(Z,"assignTrackIdsByGroup",function(){return A}),U.d(Z,"updatePTS",function(){return w}),U.d(Z,"updateFragPTSDTS",function(){return u}),U.d(Z,"mergeDetails",function(){return f}),U.d(Z,"mapPartIntersection",function(){return o}),U.d(Z,"mapFragmentIntersection",function(){return t}),U.d(Z,"adjustSliding",function(){return i}),U.d(Z,"addSliding",function(){return s}),U.d(Z,"computeReloadInterval",function(){return h}),U.d(Z,"getFragmentWithSN",function(){return a}),U.d(Z,"getPartWith",function(){return e});var _=U("./src/polyfills/number.ts"),L=U("./src/utils/logger.ts");function E(l,n,d){switch(n){case"audio":l.audioGroupIds||(l.audioGroupIds=[]),l.audioGroupIds.push(d);break;case"text":l.textGroupIds||(l.textGroupIds=[]),l.textGroupIds.push(d);break}}function A(l){var n={};l.forEach(function(d){var c=d.groupId||"";d.id=n[c]=n[c]||0,n[c]++})}function w(l,n,d){var c=l[n],g=l[d];v(c,g)}function v(l,n){var d=n.startPTS;if(Object(_.isFiniteNumber)(d)){var c=0,g;n.sn>l.sn?(c=d-l.start,g=l):(c=l.start-d,g=n),g.duration!==c&&(g.duration=c)}else if(n.sn>l.sn){var p=l.cc===n.cc;p&&l.minEndPTS?n.start=l.start+(l.minEndPTS-l.start):n.start=l.start+l.duration}else n.start=Math.max(l.start-n.duration,0)}function u(l,n,d,c,g,p){var m=c-d;m<=0&&(L.logger.warn("Fragment should have a positive duration",n),c=d+n.duration,p=g+n.duration);var b=d,y=c,r=n.startPTS,x=n.endPTS;if(Object(_.isFiniteNumber)(r)){var S=Math.abs(r-d);Object(_.isFiniteNumber)(n.deltaPTS)?n.deltaPTS=Math.max(S,n.deltaPTS):n.deltaPTS=S,b=Math.max(d,r),d=Math.min(d,r),g=Math.min(g,n.startDTS),y=Math.min(c,x),c=Math.max(c,x),p=Math.max(p,n.endDTS)}n.duration=c-d;var T=d-n.start;n.appendedPTS=c,n.start=n.startPTS=d,n.maxStartPTS=b,n.startDTS=g,n.endPTS=c,n.minEndPTS=y,n.endDTS=p;var R=n.sn;if(!l||R<l.startSN||R>l.endSN)return 0;var D,k=R-l.startSN,B=l.fragments;for(B[k]=n,D=k;D>0;D--)v(B[D],B[D-1]);for(D=k;D<B.length-1;D++)v(B[D],B[D+1]);return l.fragmentHint&&v(B[B.length-1],l.fragmentHint),l.PTSKnown=l.alignedSliding=!0,T}function f(l,n){for(var d=null,c=l.fragments,g=c.length-1;g>=0;g--){var p=c[g].initSegment;if(p){d=p;break}}l.fragmentHint&&delete l.fragmentHint.endPTS;var m=0,b;if(t(l,n,function(D,k){D.relurl&&(m=D.cc-k.cc),Object(_.isFiniteNumber)(D.startPTS)&&Object(_.isFiniteNumber)(D.endPTS)&&(k.start=k.startPTS=D.startPTS,k.startDTS=D.startDTS,k.appendedPTS=D.appendedPTS,k.maxStartPTS=D.maxStartPTS,k.endPTS=D.endPTS,k.endDTS=D.endDTS,k.minEndPTS=D.minEndPTS,k.duration=D.endPTS-D.startPTS,k.duration&&(b=k),n.PTSKnown=n.alignedSliding=!0),k.elementaryStreams=D.elementaryStreams,k.loader=D.loader,k.stats=D.stats,k.urlId=D.urlId,D.initSegment&&(k.initSegment=D.initSegment,d=D.initSegment)}),d){var y=n.fragmentHint?n.fragments.concat(n.fragmentHint):n.fragments;y.forEach(function(D){var k;(!D.initSegment||D.initSegment.relurl===((k=d)===null||k===void 0?void 0:k.relurl))&&(D.initSegment=d)})}if(n.skippedSegments&&(n.deltaUpdateFailed=n.fragments.some(function(D){return!D}),n.deltaUpdateFailed)){L.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var r=n.skippedSegments;r--;)n.fragments.shift();n.startSN=n.fragments[0].sn,n.startCC=n.fragments[0].cc}var x=n.fragments;if(m){L.logger.warn("discontinuity sliding from playlist, take drift into account");for(var S=0;S<x.length;S++)x[S].cc+=m}n.skippedSegments&&(n.startCC=n.fragments[0].cc),o(l.partList,n.partList,function(D,k){k.elementaryStreams=D.elementaryStreams,k.stats=D.stats}),b?u(n,b,b.startPTS,b.endPTS,b.startDTS,b.endDTS):i(l,n),x.length&&(n.totalduration=n.edge-x[0].start),n.driftStartTime=l.driftStartTime,n.driftStart=l.driftStart;var T=n.advancedDateTime;if(n.advanced&&T){var R=n.edge;n.driftStart||(n.driftStartTime=T,n.driftStart=R),n.driftEndTime=T,n.driftEnd=R}else n.driftEndTime=l.driftEndTime,n.driftEnd=l.driftEnd,n.advancedDateTime=l.advancedDateTime}function o(l,n,d){if(l&&n)for(var c=0,g=0,p=l.length;g<=p;g++){var m=l[g],b=n[g+c];m&&b&&m.index===b.index&&m.fragment.sn===b.fragment.sn?d(m,b):c--}}function t(l,n,d){for(var c=n.skippedSegments,g=Math.max(l.startSN,n.startSN)-n.startSN,p=(l.fragmentHint?1:0)+(c?n.endSN:Math.min(l.endSN,n.endSN))-n.startSN,m=n.startSN-l.startSN,b=n.fragmentHint?n.fragments.concat(n.fragmentHint):n.fragments,y=l.fragmentHint?l.fragments.concat(l.fragmentHint):l.fragments,r=g;r<=p;r++){var x=y[m+r],S=b[r];c&&!S&&r<c&&(S=n.fragments[r]=x),x&&S&&d(x,S)}}function i(l,n){var d=n.startSN+n.skippedSegments-l.startSN,c=l.fragments;if(d<0||d>=c.length)return;s(n,c[d].start)}function s(l,n){if(n){for(var d=l.fragments,c=l.skippedSegments;c<d.length;c++)d[c].start+=n;l.fragmentHint&&(l.fragmentHint.start+=n)}}function h(l,n){var d=1e3*l.levelTargetDuration,c=d/2,g=l.age,p=g>0&&g<d*3,m=n.loading.end-n.loading.start,b,y=l.availabilityDelay;if(l.updated===!1)if(p){var r=333*l.misses;b=Math.max(Math.min(c,m*2),r),l.availabilityDelay=(l.availabilityDelay||0)+b}else b=c;else p?(y=Math.min(y||d/2,g),l.availabilityDelay=y,b=y+d-g):b=d-m;return Math.round(b)}function a(l,n,d){if(!l||!l.details)return null;var c=l.details,g=c.fragments[n-c.startSN];return g||(g=c.fragmentHint,g&&g.sn===n?g:n<c.startSN&&d&&d.sn===n?d:null)}function e(l,n,d){if(!l||!l.details)return null;var c=l.details.partList;if(c)for(var g=c.length;g--;){var p=c[g];if(p.index===d&&p.fragment.sn===n)return p}return null}},"./src/controller/stream-controller.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"default",function(){return c});var _=U("./src/polyfills/number.ts"),L=U("./src/controller/base-stream-controller.ts"),E=U("./src/is-supported.ts"),A=U("./src/events.ts"),w=U("./src/utils/buffer-helper.ts"),v=U("./src/controller/fragment-tracker.ts"),u=U("./src/types/loader.ts"),f=U("./src/loader/fragment.ts"),o=U("./src/demux/transmuxer-interface.ts"),t=U("./src/types/transmuxer.ts"),i=U("./src/controller/gap-controller.ts"),s=U("./src/errors.ts"),h=U("./src/utils/logger.ts");function a(g,p){for(var m=0;m<p.length;m++){var b=p[m];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(g,b.key,b)}}function e(g,p,m){return p&&a(g.prototype,p),m&&a(g,m),g}function l(g,p){g.prototype=Object.create(p.prototype),g.prototype.constructor=g,n(g,p)}function n(g,p){return n=Object.setPrototypeOf||function(b,y){return b.__proto__=y,b},n(g,p)}var d=100,c=function(g){l(p,g);function p(b,y){var r;return r=g.call(this,b,y,"[stream-controller]")||this,r.audioCodecSwap=!1,r.gapController=null,r.level=-1,r._forceStartLoad=!1,r.altAudio=!1,r.audioOnly=!1,r.fragPlaying=null,r.onvplaying=null,r.onvseeked=null,r.fragLastKbps=0,r.stalled=!1,r.couldBacktrack=!1,r.audioCodecSwitch=!1,r.videoBuffer=null,r._registerListeners(),r}var m=p.prototype;return m._registerListeners=function(){var y=this.hls;y.on(A.Events.MEDIA_ATTACHED,this.onMediaAttached,this),y.on(A.Events.MEDIA_DETACHING,this.onMediaDetaching,this),y.on(A.Events.MANIFEST_LOADING,this.onManifestLoading,this),y.on(A.Events.MANIFEST_PARSED,this.onManifestParsed,this),y.on(A.Events.LEVEL_LOADING,this.onLevelLoading,this),y.on(A.Events.LEVEL_LOADED,this.onLevelLoaded,this),y.on(A.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),y.on(A.Events.ERROR,this.onError,this),y.on(A.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),y.on(A.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),y.on(A.Events.BUFFER_CREATED,this.onBufferCreated,this),y.on(A.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),y.on(A.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),y.on(A.Events.FRAG_BUFFERED,this.onFragBuffered,this)},m._unregisterListeners=function(){var y=this.hls;y.off(A.Events.MEDIA_ATTACHED,this.onMediaAttached,this),y.off(A.Events.MEDIA_DETACHING,this.onMediaDetaching,this),y.off(A.Events.MANIFEST_LOADING,this.onManifestLoading,this),y.off(A.Events.MANIFEST_PARSED,this.onManifestParsed,this),y.off(A.Events.LEVEL_LOADED,this.onLevelLoaded,this),y.off(A.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),y.off(A.Events.ERROR,this.onError,this),y.off(A.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),y.off(A.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),y.off(A.Events.BUFFER_CREATED,this.onBufferCreated,this),y.off(A.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),y.off(A.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),y.off(A.Events.FRAG_BUFFERED,this.onFragBuffered,this)},m.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},m.startLoad=function(y){if(this.levels){var r=this.lastCurrentTime,x=this.hls;if(this.stopLoad(),this.setInterval(d),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var S=x.startLevel;S===-1&&(x.config.testBandwidth?(S=0,this.bitrateTest=!0):S=x.nextAutoLevel),this.level=x.nextLoadLevel=S,this.loadedmetadata=!1}r>0&&y===-1&&(this.log("Override startPosition with lastCurrentTime @"+r.toFixed(3)),y=r),this.state=L.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=y,this.tick()}else this._forceStartLoad=!0,this.state=L.State.STOPPED},m.stopLoad=function(){this._forceStartLoad=!1,g.prototype.stopLoad.call(this)},m.doTick=function(){switch(this.state){case L.State.IDLE:this.doTickIdle();break;case L.State.WAITING_LEVEL:{var y,r=this.levels,x=this.level,S=r==null||((y=r[x])===null||y===void 0)?void 0:y.details;if(S&&(!S.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(S))break;this.state=L.State.IDLE;break}break}case L.State.FRAG_LOADING_WAITING_RETRY:{var T,R=self.performance.now(),D=this.retryDate;(!D||R>=D||(T=this.media)!==null&&T!==void 0&&T.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=L.State.IDLE)}break;default:break}this.onTickEnd()},m.onTickEnd=function(){g.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},m.doTickIdle=function(){var y,r,x=this.hls,S=this.levelLastLoaded,T=this.levels,R=this.media,D=x.config,k=x.nextLoadLevel;if(S===null||!R&&(this.startFragRequested||!D.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!T||!T[k])return;var B=T[k];this.level=x.nextLoadLevel=k;var G=B.details;if(!G||this.state===L.State.WAITING_LEVEL||G.live&&this.levelLastLoaded!==k){this.state=L.State.WAITING_LEVEL;return}var P=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:R,u.PlaylistLevelType.MAIN);if(P===null)return;var $=P.len,X=this.getMaxBufferLength(B.maxBitrate);if($>=X)return;if(this._streamEnded(P,G)){var z={};this.altAudio&&(z.type="video"),this.hls.trigger(A.Events.BUFFER_EOS,z),this.state=L.State.ENDED;return}var N=P.end,H=this.getNextFragment(N,G);if(this.couldBacktrack&&!this.fragPrevious&&H&&H.sn!=="initSegment"){var q=H.sn-G.startSN;q>1&&(H=G.fragments[q-1],this.fragmentTracker.removeFragment(H))}if(H&&this.fragmentTracker.getState(H)===v.FragmentState.OK&&this.nextLoadPosition>N){var ee=this.audioOnly&&!this.altAudio?f.ElementaryStreamTypes.AUDIO:f.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(R,ee,u.PlaylistLevelType.MAIN),H=this.getNextFragment(this.nextLoadPosition,G)}if(!H)return;H.initSegment&&!H.initSegment.data&&!this.bitrateTest&&(H=H.initSegment),((y=H.decryptdata)===null||y===void 0?void 0:y.keyFormat)==="identity"&&!((r=H.decryptdata)!==null&&r!==void 0&&r.key)?this.loadKey(H,G):this.loadFragment(H,G,N)},m.loadFragment=function(y,r,x){var S,T=this.fragmentTracker.getState(y);if(this.fragCurrent=y,T===v.FragmentState.BACKTRACKED){var R=this.fragmentTracker.getBacktrackData(y);if(R){this._handleFragmentLoadProgress(R),this._handleFragmentLoadComplete(R);return}else T=v.FragmentState.NOT_LOADED}T===v.FragmentState.NOT_LOADED||T===v.FragmentState.PARTIAL?y.sn==="initSegment"?this._loadInitSegment(y):this.bitrateTest?(y.bitrateTest=!0,this.log("Fragment "+y.sn+" of level "+y.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(y)):(this.startFragRequested=!0,g.prototype.loadFragment.call(this,y,r,x)):T===v.FragmentState.APPENDING?this.reduceMaxBufferLength(y.duration)&&this.fragmentTracker.removeFragment(y):((S=this.media)===null||S===void 0?void 0:S.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},m.getAppendedFrag=function(y){var r=this.fragmentTracker.getAppendedFrag(y,u.PlaylistLevelType.MAIN);return r&&"fragment"in r?r.fragment:r},m.getBufferedFrag=function(y){return this.fragmentTracker.getBufferedFrag(y,u.PlaylistLevelType.MAIN)},m.followingBufferedFrag=function(y){return y?this.getBufferedFrag(y.end+.5):null},m.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},m.nextLevelSwitch=function(){var y=this.levels,r=this.media;if(r!=null&&r.readyState){var x,S=this.getAppendedFrag(r.currentTime);if(S&&S.start>1&&this.flushMainBuffer(0,S.start-1),!r.paused&&y){var T=this.hls.nextLoadLevel,R=y[T],D=this.fragLastKbps;D&&this.fragCurrent?x=this.fragCurrent.duration*R.maxBitrate/(1e3*D)+1:x=0}else x=0;var k=this.getBufferedFrag(r.currentTime+x);if(k){var B=this.followingBufferedFrag(k);if(B){this.abortCurrentFrag();var G=B.maxStartPTS?B.maxStartPTS:B.start,P=B.duration,$=Math.max(k.end,G+Math.min(Math.max(P-this.config.maxFragLookUpTolerance,P*.5),P*.75));this.flushMainBuffer($,Number.POSITIVE_INFINITY)}}}},m.abortCurrentFrag=function(){var y=this.fragCurrent;this.fragCurrent=null,y!=null&&y.loader&&y.loader.abort(),this.state===L.State.KEY_LOADING&&(this.state=L.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},m.flushMainBuffer=function(y,r){g.prototype.flushMainBuffer.call(this,y,r,this.altAudio?"video":null)},m.onMediaAttached=function(y,r){g.prototype.onMediaAttached.call(this,y,r);var x=r.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),x.addEventListener("playing",this.onvplaying),x.addEventListener("seeked",this.onvseeked),this.gapController=new i.default(this.config,x,this.fragmentTracker,this.hls)},m.onMediaDetaching=function(){var y=this.media;y&&(y.removeEventListener("playing",this.onvplaying),y.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),g.prototype.onMediaDetaching.call(this)},m.onMediaPlaying=function(){this.tick()},m.onMediaSeeked=function(){var y=this.media,r=y?y.currentTime:null;Object(_.isFiniteNumber)(r)&&this.log("Media seeked to "+r.toFixed(3)),this.tick()},m.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(A.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},m.onManifestParsed=function(y,r){var x=!1,S=!1,T;r.levels.forEach(function(R){T=R.audioCodec,T&&(T.indexOf("mp4a.40.2")!==-1&&(x=!0),T.indexOf("mp4a.40.5")!==-1&&(S=!0))}),this.audioCodecSwitch=x&&S&&!Object(E.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=r.levels,this.startFragRequested=!1},m.onLevelLoading=function(y,r){var x=this.levels;if(!x||this.state!==L.State.IDLE)return;var S=x[r.level];(!S.details||S.details.live&&this.levelLastLoaded!==r.level||this.waitForCdnTuneIn(S.details))&&(this.state=L.State.WAITING_LEVEL)},m.onLevelLoaded=function(y,r){var x,S=this.levels,T=r.level,R=r.details,D=R.totalduration;if(!S){this.warn("Levels were reset while loading level "+T);return}this.log("Level "+T+" loaded ["+R.startSN+","+R.endSN+"], cc ["+R.startCC+", "+R.endCC+"] duration:"+D);var k=this.fragCurrent;k&&(this.state===L.State.FRAG_LOADING||this.state===L.State.FRAG_LOADING_WAITING_RETRY)&&(k.level!==r.level&&k.loader&&(this.state=L.State.IDLE,k.loader.abort()));var B=S[T],G=0;if(R.live||(x=B.details)!==null&&x!==void 0&&x.live){if(R.fragments[0]||(R.deltaUpdateFailed=!0),R.deltaUpdateFailed)return;G=this.alignPlaylists(R,B.details)}if(B.details=R,this.levelLastLoaded=T,this.hls.trigger(A.Events.LEVEL_UPDATED,{details:R,level:T}),this.state===L.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(R))return;this.state=L.State.IDLE}this.startFragRequested?R.live&&this.synchronizeToLiveEdge(R):this.setStartPosition(R,G),this.tick()},m._handleFragmentLoadProgress=function(y){var r,x=y.frag,S=y.part,T=y.payload,R=this.levels;if(!R){this.warn("Levels were reset while fragment load was in progress. Fragment "+x.sn+" of level "+x.level+" will not be buffered");return}var D=R[x.level],k=D.details;if(!k){this.warn("Dropping fragment "+x.sn+" of level "+x.level+" after level details were reset");return}var B=D.videoCodec,G=k.PTSKnown||!k.live,P=(r=x.initSegment)===null||r===void 0?void 0:r.data,$=this._getAudioCodec(D),X=this.transmuxer=this.transmuxer||new o.default(this.hls,u.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),z=S?S.index:-1,N=z!==-1,H=new t.ChunkMetadata(x.level,x.sn,x.stats.chunkCount,T.byteLength,z,N),q=this.initPTS[x.cc];X.push(T,P,$,B,x,S,k.totalduration,G,H,q)},m.onAudioTrackSwitching=function(y,r){var x=this.altAudio,S=!!r.url,T=r.id;if(!S){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var R=this.fragCurrent;R!=null&&R.loader&&(this.log("Switching to main audio track, cancel main fragment load"),R.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var D=this.hls;x&&D.trigger(A.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),D.trigger(A.Events.AUDIO_TRACK_SWITCHED,{id:T})}},m.onAudioTrackSwitched=function(y,r){var x=r.id,S=!!this.hls.audioTracks[x].url;if(S){var T=this.videoBuffer;T&&this.mediaBuffer!==T&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=T)}this.altAudio=S,this.tick()},m.onBufferCreated=function(y,r){var x=r.tracks,S,T,R=!1;for(var D in x){var k=x[D];if(k.id==="main"){if(T=D,S=k,D==="video"){var B=x[D];B&&(this.videoBuffer=B.buffer)}}else R=!0}R&&S?(this.log("Alternate track found, use "+T+".buffered to schedule main fragment loading"),this.mediaBuffer=S.buffer):this.mediaBuffer=this.media},m.onFragBuffered=function(y,r){var x=r.frag,S=r.part;if(x&&x.type!==u.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(x)){this.warn("Fragment "+x.sn+(S?" p: "+S.index:"")+" of level "+x.level+" finished buffering, but was aborted. state: "+this.state),this.state===L.State.PARSED&&(this.state=L.State.IDLE);return}var T=S?S.stats:x.stats;this.fragLastKbps=Math.round(8*T.total/(T.buffering.end-T.loading.first)),x.sn!=="initSegment"&&(this.fragPrevious=x),this.fragBufferedComplete(x,S)},m.onError=function(y,r){switch(r.details){case s.ErrorDetails.FRAG_LOAD_ERROR:case s.ErrorDetails.FRAG_LOAD_TIMEOUT:case s.ErrorDetails.KEY_LOAD_ERROR:case s.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(u.PlaylistLevelType.MAIN,r);break;case s.ErrorDetails.LEVEL_LOAD_ERROR:case s.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==L.State.ERROR&&(r.fatal?(this.warn(""+r.details),this.state=L.State.ERROR):!r.levelRetry&&this.state===L.State.WAITING_LEVEL&&(this.state=L.State.IDLE));break;case s.ErrorDetails.BUFFER_FULL_ERROR:if(r.parent==="main"&&(this.state===L.State.PARSING||this.state===L.State.PARSED)){var x=!0,S=this.getFwdBufferInfo(this.media,u.PlaylistLevelType.MAIN);S&&S.len>.5&&(x=!this.reduceMaxBufferLength(S.len)),x&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},m.checkBuffer=function(){var y=this.media,r=this.gapController;if(!y||!r||!y.readyState)return;var x=w.BufferHelper.getBuffered(y);!this.loadedmetadata&&x.length?(this.loadedmetadata=!0,this.seekToStartPos()):r.poll(this.lastCurrentTime),this.lastCurrentTime=y.currentTime},m.onFragLoadEmergencyAborted=function(){this.state=L.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},m.onBufferFlushed=function(y,r){var x=r.type;if(x!==f.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var S=(x===f.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(S,x,u.PlaylistLevelType.MAIN)}},m.onLevelsUpdated=function(y,r){this.levels=r.levels},m.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},m.seekToStartPos=function(){var y=this.media,r=y.currentTime,x=this.startPosition;if(x>=0&&r<x){if(y.seeking){h.logger.log("could not seek to "+x+", already seeking at "+r);return}var S=w.BufferHelper.getBuffered(y),T=S.length?S.start(0):0,R=T-x;R>0&&(R<this.config.maxBufferHole||R<this.config.maxFragLookUpTolerance)&&(h.logger.log("adjusting start position by "+R+" to match buffer start"),x+=R,this.startPosition=x),this.log("seek to target start position "+x+" from current time "+r),y.currentTime=x}},m._getAudioCodec=function(y){var r=this.config.defaultAudioCodec||y.audioCodec;return this.audioCodecSwap&&r&&(this.log("Swapping audio codec"),r.indexOf("mp4a.40.5")!==-1?r="mp4a.40.2":r="mp4a.40.5"),r},m._loadBitrateTestFrag=function(y){var r=this;this._doFragLoad(y).then(function(x){var S=r.hls;if(!x||S.nextLoadLevel||r.fragContextChanged(y))return;r.fragLoadError=0,r.state=L.State.IDLE,r.startFragRequested=!1,r.bitrateTest=!1;var T=y.stats;T.parsing.start=T.parsing.end=T.buffering.start=T.buffering.end=self.performance.now(),S.trigger(A.Events.FRAG_LOADED,x)})},m._handleTransmuxComplete=function(y){var r,x="main",S=this.hls,T=y.remuxResult,R=y.chunkMeta,D=this.getCurrentContext(R);if(!D){this.warn("The loading context changed while buffering fragment "+R.sn+" of level "+R.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(R.level);return}var k=D.frag,B=D.part,G=D.level,P=T.video,$=T.text,X=T.id3,z=T.initSegment,N=this.altAudio?void 0:T.audio;if(this.fragContextChanged(k))return;if(this.state=L.State.PARSING,z){z.tracks&&(this._bufferInitSegment(G,z.tracks,k,R),S.trigger(A.Events.FRAG_PARSING_INIT_SEGMENT,{frag:k,id:x,tracks:z.tracks}));var H=z.initPTS,q=z.timescale;Object(_.isFiniteNumber)(H)&&(this.initPTS[k.cc]=H,S.trigger(A.Events.INIT_PTS_FOUND,{frag:k,id:x,initPTS:H,timescale:q}))}if(P&&T.independent!==!1){if(G.details){var ee=P.startPTS,fe=P.endPTS,oe=P.startDTS,he=P.endDTS;if(B)B.elementaryStreams[P.type]={startPTS:ee,endPTS:fe,startDTS:oe,endDTS:he};else if(P.firstKeyFrame&&P.independent&&(this.couldBacktrack=!0),P.dropped&&P.independent){var se=this.getLoadPosition()+this.config.maxBufferHole;if(se<ee){this.backtrack(k);return}k.setElementaryStreamInfo(P.type,k.start,fe,k.start,he,!0)}k.setElementaryStreamInfo(P.type,ee,fe,oe,he),this.bufferFragmentData(P,k,B,R)}}else if(T.independent===!1){this.backtrack(k);return}if(N){var ge=N.startPTS,ie=N.endPTS,re=N.startDTS,Q=N.endDTS;B&&(B.elementaryStreams[f.ElementaryStreamTypes.AUDIO]={startPTS:ge,endPTS:ie,startDTS:re,endDTS:Q}),k.setElementaryStreamInfo(f.ElementaryStreamTypes.AUDIO,ge,ie,re,Q),this.bufferFragmentData(N,k,B,R)}if(X!=null&&(r=X.samples)!==null&&r!==void 0&&r.length){var pe={frag:k,id:x,samples:X.samples};S.trigger(A.Events.FRAG_PARSING_METADATA,pe)}if($){var ne={frag:k,id:x,samples:$.samples};S.trigger(A.Events.FRAG_PARSING_USERDATA,ne)}},m._bufferInitSegment=function(y,r,x,S){var T=this;if(this.state!==L.State.PARSING)return;this.audioOnly=!!r.audio&&!r.video,this.altAudio&&!this.audioOnly&&delete r.audio;var R=r.audio,D=r.video,k=r.audiovideo;if(R){var B=y.audioCodec,G=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(B&&(B.indexOf("mp4a.40.5")!==-1?B="mp4a.40.2":B="mp4a.40.5"),R.metadata.channelCount!==1&&G.indexOf("firefox")===-1&&(B="mp4a.40.5")),G.indexOf("android")!==-1&&R.container!=="audio/mpeg"&&(B="mp4a.40.2",this.log("Android: force audio codec to "+B)),y.audioCodec&&y.audioCodec!==B&&this.log('Swapping manifest audio codec "'+y.audioCodec+'" for "'+B+'"'),R.levelCodec=B,R.id="main",this.log("Init audio buffer, container:"+R.container+", codecs[selected/level/parsed]=["+(B||"")+"/"+(y.audioCodec||"")+"/"+R.codec+"]")}D&&(D.levelCodec=y.videoCodec,D.id="main",this.log("Init video buffer, container:"+D.container+", codecs[level/parsed]=["+(y.videoCodec||"")+"/"+D.codec+"]")),k&&this.log("Init audiovideo buffer, container:"+k.container+", codecs[level/parsed]=["+(y.attrs.CODECS||"")+"/"+k.codec+"]"),this.hls.trigger(A.Events.BUFFER_CODECS,r),Object.keys(r).forEach(function(P){var $=r[P],X=$.initSegment;X!=null&&X.byteLength&&T.hls.trigger(A.Events.BUFFER_APPENDING,{type:P,data:X,frag:x,part:null,chunkMeta:S,parent:x.type})}),this.tick()},m.backtrack=function(y){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(y);var r=this.fragmentTracker.backtrack(y);this.fragPrevious=null,this.nextLoadPosition=y.start,r?this.resetFragmentLoading(y):this.state=L.State.BACKTRACKING},m.checkFragmentChanged=function(){var y=this.media,r=null;if(y&&y.readyState>1&&y.seeking===!1){var x=y.currentTime;if(w.BufferHelper.isBuffered(y,x)?r=this.getAppendedFrag(x):w.BufferHelper.isBuffered(y,x+.1)&&(r=this.getAppendedFrag(x+.1)),r){var S=this.fragPlaying,T=r.level;(!S||r.sn!==S.sn||S.level!==T||r.urlId!==S.urlId)&&(this.hls.trigger(A.Events.FRAG_CHANGED,{frag:r}),(!S||S.level!==T)&&this.hls.trigger(A.Events.LEVEL_SWITCHED,{level:T}),this.fragPlaying=r)}}},e(p,[{key:"nextLevel",get:function(){var y=this.nextBufferedFrag;return y?y.level:-1}},{key:"currentLevel",get:function(){var y=this.media;if(y){var r=this.getAppendedFrag(y.currentTime);if(r)return r.level}return-1}},{key:"nextBufferedFrag",get:function(){var y=this.media;if(y){var r=this.getAppendedFrag(y.currentTime);return this.followingBufferedFrag(r)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),p}(L.default)},"./src/controller/subtitle-stream-controller.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"SubtitleStreamController",function(){return l});var _=U("./src/events.ts"),L=U("./src/utils/logger.ts"),E=U("./src/utils/buffer-helper.ts"),A=U("./src/controller/fragment-finders.ts"),w=U("./src/utils/discontinuities.ts"),v=U("./src/controller/level-helper.ts"),u=U("./src/controller/fragment-tracker.ts"),f=U("./src/controller/base-stream-controller.ts"),o=U("./src/types/loader.ts"),t=U("./src/types/level.ts");function i(n,d){for(var c=0;c<d.length;c++){var g=d[c];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(n,g.key,g)}}function s(n,d,c){return d&&i(n.prototype,d),c&&i(n,c),n}function h(n,d){n.prototype=Object.create(d.prototype),n.prototype.constructor=n,a(n,d)}function a(n,d){return a=Object.setPrototypeOf||function(g,p){return g.__proto__=p,g},a(n,d)}var e=500,l=function(n){h(d,n);function d(g,p){var m;return m=n.call(this,g,p,"[subtitle-stream-controller]")||this,m.levels=[],m.currentTrackId=-1,m.tracksBuffered=[],m.mainDetails=null,m._registerListeners(),m}var c=d.prototype;return c.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},c._registerListeners=function(){var p=this.hls;p.on(_.Events.MEDIA_ATTACHED,this.onMediaAttached,this),p.on(_.Events.MEDIA_DETACHING,this.onMediaDetaching,this),p.on(_.Events.MANIFEST_LOADING,this.onManifestLoading,this),p.on(_.Events.LEVEL_LOADED,this.onLevelLoaded,this),p.on(_.Events.ERROR,this.onError,this),p.on(_.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),p.on(_.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),p.on(_.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),p.on(_.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),p.on(_.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},c._unregisterListeners=function(){var p=this.hls;p.off(_.Events.MEDIA_ATTACHED,this.onMediaAttached,this),p.off(_.Events.MEDIA_DETACHING,this.onMediaDetaching,this),p.off(_.Events.MANIFEST_LOADING,this.onManifestLoading,this),p.off(_.Events.LEVEL_LOADED,this.onLevelLoaded,this),p.off(_.Events.ERROR,this.onError,this),p.off(_.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),p.off(_.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),p.off(_.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),p.off(_.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),p.off(_.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},c.startLoad=function(){this.stopLoad(),this.state=f.State.IDLE,this.setInterval(e),this.tick()},c.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},c.onLevelLoaded=function(p,m){this.mainDetails=m.details},c.onSubtitleFragProcessed=function(p,m){var b=m.frag,y=m.success;if(this.fragPrevious=b,this.state=f.State.IDLE,!y)return;var r=this.tracksBuffered[this.currentTrackId];if(!r)return;for(var x,S=b.start,T=0;T<r.length;T++)if(S>=r[T].start&&S<=r[T].end){x=r[T];break}var R=b.start+b.duration;x?x.end=R:(x={start:S,end:R},r.push(x)),this.fragmentTracker.fragBuffered(b)},c.onBufferFlushing=function(p,m){var b=m.startOffset,y=m.endOffset;if(b===0&&y!==Number.POSITIVE_INFINITY){var r=this.currentTrackId,x=this.levels;if(!x.length||!x[r]||!x[r].details)return;var S=x[r].details,T=S.targetduration,R=y-T;if(R<=0)return;m.endOffsetSubtitles=Math.max(0,R),this.tracksBuffered.forEach(function(D){for(var k=0;k<D.length;){if(D[k].end<=R){D.shift();continue}else if(D[k].start<R)D[k].start=R;else break;k++}}),this.fragmentTracker.removeFragmentsInRange(b,R,o.PlaylistLevelType.SUBTITLE)}},c.onError=function(p,m){var b,y=m.frag;if(!y||y.type!==o.PlaylistLevelType.SUBTITLE)return;(b=this.fragCurrent)!==null&&b!==void 0&&b.loader&&this.fragCurrent.loader.abort(),this.state=f.State.IDLE},c.onSubtitleTracksUpdated=function(p,m){var b=this,y=m.subtitleTracks;this.tracksBuffered=[],this.levels=y.map(function(r){return new t.Level(r)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(r){b.tracksBuffered[r.id]=[]}),this.mediaBuffer=null},c.onSubtitleTrackSwitch=function(p,m){if(this.currentTrackId=m.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var b=this.levels[this.currentTrackId];b!=null&&b.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,b&&this.setInterval(e)},c.onSubtitleTrackLoaded=function(p,m){var b,y=m.details,r=m.id,x=this.currentTrackId,S=this.levels;if(!S.length)return;var T=S[x];if(r>=S.length||r!==x||!T)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,y.live||(b=T.details)!==null&&b!==void 0&&b.live){var R=this.mainDetails;if(y.deltaUpdateFailed||!R)return;var D=R.fragments[0];if(!T.details)y.hasProgramDateTime&&R.hasProgramDateTime?Object(w.alignMediaPlaylistByPDT)(y,R):D&&Object(v.addSliding)(y,D.start);else{var k=this.alignPlaylists(y,T.details);k===0&&D&&Object(v.addSliding)(y,D.start)}}if(T.details=y,this.levelLastLoaded=r,this.tick(),y.live&&!this.fragCurrent&&this.media&&this.state===f.State.IDLE){var B=Object(A.findFragmentByPTS)(null,y.fragments,this.media.currentTime,0);B||(this.warn("Subtitle playlist not aligned with playback"),T.details=void 0)}},c._handleFragmentLoadComplete=function(p){var m=p.frag,b=p.payload,y=m.decryptdata,r=this.hls;if(this.fragContextChanged(m))return;if(b&&b.byteLength>0&&y&&y.key&&y.iv&&y.method==="AES-128"){var x=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(b),y.key.buffer,y.iv.buffer).then(function(S){var T=performance.now();r.trigger(_.Events.FRAG_DECRYPTED,{frag:m,payload:S,stats:{tstart:x,tdecrypt:T}})})}},c.doTick=function(){if(!this.media){this.state=f.State.IDLE;return}if(this.state===f.State.IDLE){var p,m=this.currentTrackId,b=this.levels;if(!b.length||!b[m]||!b[m].details)return;var y=b[m].details,r=y.targetduration,x=this.config,S=this.media,T=E.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,S.currentTime-r,x.maxBufferHole),R=T.end,D=T.len,k=this.getMaxBufferLength()+r;if(D>k)return;console.assert(y,"Subtitle track details are defined on idle subtitle stream controller tick");var B=y.fragments,G=B.length,P=y.edge,$,X=this.fragPrevious;if(R<P){var z=x.maxFragLookUpTolerance;X&&y.hasProgramDateTime&&($=Object(A.findFragmentByPDT)(B,X.endProgramDateTime,z)),$||($=Object(A.findFragmentByPTS)(X,B,R,z),!$&&X&&X.start<B[0].start&&($=B[0]))}else $=B[G-1];(p=$)!==null&&p!==void 0&&p.encrypted?(L.logger.log("Loading key for "+$.sn),this.state=f.State.KEY_LOADING,this.hls.trigger(_.Events.KEY_LOADING,{frag:$})):$&&this.fragmentTracker.getState($)===u.FragmentState.NOT_LOADED&&this.loadFragment($,y,R)}},c.loadFragment=function(p,m,b){this.fragCurrent=p,n.prototype.loadFragment.call(this,p,m,b)},s(d,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),d}(f.default)},"./src/controller/subtitle-track-controller.ts":function(Se,Z,U){"use strict";U.r(Z);var _=U("./src/events.ts"),L=U("./src/utils/texttrack-utils.ts"),E=U("./src/controller/base-playlist-controller.ts"),A=U("./src/types/loader.ts");function w(i,s){for(var h=0;h<s.length;h++){var a=s[h];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(i,a.key,a)}}function v(i,s,h){return s&&w(i.prototype,s),h&&w(i,h),i}function u(i,s){i.prototype=Object.create(s.prototype),i.prototype.constructor=i,f(i,s)}function f(i,s){return f=Object.setPrototypeOf||function(a,e){return a.__proto__=e,a},f(i,s)}var o=function(i){u(s,i);function s(a){var e;return e=i.call(this,a,"[subtitle-track-controller]")||this,e.media=null,e.tracks=[],e.groupId=null,e.tracksInGroup=[],e.trackId=-1,e.selectDefaultTrack=!0,e.queuedDefaultTrack=-1,e.trackChangeListener=function(){return e.onTextTracksChanged()},e.asyncPollTrackChange=function(){return e.pollTrackChange(0)},e.useTextTrackPolling=!1,e.subtitlePollingInterval=-1,e.subtitleDisplay=!0,e.registerListeners(),e}var h=s.prototype;return h.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,i.prototype.destroy.call(this)},h.registerListeners=function(){var e=this.hls;e.on(_.Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(_.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(_.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.on(_.Events.MANIFEST_PARSED,this.onManifestParsed,this),e.on(_.Events.LEVEL_LOADING,this.onLevelLoading,this),e.on(_.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(_.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(_.Events.ERROR,this.onError,this)},h.unregisterListeners=function(){var e=this.hls;e.off(_.Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(_.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(_.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.off(_.Events.MANIFEST_PARSED,this.onManifestParsed,this),e.off(_.Events.LEVEL_LOADING,this.onLevelLoading,this),e.off(_.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(_.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(_.Events.ERROR,this.onError,this)},h.onMediaAttached=function(e,l){if(this.media=l.media,!this.media)return;this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange)},h.pollTrackChange=function(e){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,e)},h.onMediaDetaching=function(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId);var e=t(this.media.textTracks);e.forEach(function(l){Object(L.clearCurrentCues)(l)}),this.subtitleTrack=-1,this.media=null},h.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},h.onManifestParsed=function(e,l){this.tracks=l.subtitleTracks},h.onSubtitleTrackLoaded=function(e,l){var n=l.id,d=l.details,c=this.trackId,g=this.tracksInGroup[c];if(!g){this.warn("Invalid subtitle track id "+n);return}var p=g.details;g.details=l.details,this.log("subtitle track "+n+" loaded ["+d.startSN+"-"+d.endSN+"]"),n===this.trackId&&(this.retryCount=0,this.playlistLoaded(n,l,p))},h.onLevelLoading=function(e,l){this.switchLevel(l.level)},h.onLevelSwitching=function(e,l){this.switchLevel(l.level)},h.switchLevel=function(e){var l=this.hls.levels[e];if(!(l!=null&&l.textGroupIds))return;var n=l.textGroupIds[l.urlId];if(this.groupId!==n){var d=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,c=this.tracks.filter(function(m){return!n||m.groupId===n});this.tracksInGroup=c;var g=this.findTrackId(d==null?void 0:d.name)||this.findTrackId();this.groupId=n;var p={subtitleTracks:c};this.log("Updating subtitle tracks, "+c.length+' track(s) found in "'+n+'" group-id'),this.hls.trigger(_.Events.SUBTITLE_TRACKS_UPDATED,p),g!==-1&&this.setSubtitleTrack(g,d)}},h.findTrackId=function(e){for(var l=this.tracksInGroup,n=0;n<l.length;n++){var d=l[n];if((!this.selectDefaultTrack||d.default)&&(!e||e===d.name))return d.id}return-1},h.onError=function(e,l){if(i.prototype.onError.call(this,e,l),l.fatal||!l.context)return;l.context.type===A.PlaylistContextType.SUBTITLE_TRACK&&l.context.id===this.trackId&&l.context.groupId===this.groupId&&this.retryLoadingOrFail(l)},h.loadPlaylist=function(e){var l=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(l)){var n=l.id,d=l.groupId,c=l.url;if(e)try{c=e.addDirectives(c)}catch(g){this.warn("Could not construct new URL with HLS Delivery Directives: "+g)}this.log("Loading subtitle playlist for id "+n),this.hls.trigger(_.Events.SUBTITLE_TRACK_LOADING,{url:c,id:n,groupId:d,deliveryDirectives:e||null})}},h.toggleTrackModes=function(e){var l=this,n=this.media,d=this.subtitleDisplay,c=this.trackId;if(!n)return;var g=t(n.textTracks),p=g.filter(function(y){return y.groupId===l.groupId});if(e===-1)[].slice.call(g).forEach(function(y){y.mode="disabled"});else{var m=p[c];m&&(m.mode="disabled")}var b=p[e];b&&(b.mode=d?"showing":"hidden")},h.setSubtitleTrack=function(e,l){var n,d=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=e;return}if(this.trackId!==e&&this.toggleTrackModes(e),this.trackId===e&&(e===-1||(n=d[e])!==null&&n!==void 0&&n.details)||e<-1||e>=d.length)return;this.clearTimer();var c=d[e];if(this.log("Switching to subtitle track "+e),this.trackId=e,c){var g=c.id,p=c.groupId,m=p===void 0?"":p,b=c.name,y=c.type,r=c.url;this.hls.trigger(_.Events.SUBTITLE_TRACK_SWITCH,{id:g,groupId:m,name:b,type:y,url:r});var x=this.switchParams(c.url,l==null?void 0:l.details);this.loadPlaylist(x)}else this.hls.trigger(_.Events.SUBTITLE_TRACK_SWITCH,{id:e})},h.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var e=-1,l=t(this.media.textTracks),n=0;n<l.length;n++)if(l[n].mode==="hidden")e=n;else if(l[n].mode==="showing"){e=n;break}this.subtitleTrack!==e&&(this.subtitleTrack=e)},v(s,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(e){this.selectDefaultTrack=!1;var l=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(e,l)}}]),s}(E.default);function t(i){for(var s=[],h=0;h<i.length;h++){var a=i[h];a.kind==="subtitles"&&a.label&&s.push(i[h])}return s}Z.default=o},"./src/controller/timeline-controller.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"TimelineController",function(){return t});var _=U("./src/polyfills/number.ts"),L=U("./src/events.ts"),E=U("./src/utils/cea-608-parser.ts"),A=U("./src/utils/output-filter.ts"),w=U("./src/utils/webvtt-parser.ts"),v=U("./src/utils/texttrack-utils.ts"),u=U("./src/utils/imsc1-ttml-parser.ts"),f=U("./src/types/loader.ts"),o=U("./src/utils/logger.ts"),t=function(){function a(l){if(this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.timescale=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=h(),this.captionsProperties=void 0,this.hls=l,this.config=l.config,this.Cues=l.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},this.config.enableCEA708Captions){var n=new A.default(this,"textTrack1"),d=new A.default(this,"textTrack2"),c=new A.default(this,"textTrack3"),g=new A.default(this,"textTrack4");this.cea608Parser1=new E.default(1,n,d),this.cea608Parser2=new E.default(3,c,g)}l.on(L.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),l.on(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),l.on(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.on(L.Events.MANIFEST_LOADED,this.onManifestLoaded,this),l.on(L.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),l.on(L.Events.FRAG_LOADING,this.onFragLoading,this),l.on(L.Events.FRAG_LOADED,this.onFragLoaded,this),l.on(L.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),l.on(L.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),l.on(L.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),l.on(L.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),l.on(L.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var e=a.prototype;return e.destroy=function(){var n=this.hls;n.off(L.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),n.off(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.off(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.off(L.Events.MANIFEST_LOADED,this.onManifestLoaded,this),n.off(L.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),n.off(L.Events.FRAG_LOADING,this.onFragLoading,this),n.off(L.Events.FRAG_LOADED,this.onFragLoaded,this),n.off(L.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),n.off(L.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),n.off(L.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),n.off(L.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),n.off(L.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},e.addCues=function(n,d,c,g,p){for(var m=!1,b=p.length;b--;){var y=p[b],r=s(y[0],y[1],d,c);if(r>=0&&(y[0]=Math.min(y[0],d),y[1]=Math.max(y[1],c),m=!0,r/(c-d)>.5))return}if(m||p.push([d,c]),this.config.renderTextTracksNatively){var x=this.captionsTracks[n];this.Cues.newCue(x,d,c,g)}else{var S=this.Cues.newCue(null,d,c,g);this.hls.trigger(L.Events.CUES_PARSED,{type:"captions",cues:S,track:n})}},e.onInitPtsFound=function(n,d){var c=this,g=d.frag,p=d.id,m=d.initPTS,b=d.timescale,y=this.unparsedVttFrags;p==="main"&&(this.initPTS[g.cc]=m,this.timescale[g.cc]=b),y.length&&(this.unparsedVttFrags=[],y.forEach(function(r){c.onFragLoaded(L.Events.FRAG_LOADED,r)}))},e.getExistingTrack=function(n){var d=this.media;if(d)for(var c=0;c<d.textTracks.length;c++){var g=d.textTracks[c];if(g[n])return g}return null},e.createCaptionsTrack=function(n){this.config.renderTextTracksNatively?this.createNativeTrack(n):this.createNonNativeTrack(n)},e.createNativeTrack=function(n){if(this.captionsTracks[n])return;var d=this.captionsProperties,c=this.captionsTracks,g=this.media,p=d[n],m=p.label,b=p.languageCode,y=this.getExistingTrack(n);if(y)c[n]=y,Object(v.clearCurrentCues)(c[n]),Object(v.sendAddTrackEvent)(c[n],g);else{var r=this.createTextTrack("captions",m,b);r&&(r[n]=!0,c[n]=r)}},e.createNonNativeTrack=function(n){if(this.nonNativeCaptionsTracks[n])return;var d=this.captionsProperties[n];if(!d)return;var c=d.label,g={_id:n,label:c,kind:"captions",default:d.media?!!d.media.default:!1,closedCaptions:d.media};this.nonNativeCaptionsTracks[n]=g,this.hls.trigger(L.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[g]})},e.createTextTrack=function(n,d,c){var g=this.media;return g?g.addTextTrack(n,d,c):void 0},e.onMediaAttaching=function(n,d){this.media=d.media,this._cleanTracks()},e.onMediaDetaching=function(){var n=this.captionsTracks;Object.keys(n).forEach(function(d){Object(v.clearCurrentCues)(n[d]),delete n[d]}),this.nonNativeCaptionsTracks={}},e.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=h(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=this.unparsedVttFrags||[],this.initPTS=[],this.timescale=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())},e._cleanTracks=function(){var n=this.media;if(!n)return;var d=n.textTracks;if(d)for(var c=0;c<d.length;c++)Object(v.clearCurrentCues)(d[c])},e.onSubtitleTracksUpdated=function(n,d){var c=this;this.textTracks=[];var g=d.subtitleTracks||[],p=g.some(function(r){return r.textCodec===u.IMSC1_CODEC});if(this.config.enableWebVTT||p&&this.config.enableIMSC1){var m=this.tracks&&g&&this.tracks.length===g.length;if(this.tracks=g||[],this.config.renderTextTracksNatively){var b=this.media?this.media.textTracks:[];this.tracks.forEach(function(r,x){var S;if(x<b.length){for(var T=null,R=0;R<b.length;R++)if(i(b[R],r)){T=b[R];break}T&&(S=T)}S?Object(v.clearCurrentCues)(S):(S=c.createTextTrack("subtitles",r.name,r.lang),S&&(S.mode="disabled")),S&&(S.groupId=r.groupId,c.textTracks.push(S))})}else if(!m&&this.tracks&&this.tracks.length){var y=this.tracks.map(function(r){return{label:r.name,kind:r.type.toLowerCase(),default:r.default,subtitleTrack:r}});this.hls.trigger(L.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:y})}}},e.onManifestLoaded=function(n,d){var c=this;this.config.enableCEA708Captions&&d.captions&&d.captions.forEach(function(g){var p=/(?:CC|SERVICE)([1-4])/.exec(g.instreamId);if(!p)return;var m="textTrack"+p[1],b=c.captionsProperties[m];if(!b)return;b.label=g.name,g.lang&&(b.languageCode=g.lang),b.media=g})},e.onFragLoading=function(n,d){var c=this.cea608Parser1,g=this.cea608Parser2,p=this.lastSn,m=this.lastPartIndex;if(!this.enabled||!(c&&g))return;if(d.frag.type===f.PlaylistLevelType.MAIN){var b,y,r=d.frag.sn,x=(b=d==null||((y=d.part)===null||y===void 0)?void 0:y.index)!=null?b:-1;r===p+1||r===p&&x===m+1||(c.reset(),g.reset()),this.lastSn=r,this.lastPartIndex=x}},e.onFragLoaded=function(n,d){var c=d.frag,g=d.payload,p=this.initPTS,m=this.unparsedVttFrags;if(c.type===f.PlaylistLevelType.SUBTITLE)if(g.byteLength){if(!Object(_.isFiniteNumber)(p[c.cc])){m.push(d),p.length&&this.hls.trigger(L.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:c,error:new Error("Missing initial subtitle PTS")});return}var b=c.decryptdata;if(b==null||b.key==null||b.method!=="AES-128"){var y=this.tracks[c.level],r=this.vttCCs;r[c.cc]||(r[c.cc]={start:c.start,prevCC:this.prevCC,new:!0},this.prevCC=c.cc),y&&y.textCodec===u.IMSC1_CODEC?this._parseIMSC1(c,g):this._parseVTTs(c,g,r)}}else this.hls.trigger(L.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:c,error:new Error("Empty subtitle payload")})},e._parseIMSC1=function(n,d){var c=this,g=this.hls;Object(u.parseIMSC1)(d,this.initPTS[n.cc],this.timescale[n.cc],function(p){c._appendCues(p,n.level),g.trigger(L.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:n})},function(p){o.logger.log("Failed to parse IMSC1: "+p),g.trigger(L.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:p})})},e._parseVTTs=function(n,d,c){var g=this,p=this.hls;Object(w.parseWebVTT)(d,this.initPTS[n.cc],this.timescale[n.cc],c,n.cc,n.start,function(m){g._appendCues(m,n.level),p.trigger(L.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:n})},function(m){g._fallbackToIMSC1(n,d),o.logger.log("Failed to parse VTT cue: "+m),p.trigger(L.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:m})})},e._fallbackToIMSC1=function(n,d){var c=this,g=this.tracks[n.level];g.textCodec||Object(u.parseIMSC1)(d,this.initPTS[n.cc],this.timescale[n.cc],function(){g.textCodec=u.IMSC1_CODEC,c._parseIMSC1(n,d)},function(){g.textCodec="wvtt"})},e._appendCues=function(n,d){var c=this.hls;if(this.config.renderTextTracksNatively){var g=this.textTracks[d];if(g.mode==="disabled")return;n.forEach(function(b){return Object(v.addCueToTrack)(g,b)})}else{var p=this.tracks[d],m=p.default?"default":"subtitles"+d;c.trigger(L.Events.CUES_PARSED,{type:"subtitles",cues:n,track:m})}},e.onFragDecrypted=function(n,d){var c=d.frag;if(c.type===f.PlaylistLevelType.SUBTITLE){if(!Object(_.isFiniteNumber)(this.initPTS[c.cc])){this.unparsedVttFrags.push(d);return}this.onFragLoaded(L.Events.FRAG_LOADED,d)}},e.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},e.onFragParsingUserdata=function(n,d){var c=this.cea608Parser1,g=this.cea608Parser2;if(!this.enabled||!(c&&g))return;for(var p=0;p<d.samples.length;p++){var m=d.samples[p].bytes;if(m){var b=this.extractCea608Data(m);c.addData(d.samples[p].pts,b[0]),g.addData(d.samples[p].pts,b[1])}}},e.onBufferFlushing=function(n,d){var c=d.startOffset,g=d.endOffset,p=d.endOffsetSubtitles,m=d.type,b=this.media;if(!b||b.currentTime<g)return;if(!m||m==="video"){var y=this.captionsTracks;Object.keys(y).forEach(function(x){return Object(v.removeCuesInRange)(y[x],c,g)})}if(this.config.renderTextTracksNatively&&(c===0&&p!==void 0)){var r=this.textTracks;Object.keys(r).forEach(function(x){return Object(v.removeCuesInRange)(r[x],c,p)})}},e.extractCea608Data=function(n){for(var d=n[0]&31,c=2,g=[[],[]],p=0;p<d;p++){var m=n[c++],b=127&n[c++],y=127&n[c++],r=(4&m)!==0,x=3&m;if(b===0&&y===0)continue;r&&((x===0||x===1)&&(g[x].push(b),g[x].push(y)))}return g},a}();function i(a,e){return a&&a.label===e.name&&!(a.textTrack1||a.textTrack2)}function s(a,e,l,n){return Math.min(e,n)-Math.max(a,l)}function h(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"default",function(){return _});var _=function(){function L(A,w){this.subtle=void 0,this.aesIV=void 0,this.subtle=A,this.aesIV=w}var E=L.prototype;return E.decrypt=function(w,v){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},v,w)},L}()},"./src/crypt/aes-decryptor.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"removePadding",function(){return L}),U.d(Z,"default",function(){return E});var _=U("./src/utils/typed-array.ts");function L(A){var w=A.byteLength,v=w&&new DataView(A.buffer).getUint8(w-1);return v?Object(_.sliceUint8)(A,0,w-v):A}var E=function(){function A(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}var w=A.prototype;return w.uint8ArrayToUint32Array_=function(u){for(var f=new DataView(u),o=new Uint32Array(4),t=0;t<4;t++)o[t]=f.getUint32(t*4);return o},w.initTable=function(){var u=this.sBox,f=this.invSBox,o=this.subMix,t=o[0],i=o[1],s=o[2],h=o[3],a=this.invSubMix,e=a[0],l=a[1],n=a[2],d=a[3],c=new Uint32Array(256),g=0,p=0,m=0;for(m=0;m<256;m++)m<128?c[m]=m<<1:c[m]=m<<1^283;for(m=0;m<256;m++){var b=p^p<<1^p<<2^p<<3^p<<4;b=b>>>8^b&255^99,u[g]=b,f[b]=g;var y=c[g],r=c[y],x=c[r],S=c[b]*257^b*16843008;t[g]=S<<24|S>>>8,i[g]=S<<16|S>>>16,s[g]=S<<8|S>>>24,h[g]=S,S=x*16843009^r*65537^y*257^g*16843008,e[b]=S<<24|S>>>8,l[b]=S<<16|S>>>16,n[b]=S<<8|S>>>24,d[b]=S,g?(g=y^c[c[c[x^y]]],p^=c[c[p]]):g=p=1}},w.expandKey=function(u){for(var f=this.uint8ArrayToUint32Array_(u),o=!0,t=0;t<f.length&&o;)o=f[t]===this.key[t],t++;if(o)return;this.key=f;var i=this.keySize=f.length;if(i!==4&&i!==6&&i!==8)throw new Error("Invalid aes key size="+i);var s=this.ksRows=(i+6+1)*4,h,a,e=this.keySchedule=new Uint32Array(s),l=this.invKeySchedule=new Uint32Array(s),n=this.sBox,d=this.rcon,c=this.invSubMix,g=c[0],p=c[1],m=c[2],b=c[3],y,r;for(h=0;h<s;h++){if(h<i){y=e[h]=f[h];continue}r=y,h%i===0?(r=r<<8|r>>>24,r=n[r>>>24]<<24|n[r>>>16&255]<<16|n[r>>>8&255]<<8|n[r&255],r^=d[h/i|0]<<24):i>6&&h%i===4&&(r=n[r>>>24]<<24|n[r>>>16&255]<<16|n[r>>>8&255]<<8|n[r&255]),e[h]=y=(e[h-i]^r)>>>0}for(a=0;a<s;a++)h=s-a,a&3?r=e[h]:r=e[h-4],a<4||h<=4?l[a]=r:l[a]=g[n[r>>>24]]^p[n[r>>>16&255]]^m[n[r>>>8&255]]^b[n[r&255]],l[a]=l[a]>>>0},w.networkToHostOrderSwap=function(u){return u<<24|(u&65280)<<8|(u&16711680)>>8|u>>>24},w.decrypt=function(u,f,o){for(var t=this.keySize+6,i=this.invKeySchedule,s=this.invSBox,h=this.invSubMix,a=h[0],e=h[1],l=h[2],n=h[3],d=this.uint8ArrayToUint32Array_(o),c=d[0],g=d[1],p=d[2],m=d[3],b=new Int32Array(u),y=new Int32Array(b.length),r,x,S,T,R,D,k,B,G,P,$,X,z,N,H=this.networkToHostOrderSwap;f<b.length;){for(G=H(b[f]),P=H(b[f+1]),$=H(b[f+2]),X=H(b[f+3]),R=G^i[0],D=X^i[1],k=$^i[2],B=P^i[3],z=4,N=1;N<t;N++)r=a[R>>>24]^e[D>>16&255]^l[k>>8&255]^n[B&255]^i[z],x=a[D>>>24]^e[k>>16&255]^l[B>>8&255]^n[R&255]^i[z+1],S=a[k>>>24]^e[B>>16&255]^l[R>>8&255]^n[D&255]^i[z+2],T=a[B>>>24]^e[R>>16&255]^l[D>>8&255]^n[k&255]^i[z+3],R=r,D=x,k=S,B=T,z=z+4;r=s[R>>>24]<<24^s[D>>16&255]<<16^s[k>>8&255]<<8^s[B&255]^i[z],x=s[D>>>24]<<24^s[k>>16&255]<<16^s[B>>8&255]<<8^s[R&255]^i[z+1],S=s[k>>>24]<<24^s[B>>16&255]<<16^s[R>>8&255]<<8^s[D&255]^i[z+2],T=s[B>>>24]<<24^s[R>>16&255]<<16^s[D>>8&255]<<8^s[k&255]^i[z+3],y[f]=H(r^c),y[f+1]=H(T^g),y[f+2]=H(S^p),y[f+3]=H(x^m),c=G,g=P,p=$,m=X,f=f+4}return y.buffer},A}()},"./src/crypt/decrypter.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"default",function(){return f});var _=U("./src/crypt/aes-crypto.ts"),L=U("./src/crypt/fast-aes-key.ts"),E=U("./src/crypt/aes-decryptor.ts"),A=U("./src/utils/logger.ts"),w=U("./src/utils/mp4-tools.ts"),v=U("./src/utils/typed-array.ts"),u=16,f=function(){function o(i,s,h){var a=h===void 0?{}:h,e=a.removePKCS7Padding,l=e===void 0?!0:e;if(this.logEnabled=!0,this.observer=void 0,this.config=void 0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.observer=i,this.config=s,this.removePKCS7Padding=l,l)try{var n=self.crypto;n&&(this.subtle=n.subtle||n.webkitSubtle)}catch(d){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var t=o.prototype;return t.destroy=function(){this.observer=null},t.isSync=function(){return this.config.enableSoftwareAES},t.flush=function(){var s=this.currentResult;if(!s){this.reset();return}var h=new Uint8Array(s);return this.reset(),this.removePKCS7Padding?Object(E.removePadding)(h):h},t.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},t.decrypt=function(s,h,a,e){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(s),h,a);var l=this.flush();l&&e(l.buffer)}else this.webCryptoDecrypt(new Uint8Array(s),h,a).then(e)},t.softwareDecrypt=function(s,h,a){var e=this.currentIV,l=this.currentResult,n=this.remainderData;this.logOnce("JS AES decrypt"),n&&(s=Object(w.appendUint8Array)(n,s),this.remainderData=null);var d=this.getValidChunk(s);if(!d.length)return null;e&&(a=e);var c=this.softwareDecrypter;c||(c=this.softwareDecrypter=new E.default),c.expandKey(h);var g=l;return this.currentResult=c.decrypt(d.buffer,0,a),this.currentIV=Object(v.sliceUint8)(d,-16).buffer,g||null},t.webCryptoDecrypt=function(s,h,a){var e=this,l=this.subtle;return(this.key!==h||!this.fastAesKey)&&(this.key=h,this.fastAesKey=new L.default(l,h)),this.fastAesKey.expandKey().then(function(n){if(!l)return Promise.reject(new Error("web crypto not initialized"));var d=new _.default(l,a);return d.decrypt(s.buffer,n)}).catch(function(n){return e.onWebCryptoError(n,s,h,a)})},t.onWebCryptoError=function(s,h,a,e){return A.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",s),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(h,a,e)},t.getValidChunk=function(s){var h=s,a=s.length-s.length%u;return a!==s.length&&(h=Object(v.sliceUint8)(s,0,a),this.remainderData=Object(v.sliceUint8)(s,a)),h},t.logOnce=function(s){if(!this.logEnabled)return;A.logger.log("[decrypter.ts]: "+s),this.logEnabled=!1},o}()},"./src/crypt/fast-aes-key.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"default",function(){return _});var _=function(){function L(A,w){this.subtle=void 0,this.key=void 0,this.subtle=A,this.key=w}var E=L.prototype;return E.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},L}()},"./src/demux/aacdemuxer.ts":function(Se,Z,U){"use strict";U.r(Z);var _=U("./src/demux/base-audio-demuxer.ts"),L=U("./src/demux/adts.ts"),E=U("./src/utils/logger.ts"),A=U("./src/demux/id3.ts");function w(f,o){f.prototype=Object.create(o.prototype),f.prototype.constructor=f,v(f,o)}function v(f,o){return v=Object.setPrototypeOf||function(i,s){return i.__proto__=s,i},v(f,o)}var u=function(f){w(o,f);function o(i,s){var h;return h=f.call(this)||this,h.observer=void 0,h.config=void 0,h.observer=i,h.config=s,h}var t=o.prototype;return t.resetInitSegment=function(s,h,a){f.prototype.resetInitSegment.call(this,s,h,a),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:s,duration:a,inputTimeScale:9e4,dropped:0}},o.probe=function(s){if(!s)return!1;for(var h=A.getID3Data(s,0)||[],a=h.length,e=s.length;a<e;a++)if(L.probe(s,a))return E.logger.log("ADTS sync word found !"),!0;return!1},t.canParse=function(s,h){return L.canParse(s,h)},t.appendFrame=function(s,h,a){L.initTrackConfig(s,this.observer,h,a,s.manifestCodec);var e=L.appendFrame(s,h,a,this.initPTS,this.frameIndex);if(e&&e.missing===0)return e},o}(_.default);u.minProbeByteLength=9,Z.default=u},"./src/demux/adts.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"getAudioConfig",function(){return A}),U.d(Z,"isHeaderPattern",function(){return w}),U.d(Z,"getHeaderLength",function(){return v}),U.d(Z,"getFullFrameLength",function(){return u}),U.d(Z,"canGetFrameLength",function(){return f}),U.d(Z,"isHeader",function(){return o}),U.d(Z,"canParse",function(){return t}),U.d(Z,"probe",function(){return i}),U.d(Z,"initTrackConfig",function(){return s}),U.d(Z,"getFrameDuration",function(){return h}),U.d(Z,"parseFrameHeader",function(){return a}),U.d(Z,"appendFrame",function(){return e});var _=U("./src/utils/logger.ts"),L=U("./src/errors.ts"),E=U("./src/events.ts");function A(l,n,d,c){var g,p,m,b,y=navigator.userAgent.toLowerCase(),r=c,x=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];g=((n[d+2]&192)>>>6)+1;var S=(n[d+2]&60)>>>2;if(S>x.length-1){l.trigger(E.Events.ERROR,{type:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+S});return}return m=(n[d+2]&1)<<2,m|=(n[d+3]&192)>>>6,_.logger.log("manifest codec:"+c+", ADTS type:"+g+", samplingIndex:"+S),/firefox/i.test(y)?S>=6?(g=5,b=new Array(4),p=S-3):(g=2,b=new Array(2),p=S):y.indexOf("android")!==-1?(g=2,b=new Array(2),p=S):(g=5,b=new Array(4),c&&(c.indexOf("mp4a.40.29")!==-1||c.indexOf("mp4a.40.5")!==-1)||!c&&S>=6?p=S-3:((c&&c.indexOf("mp4a.40.2")!==-1&&(S>=6&&m===1||/vivaldi/i.test(y))||!c&&m===1)&&(g=2,b=new Array(2)),p=S)),b[0]=g<<3,b[0]|=(S&14)>>1,b[1]|=(S&1)<<7,b[1]|=m<<3,g===5&&(b[1]|=(p&14)>>1,b[2]=(p&1)<<7,b[2]|=2<<2,b[3]=0),{config:b,samplerate:x[S],channelCount:m,codec:"mp4a.40."+g,manifestCodec:r}}function w(l,n){return l[n]===255&&(l[n+1]&246)===240}function v(l,n){return l[n+1]&1?7:9}function u(l,n){return(l[n+3]&3)<<11|l[n+4]<<3|(l[n+5]&224)>>>5}function f(l,n){return n+5<l.length}function o(l,n){return n+1<l.length&&w(l,n)}function t(l,n){return f(l,n)&&w(l,n)&&u(l,n)<=l.length-n}function i(l,n){if(o(l,n)){var d=v(l,n);if(n+d>=l.length)return!1;var c=u(l,n);if(c<=d)return!1;var g=n+c;return g===l.length||o(l,g)}return!1}function s(l,n,d,c,g){if(!l.samplerate){var p=A(n,d,c,g);if(!p)return;l.config=p.config,l.samplerate=p.samplerate,l.channelCount=p.channelCount,l.codec=p.codec,l.manifestCodec=p.manifestCodec,_.logger.log("parsed codec:"+l.codec+", rate:"+p.samplerate+", channels:"+p.channelCount)}}function h(l){return 1024*9e4/l}function a(l,n,d,c,g){var p=v(l,n),m=u(l,n);if(m-=p,m>0){var b=d+c*g;return{headerLength:p,frameLength:m,stamp:b}}}function e(l,n,d,c,g){var p=h(l.samplerate),m=a(n,d,c,g,p);if(m){var b=m.frameLength,y=m.headerLength,r=m.stamp,x=y+b,S=Math.max(0,d+x-n.length),T;S?(T=new Uint8Array(x-y),T.set(n.subarray(d+y,n.length),0)):T=n.subarray(d+y,d+x);var R={unit:T,pts:r};return S||l.samples.push(R),{sample:R,length:x,missing:S}}}},"./src/demux/base-audio-demuxer.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"initPTSFn",function(){return u});var _=U("./src/polyfills/number.ts"),L=U("./src/demux/id3.ts"),E=U("./src/demux/dummy-demuxed-track.ts"),A=U("./src/utils/mp4-tools.ts"),w=U("./src/utils/typed-array.ts"),v=function(){function f(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var o=f.prototype;return o.resetInitSegment=function(i,s,h){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},o.resetTimeStamp=function(){},o.resetContiguity=function(){},o.canParse=function(i,s){return!1},o.appendFrame=function(i,s,h){},o.demux=function(i,s){this.cachedData&&(i=Object(A.appendUint8Array)(this.cachedData,i),this.cachedData=null);var h=L.getID3Data(i,0),a=h?h.length:0,e,l,n=this._audioTrack,d=this._id3Track,c=h?L.getTimeStamp(h):void 0,g=i.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=u(c,s)),h&&h.length>0&&d.samples.push({pts:this.initPTS,dts:this.initPTS,data:h}),l=this.initPTS;a<g;){if(this.canParse(i,a)){var p=this.appendFrame(n,i,a);p?(this.frameIndex++,l=p.sample.pts,a+=p.length,e=a):a=g}else L.canParse(i,a)?(h=L.getID3Data(i,a),d.samples.push({pts:l,dts:l,data:h}),a+=h.length,e=a):a++;if(a===g&&e!==g){var m=Object(w.sliceUint8)(i,e);this.cachedData?this.cachedData=Object(A.appendUint8Array)(this.cachedData,m):this.cachedData=m}}return{audioTrack:n,avcTrack:Object(E.dummyTrack)(),id3Track:d,textTrack:Object(E.dummyTrack)()}},o.demuxSampleAes=function(i,s,h){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},o.flush=function(i){var s=this.cachedData;return s&&(this.cachedData=null,this.demux(s,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(E.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(E.dummyTrack)()}},o.destroy=function(){},f}(),u=function(o,t){return Object(_.isFiniteNumber)(o)?o*90:t*9e4};Z.default=v},"./src/demux/chunk-cache.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"default",function(){return _});var _=function(){function E(){this.chunks=[],this.dataLength=0}var A=E.prototype;return A.push=function(v){this.chunks.push(v),this.dataLength+=v.length},A.flush=function(){var v=this.chunks,u=this.dataLength,f;if(v.length)v.length===1?f=v[0]:f=L(v,u);else return new Uint8Array(0);return this.reset(),f},A.reset=function(){this.chunks.length=0,this.dataLength=0},E}();function L(E,A){for(var w=new Uint8Array(A),v=0,u=0;u<E.length;u++){var f=E[u];w.set(f,v),v+=f.length}return w}},"./src/demux/dummy-demuxed-track.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"dummyTrack",function(){return _});function _(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(Se,Z,U){"use strict";U.r(Z);var _=U("./src/utils/logger.ts"),L=function(){function E(w){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=w,this.bytesAvailable=w.byteLength,this.word=0,this.bitsAvailable=0}var A=E.prototype;return A.loadWord=function(){var v=this.data,u=this.bytesAvailable,f=v.byteLength-u,o=new Uint8Array(4),t=Math.min(4,u);if(t===0)throw new Error("no bytes available");o.set(v.subarray(f,f+t)),this.word=new DataView(o.buffer).getUint32(0),this.bitsAvailable=t*8,this.bytesAvailable-=t},A.skipBits=function(v){var u;this.bitsAvailable>v?(this.word<<=v,this.bitsAvailable-=v):(v-=this.bitsAvailable,u=v>>3,v-=u>>3,this.bytesAvailable-=u,this.loadWord(),this.word<<=v,this.bitsAvailable-=v)},A.readBits=function(v){var u=Math.min(this.bitsAvailable,v),f=this.word>>>32-u;return v>32&&_.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=u,this.bitsAvailable>0?this.word<<=u:this.bytesAvailable>0&&this.loadWord(),u=v-u,u>0&&this.bitsAvailable?f<<u|this.readBits(u):f},A.skipLZ=function(){var v;for(v=0;v<this.bitsAvailable;++v)if((this.word&2147483648>>>v)!==0)return this.word<<=v,this.bitsAvailable-=v,v;return this.loadWord(),v+this.skipLZ()},A.skipUEG=function(){this.skipBits(1+this.skipLZ())},A.skipEG=function(){this.skipBits(1+this.skipLZ())},A.readUEG=function(){var v=this.skipLZ();return this.readBits(v+1)-1},A.readEG=function(){var v=this.readUEG();return 1&v?1+v>>>1:-1*(v>>>1)},A.readBoolean=function(){return this.readBits(1)===1},A.readUByte=function(){return this.readBits(8)},A.readUShort=function(){return this.readBits(16)},A.readUInt=function(){return this.readBits(32)},A.skipScalingList=function(v){for(var u=8,f=8,o,t=0;t<v;t++)f!==0&&(o=this.readEG(),f=(u+o+256)%256),u=f===0?u:f},A.readSPS=function(){var v=0,u=0,f=0,o=0,t,i,s,h=this.readUByte.bind(this),a=this.readBits.bind(this),e=this.readUEG.bind(this),l=this.readBoolean.bind(this),n=this.skipBits.bind(this),d=this.skipEG.bind(this),c=this.skipUEG.bind(this),g=this.skipScalingList.bind(this);h();var p=h();if(a(5),n(3),h(),c(),p===100||p===110||p===122||p===244||p===44||p===83||p===86||p===118||p===128){var m=e();if(m===3&&n(1),c(),c(),n(1),l())for(i=m!==3?8:12,s=0;s<i;s++)l()&&(s<6?g(16):g(64))}c();var b=e();if(b===0)e();else if(b===1)for(n(1),d(),d(),t=e(),s=0;s<t;s++)d();c(),n(1);var y=e(),r=e(),x=a(1);x===0&&n(1),n(1),l()&&(v=e(),u=e(),f=e(),o=e());var S=[1,1];if(l()&&l()){var T=h();switch(T){case 1:S=[1,1];break;case 2:S=[12,11];break;case 3:S=[10,11];break;case 4:S=[16,11];break;case 5:S=[40,33];break;case 6:S=[24,11];break;case 7:S=[20,11];break;case 8:S=[32,11];break;case 9:S=[80,33];break;case 10:S=[18,11];break;case 11:S=[15,11];break;case 12:S=[64,33];break;case 13:S=[160,99];break;case 14:S=[4,3];break;case 15:S=[3,2];break;case 16:S=[2,1];break;case 255:{S=[h()<<8|h(),h()<<8|h()];break}}}return{width:Math.ceil((y+1)*16-v*2-u*2),height:(2-x)*(r+1)*16-(x?2:4)*(f+o),pixelRatio:S}},A.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},E}();Z.default=L},"./src/demux/id3.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"isHeader",function(){return _}),U.d(Z,"isFooter",function(){return L}),U.d(Z,"getID3Data",function(){return E}),U.d(Z,"canParse",function(){return w}),U.d(Z,"getTimeStamp",function(){return v}),U.d(Z,"isTimeStampFrame",function(){return u}),U.d(Z,"getID3Frames",function(){return o}),U.d(Z,"decodeFrame",function(){return t}),U.d(Z,"utf8ArrayToStr",function(){return e}),U.d(Z,"testables",function(){return l});var _=function(g,p){return p+10<=g.length&&(g[p]===73&&g[p+1]===68&&g[p+2]===51&&(g[p+3]<255&&g[p+4]<255&&(g[p+6]<128&&g[p+7]<128&&g[p+8]<128&&g[p+9]<128)))},L=function(g,p){return p+10<=g.length&&(g[p]===51&&g[p+1]===68&&g[p+2]===73&&(g[p+3]<255&&g[p+4]<255&&(g[p+6]<128&&g[p+7]<128&&g[p+8]<128&&g[p+9]<128)))},E=function(g,p){for(var m=p,b=0;_(g,p);){b+=10;var y=A(g,p+6);b+=y,L(g,p+10)&&(b+=10),p+=b}return b>0?g.subarray(m,m+b):void 0},A=function(g,p){var m=0;return m=(g[p]&127)<<21,m|=(g[p+1]&127)<<14,m|=(g[p+2]&127)<<7,m|=g[p+3]&127,m},w=function(g,p){return _(g,p)&&A(g,p+6)+10<=g.length-p},v=function(g){for(var p=o(g),m=0;m<p.length;m++){var b=p[m];if(u(b))return a(b)}return},u=function(g){return g&&g.key==="PRIV"&&g.info==="com.apple.streaming.transportStreamTimestamp"},f=function(g){var p=String.fromCharCode(g[0],g[1],g[2],g[3]),m=A(g,4),b=10;return{type:p,size:m,data:g.subarray(b,b+m)}},o=function(g){for(var p=0,m=[];_(g,p);){var b=A(g,p+6);p+=10;for(var y=p+b;p+8<y;){var r=f(g.subarray(p)),x=t(r);x&&m.push(x),p+=r.size+10}L(g,p)&&(p+=10)}return m},t=function(g){return g.type==="PRIV"?i(g):g.type[0]==="W"?h(g):s(g)},i=function(g){if(g.size<2)return;var p=e(g.data,!0),m=new Uint8Array(g.data.subarray(p.length+1));return{key:g.type,info:p,data:m.buffer}},s=function(g){if(g.size<2)return;if(g.type==="TXXX"){var p=1,m=e(g.data.subarray(p),!0);p+=m.length+1;var b=e(g.data.subarray(p));return{key:g.type,info:m,data:b}}var y=e(g.data.subarray(1));return{key:g.type,data:y}},h=function(g){if(g.type==="WXXX"){if(g.size<2)return;var p=1,m=e(g.data.subarray(p),!0);p+=m.length+1;var b=e(g.data.subarray(p));return{key:g.type,info:m,data:b}}var y=e(g.data);return{key:g.type,data:y}},a=function(g){if(g.data.byteLength===8){var p=new Uint8Array(g.data),m=p[3]&1,b=(p[4]<<23)+(p[5]<<15)+(p[6]<<7)+p[7];return b/=45,m&&(b+=4772185884e-2),Math.round(b)}return},e=function(g,p){p===void 0&&(p=!1);var m=d();if(m){var b=m.decode(g);if(p){var y=b.indexOf("\0");return y!==-1?b.substring(0,y):b}return b.replace(/\0/g,"")}for(var r=g.length,x,S,T,R="",D=0;D<r;){if(x=g[D++],x===0&&p)return R;if(x===0||x===3)continue;switch(x>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:R+=String.fromCharCode(x);break;case 12:case 13:S=g[D++],R+=String.fromCharCode((x&31)<<6|S&63);break;case 14:S=g[D++],T=g[D++],R+=String.fromCharCode((x&15)<<12|(S&63)<<6|(T&63)<<0);break;default:}}return R},l={decodeTextFrame:s},n;function d(){return!n&&typeof self.TextDecoder!="undefined"&&(n=new self.TextDecoder("utf-8")),n}},"./src/demux/mp3demuxer.ts":function(Se,Z,U){"use strict";U.r(Z);var _=U("./src/demux/base-audio-demuxer.ts"),L=U("./src/demux/id3.ts"),E=U("./src/utils/logger.ts"),A=U("./src/demux/mpegaudio.ts");function w(f,o){f.prototype=Object.create(o.prototype),f.prototype.constructor=f,v(f,o)}function v(f,o){return v=Object.setPrototypeOf||function(i,s){return i.__proto__=s,i},v(f,o)}var u=function(f){w(o,f);function o(){return f.apply(this,arguments)||this}var t=o.prototype;return t.resetInitSegment=function(s,h,a){f.prototype.resetInitSegment.call(this,s,h,a),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:s,duration:a,inputTimeScale:9e4,dropped:0}},o.probe=function(s){if(!s)return!1;for(var h=L.getID3Data(s,0)||[],a=h.length,e=s.length;a<e;a++)if(A.probe(s,a))return E.logger.log("MPEG Audio sync word found !"),!0;return!1},t.canParse=function(s,h){return A.canParse(s,h)},t.appendFrame=function(s,h,a){return this.initPTS===null?void 0:A.appendFrame(s,h,a,this.initPTS,this.frameIndex)},o}(_.default);u.minProbeByteLength=4,Z.default=u},"./src/demux/mp4demuxer.ts":function(Se,Z,U){"use strict";U.r(Z);var _=U("./src/utils/mp4-tools.ts"),L=U("./src/demux/dummy-demuxed-track.ts"),E=function(){function A(v,u){this.remainderData=null,this.config=void 0,this.config=u}var w=A.prototype;return w.resetTimeStamp=function(){},w.resetInitSegment=function(){},w.resetContiguity=function(){},A.probe=function(u){return Object(_.findBox)({data:u,start:0,end:Math.min(u.length,16384)},["moof"]).length>0},w.demux=function(u){var f=u,o=Object(L.dummyTrack)();if(this.config.progressive){this.remainderData&&(f=Object(_.appendUint8Array)(this.remainderData,u));var t=Object(_.segmentValidRange)(f);this.remainderData=t.remainder,o.samples=t.valid||new Uint8Array}else o.samples=f;return{audioTrack:Object(L.dummyTrack)(),avcTrack:o,id3Track:Object(L.dummyTrack)(),textTrack:Object(L.dummyTrack)()}},w.flush=function(){var u=Object(L.dummyTrack)();return u.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(L.dummyTrack)(),avcTrack:u,id3Track:Object(L.dummyTrack)(),textTrack:Object(L.dummyTrack)()}},w.demuxSampleAes=function(u,f,o){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},w.destroy=function(){},A}();E.minProbeByteLength=1024,Z.default=E},"./src/demux/mpegaudio.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"appendFrame",function(){return v}),U.d(Z,"parseHeader",function(){return u}),U.d(Z,"isHeaderPattern",function(){return f}),U.d(Z,"isHeader",function(){return o}),U.d(Z,"canParse",function(){return t}),U.d(Z,"probe",function(){return i});var _=null,L=[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],E=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],A=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],w=[0,1,1,4];function v(s,h,a,e,l){if(a+24>h.length)return;var n=u(h,a);if(n&&a+n.frameLength<=h.length){var d=n.samplesPerFrame*9e4/n.sampleRate,c=e+l*d,g={unit:h.subarray(a,a+n.frameLength),pts:c,dts:c};return s.config=[],s.channelCount=n.channelCount,s.samplerate=n.sampleRate,s.samples.push(g),{sample:g,length:n.frameLength,missing:0}}}function u(s,h){var a=s[h+1]>>3&3,e=s[h+1]>>1&3,l=s[h+2]>>4&15,n=s[h+2]>>2&3;if(a!==1&&l!==0&&l!==15&&n!==3){var d=s[h+2]>>1&1,c=s[h+3]>>6,g=a===3?3-e:e===3?3:4,p=L[g*14+l-1]*1e3,m=a===3?0:a===2?1:2,b=E[m*3+n],y=c===3?1:2,r=A[a][e],x=w[e],S=r*8*x,T=Math.floor(r*p/b+d)*x;if(_===null){var R=navigator.userAgent||"",D=R.match(/Chrome\/(\d+)/i);_=D?parseInt(D[1]):0}var k=!!_&&_<=87;return k&&e===2&&p>=224e3&&c===0&&(s[h+3]=s[h+3]|128),{sampleRate:b,channelCount:y,frameLength:T,samplesPerFrame:S}}}function f(s,h){return s[h]===255&&(s[h+1]&224)===224&&(s[h+1]&6)!==0}function o(s,h){return h+1<s.length&&f(s,h)}function t(s,h){var a=4;return f(s,h)&&a<=s.length-h}function i(s,h){if(h+1<s.length&&f(s,h)){var a=4,e=u(s,h),l=a;e!=null&&e.frameLength&&(l=e.frameLength);var n=h+l;return n===s.length||o(s,n)}return!1}},"./src/demux/sample-aes.ts":function(Se,Z,U){"use strict";U.r(Z);var _=U("./src/crypt/decrypter.ts"),L=U("./src/demux/tsdemuxer.ts"),E=function(){function A(v,u,f){this.keyData=void 0,this.decrypter=void 0,this.keyData=f,this.decrypter=new _.default(v,u,{removePKCS7Padding:!1})}var w=A.prototype;return w.decryptBuffer=function(u,f){this.decrypter.decrypt(u,this.keyData.key.buffer,this.keyData.iv.buffer,f)},w.decryptAacSample=function(u,f,o,t){var i=u[f].unit,s=i.subarray(16,i.length-i.length%16),h=s.buffer.slice(s.byteOffset,s.byteOffset+s.length),a=this;this.decryptBuffer(h,function(e){var l=new Uint8Array(e);i.set(l,16),t||a.decryptAacSamples(u,f+1,o)})},w.decryptAacSamples=function(u,f,o){for(;;f++){if(f>=u.length){o();return}if(u[f].unit.length<32)continue;var t=this.decrypter.isSync();if(this.decryptAacSample(u,f,o,t),!t)return}},w.getAvcEncryptedData=function(u){for(var f=Math.floor((u.length-48)/160)*16+16,o=new Int8Array(f),t=0,i=32;i<=u.length-16;i+=160,t+=16)o.set(u.subarray(i,i+16),t);return o},w.getAvcDecryptedUnit=function(u,f){for(var o=new Uint8Array(f),t=0,i=32;i<=u.length-16;i+=160,t+=16)u.set(o.subarray(t,t+16),i);return u},w.decryptAvcSample=function(u,f,o,t,i,s){var h=Object(L.discardEPB)(i.data),a=this.getAvcEncryptedData(h),e=this;this.decryptBuffer(a.buffer,function(l){i.data=e.getAvcDecryptedUnit(h,l),s||e.decryptAvcSamples(u,f,o+1,t)})},w.decryptAvcSamples=function(u,f,o,t){if(u instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;f++,o=0){if(f>=u.length){t();return}for(var i=u[f].units;!(o>=i.length);o++){var s=i[o];if(s.data.length<=48||s.type!==1&&s.type!==5)continue;var h=this.decrypter.isSync();if(this.decryptAvcSample(u,f,o,t,s,h),!h)return}}},A}();Z.default=E},"./src/demux/transmuxer-interface.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"default",function(){return i});var _=U("./node_modules/webworkify-webpack/index.js"),L=U.n(_),E=U("./src/events.ts"),A=U("./src/demux/transmuxer.ts"),w=U("./src/utils/logger.ts"),v=U("./src/errors.ts"),u=U("./src/utils/mediasource-helper.ts"),f=U("./node_modules/eventemitter3/index.js"),o=U.n(f),t=Object(u.getMediaSource)()||{isTypeSupported:function(){return!1}},i=function(){function s(a,e,l,n){var d=this;this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.worker=void 0,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.hls=a,this.id=e,this.onTransmuxComplete=l,this.onFlush=n;var c=a.config,g=function(r,x){x=x||{},x.frag=d.frag,x.id=d.id,a.trigger(r,x)};this.observer=new f.EventEmitter,this.observer.on(E.Events.FRAG_DECRYPTED,g),this.observer.on(E.Events.ERROR,g);var p={mp4:t.isTypeSupported("video/mp4"),mpeg:t.isTypeSupported("audio/mpeg"),mp3:t.isTypeSupported('audio/mp4; codecs="mp3"')},m=navigator.vendor;if(c.enableWorker&&typeof Worker!="undefined"){w.logger.log("demuxing in webworker");var b;try{b=this.worker=_("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),b.addEventListener("message",this.onwmsg),b.onerror=function(y){a.trigger(E.Events.ERROR,{type:v.ErrorTypes.OTHER_ERROR,details:v.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(y.message+" ("+y.filename+":"+y.lineno+")")})},b.postMessage({cmd:"init",typeSupported:p,vendor:m,id:e,config:JSON.stringify(c)})}catch(y){w.logger.warn("Error in worker:",y),w.logger.error("Error while initializing DemuxerWorker, fallback to inline"),b&&self.URL.revokeObjectURL(b.objectURL),this.transmuxer=new A.default(this.observer,p,c,m,e),this.worker=null}}else this.transmuxer=new A.default(this.observer,p,c,m,e)}var h=s.prototype;return h.destroy=function(){var e=this.worker;if(e)e.removeEventListener("message",this.onwmsg),e.terminate(),this.worker=null;else{var l=this.transmuxer;l&&(l.destroy(),this.transmuxer=null)}var n=this.observer;n&&n.removeAllListeners(),this.observer=null},h.push=function(e,l,n,d,c,g,p,m,b,y){var r=this;b.transmuxing.start=self.performance.now();var x=this.transmuxer,S=this.worker,T=g?g.start:c.start,R=c.decryptdata,D=this.frag,k=!(D&&c.cc===D.cc),B=!(D&&b.level===D.level),G=D?b.sn-D.sn:-1,P=this.part?b.part-this.part.index:1,$=!B&&(G===1||G===0&&P===1),X=self.performance.now();(B||G||c.stats.parsing.start===0)&&(c.stats.parsing.start=X),g&&(P||!$)&&(g.stats.parsing.start=X);var z=new A.TransmuxState(k,$,m,B,T);if(!$||k){w.logger.log("[transmuxer-interface, "+c.type+"]: Starting new transmux session for sn: "+b.sn+" p: "+b.part+" level: "+b.level+" id: "+b.id+`
|
|
|
discontinuity: `+k+`
|
|
|
trackSwitch: `+B+`
|
|
|
contiguous: `+$+`
|
|
|
accurateTimeOffset: `+m+`
|
|
|
timeOffset: `+T);var N=new A.TransmuxConfig(n,d,l,p,y);this.configureTransmuxer(N)}if(this.frag=c,this.part=g,S)S.postMessage({cmd:"demux",data:e,decryptdata:R,chunkMeta:b,state:z},e instanceof ArrayBuffer?[e]:[]);else if(x){var H=x.push(e,R,b,z);Object(A.isPromise)(H)?H.then(function(q){r.handleTransmuxComplete(q)}):this.handleTransmuxComplete(H)}},h.flush=function(e){var l=this;e.transmuxing.start=self.performance.now();var n=this.transmuxer,d=this.worker;if(d)d.postMessage({cmd:"flush",chunkMeta:e});else if(n){var c=n.flush(e);Object(A.isPromise)(c)?c.then(function(g){l.handleFlushResult(g,e)}):this.handleFlushResult(c,e)}},h.handleFlushResult=function(e,l){var n=this;e.forEach(function(d){n.handleTransmuxComplete(d)}),this.onFlush(l)},h.onWorkerMessage=function(e){var l=e.data,n=this.hls;switch(l.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(l.data);break}case"flush":{this.onFlush(l.data);break}default:{l.data=l.data||{},l.data.frag=this.frag,l.data.id=this.id,n.trigger(l.event,l.data);break}}},h.configureTransmuxer=function(e){var l=this.worker,n=this.transmuxer;l?l.postMessage({cmd:"configure",config:e}):n&&n.configure(e)},h.handleTransmuxComplete=function(e){e.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(e)},s}()},"./src/demux/transmuxer-worker.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"default",function(){return v});var _=U("./src/demux/transmuxer.ts"),L=U("./src/events.ts"),E=U("./src/utils/logger.ts"),A=U("./node_modules/eventemitter3/index.js"),w=U.n(A);function v(i){var s=new A.EventEmitter,h=function(e,l){i.postMessage({event:e,data:l})};s.on(L.Events.FRAG_DECRYPTED,h),s.on(L.Events.ERROR,h),i.addEventListener("message",function(a){var e=a.data;switch(e.cmd){case"init":{var l=JSON.parse(e.config);i.transmuxer=new _.default(s,e.typeSupported,l,e.vendor,e.id),Object(E.enableLogs)(l.debug),h("init",null);break}case"configure":{i.transmuxer.configure(e.config);break}case"demux":{var n=i.transmuxer.push(e.data,e.decryptdata,e.chunkMeta,e.state);Object(_.isPromise)(n)?n.then(function(g){u(i,g)}):u(i,n);break}case"flush":{var d=e.chunkMeta,c=i.transmuxer.flush(d);Object(_.isPromise)(c)?c.then(function(g){o(i,g,d)}):o(i,c,d);break}default:break}})}function u(i,s){if(t(s.remuxResult))return;var h=[],a=s.remuxResult,e=a.audio,l=a.video;e&&f(h,e),l&&f(h,l),i.postMessage({event:"transmuxComplete",data:s},h)}function f(i,s){s.data1&&i.push(s.data1.buffer),s.data2&&i.push(s.data2.buffer)}function o(i,s,h){s.forEach(function(a){u(i,a)}),i.postMessage({event:"flush",data:h})}function t(i){return!i.audio&&!i.video&&!i.text&&!i.id3&&!i.initSegment}},"./src/demux/transmuxer.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"default",function(){return l}),U.d(Z,"isPromise",function(){return c}),U.d(Z,"TransmuxConfig",function(){return g}),U.d(Z,"TransmuxState",function(){return p});var _=U("./src/events.ts"),L=U("./src/errors.ts"),E=U("./src/crypt/decrypter.ts"),A=U("./src/demux/aacdemuxer.ts"),w=U("./src/demux/mp4demuxer.ts"),v=U("./src/demux/tsdemuxer.ts"),u=U("./src/demux/mp3demuxer.ts"),f=U("./src/remux/mp4-remuxer.ts"),o=U("./src/remux/passthrough-remuxer.ts"),t=U("./src/demux/chunk-cache.ts"),i=U("./src/utils/mp4-tools.ts"),s=U("./src/utils/logger.ts"),h;try{h=self.performance.now.bind(self.performance)}catch(m){s.logger.debug("Unable to use Performance API on this environment"),h=self.Date.now}var a=[{demux:v.default,remux:f.default},{demux:w.default,remux:o.default},{demux:A.default,remux:f.default},{demux:u.default,remux:f.default}],e=1024;a.forEach(function(m){var b=m.demux;e=Math.max(e,b.minProbeByteLength)});var l=function(){function m(y,r,x,S,T){this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.cache=new t.default,this.observer=y,this.typeSupported=r,this.config=x,this.vendor=S,this.id=T}var b=m.prototype;return b.configure=function(r){this.transmuxConfig=r,this.decrypter&&this.decrypter.reset()},b.push=function(r,x,S,T){var R=this,D=S.transmuxing;D.executeStart=h();var k=new Uint8Array(r),B=this.cache,G=this.config,P=this.currentTransmuxState,$=this.transmuxConfig;T&&(this.currentTransmuxState=T);var X=n(k,x);if(X&&X.method==="AES-128"){var z=this.getDecrypter();if(G.enableSoftwareAES){var N=z.softwareDecrypt(k,X.key.buffer,X.iv.buffer);if(!N)return D.executeEnd=h(),d(S);k=new Uint8Array(N)}else return this.decryptionPromise=z.webCryptoDecrypt(k,X.key.buffer,X.iv.buffer).then(function(be){var Ee=R.push(be,null,S);return R.decryptionPromise=null,Ee}),this.decryptionPromise}var H=T||P,q=H.contiguous,ee=H.discontinuity,fe=H.trackSwitch,oe=H.accurateTimeOffset,he=H.timeOffset,se=$.audioCodec,ge=$.videoCodec,ie=$.defaultInitPts,re=$.duration,Q=$.initSegmentData;if((ee||fe)&&this.resetInitSegment(Q,se,ge,re),ee&&this.resetInitialTimestamp(ie),q||this.resetContiguity(),this.needsProbing(k,ee,fe)){if(B.dataLength){var pe=B.flush();k=Object(i.appendUint8Array)(pe,k)}this.configureTransmuxer(k,$)}var ne=this.transmux(k,X,he,oe,S),J=this.currentTransmuxState;return J.contiguous=!0,J.discontinuity=!1,J.trackSwitch=!1,D.executeEnd=h(),ne},b.flush=function(r){var x=this,S=r.transmuxing;S.executeStart=h();var T=this.decrypter,R=this.cache,D=this.currentTransmuxState,k=this.decryptionPromise;if(k)return k.then(function(){return x.flush(r)});var B=[],G=D.timeOffset;if(T){var P=T.flush();P&&B.push(this.push(P,null,r))}var $=R.dataLength;R.reset();var X=this.demuxer,z=this.remuxer;if(!X||!z)return $>=e&&this.observer.emit(_.Events.ERROR,_.Events.ERROR,{type:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),S.executeEnd=h(),[d(r)];var N=X.flush(G);return c(N)?N.then(function(H){return x.flushRemux(B,H,r),B}):(this.flushRemux(B,N,r),B)},b.flushRemux=function(r,x,S){var T=x.audioTrack,R=x.avcTrack,D=x.id3Track,k=x.textTrack,B=this.currentTransmuxState,G=B.accurateTimeOffset,P=B.timeOffset;s.logger.log("[transmuxer.ts]: Flushed fragment "+S.sn+(S.part>-1?" p: "+S.part:"")+" of level "+S.level);var $=this.remuxer.remux(T,R,D,k,P,G,!0,this.id);r.push({remuxResult:$,chunkMeta:S}),S.transmuxing.executeEnd=h()},b.resetInitialTimestamp=function(r){var x=this.demuxer,S=this.remuxer;if(!x||!S)return;x.resetTimeStamp(r),S.resetTimeStamp(r)},b.resetContiguity=function(){var r=this.demuxer,x=this.remuxer;if(!r||!x)return;r.resetContiguity(),x.resetNextTimestamp()},b.resetInitSegment=function(r,x,S,T){var R=this.demuxer,D=this.remuxer;if(!R||!D)return;R.resetInitSegment(x,S,T),D.resetInitSegment(r,x,S)},b.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},b.transmux=function(r,x,S,T,R){var D;return x&&x.method==="SAMPLE-AES"?D=this.transmuxSampleAes(r,x,S,T,R):D=this.transmuxUnencrypted(r,S,T,R),D},b.transmuxUnencrypted=function(r,x,S,T){var R=this.demuxer.demux(r,x,!1,!this.config.progressive),D=R.audioTrack,k=R.avcTrack,B=R.id3Track,G=R.textTrack,P=this.remuxer.remux(D,k,B,G,x,S,!1,this.id);return{remuxResult:P,chunkMeta:T}},b.transmuxSampleAes=function(r,x,S,T,R){var D=this;return this.demuxer.demuxSampleAes(r,x,S).then(function(k){var B=D.remuxer.remux(k.audioTrack,k.avcTrack,k.id3Track,k.textTrack,S,T,!1,D.id);return{remuxResult:B,chunkMeta:R}})},b.configureTransmuxer=function(r,x){for(var S=this.config,T=this.observer,R=this.typeSupported,D=this.vendor,k=x.audioCodec,B=x.defaultInitPts,G=x.duration,P=x.initSegmentData,$=x.videoCodec,X,z=0,N=a.length;z<N;z++)if(a[z].demux.probe(r)){X=a[z];break}X||(s.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),X={demux:w.default,remux:o.default});var H=this.demuxer,q=this.remuxer,ee=X.remux,fe=X.demux;(!q||!(q instanceof ee))&&(this.remuxer=new ee(T,S,R,D)),(!H||!(H instanceof fe))&&(this.demuxer=new fe(T,S,R),this.probe=fe.probe),this.resetInitSegment(P,k,$,G),this.resetInitialTimestamp(B)},b.needsProbing=function(r,x,S){return!this.demuxer||!this.remuxer||x||S},b.getDecrypter=function(){var r=this.decrypter;return r||(r=this.decrypter=new E.default(this.observer,this.config)),r},m}();function n(m,b){var y=null;return m.byteLength>0&&b!=null&&b.key!=null&&b.iv!==null&&b.method!=null&&(y=b),y}var d=function(b){return{remuxResult:{},chunkMeta:b}};function c(m){return"then"in m&&m.then instanceof Function}var g=function(b,y,r,x,S){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=b,this.videoCodec=y,this.initSegmentData=r,this.duration=x,this.defaultInitPts=S},p=function(b,y,r,x,S){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=b,this.contiguous=y,this.accurateTimeOffset=r,this.trackSwitch=x,this.timeOffset=S}},"./src/demux/tsdemuxer.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"discardEPB",function(){return d});var _=U("./src/demux/adts.ts"),L=U("./src/demux/mpegaudio.ts"),E=U("./src/demux/exp-golomb.ts"),A=U("./src/demux/id3.ts"),w=U("./src/demux/sample-aes.ts"),v=U("./src/events.ts"),u=U("./src/utils/mp4-tools.ts"),f=U("./src/utils/logger.ts"),o=U("./src/errors.ts"),t={video:1,audio:2,id3:3,text:4},i=function(){function c(p,m,b){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this.aacLastPTS=null,this._initPTS=null,this._initDTS=null,this._pmtId=-1,this._avcTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.observer=p,this.config=m,this.typeSupported=b}c.probe=function(m){var b=c.syncOffset(m);return b<0?!1:(b&&f.logger.warn("MPEG2-TS detected but first sync word found @ offset "+b+", junk ahead ?"),!0)},c.syncOffset=function(m){for(var b=Math.min(1e3,m.length-3*188),y=0;y<b;){if(m[y]===71&&m[y+188]===71&&m[y+2*188]===71)return y;y++}return-1},c.createTrack=function(m,b){return{container:m==="video"||m==="audio"?"video/mp2t":void 0,type:m,id:t[m],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:m==="audio"?b:void 0}};var g=c.prototype;return g.resetInitSegment=function(m,b,y){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=c.createTrack("video",y),this._audioTrack=c.createTrack("audio",y),this._id3Track=c.createTrack("id3",y),this._txtTrack=c.createTrack("text",y),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=m,this.videoCodec=b,this._duration=y},g.resetTimeStamp=function(){},g.resetContiguity=function(){var m=this._audioTrack,b=this._avcTrack,y=this._id3Track;m&&(m.pesData=null),b&&(b.pesData=null),y&&(y.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},g.demux=function(m,b,y,r){y===void 0&&(y=!1),r===void 0&&(r=!1),y||(this.sampleAes=null);var x,S=this._avcTrack,T=this._audioTrack,R=this._id3Track,D=S.pid,k=S.pesData,B=T.pid,G=R.pid,P=T.pesData,$=R.pesData,X=!1,z=this.pmtParsed,N=this._pmtId,H=m.length;if(this.remainderData&&(m=Object(u.appendUint8Array)(this.remainderData,m),H=m.length,this.remainderData=null),H<188&&!r)return this.remainderData=m,{audioTrack:T,avcTrack:S,id3Track:R,textTrack:this._txtTrack};var q=Math.max(0,c.syncOffset(m));H-=(H+q)%188,H<m.byteLength&&!r&&(this.remainderData=new Uint8Array(m.buffer,H,m.buffer.byteLength-H));for(var ee=q;ee<H;ee+=188)if(m[ee]===71){var fe=!!(m[ee+1]&64),oe=((m[ee+1]&31)<<8)+m[ee+2],he=(m[ee+3]&48)>>4,se=void 0;if(he>1){if(se=ee+5+m[ee+4],se===ee+188)continue}else se=ee+4;switch(oe){case D:fe&&(k&&(x=e(k))&&this.parseAVCPES(x,!1),k={data:[],size:0}),k&&(k.data.push(m.subarray(se,ee+188)),k.size+=ee+188-se);break;case B:fe&&(P&&(x=e(P))&&(T.isAAC?this.parseAACPES(x):this.parseMPEGPES(x)),P={data:[],size:0}),P&&(P.data.push(m.subarray(se,ee+188)),P.size+=ee+188-se);break;case G:fe&&($&&(x=e($))&&this.parseID3PES(x),$={data:[],size:0}),$&&($.data.push(m.subarray(se,ee+188)),$.size+=ee+188-se);break;case 0:fe&&(se+=m[se]+1),N=this._pmtId=h(m,se);break;case N:{fe&&(se+=m[se]+1);var ge=a(m,se,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,y);D=ge.avc,D>0&&(S.pid=D),B=ge.audio,B>0&&(T.pid=B,T.isAAC=ge.isAAC),G=ge.id3,G>0&&(R.pid=G),X&&!z&&(f.logger.log("reparse from beginning"),X=!1,ee=q-188),z=this.pmtParsed=!0;break}case 17:case 8191:break;default:X=!0;break}}else this.observer.emit(v.Events.ERROR,v.Events.ERROR,{type:o.ErrorTypes.MEDIA_ERROR,details:o.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});S.pesData=k,T.pesData=P,R.pesData=$;var ie={audioTrack:T,avcTrack:S,id3Track:R,textTrack:this._txtTrack};return r&&this.extractRemainingSamples(ie),ie},g.flush=function(){var m=this.remainderData;this.remainderData=null;var b;return m?b=this.demux(m,-1,!1,!0):b={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(b),this.sampleAes?this.decrypt(b,this.sampleAes):b},g.extractRemainingSamples=function(m){var b=m.audioTrack,y=m.avcTrack,r=m.id3Track,x=y.pesData,S=b.pesData,T=r.pesData,R;x&&(R=e(x))?(this.parseAVCPES(R,!0),y.pesData=null):y.pesData=x,S&&(R=e(S))?(b.isAAC?this.parseAACPES(R):this.parseMPEGPES(R),b.pesData=null):(S!=null&&S.size&&f.logger.log("last AAC PES packet truncated,might overlap between fragments"),b.pesData=S),T&&(R=e(T))?(this.parseID3PES(R),r.pesData=null):r.pesData=T},g.demuxSampleAes=function(m,b,y){var r=this.demux(m,y,!0,!this.config.progressive),x=this.sampleAes=new w.default(this.observer,this.config,b);return this.decrypt(r,x)},g.decrypt=function(m,b){return new Promise(function(y){var r=m.audioTrack,x=m.avcTrack;r.samples&&r.isAAC?b.decryptAacSamples(r.samples,0,function(){x.samples?b.decryptAvcSamples(x.samples,0,0,function(){y(m)}):y(m)}):x.samples&&b.decryptAvcSamples(x.samples,0,0,function(){y(m)})})},g.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},g.parseAVCPES=function(m,b){var y=this,r=this._avcTrack,x=this.parseAVCNALu(m.data),S=!1,T=this.avcSample,R,D=!1;m.data=null,T&&x.length&&!r.audFound&&(l(T,r),T=this.avcSample=s(!1,m.pts,m.dts,"")),x.forEach(function(k){switch(k.type){case 1:{R=!0,T||(T=y.avcSample=s(!0,m.pts,m.dts,"")),S&&(T.debug+="NDR "),T.frame=!0;var B=k.data;if(D&&B.length>4){var G=new E.default(B).readSliceType();(G===2||G===4||G===7||G===9)&&(T.key=!0)}break}case 5:R=!0,T||(T=y.avcSample=s(!0,m.pts,m.dts,"")),S&&(T.debug+="IDR "),T.key=!0,T.frame=!0;break;case 6:{R=!0,S&&T&&(T.debug+="SEI ");var P=new E.default(d(k.data));P.readUByte();for(var $=0,X=0,z=!1,N=0;!z&&P.bytesAvailable>1;){$=0;do N=P.readUByte(),$+=N;while(N===255);X=0;do N=P.readUByte(),X+=N;while(N===255);if($===4&&P.bytesAvailable!==0){z=!0;var H=P.readUByte();if(H===181){var q=P.readUShort();if(q===49){var ee=P.readUInt();if(ee===1195456820){var fe=P.readUByte();if(fe===3){for(var oe=P.readUByte(),he=P.readUByte(),se=31&oe,ge=[oe,he],ie=0;ie<se;ie++)ge.push(P.readUByte()),ge.push(P.readUByte()),ge.push(P.readUByte());n(y._txtTrack.samples,{type:3,pts:m.pts,bytes:ge})}}}}}else if($===5&&P.bytesAvailable!==0){if(z=!0,X>16){for(var re=[],Q=0;Q<16;Q++)re.push(P.readUByte().toString(16)),(Q===3||Q===5||Q===7||Q===9)&&re.push("-");for(var pe=X-16,ne=new Uint8Array(pe),J=0;J<pe;J++)ne[J]=P.readUByte();n(y._txtTrack.samples,{pts:m.pts,payloadType:$,uuid:re.join(""),userData:Object(A.utf8ArrayToStr)(ne),userDataBytes:ne})}}else if(X<P.bytesAvailable)for(var be=0;be<X;be++)P.readUByte()}break}case 7:if(R=!0,D=!0,S&&T&&(T.debug+="SPS "),!r.sps){var Ee=new E.default(k.data),Le=Ee.readSPS();r.width=Le.width,r.height=Le.height,r.pixelRatio=Le.pixelRatio,r.sps=[k.data],r.duration=y._duration;for(var V=k.data.subarray(1,4),C="avc1.",O=0;O<3;O++){var j=V[O].toString(16);j.length<2&&(j="0"+j),C+=j}r.codec=C}break;case 8:R=!0,S&&T&&(T.debug+="PPS "),r.pps||(r.pps=[k.data]);break;case 9:R=!1,r.audFound=!0,T&&l(T,r),T=y.avcSample=s(!1,m.pts,m.dts,S?"AUD ":"");break;case 12:R=!1;break;default:R=!1,T&&(T.debug+="unknown NAL "+k.type+" ");break}if(T&&R){var M=T.units;M.push(k)}}),b&&T&&(l(T,r),this.avcSample=null)},g.getLastNalUnit=function(){var m,b=this.avcSample,y;if(!b||b.units.length===0){var r=this._avcTrack.samples;b=r[r.length-1]}if((m=b)!==null&&m!==void 0&&m.units){var x=b.units;y=x[x.length-1]}return y},g.parseAVCNALu=function(m){var b=m.byteLength,y=this._avcTrack,r=y.naluState||0,x=r,S=[],T=0,R,D,k,B=-1,G=0;for(r===-1&&(B=0,G=m[0]&31,r=0,T=1);T<b;){if(R=m[T++],!r){r=R?0:1;continue}if(r===1){r=R?0:2;continue}if(!R)r=3;else if(R===1){if(B>=0){var P={data:m.subarray(B,T-r-1),type:G};S.push(P)}else{var $=this.getLastNalUnit();if($&&(x&&T<=4-x&&($.state&&($.data=$.data.subarray(0,$.data.byteLength-x))),D=T-r-1,D>0)){var X=new Uint8Array($.data.byteLength+D);X.set($.data,0),X.set(m.subarray(0,D),$.data.byteLength),$.data=X,$.state=0}}T<b?(k=m[T]&31,B=T,G=k,r=0):r=-1}else r=0}if(B>=0&&r>=0){var z={data:m.subarray(B,b),type:G,state:r};S.push(z)}if(S.length===0){var N=this.getLastNalUnit();if(N){var H=new Uint8Array(N.data.byteLength+m.byteLength);H.set(N.data,0),H.set(m,N.data.byteLength),N.data=H}}return y.naluState=r,S},g.parseAACPES=function(m){var b=0,y=this._audioTrack,r=this.aacOverFlow,x=m.data;if(r){this.aacOverFlow=null;var S=r.sample.unit.byteLength,T=Math.min(r.missing,S),R=S-T;r.sample.unit.set(x.subarray(0,T),R),y.samples.push(r.sample),b=r.missing}var D,k;for(D=b,k=x.length;D<k-1&&!_.isHeader(x,D);D++);if(D!==b){var B,G;if(D<k-1?(B="AAC PES did not start with ADTS header,offset:"+D,G=!1):(B="no ADTS header found in AAC PES",G=!0),f.logger.warn("parsing error:"+B),this.observer.emit(v.Events.ERROR,v.Events.ERROR,{type:o.ErrorTypes.MEDIA_ERROR,details:o.ErrorDetails.FRAG_PARSING_ERROR,fatal:G,reason:B}),G)return}_.initTrackConfig(y,this.observer,x,D,this.audioCodec);var P;if(m.pts!==void 0)P=m.pts;else if(r){var $=_.getFrameDuration(y.samplerate);P=r.sample.pts+$}else{f.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var X=0;D<k;)if(_.isHeader(x,D)){if(D+5<k){var z=_.appendFrame(y,x,D,P,X);if(z)if(z.missing)this.aacOverFlow=z;else{D+=z.length,X++;continue}}break}else D++},g.parseMPEGPES=function(m){var b=m.data,y=b.length,r=0,x=0,S=m.pts;if(S===void 0){f.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;x<y;)if(L.isHeader(b,x)){var T=L.appendFrame(this._audioTrack,b,x,S,r);if(T)x+=T.length,r++;else break}else x++},g.parseID3PES=function(m){if(m.pts===void 0){f.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(m)},c}();i.minProbeByteLength=188;function s(c,g,p,m){return{key:c,frame:!1,pts:g,dts:p,units:[],debug:m,length:0}}function h(c,g){return(c[g+10]&31)<<8|c[g+11]}function a(c,g,p,m){var b={audio:-1,avc:-1,id3:-1,isAAC:!0},y=(c[g+1]&15)<<8|c[g+2],r=g+3+y-4,x=(c[g+10]&15)<<8|c[g+11];for(g+=12+x;g<r;){var S=(c[g+1]&31)<<8|c[g+2];switch(c[g]){case 207:if(!m){f.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:b.audio===-1&&(b.audio=S);break;case 21:b.id3===-1&&(b.id3=S);break;case 219:if(!m){f.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:b.avc===-1&&(b.avc=S);break;case 3:case 4:p?b.audio===-1&&(b.audio=S,b.isAAC=!1):f.logger.log("MPEG audio found, not supported in this browser");break;case 36:f.logger.warn("Unsupported HEVC stream type found");break;default:break}g+=((c[g+3]&15)<<8|c[g+4])+5}return b}function e(c){var g=0,p,m,b,y,r,x=c.data;if(!c||c.size===0)return null;for(;x[0].length<19&&x.length>1;){var S=new Uint8Array(x[0].length+x[1].length);S.set(x[0]),S.set(x[1],x[0].length),x[0]=S,x.splice(1,1)}p=x[0];var T=(p[0]<<16)+(p[1]<<8)+p[2];if(T===1){if(m=(p[4]<<8)+p[5],m&&m>c.size-6)return null;var R=p[7];R&192&&(y=(p[9]&14)*536870912+(p[10]&255)*4194304+(p[11]&254)*16384+(p[12]&255)*128+(p[13]&254)/2,R&64?(r=(p[14]&14)*536870912+(p[15]&255)*4194304+(p[16]&254)*16384+(p[17]&255)*128+(p[18]&254)/2,y-r>60*9e4&&(f.logger.warn(Math.round((y-r)/9e4)+"s delta between PTS and DTS, align them"),y=r)):r=y),b=p[8];var D=b+9;if(c.size<=D)return null;c.size-=D;for(var k=new Uint8Array(c.size),B=0,G=x.length;B<G;B++){p=x[B];var P=p.byteLength;if(D)if(D>P){D-=P;continue}else p=p.subarray(D),P-=D,D=0;k.set(p,g),g+=P}return m&&(m-=b+3),{data:k,pts:y,dts:r,len:m}}return null}function l(c,g){if(c.units.length&&c.frame){if(c.pts===void 0){var p=g.samples,m=p.length;if(m){var b=p[m-1];c.pts=b.pts,c.dts=b.dts}else{g.dropped++;return}}g.samples.push(c)}c.debug.length&&f.logger.log(c.pts+"/"+c.dts+":"+c.debug)}function n(c,g){var p=c.length;if(p>0){if(g.pts>=c[p-1].pts)c.push(g);else for(var m=p-1;m>=0;m--)if(g.pts<c[m].pts){c.splice(m,0,g);break}}else c.push(g)}function d(c){for(var g=c.byteLength,p=[],m=1;m<g-2;)c[m]===0&&c[m+1]===0&&c[m+2]===3?(p.push(m+2),m+=2):m++;if(p.length===0)return c;var b=g-p.length,y=new Uint8Array(b),r=0;for(m=0;m<b;r++,m++)r===p[0]&&(r++,p.shift()),y[m]=c[r];return y}Z.default=i},"./src/errors.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"ErrorTypes",function(){return _}),U.d(Z,"ErrorDetails",function(){return L});var _;(function(E){E.NETWORK_ERROR="networkError",E.MEDIA_ERROR="mediaError",E.KEY_SYSTEM_ERROR="keySystemError",E.MUX_ERROR="muxError",E.OTHER_ERROR="otherError"})(_||(_={}));var L;(function(E){E.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",E.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",E.KEY_SYSTEM_NO_SESSION="keySystemNoSession",E.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",E.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",E.MANIFEST_LOAD_ERROR="manifestLoadError",E.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",E.MANIFEST_PARSING_ERROR="manifestParsingError",E.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",E.LEVEL_EMPTY_ERROR="levelEmptyError",E.LEVEL_LOAD_ERROR="levelLoadError",E.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",E.LEVEL_SWITCH_ERROR="levelSwitchError",E.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",E.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",E.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",E.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",E.FRAG_LOAD_ERROR="fragLoadError",E.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",E.FRAG_DECRYPT_ERROR="fragDecryptError",E.FRAG_PARSING_ERROR="fragParsingError",E.REMUX_ALLOC_ERROR="remuxAllocError",E.KEY_LOAD_ERROR="keyLoadError",E.KEY_LOAD_TIMEOUT="keyLoadTimeOut",E.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",E.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",E.BUFFER_APPEND_ERROR="bufferAppendError",E.BUFFER_APPENDING_ERROR="bufferAppendingError",E.BUFFER_STALLED_ERROR="bufferStalledError",E.BUFFER_FULL_ERROR="bufferFullError",E.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",E.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",E.INTERNAL_EXCEPTION="internalException",E.INTERNAL_ABORTED="aborted",E.UNKNOWN="unknown"})(L||(L={}))},"./src/events.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"Events",function(){return _});var _;(function(L){L.MEDIA_ATTACHING="hlsMediaAttaching",L.MEDIA_ATTACHED="hlsMediaAttached",L.MEDIA_DETACHING="hlsMediaDetaching",L.MEDIA_DETACHED="hlsMediaDetached",L.BUFFER_RESET="hlsBufferReset",L.BUFFER_CODECS="hlsBufferCodecs",L.BUFFER_CREATED="hlsBufferCreated",L.BUFFER_APPENDING="hlsBufferAppending",L.BUFFER_APPENDED="hlsBufferAppended",L.BUFFER_EOS="hlsBufferEos",L.BUFFER_FLUSHING="hlsBufferFlushing",L.BUFFER_FLUSHED="hlsBufferFlushed",L.MANIFEST_LOADING="hlsManifestLoading",L.MANIFEST_LOADED="hlsManifestLoaded",L.MANIFEST_PARSED="hlsManifestParsed",L.LEVEL_SWITCHING="hlsLevelSwitching",L.LEVEL_SWITCHED="hlsLevelSwitched",L.LEVEL_LOADING="hlsLevelLoading",L.LEVEL_LOADED="hlsLevelLoaded",L.LEVEL_UPDATED="hlsLevelUpdated",L.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",L.LEVELS_UPDATED="hlsLevelsUpdated",L.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",L.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",L.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",L.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",L.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",L.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",L.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",L.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",L.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",L.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",L.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",L.CUES_PARSED="hlsCuesParsed",L.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",L.INIT_PTS_FOUND="hlsInitPtsFound",L.FRAG_LOADING="hlsFragLoading",L.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",L.FRAG_LOADED="hlsFragLoaded",L.FRAG_DECRYPTED="hlsFragDecrypted",L.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",L.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",L.FRAG_PARSING_METADATA="hlsFragParsingMetadata",L.FRAG_PARSED="hlsFragParsed",L.FRAG_BUFFERED="hlsFragBuffered",L.FRAG_CHANGED="hlsFragChanged",L.FPS_DROP="hlsFpsDrop",L.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",L.ERROR="hlsError",L.DESTROYING="hlsDestroying",L.KEY_LOADING="hlsKeyLoading",L.KEY_LOADED="hlsKeyLoaded",L.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",L.BACK_BUFFER_REACHED="hlsBackBufferReached"})(_||(_={}))},"./src/hls.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"default",function(){return c});var _=U("./node_modules/url-toolkit/src/url-toolkit.js"),L=U.n(_),E=U("./src/loader/playlist-loader.ts"),A=U("./src/loader/key-loader.ts"),w=U("./src/controller/id3-track-controller.ts"),v=U("./src/controller/latency-controller.ts"),u=U("./src/controller/level-controller.ts"),f=U("./src/controller/fragment-tracker.ts"),o=U("./src/controller/stream-controller.ts"),t=U("./src/is-supported.ts"),i=U("./src/utils/logger.ts"),s=U("./src/config.ts"),h=U("./node_modules/eventemitter3/index.js"),a=U.n(h),e=U("./src/events.ts"),l=U("./src/errors.ts");function n(g,p){for(var m=0;m<p.length;m++){var b=p[m];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(g,b.key,b)}}function d(g,p,m){return p&&n(g.prototype,p),m&&n(g,m),g}var c=function(){g.isSupported=function(){return Object(t.isSupported)()};function g(m){m===void 0&&(m={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new h.EventEmitter,this._autoLevelCapping=void 0,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null;var b=this.config=Object(s.mergeConfig)(g.DefaultConfig,m);this.userConfig=m,Object(i.enableLogs)(b.debug),this._autoLevelCapping=-1,b.progressive&&Object(s.enableStreamingMode)(b);var y=b.abrController,r=b.bufferController,x=b.capLevelController,S=b.fpsController,T=this.abrController=new y(this),R=this.bufferController=new r(this),D=this.capLevelController=new x(this),k=new S(this),B=new E.default(this),G=new A.default(this),P=new w.default(this),$=this.levelController=new u.default(this),X=new f.FragmentTracker(this),z=this.streamController=new o.default(this,X);D.setStreamController(z),k.setStreamController(z);var N=[$,z];this.networkControllers=N;var H=[B,G,T,R,D,k,P,X];this.audioTrackController=this.createController(b.audioTrackController,null,N),this.createController(b.audioStreamController,X,N),this.subtitleTrackController=this.createController(b.subtitleTrackController,null,N),this.createController(b.subtitleStreamController,X,N),this.createController(b.timelineController,null,H),this.emeController=this.createController(b.emeController,null,H),this.cmcdController=this.createController(b.cmcdController,null,H),this.latencyController=this.createController(v.default,null,H),this.coreComponents=H}var p=g.prototype;return p.createController=function(b,y,r){if(b){var x=y?new b(this,y):new b(this);return r&&r.push(x),x}return null},p.on=function(b,y,r){r===void 0&&(r=this),this._emitter.on(b,y,r)},p.once=function(b,y,r){r===void 0&&(r=this),this._emitter.once(b,y,r)},p.removeAllListeners=function(b){this._emitter.removeAllListeners(b)},p.off=function(b,y,r,x){r===void 0&&(r=this),this._emitter.off(b,y,r,x)},p.listeners=function(b){return this._emitter.listeners(b)},p.emit=function(b,y,r){return this._emitter.emit(b,y,r)},p.trigger=function(b,y){if(this.config.debug)return this.emit(b,b,y);try{return this.emit(b,b,y)}catch(r){i.logger.error("An internal error happened while handling event "+b+'. Error message: "'+r.message+'". Here is a stacktrace:',r),this.trigger(e.Events.ERROR,{type:l.ErrorTypes.OTHER_ERROR,details:l.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:b,error:r})}return!1},p.listenerCount=function(b){return this._emitter.listenerCount(b)},p.destroy=function(){i.logger.log("destroy"),this.trigger(e.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(b){return b.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(b){return b.destroy()}),this.coreComponents.length=0},p.attachMedia=function(b){i.logger.log("attachMedia"),this._media=b,this.trigger(e.Events.MEDIA_ATTACHING,{media:b})},p.detachMedia=function(){i.logger.log("detachMedia"),this.trigger(e.Events.MEDIA_DETACHING,void 0),this._media=null},p.loadSource=function(b){this.stopLoad();var y=this.media,r=this.url,x=this.url=_.buildAbsoluteURL(self.location.href,b,{alwaysNormalize:!0});i.logger.log("loadSource:"+x),y&&r&&r!==x&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(y)),this.trigger(e.Events.MANIFEST_LOADING,{url:b})},p.startLoad=function(b){b===void 0&&(b=-1),i.logger.log("startLoad("+b+")"),this.networkControllers.forEach(function(y){y.startLoad(b)})},p.stopLoad=function(){i.logger.log("stopLoad"),this.networkControllers.forEach(function(b){b.stopLoad()})},p.swapAudioCodec=function(){i.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},p.recoverMediaError=function(){i.logger.log("recoverMediaError");var b=this._media;this.detachMedia(),b&&this.attachMedia(b)},p.removeLevel=function(b,y){y===void 0&&(y=0),this.levelController.removeLevel(b,y)},d(g,[{key:"levels",get:function(){var b=this.levelController.levels;return b||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(b){i.logger.log("set currentLevel:"+b),this.loadLevel=b,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(b){i.logger.log("set nextLevel:"+b),this.levelController.manualLevel=b,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(b){i.logger.log("set loadLevel:"+b),this.levelController.manualLevel=b}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(b){this.levelController.nextLoadLevel=b}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(b){i.logger.log("set firstLevel:"+b),this.levelController.firstLevel=b}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(b){i.logger.log("set startLevel:"+b),b!==-1&&(b=Math.max(b,this.minAutoLevel)),this.levelController.startLevel=b}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(b){var y=!!b;y!==this.config.capLevelToPlayerSize&&(y?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=y)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(b){this._autoLevelCapping!==b&&(i.logger.log("set autoLevelCapping:"+b),this._autoLevelCapping=b)}},{key:"bandwidthEstimate",get:function(){var b=this.abrController.bwEstimator;return b?b.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var b=this.levels,y=this.config.minAutoBitrate;if(!b)return 0;for(var r=b.length,x=0;x<r;x++)if(b[x].maxBitrate>y)return x;return 0}},{key:"maxAutoLevel",get:function(){var b=this.levels,y=this.autoLevelCapping,r;return y===-1&&b&&b.length?r=b.length-1:r=y,r}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(b){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,b)}},{key:"audioTracks",get:function(){var b=this.audioTrackController;return b?b.audioTracks:[]}},{key:"audioTrack",get:function(){var b=this.audioTrackController;return b?b.audioTrack:-1},set:function(b){var y=this.audioTrackController;y&&(y.audioTrack=b)}},{key:"subtitleTracks",get:function(){var b=this.subtitleTrackController;return b?b.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var b=this.subtitleTrackController;return b?b.subtitleTrack:-1},set:function(b){var y=this.subtitleTrackController;y&&(y.subtitleTrack=b)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var b=this.subtitleTrackController;return b?b.subtitleDisplay:!1},set:function(b){var y=this.subtitleTrackController;y&&(y.subtitleDisplay=b)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(b){this.config.lowLatencyMode=b}},{key:"liveSyncPosition",get:function(){return this.latencyController.liveSyncPosition}},{key:"latency",get:function(){return this.latencyController.latency}},{key:"maxLatency",get:function(){return this.latencyController.maxLatency}},{key:"targetLatency",get:function(){return this.latencyController.targetLatency}},{key:"drift",get:function(){return this.latencyController.drift}},{key:"forceStartLoad",get:function(){return this.streamController.forceStartLoad}}],[{key:"version",get:function(){return"1.1.2"}},{key:"Events",get:function(){return e.Events}},{key:"ErrorTypes",get:function(){return l.ErrorTypes}},{key:"ErrorDetails",get:function(){return l.ErrorDetails}},{key:"DefaultConfig",get:function(){return g.defaultConfig?g.defaultConfig:s.hlsDefaultConfig},set:function(b){g.defaultConfig=b}}]),g}();c.defaultConfig=void 0},"./src/is-supported.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"isSupported",function(){return E}),U.d(Z,"changeTypeSupported",function(){return A});var _=U("./src/utils/mediasource-helper.ts");function L(){return self.SourceBuffer||self.WebKitSourceBuffer}function E(){var w=Object(_.getMediaSource)();if(!w)return!1;var v=L(),u=w&&typeof w.isTypeSupported=="function"&&w.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),f=!v||v.prototype&&typeof v.prototype.appendBuffer=="function"&&typeof v.prototype.remove=="function";return!!u&&!!f}function A(){var w,v=L();return typeof(v==null||((w=v.prototype)===null||w===void 0)?void 0:w.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"default",function(){return i}),U.d(Z,"LoadError",function(){return h});var _=U("./src/polyfills/number.ts"),L=U("./src/errors.ts");function E(a,e){a.prototype=Object.create(e.prototype),a.prototype.constructor=a,f(a,e)}function A(a){var e=typeof Map=="function"?new Map:void 0;return A=function(n){if(n===null||!u(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e!="undefined"){if(e.has(n))return e.get(n);e.set(n,d)}function d(){return w(n,arguments,o(this).constructor)}return d.prototype=Object.create(n.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),f(d,n)},A(a)}function w(a,e,l){return v()?w=Reflect.construct:w=function(d,c,g){var p=[null];p.push.apply(p,c);var m=Function.bind.apply(d,p),b=new m;return g&&f(b,g.prototype),b},w.apply(null,arguments)}function v(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(a){return!1}}function u(a){return Function.toString.call(a).indexOf("[native code]")!==-1}function f(a,e){return f=Object.setPrototypeOf||function(n,d){return n.__proto__=d,n},f(a,e)}function o(a){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(l){return l.__proto__||Object.getPrototypeOf(l)},o(a)}var t=Math.pow(2,17),i=function(){function a(l){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=l}var e=a.prototype;return e.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},e.abort=function(){this.loader&&this.loader.abort()},e.load=function(n,d){var c=this,g=n.url;if(!g)return Promise.reject(new h({type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:n,networkDetails:null},"Fragment does not have a "+(g?"part list":"url")));this.abort();var p=this.config,m=p.fLoader,b=p.loader;return new Promise(function(y,r){c.loader&&c.loader.destroy();var x=c.loader=n.loader=m?new m(p):new b(p),S=s(n),T={timeout:p.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:p.fragLoadingMaxRetryTimeout,highWaterMark:t};n.stats=x.stats,x.load(S,T,{onSuccess:function(D,k,B,G){c.resetLoader(n,x),y({frag:n,part:null,payload:D.data,networkDetails:G})},onError:function(D,k,B){c.resetLoader(n,x),r(new h({type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:n,response:D,networkDetails:B}))},onAbort:function(D,k,B){c.resetLoader(n,x),r(new h({type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:n,networkDetails:B}))},onTimeout:function(D,k,B){c.resetLoader(n,x),r(new h({type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:n,networkDetails:B}))},onProgress:function(D,k,B,G){d&&d({frag:n,part:null,payload:B,networkDetails:G})}})})},e.loadPart=function(n,d,c){var g=this;this.abort();var p=this.config,m=p.fLoader,b=p.loader;return new Promise(function(y,r){g.loader&&g.loader.destroy();var x=g.loader=n.loader=m?new m(p):new b(p),S=s(n,d),T={timeout:p.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:p.fragLoadingMaxRetryTimeout,highWaterMark:t};d.stats=x.stats,x.load(S,T,{onSuccess:function(D,k,B,G){g.resetLoader(n,x),g.updateStatsFromPart(n,d);var P={frag:n,part:d,payload:D.data,networkDetails:G};c(P),y(P)},onError:function(D,k,B){g.resetLoader(n,x),r(new h({type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:n,part:d,response:D,networkDetails:B}))},onAbort:function(D,k,B){n.stats.aborted=d.stats.aborted,g.resetLoader(n,x),r(new h({type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:n,part:d,networkDetails:B}))},onTimeout:function(D,k,B){g.resetLoader(n,x),r(new h({type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:n,part:d,networkDetails:B}))}})})},e.updateStatsFromPart=function(n,d){var c=n.stats,g=d.stats,p=g.total;if(c.loaded+=g.loaded,p){var m=Math.round(n.duration/d.duration),b=Math.min(Math.round(c.loaded/p),m),y=m-b,r=y*Math.round(c.loaded/b);c.total=c.loaded+r}else c.total=Math.max(c.loaded,c.total);var x=c.loading,S=g.loading;x.start?x.first+=S.first-S.start:(x.start=S.start,x.first=S.first),x.end=S.end},e.resetLoader=function(n,d){n.loader=null,this.loader===d&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),d.destroy()},a}();function s(a,e){e===void 0&&(e=null);var l=e||a,n={frag:a,part:e,responseType:"arraybuffer",url:l.url,headers:{},rangeStart:0,rangeEnd:0},d=l.byteRangeStartOffset,c=l.byteRangeEndOffset;return Object(_.isFiniteNumber)(d)&&Object(_.isFiniteNumber)(c)&&(n.rangeStart=d,n.rangeEnd=c),n}var h=function(a){E(e,a);function e(l){for(var n,d=arguments.length,c=new Array(d>1?d-1:0),g=1;g<d;g++)c[g-1]=arguments[g];return n=a.call.apply(a,[this].concat(c))||this,n.data=void 0,n.data=l,n}return e}(A(Error))},"./src/loader/fragment.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"ElementaryStreamTypes",function(){return i}),U.d(Z,"BaseSegment",function(){return s}),U.d(Z,"Fragment",function(){return h}),U.d(Z,"Part",function(){return a});var _=U("./src/polyfills/number.ts"),L=U("./node_modules/url-toolkit/src/url-toolkit.js"),E=U.n(L),A=U("./src/utils/logger.ts"),w=U("./src/loader/level-key.ts"),v=U("./src/loader/load-stats.ts");function u(e,l){e.prototype=Object.create(l.prototype),e.prototype.constructor=e,f(e,l)}function f(e,l){return f=Object.setPrototypeOf||function(d,c){return d.__proto__=c,d},f(e,l)}function o(e,l){for(var n=0;n<l.length;n++){var d=l[n];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(e,d.key,d)}}function t(e,l,n){return l&&o(e.prototype,l),n&&o(e,n),e}var i;(function(e){e.AUDIO="audio",e.VIDEO="video",e.AUDIOVIDEO="audiovideo"})(i||(i={}));var s=function(){function e(n){var d;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(d={},d[i.AUDIO]=null,d[i.VIDEO]=null,d[i.AUDIOVIDEO]=null,d),this.baseurl=n}var l=e.prototype;return l.setByteRange=function(d,c){var g=d.split("@",2),p=[];g.length===1?p[0]=c?c.byteRangeEndOffset:0:p[0]=parseInt(g[1]),p[1]=parseInt(g[0])+p[0],this._byteRange=p},t(e,[{key:"byteRange",get:function(){return this._byteRange?this._byteRange:[]}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"url",get:function(){return!this._url&&this.baseurl&&this.relurl&&(this._url=Object(L.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(d){this._url=d}}]),e}(),h=function(e){u(l,e);function l(d,c){var g;return g=e.call(this,c)||this,g._decryptdata=null,g.rawProgramDateTime=null,g.programDateTime=null,g.tagList=[],g.duration=0,g.sn=0,g.levelkey=void 0,g.type=void 0,g.loader=null,g.level=-1,g.cc=0,g.startPTS=void 0,g.endPTS=void 0,g.appendedPTS=void 0,g.startDTS=void 0,g.endDTS=void 0,g.start=0,g.deltaPTS=void 0,g.maxStartPTS=void 0,g.minEndPTS=void 0,g.stats=new v.LoadStats,g.urlId=0,g.data=void 0,g.bitrateTest=!1,g.title=null,g.initSegment=null,g.type=d,g}var n=l.prototype;return n.createInitializationVector=function(c){for(var g=new Uint8Array(16),p=12;p<16;p++)g[p]=c>>8*(15-p)&255;return g},n.setDecryptDataFromLevelKey=function(c,g){var p=c;return(c==null?void 0:c.method)==="AES-128"&&c.uri&&!c.iv&&(p=w.LevelKey.fromURI(c.uri),p.method=c.method,p.iv=this.createInitializationVector(g),p.keyFormat="identity"),p},n.setElementaryStreamInfo=function(c,g,p,m,b,y){y===void 0&&(y=!1);var r=this.elementaryStreams,x=r[c];if(!x){r[c]={startPTS:g,endPTS:p,startDTS:m,endDTS:b,partial:y};return}x.startPTS=Math.min(x.startPTS,g),x.endPTS=Math.max(x.endPTS,p),x.startDTS=Math.min(x.startDTS,m),x.endDTS=Math.max(x.endDTS,b)},n.clearElementaryStreamInfo=function(){var c=this.elementaryStreams;c[i.AUDIO]=null,c[i.VIDEO]=null,c[i.AUDIOVIDEO]=null},t(l,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var c=this.sn;typeof c!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&A.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),c=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,c)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(_.isFiniteNumber)(this.programDateTime))return null;var c=Object(_.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+c*1e3}},{key:"encrypted",get:function(){var c;return!!((c=this.decryptdata)!==null&&c!==void 0&&c.keyFormat&&this.decryptdata.uri)}}]),l}(s),a=function(e){u(l,e);function l(n,d,c,g,p){var m;m=e.call(this,c)||this,m.fragOffset=0,m.duration=0,m.gap=!1,m.independent=!1,m.relurl=void 0,m.fragment=void 0,m.index=void 0,m.stats=new v.LoadStats,m.duration=n.decimalFloatingPoint("DURATION"),m.gap=n.bool("GAP"),m.independent=n.bool("INDEPENDENT"),m.relurl=n.enumeratedString("URI"),m.fragment=d,m.index=g;var b=n.enumeratedString("BYTERANGE");return b&&m.setByteRange(b,p),p&&(m.fragOffset=p.fragOffset+p.duration),m}return t(l,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var d=this.elementaryStreams;return!!(d.audio||d.video||d.audiovideo)}}]),l}(s)},"./src/loader/key-loader.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"default",function(){return A});var _=U("./src/events.ts"),L=U("./src/errors.ts"),E=U("./src/utils/logger.ts"),A=function(){function w(u){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=u,this._registerListeners()}var v=w.prototype;return v._registerListeners=function(){this.hls.on(_.Events.KEY_LOADING,this.onKeyLoading,this)},v._unregisterListeners=function(){this.hls.off(_.Events.KEY_LOADING,this.onKeyLoading)},v.destroy=function(){this._unregisterListeners();for(var f in this.loaders){var o=this.loaders[f];o&&o.destroy()}this.loaders={}},v.onKeyLoading=function(f,o){var t=o.frag,i=t.type,s=this.loaders[i];if(!t.decryptdata){E.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var h=t.decryptdata.uri;if(h!==this.decrypturl||this.decryptkey===null){var a=this.hls.config;if(s&&(E.logger.warn("abort previous key loader for type:"+i),s.abort()),!h){E.logger.warn("key uri is falsy");return}var e=a.loader,l=t.loader=this.loaders[i]=new e(a);this.decrypturl=h,this.decryptkey=null;var n={url:h,frag:t,responseType:"arraybuffer"},d={timeout:a.fragLoadingTimeOut,maxRetry:0,retryDelay:a.fragLoadingRetryDelay,maxRetryDelay:a.fragLoadingMaxRetryTimeout,highWaterMark:0},c={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};l.load(n,d,c)}else this.decryptkey&&(t.decryptdata.key=this.decryptkey,this.hls.trigger(_.Events.KEY_LOADED,{frag:t}))},v.loadsuccess=function(f,o,t){var i=t.frag;if(!i.decryptdata){E.logger.error("after key load, decryptdata unset");return}this.decryptkey=i.decryptdata.key=new Uint8Array(f.data),i.loader=null,delete this.loaders[i.type],this.hls.trigger(_.Events.KEY_LOADED,{frag:i})},v.loaderror=function(f,o){var t=o.frag,i=t.loader;i&&i.abort(),delete this.loaders[t.type],this.hls.trigger(_.Events.ERROR,{type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:t,response:f})},v.loadtimeout=function(f,o){var t=o.frag,i=t.loader;i&&i.abort(),delete this.loaders[t.type],this.hls.trigger(_.Events.ERROR,{type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:t})},w}()},"./src/loader/level-details.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"LevelDetails",function(){return w});var _=U("./src/polyfills/number.ts");function L(v,u){for(var f=0;f<u.length;f++){var o=u[f];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(v,o.key,o)}}function E(v,u,f){return u&&L(v.prototype,u),f&&L(v,f),v}var A=10,w=function(){function v(f){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.needSidxRanges=!1,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.fragments=[],this.url=f}var u=v.prototype;return u.reloaded=function(o){if(!o){this.advanced=!0,this.updated=!0;return}var t=this.lastPartSn-o.lastPartSn,i=this.lastPartIndex-o.lastPartIndex;this.updated=this.endSN!==o.endSN||!!i||!!t,this.advanced=this.endSN>o.endSN||t>0||t===0&&i>0,this.updated||this.advanced?this.misses=Math.floor(o.misses*.6):this.misses=o.misses+1,this.availabilityDelay=o.availabilityDelay},E(v,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(_.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||A}},{key:"drift",get:function(){var o=this.driftEndTime-this.driftStartTime;if(o>0){var t=this.driftEnd-this.driftStart;return t*1e3/o}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var o;return(o=this.partList)!==null&&o!==void 0&&o.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var o;return(o=this.fragments)!==null&&o!==void 0&&o.length?this.fragments[this.fragments.length-1].end:0}},{key:"age",get:function(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}},{key:"lastPartIndex",get:function(){var o;return(o=this.partList)!==null&&o!==void 0&&o.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var o;return(o=this.partList)!==null&&o!==void 0&&o.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),v}()},"./src/loader/level-key.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"LevelKey",function(){return w});var _=U("./node_modules/url-toolkit/src/url-toolkit.js"),L=U.n(_);function E(v,u){for(var f=0;f<u.length;f++){var o=u[f];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(v,o.key,o)}}function A(v,u,f){return u&&E(v.prototype,u),f&&E(v,f),v}var w=function(){v.fromURL=function(f,o){return new v(f,o)},v.fromURI=function(f){return new v(f)};function v(u,f){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,f?this._uri=Object(_.buildAbsoluteURL)(u,f,{alwaysNormalize:!0}):this._uri=u}return A(v,[{key:"uri",get:function(){return this._uri}}]),v}()},"./src/loader/load-stats.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"LoadStats",function(){return _});var _=function(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}},"./src/loader/m3u8-parser.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"default",function(){return l});var _=U("./src/polyfills/number.ts"),L=U("./node_modules/url-toolkit/src/url-toolkit.js"),E=U.n(L),A=U("./src/loader/fragment.ts"),w=U("./src/loader/level-details.ts"),v=U("./src/loader/level-key.ts"),u=U("./src/utils/attr-list.ts"),f=U("./src/utils/logger.ts"),o=U("./src/utils/codecs.ts"),t=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,i=/#EXT-X-MEDIA:(.*)/g,s=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),h=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(PLAYLIST-TYPE):(.+)/.source,/#EXT-X-(MEDIA-SEQUENCE): *(\d+)/.source,/#EXT-X-(SKIP):(.+)/.source,/#EXT-X-(TARGETDURATION): *(\d+)/.source,/#EXT-X-(KEY):(.+)/.source,/#EXT-X-(START):(.+)/.source,/#EXT-X-(ENDLIST)/.source,/#EXT-X-(DISCONTINUITY-SEQ)UENCE: *(\d+)/.source,/#EXT-X-(DIS)CONTINUITY/.source,/#EXT-X-(VERSION):(\d+)/.source,/#EXT-X-(MAP):(.+)/.source,/#EXT-X-(SERVER-CONTROL):(.+)/.source,/#EXT-X-(PART-INF):(.+)/.source,/#EXT-X-(GAP)/.source,/#EXT-X-(BITRATE):\s*(\d+)/.source,/#EXT-X-(PART):(.+)/.source,/#EXT-X-(PRELOAD-HINT):(.+)/.source,/#EXT-X-(RENDITION-REPORT):(.+)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),a=/\.(mp4|m4s|m4v|m4a)$/i;function e(p){var m,b;return a.test((m=(b=L.parseURL(p))===null||b===void 0?void 0:b.path)!=null?m:"")}var l=function(){function p(){}return p.findGroup=function(b,y){for(var r=0;r<b.length;r++){var x=b[r];if(x.id===y)return x}},p.convertAVC1ToAVCOTI=function(b){var y=b.split(".");if(y.length>2){var r=y.shift()+".";return r+=parseInt(y.shift()).toString(16),r+=("000"+parseInt(y.shift()).toString(16)).substr(-4),r}return b},p.resolve=function(b,y){return L.buildAbsoluteURL(y,b,{alwaysNormalize:!0})},p.parseMasterPlaylist=function(b,y){var r=[],x={},S=!1;t.lastIndex=0;for(var T;(T=t.exec(b))!=null;)if(T[1]){var R=new u.AttrList(T[1]),D={attrs:R,bitrate:R.decimalInteger("AVERAGE-BANDWIDTH")||R.decimalInteger("BANDWIDTH"),name:R.NAME,url:p.resolve(T[2],y)},k=R.decimalResolution("RESOLUTION");k&&(D.width=k.width,D.height=k.height),n((R.CODECS||"").split(/[ ,]+/).filter(function(G){return G}),D),D.videoCodec&&D.videoCodec.indexOf("avc1")!==-1&&(D.videoCodec=p.convertAVC1ToAVCOTI(D.videoCodec)),r.push(D)}else if(T[3]){var B=new u.AttrList(T[3]);B["DATA-ID"]&&(S=!0,x[B["DATA-ID"]]=B)}return{levels:r,sessionData:S?x:null}},p.parseMasterPlaylistMedia=function(b,y,r,x){x===void 0&&(x=[]);var S,T=[],R=0;for(i.lastIndex=0;(S=i.exec(b))!==null;){var D=new u.AttrList(S[1]);if(D.TYPE===r){var k={attrs:D,bitrate:0,id:R++,groupId:D["GROUP-ID"],instreamId:D["INSTREAM-ID"],name:D.NAME||D.LANGUAGE||"",type:r,default:D.bool("DEFAULT"),autoselect:D.bool("AUTOSELECT"),forced:D.bool("FORCED"),lang:D.LANGUAGE,url:D.URI?p.resolve(D.URI,y):""};if(x.length){var B=p.findGroup(x,k.groupId)||x[0];d(k,B,"audioCodec"),d(k,B,"textCodec")}T.push(k)}}return T},p.parseLevelPlaylist=function(b,y,r,x,S){var T=new w.LevelDetails(y),R=T.fragments,D=null,k=0,B=0,G=0,P=0,$=null,X=new A.Fragment(x,y),z,N,H,q=-1,ee=!1;for(s.lastIndex=0,T.m3u8=b;(z=s.exec(b))!==null;){ee&&(ee=!1,X=new A.Fragment(x,y),X.start=G,X.sn=k,X.cc=P,X.level=r,D&&(X.initSegment=D,X.rawProgramDateTime=D.rawProgramDateTime));var fe=z[1];if(fe){X.duration=parseFloat(fe);var oe=(" "+z[2]).slice(1);X.title=oe||null,X.tagList.push(oe?["INF",fe,oe]:["INF",fe])}else if(z[3])Object(_.isFiniteNumber)(X.duration)&&(X.start=G,H&&(X.levelkey=H),X.sn=k,X.level=r,X.cc=P,X.urlId=S,R.push(X),X.relurl=(" "+z[3]).slice(1),g(X,$),$=X,G+=X.duration,k++,B=0,ee=!0);else if(z[4]){var he=(" "+z[4]).slice(1);$?X.setByteRange(he,$):X.setByteRange(he)}else if(z[5])X.rawProgramDateTime=(" "+z[5]).slice(1),X.tagList.push(["PROGRAM-DATE-TIME",X.rawProgramDateTime]),q===-1&&(q=R.length);else{if(z=z[0].match(h),!z){f.logger.warn("No matches on slow regex match for level playlist!");continue}for(N=1;N<z.length&&!(typeof z[N]!="undefined");N++);var se=(" "+z[N]).slice(1),ge=(" "+z[N+1]).slice(1),ie=z[N+2]?(" "+z[N+2]).slice(1):"";switch(se){case"PLAYLIST-TYPE":T.type=ge.toUpperCase();break;case"MEDIA-SEQUENCE":k=T.startSN=parseInt(ge);break;case"SKIP":{var re=new u.AttrList(ge),Q=re.decimalInteger("SKIPPED-SEGMENTS");if(Object(_.isFiniteNumber)(Q)){T.skippedSegments=Q;for(var pe=Q;pe--;)R.unshift(null);k+=Q}var ne=re.enumeratedString("RECENTLY-REMOVED-DATERANGES");ne&&(T.recentlyRemovedDateranges=ne.split(" "));break}case"TARGETDURATION":T.targetduration=parseFloat(ge);break;case"VERSION":T.version=parseInt(ge);break;case"EXTM3U":break;case"ENDLIST":T.live=!1;break;case"#":(ge||ie)&&X.tagList.push(ie?[ge,ie]:[ge]);break;case"DIS":P++;case"GAP":X.tagList.push([se]);break;case"BITRATE":X.tagList.push([se,ge]);break;case"DISCONTINUITY-SEQ":P=parseInt(ge);break;case"KEY":{var J,be=new u.AttrList(ge),Ee=be.enumeratedString("METHOD"),Le=be.URI,V=be.hexadecimalInteger("IV"),C=be.enumeratedString("KEYFORMATVERSIONS"),O=be.enumeratedString("KEYID"),j=(J=be.enumeratedString("KEYFORMAT"))!=null?J:"identity",M=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(M.indexOf(j)>-1){f.logger.warn("Keyformat "+j+" is not supported from the manifest");continue}else if(j!=="identity")continue;Ee&&(H=v.LevelKey.fromURL(y,Le),Le&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Ee)>=0&&(H.method=Ee,H.keyFormat=j,O&&(H.keyID=O),C&&(H.keyFormatVersions=C),H.iv=V));break}case"START":{var F=new u.AttrList(ge),ae=F.decimalFloatingPoint("TIME-OFFSET");Object(_.isFiniteNumber)(ae)&&(T.startTimeOffset=ae);break}case"MAP":{var ve=new u.AttrList(ge);X.relurl=ve.URI,ve.BYTERANGE&&X.setByteRange(ve.BYTERANGE),X.level=r,X.sn="initSegment",H&&(X.levelkey=H),X.initSegment=null,D=X,ee=!0;break}case"SERVER-CONTROL":{var Pe=new u.AttrList(ge);T.canBlockReload=Pe.bool("CAN-BLOCK-RELOAD"),T.canSkipUntil=Pe.optionalFloat("CAN-SKIP-UNTIL",0),T.canSkipDateRanges=T.canSkipUntil>0&&Pe.bool("CAN-SKIP-DATERANGES"),T.partHoldBack=Pe.optionalFloat("PART-HOLD-BACK",0),T.holdBack=Pe.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Oe=new u.AttrList(ge);T.partTarget=Oe.decimalFloatingPoint("PART-TARGET");break}case"PART":{var De=T.partList;De||(De=T.partList=[]);var Ne=B>0?De[De.length-1]:void 0,Ke=B++,ke=new A.Part(new u.AttrList(ge),X,y,Ke,Ne);De.push(ke),X.duration+=ke.duration;break}case"PRELOAD-HINT":{var Re=new u.AttrList(ge);T.preloadHint=Re;break}case"RENDITION-REPORT":{var Te=new u.AttrList(ge);T.renditionReports=T.renditionReports||[],T.renditionReports.push(Te);break}default:f.logger.warn("line parsed but not handled: "+z);break}}}$&&!$.relurl?(R.pop(),G-=$.duration,T.partList&&(T.fragmentHint=$)):T.partList&&(g(X,$),X.cc=P,T.fragmentHint=X);var we=R.length,xe=R[0],ue=R[we-1];if(G+=T.skippedSegments*T.targetduration,G>0&&we&&ue){T.averagetargetduration=G/we;var de=ue.sn;T.endSN=de!=="initSegment"?de:0,xe&&(T.startCC=xe.cc,xe.initSegment||T.fragments.every(function(_e){return _e.relurl&&e(_e.relurl)})&&(f.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),X=new A.Fragment(x,y),X.relurl=ue.relurl,X.level=r,X.sn="initSegment",xe.initSegment=X,T.needSidxRanges=!0))}else T.endSN=0,T.startCC=0;return T.fragmentHint&&(G+=T.fragmentHint.duration),T.totalduration=G,T.endCC=P,q>0&&c(R,q),T},p}();function n(p,m){["video","audio","text"].forEach(function(b){var y=p.filter(function(x){return Object(o.isCodecType)(x,b)});if(y.length){var r=y.filter(function(x){return x.lastIndexOf("avc1",0)===0||x.lastIndexOf("mp4a",0)===0});m[b+"Codec"]=r.length>0?r[0]:y[0],p=p.filter(function(x){return y.indexOf(x)===-1})}}),m.unknownCodecs=p}function d(p,m,b){var y=m[b];y&&(p[b]=y)}function c(p,m){for(var b=p[m],y=m;y--;){var r=p[y];if(!r)return;r.programDateTime=b.programDateTime-r.duration*1e3,b=r}}function g(p,m){p.rawProgramDateTime?p.programDateTime=Date.parse(p.rawProgramDateTime):m!=null&&m.programDateTime&&(p.programDateTime=m.endProgramDateTime),Object(_.isFiniteNumber)(p.programDateTime)||(p.programDateTime=null,p.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(Se,Z,U){"use strict";U.r(Z);var _=U("./src/polyfills/number.ts"),L=U("./src/events.ts"),E=U("./src/errors.ts"),A=U("./src/utils/logger.ts"),w=U("./src/utils/mp4-tools.ts"),v=U("./src/loader/m3u8-parser.ts"),u=U("./src/types/loader.ts"),f=U("./src/utils/attr-list.ts");function o(s){var h=s.type;switch(h){case u.PlaylistContextType.AUDIO_TRACK:return u.PlaylistLevelType.AUDIO;case u.PlaylistContextType.SUBTITLE_TRACK:return u.PlaylistLevelType.SUBTITLE;default:return u.PlaylistLevelType.MAIN}}function t(s,h){var a=s.url;return(a===void 0||a.indexOf("data:")===0)&&(a=h.url),a}var i=function(){function s(a){this.hls=void 0,this.loaders=Object.create(null),this.hls=a,this.registerListeners()}var h=s.prototype;return h.registerListeners=function(){var e=this.hls;e.on(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.on(L.Events.LEVEL_LOADING,this.onLevelLoading,this),e.on(L.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.on(L.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},h.unregisterListeners=function(){var e=this.hls;e.off(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.off(L.Events.LEVEL_LOADING,this.onLevelLoading,this),e.off(L.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.off(L.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},h.createInternalLoader=function(e){var l=this.hls.config,n=l.pLoader,d=l.loader,c=n||d,g=new c(l);return e.loader=g,this.loaders[e.type]=g,g},h.getInternalLoader=function(e){return this.loaders[e.type]},h.resetInternalLoader=function(e){this.loaders[e]&&delete this.loaders[e]},h.destroyInternalLoaders=function(){for(var e in this.loaders){var l=this.loaders[e];l&&l.destroy(),this.resetInternalLoader(e)}},h.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},h.onManifestLoading=function(e,l){var n=l.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:u.PlaylistContextType.MANIFEST,url:n,deliveryDirectives:null})},h.onLevelLoading=function(e,l){var n=l.id,d=l.level,c=l.url,g=l.deliveryDirectives;this.load({id:n,groupId:null,level:d,responseType:"text",type:u.PlaylistContextType.LEVEL,url:c,deliveryDirectives:g})},h.onAudioTrackLoading=function(e,l){var n=l.id,d=l.groupId,c=l.url,g=l.deliveryDirectives;this.load({id:n,groupId:d,level:null,responseType:"text",type:u.PlaylistContextType.AUDIO_TRACK,url:c,deliveryDirectives:g})},h.onSubtitleTrackLoading=function(e,l){var n=l.id,d=l.groupId,c=l.url,g=l.deliveryDirectives;this.load({id:n,groupId:d,level:null,responseType:"text",type:u.PlaylistContextType.SUBTITLE_TRACK,url:c,deliveryDirectives:g})},h.load=function(e){var l,n=this.hls.config,d=this.getInternalLoader(e);if(d){var c=d.context;if(c&&c.url===e.url){A.logger.trace("[playlist-loader]: playlist request ongoing");return}A.logger.log("[playlist-loader]: aborting previous loader for type: "+e.type),d.abort()}var g,p,m,b;switch(e.type){case u.PlaylistContextType.MANIFEST:g=n.manifestLoadingMaxRetry,p=n.manifestLoadingTimeOut,m=n.manifestLoadingRetryDelay,b=n.manifestLoadingMaxRetryTimeout;break;case u.PlaylistContextType.LEVEL:case u.PlaylistContextType.AUDIO_TRACK:case u.PlaylistContextType.SUBTITLE_TRACK:g=0,p=n.levelLoadingTimeOut;break;default:g=n.levelLoadingMaxRetry,p=n.levelLoadingTimeOut,m=n.levelLoadingRetryDelay,b=n.levelLoadingMaxRetryTimeout;break}if(d=this.createInternalLoader(e),(l=e.deliveryDirectives)!==null&&l!==void 0&&l.part){var y;if(e.type===u.PlaylistContextType.LEVEL&&e.level!==null?y=this.hls.levels[e.level].details:e.type===u.PlaylistContextType.AUDIO_TRACK&&e.id!==null?y=this.hls.audioTracks[e.id].details:e.type===u.PlaylistContextType.SUBTITLE_TRACK&&e.id!==null&&(y=this.hls.subtitleTracks[e.id].details),y){var r=y.partTarget,x=y.targetduration;r&&x&&(p=Math.min(Math.max(r*3,x*.8)*1e3,p))}}var S={timeout:p,maxRetry:g,retryDelay:m,maxRetryDelay:b,highWaterMark:0},T={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};d.load(e,S,T)},h.loadsuccess=function(e,l,n,d){if(d===void 0&&(d=null),n.isSidxRequest){this.handleSidxRequest(e,n),this.handlePlaylistLoaded(e,l,n,d);return}this.resetInternalLoader(n.type);var c=e.data;if(c.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(e,n,"no EXTM3U delimiter",d);return}l.parsing.start=performance.now(),c.indexOf("#EXTINF:")>0||c.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(e,l,n,d):this.handleMasterPlaylist(e,l,n,d)},h.loaderror=function(e,l,n){n===void 0&&(n=null),this.handleNetworkError(l,n,!1,e)},h.loadtimeout=function(e,l,n){n===void 0&&(n=null),this.handleNetworkError(l,n,!0)},h.handleMasterPlaylist=function(e,l,n,d){var c=this.hls,g=e.data,p=t(e,n),m=v.default.parseMasterPlaylist(g,p),b=m.levels,y=m.sessionData;if(!b.length){this.handleManifestParsingError(e,n,"no level found in manifest",d);return}var r=b.map(function(k){return{id:k.attrs.AUDIO,audioCodec:k.audioCodec}}),x=b.map(function(k){return{id:k.attrs.SUBTITLES,textCodec:k.textCodec}}),S=v.default.parseMasterPlaylistMedia(g,p,"AUDIO",r),T=v.default.parseMasterPlaylistMedia(g,p,"SUBTITLES",x),R=v.default.parseMasterPlaylistMedia(g,p,"CLOSED-CAPTIONS");if(S.length){var D=S.some(function(k){return!k.url});!D&&b[0].audioCodec&&!b[0].attrs.AUDIO&&(A.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),S.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new f.AttrList({}),bitrate:0,url:""}))}c.trigger(L.Events.MANIFEST_LOADED,{levels:b,audioTracks:S,subtitles:T,captions:R,url:p,stats:l,networkDetails:d,sessionData:y})},h.handleTrackOrLevelPlaylist=function(e,l,n,d){var c=this.hls,g=n.id,p=n.level,m=n.type,b=t(e,n),y=Object(_.isFiniteNumber)(g)?g:0,r=Object(_.isFiniteNumber)(p)?p:y,x=o(n),S=v.default.parseLevelPlaylist(e.data,b,r,x,y);if(!S.fragments.length){c.trigger(L.Events.ERROR,{type:E.ErrorTypes.NETWORK_ERROR,details:E.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:b,reason:"no fragments found in level",level:typeof n.level=="number"?n.level:void 0});return}if(m===u.PlaylistContextType.MANIFEST){var T={attrs:new f.AttrList({}),bitrate:0,details:S,name:"",url:b};c.trigger(L.Events.MANIFEST_LOADED,{levels:[T],audioTracks:[],url:b,stats:l,networkDetails:d,sessionData:null})}if(l.parsing.end=performance.now(),S.needSidxRanges){var R,D=(R=S.fragments[0].initSegment)===null||R===void 0?void 0:R.url;this.load({url:D,isSidxRequest:!0,type:m,level:p,levelDetails:S,id:g,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}n.levelDetails=S,this.handlePlaylistLoaded(e,l,n,d)},h.handleSidxRequest=function(e,l){var n=Object(w.parseSegmentIndex)(new Uint8Array(e.data));if(!n)return;var d=n.references,c=l.levelDetails;d.forEach(function(g,p){var m=g.info,b=c.fragments[p];b.byteRange.length===0&&b.setByteRange(String(1+m.end-m.start)+"@"+String(m.start)),b.initSegment&&b.initSegment.setByteRange(String(n.moovEndOffset)+"@0")})},h.handleManifestParsingError=function(e,l,n,d){this.hls.trigger(L.Events.ERROR,{type:E.ErrorTypes.NETWORK_ERROR,details:E.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:l.type===u.PlaylistContextType.MANIFEST,url:e.url,reason:n,response:e,context:l,networkDetails:d})},h.handleNetworkError=function(e,l,n,d){n===void 0&&(n=!1),A.logger.warn("[playlist-loader]: A network "+(n?"timeout":"error")+" occurred while loading "+e.type+" level: "+e.level+" id: "+e.id+' group-id: "'+e.groupId+'"');var c=E.ErrorDetails.UNKNOWN,g=!1,p=this.getInternalLoader(e);switch(e.type){case u.PlaylistContextType.MANIFEST:c=n?E.ErrorDetails.MANIFEST_LOAD_TIMEOUT:E.ErrorDetails.MANIFEST_LOAD_ERROR,g=!0;break;case u.PlaylistContextType.LEVEL:c=n?E.ErrorDetails.LEVEL_LOAD_TIMEOUT:E.ErrorDetails.LEVEL_LOAD_ERROR,g=!1;break;case u.PlaylistContextType.AUDIO_TRACK:c=n?E.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:E.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,g=!1;break;case u.PlaylistContextType.SUBTITLE_TRACK:c=n?E.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:E.ErrorDetails.SUBTITLE_LOAD_ERROR,g=!1;break}p&&this.resetInternalLoader(e.type);var m={type:E.ErrorTypes.NETWORK_ERROR,details:c,fatal:g,url:e.url,loader:p,context:e,networkDetails:l};d&&(m.response=d),this.hls.trigger(L.Events.ERROR,m)},h.handlePlaylistLoaded=function(e,l,n,d){var c=n.type,g=n.level,p=n.id,m=n.groupId,b=n.loader,y=n.levelDetails,r=n.deliveryDirectives;if(!(y!=null&&y.targetduration)){this.handleManifestParsingError(e,n,"invalid target duration",d);return}if(!b)return;y.live&&(b.getCacheAge&&(y.ageHeader=b.getCacheAge()||0),(!b.getCacheAge||isNaN(y.ageHeader))&&(y.ageHeader=0));switch(c){case u.PlaylistContextType.MANIFEST:case u.PlaylistContextType.LEVEL:this.hls.trigger(L.Events.LEVEL_LOADED,{details:y,level:g||0,id:p||0,stats:l,networkDetails:d,deliveryDirectives:r});break;case u.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(L.Events.AUDIO_TRACK_LOADED,{details:y,id:p||0,groupId:m||"",stats:l,networkDetails:d,deliveryDirectives:r});break;case u.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(L.Events.SUBTITLE_TRACK_LOADED,{details:y,id:p||0,groupId:m||"",stats:l,networkDetails:d,deliveryDirectives:r});break}},s}();Z.default=i},"./src/polyfills/number.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"isFiniteNumber",function(){return _}),U.d(Z,"MAX_SAFE_INTEGER",function(){return L});var _=Number.isFinite||function(E){return typeof E=="number"&&isFinite(E)},L=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(Se,Z,U){"use strict";U.r(Z);var _=function(){function L(){}return L.getSilentFrame=function(A,w){switch(A){case"mp4a.40.2":if(w===1)return new Uint8Array([0,200,0,128,35,128]);if(w===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(w===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(w===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(w===5)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(w===6)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224]);break;default:if(w===1)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(w===2)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(w===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);break}return},L}();Z.default=_},"./src/remux/mp4-generator.ts":function(Se,Z,U){"use strict";U.r(Z);var _=Math.pow(2,32)-1,L=function(){function E(){}return E.init=function(){E.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};var w;for(w in E.types)E.types.hasOwnProperty(w)&&(E.types[w]=[w.charCodeAt(0),w.charCodeAt(1),w.charCodeAt(2),w.charCodeAt(3)]);var v=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),u=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);E.HDLR_TYPES={video:v,audio:u};var f=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),o=new Uint8Array([0,0,0,0,0,0,0,0]);E.STTS=E.STSC=E.STCO=o,E.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),E.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),E.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),E.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var t=new Uint8Array([105,115,111,109]),i=new Uint8Array([97,118,99,49]),s=new Uint8Array([0,0,0,1]);E.FTYP=E.box(E.types.ftyp,t,s,t,i),E.DINF=E.box(E.types.dinf,E.box(E.types.dref,f))},E.box=function(w){for(var v=8,u=arguments.length,f=new Array(u>1?u-1:0),o=1;o<u;o++)f[o-1]=arguments[o];for(var t=f.length,i=t;t--;)v+=f[t].byteLength;var s=new Uint8Array(v);for(s[0]=v>>24&255,s[1]=v>>16&255,s[2]=v>>8&255,s[3]=v&255,s.set(w,4),t=0,v=8;t<i;t++)s.set(f[t],v),v+=f[t].byteLength;return s},E.hdlr=function(w){return E.box(E.types.hdlr,E.HDLR_TYPES[w])},E.mdat=function(w){return E.box(E.types.mdat,w)},E.mdhd=function(w,v){v*=w;var u=Math.floor(v/(_+1)),f=Math.floor(v%(_+1));return E.box(E.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,w>>24&255,w>>16&255,w>>8&255,w&255,u>>24,u>>16&255,u>>8&255,u&255,f>>24,f>>16&255,f>>8&255,f&255,85,196,0,0]))},E.mdia=function(w){return E.box(E.types.mdia,E.mdhd(w.timescale,w.duration),E.hdlr(w.type),E.minf(w))},E.mfhd=function(w){return E.box(E.types.mfhd,new Uint8Array([0,0,0,0,w>>24,w>>16&255,w>>8&255,w&255]))},E.minf=function(w){return w.type==="audio"?E.box(E.types.minf,E.box(E.types.smhd,E.SMHD),E.DINF,E.stbl(w)):E.box(E.types.minf,E.box(E.types.vmhd,E.VMHD),E.DINF,E.stbl(w))},E.moof=function(w,v,u){return E.box(E.types.moof,E.mfhd(w),E.traf(u,v))},E.moov=function(w){for(var v=w.length,u=[];v--;)u[v]=E.trak(w[v]);return E.box.apply(null,[E.types.moov,E.mvhd(w[0].timescale,w[0].duration)].concat(u).concat(E.mvex(w)))},E.mvex=function(w){for(var v=w.length,u=[];v--;)u[v]=E.trex(w[v]);return E.box.apply(null,[E.types.mvex].concat(u))},E.mvhd=function(w,v){v*=w;var u=Math.floor(v/(_+1)),f=Math.floor(v%(_+1)),o=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,w>>24&255,w>>16&255,w>>8&255,w&255,u>>24,u>>16&255,u>>8&255,u&255,f>>24,f>>16&255,f>>8&255,f&255,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)},E.sdtp=function(w){var v=w.samples||[],u=new Uint8Array(4+v.length),f,o;for(f=0;f<v.length;f++)o=v[f].flags,u[f+4]=o.dependsOn<<4|o.isDependedOn<<2|o.hasRedundancy;return E.box(E.types.sdtp,u)},E.stbl=function(w){return E.box(E.types.stbl,E.stsd(w),E.box(E.types.stts,E.STTS),E.box(E.types.stsc,E.STSC),E.box(E.types.stsz,E.STSZ),E.box(E.types.stco,E.STCO))},E.avc1=function(w){var v=[],u=[],f,o,t;for(f=0;f<w.sps.length;f++)o=w.sps[f],t=o.byteLength,v.push(t>>>8&255),v.push(t&255),v=v.concat(Array.prototype.slice.call(o));for(f=0;f<w.pps.length;f++)o=w.pps[f],t=o.byteLength,u.push(t>>>8&255),u.push(t&255),u=u.concat(Array.prototype.slice.call(o));var i=E.box(E.types.avcC,new Uint8Array([1,v[3],v[4],v[5],252|3,224|w.sps.length].concat(v).concat([w.pps.length]).concat(u))),s=w.width,h=w.height,a=w.pixelRatio[0],e=w.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,s>>8&255,s&255,h>>8&255,h&255,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]),i,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([a>>24,a>>16&255,a>>8&255,a&255,e>>24,e>>16&255,e>>8&255,e&255])))},E.esds=function(w){var v=w.config.length;return new Uint8Array([0,0,0,0,3,23+v,0,1,0,4,15+v,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([v]).concat(w.config).concat([6,1,2]))},E.mp4a=function(w){var v=w.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,w.channelCount,0,16,0,0,0,0,v>>8&255,v&255,0,0]),E.box(E.types.esds,E.esds(w)))},E.mp3=function(w){var v=w.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,w.channelCount,0,16,0,0,0,0,v>>8&255,v&255,0,0]))},E.stsd=function(w){return w.type==="audio"?!w.isAAC&&w.codec==="mp3"?E.box(E.types.stsd,E.STSD,E.mp3(w)):E.box(E.types.stsd,E.STSD,E.mp4a(w)):E.box(E.types.stsd,E.STSD,E.avc1(w))},E.tkhd=function(w){var v=w.id,u=w.duration*w.timescale,f=w.width,o=w.height,t=Math.floor(u/(_+1)),i=Math.floor(u%(_+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,v>>24&255,v>>16&255,v>>8&255,v&255,0,0,0,0,t>>24,t>>16&255,t>>8&255,t&255,i>>24,i>>16&255,i>>8&255,i&255,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,f>>8&255,f&255,0,0,o>>8&255,o&255,0,0]))},E.traf=function(w,v){var u=E.sdtp(w),f=w.id,o=Math.floor(v/(_+1)),t=Math.floor(v%(_+1));return E.box(E.types.traf,E.box(E.types.tfhd,new Uint8Array([0,0,0,0,f>>24,f>>16&255,f>>8&255,f&255])),E.box(E.types.tfdt,new Uint8Array([1,0,0,0,o>>24,o>>16&255,o>>8&255,o&255,t>>24,t>>16&255,t>>8&255,t&255])),E.trun(w,u.length+16+20+8+16+8+8),u)},E.trak=function(w){return w.duration=w.duration||4294967295,E.box(E.types.trak,E.tkhd(w),E.mdia(w))},E.trex=function(w){var v=w.id;return E.box(E.types.trex,new Uint8Array([0,0,0,0,v>>24,v>>16&255,v>>8&255,v&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},E.trun=function(w,v){var u=w.samples||[],f=u.length,o=12+16*f,t=new Uint8Array(o),i,s,h,a,e,l;for(v+=8+o,t.set([0,0,15,1,f>>>24&255,f>>>16&255,f>>>8&255,f&255,v>>>24&255,v>>>16&255,v>>>8&255,v&255],0),i=0;i<f;i++)s=u[i],h=s.duration,a=s.size,e=s.flags,l=s.cts,t.set([h>>>24&255,h>>>16&255,h>>>8&255,h&255,a>>>24&255,a>>>16&255,a>>>8&255,a&255,e.isLeading<<2|e.dependsOn,e.isDependedOn<<6|e.hasRedundancy<<4|e.paddingValue<<1|e.isNonSync,e.degradPrio&240<<8,e.degradPrio&15,l>>>24&255,l>>>16&255,l>>>8&255,l&255],12+16*i);return E.box(E.types.trun,t)},E.initSegment=function(w){E.types||E.init();var v=E.moov(w),u=new Uint8Array(E.FTYP.byteLength+v.byteLength);return u.set(E.FTYP),u.set(v,E.FTYP.byteLength),u},E}();L.types=void 0,L.HDLR_TYPES=void 0,L.STTS=void 0,L.STSC=void 0,L.STCO=void 0,L.STSZ=void 0,L.VMHD=void 0,L.SMHD=void 0,L.STSD=void 0,L.FTYP=void 0,L.DINF=void 0,Z.default=L},"./src/remux/mp4-remuxer.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"default",function(){return l}),U.d(Z,"normalizePts",function(){return n});var _=U("./src/polyfills/number.ts"),L=U("./src/remux/aac-helper.ts"),E=U("./src/remux/mp4-generator.ts"),A=U("./src/events.ts"),w=U("./src/errors.ts"),v=U("./src/utils/logger.ts"),u=U("./src/types/loader.ts"),f=U("./src/utils/timescale-conversion.ts");function o(){return o=Object.assign||function(p){for(var m=1;m<arguments.length;m++){var b=arguments[m];for(var y in b)Object.prototype.hasOwnProperty.call(b,y)&&(p[y]=b[y])}return p},o.apply(this,arguments)}var t=10*1e3,i=1024,s=1152,h=null,a=null,e=!1,l=function(){function p(b,y,r,x){if(x===void 0&&(x=""),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=void 0,this._initDTS=void 0,this.nextAvcDts=null,this.nextAudioPts=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.observer=b,this.config=y,this.typeSupported=r,this.ISGenerated=!1,h===null){var S=navigator.userAgent||"",T=S.match(/Chrome\/(\d+)/i);h=T?parseInt(T[1]):0}if(a===null){var R=navigator.userAgent.match(/Safari\/(\d+)/i);a=R?parseInt(R[1]):0}e=!!h&&h<75||!!a&&a<600}var m=p.prototype;return m.destroy=function(){},m.resetTimeStamp=function(y){v.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=y},m.resetNextTimestamp=function(){v.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},m.resetInitSegment=function(){v.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},m.getVideoStartPts=function(y){var r=!1,x=y.reduce(function(S,T){var R=T.pts-S;return R<-4294967296?(r=!0,n(S,T.pts)):R>0?S:T.pts},y[0].pts);return r&&v.logger.debug("PTS rollover detected"),x},m.remux=function(y,r,x,S,T,R,D,k){var B,G,P,$,X,z,N=T,H=T,q=y.pid>-1,ee=r.pid>-1,fe=r.samples.length,oe=y.samples.length>0,he=fe>1,se=(!q||oe)&&(!ee||he)||this.ISGenerated||D;if(se){this.ISGenerated||(P=this.generateIS(y,r,T));var ge=this.isVideoContiguous,ie=-1;if(he&&(ie=d(r.samples),!ge&&this.config.forceKeyFrameOnDiscontinuity))if(z=!0,ie>0){v.logger.warn("[mp4-remuxer]: Dropped "+ie+" out of "+fe+" video samples due to a missing keyframe");var re=this.getVideoStartPts(r.samples);r.samples=r.samples.slice(ie),r.dropped+=ie,H+=(r.samples[0].pts-re)/(r.timescale||9e4)}else ie===-1&&(v.logger.warn("[mp4-remuxer]: No keyframe found out of "+fe+" video samples"),z=!1);if(this.ISGenerated){if(oe&&he){var Q=this.getVideoStartPts(r.samples),pe=n(y.samples[0].pts,Q)-Q,ne=pe/r.inputTimeScale;N+=Math.max(0,ne),H+=Math.max(0,-ne)}if(oe){if(y.samplerate||(v.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),P=this.generateIS(y,r,T)),G=this.remuxAudio(y,N,this.isAudioContiguous,R,ee||he||k===u.PlaylistLevelType.AUDIO?H:void 0),he){var J=G?G.endPTS-G.startPTS:0;r.inputTimeScale||(v.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),P=this.generateIS(y,r,T)),B=this.remuxVideo(r,H,ge,J)}}else he&&(B=this.remuxVideo(r,H,ge,0));B&&(B.firstKeyFrame=ie,B.independent=ie!==-1)}}return this.ISGenerated&&(x.samples.length&&(X=this.remuxID3(x,T)),S.samples.length&&($=this.remuxText(S,T))),{audio:G,video:B,initSegment:P,independent:z,text:$,id3:X}},m.generateIS=function(y,r,x){var S=y.samples,T=r.samples,R=this.typeSupported,D={},k=!Object(_.isFiniteNumber)(this._initPTS),B="audio/mp4",G,P,$;if(k&&(G=P=Infinity),y.config&&S.length&&(y.timescale=y.samplerate,y.isAAC||(R.mpeg?(B="audio/mpeg",y.codec=""):R.mp3&&(y.codec="mp3")),D.audio={id:"audio",container:B,codec:y.codec,initSegment:!y.isAAC&&R.mpeg?new Uint8Array(0):E.default.initSegment([y]),metadata:{channelCount:y.channelCount}},k&&($=y.inputTimeScale,G=P=S[0].pts-Math.round($*x))),r.sps&&r.pps&&T.length&&(r.timescale=r.inputTimeScale,D.video={id:"main",container:"video/mp4",codec:r.codec,initSegment:E.default.initSegment([r]),metadata:{width:r.width,height:r.height}},k)){$=r.inputTimeScale;var X=this.getVideoStartPts(T),z=Math.round($*x);P=Math.min(P,n(T[0].dts,X)-z),G=Math.min(G,X-z)}if(Object.keys(D).length)return this.ISGenerated=!0,k&&(this._initPTS=G,this._initDTS=P),{tracks:D,initPTS:G,timescale:$}},m.remuxVideo=function(y,r,x,S){var T=y.inputTimeScale,R=y.samples,D=[],k=R.length,B=this._initPTS,G=this.nextAvcDts,P=8,$,X,z,N=Number.POSITIVE_INFINITY,H=Number.NEGATIVE_INFINITY,q=0,ee=!1;if(!x||G===null){var fe=r*T,oe=R[0].pts-n(R[0].dts,R[0].pts);G=fe-oe}for(var he=0;he<k;he++){var se=R[he];if(se.pts=n(se.pts-B,G),se.dts=n(se.dts-B,G),se.dts>se.pts){var ge=9e4*.2;q=Math.max(Math.min(q,se.pts-se.dts),-1*ge)}se.dts<R[he>0?he-1:he].dts&&(ee=!0)}ee&&R.sort(function(Je,$e){var et=Je.dts-$e.dts,nt=Je.pts-$e.pts;return et||nt}),X=R[0].dts,z=R[R.length-1].dts;var ie=Math.round((z-X)/(k-1));if(q<0){if(q<ie*-2){v.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(f.toMsFromMpegTsClock)(-ie,!0)+" ms");for(var re=q,Q=0;Q<k;Q++)R[Q].dts=re=Math.max(re,R[Q].pts-ie),R[Q].pts=Math.max(re,R[Q].pts)}else{v.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(f.toMsFromMpegTsClock)(q,!0)+" ms to overcome this issue");for(var pe=0;pe<k;pe++)R[pe].dts=R[pe].dts+q}X=R[0].dts}if(x){var ne=X-G,J=ne>ie,be=ne<-1;if(J||be){J?v.logger.warn("AVC: "+Object(f.toMsFromMpegTsClock)(ne,!0)+" ms ("+ne+"dts) hole between fragments detected, filling it"):v.logger.warn("AVC: "+Object(f.toMsFromMpegTsClock)(-ne,!0)+" ms ("+ne+"dts) overlapping between fragments detected"),X=G;var Ee=R[0].pts-ne;R[0].dts=X,R[0].pts=Ee,v.logger.log("Video: First PTS/DTS adjusted: "+Object(f.toMsFromMpegTsClock)(Ee,!0)+"/"+Object(f.toMsFromMpegTsClock)(X,!0)+", delta: "+Object(f.toMsFromMpegTsClock)(ne,!0)+" ms")}}e&&(X=Math.max(0,X));for(var Le=0,V=0,C=0;C<k;C++){for(var O=R[C],j=O.units,M=j.length,F=0,ae=0;ae<M;ae++)F+=j[ae].data.length;V+=F,Le+=M,O.length=F,O.dts=Math.max(O.dts,X),O.pts=Math.max(O.pts,O.dts,0),N=Math.min(O.pts,N),H=Math.max(O.pts,H)}z=R[k-1].dts;var ve=V+4*Le+8,Pe;try{Pe=new Uint8Array(ve)}catch(Je){this.observer.emit(A.Events.ERROR,A.Events.ERROR,{type:w.ErrorTypes.MUX_ERROR,details:w.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:ve,reason:"fail allocating video mdat "+ve});return}var Oe=new DataView(Pe.buffer);Oe.setUint32(0,ve),Pe.set(E.default.types.mdat,4);for(var De=0;De<k;De++){for(var Ne=R[De],Ke=Ne.units,ke=0,Re=0,Te=Ke.length;Re<Te;Re++){var we=Ke[Re],xe=we.data,ue=we.data.byteLength;Oe.setUint32(P,ue),P+=4,Pe.set(xe,P),P+=ue,ke+=4+ue}if(De<k-1)$=R[De+1].dts-Ne.dts;else{var de=this.config,_e=Ne.dts-R[De>0?De-1:De].dts;if(de.stretchShortVideoTrack&&this.nextAudioPts!==null){var me=Math.floor(de.maxBufferHole*T),Ie=(S?N+S*T:this.nextAudioPts)-Ne.pts;Ie>me?($=Ie-_e,$<0&&($=_e),v.logger.log("[mp4-remuxer]: It is approximately "+Ie/90+" ms to the next segment; using duration "+$/90+" ms for the last video frame.")):$=_e}else $=_e}var Me=Math.round(Ne.pts-Ne.dts);D.push(new c(Ne.key,$,ke,Me))}if(D.length&&h&&h<70){var Ve=D[0].flags;Ve.dependsOn=2,Ve.isNonSync=0}console.assert($!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=G=z+$,this.isVideoContiguous=!0;var ot=E.default.moof(y.sequenceNumber++,X,o({},y,{samples:D})),tt="video",Ge={data1:ot,data2:Pe,startPTS:N/T,endPTS:(H+$)/T,startDTS:X/T,endDTS:G/T,type:tt,hasAudio:!1,hasVideo:!0,nb:D.length,dropped:y.dropped};return y.samples=[],y.dropped=0,console.assert(Pe.length,"MDAT length must not be zero"),Ge},m.remuxAudio=function(y,r,x,S,T){var R=y.inputTimeScale,D=y.samplerate?y.samplerate:R,k=R/D,B=y.isAAC?i:s,G=B*k,P=this._initPTS,$=!y.isAAC&&this.typeSupported.mpeg,X=[],z=y.samples,N=$?0:8,H=this.nextAudioPts||-1,q=r*R;if(this.isAudioContiguous=x=x||z.length&&H>0&&(S&&Math.abs(q-H)<9e3||Math.abs(n(z[0].pts-P,q)-H)<20*G),z.forEach(function(xe){xe.pts=n(xe.pts-P,q)}),!x||H<0){if(z=z.filter(function(xe){return xe.pts>=0}),!z.length)return;T===0?H=0:S?H=Math.max(0,q):H=z[0].pts}if(y.isAAC)for(var ee=T!==void 0,fe=this.config.maxAudioFramesDrift,oe=0,he=H;oe<z.length;oe++){var se=z[oe],ge=se.pts,ie=ge-he,re=Math.abs(1e3*ie/R);if(ie<=-fe*G&&ee)oe===0&&(v.logger.warn("Audio frame @ "+(ge/R).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*ie/R)+" ms."),this.nextAudioPts=H=he=ge);else if(ie>=fe*G&&re<t&&ee){var Q=Math.round(ie/G);he=ge-Q*G,he<0&&(Q--,he+=G),oe===0&&(this.nextAudioPts=H=he),v.logger.warn("[mp4-remuxer]: Injecting "+Q+" audio frame @ "+(he/R).toFixed(3)+"s due to "+Math.round(1e3*ie/R)+" ms gap.");for(var pe=0;pe<Q;pe++){var ne=Math.max(he,0),J=L.default.getSilentFrame(y.manifestCodec||y.codec,y.channelCount);J||(v.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),J=se.unit.subarray()),z.splice(oe,0,{unit:J,pts:ne}),he+=G,oe++}}se.pts=he,he+=G}for(var be=null,Ee=null,Le,V=0,C=z.length;C--;)V+=z[C].unit.byteLength;for(var O=0,j=z.length;O<j;O++){var M=z[O],F=M.unit,ae=M.pts;if(Ee!==null){var ve=X[O-1];ve.duration=Math.round((ae-Ee)/k)}else if(x&&y.isAAC&&(ae=H),be=ae,V>0){V+=N;try{Le=new Uint8Array(V)}catch(xe){this.observer.emit(A.Events.ERROR,A.Events.ERROR,{type:w.ErrorTypes.MUX_ERROR,details:w.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:V,reason:"fail allocating audio mdat "+V});return}if(!$){var Pe=new DataView(Le.buffer);Pe.setUint32(0,V),Le.set(E.default.types.mdat,4)}}else return;Le.set(F,N);var Oe=F.byteLength;N+=Oe,X.push(new c(!0,B,Oe,0)),Ee=ae}var De=X.length;if(!De)return;var Ne=X[X.length-1];this.nextAudioPts=H=Ee+k*Ne.duration;var Ke=$?new Uint8Array(0):E.default.moof(y.sequenceNumber++,be/k,o({},y,{samples:X}));y.samples=[];var ke=be/R,Re=H/R,Te="audio",we={data1:Ke,data2:Le,startPTS:ke,endPTS:Re,startDTS:ke,endDTS:Re,type:Te,hasAudio:!0,hasVideo:!1,nb:De};return this.isAudioContiguous=!0,console.assert(Le.length,"MDAT length must not be zero"),we},m.remuxEmptyAudio=function(y,r,x,S){var T=y.inputTimeScale,R=y.samplerate?y.samplerate:T,D=T/R,k=this.nextAudioPts,B=(k!==null?k:S.startDTS*T)+this._initDTS,G=S.endDTS*T+this._initDTS,P=D*i,$=Math.ceil((G-B)/P),X=L.default.getSilentFrame(y.manifestCodec||y.codec,y.channelCount);if(v.logger.warn("[mp4-remuxer]: remux empty Audio"),!X){v.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var z=[],N=0;N<$;N++){var H=B+N*P;z.push({unit:X,pts:H,dts:H})}return y.samples=z,this.remuxAudio(y,r,x,!1)},m.remuxID3=function(y,r){var x=y.samples.length;if(!x)return;for(var S=y.inputTimeScale,T=this._initPTS,R=this._initDTS,D=0;D<x;D++){var k=y.samples[D];k.pts=n(k.pts-T,r*S)/S,k.dts=n(k.dts-R,r*S)/S}var B=y.samples;return y.samples=[],{samples:B}},m.remuxText=function(y,r){var x=y.samples.length;if(!x)return;for(var S=y.inputTimeScale,T=this._initPTS,R=0;R<x;R++){var D=y.samples[R];D.pts=n(D.pts-T,r*S)/S}y.samples.sort(function(B,G){return B.pts-G.pts});var k=y.samples;return y.samples=[],{samples:k}},p}();function n(p,m){var b;if(m===null)return p;for(m<p?b=-8589934592:b=8589934592;Math.abs(p-m)>4294967296;)p+=b;return p}function d(p){for(var m=0;m<p.length;m++)if(p[m].key)return m;return-1}var c=function(m,b,y,r){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=b,this.size=y,this.cts=r,this.flags=new g(m)},g=function(m){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=m?2:1,this.isNonSync=m?0:1}},"./src/remux/passthrough-remuxer.ts":function(Se,Z,U){"use strict";U.r(Z);var _=U("./src/polyfills/number.ts"),L=U("./src/utils/mp4-tools.ts"),E=U("./src/loader/fragment.ts"),A=U("./src/utils/logger.ts"),w=function(){function f(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=void 0,this.initTracks=void 0,this.lastEndDTS=null}var o=f.prototype;return o.destroy=function(){},o.resetTimeStamp=function(i){this.initPTS=i,this.lastEndDTS=null},o.resetNextTimestamp=function(){this.lastEndDTS=null},o.resetInitSegment=function(i,s,h){this.audioCodec=s,this.videoCodec=h,this.generateInitSegment(i),this.emitInitSegment=!0},o.generateInitSegment=function(i){var s=this.audioCodec,h=this.videoCodec;if(!i||!i.byteLength){this.initTracks=void 0,this.initData=void 0;return}var a=this.initData=Object(L.parseInitSegment)(i);s||(s=u(a.audio,E.ElementaryStreamTypes.AUDIO)),h||(h=u(a.video,E.ElementaryStreamTypes.VIDEO));var e={};a.audio&&a.video?e.audiovideo={container:"video/mp4",codec:s+","+h,initSegment:i,id:"main"}:a.audio?e.audio={container:"audio/mp4",codec:s,initSegment:i,id:"audio"}:a.video?e.video={container:"video/mp4",codec:h,initSegment:i,id:"main"}:A.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=e},o.remux=function(i,s,h,a,e){var l=this.initPTS,n=this.lastEndDTS,d={audio:void 0,video:void 0,text:a,id3:h,initSegment:void 0};Object(_.isFiniteNumber)(n)||(n=this.lastEndDTS=e||0);var c=s.samples;if(!c||!c.length)return d;var g={initPTS:void 0,timescale:1},p=this.initData;if((!p||!p.length)&&(this.generateInitSegment(c),p=this.initData),!p||!p.length)return A.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),d;this.emitInitSegment&&(g.tracks=this.initTracks,this.emitInitSegment=!1),Object(_.isFiniteNumber)(l)||(this.initPTS=g.initPTS=l=v(p,c,n));var m=Object(L.getDuration)(c,p),b=n,y=m+b;Object(L.offsetStartDTS)(p,c,l),m>0?this.lastEndDTS=y:(A.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var r=!!p.audio,x=!!p.video,S="";r&&(S+="audio"),x&&(S+="video");var T={data1:c,startPTS:b,startDTS:b,endPTS:y,endDTS:y,type:S,hasAudio:r,hasVideo:x,nb:1,dropped:0};return d.audio=T.type==="audio"?T:void 0,d.video=T.type!=="audio"?T:void 0,d.text=a,d.id3=h,d.initSegment=g,d},f}(),v=function(o,t,i){return Object(L.getStartDTS)(o,t)-i};function u(f,o){var t=f==null?void 0:f.codec;return t&&t.length>4?t:t==="hvc1"?"hvc1.1.c.L120.90":t==="av01"?"av01.0.04M.08":t==="avc1"||o===E.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}Z.default=w},"./src/task-loop.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"default",function(){return _});var _=function(){function L(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var E=L.prototype;return E.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},E.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},E.onHandlerDestroyed=function(){},E.hasInterval=function(){return!!this._tickInterval},E.hasNextTick=function(){return!!this._tickTimer},E.setInterval=function(w){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,w),!0)},E.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},E.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},E.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},E.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},E.doTick=function(){},L}()},"./src/types/cmcd.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"CMCDVersion",function(){return _}),U.d(Z,"CMCDObjectType",function(){return L}),U.d(Z,"CMCDStreamingFormat",function(){return E}),U.d(Z,"CMCDStreamType",function(){return A});var _=1,L;(function(w){w.MANIFEST="m",w.AUDIO="a",w.VIDEO="v",w.MUXED="av",w.INIT="i",w.CAPTION="c",w.TIMED_TEXT="tt",w.KEY="k",w.OTHER="o"})(L||(L={}));var E;(function(w){w.DASH="d",w.HLS="h",w.SMOOTH="s",w.OTHER="o"})(E||(E={}));var A;(function(w){w.VOD="v",w.LIVE="l"})(A||(A={}))},"./src/types/level.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"HlsSkip",function(){return E}),U.d(Z,"getSkipValue",function(){return A}),U.d(Z,"HlsUrlParameters",function(){return w}),U.d(Z,"Level",function(){return v});function _(u,f){for(var o=0;o<f.length;o++){var t=f[o];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(u,t.key,t)}}function L(u,f,o){return f&&_(u.prototype,f),o&&_(u,o),u}var E;(function(u){u.No="",u.Yes="YES",u.v2="v2"})(E||(E={}));function A(u,f){var o=u.canSkipUntil,t=u.canSkipDateRanges,i=u.endSN,s=f!==void 0?f-i:0;return o&&s<o?t?E.v2:E.Yes:E.No}var w=function(){function u(o,t,i){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=o,this.part=t,this.skip=i}var f=u.prototype;return f.addDirectives=function(t){var i=new self.URL(t);return this.msn!==void 0&&i.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&i.searchParams.set("_HLS_part",this.part.toString()),this.skip&&i.searchParams.set("_HLS_skip",this.skip),i.toString()},u}(),v=function(){function u(f){this.attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.unknownCodecs=void 0,this.audioGroupIds=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.textGroupIds=void 0,this.url=void 0,this._urlId=0,this.url=[f.url],this.attrs=f.attrs,this.bitrate=f.bitrate,f.details&&(this.details=f.details),this.id=f.id||0,this.name=f.name,this.width=f.width||0,this.height=f.height||0,this.audioCodec=f.audioCodec,this.videoCodec=f.videoCodec,this.unknownCodecs=f.unknownCodecs,this.codecSet=[f.videoCodec,f.audioCodec].filter(function(o){return o}).join(",").replace(/\.[^.,]+/g,"")}return L(u,[{key:"maxBitrate",get:function(){return Math.max(this.realBitrate,this.bitrate)}},{key:"uri",get:function(){return this.url[this._urlId]||""}},{key:"urlId",get:function(){return this._urlId},set:function(o){var t=o%this.url.length;this._urlId!==t&&(this.details=void 0,this._urlId=t)}}]),u}()},"./src/types/loader.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"PlaylistContextType",function(){return _}),U.d(Z,"PlaylistLevelType",function(){return L});var _;(function(E){E.MANIFEST="manifest",E.LEVEL="level",E.AUDIO_TRACK="audioTrack",E.SUBTITLE_TRACK="subtitleTrack"})(_||(_={}));var L;(function(E){E.MAIN="main",E.AUDIO="audio",E.SUBTITLE="subtitle"})(L||(L={}))},"./src/types/transmuxer.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"ChunkMetadata",function(){return _});var _=function(A,w,v,u,f,o){u===void 0&&(u=0),f===void 0&&(f=-1),o===void 0&&(o=!1),this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing=L(),this.buffering={audio:L(),video:L(),audiovideo:L()},this.level=A,this.sn=w,this.id=v,this.size=u,this.part=f,this.partial=o};function L(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"AttrList",function(){return E});var _=/^(\d+)x(\d+)$/,L=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,E=function(){function A(v){typeof v=="string"&&(v=A.parseAttrList(v));for(var u in v)v.hasOwnProperty(u)&&(this[u]=v[u])}var w=A.prototype;return w.decimalInteger=function(u){var f=parseInt(this[u],10);return f>Number.MAX_SAFE_INTEGER?Infinity:f},w.hexadecimalInteger=function(u){if(this[u]){var f=(this[u]||"0x").slice(2);f=(f.length&1?"0":"")+f;for(var o=new Uint8Array(f.length/2),t=0;t<f.length/2;t++)o[t]=parseInt(f.slice(t*2,t*2+2),16);return o}else return null},w.hexadecimalIntegerAsNumber=function(u){var f=parseInt(this[u],16);return f>Number.MAX_SAFE_INTEGER?Infinity:f},w.decimalFloatingPoint=function(u){return parseFloat(this[u])},w.optionalFloat=function(u,f){var o=this[u];return o?parseFloat(o):f},w.enumeratedString=function(u){return this[u]},w.bool=function(u){return this[u]==="YES"},w.decimalResolution=function(u){var f=_.exec(this[u]);return f===null?void 0:{width:parseInt(f[1],10),height:parseInt(f[2],10)}},A.parseAttrList=function(u){var f,o={},t='"';for(L.lastIndex=0;(f=L.exec(u))!==null;){var i=f[2];i.indexOf(t)===0&&i.lastIndexOf(t)===i.length-1&&(i=i.slice(1,-1)),o[f[1]]=i}return o},A}()},"./src/utils/binary-search.ts":function(Se,Z,U){"use strict";U.r(Z);var _={search:function(E,A){for(var w=0,v=E.length-1,u=null,f=null;w<=v;){u=(w+v)/2|0,f=E[u];var o=A(f);if(o>0)w=u+1;else if(o<0)v=u-1;else return f}return null}};Z.default=_},"./src/utils/buffer-helper.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"BufferHelper",function(){return E});var _=U("./src/utils/logger.ts"),L={length:0,start:function(){return 0},end:function(){return 0}},E=function(){function A(){}return A.isBuffered=function(v,u){try{if(v){for(var f=A.getBuffered(v),o=0;o<f.length;o++)if(u>=f.start(o)&&u<=f.end(o))return!0}}catch(t){}return!1},A.bufferInfo=function(v,u,f){try{if(v){var o=A.getBuffered(v),t=[],i;for(i=0;i<o.length;i++)t.push({start:o.start(i),end:o.end(i)});return this.bufferedInfo(t,u,f)}}catch(s){}return{len:0,start:u,end:u,nextStart:void 0}},A.bufferedInfo=function(v,u,f){u=Math.max(0,u),v.sort(function(g,p){var m=g.start-p.start;return m||p.end-g.end});var o=[];if(f)for(var t=0;t<v.length;t++){var i=o.length;if(i){var s=o[i-1].end;v[t].start-s<f?v[t].end>s&&(o[i-1].end=v[t].end):o.push(v[t])}else o.push(v[t])}else o=v;for(var h=0,a,e=u,l=u,n=0;n<o.length;n++){var d=o[n].start,c=o[n].end;if(u+f>=d&&u<c)e=d,l=c,h=l-u;else if(u+f<d){a=d;break}}return{len:h,start:e||0,end:l||0,nextStart:a}},A.getBuffered=function(v){try{return v.buffered}catch(u){return _.logger.log("failed to get media.buffered",u),L}},A}()},"./src/utils/cea-608-parser.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"Row",function(){return l}),U.d(Z,"CaptionScreen",function(){return n});var _=U("./src/utils/logger.ts"),L={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},E=function(y){var r=y;return L.hasOwnProperty(y)&&(r=L[y]),String.fromCharCode(r)},A=15,w=100,v={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},u={17:2,18:4,21:6,22:8,23:10,19:13,20:15},f={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},o={25:2,26:4,29:6,30:8,31:10,27:13,28:15},t=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],i;(function(b){b[b.ERROR=0]="ERROR",b[b.TEXT=1]="TEXT",b[b.WARNING=2]="WARNING",b[b.INFO=2]="INFO",b[b.DEBUG=3]="DEBUG",b[b.DATA=3]="DATA"})(i||(i={}));var s=function(){function b(){this.time=null,this.verboseLevel=i.ERROR}var y=b.prototype;return y.log=function(x,S){this.verboseLevel>=x&&_.logger.log(this.time+" ["+x+"] "+S)},b}(),h=function(y){for(var r=[],x=0;x<y.length;x++)r.push(y[x].toString(16));return r},a=function(){function b(r,x,S,T,R){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=r||"white",this.underline=x||!1,this.italics=S||!1,this.background=T||"black",this.flash=R||!1}var y=b.prototype;return y.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},y.setStyles=function(x){for(var S=["foreground","underline","italics","background","flash"],T=0;T<S.length;T++){var R=S[T];x.hasOwnProperty(R)&&(this[R]=x[R])}},y.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},y.equals=function(x){return this.foreground===x.foreground&&this.underline===x.underline&&this.italics===x.italics&&this.background===x.background&&this.flash===x.flash},y.copy=function(x){this.foreground=x.foreground,this.underline=x.underline,this.italics=x.italics,this.background=x.background,this.flash=x.flash},y.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},b}(),e=function(){function b(r,x,S,T,R,D){this.uchar=void 0,this.penState=void 0,this.uchar=r||" ",this.penState=new a(x,S,T,R,D)}var y=b.prototype;return y.reset=function(){this.uchar=" ",this.penState.reset()},y.setChar=function(x,S){this.uchar=x,this.penState.copy(S)},y.setPenState=function(x){this.penState.copy(x)},y.equals=function(x){return this.uchar===x.uchar&&this.penState.equals(x.penState)},y.copy=function(x){this.uchar=x.uchar,this.penState.copy(x.penState)},y.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},b}(),l=function(){function b(r){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var x=0;x<w;x++)this.chars.push(new e);this.logger=r,this.pos=0,this.currPenState=new a}var y=b.prototype;return y.equals=function(x){for(var S=!0,T=0;T<w;T++)if(!this.chars[T].equals(x.chars[T])){S=!1;break}return S},y.copy=function(x){for(var S=0;S<w;S++)this.chars[S].copy(x.chars[S])},y.isEmpty=function(){for(var x=!0,S=0;S<w;S++)if(!this.chars[S].isEmpty()){x=!1;break}return x},y.setCursor=function(x){this.pos!==x&&(this.pos=x),this.pos<0?(this.logger.log(i.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>w&&(this.logger.log(i.DEBUG,"Too large cursor position "+this.pos),this.pos=w)},y.moveCursor=function(x){var S=this.pos+x;if(x>1)for(var T=this.pos+1;T<S+1;T++)this.chars[T].setPenState(this.currPenState);this.setCursor(S)},y.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},y.insertChar=function(x){x>=144&&this.backSpace();var S=E(x);if(this.pos>=w){this.logger.log(i.ERROR,"Cannot insert "+x.toString(16)+" ("+S+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(S,this.currPenState),this.moveCursor(1)},y.clearFromPos=function(x){var S;for(S=x;S<w;S++)this.chars[S].reset()},y.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},y.clearToEndOfRow=function(){this.clearFromPos(this.pos)},y.getTextString=function(){for(var x=[],S=!0,T=0;T<w;T++){var R=this.chars[T].uchar;R!==" "&&(S=!1),x.push(R)}return S?"":x.join("")},y.setPenStyles=function(x){this.currPenState.setStyles(x);var S=this.chars[this.pos];S.setPenState(this.currPenState)},b}(),n=function(){function b(r){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var x=0;x<A;x++)this.rows.push(new l(r));this.logger=r,this.currRow=A-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var y=b.prototype;return y.reset=function(){for(var x=0;x<A;x++)this.rows[x].clear();this.currRow=A-1},y.equals=function(x){for(var S=!0,T=0;T<A;T++)if(!this.rows[T].equals(x.rows[T])){S=!1;break}return S},y.copy=function(x){for(var S=0;S<A;S++)this.rows[S].copy(x.rows[S])},y.isEmpty=function(){for(var x=!0,S=0;S<A;S++)if(!this.rows[S].isEmpty()){x=!1;break}return x},y.backSpace=function(){var x=this.rows[this.currRow];x.backSpace()},y.clearToEndOfRow=function(){var x=this.rows[this.currRow];x.clearToEndOfRow()},y.insertChar=function(x){var S=this.rows[this.currRow];S.insertChar(x)},y.setPen=function(x){var S=this.rows[this.currRow];S.setPenStyles(x)},y.moveCursor=function(x){var S=this.rows[this.currRow];S.moveCursor(x)},y.setCursor=function(x){this.logger.log(i.INFO,"setCursor: "+x);var S=this.rows[this.currRow];S.setCursor(x)},y.setPAC=function(x){this.logger.log(i.INFO,"pacData = "+JSON.stringify(x));var S=x.row-1;if(this.nrRollUpRows&&S<this.nrRollUpRows-1&&(S=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==S){for(var T=0;T<A;T++)this.rows[T].clear();var R=this.currRow+1-this.nrRollUpRows,D=this.lastOutputScreen;if(D){var k=D.rows[R].cueStartTime,B=this.logger.time;if(k&&B!==null&&k<B)for(var G=0;G<this.nrRollUpRows;G++)this.rows[S-this.nrRollUpRows+G+1].copy(D.rows[R+G])}}this.currRow=S;var P=this.rows[this.currRow];if(x.indent!==null){var $=x.indent,X=Math.max($-1,0);P.setCursor(x.indent),x.color=P.chars[X].penState.foreground}var z={foreground:x.color,underline:x.underline,italics:x.italics,background:"black",flash:!1};this.setPen(z)},y.setBkgData=function(x){this.logger.log(i.INFO,"bkgData = "+JSON.stringify(x)),this.backSpace(),this.setPen(x),this.insertChar(32)},y.setRollUpRows=function(x){this.nrRollUpRows=x},y.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(i.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(i.TEXT,this.getDisplayText());var x=this.currRow+1-this.nrRollUpRows,S=this.rows.splice(x,1)[0];S.clear(),this.rows.splice(this.currRow,0,S),this.logger.log(i.INFO,"Rolling up")},y.getDisplayText=function(x){x=x||!1;for(var S=[],T="",R=-1,D=0;D<A;D++){var k=this.rows[D].getTextString();k&&(R=D+1,x?S.push("Row "+R+": '"+k+"'"):S.push(k.trim()))}return S.length>0&&(x?T="["+S.join(" | ")+"]":T=S.join(`
|
|
|
`)),T},y.getTextAndFormat=function(){return this.rows},b}(),d=function(){function b(r,x,S){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=r,this.outputFilter=x,this.mode=null,this.verbose=0,this.displayedMemory=new n(S),this.nonDisplayedMemory=new n(S),this.lastOutputScreen=new n(S),this.currRollUpRow=this.displayedMemory.rows[A-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=S}var y=b.prototype;return y.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[A-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},y.getHandler=function(){return this.outputFilter},y.setHandler=function(x){this.outputFilter=x},y.setPAC=function(x){this.writeScreen.setPAC(x)},y.setBkgData=function(x){this.writeScreen.setBkgData(x)},y.setMode=function(x){if(x===this.mode)return;this.mode=x,this.logger.log(i.INFO,"MODE="+x),this.mode==="MODE_POP-ON"?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),this.mode!=="MODE_ROLL-UP"&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=x},y.insertChars=function(x){for(var S=0;S<x.length;S++)this.writeScreen.insertChar(x[S]);var T=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(i.INFO,T+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(i.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},y.ccRCL=function(){this.logger.log(i.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},y.ccBS=function(){if(this.logger.log(i.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},y.ccAOF=function(){},y.ccAON=function(){},y.ccDER=function(){this.logger.log(i.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},y.ccRU=function(x){this.logger.log(i.INFO,"RU("+x+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(x)},y.ccFON=function(){this.logger.log(i.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},y.ccRDC=function(){this.logger.log(i.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},y.ccTR=function(){this.logger.log(i.INFO,"TR"),this.setMode("MODE_TEXT")},y.ccRTD=function(){this.logger.log(i.INFO,"RTD"),this.setMode("MODE_TEXT")},y.ccEDM=function(){this.logger.log(i.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},y.ccCR=function(){this.logger.log(i.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},y.ccENM=function(){this.logger.log(i.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},y.ccEOC=function(){if(this.logger.log(i.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var x=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=x,this.writeScreen=this.nonDisplayedMemory,this.logger.log(i.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},y.ccTO=function(x){this.logger.log(i.INFO,"TO("+x+") - Tab Offset"),this.writeScreen.moveCursor(x)},y.ccMIDROW=function(x){var S={flash:!1};if(S.underline=x%2===1,S.italics=x>=46,S.italics)S.foreground="white";else{var T=Math.floor(x/2)-16,R=["white","green","blue","cyan","red","yellow","magenta"];S.foreground=R[T]}this.logger.log(i.INFO,"MIDROW: "+JSON.stringify(S)),this.writeScreen.setPen(S)},y.outputDataUpdate=function(x){x===void 0&&(x=!1);var S=this.logger.time;if(S===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=S:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,S,this.lastOutputScreen),x&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:S),this.lastOutputScreen.copy(this.displayedMemory))},y.cueSplitAtTime=function(x){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,x,this.displayedMemory),this.cueStartTime=x))},b}(),c=function(){function b(r,x,S){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var T=new s;this.channels=[null,new d(r,x,T),new d(r+1,S,T)],this.cmdHistory=m(),this.logger=T}var y=b.prototype;return y.getHandler=function(x){return this.channels[x].getHandler()},y.setHandler=function(x,S){this.channels[x].setHandler(S)},y.addData=function(x,S){var T,R,D,k=!1;this.logger.time=x;for(var B=0;B<S.length;B+=2){if(R=S[B]&127,D=S[B+1]&127,R===0&&D===0)continue;if(this.logger.log(i.DATA,"["+h([S[B],S[B+1]])+"] -> ("+h([R,D])+")"),T=this.parseCmd(R,D),T||(T=this.parseMidrow(R,D)),T||(T=this.parsePAC(R,D)),T||(T=this.parseBackgroundAttributes(R,D)),!T&&(k=this.parseChars(R,D),k)){var G=this.currentChannel;if(G&&G>0){var P=this.channels[G];P.insertChars(k)}else this.logger.log(i.WARNING,"No channel found yet. TEXT-MODE?")}!T&&!k&&this.logger.log(i.WARNING,"Couldn't parse cleaned data "+h([R,D])+" orig: "+h([S[B],S[B+1]]))}},y.parseCmd=function(x,S){var T=this.cmdHistory,R=(x===20||x===28||x===21||x===29)&&S>=32&&S<=47,D=(x===23||x===31)&&S>=33&&S<=35;if(!(R||D))return!1;if(p(x,S,T))return g(null,null,T),this.logger.log(i.DEBUG,"Repeated command ("+h([x,S])+") is dropped"),!0;var k=x===20||x===21||x===23?1:2,B=this.channels[k];return x===20||x===21||x===28||x===29?S===32?B.ccRCL():S===33?B.ccBS():S===34?B.ccAOF():S===35?B.ccAON():S===36?B.ccDER():S===37?B.ccRU(2):S===38?B.ccRU(3):S===39?B.ccRU(4):S===40?B.ccFON():S===41?B.ccRDC():S===42?B.ccTR():S===43?B.ccRTD():S===44?B.ccEDM():S===45?B.ccCR():S===46?B.ccENM():S===47&&B.ccEOC():B.ccTO(S-32),g(x,S,T),this.currentChannel=k,!0},y.parseMidrow=function(x,S){var T=0;if((x===17||x===25)&&S>=32&&S<=47){if(x===17?T=1:T=2,T!==this.currentChannel)return this.logger.log(i.ERROR,"Mismatch channel in midrow parsing"),!1;var R=this.channels[T];return R?(R.ccMIDROW(S),this.logger.log(i.DEBUG,"MIDROW ("+h([x,S])+")"),!0):!1}return!1},y.parsePAC=function(x,S){var T,R=this.cmdHistory,D=(x>=17&&x<=23||x>=25&&x<=31)&&S>=64&&S<=127,k=(x===16||x===24)&&S>=64&&S<=95;if(!(D||k))return!1;if(p(x,S,R))return g(null,null,R),!0;var B=x<=23?1:2;S>=64&&S<=95?T=B===1?v[x]:f[x]:T=B===1?u[x]:o[x];var G=this.channels[B];return G?(G.setPAC(this.interpretPAC(T,S)),g(x,S,R),this.currentChannel=B,!0):!1},y.interpretPAC=function(x,S){var T,R={color:null,italics:!1,indent:null,underline:!1,row:x};return S>95?T=S-96:T=S-64,R.underline=(T&1)===1,T<=13?R.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(T/2)]:T<=15?(R.italics=!0,R.color="white"):R.indent=Math.floor((T-16)/2)*4,R},y.parseChars=function(x,S){var T,R=null,D=null;if(x>=25?(T=2,D=x-8):(T=1,D=x),D>=17&&D<=19){var k;D===17?k=S+80:D===18?k=S+112:k=S+144,this.logger.log(i.INFO,"Special char '"+E(k)+"' in channel "+T),R=[k]}else x>=32&&x<=127&&(R=S===0?[x]:[x,S]);if(R){var B=h(R);this.logger.log(i.DEBUG,"Char codes = "+B.join(",")),g(x,S,this.cmdHistory)}return R},y.parseBackgroundAttributes=function(x,S){var T=(x===16||x===24)&&S>=32&&S<=47,R=(x===23||x===31)&&S>=45&&S<=47;if(!(T||R))return!1;var D,k={};x===16||x===24?(D=Math.floor((S-32)/2),k.background=t[D],S%2===1&&(k.background=k.background+"_semi")):S===45?k.background="transparent":(k.foreground="black",S===47&&(k.underline=!0));var B=x<=23?1:2,G=this.channels[B];return G.setBkgData(k),g(x,S,this.cmdHistory),!0},y.reset=function(){for(var x=0;x<Object.keys(this.channels).length;x++){var S=this.channels[x];S&&S.reset()}this.cmdHistory=m()},y.cueSplitAtTime=function(x){for(var S=0;S<this.channels.length;S++){var T=this.channels[S];T&&T.cueSplitAtTime(x)}},b}();function g(b,y,r){r.a=b,r.b=y}function p(b,y,r){return r.a===b&&r.b===y}function m(){return{a:null,b:null}}Z.default=c},"./src/utils/codecs.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"isCodecType",function(){return L}),U.d(Z,"isCodecSupportedInMp4",function(){return E});var _={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,av01:!0,drac:!0,dvav:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0},text:{stpp:!0,wvtt:!0}};function L(A,w){var v=_[w];return!!v&&v[A.slice(0,4)]===!0}function E(A,w){return MediaSource.isTypeSupported((w||"video")+'/mp4;codecs="'+A+'"')}},"./src/utils/cues.ts":function(Se,Z,U){"use strict";U.r(Z);var _=U("./src/utils/vttparser.ts"),L=U("./src/utils/webvtt-parser.ts"),E=U("./src/utils/texttrack-utils.ts"),A=/\s/,w={newCue:function(u,f,o,t){for(var i=[],s,h,a,e,l,n=self.VTTCue||self.TextTrackCue,d=0;d<t.rows.length;d++)if(s=t.rows[d],a=!0,e=0,l="",!s.isEmpty()){for(var c=0;c<s.chars.length;c++)A.test(s.chars[c].uchar)&&a?e++:(l+=s.chars[c].uchar,a=!1);s.cueStartTime=f,f===o&&(o+=1e-4),e>=16?e--:e++;var g=Object(_.fixLineBreaks)(l.trim()),p=Object(L.generateCueId)(f,o,g);(!u||!u.cues||!u.cues.getCueById(p))&&(h=new n(f,o,g),h.id=p,h.line=d+1,h.align="left",h.position=10+Math.min(80,Math.floor(e*8/32)*10),i.push(h))}return u&&i.length&&(i.sort(function(m,b){return m.line==="auto"||b.line==="auto"?0:m.line>8&&b.line>8?b.line-m.line:m.line-b.line}),i.forEach(function(m){return Object(E.addCueToTrack)(u,m)})),i}};Z.default=w},"./src/utils/discontinuities.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"findFirstFragWithCC",function(){return A}),U.d(Z,"shouldAlignOnDiscontinuities",function(){return w}),U.d(Z,"findDiscontinuousReferenceFrag",function(){return v}),U.d(Z,"adjustSlidingStart",function(){return f}),U.d(Z,"alignStream",function(){return o}),U.d(Z,"alignPDT",function(){return i}),U.d(Z,"alignFragmentByPDTDelta",function(){return s}),U.d(Z,"alignMediaPlaylistByPDT",function(){return h});var _=U("./src/polyfills/number.ts"),L=U("./src/utils/logger.ts"),E=U("./src/controller/level-helper.ts");function A(a,e){for(var l=null,n=0,d=a.length;n<d;n++){var c=a[n];if(c&&c.cc===e){l=c;break}}return l}function w(a,e,l){return!!(e.details&&(l.endCC>l.startCC||a&&a.cc<l.startCC))}function v(a,e){var l=a.fragments,n=e.fragments;if(!n.length||!l.length){L.logger.log("No fragments to align");return}var d=A(l,n[0].cc);if(!d||d&&!d.startPTS){L.logger.log("No frag in previous level to align on");return}return d}function u(a,e){if(a){var l=a.start+e;a.start=a.startPTS=l,a.endPTS=l+a.duration}}function f(a,e){for(var l=e.fragments,n=0,d=l.length;n<d;n++)u(l[n],a);e.fragmentHint&&u(e.fragmentHint,a),e.alignedSliding=!0}function o(a,e,l){if(!e)return;t(a,l,e),!l.alignedSliding&&e.details&&i(l,e.details),!l.alignedSliding&&e.details&&!l.skippedSegments&&Object(E.adjustSliding)(e.details,l)}function t(a,e,l){if(w(a,l,e)){var n=v(l.details,e);n&&Object(_.isFiniteNumber)(n.start)&&(L.logger.log("Adjusting PTS using last level due to CC increase within current level "+e.url),f(n.start,e))}}function i(a,e){if(!e.fragments.length||!a.hasProgramDateTime||!e.hasProgramDateTime)return;var l=e.fragments[0].programDateTime,n=a.fragments[0].programDateTime,d=(n-l)/1e3+e.fragments[0].start;d&&Object(_.isFiniteNumber)(d)&&(L.logger.log("Adjusting PTS using programDateTime delta "+(n-l)+"ms, sliding:"+d.toFixed(3)+" "+a.url+" "),f(d,a))}function s(a,e){var l=a.programDateTime;if(!l)return;var n=(l-e)/1e3;a.start=a.startPTS=n,a.endPTS=n+a.duration}function h(a,e){if(!e.fragments.length||!a.hasProgramDateTime||!e.hasProgramDateTime)return;var l=e.fragments[0].programDateTime,n=e.fragments[0].start,d=l-n*1e3;a.fragments.forEach(function(c){s(c,d)}),a.fragmentHint&&s(a.fragmentHint,d),a.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(Se,Z,U){"use strict";U.r(Z);var _=U("./src/utils/ewma.ts"),L=function(){function E(w,v,u){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=u,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new _.default(w),this.fast_=new _.default(v)}var A=E.prototype;return A.update=function(v,u){var f=this.slow_,o=this.fast_;this.slow_.halfLife!==v&&(this.slow_=new _.default(v,f.getEstimate(),f.getTotalWeight())),this.fast_.halfLife!==u&&(this.fast_=new _.default(u,o.getEstimate(),o.getTotalWeight()))},A.sample=function(v,u){v=Math.max(v,this.minDelayMs_);var f=8*u,o=v/1e3,t=f/o;this.fast_.sample(o,t),this.slow_.sample(o,t)},A.canEstimate=function(){var v=this.fast_;return v&&v.getTotalWeight()>=this.minWeight_},A.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},A.destroy=function(){},E}();Z.default=L},"./src/utils/ewma.ts":function(Se,Z,U){"use strict";U.r(Z);var _=function(){function L(A,w,v){w===void 0&&(w=0),v===void 0&&(v=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=A,this.alpha_=A?Math.exp(Math.log(.5)/A):0,this.estimate_=w,this.totalWeight_=v}var E=L.prototype;return E.sample=function(w,v){var u=Math.pow(this.alpha_,w);this.estimate_=v*(1-u)+u*this.estimate_,this.totalWeight_+=w},E.getTotalWeight=function(){return this.totalWeight_},E.getEstimate=function(){if(this.alpha_){var w=1-Math.pow(this.alpha_,this.totalWeight_);if(w)return this.estimate_/w}return this.estimate_},L}();Z.default=_},"./src/utils/fetch-loader.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"fetchSupported",function(){return s});var _=U("./src/polyfills/number.ts"),L=U("./src/loader/load-stats.ts"),E=U("./src/demux/chunk-cache.ts");function A(n,d){n.prototype=Object.create(d.prototype),n.prototype.constructor=n,o(n,d)}function w(n){var d=typeof Map=="function"?new Map:void 0;return w=function(g){if(g===null||!f(g))return g;if(typeof g!="function")throw new TypeError("Super expression must either be null or a function");if(typeof d!="undefined"){if(d.has(g))return d.get(g);d.set(g,p)}function p(){return v(g,arguments,t(this).constructor)}return p.prototype=Object.create(g.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),o(p,g)},w(n)}function v(n,d,c){return u()?v=Reflect.construct:v=function(p,m,b){var y=[null];y.push.apply(y,m);var r=Function.bind.apply(p,y),x=new r;return b&&o(x,b.prototype),x},v.apply(null,arguments)}function u(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(n){return!1}}function f(n){return Function.toString.call(n).indexOf("[native code]")!==-1}function o(n,d){return o=Object.setPrototypeOf||function(g,p){return g.__proto__=p,g},o(n,d)}function t(n){return t=Object.setPrototypeOf?Object.getPrototypeOf:function(c){return c.__proto__||Object.getPrototypeOf(c)},t(n)}function i(){return i=Object.assign||function(n){for(var d=1;d<arguments.length;d++){var c=arguments[d];for(var g in c)Object.prototype.hasOwnProperty.call(c,g)&&(n[g]=c[g])}return n},i.apply(this,arguments)}function s(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(n){}return!1}var h=function(){function n(c){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=void 0,this.response=void 0,this.controller=void 0,this.context=void 0,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=c.fetchSetup||e,this.controller=new self.AbortController,this.stats=new L.LoadStats}var d=n.prototype;return d.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},d.abortInternal=function(){var g=this.response;(!g||!g.ok)&&(this.stats.aborted=!0,this.controller.abort())},d.abort=function(){var g;this.abortInternal(),(g=this.callbacks)!==null&&g!==void 0&&g.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},d.load=function(g,p,m){var b=this,y=this.stats;if(y.loading.start)throw new Error("Loader can only be used once.");y.loading.start=self.performance.now();var r=a(g,this.controller.signal),x=m.onProgress,S=g.responseType==="arraybuffer",T=S?"byteLength":"length";this.context=g,this.config=p,this.callbacks=m,this.request=this.fetchSetup(g,r),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){b.abortInternal(),m.onTimeout(y,g,b.response)},p.timeout),self.fetch(this.request).then(function(R){if(b.response=b.loader=R,!R.ok){var D=R.status,k=R.statusText;throw new l(k||"fetch, bad network response",D,R)}return y.loading.first=Math.max(self.performance.now(),y.loading.start),y.total=parseInt(R.headers.get("Content-Length")||"0"),x&&Object(_.isFiniteNumber)(p.highWaterMark)?b.loadProgressively(R,y,g,p.highWaterMark,x):S?R.arrayBuffer():R.text()}).then(function(R){var D=b.response;self.clearTimeout(b.requestTimeout),y.loading.end=Math.max(self.performance.now(),y.loading.first),y.loaded=y.total=R[T];var k={url:D.url,data:R};x&&!Object(_.isFiniteNumber)(p.highWaterMark)&&x(y,g,R,D),m.onSuccess(k,y,g,D)}).catch(function(R){if(self.clearTimeout(b.requestTimeout),y.aborted)return;var D=R.code||0;m.onError({code:D,text:R.message},g,R.details)})},d.getCacheAge=function(){var g=null;if(this.response){var p=this.response.headers.get("age");g=p?parseFloat(p):null}return g},d.loadProgressively=function(g,p,m,b,y){b===void 0&&(b=0);var r=new E.default,x=g.body.getReader(),S=function T(){return x.read().then(function(R){if(R.done)return r.dataLength&&y(p,m,r.flush(),g),Promise.resolve(new ArrayBuffer(0));var D=R.value,k=D.length;return p.loaded+=k,k<b||r.dataLength?(r.push(D),r.dataLength>=b&&y(p,m,r.flush(),g)):y(p,m,D,g),T()}).catch(function(){return Promise.reject()})};return S()},n}();function a(n,d){var c={method:"GET",mode:"cors",credentials:"same-origin",signal:d,headers:new self.Headers(i({},n.headers))};return n.rangeEnd&&c.headers.set("Range","bytes="+n.rangeStart+"-"+String(n.rangeEnd-1)),c}function e(n,d){return new self.Request(n.url,d)}var l=function(n){A(d,n);function d(c,g,p){var m;return m=n.call(this,c)||this,m.code=void 0,m.details=void 0,m.code=g,m.details=p,m}return d}(w(Error));Z.default=h},"./src/utils/imsc1-ttml-parser.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"IMSC1_CODEC",function(){return f}),U.d(Z,"parseIMSC1",function(){return s});var _=U("./src/utils/mp4-tools.ts"),L=U("./src/utils/vttparser.ts"),E=U("./src/utils/vttcue.ts"),A=U("./src/demux/id3.ts"),w=U("./src/utils/timescale-conversion.ts"),v=U("./src/utils/webvtt-parser.ts");function u(){return u=Object.assign||function(b){for(var y=1;y<arguments.length;y++){var r=arguments[y];for(var x in r)Object.prototype.hasOwnProperty.call(r,x)&&(b[x]=r[x])}return b},u.apply(this,arguments)}var f="stpp.ttml.im1t",o=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,t=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,i={left:"start",center:"center",right:"end",start:"start",end:"end"};function s(b,y,r,x,S){var T=Object(_.findBox)(new Uint8Array(b),["mdat"]);if(T.length===0){S(new Error("Could not parse IMSC1 mdat"));return}var R=T[0],D=Object(A.utf8ArrayToStr)(new Uint8Array(b,R.start,R.end-R.start)),k=Object(w.toTimescaleFromScale)(y,1,r);try{x(h(D,k))}catch(B){S(B)}}function h(b,y){var r=new DOMParser,x=r.parseFromString(b,"text/xml"),S=x.getElementsByTagName("tt")[0];if(!S)throw new Error("Invalid ttml");var T={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},R=Object.keys(T).reduce(function(P,$){return P[$]=S.getAttribute("ttp:"+$)||T[$],P},{}),D=S.getAttribute("xml:space")!=="preserve",k=e(a(S,"styling","style")),B=e(a(S,"layout","region")),G=a(S,"body","[begin]");return[].map.call(G,function(P){var $=l(P,D);if(!$||!P.hasAttribute("begin"))return null;var X=g(P.getAttribute("begin"),R),z=g(P.getAttribute("dur"),R),N=g(P.getAttribute("end"),R);if(X===null)throw c(P);if(N===null){if(z===null)throw c(P);N=X+z}var H=new E.default(X-y,N-y,$);H.id=Object(v.generateCueId)(H.startTime,H.endTime,H.text);var q=B[P.getAttribute("region")],ee=k[P.getAttribute("style")];H.position=10,H.size=80;var fe=n(q,ee),oe=fe.textAlign;if(oe){var he=i[oe];he&&(H.lineAlign=he),H.align=oe}return u(H,fe),H}).filter(function(P){return P!==null})}function a(b,y,r){var x=b.getElementsByTagName(y)[0];return x?[].slice.call(x.querySelectorAll(r)):[]}function e(b){return b.reduce(function(y,r){var x=r.getAttribute("xml:id");return x&&(y[x]=r),y},{})}function l(b,y){return[].slice.call(b.childNodes).reduce(function(r,x,S){var T;return x.nodeName==="br"&&S?r+`
|
|
|
`:(T=x.childNodes)!==null&&T!==void 0&&T.length?l(x,y):y?r+x.textContent.trim().replace(/\s+/g," "):r+x.textContent},"")}function n(b,y){var r="http://www.w3.org/ns/ttml#styling",x=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return x.reduce(function(S,T){var R=d(y,r,T)||d(b,r,T);return R&&(S[T]=R),S},{})}function d(b,y,r){return b.hasAttributeNS(y,r)?b.getAttributeNS(y,r):null}function c(b){return new Error("Could not parse ttml timestamp "+b)}function g(b,y){if(!b)return null;var r=Object(L.parseTimeStamp)(b);return r===null&&(o.test(b)?r=p(b,y):t.test(b)&&(r=m(b,y))),r}function p(b,y){var r=o.exec(b),x=(r[4]|0)+(r[5]|0)/y.subFrameRate;return(r[1]|0)*3600+(r[2]|0)*60+(r[3]|0)+x/y.frameRate}function m(b,y){var r=t.exec(b),x=Number(r[1]),S=r[2];switch(S){case"h":return x*3600;case"m":return x*60;case"ms":return x*1e3;case"f":return x/y.frameRate;case"t":return x/y.tickRate}return x}},"./src/utils/logger.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"enableLogs",function(){return v}),U.d(Z,"logger",function(){return u});var _=function(){},L={trace:_,debug:_,log:_,warn:_,info:_,error:_},E=L;function A(f){var o=self.console[f];return o?o.bind(self.console,"["+f+"] >"):_}function w(f){for(var o=arguments.length,t=new Array(o>1?o-1:0),i=1;i<o;i++)t[i-1]=arguments[i];t.forEach(function(s){E[s]=f[s]?f[s].bind(f):A(s)})}function v(f){if(self.console&&f===!0||typeof f=="object"){w(f,"debug","log","info","warn","error");try{E.log()}catch(o){E=L}}else E=L}var u=E},"./src/utils/mediakeys-helper.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"KeySystems",function(){return _}),U.d(Z,"requestMediaKeySystemAccess",function(){return L});var _;(function(E){E.WIDEVINE="com.widevine.alpha",E.PLAYREADY="com.microsoft.playready"})(_||(_={}));var L=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"getMediaSource",function(){return _});function _(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"bin2str",function(){return w}),U.d(Z,"readUint16",function(){return v}),U.d(Z,"readUint32",function(){return u}),U.d(Z,"writeUint32",function(){return f}),U.d(Z,"findBox",function(){return o}),U.d(Z,"parseSegmentIndex",function(){return t}),U.d(Z,"parseInitSegment",function(){return i}),U.d(Z,"getStartDTS",function(){return s}),U.d(Z,"getDuration",function(){return h}),U.d(Z,"computeRawDurationFromSamples",function(){return a}),U.d(Z,"offsetStartDTS",function(){return e}),U.d(Z,"segmentValidRange",function(){return l}),U.d(Z,"appendUint8Array",function(){return n});var _=U("./src/utils/typed-array.ts"),L=U("./src/loader/fragment.ts"),E=Math.pow(2,32)-1,A=[].push;function w(d){return String.fromCharCode.apply(null,d)}function v(d,c){"data"in d&&(c+=d.start,d=d.data);var g=d[c]<<8|d[c+1];return g<0?65536+g:g}function u(d,c){"data"in d&&(c+=d.start,d=d.data);var g=d[c]<<24|d[c+1]<<16|d[c+2]<<8|d[c+3];return g<0?4294967296+g:g}function f(d,c,g){"data"in d&&(c+=d.start,d=d.data),d[c]=g>>24,d[c+1]=g>>16&255,d[c+2]=g>>8&255,d[c+3]=g&255}function o(d,c){var g=[];if(!c.length)return g;var p,m,b;"data"in d?(p=d.data,m=d.start,b=d.end):(p=d,m=0,b=p.byteLength);for(var y=m;y<b;){var r=u(p,y),x=w(p.subarray(y+4,y+8)),S=r>1?y+r:b;if(x===c[0])if(c.length===1)g.push({data:p,start:y+8,end:S});else{var T=o({data:p,start:y+8,end:S},c.slice(1));T.length&&A.apply(g,T)}y=S}return g}function t(d){var c=o(d,["moov"]),g=c[0],p=g?g.end:null,m=o(d,["sidx"]);if(!m||!m[0])return null;var b=[],y=m[0],r=y.data[0],x=r===0?8:16,S=u(y,x);x+=4;var T=0,R=0;r===0?x+=8:x+=16,x+=2;var D=y.end+R,k=v(y,x);x+=2;for(var B=0;B<k;B++){var G=x,P=u(y,G);G+=4;var $=P&2147483647,X=(P&2147483648)>>>31;if(X===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var z=u(y,G);G+=4,b.push({referenceSize:$,subsegmentDuration:z,info:{duration:z/S,start:D,end:D+$-1}}),D+=$,G+=4,x=G}return{earliestPresentationTime:T,timescale:S,version:r,referencesCount:k,references:b,moovEndOffset:p}}function i(d){for(var c=[],g=o(d,["moov","trak"]),p=0;p<g.length;p++){var m=g[p],b=o(m,["tkhd"])[0];if(b){var y=b.data[b.start],r=y===0?12:20,x=u(b,r),S=o(m,["mdia","mdhd"])[0];if(S){y=S.data[S.start],r=y===0?12:20;var T=u(S,r),R=o(m,["mdia","hdlr"])[0];if(R){var D=w(R.data.subarray(R.start+8,R.start+12)),k={soun:L.ElementaryStreamTypes.AUDIO,vide:L.ElementaryStreamTypes.VIDEO}[D];if(k){var B=o(m,["mdia","minf","stbl","stsd"])[0],G=void 0;B&&(G=w(B.data.subarray(B.start+12,B.start+16))),c[x]={timescale:T,type:k},c[k]={timescale:T,id:x,codec:G}}}}}}var P=o(d,["moov","mvex","trex"]);return P.forEach(function($){var X=u($,4),z=c[X];z&&(z.default={duration:u($,12),flags:u($,20)})}),c}function s(d,c){return o(c,["moof","traf"]).reduce(function(g,p){var m=o(p,["tfdt"])[0],b=m.data[m.start],y=o(p,["tfhd"]).reduce(function(r,x){var S=u(x,4),T=d[S];if(T){var R=u(m,4);b===1&&(R*=Math.pow(2,32),R+=u(m,8));var D=T.timescale||9e4,k=R/D;if(isFinite(k)&&(r===null||k<r))return k}return r},null);return y!==null&&isFinite(y)&&(g===null||y<g)?y:g},null)||0}function h(d,c){for(var g=0,p=0,m=0,b=o(d,["moof","traf"]),y=0;y<b.length;y++){var r=b[y],x=o(r,["tfhd"])[0],S=u(x,4),T=c[S];if(!T)continue;var R=T.default,D=u(x,0)|(R==null?void 0:R.flags),k=R==null?void 0:R.duration;D&8&&(D&2?k=u(x,12):k=u(x,8));for(var B=T.timescale||9e4,G=o(r,["trun"]),P=0;P<G.length;P++){if(k){var $=u(G[P],4);g=k*$}else g=a(G[P]);T.type===L.ElementaryStreamTypes.VIDEO?p+=g/B:T.type===L.ElementaryStreamTypes.AUDIO&&(m+=g/B)}}if(p===0&&m===0){var X=t(d);if(X!=null&&X.references)return X.references.reduce(function(z,N){return z+N.info.duration||0},0)}return p||m}function a(d){var c=u(d,0),g=8;c&1&&(g+=4),c&4&&(g+=4);for(var p=0,m=u(d,4),b=0;b<m;b++){if(c&256){var y=u(d,g);p+=y,g+=4}c&512&&(g+=4),c&1024&&(g+=4),c&2048&&(g+=4)}return p}function e(d,c,g){o(c,["moof","traf"]).forEach(function(p){o(p,["tfhd"]).forEach(function(m){var b=u(m,4),y=d[b];if(!y)return;var r=y.timescale||9e4;o(p,["tfdt"]).forEach(function(x){var S=x.data[x.start],T=u(x,4);if(S===0)f(x,4,T-g*r);else{T*=Math.pow(2,32),T+=u(x,8),T-=g*r,T=Math.max(T,0);var R=Math.floor(T/(E+1)),D=Math.floor(T%(E+1));f(x,4,R),f(x,8,D)}})})})}function l(d){var c={valid:null,remainder:null},g=o(d,["moof"]);if(g){if(g.length<2)return c.remainder=d,c}else return c;var p=g[g.length-1];return c.valid=Object(_.sliceUint8)(d,0,p.start-8),c.remainder=Object(_.sliceUint8)(d,p.start-8),c}function n(d,c){var g=new Uint8Array(d.length+c.length);return g.set(d),g.set(c,d.length),g}},"./src/utils/output-filter.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"default",function(){return _});var _=function(){function L(A,w){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=A,this.trackName=w}var E=L.prototype;return E.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},E.newCue=function(w,v,u){(this.startTime===null||this.startTime>w)&&(this.startTime=w),this.endTime=v,this.screen=u,this.timelineController.createCaptionsTrack(this.trackName)},E.reset=function(){this.cueRanges=[]},L}()},"./src/utils/texttrack-utils.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"sendAddTrackEvent",function(){return L}),U.d(Z,"addCueToTrack",function(){return E}),U.d(Z,"clearCurrentCues",function(){return A}),U.d(Z,"removeCuesInRange",function(){return w}),U.d(Z,"getCuesInRange",function(){return u});var _=U("./src/utils/logger.ts");function L(f,o){var t;try{t=new Event("addtrack")}catch(i){t=document.createEvent("Event"),t.initEvent("addtrack",!1,!1)}t.track=f,o.dispatchEvent(t)}function E(f,o){var t=f.mode;if(t==="disabled"&&(f.mode="hidden"),f.cues&&!f.cues.getCueById(o.id))try{if(f.addCue(o),!f.cues.getCueById(o.id))throw new Error("addCue is failed for: "+o)}catch(s){_.logger.debug("[texttrack-utils]: "+s);var i=new self.TextTrackCue(o.startTime,o.endTime,o.text);i.id=o.id,f.addCue(i)}t==="disabled"&&(f.mode=t)}function A(f){var o=f.mode;if(o==="disabled"&&(f.mode="hidden"),f.cues)for(var t=f.cues.length;t--;)f.removeCue(f.cues[t]);o==="disabled"&&(f.mode=o)}function w(f,o,t){var i=f.mode;if(i==="disabled"&&(f.mode="hidden"),f.cues&&f.cues.length>0)for(var s=u(f.cues,o,t),h=0;h<s.length;h++)f.removeCue(s[h]);i==="disabled"&&(f.mode=i)}function v(f,o){if(o<f[0].startTime)return 0;var t=f.length-1;if(o>f[t].endTime)return-1;for(var i=0,s=t;i<=s;){var h=Math.floor((s+i)/2);if(o<f[h].startTime)s=h-1;else if(o>f[h].startTime&&i<t)i=h+1;else return h}return f[i].startTime-o<o-f[s].startTime?i:s}function u(f,o,t){var i=[],s=v(f,o);if(s>-1)for(var h=s,a=f.length;h<a;h++){var e=f[h];if(e.startTime>=o&&e.endTime<=t)i.push(e);else if(e.startTime>t)return i}return i}},"./src/utils/time-ranges.ts":function(Se,Z,U){"use strict";U.r(Z);var _={toString:function(E){for(var A="",w=E.length,v=0;v<w;v++)A+="["+E.start(v).toFixed(3)+","+E.end(v).toFixed(3)+"]";return A}};Z.default=_},"./src/utils/timescale-conversion.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"toTimescaleFromBase",function(){return L}),U.d(Z,"toTimescaleFromScale",function(){return E}),U.d(Z,"toMsFromMpegTsClock",function(){return A}),U.d(Z,"toMpegTsClockFromTimescale",function(){return w});var _=9e4;function L(v,u,f,o){f===void 0&&(f=1),o===void 0&&(o=!1);var t=v*u*f;return o?Math.round(t):t}function E(v,u,f,o){return f===void 0&&(f=1),o===void 0&&(o=!1),L(v,u,1/f,o)}function A(v,u){return u===void 0&&(u=!1),L(v,1e3,1/_,u)}function w(v,u){return u===void 0&&(u=1),L(v,_,1/u)}},"./src/utils/typed-array.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"sliceUint8",function(){return _});function _(L,E,A){return Uint8Array.prototype.slice?L.slice(E,A):new Uint8Array(Array.prototype.slice.call(L,E,A))}},"./src/utils/vttcue.ts":function(Se,Z,U){"use strict";U.r(Z),Z.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var _=["","lr","rl"],L=["start","middle","end","left","right"];function E(f,o){if(typeof o!="string")return!1;if(!Array.isArray(f))return!1;var t=o.toLowerCase();return~f.indexOf(t)?t:!1}function A(f){return E(_,f)}function w(f){return E(L,f)}function v(f){for(var o=arguments.length,t=new Array(o>1?o-1:0),i=1;i<o;i++)t[i-1]=arguments[i];for(var s=1;s<arguments.length;s++){var h=arguments[s];for(var a in h)f[a]=h[a]}return f}function u(f,o,t){var i=this,s={enumerable:!0};i.hasBeenReset=!1;var h="",a=!1,e=f,l=o,n=t,d=null,c="",g=!0,p="auto",m="start",b=50,y="middle",r=50,x="middle";Object.defineProperty(i,"id",v({},s,{get:function(){return h},set:function(T){h=""+T}})),Object.defineProperty(i,"pauseOnExit",v({},s,{get:function(){return a},set:function(T){a=!!T}})),Object.defineProperty(i,"startTime",v({},s,{get:function(){return e},set:function(T){if(typeof T!="number")throw new TypeError("Start time must be set to a number.");e=T,this.hasBeenReset=!0}})),Object.defineProperty(i,"endTime",v({},s,{get:function(){return l},set:function(T){if(typeof T!="number")throw new TypeError("End time must be set to a number.");l=T,this.hasBeenReset=!0}})),Object.defineProperty(i,"text",v({},s,{get:function(){return n},set:function(T){n=""+T,this.hasBeenReset=!0}})),Object.defineProperty(i,"region",v({},s,{get:function(){return d},set:function(T){d=T,this.hasBeenReset=!0}})),Object.defineProperty(i,"vertical",v({},s,{get:function(){return c},set:function(T){var R=A(T);if(R===!1)throw new SyntaxError("An invalid or illegal string was specified.");c=R,this.hasBeenReset=!0}})),Object.defineProperty(i,"snapToLines",v({},s,{get:function(){return g},set:function(T){g=!!T,this.hasBeenReset=!0}})),Object.defineProperty(i,"line",v({},s,{get:function(){return p},set:function(T){if(typeof T!="number"&&T!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");p=T,this.hasBeenReset=!0}})),Object.defineProperty(i,"lineAlign",v({},s,{get:function(){return m},set:function(T){var R=w(T);if(!R)throw new SyntaxError("An invalid or illegal string was specified.");m=R,this.hasBeenReset=!0}})),Object.defineProperty(i,"position",v({},s,{get:function(){return b},set:function(T){if(T<0||T>100)throw new Error("Position must be between 0 and 100.");b=T,this.hasBeenReset=!0}})),Object.defineProperty(i,"positionAlign",v({},s,{get:function(){return y},set:function(T){var R=w(T);if(!R)throw new SyntaxError("An invalid or illegal string was specified.");y=R,this.hasBeenReset=!0}})),Object.defineProperty(i,"size",v({},s,{get:function(){return r},set:function(T){if(T<0||T>100)throw new Error("Size must be between 0 and 100.");r=T,this.hasBeenReset=!0}})),Object.defineProperty(i,"align",v({},s,{get:function(){return x},set:function(T){var R=w(T);if(!R)throw new SyntaxError("An invalid or illegal string was specified.");x=R,this.hasBeenReset=!0}})),i.displayState=void 0}return u.prototype.getCueAsHTML=function(){var f=self.WebVTT;return f.convertCueToDOMTree(self,this.text)},u}()},"./src/utils/vttparser.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"parseTimeStamp",function(){return E}),U.d(Z,"fixLineBreaks",function(){return o}),U.d(Z,"VTTParser",function(){return t});var _=U("./src/utils/vttcue.ts"),L=function(){function i(){}var s=i.prototype;return s.decode=function(a,e){if(!a)return"";if(typeof a!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(a))},i}();function E(i){function s(a,e,l,n){return(a|0)*3600+(e|0)*60+(l|0)+parseFloat(n||0)}var h=i.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return h?parseFloat(h[2])>59?s(h[2],h[3],0,h[4]):s(h[1],h[2],h[3],h[4]):null}var A=function(){function i(){this.values=Object.create(null)}var s=i.prototype;return s.set=function(a,e){!this.get(a)&&e!==""&&(this.values[a]=e)},s.get=function(a,e,l){return l?this.has(a)?this.values[a]:e[l]:this.has(a)?this.values[a]:e},s.has=function(a){return a in this.values},s.alt=function(a,e,l){for(var n=0;n<l.length;++n)if(e===l[n]){this.set(a,e);break}},s.integer=function(a,e){/^-?\d+$/.test(e)&&this.set(a,parseInt(e,10))},s.percent=function(a,e){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(e)){var l=parseFloat(e);if(l>=0&&l<=100)return this.set(a,l),!0}return!1},i}();function w(i,s,h,a){var e=a?i.split(a):[i];for(var l in e){if(typeof e[l]!="string")continue;var n=e[l].split(h);if(n.length!==2)continue;var d=n[0],c=n[1];s(d,c)}}var v=new _.default(0,0,""),u=v.align==="middle"?"middle":"center";function f(i,s,h){var a=i;function e(){var d=E(i);if(d===null)throw new Error("Malformed timestamp: "+a);return i=i.replace(/^[^\sa-zA-Z-]+/,""),d}function l(d,c){var g=new A;w(d,function(b,y){var r;switch(b){case"region":for(var x=h.length-1;x>=0;x--)if(h[x].id===y){g.set(b,h[x].region);break}break;case"vertical":g.alt(b,y,["rl","lr"]);break;case"line":r=y.split(","),g.integer(b,r[0]),g.percent(b,r[0])&&g.set("snapToLines",!1),g.alt(b,r[0],["auto"]),r.length===2&&g.alt("lineAlign",r[1],["start",u,"end"]);break;case"position":r=y.split(","),g.percent(b,r[0]),r.length===2&&g.alt("positionAlign",r[1],["start",u,"end","line-left","line-right","auto"]);break;case"size":g.percent(b,y);break;case"align":g.alt(b,y,["start",u,"end","left","right"]);break}},/:/,/\s/),c.region=g.get("region",null),c.vertical=g.get("vertical","");var p=g.get("line","auto");p==="auto"&&v.line===-1&&(p=-1),c.line=p,c.lineAlign=g.get("lineAlign","start"),c.snapToLines=g.get("snapToLines",!0),c.size=g.get("size",100),c.align=g.get("align",u);var m=g.get("position","auto");m==="auto"&&v.position===50&&(m=c.align==="start"||c.align==="left"?0:c.align==="end"||c.align==="right"?100:50),c.position=m}function n(){i=i.replace(/^\s+/,"")}if(n(),s.startTime=e(),n(),i.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+a);i=i.substr(3),n(),s.endTime=e(),n(),l(i,s)}function o(i){return i.replace(/<br(?: \/)?>/gi,`
|
|
|
`)}var t=function(){function i(){this.state="INITIAL",this.buffer="",this.decoder=new L,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var s=i.prototype;return s.parse=function(a){var e=this;a&&(e.buffer+=e.decoder.decode(a,{stream:!0}));function l(){var m=e.buffer,b=0;for(m=o(m);b<m.length&&m[b]!=="\r"&&m[b]!==`
|
|
|
`;)++b;var y=m.substr(0,b);return m[b]==="\r"&&++b,m[b]===`
|
|
|
`&&++b,e.buffer=m.substr(b),y}function n(m){w(m,function(b,y){},/:/)}try{var d="";if(e.state==="INITIAL"){if(!/\r\n|\n/.test(e.buffer))return this;d=l();var c=d.match(/^()?WEBVTT([ \t].*)?$/);if(!c||!c[0])throw new Error("Malformed WebVTT signature.");e.state="HEADER"}for(var g=!1;e.buffer;){if(!/\r\n|\n/.test(e.buffer))return this;g?g=!1:d=l();switch(e.state){case"HEADER":/:/.test(d)?n(d):d||(e.state="ID");continue;case"NOTE":d||(e.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(d)){e.state="NOTE";break}if(!d)continue;if(e.cue=new _.default(0,0,""),e.state="CUE",d.indexOf("-->")===-1){e.cue.id=d;continue}case"CUE":if(!e.cue){e.state="BADCUE";continue}try{f(d,e.cue,e.regionList)}catch(m){e.cue=null,e.state="BADCUE";continue}e.state="CUETEXT";continue;case"CUETEXT":{var p=d.indexOf("-->")!==-1;if(!d||p&&(g=!0)){e.oncue&&e.cue&&e.oncue(e.cue),e.cue=null,e.state="ID";continue}if(e.cue===null)continue;e.cue.text&&(e.cue.text+=`
|
|
|
`),e.cue.text+=d}continue;case"BADCUE":d||(e.state="ID")}}}catch(m){e.state==="CUETEXT"&&e.cue&&e.oncue&&e.oncue(e.cue),e.cue=null,e.state=e.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},s.flush=function(){var a=this;try{if((a.cue||a.state==="HEADER")&&(a.buffer+=`
|
|
|
|
|
|
`,a.parse()),a.state==="INITIAL"||a.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(e){a.onparsingerror&&a.onparsingerror(e)}return a.onflush&&a.onflush(),this},i}()},"./src/utils/webvtt-parser.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"generateCueId",function(){return t}),U.d(Z,"parseWebVTT",function(){return s});var _=U("./src/polyfills/number.ts"),L=U("./src/utils/vttparser.ts"),E=U("./src/demux/id3.ts"),A=U("./src/utils/timescale-conversion.ts"),w=U("./src/remux/mp4-remuxer.ts"),v=/\r\n|\n\r|\n|\r/g,u=function(a,e,l){return l===void 0&&(l=0),a.substr(l,e.length)===e},f=function(a){var e=parseInt(a.substr(-3)),l=parseInt(a.substr(-6,2)),n=parseInt(a.substr(-9,2)),d=a.length>9?parseInt(a.substr(0,a.indexOf(":"))):0;if(!Object(_.isFiniteNumber)(e)||!Object(_.isFiniteNumber)(l)||!Object(_.isFiniteNumber)(n)||!Object(_.isFiniteNumber)(d))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+a);return e+=1e3*l,e+=60*1e3*n,e+=60*60*1e3*d,e},o=function(a){for(var e=5381,l=a.length;l;)e=e*33^a.charCodeAt(--l);return(e>>>0).toString()};function t(h,a,e){return o(h.toString())+o(a.toString())+o(e)}var i=function(a,e,l){var n=a[e],d=a[n.prevCC];if(!d||!d.new&&n.new){a.ccOffset=a.presentationOffset=n.start,n.new=!1;return}for(;(c=d)!==null&&c!==void 0&&c.new;){var c;a.ccOffset+=n.start-d.start,n.new=!1,n=d,d=a[n.prevCC]}a.presentationOffset=l};function s(h,a,e,l,n,d,c,g){var p=new L.VTTParser,m=Object(E.utf8ArrayToStr)(new Uint8Array(h)).trim().replace(v,`
|
|
|
`).split(`
|
|
|
`),b=[],y=Object(A.toMpegTsClockFromTimescale)(a,e),r="00:00.000",x=0,S=0,T,R=!0,D=!1;p.oncue=function(k){var B=l[n],G=l.ccOffset,P=(x-y)/9e4;if(B!=null&&B.new&&(S!==void 0?G=l.ccOffset=B.start:i(l,n,P)),P&&(G=P-l.presentationOffset),D){var $=k.endTime-k.startTime,X=Object(w.normalizePts)((k.startTime+G-S)*9e4,d*9e4)/9e4;k.startTime=X,k.endTime=X+$}var z=k.text.trim();k.text=decodeURIComponent(encodeURIComponent(z)),k.id||(k.id=t(k.startTime,k.endTime,z)),k.endTime>0&&b.push(k)},p.onparsingerror=function(k){T=k},p.onflush=function(){if(T){g(T);return}c(b)},m.forEach(function(k){if(R)if(u(k,"X-TIMESTAMP-MAP=")){R=!1,D=!0,k.substr(16).split(",").forEach(function(B){u(B,"LOCAL:")?r=B.substr(6):u(B,"MPEGTS:")&&(x=parseInt(B.substr(7)))});try{S=f(r)/1e3}catch(B){D=!1,T=B}return}else k===""&&(R=!1);p.parse(k+`
|
|
|
`)}),p.flush()}},"./src/utils/xhr-loader.ts":function(Se,Z,U){"use strict";U.r(Z);var _=U("./src/utils/logger.ts"),L=U("./src/loader/load-stats.ts"),E=/^age:\s*[\d.]+\s*$/m,A=function(){function w(u){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=void 0,this.loader=null,this.stats=void 0,this.xhrSetup=u?u.xhrSetup:null,this.stats=new L.LoadStats,this.retryDelay=0}var v=w.prototype;return v.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},v.abortInternal=function(){var f=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),f&&(f.onreadystatechange=null,f.onprogress=null,f.readyState!==4&&(this.stats.aborted=!0,f.abort()))},v.abort=function(){var f;this.abortInternal(),(f=this.callbacks)!==null&&f!==void 0&&f.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},v.load=function(f,o,t){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=f,this.config=o,this.callbacks=t,this.retryDelay=o.retryDelay,this.loadInternal()},v.loadInternal=function(){var f=this.config,o=this.context;if(!f)return;var t=this.loader=new self.XMLHttpRequest,i=this.stats;i.loading.first=0,i.loaded=0;var s=this.xhrSetup;try{if(s)try{s(t,o.url)}catch(e){t.open("GET",o.url,!0),s(t,o.url)}t.readyState||t.open("GET",o.url,!0);var h=this.context.headers;if(h)for(var a in h)t.setRequestHeader(a,h[a])}catch(e){this.callbacks.onError({code:t.status,text:e.message},o,t);return}o.rangeEnd&&t.setRequestHeader("Range","bytes="+o.rangeStart+"-"+(o.rangeEnd-1)),t.onreadystatechange=this.readystatechange.bind(this),t.onprogress=this.loadprogress.bind(this),t.responseType=o.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),f.timeout),t.send()},v.readystatechange=function(){var f=this.context,o=this.loader,t=this.stats;if(!f||!o)return;var i=o.readyState,s=this.config;if(t.aborted)return;if(i>=2)if(self.clearTimeout(this.requestTimeout),t.loading.first===0&&(t.loading.first=Math.max(self.performance.now(),t.loading.start)),i===4){o.onreadystatechange=null,o.onprogress=null;var h=o.status;if(h>=200&&h<300){t.loading.end=Math.max(self.performance.now(),t.loading.first);var a,e;if(f.responseType==="arraybuffer"?(a=o.response,e=a.byteLength):(a=o.responseText,e=a.length),t.loaded=t.total=e,!this.callbacks)return;var l=this.callbacks.onProgress;if(l&&l(t,f,a,o),!this.callbacks)return;var n={url:o.responseURL,data:a};this.callbacks.onSuccess(n,t,f,o)}else t.retry>=s.maxRetry||h>=400&&h<499?(_.logger.error(h+" while loading "+f.url),this.callbacks.onError({code:h,text:o.statusText},f,o)):(_.logger.warn(h+" while loading "+f.url+", retrying in "+this.retryDelay+"..."),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,s.maxRetryDelay),t.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),s.timeout)},v.loadtimeout=function(){_.logger.warn("timeout while loading "+this.context.url);var f=this.callbacks;f&&(this.abortInternal(),f.onTimeout(this.stats,this.context,this.loader))},v.loadprogress=function(f){var o=this.stats;o.loaded=f.loaded,f.lengthComputable&&(o.total=f.total)},v.getCacheAge=function(){var f=null;if(this.loader&&E.test(this.loader.getAllResponseHeaders())){var o=this.loader.getResponseHeader("age");f=o?parseFloat(o):null}return f},w}();Z.default=A}}).default})},vZDz:function(Ze,Qe,ye){Ze.exports={contentWrap:"contentWrap___3Fc2r",footer:"footer___4nxVN",radioGroup:"radioGroup___359yE",wrap:"wrap___1OqR3",introName:"introName___3saG-",rating:"rating___3X95K",modalRating:"modalRating___A4qeN"}},w8Aa:function(Ze,Qe,ye){Ze.exports={img:"img___3e4yQ"}}}]);
|