(window.webpackJsonp=window.webpackJsonp||[]).push([[202,3,5,7,8,17,20],{"++UQ":function(et,Ve,z){},"+NIl":function(et,Ve,z){(function(le){le(z("VrN/"))})(function(le){"use strict";le.defineMode("stex",function(Q,j){"use strict";function w(d,s){d.cmdState.push(s)}function P(d){return d.cmdState.length>0?d.cmdState[d.cmdState.length-1]:null}function _(d){var s=d.cmdState.pop();s&&s.closeBracket()}function T(d){for(var s=d.cmdState,f=s.length-1;f>=0;f--){var i=s[f];if(i.name=="DEFAULT")continue;return i}return{styleIdentifier:function(){return null}}}function C(d,s,f){return function(){this.name=d,this.bracketNo=0,this.style=s,this.styles=f,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var c={};c.importmodule=C("importmodule","tag",["string","builtin"]),c.documentclass=C("documentclass","tag",["","atom"]),c.usepackage=C("usepackage","tag",["atom"]),c.begin=C("begin","tag",["atom"]),c.end=C("end","tag",["atom"]),c.label=C("label","tag",["atom"]),c.ref=C("ref","tag",["atom"]),c.eqref=C("eqref","tag",["atom"]),c.cite=C("cite","tag",["atom"]),c.bibitem=C("bibitem","tag",["atom"]),c.Bibitem=C("Bibitem","tag",["atom"]),c.RBibitem=C("RBibitem","tag",["atom"]),c.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function p(d,s){d.f=s}function u(d,s){var f;if(d.match(/^\\[a-zA-Z@]+/)){var i=d.current().slice(1);return f=c.hasOwnProperty(i)?c[i]:c.DEFAULT,f=new f,w(s,f),p(s,a),f.style}if(d.match(/^\\[$&%#{}_]/))return"tag";if(d.match(/^\\[,;!\/\\]/))return"tag";if(d.match("\\["))return p(s,function(t,h){return o(t,h,"\\]")}),"keyword";if(d.match("\\("))return p(s,function(t,h){return o(t,h,"\\)")}),"keyword";if(d.match("$$"))return p(s,function(t,h){return o(t,h,"$$")}),"keyword";if(d.match("$"))return p(s,function(t,h){return o(t,h,"$")}),"keyword";var n=d.next();if(n=="%")return d.skipToEnd(),"comment";if(n=="}"||n=="]"){if(f=P(s),f)f.closeBracket(n),p(s,a);else return"error";return"bracket"}else return n=="{"||n=="["?(f=c.DEFAULT,f=new f,w(s,f),"bracket"):/\d/.test(n)?(d.eatWhile(/[\w.%]/),"atom"):(d.eatWhile(/[\w\-_]/),f=T(s),f.name=="begin"&&(f.argument=d.current()),f.styleIdentifier())}function o(d,s,f){if(d.eatSpace())return null;if(f&&d.match(f))return p(s,u),"keyword";if(d.match(/^\\[a-zA-Z@]+/))return"tag";if(d.match(/^[a-zA-Z]+/))return"variable-2";if(d.match(/^\\[$&%#{}_]/))return"tag";if(d.match(/^\\[,;!\/]/))return"tag";if(d.match(/^[\^_&]/))return"tag";if(d.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(d.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var i=d.next();return i=="{"||i=="}"||i=="["||i=="]"||i=="("||i==")"?"bracket":i=="%"?(d.skipToEnd(),"comment"):"error"}function a(d,s){var f=d.peek(),i;return f=="{"||f=="["?(i=P(s),i.openBracket(f),d.eat(f),p(s,u),"bracket"):/[ \t\r]/.test(f)?(d.eat(f),null):(p(s,u),_(s),u(d,s))}return{startState:function(){var d=j.inMathMode?function(s,f){return o(s,f)}:u;return{cmdState:[],f:d}},copyState:function(d){return{cmdState:d.cmdState.slice(),f:d.f}},token:function(d,s){return s.f(d,s)},blankLine:function(d){d.f=u,d.cmdState.length=0},lineComment:"%"}}),le.defineMIME("text/x-stex","stex"),le.defineMIME("text/x-latex","stex")})},"+QRC":function(et,Ve,z){"use strict";var le=z("E9nw"),Q={"text/plain":"Text","text/html":"Url",default:"Text"},j="Copy to clipboard: #{key}, Enter";function w(_){var T=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return _.replace(/#{\s*key\s*}/g,T)}function P(_,T){var C,c,p,u,o,a,d=!1;T||(T={}),C=T.debug||!1;try{p=le(),u=document.createRange(),o=document.getSelection(),a=document.createElement("span"),a.textContent=_,a.style.all="unset",a.style.position="fixed",a.style.top=0,a.style.clip="rect(0, 0, 0, 0)",a.style.whiteSpace="pre",a.style.webkitUserSelect="text",a.style.MozUserSelect="text",a.style.msUserSelect="text",a.style.userSelect="text",a.addEventListener("copy",function(f){if(f.stopPropagation(),T.format)if(f.preventDefault(),typeof f.clipboardData=="undefined"){C&&console.warn("unable to use e.clipboardData"),C&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var i=Q[T.format]||Q.default;window.clipboardData.setData(i,_)}else f.clipboardData.clearData(),f.clipboardData.setData(T.format,_);T.onCopy&&(f.preventDefault(),T.onCopy(f.clipboardData))}),document.body.appendChild(a),u.selectNodeContents(a),o.addRange(u);var s=document.execCommand("copy");if(!s)throw new Error("copy command was unsuccessful");d=!0}catch(f){C&&console.error("unable to copy using execCommand: ",f),C&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(T.format||"text",_),T.onCopy&&T.onCopy(window.clipboardData),d=!0}catch(i){C&&console.error("unable to copy using clipboardData: ",i),C&&console.error("falling back to prompt"),c=w("message"in T?T.message:j),window.prompt(c,_)}}finally{o&&(typeof o.removeRange=="function"?o.removeRange(u):o.removeAllRanges()),a&&document.body.removeChild(a),p()}return d}et.exports=P},"07cG":function(et,Ve,z){et.exports={ldsRing:"ldsRing___2F8W7",idsRingWrapper:"idsRingWrapper___fC2cF",ldsring:"ldsring___3A88y"}},"0r65":function(et,Ve){var z=arguments[3],le=arguments[4],Q=arguments[5],j=JSON.stringify;et.exports=function(w,P){for(var _,T=Object.keys(Q),C=0,c=T.length;C")):null:S.match("--")?A(s("comment","-->")):S.match("DOCTYPE",!0,!0)?(S.eatWhile(/[\w\._\-]/),A(f(1))):null:S.eat("?")?(S.eatWhile(/[\w\._\-]/),O.tokenize=s("meta","?>"),"meta"):(p=S.eat("/")?"closeTag":"openTag",O.tokenize=a,"tag bracket");if(D=="&"){var I;return S.eat("#")?S.eat("x")?I=S.eatWhile(/[a-fA-F\d]/)&&S.eat(";"):I=S.eatWhile(/[\d]/)&&S.eat(";"):I=S.eatWhile(/[\w\.\-:]/)&&S.eat(";"),I?"atom":"error"}else return S.eatWhile(/[^&<]/),null}o.isInText=!0;function a(S,O){var A=S.next();if(A==">"||A=="/"&&S.eat(">"))return O.tokenize=o,p=A==">"?"endTag":"selfcloseTag","tag bracket";if(A=="=")return p="equals",null;if(A=="<"){O.tokenize=o,O.state=h,O.tagName=O.tagStart=null;var D=O.tokenize(S,O);return D?D+" tag error":"tag error"}else return/[\'\"]/.test(A)?(O.tokenize=d(A),O.stringStartCol=S.column(),O.tokenize(S,O)):(S.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function d(S){var O=function(A,D){for(;!A.eol();)if(A.next()==S){D.tokenize=a;break}return"string"};return O.isInAttribute=!0,O}function s(S,O){return function(A,D){for(;!A.eol();){if(A.match(O)){D.tokenize=o;break}A.next()}return S}}function f(S){return function(O,A){for(var D;(D=O.next())!=null;){if(D=="<")return A.tokenize=f(S+1),A.tokenize(O,A);if(D==">")if(S==1){A.tokenize=o;break}else return A.tokenize=f(S-1),A.tokenize(O,A)}return"meta"}}function i(S,O,A){this.prev=S.context,this.tagName=O,this.indent=S.indented,this.startOfLine=A,(T.doNotIndent.hasOwnProperty(O)||S.context&&S.context.noIndent)&&(this.noIndent=!0)}function n(S){S.context&&(S.context=S.context.prev)}function t(S,O){for(var A;;){if(!S.context)return;if(A=S.context.tagName,!T.contextGrabbers.hasOwnProperty(A)||!T.contextGrabbers[A].hasOwnProperty(O))return;n(S)}}function h(S,O,A){return S=="openTag"?(A.tagStart=O.column(),v):S=="closeTag"?g:h}function v(S,O,A){return S=="word"?(A.tagName=O.current(),u="tag",m):T.allowMissingTagName&&S=="endTag"?(u="tag bracket",m(S,O,A)):(u="error",v)}function g(S,O,A){if(S=="word"){var D=O.current();return A.context&&A.context.tagName!=D&&T.implicitlyClosed.hasOwnProperty(A.context.tagName)&&n(A),A.context&&A.context.tagName==D||T.matchClosing===!1?(u="tag",b):(u="tag error",E)}else return T.allowMissingTagName&&S=="endTag"?(u="tag bracket",b(S,O,A)):(u="error",E)}function b(S,O,A){return S!="endTag"?(u="error",b):(n(A),h)}function E(S,O,A){return u="error",b(S,O,A)}function m(S,O,A){if(S=="word")return u="attribute",y;if(S=="endTag"||S=="selfcloseTag"){var D=A.tagName,I=A.tagStart;return A.tagName=A.tagStart=null,S=="selfcloseTag"||T.autoSelfClosers.hasOwnProperty(D)?t(A,D):(t(A,D),A.context=new i(A,D,I==A.indented)),h}return u="error",m}function y(S,O,A){return S=="equals"?x:(T.allowMissing||(u="error"),m(S,O,A))}function x(S,O,A){return S=="string"?l:S=="word"&&T.allowUnquoted?(u="string",m):(u="error",m(S,O,A))}function l(S,O,A){return S=="string"?l:m(S,O,A)}return{startState:function(S){var O={tokenize:o,state:h,indented:S||0,tagName:null,tagStart:null,context:null};return S!=null&&(O.baseIndent=S),O},token:function(S,O){if(!O.tagName&&S.sol()&&(O.indented=S.indentation()),S.eatSpace())return null;p=null;var A=O.tokenize(S,O);return(A||p)&&A!="comment"&&(u=null,O.state=O.state(p||A,S,O),u&&(A=u=="error"?A+" error":u)),A},indent:function(S,O,A){var D=S.context;if(S.tokenize.isInAttribute)return S.tagStart==S.indented?S.stringStartCol+1:S.indented+_;if(D&&D.noIndent)return le.Pass;if(S.tokenize!=a&&S.tokenize!=o)return A?A.match(/^(\s*)/)[0].length:0;if(S.tagName)return T.multilineTagIndentPastTag!==!1?S.tagStart+S.tagName.length+2:S.tagStart+_*(T.multilineTagIndentFactor||1);if(T.alignCDATA&&/$/,blockCommentStart:"",configuration:T.htmlMode?"html":"xml",helperType:T.htmlMode?"html":"xml",skipAttribute:function(S){S.state==x&&(S.state=m)},xmlCurrentTag:function(S){return S.tagName?{name:S.tagName,close:S.type=="closeTag"}:null},xmlCurrentContext:function(S){for(var O=[],A=S.context;A;A=A.prev)A.tagName&&O.push(A.tagName);return O.reverse()}}}),le.defineMIME("text/xml","xml"),le.defineMIME("application/xml","xml"),le.mimeModes.hasOwnProperty("text/html")||le.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"1j5w":function(et,Ve,z){"use strict";z.d(Ve,"d",function(){return q}),z.d(Ve,"b",function(){return Ze}),z.d(Ve,"c",function(){return Tt}),z.d(Ve,"a",function(){return Qt});var le=z("VTBJ"),Q=z("1OyB"),j=z("vuIU"),w=z("JX7q"),P=z("Ji7U"),_=z("LK+K"),T=z("q1tI"),C=z("I8Z2"),c=z("BGR+"),p=z("wx14"),u=z("rePB"),o=z("4IlW"),a=z("2GS6"),d=z("Gytx"),s=z.n(d),f=z("TSYQ"),i=z.n(f),n=z("U8pU"),t=z("ODXe"),h=/iPhone/i,v=/iPod/i,g=/iPad/i,b=/\bAndroid(?:.+)Mobile\b/i,E=/Android/i,m=/\bAndroid(?:.+)SD4930UR\b/i,y=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,x=/Windows Phone/i,l=/\bWindows(?:.+)ARM\b/i,S=/BlackBerry/i,O=/BB10/i,A=/Opera Mini/i,D=/\b(CriOS|Chrome)(?:.+)Mobile/i,I=/Mobile(?:.+)Firefox\b/i;function B(Lt,at){return Lt.test(at)}function H(Lt){var at=Lt||(typeof navigator!="undefined"?navigator.userAgent:""),pt=at.split("[FBAN");if(typeof pt[1]!="undefined"){var st=pt,Pe=Object(t.a)(st,1);at=Pe[0]}if(pt=at.split("Twitter"),typeof pt[1]!="undefined"){var Ge=pt,yt=Object(t.a)(Ge,1);at=yt[0]}var ot={apple:{phone:B(h,at)&&!B(x,at),ipod:B(v,at),tablet:!B(h,at)&&B(g,at)&&!B(x,at),device:(B(h,at)||B(v,at)||B(g,at))&&!B(x,at)},amazon:{phone:B(m,at),tablet:!B(m,at)&&B(y,at),device:B(m,at)||B(y,at)},android:{phone:!B(x,at)&&B(m,at)||!B(x,at)&&B(b,at),tablet:!B(x,at)&&!B(m,at)&&!B(b,at)&&(B(y,at)||B(E,at)),device:!B(x,at)&&(B(m,at)||B(y,at)||B(b,at)||B(E,at))||B(/\bokhttp\b/i,at)},windows:{phone:B(x,at),tablet:B(l,at),device:B(x,at)||B(l,at)},other:{blackberry:B(S,at),blackberry10:B(O,at),opera:B(A,at),firefox:B(I,at),chrome:B(D,at),device:B(S,at)||B(O,at)||B(A,at)||B(I,at)||B(D,at)},any:null,phone:null,tablet:null};return ot.any=ot.apple.device||ot.android.device||ot.windows.device||ot.other.device,ot.phone=ot.apple.phone||ot.android.phone||ot.windows.phone,ot.tablet=ot.apple.tablet||ot.android.tablet||ot.windows.tablet,ot}var te=Object(le.a)(Object(le.a)({},H()),{},{isMobile:H}),W=te;function V(){}function X(Lt,at,pt){var st=at||"";return Lt.key||"".concat(st,"item_").concat(pt)}function ne(Lt){return"".concat(Lt,"-menu-")}function $(Lt,at){var pt=-1;T.Children.forEach(Lt,function(st){pt+=1,st&&st.type&&st.type.isMenuItemGroup?T.Children.forEach(st.props.children,function(Pe){pt+=1,at(Pe,pt)}):at(st,pt)})}function ee(Lt,at,pt){if(!Lt||pt.find)return;T.Children.forEach(Lt,function(st){if(st){var Pe=st.type;if(!Pe||!(Pe.isSubMenu||Pe.isMenuItem||Pe.isMenuItemGroup))return;at.indexOf(st.key)!==-1?pt.find=!0:st.props.children&&ee(st.props.children,at,pt)}})}var ce=["defaultSelectedKeys","selectedKeys","defaultOpenKeys","openKeys","mode","getPopupContainer","onSelect","onDeselect","onDestroy","openTransitionName","openAnimation","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","triggerSubMenuAction","level","selectable","multiple","onOpenChange","visible","focusable","defaultActiveFirst","prefixCls","inlineIndent","parentMenu","title","rootPrefixCls","eventKey","active","onItemHover","onTitleMouseEnter","onTitleMouseLeave","onTitleClick","popupAlign","popupOffset","isOpen","renderMenuItem","manualRef","subMenuKey","disabled","index","isSelected","store","activeKey","builtinPlacements","overflowedIndicator","motion","attribute","value","popupClassName","inlineCollapsed","menu","theme","itemIcon","expandIcon"],de=function(at){var pt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,st=at&&typeof at.getBoundingClientRect=="function"&&at.getBoundingClientRect().width;if(st){if(pt){var Pe=getComputedStyle(at),Ge=Pe.marginLeft,yt=Pe.marginRight;st+=+Ge.replace("px","")+ +yt.replace("px","")}st=+st.toFixed(6)}return st||0},Ce=function(at,pt,st){at&&Object(n.a)(at.style)==="object"&&(at.style[pt]=st)},Se=function(){return W.any},De=z("KQm4"),be=z("Ff2n"),_e=z("i8i4"),Ke=z("bdgK"),Ne=z("uciX"),Be=z("8XRh"),ze={adjustX:1,adjustY:1},ye={topLeft:{points:["bl","tl"],overflow:ze,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:ze,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:ze,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:ze,offset:[4,0]}},pe={topLeft:{points:["bl","tl"],overflow:ze,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:ze,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:ze,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:ze,offset:[4,0]}},We=ye,He=0,nt={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},re=function(at,pt,st){var Pe=ne(pt),Ge=at.getState();at.setState({defaultActiveFirst:Object(le.a)(Object(le.a)({},Ge.defaultActiveFirst),{},Object(u.a)({},Pe,st))})},k=function(Lt){Object(P.a)(pt,Lt);var at=Object(_.a)(pt);function pt(st){var Pe;Object(Q.a)(this,pt),Pe=at.call(this,st),Pe.onDestroy=function(rt){Pe.props.onDestroy(rt)},Pe.onKeyDown=function(rt){var wt=rt.keyCode,Bt=Pe.menuInstance,zt=Pe.props,Zt=zt.isOpen,Re=zt.store;if(wt===o.a.ENTER)return Pe.onTitleClick(rt),re(Re,Pe.props.eventKey,!0),!0;if(wt===o.a.RIGHT)return Zt?Bt.onKeyDown(rt):(Pe.triggerOpenChange(!0),re(Re,Pe.props.eventKey,!0)),!0;if(wt===o.a.LEFT){var ve;if(Zt)ve=Bt.onKeyDown(rt);else return;return ve||(Pe.triggerOpenChange(!1),ve=!0),ve}return Zt&&(wt===o.a.UP||wt===o.a.DOWN)?Bt.onKeyDown(rt):void 0},Pe.onOpenChange=function(rt){Pe.props.onOpenChange(rt)},Pe.onPopupVisibleChange=function(rt){Pe.triggerOpenChange(rt,rt?"mouseenter":"mouseleave")},Pe.onMouseEnter=function(rt){var wt=Pe.props,Bt=wt.eventKey,zt=wt.onMouseEnter,Zt=wt.store;re(Zt,Pe.props.eventKey,!1),zt({key:Bt,domEvent:rt})},Pe.onMouseLeave=function(rt){var wt=Pe.props,Bt=wt.parentMenu,zt=wt.eventKey,Zt=wt.onMouseLeave;Bt.subMenuInstance=Object(w.a)(Pe),Zt({key:zt,domEvent:rt})},Pe.onTitleMouseEnter=function(rt){var wt=Pe.props,Bt=wt.eventKey,zt=wt.onItemHover,Zt=wt.onTitleMouseEnter;zt({key:Bt,hover:!0}),Zt({key:Bt,domEvent:rt})},Pe.onTitleMouseLeave=function(rt){var wt=Pe.props,Bt=wt.parentMenu,zt=wt.eventKey,Zt=wt.onItemHover,Re=wt.onTitleMouseLeave;Bt.subMenuInstance=Object(w.a)(Pe),Zt({key:zt,hover:!1}),Re({key:zt,domEvent:rt})},Pe.onTitleClick=function(rt){var wt=Object(w.a)(Pe),Bt=wt.props;if(Bt.onTitleClick({key:Bt.eventKey,domEvent:rt}),Bt.triggerSubMenuAction==="hover")return;Pe.triggerOpenChange(!Bt.isOpen,"click"),re(Bt.store,Pe.props.eventKey,!1)},Pe.onSubMenuClick=function(rt){typeof Pe.props.onClick=="function"&&Pe.props.onClick(Pe.addKeyPath(rt))},Pe.onSelect=function(rt){Pe.props.onSelect(rt)},Pe.onDeselect=function(rt){Pe.props.onDeselect(rt)},Pe.getPrefixCls=function(){return"".concat(Pe.props.rootPrefixCls,"-submenu")},Pe.getActiveClassName=function(){return"".concat(Pe.getPrefixCls(),"-active")},Pe.getDisabledClassName=function(){return"".concat(Pe.getPrefixCls(),"-disabled")},Pe.getSelectedClassName=function(){return"".concat(Pe.getPrefixCls(),"-selected")},Pe.getOpenClassName=function(){return"".concat(Pe.props.rootPrefixCls,"-submenu-open")},Pe.saveMenuInstance=function(rt){Pe.menuInstance=rt},Pe.addKeyPath=function(rt){return Object(le.a)(Object(le.a)({},rt),{},{keyPath:(rt.keyPath||[]).concat(Pe.props.eventKey)})},Pe.triggerOpenChange=function(rt,wt){var Bt=Pe.props.eventKey,zt=function(){Pe.onOpenChange({key:Bt,item:Object(w.a)(Pe),trigger:wt,open:rt})};wt==="mouseenter"?Pe.mouseenterTimeout=setTimeout(function(){zt()},0):zt()},Pe.isChildrenSelected=function(){var rt={find:!1};return ee(Pe.props.children,Pe.props.selectedKeys,rt),rt.find},Pe.isOpen=function(){return Pe.props.openKeys.indexOf(Pe.props.eventKey)!==-1},Pe.adjustWidth=function(){if(!Pe.subMenuTitle||!Pe.menuInstance)return;var rt=_e.findDOMNode(Pe.menuInstance);if(rt.offsetWidth>=Pe.subMenuTitle.offsetWidth)return;rt.style.minWidth="".concat(Pe.subMenuTitle.offsetWidth,"px")},Pe.saveSubMenuTitle=function(rt){Pe.subMenuTitle=rt},Pe.getBaseProps=function(){var rt=Object(w.a)(Pe),wt=rt.props;return{mode:wt.mode==="horizontal"?"vertical":wt.mode,visible:Pe.props.isOpen,level:wt.level+1,inlineIndent:wt.inlineIndent,focusable:!1,onClick:Pe.onSubMenuClick,onSelect:Pe.onSelect,onDeselect:Pe.onDeselect,onDestroy:Pe.onDestroy,selectedKeys:wt.selectedKeys,eventKey:"".concat(wt.eventKey,"-menu-"),openKeys:wt.openKeys,motion:wt.motion,onOpenChange:Pe.onOpenChange,subMenuOpenDelay:wt.subMenuOpenDelay,parentMenu:Object(w.a)(Pe),subMenuCloseDelay:wt.subMenuCloseDelay,forceSubMenuRender:wt.forceSubMenuRender,triggerSubMenuAction:wt.triggerSubMenuAction,builtinPlacements:wt.builtinPlacements,defaultActiveFirst:wt.store.getState().defaultActiveFirst[ne(wt.eventKey)],multiple:wt.multiple,prefixCls:wt.rootPrefixCls,id:Pe.internalMenuId,manualRef:Pe.saveMenuInstance,itemIcon:wt.itemIcon,expandIcon:wt.expandIcon,direction:wt.direction}},Pe.getMotion=function(rt,wt){var Bt=Object(w.a)(Pe),zt=Bt.haveRendered,Zt=Pe.props,Re=Zt.motion,ve=Zt.rootPrefixCls,K=Object(le.a)(Object(le.a)({},Re),{},{leavedClassName:"".concat(ve,"-hidden"),removeOnLeave:!1,motionAppear:zt||!wt||rt!=="inline"});return K};var Ge=st.store,yt=st.eventKey,ot=Ge.getState(),kt=ot.defaultActiveFirst;Pe.isRootMenu=!1;var Dt=!1;return kt&&(Dt=kt[yt]),re(Ge,yt,Dt),Pe}return Object(j.a)(pt,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var Pe=this,Ge=this.props,yt=Ge.mode,ot=Ge.parentMenu,kt=Ge.manualRef;if(kt&&kt(this),yt!=="horizontal"||!ot.isRootMenu||!this.props.isOpen)return;this.minWidthTimeout=setTimeout(function(){return Pe.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var Pe=this.props,Ge=Pe.onDestroy,yt=Pe.eventKey;Ge&&Ge(yt),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout)}},{key:"renderChildren",value:function(Pe){var Ge=this,yt=this.getBaseProps(),ot=this.getMotion(yt.mode,yt.visible);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||yt.visible||yt.forceSubMenuRender,!this.haveOpened)return T.createElement("div",null);var kt=yt.direction;return T.createElement(Be.default,Object.assign({visible:yt.visible},ot),function(Dt){var rt=Dt.className,wt=Dt.style,Bt=i()("".concat(yt.prefixCls,"-sub"),rt,Object(u.a)({},"".concat(yt.prefixCls,"-rtl"),kt==="rtl"));return T.createElement(Fe,Object.assign({},yt,{id:Ge.internalMenuId,className:Bt,style:wt}),Pe)})}},{key:"render",value:function(){var Pe,Ge=Object(le.a)({},this.props),yt=Ge.isOpen,ot=this.getPrefixCls(),kt=Ge.mode==="inline",Dt=i()(ot,"".concat(ot,"-").concat(Ge.mode),(Pe={},Object(u.a)(Pe,Ge.className,!!Ge.className),Object(u.a)(Pe,this.getOpenClassName(),yt),Object(u.a)(Pe,this.getActiveClassName(),Ge.active||yt&&!kt),Object(u.a)(Pe,this.getDisabledClassName(),Ge.disabled),Object(u.a)(Pe,this.getSelectedClassName(),this.isChildrenSelected()),Pe));this.internalMenuId||(Ge.eventKey?this.internalMenuId="".concat(Ge.eventKey,"$Menu"):(He+=1,this.internalMenuId="$__$".concat(He,"$Menu")));var rt={},wt={},Bt={};Ge.disabled||(rt={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},wt={onClick:this.onTitleClick},Bt={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var zt={},Zt=Ge.direction;kt&&(Zt==="rtl"?zt.paddingRight=Ge.inlineIndent*Ge.level:zt.paddingLeft=Ge.inlineIndent*Ge.level);var Re={};this.props.isOpen&&(Re={"aria-owns":this.internalMenuId});var ve=null;Ge.mode!=="horizontal"&&(ve=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(ve=T.createElement(this.props.expandIcon,Object(le.a)({},this.props))));var K=T.createElement("div",Object.assign({ref:this.saveSubMenuTitle,style:zt,className:"".concat(ot,"-title"),role:"button"},Bt,wt,{"aria-expanded":yt},Re,{"aria-haspopup":"true",title:typeof Ge.title=="string"?Ge.title:void 0}),Ge.title,ve||T.createElement("i",{className:"".concat(ot,"-arrow")})),Z=this.renderChildren(Ge.children),oe=Ge.parentMenu.isRootMenu?Ge.parentMenu.props.getPopupContainer:function(cn){return cn.parentNode},he=nt[Ge.mode],Oe=Ge.popupOffset?{offset:Ge.popupOffset}:{},Je=Ge.mode==="inline"?"":Ge.popupClassName;Je+=Zt==="rtl"?" ".concat(ot,"-rtl"):"";var lt=Ge.disabled,Pt=Ge.triggerSubMenuAction,Nt=Ge.subMenuOpenDelay,ht=Ge.forceSubMenuRender,Mt=Ge.subMenuCloseDelay,nn=Ge.builtinPlacements;ce.forEach(function(cn){return delete Ge[cn]}),delete Ge.onClick;var Rt=Zt==="rtl"?Object.assign({},pe,nn):Object.assign({},ye,nn);return delete Ge.direction,T.createElement("li",Object.assign({},Ge,rt,{className:Dt,role:"menuitem"}),kt&&K,kt&&Z,!kt&&T.createElement(Ne.a,{prefixCls:ot,popupClassName:i()("".concat(ot,"-popup"),Je),getPopupContainer:oe,builtinPlacements:Rt,popupPlacement:he,popupVisible:yt,popupAlign:Oe,popup:Z,action:lt?[]:[Pt],mouseEnterDelay:Nt,mouseLeaveDelay:Mt,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:ht},K))}}]),pt}(T.Component);k.defaultProps={onMouseEnter:V,onMouseLeave:V,onTitleMouseEnter:V,onTitleMouseLeave:V,onTitleClick:V,manualRef:V,mode:"vertical",title:""};var U=Object(C.b)(function(Lt,at){var pt=Lt.openKeys,st=Lt.activeKey,Pe=Lt.selectedKeys,Ge=at.eventKey,yt=at.subMenuKey;return{isOpen:pt.indexOf(Ge)>-1,active:st[yt]===Ge,selectedKeys:Pe}})(k);U.isSubMenu=!0;var q=U,Y="menuitem-overflowed",J=.5,xe=function(Lt){Object(P.a)(pt,Lt);var at=Object(_.a)(pt);function pt(){var st;return Object(Q.a)(this,pt),st=at.apply(this,arguments),st.resizeObserver=null,st.mutationObserver=null,st.originalTotalWidth=0,st.overflowedItems=[],st.menuItemSizes=[],st.cancelFrameId=null,st.state={lastVisibleIndex:void 0},st.getMenuItemNodes=function(){var Pe=st.props.prefixCls,Ge=_e.findDOMNode(Object(w.a)(st));return Ge?[].slice.call(Ge.children).filter(function(yt){return yt.className.split(" ").indexOf("".concat(Pe,"-overflowed-submenu"))<0}):[]},st.getOverflowedSubMenuItem=function(Pe,Ge,yt){var ot=st.props,kt=ot.overflowedIndicator,Dt=ot.level,rt=ot.mode,wt=ot.prefixCls,Bt=ot.theme;if(Dt!==1||rt!=="horizontal")return null;var zt=st.props.children[0],Zt=zt.props,Re=Zt.children,ve=Zt.title,K=Zt.style,Z=Object(be.a)(Zt,["children","title","style"]),oe=Object(le.a)({},K),he="".concat(Pe,"-overflowed-indicator"),Oe="".concat(Pe,"-overflowed-indicator");Ge.length===0&&yt!==!0?oe=Object(le.a)(Object(le.a)({},oe),{},{display:"none"}):yt&&(oe=Object(le.a)(Object(le.a)({},oe),{},{visibility:"hidden",position:"absolute"}),he="".concat(he,"-placeholder"),Oe="".concat(Oe,"-placeholder"));var Je=Bt?"".concat(wt,"-").concat(Bt):"",lt={};return ce.forEach(function(Pt){Z[Pt]!==void 0&&(lt[Pt]=Z[Pt])}),T.createElement(q,Object.assign({title:kt,className:"".concat(wt,"-overflowed-submenu"),popupClassName:Je},lt,{key:he,eventKey:Oe,disabled:!1,style:oe}),Ge)},st.setChildrenWidthAndResize=function(){if(st.props.mode!=="horizontal")return;var Pe=_e.findDOMNode(Object(w.a)(st));if(!Pe)return;var Ge=Pe.children;if(!Ge||Ge.length===0)return;var yt=Pe.children[Ge.length-1];Ce(yt,"display","inline-block");var ot=st.getMenuItemNodes(),kt=ot.filter(function(Dt){return Dt.className.split(" ").indexOf(Y)>=0});kt.forEach(function(Dt){Ce(Dt,"display","inline-block")}),st.menuItemSizes=ot.map(function(Dt){return de(Dt,!0)}),kt.forEach(function(Dt){Ce(Dt,"display","none")}),st.overflowedIndicatorWidth=de(Pe.children[Pe.children.length-1],!0),st.originalTotalWidth=st.menuItemSizes.reduce(function(Dt,rt){return Dt+rt},0),st.handleResize(),Ce(yt,"display","none")},st.handleResize=function(){if(st.props.mode!=="horizontal")return;var Pe=_e.findDOMNode(Object(w.a)(st));if(!Pe)return;var Ge=de(Pe);st.overflowedItems=[];var yt=0,ot;st.originalTotalWidth>Ge+J&&(ot=-1,st.menuItemSizes.forEach(function(kt){yt+=kt,yt+st.overflowedIndicatorWidth<=Ge&&(ot+=1)})),st.setState({lastVisibleIndex:ot})},st}return Object(j.a)(pt,[{key:"componentDidMount",value:function(){var Pe=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var Ge=_e.findDOMNode(this);if(!Ge)return;this.resizeObserver=new Ke.default(function(yt){yt.forEach(function(){var ot=Pe.cancelFrameId;cancelAnimationFrame(ot),Pe.cancelFrameId=requestAnimationFrame(Pe.setChildrenWidthAndResize)})}),[].slice.call(Ge.children).concat(Ge).forEach(function(yt){Pe.resizeObserver.observe(yt)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){Pe.resizeObserver.disconnect(),[].slice.call(Ge.children).concat(Ge).forEach(function(yt){Pe.resizeObserver.observe(yt)}),Pe.setChildrenWidthAndResize()}),this.mutationObserver.observe(Ge,{attributes:!1,childList:!0,subTree:!1}))}}},{key:"componentWillUnmount",value:function(){this.resizeObserver&&this.resizeObserver.disconnect(),this.mutationObserver&&this.mutationObserver.disconnect(),cancelAnimationFrame(this.cancelFrameId)}},{key:"renderChildren",value:function(Pe){var Ge=this,yt=this.state.lastVisibleIndex;return(Pe||[]).reduce(function(ot,kt,Dt){var rt=kt;if(Ge.props.mode==="horizontal"){var wt=Ge.getOverflowedSubMenuItem(kt.props.eventKey,[]);yt!==void 0&&Ge.props.className.indexOf("".concat(Ge.props.prefixCls,"-root"))!==-1&&(Dt>yt&&(rt=T.cloneElement(kt,{style:{display:"none"},eventKey:"".concat(kt.props.eventKey,"-hidden"),className:"".concat(Y)})),Dt===yt+1&&(Ge.overflowedItems=Pe.slice(yt+1).map(function(zt){return T.cloneElement(zt,{key:zt.props.eventKey,mode:"vertical-left"})}),wt=Ge.getOverflowedSubMenuItem(kt.props.eventKey,Ge.overflowedItems)));var Bt=[].concat(Object(De.a)(ot),[wt,rt]);return Dt===Pe.length-1&&Bt.push(Ge.getOverflowedSubMenuItem(kt.props.eventKey,[],!0)),Bt}return[].concat(Object(De.a)(ot),[rt])},[])}},{key:"render",value:function(){var Pe=this.props,Ge=Pe.visible,yt=Pe.prefixCls,ot=Pe.overflowedIndicator,kt=Pe.mode,Dt=Pe.level,rt=Pe.tag,wt=Pe.children,Bt=Pe.theme,zt=Object(be.a)(Pe,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),Zt=rt;return T.createElement(Zt,Object.assign({},zt),this.renderChildren(wt))}}]),pt}(T.Component);xe.defaultProps={tag:"div",className:""};var ke=xe;function dt(Lt){return Lt.length?Lt.every(function(at){return!!at.props.disabled}):!0}function Ue(Lt,at,pt){var st=Lt.getState();Lt.setState({activeKey:Object(le.a)(Object(le.a)({},st.activeKey),{},Object(u.a)({},at,pt))})}function je(Lt){return Lt.eventKey||"0-menu-"}function tt(Lt,at){var pt=at,st=Lt.children,Pe=Lt.eventKey;if(pt){var Ge;if($(st,function(yt,ot){yt&&yt.props&&!yt.props.disabled&&pt===X(yt,Pe,ot)&&(Ge=!0)}),Ge)return pt}return pt=null,Lt.defaultActiveFirst&&$(st,function(yt,ot){!pt&&yt&&!yt.props.disabled&&(pt=X(yt,Pe,ot))}),pt}function mt(Lt){if(Lt){var at=this.instanceArray.indexOf(Lt);at!==-1?this.instanceArray[at]=Lt:this.instanceArray.push(Lt)}}var Qe=function(Lt){Object(P.a)(pt,Lt);var at=Object(_.a)(pt);function pt(st){var Pe;return Object(Q.a)(this,pt),Pe=at.call(this,st),Pe.onKeyDown=function(Ge,yt){var ot=Ge.keyCode,kt;if(Pe.getFlatInstanceArray().forEach(function(rt){rt&&rt.props.active&&rt.onKeyDown&&(kt=rt.onKeyDown(Ge))}),kt)return 1;var Dt=null;return(ot===o.a.UP||ot===o.a.DOWN)&&(Dt=Pe.step(ot===o.a.UP?-1:1)),Dt?(Ge.preventDefault(),Ue(Pe.props.store,je(Pe.props),Dt.props.eventKey),typeof yt=="function"&&yt(Dt),1):void 0},Pe.onItemHover=function(Ge){var yt=Ge.key,ot=Ge.hover;Ue(Pe.props.store,je(Pe.props),ot?yt:null)},Pe.onDeselect=function(Ge){Pe.props.onDeselect(Ge)},Pe.onSelect=function(Ge){Pe.props.onSelect(Ge)},Pe.onClick=function(Ge){Pe.props.onClick(Ge)},Pe.onOpenChange=function(Ge){Pe.props.onOpenChange(Ge)},Pe.onDestroy=function(Ge){Pe.props.onDestroy(Ge)},Pe.getFlatInstanceArray=function(){return Pe.instanceArray},Pe.step=function(Ge){var yt=Pe.getFlatInstanceArray(),ot=Pe.props.store.getState().activeKey[je(Pe.props)],kt=yt.length;if(!kt)return null;Ge<0&&(yt=yt.concat().reverse());var Dt=-1;if(yt.every(function(zt,Zt){return zt&&zt.props.eventKey===ot?(Dt=Zt,!1):!0}),!Pe.props.defaultActiveFirst&&Dt!==-1&&dt(yt.slice(Dt,kt-1)))return;var rt=(Dt+1)%kt,wt=rt;do{var Bt=yt[wt];if(!Bt||Bt.props.disabled)wt=(wt+1)%kt;else return Bt}while(wt!==rt);return null},Pe.renderCommonMenuItem=function(Ge,yt,ot){var kt=Pe.props.store.getState(),Dt=Object(w.a)(Pe),rt=Dt.props,wt=X(Ge,rt.eventKey,yt),Bt=Ge.props;if(!Bt||typeof Ge.type=="string")return Ge;var zt=wt===kt.activeKey,Zt=Object(le.a)(Object(le.a)({mode:Bt.mode||rt.mode,level:rt.level,inlineIndent:rt.inlineIndent,renderMenuItem:Pe.renderMenuItem,rootPrefixCls:rt.prefixCls,index:yt,parentMenu:rt.parentMenu,manualRef:Bt.disabled?void 0:Object(a.a)(Ge.ref,mt.bind(Object(w.a)(Pe))),eventKey:wt,active:!Bt.disabled&&zt,multiple:rt.multiple,onClick:function(ve){(Bt.onClick||V)(ve),Pe.onClick(ve)},onItemHover:Pe.onItemHover,motion:rt.motion,subMenuOpenDelay:rt.subMenuOpenDelay,subMenuCloseDelay:rt.subMenuCloseDelay,forceSubMenuRender:rt.forceSubMenuRender,onOpenChange:Pe.onOpenChange,onDeselect:Pe.onDeselect,onSelect:Pe.onSelect,builtinPlacements:rt.builtinPlacements,itemIcon:Bt.itemIcon||Pe.props.itemIcon,expandIcon:Bt.expandIcon||Pe.props.expandIcon},ot),{},{direction:rt.direction});return(rt.mode==="inline"||Se())&&(Zt.triggerSubMenuAction="click"),T.cloneElement(Ge,Zt)},Pe.renderMenuItem=function(Ge,yt,ot){if(!Ge)return null;var kt=Pe.props.store.getState(),Dt={openKeys:kt.openKeys,selectedKeys:kt.selectedKeys,triggerSubMenuAction:Pe.props.triggerSubMenuAction,subMenuKey:ot};return Pe.renderCommonMenuItem(Ge,yt,Dt)},st.store.setState({activeKey:Object(le.a)(Object(le.a)({},st.store.getState().activeKey),{},Object(u.a)({},st.eventKey,tt(st,st.activeKey)))}),Pe.instanceArray=[],Pe}return Object(j.a)(pt,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(Pe){return this.props.visible||Pe.visible||this.props.className!==Pe.className||!s()(this.props.style,Pe.style)}},{key:"componentDidUpdate",value:function(Pe){var Ge=this.props,yt="activeKey"in Ge?Ge.activeKey:Ge.store.getState().activeKey[je(Ge)],ot=tt(Ge,yt);if(ot!==yt)Ue(Ge.store,je(Ge),ot);else if("activeKey"in Pe){var kt=tt(Pe,Pe.activeKey);ot!==kt&&Ue(Ge.store,je(Ge),ot)}}},{key:"render",value:function(){var Pe=this,Ge=Object(p.a)({},this.props);this.instanceArray=[];var yt=i()(Ge.prefixCls,Ge.className,"".concat(Ge.prefixCls,"-").concat(Ge.mode)),ot={className:yt,role:Ge.role||"menu"};Ge.id&&(ot.id=Ge.id),Ge.focusable&&(ot.tabIndex=0,ot.onKeyDown=this.onKeyDown);var kt=Ge.prefixCls,Dt=Ge.eventKey,rt=Ge.visible,wt=Ge.level,Bt=Ge.mode,zt=Ge.overflowedIndicator,Zt=Ge.theme;return ce.forEach(function(Re){return delete Ge[Re]}),delete Ge.onClick,T.createElement(ke,Object.assign({},Ge,{prefixCls:kt,mode:Bt,tag:"ul",level:wt,theme:Zt,visible:rt,overflowedIndicator:zt},ot),T.Children.map(Ge.children,function(Re,ve){return Pe.renderMenuItem(Re,ve,Dt||"0-menu-")}))}}]),pt}(T.Component);Qe.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:V};var Xe=Object(C.b)()(Qe),Fe=Xe,Ie=z("Kwbf");function Me(Lt,at,pt){var st=Lt.prefixCls,Pe=Lt.motion,Ge=Lt.defaultMotions,yt=Ge===void 0?{}:Ge,ot=Lt.openAnimation,kt=Lt.openTransitionName,Dt=at.switchingModeFromInline;if(Pe)return Pe;if(Object(n.a)(ot)==="object"&&ot)Object(Ie.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof ot=="string")return{motionName:"".concat(st,"-open-").concat(ot)};if(kt)return{motionName:kt};var rt=yt[pt];return rt||(Dt?null:yt.other)}var Ee=function(Lt){Object(P.a)(pt,Lt);var at=Object(_.a)(pt);function pt(st){var Pe;Object(Q.a)(this,pt),Pe=at.call(this,st),Pe.inlineOpenKeys=[],Pe.onSelect=function(ot){var kt=Object(w.a)(Pe),Dt=kt.props;if(Dt.selectable){var rt=Pe.store.getState(),wt=rt.selectedKeys,Bt=ot.key;Dt.multiple?wt=wt.concat([Bt]):wt=[Bt],"selectedKeys"in Dt||Pe.store.setState({selectedKeys:wt}),Dt.onSelect(Object(le.a)(Object(le.a)({},ot),{},{selectedKeys:wt}))}},Pe.onClick=function(ot){var kt=Pe.getRealMenuMode(),Dt=Object(w.a)(Pe),rt=Dt.store,wt=Dt.props.onOpenChange;kt!=="inline"&&!("openKeys"in Pe.props)&&(rt.setState({openKeys:[]}),wt([])),Pe.props.onClick(ot)},Pe.onKeyDown=function(ot,kt){Pe.innerMenu.getWrappedInstance().onKeyDown(ot,kt)},Pe.onOpenChange=function(ot){var kt=Object(w.a)(Pe),Dt=kt.props,rt=Pe.store.getState().openKeys.concat(),wt=!1,Bt=function(Zt){var Re=!1;if(Zt.open)Re=rt.indexOf(Zt.key)===-1,Re&&rt.push(Zt.key);else{var ve=rt.indexOf(Zt.key);Re=ve!==-1,Re&&rt.splice(ve,1)}wt=wt||Re};Array.isArray(ot)?ot.forEach(Bt):Bt(ot),wt&&("openKeys"in Pe.props||Pe.store.setState({openKeys:rt}),Dt.onOpenChange(rt))},Pe.onDeselect=function(ot){var kt=Object(w.a)(Pe),Dt=kt.props;if(Dt.selectable){var rt=Pe.store.getState().selectedKeys.concat(),wt=ot.key,Bt=rt.indexOf(wt);Bt!==-1&&rt.splice(Bt,1),"selectedKeys"in Dt||Pe.store.setState({selectedKeys:rt}),Dt.onDeselect(Object(le.a)(Object(le.a)({},ot),{},{selectedKeys:rt}))}},Pe.onMouseEnter=function(ot){Pe.restoreModeVerticalFromInline();var kt=Pe.props.onMouseEnter;kt&&kt(ot)},Pe.onTransitionEnd=function(ot){var kt=ot.propertyName==="width"&&ot.target===ot.currentTarget,Dt=ot.target.className,rt=Object.prototype.toString.call(Dt)==="[object SVGAnimatedString]"?Dt.animVal:Dt,wt=ot.propertyName==="font-size"&&rt.indexOf("anticon")>=0;(kt||wt)&&Pe.restoreModeVerticalFromInline()},Pe.setInnerMenu=function(ot){Pe.innerMenu=ot},Pe.isRootMenu=!0;var Ge=st.defaultSelectedKeys,yt=st.defaultOpenKeys;return"selectedKeys"in st&&(Ge=st.selectedKeys||[]),"openKeys"in st&&(yt=st.openKeys||[]),Pe.store=Object(C.c)({selectedKeys:Ge,openKeys:yt,activeKey:{"0-menu-":tt(st,st.activeKey)}}),Pe.state={switchingModeFromInline:!1},Pe}return Object(j.a)(pt,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(Pe){this.updateOpentKeysWhenSwitchMode(Pe),this.updateMiniStore();var Ge=this.props,yt=Ge.siderCollapsed,ot=Ge.inlineCollapsed,kt=Ge.onOpenChange;(!Pe.inlineCollapsed&&ot||!Pe.siderCollapsed&&yt)&&kt([]),this.updateMenuDisplay()}},{key:"updateOpentKeysWhenSwitchMode",value:function(Pe){var Ge=this.props,yt=this.store,ot=this.inlineOpenKeys,kt=yt.getState(),Dt={};Pe.mode==="inline"&&Ge.mode!=="inline"&&this.setState({switchingModeFromInline:!0}),"openKeys"in Ge||((Ge.inlineCollapsed&&!Pe.inlineCollapsed||Ge.siderCollapsed&&!Pe.siderCollapsed)&&(this.setState({switchingModeFromInline:!0}),this.inlineOpenKeys=kt.openKeys.concat(),Dt.openKeys=[]),(!Ge.inlineCollapsed&&Pe.inlineCollapsed||!Ge.siderCollapsed&&Pe.siderCollapsed)&&(Dt.openKeys=ot,this.inlineOpenKeys=[])),Object.keys(Dt).length&&yt.setState(Dt)}},{key:"updateMenuDisplay",value:function(){var Pe=this.props.collapsedWidth,Ge=this.store,yt=this.prevOpenKeys,ot=this.getInlineCollapsed()&&(Pe===0||Pe==="0"||Pe==="0px");ot?(this.prevOpenKeys=Ge.getState().openKeys.concat(),this.store.setState({openKeys:[]})):yt&&(this.store.setState({openKeys:yt}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var Pe=this.props.mode,Ge=this.state.switchingModeFromInline,yt=this.getInlineCollapsed();return Ge&&yt?"inline":yt?"vertical":Pe}},{key:"getInlineCollapsed",value:function(){var Pe=this.props,Ge=Pe.inlineCollapsed,yt=Pe.siderCollapsed;return yt!==void 0?yt:Ge}},{key:"restoreModeVerticalFromInline",value:function(){var Pe=this.state.switchingModeFromInline;Pe&&this.setState({switchingModeFromInline:!1})}},{key:"updateMiniStore",value:function(){"selectedKeys"in this.props&&this.store.setState({selectedKeys:this.props.selectedKeys||[]}),"openKeys"in this.props&&this.store.setState({openKeys:this.props.openKeys||[]})}},{key:"render",value:function(){var Pe=Object(le.a)({},Object(c.default)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),Ge=this.getRealMenuMode();return Pe.className+=" ".concat(Pe.prefixCls,"-root"),Pe.direction==="rtl"&&(Pe.className+=" ".concat(Pe.prefixCls,"-rtl")),Pe=Object(le.a)(Object(le.a)({},Pe),{},{mode:Ge,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:Me(this.props,this.state,Ge)}),delete Pe.openAnimation,delete Pe.openTransitionName,T.createElement(C.a,{store:this.store},T.createElement(Fe,Object.assign({},Pe,{ref:this.setInnerMenu}),this.props.children))}}]),pt}(T.Component);Ee.defaultProps={selectable:!0,onClick:V,onSelect:V,onOpenChange:V,onDeselect:V,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:T.createElement("span",null,"\xB7\xB7\xB7")};var Ae=Ee,Le=function(Lt){Object(P.a)(pt,Lt);var at=Object(_.a)(pt);function pt(){var st;return Object(Q.a)(this,pt),st=at.apply(this,arguments),st.onKeyDown=function(Pe){var Ge=Pe.keyCode;return Ge===o.a.ENTER?(st.onClick(Pe),!0):void 0},st.onMouseLeave=function(Pe){var Ge=st.props,yt=Ge.eventKey,ot=Ge.onItemHover,kt=Ge.onMouseLeave;ot({key:yt,hover:!1}),kt({key:yt,domEvent:Pe})},st.onMouseEnter=function(Pe){var Ge=st.props,yt=Ge.eventKey,ot=Ge.onItemHover,kt=Ge.onMouseEnter;ot({key:yt,hover:!0}),kt({key:yt,domEvent:Pe})},st.onClick=function(Pe){var Ge=st.props,yt=Ge.eventKey,ot=Ge.multiple,kt=Ge.onClick,Dt=Ge.onSelect,rt=Ge.onDeselect,wt=Ge.isSelected,Bt={key:yt,keyPath:[yt],item:Object(w.a)(st),domEvent:Pe};kt(Bt),ot?wt?rt(Bt):Dt(Bt):wt||Dt(Bt)},st.saveNode=function(Pe){st.node=Pe},st}return Object(j.a)(pt,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var Pe=this.props;Pe.onDestroy&&Pe.onDestroy(Pe.eventKey)}},{key:"getPrefixCls",value:function(){return"".concat(this.props.rootPrefixCls,"-item")}},{key:"getActiveClassName",value:function(){return"".concat(this.getPrefixCls(),"-active")}},{key:"getSelectedClassName",value:function(){return"".concat(this.getPrefixCls(),"-selected")}},{key:"getDisabledClassName",value:function(){return"".concat(this.getPrefixCls(),"-disabled")}},{key:"callRef",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"render",value:function(){var Pe,Ge=Object(le.a)({},this.props),yt=i()(this.getPrefixCls(),Ge.className,(Pe={},Object(u.a)(Pe,this.getActiveClassName(),!Ge.disabled&&Ge.active),Object(u.a)(Pe,this.getSelectedClassName(),Ge.isSelected),Object(u.a)(Pe,this.getDisabledClassName(),Ge.disabled),Pe)),ot=Object(le.a)(Object(le.a)({},Ge.attribute),{},{title:typeof Ge.title=="string"?Ge.title:void 0,className:yt,role:Ge.role||"menuitem","aria-disabled":Ge.disabled});Ge.role==="option"?ot=Object(le.a)(Object(le.a)({},ot),{},{role:"option","aria-selected":Ge.isSelected}):(Ge.role===null||Ge.role==="none")&&(ot.role="none");var kt={onClick:Ge.disabled?null:this.onClick,onMouseLeave:Ge.disabled?null:this.onMouseLeave,onMouseEnter:Ge.disabled?null:this.onMouseEnter},Dt=Object(le.a)({},Ge.style);Ge.mode==="inline"&&(Ge.direction==="rtl"?Dt.paddingRight=Ge.inlineIndent*Ge.level:Dt.paddingLeft=Ge.inlineIndent*Ge.level),ce.forEach(function(wt){return delete Ge[wt]}),delete Ge.direction;var rt=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(rt=T.createElement(this.props.itemIcon,this.props)),T.createElement("li",Object.assign({},Object(c.default)(Ge,["onClick","onMouseEnter","onMouseLeave","onSelect"]),ot,kt,{style:Dt,ref:this.saveNode}),Ge.children,rt)}}]),pt}(T.Component);Le.isMenuItem=!0,Le.defaultProps={onSelect:V,onMouseEnter:V,onMouseLeave:V,manualRef:V};var Te=Object(C.b)(function(Lt,at){var pt=Lt.activeKey,st=Lt.selectedKeys,Pe=at.eventKey,Ge=at.subMenuKey;return{active:pt[Ge]===Pe,isSelected:st.indexOf(Pe)!==-1}})(Le),Ze=Te,ut=function(Lt){Object(P.a)(pt,Lt);var at=Object(_.a)(pt);function pt(){var st;return Object(Q.a)(this,pt),st=at.apply(this,arguments),st.renderInnerMenuItem=function(Pe){var Ge=st.props,yt=Ge.renderMenuItem,ot=Ge.index;return yt(Pe,ot,st.props.subMenuKey)},st}return Object(j.a)(pt,[{key:"render",value:function(){var Pe=Object(p.a)({},this.props),Ge=Pe.className,yt=Ge===void 0?"":Ge,ot=Pe.rootPrefixCls,kt="".concat(ot,"-item-group-title"),Dt="".concat(ot,"-item-group-list"),rt=Pe.title,wt=Pe.children;return ce.forEach(function(Bt){return delete Pe[Bt]}),delete Pe.onClick,delete Pe.direction,T.createElement("li",Object.assign({},Pe,{className:"".concat(yt," ").concat(ot,"-item-group")}),T.createElement("div",{className:kt,title:typeof rt=="string"?rt:void 0},rt),T.createElement("ul",{className:Dt},T.Children.map(wt,this.renderInnerMenuItem)))}}]),pt}(T.Component);ut.isMenuItemGroup=!0,ut.defaultProps={disabled:!0};var Tt=ut,Ht=function(at){var pt=at.className,st=at.rootPrefixCls,Pe=at.style;return T.createElement("li",{className:"".concat(pt," ").concat(st,"-item-divider"),style:Pe})};Ht.defaultProps={disabled:!0,className:"",style:{}};var Qt=Ht,bt=Ve.e=Ae},"3tLw":function(et,Ve,z){et.exports=z.p+"static/a.39070d50.svg"},"4xil":function(et,Ve,z){et.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","volume-controls":"volume-controls___QLaWH","fullscreen-button":"fullscreen-button___2nHzc","pip-button":"pip-button___18qQG","playback-animation":"playback-animation___gCL6X",volume:"volume___10eUe",hidden:"hidden___2JBJW"}},"55Ip":function(et,Ve,z){"use strict";z.d(Ve,"a",function(){return t}),z.d(Ve,"b",function(){return m});var le=z("Ty5D"),Q=z("dI71"),j=z("q1tI"),w=z.n(j),P=z("YS25"),_=z("17x9"),T=z.n(_),C=z("wx14"),c=z("zLVn"),p=z("9R94"),u=function(x){Object(Q.a)(l,x);function l(){for(var O,A=arguments.length,D=new Array(A),I=0;I=0||A.relatedTarget.className.indexOf("".concat(H,"-next"))>=0))return;x.setState({goInputText:""}),B(x.getValidValue())},x.go=function(A){var D=x.state.goInputText;if(D==="")return;(A.keyCode===d.ENTER||A.type==="click")&&(x.setState({goInputText:""}),x.props.quickGo(x.getValidValue()))},x}return Object(P.a)(y,[{key:"getValidValue",value:function(){var l=this.state,S=l.goInputText,O=l.current;return!S||isNaN(S)?O:Number(S)}},{key:"getPageSizeOptions",value:function(){var l=this.props,S=l.pageSize,O=l.pageSizeOptions;return O.some(function(A){return A.toString()===S.toString()})?O:O.concat([S.toString()]).sort(function(A,D){var I=isNaN(Number(A))?0:Number(A),B=isNaN(Number(D))?0:Number(D);return I-B})}},{key:"render",value:function(){var l=this,S=this.props,O=S.pageSize,A=S.locale,D=S.rootPrefixCls,I=S.changeSize,B=S.quickGo,H=S.goButton,te=S.selectComponentClass,W=S.buildOptionText,V=S.selectPrefixCls,X=S.disabled,ne=this.state.goInputText,$="".concat(D,"-options"),ee=te,ce=null,de=null,Ce=null;if(!I&&!B)return null;var Se=this.getPageSizeOptions();if(I&&ee){var De=Se.map(function(be,_e){return c.a.createElement(ee.Option,{key:_e,value:be.toString()},(W||l.buildOptionText)(be))});ce=c.a.createElement(ee,{disabled:X,prefixCls:V,showSearch:!1,className:"".concat($,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(O||Se[0]).toString(),onChange:this.changeSize,getPopupContainer:function(_e){return _e.parentNode}},De)}return B&&(H&&(Ce=typeof H=="boolean"?c.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:X,className:"".concat($,"-quick-jumper-button")},A.jump_to_confirm):c.a.createElement("span",{onClick:this.go,onKeyUp:this.go},H)),de=c.a.createElement("div",{className:"".concat($,"-quick-jumper")},A.jump_to,c.a.createElement("input",{disabled:X,type:"text",value:ne,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),A.page,Ce)),c.a.createElement("li",{className:"".concat($)},ce,de)}}]),y}(c.a.Component);s.defaultProps={pageSizeOptions:["10","20","50","100"]};var f=s,i=z("N2Kk");function n(){}function t(E){return typeof E=="number"&&isFinite(E)&&Math.floor(E)===E}function h(E,m,y){return y}function v(E,m,y){var x=typeof E=="undefined"?m.pageSize:E;return Math.floor((y.total-1)/x)+1}var g=function(E){Object(_.a)(y,E);var m=Object(T.a)(y);function y(x){var l;Object(w.a)(this,y),l=m.call(this,x),l.getJumpPrevPage=function(){return Math.max(1,l.state.current-(l.props.showLessItems?3:5))},l.getJumpNextPage=function(){return Math.min(v(void 0,l.state,l.props),l.state.current+(l.props.showLessItems?3:5))},l.getItemIcon=function(I,B){var H=l.props.prefixCls,te=I||c.a.createElement("button",{type:"button","aria-label":B,className:"".concat(H,"-item-link")});return typeof I=="function"&&(te=c.a.createElement(I,Object(j.a)({},l.props))),te},l.savePaginationNode=function(I){l.paginationNode=I},l.isValid=function(I){return t(I)&&I!==l.state.current},l.shouldDisplayQuickJumper=function(){var I=l.props,B=I.showQuickJumper,H=I.pageSize,te=I.total;return te<=H?!1:B},l.handleKeyDown=function(I){(I.keyCode===d.ARROW_UP||I.keyCode===d.ARROW_DOWN)&&I.preventDefault()},l.handleKeyUp=function(I){var B=l.getValidValue(I),H=l.state.currentInputValue;B!==H&&l.setState({currentInputValue:B}),I.keyCode===d.ENTER?l.handleChange(B):I.keyCode===d.ARROW_UP?l.handleChange(B-1):I.keyCode===d.ARROW_DOWN&&l.handleChange(B+1)},l.changePageSize=function(I){var B=l.state.current,H=v(I,l.state,l.props);B=B>H?H:B,H===0&&(B=l.state.current),typeof I=="number"&&("pageSize"in l.props||l.setState({pageSize:I}),"current"in l.props||l.setState({current:B,currentInputValue:B})),l.props.onShowSizeChange(B,I),"onChange"in l.props&&l.props.onChange&&l.props.onChange(B,I)},l.handleChange=function(I){var B=l.props.disabled,H=I;if(l.isValid(H)&&!B){var te=v(void 0,l.state,l.props);H>te?H=te:H<1&&(H=1),"current"in l.props||l.setState({current:H,currentInputValue:H});var W=l.state.pageSize;return l.props.onChange(H,W),H}return l.state.current},l.prev=function(){l.hasPrev()&&l.handleChange(l.state.current-1)},l.next=function(){l.hasNext()&&l.handleChange(l.state.current+1)},l.jumpPrev=function(){l.handleChange(l.getJumpPrevPage())},l.jumpNext=function(){l.handleChange(l.getJumpNextPage())},l.hasPrev=function(){return l.state.current>1},l.hasNext=function(){return l.state.current2?H-2:0),W=2;W=O?D=O:D=Number(S),D}},{key:"getShowSizeChanger",value:function(){var l=this.props,S=l.showSizeChanger,O=l.total,A=l.totalBoundaryShowSizeChanger;return typeof S!="undefined"?S:O>A}},{key:"renderPrev",value:function(l){var S=this.props,O=S.prevIcon,A=S.itemRender,D=A(l,"prev",this.getItemIcon(O,"prev page")),I=!this.hasPrev();return Object(C.isValidElement)(D)?Object(C.cloneElement)(D,{disabled:I}):D}},{key:"renderNext",value:function(l){var S=this.props,O=S.nextIcon,A=S.itemRender,D=A(l,"next",this.getItemIcon(O,"next page")),I=!this.hasNext();return Object(C.isValidElement)(D)?Object(C.cloneElement)(D,{disabled:I}):D}},{key:"render",value:function(){var l=this,S=this.props,O=S.prefixCls,A=S.className,D=S.style,I=S.disabled,B=S.hideOnSinglePage,H=S.total,te=S.locale,W=S.showQuickJumper,V=S.showLessItems,X=S.showTitle,ne=S.showTotal,$=S.simple,ee=S.itemRender,ce=S.showPrevNextJumpers,de=S.jumpPrevIcon,Ce=S.jumpNextIcon,Se=S.selectComponentClass,De=S.selectPrefixCls,be=S.pageSizeOptions,_e=this.state,Ke=_e.current,Ne=_e.pageSize,Be=_e.currentInputValue;if(B===!0&&H<=Ne)return null;var ze=v(void 0,this.state,this.props),ye=[],pe=null,We=null,He=null,nt=null,re=null,k=W&&W.goButton,U=V?1:2,q=Ke-1>0?Ke-1:0,Y=Ke+1=U*2&&Ke!==1+2&&(ye[0]=Object(C.cloneElement)(ye[0],{className:"".concat(O,"-item-after-jump-prev")}),ye.unshift(pe)),ze-Ke>=U*2&&Ke!==ze-2&&(ye[ye.length-1]=Object(C.cloneElement)(ye[ye.length-1],{className:"".concat(O,"-item-before-jump-next")}),ye.push(We)),tt!==1&&ye.unshift(He),mt!==ze&&ye.push(nt)}var Fe=null;ne&&(Fe=c.a.createElement("li",{className:"".concat(O,"-total-text")},ne(H,[H===0?0:(Ke-1)*Ne+1,Ke*Ne>H?H:Ke*Ne])));var Ie=!this.hasPrev()||!ze,Me=!this.hasNext()||!ze;return c.a.createElement("ul",Object(le.a)({className:u()(O,A,Object(Q.a)({},"".concat(O,"-disabled"),I)),style:D,unselectable:"unselectable",ref:this.savePaginationNode},J),Fe,c.a.createElement("li",{title:X?te.prev_page:null,onClick:this.prev,tabIndex:Ie?null:0,onKeyPress:this.runIfEnterPrev,className:u()("".concat(O,"-prev"),Object(Q.a)({},"".concat(O,"-disabled"),Ie)),"aria-disabled":Ie},this.renderPrev(q)),ye,c.a.createElement("li",{title:X?te.next_page:null,onClick:this.next,tabIndex:Me?null:0,onKeyPress:this.runIfEnterNext,className:u()("".concat(O,"-next"),Object(Q.a)({},"".concat(O,"-disabled"),Me)),"aria-disabled":Me},this.renderNext(Y)),c.a.createElement(f,{disabled:I,locale:te,rootPrefixCls:O,selectComponentClass:Se,selectPrefixCls:De,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:Ke,pageSize:Ne,pageSizeOptions:be,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:k}))}}],[{key:"getDerivedStateFromProps",value:function(l,S){var O={};if("current"in l&&(O.current=l.current,l.current!==S.current&&(O.currentInputValue=O.current)),"pageSize"in l&&l.pageSize!==S.pageSize){var A=S.current,D=v(l.pageSize,S,l);A=A>D?D:A,"current"in l||(O.current=A,O.currentInputValue=A),O.pageSize=l.pageSize}return O}}]),y}(c.a.Component);g.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:n,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:n,locale:i.a,style:{},itemRender:h,totalBoundaryShowSizeChanger:50};var b=g},"6RRn":function(et,Ve,z){"use strict";var le=z("wCXF"),Q=z("n6Qo");z.d(Ve,"b",function(){return Q.a});var j=z("IBYe"),w=z("6eGT"),P=z("hW8S");z.d(Ve,"a",function(){return P.a}),Ve.c=le.b},"6eGT":function(et,Ve,z){"use strict";function le(Q){return null}Ve.a=le},"7+5b":function(et,Ve,z){et.exports=z.p+"static/v.e7f297d6.svg"},"7Cbv":function(et,Ve,z){"use strict";var le=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),Q=new Uint8Array(16);function j(){if(!le)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return le(Q)}var w=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function P(a){return typeof a=="string"&&w.test(a)}for(var _=P,T=[],C=0;C<256;++C)T.push((C+256).toString(16).substr(1));function c(a){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=(T[a[d+0]]+T[a[d+1]]+T[a[d+2]]+T[a[d+3]]+"-"+T[a[d+4]]+T[a[d+5]]+"-"+T[a[d+6]]+T[a[d+7]]+"-"+T[a[d+8]]+T[a[d+9]]+"-"+T[a[d+10]]+T[a[d+11]]+T[a[d+12]]+T[a[d+13]]+T[a[d+14]]+T[a[d+15]]).toLowerCase();if(!_(s))throw TypeError("Stringified UUID is invalid");return s}var p=c;function u(a,d,s){a=a||{};var f=a.random||(a.rng||j)();if(f[6]=f[6]&15|64,f[8]=f[8]&63|128,d){s=s||0;for(var i=0;i<16;++i)d[s+i]=f[i];return d}return p(f)}var o=Ve.a=u},"7ahc":function(et,Ve,z){"use strict";z.d(Ve,"a",function(){return v});var le=z("k1fw"),Q=z("0Owb"),j=z("+L6B"),w=z("2/Rp"),P=z("y8nQ"),_=z("Vl3Y"),T=z("tJVT"),C=z("OaEy"),c=z("2fM7"),p=z("q1tI"),u=z.n(p),o=z("VrN/"),a=z.n(o),d=z("p77/"),s=z.n(d),f=z("c5Ni"),i=z.n(f),n=c.a.Option,t={labelCol:{span:4},wrapperCol:{span:20}},h={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};Ve.b=function(g){var b=g.callback,E=g.onCancel,m=Object(p.useState)("python"),y=Object(T.a)(m,2),x=y[0],l=y[1];function S(A){l(h[A][1])}function O(A){b(A)}return u.a.createElement(_.a,Object(Q.a)({},t,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:O}),u.a.createElement(_.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},u.a.createElement(c.a,{onChange:S},Object.keys(h).map(function(A){return u.a.createElement(n,{key:A,value:A},h[A][0])}))),u.a.createElement(_.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},u.a.createElement(v,{mode:x})),u.a.createElement("div",{className:"flex-container flex-end"},u.a.createElement(w.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),u.a.createElement(w.a,{type:"ghost",onClick:E},"\u53D6\u6D88")))};function v(g){var b=g.value,E=g.onChange,m=g.mode,y=g.options,x=y===void 0?{}:y,l=Object(p.useRef)(),S=Object(p.useState)(),O=Object(T.a)(S,2),A=O[0],D=O[1];return Object(p.useEffect)(function(){if(A){function I(B){var H=B.getValue();E&&E(H)}return A.on("change",I),function(){A.off("change",I)}}},[A,E]),Object(p.useEffect)(function(){A&&A.setOption("mode",m)},[A,m]),Object(p.useEffect)(function(){A&&((b!==A.getValue()||b==="")&&setTimeout(function(){A.setValue(b||" ")},300))},[A,b]),Object(p.useEffect)(function(){if(l.current&&!A){var I=a.a.fromTextArea(l.current,Object(le.a)({mode:m,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},x));D(I)}},[l.current,A]),u.a.createElement("div",{className:"my-codemirror-container"},u.a.createElement("textarea",{ref:l}))}},"7ixt":function(et,Ve,z){"use strict";z.d(Ve,"a",function(){return j});var le={adjustX:1,adjustY:1},Q=[0,0],j={left:{points:["cr","cl"],overflow:le,offset:[-4,0],targetOffset:Q},right:{points:["cl","cr"],overflow:le,offset:[4,0],targetOffset:Q},top:{points:["bc","tc"],overflow:le,offset:[0,-4],targetOffset:Q},bottom:{points:["tc","bc"],overflow:le,offset:[0,4],targetOffset:Q},topLeft:{points:["bl","tl"],overflow:le,offset:[0,-4],targetOffset:Q},leftTop:{points:["tr","tl"],overflow:le,offset:[-4,0],targetOffset:Q},topRight:{points:["br","tr"],overflow:le,offset:[0,-4],targetOffset:Q},rightTop:{points:["tl","tr"],overflow:le,offset:[4,0],targetOffset:Q},bottomRight:{points:["tr","br"],overflow:le,offset:[0,4],targetOffset:Q},rightBottom:{points:["bl","br"],overflow:le,offset:[4,0],targetOffset:Q},bottomLeft:{points:["tl","bl"],overflow:le,offset:[0,4],targetOffset:Q},leftBottom:{points:["br","bl"],overflow:le,offset:[-4,0],targetOffset:Q}},w=j},"7qur":function(et,Ve,z){"use strict";z.d(Ve,"m",function(){return Q}),z.d(Ve,"s",function(){return j}),z.d(Ve,"h",function(){return w}),z.d(Ve,"o",function(){return P}),z.d(Ve,"n",function(){return _}),z.d(Ve,"l",function(){return T}),z.d(Ve,"b",function(){return C}),z.d(Ve,"q",function(){return c}),z.d(Ve,"t",function(){return p}),z.d(Ve,"v",function(){return u}),z.d(Ve,"w",function(){return o}),z.d(Ve,"u",function(){return a}),z.d(Ve,"p",function(){return d}),z.d(Ve,"f",function(){return s}),z.d(Ve,"a",function(){return f}),z.d(Ve,"j",function(){return i}),z.d(Ve,"k",function(){return n}),z.d(Ve,"d",function(){return t}),z.d(Ve,"g",function(){return h}),z.d(Ve,"c",function(){return v}),z.d(Ve,"e",function(){return g}),z.d(Ve,"i",function(){return b}),z.d(Ve,"r",function(){return E});var le=z("ErOA");function Q(m){return Object(le.c)("mypractices/".concat(m,".json"),{hidePopLogin:!0})}function j(m,y){return Object(le.f)("mypractices/".concat(m,"/code_submit.json"),y)}function w(m,y){return Object(le.c)("mypractices/".concat(m,"/code_debug.json"),y)}function P(m,y){return Object(le.c)("mypractices/".concat(m,"/submit_records.json"),y)}function _(m){return Object(le.c)("mypractices/record_detail.json",{id:m})}function T(m,y){return Object(le.c)("mypractices/".concat(m,"/result.json"),{mode:y})}function C(m,y){return Object(le.f)("mypractices/".concat(m,"/add_notes.json"),y)}function c(m,y){return Object(le.f)("mypractices/".concat(m,"/restore_initial_code.json"),y)}function p(m,y){return Object(le.f)("mypractices/".concat(m,"/sync_code.json"),y)}function u(m,y){return Object(le.f)("mypractices/".concat(m,"/update_code.json"),y)}function o(m){return Object(le.f)("mypractices/".concat(m,"/initial_codes.json"))}function a(m,y){return Object(le.f)("discusses/".concat(m,"/plus.json"),y)}function d(m){return Object(le.c)("practices/practices_list.json",m)}function s(m,y){return Object(le.c)("practices/".concat(m,"/question_solution_articles"),y)}function f(m,y){return Object(le.f)("practices/".concat(m,"/question_solution_articles"),y)}function i(m,y){return Object(le.g)("practices/".concat(m,"/question_solution_articles/").concat(y==null?void 0:y.active),y)}function n(m,y){return Object(le.c)("practices/".concat(m,"/question_solution_articles/").concat(y==null?void 0:y.active,"/edit"),y)}function t(m,y){return Object(le.c)("practices/".concat(m,"/question_solution_articles/").concat(y==null?void 0:y.active),y)}function h(m,y){return Object(le.f)("practices/".concat(m,"/question_solution_articles/").concat(y==null?void 0:y.active,"/set_authority_or_excellent"),y)}function v(m,y){return Object(le.f)("practices/".concat(m,"/question_solution_articles/").concat(y==null?void 0:y.active,"/praise_or_treads"),y)}function g(m,y){return Object(le.f)("practices/".concat(m,"/question_solution_articles/").concat(y==null?void 0:y.active,"/hide"))}function b(m,y){return Object(le.b)("practices/".concat(m,"/question_solution_articles/").concat(y==null?void 0:y.active),y)}function E(m,y){return Object(le.f)("mypractices/".concat(m,"/update_practice_time_sum"),y)}},"815F":function(et,Ve,z){"use strict";z.d(Ve,"e",function(){return T}),z.d(Ve,"c",function(){return c}),z.d(Ve,"d",function(){return p}),z.d(Ve,"a",function(){return o}),z.d(Ve,"f",function(){return a}),z.d(Ve,"b",function(){return d});var le=z("KQm4"),Q=z("VTBJ"),j=z("Ff2n"),w=z("Zm9Q"),P=z("Kwbf"),_=z("OZM5");function T(s,f){return s!=null?s:f}function C(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],f=new Map;function i(n){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(n||[]).forEach(function(h){var v=h.key,g=h.children;Object(P.a)(v!=null,"Tree node must have a certain key: [".concat(t).concat(v,"]"));var b=String(v);Object(P.a)(!f.has(b)||v===null||v===void 0,"Same 'key' exist in the Tree: ".concat(b)),f.set(b,!0),i(g,"".concat(t).concat(b," > "))})}i(s)}function c(s){function f(i){var n=Object(w.a)(i);return n.map(function(t){if(!Object(_.i)(t))return Object(P.a)(!t,"Tree/TreeNode can only accept TreeNode as children."),null;var h=t.key,v=t.props,g=v.children,b=Object(j.a)(v,["children"]),E=Object(Q.a)({key:h},b),m=f(g);return m.length&&(E.children=m),E}).filter(function(t){return t})}return f(s)}function p(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=new Set(f===!0?[]:f),n=[];function t(h){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return h.map(function(g,b){var E=Object(_.h)(v?v.pos:"0",b),m=T(g.key,E),y=Object(Q.a)(Object(Q.a)({},g),{},{parent:v,pos:E,children:null,data:g,isStart:[].concat(Object(le.a)(v?v.isStart:[]),[b===0]),isEnd:[].concat(Object(le.a)(v?v.isEnd:[]),[b===h.length-1])});return n.push(y),f===!0||i.has(m)?y.children=t(g.children||[],y):y.children=[],y})}return t(s),n}function u(s,f,i){var n;i?typeof i=="string"?n=function(v){return v[i]}:typeof i=="function"&&(n=function(v){return i(v)}):n=function(v,g){return T(v.key,g)};function t(h,v,g){var b=h?h.children:s,E=h?Object(_.h)(g.pos,v):"0";if(h){var m=n(h,E),y={node:h,index:v,pos:E,key:m,parentPos:g.node?g.pos:null,level:g.level+1};f(y)}b&&b.forEach(function(x,l){t(x,l,{node:h,pos:E,level:g?g.level+1:-1})})}t(null)}function o(s){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=f.initWrapper,n=f.processEntity,t=f.onProcessFinished,h=arguments.length>2?arguments[2]:void 0,v={},g={},b={posEntities:v,keyEntities:g};return i&&(b=i(b)||b),u(s,function(E){var m=E.node,y=E.index,x=E.pos,l=E.key,S=E.parentPos,O=E.level,A={node:m,index:y,key:l,pos:x,level:O},D=T(l,x);v[x]=A,g[D]=A,A.parent=v[S],A.parent&&(A.parent.children=A.parent.children||[],A.parent.children.push(A)),n&&n(A,b)},h),t&&t(b),b}function a(s,f){var i=f.expandedKeys,n=f.selectedKeys,t=f.loadedKeys,h=f.loadingKeys,v=f.checkedKeys,g=f.halfCheckedKeys,b=f.dragOverNodeKey,E=f.dropPosition,m=f.keyEntities,y=m[s],x={eventKey:s,expanded:i.indexOf(s)!==-1,selected:n.indexOf(s)!==-1,loaded:t.indexOf(s)!==-1,loading:h.indexOf(s)!==-1,checked:v.indexOf(s)!==-1,halfChecked:g.indexOf(s)!==-1,pos:String(y?y.pos:""),dragOver:b===s&&E===0,dragOverGapTop:b===s&&E===-1,dragOverGapBottom:b===s&&E===1};return x}function d(s){var f=s.data,i=s.expanded,n=s.selected,t=s.checked,h=s.loaded,v=s.loading,g=s.halfChecked,b=s.dragOver,E=s.dragOverGapTop,m=s.dragOverGapBottom,y=s.pos,x=s.active,l=Object(Q.a)(Object(Q.a)({},f),{},{expanded:i,selected:n,checked:t,loaded:h,loading:v,halfChecked:g,dragOver:b,dragOverGapTop:E,dragOverGapBottom:m,pos:y,active:x});return"props"in l||Object.defineProperty(l,"props",{get:function(){return Object(P.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),s}}),l}},"8EBN":function(et,Ve,z){(function(le){le(z("VrN/"))})(function(le){"use strict";le.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var Q=0;Q-1&&w.substring(T+1,w.length);if(C)return le.findModeByExtension(C)},le.findModeByName=function(w){w=w.toLowerCase();for(var P=0;P=ae.length?me.slice(ae.length):me}).join(` `)}var i=[],n=["
    "],t=new d.a.Renderer,h=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function v(){i.length=0,n=["
      "]}var g={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function b(ie,N,F,ae){if(N>=ie.length||ie[N].level<=F)return N;var me=ie[N];ae.push("
    • "+me.text+""),N++;var se=[];return N=b(ie,N,me.level,se),se.length>0&&(ae.push("
        "),se.forEach(function($e){ae.push($e)}),ae.push("
      ")),ae.push("
    • "),N=b(ie,N,F,ae),N}function E(){return b(i,0,0,n),n.push("
    "),n.join("")}var m={heading:function(N){var F=h.exec(N);if(F)return{type:"heading",raw:F[0],depth:F[1].length,text:F[2]}},fences:function(N){var F=this.rules.block.fences.exec(N);if(F){var ae=F[0],me=f(ae,F[3]||""),se=F[2]?F[2].trim():F[2];if(["latex","katex","math"].indexOf(se)>=0){var $e=l(),Et=me;me=$e,S[$e]={type:"block",expression:Et}}return{type:"code",raw:ae,lang:se,text:me}}}},y=/(?:\${2})([^\n`]+?)(?:\${2})/gi,x=0,l=function(){return"__special_katext_id_".concat(x++,"__")},S={};function O(){return S}function A(){x=0,S={}}function D(ie){return ie=ie.replace(y,function(N,F){var ae=l();return S[ae]={type:"inline",expression:F},ae}),ie}var I=t.listitem;t.listitem=function(ie){return I(D(ie))};var B=t.paragraph;t.paragraph=function(ie){return B(D(ie))};var H=t.tablecell;t.tablecell=function(ie,N){return H(D(ie),N)},t.code=function(ie,N,F){var ae=(N||"").match(/\S*/)[0];return ae?["latex","katex","math"].indexOf(ae)>=0?"

    ".concat(ie,"

    "):'
    ').concat(F?ie:Object(s.escape)(ie,!0),`
    `):'
    '+(F?ie:Object(s.escape)(ie,!0))+"
    "},t.heading=function(ie,N,F){var ae=this.options.headerPrefix+F.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return i.push({anchor:ae,level:N,text:ie}),"'+ie+""},d.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),d.a.use({tokenizer:m,renderer:t});var te=d.a,W=z("SJMd"),V=z("ulZh"),X=z.n(V),ne=z("m3rI"),$=z("Oy/b"),ee=z("p5ED"),ce=z("ErOA");/*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */var de=function(ie,N){return(de=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(F,ae){F.__proto__=ae}||function(F,ae){for(var me in ae)Object.prototype.hasOwnProperty.call(ae,me)&&(F[me]=ae[me])})(ie,N)};function Ce(ie,N){function F(){this.constructor=ie}de(ie,N),ie.prototype=N===null?Object.create(N):(F.prototype=N.prototype,new F)}function Se(ie,N,F,ae){return new(F||(F=Promise))(function(me,se){function $e(Vt){try{it(ae.next(Vt))}catch(At){se(At)}}function Et(Vt){try{it(ae.throw(Vt))}catch(At){se(At)}}function it(Vt){var At;Vt.done?me(Vt.value):(At=Vt.value,At instanceof F?At:new F(function(Ft){Ft(At)})).then($e,Et)}it((ae=ae.apply(ie,N||[])).next())})}function De(ie,N){var F,ae,me,se,$e={label:0,sent:function(){if(1&me[0])throw me[1];return me[1]},trys:[],ops:[]};return se={next:Et(0),throw:Et(1),return:Et(2)},typeof Symbol=="function"&&(se[Symbol.iterator]=function(){return this}),se;function Et(it){return function(Vt){return function(At){if(F)throw new TypeError("Generator is already executing.");for(;$e;)try{if(F=1,ae&&(me=2&At[0]?ae.return:At[0]?ae.throw||((me=ae.return)&&me.call(ae),0):ae.next)&&!(me=me.call(ae,At[1])).done)return me;switch(ae=0,me&&(At=[2&At[0],me.value]),At[0]){case 0:case 1:me=At;break;case 4:return $e.label++,{value:At[1],done:!1};case 5:$e.label++,ae=At[1],At=[0];continue;case 7:At=$e.ops.pop(),$e.trys.pop();continue;default:if(!(me=$e.trys,(me=me.length>0&&me[me.length-1])||At[0]!==6&&At[0]!==2)){$e=0;continue}if(At[0]===3&&(!me||At[1]>me[0]&&At[1]',"select"),this.addActionButton(ae,'',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(ae,'',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(ae,'',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(ae,'',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(ae,'',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(ae,'',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(ae,'',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function(se){var $e=document.createElement("div");$e.className=""+F.toolbarButtonStyleClass.name,$e.setAttribute("data-type-name",se.typeName),$e.innerHTML=se.icon,$e.addEventListener("click",function(){F.markerToolbarButtonClicked($e,se)}),F.buttons.push($e),F.markerButtons.push($e)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var me=document.createElement("div");me.className=this.toolbarBlockStyleClass.name,me.style.whiteSpace="nowrap",me.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(me),this.addActionButton(me,'',"render"),this.addActionButton(me,'',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},ie.prototype.addButtonClickListener=function(N){this.buttonClickListeners.push(N)},ie.prototype.removeButtonClickListener=function(N){this.buttonClickListeners.indexOf(N)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(N),1)},ie.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},ie.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var N=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var F=0;F0&&this.buttonClickListeners.forEach(function(ae){return ae("marker",F)}),this.markerButtonOverflowBlock.style.display="none"},ie.prototype.actionToolbarButtonClicked=function(N,F){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(ae){return ae("action",F)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},ie.prototype.setActiveButton=function(N){this.resetButtonStyles(),N.className=N.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),N.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},ie.prototype.setActiveMarkerButton=function(N){var F=this.markerButtons.find(function(ae){return ae.getAttribute("data-type-name")===N});F&&this.setActiveButton(F)},ie.prototype.setCurrentMarker=function(N){var F=this;this.currentMarker=N,this.buttons.filter(function(ae){return/delete|notes/.test(ae.getAttribute("data-action"))}).forEach(function(ae){F.currentMarker===void 0?(ae.style.fillOpacity="0.4",ae.style.pointerEvents="none"):(ae.style.fillOpacity="1",ae.style.pointerEvents="all")})},ie}(),He=function(){function ie(N,F,ae,me){this.panels=[],this.panelButtons=[],this.markerjsContainer=N,this.displayMode=F,this.uiStyleSettings=ae,this.styles=me,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return ie.prototype.addStyles=function(){var N;this.toolboxStyleClass=this.styles.addClass(new pe("toolbox",` width: 100%; flex-shrink: 0; display: flex; flex-direction: column; font-family: sans-serif; `+(this.displayMode==="popup"?"height:"+2.5*this.uiStyleSettings.toolbarHeight+"px;":"")+` box-sizing: content-box; `+(this.displayMode==="popup"?"background-color: "+this.uiStyleSettings.canvasBackgroundColor+";":"")+` `+(this.displayMode==="inline"?"border-bottom-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+` `+(this.displayMode==="inline"?"border-bottom-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+` overflow: hidden; `)),this.toolboxStyleColorsClass=this.styles.addClass(new pe("toolbox_colors",` color: `+this.uiStyleSettings.toolboxColor+`; `));var F=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new pe("toolbox-button-row",` display: flex; cursor: default; box-sizing: content-box; `)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new pe("toolbox-button-row_colors",` background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`; `)),this.toolboxPanelRowStyleClass=this.styles.addClass(new pe("toolbox-panel-row",` display: flex; `+(this.displayMode==="inline"?"position: absolute;":"")+` `+(this.displayMode==="inline"?"bottom: "+this.uiStyleSettings.toolbarHeight+"px;":"")+` cursor: default; height: `+1.5*this.uiStyleSettings.toolbarHeight+`px; `+(this.displayMode==="inline"?"width: 100%;":"")+` box-sizing: content-box; `)),this.toolboxPanelRowStyleColorsClass=this.styles.addClass(new pe("toolbox-panel-row_colors",` background-color: `+((N=this.uiStyleSettings.toolboxBackgroundColor)!==null&&N!==void 0?N:this.uiStyleSettings.toolbarBackgroundHoverColor)+`; `)),this.toolboxButtonStyleClass=this.styles.addClass(new pe("toolbox_button",` display: inline-block; width: `+(this.uiStyleSettings.toolbarHeight-2*F)+`px; height: `+(this.uiStyleSettings.toolbarHeight-2*F)+`px; padding: `+F+`px; box-sizing: content-box; `)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new pe("toolbox-button_colors",` fill: `+this.uiStyleSettings.toolbarColor+`; `)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new pe("toolbox-active-button_colors",` background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`; fill: `+this.uiStyleSettings.toolbarColor+`; `)),this.styles.addRule(new ye("."+this.toolboxButtonStyleColorsClass.name+":hover",` background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+` `)),this.styles.addRule(new ye("."+this.toolboxButtonStyleClass.name+" svg",` height: `+this.uiStyleSettings.toolbarHeight/2+`px; `))},ie.prototype.show=function(N){var F;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=N,this.uiContainer.className=this.toolboxStyleClass.name+" "+((F=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&F!==void 0?F:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},ie.prototype.setPanelButtons=function(N){var F,ae,me=this;this.panels=N,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((F=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&F!==void 0?F:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((ae=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&ae!==void 0?ae:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(se){var $e;se.uiStyleSettings=me.uiStyleSettings;var Et=document.createElement("div");Et.className=me.toolboxButtonStyleClass.name+" "+(($e=me.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&$e!==void 0?$e:me.toolboxButtonStyleColorsClass.name),Et.innerHTML=se.icon,Et.title=se.title,Et.addEventListener("click",function(){me.panelButtonClick(se)}),me.panelButtons.push(Et),me.buttonRow.appendChild(Et)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},ie.prototype.panelButtonClick=function(N){var F=this,ae=-1;if(N!==this.activePanel){ae=this.panels.indexOf(N),this.panelRow.innerHTML="";var me=N.getUi();me.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(me),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=N}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){F.displayMode==="inline"?F.panelRow.style.display="none":F.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(se,$e){var Et,it;se.className=F.toolboxButtonStyleClass.name+" "+($e===ae?""+((Et=F.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Et!==void 0?Et:F.toolboxActiveButtonStyleColorsClass.name):""+((it=F.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&it!==void 0?it:F.toolboxButtonStyleColorsClass.name))})},ie}(),nt=function(ie,N){this.title=ie,this.icon=N},re=function(ie){function N(F,ae,me,se){var $e=ie.call(this,F,se||'')||this;return $e.colors=[],$e.addTransparent=!1,$e.colorBoxes=[],$e.colors=ae,$e.currentColor=me,$e.setCurrentColor=$e.setCurrentColor.bind($e),$e.getColorBox=$e.getColorBox.bind($e),$e}return Ce(N,ie),N.prototype.getUi=function(){var F=this,ae=document.createElement("div");return ae.style.overflow="hidden",ae.style.whiteSpace="nowrap",this.colors.forEach(function(me){var se=F.getColorBox(me);ae.appendChild(se),F.colorBoxes.push(se)}),ae},N.prototype.getColorBox=function(F){var ae=this,me=this.uiStyleSettings.toolbarHeight/4,se=this.uiStyleSettings.toolbarHeight-me,$e=document.createElement("div");$e.style.display="inline-block",$e.style.boxSizing="content-box",$e.style.width=se-2+"px",$e.style.height=se-2+"px",$e.style.padding="1px",$e.style.marginRight="2px",$e.style.marginBottom="2px",$e.style.borderWidth="2px",$e.style.borderStyle="solid",$e.style.borderRadius=(se+2)/2+"px",$e.style.borderColor=F===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",$e.addEventListener("click",function(){ae.setCurrentColor(F,$e)});var Et=document.createElement("div");return Et.style.display="inline-block",Et.style.width=se-2+"px",Et.style.height=se-2+"px",Et.style.backgroundColor=F,Et.style.borderRadius=se/2+"px",F==="transparent"&&(Et.style.fill=this.uiStyleSettings.toolboxAccentColor,Et.innerHTML=` `),$e.appendChild(Et),$e},N.prototype.setCurrentColor=function(F,ae){var me=this;this.currentColor=F,this.colorBoxes.forEach(function(se){se.style.borderColor=se===ae?me.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(F)},N}(nt),k=function(){function ie(N,F,ae){this._state="new",this._isSelected=!1,this._container=N,this._overlayContainer=F,this.globalSettings=ae,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(ie.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),ie.prototype.ownsTarget=function(N){return!1},Object.defineProperty(ie.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),ie.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},ie.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},ie.prototype.pointerDown=function(N,F){},ie.prototype.dblClick=function(N,F){},ie.prototype.manipulate=function(N){},ie.prototype.pointerUp=function(N){this.stateChanged()},ie.prototype.dispose=function(){},ie.prototype.addMarkerVisualToContainer=function(N){this.container.childNodes.length>0?this.container.insertBefore(N,this.container.childNodes[0]):this.container.appendChild(N)},ie.prototype.getState=function(){return{typeName:ie.typeName,state:this.state,notes:this.notes}},ie.prototype.restoreState=function(N){this._state=N.state,this.notes=N.notes},ie.prototype.scale=function(N,F){},ie.prototype.colorChanged=function(N){this.onColorChanged&&this.onColorChanged(N),this.stateChanged()},ie.prototype.fillColorChanged=function(N){this.onFillColorChanged&&this.onFillColorChanged(N),this.stateChanged()},ie.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var N=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),N.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(N)&&this.onStateChanged(this)}},ie.typeName="MarkerBase",ie}(),U=function(){function ie(){this.findGripByVisual=this.findGripByVisual.bind(this)}return ie.prototype.findGripByVisual=function(N){return this.topLeft.ownsTarget(N)?this.topLeft:this.topCenter.ownsTarget(N)?this.topCenter:this.topRight.ownsTarget(N)?this.topRight:this.centerLeft.ownsTarget(N)?this.centerLeft:this.centerRight.ownsTarget(N)?this.centerRight:this.bottomLeft.ownsTarget(N)?this.bottomLeft:this.bottomCenter.ownsTarget(N)?this.bottomCenter:this.bottomRight.ownsTarget(N)?this.bottomRight:void 0},ie}(),q=function(){function ie(){this.GRIP_SIZE=10,this.visual=_e.createGroup(),this.visual.appendChild(_e.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(_e.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return ie.prototype.ownsTarget=function(N){return N===this.visual||N===this.visual.childNodes[0]||N===this.visual.childNodes[1]},ie}(),Y=function(){function ie(){}return ie.toITransformMatrix=function(N){return{a:N.a,b:N.b,c:N.c,d:N.d,e:N.e,f:N.f}},ie.toSVGMatrix=function(N,F){return N.a=F.a,N.b=F.b,N.c=F.c,N.d=F.d,N.e=F.e,N.f=F.f,N},ie}(),J=function(ie){function N(F,ae,me){var se=ie.call(this,F,ae,me)||this;return se.left=0,se.top=0,se.width=0,se.height=0,se.defaultSize={x:50,y:20},se.offsetX=0,se.offsetY=0,se.rotationAngle=0,se.CB_DISTANCE=10,se._suppressMarkerCreateEvent=!1,se.container.transform.baseVal.appendItem(_e.createTransform()),se.setupControlBox(),se}return Ce(N,ie),Object.defineProperty(N.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"visual",{get:function(){return this._visual},set:function(F){this._visual=F;var ae=_e.createTransform();this._visual.transform.baseVal.appendItem(ae)},enumerable:!1,configurable:!0}),N.prototype.ownsTarget=function(F){return!!ie.prototype.ownsTarget.call(this,F)||!!(this.controlGrips.findGripByVisual(F)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(F))},N.prototype.pointerDown=function(F,ae){ie.prototype.pointerDown.call(this,F,ae),this.state==="new"&&(this.left=F.x,this.top=F.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var me=this.unrotatePoint(F);if(this.manipulationStartX=me.x,this.manipulationStartY=me.y,this.offsetX=me.x-this.left,this.offsetY=me.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(ae),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(ae)){this.activeGrip=this.rotatorGrip;var se=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=se.x-this.width/2,this.top=se.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var $e=this.container.transform.baseVal.getItem(0);$e.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem($e,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},N.prototype.pointerUp=function(F){var ae=this.state;ie.prototype.pointerUp.call(this,F),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(F),this._state="select",ae==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},N.prototype.moveVisual=function(F){this.visual.style.transform="translate("+F.x+"px, "+F.y+"px)"},N.prototype.manipulate=function(F){var ae=this.unrotatePoint(F);this.state==="creating"?this.resize(F):this.state==="move"?(this.left=this.manipulationStartLeft+(ae.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(ae.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(ae):this.state==="rotate"&&this.rotate(F)},N.prototype.resize=function(F){var ae=this.manipulationStartLeft,me=this.manipulationStartWidth,se=this.manipulationStartTop,$e=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:ae=this.manipulationStartLeft+F.x-this.manipulationStartX,me=this.manipulationStartWidth+this.manipulationStartLeft-ae;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:me=this.manipulationStartWidth+F.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:se=this.manipulationStartTop+F.y-this.manipulationStartY,$e=this.manipulationStartHeight+this.manipulationStartTop-se;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:$e=this.manipulationStartHeight+F.y-this.manipulationStartY}me>=0?(this.left=ae,this.width=me):(this.left=ae+me,this.width=-me),$e>=0?(this.top=se,this.height=$e):(this.top=se+$e,this.height=-$e),this.setSize()},N.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},N.prototype.rotate=function(F){if(Math.abs(F.x-this.centerX)>.1){var ae=Math.sign(F.x-this.centerX);this.rotationAngle=180*Math.atan((F.y-this.centerY)/(F.x-this.centerX))/Math.PI+90*ae,this.applyRotation()}},N.prototype.applyRotation=function(){var F=this.container.transform.baseVal.getItem(0);F.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(F,0)},N.prototype.rotatePoint=function(F){if(this.rotationAngle===0)return F;var ae=this.container.getCTM(),me=_e.createPoint(F.x,F.y);return{x:(me=me.matrixTransform(ae)).x,y:me.y}},N.prototype.unrotatePoint=function(F){if(this.rotationAngle===0)return F;var ae=this.container.getCTM();ae=ae.inverse();var me=_e.createPoint(F.x,F.y);return{x:(me=me.matrixTransform(ae)).x,y:me.y}},N.prototype.select=function(){ie.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},N.prototype.deselect=function(){ie.prototype.deselect.call(this),this.controlBox.style.display="none"},N.prototype.setupControlBox=function(){this.controlBox=_e.createGroup();var F=_e.createTransform();F.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(F),this.container.appendChild(this.controlBox),this.controlRect=_e.createRect(this.width+this.CB_DISTANCE,this.height+this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"],["fill","transparent"],["pointer-events","none"]]),this.controlBox.appendChild(this.controlRect),this.globalSettings.disableRotation!==!0&&(this.rotatorGripLine=_e.createLine((this.width+2*this.CB_DISTANCE)/2,this.top-this.CB_DISTANCE,(this.width+2*this.CB_DISTANCE)/2,this.top-3*this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.appendChild(this.rotatorGripLine)),this.controlGrips=new U,this.addControlGrips(),this.controlBox.style.display="none"},N.prototype.adjustControlBox=function(){var F=this.controlBox.transform.baseVal.getItem(0);F.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(F,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},N.prototype.addControlGrips=function(){this.controlGrips.topLeft=this.createGrip(),this.controlGrips.topCenter=this.createGrip(),this.controlGrips.topRight=this.createGrip(),this.controlGrips.centerLeft=this.createGrip(),this.controlGrips.centerRight=this.createGrip(),this.controlGrips.bottomLeft=this.createGrip(),this.controlGrips.bottomCenter=this.createGrip(),this.controlGrips.bottomRight=this.createGrip(),this.globalSettings.disableRotation!==!0&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},N.prototype.createGrip=function(){var F=new q;return F.visual.transform.baseVal.appendItem(_e.createTransform()),this.controlBox.appendChild(F.visual),F},N.prototype.positionGrips=function(){var F=this.controlGrips.topLeft.GRIP_SIZE,ae=-F/2,me=ae,se=(this.width+this.CB_DISTANCE)/2-F/2,$e=(this.height+this.CB_DISTANCE)/2-F/2,Et=this.height+this.CB_DISTANCE-F/2,it=this.width+this.CB_DISTANCE-F/2;this.positionGrip(this.controlGrips.topLeft.visual,ae,me),this.positionGrip(this.controlGrips.topCenter.visual,se,me),this.positionGrip(this.controlGrips.topRight.visual,it,me),this.positionGrip(this.controlGrips.centerLeft.visual,ae,$e),this.positionGrip(this.controlGrips.centerRight.visual,it,$e),this.positionGrip(this.controlGrips.bottomLeft.visual,ae,Et),this.positionGrip(this.controlGrips.bottomCenter.visual,se,Et),this.positionGrip(this.controlGrips.bottomRight.visual,it,Et),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,se,me-3*this.CB_DISTANCE)},N.prototype.positionGrip=function(F,ae,me){var se=F.transform.baseVal.getItem(0);se.setTranslate(ae,me),F.transform.baseVal.replaceItem(se,0)},N.prototype.hideControlBox=function(){this.controlBox.style.display="none"},N.prototype.showControlBox=function(){this.controlBox.style.display=""},N.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:Y.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:Y.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},ie.prototype.getState.call(this))},N.prototype.restoreState=function(F){ie.prototype.restoreState.call(this,F);var ae=F;this.left=ae.left,this.top=ae.top,this.width=ae.width,this.height=ae.height,this.rotationAngle=ae.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(Y.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,ae.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(Y.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,ae.containerTransformMatrix))},N.prototype.scale=function(F,ae){ie.prototype.scale.call(this,F,ae);var me=this.rotatePoint({x:this.left,y:this.top}),se=this.unrotatePoint({x:me.x*F,y:me.y*ae});this.left=se.x,this.top=se.y,this.width=this.width*F,this.height=this.height*ae,this.adjustControlBox()},N}(k),xe=function(ie){function N(F,ae,me){var se=ie.call(this,F,ae,me)||this;return se.fillColor="transparent",se.strokeColor="transparent",se.strokeWidth=0,se.strokeDasharray="",se.opacity=1,se.setStrokeColor=se.setStrokeColor.bind(se),se.setFillColor=se.setFillColor.bind(se),se.setStrokeWidth=se.setStrokeWidth.bind(se),se.setStrokeDasharray=se.setStrokeDasharray.bind(se),se.createVisual=se.createVisual.bind(se),se}return Ce(N,ie),N.prototype.ownsTarget=function(F){return!(!ie.prototype.ownsTarget.call(this,F)&&F!==this.visual)},N.prototype.createVisual=function(){this.visual=_e.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},N.prototype.pointerDown=function(F,ae){ie.prototype.pointerDown.call(this,F,ae),this.state==="new"&&(this.createVisual(),this.moveVisual(F),this._state="creating")},N.prototype.manipulate=function(F){ie.prototype.manipulate.call(this,F)},N.prototype.resize=function(F){ie.prototype.resize.call(this,F),this.setSize()},N.prototype.setSize=function(){ie.prototype.setSize.call(this),_e.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},N.prototype.pointerUp=function(F){ie.prototype.pointerUp.call(this,F),this.setSize()},N.prototype.setStrokeColor=function(F){this.strokeColor=F,this.visual&&_e.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(F),this.stateChanged()},N.prototype.setFillColor=function(F){this.fillColor=F,this.visual&&_e.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},N.prototype.setStrokeWidth=function(F){this.strokeWidth=F,this.visual&&_e.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},N.prototype.setStrokeDasharray=function(F){this.strokeDasharray=F,this.visual&&_e.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},N.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},ie.prototype.getState.call(this))},N.prototype.restoreState=function(F){var ae=F;this.fillColor=ae.fillColor,this.strokeColor=ae.strokeColor,this.strokeWidth=ae.strokeWidth,this.strokeDasharray=ae.strokeDasharray,this.opacity=ae.opacity,this.createVisual(),ie.prototype.restoreState.call(this,F),this.setSize()},N.prototype.scale=function(F,ae){ie.prototype.scale.call(this,F,ae),this.setSize()},N.title="Rectangle marker",N}(J),ke=function(ie){function N(F,ae,me,se){var $e=ie.call(this,F,se||'')||this;return $e.widths=[],$e.widthBoxes=[],$e.widths=ae,$e.currentWidth=me,$e.setCurrentWidth=$e.setCurrentWidth.bind($e),$e}return Ce(N,ie),N.prototype.getUi=function(){var F=this,ae=document.createElement("div");return ae.style.display="flex",ae.style.overflow="hidden",ae.style.flexGrow="2",this.widths.forEach(function(me){var se=document.createElement("div");se.style.display="flex",se.style.flexGrow="2",se.style.alignItems="center",se.style.justifyContent="space-between",se.style.padding="5px",se.style.borderWidth="2px",se.style.borderStyle="solid",se.style.borderColor=me===F.currentWidth?F.uiStyleSettings.toolboxAccentColor:"transparent",se.addEventListener("click",function(){F.setCurrentWidth(me,se)}),ae.appendChild(se);var $e=document.createElement("div");$e.innerText=me.toString(),$e.style.marginRight="5px",se.appendChild($e);var Et=document.createElement("div");Et.style.minHeight="20px",Et.style.flexGrow="2",Et.style.display="flex",Et.style.alignItems="center";var it=document.createElement("hr");it.style.minWidth="20px",it.style.border="0px",it.style.borderTop=me+"px solid "+F.uiStyleSettings.toolboxColor,it.style.flexGrow="2",Et.appendChild(it),se.appendChild(Et),F.widthBoxes.push(se)}),ae},N.prototype.setCurrentWidth=function(F,ae){var me=this;this.currentWidth=F,this.widthBoxes.forEach(function(se){se.style.borderColor=se===ae?me.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},N}(nt),dt=function(ie){function N(F,ae,me,se){var $e=ie.call(this,F,se||'')||this;return $e.styles=[],$e.styleBoxes=[],$e.styles=ae,$e.currentStyle=me,$e.setCurrentStyle=$e.setCurrentStyle.bind($e),$e}return Ce(N,ie),N.prototype.getUi=function(){var F=this,ae=document.createElement("div");return ae.style.display="flex",ae.style.overflow="hidden",ae.style.flexGrow="2",this.styles.forEach(function(me){var se=document.createElement("div");se.style.display="flex",se.style.alignItems="center",se.style.justifyContent="space-between",se.style.padding="5px",se.style.borderWidth="2px",se.style.borderStyle="solid",se.style.overflow="hidden",se.style.maxWidth=100/F.styles.length-5+"%",se.style.borderColor=me===F.currentStyle?F.uiStyleSettings.toolboxAccentColor:"transparent",se.addEventListener("click",function(){F.setCurrentStyle(me,se)}),ae.appendChild(se);var $e=document.createElement("div");$e.style.minHeight="20px",$e.style.flexGrow="2",$e.style.overflow="hidden";var Et=` `;$e.innerHTML=Et,se.appendChild($e),F.styleBoxes.push(se)}),ae},N.prototype.setCurrentStyle=function(F,ae){var me=this;this.currentStyle=F,this.styleBoxes.forEach(function(se){se.style.borderColor=se===ae?me.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},N}(nt),Ue=function(ie){function N(F,ae,me){var se=ie.call(this,F,ae,me)||this;return se.strokeColor=me.defaultColor,se.strokeWidth=me.defaultStrokeWidth,se.strokeDasharray=me.defaultStrokeDasharray,se.strokePanel=new re("Line color",me.defaultColorSet,me.defaultColor),se.strokePanel.onColorChanged=se.setStrokeColor,se.strokeWidthPanel=new ke("Line width",me.defaultStrokeWidths,me.defaultStrokeWidth),se.strokeWidthPanel.onWidthChanged=se.setStrokeWidth,se.strokeStylePanel=new dt("Line style",me.defaultStrokeDasharrays,me.defaultStrokeDasharray),se.strokeStylePanel.onStyleChanged=se.setStrokeDasharray,se}return Ce(N,ie),Object.defineProperty(N.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),N.prototype.getState=function(){var F=ie.prototype.getState.call(this);return F.typeName=N.typeName,F},N.typeName="FrameMarker",N.title="Frame marker",N.icon='',N}(xe),je=function(){this.defaultColorSet=["#EF4444","#10B981","#2563EB","#FFFF00","#7C3AED","#F472B6","#000000","#FFFFFF"],this.defaultColor=this.defaultColorSet[0],this.defaultFillColor=this.defaultColorSet[0],this.defaultStrokeColor=this.defaultColorSet[7],this.defaultHighlightColor=this.defaultColorSet[3],this.defaultStrokeWidth=3,this.defaultStrokeDasharray="",this.defaultHighlightOpacity=.5,this.defaultFontFamily="Helvetica, Arial, sans-serif",this.defaultStrokeWidths=[1,2,3,5,10],this.defaultStrokeDasharrays=["","3","12 3","9 6 3 6"],this.defaultOpacitySteps=[.1,.25,.5,.75,1],this.displayMode="inline",this.defaultFontFamilies=['Times, "Times New Roman", serif',"Helvetica, Arial, sans-serif",'Courier, "Courier New", monospace',"cursive","fantasy"],this.popupMargin=30,this.newFreehandMarkerOnPointerUp=!1,this.defaultColorsFollowCurrentColors=!1,this.freehandPixelRatio=1,this.disableRotation=!1},tt=function(ie){function N(F,ae,me){var se=ie.call(this,F,ae,me)||this;return se.x1=0,se.y1=0,se.x2=0,se.y2=0,se.defaultLength=50,se.manipulationStartX=0,se.manipulationStartY=0,se.manipulationStartX1=0,se.manipulationStartY1=0,se.manipulationStartX2=0,se.manipulationStartY2=0,se.setupControlBox(),se}return Ce(N,ie),N.prototype.ownsTarget=function(F){return!!ie.prototype.ownsTarget.call(this,F)||!(!this.grip1.ownsTarget(F)&&!this.grip2.ownsTarget(F))},N.prototype.pointerDown=function(F,ae){ie.prototype.pointerDown.call(this,F,ae),this.manipulationStartX=F.x,this.manipulationStartY=F.y,this.state==="new"&&(this.x1=F.x,this.y1=F.y,this.x2=F.x,this.y2=F.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(ae)?this.activeGrip=this.grip1:this.grip2.ownsTarget(ae)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},N.prototype.pointerUp=function(F){var ae=this.state;ie.prototype.pointerUp.call(this,F),this.state==="creating"&&Math.abs(this.x1-this.x2)<10&&Math.abs(this.y1-this.y2)<10?(this.x2=this.x1+this.defaultLength,this.adjustVisual(),this.adjustControlBox()):this.manipulate(F),this._state="select",ae==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},N.prototype.adjustVisual=function(){},N.prototype.manipulate=function(F){this.state==="creating"?this.resize(F):this.state==="move"?(this.x1=this.manipulationStartX1+F.x-this.manipulationStartX,this.y1=this.manipulationStartY1+F.y-this.manipulationStartY,this.x2=this.manipulationStartX2+F.x-this.manipulationStartX,this.y2=this.manipulationStartY2+F.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(F)},N.prototype.resize=function(F){switch(this.activeGrip){case this.grip1:this.x1=F.x,this.y1=F.y;break;case this.grip2:case void 0:this.x2=F.x,this.y2=F.y}this.adjustVisual(),this.adjustControlBox()},N.prototype.select=function(){ie.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},N.prototype.deselect=function(){ie.prototype.deselect.call(this),this.controlBox.style.display="none"},N.prototype.setupControlBox=function(){this.controlBox=_e.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},N.prototype.adjustControlBox=function(){this.positionGrips()},N.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},N.prototype.createGrip=function(){var F=new q;return F.visual.transform.baseVal.appendItem(_e.createTransform()),this.controlBox.appendChild(F.visual),F},N.prototype.positionGrips=function(){var F=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-F/2,this.y1-F/2),this.positionGrip(this.grip2.visual,this.x2-F/2,this.y2-F/2)},N.prototype.positionGrip=function(F,ae,me){var se=F.transform.baseVal.getItem(0);se.setTranslate(ae,me),F.transform.baseVal.replaceItem(se,0)},N.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},ie.prototype.getState.call(this))},N.prototype.restoreState=function(F){ie.prototype.restoreState.call(this,F);var ae=F;this.x1=ae.x1,this.y1=ae.y1,this.x2=ae.x2,this.y2=ae.y2},N.prototype.scale=function(F,ae){ie.prototype.scale.call(this,F,ae),this.x1=this.x1*F,this.y1=this.y1*ae,this.x2=this.x2*F,this.y2=this.y2*ae,this.adjustVisual(),this.adjustControlBox()},N}(k),mt=function(ie){function N(F,ae,me){var se=ie.call(this,F,ae,me)||this;return se.strokeColor="transparent",se.strokeWidth=0,se.strokeDasharray="",se.setStrokeColor=se.setStrokeColor.bind(se),se.setStrokeWidth=se.setStrokeWidth.bind(se),se.setStrokeDasharray=se.setStrokeDasharray.bind(se),se.strokeColor=me.defaultColor,se.strokeWidth=me.defaultStrokeWidth,se.strokeDasharray=me.defaultStrokeDasharray,se.strokePanel=new re("Line color",me.defaultColorSet,me.defaultColor),se.strokePanel.onColorChanged=se.setStrokeColor,se.strokeWidthPanel=new ke("Line width",me.defaultStrokeWidths,me.defaultStrokeWidth),se.strokeWidthPanel.onWidthChanged=se.setStrokeWidth,se.strokeStylePanel=new dt("Line style",me.defaultStrokeDasharrays,me.defaultStrokeDasharray),se.strokeStylePanel.onStyleChanged=se.setStrokeDasharray,se}return Ce(N,ie),N.prototype.ownsTarget=function(F){return!(!ie.prototype.ownsTarget.call(this,F)&&F!==this.visual&&F!==this.selectorLine&&F!==this.visibleLine)},N.prototype.createVisual=function(){this.visual=_e.createGroup(),this.selectorLine=_e.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=_e.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},N.prototype.pointerDown=function(F,ae){ie.prototype.pointerDown.call(this,F,ae),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},N.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),_e.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),_e.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),_e.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},N.prototype.setStrokeColor=function(F){this.strokeColor=F,this.adjustVisual(),this.colorChanged(F)},N.prototype.setStrokeWidth=function(F){this.strokeWidth=F,this.adjustVisual()},N.prototype.setStrokeDasharray=function(F){this.strokeDasharray=F,this.adjustVisual(),this.stateChanged()},Object.defineProperty(N.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),N.prototype.getState=function(){var F=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},ie.prototype.getState.call(this));return F.typeName=N.typeName,F},N.prototype.restoreState=function(F){ie.prototype.restoreState.call(this,F);var ae=F;this.strokeColor=ae.strokeColor,this.strokeWidth=ae.strokeWidth,this.strokeDasharray=ae.strokeDasharray,this.createVisual(),this.adjustVisual()},N.typeName="LineMarker",N.title="Line marker",N.icon='',N}(tt),Qe=function(ie){function N(F,ae,me,se){var $e=ie.call(this,F,se||'')||this;return $e.fonts=[],$e.fontBoxes=[],$e.fonts=ae,$e.currentFont=me,$e.setCurrentFont=$e.setCurrentFont.bind($e),$e}return Ce(N,ie),N.prototype.getUi=function(){var F=this,ae=document.createElement("div");return ae.style.overflow="hidden",ae.style.flexGrow="2",this.fonts.forEach(function(me){var se=document.createElement("div");se.style.display="inline-block",se.style.alignItems="center",se.style.justifyContent="space-between",se.style.padding="5px",se.style.borderWidth="2px",se.style.borderStyle="solid",se.style.overflow="hidden",se.style.maxWidth=100/F.fonts.length-5+"%",se.style.borderColor=me===F.currentFont?F.uiStyleSettings.toolboxAccentColor:"transparent",se.addEventListener("click",function(){F.setCurrentFont(me,se)}),ae.appendChild(se);var $e=document.createElement("div");$e.style.display="flex",$e.style.minHeight="20px",$e.style.flexGrow="2",$e.style.fontFamily=me,$e.style.overflow="hidden";var Et=document.createElement("div");Et.style.whiteSpace="nowrap",Et.style.overflow="hidden",Et.style.textOverflow="ellipsis",Et.innerHTML="The quick brown fox jumps over the lazy dog",$e.appendChild(Et),se.appendChild($e),F.fontBoxes.push(se)}),ae},N.prototype.setCurrentFont=function(F,ae){var me=this;this.currentFont=F,this.fontBoxes.forEach(function(se){se.style.borderColor=se===ae?me.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},N}(nt),Xe=function(ie){function N(F,ae,me){var se=ie.call(this,F,ae,me)||this;return se.color="transparent",se.padding=5,se.DEFAULT_TEXT="your text here",se.text=se.DEFAULT_TEXT,se.isMoved=!1,se.color=me.defaultColor,se.fontFamily=me.defaultFontFamily,se.defaultSize={x:100,y:30},se.setColor=se.setColor.bind(se),se.setFont=se.setFont.bind(se),se.renderText=se.renderText.bind(se),se.sizeText=se.sizeText.bind(se),se.textEditDivClicked=se.textEditDivClicked.bind(se),se.showTextEditor=se.showTextEditor.bind(se),se.setSize=se.setSize.bind(se),se.positionTextEditor=se.positionTextEditor.bind(se),se.colorPanel=new re("Color",me.defaultColorSet,me.defaultColor),se.colorPanel.onColorChanged=se.setColor,se.fontFamilyPanel=new Qe("Font",me.defaultFontFamilies,me.defaultFontFamily),se.fontFamilyPanel.onFontChanged=se.setFont,se}return Ce(N,ie),N.prototype.ownsTarget=function(F){if(ie.prototype.ownsTarget.call(this,F)||F===this.visual||F===this.textElement||F===this.bgRectangle)return!0;var ae=!1;return this.textElement.childNodes.forEach(function(me){me===F&&(ae=!0)}),ae},N.prototype.createVisual=function(){this.visual=_e.createGroup(),this.bgRectangle=_e.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=_e.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(_e.createTransform()),this.textElement.transform.baseVal.appendItem(_e.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},N.prototype.pointerDown=function(F,ae){ie.prototype.pointerDown.call(this,F,ae),this.isMoved=!1,this.pointerDownPoint=F,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(F),this._state="creating")},N.prototype.renderText=function(){var F=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(ae){F.textElement.appendChild(_e.createTSpan(ae.trim()===""?" ":ae.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},N.prototype.getTextScale=function(){var F=this.textElement.getBBox(),ae=1;if(F.width>0&&F.height>0){var me=(1*this.width-this.width*this.padding*2/100)/F.width,se=(1*this.height-this.height*this.padding*2/100)/F.height;ae=Math.min(me,se)}return ae},N.prototype.getTextPosition=function(F){var ae=this.textElement.getBBox(),me=0,se=0;return ae.width>0&&ae.height>0&&(me=(this.width-ae.width*F)/2,se=this.height/2-ae.height*F/2),{x:me,y:se}},N.prototype.sizeText=function(){var F=this.textElement.getBBox(),ae=this.getTextScale(),me=this.getTextPosition(ae);me.y-=F.y*ae,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+me.x+"px, "+me.y+"px) scale("+ae+", "+ae+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(me.x,me.y),this.textElement.transform.baseVal.getItem(1).setScale(ae,ae))},N.prototype.manipulate=function(F){ie.prototype.manipulate.call(this,F),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(F.x-this.pointerDownPoint.x)>5||Math.abs(F.y-this.pointerDownPoint.y)>5)},N.prototype.resize=function(F){ie.prototype.resize.call(this,F),this.isMoved=!0,this.setSize(),this.sizeText()},N.prototype.setSize=function(){ie.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(_e.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),_e.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},N.prototype.pointerUp=function(F){var ae=this.state;ae==="creating"&&(this._suppressMarkerCreateEvent=!0),ie.prototype.pointerUp.call(this,F),this.setSize(),(ae==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},N.prototype.showTextEditor=function(){var F=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(ae){ae.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var ae=Number.parseFloat(F.textEditor.style.fontSize);F.textEditor.clientWidth>=Number.parseInt(F.textEditor.style.maxWidth)&&ae>.9;)ae-=.1,F.textEditor.style.fontSize=Math.max(ae,.9)+"em"}),this.textEditor.addEventListener("keyup",function(ae){ae.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(ae){if(ae.clipboardData){var me=ae.clipboardData.getData("text"),se=window.getSelection();if(!se.rangeCount)return!1;se.deleteFromDocument(),se.getRangeAt(0).insertNode(document.createTextNode(me)),ae.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){F.textEditDivClicked(F.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},N.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var F=this.getTextScale(),ae=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),me=this.textElement.getBBox(),se={x:me.width*F,y:me.height*F};ae.x-=se.x/2,ae.y-=se.y/2,this.textEditor.style.top=ae.y+"px",this.textEditor.style.left=ae.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-ae.x+"px",this.textEditor.style.fontSize=Math.max(16*F,12)+"px",this.textElement.style.display="none"}},N.prototype.textEditDivClicked=function(F){this.text=F.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},N.prototype.select=function(){ie.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},N.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),ie.prototype.deselect.call(this)},N.prototype.dblClick=function(F,ae){ie.prototype.dblClick.call(this,F,ae),this.showTextEditor()},N.prototype.setColor=function(F){this.textElement&&_e.setAttributes(this.textElement,[["fill",F]]),this.color=F,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(F)},N.prototype.setFont=function(F){this.textElement&&_e.setAttributes(this.textElement,[["font-family",F]]),this.fontFamily=F,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},N.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},N.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(N.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),N.prototype.getState=function(){var F=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},ie.prototype.getState.call(this));return F.typeName=N.typeName,F},N.prototype.restoreState=function(F){var ae=F;this.color=ae.color,this.fontFamily=ae.fontFamily,this.padding=ae.padding,this.text=ae.text,this.createVisual(),ie.prototype.restoreState.call(this,F),this.setSize()},N.prototype.scale=function(F,ae){ie.prototype.scale.call(this,F,ae),this.setSize(),this.sizeText(),this.positionTextEditor()},N.typeName="TextMarker",N.title="Text marker",N.icon='',N}(J),Fe=function(ie){function N(F,ae,me){var se=ie.call(this,F,ae,me)||this;return se.color="transparent",se.lineWidth=3,se.drawing=!1,se.pixelRatio=1,se.color=me.defaultColor,se.lineWidth=me.defaultStrokeWidth,se.pixelRatio=me.freehandPixelRatio,se.setColor=se.setColor.bind(se),se.addCanvas=se.addCanvas.bind(se),se.finishCreation=se.finishCreation.bind(se),se.setLineWidth=se.setLineWidth.bind(se),se.colorPanel=new re("Color",me.defaultColorSet,me.defaultColor),se.colorPanel.onColorChanged=se.setColor,se.lineWidthPanel=new ke("Line width",me.defaultStrokeWidths,me.defaultStrokeWidth),se.lineWidthPanel.onWidthChanged=se.setLineWidth,se}return Ce(N,ie),N.prototype.ownsTarget=function(F){return!(!ie.prototype.ownsTarget.call(this,F)&&F!==this.visual&&F!==this.drawingImage)},N.prototype.createVisual=function(){this.visual=_e.createGroup(),this.drawingImage=_e.createImage(),this.visual.appendChild(this.drawingImage);var F=_e.createTransform();this.visual.transform.baseVal.appendItem(F),this.addMarkerVisualToContainer(this.visual)},N.prototype.pointerDown=function(F,ae){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(F.x,F.y),this.drawing=!0):ie.prototype.pointerDown.call(this,F,ae)},N.prototype.manipulate=function(F){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(F.x,F.y),this.canvasContext.stroke()):ie.prototype.manipulate.call(this,F)},N.prototype.resize=function(F){ie.prototype.resize.call(this,F),_e.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),_e.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},N.prototype.pointerUp=function(F){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):ie.prototype.pointerUp.call(this,F)},N.prototype.addCanvas=function(){this.overlayContainer.innerHTML="",this.canvasElement=document.createElement("canvas"),this.canvasElement.width=this.overlayContainer.clientWidth*this.pixelRatio,this.canvasElement.height=this.overlayContainer.clientHeight*this.pixelRatio,this.canvasContext=this.canvasElement.getContext("2d"),this.canvasContext.scale(this.pixelRatio,this.pixelRatio),this.overlayContainer.appendChild(this.canvasElement)},N.prototype.select=function(){this.state==="creating"&&this.finishCreation(),ie.prototype.select.call(this)},N.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),ie.prototype.deselect.call(this)},N.prototype.finishCreation=function(){for(var F=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),ae=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],me=ae[0],se=ae[1],$e=ae[2],Et=ae[3],it=!1,Vt=0;Vt0&&(it=!0,VtEt&&(Et=Vt),At>$e&&($e=At));if(it){this.left=me/this.pixelRatio,this.top=se/this.pixelRatio,this.width=($e-me)/this.pixelRatio,this.height=(Et-se)/this.pixelRatio;var Ft=document.createElement("canvas");Ft.width=$e-me,Ft.height=Et-se,Ft.getContext("2d").putImageData(this.canvasContext.getImageData(me,se,$e-me,Et-se),0,0),this.drawingImgUrl=Ft.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},N.prototype.setDrawingImage=function(){_e.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),_e.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},N.prototype.setColor=function(F){this.color=F,this.colorChanged(F)},N.prototype.setLineWidth=function(F){this.lineWidth=F},Object.defineProperty(N.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),N.prototype.getState=function(){var F=Object.assign({drawingImgUrl:this.drawingImgUrl},ie.prototype.getState.call(this));return F.typeName=N.typeName,F},N.prototype.restoreState=function(F){this.createVisual(),ie.prototype.restoreState.call(this,F),this.drawingImgUrl=F.drawingImgUrl,this.setDrawingImage()},N.prototype.scale=function(F,ae){ie.prototype.scale.call(this,F,ae),this.setDrawingImage()},N.typeName="FreehandMarker",N.title="Freehand marker",N.icon='',N}(J),Ie=function(ie){function N(F,ae,me){var se=ie.call(this,F,me||'')||this;return se.typeBoxes=[],se.currentType=ae,se.setCurrentType=se.setCurrentType.bind(se),se}return Ce(N,ie),N.prototype.getUi=function(){var F=this,ae=document.createElement("div");ae.style.display="flex",ae.style.overflow="hidden",ae.style.flexGrow="2";for(var me=function(Et){var it="both";switch(Et){case 0:it="both";break;case 1:it="start";break;case 2:it="end";break;case 3:it="none"}var Vt=document.createElement("div");if(Vt.style.display="flex",Vt.style.flexGrow="2",Vt.style.alignItems="center",Vt.style.justifyContent="space-between",Vt.style.padding="5px",Vt.style.borderWidth="2px",Vt.style.borderStyle="solid",Vt.style.borderColor=it===se.currentType?se.uiStyleSettings.toolboxAccentColor:"transparent",Vt.addEventListener("click",function(){F.setCurrentType(it,Vt)}),ae.appendChild(Vt),it==="both"||it==="start"){var At=document.createElement("div");At.style.display="flex",At.style.alignItems="center",At.style.minHeight="20px",At.innerHTML=` `,At.style.marginLeft="5px",Vt.appendChild(At)}var Ft=document.createElement("div");Ft.style.display="flex",Ft.style.alignItems="center",Ft.style.minHeight="20px",Ft.style.flexGrow="2";var on=document.createElement("hr");if(on.style.minWidth="20px",on.style.border="0px",on.style.borderTop="3px solid "+(se.uiStyleSettings!==void 0?se.uiStyleSettings.toolboxColor:"#eeeeee"),on.style.flexGrow="2",Ft.appendChild(on),Vt.appendChild(Ft),it==="both"||it==="end"){var In=document.createElement("div");In.style.display="flex",In.style.alignItems="center",In.style.minHeight="20px",In.innerHTML=` `,In.style.marginRight="5px",Vt.appendChild(In)}se.typeBoxes.push(Vt)},se=this,$e=0;$e<4;$e++)me($e);return ae},N.prototype.setCurrentType=function(F,ae){var me=this;this.currentType=F,this.typeBoxes.forEach(function(se){se.style.borderColor=se===ae?me.uiStyleSettings!==void 0?me.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},N}(nt),Me=function(ie){function N(F,ae,me){var se=ie.call(this,F,ae,me)||this;return se.arrowType="end",se.arrowBaseHeight=10,se.arrowBaseWidth=10,se.getArrowPoints=se.getArrowPoints.bind(se),se.setArrowType=se.setArrowType.bind(se),se.arrowTypePanel=new Ie("Arrow type","end"),se.arrowTypePanel.onArrowTypeChanged=se.setArrowType,se}return Ce(N,ie),N.prototype.ownsTarget=function(F){return!(!ie.prototype.ownsTarget.call(this,F)&&F!==this.arrow1&&F!==this.arrow2)},N.prototype.getArrowPoints=function(F,ae){var me=this.arrowBaseWidth+2*this.strokeWidth,se=this.arrowBaseHeight+2*this.strokeWidth;return F-me/2+","+(ae+se/2)+" "+F+","+(ae-se/2)+" "+(F+me/2)+","+(ae+se/2)},N.prototype.createTips=function(){this.arrow1=_e.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(_e.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=_e.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(_e.createTransform()),this.visual.appendChild(this.arrow2)},N.prototype.pointerDown=function(F,ae){ie.prototype.pointerDown.call(this,F,ae),this.state==="creating"&&this.createTips()},N.prototype.adjustVisual=function(){if(ie.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",_e.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),_e.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var F=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),ae=this.arrow1.transform.baseVal.getItem(0);ae.setRotate(F,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(ae,0);var me=this.arrow2.transform.baseVal.getItem(0);me.setRotate(F+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(me,0)}},N.prototype.setArrowType=function(F){this.arrowType=F,this.adjustVisual(),this.stateChanged()},Object.defineProperty(N.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),N.prototype.getState=function(){var F=Object.assign({arrowType:this.arrowType},ie.prototype.getState.call(this));return F.typeName=N.typeName,F},N.prototype.restoreState=function(F){ie.prototype.restoreState.call(this,F);var ae=F;this.arrowType=ae.arrowType,this.createTips(),this.adjustVisual()},N.typeName="ArrowMarker",N.title="Arrow marker",N.icon='',N}(mt),Ee=function(ie){function N(F,ae,me){var se=ie.call(this,F,ae,me)||this;return se.fillColor=me.defaultFillColor,se.strokeWidth=0,se.fillPanel=new re("Color",me.defaultColorSet,me.defaultFillColor),se.fillPanel.onColorChanged=se.setFillColor,se}return Ce(N,ie),Object.defineProperty(N.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),N.prototype.getState=function(){var F=ie.prototype.getState.call(this);return F.typeName=N.typeName,F},N.typeName="CoverMarker",N.title="Cover marker",N.icon='',N}(xe),Ae=function(ie){function N(F,ae,me,se){var $e=ie.call(this,F,se||'')||this;return $e.opacities=[],$e.opacityBoxes=[],$e.opacities=ae,$e.currentOpacity=me,$e.setCurrentOpacity=$e.setCurrentOpacity.bind($e),$e}return Ce(N,ie),N.prototype.getUi=function(){var F=this,ae=document.createElement("div");return ae.style.display="flex",ae.style.overflow="hidden",ae.style.flexGrow="2",ae.style.justifyContent="space-between",this.opacities.forEach(function(me){var se=document.createElement("div");se.style.display="flex",se.style.alignItems="center",se.style.justifyContent="center",se.style.padding="5px",se.style.borderWidth="2px",se.style.borderStyle="solid",se.style.borderColor=me===F.currentOpacity?F.uiStyleSettings.toolboxAccentColor:"transparent",se.addEventListener("click",function(){F.setCurrentOpacity(me,se)}),ae.appendChild(se);var $e=document.createElement("div");$e.innerText=100*me+"%",se.appendChild($e),F.opacityBoxes.push(se)}),ae},N.prototype.setCurrentOpacity=function(F,ae){var me=this;this.currentOpacity=F,this.opacityBoxes.forEach(function(se){se.style.borderColor=se===ae?me.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},N}(nt),Le=function(ie){function N(F,ae,me){var se=ie.call(this,F,ae,me)||this;return se.setOpacity=se.setOpacity.bind(se),se.fillColor=me.defaultHighlightColor,se.strokeWidth=0,se.opacity=me.defaultHighlightOpacity,se.fillPanel=new re("Color",me.defaultColorSet,se.fillColor),se.fillPanel.onColorChanged=se.setFillColor,se.opacityPanel=new Ae("Opacity",me.defaultOpacitySteps,se.opacity),se.opacityPanel.onOpacityChanged=se.setOpacity,se}return Ce(N,ie),N.prototype.setOpacity=function(F){this.opacity=F,this.visual&&_e.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(N.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),N.prototype.getState=function(){var F=ie.prototype.getState.call(this);return F.typeName=N.typeName,F},N.typeName="HighlightMarker",N.title="Highlight marker",N.icon='',N}(Ee),Te='',Ze=function(ie){function N(F,ae,me){var se=ie.call(this,F,ae,me)||this;return se.bgColor="transparent",se.tipPosition={x:0,y:0},se.tipBase1Position={x:0,y:0},se.tipBase2Position={x:0,y:0},se.tipMoving=!1,se.color=me.defaultStrokeColor,se.bgColor=me.defaultFillColor,se.fontFamily=me.defaultFontFamily,se.defaultSize={x:100,y:30},se.setBgColor=se.setBgColor.bind(se),se.getTipPoints=se.getTipPoints.bind(se),se.positionTip=se.positionTip.bind(se),se.setTipPoints=se.setTipPoints.bind(se),se.colorPanel=new re("Text color",me.defaultColorSet,se.color,''),se.colorPanel.onColorChanged=se.setColor,se.bgColorPanel=new re("Fill color",me.defaultColorSet,se.bgColor,Te),se.bgColorPanel.onColorChanged=se.setBgColor,se.fontFamilyPanel=new Qe("Font",me.defaultFontFamilies,me.defaultFontFamily),se.fontFamilyPanel.onFontChanged=se.setFont,se.tipGrip=new q,se.tipGrip.visual.transform.baseVal.appendItem(_e.createTransform()),se.controlBox.appendChild(se.tipGrip.visual),se}return Ce(N,ie),N.prototype.ownsTarget=function(F){return ie.prototype.ownsTarget.call(this,F)||this.tipGrip.ownsTarget(F)||this.tip===F},N.prototype.createTip=function(){_e.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=_e.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},N.prototype.pointerDown=function(F,ae){this.state==="new"&&ie.prototype.pointerDown.call(this,F,ae),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(ae)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):ie.prototype.pointerDown.call(this,F,ae)},N.prototype.pointerUp=function(F){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,ie.prototype.pointerUp.call(this,F);else{var ae=this.state==="creating";ie.prototype.pointerUp.call(this,F),this.setTipPoints(ae),this.positionTip()}},N.prototype.manipulate=function(F){if(this.tipMoving){var ae=this.unrotatePoint(F);this.tipPosition={x:ae.x-this.manipulationStartLeft,y:ae.y-this.manipulationStartTop},this.positionTip()}else ie.prototype.manipulate.call(this,F)},N.prototype.setBgColor=function(F){this.bgRectangle&&this.tip&&(_e.setAttributes(this.bgRectangle,[["fill",F]]),_e.setAttributes(this.tip,[["fill",F]])),this.bgColor=F,this.fillColorChanged(F)},N.prototype.getTipPoints=function(){return this.setTipPoints(this.state==="creating"),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},N.prototype.setTipPoints=function(F){F===void 0&&(F=!1);var ae=Math.min(this.height/2,15),me=this.height/5;F&&(this.tipPosition={x:ae+me/2,y:this.height+20});var se=Math.atan(this.height/2/(this.width/2));this.tipPosition.x=this.width/2&&this.tipPosition.y=this.width/2&&this.tipPosition.y>=this.height/2?se.1)){var F=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),ae=this.tip1.transform.baseVal.getItem(0);ae.setRotate(F,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(ae,0);var me=this.tip2.transform.baseVal.getItem(0);me.setRotate(F+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(me,0)}},Object.defineProperty(N.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),N.prototype.getState=function(){var F=ie.prototype.getState.call(this);return F.typeName=N.typeName,F},N.prototype.restoreState=function(F){ie.prototype.restoreState.call(this,F),this.createTips(),this.adjustVisual()},N.typeName="MeasurementMarker",N.title="Measurement marker",N.icon='',N}(mt),Ht=function(ie){function N(F,ae,me){var se=ie.call(this,F,ae,me)||this;return se.strokePanel.colors=me.defaultColorSet,se.fillColor="transparent",se}return Ce(N,ie),Object.defineProperty(N.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),N.prototype.getState=function(){var F=ie.prototype.getState.call(this);return F.typeName=N.typeName,F},N.typeName="EllipseFrameMarker",N.title="Ellipse frame marker",N.icon='',N}(ut),Qt=function(){function ie(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(ie.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),ie.prototype.addUndoStep=function(N){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(N)||(this.undoStack.push(N),JSON.stringify(this.lastRedoStep)!==JSON.stringify(N)&&this.redoStack.splice(0,this.redoStack.length))},ie.prototype.replaceLastUndoStep=function(N){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=N)},ie.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},ie.prototype.undo=function(){if(this.undoStack.length>1){var N=this.undoStack.pop();return N!==void 0&&this.redoStack.push(N),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},ie.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},ie}(),bt=function(ie){function N(F,ae,me){var se=ie.call(this,F,ae,me)||this;return se.strokeColor="transparent",se.strokeWidth=0,se.strokeDasharray="",se.curveX=0,se.curveY=0,se.manipulationStartCurveX=0,se.manipulationStartCurveY=0,se.setStrokeColor=se.setStrokeColor.bind(se),se.setStrokeWidth=se.setStrokeWidth.bind(se),se.setStrokeDasharray=se.setStrokeDasharray.bind(se),se.positionGrips=se.positionGrips.bind(se),se.addControlGrips=se.addControlGrips.bind(se),se.adjustVisual=se.adjustVisual.bind(se),se.setupControlBox=se.setupControlBox.bind(se),se.resize=se.resize.bind(se),se.strokeColor=me.defaultColor,se.strokeWidth=me.defaultStrokeWidth,se.strokeDasharray=me.defaultStrokeDasharray,se.strokePanel=new re("Line color",me.defaultColorSet,me.defaultColor),se.strokePanel.onColorChanged=se.setStrokeColor,se.strokeWidthPanel=new ke("Line width",me.defaultStrokeWidths,me.defaultStrokeWidth),se.strokeWidthPanel.onWidthChanged=se.setStrokeWidth,se.strokeStylePanel=new dt("Line style",me.defaultStrokeDasharrays,me.defaultStrokeDasharray),se.strokeStylePanel.onStyleChanged=se.setStrokeDasharray,se}return Ce(N,ie),N.prototype.ownsTarget=function(F){return!(!ie.prototype.ownsTarget.call(this,F)&&F!==this.visual&&F!==this.selectorCurve&&F!==this.visibleCurve&&!this.curveGrip.ownsTarget(F))},N.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},N.prototype.createVisual=function(){this.visual=_e.createGroup(),this.selectorCurve=_e.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=_e.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},N.prototype.pointerDown=function(F,ae){ie.prototype.pointerDown.call(this,F,ae),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=F.x,this.curveY=F.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(ae)&&(this.activeGrip=this.curveGrip,this._state="resize")},N.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),_e.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),_e.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),_e.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},N.prototype.setupControlBox=function(){ie.prototype.setupControlBox.call(this),this.curveControlLine1=_e.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=_e.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},N.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,ie.prototype.addControlGrips.call(this)},N.prototype.positionGrips=function(){ie.prototype.positionGrips.call(this);var F=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-F/2,this.curveY-F/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},N.prototype.manipulate=function(F){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+F.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+F.y-this.manipulationStartY),ie.prototype.manipulate.call(this,F)},N.prototype.resize=function(F){this.activeGrip===this.curveGrip&&(this.curveX=F.x,this.curveY=F.y),ie.prototype.resize.call(this,F),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},N.prototype.setStrokeColor=function(F){this.strokeColor=F,this.adjustVisual(),this.colorChanged(F)},N.prototype.setStrokeWidth=function(F){this.strokeWidth=F,this.adjustVisual()},N.prototype.setStrokeDasharray=function(F){this.strokeDasharray=F,this.adjustVisual()},N.prototype.scale=function(F,ae){this.curveX=this.curveX*F,this.curveY=this.curveY*ae,ie.prototype.scale.call(this,F,ae)},Object.defineProperty(N.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),N.prototype.getState=function(){var F=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},ie.prototype.getState.call(this));return F.typeName=N.typeName,F},N.prototype.restoreState=function(F){ie.prototype.restoreState.call(this,F);var ae=F;this.strokeColor=ae.strokeColor,this.strokeWidth=ae.strokeWidth,this.strokeDasharray=ae.strokeDasharray,this.curveX=ae.curveX,this.curveY=ae.curveY,this.createVisual(),this.adjustVisual()},N.typeName="CurveMarker",N.title="Curve marker",N.icon='',N}(tt),Lt=function(){function ie(N,F){F===void 0&&(F=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=N,this.cancelable=F}return Object.defineProperty(ie.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),ie.prototype.preventDefault=function(){this._defaultPrevented=!0},ie}(),at=function(ie){function N(F,ae,me){var se=ie.call(this,F,!1)||this;return se.dataUrl=ae,se.state=me,se}return Ce(N,ie),N}(Lt),pt=function(ie){function N(F,ae,me){me===void 0&&(me=!1);var se=ie.call(this,F,me)||this;return se.marker=ae,se}return Ce(N,ie),N}(Lt),st=function(){function ie(){this.render=[],this.beforeclose=[],this.close=[],this.show=[],this.restorestate=[],this.statechange=[],this.markerselect=[],this.markerdeselect=[],this.markercreating=[],this.markercreate=[],this.markerbeforedelete=[],this.markerdelete=[],this.markerchange=[],this.focus=[],this.blur=[]}return ie.prototype.addEventListener=function(N,F){this[N].push(F)},ie.prototype.removeEventListener=function(N,F){var ae=this[N].indexOf(F);ae>-1&&this[N].splice(ae,1)},ie}(),Pe=function(){function ie(N){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new je,this._isOpen=!1,this.undoRedoManager=new Qt,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.renderMarkersOnly=!1,this.zoomSteps=[1,1.5,2,4],this._zoomLevel=1,this._isResizing=!1,this.prevPanPoint={x:0,y:0},this.eventListeners=new st,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=ie.instanceCounter++,this.styles=new ze(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=N,this.targetRoot=document.body,this.width=N.clientWidth,this.height=N.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(ie.prototype,"ALL_MARKER_TYPES",{get:function(){return[Ue,Fe,Me,Xe,Ht,ut,Le,Ze,Tt,Ee,mt,bt]},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[Ue,Fe,Me,Xe,ut,Le,Ze]},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"BASIC_MARKER_TYPES",{get:function(){return[Ue,Fe,Me,Xe,Le]},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(N){var F=this;this._availableMarkerTypes.splice(0),N.forEach(function(ae){if(typeof ae=="string"){var me=F.ALL_MARKER_TYPES.find(function(se){return se.typeName===ae});me!==void 0&&F._availableMarkerTypes.push(me)}else F._availableMarkerTypes.push(ae)})},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(N){this._zoomLevel=N,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),ie.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),Ke.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},ie.prototype.show=function(){var N=this;this.styles.styleSheetRoot===void 0&&Be.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=Be.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(F){return F(new Lt(N))})},ie.prototype.render=function(){return Se(this,void 0,void 0,function(){var N;return De(this,function(F){switch(F.label){case 0:return this.setCurrentMarker(),(N=new Ne).naturalSize=this.renderAtNaturalSize,N.imageType=this.renderImageType,N.imageQuality=this.renderImageQuality,N.markersOnly=this.renderMarkersOnly,N.width=this.renderWidth,N.height=this.renderHeight,[4,N.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return F.sent(),[4,N.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,F.sent()]}})})},ie.prototype.close=function(N){var F=this;if(N===void 0&&(N=!1),this.isOpen){var ae=!1;N||this.eventListeners.beforeclose.forEach(function(me){var se=new Lt(F,!0);me(se),se.defaultPrevented&&(ae=!0)}),ae||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(me){return me(new Lt(F))}),this.detachEvents(),this._isOpen=!1)}},ie.prototype.addMarkersToToolbar=function(){for(var N,F=[],ae=0;aethis.editorCanvas.clientHeight?this.editorCanvas.clientHeight*N:this.editorCanvas.clientWidth,ae=F',N.title="Powered by marker.js",N.style.display="grid",N.style.alignItems="center",N.style.justifyItems="center",N.style.padding="3px",N.style.width="20px",N.style.height="20px",this.logoUI.appendChild(N),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},ie.prototype.positionLogo=function(){this.logoUI&&(this.uiStyleSettings.logoPosition!=="right"?this.logoUI.style.left=this.markerImageHolder.offsetLeft+10+"px":this.logoUI.style.left=this.markerImageHolder.offsetLeft+this.markerImageHolder.offsetWidth-this.logoUI.clientWidth-10+"px",this.logoUI.style.top=this.markerImageHolder.offsetTop+this.markerImageHolder.offsetHeight-this.logoUI.clientHeight-10+"px")},ie.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},ie.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},ie.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var N=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=N+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new We(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.target.getClientRects().item(0).y-1&&this.markers.splice(this.markers.indexOf(N),1),N.dispose()},ie.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),this._currentMarker!==void 0&&(this._currentMarker.state!=="new"?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},ie.prototype.toolbarButtonClicked=function(N,F){if(N==="marker"&&F!==void 0)this.createNewMarker(F);else if(N==="action")switch(F){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},ie.prototype.deleteSelectedMarker=function(){var N=this;if(this._currentMarker!==void 0){var F=!1;if(this.eventListeners.markerbeforedelete.forEach(function(me){var se=new pt(N,N._currentMarker,!0);me(se),se.defaultPrevented&&(F=!0)}),!F){var ae=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(me){return me(new pt(N,ae))})}}},ie.prototype.clear=function(){var N=this,F=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function($e){var Et=new pt(N,void 0,!0);$e(Et),Et.defaultPrevented&&(F=!0)}),!F)){this.setCurrentMarker();for(var ae=function($e){var Et=me.markers[$e];me.setCurrentMarker(me.markers[$e]),me._currentMarker.dispose(),me.markerImage.removeChild(me._currentMarker.container),me.markers.splice(me.markers.indexOf(me._currentMarker),1),me.eventListeners.markerdelete.forEach(function(it){return it(new pt(N,Et))})},me=this,se=this.markers.length-1;se>=0;se--)ae(se);this.addUndoStep()}},Object.defineProperty(ie.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),ie.prototype.showNotesEditor=function(){var N;this._currentMarker!==void 0&&(this.overlayContainer.innerHTML="",this.notesArea=document.createElement("textarea"),this.notesArea.className=this.uiStyleSettings.notesAreaStyleClassName,this.notesArea.style.pointerEvents="auto",this.notesArea.style.alignSelf="stretch",this.notesArea.style.width="100%",this.notesArea.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.notesArea.value=(N=this._currentMarker.notes)!==null&&N!==void 0?N:"",this.overlayContainer.appendChild(this.notesArea))},ie.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(this._currentMarker!==void 0&&(this._currentMarker.notes=this.notesArea.value.trim()!==""?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},ie.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},ie.prototype.addUndoStep=function(){var N=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var F=this.getState(),ae=this.undoRedoManager.getLastUndoStep();if(!ae||ae.width===F.width&&ae.height===F.height){var me=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(F),me1&&this.panTo({x:N.clientX,y:N.clientY}))},ie.prototype.onPointerUp=function(N){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(N.clientX,N.clientY)),this.isDragging=!1,this.addUndoStep()},ie.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},ie.prototype.onKeyUp=function(N){this._currentMarker===void 0||this.notesArea!==void 0||N.key!=="Delete"&&N.key!=="Backspace"||this.deleteSelectedMarker()},ie.prototype.clientToLocalCoordinates=function(N,F){var ae=this.markerImage.getBoundingClientRect();return{x:(N-ae.left)/this.zoomLevel,y:(F-ae.top)/this.zoomLevel}},ie.prototype.onWindowResize=function(){this.positionUI()},ie.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var N=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=N+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},ie.prototype.addLicenseKey=function(N){Ke.addKey(N)},ie.prototype.addEventListener=function(N,F){this.eventListeners.addEventListener(N,F)},ie.prototype.removeEventListener=function(N,F){this.eventListeners.removeEventListener(N,F)},ie.prototype.renderState=function(N){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(N),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(ie.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),ie.prototype.focus=function(){var N=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(F){return F(new Lt(N))}))},ie.prototype.blur=function(){var N=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(F){return F(new Lt(N))}))},ie.instanceCounter=0,ie}();/* ********************************** cropro version 1.2.0 @license SEE LICENSE IN LICENSE copyright Alan Mendelevich see README and LICENSE for details ********************************** *//*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */var Ge=function(ie,N){return(Ge=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(F,ae){F.__proto__=ae}||function(F,ae){for(var me in ae)Object.prototype.hasOwnProperty.call(ae,me)&&(F[me]=ae[me])})(ie,N)};function yt(ie,N){if(typeof N!="function"&&N!==null)throw new TypeError("Class extends value "+String(N)+" is not a constructor or null");function F(){this.constructor=ie}Ge(ie,N),ie.prototype=N===null?Object.create(N):(F.prototype=N.prototype,new F)}function ot(ie,N,F,ae){return new(F||(F=Promise))(function(me,se){function $e(Vt){try{it(ae.next(Vt))}catch(At){se(At)}}function Et(Vt){try{it(ae.throw(Vt))}catch(At){se(At)}}function it(Vt){var At;Vt.done?me(Vt.value):(At=Vt.value,At instanceof F?At:new F(function(Ft){Ft(At)})).then($e,Et)}it((ae=ae.apply(ie,N||[])).next())})}function kt(ie,N){var F,ae,me,se,$e={label:0,sent:function(){if(1&me[0])throw me[1];return me[1]},trys:[],ops:[]};return se={next:Et(0),throw:Et(1),return:Et(2)},typeof Symbol=="function"&&(se[Symbol.iterator]=function(){return this}),se;function Et(it){return function(Vt){return function(At){if(F)throw new TypeError("Generator is already executing.");for(;$e;)try{if(F=1,ae&&(me=2&At[0]?ae.return:At[0]?ae.throw||((me=ae.return)&&me.call(ae),0):ae.next)&&!(me=me.call(ae,At[1])).done)return me;switch(ae=0,me&&(At=[2&At[0],me.value]),At[0]){case 0:case 1:me=At;break;case 4:return $e.label++,{value:At[1],done:!1};case 5:$e.label++,ae=At[1],At=[0];continue;case 7:At=$e.ops.pop(),$e.trys.pop();continue;default:if(!(me=$e.trys,(me=me.length>0&&me[me.length-1])||At[0]!==6&&At[0]!==2)){$e=0;continue}if(At[0]===3&&(!me||At[1]>me[0]&&At[1]0&&F>0){var ae=new oe(N,F),me=ae.ratio>=1?20:ae.getHorizontalLength(20),se=ae.ratio<1?20:ae.getVerticalLength(20),$e=document.createElementNS("http://www.w3.org/2000/svg","svg");$e.setAttribute("xmlns","http://www.w3.org/2000/svg"),$e.setAttribute("viewBox","0 0 24 24"),document.body.appendChild($e);var Et=rt.createDefs();$e.appendChild(Et);var it=rt.createElement("clipPath",[["id","text-bg-clip"]]);Et.appendChild(it);var Vt=rt.createPath(rt.getHollowRectanglePath((24-me)/2,(24-se)/2,me,se,(24-me)/2+2,(24-se)/2+2,me-4,se-4));$e.appendChild(Vt);var At=rt.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);At.appendChild(rt.createTSpan(N+":"+F)),$e.appendChild(At);var Ft=At.getBBox();rt.setAttributes(At,[["x",((24-Ft.width)/2).toString()],["y",((24-Ft.height)/2-Ft.y).toString()]]);var on=rt.createPath(rt.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Ft.width))/2,(24-Math.ceil(Ft.height))/2,Math.ceil(Ft.width),Math.ceil(Ft.height)));return it.appendChild(on),rt.setAttributes(Vt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild($e),$e.outerHTML}return''},ie}(),Oe=function(ie){function N(F,ae,me){var se=ie.call(this,F,ae)||this;return se.isDropdownOpen=!1,se.onClick=se.dropdownButtonClicked,se.dropdownButtons=me,se}return yt(N,ie),N.prototype.setupDropdown=function(){var F=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(ae){ae.className=F.className,ae.colorsClassName=F.colorsClassName,F.dropdownBlock.appendChild(ae.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},N.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},N.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},N.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},N.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},N.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},N}(K),Je=function(){function ie(N,F){this.GRIP_SIZE=10,this.color=N,this.fillColor=F,this.visual=rt.createGroup(),this.visual.appendChild(rt.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(rt.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return ie.prototype.ownsTarget=function(N){return N===this.visual||N===this.visual.childNodes[0]||N===this.visual.childNodes[1]},ie.prototype.setCenter=function(N,F){this.visual.childNodes.forEach(function(ae){return rt.setAttributes(ae,[["cx",N.toString()],["cy",F.toString()]])})},ie}(),lt=function(){function ie(N,F,ae,me){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=N,this.canvasHeight=F,this.margin=ae,this.container=me,this.attachEvents=this.attachEvents.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.resize=this.resize.bind(this),this.adjustCropRect=this.adjustCropRect.bind(this),this.scaleCanvas=this.scaleCanvas.bind(this),this.getRescaledRect=this.getRescaledRect.bind(this)}return Object.defineProperty(ie.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(N){this._aspectRatio=N,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(N){this._isGridVisible=N,this.gridContainer&&rt.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(N){this._zoomFactor=N,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),ie.prototype.open=function(){var N=this;this.cropShadeElement=rt.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=rt.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var F=0;Fthis.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-F.height/2),rt.setAttributes(this.cropRectElement,[["x",F.x.toString()],["y",F.y.toString()],["width",F.width.toString()],["height",F.height.toString()]]);var ae=F.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(se,$e){var Et=F.y+ae*($e+1);rt.setAttributes(se,[["x1",""+F.x],["y1",""+Et],["x2",""+(F.x+F.width)],["y2",""+Et]])});var me=F.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(se,$e){var Et=F.x+me*($e+1);rt.setAttributes(se,[["x1",""+Et],["y1",""+F.y],["x2",""+Et],["y2",""+(F.y+F.height)]])}),rt.setAttributes(this.cropShadeElement,[["d",rt.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,F.x,F.y,F.width,F.height)]]),this.topLeftGrip.setCenter(F.x,F.y),this.topRightGrip.setCenter(F.x+F.width,F.y),this.bottomLeftGrip.setCenter(F.x,F.y+F.height),this.bottomRightGrip.setCenter(F.x+F.width,F.y+F.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},ie.prototype.attachEvents=function(){this.container.style.touchAction="none",this.container.addEventListener("pointerdown",this.onPointerDown),this.container.addEventListener("pointermove",this.onPointerMove),this.container.addEventListener("pointerup",this.onPointerUp)},ie.prototype.clientToLocalCoordinates=function(N,F){var ae=this.container.getBoundingClientRect();return{x:N-ae.left+this.margin,y:F-ae.top+this.margin}},ie.prototype.onPointerDown=function(N){this.container.setPointerCapture(N.pointerId),this.previousPoint=this.clientToLocalCoordinates(N.clientX,N.clientY),this.cropRectElement===N.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(N.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(N.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(N.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(N.target)&&(this.activeGrip=this.bottomRightGrip)},ie.prototype.onPointerMove=function(N){if(this.isMoving)this.move(this.clientToLocalCoordinates(N.clientX,N.clientY));else if(this.activeGrip){var F=this.clientToLocalCoordinates(N.clientX,N.clientY);this.resize(F)}N.preventDefault()},ie.prototype.onPointerUp=function(N){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(N.pointerId)},ie.prototype.move=function(N){var F=N.x-this.previousPoint.x,ae=N.y-this.previousPoint.y;this.zoomFactor!==1&&(F=-F/this.zoomFactor,ae=-ae/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+F),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+ae),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=N},ie.prototype.resize=function(N){var F=Object.assign({},this.cropRect),ae=N.x-this.previousPoint.x,me=N.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:F.x+aethis.canvasWidth*this.zoomFactor&&(ae=this.canvasWidth*this.zoomFactor-F.width),F.width+=ae}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(F.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(ae),F.height=this.aspectRatio.getVerticalLength(F.width)):(F.y+=me,F.height=this.cropRect.y+this.cropRect.height-F.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?F.height=this.aspectRatio.getVerticalLength(F.width):F.height+=me}F.width<10&&(F.x=this.cropRect.x,F.width=10),F.height<10&&(F.y=this.cropRect.y,F.height=10),this.previousPoint=N,F.x>=this.margin&&F.y>=this.margin&&F.x-this.margin+F.width<=this.canvasWidth&&F.y-this.margin+F.height<=this.canvasHeight&&(this.cropRect=F,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},ie.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var N=this.cropRect.x+this.cropRect.width/2,F=this.cropRect.y+this.cropRect.height/2,ae=this.aspectRatio.getHorizontalLength(this.cropRect.height),me=this.aspectRatio.getVerticalLength(this.cropRect.width);ae/this.canvasWidththis.canvasWidth&&(this.cropRect.height/=this.cropRect.width/this.canvasWidth,this.cropRect.width=this.canvasWidth),this.cropRect.height>this.canvasHeight&&(this.cropRect.width/=this.cropRect.height/this.canvasHeight,this.cropRect.height=this.canvasHeight),this.cropRect.x=N-this.cropRect.width/2,this.cropRect.y=F-this.cropRect.height/2,this.cropRect.x+this.cropRect.width>this.margin+this.canvasWidth&&(this.cropRect.x=this.margin+this.canvasWidth-this.cropRect.width),this.cropRect.y+this.cropRect.height>this.margin+this.canvasHeight&&(this.cropRect.y=this.margin+this.canvasHeight-this.cropRect.height),this.cropRect.x=Math.max(this.cropRect.x,this.margin),this.cropRect.y=Math.max(this.cropRect.y,this.margin)}},ie.prototype.getRescaledRect=function(N,F,ae,me,se,$e){var Et=ae/N,it=me/F;return{x:(se.x-$e)*Et+$e,y:(se.y-$e)*it+$e,width:se.width*Et,height:se.height*it}},ie.prototype.scaleCanvas=function(N,F){var ae=this.getRescaledRect(this.canvasWidth,this.canvasHeight,N,F,this.cropRect,this.margin);this.canvasWidth=N,this.canvasHeight=F,this.onCropChange&&this.onCropChange(ae),this.setCropRectangle(ae)},ie}(),Pt=function(){function ie(N){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=N,this.uiContainer=document.createElement("div"),this.getUI=this.getUI.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.setAngleLabel=this.setAngleLabel.bind(this),this.positionScaleShape=this.positionScaleShape.bind(this)}return Object.defineProperty(ie.prototype,"angle",{get:function(){return this._angle},set:function(N){this._angle=N,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),ie.prototype.getUI=function(){return this.controlContainer=document.createElement("div"),this.controlContainer.title=this.title,this.controlContainer.className=this.className+" "+this.colorsClassName,this.controlContainer.appendChild(this.getVisual()),this.controlContainer.addEventListener("pointerdown",this.onPointerDown),this.controlContainer.addEventListener("pointermove",this.onPointerMove),this.controlContainer.addEventListener("pointerup",this.onPointerUp),this.uiContainer.appendChild(this.controlContainer),this.uiContainer.style.display="inline-block",this.uiContainer.style.touchAction="none",this.setAngleLabel(),this.positionScaleShape(),this.uiContainer},ie.prototype.onPointerDown=function(N){this.controlContainer.setPointerCapture(N.pointerId),this.isDragging=!0,this.previousPoint={x:N.clientX,y:N.clientY}},ie.prototype.onPointerMove=function(N){this.isDragging&&(this.onAngleChange&&this.onAngleChange((N.clientX-this.previousPoint.x)/5),this.previousPoint.x=N.clientX)},ie.prototype.onPointerUp=function(N){this.isDragging&&this.onAngleChange&&this.onAngleChange((N.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(N.pointerId)},ie.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var N=this.angleLabelText.getBBox();rt.setAttributes(this.angleLabelElement,[["x",((this.width-N.width)/2).toString()],["y",(this.height/2).toString()]])}},ie.prototype.positionScaleShape=function(){if(this.scaleShape){var N=this.scaleShape.transform.baseVal.getItem(0);N.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(N,0)}},ie.prototype.getVisual=function(){var N=document.createElementNS("http://www.w3.org/2000/svg","svg");N.setAttribute("xmlns","http://www.w3.org/2000/svg"),N.setAttribute("width",this.width+"px"),N.setAttribute("height",this.height+"px"),N.setAttribute("viewBox","0 0 "+this.width+" "+this.height),N.style.flexShrink="0",document.body.appendChild(N);for(var F="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,ae=1;ae<=this.width/5+10;ae++){var me=ae%5==0?this.height/3:this.height/6;F+="h4v"+-me+"h1v"+me}F+="v1H0Z",this.scaleShape=rt.createPath(F);var se=rt.createTransform();this.scaleShape.transform.baseVal.appendItem(se),N.appendChild(this.scaleShape),this.angleLabelElement=rt.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=rt.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var $e=rt.createTSpan("");return $e.innerHTML="°",this.angleLabelElement.appendChild($e),N.appendChild(this.angleLabelElement),document.body.removeChild(N),N},ie}(),Nt=function(){function ie(){this.naturalSize=!1,this.imageType="image/png"}return ie.prototype.rasterize=function(N,F,ae,me,se,$e,Et){var it=this;return new Promise(function(Vt){var At=document.createElement("canvas");At.width=N.width.baseVal.value-2*me,At.height=N.height.baseVal.value-2*me;var Ft=1,on=1;it.naturalSize===!0?(Ft=F.naturalWidth/(N.width.baseVal.value-2*me)/$e,on=F.naturalHeight/(N.height.baseVal.value-2*me)/Et,At.width=F.naturalWidth/$e,At.height=F.naturalHeight/Et):it.width!==void 0&&it.height!==void 0&&(Ft=it.width/ae.width,on=it.height/ae.height,At.width*=Ft,At.height*=on);var In=At.getContext("2d");In.translate(At.width/2,At.height/2),In.rotate(se*Math.PI/180),In.scale($e,Et),In.translate(-At.width/2,-At.height/2),In.drawImage(F,0,0,At.width,At.height);var Lr=document.createElement("canvas");Lr.width=ae.width*Ft,Lr.height=ae.height*on,Lr.getContext("2d").putImageData(In.getImageData((ae.x-me)*Ft,(ae.y-me)*on,ae.width*Ft,ae.height*on),0,0),Vt(Lr.toDataURL(it.imageType,it.imageQuality))})},ie}(),ht=function(){function ie(N){this._zoomToCropEnabled=!0,this.zoomFactor=1,this.flippedHorizontally=!1,this.flippedVertically=!1,this._isGridVisible=!0,this._gridLines=2,this._rotationAngle=0,this.scaleFactor=1,this.renderEventListeners=[],this.closeEventListeners=[],this._isOpen=!1,this.CANVAS_MARGIN=20,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.displayMode="inline",this.popupMargin=30,this.toolbarHeight=40,this.aspectRatios=[{horizontal:0,vertical:0},{horizontal:4,vertical:3},{horizontal:3,vertical:2},{horizontal:16,vertical:9},{horizontal:1,vertical:1},{horizontal:3,vertical:4},{horizontal:2,vertical:3},{horizontal:9,vertical:16}],this._instanceNo=ie.instanceCounter++,this.styles=new wt(this.instanceNo),this.target=N,this.targetRoot=document.body,this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.rotateBy=this.rotateBy.bind(this),this.applyRotation=this.applyRotation.bind(this),this.cropRectChanged=this.cropRectChanged.bind(this),this.zoomToCrop=this.zoomToCrop.bind(this),this.unzoomFromCrop=this.unzoomFromCrop.bind(this),this.rotateLeftButtonClicked=this.rotateLeftButtonClicked.bind(this),this.rotateRightButtonClicked=this.rotateRightButtonClicked.bind(this),this.flipHorizontallyButtonClicked=this.flipHorizontallyButtonClicked.bind(this),this.flipVerticallyButtonClicked=this.flipVerticallyButtonClicked.bind(this),this.applyFlip=this.applyFlip.bind(this),this.startRenderAndClose=this.startRenderAndClose.bind(this),this.render=this.render.bind(this),this.onPopupResize=this.onPopupResize.bind(this),this.applyAspectRatio=this.applyAspectRatio.bind(this)}return Object.defineProperty(ie.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(N){this._zoomToCropEnabled=N,N?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(N){this._isGridVisible=N,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"gridLines",{get:function(){return this._gridLines},set:function(N){this._gridLines=N,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(N){this._rotationAngle=N,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"aspectRatio",{get:function(){var N;return(N=this._aspectRatio)!==null&&N!==void 0?N:this.aspectRatios[0]},set:function(N){this._aspectRatio=N},enumerable:!1,configurable:!0}),ie.prototype.open=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.setupResizeObserver(),this.initCropCanvas(),this.setEditingTarget(),this.setTopLeft(),this.initCropLayer(),this.attachEvents(),this.applyAspectRatio(),this.displayMode==="popup"&&this.onPopupResize(),this._isOpen=!0},ie.prototype.show=function(){this.showUI(),this.open()},ie.prototype.close=function(N){N===void 0&&(N=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),N||this.closeEventListeners.forEach(function(F){return F()}),this._isOpen=!1)},ie.prototype.addRenderEventListener=function(N){this.renderEventListeners.push(N)},ie.prototype.removeRenderEventListener=function(N){this.renderEventListeners.indexOf(N)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(N),1)},ie.prototype.addCloseEventListener=function(N){this.closeEventListeners.push(N)},ie.prototype.removeCloseEventListener=function(N){this.closeEventListeners.indexOf(N)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(N),1)},ie.prototype.setupResizeObserver=function(){var N=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){N.resize(N.target.clientWidth,N.target.clientHeight)}),this.targetObserver.observe(this.target)):this.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(this.onPopupResize),this.targetObserver.observe(this.contentDiv)),window.addEventListener("resize",this.setWindowHeight))},ie.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var N=1*this.target.clientWidth/this.target.clientHeight,F=this.contentDiv.clientWidth/N>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*N:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,ae=F+2*this.CANVAS_MARGINN+this.CANVAS_MARGIN?this.target.offsetTop-(N+this.CANVAS_MARGIN):0;this.coverDiv.style.top=F+"px",this.coverDiv.style.left=(this.target.offsetLeft>this.CANVAS_MARGIN?this.target.offsetLeft-this.CANVAS_MARGIN:0)+"px",this.coverDiv.style.width=this.target.offsetWidth+this.CANVAS_MARGIN+"px",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.displayMode==="popup"?this.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.addToolbars(),this.uiDiv.appendChild(this.topToolbar.getUI()),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.alignItems="center",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.contentDiv.style.overflow="hidden",this.contentDiv.style.backgroundColor=this.styles.settings.canvasBackgroundColor,this.displayMode==="popup"&&(this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.popupMargin+"px)"),this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.contentDiv.appendChild(this.editorCanvas),this.uiDiv.appendChild(this.bottomToolbar.getUI()),this.straightener.angle=this.rotationAngle},ie.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},ie.prototype.addTopToolbar=function(){var N=this;this.topToolbar=new Zt,this.topToolbar.display=this.styles.settings.hideTopToolbar?"none":"",this.topToolbar.className=this.toolbarStyleClass.name,this.topToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.topToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.topToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.topToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.topToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.topToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var F=new ve;F.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(F);var ae=[];this.aspectRatios.forEach(function(on){var In=new K(he.getIcon(on.horizontal,on.vertical),on.horizontal===0&&on.vertical===0?"FREE":on.horizontal+":"+on.vertical);In.onClick=function(){return N.ratioButtonClicked(on)},ae.push(In)}),this.aspectRatioButton=new Oe(he.getIcon(0,0),"Aspect ratio",ae),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,F.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var me=new K('',"Toggle grid");me.isActive=this.isGridVisible,me.onClick=function(){N.isGridVisible=!N.isGridVisible,me.isActive=N.isGridVisible},F.addButton(me);var se=new K('',"Zoom to selection");if(se.isActive=this.zoomToCropEnabled,se.onClick=function(){N.zoomToCropEnabled=!N.zoomToCropEnabled,se.isActive=N.zoomToCropEnabled},F.addButton(se),!Dt.isLicensed){var $e=new Z;this.topToolbar.addElementBlock($e);var Et=document.createElement("div");Et.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var it=document.createElement("a");it.style.color="currentColor",it.href="https://markerjs.com/products/cropro",it.target="_blank",it.innerHTML='',Et.appendChild(it),$e.addElement(Et)}var Vt=new ve;Vt.minWidth=3*this.toolbarHeight+"px",Vt.contentAlign="end",this.topToolbar.addButtonBlock(Vt);var At=new K('',"OK");At.onClick=this.startRenderAndClose,Vt.addButton(At),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(At.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Ft=new K('',"Close");Ft.onClick=this.close,Vt.addButton(Ft),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Ft.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},ie.prototype.addBottomToolbar=function(){var N=this;this.bottomToolbar=new Zt,this.bottomToolbar.display=this.styles.settings.hideBottomToolbar?"none":"",this.bottomToolbar.className=this.toolbarStyleClass.name,this.bottomToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.bottomToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.bottomToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.bottomToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.bottomToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.bottomToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var F=new ve;F.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(F);var ae=new K('',"Rotate left");ae.onClick=this.rotateLeftButtonClicked,F.addButton(ae);var me=new K('',"Rotate right");me.onClick=this.rotateRightButtonClicked,F.addButton(me);var se=new Z;se.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(se),this.straightener=new Pt("Straighten"),this.straightener.className=this.toolbarStraightenerStyleClass.name,this.straightener.colorsClassName=this.styles.settings.toolbarStraightenerColorsClassName?this.styles.settings.toolbarStraightenerColorsClassName:this.toolbarStraightenerStyleColorsClass.name,this.straightener.onAngleChange=function(Vt){N.rotateBy(Vt),N.straightener.angle=N.rotationAngle},se.addElement(this.straightener.getUI());var $e=new ve;$e.minWidth=2*this.toolbarHeight+"px",$e.contentAlign="end",this.bottomToolbar.addButtonBlock($e);var Et=new K('',"Flip horizontal");Et.onClick=this.flipHorizontallyButtonClicked,$e.addButton(Et);var it=new K('',"Flip vertical");it.onClick=this.flipVerticallyButtonClicked,$e.addButton(it)},ie.prototype.ratioButtonClicked=function(N){this.aspectRatio=N,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},ie.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=he.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},ie.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new oe(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},ie.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},ie.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},ie.prototype.restoreState=function(N){if(N){var F=this.cropLayer.getRescaledRect(N.width,N.height,this.imageWidth,this.imageHeight,N.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(F),this.cropRectChanged(F),this.flippedHorizontally=N.flippedHorizontally,this.flippedVertically=N.flippedVertically,this.applyFlip(),this.rotationAngle=N.rotationAngle,this.applyRotation()}},ie.prototype.clientToLocalCoordinates=function(N,F){var ae=this.cropImage.getBoundingClientRect();return{x:N-ae.left,y:F-ae.top}},ie.prototype.onWindowResize=function(){this.positionUI()},ie.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var N=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=N+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)"}this.positionCropImage()},ie.prototype.rotateLeftButtonClicked=function(){var N=this.rotationAngle-90;this.rotationAngle%90!=0&&(N+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(N)},ie.prototype.rotateRightButtonClicked=function(){var N=this.rotationAngle+90;this.rotationAngle%90!=0&&(N-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(N)},ie.prototype.rotateTo=function(N){N=(N=N>180?N-360:N)<=-180?N+360:N,this.rotationAngle=N,this.applyRotation()},ie.prototype.rotateBy=function(N){this.rotateTo((this.rotationAngle+N)%360)},ie.prototype.applyRotation=function(){var N=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var F=this.editingTargetRotationContainer.transform.baseVal.getItem(0);F.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(F,0);var ae=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/ae.width,this.imageHeight/ae.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=N},ie.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},ie.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},ie.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},ie.prototype.startRenderAndClose=function(){return ot(this,void 0,void 0,function(){var N,F;return kt(this,function(ae){switch(ae.label){case 0:return[4,this.render()];case 1:return N=ae.sent(),F=this.getState(),this.renderEventListeners.forEach(function(me){return me(N,F)}),this.close(!0),[2]}})})},ie.prototype.render=function(){return ot(this,void 0,void 0,function(){var N;return kt(this,function(F){switch(F.label){case 0:return(N=new Nt).naturalSize=this.renderAtNaturalSize,N.imageType=this.renderImageType,N.imageQuality=this.renderImageQuality,N.width=this.renderWidth,N.height=this.renderHeight,this.unzoomFromCrop(),rt.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,N.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 1:return F.sent(),[4,N.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 2:return[2,F.sent()]}})})},ie.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new zt("toolbar",` width: `+(this.displayMode==="inline"?"100%":"calc(100vw - "+2*this.popupMargin+"px)")+`; flex-shrink: 0; display: flex; flex-direction: row; justify-content: space-between; height: `+this.toolbarHeight+`px; box-sizing: content-box; overflow: hidden; line-height: 0px; `)),this.toolbarStyleColorsClass=this.styles.addClass(new zt("toolbar_colors",` background-color: `+this.styles.settings.toolbarBackgroundColor+`; `)),this.toolbarBlockStyleClass=this.styles.addClass(new zt("toolbar-block",` display: flex; align-items: center; box-sizing: content-box; `));var N=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new zt("toolbar_button",` display: inline-block; width: `+(this.toolbarHeight-2*N)+`px; height: `+(this.toolbarHeight-2*N)+`px; padding: `+N+`px; cursor: default; user-select: none; box-sizing: content-box; `)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new zt("toolbar_button_colors",` color: `+this.styles.settings.toolbarColor+`; fill: currentColor; `)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new zt("toolbar_active_button",` color: `+this.styles.settings.toolbarColor+`; fill: currentColor; background-color: `+this.styles.settings.toolbarBackgroundActiveColor+` `)),this.styles.addRule(new Bt("."+this.toolbarButtonStyleClass.name+" svg",` height: `+this.toolbarHeight/2+`px; `)),this.styles.addRule(new Bt("."+this.toolbarButtonStyleColorsClass.name+":hover",` background-color: `+this.styles.settings.toolbarBackgroundHoverColor+` `)),this.toolbarDropdownStyleClass=this.styles.addClass(new zt("toolbar_dropdown",` position: absolute; max-width: `+4*this.toolbarHeight+`px; z-index: 20; white-space: normal; box-sizing: content-box; box-shadow: 3px 3px rgba(33, 33, 33, 0.1); margin: `+(this.displayMode==="inline"?"0":this.popupMargin)+`px; line-height: 0px; `)),this.toolbarDropdownStyleColorsClass=this.styles.addClass(new zt("toolbar_dropdown_colors",` background-color: `+this.styles.settings.toolbarBackgroundColor+`; `)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new zt("toolbar_straightener_block",` display: flex; overflow: hidden; justify-content: center; -webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 30%, rgba(0,0,0,1) 70%, rgba(0,0,0,0) 100%); `)),this.toolbarStraightenerStyleClass=this.styles.addClass(new zt("toolbar_straightener",` display: flex; overflow: hidden; justify-content: center; height: `+(this.toolbarHeight-2*N)+`px; padding: `+N+`px; cursor: default; user-select: none; box-sizing: content-box; `)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new zt("toolbar_straightener_colors",` color: `+this.styles.settings.toolbarColor+`; fill: currentColor; `))},ie.instanceCounter=0,ie}(),Mt=z("8hTe"),nn=z.n(Mt),Rt=/]*>/g;function cn(ie){var N=document.createElement("div");return N.innerHTML=ie,N.childNodes.length===0?"":N.childNodes[0].nodeValue}var an=Ve.a=function(ie){var N=ie.value,F=N===void 0?"":N,ae=ie.edit,me=ae===void 0?!1:ae,se=ie.className,$e=ie.showTextOnly,Et=ie.showLines,it=ie.replaces,Vt=ie.zoomImg,At=ie.hasMask,Ft=ie.style,on=Ft===void 0?{}:Ft,In=ie.stylesPrev,Lr=In===void 0?{}:In,Sr=String(F),Un=Object(p.useRef)(),ur=Object(p.useRef)(),mi=Object(p.useState)(""),Ar=Object(T.a)(mi,2),fr=Ar[0],br=Ar[1],Xr=Object(p.useState)("office"),Dr=Object(T.a)(Xr,2),Yr=Dr[0],gr=Dr[1],gi=function(){var wn=new ht(ur.current);wn.displayMode="popup",wn.addRenderEventListener(function(){var _r=Object(_.a)(c.a.mark(function qn(kr){var hr;return c.a.wrap(function(Nr){for(;;)switch(Nr.prev=Nr.next){case 0:return Un.current.style.display="none",Nr.next=3,Object(ce.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:kr}});case 3:hr=Nr.sent,hr!=null&&hr.id&&it(ur.current.getAttribute("src").replace(ne.a.API_SERVER,""),"/api/attachments/".concat(hr==null?void 0:hr.id,"?type=").concat(hr.content_type));case 5:case"end":return Nr.stop()}},qn)}));return function(qn){return _r.apply(this,arguments)}}()),wn.show()},si=function(){var wn=new Pe(ur.current);wn.settings.displayMode="popup",wn.addEventListener("render",function(){var _r=Object(_.a)(c.a.mark(function qn(kr){var hr;return c.a.wrap(function(Nr){for(;;)switch(Nr.prev=Nr.next){case 0:if(Un.current.style.display="none",!ur.current){Nr.next=6;break}return Nr.next=4,Object(ce.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:kr.dataUrl}});case 4:hr=Nr.sent,hr!=null&&hr.id&&it(ur.current.getAttribute("src").replace(ne.a.API_SERVER,""),"/api/attachments/".concat(hr==null?void 0:hr.id,"?type=").concat(hr.content_type));case 6:case"end":return Nr.stop()}},qn)}));return function(qn){return _r.apply(this,arguments)}}()),wn.show(),window.markerArea=wn},Pr=Object(p.useMemo)(function(){try{var Fn=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,wn=/\"\/api\/attachments\/|\"\/attachments\/download\//g,_r=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Sr=Sr.replace(Fn,"("+ne.a.API_SERVER+"/api/attachments/").replace(wn,'"'+ne.a.API_SERVER+"/api/attachments/").replace(_r,'"'+ne.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,` `),Sr=Sr.replace(new RegExp("(?[TOC]

    ",E()),v()),qn=qn.replace(/(__special_katext_id_\d+__)/g,function(Ui,Nr){var Ur=kr[Nr],yi=Ur.type,Zr=Ur.expression;return Object($.renderToString)(cn(Zr)||"",{displayMode:yi==="block",throwOnError:!1,output:"html"})}),qn=qn.replace(/▁/g,"\u2581\u2581\u2581"),A(),$e){var hr=document.createElement("div");return hr.innerHTML=qn,hr.innerText}return setTimeout(function(){return vi()},500),qn},[Sr]),Fr=Object(p.useRef)();g.WebkitLineClamp=Et,Et&&(on=Object(P.a)(Object(P.a)({},on),g));function Ei(Fn){var wn=Fn.target;if(wn.tagName.toUpperCase()==="IMG"){if(Vt){var _r=wn.getAttribute("src");br(_r),gr("image")}}else if(wn.tagName.toUpperCase()==="A"){var qn=wn.getAttribute("href");if(qn.indexOf("office")>-1)Fn.preventDefault(),br(qn),gr("office");else if(qn.indexOf("application/pdf")>-1)Fn.preventDefault(),br(qn),gr("pdf");else if(qn.indexOf("type=text")>-1)Fn.preventDefault(),br(qn),gr("html");else if(qn.startsWith("#")){Fn.preventDefault();var kr=document.getElementById(qn.replace("#",""));kr&&kr.scrollIntoView(!0)}}}var vi=function(){var wn,_r=(wn=Fr.current)===null||wn===void 0?void 0:wn.querySelectorAll("video");_r==null||_r.forEach(function(qn){if(qn.oncontextmenu=function(){return!1},qn.src.indexOf(".m3u8")>-1&&!qn.canPlayType("application/vnd.apple.mpegurl")){if(X.a.isSupported()){var kr=new X.a;kr.loadSource(qn.src),kr.attachMedia(qn)}}})};Object(p.useEffect)(function(){if(Fr.current&&Pr&&(Pr.match(Rt)&&window.PR.prettyPrint()),Fr.current)return Fr.current.addEventListener("click",Ei),function(){Fr.current.removeEventListener("click",Ei),A(),v()}},[Pr,Fr.current,Ei]);var di=function(wn){if(!me)return;wn.target.nodeName==="IMG"?(Un.current.style.display="flex",Un.current.style.width=wn.target.clientWidth+"px",Un.current.style.height=wn.target.clientHeight+"px",Un.current.style.top=wn.target.offsetTop+"px",Un.current.style.left=wn.target.offsetLeft+"px",ur.current.src=wn.target.getAttribute("src")):Un.current.style.display="none"};return u.a.createElement("div",{style:{position:"relative"}},u.a.createElement("div",{ref:Fr,style:Object(P.a)({},on),className:"".concat(se||""," markdown-body ").concat(nn.a.mdBody),onMouseOver:di,dangerouslySetInnerHTML:{__html:Pr}}),u.a.createElement("div",{ref:Un,className:nn.a.button},u.a.createElement(Q.a,null,u.a.createElement(w.a,{onClick:function(){return gi()}},"\u88C1\u526A"),u.a.createElement(w.a,{onClick:function(){return si()}},"\u7F16\u8F91"))),u.a.createElement("img",{ref:ur,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1,top:"-10000px"}}),u.a.createElement(ee.a,{close:!0,data:fr,hasMask:At,type:fr!=null&&fr.length?Yr:"",style:Object(P.a)({},Lr),onClose:function(){return br("")}}))}},"9VGf":function(et,Ve,z){"use strict";z.d(Ve,"a",function(){return j});var le=z("q1tI"),Q=z.n(le);function j(w,P){var _=Object(le.useRef)();Object(le.useEffect)(function(){_.current=w}),Object(le.useEffect)(function(){function T(){_.current()}if(P!==null){var C=setInterval(T,P);return function(){return clearInterval(C)}}},[P])}},AMnG:function(et,Ve,z){"use strict";var le=z("miYZ"),Q=z("tsqr"),j=z("tJVT"),w=z("q1tI"),P=z.n(w),_=z("nWbc"),T=z.n(_),C=z("Ot1p");Ve.a=function(c){var p=c.id,u=c.activeDiscussIndex,o=c.onReplyDiscuss,a=Object(w.useState)(""),d=Object(j.a)(a,2),s=d[0],f=d[1];function i(t){f(t)}function n(){if(!s){Q.b.info("\u56DE\u590D\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7A7A!");return}o(p,s),f("")}return P.a.createElement("div",{key:p,className:"discuss-item-editor",style:{display:u===p?"block":"none",width:"100%"}},P.a.createElement(C.a,{miniToolbar:!0,startInit:u===p,defaultValue:s,id:p,noStorage:!0,watch:!1,height:155,placeholder:"\u6211\u8981\u56DE\u590D",showResizeBar:!0,onChange:i}),P.a.createElement("a",{onClick:n,className:"btn-send"},"\u53D1\u9001"))}},Aky1:function(et,Ve,z){"use strict";z.d(Ve,"a",function(){return c});var le=z("ErOA"),Q=z("ppsT"),j=z.n(Q),w="",P,_="";function T(p){C(p)}function C(p){P=new j.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),p.addFileSuccess&&p.addFileSuccess(o),P.startUpload()},onUploadstarted:function(o){var a=o.file.name;if(o.videoId){var f="/api/users/".concat(w,"/video_auths.json");Object(le.a)(f,{method:"put",body:{video_id:o.videoId,title:a,file_name:a,virtual_classroom_id:_}}).then(function(i){if(i.status==-1){p.onUploadError&&p.onUploadError(o);return}var n=i.data,t=n.UploadAuth,h=n.UploadAddress,v=n.VideoId;P.setUploadAuthAndAddress(o,t,h)}).catch(function(i){P.deleteFile(P._curIndex),P.nextUpload(),console.log(i)})}else{var d="/api/users/".concat(w,"/video_auths.json"),s="";Object(le.a)(d,{method:"Post",body:{title:s+a,file_name:s+a,virtual_classroom_id:_}}).then(function(i){if(i){var n=i.data,t=n.UploadAuth,h=n.UploadAddress,v=n.VideoId;P.setUploadAuthAndAddress(o,t,h,v)}}).catch(function(i){P.deleteFile(P._curIndex),P.nextUpload(),console.log(i)}),console.log("\u6587\u4EF6\u5F00\u59CB\u4E0A\u4F20...")}},onUploadSucceed:function(o){p.onUploadSucceed&&p.onUploadSucceed(o),console.log("\u6587\u4EF6\u4E0A\u4F20\u6210\u529F!")},onUploadFailed:function(o,a,d){p.onUploadFailed&&p.onUploadFailed(o),console.log("\u6587\u4EF6\u4E0A\u4F20\u5931\u8D25!")},onUploadCanceled:function(o,a,d){console.log("\u6587\u4EF6\u4E0A\u4F20\u5DF2\u6682\u505C!")},onUploadProgress:function(o,a,d){p.onUploadProgress&&p.onUploadProgress(o,a,d);var s=Math.ceil(d*100);console.log("\u6587\u4EF6\u4E0A\u4F20\u4E2D...")},onUploadTokenExpired:function(o){console.log("\u6587\u4EF6\u4E0A\u4F20\u8D85\u65F6!");var a="/api/users/".concat(w,"/video_auths.json");Object(le.a)(a,{method:"put",body:{video_id:o.videoId}}).then(function(d){var s=d.data,f=s.UploadAuth;P.resumeUploadWithAuth(f)}).catch(function(d){console.log(d)})},onUploadEnd:function(o){p.onUploadEnd&&p.onUploadEnd(o),console.log("onUploadEnd: uploaded all the files")}}),p.gotUploader&&p.gotUploader(P)}function c(p,u,o){p&&(w=p),u&&(_=u),T(o)}},BU3w:function(et,Ve,z){"use strict";z.d(Ve,"a",function(){return _});var le=z("MNnm"),Q="rc-util-key";function j(T){if(T.attachTo)return T.attachTo;var C=document.querySelector("head");return C||document.body}function w(T){var C,c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(le.a)())return null;var p=document.createElement("style");if((C=c.csp)===null||C===void 0?void 0:C.nonce){var u;p.nonce=(u=c.csp)===null||u===void 0?void 0:u.nonce}p.innerHTML=T;var o=j(c),a=o.firstChild;return c.prepend&&o.prepend?o.prepend(p):c.prepend&&a?o.insertBefore(p,a):o.appendChild(p),p}var P=new Map;function _(T,C){var c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},p=j(c);if(!P.has(p)){var u=w("",c),o=u.parentNode;P.set(p,o),o.removeChild(u)}var a=Array.from(P.get(p).children).find(function(n){return n.tagName==="STYLE"&&n[Q]===C});if(a){var d,s;if(((d=c.csp)===null||d===void 0?void 0:d.nonce)&&a.nonce!==((s=c.csp)===null||s===void 0?void 0:s.nonce)){var f;a.nonce=(f=c.csp)===null||f===void 0?void 0:f.nonce}return a.innerHTML!==T&&(a.innerHTML=T),a}var i=w(T,c);return i[Q]=C,i}},Bd2K:function(et,Ve,z){(function(le){le(z("VrN/"),z("osHv"))})(function(le){le.defineOption("autoCloseTags",!1,function(c,p,u){if(u!=le.Init&&u&&c.removeKeyMap("autoCloseTags"),!p)return;var o={name:"autoCloseTags"};(typeof p!="object"||p.whenClosing!==!1)&&(o["'/'"]=function(a){return _(a)}),(typeof p!="object"||p.whenOpening!==!1)&&(o["'>'"]=function(a){return w(a)}),c.addKeyMap(o)});var Q=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],j=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function w(c){if(c.getOption("disableInput"))return le.Pass;for(var p=c.listSelections(),u=[],o=c.getOption("autoCloseTags"),a=0;ad.ch&&(t=t.slice(0,t.length-s.end+d.ch));var b=t.toLowerCase();if(!t||s.type=="string"&&(s.end!=d.ch||!/[\"\']/.test(s.string.charAt(s.string.length-1))||s.string.length==1)||s.type=="tag"&&n.close||s.string.indexOf("/")==d.ch-s.start-1||v&&T(v,b)>-1||C(c,f.mode.xmlCurrentContext&&f.mode.xmlCurrentContext(i)||[],t,d,!0))return le.Pass;var E=typeof o=="object"&&o.emptyTags;if(E&&T(E,t)>-1){u[a]={text:"/>",newPos:le.Pos(d.line,d.ch+2)};continue}var m=g&&T(g,b)>-1;u[a]={indent:m,text:">"+(m?` `:"")+"",newPos:m?le.Pos(d.line+1,0):le.Pos(d.line,d.ch+1)}}for(var y=typeof o=="object"&&o.dontIndentOnAutoClose,a=p.length-1;a>=0;a--){var x=u[a];c.replaceRange(x.text,p[a].head,p[a].anchor,"+insert");var l=c.listSelections().slice(0);l[a]={head:x.newPos,anchor:x.newPos},c.setSelections(l),!y&&x.indent&&(c.indentLine(x.newPos.line,null,!0),c.indentLine(x.newPos.line+1,null,!0))}}function P(c,p){for(var u=c.listSelections(),o=[],a=p?"/":""&&(v+=">"),o[f]=v}if(c.replaceSelections(o),u=c.listSelections(),!s)for(var f=0;f=0&&p[i]==u;i--)++f;o=s.to;for(var i=1;i0){for(var p=0;p1&&arguments[1]!==void 0?arguments[1]:"",p=[],u=0;u=0;p--){var u=j().key(p);c(w(u),u)}}function T(c){return j().removeItem(c)}function C(){return j().clear()}},D1Df:function(et,Ve,z){"use strict";function le(D){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?le=function(B){return typeof B}:le=function(B){return B&&typeof Symbol=="function"&&B.constructor===Symbol&&B!==Symbol.prototype?"symbol":typeof B},le(D)}function Q(){return Q=Object.assign||function(D){for(var I=1;I=0)continue;if(!Object.prototype.propertyIsEnumerable.call(D,H))continue;B[H]=D[H]}}return B}function _(D,I){if(D==null)return{};var B={},H=Object.keys(D),te,W;for(W=0;W=0)continue;B[te]=D[te]}return B}function T(D,I){if(!(D instanceof I))throw new TypeError("Cannot call a class as a function")}function C(D,I){for(var B=0;B>6),I+=String.fromCharCode(128|H&63)):H<55296||H>=57344?(I+=String.fromCharCode(224|H>>12),I+=String.fromCharCode(128|H>>6&63),I+=String.fromCharCode(128|H&63)):(B++,H=65536+((H&1023)<<10|D.charCodeAt(B)&1023),I+=String.fromCharCode(240|H>>18),I+=String.fromCharCode(128|H>>12&63),I+=String.fromCharCode(128|H>>6&63),I+=String.fromCharCode(128|H&63))}return I}var v={size:128,level:"L",bgColor:"#FFFFFF",fgColor:"#000000",includeMargin:!1},g={},b=4,E=.1;function m(D){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,B=[];return D.forEach(function(H,te){var W=null;H.forEach(function(V,X){if(!V&&W!==null){B.push("M".concat(W+I," ").concat(te+I,"h").concat(X-W,"v1H").concat(W+I,"z")),W=null;return}if(X===H.length-1){if(!V)return;W===null?B.push("M".concat(X+I,",").concat(te+I," h1v1H").concat(X+I,"z")):B.push("M".concat(W+I,",").concat(te+I," h").concat(X+1-W,"v1H").concat(W+I,"z"));return}V&&W===null&&(W=X)})}),B.join("")}function y(D,I){return D.slice().map(function(B,H){return H=I.y+I.h?B:B.map(function(te,W){return W=I.x+I.w?te:!1})})}function x(D,I){var B=D.imageSettings,H=D.size,te=D.includeMargin;if(B==null)return null;var W=te?b:0,V=I.length+W*2,X=Math.floor(H*E),ne=V/H,$=(B.width||X)*ne,ee=(B.height||X)*ne,ce=B.x==null?I.length/2-$/2:B.x*ne,de=B.y==null?I.length/2-ee/2:B.y*ne,Ce=null;if(B.excavate){var Se=Math.floor(ce),De=Math.floor(de),be=Math.ceil($+ce-Se),_e=Math.ceil(ee+de-De);Ce={x:Se,y:De,w:be,h:_e}}return{x:ce,y:de,h:ee,w:$,excavation:Ce}}var l=function(){try{new Path2D().addPath(new Path2D)}catch(D){return!1}return!0}(),S=function(D){a(I,D);function I(){var B,H;T(this,I);for(var te=arguments.length,W=new Array(te),V=0;VFe.length)&&(Ie=Fe.length);for(var Me=0,Ee=new Array(Ie);Me=Fe.length?{done:!0}:{done:!1,value:Fe[Ee++]}}}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 Me=Fe[Symbol.iterator](),Me.next.bind(Me)}function _(Fe,Ie){return Ie={exports:{}},Fe(Ie,Ie.exports),Ie.exports}var T=_(function(Fe){function Ie(){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 Me(Ee){Fe.exports.defaults=Ee}Fe.exports={defaults:Ie(),getDefaults:Ie,changeDefaults:Me}}),C=T.defaults,c=T.getDefaults,p=T.changeDefaults,u=/[&<>"']/,o=/[&<>"']/g,a=/[<>"']|&(?!#?\w+;)/,d=/[<>"']|&(?!#?\w+;)/g,s={"&":"&","<":"<",">":">",'"':""","'":"'"},f=function(Ie){return s[Ie]};function i(Fe,Ie){if(Ie){if(u.test(Fe))return Fe.replace(o,f)}else if(a.test(Fe))return Fe.replace(d,f);return Fe}var n=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function t(Fe){return Fe.replace(n,function(Ie,Me){return Me=Me.toLowerCase(),Me==="colon"?":":Me.charAt(0)==="#"?Me.charAt(1)==="x"?String.fromCharCode(parseInt(Me.substring(2),16)):String.fromCharCode(+Me.substring(1)):""})}var h=/(^|[^\[])\^/g;function v(Fe,Ie){Fe=Fe.source||Fe,Ie=Ie||"";var Me={replace:function(Ae,Le){return Le=Le.source||Le,Le=Le.replace(h,"$1"),Fe=Fe.replace(Ae,Le),Me},getRegex:function(){return new RegExp(Fe,Ie)}};return Me}var g=/[^\w:]/g,b=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function E(Fe,Ie,Me){if(Fe){var Ee;try{Ee=decodeURIComponent(t(Me)).replace(g,"").toLowerCase()}catch(Ae){return null}if(Ee.indexOf("javascript:")===0||Ee.indexOf("vbscript:")===0||Ee.indexOf("data:")===0)return null}Ie&&!b.test(Me)&&(Me=S(Ie,Me));try{Me=encodeURI(Me).replace(/%25/g,"%")}catch(Ae){return null}return Me}var m={},y=/^[^:]+:\/*[^/]*$/,x=/^([^:]+:)[\s\S]*$/,l=/^([^:]+:\/*[^/]*)[\s\S]*$/;function S(Fe,Ie){m[" "+Fe]||(y.test(Fe)?m[" "+Fe]=Fe+"/":m[" "+Fe]=I(Fe,"/",!0)),Fe=m[" "+Fe];var Me=Fe.indexOf(":")===-1;return Ie.substring(0,2)==="//"?Me?Ie:Fe.replace(x,"$1")+Ie:Ie.charAt(0)==="/"?Me?Ie:Fe.replace(l,"$1")+Ie:Fe+Ie}var O={exec:function(){}};function A(Fe){for(var Ie=1,Me,Ee;Ie=0&&Ze[Tt]==="\\";)ut=!ut;return ut?"|":" |"}),Ee=Me.split(/ \|/),Ae=0;if(Ee.length>Ie)Ee.splice(Ie);else for(;Ee.length=Ee.length?Ae.slice(Ee.length):Ae}).join(` `)}var de=function(){function Fe(Me){this.options=Me||W}var Ie=Fe.prototype;return Ie.space=function(Ee){var Ae=this.rules.block.newline.exec(Ee);if(Ae)return Ae[0].length>1?{type:"space",raw:Ae[0]}:{raw:` `}},Ie.code=function(Ee,Ae){var Le=this.rules.block.code.exec(Ee);if(Le){var Te=Ae[Ae.length-1];if(Te&&Te.type==="paragraph")return{raw:Le[0],text:Le[0].trimRight()};var Ze=Le[0].replace(/^ {4}/gm,"");return{type:"code",raw:Le[0],codeBlockStyle:"indented",text:this.options.pedantic?Ze:V(Ze,` `)}}},Ie.fences=function(Ee){var Ae=this.rules.block.fences.exec(Ee);if(Ae){var Le=Ae[0],Te=ce(Le,Ae[3]||"");return{type:"code",raw:Le,lang:Ae[2]?Ae[2].trim():Ae[2],text:Te}}},Ie.heading=function(Ee){var Ae=this.rules.block.heading.exec(Ee);if(Ae)return{type:"heading",raw:Ae[0],depth:Ae[1].length,text:Ae[2]}},Ie.nptable=function(Ee){var Ae=this.rules.block.nptable.exec(Ee);if(Ae){var Le={type:"table",header:X(Ae[1].replace(/^ *| *\| *$/g,"")),align:Ae[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Ae[3]?Ae[3].replace(/\n$/,"").split(` `):[],raw:Ae[0]};if(Le.header.length===Le.align.length){var Te=Le.align.length,Ze;for(Ze=0;Ze ?/gm,"");return{type:"blockquote",raw:Ae[0],text:Le}}},Ie.list=function(Ee){var Ae=this.rules.block.list.exec(Ee);if(Ae){for(var Le=Ae[0],Te=Ae[2],Ze=Te.length>1,ut=Te[Te.length-1]===")",Tt={type:"list",raw:Le,ordered:Ze,start:Ze?+Te.slice(0,-1):"",loose:!1,items:[]},Ht=Ae[0].match(this.rules.block.item),Qt=!1,bt,Lt,at,pt,st,Pe,Ge,yt=Ht.length,ot=0;ot1||this.options.smartLists&&at!==Te)&&(pt=Ht.slice(ot+1).join(` `),Tt.raw=Tt.raw.substring(0,Tt.raw.length-pt.length),ot=yt-1)),st=Qt||/\n\n(?!\s*$)/.test(bt),ot!==yt-1&&(Qt=bt.charAt(bt.length-1)===` `,st||(st=Qt)),st&&(Tt.loose=!0),Pe=/^\[[ xX]\] /.test(bt),Ge=void 0,Pe&&(Ge=bt[1]!==" ",bt=bt.replace(/^\[[ xX]\] +/,"")),Tt.items.push({type:"list_item",raw:Le,task:Pe,checked:Ge,loose:st,text:bt});return Tt}},Ie.html=function(Ee){var Ae=this.rules.block.html.exec(Ee);if(Ae)return{type:this.options.sanitize?"paragraph":"html",raw:Ae[0],pre:!this.options.sanitizer&&(Ae[1]==="pre"||Ae[1]==="script"||Ae[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Ae[0]):ne(Ae[0]):Ae[0]}},Ie.def=function(Ee){var Ae=this.rules.block.def.exec(Ee);if(Ae){Ae[3]&&(Ae[3]=Ae[3].substring(1,Ae[3].length-1));var Le=Ae[1].toLowerCase().replace(/\s+/g," ");return{tag:Le,raw:Ae[0],href:Ae[2],title:Ae[3]}}},Ie.table=function(Ee){var Ae=this.rules.block.table.exec(Ee);if(Ae){var Le={type:"table",header:X(Ae[1].replace(/^ *| *\| *$/g,"")),align:Ae[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Ae[3]?Ae[3].replace(/\n$/,"").split(` `):[]};if(Le.header.length===Le.align.length){Le.raw=Ae[0];var Te=Le.align.length,Ze;for(Ze=0;Ze/i.test(Te[0])&&(Ae=!1),!Le&&/^<(pre|code|kbd|script)(\s|>)/i.test(Te[0])?Le=!0:Le&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(Te[0])&&(Le=!1),{type:this.options.sanitize?"text":"html",raw:Te[0],inLink:Ae,inRawBlock:Le,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Te[0]):ne(Te[0]):Te[0]}},Ie.link=function(Ee){var Ae=this.rules.inline.link.exec(Ee);if(Ae){var Le=$(Ae[2],"()");if(Le>-1){var Te=Ae[0].indexOf("!")===0?5:4,Ze=Te+Ae[1].length+Le;Ae[2]=Ae[2].substring(0,Le),Ae[0]=Ae[0].substring(0,Ze).trim(),Ae[3]=""}var ut=Ae[2],Tt="";if(this.options.pedantic){var Ht=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(ut);Ht?(ut=Ht[1],Tt=Ht[3]):Tt=""}else Tt=Ae[3]?Ae[3].slice(1,-1):"";ut=ut.trim().replace(/^<([\s\S]*)>$/,"$1");var Qt=ee(Ae,{href:ut&&ut.replace(this.rules.inline._escapes,"$1"),title:Tt&&Tt.replace(this.rules.inline._escapes,"$1")},Ae[0]);return Qt}},Ie.reflink=function(Ee,Ae){var Le;if((Le=this.rules.inline.reflink.exec(Ee))||(Le=this.rules.inline.nolink.exec(Ee))){var Te=(Le[2]||Le[1]).replace(/\s+/g," ");if(Te=Ae[Te.toLowerCase()],!Te||!Te.href){var Ze=Le[0].charAt(0);return{type:"text",raw:Ze,text:Ze}}var ut=ee(Le,Te,Le[0]);return ut}},Ie.strong=function(Ee,Ae,Le){Le===void 0&&(Le="");var Te=this.rules.inline.strong.start.exec(Ee);if(Te&&(!Te[1]||Te[1]&&(Le===""||this.rules.inline.punctuation.exec(Le)))){Ae=Ae.slice(-1*Ee.length);var Ze=Te[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Ze.lastIndex=0;for(var ut;(Te=Ze.exec(Ae))!=null;)if(ut=this.rules.inline.strong.middle.exec(Ae.slice(0,Te.index+3)),ut)return{type:"strong",raw:Ee.slice(0,ut[0].length),text:Ee.slice(2,ut[0].length-2)}}},Ie.em=function(Ee,Ae,Le){Le===void 0&&(Le="");var Te=this.rules.inline.em.start.exec(Ee);if(Te&&(!Te[1]||Te[1]&&(Le===""||this.rules.inline.punctuation.exec(Le)))){Ae=Ae.slice(-1*Ee.length);var Ze=Te[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Ze.lastIndex=0;for(var ut;(Te=Ze.exec(Ae))!=null;)if(ut=this.rules.inline.em.middle.exec(Ae.slice(0,Te.index+2)),ut)return{type:"em",raw:Ee.slice(0,ut[0].length),text:Ee.slice(1,ut[0].length-1)}}},Ie.codespan=function(Ee){var Ae=this.rules.inline.code.exec(Ee);if(Ae){var Le=Ae[2].replace(/\n/g," "),Te=/[^ ]/.test(Le),Ze=Le.startsWith(" ")&&Le.endsWith(" ");return Te&&Ze&&(Le=Le.substring(1,Le.length-1)),Le=ne(Le,!0),{type:"codespan",raw:Ae[0],text:Le}}},Ie.br=function(Ee){var Ae=this.rules.inline.br.exec(Ee);if(Ae)return{type:"br",raw:Ae[0]}},Ie.del=function(Ee){var Ae=this.rules.inline.del.exec(Ee);if(Ae)return{type:"del",raw:Ae[0],text:Ae[1]}},Ie.autolink=function(Ee,Ae){var Le=this.rules.inline.autolink.exec(Ee);if(Le){var Te,Ze;return Le[2]==="@"?(Te=ne(this.options.mangle?Ae(Le[1]):Le[1]),Ze="mailto:"+Te):(Te=ne(Le[1]),Ze=Te),{type:"link",raw:Le[0],text:Te,href:Ze,tokens:[{type:"text",raw:Te,text:Te}]}}},Ie.url=function(Ee,Ae){var Le;if(Le=this.rules.inline.url.exec(Ee)){var Te,Ze;if(Le[2]==="@")Te=ne(this.options.mangle?Ae(Le[0]):Le[0]),Ze="mailto:"+Te;else{var ut;do ut=Le[0],Le[0]=this.rules.inline._backpedal.exec(Le[0])[0];while(ut!==Le[0]);Te=ne(Le[0]),Le[1]==="www."?Ze="http://"+Te:Ze=Te}return{type:"link",raw:Le[0],text:Te,href:Ze,tokens:[{type:"text",raw:Te,text:Te}]}}},Ie.inlineText=function(Ee,Ae,Le){var Te=this.rules.inline.text.exec(Ee);if(Te){var Ze;return Ae?Ze=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Te[0]):ne(Te[0]):Te[0]:Ze=ne(this.options.smartypants?Le(Te[0]):Te[0]),{type:"text",raw:Te[0],text:Ze}}},Fe}(),Ce=te.noopTest,Se=te.edit,De=te.merge,be={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]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|\\n*|\\n*|)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:Ce,table:Ce,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};be._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,be._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,be.def=Se(be.def).replace("label",be._label).replace("title",be._title).getRegex(),be.bullet=/(?:[*+-]|\d{1,9}[.)])/,be.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,be.item=Se(be.item,"gm").replace(/bull/g,be.bullet).getRegex(),be.list=Se(be.list).replace(/bull/g,be.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+be.def.source+")").getRegex(),be._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",be._comment=//,be.html=Se(be.html,"i").replace("comment",be._comment).replace("tag",be._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),be.paragraph=Se(be._paragraph).replace("hr",be.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",")|<(?:script|pre|style|!--)").replace("tag",be._tag).getRegex(),be.blockquote=Se(be.blockquote).replace("paragraph",be.paragraph).getRegex(),be.normal=De({},be),be.gfm=De({},be.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*|$)"}),be.gfm.nptable=Se(be.gfm.nptable).replace("hr",be.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",")|<(?:script|pre|style|!--)").replace("tag",be._tag).getRegex(),be.gfm.table=Se(be.gfm.table).replace("hr",be.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",")|<(?:script|pre|style|!--)").replace("tag",be._tag).getRegex(),be.pedantic=De({},be.normal,{html:Se(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",be._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:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:Ce,paragraph:Se(be.normal._paragraph).replace("hr",be.hr).replace("heading",` *#{1,6} *[^ ]`).replace("lheading",be.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var _e={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Ce,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\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:Ce,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~",_e.punctuation=Se(_e.punctuation).replace(/punctuation/g,_e._punctuation).getRegex(),_e._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",_e._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",_e.em.start=Se(_e.em.start).replace(/punctuation/g,_e._punctuation).getRegex(),_e.em.middle=Se(_e.em.middle).replace(/punctuation/g,_e._punctuation).replace(/overlapSkip/g,_e._overlapSkip).getRegex(),_e.em.endAst=Se(_e.em.endAst,"g").replace(/punctuation/g,_e._punctuation).getRegex(),_e.em.endUnd=Se(_e.em.endUnd,"g").replace(/punctuation/g,_e._punctuation).getRegex(),_e.strong.start=Se(_e.strong.start).replace(/punctuation/g,_e._punctuation).getRegex(),_e.strong.middle=Se(_e.strong.middle).replace(/punctuation/g,_e._punctuation).replace(/blockSkip/g,_e._blockSkip).getRegex(),_e.strong.endAst=Se(_e.strong.endAst,"g").replace(/punctuation/g,_e._punctuation).getRegex(),_e.strong.endUnd=Se(_e.strong.endUnd,"g").replace(/punctuation/g,_e._punctuation).getRegex(),_e.blockSkip=Se(_e._blockSkip,"g").getRegex(),_e.overlapSkip=Se(_e._overlapSkip,"g").getRegex(),_e._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,_e._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,_e._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])?)+(?![-_])/,_e.autolink=Se(_e.autolink).replace("scheme",_e._scheme).replace("email",_e._email).getRegex(),_e._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,_e.tag=Se(_e.tag).replace("comment",be._comment).replace("attribute",_e._attribute).getRegex(),_e._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,_e._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,_e._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,_e.link=Se(_e.link).replace("label",_e._label).replace("href",_e._href).replace("title",_e._title).getRegex(),_e.reflink=Se(_e.reflink).replace("label",_e._label).getRegex(),_e.reflinkSearch=Se(_e.reflinkSearch,"g").replace("reflink",_e.reflink).replace("nolink",_e.nolink).getRegex(),_e.normal=De({},_e),_e.pedantic=De({},_e.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:Se(/^!?\[(label)\]\((.*?)\)/).replace("label",_e._label).getRegex(),reflink:Se(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",_e._label).getRegex()}),_e.gfm=De({},_e.normal,{escape:Se(_e.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]*?(?:(?=[\\.5&&(Ee="x"+Ee.toString(16)),Ie+="&#"+Ee+";";return Ie}var We=function(){function Fe(Me){this.tokens=[],this.tokens.links=Object.create(null),this.options=Me||Ne,this.options.tokenizer=this.options.tokenizer||new de,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var Ee={block:Be.normal,inline:ze.normal};this.options.pedantic?(Ee.block=Be.pedantic,Ee.inline=ze.pedantic):this.options.gfm&&(Ee.block=Be.gfm,this.options.breaks?Ee.inline=ze.breaks:Ee.inline=ze.gfm),this.tokenizer.rules=Ee}Fe.lex=function(Ee,Ae){var Le=new Fe(Ae);return Le.lex(Ee)};var Ie=Fe.prototype;return Ie.lex=function(Ee){return Ee=Ee.replace(/\r\n|\r/g,` `).replace(/\t/g," "),this.blockTokens(Ee,this.tokens,!0),this.inline(this.tokens),this.tokens},Ie.blockTokens=function(Ee,Ae,Le){Ae===void 0&&(Ae=[]),Le===void 0&&(Le=!0),Ee=Ee.replace(/^ +$/gm,"");for(var Te,Ze,ut,Tt;Ee;){if(Te=this.tokenizer.space(Ee)){Ee=Ee.substring(Te.raw.length),Te.type&&Ae.push(Te);continue}if(Te=this.tokenizer.code(Ee,Ae)){Ee=Ee.substring(Te.raw.length),Te.type?Ae.push(Te):(Tt=Ae[Ae.length-1],Tt.raw+=` `+Te.raw,Tt.text+=` `+Te.text);continue}if(Te=this.tokenizer.fences(Ee)){Ee=Ee.substring(Te.raw.length),Ae.push(Te);continue}if(Te=this.tokenizer.heading(Ee)){Ee=Ee.substring(Te.raw.length),Ae.push(Te);continue}if(Te=this.tokenizer.nptable(Ee)){Ee=Ee.substring(Te.raw.length),Ae.push(Te);continue}if(Te=this.tokenizer.hr(Ee)){Ee=Ee.substring(Te.raw.length),Ae.push(Te);continue}if(Te=this.tokenizer.blockquote(Ee)){Ee=Ee.substring(Te.raw.length),Te.tokens=this.blockTokens(Te.text,[],Le),Ae.push(Te);continue}if(Te=this.tokenizer.list(Ee)){for(Ee=Ee.substring(Te.raw.length),ut=Te.items.length,Ze=0;Ze0)for(;(Ht=this.tokenizer.rules.inline.reflinkSearch.exec(Tt))!=null;)Qt.includes(Ht[0].slice(Ht[0].lastIndexOf("[")+1,-1))&&(Tt=Tt.slice(0,Ht.index)+"["+"a".repeat(Ht[0].length-2)+"]"+Tt.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Ht=this.tokenizer.rules.inline.blockSkip.exec(Tt))!=null;)Tt=Tt.slice(0,Ht.index)+"["+"a".repeat(Ht[0].length-2)+"]"+Tt.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;Ee;){if(ut=this.tokenizer.escape(Ee)){Ee=Ee.substring(ut.raw.length),Ae.push(ut);continue}if(ut=this.tokenizer.tag(Ee,Le,Te)){Ee=Ee.substring(ut.raw.length),Le=ut.inLink,Te=ut.inRawBlock,Ae.push(ut);continue}if(ut=this.tokenizer.link(Ee)){Ee=Ee.substring(ut.raw.length),ut.type==="link"&&(ut.tokens=this.inlineTokens(ut.text,[],!0,Te)),Ae.push(ut);continue}if(ut=this.tokenizer.reflink(Ee,this.tokens.links)){Ee=Ee.substring(ut.raw.length),ut.type==="link"&&(ut.tokens=this.inlineTokens(ut.text,[],!0,Te)),Ae.push(ut);continue}if(ut=this.tokenizer.strong(Ee,Tt,Ze)){Ee=Ee.substring(ut.raw.length),ut.tokens=this.inlineTokens(ut.text,[],Le,Te),Ae.push(ut);continue}if(ut=this.tokenizer.em(Ee,Tt,Ze)){Ee=Ee.substring(ut.raw.length),ut.tokens=this.inlineTokens(ut.text,[],Le,Te),Ae.push(ut);continue}if(ut=this.tokenizer.codespan(Ee)){Ee=Ee.substring(ut.raw.length),Ae.push(ut);continue}if(ut=this.tokenizer.br(Ee)){Ee=Ee.substring(ut.raw.length),Ae.push(ut);continue}if(ut=this.tokenizer.del(Ee)){Ee=Ee.substring(ut.raw.length),ut.tokens=this.inlineTokens(ut.text,[],Le,Te),Ae.push(ut);continue}if(ut=this.tokenizer.autolink(Ee,pe)){Ee=Ee.substring(ut.raw.length),Ae.push(ut);continue}if(!Le&&(ut=this.tokenizer.url(Ee,pe))){Ee=Ee.substring(ut.raw.length),Ae.push(ut);continue}if(ut=this.tokenizer.inlineText(Ee,Te,ye)){Ee=Ee.substring(ut.raw.length),Ze=ut.raw.slice(-1),Ae.push(ut);continue}if(Ee){var bt="Infinite loop on byte: "+Ee.charCodeAt(0);if(this.options.silent){console.error(bt);break}else throw new Error(bt)}}return Ae},Q(Fe,null,[{key:"rules",get:function(){return{block:Be,inline:ze}}}]),Fe}(),He=T.defaults,nt=te.cleanUrl,re=te.escape,k=function(){function Fe(Me){this.options=Me||He}var Ie=Fe.prototype;return Ie.code=function(Ee,Ae,Le){var Te=(Ae||"").match(/\S*/)[0];if(this.options.highlight){var Ze=this.options.highlight(Ee,Te);Ze!=null&&Ze!==Ee&&(Le=!0,Ee=Ze)}return Te?'
    '+(Le?Ee:re(Ee,!0))+`
    `:"
    "+(Le?Ee:re(Ee,!0))+`
    `},Ie.blockquote=function(Ee){return`
    `+Ee+`
    `},Ie.html=function(Ee){return Ee},Ie.heading=function(Ee,Ae,Le,Te){return this.options.headerIds?"'+Ee+" `:""+Ee+" `},Ie.hr=function(){return this.options.xhtml?`
    `:`
    `},Ie.list=function(Ee,Ae,Le){var Te=Ae?"ol":"ul",Ze=Ae&&Le!==1?' start="'+Le+'"':"";return"<"+Te+Ze+`> `+Ee+" `},Ie.listitem=function(Ee){return"
  • "+Ee+`
  • `},Ie.checkbox=function(Ee){return" "},Ie.paragraph=function(Ee){return"

    "+Ee+`

    `},Ie.table=function(Ee,Ae){return Ae&&(Ae=""+Ae+""),` `+Ee+` `+Ae+`
    `},Ie.tablerow=function(Ee){return` `+Ee+` `},Ie.tablecell=function(Ee,Ae){var Le=Ae.header?"th":"td",Te=Ae.align?"<"+Le+' align="'+Ae.align+'">':"<"+Le+">";return Te+Ee+" `},Ie.strong=function(Ee){return""+Ee+""},Ie.em=function(Ee){return""+Ee+""},Ie.codespan=function(Ee){return""+Ee+""},Ie.br=function(){return this.options.xhtml?"
    ":"
    "},Ie.del=function(Ee){return""+Ee+""},Ie.link=function(Ee,Ae,Le){if(Ee=nt(this.options.sanitize,this.options.baseUrl,Ee),Ee===null)return Le;var Te='",Te},Ie.image=function(Ee,Ae,Le){if(Ee=nt(this.options.sanitize,this.options.baseUrl,Ee),Ee===null)return Le;var Te=''+Le+'":">",Te},Ie.text=function(Ee){return Ee},Fe}(),U=function(){function Fe(){}var Ie=Fe.prototype;return Ie.strong=function(Ee){return Ee},Ie.em=function(Ee){return Ee},Ie.codespan=function(Ee){return Ee},Ie.del=function(Ee){return Ee},Ie.html=function(Ee){return Ee},Ie.text=function(Ee){return Ee},Ie.link=function(Ee,Ae,Le){return""+Le},Ie.image=function(Ee,Ae,Le){return""+Le},Ie.br=function(){return""},Fe}(),q=function(){function Fe(){this.seen={}}var Ie=Fe.prototype;return Ie.slug=function(Ee){var Ae=Ee.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(Ae)){var Le=Ae;do this.seen[Le]++,Ae=Le+"-"+this.seen[Le];while(this.seen.hasOwnProperty(Ae))}return this.seen[Ae]=0,Ae},Fe}(),Y=T.defaults,J=te.unescape,xe=function(){function Fe(Me){this.options=Me||Y,this.options.renderer=this.options.renderer||new k,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new U,this.slugger=new q}Fe.parse=function(Ee,Ae){var Le=new Fe(Ae);return Le.parse(Ee)};var Ie=Fe.prototype;return Ie.parse=function(Ee,Ae){Ae===void 0&&(Ae=!0);var Le="",Te,Ze,ut,Tt,Ht,Qt,bt,Lt,at,pt,st,Pe,Ge,yt,ot,kt,Dt,rt,wt=Ee.length;for(Te=0;Te0&&ot.tokens[0].type==="text"?(ot.tokens[0].text=rt+" "+ot.tokens[0].text,ot.tokens[0].tokens&&ot.tokens[0].tokens.length>0&&ot.tokens[0].tokens[0].type==="text"&&(ot.tokens[0].tokens[0].text=rt+" "+ot.tokens[0].tokens[0].text)):ot.tokens.unshift({type:"text",text:rt}):yt+=rt),yt+=this.parse(ot.tokens,Ge),at+=this.renderer.listitem(yt,Dt,kt);Le+=this.renderer.list(at,st,Pe);continue}case"html":{Le+=this.renderer.html(pt.text);continue}case"paragraph":{Le+=this.renderer.paragraph(this.parseInline(pt.tokens));continue}case"text":{for(at=pt.tokens?this.parseInline(pt.tokens):pt.text;Te+1An error occurred:

    "+Ue(ut.message+"",!0)+"
    ";throw ut}}Qe.options=Qe.setOptions=function(Fe){return ke(Qe.defaults,Fe),tt(Qe.defaults),Qe},Qe.getDefaults=je,Qe.defaults=mt,Qe.use=function(Fe){var Ie=ke({},Fe);if(Fe.renderer&&function(){var Ee=Qe.defaults.renderer||new k,Ae=function(Ze){var ut=Ee[Ze];Ee[Ze]=function(){for(var Tt=arguments.length,Ht=new Array(Tt),Qt=0;Qt=0;a--){if(!j(o[a]))continue;var d=o[a].split("="),s=unescape(d[0]),f=unescape(d[1]);u(f,s)}}function T(u,o){if(!u)return;w.cookie=escape(u)+"="+escape(o)+"; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/"}function C(u){if(!u||!p(u))return;w.cookie=escape(u)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/"}function c(){_(function(u,o){C(o)})}function p(u){return new RegExp("(?:^|;\\s*)"+escape(u).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(w.cookie)}},E2g8:function(et,Ve,z){(function(le,Q){/*! * @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(j,w){et.exports=w()})(this,function(){"use strict";function j(k){var U=typeof k;return k!==null&&(U==="object"||U==="function")}function w(k){return typeof k=="function"}var P=void 0;Array.isArray?P=Array.isArray:P=function(k){return Object.prototype.toString.call(k)==="[object Array]"};var _=P,T=0,C=void 0,c=void 0,p=function(U,q){b[T]=U,b[T+1]=q,T+=2,T===2&&(c?c(E):y())};function u(k){c=k}function o(k){p=k}var a=typeof window!="undefined"?window:void 0,d=a||{},s=d.MutationObserver||d.WebKitMutationObserver,f=typeof self=="undefined"&&typeof le!="undefined"&&{}.toString.call(le)==="[object process]",i=typeof Uint8ClampedArray!="undefined"&&typeof importScripts!="undefined"&&typeof MessageChannel!="undefined";function n(){return function(){return le.nextTick(E)}}function t(){return typeof C!="undefined"?function(){C(E)}:g()}function h(){var k=0,U=new s(E),q=document.createTextNode("");return U.observe(q,{characterData:!0}),function(){q.data=k=++k%2}}function v(){var k=new MessageChannel;return k.port1.onmessage=E,function(){return k.port2.postMessage(0)}}function g(){var k=setTimeout;return function(){return k(E,1)}}var b=new Array(1e3);function E(){for(var k=0;k`,triples:"",explode:"[]{}"},j=le.Pos;le.defineOption("autoCloseBrackets",!1,function(s,f,i){i&&i!=le.Init&&(s.removeKeyMap(P),s.state.closeBrackets=null),f&&(_(w(f,"pairs")),s.state.closeBrackets=f,s.addKeyMap(P))});function w(s,f){return f=="pairs"&&typeof s=="string"?s:typeof s=="object"&&s[f]!=null?s[f]:Q[f]}var P={Backspace:c,Enter:p};function _(s){for(var f=0;f=0;t--){var v=n[t].head;s.replaceRange("",j(v.line,v.ch-1),j(v.line,v.ch+1),"+delete")}}function p(s){var f=C(s),i=f&&w(f,"explode");if(!i||s.getOption("disableInput"))return le.Pass;for(var n=s.listSelections(),t=0;t0;return{anchor:new j(s.anchor.line,s.anchor.ch+(f?-1:1)),head:new j(s.head.line,s.head.ch+(f?1:-1))}}function o(s,f){var i=C(s);if(!i||s.getOption("disableInput"))return le.Pass;var n=w(i,"pairs"),t=n.indexOf(f);if(t==-1)return le.Pass;for(var h=w(i,"closeBefore"),v=w(i,"triples"),g=n.charAt(t+1)==f,b=s.listSelections(),E=t%2==0,m,y=0;y=0&&s.getRange(l,j(l.line,l.ch+3))==f+f+f?S="skipThree":S="skip";else if(g&&l.ch>1&&v.indexOf(f)>=0&&s.getRange(j(l.line,l.ch-2),l)==f+f){if(l.ch>2&&/\bstring/.test(s.getTokenTypeAt(j(l.line,l.ch-2))))return le.Pass;S="addFour"}else if(g){var A=l.ch==0?" ":s.getRange(j(l.line,l.ch-1),l);if(!le.isWordChar(O)&&A!=f&&!le.isWordChar(A))S="both";else return le.Pass}else if(E&&(O.length===0||/\s/.test(O)||h.indexOf(O)>-1))S="both";else return le.Pass;if(!m)m=S;else if(m!=S)return le.Pass}var D=t%2?n.charAt(t-1):f,I=t%2?f:n.charAt(t+1);s.operation(function(){if(m=="skip")s.execCommand("goCharRight");else if(m=="skipThree")for(var B=0;B<3;B++)s.execCommand("goCharRight");else if(m=="surround"){for(var H=s.getSelections(),B=0;B ").concat(Z);if(Re.ENABLE_CALLBACK&&Re.emitter.emit("log","error",oe),!Re.ENABLE_ERROR)return;console.error?console.error(oe):console.warn?console.warn(oe):console.log(oe)}},{key:"i",value:function(K,Z){(!K||Re.FORCE_GLOBAL_TAG)&&(K=Re.GLOBAL_TAG);var oe="[".concat(K,"] > ").concat(Z);if(Re.ENABLE_CALLBACK&&Re.emitter.emit("log","info",oe),!Re.ENABLE_INFO)return;console.info?console.info(oe):console.log(oe)}},{key:"w",value:function(K,Z){(!K||Re.FORCE_GLOBAL_TAG)&&(K=Re.GLOBAL_TAG);var oe="[".concat(K,"] > ").concat(Z);if(Re.ENABLE_CALLBACK&&Re.emitter.emit("log","warn",oe),!Re.ENABLE_WARN)return;console.warn?console.warn(oe):console.log(oe)}},{key:"d",value:function(K,Z){(!K||Re.FORCE_GLOBAL_TAG)&&(K=Re.GLOBAL_TAG);var oe="[".concat(K,"] > ").concat(Z);if(Re.ENABLE_CALLBACK&&Re.emitter.emit("log","debug",oe),!Re.ENABLE_DEBUG)return;console.debug?console.debug(oe):console.log(oe)}},{key:"v",value:function(K,Z){(!K||Re.FORCE_GLOBAL_TAG)&&(K=Re.GLOBAL_TAG);var oe="[".concat(K,"] > ").concat(Z);if(Re.ENABLE_CALLBACK&&Re.emitter.emit("log","verbose",oe),!Re.ENABLE_VERBOSE)return;console.log(oe)}}]),Re}();T.GLOBAL_TAG="flv.js",T.FORCE_GLOBAL_TAG=!1,T.ENABLE_ERROR=!0,T.ENABLE_INFO=!0,T.ENABLE_WARN=!0,T.ENABLE_DEBUG=!0,T.ENABLE_VERBOSE=!0,T.ENABLE_CALLBACK=!1,T.emitter=new _.a;var C=T,c=function(){function Re(){Object(le.a)(this,Re),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(Q.a)(Re,[{key:"reset",value:function(){this._firstCheckpoint=this._lastCheckpoint=0,this._totalBytes=this._intervalBytes=0,this._lastSecondBytes=0}},{key:"addBytes",value:function(K){this._firstCheckpoint===0?(this._firstCheckpoint=this._now(),this._lastCheckpoint=this._firstCheckpoint,this._intervalBytes+=K,this._totalBytes+=K):this._now()-this._lastCheckpoint<1e3?(this._intervalBytes+=K,this._totalBytes+=K):(this._lastSecondBytes=this._intervalBytes,this._intervalBytes=K,this._totalBytes+=K,this._lastCheckpoint=this._now())}},{key:"currentKBps",get:function(){this.addBytes(0);var K=(this._now()-this._lastCheckpoint)/1e3;return K==0&&(K=1),this._intervalBytes/K/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 K=(this._now()-this._firstCheckpoint)/1e3;return this._totalBytes/K/1024}}]),Re}(),p=c,u=z("yKVA"),o=z("879j"),a=function(){function Re(ve){Object(le.a)(this,Re),this._message=ve}return Object(Q.a)(Re,[{key:"name",get:function(){return"RuntimeException"}},{key:"message",get:function(){return this._message}},{key:"toString",value:function(){return this.name+": "+this.message}}]),Re}(),d=function(Re){Object(u.a)(K,Re);var ve=Object(o.a)(K);function K(Z){return Object(le.a)(this,K),ve.call(this,Z)}return Object(Q.a)(K,[{key:"name",get:function(){return"IllegalStateException"}}]),K}(a),s=function(Re){Object(u.a)(K,Re);var ve=Object(o.a)(K);function K(Z){return Object(le.a)(this,K),ve.call(this,Z)}return Object(Q.a)(K,[{key:"name",get:function(){return"InvalidArgumentException"}}]),K}(a),f=function(Re){Object(u.a)(K,Re);var ve=Object(o.a)(K);function K(Z){return Object(le.a)(this,K),ve.call(this,Z)}return Object(Q.a)(K,[{key:"name",get:function(){return"NotImplementedException"}}]),K}(a),i={kIdle:0,kConnecting:1,kBuffering:2,kError:3,kComplete:4},n={OK:"OK",EXCEPTION:"Exception",HTTP_STATUS_CODE_INVALID:"HttpStatusCodeInvalid",CONNECTING_TIMEOUT:"ConnectingTimeout",EARLY_EOF:"EarlyEof",UNRECOVERABLE_EARLY_EOF:"UnrecoverableEarlyEof"},t=function(){function Re(ve){Object(le.a)(this,Re),this._type=ve||"undefined",this._status=i.kIdle,this._needStash=!1,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}return Object(Q.a)(Re,[{key:"destroy",value:function(){this._status=i.kIdle,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}},{key:"isWorking",value:function(){return this._status===i.kConnecting||this._status===i.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(K){this._onContentLengthKnown=K}},{key:"onURLRedirect",get:function(){return this._onURLRedirect},set:function(K){this._onURLRedirect=K}},{key:"onDataArrival",get:function(){return this._onDataArrival},set:function(K){this._onDataArrival=K}},{key:"onError",get:function(){return this._onError},set:function(K){this._onError=K}},{key:"onComplete",get:function(){return this._onComplete},set:function(K){this._onComplete=K}},{key:"open",value:function(K,Z){throw new f("Unimplemented abstract function!")}},{key:"abort",value:function(){throw new f("Unimplemented abstract function!")}}]),Re}(),h=z("oZsa");function v(Re,ve){for(;!Object.prototype.hasOwnProperty.call(Re,ve)&&!(Re=Object(h.a)(Re),Re===null););return Re}function g(Re,ve,K){return typeof Reflect!="undefined"&&Reflect.get?g=Reflect.get:g=function(oe,he,Oe){var Je=v(oe,he);if(!Je)return;var lt=Object.getOwnPropertyDescriptor(Je,he);return lt.get?lt.get.call(Oe):lt.value},g(Re,ve,K||Re)}var b={};function E(){var Re=self.navigator.userAgent.toLowerCase(),ve=/(edge)\/([\w.]+)/.exec(Re)||/(opr)[\/]([\w.]+)/.exec(Re)||/(chrome)[ \/]([\w.]+)/.exec(Re)||/(iemobile)[\/]([\w.]+)/.exec(Re)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(Re)||/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(Re)||/(webkit)[ \/]([\w.]+)/.exec(Re)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(Re)||/(msie) ([\w.]+)/.exec(Re)||Re.indexOf("trident")>=0&&/(rv)(?::| )([\w.]+)/.exec(Re)||Re.indexOf("compatible")<0&&/(firefox)[ \/]([\w.]+)/.exec(Re)||[],K=/(ipad)/.exec(Re)||/(ipod)/.exec(Re)||/(windows phone)/.exec(Re)||/(iphone)/.exec(Re)||/(kindle)/.exec(Re)||/(android)/.exec(Re)||/(windows)/.exec(Re)||/(mac)/.exec(Re)||/(linux)/.exec(Re)||/(cros)/.exec(Re)||[],Z={browser:ve[5]||ve[3]||ve[1]||"",version:ve[2]||ve[4]||"0",majorVersion:ve[4]||ve[2]||"0",platform:K[0]||""},oe={};if(Z.browser){oe[Z.browser]=!0;var he=Z.majorVersion.split(".");oe.version={major:parseInt(Z.majorVersion,10),string:Z.version},he.length>1&&(oe.version.minor=parseInt(he[1],10)),he.length>2&&(oe.version.build=parseInt(he[2],10))}if(Z.platform&&(oe[Z.platform]=!0),(oe.chrome||oe.opr||oe.safari)&&(oe.webkit=!0),oe.rv||oe.iemobile){oe.rv&&delete oe.rv;var Oe="msie";Z.browser=Oe,oe[Oe]=!0}if(oe.edge){delete oe.edge;var Je="msedge";Z.browser=Je,oe[Je]=!0}if(oe.opr){var lt="opera";Z.browser=lt,oe[lt]=!0}if(oe.safari&&oe.android){var Pt="android";Z.browser=Pt,oe[Pt]=!0}oe.name=Z.browser,oe.platform=Z.platform;for(var Nt in b)b.hasOwnProperty(Nt)&&delete b[Nt];Object.assign(b,oe)}E();var m=b,y=function(Re){Object(u.a)(K,Re);var ve=Object(o.a)(K);function K(Z,oe){var he;return Object(le.a)(this,K),he=ve.call(this,"fetch-stream-loader"),he.TAG="FetchStreamLoader",he._seekHandler=Z,he._config=oe,he._needStash=!0,he._requestAbort=!1,he._contentLength=null,he._receivedLength=0,he}return Object(Q.a)(K,[{key:"destroy",value:function(){this.isWorking()&&this.abort(),g(Object(h.a)(K.prototype),"destroy",this).call(this)}},{key:"open",value:function(oe,he){var Oe=this;this._dataSource=oe,this._range=he;var Je=oe.url;this._config.reuseRedirectedURL&&oe.redirectedURL!=null&&(Je=oe.redirectedURL);var lt=this._seekHandler.getConfig(Je,he),Pt=new self.Headers;if(typeof lt.headers=="object"){var Nt=lt.headers;for(var ht in Nt)Nt.hasOwnProperty(ht)&&Pt.append(ht,Nt[ht])}var Mt={method:"GET",headers:Pt,mode:"cors",cache:"default",referrerPolicy:"no-referrer-when-downgrade"};if(typeof this._config.headers=="object")for(var nn in this._config.headers)Pt.append(nn,this._config.headers[nn]);oe.cors===!1&&(Mt.mode="same-origin"),oe.withCredentials&&(Mt.credentials="include"),oe.referrerPolicy&&(Mt.referrerPolicy=oe.referrerPolicy),this._status=i.kConnecting,self.fetch(lt.url,Mt).then(function(Rt){if(Oe._requestAbort){Oe._requestAbort=!1,Oe._status=i.kIdle;return}if(Rt.ok&&Rt.status>=200&&Rt.status<=299){if(Rt.url!==lt.url&&Oe._onURLRedirect){var cn=Oe._seekHandler.removeURLParameters(Rt.url);Oe._onURLRedirect(cn)}var an=Rt.headers.get("Content-Length");return an!=null&&(Oe._contentLength=parseInt(an),Oe._contentLength!==0&&(Oe._onContentLengthKnown&&Oe._onContentLengthKnown(Oe._contentLength))),Oe._pump.call(Oe,Rt.body.getReader())}else if(Oe._status=i.kError,Oe._onError)Oe._onError(n.HTTP_STATUS_CODE_INVALID,{code:Rt.status,msg:Rt.statusText});else throw new a("FetchStreamLoader: Http code invalid, "+Rt.status+" "+Rt.statusText)}).catch(function(Rt){if(Oe._status=i.kError,Oe._onError)Oe._onError(n.EXCEPTION,{code:-1,msg:Rt.message});else throw Rt})}},{key:"abort",value:function(){this._requestAbort=!0}},{key:"_pump",value:function(oe){var he=this;return oe.read().then(function(Oe){if(Oe.done)if(he._contentLength!==null&&he._receivedLength=15048,he=m.msedge?oe:!0;return self.fetch&&self.ReadableStream&&he}catch(Oe){return!1}}}]),K}(t),x=y,l=function(Re){Object(u.a)(K,Re);var ve=Object(o.a)(K);function K(Z,oe){var he;return Object(le.a)(this,K),he=ve.call(this,"xhr-moz-chunked-loader"),he.TAG="MozChunkedLoader",he._seekHandler=Z,he._config=oe,he._needStash=!0,he._xhr=null,he._requestAbort=!1,he._contentLength=null,he._receivedLength=0,he}return Object(Q.a)(K,[{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),g(Object(h.a)(K.prototype),"destroy",this).call(this)}},{key:"open",value:function(oe,he){this._dataSource=oe,this._range=he;var Oe=oe.url;this._config.reuseRedirectedURL&&oe.redirectedURL!=null&&(Oe=oe.redirectedURL);var Je=this._seekHandler.getConfig(Oe,he);this._requestURL=Je.url;var lt=this._xhr=new XMLHttpRequest;if(lt.open("GET",Je.url,!0),lt.responseType="moz-chunked-arraybuffer",lt.onreadystatechange=this._onReadyStateChange.bind(this),lt.onprogress=this._onProgress.bind(this),lt.onloadend=this._onLoadEnd.bind(this),lt.onerror=this._onXhrError.bind(this),oe.withCredentials&&(lt.withCredentials=!0),typeof Je.headers=="object"){var Pt=Je.headers;for(var Nt in Pt)Pt.hasOwnProperty(Nt)&<.setRequestHeader(Nt,Pt[Nt])}if(typeof this._config.headers=="object"){var ht=this._config.headers;for(var Mt in ht)ht.hasOwnProperty(Mt)&<.setRequestHeader(Mt,ht[Mt])}this._status=i.kConnecting,lt.send()}},{key:"abort",value:function(){this._requestAbort=!0,this._xhr&&this._xhr.abort(),this._status=i.kComplete}},{key:"_onReadyStateChange",value:function(oe){var he=oe.target;if(he.readyState===2){if(he.responseURL!=null&&he.responseURL!==this._requestURL&&this._onURLRedirect){var Oe=this._seekHandler.removeURLParameters(he.responseURL);this._onURLRedirect(Oe)}if(he.status!==0&&(he.status<200||he.status>299))if(this._status=i.kError,this._onError)this._onError(n.HTTP_STATUS_CODE_INVALID,{code:he.status,msg:he.statusText});else throw new a("MozChunkedLoader: Http code invalid, "+he.status+" "+he.statusText);else this._status=i.kBuffering}}},{key:"_onProgress",value:function(oe){if(this._status===i.kError)return;this._contentLength===null&&(oe.total!==null&&oe.total!==0&&(this._contentLength=oe.total,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)));var he=oe.target.response,Oe=this._range.from+this._receivedLength;this._receivedLength+=he.byteLength,this._onDataArrival&&this._onDataArrival(he,Oe,this._receivedLength)}},{key:"_onLoadEnd",value:function(oe){if(this._requestAbort===!0){this._requestAbort=!1;return}else if(this._status===i.kError)return;this._status=i.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1)}},{key:"_onXhrError",value:function(oe){this._status=i.kError;var he=0,Oe=null;if(this._contentLength&&oe.loaded=200&&he.status<=299){if(this._status=i.kBuffering,he.responseURL!=null){var Oe=this._seekHandler.removeURLParameters(he.responseURL);he.responseURL!==this._currentRequestURL&&Oe!==this._currentRedirectedURL&&(this._currentRedirectedURL=Oe,this._onURLRedirect&&this._onURLRedirect(Oe))}var Je=he.getResponseHeader("Content-Length");if(Je!=null&&this._contentLength==null){var lt=parseInt(Je);lt>0&&(this._contentLength=lt,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength))}}else if(this._status=i.kError,this._onError)this._onError(n.HTTP_STATUS_CODE_INVALID,{code:he.status,msg:he.statusText});else throw new a("MSStreamLoader: Http code invalid, "+he.status+" "+he.statusText);else if(he.readyState===3&&(he.status>=200&&he.status<=299)){this._status=i.kBuffering;var Pt=he.response;this._reader.readAsArrayBuffer(Pt)}}},{key:"_xhrOnError",value:function(oe){this._status=i.kError;var he=n.EXCEPTION,Oe={code:-1,msg:oe.constructor.name+" "+oe.type};if(this._onError)this._onError(he,Oe);else throw new a(Oe.msg)}},{key:"_msrOnProgress",value:function(oe){var he=oe.target,Oe=he.result;if(Oe==null){this._doReconnectIfNeeded();return}var Je=Oe.slice(this._lastTimeBufferSize);this._lastTimeBufferSize=Oe.byteLength;var lt=this._totalRange.from+this._receivedLength;this._receivedLength+=Je.byteLength,this._onDataArrival&&this._onDataArrival(Je,lt,this._receivedLength),Oe.byteLength>=this._bufferLimit&&(C.v(this.TAG,"MSStream buffer exceeded max size near ".concat(lt+Je.byteLength,", reconnecting...")),this._doReconnectIfNeeded())}},{key:"_doReconnectIfNeeded",value:function(){if(this._contentLength==null||this._receivedLength=this._contentLength&&(Oe=this._range.from+this._contentLength-1)),this._currentRequestRange={from:he,to:Oe},this._internalOpen(this._dataSource,this._currentRequestRange)}},{key:"_internalOpen",value:function(oe,he){this._lastTimeLoaded=0;var Oe=oe.url;this._config.reuseRedirectedURL&&(this._currentRedirectedURL!=null?Oe=this._currentRedirectedURL:oe.redirectedURL!=null&&(Oe=oe.redirectedURL));var Je=this._seekHandler.getConfig(Oe,he);this._currentRequestURL=Je.url;var lt=this._xhr=new XMLHttpRequest;if(lt.open("GET",Je.url,!0),lt.responseType="arraybuffer",lt.onreadystatechange=this._onReadyStateChange.bind(this),lt.onprogress=this._onProgress.bind(this),lt.onload=this._onLoad.bind(this),lt.onerror=this._onXhrError.bind(this),oe.withCredentials&&(lt.withCredentials=!0),typeof Je.headers=="object"){var Pt=Je.headers;for(var Nt in Pt)Pt.hasOwnProperty(Nt)&<.setRequestHeader(Nt,Pt[Nt])}if(typeof this._config.headers=="object"){var ht=this._config.headers;for(var Mt in ht)ht.hasOwnProperty(Mt)&<.setRequestHeader(Mt,ht[Mt])}lt.send()}},{key:"abort",value:function(){this._requestAbort=!0,this._internalAbort(),this._status=i.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(oe){var he=oe.target;if(he.readyState===2){if(he.responseURL!=null){var Oe=this._seekHandler.removeURLParameters(he.responseURL);he.responseURL!==this._currentRequestURL&&Oe!==this._currentRedirectedURL&&(this._currentRedirectedURL=Oe,this._onURLRedirect&&this._onURLRedirect(Oe))}if(he.status>=200&&he.status<=299){if(this._waitForTotalLength)return;this._status=i.kBuffering}else if(this._status=i.kError,this._onError)this._onError(n.HTTP_STATUS_CODE_INVALID,{code:he.status,msg:he.statusText});else throw new a("RangeLoader: Http code invalid, "+he.status+" "+he.statusText)}}},{key:"_onProgress",value:function(oe){if(this._status===i.kError)return;if(this._contentLength===null){var he=!1;if(this._waitForTotalLength){this._waitForTotalLength=!1,this._totalLengthReceived=!0,he=!0;var Oe=oe.total;this._internalAbort(),Oe!=null&Oe!==0&&(this._totalLength=Oe)}if(this._range.to===-1?this._contentLength=this._totalLength-this._range.from:this._contentLength=this._range.to-this._range.from+1,he){this._openSubRange();return}this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)}var Je=oe.loaded-this._lastTimeLoaded;this._lastTimeLoaded=oe.loaded,this._speedSampler.addBytes(Je)}},{key:"_normalizeSpeed",value:function(oe){var he=this._chunkSizeKBList,Oe=he.length-1,Je=0,lt=0,Pt=Oe;if(oe=he[Je]&&oe=3&&(he=this._speedSampler.currentKBps)),he!==0){var Oe=this._normalizeSpeed(he);this._currentSpeedNormalized!==Oe&&(this._currentSpeedNormalized=Oe,this._currentChunkSizeKB=Oe)}var Je=oe.target.response,lt=this._range.from+this._receivedLength;this._receivedLength+=Je.byteLength;var Pt=!1;this._contentLength!=null&&this._receivedLength0&&this._receivedLength0)for(var Je=oe.split("&"),lt=0;lt0;Pt[0]!==this._startName&&Pt[0]!==this._endName&&(Nt&&(Oe+="&"),Oe+=Je[lt])}return Oe.length===0?Z:Z+"?"+Oe}}]),Re}(),X=V,ne=function(){function Re(ve,K,Z){Object(le.a)(this,Re),this.TAG="IOController",this._config=K,this._extraData=Z,this._stashInitialSize=1024*384,K.stashInitialSize!=null&&K.stashInitialSize>0&&(this._stashInitialSize=K.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,K.enableStashBuffer===!1&&(this._enableStash=!1),this._loader=null,this._loaderClass=null,this._seekHandler=null,this._dataSource=ve,this._isWebSocketURL=/wss?:\/\/(.+?)/.test(ve.url),this._refTotalLength=ve.filesize?ve.filesize:null,this._totalLength=this._refTotalLength,this._fullRequestFlag=!1,this._currentRange=null,this._redirectedURL=null,this._speedNormalized=0,this._speedSampler=new p,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(Q.a)(Re,[{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(K){this._extraData=K}},{key:"onDataArrival",get:function(){return this._onDataArrival},set:function(K){this._onDataArrival=K}},{key:"onSeeked",get:function(){return this._onSeeked},set:function(K){this._onSeeked=K}},{key:"onError",get:function(){return this._onError},set:function(K){this._onError=K}},{key:"onComplete",get:function(){return this._onComplete},set:function(K){this._onComplete=K}},{key:"onRedirect",get:function(){return this._onRedirect},set:function(K){this._onRedirect=K}},{key:"onRecoveredEarlyEof",get:function(){return this._onRecoveredEarlyEof},set:function(K){this._onRecoveredEarlyEof=K}},{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===I?this._loader.currentSpeed:this._speedSampler.lastSecondKBps}},{key:"loaderType",get:function(){return this._loader.type}},{key:"_selectSeekHandler",value:function(){var K=this._config;if(K.seekType==="range")this._seekHandler=new W(this._config.rangeLoadZeroStart);else if(K.seekType==="param"){var Z=K.seekParamStart||"bstart",oe=K.seekParamEnd||"bend";this._seekHandler=new X(Z,oe)}else if(K.seekType==="custom"){if(typeof K.customSeekHandler!="function")throw new s("Custom seekType specified in config but invalid customSeekHandler!");this._seekHandler=new K.customSeekHandler}else throw new s("Invalid seekType in config: ".concat(K.seekType))}},{key:"_selectLoader",value:function(){if(this._config.customLoader!=null)this._loaderClass=this._config.customLoader;else if(this._isWebSocketURL)this._loaderClass=H;else if(x.isSupported())this._loaderClass=x;else if(S.isSupported())this._loaderClass=S;else if(I.isSupported())this._loaderClass=I;else throw new a("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(K){this._currentRange={from:0,to:-1},K&&(this._currentRange.from=K),this._speedSampler.reset(),K||(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 K=this._resumeFrom;this._resumeFrom=0,this._internalSeek(K,!0)}}},{key:"seek",value:function(K){this._paused=!1,this._stashUsed=0,this._stashByteStart=0,this._internalSeek(K,!0)}},{key:"_internalSeek",value:function(K,Z){this._loader.isWorking()&&this._loader.abort(),this._flushStashBuffer(Z),this._loader.destroy(),this._loader=null;var oe={from:K,to:-1};this._currentRange={from:oe.from,to:-1},this._speedSampler.reset(),this._stashSize=this._stashInitialSize,this._createLoader(),this._loader.open(this._dataSource,oe),this._onSeeked&&this._onSeeked()}},{key:"updateUrl",value:function(K){if(!K||typeof K!="string"||K.length===0)throw new s("Url must be a non-empty string!");this._dataSource.url=K}},{key:"_expandBuffer",value:function(K){for(var Z=this._stashSize;Z+1024*1024*10){var he=new Uint8Array(this._stashBuffer,0,this._stashUsed),Oe=new Uint8Array(oe,0,Z);Oe.set(he,0)}this._stashBuffer=oe,this._bufferSize=Z}},{key:"_normalizeSpeed",value:function(K){var Z=this._speedNormalizeList,oe=Z.length-1,he=0,Oe=0,Je=oe;if(K=Z[he]&&K=512&&K<=1024?Z=Math.floor(K*1.5):Z=K*2,Z>8192&&(Z=8192);var oe=Z*1024+1024*1024*1;this._bufferSize0){var cn=this._stashBuffer.slice(0,this._stashUsed),an=this._dispatchChunks(cn,this._stashByteStart);if(an0){var ie=new Uint8Array(cn,an);Rt.set(ie,0),this._stashUsed=ie.byteLength,this._stashByteStart+=an}}else this._stashUsed=0,this._stashByteStart+=an;this._stashUsed+K.byteLength>this._bufferSize&&(this._expandBuffer(this._stashUsed+K.byteLength),Rt=new Uint8Array(this._stashBuffer,0,this._bufferSize)),Rt.set(new Uint8Array(K),this._stashUsed),this._stashUsed+=K.byteLength}else{var N=this._dispatchChunks(K,Z);if(Nthis._bufferSize&&(this._expandBuffer(F),Rt=new Uint8Array(this._stashBuffer,0,this._bufferSize)),Rt.set(new Uint8Array(K,N),0),this._stashUsed+=F,this._stashByteStart=Z+N}}}else if(this._stashUsed===0){var Je=this._dispatchChunks(K,Z);if(Jethis._bufferSize&&this._expandBuffer(lt);var Pt=new Uint8Array(this._stashBuffer,0,this._bufferSize);Pt.set(new Uint8Array(K,Je),0),this._stashUsed+=lt,this._stashByteStart=Z+Je}}else{this._stashUsed+K.byteLength>this._bufferSize&&this._expandBuffer(this._stashUsed+K.byteLength);var Nt=new Uint8Array(this._stashBuffer,0,this._bufferSize);Nt.set(new Uint8Array(K),this._stashUsed),this._stashUsed+=K.byteLength;var ht=this._dispatchChunks(this._stashBuffer.slice(0,this._stashUsed),this._stashByteStart);if(ht0){var Mt=new Uint8Array(this._stashBuffer,ht);Nt.set(Mt,0)}this._stashUsed-=ht,this._stashByteStart+=ht}}},{key:"_flushStashBuffer",value:function(K){if(this._stashUsed>0){var Z=this._stashBuffer.slice(0,this._stashUsed),oe=this._dispatchChunks(Z,this._stashByteStart),he=Z.byteLength-oe;if(oe0){var Oe=new Uint8Array(this._stashBuffer,0,this._bufferSize),Je=new Uint8Array(Z,oe);Oe.set(Je,0),this._stashUsed=Je.byteLength,this._stashByteStart+=oe}return 0}return this._stashUsed=0,this._stashByteStart=0,he}return 0}},{key:"_onLoaderComplete",value:function(K,Z){this._flushStashBuffer(!0),this._onComplete&&this._onComplete(this._extraData)}},{key:"_onLoaderError",value:function(K,Z){C.e(this.TAG,"Loader error, code = ".concat(Z.code,", msg = ").concat(Z.msg)),this._flushStashBuffer(!1),this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,K=n.UNRECOVERABLE_EARLY_EOF);switch(K){case n.EARLY_EOF:{if(!this._config.isLive&&this._totalLength){var oe=this._currentRange.to+1;oe0){var Z=Re.getConfig();K.emit("change",Z)}}},{key:"registerListener",value:function(K){Re.emitter.addListener("change",K)}},{key:"removeListener",value:function(K){Re.emitter.removeListener("change",K)}},{key:"addLogListener",value:function(K){C.emitter.addListener("log",K),C.emitter.listenerCount("log")>0&&(C.ENABLE_CALLBACK=!0,Re._notifyChange())}},{key:"removeLogListener",value:function(K){C.emitter.removeListener("log",K),C.emitter.listenerCount("log")===0&&(C.ENABLE_CALLBACK=!1,Re._notifyChange())}}]),Re}();be.emitter=new _.a;var _e=be,Ke=function(){function Re(){Object(le.a)(this,Re),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(Q.a)(Re,[{key:"isComplete",value:function(){var K=this.hasAudio===!1||this.hasAudio===!0&&this.audioCodec!=null&&this.audioSampleRate!=null&&this.audioChannelCount!=null,Z=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&&K&&Z}},{key:"isSeekable",value:function(){return this.hasKeyframesIndex===!0}},{key:"getNearestKeyframe",value:function(K){if(this.keyframesIndex==null)return null;var Z=this.keyframesIndex,oe=this._search(Z.times,K);return{index:oe,milliseconds:Z.times[oe],fileposition:Z.filepositions[oe]}}},{key:"_search",value:function(K,Z){var oe=0,he=K.length-1,Oe=0,Je=0,lt=he;for(Z=K[Oe]&&Z=128){ve.push(String.fromCharCode(he&65535)),Z+=2;continue}}}else if(K[Z]<240){if(Be(K,Z,2)){var Oe=(K[Z]&15)<<12|(K[Z+1]&63)<<6|K[Z+2]&63;if(Oe>=2048&&(Oe&63488)!==55296){ve.push(String.fromCharCode(Oe&65535)),Z+=3;continue}}}else if(K[Z]<248&&Be(K,Z,3)){var Je=(K[Z]&7)<<18|(K[Z+1]&63)<<12|(K[Z+2]&63)<<6|K[Z+3]&63;if(Je>65536&&Je<1114112){Je-=65536,ve.push(String.fromCharCode(Je>>>10|55296)),ve.push(String.fromCharCode(Je&1023|56320)),Z+=4;continue}}}ve.push(String.fromCharCode(65533)),++Z}return ve.join("")}var ye=ze,pe=function(){var Re=new ArrayBuffer(2);return new DataView(Re).setInt16(0,256,!0),new Int16Array(Re)[0]===256}(),We=function(){function Re(){Object(le.a)(this,Re)}return Object(Q.a)(Re,null,[{key:"parseScriptData",value:function(K,Z,oe){var he={};try{var Oe=Re.parseValue(K,Z,oe),Je=Re.parseValue(K,Z+Oe.size,oe-Oe.size);he[Oe.data]=Je.data}catch(lt){C.e("AMF",lt.toString())}return he}},{key:"parseObject",value:function(K,Z,oe){if(oe<3)throw new d("Data not enough when parse ScriptDataObject");var he=Re.parseString(K,Z,oe),Oe=Re.parseValue(K,Z+he.size,oe-he.size),Je=Oe.objectEnd;return{data:{name:he.data,value:Oe.data},size:he.size+Oe.size,objectEnd:Je}}},{key:"parseVariable",value:function(K,Z,oe){return Re.parseObject(K,Z,oe)}},{key:"parseString",value:function(K,Z,oe){if(oe<2)throw new d("Data not enough when parse String");var he=new DataView(K,Z,oe),Oe=he.getUint16(0,!pe),Je;return Oe>0?Je=ye(new Uint8Array(K,Z+2,Oe)):Je="",{data:Je,size:2+Oe}}},{key:"parseLongString",value:function(K,Z,oe){if(oe<4)throw new d("Data not enough when parse LongString");var he=new DataView(K,Z,oe),Oe=he.getUint32(0,!pe),Je;return Oe>0?Je=ye(new Uint8Array(K,Z+4,Oe)):Je="",{data:Je,size:4+Oe}}},{key:"parseDate",value:function(K,Z,oe){if(oe<10)throw new d("Data size invalid when parse Date");var he=new DataView(K,Z,oe),Oe=he.getFloat64(0,!pe),Je=he.getInt16(8,!pe);return Oe+=Je*60*1e3,{data:new Date(Oe),size:8+2}}},{key:"parseValue",value:function(K,Z,oe){if(oe<1)throw new d("Data not enough when parse Value");var he=new DataView(K,Z,oe),Oe=1,Je=he.getUint8(0),lt,Pt=!1;try{switch(Je){case 0:lt=he.getFloat64(1,!pe),Oe+=8;break;case 1:{var Nt=he.getUint8(1);lt=!!Nt,Oe+=1;break}case 2:{var ht=Re.parseString(K,Z+1,oe-1);lt=ht.data,Oe+=ht.size;break}case 3:{lt={};var Mt=0;for((he.getUint32(oe-4,!pe)&16777215)===9&&(Mt=3);Oe32)throw new s("ExpGolomb: readBits() bits exceeded max 32bits!");if(K<=this._current_word_bits_left){var Z=this._current_word>>>32-K;return this._current_word<<=K,this._current_word_bits_left-=K,Z}var oe=this._current_word_bits_left?this._current_word:0;oe=oe>>>32-this._current_word_bits_left;var he=K-this._current_word_bits_left;this._fillCurrentWord();var Oe=Math.min(he,this._current_word_bits_left),Je=this._current_word>>>32-Oe;return this._current_word<<=Oe,this._current_word_bits_left-=Oe,oe=oe<>>K)!==0)return this._current_word<<=K,this._current_word_bits_left-=K,K;return this._fillCurrentWord(),K+this._skipLeadingZero()}},{key:"readUEG",value:function(){var K=this._skipLeadingZero();return this.readBits(K+1)-1}},{key:"readSEG",value:function(){var K=this.readUEG();return K&1?K+1>>>1:-1*(K>>>1)}}]),Re}(),re=nt,k=function(){function Re(){Object(le.a)(this,Re)}return Object(Q.a)(Re,null,[{key:"_ebsp2rbsp",value:function(K){for(var Z=K,oe=Z.byteLength,he=new Uint8Array(oe),Oe=0,Je=0;Je=2&&(Z[Je]===3&&Z[Je-1]===0&&Z[Je-2]===0))continue;he[Oe]=Z[Je],Oe++}return new Uint8Array(he.buffer,0,Oe)}},{key:"parseSPS",value:function(K){var Z=Re._ebsp2rbsp(K),oe=new re(Z);oe.readByte();var he=oe.readByte();oe.readByte();var Oe=oe.readByte();oe.readUEG();var Je=Re.getProfileString(he),lt=Re.getLevelString(Oe),Pt=1,Nt=420,ht=[0,420,422,444],Mt=8;if((he===100||he===110||he===122||he===244||he===44||he===83||he===86||he===118||he===128||he===138||he===144)&&(Pt=oe.readUEG(),Pt===3&&oe.readBits(1),Pt<=3&&(Nt=ht[Pt]),Mt=oe.readUEG()+8,oe.readUEG(),oe.readBits(1),oe.readBool()))for(var nn=Pt!==3?8:12,Rt=0;Rt0&&ur<16?(At=mi[ur-1],Ft=Ar[ur-1]):ur===255&&(At=oe.readByte()<<8|oe.readByte(),Ft=oe.readByte()<<8|oe.readByte())}if(oe.readBool()&&oe.readBool(),oe.readBool()&&(oe.readBits(4),oe.readBool()&&oe.readBits(24)),oe.readBool()&&(oe.readUEG(),oe.readUEG()),oe.readBool()){var fr=oe.readBits(32),br=oe.readBits(32);In=oe.readBool(),Lr=br,Sr=fr*2,on=Lr/Sr}}var Xr=1;(At!==1||Ft!==1)&&(Xr=At/Ft);var Dr=0,Yr=0;if(Pt===0)Dr=1,Yr=2-me;else{var gr=Pt===3?1:2,gi=Pt===1?2:1;Dr=gr,Yr=gi*(2-me)}var si=(F+1)*16,Pr=(2-me)*((ae+1)*16);si-=(se+$e)*Dr,Pr-=(Et+it)*Yr;var Fr=Math.ceil(si*Xr);return oe.destroy(),oe=null,{profile_string:Je,level_string:lt,bit_depth:Mt,ref_frames:N,chroma_format:Nt,chroma_format_string:Re.getChromaFormatString(Nt),frame_rate:{fixed:In,fps:on,fps_den:Sr,fps_num:Lr},sar_ratio:{width:At,height:Ft},codec_size:{width:si,height:Pr},present_size:{width:Fr,height:Pr}}}},{key:"_skipScalingList",value:function(K,Z){for(var oe=8,he=8,Oe=0,Je=0;Je>>8&255|(Re&255)<<8}function xe(Re){return(Re&4278190080)>>>24|(Re&16711680)>>>8|(Re&65280)<<8|(Re&255)<<24}function ke(Re,ve){return Re[ve]<<24|Re[ve+1]<<16|Re[ve+2]<<8|Re[ve+3]}var dt=function(){function Re(ve,K){Object(le.a)(this,Re),this.TAG="FLVDemuxer",this._config=K,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null,this._dataOffset=ve.dataOffset,this._firstParse=!0,this._dispatch=!1,this._hasAudio=ve.hasAudioTrack,this._hasVideo=ve.hasVideoTrack,this._hasAudioFlagOverrided=!1,this._hasVideoFlagOverrided=!1,this._audioInitialMetadataDispatched=!1,this._videoInitialMetadataDispatched=!1,this._mediaInfo=new Ne,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 Z=new ArrayBuffer(2);return new DataView(Z).setInt16(0,256,!0),new Int16Array(Z)[0]===256}()}return Object(Q.a)(Re,[{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(K){return K.onDataArrival=this.parseChunks.bind(this),this}},{key:"onTrackMetadata",get:function(){return this._onTrackMetadata},set:function(K){this._onTrackMetadata=K}},{key:"onMediaInfo",get:function(){return this._onMediaInfo},set:function(K){this._onMediaInfo=K}},{key:"onMetaDataArrived",get:function(){return this._onMetaDataArrived},set:function(K){this._onMetaDataArrived=K}},{key:"onScriptDataArrived",get:function(){return this._onScriptDataArrived},set:function(K){this._onScriptDataArrived=K}},{key:"onError",get:function(){return this._onError},set:function(K){this._onError=K}},{key:"onDataAvailable",get:function(){return this._onDataAvailable},set:function(K){this._onDataAvailable=K}},{key:"timestampBase",get:function(){return this._timestampBase},set:function(K){this._timestampBase=K}},{key:"overridedDuration",get:function(){return this._duration},set:function(K){this._durationOverrided=!0,this._duration=K,this._mediaInfo.duration=K}},{key:"overridedHasAudio",set:function(K){this._hasAudioFlagOverrided=!0,this._hasAudio=K,this._mediaInfo.hasAudio=K}},{key:"overridedHasVideo",set:function(K){this._hasVideoFlagOverrided=!0,this._hasVideo=K,this._mediaInfo.hasVideo=K}},{key:"resetMediaInfo",value:function(){this._mediaInfo=new Ne}},{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(K,Z){if(!this._onError||!this._onMediaInfo||!this._onTrackMetadata||!this._onDataAvailable)throw new d("Flv: onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");var oe=0,he=this._littleEndian;if(Z===0)if(K.byteLength>13){var Oe=Re.probe(K);oe=Oe.dataOffset}else return 0;if(this._firstParse){this._firstParse=!1,Z+oe!==this._dataOffset&&C.w(this.TAG,"First time parsing but chunk byteStart invalid!");var Je=new DataView(K,oe),lt=Je.getUint32(0,!he);lt!==0&&C.w(this.TAG,"PrevTagSize0 !== 0 !!!"),oe+=4}for(;oeK.byteLength)break;var Nt=Pt.getUint8(0),ht=Pt.getUint32(0,!he)&16777215;if(oe+11+ht+4>K.byteLength)break;if(Nt!==8&&Nt!==9&&Nt!==18){C.w(this.TAG,"Unsupported tag type ".concat(Nt,", skipped")),oe+=11+ht+4;continue}var Mt=Pt.getUint8(4),nn=Pt.getUint8(5),Rt=Pt.getUint8(6),cn=Pt.getUint8(7),an=Rt|nn<<8|Mt<<16|cn<<24,ie=Pt.getUint32(7,!he)&16777215;ie!==0&&C.w(this.TAG,"Meet tag which has StreamID != 0!");var N=oe+11;switch(Nt){case 8:this._parseAudioData(K,N,ht,an);break;case 9:this._parseVideoData(K,N,ht,an,Z+oe);break;case 18:this._parseScriptData(K,N,ht);break}var F=Pt.getUint32(11+ht,!he);F!==11+ht&&C.w(this.TAG,"Invalid PrevTagSize ".concat(F)),oe+=11+ht+4}return this._isInitialMetadataDispatched()&&(this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack)),oe}},{key:"_parseScriptData",value:function(K,Z,oe){var he=He.parseScriptData(K,Z,oe);if(he.hasOwnProperty("onMetaData")){if(he.onMetaData==null||typeof he.onMetaData!="object"){C.w(this.TAG,"Invalid onMetaData structure!");return}this._metadata&&C.w(this.TAG,"Found another onMetaData tag!"),this._metadata=he;var Oe=this._metadata.onMetaData;if(this._onMetaDataArrived&&this._onMetaDataArrived(Object.assign({},Oe)),typeof Oe.hasAudio=="boolean"&&(this._hasAudioFlagOverrided===!1&&(this._hasAudio=Oe.hasAudio,this._mediaInfo.hasAudio=this._hasAudio)),typeof Oe.hasVideo=="boolean"&&(this._hasVideoFlagOverrided===!1&&(this._hasVideo=Oe.hasVideo,this._mediaInfo.hasVideo=this._hasVideo)),typeof Oe.audiodatarate=="number"&&(this._mediaInfo.audioDataRate=Oe.audiodatarate),typeof Oe.videodatarate=="number"&&(this._mediaInfo.videoDataRate=Oe.videodatarate),typeof Oe.width=="number"&&(this._mediaInfo.width=Oe.width),typeof Oe.height=="number"&&(this._mediaInfo.height=Oe.height),typeof Oe.duration=="number"){if(!this._durationOverrided){var Je=Math.floor(Oe.duration*this._timescale);this._duration=Je,this._mediaInfo.duration=Je}}else this._mediaInfo.duration=0;if(typeof Oe.framerate=="number"){var lt=Math.floor(Oe.framerate*1e3);if(lt>0){var Pt=lt/1e3;this._referenceFrameRate.fixed=!0,this._referenceFrameRate.fps=Pt,this._referenceFrameRate.fps_num=lt,this._referenceFrameRate.fps_den=1e3,this._mediaInfo.fps=Pt}}if(typeof Oe.keyframes=="object"){this._mediaInfo.hasKeyframesIndex=!0;var Nt=Oe.keyframes;this._mediaInfo.keyframesIndex=this._parseKeyframesIndex(Nt),Oe.keyframes=null}else this._mediaInfo.hasKeyframesIndex=!1;this._dispatch=!1,this._mediaInfo.metadata=Oe,C.v(this.TAG,"Parsed onMetaData"),this._mediaInfo.isComplete()&&this._onMediaInfo(this._mediaInfo)}Object.keys(he).length>0&&(this._onScriptDataArrived&&this._onScriptDataArrived(Object.assign({},he)))}},{key:"_parseKeyframesIndex",value:function(K){for(var Z=[],oe=[],he=1;he>>4;if(Pt!==2&&Pt!==10){this._onError(Y.CODEC_UNSUPPORTED,"Flv: Unsupported audio codec idx: "+Pt);return}var Nt=0,ht=(lt&12)>>>2;if(ht>=0&&ht<=4)Nt=this._flvSoundRateTable[ht];else{this._onError(Y.FORMAT_ERROR,"Flv: Invalid audio sample rate idx: "+ht);return}var Mt=(lt&2)>>>1,nn=lt&1,Rt=this._audioMetadata,cn=this._audioTrack;if(Rt||(this._hasAudio===!1&&this._hasAudioFlagOverrided===!1&&(this._hasAudio=!0,this._mediaInfo.hasAudio=!0),Rt=this._audioMetadata={},Rt.type="audio",Rt.id=cn.id,Rt.timescale=this._timescale,Rt.duration=this._duration,Rt.audioSampleRate=Nt,Rt.channelCount=nn===0?1:2),Pt===10){var an=this._parseAACAudioData(K,Z+1,oe-1);if(an==null)return;if(an.packetType===0){Rt.config&&C.w(this.TAG,"Found another AudioSpecificConfig!");var ie=an.data;Rt.audioSampleRate=ie.samplingRate,Rt.channelCount=ie.channelCount,Rt.codec=ie.codec,Rt.originalCodec=ie.originalCodec,Rt.config=ie.config,Rt.refSampleDuration=1024/Rt.audioSampleRate*Rt.timescale,C.v(this.TAG,"Parsed AudioSpecificConfig"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._audioInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("audio",Rt);var N=this._mediaInfo;N.audioCodec=Rt.originalCodec,N.audioSampleRate=Rt.audioSampleRate,N.audioChannelCount=Rt.channelCount,N.hasVideo?N.videoCodec!=null&&(N.mimeType='video/x-flv; codecs="'+N.videoCodec+","+N.audioCodec+'"'):N.mimeType='video/x-flv; codecs="'+N.audioCodec+'"',N.isComplete()&&this._onMediaInfo(N)}else if(an.packetType===1){var F=this._timestampBase+he,ae={unit:an.data,length:an.data.byteLength,dts:F,pts:F};cn.samples.push(ae),cn.length+=an.data.length}else C.e(this.TAG,"Flv: Unsupported AAC data type ".concat(an.packetType))}else if(Pt===2){if(!Rt.codec){var me=this._parseMP3AudioData(K,Z+1,oe-1,!0);if(me==null)return;Rt.audioSampleRate=me.samplingRate,Rt.channelCount=me.channelCount,Rt.codec=me.codec,Rt.originalCodec=me.originalCodec,Rt.refSampleDuration=1152/Rt.audioSampleRate*Rt.timescale,C.v(this.TAG,"Parsed MPEG Audio Frame Header"),this._audioInitialMetadataDispatched=!0,this._onTrackMetadata("audio",Rt);var se=this._mediaInfo;se.audioCodec=Rt.codec,se.audioSampleRate=Rt.audioSampleRate,se.audioChannelCount=Rt.channelCount,se.audioDataRate=me.bitRate,se.hasVideo?se.videoCodec!=null&&(se.mimeType='video/x-flv; codecs="'+se.videoCodec+","+se.audioCodec+'"'):se.mimeType='video/x-flv; codecs="'+se.audioCodec+'"',se.isComplete()&&this._onMediaInfo(se)}var $e=this._parseMP3AudioData(K,Z+1,oe-1,!1);if($e==null)return;var Et=this._timestampBase+he,it={unit:$e,length:$e.byteLength,dts:Et,pts:Et};cn.samples.push(it),cn.length+=$e.length}}},{key:"_parseAACAudioData",value:function(K,Z,oe){if(oe<=1){C.w(this.TAG,"Flv: Invalid AAC packet, missing AACPacketType or/and Data!");return}var he={},Oe=new Uint8Array(K,Z,oe);return he.packetType=Oe[0],Oe[0]===0?he.data=this._parseAACAudioSpecificConfig(K,Z+1,oe-1):he.data=Oe.subarray(1),he}},{key:"_parseAACAudioSpecificConfig",value:function(K,Z,oe){var he=new Uint8Array(K,Z,oe),Oe=null,Je=0,lt=0,Pt=null,Nt=0,ht=null;if(Je=lt=he[0]>>>3,Nt=(he[0]&7)<<1|he[1]>>>7,Nt<0||Nt>=this._mpegSamplingRates.length){this._onError(Y.FORMAT_ERROR,"Flv: AAC invalid sampling frequency index!");return}var Mt=this._mpegSamplingRates[Nt],nn=(he[1]&120)>>>3;if(nn<0||nn>=8){this._onError(Y.FORMAT_ERROR,"Flv: AAC invalid channel configuration");return}Je===5&&(ht=(he[1]&7)<<1|he[2]>>>7,Pt=(he[2]&124)>>>2);var Rt=self.navigator.userAgent.toLowerCase();return Rt.indexOf("firefox")!==-1?Nt>=6?(Je=5,Oe=new Array(4),ht=Nt-3):(Je=2,Oe=new Array(2),ht=Nt):Rt.indexOf("android")!==-1?(Je=2,Oe=new Array(2),ht=Nt):(Je=5,ht=Nt,Oe=new Array(4),Nt>=6?ht=Nt-3:nn===1&&(Je=2,Oe=new Array(2),ht=Nt)),Oe[0]=Je<<3,Oe[0]|=(Nt&15)>>>1,Oe[1]=(Nt&15)<<7,Oe[1]|=(nn&15)<<3,Je===5&&(Oe[1]|=(ht&15)>>>1,Oe[2]=(ht&1)<<7,Oe[2]|=2<<2,Oe[3]=0),{config:Oe,samplingRate:Mt,channelCount:nn,codec:"mp4a.40."+Je,originalCodec:"mp4a.40."+lt}}},{key:"_parseMP3AudioData",value:function(K,Z,oe,he){if(oe<4){C.w(this.TAG,"Flv: Invalid MP3 packet, header missing!");return}var Oe=this._littleEndian,Je=new Uint8Array(K,Z,oe),lt=null;if(he){if(Je[0]!==255)return;var Pt=Je[1]>>>3&3,Nt=(Je[1]&6)>>1,ht=(Je[2]&240)>>>4,Mt=(Je[2]&12)>>>2,nn=Je[3]>>>6&3,Rt=nn!==3?2:1,cn=0,an=0,ie=34,N="mp3";switch(Pt){case 0:cn=this._mpegAudioV25SampleRateTable[Mt];break;case 2:cn=this._mpegAudioV20SampleRateTable[Mt];break;case 3:cn=this._mpegAudioV10SampleRateTable[Mt];break}switch(Nt){case 1:ie=34,ht>>4,Pt=Je&15;if(Pt!==7){this._onError(Y.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: ".concat(Pt));return}this._parseAVCVideoPacket(K,Z+1,oe-1,he,Oe,lt)}},{key:"_parseAVCVideoPacket",value:function(K,Z,oe,he,Oe,Je){if(oe<4){C.w(this.TAG,"Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime");return}var lt=this._littleEndian,Pt=new DataView(K,Z,oe),Nt=Pt.getUint8(0),ht=Pt.getUint32(0,!lt)&16777215,Mt=ht<<8>>8;if(Nt===0)this._parseAVCDecoderConfigurationRecord(K,Z+4,oe-4);else if(Nt===1)this._parseAVCVideoData(K,Z+4,oe-4,he,Oe,Je,Mt);else if(!(Nt===2)){this._onError(Y.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(Nt));return}}},{key:"_parseAVCDecoderConfigurationRecord",value:function(K,Z,oe){if(oe<7){C.w(this.TAG,"Flv: Invalid AVCDecoderConfigurationRecord, lack of data!");return}var he=this._videoMetadata,Oe=this._videoTrack,Je=this._littleEndian,lt=new DataView(K,Z,oe);he?typeof he.avcc!="undefined"&&C.w(this.TAG,"Found another AVCDecoderConfigurationRecord!"):(this._hasVideo===!1&&this._hasVideoFlagOverrided===!1&&(this._hasVideo=!0,this._mediaInfo.hasVideo=!0),he=this._videoMetadata={},he.type="video",he.id=Oe.id,he.timescale=this._timescale,he.duration=this._duration);var Pt=lt.getUint8(0),Nt=lt.getUint8(1),ht=lt.getUint8(2),Mt=lt.getUint8(3);if(Pt!==1||Nt===0){this._onError(Y.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord");return}if(this._naluLengthSize=(lt.getUint8(4)&3)+1,this._naluLengthSize!==3&&this._naluLengthSize!==4){this._onError(Y.FORMAT_ERROR,"Flv: Strange NaluLengthSizeMinusOne: ".concat(this._naluLengthSize-1));return}var nn=lt.getUint8(5)&31;if(nn===0){this._onError(Y.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No SPS");return}else nn>1&&C.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: SPS Count = ".concat(nn));for(var Rt=6,cn=0;cn1&&C.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: PPS Count = ".concat(Vt));Rt++;for(var At=0;At=oe){C.w(this.TAG,"Malformed Nalu near timestamp ".concat(cn,", offset = ").concat(nn,", dataSize = ").concat(oe));break}var ie=Nt.getUint32(nn,!Pt);if(Rt===3&&(ie>>>=8),ie>oe-Rt){C.w(this.TAG,"Malformed Nalus near timestamp ".concat(cn,", NaluSize > DataSize!"));return}var N=Nt.getUint8(nn+Rt)&31;N===5&&(an=!0);var F=new Uint8Array(K,Z+nn,Rt+ie),ae={type:N,data:F};ht.push(ae),Mt+=F.byteLength,nn+=Rt+ie}if(ht.length){var me=this._videoTrack,se={units:ht,length:Mt,isKeyframe:an,dts:cn,cts:lt,pts:cn+lt};an&&(se.fileposition=Oe),me.samples.push(se),me.length+=Mt}}}],[{key:"probe",value:function(K){var Z=new Uint8Array(K),oe={match:!1};if(Z[0]!==70||Z[1]!==76||Z[2]!==86||Z[3]!==1)return oe;var he=(Z[4]&4)>>>2!==0,Oe=(Z[4]&1)!==0,Je=ke(Z,5);return Je<9?oe:{match:!0,consumed:Je,dataOffset:Je,hasAudioTrack:he,hasVideoTrack:Oe}}}]),Re}(),Ue=dt,je=function(){function Re(){Object(le.a)(this,Re)}return Object(Q.a)(Re,null,[{key:"init",value:function(){Re.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 K in Re.types)Re.types.hasOwnProperty(K)&&(Re.types[K]=[K.charCodeAt(0),K.charCodeAt(1),K.charCodeAt(2),K.charCodeAt(3)]);var Z=Re.constants={};Z.FTYP=new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]),Z.STSD_PREFIX=new Uint8Array([0,0,0,0,0,0,0,1]),Z.STTS=new Uint8Array([0,0,0,0,0,0,0,0]),Z.STSC=Z.STCO=Z.STTS,Z.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),Z.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]),Z.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]),Z.DREF=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),Z.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),Z.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}},{key:"box",value:function(K){for(var Z=8,oe=null,he=Array.prototype.slice.call(arguments,1),Oe=he.length,Je=0;Je>>24&255,oe[1]=Z>>>16&255,oe[2]=Z>>>8&255,oe[3]=Z&255,oe.set(K,4);for(var lt=8,Pt=0;Pt>>24&255,K>>>16&255,K>>>8&255,K&255,Z>>>24&255,Z>>>16&255,Z>>>8&255,Z&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(K){return Re.box(Re.types.trak,Re.tkhd(K),Re.mdia(K))}},{key:"tkhd",value:function(K){var Z=K.id,oe=K.duration,he=K.presentWidth,Oe=K.presentHeight;return Re.box(Re.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,Z>>>24&255,Z>>>16&255,Z>>>8&255,Z&255,0,0,0,0,oe>>>24&255,oe>>>16&255,oe>>>8&255,oe&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,he>>>8&255,he&255,0,0,Oe>>>8&255,Oe&255,0,0]))}},{key:"mdia",value:function(K){return Re.box(Re.types.mdia,Re.mdhd(K),Re.hdlr(K),Re.minf(K))}},{key:"mdhd",value:function(K){var Z=K.timescale,oe=K.duration;return Re.box(Re.types.mdhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,Z>>>24&255,Z>>>16&255,Z>>>8&255,Z&255,oe>>>24&255,oe>>>16&255,oe>>>8&255,oe&255,85,196,0,0]))}},{key:"hdlr",value:function(K){var Z=null;return K.type==="audio"?Z=Re.constants.HDLR_AUDIO:Z=Re.constants.HDLR_VIDEO,Re.box(Re.types.hdlr,Z)}},{key:"minf",value:function(K){var Z=null;return K.type==="audio"?Z=Re.box(Re.types.smhd,Re.constants.SMHD):Z=Re.box(Re.types.vmhd,Re.constants.VMHD),Re.box(Re.types.minf,Z,Re.dinf(),Re.stbl(K))}},{key:"dinf",value:function(){var K=Re.box(Re.types.dinf,Re.box(Re.types.dref,Re.constants.DREF));return K}},{key:"stbl",value:function(K){var Z=Re.box(Re.types.stbl,Re.stsd(K),Re.box(Re.types.stts,Re.constants.STTS),Re.box(Re.types.stsc,Re.constants.STSC),Re.box(Re.types.stsz,Re.constants.STSZ),Re.box(Re.types.stco,Re.constants.STCO));return Z}},{key:"stsd",value:function(K){return K.type==="audio"?K.codec==="mp3"?Re.box(Re.types.stsd,Re.constants.STSD_PREFIX,Re.mp3(K)):Re.box(Re.types.stsd,Re.constants.STSD_PREFIX,Re.mp4a(K)):Re.box(Re.types.stsd,Re.constants.STSD_PREFIX,Re.avc1(K))}},{key:"mp3",value:function(K){var Z=K.channelCount,oe=K.audioSampleRate,he=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,Z,0,16,0,0,0,0,oe>>>8&255,oe&255,0,0]);return Re.box(Re.types[".mp3"],he)}},{key:"mp4a",value:function(K){var Z=K.channelCount,oe=K.audioSampleRate,he=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,Z,0,16,0,0,0,0,oe>>>8&255,oe&255,0,0]);return Re.box(Re.types.mp4a,he,Re.esds(K))}},{key:"esds",value:function(K){var Z=K.config||[],oe=Z.length,he=new Uint8Array([0,0,0,0,3,23+oe,0,1,0,4,15+oe,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([oe]).concat(Z).concat([6,1,2]));return Re.box(Re.types.esds,he)}},{key:"avc1",value:function(K){var Z=K.avcc,oe=K.codecWidth,he=K.codecHeight,Oe=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,oe>>>8&255,oe&255,he>>>8&255,he&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 Re.box(Re.types.avc1,Oe,Re.box(Re.types.avcC,Z))}},{key:"mvex",value:function(K){return Re.box(Re.types.mvex,Re.trex(K))}},{key:"trex",value:function(K){var Z=K.id,oe=new Uint8Array([0,0,0,0,Z>>>24&255,Z>>>16&255,Z>>>8&255,Z&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return Re.box(Re.types.trex,oe)}},{key:"moof",value:function(K,Z){return Re.box(Re.types.moof,Re.mfhd(K.sequenceNumber),Re.traf(K,Z))}},{key:"mfhd",value:function(K){var Z=new Uint8Array([0,0,0,0,K>>>24&255,K>>>16&255,K>>>8&255,K&255]);return Re.box(Re.types.mfhd,Z)}},{key:"traf",value:function(K,Z){var oe=K.id,he=Re.box(Re.types.tfhd,new Uint8Array([0,0,0,0,oe>>>24&255,oe>>>16&255,oe>>>8&255,oe&255])),Oe=Re.box(Re.types.tfdt,new Uint8Array([0,0,0,0,Z>>>24&255,Z>>>16&255,Z>>>8&255,Z&255])),Je=Re.sdtp(K),lt=Re.trun(K,Je.byteLength+16+16+8+16+8+8);return Re.box(Re.types.traf,he,Oe,lt,Je)}},{key:"sdtp",value:function(K){for(var Z=K.samples||[],oe=Z.length,he=new Uint8Array(4+oe),Oe=0;Oe>>24&255,he>>>16&255,he>>>8&255,he&255,Z>>>24&255,Z>>>16&255,Z>>>8&255,Z&255],0);for(var lt=0;lt>>24&255,Pt>>>16&255,Pt>>>8&255,Pt&255,Nt>>>24&255,Nt>>>16&255,Nt>>>8&255,Nt&255,ht.isLeading<<2|ht.dependsOn,ht.isDependedOn<<6|ht.hasRedundancy<<4|ht.isNonSync,0,0,Mt>>>24&255,Mt>>>16&255,Mt>>>8&255,Mt&255],12+16*lt)}return Re.box(Re.types.trun,Je)}},{key:"mdat",value:function(K){return Re.box(Re.types.mdat,K)}}]),Re}();je.init();var tt=je,mt=function(){function Re(){Object(le.a)(this,Re)}return Object(Q.a)(Re,null,[{key:"getSilentFrame",value:function(K,Z){if(K==="mp4a.40.2"){if(Z===1)return new Uint8Array([0,200,0,128,35,128]);if(Z===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(Z===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(Z===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(Z===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(Z===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(Z===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(Z===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(Z===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}}]),Re}(),Qe=mt,Xe=function Re(ve,K,Z,oe,he){Object(le.a)(this,Re),this.dts=ve,this.pts=K,this.duration=Z,this.originalDts=oe,this.isSyncPoint=he,this.fileposition=null},Fe=function(){function Re(){Object(le.a)(this,Re),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(Q.a)(Re,[{key:"appendSyncPoint",value:function(K){K.isSyncPoint=!0,this.syncPoints.push(K)}}]),Re}(),Ie=function(){function Re(){Object(le.a)(this,Re),this._list=[]}return Object(Q.a)(Re,[{key:"clear",value:function(){this._list=[]}},{key:"appendArray",value:function(K){var Z=this._list;if(K.length===0)return;Z.length>0&&K[0].originalDts=Z[Oe].dts&&KZ[he].lastSample.originalDts&&K=Z[he].lastSample.originalDts&&(he===Z.length-1||he0&&(Oe=this._searchNearestSegmentBefore(oe.originalBeginDts)+1),this._lastAppendLocation=Oe,this._list.splice(Oe,0,oe)}},{key:"getLastSegmentBefore",value:function(K){var Z=this._searchNearestSegmentBefore(K);return Z>=0?this._list[Z]:null}},{key:"getLastSampleBefore",value:function(K){var Z=this.getLastSegmentBefore(K);return Z!=null?Z.lastSample:null}},{key:"getLastSyncPointBefore",value:function(K){for(var Z=this._searchNearestSegmentBefore(K),oe=this._list[Z].syncPoints;oe.length===0&&Z>0;)Z--,oe=this._list[Z].syncPoints;return oe.length>0?oe[oe.length-1]:null}}]),Re}(),Ee=function(){function Re(ve){Object(le.a)(this,Re),this.TAG="MP4Remuxer",this._config=ve,this._isLive=ve.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 Me("audio"),this._videoSegmentInfoList=new Me("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(Q.a)(Re,[{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(K){return K.onDataAvailable=this.remux.bind(this),K.onTrackMetadata=this._onTrackMetadataReceived.bind(this),this}},{key:"onInitSegment",get:function(){return this._onInitSegment},set:function(K){this._onInitSegment=K}},{key:"onMediaSegment",get:function(){return this._onMediaSegment},set:function(K){this._onMediaSegment=K}},{key:"insertDiscontinuity",value:function(){this._audioNextDts=this._videoNextDts=void 0}},{key:"seek",value:function(K){this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._videoSegmentInfoList.clear(),this._audioSegmentInfoList.clear()}},{key:"remux",value:function(K,Z){if(!this._onMediaSegment)throw new d("MP4Remuxer: onMediaSegment callback must be specificed!");this._dtsBaseInited||this._calculateDtsBase(K,Z),this._remuxVideo(Z),this._remuxAudio(K)}},{key:"_onTrackMetadataReceived",value:function(K,Z){var oe=null,he="mp4",Oe=Z.codec;if(K==="audio")this._audioMeta=Z,Z.codec==="mp3"&&this._mp3UseMpegAudio?(he="mpeg",Oe="",oe=new Uint8Array):oe=tt.generateInitSegment(Z);else if(K==="video")this._videoMeta=Z,oe=tt.generateInitSegment(Z);else return;if(!this._onInitSegment)throw new d("MP4Remuxer: onInitSegment callback must be specified!");this._onInitSegment(K,{type:K,data:oe.buffer,codec:Oe,container:"".concat(K,"/").concat(he),mediaDuration:Z.duration})}},{key:"_calculateDtsBase",value:function(K,Z){if(this._dtsBaseInited)return;K.samples&&K.samples.length&&(this._audioDtsBase=K.samples[0].dts),Z.samples&&Z.samples.length&&(this._videoDtsBase=Z.samples[0].dts),this._dtsBase=Math.min(this._audioDtsBase,this._videoDtsBase),this._dtsBaseInited=!0}},{key:"flushStashedSamples",value:function(){var K=this._videoStashedLastSample,Z=this._audioStashedLastSample,oe={type:"video",id:1,sequenceNumber:0,samples:[],length:0};K!=null&&(oe.samples.push(K),oe.length=K.length);var he={type:"audio",id:2,sequenceNumber:0,samples:[],length:0};Z!=null&&(he.samples.push(Z),he.length=Z.length),this._videoStashedLastSample=null,this._audioStashedLastSample=null,this._remuxVideo(oe,!0),this._remuxAudio(he,!0)}},{key:"_remuxAudio",value:function(K,Z){if(this._audioMeta==null)return;var oe=K,he=oe.samples,Oe=void 0,Je=-1,lt=-1,Pt=-1,Nt=this._audioMeta.refSampleDuration,ht=this._audioMeta.codec==="mp3"&&this._mp3UseMpegAudio,Mt=this._dtsBaseInited&&this._audioNextDts===void 0,nn=!1;if(!he||he.length===0)return;if(he.length===1&&!Z)return;var Rt=0,cn=null,an=0;ht?(Rt=0,an=oe.length):(Rt=8,an=8+oe.length);var ie=null;if(he.length>1&&(ie=he.pop(),an-=ie.length),this._audioStashedLastSample!=null){var N=this._audioStashedLastSample;this._audioStashedLastSample=null,he.unshift(N),an+=N.length}ie!=null&&(this._audioStashedLastSample=ie);var F=he[0].dts-this._dtsBase;if(this._audioNextDts)Oe=F-this._audioNextDts;else if(this._audioSegmentInfoList.isEmpty())Oe=0,this._fillSilentAfterSeek&&!this._videoSegmentInfoList.isEmpty()&&(this._audioMeta.originalCodec!=="mp3"&&(nn=!0));else{var ae=this._audioSegmentInfoList.getLastSampleBefore(F);if(ae!=null){var me=F-(ae.originalDts+ae.duration);me<=3&&(me=0);var se=ae.dts+ae.duration+me;Oe=F-se}else Oe=0}if(nn){var $e=F-Oe,Et=this._videoSegmentInfoList.getLastSegmentBefore(F);if(Et!=null&&Et.beginDts<$e){var it=Qe.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);if(it){var Vt=Et.beginDts,At=$e-Et.beginDts;C.v(this.TAG,"InsertPrefixSilentAudio: dts: ".concat(Vt,", duration: ").concat(At)),he.unshift({unit:it,dts:Vt,pts:Vt}),an+=it.byteLength}}else nn=!1}for(var Ft=[],on=0;on=1?ur=Ft[Ft.length-1].duration:ur=Math.floor(Nt);var fr=!1,br=null;if(ur>Nt*1.5&&this._audioMeta.codec!=="mp3"&&this._fillAudioTimestampGap&&!m.safari){fr=!0;var Xr=Math.abs(ur-Nt),Dr=Math.ceil(Xr/Nt),Yr=Un+Nt;C.w(this.TAG,`Large audio timestamp gap detected, may cause AV sync to drift. Silent frames will be generated to avoid unsync. `+"dts: ".concat(Un+ur," ms, expected: ").concat(Un+Math.round(Nt)," ms, ")+"delta: ".concat(Math.round(Xr)," ms, generate: ").concat(Dr," frames"));var gr=Qe.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);gr==null&&(C.w(this.TAG,"Unable to generate silent frame for "+"".concat(this._audioMeta.originalCodec," with ").concat(this._audioMeta.channelCount," channels, repeat last frame")),gr=Lr),br=[];for(var gi=0;gi0){var Pr=br[br.length-1];Pr.duration=si-Pr.dts}var Fr={dts:si,pts:si,cts:0,unit:gr,size:gr.byteLength,duration:0,originalDts:Sr,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}};br.push(Fr),an+=Fr.size,Yr+=Nt}var Ei=br[br.length-1];Ei.duration=Un+ur-Ei.dts,ur=Math.round(Nt)}Ft.push({dts:Un,pts:Un,cts:0,unit:In.unit,size:In.unit.byteLength,duration:ur,originalDts:Sr,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}}),fr&&Ft.push.apply(Ft,br)}ht?cn=new Uint8Array(an):(cn=new Uint8Array(an),cn[0]=an>>>24&255,cn[1]=an>>>16&255,cn[2]=an>>>8&255,cn[3]=an&255,cn.set(tt.types.mdat,4));for(var vi=0;vi1&&(Rt=he.pop(),nn-=Rt.length),this._videoStashedLastSample!=null){var cn=this._videoStashedLastSample;this._videoStashedLastSample=null,he.unshift(cn),nn+=cn.length}Rt!=null&&(this._videoStashedLastSample=Rt);var an=he[0].dts-this._dtsBase;if(this._videoNextDts)Oe=an-this._videoNextDts;else if(this._videoSegmentInfoList.isEmpty())Oe=0;else{var ie=this._videoSegmentInfoList.getLastSampleBefore(an);if(ie!=null){var N=an-(ie.originalDts+ie.duration);N<=3&&(N=0);var F=ie.dts+ie.duration+N;Oe=an-F}else Oe=0}for(var ae=new Fe,me=[],se=0;se=1?on=me[me.length-1].duration:on=Math.floor(this._videoMeta.refSampleDuration);if(it){var Sr=new Xe(Vt,Ft,on,$e.dts,!0);Sr.fileposition=$e.fileposition,ae.appendSyncPoint(Sr)}me.push({dts:Vt,pts:Ft,cts:At,units:$e.units,size:$e.length,isKeyframe:it,duration:on,originalDts:Et,flags:{isLeading:0,dependsOn:it?2:1,isDependedOn:it?1:0,hasRedundancy:0,isNonSync:it?0:1}})}Mt=new Uint8Array(nn),Mt[0]=nn>>>24&255,Mt[1]=nn>>>16&255,Mt[2]=nn>>>8&255,Mt[3]=nn&255,Mt.set(tt.types.mdat,4);for(var Un=0;Un0)this._demuxer.bindDataSource(this._ioctl),this._demuxer.timestampBase=this._mediaDataSource.segments[this._currentSegmentIndex].timestampBase,Oe=this._demuxer.parseChunks(K,Z);else if((he=Ue.probe(K)).match){this._demuxer=new Ue(he,this._config),this._remuxer||(this._remuxer=new Ae(this._config));var Je=this._mediaDataSource;Je.duration!=null&&!isNaN(Je.duration)&&(this._demuxer.overridedDuration=Je.duration),typeof Je.hasAudio=="boolean"&&(this._demuxer.overridedHasAudio=Je.hasAudio),typeof Je.hasVideo=="boolean"&&(this._demuxer.overridedHasVideo=Je.hasVideo),this._demuxer.timestampBase=Je.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),Oe=this._demuxer.parseChunks(K,Z)}else he=null,C.e(this.TAG,"Non-FLV, Unsupported media type!"),Promise.resolve().then(function(){oe._internalAbort()}),this._emitter.emit(Te.DEMUX_ERROR,Y.FORMAT_UNSUPPORTED,"Non-FLV, Unsupported media type"),Oe=0;return Oe}},{key:"_onMediaInfo",value:function(K){var Z=this;this._mediaInfo==null&&(this._mediaInfo=Object.assign({},K),this._mediaInfo.keyframesIndex=null,this._mediaInfo.segments=[],this._mediaInfo.segmentCount=this._mediaDataSource.segments.length,Object.setPrototypeOf(this._mediaInfo,Ne.prototype));var oe=Object.assign({},K);Object.setPrototypeOf(oe,Ne.prototype),this._mediaInfo.segments[this._currentSegmentIndex]=oe,this._reportSegmentMediaInfo(this._currentSegmentIndex),this._pendingSeekTime!=null&&Promise.resolve().then(function(){var he=Z._pendingSeekTime;Z._pendingSeekTime=null,Z.seek(he)})}},{key:"_onMetaDataArrived",value:function(K){this._emitter.emit(Te.METADATA_ARRIVED,K)}},{key:"_onScriptDataArrived",value:function(K){this._emitter.emit(Te.SCRIPTDATA_ARRIVED,K)}},{key:"_onIOSeeked",value:function(){this._remuxer.insertDiscontinuity()}},{key:"_onIOComplete",value:function(K){var Z=K,oe=Z+1;oe0&&oe[0].originalDts===he&&(he=oe[0].pts),this._emitter.emit(Te.RECOMMEND_SEEKPOINT,he)}}},{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(K){var Z=this._mediaInfo.segments[K],oe=Object.assign({},Z);oe.duration=this._mediaInfo.duration,oe.segmentCount=this._mediaInfo.segmentCount,delete oe.segments,delete oe.keyframesIndex,this._emitter.emit(Te.MEDIA_INFO,oe)}},{key:"_reportStatisticsInfo",value:function(){var K={};K.url=this._ioctl.currentURL,K.hasRedirect=this._ioctl.hasRedirect,K.hasRedirect&&(K.redirectedURL=this._ioctl.currentRedirectedURL),K.speed=this._ioctl.currentSpeed,K.loaderType=this._ioctl.loaderType,K.currentSegmentIndex=this._currentSegmentIndex,K.totalSegmentCount=this._mediaDataSource.segments.length,this._emitter.emit(Te.STATISTICS_INFO,K)}}]),Re}(),ut=Ze,Tt=function(ve){var K="TransmuxingWorker",Z=null,oe=an.bind(this);w.install(),ve.addEventListener("message",function(ie){switch(ie.data.cmd){case"init":Z=new ut(ie.data.param[0],ie.data.param[1]),Z.on(Te.IO_ERROR,nn.bind(this)),Z.on(Te.DEMUX_ERROR,Rt.bind(this)),Z.on(Te.INIT_SEGMENT,he.bind(this)),Z.on(Te.MEDIA_SEGMENT,Oe.bind(this)),Z.on(Te.LOADING_COMPLETE,Je.bind(this)),Z.on(Te.RECOVERED_EARLY_EOF,lt.bind(this)),Z.on(Te.MEDIA_INFO,Pt.bind(this)),Z.on(Te.METADATA_ARRIVED,Nt.bind(this)),Z.on(Te.SCRIPTDATA_ARRIVED,ht.bind(this)),Z.on(Te.STATISTICS_INFO,Mt.bind(this)),Z.on(Te.RECOMMEND_SEEKPOINT,cn.bind(this));break;case"destroy":Z&&(Z.destroy(),Z=null),ve.postMessage({msg:"destroyed"});break;case"start":Z.start();break;case"stop":Z.stop();break;case"seek":Z.seek(ie.data.param);break;case"pause":Z.pause();break;case"resume":Z.resume();break;case"logging_config":{var N=ie.data.param;_e.applyConfig(N),N.enableCallback===!0?_e.addLogListener(oe):_e.removeLogListener(oe);break}}});function he(ie,N){var F={msg:Te.INIT_SEGMENT,data:{type:ie,data:N}};ve.postMessage(F,[N.data])}function Oe(ie,N){var F={msg:Te.MEDIA_SEGMENT,data:{type:ie,data:N}};ve.postMessage(F,[N.data])}function Je(){var ie={msg:Te.LOADING_COMPLETE};ve.postMessage(ie)}function lt(){var ie={msg:Te.RECOVERED_EARLY_EOF};ve.postMessage(ie)}function Pt(ie){var N={msg:Te.MEDIA_INFO,data:ie};ve.postMessage(N)}function Nt(ie){var N={msg:Te.METADATA_ARRIVED,data:ie};ve.postMessage(N)}function ht(ie){var N={msg:Te.SCRIPTDATA_ARRIVED,data:ie};ve.postMessage(N)}function Mt(ie){var N={msg:Te.STATISTICS_INFO,data:ie};ve.postMessage(N)}function nn(ie,N){ve.postMessage({msg:Te.IO_ERROR,data:{type:ie,info:N}})}function Rt(ie,N){ve.postMessage({msg:Te.DEMUX_ERROR,data:{type:ie,info:N}})}function cn(ie){ve.postMessage({msg:Te.RECOMMEND_SEEKPOINT,data:ie})}function an(ie,N){ve.postMessage({msg:"logcat_callback",data:{type:ie,logcat:N}})}},Ht=Tt,Qt=function(){function Re(ve,K){if(Object(le.a)(this,Re),this.TAG="Transmuxer",this._emitter=new _.a,K.enableWorker&&typeof Worker!="undefined")try{var Z=z("0r65");this._worker=Z(Ht),this._workerDestroying=!1,this._worker.addEventListener("message",this._onWorkerMessage.bind(this)),this._worker.postMessage({cmd:"init",param:[ve,K]}),this.e={onLoggingConfigChanged:this._onLoggingConfigChanged.bind(this)},_e.registerListener(this.e.onLoggingConfigChanged),this._worker.postMessage({cmd:"logging_config",param:_e.getConfig()})}catch(he){C.e(this.TAG,"Error while initialize transmuxing worker, fallback to inline transmuxing"),this._worker=null,this._controller=new ut(ve,K)}else this._controller=new ut(ve,K);if(this._controller){var oe=this._controller;oe.on(Te.IO_ERROR,this._onIOError.bind(this)),oe.on(Te.DEMUX_ERROR,this._onDemuxError.bind(this)),oe.on(Te.INIT_SEGMENT,this._onInitSegment.bind(this)),oe.on(Te.MEDIA_SEGMENT,this._onMediaSegment.bind(this)),oe.on(Te.LOADING_COMPLETE,this._onLoadingComplete.bind(this)),oe.on(Te.RECOVERED_EARLY_EOF,this._onRecoveredEarlyEof.bind(this)),oe.on(Te.MEDIA_INFO,this._onMediaInfo.bind(this)),oe.on(Te.METADATA_ARRIVED,this._onMetaDataArrived.bind(this)),oe.on(Te.SCRIPTDATA_ARRIVED,this._onScriptDataArrived.bind(this)),oe.on(Te.STATISTICS_INFO,this._onStatisticsInfo.bind(this)),oe.on(Te.RECOMMEND_SEEKPOINT,this._onRecommendSeekpoint.bind(this))}}return Object(Q.a)(Re,[{key:"destroy",value:function(){this._worker?this._workerDestroying||(this._workerDestroying=!0,this._worker.postMessage({cmd:"destroy"}),_e.removeListener(this.e.onLoggingConfigChanged),this.e=null):(this._controller.destroy(),this._controller=null),this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(K,Z){this._emitter.addListener(K,Z)}},{key:"off",value:function(K,Z){this._emitter.removeListener(K,Z)}},{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(K){this._worker?this._worker.postMessage({cmd:"seek",param:K}):this._controller.seek(K)}},{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(K,Z){var oe=this;Promise.resolve().then(function(){oe._emitter.emit(Te.INIT_SEGMENT,K,Z)})}},{key:"_onMediaSegment",value:function(K,Z){var oe=this;Promise.resolve().then(function(){oe._emitter.emit(Te.MEDIA_SEGMENT,K,Z)})}},{key:"_onLoadingComplete",value:function(){var K=this;Promise.resolve().then(function(){K._emitter.emit(Te.LOADING_COMPLETE)})}},{key:"_onRecoveredEarlyEof",value:function(){var K=this;Promise.resolve().then(function(){K._emitter.emit(Te.RECOVERED_EARLY_EOF)})}},{key:"_onMediaInfo",value:function(K){var Z=this;Promise.resolve().then(function(){Z._emitter.emit(Te.MEDIA_INFO,K)})}},{key:"_onMetaDataArrived",value:function(K){var Z=this;Promise.resolve().then(function(){Z._emitter.emit(Te.METADATA_ARRIVED,K)})}},{key:"_onScriptDataArrived",value:function(K){var Z=this;Promise.resolve().then(function(){Z._emitter.emit(Te.SCRIPTDATA_ARRIVED,K)})}},{key:"_onStatisticsInfo",value:function(K){var Z=this;Promise.resolve().then(function(){Z._emitter.emit(Te.STATISTICS_INFO,K)})}},{key:"_onIOError",value:function(K,Z){var oe=this;Promise.resolve().then(function(){oe._emitter.emit(Te.IO_ERROR,K,Z)})}},{key:"_onDemuxError",value:function(K,Z){var oe=this;Promise.resolve().then(function(){oe._emitter.emit(Te.DEMUX_ERROR,K,Z)})}},{key:"_onRecommendSeekpoint",value:function(K){var Z=this;Promise.resolve().then(function(){Z._emitter.emit(Te.RECOMMEND_SEEKPOINT,K)})}},{key:"_onLoggingConfigChanged",value:function(K){this._worker&&this._worker.postMessage({cmd:"logging_config",param:K})}},{key:"_onWorkerMessage",value:function(K){var Z=K.data,oe=Z.data;if(Z.msg==="destroyed"||this._workerDestroying){this._workerDestroying=!1,this._worker.terminate(),this._worker=null;return}switch(Z.msg){case Te.INIT_SEGMENT:case Te.MEDIA_SEGMENT:this._emitter.emit(Z.msg,oe.type,oe.data);break;case Te.LOADING_COMPLETE:case Te.RECOVERED_EARLY_EOF:this._emitter.emit(Z.msg);break;case Te.MEDIA_INFO:Object.setPrototypeOf(oe,Ne.prototype),this._emitter.emit(Z.msg,oe);break;case Te.METADATA_ARRIVED:case Te.SCRIPTDATA_ARRIVED:case Te.STATISTICS_INFO:this._emitter.emit(Z.msg,oe);break;case Te.IO_ERROR:case Te.DEMUX_ERROR:this._emitter.emit(Z.msg,oe.type,oe.info);break;case Te.RECOMMEND_SEEKPOINT:this._emitter.emit(Z.msg,oe);break;case"logcat_callback":C.emitter.emit("log",oe.type,oe.logcat);break;default:break}}}]),Re}(),bt=Qt,Lt={ERROR:"error",SOURCE_OPEN:"source_open",UPDATE_END:"update_end",BUFFER_FULL:"buffer_full"},at=Lt,pt=function(){function Re(ve){Object(le.a)(this,Re),this.TAG="MSEController",this._config=ve,this._emitter=new _.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 Ie}return Object(Q.a)(Re,[{key:"destroy",value:function(){(this._mediaElement||this._mediaSource)&&this.detachMediaElement(),this.e=null,this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(K,Z){this._emitter.addListener(K,Z)}},{key:"off",value:function(K,Z){this._emitter.removeListener(K,Z)}},{key:"attachMediaElement",value:function(K){if(this._mediaSource)throw new d("MediaSource has been attached to an HTMLMediaElement!");var Z=this._mediaSource=new window.MediaSource;Z.addEventListener("sourceopen",this.e.onSourceOpen),Z.addEventListener("sourceended",this.e.onSourceEnded),Z.addEventListener("sourceclose",this.e.onSourceClose),this._mediaElement=K,this._mediaSourceObjectURL=window.URL.createObjectURL(this._mediaSource),K.src=this._mediaSourceObjectURL}},{key:"detachMediaElement",value:function(){if(this._mediaSource){var K=this._mediaSource;for(var Z in this._sourceBuffers){var oe=this._pendingSegments[Z];oe.splice(0,oe.length),this._pendingSegments[Z]=null,this._pendingRemoveRanges[Z]=null,this._lastInitSegments[Z]=null;var he=this._sourceBuffers[Z];if(he){if(K.readyState!=="closed"){try{K.removeSourceBuffer(he)}catch(Oe){C.e(this.TAG,Oe.message)}he.removeEventListener("error",this.e.onSourceBufferError),he.removeEventListener("updateend",this.e.onSourceBufferUpdateEnd)}this._mimeTypes[Z]=null,this._sourceBuffers[Z]=null}}if(K.readyState==="open")try{K.endOfStream()}catch(Oe){C.e(this.TAG,Oe.message)}K.removeEventListener("sourceopen",this.e.onSourceOpen),K.removeEventListener("sourceended",this.e.onSourceEnded),K.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(K,Z){if(!this._mediaSource||this._mediaSource.readyState!=="open"){this._pendingSourceBufferInit.push(K),this._pendingSegments[K.type].push(K);return}var oe=K,he="".concat(oe.container);oe.codec&&oe.codec.length>0&&(he+=";codecs=".concat(oe.codec));var Oe=!1;if(C.v(this.TAG,"Received Initialization Segment, mimeType: "+he),this._lastInitSegments[oe.type]=oe,he!==this._mimeTypes[oe.type]){if(this._mimeTypes[oe.type])C.v(this.TAG,"Notice: ".concat(oe.type," mimeType changed, origin: ").concat(this._mimeTypes[oe.type],", target: ").concat(he));else{Oe=!0;try{var Je=this._sourceBuffers[oe.type]=this._mediaSource.addSourceBuffer(he);Je.addEventListener("error",this.e.onSourceBufferError),Je.addEventListener("updateend",this.e.onSourceBufferUpdateEnd)}catch(lt){C.e(this.TAG,lt.message),this._emitter.emit(at.ERROR,{code:lt.code,msg:lt.message});return}}this._mimeTypes[oe.type]=he}Z||this._pendingSegments[oe.type].push(oe),Oe||this._sourceBuffers[oe.type]&&!this._sourceBuffers[oe.type].updating&&this._doAppendSegments(),m.safari&&oe.container==="audio/mpeg"&&oe.mediaDuration>0&&(this._requireSetMediaDuration=!0,this._pendingMediaDuration=oe.mediaDuration/1e3,this._updateMediaSourceDuration())}},{key:"appendMediaSegment",value:function(K){var Z=K;this._pendingSegments[Z.type].push(Z),this._config.autoCleanupSourceBuffer&&this._needCleanupSourceBuffer()&&this._doCleanupSourceBuffer();var oe=this._sourceBuffers[Z.type];oe&&!oe.updating&&!this._hasPendingRemoveRanges()&&this._doAppendSegments()}},{key:"seek",value:function(K){for(var Z in this._sourceBuffers){if(!this._sourceBuffers[Z])continue;var oe=this._sourceBuffers[Z];if(this._mediaSource.readyState==="open")try{oe.abort()}catch(Nt){C.e(this.TAG,Nt.message)}this._idrList.clear();var he=this._pendingSegments[Z];if(he.splice(0,he.length),this._mediaSource.readyState==="closed")continue;for(var Oe=0;Oe=1&&K-he.start(0)>=this._config.autoCleanupMaxBackwardDuration)return!0}}return!1}},{key:"_doCleanupSourceBuffer",value:function(){var K=this._mediaElement.currentTime;for(var Z in this._sourceBuffers){var oe=this._sourceBuffers[Z];if(oe){for(var he=oe.buffered,Oe=!1,Je=0;Je=this._config.autoCleanupMaxBackwardDuration){Oe=!0;var Nt=K-this._config.autoCleanupMinBackwardDuration;this._pendingRemoveRanges[Z].push({start:lt,end:Nt})}}else Pt0&&(isNaN(Z)||oe>Z)&&(C.v(this.TAG,"Update MediaSource duration from ".concat(Z," to ").concat(oe)),this._mediaSource.duration=oe),this._requireSetMediaDuration=!1,this._pendingMediaDuration=0}},{key:"_doRemoveRanges",value:function(){for(var K in this._pendingRemoveRanges){if(!this._sourceBuffers[K]||this._sourceBuffers[K].updating)continue;for(var Z=this._sourceBuffers[K],oe=this._pendingRemoveRanges[K];oe.length&&!Z.updating;){var he=oe.shift();Z.remove(he.start,he.end)}}}},{key:"_doAppendSegments",value:function(){var K=this._pendingSegments;for(var Z in K){if(!this._sourceBuffers[Z]||this._sourceBuffers[Z].updating)continue;if(K[Z].length>0){var oe=K[Z].shift();if(oe.timestampOffset){var he=this._sourceBuffers[Z].timestampOffset,Oe=oe.timestampOffset/1e3,Je=Math.abs(he-Oe);Je>.1&&(C.v(this.TAG,"Update MPEG audio timestampOffset from ".concat(he," to ").concat(Oe)),this._sourceBuffers[Z].timestampOffset=Oe),delete oe.timestampOffset}if(!oe.data||oe.data.byteLength===0)continue;try{this._sourceBuffers[Z].appendBuffer(oe.data),this._isBufferFull=!1,Z==="video"&&oe.hasOwnProperty("info")&&this._idrList.appendArray(oe.info.syncPoints)}catch(lt){this._pendingSegments[Z].unshift(oe),lt.code===22?(this._isBufferFull||this._emitter.emit(at.BUFFER_FULL),this._isBufferFull=!0):(C.e(this.TAG,lt.message),this._emitter.emit(at.ERROR,{code:lt.code,msg:lt.message}))}}}}},{key:"_onSourceOpen",value:function(){if(C.v(this.TAG,"MediaSource onSourceOpen"),this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._pendingSourceBufferInit.length>0)for(var K=this._pendingSourceBufferInit;K.length;){var Z=K.shift();this.appendInitSegment(Z,!0)}this._hasPendingSegments()&&this._doAppendSegments(),this._emitter.emit(at.SOURCE_OPEN)}},{key:"_onSourceEnded",value:function(){C.v(this.TAG,"MediaSource onSourceEnded")}},{key:"_onSourceClose",value:function(){C.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 K=this._pendingSegments;return K.video.length>0||K.audio.length>0}},{key:"_hasPendingRemoveRanges",value:function(){var K=this._pendingRemoveRanges;return K.video.length>0||K.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(at.UPDATE_END)}},{key:"_onSourceBufferError",value:function(K){C.e(this.TAG,"SourceBuffer Error: ".concat(K))}}]),Re}(),st=pt,Pe={NETWORK_ERROR:"NetworkError",MEDIA_ERROR:"MediaError",OTHER_ERROR:"OtherError"},Ge={NETWORK_EXCEPTION:n.EXCEPTION,NETWORK_STATUS_CODE_INVALID:n.HTTP_STATUS_CODE_INVALID,NETWORK_TIMEOUT:n.CONNECTING_TIMEOUT,NETWORK_UNRECOVERABLE_EARLY_EOF:n.UNRECOVERABLE_EARLY_EOF,MEDIA_MSE_ERROR:"MediaMSEError",MEDIA_FORMAT_ERROR:Y.FORMAT_ERROR,MEDIA_FORMAT_UNSUPPORTED:Y.FORMAT_UNSUPPORTED,MEDIA_CODEC_UNSUPPORTED:Y.CODEC_UNSUPPORTED},yt=function(){function Re(ve,K){if(Object(le.a)(this,Re),this.TAG="FlvPlayer",this._type="FlvPlayer",this._emitter=new _.a,this._config=ce(),typeof K=="object"&&Object.assign(this._config,K),ve.type.toLowerCase()!=="flv")throw new s("FlvPlayer requires an flv MediaDataSource input!");ve.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=ve,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 Z=m.chrome&&(m.version.major<50||m.version.major===50&&m.version.build<2661);this._alwaysSeekKeyframe=!!(Z||m.msedge||m.msie),this._alwaysSeekKeyframe&&(this._config.accurateSeek=!1)}return Object(Q.a)(Re,[{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(K,Z){var oe=this;K===De.MEDIA_INFO?this._mediaInfo!=null&&Promise.resolve().then(function(){oe._emitter.emit(De.MEDIA_INFO,oe.mediaInfo)}):K===De.STATISTICS_INFO&&(this._statisticsInfo!=null&&Promise.resolve().then(function(){oe._emitter.emit(De.STATISTICS_INFO,oe.statisticsInfo)})),this._emitter.addListener(K,Z)}},{key:"off",value:function(K,Z){this._emitter.removeListener(K,Z)}},{key:"attachMediaElement",value:function(K){var Z=this;if(this._mediaElement=K,K.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),K.addEventListener("seeking",this.e.onvSeeking),K.addEventListener("canplay",this.e.onvCanPlay),K.addEventListener("stalled",this.e.onvStalled),K.addEventListener("progress",this.e.onvProgress),this._msectl=new st(this._config),this._msectl.on(at.UPDATE_END,this._onmseUpdateEnd.bind(this)),this._msectl.on(at.BUFFER_FULL,this._onmseBufferFull.bind(this)),this._msectl.on(at.SOURCE_OPEN,function(){Z._mseSourceOpened=!0,Z._hasPendingLoad&&(Z._hasPendingLoad=!1,Z.load())}),this._msectl.on(at.ERROR,function(oe){Z._emitter.emit(De.ERROR,Pe.MEDIA_ERROR,Ge.MEDIA_MSE_ERROR,oe)}),this._msectl.attachMediaElement(K),this._pendingSeekTime!=null)try{K.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(oe){}}},{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 K=this;if(!this._mediaElement)throw new d("HTMLMediaElement must be attached before load()!");if(this._transmuxer)throw new d("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 bt(this._mediaDataSource,this._config),this._transmuxer.on(Te.INIT_SEGMENT,function(Z,oe){K._msectl.appendInitSegment(oe)}),this._transmuxer.on(Te.MEDIA_SEGMENT,function(Z,oe){if(K._msectl.appendMediaSegment(oe),K._config.lazyLoad&&!K._config.isLive){var he=K._mediaElement.currentTime;oe.info.endDts>=(he+K._config.lazyLoadMaxDuration)*1e3&&(K._progressChecker==null&&(C.v(K.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),K._suspendTransmuxer()))}}),this._transmuxer.on(Te.LOADING_COMPLETE,function(){K._msectl.endOfStream(),K._emitter.emit(De.LOADING_COMPLETE)}),this._transmuxer.on(Te.RECOVERED_EARLY_EOF,function(){K._emitter.emit(De.RECOVERED_EARLY_EOF)}),this._transmuxer.on(Te.IO_ERROR,function(Z,oe){K._emitter.emit(De.ERROR,Pe.NETWORK_ERROR,Z,oe)}),this._transmuxer.on(Te.DEMUX_ERROR,function(Z,oe){K._emitter.emit(De.ERROR,Pe.MEDIA_ERROR,Z,{code:-1,msg:oe})}),this._transmuxer.on(Te.MEDIA_INFO,function(Z){K._mediaInfo=Z,K._emitter.emit(De.MEDIA_INFO,Object.assign({},Z))}),this._transmuxer.on(Te.METADATA_ARRIVED,function(Z){K._emitter.emit(De.METADATA_ARRIVED,Z)}),this._transmuxer.on(Te.SCRIPTDATA_ARRIVED,function(Z){K._emitter.emit(De.SCRIPTDATA_ARRIVED,Z)}),this._transmuxer.on(Te.STATISTICS_INFO,function(Z){K._statisticsInfo=K._fillStatisticsInfo(Z),K._emitter.emit(De.STATISTICS_INFO,Object.assign({},K._statisticsInfo))}),this._transmuxer.on(Te.RECOMMEND_SEEKPOINT,function(Z){K._mediaElement&&!K._config.accurateSeek&&(K._requestSetTime=!0,K._mediaElement.currentTime=Z/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(K){this._mediaElement.volume=K}},{key:"muted",get:function(){return this._mediaElement.muted},set:function(K){this._mediaElement.muted=K}},{key:"currentTime",get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(K){this._mediaElement?this._internalSeek(K):this._pendingSeekTime=K}},{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(K){if(K.playerType=this._type,!(this._mediaElement instanceof HTMLVideoElement))return K;var Z=!0,oe=0,he=0;if(this._mediaElement.getVideoPlaybackQuality){var Oe=this._mediaElement.getVideoPlaybackQuality();oe=Oe.totalVideoFrames,he=Oe.droppedVideoFrames}else this._mediaElement.webkitDecodedFrameCount!=null?(oe=this._mediaElement.webkitDecodedFrameCount,he=this._mediaElement.webkitDroppedFrameCount):Z=!1;return Z&&(K.decodedFrames=oe,K.droppedFrames=he),K}},{key:"_onmseUpdateEnd",value:function(){if(!this._config.lazyLoad||this._config.isLive)return;for(var K=this._mediaElement.buffered,Z=this._mediaElement.currentTime,oe=0,he=0,Oe=0;Oe=Z+this._config.lazyLoadMaxDuration&&this._progressChecker==null&&(C.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}},{key:"_onmseBufferFull",value:function(){C.v(this.TAG,"MSE SourceBuffer is full, suspend transmuxing task"),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 K=this._mediaElement.currentTime,Z=this._mediaElement.buffered,oe=!1,he=0;he=Oe&&K=Je-this._config.lazyLoadRecoverDuration&&(oe=!0);break}}oe&&(window.clearInterval(this._progressChecker),this._progressChecker=null,oe&&(C.v(this.TAG,"Continue loading from paused position"),this._transmuxer.resume()))}},{key:"_isTimepointBuffered",value:function(K){for(var Z=this._mediaElement.buffered,oe=0;oe=he&&K0){var Oe=this._mediaElement.buffered.start(0);(Oe<1&&K0&&Z.currentTime0){var he=oe.start(0);if(he<1&&Z0&&(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(K){this._mediaElement.volume=K}},{key:"muted",get:function(){return this._mediaElement.muted},set:function(K){this._mediaElement.muted=K}},{key:"currentTime",get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(K){this._mediaElement?this._mediaElement.currentTime=K:this._pendingSeekTime=K}},{key:"mediaInfo",get:function(){var K=this._mediaElement instanceof HTMLAudioElement?"audio/":"video/",Z={mimeType:K+this._mediaDataSource.type};return this._mediaElement&&(Z.duration=Math.floor(this._mediaElement.duration*1e3),this._mediaElement instanceof HTMLVideoElement&&(Z.width=this._mediaElement.videoWidth,Z.height=this._mediaElement.videoHeight)),Z}},{key:"statisticsInfo",get:function(){var K={playerType:this._type,url:this._mediaDataSource.url};if(!(this._mediaElement instanceof HTMLVideoElement))return K;var Z=!0,oe=0,he=0;if(this._mediaElement.getVideoPlaybackQuality){var Oe=this._mediaElement.getVideoPlaybackQuality();oe=Oe.totalVideoFrames,he=Oe.droppedVideoFrames}else this._mediaElement.webkitDecodedFrameCount!=null?(oe=this._mediaElement.webkitDecodedFrameCount,he=this._mediaElement.webkitDroppedFrameCount):Z=!1;return Z&&(K.decodedFrames=oe,K.droppedFrames=he),K}},{key:"_onvLoadedMetadata",value:function(K){this._pendingSeekTime!=null&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null),this._emitter.emit(De.MEDIA_INFO,this.mediaInfo)}},{key:"_reportStatisticsInfo",value:function(){this._emitter.emit(De.STATISTICS_INFO,this.statisticsInfo)}}]),Re}(),Dt=kt;w.install();function rt(Re,ve){var K=Re;if(K==null||typeof K!="object")throw new s("MediaDataSource must be an javascript object!");if(!K.hasOwnProperty("type"))throw new s("MediaDataSource must has type field to indicate video file type!");switch(K.type){case"flv":return new ot(K,ve);default:return new Dt(K,ve)}}function wt(){return Ce.supportMSEH264Playback()}function Bt(){return Ce.getFeatureList()}var zt={};zt.createPlayer=rt,zt.isSupported=wt,zt.getFeatureList=Bt,zt.BaseLoader=t,zt.LoaderStatus=i,zt.LoaderErrors=n,zt.Events=De,zt.ErrorTypes=Pe,zt.ErrorDetails=Ge,zt.FlvPlayer=ot,zt.NativePlayer=Dt,zt.LoggingControl=_e,Object.defineProperty(zt,"version",{enumerable:!0,get:function(){return"__VERSION__"}});var Zt=Ve.a=zt},GgEA:function(et,Ve,z){},Gytx:function(et,Ve){et.exports=function(le,Q,j,w){var P=j?j.call(w,le,Q):void 0;if(P!==void 0)return!!P;if(le===Q)return!0;if(typeof le!="object"||!le||typeof Q!="object"||!Q)return!1;var _=Object.keys(le),T=Object.keys(Q);if(_.length!==T.length)return!1;for(var C=Object.prototype.hasOwnProperty.bind(Q),c=0;c<_.length;c++){var p=_[c];if(!C(p))return!1;var u=le[p],o=Q[p];if(P=j?j.call(w,u,o,p):void 0,P===!1||P===void 0&&u!==o)return!1}return!0}},H38U:function(et,Ve,z){var le=z("f4xo"),Q=z("rcnY"),j=z("wU8J"),w=z("Iq15"),P=z("dWSS");function _(C,c){this.typeNumber=C,this.errorCorrectLevel=c,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}var T=_.prototype;T.addData=function(C){var c=new le(C);this.dataList.push(c),this.dataCache=null},T.isDark=function(C,c){if(C<0||this.moduleCount<=C||c<0||this.moduleCount<=c)throw new Error(C+","+c);return this.modules[C][c]},T.getModuleCount=function(){return this.moduleCount},T.make=function(){if(this.typeNumber<1){var C=1;for(C=1;C<40;C++){for(var c=Q.getRSBlocks(C,this.errorCorrectLevel),p=new j,u=0,o=0;o=7&&this.setupTypeNumber(C),this.dataCache==null&&(this.dataCache=_.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,c)},T.setupPositionProbePattern=function(C,c){for(var p=-1;p<=7;p++){if(C+p<=-1||this.moduleCount<=C+p)continue;for(var u=-1;u<=7;u++){if(c+u<=-1||this.moduleCount<=c+u)continue;0<=p&&p<=6&&(u==0||u==6)||0<=u&&u<=6&&(p==0||p==6)||2<=p&&p<=4&&2<=u&&u<=4?this.modules[C+p][c+u]=!0:this.modules[C+p][c+u]=!1}}},T.getBestMaskPattern=function(){for(var C=0,c=0,p=0;p<8;p++){this.makeImpl(!0,p);var u=w.getLostPoint(this);(p==0||C>u)&&(C=u,c=p)}return c},T.createMovieClip=function(C,c,p){var u=C.createEmptyMovieClip(c,p),o=1;this.make();for(var a=0;a>p&1)==1;this.modules[Math.floor(p/3)][p%3+this.moduleCount-8-3]=u}for(var p=0;p<18;p++){var u=!C&&(c>>p&1)==1;this.modules[p%3+this.moduleCount-8-3][Math.floor(p/3)]=u}},T.setupTypeInfo=function(C,c){for(var p=this.errorCorrectLevel<<3|c,u=w.getBCHTypeInfo(p),o=0;o<15;o++){var a=!C&&(u>>o&1)==1;o<6?this.modules[o][8]=a:o<8?this.modules[o+1][8]=a:this.modules[this.moduleCount-15+o][8]=a}for(var o=0;o<15;o++){var a=!C&&(u>>o&1)==1;o<8?this.modules[8][this.moduleCount-o-1]=a:o<9?this.modules[8][15-o-1+1]=a:this.modules[8][15-o-1]=a}this.modules[this.moduleCount-8][8]=!C},T.mapData=function(C,c){for(var p=-1,u=this.moduleCount-1,o=7,a=0,d=this.moduleCount-1;d>0;d-=2)for(d==6&&d--;;){for(var s=0;s<2;s++)if(this.modules[u][d-s]==null){var f=!1;a>>o&1)==1);var i=w.getMask(c,u,d-s);i&&(f=!f),this.modules[u][d-s]=f,o--,o==-1&&(a++,o=7)}if(u+=p,u<0||this.moduleCount<=u){u-=p,p=-p;break}}},_.PAD0=236,_.PAD1=17,_.createData=function(C,c,p){for(var u=Q.getRSBlocks(C,c),o=new j,a=0;as*8)throw new Error("code length overflow. ("+o.getLengthInBits()+">"+s*8+")");for(o.getLengthInBits()+4<=s*8&&o.put(0,4);o.getLengthInBits()%8!=0;)o.putBit(!1);for(;!(o.getLengthInBits()>=s*8);){if(o.put(_.PAD0,8),o.getLengthInBits()>=s*8)break;o.put(_.PAD1,8)}return _.createBytes(o,u)},_.createBytes=function(C,c){for(var p=0,u=0,o=0,a=new Array(c.length),d=new Array(c.length),s=0;s=0?v.get(g):0}}for(var b=0,n=0;n=0;)T^=P.G15<=0;)T^=P.G18<>>=1;return T},getPatternPosition:function(_){return P.PATTERN_POSITION_TABLE[_-1]},getMask:function(_,T,C){switch(_){case w.PATTERN000:return(T+C)%2==0;case w.PATTERN001:return T%2==0;case w.PATTERN010:return C%3==0;case w.PATTERN011:return(T+C)%3==0;case w.PATTERN100:return(Math.floor(T/2)+Math.floor(C/3))%2==0;case w.PATTERN101:return T*C%2+T*C%3==0;case w.PATTERN110:return(T*C%2+T*C%3)%2==0;case w.PATTERN111:return(T*C%3+(T+C)%2)%2==0;default:throw new Error("bad maskPattern:"+_)}},getErrorCorrectPolynomial:function(_){for(var T=new Q([1],0),C=0;C<_;C++)T=T.multiply(new Q([1,j.gexp(C)],0));return T},getLengthInBits:function(_,T){if(1<=T&&T<10)switch(_){case le.MODE_NUMBER:return 10;case le.MODE_ALPHA_NUM:return 9;case le.MODE_8BIT_BYTE:return 8;case le.MODE_KANJI:return 8;default:throw new Error("mode:"+_)}else if(T<27)switch(_){case le.MODE_NUMBER:return 12;case le.MODE_ALPHA_NUM:return 11;case le.MODE_8BIT_BYTE:return 16;case le.MODE_KANJI:return 10;default:throw new Error("mode:"+_)}else if(T<41)switch(_){case le.MODE_NUMBER:return 14;case le.MODE_ALPHA_NUM:return 13;case le.MODE_8BIT_BYTE:return 16;case le.MODE_KANJI:return 12;default:throw new Error("mode:"+_)}else throw new Error("type:"+T)},getLostPoint:function(_){for(var T=_.getModuleCount(),C=0,c=0;c5&&(C+=3+u-5)}for(var c=0;c>>6)+c(128|I&63):c(224|I>>>12&15)+c(128|I>>>6&63)+c(128|I&63)}else{var I=65536+(D.charCodeAt(0)-55296)*1024+(D.charCodeAt(1)-56320);return c(240|I>>>18&7)+c(128|I>>>12&63)+c(128|I>>>6&63)+c(128|I&63)}},u=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,o=function(D){return D.replace(u,p)},a=function(D){var I=[0,2,1][D.length%3],B=D.charCodeAt(0)<<16|(D.length>1?D.charCodeAt(1):0)<<8|(D.length>2?D.charCodeAt(2):0),H=[T.charAt(B>>>18),T.charAt(B>>>12&63),I>=2?"=":T.charAt(B>>>6&63),I>=1?"=":T.charAt(B&63)];return H.join("")},d=w.btoa&&typeof w.btoa=="function"?function(D){return w.btoa(D)}:function(D){if(D.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return D.replace(/[\s\S]{1,3}/g,a)},s=function(D){return d(o(String(D)))},f=function(D){return D.replace(/[+\/]/g,function(I){return I=="+"?"-":"_"}).replace(/=/g,"")},i=function(D,I){return I?f(s(D)):s(D)},n=function(D){return i(D,!0)},t;w.Uint8Array&&(t=function(D,I){for(var B="",H=0,te=D.length;H>>18)+T.charAt(ne>>>12&63)+(typeof V!="undefined"?T.charAt(ne>>>6&63):"=")+(typeof X!="undefined"?T.charAt(ne&63):"=")}return I?f(B):B});var h=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,v=function(D){switch(D.length){case 4:var I=(7&D.charCodeAt(0))<<18|(63&D.charCodeAt(1))<<12|(63&D.charCodeAt(2))<<6|63&D.charCodeAt(3),B=I-65536;return c((B>>>10)+55296)+c((B&1023)+56320);case 3:return c((15&D.charCodeAt(0))<<12|(63&D.charCodeAt(1))<<6|63&D.charCodeAt(2));default:return c((31&D.charCodeAt(0))<<6|63&D.charCodeAt(1))}},g=function(D){return D.replace(h,v)},b=function(D){var I=D.length,B=I%4,H=(I>0?C[D.charAt(0)]<<18:0)|(I>1?C[D.charAt(1)]<<12:0)|(I>2?C[D.charAt(2)]<<6:0)|(I>3?C[D.charAt(3)]:0),te=[c(H>>>16),c(H>>>8&255),c(H&255)];return te.length-=[0,0,2,1][B],te.join("")},E=w.atob&&typeof w.atob=="function"?function(D){return w.atob(D)}:function(D){return D.replace(/\S{1,4}/g,b)},m=function(D){return E(String(D).replace(/[^A-Za-z0-9\+\/]/g,""))},y=function(D){return g(E(D))},x=function(D){return String(D).replace(/[-_]/g,function(I){return I=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},l=function(D){return y(x(D))},S;w.Uint8Array&&(S=function(D){return Uint8Array.from(m(x(D)),function(I){return I.charCodeAt(0)})});var O=function(){var D=w.Base64;return w.Base64=P,D};if(w.Base64={VERSION:_,atob:m,btoa:d,fromBase64:l,toBase64:i,utob:o,encode:i,encodeURI:n,btou:g,decode:l,noConflict:O,fromUint8Array:t,toUint8Array:S},typeof Object.defineProperty=="function"){var A=function(D){return{value:D,enumerable:!1,writable:!0,configurable:!0}};w.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",A(function(){return l(this)})),Object.defineProperty(String.prototype,"toBase64",A(function(D){return i(this,D)})),Object.defineProperty(String.prototype,"toBase64URI",A(function(){return i(this,!0)}))}}return w.Meteor&&(Base64=w.Base64),et.exports?et.exports.Base64=w.Base64:!(Q=[],j=function(){return w.Base64}.apply(Ve,Q),j!==void 0&&(et.exports=j)),{Base64:w.Base64}})}).call(this,z("IyRk"))},JOrW:function(et,Ve,z){et.exports=z.p+"static/gf.09d89ab3.svg"},LdHM:function(et,Ve,z){"use strict";z.d(Ve,"b",function(){return h}),z.d(Ve,"a",function(){return g});var le=z("1OyB"),Q=z("vuIU"),j=z("Ji7U"),w=z("LK+K"),P=z("q1tI"),_=z("rePB"),T=z("Ff2n"),C=z("ODXe"),c=z("4IlW"),p=z("bX4T"),u=z("YrtM"),o=z("TSYQ"),a=z.n(o),d=z("+nKL"),s=z("8OUc"),f=function(X,ne){var $=X.prefixCls,ee=X.id,ce=X.flattenOptions,de=X.childrenAsData,Ce=X.values,Se=X.searchValue,De=X.multiple,be=X.defaultActiveFirstOption,_e=X.height,Ke=X.itemHeight,Ne=X.notFoundContent,Be=X.open,ze=X.menuItemSelectedIcon,ye=X.virtual,pe=X.onSelect,We=X.onToggleOpen,He=X.onActiveValue,nt=X.onScroll,re=X.onMouseEnter,k="".concat($,"-item"),U=Object(u.a)(function(){return ce},[Be,ce],function(Xe,Fe){return Fe[0]&&Xe[1]!==Fe[1]}),q=P.useRef(null),Y=function(Fe){Fe.preventDefault()},J=function(Fe){q.current&&q.current.scrollTo({index:Fe})},xe=function(Fe){for(var Ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Me=U.length,Ee=0;Ee1&&arguments[1]!==void 0?arguments[1]:!1;return Object(E.a)(V).map(function(ne,$){if(!P.isValidElement(ne)||!ne.type)return null;var ee=ne.type.isSelectOptGroup,ce=ne.key,de=ne.props,Ce=de.children,Se=Object(T.a)(de,["children"]);return X||!ee?m(ne):Object(b.a)(Object(b.a)({key:"__RC_SELECT_GRP__".concat(ce===null?$:ce,"__"),label:ce},Se),{},{options:y(Ce)})}).filter(function(ne){return ne})}var x=z("2Qr1"),l=z("qNPg"),S=z("U8pU"),O=z("Kwbf"),A=z("WKfj");function D(V){var X=V.mode,ne=V.options,$=V.children,ee=V.backfill,ce=V.allowClear,de=V.placeholder,Ce=V.getInputElement,Se=V.showSearch,De=V.onSearch,be=V.defaultOpen,_e=V.autoFocus,Ke=V.labelInValue,Ne=V.value,Be=V.inputValue,ze=V.optionLabelProp,ye=X==="multiple"||X==="tags",pe=Se!==void 0?Se:ye||X==="combobox",We=ne||y($);if(Object(O.a)(X!=="tags"||We.every(function(k){return!k.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),X==="tags"||X==="combobox"){var He=We.some(function(k){return k.options?k.options.some(function(U){return typeof("value"in U?U.value:U.key)=="number"}):typeof("value"in k?k.value:k.key)=="number"});Object(O.a)(!He,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(O.a)(X!=="combobox"||!ze,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(O.a)(X==="combobox"||!ee,"`backfill` only works with `combobox` mode."),Object(O.a)(X==="combobox"||!Ce,"`getInputElement` only work with `combobox` mode."),Object(O.b)(X!=="combobox"||!Ce||!ce||!de,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),De&&!pe&&X!=="combobox"&&X!=="tags"&&Object(O.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(O.b)(!be||_e,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),Ne!=null){var nt=Object(A.d)(Ne);Object(O.a)(!Ke||nt.every(function(k){return Object(S.a)(k)==="object"&&("key"in k||"value"in k)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(O.a)(!ye||Array.isArray(Ne),"`value` should be array when `mode` is `multiple` or `tags`")}if($){var re=null;Object(E.a)($).some(function(k){if(!P.isValidElement(k)||!k.type)return!1;var U=k.type;if(U.isSelectOption)return!1;if(U.isSelectOptGroup){var q=Object(E.a)(k.props.children).every(function(Y){return!P.isValidElement(Y)||!k.type||Y.type.isSelectOption?!0:(re=Y.type,!1)});return!q}return re=U,!0}),re&&Object(O.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(re.displayName||re.name||re,"`.")),Object(O.a)(Be===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var I=D,B=Object(l.a)({prefixCls:"rc-select",components:{optionList:n},convertChildrenToData:y,flattenOptions:x.d,getLabeledValue:x.e,filterOptions:x.b,isValueDisabled:x.g,findValueOption:x.c,warningProps:I,fillOptionsWithMissingValue:x.a}),H=function(V){Object(j.a)(ne,V);var X=Object(w.a)(ne);function ne(){var $;return Object(le.a)(this,ne),$=X.apply(this,arguments),$.selectRef=P.createRef(),$.focus=function(){$.selectRef.current.focus()},$.blur=function(){$.selectRef.current.blur()},$}return Object(Q.a)(ne,[{key:"render",value:function(){return P.createElement(B,Object.assign({ref:this.selectRef},this.props))}}]),ne}(P.Component);H.Option=h,H.OptGroup=g;var te=H,W=Ve.c=te},M8RZ:function(et,Ve,z){"use strict";z.d(Ve,"a",function(){return c});var le=z("fWQN"),Q=z("mtLc"),j=z("yKVA"),w=z("879j"),P=z("q1tI"),_=z.n(P),T=z("i8i4"),C=z.n(T),c=function(p){Object(j.a)(o,p);var u=Object(w.a)(o);function o(a){var d;Object(le.a)(this,o),d=u.call(this,a);var s=window.document;return d.node=s.createElement("div"),s.body.appendChild(d.node),d}return Object(Q.a)(o,[{key:"render",value:function(){var d=this.props.children;return Object(T.createPortal)(d,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),o}(_.a.Component)},MFOe:function(et,Ve,z){(function(le){var Q=_(),j=T(),w=C(),P=typeof window!="undefined"?window:le;et.exports={assign:Q,create:j,trim:w,bind:c,slice:p,each:u,map:o,pluck:a,isList:d,isFunction:s,isObject:f,Global:P};function _(){return Object.assign?Object.assign:function(n,t,h,v){for(var g=1;g=0;f-=1){var i=C.get(f)||new Set;i.forEach(function(n){var t=n.parent,h=n.node;if(p(h)||!n.parent||s.has(n.parent.key))return;if(p(n.parent.node)){s.add(t.key);return}var v=!0,g=!1;(t.children||[]).filter(function(b){return!p(b.node)}).forEach(function(b){var E=b.key,m=u.has(E);v&&!m&&(v=!1),!g&&(m||o.has(E))&&(g=!0)}),v&&u.add(t.key),g&&o.add(t.key),s.add(t.key)})}return{checkedKeys:Array.from(u),halfCheckedKeys:Array.from(Q(o,u))}}function P(T,C,c,p,u){for(var o=new Set(T),a=new Set(C),d=0;d<=p;d+=1){var s=c.get(d)||new Set;s.forEach(function(t){var h=t.key,v=t.node,g=t.children,b=g===void 0?[]:g;!o.has(h)&&!a.has(h)&&!u(v)&&b.filter(function(E){return!u(E.node)}).forEach(function(E){o.delete(E.key)})})}a=new Set;for(var f=new Set,i=p;i>=0;i-=1){var n=c.get(i)||new Set;n.forEach(function(t){var h=t.parent,v=t.node;if(u(v)||!t.parent||f.has(t.parent.key))return;if(u(t.parent.node)){f.add(h.key);return}var g=!0,b=!1;(h.children||[]).filter(function(E){return!u(E.node)}).forEach(function(E){var m=E.key,y=o.has(m);g&&!y&&(g=!1),!b&&(y||a.has(m))&&(b=!0)}),g||o.delete(h.key),b&&a.add(h.key),f.add(h.key)})}return{checkedKeys:Array.from(o),halfCheckedKeys:Array.from(Q(a,o))}}function _(T,C,c,p){var u=[],o;p?o=p:o=j;var a=new Set(T.filter(function(i){var n=!!c[i];return n||u.push(i),n})),d=new Map,s=0;Object.keys(c).forEach(function(i){var n=c[i],t=n.level,h=d.get(t);h||(h=new Set,d.set(t,h)),h.add(n),s=Math.max(s,t)}),Object(le.a)(!u.length,"Tree missing follow keys: ".concat(u.slice(0,100).map(function(i){return"'".concat(i,"'")}).join(", ")));var f;return C===!0?f=w(a,d,s,o):f=P(a,C.halfCheckedKeys,d,s,o),f}},OLES:function(et,Ve,z){"use strict";var le=z("U8pU"),Q=z("VTBJ"),j=z("Ff2n"),w=z("q1tI"),P=z("uciX"),_=z("7ixt"),T=function(a){var d=a.overlay,s=a.prefixCls,f=a.id,i=a.overlayInnerStyle;return w.createElement("div",{className:"".concat(s,"-inner"),id:f,role:"tooltip",style:i},typeof d=="function"?d():d)},C=T,c=function(a,d){var s=a.overlayClassName,f=a.trigger,i=f===void 0?["hover"]:f,n=a.mouseEnterDelay,t=n===void 0?0:n,h=a.mouseLeaveDelay,v=h===void 0?.1:h,g=a.overlayStyle,b=a.prefixCls,E=b===void 0?"rc-tooltip":b,m=a.children,y=a.onVisibleChange,x=a.afterVisibleChange,l=a.transitionName,S=a.animation,O=a.placement,A=O===void 0?"right":O,D=a.align,I=D===void 0?{}:D,B=a.destroyTooltipOnHide,H=B===void 0?!1:B,te=a.defaultVisible,W=a.getTooltipContainer,V=a.overlayInnerStyle,X=Object(j.a)(a,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),ne=Object(w.useRef)(null);Object(w.useImperativeHandle)(d,function(){return ne.current});var $=Object(Q.a)({},X);"visible"in a&&($.popupVisible=a.visible);var ee=function(){var De=a.arrowContent,be=De===void 0?null:De,_e=a.overlay,Ke=a.id;return[w.createElement("div",{className:"".concat(E,"-arrow"),key:"arrow"},be),w.createElement(C,{key:"content",prefixCls:E,id:Ke,overlay:_e,overlayInnerStyle:V})]},ce=!1,de=!1;if(typeof H=="boolean")ce=H;else if(H&&Object(le.a)(H)==="object"){var Ce=H.keepParent;ce=Ce===!0,de=Ce===!1}return w.createElement(P.a,Object.assign({popupClassName:s,prefixCls:E,popup:ee,action:i,builtinPlacements:_.a,popupPlacement:A,ref:ne,popupAlign:I,getPopupContainer:W,onPopupVisibleChange:y,afterPopupVisibleChange:x,popupTransitionName:l,popupAnimation:S,defaultPopupVisible:te,destroyPopupOnHide:ce,autoDestroy:de,mouseLeaveDelay:v,popupStyle:g,mouseEnterDelay:t},$),m)},p=Object(w.forwardRef)(c),u=Ve.a=p},OZM5:function(et,Ve,z){"use strict";z.d(Ve,"b",function(){return p}),z.d(Ve,"a",function(){return u}),z.d(Ve,"k",function(){return o}),z.d(Ve,"h",function(){return a}),z.d(Ve,"i",function(){return d}),z.d(Ve,"g",function(){return s}),z.d(Ve,"c",function(){return f}),z.d(Ve,"d",function(){return i}),z.d(Ve,"j",function(){return h}),z.d(Ve,"e",function(){return v}),z.d(Ve,"f",function(){return g});var le=z("KQm4"),Q=z("U8pU"),j=z("Ff2n"),w=z("q1tI"),P=z.n(w),_=z("Kwbf"),T=z("WaYH"),C=.25,c=2;function p(b,E){var m=b.slice(),y=m.indexOf(E);return y>=0&&m.splice(y,1),m}function u(b,E){var m=b.slice();return m.indexOf(E)===-1&&m.push(E),m}function o(b){return b.split("-")}function a(b,E){return"".concat(b,"-").concat(E)}function d(b){return b&&b.type&&b.type.isTreeNode}function s(b,E){var m=[b],y=E[b];function x(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];l.forEach(function(S){var O=S.key,A=S.children;m.push(O),x(A)})}return x(y.children),m}function f(b,E){var m=b.clientY,y=E.selectHandle.getBoundingClientRect(),x=y.top,l=y.bottom,S=y.height,O=Math.max(S*C,c);return m<=x+O?-1:m>=l-O?1:0}function i(b,E){if(!b)return;var m=E.multiple;return m?b.slice():b.length?[b[0]]:b}var n=function(E){return E};function t(b,E){if(!b)return[];var m=E||{},y=m.processProps,x=y===void 0?n:y,l=Array.isArray(b)?b:[b];return l.map(function(S){var O=S.children,A=Object(j.a)(S,["children"]),D=t(O,E);return P.a.createElement(T.a,Object.assign({},x(A)),D)})}function h(b){if(!b)return null;var E;if(Array.isArray(b))E={checkedKeys:b,halfCheckedKeys:void 0};else if(Object(Q.a)(b)==="object")E={checkedKeys:b.checked||void 0,halfCheckedKeys:b.halfChecked||void 0};else return Object(_.a)(!1,"`checkedKeys` is not an array or an object"),null;return E}function v(b,E){var m=new Set;function y(x){if(m.has(x))return;var l=E[x];if(!l)return;m.add(x);var S=l.parent,O=l.node;if(O.disabled)return;S&&y(S.key)}return(b||[]).forEach(function(x){y(x)}),Object(le.a)(m)}function g(b){var E={};return Object.keys(b).forEach(function(m){(m.startsWith("data-")||m.startsWith("aria-"))&&(E[m]=b[m])}),E}},"OkW/":function(et,Ve,z){},Ot1p:function(et,Ve,z){"use strict";var le=z("2qtc"),Q=z("kLXV"),j=z("rAM+"),w=z("miYZ"),P=z("tsqr"),_=z("9og8"),T=z("tJVT"),C=z("jrin"),c=z("WmNS"),p=z.n(c),u=z("q1tI"),o=z.n(u),a=z("VrN/"),d=z.n(a),s=z("bdgK"),f=z("p77/"),i=z("Bd2K"),n=z("ELLl"),t=z("19Vz"),h=z("lZu9"),v=z("+NIl"),g=z("kSUc"),b=z("9Bee"),E=function(bt){var Lt=bt.value,at=Lt===void 0?"":Lt,pt=bt.className,st=bt.showTextOnly,Pe=bt.showLines,Ge=bt.style,yt=Ge===void 0?{}:Ge,ot=Object(u.useMemo)(function(){return""},[at]);return o.a.createElement(o.a.Fragment,null,o.a.createElement("div",{dangerouslySetInnerHTML:{__html:ot}}))},m=z("Q9mQ"),y=z("diRs"),x=z("0Owb"),l=z("dejd"),S=z("C+DQ"),O=z("D1Df"),A=z.n(O),D=z("1vsH"),I=z("m3rI"),B=[{title:"\u7C97\u4F53",icon:"icon-bold",actionName:"bold"},{title:"\u659C\u4F53",icon:"icon-italic",actionName:"italic"},"|",{title:"\u65E0\u5E8F\u5217\u8868",icon:"icon-unorder-list",actionName:"list-ul"},{title:"\u6709\u5E8F\u5217\u8868",icon:"icon-order-list",actionName:"list-ol"},"|",{title:"\u884C\u5185\u4EE3\u7801",icon:"icon-code",actionName:"code"},{title:"\u4EE3\u7801\u5757\uFF08\u591A\u8BED\u8A00\u98CE\u683C\uFF09",icon:"icon-file-code",actionName:"code-block"},{title:"\u94FE\u63A5",icon:"icon-link",actionName:"link"},"|",{title:"\u884C\u5185\u516C\u5F0F",icon:"icon-sum",actionName:"inline-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"icon-formula",actionName:"latex"},"|",{title:"\u6DFB\u52A0\u56FE\u7247",icon:"icon-picture",actionName:"upload-image"},{title:"\u8868\u683C",icon:"icon-table",actionName:"add-table"},"|",{title:"\u6362\u884C",icon:"icon-minus",actionName:"line-break"},{title:"\u6E05\u7A7A",icon:"icon-eraser",actionName:"eraser"}];function H(bt){var Lt=bt.onActionCallback,at=bt.title,pt=bt.icon,st=bt.actionName,Pe=bt.className,Ge=Pe===void 0?"":Pe,yt=bt.children;function ot(){Lt(st)}return o.a.createElement("a",{title:at,className:Ge,onClick:ot},o.a.createElement("i",{className:"md-iconfont ".concat(pt)}),yt)}var te=function(bt){var Lt=bt.watch,at=bt.showNullButton,pt=bt.onActionCallback,st=bt.fullScreen,Pe=bt.insertTemp,Ge=bt.hidetoolBar,yt=bt.uuid,ot=bt.setOpenPhones,kt=Object(D.E)("_educoder_session_login"),Dt=Object(D.E)("_educoder_session"),rt=[].concat(B,[{title:"".concat(Lt?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Lt?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return o.a.createElement("ul",{className:"markdown-toolbar-container"},!Ge&&rt.map(function(wt,Bt){return o.a.createElement("li",{key:Bt},wt.actionName?o.a.createElement(H,Object(x.a)({},wt,{onActionCallback:pt})):o.a.createElement("span",{className:"v-line"}))}),at?o.a.createElement("li",null,o.a.createElement(H,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:pt},o.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,Pe&&o.a.createElement("li",null,o.a.createElement(H,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(Pe),onActionCallback:pt},o.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),o.a.createElement("li",null,o.a.createElement(y.a,{title:"\u6253\u5F00\u624B\u673A\u626B\u4E00\u626B",content:o.a.createElement("div",null,o.a.createElement("span",{style:{display:"none"}},"test----",location.origin+"/upload.html?_educoder_session_login="+kt+"&_educoder_session="+Dt+"&key="+yt+"&api="+encodeURIComponent(I.a.API_SERVER)),o.a.createElement(A.a,{size:150,fgColor:"#000",value:location.origin+"/upload.html?_educoder_session_login="+kt+"&_educoder_session="+Dt+"&key="+yt+"&api="+encodeURIComponent(I.a.API_SERVER)}))},o.a.createElement("span",{className:"fill-tip",onMouseOver:function(){return ot(!0)}},"\u624B\u673A\u4E0A\u4F20\u6587\u4EF6"))),o.a.createElement("li",{className:"btn-full-screen"},o.a.createElement(H,{icon:"".concat(st?"icon-shrink":"icon-enlarge"),title:st?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:pt})))},W=z("M8RZ"),V=z("+L6B"),X=z("2/Rp"),ne=z("y8nQ"),$=z("Vl3Y"),ee=z("5NDa"),ce=z("5rEg"),de={labelCol:{span:4},wrapperCol:{span:20}},Ce=function(bt){var Lt=bt.callback,at=bt.onCancel;function pt(st){Lt(st)}return o.a.createElement($.a,Object(x.a)({},de,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:pt}),o.a.createElement($.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},o.a.createElement(ce.a,null)),o.a.createElement($.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},o.a.createElement(ce.a,null)),o.a.createElement("div",{className:"flex-container flex-end"},o.a.createElement(X.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),o.a.createElement(X.a,{type:"ghost",onClick:at},"\u53D6\u6D88")))},Se=z("7ahc"),De=z("k1fw"),be=z("HmJG"),_e=z("BjJ7"),Ke=$.a.useForm,Ne={width:280,marginRight:10},Be={labelCol:{span:5},wrapperCol:{span:19}},ze=function(bt){var Lt=bt.callback,at=bt.onCancel,pt=Ke(),st=Object(T.a)(pt,1),Pe=st[0],Ge=Object(u.useRef)();function yt(Dt){Lt(Object(De.a)(Object(De.a)({},Dt),{},{name:Ge.current}))}function ot(Dt,rt){Pe.setFieldsValue({src:"/api/attachments/".concat(Dt.id,"?type=").concat(Dt.content_type),type:rt.type})}function kt(Dt){var rt=Dt.target.files[0];Ge.current=rt.name,pe(rt,ot)}return o.a.createElement($.a,Object(x.a)({form:Pe},Be,{className:"upload-image-panel",onFinish:yt}),o.a.createElement($.a.Item,{label:"\u6587\u4EF6\u5730\u5740",required:!0},o.a.createElement("div",{className:"flex-container"},o.a.createElement($.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5730\u5740"}]},o.a.createElement(ce.a,{style:Ne})),o.a.createElement(ye,{onFileChange:kt}))),o.a.createElement($.a.Item,{label:"\u6587\u4EF6\u63CF\u8FF0",name:"alt"},o.a.createElement(ce.a,{style:{width:264}})),o.a.createElement($.a.Item,{style:{textAlign:"right"}},o.a.createElement(X.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),o.a.createElement(X.a,{type:"ghost",onClick:at},"\u53D6\u6D88")))};function ye(bt){var Lt=bt.onFileChange;return o.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",o.a.createElement("input",{type:"file",onChange:Lt}))}function pe(bt,Lt){if(!bt)throw new String("\u6CA1\u6709\u6587\u4EF6");var at=new FormData;at.append("editormd-image-file",bt),at.append("file_param_name","editormd-image-file"),at.append("byxhr","true");var pt=new window.XMLHttpRequest;pt.withCredentials=!0,pt.addEventListener("load",function(st){Lt(JSON.parse(st.target.responseText),bt)},!1),pt.addEventListener("error",function(st){console.error(st)},!1),pt.open("POST","".concat(_e.a,"/api/attachments.json")),pt.send(at)}var We=z("giR+"),He=z("fyUT"),nt=z("7Kak"),re=z("9yH6"),k=re.a.Group,U={margin:"0 8px"},q=function(bt){var Lt=bt.callback,at=bt.onCancel;function pt(st){Lt(st)}return o.a.createElement($.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:pt},o.a.createElement("div",{className:"flex-container"},o.a.createElement("span",{style:U},"\u5355\u5143\u683C\u6570\uFF1A"),o.a.createElement("span",{style:U},"\u884C\u6570"),o.a.createElement($.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},o.a.createElement(He.a,null)),o.a.createElement("span",{style:U},"\u5217\u6570"),o.a.createElement($.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},o.a.createElement(He.a,null))),o.a.createElement("div",{className:"flex-container",style:{marginTop:12}},o.a.createElement("span",{style:U},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),o.a.createElement($.a.Item,{name:"align"},o.a.createElement(k,null,o.a.createElement(re.a,{value:"default"},o.a.createElement("i",{className:"fa fa-align-justify"})),o.a.createElement(re.a,{value:"left"},o.a.createElement("i",{className:"fa fa-align-left"})),o.a.createElement(re.a,{value:"center"},o.a.createElement("i",{className:"fa fa-align-center"})),o.a.createElement(re.a,{value:"right"},o.a.createElement("i",{className:"fa fa-align-right"}))))),o.a.createElement("div",{className:"flex-container flex-end"},o.a.createElement(X.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),o.a.createElement(X.a,{type:"ghost",onClick:at},"\u53D6\u6D88")))},Y=z("ErOA"),J=z("7Cbv"),xe="link",ke="upload-image",dt="code-block",Ue="add-table",je="------------",tt={default:je,left:":".concat(je),center:":".concat(je,":"),right:"".concat(je,":")},mt=z("9VGf"),Qe,Xe;function Fe(){}var Ie=0,Me=1e4,Ee="\u2581",Ae=` **\u6A21\u677F\u6807\u9898** \u6A21\u677F\u6B63\u6587\u5185\u5BB9\uFF0C\u53EF\u8F93\u5165\u6587\u672C\u5185\u5BB9\u548C\u7C98\u8D34\u56FE\u7247\u7B49\u64CD\u4F5C`;function Le(bt){return/^\d+$/.test(bt)?"".concat(bt,"px"):bt}var Te=navigator.platform.toUpperCase().indexOf("MAC")>=0,Ze=Te?"Cmd":"Ctrl",ut=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"],Tt=(Qe={},Object(C.a)(Qe,Ze+"-B","bold"),Object(C.a)(Qe,Ze+"-I","italic"),Qe),Ht=(Xe={},Object(C.a)(Xe,xe,"\u6DFB\u52A0\u94FE\u63A5"),Object(C.a)(Xe,dt,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(C.a)(Xe,ke,"\u6DFB\u52A0\u6587\u4EF6"),Object(C.a)(Xe,Ue,"\u6DFB\u52A0\u8868\u683C"),Xe),Qt=Ve.a=function(bt){var Lt=bt.defaultValue,at=Lt===void 0?"":Lt,pt=bt.onChange,st=bt.width,Pe=st===void 0?"100%":st,Ge=bt.height,yt=Ge===void 0?400:Ge,ot=bt.miniToolbar,kt=ot===void 0?!1:ot,Dt=bt.isFocus,rt=Dt===void 0?!1:Dt,wt=bt.watch,Bt=bt.insertTemp,zt=bt.mode,Zt=zt===void 0?"markdown":zt,Re=bt.id,ve=Re===void 0?"markdown-editor-id":Re,K=bt.showResizeBar,Z=K===void 0?!1:K,oe=bt.noStorage,he=oe===void 0?!1:oe,Oe=bt.showNullButton,Je=Oe===void 0?!1:Oe,lt=bt.hidetoolBar,Pt=lt===void 0?!1:lt,Nt=bt.fullScreen,ht=Nt===void 0?!1:Nt,Mt=bt.onBlur,nn=bt.onCMBeforeChange,Rt=bt.onFullScreen,cn=bt.className,an=cn===void 0?"":cn,ie=bt.disablePaste,N=ie===void 0?!1:ie,F=bt.placeholder,ae=F===void 0?"":F,me=bt.values,se=me===void 0?"":me,$e=Object(u.useState)(null),Et=Object(T.a)($e,2),it=Et[0],Vt=Et[1],At=Object(u.useState)(at),Ft=Object(T.a)(At,2),on=Ft[0],In=Ft[1],Lr=Object(u.useState)(wt),Sr=Object(T.a)(Lr,2),Un=Sr[0],ur=Sr[1],mi=Object(u.useState)(ht),Ar=Object(T.a)(mi,2),fr=Ar[0],br=Ar[1],Xr=Object(u.useState)(""),Dr=Object(T.a)(Xr,2),Yr=Dr[0],gr=Dr[1],gi=Object(u.useState)(0),si=Object(T.a)(gi,2),Pr=si[0],Fr=si[1],Ei=Object(u.useState)(yt),vi=Object(T.a)(Ei,2),di=vi[0],Fn=vi[1],wn=Object(u.useState)(!1),_r=Object(T.a)(wn,2),qn=_r[0],kr=_r[1],hr=Object(u.useRef)(Object(J.a)()),Ui=Object(u.useRef)(!1),Nr=Object(u.useRef)(),Ur=Object(u.useRef)(),yi=Object(u.useRef)(),Zr=Object(u.useRef)(),Li=Object(u.useRef)(),qi=function(){var dn=Object(_.a)(p.a.mark(function On(){var gn,qt;return p.a.wrap(function(cr){for(;;)switch(cr.prev=cr.next){case 0:return cr.next=2,Object(Y.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:hr.current}});case 2:qt=cr.sent,qt!=null&&(gn=qt.attachments)!==null&&gn!==void 0&&gn.length&&(console.log("cm:",it,Ur),qt.attachments.map(function(Zn){Zn.content_type.indexOf("image")>-1?it.replaceSelection("![,](/api/attachments/".concat(Zn.id,"?type=").concat(Zn.content_type,")")):Zn.content_type.indexOf("video")>-1?it.replaceSelection('')):Zn.content_type.indexOf("pdf")>-1?it.replaceSelection('
    ').concat(Zn.name,"")):it.replaceSelection("[".concat(Zn.name,"](").concat(I.a.API_SERVER,"/api/attachments/").concat(Zn.id,"?type=").concat(Zn.content_type,")"))}));case 4:case"end":return cr.stop()}},On)}));return function(){return dn.apply(this,arguments)}}();Object(u.useEffect)(function(){In(se),it==null||it.setValue(se)},[se]),Object(u.useEffect)(function(){Rt==null||Rt(fr)},[fr]),Object(u.useEffect)(function(){if(Ur.current){var dn=d.a.fromTextArea(Ur.current,{mode:Zt,lineNumbers:!kt,lineWrapping:!0,value:at,autoCloseTags:!0,autoCloseBrackets:!0});rt&&dn.focus();function On(gn,qt){if(N){qt.preventDefault();return}var Hn=qt.clipboardData;if(Hn){var cr=Hn.types.toString(),Zn=Hn.items;if(cr==="Files"||Hn.types.indexOf("Files")>-1){if(qt.preventDefault(),Zt=="stex")return;try{var wr,Wr=Zn[1];((wr=Zn[0])===null||wr===void 0?void 0:wr.kind)==="file"&&(Wr=Zn[0]);var zn=Wr.getAsFile(),gt=zn.name.split(".").pop();pe(zn,function(ct){if(ct.id){var xt,It,sn;(zn==null||((xt=zn.type)===null||xt===void 0)?void 0:xt.indexOf("image"))>-1?dn.replaceSelection("![,](/api/attachments/".concat(ct.id,"?type=").concat(ct.content_type,")")):(zn==null||((It=zn.type)===null||It===void 0)?void 0:It.indexOf("video"))>-1?dn.replaceSelection('')):(zn==null||((sn=zn.type)===null||sn===void 0)?void 0:sn.indexOf("pdf"))>-1?dn.replaceSelection('').concat(zn.name,"")):ut.includes(gt)?dn.replaceSelection('').concat(zn.name,"")):dn.replaceSelection("[".concat(zn.name,"](").concat(I.a.API_SERVER,"/api/attachments/").concat(ct.id,"?type=").concat(ct.content_type,")"))}else(ct==null?void 0:ct.status)===401&&(document.location.href="/user/login")})}catch(ct){P.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return dn.on("paste",On),dn.on("dragleave",function(gn,qt){yi.current.classList.remove("mouse-hover-md")}),dn.on("dragover",function(gn,qt){yi.current.classList.add("mouse-hover-md")}),dn.on("drop",function(gn,qt){yi.current.classList.add("mouse-hover-md");var Hn;if(Hn=qt.dataTransfer.files,Hn.length>0){qt.preventDefault(),qt.stopPropagation();for(var cr=function(Wr){var zn=Hn[Wr],gt=zn.name.split(".").pop();pe(zn,function(ct){if(ct.id){var xt,It,sn;(zn==null||((xt=zn.type)===null||xt===void 0)?void 0:xt.indexOf("image"))>-1?dn.replaceSelection("![,](/api/attachments/".concat(ct.id,"?type=").concat(ct.content_type,")")):(zn==null||((It=zn.type)===null||It===void 0)?void 0:It.indexOf("video"))>-1?dn.replaceSelection('')):(zn==null||((sn=zn.type)===null||sn===void 0)?void 0:sn.indexOf("pdf"))>-1?dn.replaceSelection('').concat(zn.name,"")):ut.includes(gt)?dn.replaceSelection('').concat(zn.name,"")):dn.replaceSelection("[".concat(zn.name,"](").concat(I.a.API_SERVER,"/api/attachments/").concat(ct.id,"?type=").concat(ct.content_type,")"))}else(ct==null?void 0:ct.status)===401&&(document.location.href="/user/login")})},Zn=0;Zn0||Zn.target.offsetWidth>0)&&(xi(),it.setSize("100%","100%"),it.refresh())}}catch(wr){Hn.e(wr)}finally{Hn.f()}});return gn.observe(Ur.current.parentElement),gn}if(it){var On=dn();return function(){On.unobserve(Ur.current.parentElement)}}},[it,xi]),Object(u.useEffect)(function(){if(it){for(var dn=[],On=function(){var Zn=qt[gn];Hn=Object(T.a)(Zn,2);var wr=Hn[0],Wr=Hn[1],zn=Object(C.a)({},wr,function(){Pi(Wr)});dn.push(zn),it.addKeyMap(zn)},gn=0,qt=Object.entries(Tt);gn0){var dn=new Date().getTime(),On=window.sessionStorage.getItem(ve);dn>=Pr+Me&&(!On||On!==on)&&(window.sessionStorage.setItem(ve,on),kr(!0))}},Me),Object(u.useEffect)(function(){ur(wt)},[it,wt]),Object(u.useEffect)(function(){it&&(rt&&it.focus())},[it,rt]),Object(u.useEffect)(function(){if(Un&&it){var dn=it.getScrollerElement();function On(gn){var qt=gn.target;if(Li.current){var Hn=qt.scrollTop/qt.scrollHeight;Li.current.scrollTop=Li.current.scrollHeight*Hn}}return dn.addEventListener("scroll",On),function(){dn.removeEventListener("scroll",On)}}},[it,Un]),Object(u.useEffect)(function(){if(it&&nn){function dn(On,gn){nn(On,gn)}return it.on("beforeChange",dn),function(){it.off("beforeChange",dn)}}},[it,nn]),Object(u.useEffect)(function(){if(it&&Mt){function dn(){Mt(it.getValue())}return it.on("blur",dn),function(){it.off("blur",dn)}}},[it,Mt]),Object(u.useEffect)(function(){if(it){function dn(On){var gn=On.getValue();In(gn),Fr(new Date().getTime()),On.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),pt&&pt(gn)}return it.on("change",dn),function(){it.off("change",dn)}}},[it,pt]),Object(u.useEffect)(function(){it&&(at==null?(it.setValue(""),In("")):at!==it.getValue()&&(it.setValue(at),In(at),it.setCursor(it.lineCount(),0)))},[it,at]);var Pi=Object(u.useCallback)(function(dn){var On=it.getCursor(),gn=it.getSelection(),qt=gn.split(` `);switch(dn){case"bold":return it.replaceSelection("**"+gn+"**"),gn===""&&it.setCursor(On.line,On.ch+2),it.focus();case"italic":return it.replaceSelection("*"+gn+"*"),gn===""&&it.setCursor(On.line,On.ch+1),it.focus();case"code":return it.replaceSelection("`"+gn+"`"),gn===""&&it.setCursor(On.line,On.ch+1),it.focus();case"inline-latex":return it.replaceSelection("`$$"+gn+"$$`"),gn===""&&it.setCursor(On.line,On.ch+3),it.focus();case"latex":return it.replaceSelection("```latex\n"+gn+"\n```"),it.setCursor(On.line+1,gn.length+1),it.focus();case"line-break":return it.replaceSelection(`
    `),it.focus();case"list-ul":return gn===""?it.replaceSelection("- "+gn):it.replaceSelection(qt.map(function(Hn){return Hn===""?"":"- ".concat(Hn)}).join(` `)),it.focus();case"list-ol":return gn===""?it.replaceSelection("1. "+gn):it.replaceSelection(qt.map(function(Hn,cr){return Hn===""?"":"".concat(cr+1,". ").concat(Hn)}).join(` `)),it.focus();case"add-null-ch":return gn===""&&it.setCursor(On.line,On.ch+1),it.replaceSelection(Ee),it.focus();case"inster-template-1":return gn===""&&it.setCursor(On.line,On.ch),it.replaceSelection(Ae),it.focus();case"eraser":return it.setValue(""),it.focus();case"trigger-watch":return ur(!Un),it.focus();case"trigger-full-screen":return br(!fr),it.focus();case xe:gr(xe);return;case dt:gr(dt);return;case ke:gr(ke);return;case Ue:gr(Ue);return;default:throw new Error}},[it,Un,fr]),li=Object(u.useCallback)(function(dn){gr("");switch(Yr){case xe:var On=dn.title,gn=dn.link;return it.replaceSelection("[".concat(On,"](").concat(gn,")")),it.focus();case dt:var qt=dn.language,Hn=dn.content;return it.replaceSelection(["```"+qt,Hn,"```"].join(` `)),it.focus();case ke:var cr=dn.src,Zn=dn.alt,wr=dn.name;return cr.indexOf("type=image")>-1?it.replaceSelection("![ ".concat(Zn||""," ]( ").concat(cr,' "').concat(Zn||"",'" )')):cr.indexOf("type=application/pdf")>-1?it.replaceSelection('').concat(wr,"")):it.replaceSelection('').concat(wr,"")),it.focus();case Ue:for(var Wr=dn.row,zn=dn.col,gt=dn.align,ct=` `,xt=0;xt300&&(wr=300);var Wr=yt+wr+"px";Fn(Wr)}}return dn.addEventListener("mousedown",qt),document.addEventListener("mousemove",cr),document.addEventListener("mouseup",Hn),function(){dn.removeEventListener("mousedown",qt),document.removeEventListener("mousemove",cr),document.removeEventListener("mouseup",Hn)}}},[it,Zr]),Object(u.useEffect)(function(){Fn(yt)},[yt]);var hi=Le(Pe),Zi=Le(di),pa={width:hi,height:Zi},ma=Object(u.useMemo)(function(){if(Pr){var dn=new Date(Pr),On=dn.getHours(),gn=dn.getMinutes(),qt=dn.getSeconds();return On=On<10?"0"+On:On,gn=gn<10?"0"+gn:gn,qt=qt<10?"0"+qt:qt,"".concat(On,":").concat(gn,":").concat(qt)}return 0},[Pr]);function ea(){window.sessionStorage.removeItem(ve),kr(!1),Fr(0)}function ta(){kr(!1),Fr(0),it.setValue(window.sessionStorage.getItem(ve))}function $i(dn,On){var gn=it.getValue();gn=gn.replace(dn,On),In(gn),it==null||it.setValue(gn)}return o.a.createElement(u.Fragment,null,o.a.createElement("div",{className:"markdown-editor-wrapper",ref:yi},o.a.createElement("div",{className:"markdown-editor-container ".concat(an," ").concat(Un?"on-preview":""," ").concat(kt?"mini":""," ").concat(fr?"full-screen":""),style:pa},o.a.createElement(te,{insertTemp:Bt,watch:Un,fullScreen:fr,showNullButton:Je,onActionCallback:Pi,hidetoolBar:Pt,uuid:hr.current,setOpenPhones:function(){Ui.current=!0}}),o.a.createElement("div",{className:"markdown-editor-body"},o.a.createElement("div",{className:"codemirror-container"},o.a.createElement("textarea",{ref:Ur,placeholder:ae})),Un?o.a.createElement("div",{ref:Li,className:"preview-container"},Zt==="stex"&&o.a.createElement(E,{value:on}),Zt!=="stex"&&o.a.createElement(b.a,{edit:!0,value:on,replaces:$i})):null))),Z?o.a.createElement("a",{ref:Zr,className:"editor-resize"}):null,o.a.createElement(W.a,null,Ht[Yr]?o.a.createElement(Q.a,{centered:!0,title:Ht[Yr],visible:!0,onCancel:Si,footer:null},Wi):null))}},P5Jw:function(et,Ve,z){"use strict";var le=z("rHrb"),Q=le.CopyToClipboard;Q.CopyToClipboard=Q,et.exports=Q},PD8m:function(et,Ve){et.exports={name:"memoryStorage",read:le,write:Q,each:j,remove:w,clearAll:P};var z={};function le(_){return z[_]}function Q(_,T){z[_]=T}function j(_){for(var T in z)z.hasOwnProperty(T)&&_(z[T],T)}function w(_){delete z[_]}function P(_){z={}}},RELg:function(et,Ve,z){var le=z("MFOe"),Q=le.Global;et.exports={name:"oldIE-userDataStorage",write:T,read:C,each:c,remove:p,clearAll:u};var j="storejs",w=Q.document,P=d(),_=(Q.navigator?Q.navigator.userAgent:"").match(/ (MSIE 8|MSIE 9|MSIE 10)\./);function T(s,f){if(_)return;var i=a(s);P(function(n){n.setAttribute(i,f),n.save(j)})}function C(s){if(_)return;var f=a(s),i=null;return P(function(n){i=n.getAttribute(f)}),i}function c(s){P(function(f){for(var i=f.XMLDocument.documentElement.attributes,n=i.length-1;n>=0;n--){var t=i[n];s(f.getAttribute(t.name),t.name)}})}function p(s){var f=a(s);P(function(i){i.removeAttribute(f),i.save(j)})}function u(){P(function(s){var f=s.XMLDocument.documentElement.attributes;s.load(j);for(var i=f.length-1;i>=0;i--)s.removeAttribute(f[i].name);s.save(j)})}var o=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g");function a(s){return s.replace(/^\d/,"___$&").replace(o,"___")}function d(){if(!w||!w.documentElement||!w.documentElement.addBehavior)return null;var s="script",f,i,n;try{i=new ActiveXObject("htmlfile"),i.open(),i.write("<"+s+">document.w=window'),i.close(),f=i.w.frames[0].document,n=f.createElement("div")}catch(t){n=w.createElement("div"),f=w.body}return function(t){var h=[].slice.call(arguments,0);h.unshift(n),f.appendChild(n),n.addBehavior("#default#userData"),n.load(j),t.apply(this,h),f.removeChild(n);return}}},RpDr:function(et,Ve,z){"use strict";z.d(Ve,"a",function(){return b}),z.d(Ve,"c",function(){return y});var le=z("+L6B"),Q=z("2/Rp"),j=z("tJVT"),w=z("k1fw"),P=z("jrin"),_=z("5NDa"),T=z("5rEg"),C=z("q1tI"),c=z.n(C),p=z("8Skl"),u=z("y3Kf"),o=z("bdLU"),a=z("J66h"),d=z.n(a),s=z("++UQ"),f=z.n(s),i=z("IxHN"),n=z("9Bee"),t=z("1vsH"),h,v=T.a.TextArea,g={visible:!1,tabIndex:"0"},b=(h={},Object(P.a)(h,o.a.NOMATCH,"\u6D4B\u8BD5\u7528\u4F8B\u7ED3\u679C\u4E0D\u5339\u914D"),Object(P.a)(h,o.a.OK,"\u8C03\u8BD5\u901A\u8FC7"),Object(P.a)(h,2,"\u8C03\u8BD5\u8D85\u65F6"),Object(P.a)(h,3,"\u8C03\u8BD5pod\u5931\u8D25"),Object(P.a)(h,4,"\u7F16\u8BD1\u5931\u8D25"),Object(P.a)(h,5,"\u6267\u884C\u5931\u8D25"),h),E;(function(l){l[l.SET_VISIBLE=0]="SET_VISIBLE",l[l.SET_TABINDEX=1]="SET_TABINDEX"})(E||(E={}));function m(l,S){switch(S.type){case E.SET_VISIBLE:return Object(w.a)(Object(w.a)({},l),{},{visible:S.payload});case E.SET_TABINDEX:return Object(w.a)(Object(w.a)({},l),{},{tabIndex:S.payload});default:throw new Error}}function y(l){var S=l.status,O=l.error_msg,A=l.output,D=l.input,I=l.expected_output,B=l.is_file,H=l.input_file_url,te=l.output_file_url,W=l.expected_output_file_url,V=null,X={minHeight:150,marginBottom:10,paddingLeft:24,background:"#070f19",color:"#fff"};switch(S){case o.a.NOMATCH:V=c.a.createElement(c.a.Fragment,null,c.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u5165\uFF1A"),!B&&c.a.createElement(n.a,{value:D,style:X}),B&&c.a.createElement("div",{style:X},c.a.createElement("a",{onClick:function(){return Object(t.w)(H,D)}},D)),c.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u51FA\uFF1A"),!B&&c.a.createElement(n.a,{value:A&&a.Base64.decode(A)||"",style:X}),B&&c.a.createElement("div",{style:X},c.a.createElement("a",{onClick:function(){return Object(t.w)(te,A)}},A)),c.a.createElement("p",{className:"c-red"},"\u9884\u671F\u8F93\u51FA\uFF1A"),!B&&c.a.createElement(n.a,{value:I&&a.Base64.decode(I)||"",style:X}),B&&c.a.createElement("div",{style:X},c.a.createElement("a",{onClick:function(){return Object(t.w)(W,I)}},I)));break;case o.a.EXECUTEFAILURE:V=c.a.createElement(c.a.Fragment,null,c.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A"),!B&&c.a.createElement(n.a,{value:D,style:X}),B&&c.a.createElement("div",{style:X},c.a.createElement("a",{onClick:function(){return Object(t.w)(H,D)}},D)),c.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),c.a.createElement("pre",{className:"error"},a.Base64.decode(O)));break;case o.a.COMPILEFAILURE:V=c.a.createElement(c.a.Fragment,null,c.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A"),!B&&c.a.createElement(n.a,{value:D,style:X}),B&&c.a.createElement("div",{style:X},c.a.createElement("a",{onClick:function(){return Object(t.w)(H,D)}},D)),c.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),c.a.createElement("pre",{className:"error"},a.Base64.decode(O)));break;case o.a.PODFAILURE:V=c.a.createElement("p",null,"\u521B\u5EFApod\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break;case o.a.TIMEOUT:V=c.a.createElement("p",null,"\u8BC4\u6D4B\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break}return c.a.createElement(c.a.Fragment,null," ",V," ")}function x(l){var S=l.status,O=l.error_msg,A=l.execute_time,D=l.output,I=l.input,B=l.expected_output,H=l.is_file,te=l.input_file_url,W=l.output_file_url,V=l.expected_output_file_url,X=null;switch(S){case o.a.OK:X=c.a.createElement(c.a.Fragment,null,c.a.createElement("p",null,"\u6267\u884C\u7528\u65F6\uFF1A",A),c.a.createElement("p",null,"\u6267\u884C\u7ED3\u679C\uFF1A"),c.a.createElement("pre",null,a.Base64.decode(D)));break;case o.a.NOMATCH:X=c.a.createElement(c.a.Fragment,null,c.a.createElement("p",null,"\u8F93\u5165\uFF1A",c.a.createElement("pre",null,I)),c.a.createElement("p",null,"\u8F93\u51FA\uFF1A",D&&a.Base64.decode(D)),c.a.createElement("p",null,"\u9884\u671F\u8F93\u51FA\uFF1A",B&&a.Base64.decode(B)));break;case o.a.EXECUTEFAILURE:X=c.a.createElement(c.a.Fragment,null,c.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A",c.a.createElement("pre",null,I)),c.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),c.a.createElement("pre",{className:"error"},a.Base64.decode(O)));break;case o.a.COMPILEFAILURE:X=c.a.createElement(c.a.Fragment,null,c.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A",c.a.createElement("pre",null,I)),c.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),c.a.createElement("pre",{className:"error"},a.Base64.decode(O)));break;case o.a.PODFAILURE:X=c.a.createElement("p",null,"\u521B\u5EFApod\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break;case o.a.TIMEOUT:X=c.a.createElement("p",null,"\u8BC4\u6D4B\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break}return c.a.createElement(c.a.Fragment,null," ",X," ")}Ve.b=function(l){var S=l.id,O=l.input,A=l.debuging,D=l.submitting,I=l.executingMessage,B=l.debugResult,H=l.onChangeInput,te=l.onDebugCode,W=l.onSubmitCode,V=Object(C.useReducer)(m,g),X=Object(j.a)(V,2),ne=X[0],$=X[1],ee=ne.visible,ce=ne.tabIndex;Object(C.useEffect)(function(){$({type:E.SET_VISIBLE,payload:!1})},[S]);function de(be){var _e=be.target.id;$({type:E.SET_TABINDEX,payload:_e})}function Ce(){$({type:E.SET_VISIBLE,payload:!ee})}var Se=Object(C.useMemo)(function(){if(B){var be=B.status;return c.a.createElement(c.a.Fragment,null,x(B))}return null},[B]);function De(){$({type:E.SET_VISIBLE,payload:!0}),$({type:E.SET_TABINDEX,payload:"1"}),te()}return c.a.createElement("div",{className:"test-case-panel"},c.a.createElement("div",{className:"test-case-panel-body ".concat(ee?"active":"")},c.a.createElement("ul",{className:"s-navs"},c.a.createElement("li",null,c.a.createElement("a",{className:ce==="0"?"active":"",id:"0",onClick:de},"\u81EA\u5B9A\u4E49\u6D4B\u8BD5\u7528\u4F8B")),c.a.createElement("li",null,c.a.createElement("a",{className:ce==="1"?"active":"",id:"1",onClick:de},"\u4EE3\u7801\u6267\u884C\u7ED3\u679C"))),c.a.createElement("div",{className:"tab-panel-body ".concat(ce==="0"?"":"hide")},c.a.createElement(v,{placeholder:"\u8BF7\u586B\u5199\u6D4B\u8BD5\u7528\u4F8B\u7684\u8F93\u5165\u503C\uFF0C\u70B9\u51FB\u201C\u8C03\u8BD5\u4EE3\u7801\u201D",value:O,onChange:H})),c.a.createElement("div",{className:"tab-panel-body ".concat(ce==="1"?"":"hide")},A?c.a.createElement(i.a,{message:I}):B?c.a.createElement("section",{style:{height:200}}," ",Se," "):c.a.createElement("p",{className:"tip"},"\u8BF7\u586B\u5199\u6D4B\u8BD5\u7528\u4F8B\u7684\u8F93\u5165\u503C\uFF0C\u70B9\u51FB\u201C\u8C03\u8BD5\u4EE3\u7801\u201D"))),c.a.createElement("a",{className:"btn-collapse ".concat(ee?"up":""),onClick:Ce},ee?c.a.createElement(p.a,null):c.a.createElement(u.a,null)),c.a.createElement("footer",{className:"footer"},c.a.createElement("span",{style:{visibility:"hidden"}},"\u63A7\u5236\u53F0"),c.a.createElement("div",{className:"flex-container"},c.a.createElement(Q.a,{id:"oj-prev",className:"btn-blue",type:"ghost"},"\u4E0A\u4E00\u9898"),c.a.createElement(Q.a,{id:"oj-next",className:"btn-blue",type:"ghost"},"\u4E0B\u4E00\u9898"),c.a.createElement(Q.a,{className:"btn-green",type:"ghost",loading:A,onClick:De},"\u8C03\u8BD5\u4EE3\u7801"),c.a.createElement(Q.a,{type:"primary",loading:D,disabled:D,onClick:function(){$({type:E.SET_VISIBLE,payload:!1}),W()}},"\u8BC4\u6D4B\u5E76\u63D0\u4EA4"))))}},"S/kP":function(et,Ve,z){et.exports=z.p+"static/time.a3dc82f3.svg"},"SA+Z":function(et,Ve,z){var le=z("wTVA"),Q=z("EbDI"),j=z("ZhPi"),w=z("wkBT");function P(_){return le(_)||Q(_)||j(_)||w()}et.exports=P,et.exports.__esModule=!0,et.exports.default=et.exports},SJMd:function(et,Ve){/** * @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 z,le,Q,j=!1,w,P;window.PR_SHOULD_USE_CONTINUATION=!0;var _,T;(function(){var C=window,c=["break,continue,do,else,for,if,return,while"],p=[c,"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"],u=[p,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],o=[u,"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"],a=[u,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],d=[u,"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",f=[u,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],i="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",n=[c,"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"],t=[c,"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"],h=[c,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],v=[o,d,a,f,i,n,t,h],g=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,b="str",E="kwd",m="com",y="typ",x="lit",l="pun",S="pln",O="tag",A="dec",D="src",I="atn",B="atv",H="nocode",te="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function W(pe){for(var We=0,He=!1,nt=!1,re=0,k=pe.length;re122||(Ee<65||Me>90||tt.push([Math.max(65,Me)|32,Math.min(Ee,90)|32]),Ee<97||Me>122||tt.push([Math.max(97,Me)&~32,Math.min(Ee,122)&~32]))}}tt.sort(function(Ze,ut){return Ze[0]-ut[0]||ut[1]-Ze[1]});for(var Ae=[],Le=[],Xe=0;XeTe[0]&&(Te[1]+1>Te[0]&&Qe.push("-"),Qe.push(J(Te[1])))}return Qe.push("]"),Qe.join("")}function ke(Ue){for(var je=Ue.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")),tt=je.length,mt=[],Qe=0,Xe=0;Qe=2&&Me==="["?je[Qe]=xe(Fe):Me!=="\\"&&(je[Qe]=Fe.replace(/[a-zA-Z]/g,function(Le){var Te=Le.charCodeAt(0);return"["+String.fromCharCode(Te&~32,Te|32)+"]"}))}return je.join("")}for(var dt=[],re=0,k=pe.length;re=0;)He[dt.charAt(Ue)]=ke;var je=ke[1],tt=""+je;Y.hasOwnProperty(tt)||(q.push(je),Y[tt]=null)}q.push(/[\0-\uffff]/),nt=W(q)})();var re=We.length,k=function(U){for(var q=U.sourceCode,Y=U.basePos,J=U.sourceNode,xe=[Y,S],ke=0,dt=q.match(nt)||[],Ue={},je=0,tt=dt.length;je=5&&Qe.substring(0,5)==="lang-",Fe&&!(Xe&&typeof Xe[1]=="string")&&(Fe=!1,Qe=D),Fe||(Ue[mt]=Qe)}var Ee=ke;if(ke+=mt.length,!Fe)xe.push(Y+Ee,Qe);else{var Ae=Xe[1],Le=mt.indexOf(Ae),Te=Le+Ae.length;Xe[2]&&(Te=mt.length-Xe[2].length,Le=Te-Ae.length);var Ze=Qe.substring(5);X(J,Y+Ee,mt.substring(0,Le),k,xe),X(J,Y+Ee+Le,Ae,_e(Ze,Ae),xe),X(J,Y+Ee+Te,mt.substring(Te),k,xe)}}U.decorations=xe};return k}function ce(pe){var We=[],He=[];pe.tripleQuotedStrings?We.push([b,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):pe.multiLineStrings?We.push([b,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):We.push([b,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),pe.verbatimStrings&&He.push([b,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var nt=pe.hashComments;nt&&(pe.cStyleComments?(nt>1?We.push([m,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):We.push([m,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),He.push([b,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):We.push([m,/^#[^\r\n]*/,null,"#"])),pe.cStyleComments&&(He.push([m,/^\/\/[^\r\n]*/,null]),He.push([m,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var re=pe.regexLiterals;if(re){var k=re>1?"":` \r`,U=k?".":"[\\S\\s]",q="/(?=[^/*"+k+"])(?:[^/\\x5B\\x5C"+k+"]|\\x5C"+U+"|\\x5B(?:[^\\x5C\\x5D"+k+"]|\\x5C"+U+")*(?:\\x5D|$))+/";He.push(["lang-regex",RegExp("^"+te+"("+q+")")])}var Y=pe.types;Y&&He.push([y,Y]);var J=(""+pe.keywords).replace(/^ | $/g,"");J.length&&He.push([E,new RegExp("^(?:"+J.replace(/[\s,]+/g,"|")+")\\b"),null]),We.push([S,/^\s+/,null,` \r \xA0`]);var xe="^.[^\\s\\w.$@'\"`/\\\\]*";return pe.regexLiterals&&(xe+="(?!s*/)"),He.push([x,/^@[a-z_$][a-z_$@0-9]*/i,null],[y,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[S,/^[a-z_$][a-z_$@0-9]*/i,null],[x,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[S,/^\\[\s\S]?/,null],[l,new RegExp(xe),null]),ee(We,He)}var de=ce({keywords:v,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Ce(pe,We,He){for(var nt=/(?:^|\s)nocode(?:\s|$)/,re=/\r\n?|\n/,k=pe.ownerDocument,U=k.createElement("li");pe.firstChild;)U.appendChild(pe.firstChild);var q=[U];function Y(je){var tt=je.nodeType;if(tt==1&&!nt.test(je.className))if(je.nodeName==="br")J(je),je.parentNode&&je.parentNode.removeChild(je);else for(var mt=je.firstChild;mt;mt=mt.nextSibling)Y(mt);else if((tt==3||tt==4)&&He){var Qe=je.nodeValue,Xe=Qe.match(re);if(Xe){var Fe=Qe.substring(0,Xe.index);je.nodeValue=Fe;var Ie=Qe.substring(Xe.index+Xe[0].length);if(Ie){var Me=je.parentNode;Me.insertBefore(k.createTextNode(Ie),je.nextSibling)}J(je),Fe||je.parentNode.removeChild(je)}}}function J(je){for(;!je.nextSibling;)if(je=je.parentNode,!je)return;function tt(Xe,Fe){var Ie=Fe?Xe.cloneNode(!1):Xe,Me=Xe.parentNode;if(Me){var Ee=tt(Me,1),Ae=Xe.nextSibling;Ee.appendChild(Ie);for(var Le=Ae;Le;Le=Ae)Ae=Le.nextSibling,Ee.appendChild(Le)}return Ie}for(var mt=tt(je.nextSibling,0),Qe;(Qe=mt.parentNode)&&Qe.nodeType===1;)mt=Qe;q.push(mt)}for(var xe=0;xe=Me&&(Y+=2),k>=Ee&&(ke+=2)}}finally{Qe&&(Qe.style.display=Xe)}}var De={};function be(pe,We){for(var He=We.length;--He>=0;){var nt=We[He];De.hasOwnProperty(nt)?C.console&&console.warn("cannot override language handler %s",nt):De[nt]=pe}}function _e(pe,We){return pe&&De.hasOwnProperty(pe)||(pe=/^\s*]*(?:>|$)/],[m,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[l,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),be(ee([[S,/^[\s]+/,null,` \r `],[B,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[O,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[I,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[l,/^[=<>\/]+/],["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"]),be(ee([],[[B,/^[\s\S]+/]]),["uq.val"]),be(ce({keywords:o,hashComments:!0,cStyleComments:!0,types:g}),["c","cc","cpp","cxx","cyc","m"]),be(ce({keywords:"null,true,false"}),["json"]),be(ce({keywords:d,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:g}),["cs"]),be(ce({keywords:a,cStyleComments:!0}),["java"]),be(ce({keywords:h,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),be(ce({keywords:n,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),be(ce({keywords:i,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),be(ce({keywords:t,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),be(ce({keywords:f,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),be(ce({keywords:s,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),be(ee([],[[b,/^[\s\S]+/]]),["regex"]);function Ke(pe){var We=pe.langExtension;try{var He=V(pe.sourceNode,pe.pre),nt=He.sourceCode;pe.sourceCode=nt,pe.spans=He.spans,pe.basePos=0,_e(We,nt)(pe),Se(pe)}catch(re){C.console&&console.log(re&&re.stack||re)}}function Ne(pe,We,He){var nt=He||!1,re=We||null,k=document.createElement("div");k.innerHTML="
    "+pe+"
    ",k=k.firstChild,nt&&Ce(k,nt,!0);var U={langExtension:re,numberLines:nt,sourceNode:k,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return Ke(U),k.innerHTML}function Be(pe,We){var He=We||document.body,nt=He.ownerDocument||document;function re(Ie){return He.getElementsByTagName(Ie)}for(var k=[re("pre"),re("code"),re("xmp")],U=[],q=0;q=15&&(o=!1,c=!0);var b=t&&(p||o&&(g==null||g<12.11)),E=j||T&&C>=9;function m(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var y=function(e,r){var R=e.className,L=m(r).exec(R);if(L){var M=R.slice(L.index+L[0].length);e.className=R.slice(0,L.index)+(M?L[1]+M:"")}};function x(e){for(var r=e.childNodes.length;r>0;--r)e.removeChild(e.firstChild);return e}function l(e,r){return x(e).appendChild(r)}function S(e,r,R,L){var M=document.createElement(e);if(R&&(M.className=R),L&&(M.style.cssText=L),typeof r=="string")M.appendChild(document.createTextNode(r));else if(r)for(var G=0;G=r)return ue+(r-G);ue+=fe-G,ue+=R-ue%R,G=fe+1}}var ne=function(){this.id=null,this.f=null,this.time=0,this.handler=W(this.onTimeout,this)};ne.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},ne.prototype.set=function(e,r){this.f=r;var R=+new Date+e;(!this.id||R=r)return L+Math.min(ue,r-M);if(M+=G-L,M+=R-M%R,L=G+1,M>=r)return L}}var be=[""];function _e(e){for(;be.length<=e;)be.push(Ke(be)+" ");return be[e]}function Ke(e){return e[e.length-1]}function Ne(e,r){for(var R=[],L=0;L"\x80"&&(e.toUpperCase()!=e.toLowerCase()||pe.test(e))}function He(e,r){return r?r.source.indexOf("\\w")>-1&&We(e)?!0:r.test(e):We(e)}function nt(e){for(var r in e)if(e.hasOwnProperty(r)&&e[r])return!1;return!0}var re=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function k(e){return e.charCodeAt(0)>=768&&re.test(e)}function U(e,r,R){for(;(R<0?r>0:rR?-1:1;;){if(r==R)return r;var M=(r+R)/2,G=L<0?Math.ceil(M):Math.floor(M);if(G==r)return e(G)?r:R;e(G)?R=G:r=G+L}}function Y(e,r,R,L){if(!e)return L(r,R,"ltr",0);for(var M=!1,G=0;Gr||r==R&&ue.to==r)&&(L(Math.max(ue.from,r),Math.min(ue.to,R),ue.level==1?"rtl":"ltr",G),M=!0)}M||L(r,R,"ltr")}var J=null;function xe(e,r,R){var L;J=null;for(var M=0;Mr)return M;G.to==r&&(G.from!=G.to&&R=="before"?L=M:J=M),G.from==r&&(G.from!=G.to&&R!="before"?L=M:J=M)}return L!=null?L:J}var ke=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",r="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function R(we){return we<=247?e.charAt(we):1424<=we&&we<=1524?"R":1536<=we&&we<=1785?r.charAt(we-1536):1774<=we&&we<=2220?"r":8192<=we&&we<=8203?"w":we==8204?"b":"L"}var L=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,M=/[stwN]/,G=/[LRr]/,ue=/[Lb1n]/,fe=/[1n]/;function ge(we,Ye,qe){this.level=we,this.from=Ye,this.to=qe}return function(we,Ye){var qe=Ye=="ltr"?"L":"R";if(we.length==0||Ye=="ltr"&&!L.test(we))return!1;for(var vt=we.length,ft=[],Ot=0;Ot-1&&(L[r]=M.slice(0,G).concat(M.slice(G+1)))}}}function Qe(e,r){var R=tt(e,r);if(!R.length)return;for(var L=Array.prototype.slice.call(arguments,2),M=0;M0}function Me(e){e.prototype.on=function(r,R){je(this,r,R)},e.prototype.off=function(r,R){mt(this,r,R)}}function Ee(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Ae(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Le(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function Te(e){Ee(e),Ae(e)}function Ze(e){return e.target||e.srcElement}function ut(e){var r=e.which;return r==null&&(e.button&1?r=1:e.button&2?r=3:e.button&4&&(r=2)),t&&e.ctrlKey&&r==1&&(r=3),r}var Tt=function(){if(T&&C<9)return!1;var e=S("div");return"draggable"in e||"dragDrop"in e}(),Ht;function Qt(e){if(Ht==null){var r=S("span","\u200B");l(e,S("span",[r,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Ht=r.offsetWidth<=1&&r.offsetHeight>2&&!(T&&C<8))}var R=Ht?S("span","\u200B"):S("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return R.setAttribute("cm-text",""),R}var bt;function Lt(e){if(bt!=null)return bt;var r=l(e,document.createTextNode("A\u062EA")),R=A(r,0,1).getBoundingClientRect(),L=A(r,1,2).getBoundingClientRect();return x(e),!R||R.left==R.right?!1:bt=L.right-R.right<3}var at=` b`.split(/\n/).length!=3?function(e){for(var r=0,R=[],L=e.length;r<=L;){var M=e.indexOf(` `,r);M==-1&&(M=e.length);var G=e.slice(r,e.charAt(M-1)=="\r"?M-1:M),ue=G.indexOf("\r");ue!=-1?(R.push(G.slice(0,ue)),r+=ue+1):(R.push(G),r=M+1)}return R}:function(e){return e.split(/\r\n?|\n/)},pt=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(r){return!1}}:function(e){var r;try{r=e.ownerDocument.selection.createRange()}catch(R){}return!r||r.parentElement()!=e?!1:r.compareEndPoints("StartToEnd",r)!=0},st=function(){var e=S("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Pe=null;function Ge(e){if(Pe!=null)return Pe;var r=l(e,S("span","x")),R=r.getBoundingClientRect(),L=A(r,0,1).getBoundingClientRect();return Pe=Math.abs(R.left-L.left)>1}var yt={},ot={};function kt(e,r){arguments.length>2&&(r.dependencies=Array.prototype.slice.call(arguments,2)),yt[e]=r}function Dt(e,r){ot[e]=r}function rt(e){if(typeof e=="string"&&ot.hasOwnProperty(e))e=ot[e];else if(e&&typeof e.name=="string"&&ot.hasOwnProperty(e.name)){var r=ot[e.name];typeof r=="string"&&(r={name:r}),e=ye(r,e),e.name=r.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return rt("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return rt("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function wt(e,r){r=rt(r);var R=yt[r.name];if(!R)return wt(e,"text/plain");var L=R(e,r);if(Bt.hasOwnProperty(r.name)){var M=Bt[r.name];for(var G in M){if(!M.hasOwnProperty(G))continue;L.hasOwnProperty(G)&&(L["_"+G]=L[G]),L[G]=M[G]}}if(L.name=r.name,r.helperType&&(L.helperType=r.helperType),r.modeProps)for(var ue in r.modeProps)L[ue]=r.modeProps[ue];return L}var Bt={};function zt(e,r){var R=Bt.hasOwnProperty(e)?Bt[e]:Bt[e]={};V(r,R)}function Zt(e,r){if(r===!0)return r;if(e.copyState)return e.copyState(r);var R={};for(var L in r){var M=r[L];M instanceof Array&&(M=M.concat([])),R[L]=M}return R}function Re(e,r){for(var R;e.innerMode&&!(R=e.innerMode(r),!R||R.mode==e);)r=R.state,e=R.mode;return R||{mode:e,state:r}}function ve(e,r,R){return e.startState?e.startState(r,R):!0}var K=function(e,r,R){this.pos=this.start=0,this.string=e,this.tabSize=r||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=R};K.prototype.eol=function(){return this.pos>=this.string.length},K.prototype.sol=function(){return this.pos==this.lineStart},K.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},K.prototype.next=function(){if(this.posr},K.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},K.prototype.skipToEnd=function(){this.pos=this.string.length},K.prototype.skipTo=function(e){var r=this.string.indexOf(e,this.pos);if(r>-1)return this.pos=r,!0},K.prototype.backUp=function(e){this.pos-=e},K.prototype.column=function(){return this.lastColumnPos0?null:(G&&r!==!1&&(this.pos+=G[0].length),G)}},K.prototype.current=function(){return this.string.slice(this.start,this.pos)},K.prototype.hideFirstChars=function(e,r){this.lineStart+=e;try{return r()}finally{this.lineStart-=e}},K.prototype.lookAhead=function(e){var r=this.lineOracle;return r&&r.lookAhead(e)},K.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function Z(e,r){if(r-=e.first,r<0||r>=e.size)throw new Error("There is no line "+(r+e.first)+" in the document.");for(var R=e;!R.lines;)for(var L=0;;++L){var M=R.children[L],G=M.chunkSize();if(r=e.first&&rR?ht(R,Z(e,R).text.length):F(r,Z(e,r.line).text.length)}function F(e,r){var R=e.ch;return R==null||R>r?ht(e.line,r):R<0?ht(e.line,0):e}function ae(e,r){for(var R=[],L=0;Lthis.maxLookAhead&&(this.maxLookAhead=e),r},se.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var r=this.baseTokens[this.baseTokenPos+1];return{type:r&&r.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},se.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},se.fromSaved=function(e,r,R){return r instanceof me?new se(e,Zt(e.mode,r.state),R,r.lookAhead):new se(e,Zt(e.mode,r),R)},se.prototype.save=function(e){var r=e!==!1?Zt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new me(r,this.maxLookAhead):r};function $e(e,r,R,L){var M=[e.state.modeGen],G={};Sr(e,r.text,e.doc.mode,R,function(we,Ye){return M.push(we,Ye)},G,L);for(var ue=R.state,fe=function(we){R.baseTokens=M;var Ye=e.state.overlays[we],qe=1,vt=0;R.state=!0,Sr(e,r.text,Ye.mode,R,function(ft,Ot){for(var Ut=qe;vtft&&M.splice(qe,1,ft,M[qe+1],Wt),qe+=2,vt=Math.min(ft,Wt)}if(!Ot)return;if(Ye.opaque)M.splice(Ut,qe-Ut,ft,"overlay "+Ot),qe=Ut+2;else for(;Ute.options.maxHighlightLength&&Zt(e.doc.mode,L.state),G=$e(e,r,L);M&&(L.state=M),r.stateAfter=L.save(!M),r.styles=G.styles,G.classes?r.styleClasses=G.classes:r.styleClasses&&(r.styleClasses=null),R===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return r.styles}function it(e,r,R){var L=e.doc,M=e.display;if(!L.mode.startState)return new se(L,!0,r);var G=Un(e,r,R),ue=G>L.first&&Z(L,G-1).stateAfter,fe=ue?se.fromSaved(L,ue,G):new se(L,ve(L.mode),G);return L.iter(G,r,function(ge){Vt(e,ge.text,fe);var we=fe.line;ge.stateAfter=we==r-1||we%5==0||we>=M.viewFrom&&wer.start)return G}throw new Error("Mode "+e.name+" failed to advance stream.")}var on=function(e,r,R){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=r||null,this.state=R};function In(e,r,R,L){var M=e.doc,G=M.mode,ue;r=N(M,r);var fe=Z(M,r.line),ge=it(e,r.line,R),we=new K(fe.text,e.options.tabSize,ge),Ye;for(L&&(Ye=[]);(L||we.pose.options.maxHighlightLength?(fe=!1,ue&&Vt(e,r,L,Ye.pos),Ye.pos=r.length,qe=null):qe=Lr(Ft(R,Ye,L.state,vt),G),vt){var ft=vt[0].name;ft&&(qe="m-"+(qe?ft+" "+qe:ft))}if(!fe||we!=qe){for(;geue;--fe){if(fe<=G.first)return G.first;var ge=Z(G,fe-1),we=ge.stateAfter;if(we&&(!R||fe+(we instanceof me?we.lookAhead:0)<=G.modeFrontier))return fe;var Ye=X(ge.text,null,e.options.tabSize);(M==null||L>Ye)&&(M=fe-1,L=Ye)}return M}function ur(e,r){if(e.modeFrontier=Math.min(e.modeFrontier,r),e.highlightFrontierR;L--){var M=Z(e,L).stateAfter;if(M&&(!(M instanceof me)||L+M.lookAhead=r:G.to>r);(L||(L=[])).push(new Xr(ue,G.from,ge?null:G.to))}}return L}function si(e,r,R){var L;if(e)for(var M=0;M=r:G.to>r);if(fe||G.from==r&&ue.type=="bookmark"&&(!R||G.marker.insertLeft)){var ge=G.from==null||(ue.inclusiveLeft?G.from<=r:G.from0&&fe)for(var un=0;un0)continue;var Ye=[ge,1],qe=Mt(we.from,fe.from),vt=Mt(we.to,fe.to);(qe<0||!ue.inclusiveLeft&&!qe)&&Ye.push({from:we.from,to:fe.from}),(vt>0||!ue.inclusiveRight&&!vt)&&Ye.push({from:fe.to,to:we.to}),M.splice.apply(M,Ye),ge+=Ye.length-3}return M}function vi(e){var r=e.markedSpans;if(!r)return;for(var R=0;Rr)&&(!L||_r(L,G.marker)<0)&&(L=G.marker)}return L}function Nr(e,r,R,L,M){var G=Z(e,r),ue=Ar&&G.markedSpans;if(ue)for(var fe=0;fe=0&&qe<=0||Ye<=0&&qe>=0)continue;if(Ye<=0&&(ge.marker.inclusiveRight&&M.inclusiveLeft?Mt(we.to,R)>=0:Mt(we.to,R)>0)||Ye>=0&&(ge.marker.inclusiveRight&&M.inclusiveLeft?Mt(we.from,L)<=0:Mt(we.from,L)<0))return!0}}function Ur(e){for(var r;r=kr(e);)e=r.find(-1,!0).line;return e}function yi(e){for(var r;r=hr(e);)e=r.find(1,!0).line;return e}function Zr(e){for(var r,R;r=hr(e);)e=r.find(1,!0).line,(R||(R=[])).push(e);return R}function Li(e,r){var R=Z(e,r),L=Ur(R);return R==L?r:Je(L)}function qi(e,r){if(r>e.lastLine())return r;var R=Z(e,r),L;if(!xi(e,R))return r;for(;L=hr(R);)R=L.find(1,!0).line;return Je(R)+1}function xi(e,r){var R=Ar&&r.markedSpans;if(R)for(var L=void 0,M=0;Mr.maxLineLength&&(r.maxLineLength=M,r.maxLine=L)})}var hi=function(e,r,R){this.text=e,di(this,r),this.height=R?R(this):1};hi.prototype.lineNo=function(){return Je(this)},Me(hi);function Zi(e,r,R,L){e.text=r,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),vi(e),di(e,R);var M=L?L(e):1;M!=e.height&&Oe(e,M)}function pa(e){e.parent=null,vi(e)}var ma={},ea={};function ta(e,r){if(!e||/^\s*$/.test(e))return null;var R=r.addModeClass?ea:ma;return R[e]||(R[e]=e.replace(/\S+/g,"cm-$&"))}function $i(e,r){var R=O("span",null,null,c?"padding-right: .1px":null),L={pre:O("pre",[R],"CodeMirror-line"),content:R,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};r.measure={};for(var M=0;M<=(r.rest?r.rest.length:0);M++){var G=M?r.rest[M-1]:r.line,ue=void 0;L.pos=0,L.addToken=On,Lt(e.display.measure)&&(ue=dt(G,e.doc.direction))&&(L.addToken=qt(L.addToken,ue)),L.map=[];var fe=r!=e.display.externalMeasured&&Je(G);cr(G,L,Et(e,G,fe)),G.styleClasses&&(G.styleClasses.bgClass&&(L.bgClass=H(G.styleClasses.bgClass,L.bgClass||"")),G.styleClasses.textClass&&(L.textClass=H(G.styleClasses.textClass,L.textClass||""))),L.map.length==0&&L.map.push(0,0,L.content.appendChild(Qt(e.display.measure))),M==0?(r.measure.map=L.map,r.measure.cache={}):((r.measure.maps||(r.measure.maps=[])).push(L.map),(r.measure.caches||(r.measure.caches=[])).push({}))}if(c){var ge=L.content.lastChild;(/\bcm-tab\b/.test(ge.className)||ge.querySelector&&ge.querySelector(".cm-tab"))&&(L.content.className="cm-tab-wrap-hack")}return Qe(e,"renderLine",e,r.line,L.pre),L.pre.className&&(L.textClass=H(L.pre.className,L.textClass||"")),L}function dn(e){var r=S("span","\u2022","cm-invalidchar");return r.title="\\u"+e.charCodeAt(0).toString(16),r.setAttribute("aria-label",r.title),r}function On(e,r,R,L,M,G,ue){if(!r)return;var fe=e.splitSpaces?gn(r,e.trailingSpace):r,ge=e.cm.state.specialChars,we=!1,Ye;if(!ge.test(r))e.col+=r.length,Ye=document.createTextNode(fe),e.map.push(e.pos,e.pos+r.length,Ye),T&&C<9&&(we=!0),e.pos+=r.length;else{Ye=document.createDocumentFragment();for(var qe=0;;){ge.lastIndex=qe;var vt=ge.exec(r),ft=vt?vt.index-qe:r.length-qe;if(ft){var Ot=document.createTextNode(fe.slice(qe,qe+ft));T&&C<9?Ye.appendChild(S("span",[Ot])):Ye.appendChild(Ot),e.map.push(e.pos,e.pos+ft,Ot),e.col+=ft,e.pos+=ft}if(!vt)break;qe+=ft+1;var Ut=void 0;if(vt[0]==" "){var Wt=e.cm.options.tabSize,$t=Wt-e.col%Wt;Ut=Ye.appendChild(S("span",_e($t),"cm-tab")),Ut.setAttribute("role","presentation"),Ut.setAttribute("cm-text"," "),e.col+=$t}else vt[0]=="\r"||vt[0]==` `?(Ut=Ye.appendChild(S("span",vt[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Ut.setAttribute("cm-text",vt[0]),e.col+=1):(Ut=e.cm.options.specialCharPlaceholder(vt[0]),Ut.setAttribute("cm-text",vt[0]),T&&C<9?Ye.appendChild(S("span",[Ut])):Ye.appendChild(Ut),e.col+=1);e.map.push(e.pos,e.pos+1,Ut),e.pos++}}if(e.trailingSpace=fe.charCodeAt(r.length-1)==32,R||L||M||we||G||ue){var rn=R||"";L&&(rn+=L),M&&(rn+=M);var Jt=S("span",[Ye],rn,G);if(ue)for(var un in ue)ue.hasOwnProperty(un)&&un!="style"&&un!="class"&&Jt.setAttribute(un,ue[un]);return e.content.appendChild(Jt)}e.content.appendChild(Ye)}function gn(e,r){if(e.length>1&&!/ /.test(e))return e;for(var R=r,L="",M=0;Mwe&&qe.from<=we);vt++);if(qe.to>=Ye)return e(R,L,M,G,ue,fe,ge);e(R,L.slice(0,qe.to-we),M,G,null,fe,ge),G=null,L=L.slice(qe.to-we),we=qe.to}}}function Hn(e,r,R,L){var M=!L&&R.widgetNode;M&&e.map.push(e.pos,e.pos+r,M),!L&&e.cm.display.input.needsContentAttribute&&(M||(M=e.content.appendChild(document.createElement("span"))),M.setAttribute("cm-marker",R.id)),M&&(e.cm.display.input.setUneditable(M),e.content.appendChild(M)),e.pos+=r,e.trailingSpace=!1}function cr(e,r,R){var L=e.markedSpans,M=e.text,G=0;if(!L){for(var ue=1;uege||Qn.collapsed&&_n.to==ge&&_n.from==ge)){if(_n.to!=null&&_n.to!=ge&&ft>_n.to&&(ft=_n.to,Ut=""),Qn.className&&(Ot+=" "+Qn.className),Qn.css&&(vt=(vt?vt+";":"")+Qn.css),Qn.startStyle&&_n.from==ge&&(Wt+=" "+Qn.startStyle),Qn.endStyle&&_n.to==ft&&(un||(un=[])).push(Qn.endStyle,_n.to),Qn.title&&((rn||(rn={})).title=Qn.title),Qn.attributes)for(var Or in Qn.attributes)(rn||(rn={}))[Or]=Qn.attributes[Or];Qn.collapsed&&(!$t||_r($t.marker,Qn)<0)&&($t=_n)}else _n.from>ge&&ft>_n.from&&(ft=_n.from)}if(un)for(var ai=0;ai=fe)break;for(var Di=Math.min(fe,ft);;){if(Ye){var Ti=ge+Ye.length;if(!$t){var Qr=Ti>Di?Ye.slice(0,Di-ge):Ye;r.addToken(r,Qr,qe?qe+Ot:Ot,Wt,ge+Qr.length==ft?Ut:"",vt,rn)}if(Ti>=Di){Ye=Ye.slice(Di-ge),ge=Di;break}ge=Ti,Wt=""}Ye=M.slice(G,G=R[we++]),qe=ta(R[we++],r.cm.options)}}}function Zn(e,r,R){this.line=r,this.rest=Zr(r),this.size=this.rest?Je(Ke(this.rest))-R+1:1,this.node=this.text=null,this.hidden=xi(e,r)}function wr(e,r,R){for(var L=[],M,G=r;G2&&G.push((ge.bottom+we.top)/2-R.top)}}G.push(R.bottom-R.top)}}function dr(e,r,R){if(e.line==r)return{map:e.measure.map,cache:e.measure.cache};for(var L=0;LR)return{map:e.measure.maps[M],cache:e.measure.caches[M],before:!0}}function jn(e,r){r=Ur(r);var R=Je(r),L=e.display.externalMeasured=new Zn(e.doc,r,R);L.lineN=R;var M=L.built=$i(e,L);return L.text=M.pre,l(e.display.lineMeasure,M.pre),L}function Gt(e,r,R,L){return ar(e,tr(e,r),R,L)}function vn(e,r){if(r>=e.display.viewFrom&&r=R.lineN&&rr)&&(G=ge-fe,M=G-1,r>=ge&&(ue="right")),M!=null){if(L=e[we+2],fe==ge&&R==(L.insertLeft?"left":"right")&&(ue=R),R=="left"&&M==0)for(;we&&e[we-2]==e[we-3]&&e[we-1].insertLeft;)L=e[(we-=3)+2],ue="left";if(R=="right"&&M==ge-fe)for(;we=0&&!((R=e[M]).left!=R.right);M--);return R}function yn(e,r,R,L){var M=$n(r.map,R,L),G=M.node,ue=M.start,fe=M.end,ge=M.collapse,we;if(G.nodeType==3){for(var Ye=0;Ye<4;Ye++){for(;ue&&k(r.line.text.charAt(M.coverStart+ue));)--ue;for(;M.coverStart+fe0&&(ge=L="right");var qe;e.options.lineWrapping&&(qe=G.getClientRects()).length>1?we=qe[L=="right"?qe.length-1:0]:we=G.getBoundingClientRect()}if(T&&C<9&&!ue&&(!we||!we.left&&!we.right)){var vt=G.parentNode.getClientRects()[0];vt?we={left:vt.left,right:vt.left+Vn(e.display),top:vt.top,bottom:vt.bottom}:we=mr}for(var ft=we.top-r.rect.top,Ot=we.bottom-r.rect.top,Ut=(ft+Ot)/2,Wt=r.view.measure.heights,$t=0;$t=L.text.length?(ge=L.text.length,we="before"):ge<=0&&(ge=0,we="after"),!fe)return ue(we=="before"?ge-1:ge,we=="before");function Ye(Ot,Ut,Wt){var $t=fe[Ut],rn=$t.level==1;return ue(Wt?Ot-1:Ot,rn!=Wt)}var qe=xe(fe,ge,we),vt=J,ft=Ye(ge,qe,we=="before");return vt!=null&&(ft.other=Ye(ge,vt,we!="before")),ft}function or(e,r){var R=0;r=N(e.doc,r),e.options.lineWrapping||(R=Vn(e.display)*r.ch);var L=Z(e.doc,r.line),M=li(L)+Kn(e.display);return{left:R,right:R,top:M,bottom:M+L.height}}function vr(e,r,R,L,M){var G=ht(e,r,R);return G.xRel=M,L&&(G.outside=L),G}function Rr(e,r,R){var L=e.doc;if(R+=e.display.viewOffset,R<0)return vr(L.first,0,null,-1,-1);var M=lt(L,R),G=L.first+L.size-1;if(M>G)return vr(L.first+L.size-1,Z(L,G).text.length,null,1,1);r<0&&(r=0);for(var ue=Z(L,M);;){var fe=ji(e,ue,M,r,R),ge=Ui(ue,fe.ch+(fe.xRel>0||fe.outside>0?1:0));if(!ge)return fe;var we=ge.find(1);if(we.line==M)return we;ue=Z(L,M=we.line)}}function ei(e,r,R,L){L-=Bn(r);var M=r.text.length,G=q(function(ue){return ar(e,R,ue-1).bottom<=L},M,0);return M=q(function(ue){return ar(e,R,ue).top>L},G,M),{begin:G,end:M}}function ki(e,r,R,L){R||(R=tr(e,r));var M=bn(e,r,ar(e,R,L),"line").top;return ei(e,r,R,M)}function $r(e,r,R,L){return e.bottom<=R?!1:e.top>R?!0:(L?e.left:e.right)>r}function ji(e,r,R,L,M){M-=li(r);var G=tr(e,r),ue=Bn(r),fe=0,ge=r.text.length,we=!0,Ye=dt(r,e.doc.direction);if(Ye){var qe=(e.options.lineWrapping?Hi:na)(e,r,R,G,Ye,L,M);we=qe.level!=1,fe=we?qe.from:qe.to-1,ge=we?qe.to:qe.from-1}var vt=null,ft=null,Ot=q(function(An){var _n=ar(e,G,An);return _n.top+=ue,_n.bottom+=ue,$r(_n,L,M,!1)?(_n.top<=M&&_n.left<=L&&(vt=An,ft=_n),!0):!1},fe,ge),Ut,Wt,$t=!1;if(ft){var rn=L-ft.left=un.bottom?1:0}return Ot=U(r.text,Ot,1),vr(R,Ot,Wt,$t,L-Ut)}function na(e,r,R,L,M,G,ue){var fe=q(function(qe){var vt=M[qe],ft=vt.level!=1;return $r(Gn(e,ht(R,ft?vt.to:vt.from,ft?"before":"after"),"line",r,L),G,ue,!0)},0,M.length-1),ge=M[fe];if(fe>0){var we=ge.level!=1,Ye=Gn(e,ht(R,we?ge.from:ge.to,we?"after":"before"),"line",r,L);$r(Ye,G,ue,!0)&&Ye.top>ue&&(ge=M[fe-1])}return ge}function Hi(e,r,R,L,M,G,ue){var fe=ei(e,r,L,ue),ge=fe.begin,we=fe.end;/\s/.test(r.text.charAt(we-1))&&we--;for(var Ye=null,qe=null,vt=0;vt=we||ft.to<=ge)continue;var Ot=ft.level!=1,Ut=ar(e,L,Ot?Math.min(we,ft.to)-1:Math.max(ge,ft.from)).right,Wt=UtWt)&&(Ye=ft,qe=Wt)}return Ye||(Ye=M[M.length-1]),Ye.fromwe&&(Ye={from:Ye.from,to:we,level:Ye.level}),Ye}var ui;function zi(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(ui==null){ui=S("pre",null,"CodeMirror-line-like");for(var r=0;r<49;++r)ui.appendChild(document.createTextNode("x")),ui.appendChild(S("br"));ui.appendChild(document.createTextNode("x"))}l(e.measure,ui);var R=ui.offsetHeight/50;return R>3&&(e.cachedTextHeight=R),x(e.measure),R||1}function Vn(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var r=S("span","xxxxxxxxxx"),R=S("pre",[r],"CodeMirror-line-like");l(e.measure,R);var L=r.getBoundingClientRect(),M=(L.right-L.left)/10;return M>2&&(e.cachedCharWidth=M),M||10}function Tn(e){for(var r=e.display,R={},L={},M=r.gutters.clientLeft,G=r.gutters.firstChild,ue=0;G;G=G.nextSibling,++ue){var fe=e.display.gutterSpecs[ue].className;R[fe]=G.offsetLeft+G.clientLeft+M,L[fe]=G.clientWidth}return{fixedPos:nr(r),gutterTotalWidth:r.gutters.offsetWidth,gutterLeft:R,gutterWidth:L,wrapperWidth:r.wrapper.clientWidth}}function nr(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function sr(e){var r=zi(e.display),R=e.options.lineWrapping,L=R&&Math.max(5,e.display.scroller.clientWidth/Vn(e.display)-3);return function(M){if(xi(e.doc,M))return 0;var G=0;if(M.widgets)for(var ue=0;ue0&&(we=Z(e.doc,ge.line).text).length==ge.ch){var Ye=X(we,we.length,e.options.tabSize)-we.length;ge=ht(ge.line,Math.max(0,Math.round((G-rr(e.display).left)/Vn(e.display))-Ye))}return ge}function ni(e,r){if(r>=e.display.viewTo)return null;if(r-=e.display.viewFrom,r<0)return null;for(var R=e.display.view,L=0;Lr)&&(M.updateLineNumbers=r),e.curOp.viewChanged=!0,r>=M.viewTo)Ar&&Li(e.doc,r)M.viewFrom?wi(e):(M.viewFrom+=L,M.viewTo+=L);else if(r<=M.viewFrom&&R>=M.viewTo)wi(e);else if(r<=M.viewFrom){var G=Mi(e,R,R+L,1);G?(M.view=M.view.slice(G.index),M.viewFrom=G.lineN,M.viewTo+=L):wi(e)}else if(R>=M.viewTo){var ue=Mi(e,r,r,-1);ue?(M.view=M.view.slice(0,ue.index),M.viewTo=ue.lineN):wi(e)}else{var fe=Mi(e,r,r,-1),ge=Mi(e,R,R+L,1);fe&&ge?(M.view=M.view.slice(0,fe.index).concat(wr(e,fe.lineN,ge.lineN)).concat(M.view.slice(ge.index)),M.viewTo+=L):wi(e)}var we=M.externalMeasured;we&&(R=M.lineN&&r=L.viewTo)return;var G=L.view[ni(e,r)];if(G.node==null)return;var ue=G.changes||(G.changes=[]);$(ue,R)==-1&&ue.push(R)}function wi(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Mi(e,r,R,L){var M=ni(e,r),G,ue=e.display.view;if(!Ar||R==e.doc.first+e.doc.size)return{index:M,lineN:R};for(var fe=e.display.viewFrom,ge=0;ge0){if(M==ue.length-1)return null;G=fe+ue[M].size-r,M++}else G=fe-r;r+=G,R+=G}for(;Li(e.doc,R)!=R;){if(M==(L<0?0:ue.length-1))return null;R+=L*ue[M-(L<0?1:0)].size,M+=L}return{index:M,lineN:R}}function Ki(e,r,R){var L=e.display,M=L.view;M.length==0||r>=L.viewTo||R<=L.viewFrom?(L.view=wr(e,r,R),L.viewFrom=r):(L.viewFrom>r?L.view=wr(e,r,L.viewFrom).concat(L.view):L.viewFromR&&(L.view=L.view.slice(0,ni(e,R)))),L.viewTo=R}function Wn(e){for(var r=e.display.view,R=0,L=0;L=e.display.viewTo||fe.to().line0?r.blinker=setInterval(function(){e.hasFocus()||Bi(e),r.cursorDiv.style.visibility=(R=!R)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(r.cursorDiv.style.visibility="hidden")}function Gr(e){e.state.focused||(e.display.input.focus(),mn(e))}function ga(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Bi(e))},100)}function mn(e,r){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(Qe(e,"focus",e,r),e.state.focused=!0,B(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),c&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Kr(e)}function Bi(e,r){if(e.state.delayingBlurEvent)return;e.state.focused&&(Qe(e,"blur",e,r),e.state.focused=!1,y(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function aa(e){for(var r=e.display,R=r.lineDiv.offsetTop,L=0;L.005||Ye<-.005)&&(Oe(M.line,ue),Gi(M.line),M.rest))for(var qe=0;qee.display.sizerWidth){var vt=Math.ceil(fe/Vn(e.display));vt>e.display.maxLineLength&&(e.display.maxLineLength=vt,e.display.maxLine=M.line,e.display.maxLineChanged=!0)}}}function Gi(e){if(e.widgets)for(var r=0;r=ue&&(G=lt(r,li(Z(r,ge))-e.wrapper.clientHeight),ue=ge)}return{from:G,to:Math.max(ue,G+1)}}function Vi(e,r){if(Xe(e,"scrollCursorIntoView"))return;var R=e.display,L=R.sizer.getBoundingClientRect(),M=null;if(r.top+L.top<0?M=!0:r.bottom+L.top>(window.innerHeight||document.documentElement.clientHeight)&&(M=!1),M!=null&&!s){var G=S("div","\u200B",null,`position: absolute; top: `+(r.top-R.viewOffset-Kn(e.display))+`px; height: `+(r.bottom-r.top+lr(e)+R.barHeight)+`px; left: `+r.left+"px; width: "+Math.max(2,r.right-r.left)+"px;");e.display.lineSpace.appendChild(G),G.scrollIntoView(M),e.display.lineSpace.removeChild(G)}}function oa(e,r,R,L){L==null&&(L=0);var M;!e.options.lineWrapping&&r==R&&(r=r.ch?ht(r.line,r.sticky=="before"?r.ch-1:r.ch,"after"):r,R=r.sticky=="before"?ht(r.line,r.ch+1,"before"):r);for(var G=0;G<5;G++){var ue=!1,fe=Gn(e,r),ge=!R||R==r?fe:Gn(e,R);M={left:Math.min(fe.left,ge.left),top:Math.min(fe.top,ge.top)-L,right:Math.max(fe.left,ge.left),bottom:Math.max(fe.bottom,ge.bottom)+L};var we=Ji(e,M),Ye=e.doc.scrollTop,qe=e.doc.scrollLeft;if(we.scrollTop!=null&&(Ua(e,we.scrollTop),Math.abs(e.doc.scrollTop-Ye)>1&&(ue=!0)),we.scrollLeft!=null&&(va(e,we.scrollLeft),Math.abs(e.doc.scrollLeft-qe)>1&&(ue=!0)),!ue)break}return M}function sa(e,r){var R=Ji(e,r);R.scrollTop!=null&&Ua(e,R.scrollTop),R.scrollLeft!=null&&va(e,R.scrollLeft)}function Ji(e,r){var R=e.display,L=zi(e.display);r.top<0&&(r.top=0);var M=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:R.scroller.scrollTop,G=Er(e),ue={};r.bottom-r.top>G&&(r.bottom=r.top+G);var fe=e.doc.height+Cr(R),ge=r.topfe-L;if(r.topM+G){var Ye=Math.min(r.top,(we?fe:r.bottom)-G);Ye!=M&&(ue.scrollTop=Ye)}var qe=e.options.fixedGutter?0:R.gutters.offsetWidth,vt=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:R.scroller.scrollLeft-qe,ft=pr(e)-R.gutters.offsetWidth,Ot=r.right-r.left>ft;return Ot&&(r.right=r.left+ft),r.left<10?ue.scrollLeft=0:r.leftft+vt-3&&(ue.scrollLeft=r.right+(Ot?0:10)-ft),ue}function Ia(e,r){if(r==null)return;no(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+r}function Mr(e){no(e);var r=e.getCursor();e.curOp.scrollToPos={from:r,to:r,margin:e.options.cursorScrollMargin}}function Na(e,r,R){(r!=null||R!=null)&&no(e),r!=null&&(e.curOp.scrollLeft=r),R!=null&&(e.curOp.scrollTop=R)}function Qs(e,r){no(e),e.curOp.scrollToPos=r}function no(e){var r=e.curOp.scrollToPos;if(r){e.curOp.scrollToPos=null;var R=or(e,r.from),L=or(e,r.to);Wo(e,R,L,r.margin)}}function Wo(e,r,R,L){var M=Ji(e,{left:Math.min(r.left,R.left),top:Math.min(r.top,R.top)-L,right:Math.max(r.right,R.right),bottom:Math.max(r.bottom,R.bottom)+L});Na(e,M.scrollLeft,M.scrollTop)}function Ua(e,r){if(Math.abs(e.doc.scrollTop-r)<2)return;j||_o(e,{top:r}),Ho(e,r,!0),j&&_o(e),Fa(e,100)}function Ho(e,r,R){if(r=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,r)),e.display.scroller.scrollTop==r&&!R)return;e.doc.scrollTop=r,e.display.scrollbars.setScrollTop(r),e.display.scroller.scrollTop!=r&&(e.display.scroller.scrollTop=r)}function va(e,r,R,L){if(r=Math.max(0,Math.min(r,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(R?r==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-r)<2)&&!L)return;e.doc.scrollLeft=r,Xo(e),e.display.scroller.scrollLeft!=r&&(e.display.scroller.scrollLeft=r),e.display.scrollbars.setScrollLeft(r)}function ja(e){var r=e.display,R=r.gutters.offsetWidth,L=Math.round(e.doc.height+Cr(e.display));return{clientHeight:r.scroller.clientHeight,viewHeight:r.wrapper.clientHeight,scrollWidth:r.scroller.scrollWidth,clientWidth:r.scroller.clientWidth,viewWidth:r.wrapper.clientWidth,barLeft:e.options.fixedGutter?R:0,docHeight:L,scrollHeight:L+lr(e)+r.barHeight,nativeBarWidth:r.nativeBarWidth,gutterWidth:R}}var ya=function(e,r,R){this.cm=R;var L=this.vert=S("div",[S("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),M=this.horiz=S("div",[S("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");L.tabIndex=M.tabIndex=-1,e(L),e(M),je(L,"scroll",function(){L.clientHeight&&r(L.scrollTop,"vertical")}),je(M,"scroll",function(){M.clientWidth&&r(M.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,T&&C<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};ya.prototype.update=function(e){var r=e.scrollWidth>e.clientWidth+1,R=e.scrollHeight>e.clientHeight+1,L=e.nativeBarWidth;if(R){this.vert.style.display="block",this.vert.style.bottom=r?L+"px":"0";var M=e.viewHeight-(r?L:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+M)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(r){this.horiz.style.display="block",this.horiz.style.right=R?L+"px":"0",this.horiz.style.left=e.barLeft+"px";var G=e.viewWidth-e.barLeft-(R?L:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+G)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(L==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:R?L:0,bottom:r?L:0}},ya.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},ya.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},ya.prototype.zeroWidthHack=function(){var e=t&&!d?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new ne,this.disableVert=new ne},ya.prototype.enableZeroWidthBar=function(e,r,R){e.style.pointerEvents="auto";function L(){var M=e.getBoundingClientRect(),G=R=="vert"?document.elementFromPoint(M.right-1,(M.top+M.bottom)/2):document.elementFromPoint((M.right+M.left)/2,M.bottom-1);G!=e?e.style.pointerEvents="none":r.set(1e3,L)}r.set(1e3,L)},ya.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Ba=function(){};Ba.prototype.update=function(){return{bottom:0,right:0}},Ba.prototype.setScrollLeft=function(){},Ba.prototype.setScrollTop=function(){},Ba.prototype.clear=function(){};function Sa(e,r){r||(r=ja(e));var R=e.display.barWidth,L=e.display.barHeight;zo(e,r);for(var M=0;M<4&&R!=e.display.barWidth||L!=e.display.barHeight;M++)R!=e.display.barWidth&&e.options.lineWrapping&&aa(e),zo(e,ja(e)),R=e.display.barWidth,L=e.display.barHeight}function zo(e,r){var R=e.display,L=R.scrollbars.update(r);R.sizer.style.paddingRight=(R.barWidth=L.right)+"px",R.sizer.style.paddingBottom=(R.barHeight=L.bottom)+"px",R.heightForcer.style.borderBottom=L.bottom+"px solid transparent",L.right&&L.bottom?(R.scrollbarFiller.style.display="block",R.scrollbarFiller.style.height=L.bottom+"px",R.scrollbarFiller.style.width=L.right+"px"):R.scrollbarFiller.style.display="",L.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(R.gutterFiller.style.display="block",R.gutterFiller.style.height=L.bottom+"px",R.gutterFiller.style.width=r.gutterWidth+"px"):R.gutterFiller.style.display=""}var Ko={native:ya,null:Ba};function Go(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&y(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Ko[e.options.scrollbarStyle](function(r){e.display.wrapper.insertBefore(r,e.display.scrollbarFiller),je(r,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),r.setAttribute("cm-not-content","true")},function(r,R){R=="horizontal"?va(e,r):Ua(e,r)},e),e.display.scrollbars.addClass&&B(e.display.wrapper,e.display.scrollbars.addClass)}var Zs=0;function ba(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Zs},zn(e.curOp)}function _a(e){var r=e.curOp;r&&ct(r,function(R){for(var L=0;L=R.viewTo)||R.maxLineChanged&&r.options.lineWrapping,e.update=e.mustUpdate&&new ro(r,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function nl(e){e.updatedDisplay=e.mustUpdate&&bo(e.cm,e.update)}function rl(e){var r=e.cm,R=r.display;e.updatedDisplay&&aa(r),e.barMeasure=ja(r),R.maxLineChanged&&!r.options.lineWrapping&&(e.adjustWidthTo=Gt(r,R.maxLine,R.maxLine.text.length).left+3,r.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(R.scroller.clientWidth,R.sizer.offsetLeft+e.adjustWidthTo+lr(r)+r.display.barWidth),e.maxScrollLeft=Math.max(0,R.sizer.offsetLeft+e.adjustWidthTo-pr(r))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=R.input.prepareSelection())}function il(e){var r=e.cm;e.adjustWidthTo!=null&&(r.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft=e.display.viewTo)return;var R=+new Date+e.options.workTime,L=it(e,r.highlightFrontier),M=[];r.iter(L.line,Math.min(r.first+r.size,e.display.viewTo+500),function(G){if(L.line>=e.display.viewFrom){var ue=G.styles,fe=G.text.length>e.options.maxHighlightLength?Zt(r.mode,L.state):null,ge=$e(e,G,L,!0);fe&&(L.state=fe),G.styles=ge.styles;var we=G.styleClasses,Ye=ge.classes;Ye?G.styleClasses=Ye:we&&(G.styleClasses=null);for(var qe=!ue||ue.length!=G.styles.length||we!=Ye&&(!we||!Ye||we.bgClass!=Ye.bgClass||we.textClass!=Ye.textClass),vt=0;!qe&&vtR)return Fa(e,e.options.workDelay),!0}),r.highlightFrontier=L.line,r.modeFrontier=Math.max(r.modeFrontier,L.line),M.length&&Ri(e,function(){for(var G=0;G=R.viewFrom&&r.visible.to<=R.viewTo&&(R.updateLineNumbers==null||R.updateLineNumbers>=R.viewTo)&&R.renderedView==R.view&&Wn(e)==0)return!1;Yo(e)&&(wi(e),r.dims=Tn(e));var M=L.first+L.size,G=Math.max(r.visible.from-e.options.viewportMargin,L.first),ue=Math.min(M,r.visible.to+e.options.viewportMargin);R.viewFromue&&R.viewTo-ue<20&&(ue=Math.min(M,R.viewTo)),Ar&&(G=Li(e.doc,G),ue=qi(e.doc,ue));var fe=G!=R.viewFrom||ue!=R.viewTo||R.lastWrapHeight!=r.wrapperHeight||R.lastWrapWidth!=r.wrapperWidth;Ki(e,G,ue),R.viewOffset=li(Z(e.doc,R.viewFrom)),e.display.mover.style.top=R.viewOffset+"px";var ge=Wn(e);if(!fe&&ge==0&&!r.force&&R.renderedView==R.view&&(R.updateLineNumbers==null||R.updateLineNumbers>=R.viewTo))return!1;var we=ll(e);return ge>4&&(R.lineDiv.style.display="none"),cl(e,R.updateLineNumbers,r.dims),ge>4&&(R.lineDiv.style.display=""),R.renderedView=R.view,ul(we),x(R.cursorDiv),x(R.selectionDiv),R.gutters.style.height=R.sizer.style.minHeight=0,fe&&(R.lastWrapHeight=r.wrapperHeight,R.lastWrapWidth=r.wrapperWidth,Fa(e,400)),R.updateLineNumbers=null,!0}function Vo(e,r){for(var R=r.viewport,L=!0;;L=!1){if(!L||!e.options.lineWrapping||r.oldDisplayWidth==pr(e)){if(R&&R.top!=null&&(R={top:Math.min(e.doc.height+Cr(e.display)-Er(e),R.top)}),r.visible=Fi(e.display,e.doc,R),r.visible.from>=e.display.viewFrom&&r.visible.to<=e.display.viewTo)break}else L&&(r.visible=Fi(e.display,e.doc,R));if(!bo(e,r))break;aa(e);var M=ja(e);Sn(e),Sa(e,M),xo(e,M),r.force=!1}r.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(r.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function _o(e,r){var R=new ro(e,r);if(bo(e,R)){aa(e),Vo(e,R);var L=ja(e);Sn(e),Sa(e,L),xo(e,L),R.finish()}}function cl(e,r,R){var L=e.display,M=e.options.lineNumbers,G=L.lineDiv,ue=G.firstChild;function fe(Ot){var Ut=Ot.nextSibling;return c&&t&&e.display.currentWheelTarget==Ot?Ot.style.display="none":Ot.parentNode.removeChild(Ot),Ut}for(var ge=L.view,we=L.viewFrom,Ye=0;Ye-1&&(ft=!1),fn(e,qe,we,R)),ft&&(x(qe.lineNumber),qe.lineNumber.appendChild(document.createTextNode(Nt(e.options,we)))),ue=qe.node.nextSibling}we+=qe.size}for(;ue;)ue=fe(ue)}function Eo(e){var r=e.gutters.offsetWidth;e.sizer.style.marginLeft=r+"px"}function xo(e,r){e.display.sizer.style.minHeight=r.docHeight+"px",e.display.heightForcer.style.top=r.docHeight+"px",e.display.gutters.style.height=r.docHeight+e.display.barHeight+lr(e)+"px"}function Xo(e){var r=e.display,R=r.view;if(!r.alignWidgets&&(!r.gutters.firstChild||!e.options.fixedGutter))return;for(var L=nr(r)-r.scroller.scrollLeft+e.doc.scrollLeft,M=r.gutters.offsetWidth,G=L+"px",ue=0;ueue.clientWidth,ge=ue.scrollHeight>ue.clientHeight;if(!(L&&fe||M&&ge))return;if(M&&t&&c){e:for(var we=r.target,Ye=G.view;we!=ue;we=we.parentNode)for(var qe=0;qe=0&&Mt(e,L.to())<=0)return R}return-1};var yr=function(e,r){this.anchor=e,this.head=r};yr.prototype.from=function(){return an(this.anchor,this.head)},yr.prototype.to=function(){return cn(this.anchor,this.head)},yr.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Xi(e,r,R){var L=e&&e.options.selectionsMayTouch,M=r[R];r.sort(function(vt,ft){return Mt(vt.from(),ft.from())}),R=$(r,M);for(var G=1;G0:ge>=0){var we=an(fe.from(),ue.from()),Ye=cn(fe.to(),ue.to()),qe=fe.empty()?ue.from()==ue.head:fe.from()==fe.head;G<=R&&--R,r.splice(--G,2,new yr(qe?Ye:we,qe?we:Ye))}}return new Ni(r,R)}function la(e,r){return new Ni([new yr(e,r||e)],0)}function ua(e){return e.text?ht(e.from.line+e.text.length-1,Ke(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function qo(e,r){if(Mt(e,r.from)<0)return e;if(Mt(e,r.to)<=0)return ua(r);var R=e.line+r.text.length-(r.to.line-r.from.line)-1,L=e.ch;return e.line==r.to.line&&(L+=ua(r).ch-r.to.ch),ht(R,L)}function wo(e,r){for(var R=[],L=0;L1&&e.remove(fe.line+1,Ot-1),e.insert(fe.line+1,$t)}It(e,"change",e,r)}function ca(e,r,R){function L(M,G,ue){if(M.linked)for(var fe=0;fe1&&!e.done[e.done.length-2].ranges)return e.done.pop(),Ke(e.done)}function is(e,r,R,L){var M=e.history;M.undone.length=0;var G=+new Date,ue,fe;if((M.lastOp==L||M.lastOrigin==r.origin&&r.origin&&(r.origin.charAt(0)=="+"&&M.lastModTime>G-(e.cm?e.cm.options.historyEventDelay:500)||r.origin.charAt(0)=="*"))&&(ue=ml(M,M.lastOp==L)))fe=Ke(ue.changes),Mt(r.from,r.to)==0&&Mt(r.from,fe.to)==0?fe.to=ua(r):ue.changes.push(Ao(e,r));else{var ge=Ke(M.done);for((!ge||!ge.ranges)&&oo(e.sel,M.done),ue={changes:[Ao(e,r)],generation:M.generation},M.done.push(ue);M.done.length>M.undoDepth;)M.done.shift(),M.done[0].ranges||M.done.shift()}M.done.push(R),M.generation=++M.maxGeneration,M.lastModTime=M.lastSelTime=G,M.lastOp=M.lastSelOp=L,M.lastOrigin=M.lastSelOrigin=r.origin,fe||Qe(e,"historyAdded")}function gl(e,r,R,L){var M=r.charAt(0);return M=="*"||M=="+"&&R.ranges.length==L.ranges.length&&R.somethingSelected()==L.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function vl(e,r,R,L){var M=e.history,G=L&&L.origin;R==M.lastSelOp||G&&M.lastSelOrigin==G&&(M.lastModTime==M.lastSelTime&&M.lastOrigin==G||gl(e,G,Ke(M.done),r))?M.done[M.done.length-1]=r:oo(r,M.done),M.lastSelTime=+new Date,M.lastSelOrigin=G,M.lastSelOp=R,L&&L.clearRedo!==!1&&rs(M.undone)}function oo(e,r){var R=Ke(r);R&&R.ranges&&R.equals(e)||r.push(e)}function as(e,r,R,L){var M=r["spans_"+e.id],G=0;e.iter(Math.max(e.first,R),Math.min(e.first+e.size,L),function(ue){ue.markedSpans&&((M||(M=r["spans_"+e.id]={}))[G]=ue.markedSpans),++G})}function yl(e){if(!e)return null;for(var r,R=0;R-1&&(Ke(fe)[qe]=we[qe],delete we[qe]))}}return L}function Oo(e,r,R,L){if(L){var M=e.anchor;if(R){var G=Mt(r,M)<0;G!=Mt(R,M)<0?(M=r,r=R):G!=Mt(r,R)<0&&(r=R)}return new yr(M,r)}else return new yr(R||r,r)}function so(e,r,R,L,M){M==null&&(M=e.cm&&(e.cm.display.shift||e.extend)),fi(e,new Ni([Oo(e.sel.primary(),r,R,M)],0),L)}function ss(e,r,R){for(var L=[],M=e.cm&&(e.cm.display.shift||e.extend),G=0;G=r.ch:fe.to>r.ch))){if(M&&(Qe(ge,"beforeCursorEnter"),ge.explicitlyCleared))if(G.markedSpans){--ue;continue}else break;if(!ge.atomic)continue;if(R){var qe=ge.find(L<0?1:-1),vt=void 0;if((L<0?Ye:we)&&(qe=fs(e,qe,-L,qe&&qe.line==r.line?G:null)),qe&&qe.line==r.line&&(vt=Mt(qe,R))&&(L<0?vt<0:vt>0))return Ca(e,qe,r,L,M)}var ft=ge.find(L<0?-1:1);return(L<0?we:Ye)&&(ft=fs(e,ft,L,ft.line==r.line?G:null)),ft?Ca(e,ft,r,L,M):null}}return r}function uo(e,r,R,L,M){var G=L||1,ue=Ca(e,r,R,G,M)||!M&&Ca(e,r,R,G,!0)||Ca(e,r,R,-G,M)||!M&&Ca(e,r,R,-G,!0);return ue||(e.cantEdit=!0,ht(e.first,0))}function fs(e,r,R,L){return R<0&&r.ch==0?r.line>e.first?N(e,ht(r.line-1)):null:R>0&&r.ch==(L||Z(e,r.line)).text.length?r.line=0;--M)gs(e,{from:L[M].from,to:L[M].to,text:M?[""]:r.text,origin:r.origin});else gs(e,r)}function gs(e,r){if(r.text.length==1&&r.text[0]==""&&Mt(r.from,r.to)==0)return;var R=wo(e,r);is(e,r,R,e.cm?e.cm.curOp.id:NaN),za(e,r,R,Pr(e,r));var L=[];ca(e,function(M,G){!G&&$(L,M.history)==-1&&(_s(M.history,r),L.push(M.history)),za(M,r,null,Pr(M,r))})}function co(e,r,R){var L=e.cm&&e.cm.state.suppressEdits;if(L&&!R)return;for(var M=e.history,G,ue=e.sel,fe=r=="undo"?M.done:M.undone,ge=r=="undo"?M.undone:M.done,we=0;we=0;--ft){var Ot=vt(ft);if(Ot)return Ot.v}}function vs(e,r){if(r==0)return;if(e.first+=r,e.sel=new Ni(Ne(e.sel.ranges,function(M){return new yr(ht(M.anchor.line+r,M.anchor.ch),ht(M.head.line+r,M.head.ch))}),e.sel.primIndex),e.cm){jr(e.cm,e.first,e.first-r,r);for(var R=e.cm.display,L=R.viewFrom;Le.lastLine())return;if(r.from.lineG&&(r={from:r.from,to:ht(G,Z(e,G).text.length),text:[r.text[0]],origin:r.origin}),r.removed=oe(e,r.from,r.to),R||(R=wo(e,r)),e.cm?El(e.cm,r,L):To(e,r,L),lo(e,R,de),e.cantEdit&&uo(e,ht(e.firstLine(),0))&&(e.cantEdit=!1)}function El(e,r,R){var L=e.doc,M=e.display,G=r.from,ue=r.to,fe=!1,ge=G.line;e.options.lineWrapping||(ge=Je(Ur(Z(L,G.line))),L.iter(ge,ue.line+1,function(ft){if(ft==M.maxLine)return fe=!0,!0})),L.sel.contains(r.from,r.to)>-1&&Fe(e),To(L,r,R,sr(e)),e.options.lineWrapping||(L.iter(ge,G.line+r.text.length,function(ft){var Ot=Wi(ft);Ot>M.maxLineLength&&(M.maxLine=ft,M.maxLineLength=Ot,M.maxLineChanged=!0,fe=!1)}),fe&&(e.curOp.updateMaxLine=!0)),ur(L,G.line),Fa(e,400);var we=r.text.length-(ue.line-G.line)-1;r.full?jr(e):G.line==ue.line&&r.text.length==1&&!es(e.doc,r)?Jr(e,G.line,"text"):jr(e,G.line,ue.line+1,we);var Ye=Ie(e,"changes"),qe=Ie(e,"change");if(qe||Ye){var vt={from:G,to:ue,text:r.text,removed:r.removed,origin:r.origin};qe&&It(e,"change",e,vt),Ye&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(vt)}e.display.selForContextMenu=null}function Aa(e,r,R,L,M){var G;L||(L=R),Mt(L,R)<0&&(G=[L,R],R=G[0],L=G[1]),typeof r=="string"&&(r=e.splitLines(r)),Ta(e,{from:R,to:L,text:r,origin:M})}function ys(e,r,R,L){R1||!(this.children[0]instanceof Ga))){var fe=[];this.collapse(fe),this.children=[new Ga(fe)],this.children[0].parent=this}},collapse:function(e){for(var r=0;r50){for(var ue=M.lines.length%25+25,fe=ue;fe10);e.parent.maybeSpill()},iterN:function(e,r,R){for(var L=0;Le.display.maxLineLength&&(e.display.maxLine=we,e.display.maxLineLength=Ye,e.display.maxLineChanged=!0)}L!=null&&e&&this.collapsed&&jr(e,L,M+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&ds(e.doc)),e&&It(e,"markerCleared",e,this,L,M),r&&_a(e),this.parent&&this.parent.clear()},da.prototype.find=function(e,r){e==null&&this.type=="bookmark"&&(e=1);for(var R,L,M=0;M0||ue==0&&G.clearWhenEmpty!==!1)return G;if(G.replacedWith&&(G.collapsed=!0,G.widgetNode=O("span",[G.replacedWith],"CodeMirror-widget"),L.handleMouseEvents||G.widgetNode.setAttribute("cm-ignore-events","true"),L.insertLeft&&(G.widgetNode.insertLeft=!0)),G.collapsed){if(Nr(e,r.line,r,R,G)||r.line!=R.line&&Nr(e,R.line,r,R,G))throw new Error("Inserting collapsed marker partially overlapping an existing one");br()}G.addToHistory&&is(e,{from:r,to:R,origin:"markText"},e.sel,NaN);var fe=r.line,ge=e.cm,we;if(e.iter(fe,R.line+1,function(qe){ge&&G.collapsed&&!ge.options.lineWrapping&&Ur(qe)==ge.display.maxLine&&(we=!0),G.collapsed&&fe!=r.line&&Oe(qe,0),gr(qe,new Xr(G,fe==r.line?r.ch:null,fe==R.line?R.ch:null)),++fe}),G.collapsed&&e.iter(r.line,R.line+1,function(qe){xi(e,qe)&&Oe(qe,0)}),G.clearOnEnter&&je(G,"beforeCursorEnter",function(){return G.clear()}),G.readOnly&&(fr(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),G.collapsed&&(G.id=++xs,G.atomic=!0),ge){if(we&&(ge.curOp.updateMaxLine=!0),G.collapsed)jr(ge,r.line,R.line+1);else if(G.className||G.startStyle||G.endStyle||G.css||G.attributes||G.title)for(var Ye=r.line;Ye<=R.line;Ye++)Jr(ge,Ye,"text");G.atomic&&ds(ge.doc),It(ge,"markerAdded",ge,G)}return G}var Ya=function(e,r){this.markers=e,this.primary=r;for(var R=0;R=0;ge--)Ta(this,L[ge]);fe?us(this,fe):this.cm&&Mr(this.cm)}),undo:ii(function(){co(this,"undo")}),redo:ii(function(){co(this,"redo")}),undoSelection:ii(function(){co(this,"undo",!0)}),redoSelection:ii(function(){co(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,r=0,R=0,L=0;L=e.ch)&&r.push(M.marker.parent||M.marker)}return r},findMarks:function(e,r,R){e=N(this,e),r=N(this,r);var L=[],M=e.line;return this.iter(e.line,r.line+1,function(G){var ue=G.markedSpans;if(ue)for(var fe=0;fe=ge.to||ge.from==null&&M!=e.line||ge.from!=null&&M==r.line&&ge.from>=r.ch)&&(!R||R(ge.marker))&&L.push(ge.marker.parent||ge.marker)}++M}),L},getAllMarks:function(){var e=[];return this.iter(function(r){var R=r.markedSpans;if(R)for(var L=0;Le)return r=e,!0;e-=G,++R}),N(this,ht(R,r))},indexFromPos:function(e){e=N(this,e);var r=e.ch;if(e.liner&&(r=e.from),e.to!=null&&e.to-1){r.state.draggingText(e),setTimeout(function(){return r.display.input.focus()},20);return}try{var Ye=e.dataTransfer.getData("Text");if(Ye){var qe;if(r.state.draggingText&&!r.state.draggingText.copy&&(qe=r.listSelections()),lo(r.doc,la(R,R)),qe)for(var vt=0;vt=0;fe--)Aa(e.doc,"",L[fe].from,L[fe].to,"+delete");Mr(e)})}function Ro(e,r,R){var L=U(e.text,r+R,R);return L<0||L>e.text.length?null:L}function Do(e,r,R){var L=Ro(e,r.ch,R);return L==null?null:new ht(r.line,L,R<0?"after":"before")}function Po(e,r,R,L,M){if(e){r.doc.direction=="rtl"&&(M=-M);var G=dt(R,r.doc.direction);if(G){var ue=M<0?Ke(G):G[0],fe=M<0==(ue.level==1),ge=fe?"after":"before",we;if(ue.level>0||r.doc.direction=="rtl"){var Ye=tr(r,R);we=M<0?R.text.length-1:0;var qe=ar(r,Ye,we).top;we=q(function(vt){return ar(r,Ye,vt).top==qe},M<0==(ue.level==1)?ue.from:ue.to-1,we),ge=="before"&&(we=Ro(R,we,1))}else we=M<0?ue.to:ue.from;return new ht(L,we,ge)}}return new ht(L,M<0?R.text.length:0,M<0?"before":"after")}function Il(e,r,R,L){var M=dt(r,e.doc.direction);if(!M)return Do(r,R,L);R.ch>=r.text.length?(R.ch=r.text.length,R.sticky="before"):R.ch<=0&&(R.ch=0,R.sticky="after");var G=xe(M,R.ch,R.sticky),ue=M[G];if(e.doc.direction=="ltr"&&ue.level%2==0&&(L>0?ue.to>R.ch:ue.from=ue.from&&vt>=Ye.begin)){var ft=qe?"before":"after";return new ht(R.line,vt,ft)}}var Ot=function($t,rn,Jt){for(var un=function(Or,ai){return ai?new ht(R.line,fe(Or,1),"before"):new ht(R.line,Or,"after")};$t>=0&&$t0==(An.level!=1),Qn=_n?Jt.begin:fe(Jt.end,-1);if(An.from<=Qn&&Qn0?Ye.end:fe(Ye.begin,-1);return Wt!=null&&!(L>0&&Wt==r.text.length)&&(Ut=Ot(L>0?0:M.length-1,L,we(Wt)),Ut)?Ut:null}var Qa={selectAll:ps,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),de)},killLine:function(e){return Ra(e,function(r){if(r.empty()){var R=Z(e.doc,r.head.line).text.length;return r.head.ch==R&&r.head.line0)M=new ht(M.line,M.ch+1),e.replaceRange(G.charAt(M.ch-1)+G.charAt(M.ch-2),ht(M.line,M.ch-2),M,"+transpose");else if(M.line>e.doc.first){var ue=Z(e.doc,M.line-1).text;ue&&(M=new ht(M.line,1),e.replaceRange(G.charAt(0)+e.doc.lineSeparator()+ue.charAt(ue.length-1),ht(M.line-1,ue.length-1),M,"+transpose"))}}R.push(new yr(M,M))}e.setSelections(R)})},newlineAndIndent:function(e){return Ri(e,function(){for(var r=e.listSelections(),R=r.length-1;R>=0;R--)e.replaceRange(e.doc.lineSeparator(),r[R].anchor,r[R].head,"+input");r=e.listSelections();for(var L=0;Le&&Mt(r,this.pos)==0&&R==this.button};var Za,eo;function Hl(e,r){var R=+new Date;return eo&&eo.compare(R,e,r)?(Za=eo=null,"triple"):Za&&Za.compare(R,e,r)?(eo=new Mo(R,e,r),Za=null,"double"):(Za=new Mo(R,e,r),eo=null,"single")}function js(e){var r=this,R=r.display;if(Xe(r,e)||R.activeTouch&&R.input.supportsTouch())return;if(R.input.ensurePolled(),R.shift=e.shiftKey,Pn(R,e)){c||(R.scroller.draggable=!1,setTimeout(function(){return R.scroller.draggable=!0},100));return}if(Io(r,e))return;var L=Nn(r,e),M=ut(e),G=L?Hl(L,M):"single";if(window.focus(),M==1&&r.state.selectingText&&r.state.selectingText(e),L&&zl(r,M,L,G,e))return;M==1?L?Gl(r,L,G,e):Ze(e)==R.scroller&&Ee(e):M==2?(L&&so(r.doc,L),setTimeout(function(){return R.input.focus()},20)):M==3&&(E?r.display.input.onContextMenu(e):ga(r))}function zl(e,r,R,L,M){var G="Click";return L=="double"?G="Double"+G:L=="triple"&&(G="Triple"+G),G=(r==1?"Left":r==2?"Middle":"Right")+G,qa(e,Ls(G,M),M,function(ue){if(typeof ue=="string"&&(ue=Qa[ue]),!ue)return!1;var fe=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),fe=ue(e,R)!=ce}finally{e.state.suppressEdits=!1}return fe})}function Kl(e,r,R){var L=e.getOption("configureMouse"),M=L?L(e,r,R):{};if(M.unit==null){var G=h?R.shiftKey&&R.metaKey:R.altKey;M.unit=G?"rectangle":r=="single"?"char":r=="double"?"word":"line"}return(M.extend==null||e.doc.extend)&&(M.extend=e.doc.extend||R.shiftKey),M.addNew==null&&(M.addNew=t?R.metaKey:R.ctrlKey),M.moveOnDrag==null&&(M.moveOnDrag=!(t?R.altKey:R.ctrlKey)),M}function Gl(e,r,R,L){T?setTimeout(W(Gr,e),0):e.curOp.focus=I();var M=Kl(e,R,L),G=e.doc.sel,ue;e.options.dragDrop&&Tt&&!e.isReadOnly()&&R=="single"&&(ue=G.contains(r))>-1&&(Mt((ue=G.ranges[ue]).from(),r)<0||r.xRel>0)&&(Mt(ue.to(),r)>0||r.xRel<0)?Vl(e,L,r,M):Xl(e,L,r,M)}function Vl(e,r,R,L){var M=e.display,G=!1,ue=ri(e,function(we){c&&(M.scroller.draggable=!1),e.state.draggingText=!1,mt(M.wrapper.ownerDocument,"mouseup",ue),mt(M.wrapper.ownerDocument,"mousemove",fe),mt(M.scroller,"dragstart",ge),mt(M.scroller,"drop",ue),G||(Ee(we),L.addNew||so(e.doc,R,null,null,L.extend),c&&!a||T&&C==9?setTimeout(function(){M.wrapper.ownerDocument.body.focus({preventScroll:!0}),M.input.focus()},20):M.input.focus())}),fe=function(we){G=G||Math.abs(r.clientX-we.clientX)+Math.abs(r.clientY-we.clientY)>=10},ge=function(){return G=!0};c&&(M.scroller.draggable=!0),e.state.draggingText=ue,ue.copy=!L.moveOnDrag,M.scroller.dragDrop&&M.scroller.dragDrop(),je(M.wrapper.ownerDocument,"mouseup",ue),je(M.wrapper.ownerDocument,"mousemove",fe),je(M.scroller,"dragstart",ge),je(M.scroller,"drop",ue),ga(e),setTimeout(function(){return M.input.focus()},20)}function Bs(e,r,R){if(R=="char")return new yr(r,r);if(R=="word")return e.findWordAt(r);if(R=="line")return new yr(ht(r.line,0),N(e.doc,ht(r.line+1,0)));var L=R(e,r);return new yr(L.from,L.to)}function Xl(e,r,R,L){var M=e.display,G=e.doc;Ee(r);var ue,fe,ge=G.sel,we=ge.ranges;if(L.addNew&&!L.extend?(fe=G.sel.contains(R),fe>-1?ue=we[fe]:ue=new yr(R,R)):(ue=G.sel.primary(),fe=G.sel.primIndex),L.unit=="rectangle")L.addNew||(ue=new yr(R,R)),R=Nn(e,r,!0,!0),fe=-1;else{var Ye=Bs(e,R,L.unit);L.extend?ue=Oo(ue,Ye.anchor,Ye.head,L.extend):ue=Ye}L.addNew?fe==-1?(fe=we.length,fi(G,Xi(e,we.concat([ue]),fe),{scroll:!1,origin:"*mouse"})):we.length>1&&we[fe].empty()&&L.unit=="char"&&!L.extend?(fi(G,Xi(e,we.slice(0,fe).concat(we.slice(fe+1)),0),{scroll:!1,origin:"*mouse"}),ge=G.sel):Lo(G,fe,ue,Ce):(fe=0,fi(G,new Ni([ue],0),Ce),ge=G.sel);var qe=R;function vt(Jt){if(Mt(qe,Jt)==0)return;if(qe=Jt,L.unit=="rectangle"){for(var un=[],An=e.options.tabSize,_n=X(Z(G,R.line).text,R.ch,An),Qn=X(Z(G,Jt.line).text,Jt.ch,An),Or=Math.min(_n,Qn),ai=Math.max(_n,Qn),Br=Math.min(R.line,Jt.line),Di=Math.min(e.lastLine(),Math.max(R.line,Jt.line));Br<=Di;Br++){var Ti=Z(G,Br).text,Qr=De(Ti,Or,An);Or==ai?un.push(new yr(ht(Br,Qr),ht(Br,Qr))):Ti.length>Qr&&un.push(new yr(ht(Br,Qr),ht(Br,De(Ti,ai,An))))}un.length||un.push(new yr(R,R)),fi(G,Xi(e,ge.ranges.slice(0,fe).concat(un),fe),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Jt)}else{var Ai=ue,ci=Bs(e,Jt,L.unit),ti=Ai.anchor,qr;Mt(ci.anchor,ti)>0?(qr=ci.head,ti=an(Ai.from(),ci.anchor)):(qr=ci.anchor,ti=cn(Ai.to(),ci.head));var zr=ge.ranges.slice(0);zr[fe]=Yl(e,new yr(N(G,ti),qr)),fi(G,Xi(e,zr,fe),Ce)}}var ft=M.wrapper.getBoundingClientRect(),Ot=0;function Ut(Jt){var un=++Ot,An=Nn(e,Jt,!0,L.unit=="rectangle");if(!An)return;if(Mt(An,qe)!=0){e.curOp.focus=I(),vt(An);var _n=Fi(M,G);(An.line>=_n.to||An.line<_n.from)&&setTimeout(ri(e,function(){Ot==un&&Ut(Jt)}),150)}else{var Qn=Jt.clientYft.bottom?20:0;Qn&&setTimeout(ri(e,function(){if(Ot!=un)return;M.scroller.scrollTop+=Qn,Ut(Jt)}),50)}}function Wt(Jt){e.state.selectingText=!1,Ot=Infinity,Jt&&(Ee(Jt),M.input.focus()),mt(M.wrapper.ownerDocument,"mousemove",$t),mt(M.wrapper.ownerDocument,"mouseup",rn),G.history.lastSelOrigin=null}var $t=ri(e,function(Jt){Jt.buttons===0||!ut(Jt)?Wt(Jt):Ut(Jt)}),rn=ri(e,Wt);e.state.selectingText=rn,je(M.wrapper.ownerDocument,"mousemove",$t),je(M.wrapper.ownerDocument,"mouseup",rn)}function Yl(e,r){var R=r.anchor,L=r.head,M=Z(e.doc,R.line);if(Mt(R,L)==0&&R.sticky==L.sticky)return r;var G=dt(M);if(!G)return r;var ue=xe(G,R.ch,R.sticky),fe=G[ue];if(fe.from!=R.ch&&fe.to!=R.ch)return r;var ge=ue+(fe.from==R.ch==(fe.level!=1)?0:1);if(ge==0||ge==G.length)return r;var we;if(L.line!=R.line)we=(L.line-R.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var Ye=xe(G,L.ch,L.sticky),qe=Ye-ue||(L.ch-R.ch)*(fe.level==1?-1:1);Ye==ge-1||Ye==ge?we=qe<0:we=qe>0}var vt=G[ge+(we?-1:0)],ft=we==(vt.level==1),Ot=ft?vt.from:vt.to,Ut=ft?"after":"before";return R.ch==Ot&&R.sticky==Ut?r:new yr(new ht(R.line,Ot,Ut),L)}function Fs(e,r,R,L){var M,G;if(r.touches)M=r.touches[0].clientX,G=r.touches[0].clientY;else try{M=r.clientX,G=r.clientY}catch(vt){return!1}if(M>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;L&&Ee(r);var ue=e.display,fe=ue.lineDiv.getBoundingClientRect();if(G>fe.bottom||!Ie(e,R))return Le(r);G-=fe.top-ue.viewOffset;for(var ge=0;ge=M){var Ye=lt(e.doc,G),qe=e.display.gutterSpecs[ge];return Qe(e,R,e,Ye,qe.className,r),Le(r)}}}function Io(e,r){return Fs(e,r,"gutterClick",!0)}function Ws(e,r){if(Pn(e.display,r)||$l(e,r))return;if(Xe(e,r,"contextmenu"))return;E||e.display.input.onContextMenu(r)}function $l(e,r){return Ie(e,"gutterContextMenu")?Fs(e,r,"gutterContextMenu",!1):!1}function Hs(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),en(e)}var Da={toString:function(){return"CodeMirror.Init"}},zs={},mo={};function Jl(e){var r=e.optionHandlers;function R(L,M,G,ue){e.defaults[L]=M,G&&(r[L]=ue?function(fe,ge,we){we!=Da&&G(fe,ge,we)}:G)}e.defineOption=R,e.Init=Da,R("value","",function(L,M){return L.setValue(M)},!0),R("mode",null,function(L,M){L.doc.modeOption=M,Co(L)},!0),R("indentUnit",2,Co,!0),R("indentWithTabs",!1),R("smartIndent",!0),R("tabSize",4,function(L){Ha(L),en(L),jr(L)},!0),R("lineSeparator",null,function(L,M){if(L.doc.lineSep=M,!M)return;var G=[],ue=L.doc.first;L.doc.iter(function(ge){for(var we=0;;){var Ye=ge.text.indexOf(M,we);if(Ye==-1)break;we=Ye+M.length,G.push(ht(ue,Ye))}ue++});for(var fe=G.length-1;fe>=0;fe--)Aa(L.doc,M,G[fe],ht(G[fe].line,G[fe].ch+M.length))}),R("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(L,M,G){L.state.specialChars=new RegExp(M.source+(M.test(" ")?"":"| "),"g"),G!=Da&&L.refresh()}),R("specialCharPlaceholder",dn,function(L){return L.refresh()},!0),R("electricChars",!0),R("inputStyle",n?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),R("spellcheck",!1,function(L,M){return L.getInputField().spellcheck=M},!0),R("autocorrect",!1,function(L,M){return L.getInputField().autocorrect=M},!0),R("autocapitalize",!1,function(L,M){return L.getInputField().autocapitalize=M},!0),R("rtlMoveVisually",!v),R("wholeLineUpdateBefore",!0),R("theme","default",function(L){Hs(L),Wa(L)},!0),R("keyMap","default",function(L,M,G){var ue=fo(M),fe=G!=Da&&fo(G);fe&&fe.detach&&fe.detach(L,ue),ue.attach&&ue.attach(L,fe||null)}),R("extraKeys",null),R("configureMouse",null),R("lineWrapping",!1,ql,!0),R("gutters",[],function(L,M){L.display.gutterSpecs=So(M,L.options.lineNumbers),Wa(L)},!0),R("fixedGutter",!0,function(L,M){L.display.gutters.style.left=M?nr(L.display)+"px":"0",L.refresh()},!0),R("coverGutterNextToScrollbar",!1,function(L){return Sa(L)},!0),R("scrollbarStyle","native",function(L){Go(L),Sa(L),L.display.scrollbars.setScrollTop(L.doc.scrollTop),L.display.scrollbars.setScrollLeft(L.doc.scrollLeft)},!0),R("lineNumbers",!1,function(L,M){L.display.gutterSpecs=So(L.options.gutters,M),Wa(L)},!0),R("firstLineNumber",1,Wa,!0),R("lineNumberFormatter",function(L){return L},Wa,!0),R("showCursorWhenSelecting",!1,Sn,!0),R("resetSelectionOnContextMenu",!0),R("lineWiseCopyCut",!0),R("pasteLinesPerSelection",!0),R("selectionsMayTouch",!1),R("readOnly",!1,function(L,M){M=="nocursor"&&(Bi(L),L.display.input.blur()),L.display.input.readOnlyChanged(M)}),R("screenReaderLabel",null,function(L,M){M=M===""?null:M,L.display.input.screenReaderLabelChanged(M)}),R("disableInput",!1,function(L,M){M||L.display.input.reset()},!0),R("dragDrop",!0,Ql),R("allowDropFileTypes",null),R("cursorBlinkRate",530),R("cursorScrollMargin",0),R("cursorHeight",1,Sn,!0),R("singleCursorHeightPerLine",!0,Sn,!0),R("workTime",100),R("workDelay",100),R("flattenSpans",!0,Ha,!0),R("addModeClass",!1,Ha,!0),R("pollInterval",100),R("undoDepth",200,function(L,M){return L.doc.history.undoDepth=M}),R("historyEventDelay",1250),R("viewportMargin",10,function(L){return L.refresh()},!0),R("maxHighlightLength",1e4,Ha,!0),R("moveInputWithCursor",!0,function(L,M){M||L.display.input.resetPosition()}),R("tabindex",null,function(L,M){return L.display.input.getField().tabIndex=M||""}),R("autofocus",null),R("direction","ltr",function(L,M){return L.doc.setDirection(M)},!0),R("phrases",null)}function Ql(e,r,R){var L=R&&R!=Da;if(!r!=!L){var M=e.display.dragFunctions,G=r?je:mt;G(e.display.scroller,"dragstart",M.start),G(e.display.scroller,"dragenter",M.enter),G(e.display.scroller,"dragover",M.over),G(e.display.scroller,"dragleave",M.leave),G(e.display.scroller,"drop",M.drop)}}function ql(e){e.options.lineWrapping?(B(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(y(e.display.wrapper,"CodeMirror-wrap"),Si(e)),Hr(e),jr(e),en(e),setTimeout(function(){return Sa(e)},100)}function Ir(e,r){var R=this;if(!(this instanceof Ir))return new Ir(e,r);this.options=r=r?V(r):{},V(zs,r,!1);var L=r.value;typeof L=="string"?L=new Ci(L,r.mode,null,r.lineSeparator,r.direction):r.mode&&(L.modeOption=r.mode),this.doc=L;var M=new Ir.inputStyles[r.inputStyle](this),G=this.display=new dl(e,L,M,r);G.wrapper.CodeMirror=this,Hs(this),r.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Go(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new ne,keySeq:null,specialChars:null},r.autofocus&&!n&&G.input.focus(),T&&C<11&&setTimeout(function(){return R.display.input.reset(!0)},20),Zl(this),Rl(),ba(this),this.curOp.forceUpdate=!0,ts(this,L),r.autofocus&&!n||this.hasFocus()?setTimeout(function(){R.hasFocus()&&!R.state.focused&&mn(R)},20):Bi(this);for(var ue in mo)mo.hasOwnProperty(ue)&&mo[ue](this,r[ue],Da);Yo(this),r.finishInit&&r.finishInit(this);for(var fe=0;fe20*20}je(r.scroller,"touchstart",function(ge){if(!Xe(e,ge)&&!G(ge)&&!Io(e,ge)){r.input.ensurePolled(),clearTimeout(R);var we=+new Date;r.activeTouch={start:we,moved:!1,prev:we-L.end<=300?L:null},ge.touches.length==1&&(r.activeTouch.left=ge.touches[0].pageX,r.activeTouch.top=ge.touches[0].pageY)}}),je(r.scroller,"touchmove",function(){r.activeTouch&&(r.activeTouch.moved=!0)}),je(r.scroller,"touchend",function(ge){var we=r.activeTouch;if(we&&!Pn(r,ge)&&we.left!=null&&!we.moved&&new Date-we.start<300){var Ye=e.coordsChar(r.activeTouch,"page"),qe;!we.prev||ue(we,we.prev)?qe=new yr(Ye,Ye):!we.prev.prev||ue(we,we.prev.prev)?qe=e.findWordAt(Ye):qe=new yr(ht(Ye.line,0),N(e.doc,ht(Ye.line+1,0))),e.setSelection(qe.anchor,qe.head),e.focus(),Ee(ge)}M()}),je(r.scroller,"touchcancel",M),je(r.scroller,"scroll",function(){r.scroller.clientHeight&&(Ua(e,r.scroller.scrollTop),va(e,r.scroller.scrollLeft,!0),Qe(e,"scroll",e))}),je(r.scroller,"mousewheel",function(ge){return Qo(e,ge)}),je(r.scroller,"DOMMouseScroll",function(ge){return Qo(e,ge)}),je(r.wrapper,"scroll",function(){return r.wrapper.scrollTop=r.wrapper.scrollLeft=0}),r.dragFunctions={enter:function(ge){Xe(e,ge)||Te(ge)},over:function(ge){Xe(e,ge)||(Ll(e,ge),Te(ge))},start:function(ge){return Ol(e,ge)},drop:ri(e,Al),leave:function(ge){Xe(e,ge)||Cs(e)}};var fe=r.input.getField();je(fe,"keyup",function(ge){return Ns.call(e,ge)}),je(fe,"keydown",ri(e,Is)),je(fe,"keypress",ri(e,Us)),je(fe,"focus",function(ge){return mn(e,ge)}),je(fe,"blur",function(ge){return Bi(e,ge)})}var No=[];Ir.defineInitHook=function(e){return No.push(e)};function to(e,r,R,L){var M=e.doc,G;R==null&&(R="add"),R=="smart"&&(M.mode.indent?G=it(e,r).state:R="prev");var ue=e.options.tabSize,fe=Z(M,r),ge=X(fe.text,null,ue);fe.stateAfter&&(fe.stateAfter=null);var we=fe.text.match(/^\s*/)[0],Ye;if(!L&&!/\S/.test(fe.text))Ye=0,R="not";else if(R=="smart"&&(Ye=M.mode.indent(G,fe.text.slice(we.length),fe.text),Ye==ce||Ye>150)){if(!L)return;R="prev"}R=="prev"?r>M.first?Ye=X(Z(M,r-1).text,null,ue):Ye=0:R=="add"?Ye=ge+e.options.indentUnit:R=="subtract"?Ye=ge-e.options.indentUnit:typeof R=="number"&&(Ye=ge+R),Ye=Math.max(0,Ye);var qe="",vt=0;if(e.options.indentWithTabs)for(var ft=Math.floor(Ye/ue);ft;--ft)vt+=ue,qe+=" ";if(vtue,ge=at(r),we=null;if(fe&&L.ranges.length>1)if(Yi&&Yi.text.join(` `)==r){if(L.ranges.length%Yi.text.length==0){we=[];for(var Ye=0;Ye=0;vt--){var ft=L.ranges[vt],Ot=ft.from(),Ut=ft.to();ft.empty()&&(R&&R>0?Ot=ht(Ot.line,Ot.ch-R):e.state.overwrite&&!fe?Ut=ht(Ut.line,Math.min(Z(G,Ut.line).text.length,Ut.ch+Ke(ge).length)):fe&&Yi&&Yi.lineWise&&Yi.text.join(` `)==ge.join(` `)&&(Ot=Ut=ht(Ot.line,0)));var Wt={from:Ot,to:Ut,text:we?we[vt%we.length]:ge,origin:M||(fe?"paste":e.state.cutIncoming>ue?"cut":"+input")};Ta(e.doc,Wt),It(e,"inputRead",e,Wt)}r&&!fe&&Gs(e,r),Mr(e),e.curOp.updateInput<2&&(e.curOp.updateInput=qe),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Ks(e,r){var R=e.clipboardData&&e.clipboardData.getData("Text");if(R)return e.preventDefault(),!r.isReadOnly()&&!r.options.disableInput&&Ri(r,function(){return Uo(r,R,0,null,"paste")}),!0}function Gs(e,r){if(!e.options.electricChars||!e.options.smartIndent)return;for(var R=e.doc.sel,L=R.ranges.length-1;L>=0;L--){var M=R.ranges[L];if(M.head.ch>100||L&&R.ranges[L-1].head.line==M.head.line)continue;var G=e.getModeAt(M.head),ue=!1;if(G.electricChars){for(var fe=0;fe-1){ue=to(e,M.head.line,"smart");break}}else G.electricInput&&(G.electricInput.test(Z(e.doc,M.head.line).text.slice(0,M.head.ch))&&(ue=to(e,M.head.line,"smart")));ue&&It(e,"electricInput",e,M.head.line)}}function Vs(e){for(var r=[],R=[],L=0;LG&&(to(this,fe.head.line,L,!0),G=fe.head.line,ue==this.doc.sel.primIndex&&Mr(this));else{var ge=fe.from(),we=fe.to(),Ye=Math.max(G,ge.line);G=Math.min(this.lastLine(),we.line-(we.ch?0:1))+1;for(var qe=Ye;qe0&&Lo(this.doc,ue,new yr(ge,vt[ue].to()),de)}}}),getTokenAt:function(L,M){return In(this,L,M)},getLineTokens:function(L,M){return In(this,ht(L),M,!0)},getTokenTypeAt:function(L){L=N(this.doc,L);var M=Et(this,Z(this.doc,L.line)),G=0,ue=(M.length-1)/2,fe=L.ch,ge;if(fe==0)ge=M[2];else for(;;){var we=G+ue>>1;if((we?M[we*2-1]:0)>=fe)ue=we;else if(M[we*2+1]ge&&(L=ge,ue=!0),fe=Z(this.doc,L)}else fe=L;return bn(this,fe,{top:0,left:0},M||"page",G||ue).top+(ue?this.doc.height-li(fe):0)},defaultTextHeight:function(){return zi(this.display)},defaultCharWidth:function(){return Vn(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(L,M,G,ue,fe){var ge=this.display;L=Gn(this,N(this.doc,L));var we=L.bottom,Ye=L.left;if(M.style.position="absolute",M.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(M),ge.sizer.appendChild(M),ue=="over")we=L.top;else if(ue=="above"||ue=="near"){var qe=Math.max(ge.wrapper.clientHeight,this.doc.height),vt=Math.max(ge.sizer.clientWidth,ge.lineSpace.clientWidth);(ue=="above"||L.bottom+M.offsetHeight>qe)&&L.top>M.offsetHeight?we=L.top-M.offsetHeight:L.bottom+M.offsetHeight<=qe&&(we=L.bottom),Ye+M.offsetWidth>vt&&(Ye=vt-M.offsetWidth)}M.style.top=we+"px",M.style.left=M.style.right="",fe=="right"?(Ye=ge.sizer.clientWidth-M.offsetWidth,M.style.right="0px"):(fe=="left"?Ye=0:fe=="middle"&&(Ye=(ge.sizer.clientWidth-M.offsetWidth)/2),M.style.left=Ye+"px"),G&&sa(this,{left:Ye,top:we,right:Ye+M.offsetWidth,bottom:we+M.offsetHeight})},triggerOnKeyDown:bi(Is),triggerOnKeyPress:bi(Us),triggerOnKeyUp:Ns,triggerOnMouseDown:bi(js),execCommand:function(L){if(Qa.hasOwnProperty(L))return Qa[L].call(null,this)},triggerElectric:bi(function(L){Gs(this,L)}),findPosH:function(L,M,G,ue){var fe=1;M<0&&(fe=-1,M=-M);for(var ge=N(this.doc,L),we=0;we0&&Ye(G.charAt(ue-1));)--ue;for(;fe.5||this.options.lineWrapping)&&Hr(this),Qe(this,"refresh",this)}),swapDoc:bi(function(L){var M=this.doc;return M.cm=null,this.state.selectingText&&this.state.selectingText(),ts(this,L),en(this),this.display.input.reset(),Na(this,L.scrollLeft,L.scrollTop),this.curOp.forceScroll=!0,It(this,"swapDoc",this,M),M}),phrase:function(L){var M=this.options.phrases;return M&&Object.prototype.hasOwnProperty.call(M,L)?M[L]:L},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Me(e),e.registerHelper=function(L,M,G){R.hasOwnProperty(L)||(R[L]=e[L]={_global:[]}),R[L][M]=G},e.registerGlobalHelper=function(L,M,G,ue){e.registerHelper(L,M,ue),R[L]._global.push({pred:G,val:ue})}}function jo(e,r,R,L,M){var G=r,ue=R,fe=Z(e,r.line),ge=M&&e.direction=="rtl"?-R:R;function we(){var rn=r.line+ge;return rn=e.first+e.size?!1:(r=new ht(rn,r.ch,r.sticky),fe=Z(e,rn))}function Ye(rn){var Jt;if(L=="codepoint"){var un=fe.text.charCodeAt(r.ch+(L>0?0:-1));isNaN(un)?Jt=null:Jt=new ht(r.line,Math.max(0,Math.min(fe.text.length,r.ch+R*(un>=55296&&un<56320?2:1))),-R)}else M?Jt=Il(e.cm,fe,r,R):Jt=Do(fe,r,R);if(Jt==null)if(!rn&&we())r=Po(M,e.cm,fe,r.line,ge);else return!1;else r=Jt;return!0}if(L=="char"||L=="codepoint")Ye();else if(L=="column")Ye(!0);else if(L=="word"||L=="group")for(var qe=null,vt=L=="group",ft=e.cm&&e.cm.getHelper(r,"wordChars"),Ot=!0;!(R<0&&!Ye(!Ot));Ot=!1){var Ut=fe.text.charAt(r.ch)||` `,Wt=He(Ut,ft)?"w":vt&&Ut==` `?"n":!vt||/\s/.test(Ut)?null:"p";if(vt&&!Ot&&!Wt&&(Wt="s"),qe&&qe!=Wt){R<0&&(R=1,Ye(),r.sticky="after");break}if(Wt&&(qe=Wt),R>0&&!Ye(!Ot))break}var $t=uo(e,r,G,ue,!0);return nn(G,$t)&&($t.hitSide=!0),$t}function $s(e,r,R,L){var M=e.doc,G=r.left,ue;if(L=="page"){var fe=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),ge=Math.max(fe-.5*zi(e.display),3);ue=(R>0?r.bottom:r.top)+R*ge}else L=="line"&&(ue=R>0?r.bottom+3:r.top-3);for(var we;!(we=Rr(e,G,ue),!we.outside);){if(R<0?ue<=0:ue>=M.height){we.hitSide=!0;break}ue+=R*5}return we}var xr=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new ne,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};xr.prototype.init=function(e){var r=this,R=this,L=R.cm,M=R.div=e.lineDiv;Xs(M,L.options.spellcheck,L.options.autocorrect,L.options.autocapitalize);function G(fe){for(var ge=fe.target;ge;ge=ge.parentNode){if(ge==M)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(ge.className))break}return!1}je(M,"paste",function(fe){if(!G(fe)||Xe(L,fe)||Ks(fe,L))return;C<=11&&setTimeout(ri(L,function(){return r.updateFromDOM()}),20)}),je(M,"compositionstart",function(fe){r.composing={data:fe.data,done:!1}}),je(M,"compositionupdate",function(fe){r.composing||(r.composing={data:fe.data,done:!1})}),je(M,"compositionend",function(fe){r.composing&&(fe.data!=r.composing.data&&r.readFromDOMSoon(),r.composing.done=!0)}),je(M,"touchstart",function(){return R.forceCompositionEnd()}),je(M,"input",function(){r.composing||r.readFromDOMSoon()});function ue(fe){if(!G(fe)||Xe(L,fe))return;if(L.somethingSelected())go({lineWise:!1,text:L.getSelections()}),fe.type=="cut"&&L.replaceSelection("",null,"cut");else if(L.options.lineWiseCopyCut){var ge=Vs(L);go({lineWise:!0,text:ge.text}),fe.type=="cut"&&L.operation(function(){L.setSelections(ge.ranges,0,de),L.replaceSelection("",null,"cut")})}else return;if(fe.clipboardData){fe.clipboardData.clearData();var we=Yi.text.join(` `);if(fe.clipboardData.setData("Text",we),fe.clipboardData.getData("Text")==we){fe.preventDefault();return}}var Ye=Ys(),qe=Ye.firstChild;L.display.lineSpace.insertBefore(Ye,L.display.lineSpace.firstChild),qe.value=Yi.text.join(` `);var vt=document.activeElement;te(qe),setTimeout(function(){L.display.lineSpace.removeChild(Ye),vt.focus(),vt==M&&R.showPrimarySelection()},50)}je(M,"copy",ue),je(M,"cut",ue)},xr.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},xr.prototype.prepareSelection=function(){var e=Xn(this.cm,!1);return e.focus=document.activeElement==this.div,e},xr.prototype.showSelection=function(e,r){if(!e||!this.cm.display.view.length)return;(e.focus||r)&&this.showPrimarySelection(),this.showMultipleSelections(e)},xr.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},xr.prototype.showPrimarySelection=function(){var e=this.getSelection(),r=this.cm,R=r.doc.sel.primary(),L=R.from(),M=R.to();if(r.display.viewTo==r.display.viewFrom||L.line>=r.display.viewTo||M.line=r.display.viewFrom&&Js(r,L)||{node:fe[0].measure.map[2],offset:0},we=M.linee.firstLine()&&(L=ht(L.line-1,Z(e.doc,L.line-1).length)),M.ch==Z(e.doc,M.line).text.length&&M.liner.viewTo-1)return!1;var G,ue,fe;L.line==r.viewFrom||(G=ni(e,L.line))==0?(ue=Je(r.view[0].line),fe=r.view[0].node):(ue=Je(r.view[G].line),fe=r.view[G-1].node.nextSibling);var ge=ni(e,M.line),we,Ye;if(ge==r.view.length-1?(we=r.viewTo-1,Ye=r.lineDiv.lastChild):(we=Je(r.view[ge+1].line)-1,Ye=r.view[ge+1].node.previousSibling),!fe)return!1;for(var qe=e.doc.splitLines(nu(e,fe,Ye,ue,we)),vt=oe(e.doc,ht(ue,0),ht(we,Z(e.doc,we).text.length));qe.length>1&&vt.length>1;)if(Ke(qe)==Ke(vt))qe.pop(),vt.pop(),we--;else if(qe[0]==vt[0])qe.shift(),vt.shift(),ue++;else break;for(var ft=0,Ot=0,Ut=qe[0],Wt=vt[0],$t=Math.min(Ut.length,Wt.length);ft<$t&&Ut.charCodeAt(ft)==Wt.charCodeAt(ft);)++ft;for(var rn=Ke(qe),Jt=Ke(vt),un=Math.min(rn.length-(qe.length==1?ft:0),Jt.length-(vt.length==1?ft:0));OtL.ch&&rn.charCodeAt(rn.length-Ot-1)==Jt.charCodeAt(Jt.length-Ot-1);)ft--,Ot++;qe[qe.length-1]=rn.slice(0,rn.length-Ot).replace(/^\u200b+/,""),qe[0]=qe[0].slice(ft).replace(/\u200b+$/,"");var An=ht(ue,ft),_n=ht(we,vt.length?Ke(vt).length-Ot:0);if(qe.length>1||qe[0]||Mt(An,_n))return Aa(e.doc,qe,An,_n,"+input"),!0},xr.prototype.ensurePolled=function(){this.forceCompositionEnd()},xr.prototype.reset=function(){this.forceCompositionEnd()},xr.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},xr.prototype.readFromDOMSoon=function(){var e=this;if(this.readDOMTimeout!=null)return;this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing)if(e.composing.done)e.composing=null;else return;e.updateFromDOM()},80)},xr.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Ri(this.cm,function(){return jr(e.cm)})},xr.prototype.setUneditable=function(e){e.contentEditable="false"},xr.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||ri(this.cm,Uo)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},xr.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},xr.prototype.onContextMenu=function(){},xr.prototype.resetPosition=function(){},xr.prototype.needsContentAttribute=!0;function Js(e,r){var R=vn(e,r.line);if(!R||R.hidden)return null;var L=Z(e.doc,r.line),M=dr(R,L,r.line),G=dt(L,e.doc.direction),ue="left";if(G){var fe=xe(G,r.ch);ue=fe%2?"right":"left"}var ge=$n(M.map,r.ch,ue);return ge.offset=ge.collapse=="right"?ge.end:ge.start,ge}function tu(e){for(var r=e;r;r=r.parentNode)if(/CodeMirror-gutter-wrapper/.test(r.className))return!0;return!1}function Pa(e,r){return r&&(e.bad=!0),e}function nu(e,r,R,L,M){var G="",ue=!1,fe=e.doc.lineSeparator(),ge=!1;function we(ft){return function(Ot){return Ot.id==ft}}function Ye(){ue&&(G+=fe,ge&&(G+=fe),ue=ge=!1)}function qe(ft){ft&&(Ye(),G+=ft)}function vt(ft){if(ft.nodeType==1){var Ot=ft.getAttribute("cm-text");if(Ot){qe(Ot);return}var Ut=ft.getAttribute("cm-marker"),Wt;if(Ut){var $t=e.findMarks(ht(L,0),ht(M+1,0),we(+Ut));$t.length&&(Wt=$t[0].find(0))&&qe(oe(e.doc,Wt.from,Wt.to).join(fe));return}if(ft.getAttribute("contenteditable")=="false")return;var rn=/^(pre|div|p|li|table|br)$/i.test(ft.nodeName);if(!/^br$/i.test(ft.nodeName)&&ft.textContent.length==0)return;rn&&Ye();for(var Jt=0;Jt=9&&r.hasSelection&&(r.hasSelection=null),R.poll()}),je(M,"paste",function(ue){if(Xe(L,ue)||Ks(ue,L))return;L.state.pasteIncoming=+new Date,R.fastPoll()});function G(ue){if(Xe(L,ue))return;if(L.somethingSelected())go({lineWise:!1,text:L.getSelections()});else if(L.options.lineWiseCopyCut){var fe=Vs(L);go({lineWise:!0,text:fe.text}),ue.type=="cut"?L.setSelections(fe.ranges,null,de):(R.prevInput="",M.value=fe.text.join(` `),te(M))}else return;ue.type=="cut"&&(L.state.cutIncoming=+new Date)}je(M,"cut",G),je(M,"copy",G),je(e.scroller,"paste",function(ue){if(Pn(e,ue)||Xe(L,ue))return;if(!M.dispatchEvent){L.state.pasteIncoming=+new Date,R.focus();return}var fe=new Event("paste");fe.clipboardData=ue.clipboardData,M.dispatchEvent(fe)}),je(e.lineSpace,"selectstart",function(ue){Pn(e,ue)||Ee(ue)}),je(M,"compositionstart",function(){var ue=L.getCursor("from");R.composing&&R.composing.range.clear(),R.composing={start:ue,range:L.markText(ue,L.getCursor("to"),{className:"CodeMirror-composing"})}}),je(M,"compositionend",function(){R.composing&&(R.poll(),R.composing.range.clear(),R.composing=null)})},Vr.prototype.createField=function(e){this.wrapper=Ys(),this.textarea=this.wrapper.firstChild},Vr.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Vr.prototype.prepareSelection=function(){var e=this.cm,r=e.display,R=e.doc,L=Xn(e);if(e.options.moveInputWithCursor){var M=Gn(e,R.sel.primary().head,"div"),G=r.wrapper.getBoundingClientRect(),ue=r.lineDiv.getBoundingClientRect();L.teTop=Math.max(0,Math.min(r.wrapper.clientHeight-10,M.top+ue.top-G.top)),L.teLeft=Math.max(0,Math.min(r.wrapper.clientWidth-10,M.left+ue.left-G.left))}return L},Vr.prototype.showSelection=function(e){var r=this.cm,R=r.display;l(R.cursorDiv,e.cursors),l(R.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Vr.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var r=this.cm;if(r.somethingSelected()){this.prevInput="";var R=r.getSelection();this.textarea.value=R,r.state.focused&&te(this.textarea),T&&C>=9&&(this.hasSelection=R)}else e||(this.prevInput=this.textarea.value="",T&&C>=9&&(this.hasSelection=null))},Vr.prototype.getField=function(){return this.textarea},Vr.prototype.supportsTouch=function(){return!1},Vr.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!n||I()!=this.textarea))try{this.textarea.focus()}catch(e){}},Vr.prototype.blur=function(){this.textarea.blur()},Vr.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Vr.prototype.receivedFocus=function(){this.slowPoll()},Vr.prototype.slowPoll=function(){var e=this;if(this.pollingFast)return;this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},Vr.prototype.fastPoll=function(){var e=!1,r=this;r.pollingFast=!0;function R(){var L=r.poll();!L&&!e?(e=!0,r.polling.set(60,R)):(r.pollingFast=!1,r.slowPoll())}r.polling.set(20,R)},Vr.prototype.poll=function(){var e=this,r=this.cm,R=this.textarea,L=this.prevInput;if(this.contextMenuPending||!r.state.focused||pt(R)&&!L&&!this.composing||r.isReadOnly()||r.options.disableInput||r.state.keySeq)return!1;var M=R.value;if(M==L&&!r.somethingSelected())return!1;if(T&&C>=9&&this.hasSelection===M||t&&/[\uf700-\uf7ff]/.test(M))return r.display.input.reset(),!1;if(r.doc.sel==r.display.selForContextMenu){var G=M.charCodeAt(0);if(G==8203&&!L&&(L="\u200B"),G==8666)return this.reset(),this.cm.execCommand("undo")}for(var ue=0,fe=Math.min(L.length,M.length);ue1e3||M.indexOf(` `)>-1?R.value=e.prevInput="":e.prevInput=M,e.composing&&(e.composing.range.clear(),e.composing.range=r.markText(e.composing.start,r.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Vr.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Vr.prototype.onKeyPress=function(){T&&C>=9&&(this.hasSelection=null),this.fastPoll()},Vr.prototype.onContextMenu=function(e){var r=this,R=r.cm,L=R.display,M=r.textarea;r.contextMenuPending&&r.contextMenuPending();var G=Nn(R,e),ue=L.scroller.scrollTop;if(!G||o)return;var fe=R.options.resetSelectionOnContextMenu;fe&&R.doc.sel.contains(G)==-1&&ri(R,fi)(R.doc,la(G),de);var ge=M.style.cssText,we=r.wrapper.style.cssText,Ye=r.wrapper.offsetParent.getBoundingClientRect();r.wrapper.style.cssText="position: static",M.style.cssText=`position: absolute; width: 30px; height: 30px; top: `+(e.clientY-Ye.top-5)+"px; left: "+(e.clientX-Ye.left-5)+`px; z-index: 1000; background: `+(T?"rgba(255, 255, 255, .05)":"transparent")+`; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var qe;c&&(qe=window.scrollY),L.input.focus(),c&&window.scrollTo(null,qe),L.input.reset(),R.somethingSelected()||(M.value=r.prevInput=" "),r.contextMenuPending=ft,L.selForContextMenu=R.doc.sel,clearTimeout(L.detectingSelectAll);function vt(){if(M.selectionStart!=null){var Ut=R.somethingSelected(),Wt="\u200B"+(Ut?M.value:"");M.value="\u21DA",M.value=Wt,r.prevInput=Ut?"":"\u200B",M.selectionStart=1,M.selectionEnd=Wt.length,L.selForContextMenu=R.doc.sel}}function ft(){if(r.contextMenuPending!=ft)return;if(r.contextMenuPending=!1,r.wrapper.style.cssText=we,M.style.cssText=ge,T&&C<9&&L.scrollbars.setScrollTop(L.scroller.scrollTop=ue),M.selectionStart!=null){(!T||T&&C<9)&&vt();var Ut=0,Wt=function(){L.selForContextMenu==R.doc.sel&&M.selectionStart==0&&M.selectionEnd>0&&r.prevInput=="\u200B"?ri(R,ps)(R):Ut++<10?L.detectingSelectAll=setTimeout(Wt,500):(L.selForContextMenu=null,L.input.reset())};L.detectingSelectAll=setTimeout(Wt,200)}}if(T&&C>=9&&vt(),E){Te(e);var Ot=function(){mt(window,"mouseup",Ot),setTimeout(ft,20)};je(window,"mouseup",Ot)}else setTimeout(ft,50)},Vr.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Vr.prototype.setUneditable=function(){},Vr.prototype.needsContentAttribute=!1;function iu(e,r){if(r=r?V(r):{},r.value=e.value,!r.tabindex&&e.tabIndex&&(r.tabindex=e.tabIndex),!r.placeholder&&e.placeholder&&(r.placeholder=e.placeholder),r.autofocus==null){var R=I();r.autofocus=R==e||e.getAttribute("autofocus")!=null&&R==document.body}function L(){e.value=fe.getValue()}var M;if(e.form&&(je(e.form,"submit",L),!r.leaveSubmitMethodAlone)){var G=e.form;M=G.submit;try{var ue=G.submit=function(){L(),G.submit=M,G.submit(),G.submit=ue}}catch(ge){}}r.finishInit=function(ge){ge.save=L,ge.getTextArea=function(){return e},ge.toTextArea=function(){ge.toTextArea=isNaN,L(),e.parentNode.removeChild(ge.getWrapperElement()),e.style.display="",e.form&&(mt(e.form,"submit",L),!r.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=M))}},e.style.display="none";var fe=Ir(function(ge){return e.parentNode.insertBefore(ge,e.nextSibling)},r);return fe}function au(e){e.off=mt,e.on=je,e.wheelEventPixels=hl,e.Doc=Ci,e.splitLines=at,e.countColumn=X,e.findColumn=De,e.isWordChar=We,e.Pass=ce,e.signal=Qe,e.Line=hi,e.changeEnd=ua,e.scrollbarModel=Ko,e.Pos=ht,e.cmpPos=Mt,e.modes=yt,e.mimeModes=ot,e.resolveMode=rt,e.getMode=wt,e.modeExtensions=Bt,e.extendMode=zt,e.copyState=Zt,e.startState=ve,e.innerMode=Re,e.commands=Qa,e.keyMap=ra,e.keyName=Rs,e.isModifierKey=Os,e.lookupKey=La,e.normalizeKeyMap=Ml,e.StringStream=K,e.SharedTextMarker=Ya,e.TextMarker=da,e.LineWidget=Xa,e.e_preventDefault=Ee,e.e_stopPropagation=Ae,e.e_stop=Te,e.addClass=B,e.contains=D,e.rmClass=y,e.keyNames=ha}Jl(Ir),eu(Ir);var ou="iter insert remove copy getEditor constructor".split(" ");for(var yo in Ci.prototype)Ci.prototype.hasOwnProperty(yo)&&$(ou,yo)<0&&(Ir.prototype[yo]=function(e){return function(){return e.apply(this.doc,arguments)}}(Ci.prototype[yo]));return Me(Ci),Ir.inputStyles={textarea:Vr,contenteditable:xr},Ir.defineMode=function(e){!Ir.defaults.mode&&e!="null"&&(Ir.defaults.mode=e),kt.apply(this,arguments)},Ir.defineMIME=Dt,Ir.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Ir.defineMIME("text/plain","null"),Ir.defineExtension=function(e,r){Ir.prototype[e]=r},Ir.defineDocExtension=function(e,r){Ci.prototype[e]=r},Ir.fromTextArea=iu,au(Ir),Ir.version="5.58.2",Ir})},W7jJ:function(et,Ve,z){"use strict";z.r(Ve);var le=z("0Owb"),Q=z("PpiC"),j=z("OaEy"),w=z("2fM7"),P=z("T2oS"),_=z("W9HT"),T=z("miYZ"),C=z("tsqr"),c=z("2qtc"),p=z("kLXV"),u=z("9og8"),o=z("tJVT"),a=z("k1fw"),d=z("aHsQ"),s=z("sGsY"),f=z("WmNS"),i=z.n(f),n=z("q1tI"),t=z.n(n),h=z("Fvcw"),v=z("GIiI"),g=z("Ty5D"),b=z("9kvl"),E=z("55Ip"),m=z("7qur"),y=z("cDPC"),x=z("m3rI"),l=z("RCxd"),S=z("EHPI"),O=z("J66h"),A=z("uMZB"),D=z.n(A),I=z("sNtx"),B=z("RpDr"),H=z("+L6B"),te=z("2/Rp"),W=z("y8nQ"),V=z("Vl3Y"),X=z("5NDa"),ne=z("5rEg"),$=ne.a.TextArea,ee=5e3,ce=function(gt){var ct=gt.callback,xt=gt.onCancel,It=gt.notes;function sn(fn){ct(fn)}return t.a.createElement(V.a,{className:"note-form-panel",onFinish:sn,initialValues:{notes:It}},t.a.createElement(V.a.Item,{name:"notes",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u7B14\u8BB0\u5185\u5BB9"},{max:ee,message:"\u7B14\u8BB0\u6700\u5927\u5B57\u6570\u4E3A".concat(ee)}]},t.a.createElement($,{placeholder:"\u8BF7\u8F93\u5165\u7B14\u8BB0\u5185\u5BB9",rows:5})),t.a.createElement(V.a.Item,{style:{textAlign:"right"}},t.a.createElement(te.a,{type:"ghost",onClick:xt,style:{marginRight:10}}," \u53D6\u6D88 "),t.a.createElement(te.a,{type:"primary",htmlType:"submit"}," \u63D0\u4EA4 ")))},de=z("ZsLC"),Ce=z.n(de),Se=z("DjyN"),De=z("NUBc"),be=z("g9YV"),_e=z("wCAj"),Ke=z("Hw79"),Ne=z.n(Ke),Be=z("ye1Q"),ze=z("lfch"),ye=z("bdLU"),pe=z("1vsH"),We=z("wd/R"),He=z.n(We),nt=_e.a.Column,re=function(gt){var ct=gt.submitResult,xt=gt.submitting,It=gt.submitRecords,sn=gt.page,fn=gt.onPageChange,St=gt.topicId,_t=ct||{},Yt=_t.status,Ct=_t.id,ln=_t.input,jt=_t.output,pn=_t.expected_output,Yn=_t.is_file,Dn=_t.input_file_url,En=_t.output_file_url,er=_t.expected_output_file_url,Rn=_t.error_msg,Pn=It||{},Kn=Pn.records,Cr=Pn.records_count,rr=Object(g.i)();function lr(){Yn?navigator.clipboard.writeText(O.Base64.decode(Rn)).then(function(){C.b.success("\u590D\u5236\u9519\u8BEF\u4FE1\u606F\u6210\u529F")}):navigator.clipboard.writeText(O.Base64.decode(jt)).then(function(){C.b.success("\u590D\u5236\u9519\u8BEF\u4FE1\u606F\u6210\u529F")})}return t.a.createElement(_.a,{spinning:xt,tip:"\u8BC4\u6D4B\u4E2D...",indicator:t.a.createElement(Be.a,{style:{fontSize:24},spin:!0})},Ct?t.a.createElement(t.a.Fragment,null,t.a.createElement("ul",{className:Ne.a.info},t.a.createElement("li",null,"\u6267\u884C\u7ED3\u679C\uFF1A",t.a.createElement("span",{className:Yt===ye.a.OK?"c-green":"c-red"},B.a[Yt])),t.a.createElement("li",{className:Ne.a.error},t.a.createElement("a",{onClick:lr},"\u590D\u5236\u9519\u8BEF\u4FE1\u606F ",t.a.createElement(ze.a,null)," ")),t.a.createElement("li",null,t.a.createElement(E.a,{to:"/problems/".concat(St,"/record-detail/").concat(Ct,"?backId=").concat(rr==null?void 0:rr.save_identifier)},"\u663E\u793A\u8BE6\u60C5 > "))),Yt!==ye.a.OK?t.a.createElement(t.a.Fragment,null,t.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u5165\uFF1A"),t.a.createElement("pre",null,!Yn&&ln,Yn&&t.a.createElement("a",{style:{fontSize:"16px"},onClick:function(){return Object(pe.w)(Dn,ln)}},ln)),t.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u51FA\uFF1A"),t.a.createElement("pre",null,(Yt===4||Yt===5)&&O.Base64.decode(Rn),Yt!=4&&Yt!=5&&(Yn?t.a.createElement("a",{style:{fontSize:"16px"},onClick:function(){return Object(pe.w)(En,jt)}},jt):O.Base64.decode(jt))),t.a.createElement("p",{className:"c-red"},"\u9884\u671F\u8F93\u51FA\uFF1A"),t.a.createElement("pre",null,!Yn&&O.Base64.decode(pn),Yn&&t.a.createElement("a",{style:{fontSize:"16px"},onClick:function(){return Object(pe.w)(er,pn)}},pn))):null):null,(Kn==null?void 0:Kn.length)>0?t.a.createElement(_e.a,{dataSource:Kn,rowKey:"id",pagination:!1},t.a.createElement(nt,{title:"\u63D0\u4EA4\u65F6\u95F4",dataIndex:"created_at",key:"created_at",render:function(Er,ir){return t.a.createElement("span",null," ",He()(Er).format("YYYY-MM-DD HH:mm:ss"))}}),t.a.createElement(nt,{title:"\u63D0\u4EA4\u7ED3\u679C",dataIndex:"status",key:"status",render:function(Er,ir){var dr;return t.a.createElement(E.a,{className:Er===0?"c-green":"c-red",to:"/problems/".concat(St,"/record-detail/").concat(ir.id,"?backId=").concat(rr==null?void 0:rr.save_identifier)},(dr=B.a[Er])===null||dr===void 0?void 0:dr.replace("\u8C03\u8BD5","\u8BC4\u6D4B"))}}),t.a.createElement(nt,{title:"\u6267\u884C\u7528\u65F6 (S)",dataIndex:"execute_time",key:"execute_time"}),t.a.createElement(nt,{title:"\u5185\u5B58\u6D88\u8017\uFF08MB\uFF09",dataIndex:"execute_memory",key:"execute_memory"}),t.a.createElement(nt,{title:"\u8BED\u8A00",dataIndex:"language",key:"language"})):null,Cr>15?t.a.createElement(De.a,{className:Ne.a.pagination,current:sn,pageSize:15,total:Cr,onChange:fn}):null)},k=z("BdwD"),U=z("DYRE"),q=z("zeV3"),Y=z("+BJd"),J=z("mr32"),xe=z("TcMa"),ke=z.n(xe),dt=z("9Bee"),Ue={1:{name:"\u7B80\u5355",color:"#52c41a"},2:{name:"\u9002\u4E2D",color:"#faad14"},3:{name:"\u56F0\u96BE",color:"#f5222d"}},je=function(gt){var ct=gt.hack,xt=gt.onTriggerPraise,It=gt.toDiscuss,sn=ct.language,fn=ct.difficulty,St=ct.time_limit,_t=ct.username,Yt=ct.user_path,Ct=ct.user_praise,ln=ct.comments_count,jt=ct.praises_count,pn=ct.description,Yn=ct.pass_count,Dn=ct.submit_count,En=Object(g.h)();console.log(ct.language,"language");var er=Ue[fn];return t.a.createElement(t.a.Fragment,null,t.a.createElement("ul",{className:ke.a.info},t.a.createElement("li",null,"\u96BE\u5EA6\uFF1A",t.a.createElement(J.a,{color:er.color},er.name)),t.a.createElement("li",null,"\u8BC4\u6D4B\u65F6\u957F\u9650\u5236\uFF1A",t.a.createElement("b",null,St,"\u79D2"))),t.a.createElement(dt.a,{value:pn,className:ke.a.desc}),t.a.createElement("ul",{className:ke.a["commit-info"]},t.a.createElement("li",null,t.a.createElement(q.a,{size:4},t.a.createElement("span",null,"\u901A\u8FC7\u6B21\u6570")," ",t.a.createElement("b",null,Yn))),t.a.createElement("li",null,t.a.createElement(q.a,{size:4},t.a.createElement("span",null,"\u63D0\u4EA4\u6B21\u6570")," ",t.a.createElement("b",null,Dn))," "),t.a.createElement("li",{style:{flex:"1 0 0"}}),t.a.createElement("li",null,t.a.createElement(q.a,{size:4},t.a.createElement("i",{className:"iconfont icon-huifu1",onClick:It})," ",t.a.createElement("b",null,ln))," ")))},tt=z("dhSg"),mt=z("ps8w"),Qe=z.n(mt),Xe=z("oBTY"),Fe=z("M8RZ"),Ie=z("OkW/"),Me=z("ErOA");function Ee(gt){return Object(Me.c)("comments.json",gt)}function Ae(gt){return Object(Me.f)("/discusses/".concat(gt,"/plus.json"),{container_type:"Discuss",type:1})}function Le(gt){return Object(Me.f)("comments/reply.json",gt)}function Te(gt){return Object(Me.f)("comments.json",gt)}function Ze(gt){return Object(Me.f)("comments/".concat(gt==null?void 0:gt.id,"/hidden.json"),gt)}function ut(gt){return Object(Me.b)("comments/".concat(gt==null?void 0:gt.id,".json"))}var Tt=z("GgEA"),Ht=z("AMnG"),Qt=z("xKgJ");function bt(gt){var ct=gt.author;return t.a.createElement("a",{href:"/users/".concat(ct.login),target:"_blank"},t.a.createElement("img",{alt:"\u7528\u6237\u5934\u50CF",height:"50",style:{borderRadius:"50%"},src:"".concat(x.a.IMG_SERVER,"/images/").concat(ct.image_url),width:"50"}))}function Lt(gt){var ct=gt.data,xt=gt.index,It=gt.parentDiscussIndex,sn=gt.user,fn=gt.onSetActionType,St=ct.author,_t=ct.can_delete,Yt=ct.content,Ct=ct.id,ln=ct.time;function jt(){fn({id:Ct,index:xt,type:"delete-discuss",parentDiscussIndex:It,message:"\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417"})}var pn=sn.admin||_t||St.user_id===sn.user_id;return t.a.createElement("div",{className:"discuss-item-container second-discuss "},t.a.createElement(bt,{author:St}),t.a.createElement("section",null,t.a.createElement("div",{className:"discuss-info"},t.a.createElement("a",{href:"/users/".concat(St.login),target:"_blank"},St.name),t.a.createElement("span",{className:"grey"},ln),t.a.createElement("div",{className:"btn-group",style:{marginBottom:0}},pn?t.a.createElement("a",{onClick:jt,title:"\u5220\u9664"},t.a.createElement("i",{className:"iconfont icon-shanchu"})):null)),t.a.createElement(dt.a,{className:"discuss-content",value:Yt})))}var at=function(gt){var ct=gt.user,xt=gt.data,It=gt.index,sn=gt.onPlusDiscuss,fn=gt.onSetActionType,St=gt.activeDiscussIndex,_t=gt.onReplyDiscuss,Yt=gt.onSetActiveDiscussIndex,Ct=xt.content,ln=xt.children,jt=xt.hidden,pn=xt.id,Yn=xt.praise_count,Dn=xt.time,En=xt.user_praise,er=xt.can_delete,Rn=xt.author;console.log(er&&(!ln||ln.length==0),"children22");function Pn(){Yt(pn)}function Kn(){sn(pn,!En,It)}function Cr(){fn({id:pn,index:It,type:"delete-discuss",message:"\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417"})}function rr(){fn({id:pn,index:It,params:{hidden:jt?"0":"1"},type:"hidden-discuss",message:jt?"\u786E\u5B9A\u8981\u53D6\u6D88\u9690\u85CF\u8BE5\u6761\u56DE\u590D\u5417":"\u786E\u5B9A\u8981\u9690\u85CF\u8BE5\u6761\u56DE\u590D\u5417"})}var lr=ct.admin||ct.user_id===Rn.user_id;return t.a.createElement("div",{className:"discuss-item-container",key:pn},t.a.createElement(bt,{author:Rn}),t.a.createElement("section",null,t.a.createElement("div",{className:"discuss-info"},t.a.createElement("a",{href:"/users/".concat(Rn.login),target:"_blank"}," ",Rn.name," "),t.a.createElement("span",{className:"grey"},Dn)),t.a.createElement(dt.a,{className:"discuss-content",value:Ct}),ln&&ln.length>0?t.a.createElement("div",{className:"reply-discuss-container"},ln.map(function(pr,Er){return t.a.createElement(Lt,{key:pr.id,data:pr,index:Er,user:ct,onSetActionType:fn,parentDiscussIndex:It})})):null,t.a.createElement("div",{className:"btn-group"},Object(Qt.v)()?t.a.createElement("a",{onClick:rr,title:jt?"\u53D6\u6D88\u9690\u85CF":"\u9690\u85CF\u8BC4\u8BBA"},t.a.createElement("i",{className:jt?"iconfont icon-yincangbiyan":"fa fa-eye"})):null,er&&(!ln||ln.length==0)?t.a.createElement("a",{onClick:Cr,title:"\u5220\u9664"},t.a.createElement("i",{className:"iconfont icon-shanchu"})):null,t.a.createElement("a",{onClick:Pn,title:"\u56DE\u590D"}," ",t.a.createElement("i",{className:"iconfont icon-huifu1"})," "),t.a.createElement("a",{onClick:Kn,className:En?"c-orange":""},t.a.createElement("i",{className:En?"iconfont icon-dianzan mr3":"iconfont icon-dianzan-xian mr3 "}),t.a.createElement("span",null,Yn||""))),t.a.createElement(Ht.a,{id:pn,activeDiscussIndex:St,onReplyDiscuss:_t})))},pt=z("kaH+"),st=z("Wx9E"),Pe=z("Ot1p"),Ge=function(gt){var ct=gt.user_praise,xt=gt.praise_count,It=gt.praisePlus,sn=gt.onCreateDiscuss,fn=gt.discuss_count,St=Object(n.useState)(!1),_t=Object(o.a)(St,2),Yt=_t[0],Ct=_t[1],ln=Object(n.useState)(""),jt=Object(o.a)(ln,2),pn=jt[0],Yn=jt[1];function Dn(Kn){Yn(Kn)}function En(){Ct(!0)}function er(){Ct(!1)}function Rn(){return Pn.apply(this,arguments)}function Pn(){return Pn=Object(u.a)(i.a.mark(function Kn(){return i.a.wrap(function(rr){for(;;)switch(rr.prev=rr.next){case 0:sn(pn),Yn(""),Ct(!1);case 3:case"end":return rr.stop()}},Kn)})),Pn.apply(this,arguments)}return t.a.createElement("div",{className:"dis-input-editor-container ".concat(Yt?"active":""," ")},t.a.createElement("div",{className:Yt?"text-area hide":"text-area"},t.a.createElement("input",{placeholder:"\u8BF4\u70B9\u4EC0\u4E48",onClick:En}),t.a.createElement("a",{style:{alignItems:"center"}}," ",t.a.createElement("i",{className:"iconfont icon-huifu1"})," \xA0 \xA0",fn," "),t.a.createElement("a",{className:"c-light-black",onClick:It,style:{alignItems:"center"},title:ct?"\u53D6\u6D88\u70B9\u8D5E":"\u70B9\u8D5E"},t.a.createElement("i",{className:"mr3 ".concat(ct?"iconfont icon-dianzan c-orange":"iconfont icon-dianzan-xian"," ")}),xt?t.a.createElement("span",null,xt):"")),Yt?t.a.createElement("div",{className:"input-mask",onClick:er}):null,t.a.createElement("div",{className:Yt?"md-container":"md-container hide"},t.a.createElement(Pe.a,{id:"discuss-input-editor",miniToolbar:!0,watch:!1,noStorage:!0,defaultValue:pn,height:240,onChange:Dn}),t.a.createElement("div",{className:"tip-container",onClick:er},t.a.createElement("a",{className:"btn-send",onClick:Rn}," \u53D1\u9001 "))))},yt={loading:!1,page:1,data:[],count:0,actionType:null,activeDiscussIndex:null},ot;(function(gt){gt[gt.GET_DISCUSSES=0]="GET_DISCUSSES",gt[gt.TOP_OR_DOWN_DISCUSS=1]="TOP_OR_DOWN_DISCUSS",gt[gt.ACTIVE_DISCUSS_INDEX=2]="ACTIVE_DISCUSS_INDEX",gt[gt.PLUS_DISCUSS=3]="PLUS_DISCUSS",gt[gt.SET_ACTION_TYPE=4]="SET_ACTION_TYPE",gt[gt.SET_PAGE=5]="SET_PAGE",gt[gt.SHOW_DISCUSSES_LOADING=6]="SHOW_DISCUSSES_LOADING"})(ot||(ot={}));function kt(gt,ct){switch(ct.type){case ot.SHOW_DISCUSSES_LOADING:return Object(a.a)(Object(a.a)({},gt),{},{loading:!0});case ot.GET_DISCUSSES:return Object(a.a)(Object(a.a)({},gt),ct.payload);case ot.TOP_OR_DOWN_DISCUSS:return Object(a.a)(Object(a.a)({},gt),ct.payload);case ot.SET_ACTION_TYPE:return Object(a.a)(Object(a.a)({},gt),ct.payload);case ot.PLUS_DISCUSS:return Object(a.a)(Object(a.a)({},gt),ct.payload);case ot.SET_PAGE:return Object(a.a)(Object(a.a)({},gt),{},{page:ct.payload});case ot.ACTIVE_DISCUSS_INDEX:return Object(a.a)(Object(a.a)({},gt),ct.payload);default:throw new Error}}var Dt=function(gt){var ct=gt.user,xt=gt.identifier,It=gt.hack,sn=gt.onTriggerPraise,fn=gt.setDiscussTotal,St=Object(n.useReducer)(kt,yt),_t=Object(o.a)(St,2),Yt=_t[0],Ct=_t[1],ln=Yt.loading,jt=Yt.page,pn=Yt.data,Yn=Yt.count,Dn=Yt.actionType,En=Yt.activeDiscussIndex,er=Object(n.useCallback)(Object(u.a)(i.a.mark(function vn(){var tr,ar,mr;return i.a.wrap(function(Jn){for(;;)switch(Jn.prev=Jn.next){case 0:return Ct({type:ot.SHOW_DISCUSSES_LOADING}),Jn.next=3,Ee({container_type:"Practice",container_identifier:xt,limit:10,page:jt});case 3:tr=Jn.sent,ar=tr.comments,mr=tr.disscuss_count,Ct({type:ot.GET_DISCUSSES,payload:{data:ar,count:mr,loading:!1}}),fn(mr);case 7:case"end":return Jn.stop()}},vn)})),[jt,xt]);Object(n.useEffect)(function(){er()},[xt,jt]);function Rn(vn){Ct({type:ot.SET_PAGE,page:vn})}function Pn(vn){Ct({type:ot.SET_ACTION_TYPE,payload:{actionType:vn}})}function Kn(vn){En===vn?Ct({type:ot.ACTIVE_DISCUSS_INDEX,payload:{activeDiscussIndex:null}}):Ct({type:ot.ACTIVE_DISCUSS_INDEX,payload:{activeDiscussIndex:vn}})}function Cr(vn,tr,ar){return rr.apply(this,arguments)}function rr(){return rr=Object(u.a)(i.a.mark(function vn(tr,ar,mr){var $n;return i.a.wrap(function(yn){for(;;)switch(yn.prev=yn.next){case 0:return yn.prev=0,yn.next=3,Ae(tr);case 3:$n=yn.sent,pn[mr].user_praise=ar,pn[mr].praise_count=$n.praise_count,Ct({type:ot.PLUS_DISCUSS,payload:{data:Object(Xe.a)(pn)}}),yn.next=12;break;case 9:yn.prev=9,yn.t0=yn.catch(0),console.log(yn.t0);case 12:case"end":return yn.stop()}},vn,null,[[0,9]])})),rr.apply(this,arguments)}function lr(){return pr.apply(this,arguments)}function pr(){return pr=Object(u.a)(i.a.mark(function vn(){var tr,ar,mr,$n,Jn;return i.a.wrap(function(Ln){for(;;)switch(Ln.prev=Ln.next){case 0:if(tr=Dn.id,ar=Dn.params,mr=Dn.type,$n=Dn.index,Jn=Dn.parentDiscussIndex,!(mr==="hidden-discuss")){Ln.next=7;break}return console.log(ar,"params"),Ln.next=5,Ze(Object(a.a)({id:tr,container_type:"Practice",container_identifier:xt},ar));case 5:Jn?pn[Jn].children[$n].hidden=ar.hidden==1:pn[$n].hidden=ar.hidden==1,Ct({type:ot.SET_ACTION_TYPE,payload:{actionType:null,data:Object(Xe.a)(pn)}});case 7:if(!(mr==="delete-discuss")){Ln.next=13;break}return Ln.next=10,ut({id:tr,container_type:"Practice",container_identifier:xt});case 10:return Ct({type:ot.SET_ACTION_TYPE,payload:{actionType:null}}),Ln.next=13,er();case 13:case"end":return Ln.stop()}},vn)})),pr.apply(this,arguments)}function Er(){Ct({type:ot.SET_ACTION_TYPE,payload:{actionType:null}})}function ir(vn,tr){return dr.apply(this,arguments)}function dr(){return dr=Object(u.a)(i.a.mark(function vn(tr,ar){return i.a.wrap(function($n){for(;;)switch($n.prev=$n.next){case 0:return $n.prev=0,$n.next=3,Le({container_type:"Practice",container_identifier:xt,comments:{content:ar,parent_id:tr}});case 3:er(),$n.next=9;break;case 6:$n.prev=6,$n.t0=$n.catch(0),console.log($n.t0);case 9:case"end":return $n.stop()}},vn,null,[[0,6]])})),dr.apply(this,arguments)}function jn(vn){return Gt.apply(this,arguments)}function Gt(){return Gt=Object(u.a)(i.a.mark(function vn(tr){return i.a.wrap(function(mr){for(;;)switch(mr.prev=mr.next){case 0:return Ct({type:ot.SHOW_DISCUSSES_LOADING}),mr.next=3,Te({comments:{content:tr},container_type:"Practice",container_identifier:xt});case 3:er();case 4:case"end":return mr.stop()}},vn)})),Gt.apply(this,arguments)}return t.a.createElement(t.a.Fragment,null,t.a.createElement("div",{className:"discuss-panel"},pn.length===0?t.a.createElement(k.a,null):pn.map(function(vn,tr){return t.a.createElement(at,{onReplyDiscuss:ir,onPlusDiscuss:Cr,onSetActiveDiscussIndex:Kn,onSetActionType:Pn,data:vn,index:tr,user:ct,activeDiscussIndex:En})}),Yn>10?t.a.createElement("div",{className:"pagination-container"},t.a.createElement(De.a,{showQuickJumper:!0,onChange:Rn,current:jt,total:Yn})):null),t.a.createElement(Ge,{user_praise:It.user_praise,praise_count:It.praises_count,praisePlus:sn,discuss_count:It.comments_count,onCreateDiscuss:jn}),t.a.createElement(Fe.a,null,t.a.createElement(p.a,{centered:!0,title:"\u63D0\u793A",visible:!!Dn,onOk:lr,onCancel:Er},t.a.createElement("p",null,Dn?Dn.message:"")),t.a.createElement(pt.a,null)))},rt=z("1FX+"),wt=z.n(rt),Bt=z("pYxM"),zt=z.n(Bt),Zt=z("sB/4"),Re=z.n(Zt),ve=z("Wtmd"),K=z.n(ve),Z=z("CNDd"),oe=z.n(Z),he=z("nCk5"),Oe=z.n(he),Je=z("kovY"),lt=z.n(Je),Pt=function(ct){var xt=ct.style,It=xt===void 0?{}:xt,sn=ct.onClick,fn=ct.onAssist,St=ct.onHide,_t=ct.data,Yt=ct.active,Ct=ct.showLine;return t.a.createElement(t.a.Fragment,null,t.a.createElement("div",{className:Yt===(_t==null?void 0:_t.id)?"".concat(zt.a.list," ").concat(zt.a.active):zt.a.list,style:It,onClick:function(){return sn(_t)}},(_t==null?void 0:_t.video)&&t.a.createElement("div",{className:zt.a.left},t.a.createElement("img",{src:_t==null?void 0:_t.video_cover}),t.a.createElement("div",null,t.a.createElement("img",{src:Re.a}),t.a.createElement("span",null,_t==null?void 0:_t.video_duration)),t.a.createElement("div",{className:zt.a.mask})),t.a.createElement("div",{className:zt.a.right},t.a.createElement("div",{className:zt.a.name},t.a.createElement("img",{src:x.a.IMG_SERVER+"/images/"+(_t==null?void 0:_t.image_url),width:30,height:30}),t.a.createElement("div",{title:_t==null?void 0:_t.name,className:zt.a.title},_t==null?void 0:_t.name),(_t==null?void 0:_t.is_authority)&&t.a.createElement("div",{className:zt.a.b},"\u5B98\u65B9"),(_t==null?void 0:_t.is_excellent)&&t.a.createElement("div",{className:zt.a.a},"\u7CBE\u9009")),t.a.createElement("div",{className:zt.a.des},t.a.createElement(dt.a,{showLines:2,showTextOnly:!0,value:(_t==null?void 0:_t.content)||"\u6682\u65E0\u5185\u5BB9"})),t.a.createElement("div",{className:zt.a.tag},t.a.createElement("span",{className:"current",onClick:function(jt){jt.stopPropagation(),fn(_t)}},t.a.createElement("img",{src:_t!=null&&_t.user_liker?oe.a:K.a}),t.a.createElement("span",{style:{color:_t!=null&&_t.user_liker?"#0152d9":"#656f87"}},_t==null?void 0:_t.praises_count)),t.a.createElement("span",null,t.a.createElement("img",{src:Oe.a}),t.a.createElement("span",null,_t==null?void 0:_t.discusses_count)),t.a.createElement("span",null,t.a.createElement("img",{src:lt.a}),t.a.createElement("span",null,_t==null?void 0:_t.viewed_count)),Object(Qt.v)()&&t.a.createElement("span",{className:"current",style:{color:"#0152d9",marginRight:0,userSelect:"none"},onClick:function(jt){jt.stopPropagation(),St(_t)}},_t!=null&&_t.is_hidden?"\u53D6\u6D88\u9690\u85CF":"\u9690\u85CF")))),Ct&&t.a.createElement("div",{className:zt.a.line}))},Nt=Pt,ht=z("5Dmo"),Mt=z("3S7+"),nn=z("Z8dc"),Rt=z.n(nn),cn=z("Aky1"),an=z("7+5b"),ie=z.n(an),N=z("twBr"),F=z.n(N),ae=z("oE5q"),me=z.n(ae),se=function(ct,xt){var It,sn,fn,St=xt.payload.uploadInfo,_t=St===void 0?{}:St;switch(xt.type){case"addVideo":return{videoList:[].concat(Object(Xe.a)(ct.videoList),[{name:_t.file.name,size:_t.file.size,type:_t.file.type,fileHash:_t.fileHash,state:_t.state,video_id:_t.videoId,attachment_id:"",article_id:-1,loaded:0,title:""}])};case"removeVideo":return{videoList:ct.videoList.filter(function(Yt){return Yt.name!==xt.payload.name})};case"replaceVideo":return{videoList:xt.payload};case"removeAll":return[];case"updateProgress":return{videoList:ct.videoList.map(function(Yt){return Yt.name===xt.payload.uploadInfo.file.name?Object(a.a)(Object(a.a)({},Yt),{loaded:xt.payload.progressPercent,video_id:_t.videoId,fileHash:_t.fileHash}):Yt})};case"updateTitle":return{videoList:(It=ct.videoList)===null||It===void 0?void 0:It.map(function(Yt){return Yt.name===xt.payload.item.name?Object(a.a)(Object(a.a)({},Yt),{title:xt.payload.title}):Yt})};case"updateImg":return{videoList:(sn=ct.videoList)===null||sn===void 0?void 0:sn.map(function(Yt){return Yt.name===xt.payload.item.name?Object(a.a)(Object(a.a)({},Yt),{attachment_id:xt.payload.attachment_id}):Yt})};case"updateImg":return{videoList:(fn=ct.videoList)===null||fn===void 0?void 0:fn.map(function(Yt){return Yt.name===xt.payload.item.name?Object(a.a)(Object(a.a)({},Yt),{attachment_id:xt.payload.attachment_id}):Yt})};default:return[]}},$e=function(ct){var xt,It,sn=ct.onClose,fn=ct.onOk,St=ct.identifier,_t=ct.active,Yt=V.a.useForm(),Ct=Object(o.a)(Yt,1),ln=Ct[0],jt=Object(n.useState)({}),pn=Object(o.a)(jt,2),Yn=pn[0],Dn=pn[1],En=Object(n.useState)(!1),er=Object(o.a)(En,2),Rn=er[0],Pn=er[1],Kn=Object(n.useState)(!1),Cr=Object(o.a)(Kn,2),rr=Cr[0],lr=Cr[1],pr=Object(n.useReducer)(se,{videoList:[]}),Er=Object(o.a)(pr,2),ir=Er[0],dr=Er[1],jn=Object(Qt.x)(),Gt=Object(g.i)(),vn=Object(n.useRef)();Object(n.useEffect)(function(){_t&&tr()},[_t]);var tr=function(){var bn=Object(u.a)(i.a.mark(function Mn(){var Cn,Gn,or,vr,Rr,ei,ki,$r,ji,na,Hi,ui;return i.a.wrap(function(Vn){for(;;)switch(Vn.prev=Vn.next){case 0:return Vn.next=2,Object(m.k)(St,{active:_t});case 2:Cn=Vn.sent,(Cn==null?void 0:Cn.status)===0&&(ei={name:Cn==null||((Gn=Cn.data)===null||Gn===void 0)?void 0:Gn.name,content:Cn==null||((or=Cn.data)===null||or===void 0)?void 0:or.content},ln.setFieldsValue(ei),Dn(ei),Cn!=null&&(vr=Cn.data)!==null&&vr!==void 0&&(Rr=vr.videos)!==null&&Rr!==void 0&&Rr[0]&&dr({type:"replaceVideo",payload:[{video_id:Cn==null||((ki=Cn.data)===null||ki===void 0||(($r=ki.videos)===null||$r===void 0||((ji=$r[0])===null||ji===void 0)))?void 0:ji.video_id,name:Cn==null||((na=Cn.data)===null||na===void 0||((Hi=na.videos)===null||Hi===void 0||((ui=Hi[0])===null||ui===void 0)))?void 0:ui.title,loaded:100}]}));case 4:case"end":return Vn.stop()}},Mn)}));return function(){return bn.apply(this,arguments)}}(),ar=function(Mn,Cn){Dn(Object(a.a)({},Cn))},mr=function(){var bn=Object(u.a)(i.a.mark(function Mn(Cn){var Gn,or,vr,Rr,ei;return i.a.wrap(function($r){for(;;)switch($r.prev=$r.next){case 0:if(or={videos:ir.videoList,articles:Cn},lr(!0),!_t){$r.next=9;break}return or.active=_t,$r.next=6,Object(m.j)(St,or);case 6:vr=$r.sent,$r.next=12;break;case 9:return $r.next=11,Object(m.a)(St,or);case 11:vr=$r.sent;case 12:((Gn=vr)===null||Gn===void 0?void 0:Gn.status)===0&&(console.log(_t||((Rr=vr)===null||Rr===void 0?void 0:Rr.id),44),fn(_t||((ei=vr)===null||ei===void 0?void 0:ei.id))),lr(!1);case 14:case"end":return $r.stop()}},Mn)}));return function(Cn){return bn.apply(this,arguments)}}(),$n=function(){var Mn=document.getElementById("fileUpload");Mn.value=""},Jn=function(Mn){var Cn='{"Vod":{}}';if(Pn(!0),vn.current){vn.current.addFile(Mn,null,null,null,Cn);return}Object(cn.a)(jn==null?void 0:jn.login,"",{create:!vn,addFileSuccess:function(or){dr({type:"addVideo",payload:{uploadInfo:or}})},onUploadProgress:function(or,vr,Rr){var ei=Math.ceil(Rr*100);dr({type:"updateProgress",payload:{uploadInfo:or,progressPercent:ei}}),$n()},onUploadFailed:function(or){C.b.info("\u89C6\u9891\u4E91\u670D\u52A1\u51FA\u73B0\u5F02\u5E38\uFF0C\u8BF7\u91CD\u65B0\u4E0A\u4F20\u3002")},onUploadEnd:function(or){Pn(!1)},onUploadSucceed:function(or){Pn(!1)},onUploadError:function(or){Pn(!1)},gotUploader:function(or){or.addFile(Mn,null,null,null,Cn),vn.current=or}})},yn=function(Mn){var Cn,Gn=1024,or=Mn.target.files[0];if(!or){$n();return}var vr=or.name.toLowerCase();if(vr&&vr.indexOf(".avi")==-1&&vr.indexOf(".flv")==-1&&vr.indexOf(".f4v")==-1&&vr.indexOf(".m4v")==-1&&vr.indexOf(".mov")==-1&&vr.indexOf(".mp4")==-1&&vr.indexOf(".rmvb")==-1&&vr.indexOf(".swf")==-1&&vr.indexOf(".webm")==-1&&vr.indexOf(".wmv")==-1){C.b.info("\u4E0D\u652F\u6301\u7684\u89C6\u9891\u683C\u5F0F"),$n();return}if(or.size>Gn*1024*1024){C.b.info("\u89C6\u9891\u5927\u5C0F\u8D85\u8FC7".concat(Gn,"M")),$n();return}if((Cn=ir.videoList)!==null&&Cn!==void 0&&Cn.find(function(Rr){return Rr.name===or.name})){C.b.info("\u4F60\u4E0D\u80FD\u4E0A\u4F20\u540C\u4E00\u4E2A\u89C6\u9891\u6587\u4EF6\u540D\u79F0\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9\u3002"),$n();return}Jn(or)},Ln=function(Mn,Cn){p.a.confirm({title:"\u63D0\u793A",centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:t.a.createElement("div",{className:"tc"},"\u60A8\u786E\u8BA4\u8981",Cn?"\u5220\u9664":"\u53D6\u6D88\u4E0A\u4F20","\u8BE5\u89C6\u9891\u5417\uFF1F"),onOk:function(){$n(),dr({type:"removeVideo",payload:{name:Mn}})}})},Kt=function(){return t.a.createElement("label",{htmlFor:"fileUpload",className:Rt.a.main},t.a.createElement("img",{src:ie.a,alt:""}),t.a.createElement("span",null,"\u4E0A\u4F20\u89C6\u9891"))},Xt=function(Mn){return t.a.createElement("div",{className:Rt.a.mainLoading},t.a.createElement("div",{className:Rt.a.proWarp},t.a.createElement("div",{className:Rt.a.pro},t.a.createElement("div",{style:{width:Mn}})),t.a.createElement("span",null,Mn||0,"%")),t.a.createElement("aside",null,"\u4E0A\u4F20\u4E2D"),t.a.createElement("div",{className:Rt.a.tip},t.a.createElement(Mt.a,{getPopupContainer:function(Gn){return Gn.parentNode},title:t.a.createElement("div",null,t.a.createElement("div",null,"1\u3001\u4E0A\u4F20\u89C6\u9891\uFF0C\u5373\u8868\u793A\u60A8\u5DF2\u540C\u610F",t.a.createElement("a",{className:"current c-light-primary",target:"_blank",href:"/users/innov/videos/protocol"},"\u4E0A\u4F20\u5185\u5BB9\u534F\u8BAE"),"\uFF0C\u4E0D\u5F97\u4E0A\u4F20\u672A\u7ECF\u4ED6\u4EBA\u6388\u6743\u7684\u4F5C\u54C1\uFF1B"),t.a.createElement("div",null,"2\u3001\u4E0D\u652F\u6301\u65AD\u70B9\u7EED\u4F20\uFF0C\u6587\u4EF6\u5927\u5C0F\u8BF7\u52FF\u8D85\u8FC71G\uFF1B"),t.a.createElement("div",null,"3\u3001\u652F\u6301\u6587\u4EF6\u683C\u5F0F\uFF1Aavi\u3001flv\u3001f4v\u3001m4v\u3001mov\u3001mp4\u3001rmvb\u3001swf\u3001webm\u3001wmv\uFF1B"))},t.a.createElement("img",{src:me.a,alt:""}))))},en=function(Mn){return t.a.createElement("div",{className:Rt.a.mainSucceed},t.a.createElement("img",{src:F.a,alt:""}),t.a.createElement("span",null,"\u4E0A\u4F20\u6210\u529F"),t.a.createElement("div",{className:Rt.a.tip},t.a.createElement(Mt.a,{getPopupContainer:function(Gn){return Gn.parentNode},title:t.a.createElement("div",null,t.a.createElement("div",null,"1\u3001\u4E0A\u4F20\u89C6\u9891\uFF0C\u5373\u8868\u793A\u60A8\u5DF2\u540C\u610F",t.a.createElement("a",{className:"current c-light-primary",target:"_blank",href:"/users/innov/videos/protocol"},"\u4E0A\u4F20\u5185\u5BB9\u534F\u8BAE"),"\uFF0C\u4E0D\u5F97\u4E0A\u4F20\u672A\u7ECF\u4ED6\u4EBA\u6388\u6743\u7684\u4F5C\u54C1\uFF1B"),t.a.createElement("div",null,"2\u3001\u4E0D\u652F\u6301\u65AD\u70B9\u7EED\u4F20\uFF0C\u6587\u4EF6\u5927\u5C0F\u8BF7\u52FF\u8D85\u8FC71G\uFF1B"),t.a.createElement("div",null,"3\u3001\u652F\u6301\u6587\u4EF6\u683C\u5F0F\uFF1Aavi\u3001flv\u3001f4v\u3001m4v\u3001mov\u3001mp4\u3001rmvb\u3001swf\u3001webm\u3001wmv\uFF1B"))},t.a.createElement("img",{src:me.a,alt:""}))),t.a.createElement("div",{className:Rt.a.del,onClick:function(){return Ln(Mn.name,Mn.loaded==100)}},t.a.createElement("i",{className:"iconfont icon-shanchu7 mr5"}),"\u5220\u9664\u89C6\u9891"))},xn=function(){var Mn;return t.a.createElement(t.a.Fragment,null,(Mn=ir.videoList)===null||Mn===void 0?void 0:Mn.map(function(Cn,Gn){return t.a.createElement(t.a.Fragment,{key:Gn},Cn.loaded==100?en(Cn):Xt(Cn.loaded))}))},hn=function(){p.a.confirm({centered:!0,width:500,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u6CE8\u610F",icon:null,className:"custom-modal-divider",content:"\u60A8\u6B63\u5728\u7F16\u5199\u9898\u89E3\uFF0C\u70B9\u51FB\u5173\u95ED\u540E\uFF0C\u60A8\u7684\u9898\u89E3\u5185\u5BB9\u5C06\u4E0D\u4F1A\u8FDB\u884C\u4FDD\u5B58\u3002",onOk:sn})},Bn=(xt=ir.videoList)===null||xt===void 0?void 0:xt.length;return t.a.createElement("div",{className:Rt.a.listForm},t.a.createElement("header",null,_t?"\u7F16\u8F91":"\u53D1\u5E03","\u9898\u89E3"),t.a.createElement("section",{className:Rt.a.scroll,id:"sss"},t.a.createElement("div",{className:Rt.a.formWrap}," ",t.a.createElement(V.a,{form:ln,scrollToFirstError:!0,layout:"vertical",onValuesChange:ar,onFinish:mr},t.a.createElement(V.a.Item,{name:"name",label:"\u6807\u9898:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u540D\u79F0"},{max:60,message:"\u8BF7\u8F93\u5165\u540D\u79F0\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26"},{whitespace:!0,message:"\u8BF7\u52FF\u8F93\u5165\u7A7A\u683C"}]},t.a.createElement(ne.a,{bordered:!1,placeholder:"\u8BF7\u8F93\u5165\u540D\u79F0\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26",suffix:"".concat(((It=Yn.name)===null||It===void 0?void 0:It.length)||0,"/60")})),t.a.createElement(V.a.Item,{name:"content",label:"\u5185\u5BB9:"},t.a.createElement(Pe.a,{defaultValue:Yn.content||"",watch:!0})))),t.a.createElement("div",{className:Rt.a.upload},Bn?xn():Kt(),t.a.createElement("input",{type:"file",id:"fileUpload",style:{display:"none"},onChange:yn,accept:".mkv, .flv, .f4v, .rmvb, .swf, video/mp4,video/x-m4v,video/flv,video/f4v,video/rmvb,video/swf,video/*"}))),t.a.createElement("div",{className:Rt.a.btns},t.a.createElement(te.a,{onClick:hn,type:"primary",ghost:!0},"\u5173\u95ED"),t.a.createElement(te.a,{loading:rr,disabled:Rn,onClick:function(){return ln.submit()},type:"primary"},"\u53D1\u5E03\u9898\u89E3")))},Et=$e,it=z("cWXX"),Vt=z("/ezw"),At=z("CaVn"),Ft=z.n(At),on=z("s8/Y"),In=z.n(on),Lr=z("JOrW"),Sr=z.n(Lr),Un=z("gqXR"),ur=z.n(Un),mi=z("14J3"),Ar=z("BMrR"),fr=z("jCWc"),br=z("kPKH"),Xr=z("wW8i"),Dr=z.n(Xr),Yr=z("MVJL"),gr=z.n(Yr),gi=function(ct){var xt=ct.id,It=ct.cb,sn=Object(n.useState)(""),fn=Object(o.a)(sn,2),St=fn[0],_t=fn[1];return t.a.createElement("aside",{className:"mt10"},t.a.createElement(Pe.a,{defaultValue:St,id:"writeForumsReviewId",onChange:function(Ct){_t(Ct)},placeholder:"\u6211\u8981\u56DE\u590D...",height:240}),t.a.createElement(Ar.a,null,t.a.createElement(br.a,{flex:"1"}),t.a.createElement(br.a,null,t.a.createElement(te.a,{type:"primary",size:"large",onClick:Object(u.a)(i.a.mark(function Yt(){return i.a.wrap(function(ln){for(;;)switch(ln.prev=ln.next){case 0:St===""?C.b.error("\u8BF7\u8F93\u5165\u5185\u5BB9"):It(xt,St);case 1:case"end":return ln.stop()}},Yt)}))},"\u53D1\u9001"))))},si=function(ct){var xt,It=ct.data;return t.a.createElement("div",{className:gr.a.thirdlyLevelDiscuss},t.a.createElement("span",{className:"c-grey-333"},t.a.createElement("span",{className:"font 14 c-light-primary"},It==null||((xt=It.author)===null||xt===void 0)?void 0:xt.name),"@",t.a.createElement("span",{className:"font 14 c-light-primary"},It==null?void 0:It.parent_name),":"),t.a.createElement(dt.a,{value:It==null?void 0:It.content}))},Pr=function(ct){var xt,It,sn,fn,St=ct.data,_t=ct.onReplyDiscuss,Yt=ct.thirdlyReply,Ct=ct.setThirdlyReply,ln=Object(Qt.x)();return console.log(ln,"user"),t.a.createElement("div",{className:gr.a.list},t.a.createElement("img",{src:x.a.IMG_SERVER+"/images/"+(St==null||((xt=St.author)===null||xt===void 0)?void 0:xt.image_url)}),t.a.createElement("div",{className:gr.a.wrap},t.a.createElement("div",{className:"font14",style:{marginBottom:6}},t.a.createElement("span",{className:"c-grey-333"},St==null||((It=St.author)===null||It===void 0)?void 0:It.name),(ln==null?void 0:ln.login)!==(St==null||((sn=St.author)===null||sn===void 0)?void 0:sn.login)&&t.a.createElement("span",{onClick:function(){return Ct(St==null?void 0:St.id)},className:"c-grey-999 current",style:{float:"right"}},t.a.createElement("i",{className:"iconfont icon-huifu3 mr3 font12"}),t.a.createElement("span",null,"\u56DE\u590D"))),t.a.createElement(dt.a,{value:St==null?void 0:St.content}),St==null||((fn=St.children)===null||fn===void 0)?void 0:fn.map(function(jt){return t.a.createElement(si,{key:jt.id,data:jt})}),Yt===(St==null?void 0:St.id)&&t.a.createElement("div",null,t.a.createElement(gi,{id:St==null?void 0:St.id,cb:_t}),t.a.createElement("div",{style:{textAlign:"end",paddingTop:20},onClick:function(){return Ct(null)},className:"c-light-primary current"},t.a.createElement("i",{style:{transform:"scale(0.7)",display:"inline-block"},className:"iconfont icon-shouqi font12"}),"\u6536\u8D77\u56DE\u590D")),t.a.createElement("div",{className:gr.a.line})))},Fr=function(ct){var xt,It,sn,fn,St=ct.data,_t=ct.onReplyDiscuss,Yt=ct.secondReply,Ct=ct.setSecondReply,ln=ct.thirdlyReply,jt=ct.setThirdlyReply,pn=ct.onPlusDiscuss,Yn=Object(n.useState)(!1),Dn=Object(o.a)(Yn,2),En=Dn[0],er=Dn[1];return console.log(St,"data"),t.a.createElement("div",{className:gr.a.discussItem},t.a.createElement("div",{className:gr.a.list},t.a.createElement("img",{src:x.a.IMG_SERVER+"/images/"+(St==null||((xt=St.author)===null||xt===void 0)?void 0:xt.image_url)}),t.a.createElement("div",{className:gr.a.wrap},t.a.createElement("div",{className:"font14",style:{marginBottom:6}},t.a.createElement("span",{className:"c-grey-333 mr30"},St==null||((It=St.author)===null||It===void 0)?void 0:It.name),t.a.createElement("span",{className:"c-grey-999"},St==null?void 0:St.time)),t.a.createElement(dt.a,{value:St==null?void 0:St.content}),t.a.createElement("div",{className:gr.a.btns},t.a.createElement("div",{onClick:function(){return pn(St==null?void 0:St.id)},className:St!=null&&St.user_praise?"c-light-primary":"c-grey-999"},t.a.createElement("i",{className:"iconfont icon-xiaodianzan2 mr3"}),t.a.createElement("span",null,St==null?void 0:St.praise_count)),t.a.createElement("div",{onClick:function(){var Pn;if((St==null||((Pn=St.children)===null||Pn===void 0)?void 0:Pn.length)===0)return;Ct(null),er(!En)},style:{color:En?"#0152d9":"#999999"}},t.a.createElement("i",{className:"iconfont icon-xiaopinglun2 mr3"}),t.a.createElement("span",null,En?"\u6536\u8D77\u8BC4\u8BBA":St==null||((sn=St.children)===null||sn===void 0)?void 0:sn.length)),t.a.createElement("div",{onClick:function(){er(!1),Ct(Yt===(St==null?void 0:St.id)?null:St==null?void 0:St.id)},style:{color:Yt===(St==null?void 0:St.id)?"#0152d9":"#999999"}},t.a.createElement("i",{className:"iconfont icon-huifu3 mr3"}),t.a.createElement("span",null,Yt===(St==null?void 0:St.id)?"\u6536\u8D77\u56DE\u590D":"\u56DE\u590D"))),Yt===(St==null?void 0:St.id)&&t.a.createElement(gi,{id:St==null?void 0:St.id,cb:function(Pn,Kn){_t(Pn,Kn),er(!0)}}),En&&t.a.createElement("div",{className:gr.a.secondLevelDiscuss},St==null||((fn=St.children)===null||fn===void 0)?void 0:fn.map(function(Rn){return t.a.createElement(Pr,{thirdlyReply:ln,setThirdlyReply:jt,key:Rn.id,data:Rn,onReplyDiscuss:_t})})))))},Ei=Fr,vi=function(ct){var xt=ct.identifier,It=ct.active,sn=ct.onOk,fn=Object(n.useState)(""),St=Object(o.a)(fn,2),_t=St[0],Yt=St[1],Ct=Object(n.useState)(1),ln=Object(o.a)(Ct,2),jt=ln[0],pn=ln[1],Yn=Object(n.useState)([]),Dn=Object(o.a)(Yn,2),En=Dn[0],er=Dn[1],Rn=Object(n.useState)(0),Pn=Object(o.a)(Rn,2),Kn=Pn[0],Cr=Pn[1],rr=Object(n.useState)(null),lr=Object(o.a)(rr,2),pr=lr[0],Er=lr[1],ir=Object(n.useState)(null),dr=Object(o.a)(ir,2),jn=dr[0],Gt=dr[1];Object(n.useEffect)(function(){vn(1),pn(1)},[It]);var vn=function(){var Jn=Object(u.a)(i.a.mark(function yn(Ln){var Kt;return i.a.wrap(function(en){for(;;)switch(en.prev=en.next){case 0:return en.next=2,Ee({container_type:"QuestionSolutionArticle",container_identifier:It,limit:5,page:Ln});case 2:Kt=en.sent,Kt!=null&&Kt.comments&&(er((Kt==null?void 0:Kt.comments)||[]),pn(Ln),Cr(Kt==null?void 0:Kt.disscuss_count));case 4:case"end":return en.stop()}},yn)}));return function(Ln){return Jn.apply(this,arguments)}}(),tr=function(){var Jn=Object(u.a)(i.a.mark(function yn(){var Ln;return i.a.wrap(function(Xt){for(;;)switch(Xt.prev=Xt.next){case 0:if(!(_t==="")){Xt.next=3;break}return C.b.error("\u8BF7\u8F93\u5165\u5185\u5BB9"),Xt.abrupt("return");case 3:return Xt.next=5,Te({comments:{content:_t},container_type:"QuestionSolutionArticle",container_identifier:It});case 5:Ln=Xt.sent,Ln!=null&&Ln.discuss&&(Yt(""),vn(jt),sn());case 7:case"end":return Xt.stop()}},yn)}));return function(){return Jn.apply(this,arguments)}}(),ar=function(){var Jn=Object(u.a)(i.a.mark(function yn(Ln,Kt,Xt){var en;return i.a.wrap(function(hn){for(;;)switch(hn.prev=hn.next){case 0:return hn.next=2,Le({container_type:"QuestionSolutionArticle",container_identifier:It,comments:{content:Kt,parent_id:Ln}});case 2:en=hn.sent,Er(null),Gt(null),vn(jt);case 6:case"end":return hn.stop()}},yn)}));return function(Ln,Kt,Xt){return Jn.apply(this,arguments)}}(),mr=function(){var Jn=Object(u.a)(i.a.mark(function yn(Ln){var Kt;return i.a.wrap(function(en){for(;;)switch(en.prev=en.next){case 0:return en.next=2,Ae(Ln);case 2:Kt=en.sent,vn(jt);case 4:case"end":return en.stop()}},yn)}));return function(Ln){return Jn.apply(this,arguments)}}(),$n=function(yn){pn(yn),vn(yn)};return t.a.createElement("div",{className:Dr.a.discuss},t.a.createElement("aside",{className:Dr.a.reply,style:{borderWidth:Kn?1:0}},t.a.createElement(Pe.a,{defaultValue:_t,id:"writeForumsReviewId",onChange:function(yn){Yt(yn)},placeholder:"\u6211\u8981\u56DE\u590D...",height:240}),t.a.createElement(Ar.a,null,t.a.createElement(br.a,{flex:"1"}),t.a.createElement(br.a,null,t.a.createElement(te.a,{type:"primary",size:"large",onClick:function(){return tr()}},"\u53D1\u9001")))),En==null?void 0:En.map(function(Jn){return t.a.createElement(Ei,{secondReply:pr,setSecondReply:Er,thirdlyReply:jn,setThirdlyReply:Gt,key:Jn.id,data:Jn,onReplyDiscuss:ar,onPlusDiscuss:mr})}),t.a.createElement(De.a,{className:Dr.a.pagination,showTotal:function(yn){return t.a.createElement("span",{style:{color:"#656F87"}},"\u5171",t.a.createElement("span",{className:"c-light-primary"},yn),"\u6761\u6570\u636E")},current:jt,onChange:$n,total:Kn,showSizeChanger:!1,showQuickJumper:!0,hideOnSinglePage:!0,pageSize:5}))},di=vi,Fn=z("hgre"),wn=function(ct){var xt,It,sn,fn,St,_t,Yt,Ct,ln,jt,pn=ct.active,Yn=ct.identifier,Dn=ct.onAssist,En=ct.onEdit,er=ct.onArticlesSkip,Rn=ct.onClose,Pn=ct.onOk,Kn=ct.onDelete,Cr=ct.detailsIndex,rr=ct.btnShowStatus,lr=Object(n.useState)(!0),pr=Object(o.a)(lr,2),Er=pr[0],ir=pr[1],dr=Object(n.useState)({}),jn=Object(o.a)(dr,2),Gt=jn[0],vn=jn[1];Object(n.useEffect)(function(){pn&&tr()},[pn,Cr]);var tr=function(){var yn=Object(u.a)(i.a.mark(function Ln(){var Kt,Xt,en=arguments;return i.a.wrap(function(hn){for(;;)switch(hn.prev=hn.next){case 0:return Kt=en.length>0&&en[0]!==void 0?en[0]:!0,Kt&&ir(!0),hn.next=4,Object(m.d)(Yn,{active:pn});case 4:Xt=hn.sent,(Xt==null?void 0:Xt.status)===0&&vn((Xt==null?void 0:Xt.data)||{}),ir(!1);case 7:case"end":return hn.stop()}},Ln)}));return function(){return yn.apply(this,arguments)}}(),ar=function(){var yn=Object(u.a)(i.a.mark(function Ln(Kt){var Xt;return i.a.wrap(function(xn){for(;;)switch(xn.prev=xn.next){case 0:return xn.next=2,Object(m.g)(Yn,Object(a.a)({active:pn},Kt));case 2:Xt=xn.sent,(Xt==null?void 0:Xt.status)===0&&(tr(!1),Pn());case 4:case"end":return xn.stop()}},Ln)}));return function(Kt){return yn.apply(this,arguments)}}(),mr=function(){var yn=Object(u.a)(i.a.mark(function Ln(Kt){var Xt;return i.a.wrap(function(xn){for(;;)switch(xn.prev=xn.next){case 0:return xn.next=2,Object(m.c)(Yn,{active:Kt==null?void 0:Kt.id});case 2:Xt=xn.sent,Xt.status===0&&(tr(!1),Pn());case 4:case"end":return xn.stop()}},Ln)}));return function(Kt){return yn.apply(this,arguments)}}(),$n=function(Ln){p.a.confirm({centered:!0,width:500,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",icon:null,className:"custom-modal-divider",content:"\u786E\u8BA4\u8981\u5220\u9664\u8BE5\u9898\u89E3\u5417?",onOk:function(){return Kn(Ln)}})},Jn=function(){tr(!1),Pn()};return t.a.createElement("div",{className:Ft.a.listDetails},t.a.createElement(Vt.a,{className:"pt20 pl20 pr20",loading:Er,active:!0,paragraph:{rows:5}},t.a.createElement("div",{className:Ft.a.head},t.a.createElement("div",{className:Ft.a.name},t.a.createElement("div",{title:Gt==null?void 0:Gt.name,className:Ft.a.title},Gt==null?void 0:Gt.name),(Gt==null?void 0:Gt.is_authority)&&t.a.createElement("div",{className:Ft.a.b},"\u5B98\u65B9"),(Gt==null?void 0:Gt.is_excellent)&&t.a.createElement("div",{className:Ft.a.a},"\u7CBE\u9009")),t.a.createElement("div",{className:Ft.a.tag},t.a.createElement("img",{src:x.a.IMG_SERVER+"/images/"+(Gt==null?void 0:Gt.image_url)}),t.a.createElement("div",{className:"c-grey-333 ml5 mr20 font14"},Gt==null?void 0:Gt.username),t.a.createElement("div",{style:{display:"inline-block",marginBottom:-2},className:"c-grey-999 mr20 font12"},"\u53D1\u5E03\u4E8E",He()(Gt==null?void 0:Gt.created_at).format("YYYY-MM-DD")),t.a.createElement("span",null,t.a.createElement("img",{src:K.a}),t.a.createElement("span",null,Gt==null?void 0:Gt.praises_count)),t.a.createElement("span",null,t.a.createElement("img",{src:Oe.a}),t.a.createElement("span",null,Gt==null?void 0:Gt.discusses_count)),t.a.createElement("span",null,t.a.createElement("img",{src:lt.a}),t.a.createElement("span",null,Gt==null?void 0:Gt.viewed_count)),t.a.createElement("div",{className:Ft.a.btn},(Object(Qt.v)()||(Gt==null?void 0:Gt.is_self))&&t.a.createElement(t.a.Fragment,null,t.a.createElement(te.a,{onClick:function(){return $n(Gt)},type:"primary",ghost:!0},"\u5220\u9664"),t.a.createElement(te.a,{onClick:function(){return En(Gt)},type:"primary",ghost:!0},"\u7F16\u8F91")),Object(Qt.v)()&&t.a.createElement(te.a,{onClick:function(){return ar({is_authority:!(Gt!=null&&Gt.is_authority)})},type:"primary"},t.a.createElement("img",{src:Sr.a}),Gt!=null&&Gt.is_authority?"\u53D6\u6D88":"\u8BBE\u4E3A","\u5B98\u65B9"),Object(Qt.v)()&&t.a.createElement(te.a,{onClick:function(){return ar({is_excellent:!(Gt!=null&&Gt.is_excellent)})},type:"primary"},t.a.createElement("img",{src:In.a}),Gt!=null&&Gt.is_excellent?"\u53D6\u6D88":"\u8BBE\u4E3A","\u7CBE\u9009")))),t.a.createElement("div",{className:Ft.a.scroll},(Gt==null||((xt=Gt.videos)===null||xt===void 0||((It=xt[0])===null||It===void 0))?void 0:It.id)&&t.a.createElement("div",{className:Ft.a.video},t.a.createElement(_.a,{tip:"\u6B63\u5728\u8F6C\u7801\uFF0C\u8BF7\u7A0D\u7B49...",spinning:!(Gt!=null&&(sn=Gt.videos)!==null&&sn!==void 0&&(fn=sn[0])!==null&&fn!==void 0&&fn.transcoded)},t.a.createElement(Fn.a,{poster:Gt==null||((St=Gt.videos)===null||St===void 0||((_t=St[0])===null||_t===void 0))?void 0:_t.cover_url,src:(Gt==null||((Yt=Gt.videos)===null||Yt===void 0||((Ct=Yt[0])===null||Ct===void 0))?void 0:Ct.play_url)||"",videoId:Gt==null||((ln=Gt.videos)===null||ln===void 0||((jt=ln[0])===null||jt===void 0))?void 0:jt.id,logWatchHistory:function(){}}))),t.a.createElement(dt.a,{className:Ft.a.html,value:(Gt==null?void 0:Gt.content)||""}),t.a.createElement("div",{onClick:function(){return mr(Gt)},className:Ft.a.g},t.a.createElement("img",{className:"mr10",src:(Gt!=null&&Gt.user_liker,ur.a)}),t.a.createElement("span",null,Gt==null?void 0:Gt.praises_count)),t.a.createElement(di,{onOk:Jn,active:pn,identifier:Yn})),t.a.createElement("div",{className:Ft.a.btns},t.a.createElement(te.a,{onClick:function(){return Rn()},type:"primary",ghost:!0},"\u5173\u95ED"),rr[0]&&t.a.createElement(te.a,{onClick:function(Ln){return er(Ln,"prev")},style:{marginLeft:20},type:"primary"},"\u4E0A\u4E00\u9898\u89E3"),rr[1]&&t.a.createElement(te.a,{onClick:function(Ln){return er(Ln,"next")},style:{marginLeft:20},type:"primary"},"\u4E0B\u4E00\u9898\u89E3"))))},_r=wn,qn=z("3tLw"),kr=z.n(qn),hr=z("ek7X"),Ui=z("0NbB"),Nr=function(ct){var xt=ct.identifier,It=ct.tabStatus,sn=ct.setFilterListTotal,fn=ct.setListStatus,St={page:1,limit:10,total:0,search:"",save_search:"",sort_by:"updated_at",sort_direction:null},_t=Object(n.useState)(Object(a.a)({},St)),Yt=Object(o.a)(_t,2),Ct=Yt[0],ln=Yt[1],jt=Object(n.useState)(!1),pn=Object(o.a)(jt,2),Yn=pn[0],Dn=pn[1],En=Object(n.useState)(0),er=Object(o.a)(En,2),Rn=er[0],Pn=er[1],Kn=Object(n.useState)(1),Cr=Object(o.a)(Kn,2),rr=Cr[0],lr=Cr[1],pr=Object(n.useState)(null),Er=Object(o.a)(pr,2),ir=Er[0],dr=Er[1],jn=Object(n.useState)([]),Gt=Object(o.a)(jn,2),vn=Gt[0],tr=Gt[1],ar=Object(n.useState)([!0,!0]),mr=Object(o.a)(ar,2),$n=mr[0],Jn=mr[1],yn=Object(n.useState)(0),Ln=Object(o.a)(yn,2),Kt=Ln[0],Xt=Ln[1],en=Object(n.useRef)(null);Object(n.useEffect)(function(){Rr()},[It]),Object(n.useEffect)(function(){xn()},[ir]),Object(n.useEffect)(function(){Bn(Object(a.a)({},St)),Rr()},[xt]),Object(n.useEffect)(function(){return window.addEventListener("resize",hn),fn(Kt),function(){window.removeEventListener("resize",hn)}},[Kt]);var xn=function(){var Vn=Object(u.a)(i.a.mark(function Tn(){var nr,sr;return i.a.wrap(function(Nn){for(;;)switch(Nn.prev=Nn.next){case 0:if(ir){Nn.next=3;break}return Jn([!0,!0]),Nn.abrupt("return");case 3:nr=[!0,!0],sr=vn==null?void 0:vn.findIndex(function(ni){return ni.id===ir}),sr===0&&Ct.page===1&&(nr[0]=!1),(Ct.page-1)*Ct.limit+(sr+1)===Ct.total&&(nr[1]=!1),Jn(nr);case 8:case"end":return Nn.stop()}},Tn)}));return function(){return Vn.apply(this,arguments)}}(),hn=function(){if(Kt){var Tn,nr=window.innerWidth-((Tn=en.current)===null||Tn===void 0?void 0:Tn.clientWidth);Pn(nr)}},Bn=function(){var Vn=Object(u.a)(i.a.mark(function Tn(nr){var sr,Hr,Nn,ni;return i.a.wrap(function(Jr){for(;;)switch(Jr.prev=Jr.next){case 0:return Dn(!0),Jr.next=3,Object(m.f)(xt,nr);case 3:return sr=Jr.sent,(sr==null?void 0:sr.status)===0&&(tr((sr==null||((Hr=sr.data)===null||Hr===void 0)?void 0:Hr.articles)||[]),ln(Object(a.a)(Object(a.a)({},nr),{},{total:sr==null||((Nn=sr.data)===null||Nn===void 0)?void 0:Nn.articles_count})),sn(sr==null||((ni=sr.data)===null||ni===void 0)?void 0:ni.articles_count)),Dn(!1),Jr.abrupt("return",sr);case 7:case"end":return Jr.stop()}},Tn)}));return function(nr){return Vn.apply(this,arguments)}}(),bn=function(){(Ct==null?void 0:Ct.sort_direction)===null?Ct.sort_direction="asc":(Ct==null?void 0:Ct.sort_direction)==="asc"?Ct.sort_direction="desc":(Ct==null?void 0:Ct.sort_direction)==="desc"&&(Ct.sort_direction=null),Ct.page=1,Rr(),ln(Object(a.a)({},Ct)),Bn(Ct)},Mn=function(){Ct.page=1,Ct.search=Ct==null?void 0:Ct.save_search,Rr(),ln(Object(a.a)({},Ct)),Bn(Ct)},Cn=function(){var Tn,nr=document.getElementsByClassName("btn-resize");nr[0].style.visibility="hidden";var sr=window.innerWidth-((Tn=en.current)===null||Tn===void 0?void 0:Tn.clientWidth);Pn(sr)},Gn=function(){Cn(),Xt(1)},or=function(Tn){Cn(),dr(Tn==null?void 0:Tn.id),Xt(3)},vr=function(Tn){Cn(),dr(Tn==null?void 0:Tn.id),Xt(2)},Rr=function(){var Tn=document.getElementsByClassName("btn-resize");Tn[0].style.visibility="visible",Pn(0),Xt(0),dr(null)},ei=function(Tn){Xt(3),dr(Tn),Ct.page=1,ln(Object(a.a)({},Ct)),Bn(Ct)},ki=function(Tn){Xt(3),dr(Tn),ln(Object(a.a)({},Ct)),Bn(Ct)},$r=function(Tn){ln(Object(a.a)({},Ct)),Bn(Ct)},ji=function(){var Vn=Object(u.a)(i.a.mark(function Tn(nr){var sr;return i.a.wrap(function(Nn){for(;;)switch(Nn.prev=Nn.next){case 0:return Nn.next=2,Object(m.c)(xt,{active:nr==null?void 0:nr.id});case 2:sr=Nn.sent,sr.status===0&&(Bn(Ct),lr(rr+1));case 4:case"end":return Nn.stop()}},Tn)}));return function(nr){return Vn.apply(this,arguments)}}(),na=function(){var Vn=Object(u.a)(i.a.mark(function Tn(nr){var sr;return i.a.wrap(function(Nn){for(;;)switch(Nn.prev=Nn.next){case 0:return Nn.next=2,Object(m.e)(xt,{active:nr==null?void 0:nr.id});case 2:sr=Nn.sent,sr.status===0&&(Bn(Ct),lr(rr+1));case 4:case"end":return Nn.stop()}},Tn)}));return function(nr){return Vn.apply(this,arguments)}}(),Hi=function(){var Vn=Object(u.a)(i.a.mark(function Tn(nr){var sr;return i.a.wrap(function(Nn){for(;;)switch(Nn.prev=Nn.next){case 0:return Nn.next=2,Object(m.i)(xt,{active:nr==null?void 0:nr.id});case 2:sr=Nn.sent,sr.status===0&&(Rr(),Bn(Ct));case 4:case"end":return Nn.stop()}},Tn)}));return function(nr){return Vn.apply(this,arguments)}}(),ui=function(Tn){Ct.page=Tn,ln(Object(a.a)({},Ct)),Bn(Ct)},zi=function(){var Vn=Object(u.a)(i.a.mark(function Tn(nr,sr){var Hr,Nn,ni,jr,Jr,wi,Mi,Ki,Wn,Sn,Xn;return i.a.wrap(function(kn){for(;;)switch(kn.prev=kn.next){case 0:if(Hr=vn==null?void 0:vn.findIndex(function(Tr){return Tr.id===ir}),console.log(Hr,sr,22),!(sr==="prev")){kn.next=21;break}if(!(Hr===void 0)){kn.next=6;break}return C.b.warn("\u4E0A\u4E00\u9898\u89E3\u4E0D\u5B58\u5728"),kn.abrupt("return");case 6:if(!(Hr===0)){kn.next=19;break}if(!(Ct.page===1)){kn.next=10;break}return C.b.warn("\u4E0A\u4E00\u9898\u89E3\u4E0D\u5B58\u5728"),kn.abrupt("return");case 10:if(!(Ct.page!==1)){kn.next=17;break}return Ct.page=Ct.page-1,ln(Object(a.a)({},Ct)),kn.next=15,Bn(Ct);case 15:Nn=kn.sent,(Nn==null?void 0:Nn.status)===0&&(wi=Nn==null||((ni=Nn.data)===null||ni===void 0)?void 0:ni.articles[(Nn==null||((jr=Nn.data)===null||jr===void 0||((Jr=jr.articles)===null||Jr===void 0))?void 0:Jr.length)-1],dr(wi==null?void 0:wi.id),console.log(nr.target,555));case 17:kn.next=21;break;case 19:Mi=vn[Hr-1],dr(Mi==null?void 0:Mi.id);case 21:if(!(sr==="next")){kn.next=39;break}if(!(Hr===void 0)){kn.next=25;break}return C.b.warn("\u4E0B\u4E00\u9898\u89E3\u4E0D\u5B58\u5728"),kn.abrupt("return");case 25:if(!((Ct.page-1)*Ct.limit+(Hr+1)===Ct.total)){kn.next=28;break}return C.b.warn("\u4E0B\u4E00\u9898\u89E3\u4E0D\u5B58\u5728"),kn.abrupt("return");case 28:if(!(Hr+1===Ct.limit)){kn.next=37;break}return Ct.page=Ct.page+1,ln(Object(a.a)({},Ct)),kn.next=33,Bn(Ct);case 33:Ki=kn.sent,(Ki==null?void 0:Ki.status)===0&&(Sn=Ki==null||((Wn=Ki.data)===null||Wn===void 0)?void 0:Wn.articles[0],dr(Sn==null?void 0:Sn.id)),kn.next=39;break;case 37:Xn=vn[Hr+1],dr(Xn==null?void 0:Xn.id);case 39:case"end":return kn.stop()}},Tn)}));return function(nr,sr){return Vn.apply(this,arguments)}}();return t.a.createElement("div",{className:wt.a.wrap,ref:en},t.a.createElement("div",{className:wt.a.head},t.a.createElement("div",{className:wt.a.sort,onClick:bn},t.a.createElement("span",null,"\u6700\u65B0"),t.a.createElement("aside",null,t.a.createElement(hr.a,{style:{color:(Ct==null?void 0:Ct.sort_direction)==="asc"?"#0152d9":"#bfbfbf"}}),t.a.createElement(Ui.a,{style:{color:(Ct==null?void 0:Ct.sort_direction)==="desc"?"#0152d9":"#bfbfbf"}}))),t.a.createElement(ne.a.Search,{value:Ct.save_search,className:wt.a["oj-width-input"],placeholder:"\u641C\u7D22\u9898\u89E3",onChange:function(Tn){Ct.save_search=Tn.target.value,ln(Object(a.a)({},Ct))},onSearch:Mn}),t.a.createElement("div",{onClick:Gn,className:wt.a.btn},t.a.createElement("img",{src:kr.a}),"\u5199\u9898\u89E3")),t.a.createElement("div",{className:wt.a.listWarp},t.a.createElement(_.a,{spinning:Yn,className:"mt20"},vn==null?void 0:vn.map(function(Vn,Tn){var nr=!0;return Tn+1===vn.length&&Tn!==0&&(nr=!1),t.a.createElement(Nt,{active:ir,key:Vn.id,data:Vn,showLine:nr,onClick:or,onAssist:ji,onHide:na})}),(vn==null?void 0:vn.length)===0&&t.a.createElement(k.a,{customText:"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"}))),t.a.createElement(De.a,{className:wt.a.pagination,showTotal:function(Tn){return t.a.createElement("span",{style:{color:"#656F87"}},"\u5171",t.a.createElement("span",{className:"c-light-primary"},Tn),"\u6761\u6570\u636E")},total:Ct.total,showSizeChanger:!1,current:Ct==null?void 0:Ct.page,onChange:ui,hideOnSinglePage:!0,showQuickJumper:!0}),Kt>0&&t.a.createElement("div",{className:wt.a.fixedRight,style:{width:Rn}},Kt===1&&t.a.createElement(Et,{identifier:xt,onClose:Rr,onOk:ei}),Kt===2&&t.a.createElement(Et,{active:ir,identifier:xt,onClose:Rr,onOk:ki}),Kt===3&&t.a.createElement(_r,{btnShowStatus:$n,onArticlesSkip:zi,detailsIndex:rr,active:ir,identifier:xt,onClose:Rr,onOk:$r,onEdit:vr,onAssist:ji,onDelete:Hi})))},Ur=Nr,yi=z("VEzc"),Zr=z.n(yi),Li=function(ct){var xt,It=ct.visible,sn=ct.onVisible,fn=ct.value,St=ct.onChange,_t=ct.setIndex,Yt={page:1,per_page:30,total:0,tag_discipline_id:[],search:"",save_search:"",difficulty:null},Ct=Object(n.useState)(Yt),ln=Object(o.a)(Ct,2),jt=ln[0],pn=ln[1],Yn=Object(n.useState)([]),Dn=Object(o.a)(Yn,2),En=Dn[0],er=Dn[1],Rn=Object(n.useState)([]),Pn=Object(o.a)(Rn,2),Kn=Pn[0],Cr=Pn[1],rr=Object(n.useState)(!1),lr=Object(o.a)(rr,2),pr=lr[0],Er=lr[1],ir=Object(n.useRef)([]),dr=Object(n.useRef)(null),jn=Object(g.i)();Object(n.useEffect)(function(){return jn!=null&&jn.id&&(dr.current=setInterval(function(){Gt(30)},3e4)),function(){clearInterval(dr.current)}},[]);var Gt=function(){var Kt=Object(u.a)(i.a.mark(function Xt(en){var xn;return i.a.wrap(function(Bn){for(;;)switch(Bn.prev=Bn.next){case 0:return Bn.next=2,Object(m.r)(jn==null?void 0:jn.id,{practice_time:en});case 2:xn=Bn.sent;case 3:case"end":return Bn.stop()}},Xt)}));return function(en){return Kt.apply(this,arguments)}}();Object(n.useEffect)(function(){Jn(jt),mr()},[]),Object(n.useEffect)(function(){return window.addEventListener("click",tr),function(){window.removeEventListener("click",tr)}},[jn==null?void 0:jn.save_identifier,It]),Object(n.useEffect)(function(){var Kt=ir.current.findIndex(function(Bn){return Bn.identifier===(jn==null?void 0:jn.save_identifier)}),Xt=ir.current[Kt-1],en=ir.current[Kt+1],xn=document.getElementById("oj-prev"),hn=document.getElementById("oj-next");Xt?xn.style.display="block":xn.style.display="none",en?hn.style.display="block":hn.style.display="none"},[jn==null?void 0:jn.save_identifier,ir.current]);var vn=function(Xt,en){if(Xt.id===en)return Xt;for(var xn=0,hn=Xt;hn=hn.parentNode;xn++){if(hn.id===en)return hn;if(hn==document.documentElement)return!1}},tr=function(){var Kt=Object(u.a)(i.a.mark(function Xt(en){var xn,hn,Bn;return i.a.wrap(function(Mn){for(;;)switch(Mn.prev=Mn.next){case 0:if(!vn(en.target,"oj-drawer")&&It&&sn(!1),xn=ir.current.findIndex(function(Cn){return Cn.identifier===(jn==null?void 0:jn.save_identifier)}),hn=ir.current[xn-1],Bn=ir.current[xn+1],!(en.target.id==="oj-prev")){Mn.next=14;break}if(!(!hn||xn===-1)){Mn.next=8;break}return C.b.warn("\u4E0A\u4E00\u9898\u4E0D\u5B58\u5728"),Mn.abrupt("return");case 8:return en.target.style.pointerEvents="none",en.target.style.cursor="not-allowed",Mn.next=12,yn(hn==null?void 0:hn.identifier);case 12:_t("0"),setTimeout(function(){en.target.style.pointerEvents="auto",en.target.style.cursor="pointer"},400);case 14:if(!(en.target.id==="oj-next"||en.target.id==="oj-modal-next")){Mn.next=24;break}if(!(!Bn||xn===-1)){Mn.next=18;break}return C.b.warn("\u4E0B\u4E00\u9898\u4E0D\u5B58\u5728"),Mn.abrupt("return");case 18:return en.target.style.pointerEvents="none",en.target.style.cursor="not-allowed",Mn.next=22,yn(Bn==null?void 0:Bn.identifier);case 22:_t("0"),setTimeout(function(){en.target.style.pointerEvents="auto",en.target.style.cursor="pointer"},400);case 24:case"end":return Mn.stop()}},Xt)}));return function(en){return Kt.apply(this,arguments)}}();Object(n.useEffect)(function(){St(jn==null?void 0:jn.save_identifier);var Kt=Kn.findIndex(function(Xt){return Xt.some(function(en){return en.identifier===(jn==null?void 0:jn.save_identifier)})});Kt===-1?pn(Object(a.a)(Object(a.a)({},jt),{},{page:1})):pn(Object(a.a)(Object(a.a)({},jt),{},{page:Kt+1}))},[jn==null?void 0:jn.save_identifier,Kn]);var ar=function(Xt){jt.page=1,jt.tag_discipline_id=Xt,pn(Object(a.a)({},jt)),Jn(jt)},mr=function(){var Kt=Object(u.a)(i.a.mark(function Xt(){var en;return i.a.wrap(function(hn){for(;;)switch(hn.prev=hn.next){case 0:return hn.next=2,Object(Me.a)("/api/tag_disciplines.json",{method:"get",params:{target:"practice",position:"index"}});case 2:en=hn.sent,er(en.tag_disciplines||[]);case 4:case"end":return hn.stop()}},Xt)}));return function(){return Kt.apply(this,arguments)}}(),$n=function(Xt){jt.page=1,jt.difficulty=typeof Xt=="number"?Xt:null,pn(Object(a.a)({},jt)),Jn(jt)},Jn=function(){var Kt=Object(u.a)(i.a.mark(function Xt(en){var xn,hn,Bn,bn,Mn,Cn;return i.a.wrap(function(or){for(;;)switch(or.prev=or.next){case 0:return Er(!0),or.next=3,Object(m.p)(en);case 3:if(xn=or.sent,xn!=null&&xn.practices_list){for(Bn=xn==null||((hn=xn.practices_list)===null||hn===void 0)?void 0:hn.length,bn=[],Mn=0;Mn(kn+3)*1e3,Fi!==0&&!sa&&setTimeout(Kr,1e3),!sa){Mr.next=12;break}return p.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8BC4\u6D4B\u4EE3\u7801\u8D85\u65F6"}),_t({type:qt.SET_SUBMITING,payload:!1}),Mr.abrupt("return");case 12:if(!(Fi===0)){Mr.next=19;break}return Vi.status===2&&p.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8BC4\u6D4B\u4EE3\u7801\u8D85\u65F6"}),Mr.next=16,Object(m.o)(Ct,{limit:15,page:Kn});case 16:Ji=Mr.sent,_t({type:qt.SET_SUBMIT_RESULT,payload:Object(a.a)(Object(a.a)({},St),{},{submitResult:Vi,submitting:!1,submitRecords:Ji})}),(Vi==null?void 0:Vi.status)===0&&en(!0);case 19:case"end":return Mr.stop()}},aa)})),Gr.apply(this,arguments)},Kr=function(){return Gr.apply(this,arguments)},Xn={},mn.next=14,Object(m.s)(Ct,Xn);case 14:if(tn=mn.sent,!(tn.status===-1)){mn.next=18;break}return window.parent.location.href="/classrooms/".concat(jt.query.coursesId,"/exercise/").concat(jt.query.exercisesId,"/detail"),mn.abrupt("return");case 18:kn=bn.time_limit,Tr=Hn(),Kr();case 21:mn.next=26;break;case 23:mn.prev=23,mn.t0=mn.catch(3),_t({type:qt.SET_SUBMITING,payload:!1});case 26:case"end":return mn.stop()}},Wn,null,[[3,23]])})),ji.apply(this,arguments)}function na(){return Hi.apply(this,arguments)}function Hi(){return Hi=Object(u.a)(i.a.mark(function Wn(){var Sn,Xn,tn,kn,Tr,Kr,Gr;return i.a.wrap(function(mn){for(;;)switch(mn.prev=mn.next){case 0:return St.debuging=!0,_t({type:qt.SET_DEBUGING,payload:!0}),mn.prev=2,mn.next=5,ei();case 5:if(Sn=mn.sent,!(Sn.status===0)){mn.next=21;break}return Gr=function(){return Gr=Object(u.a)(i.a.mark(function aa(){var Gi,Fi,Vi,oa,sa,Ji;return i.a.wrap(function(Mr){for(;;)switch(Mr.prev=Mr.next){case 0:return Mr.next=2,Object(m.l)(Ct,"debug");case 2:if(Gi=Mr.sent,Fi=Gi.status,Vi=Gi.message,oa=Gi.data,sa=Hn(),Ji=sa-Tr>(Xn+3)*1e3,Fi!==0&&!Ji&&(_t({type:qt.SET_EXECUTE_MESSAGE,payload:Vi}),setTimeout(Kr,1e3)),!Ji){Mr.next=13;break}return p.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8C03\u8BD5\u4EE3\u7801\u8D85\u65F6"}),_t({type:qt.SET_DEBUGING,payload:!1}),Mr.abrupt("return");case 13:Fi===0&&(_t({type:qt.SET_DEBUGING,payload:!1}),oa.status===2&&p.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8C03\u8BD5\u4EE3\u7801\u8D85\u65F6"}),_t({type:qt.SET_EXECUTE_RESULT,payload:Object(a.a)(Object(a.a)({},St),{},{debugResult:oa,debuging:!1})}));case 14:case"end":return Mr.stop()}},aa)})),Gr.apply(this,arguments)},Kr=function(){return Gr.apply(this,arguments)},Xn=bn.time_limit,tn={input:encodeURIComponent(En.test_case.input)},mn.next=13,Object(m.h)(Ct,tn);case 13:if(kn=mn.sent,!(kn.status===-1)){mn.next=17;break}return window.parent.location.href="/classrooms/".concat(jt.query.coursesId,"/exercise/").concat(jt.query.exercisesId,"/detail"),mn.abrupt("return");case 17:Tr=Hn(),Kr(),mn.next=22;break;case 21:_t({type:qt.SET_DEBUGING,payload:!1});case 22:mn.next=27;break;case 24:mn.prev=24,mn.t0=mn.catch(2),console.log(mn.t0);case 27:return mn.prev=27,mn.finish(27);case 29:case"end":return mn.stop()}},Wn,null,[[2,24,27,29]])})),Hi.apply(this,arguments)}function ui(Wn){var Sn;clearTimeout(xn.current),xn.current=setTimeout(function(){var Xn;ei({code:O.Base64.encode(Wn),language:hn==null||((Xn=hn.current)===null||Xn===void 0)?void 0:Xn.language})},2e3),_t({type:qt.SET_DATA,payload:Object(a.a)(Object(a.a)({},hn==null?void 0:hn.current),{},{hack:Object(a.a)(Object(a.a)({},hn==null||((Sn=hn.current)===null||Sn===void 0)?void 0:Sn.hack),{},{code:Wn})})})}function zi(Wn){var Sn=Wn.target.value;_t({type:qt.SET_DATA,payload:Object(a.a)(Object(a.a)({},En),{},{test_case:{input:Sn}})})}var Vn=function(){var Wn=Object(u.a)(i.a.mark(function Sn(Xn){var tn,kn,Tr,Kr,Gr;return i.a.wrap(function(mn){for(;;)switch(mn.prev=mn.next){case 0:return _t({type:qt.SET_LOADING,payload:!0}),mn.next=3,ei();case 3:if(tn=mn.sent,!(tn.status===0)){mn.next=14;break}return _t({type:qt.SET_SUBMIT_RESULT,payload:{languageValue:Xn}}),hn.current.language=Xn,kn="".concat(Bn==null?void 0:Bn.login,"-language"),localStorage.setItem(kn,Xn),mn.next=11,Object(m.w)(Ct);case 11:Tr=mn.sent,Tr.status===0&&(Gr=Tr==null||((Kr=Tr.data)===null||Kr===void 0)?void 0:Kr.find(function(Bi){return Bi.language===Xn}),ui(O.Base64.decode(Gr.code))),setTimeout(function(){_t({type:qt.SET_LOADING,payload:!1})},300);case 14:case"end":return mn.stop()}},Sn)}));return function(Xn){return Wn.apply(this,arguments)}}();function Tn(){return nr.apply(this,arguments)}function nr(){return nr=Object(u.a)(i.a.mark(function Wn(){var Sn;return i.a.wrap(function(tn){for(;;)switch(tn.prev=tn.next){case 0:return tn.prev=0,tn.next=3,Object(m.q)(Ct,{language:pn});case 3:Sn=tn.sent,Sn.status===401?ln.replace("/login",{from:jt.pathname}):(ui(O.Base64.decode(Sn.code)),or()),tn.next=10;break;case 7:tn.prev=7,tn.t0=tn.catch(0),console.log(tn.t0);case 10:case"end":return tn.stop()}},Wn,null,[[0,7]])})),nr.apply(this,arguments)}function sr(){p.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:t.a.createElement("p",null,"\u521D\u59CB\u4EE3\u7801\u6709\u4FEE\u6539\uFF0C\u66F4\u65B0\u540E\u5C06\u8986\u76D6\u73B0\u6709\u4EE3\u7801\u54E6~ ",t.a.createElement("br",null),"\u8BF7\u5C06\u60A8\u7F16\u8F91\u7684\u4EE3\u7801\u4FDD\u5B58\u81F3\u672C\u5730\uFF0C\u4EE5\u9632\u4E22\u5931"),onOk:function(){return Object(u.a)(i.a.mark(function Sn(){var Xn;return i.a.wrap(function(kn){for(;;)switch(kn.prev=kn.next){case 0:return kn.next=2,Object(m.t)(Ct,{language:pn});case 2:Xn=kn.sent,Xn.status===401?ln.replace("/login",{from:jt.pathname}):ui(O.Base64.decode(Xn.code));case 4:case"end":return kn.stop()}},Sn)}))()}})}function Hr(){_t({type:qt.SET_SHOW_NOTE,payload:!0})}function Nn(){_t({type:qt.SET_SHOW_NOTE,payload:!1})}function ni(Wn){return jr.apply(this,arguments)}function jr(){return jr=Object(u.a)(i.a.mark(function Wn(Sn){return i.a.wrap(function(tn){for(;;)switch(tn.prev=tn.next){case 0:return tn.next=2,Object(m.b)(Ct,Sn);case 2:_t({type:qt.GET_DATA,payload:{showNote:!1,data:Object(a.a)(Object(a.a)({},En),{},{hack:Object(a.a)(Object(a.a)({},bn),{},{notes:Sn.notes})})}});case 3:case"end":return tn.stop()}},Wn)})),jr.apply(this,arguments)}var Jr={input:En==null||((ct=En.test_case)===null||ct===void 0)?void 0:ct.input,language:bn==null?void 0:bn.language,code:bn==null?void 0:bn.code,title:"main."+gn[bn==null?void 0:bn.language],modify_code:bn==null?void 0:bn.modify_code,notes:bn==null?void 0:bn.notes,debugResult:er,debuging:rr,submitting:lr,executingMessage:pr,id:Ct,languageValue:pn,languageList:Yn,onChangeLanguage:Vn,onCancelNote:Nn,onAddNote:ni,showNote:Cr,onShowNote:Hr,onSubmitCode:$r,onChangeCode:ui,onChangeInput:zi,onDebugCode:na,onResetCode:Tn,onSyncCode:sr,onUpdateCode:ei};function wi(){return Mi.apply(this,arguments)}function Mi(){return Mi=Object(u.a)(i.a.mark(function Wn(){var Sn,Xn,tn;return i.a.wrap(function(Tr){for(;;)switch(Tr.prev=Tr.next){case 0:return Tr.next=2,Object(m.u)(bn.id,{container_type:"Hack",type:1});case 2:Sn=Tr.sent,Xn=Sn.praise_count,tn=Object(a.a)(Object(a.a)({},En),{},{hack:Object(a.a)(Object(a.a)({},bn),{},{praises_count:Xn,user_praise:!bn.user_praise})}),_t({type:qt.SET_DATA,payload:tn});case 6:case"end":return Tr.stop()}},Wn)})),Mi.apply(this,arguments)}var Ki={topicId:Ct,submitResult:Rn,submitRecords:Pn,submitting:lr,page:Kn,onPageChange:Rr,hack:bn,user:En==null?void 0:En.user,onTriggerPraise:wi};return console.log(En,hn==null?void 0:hn.current,"data--------"),t.a.createElement(t.a.Fragment,null,t.a.createElement(_.a,{className:"oj-custom-large-spin",size:"large",spinning:Dn},En?t.a.createElement("div",{className:"oj-custom-warp"},t.a.createElement("header",{className:D.a.header,style:{minWidth:1200}},t.a.createElement("div",null,t.a.createElement("img",{src:"".concat(x.a.IMG_SERVER,"/images/").concat(Bn.image_url),alt:"user",width:30}),t.a.createElement("span",null,Bn.name)),t.a.createElement("h2",{className:"flex-wrp flex_box_column flex_box_center"},t.a.createElement("div",null,bn.name),t.a.createElement(Wi,{onChange:function(Sn){},className:"font12 c-grey-999"})),t.a.createElement(dn.CopyToClipboard,{text:"".concat((xt=window.location)===null||xt===void 0?void 0:xt.origin,"/problems/").concat(bn.identifier,"/share"),onCopy:function(){return C.b.success("\u590D\u5236\u9898\u76EE\u94FE\u63A5\u6210\u529F")}},t.a.createElement("span",{className:D.a.btn_back,style:{marginRight:10,cursor:"pointer"}}," ",t.a.createElement("i",{className:"iconfont icon-fenxiang1 font14 mr5"}),"\u5206\u4EAB\u9898\u76EE")),bn.edit_privilege?t.a.createElement(E.a,{className:D.a.btn_back,to:"/problems/".concat(bn.identifier,"/ojedit"),style:{marginRight:10}}," ",t.a.createElement(h.a,null)," \u7F16\u8F91"):null,t.a.createElement(E.a,{className:D.a.btn_back,to:"/problems"}," ",t.a.createElement(v.a,null),"\u9000\u51FA")),t.a.createElement(y.a,{hideResize:!0,className:"my-problems oj-problems",leftChild:t.a.createElement(xi,Ki),rightChild:t.a.createElement(zn,Jr)})):null),t.a.createElement(p.a,{centered:!0,closable:!1,width:680,footer:null,visible:Xt,className:"oj-modal"},t.a.createElement("section",{className:"oj-modal-content"},t.a.createElement("div",{className:"oj-modal-head"},t.a.createElement("img",{src:hi.a,alt:""}),t.a.createElement("i",{onClick:function(){return en(!1)},className:"iconfont icon-guanbi1"})),t.a.createElement("aside",null,t.a.createElement("img",{className:"mr30",src:ea.a}),"\u8FD0\u884C\u65F6\u95F4:\xA0",t.a.createElement("span",{style:{color:"#75d6ba",marginRight:100}},Rn==null?void 0:Rn.execute_time,"s"),"\u4F18\u4E8E",t.a.createElement("span",{style:{color:"#f3b087",margin:"0 5px"}},(Rn==null?void 0:Rn.time_better_than)||100,"%"),"\u7684\u7528\u6237"),t.a.createElement("aside",{className:"mb50"},t.a.createElement("img",{src:pa.a,className:"mr30"}),t.a.createElement("span",{className:"oj-modal-tt"},t.a.createElement("span",null,t.a.createElement("span",null,"\u5360\u7528\u5185\u5B58:\xA0"),t.a.createElement("span",{className:"c-light-primary"},Rn==null?void 0:Rn.execute_memory,"kb")),t.a.createElement("span",null,t.a.createElement("span",null))),"\u4F18\u4E8E",t.a.createElement("span",{style:{color:"#f3b087",margin:"0 5px"}},(Rn==null?void 0:Rn.memory_better_than)||100,"%"),"\u7684\u7528\u6237"),t.a.createElement("div",{id:"oj-modal-next",className:"oj-modal-btn"},"\u8FDB\u5165\u4E0B\u4E00\u9898"))))};function Wr(gt){var ct=gt.languageValue,xt=gt.languageList,It=gt.onChangeLanguage,sn=gt.title,fn=gt.modify_code,St=gt.onSyncCode,_t=gt.onShowCodeSetting,Yt=gt.onResetCode,Ct=Object(g.h)(),ln=function(){p.a.confirm({title:"\u6062\u590D\u521D\u59CB\u4EE3\u7801",icon:t.a.createElement(l.a,null),content:"\u4F60\u5728\u672C\u6587\u4EF6\u4E2D\u4FEE\u6539\u7684\u5185\u5BB9\u5C06\u4E22\u5931\uFF0C\u662F\u5426\u786E\u5B9A\u91CD\u65B0\u52A0\u8F7D\u521D\u59CB\u4EE3\u7801\uFF1F",centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:Yt})};return t.a.createElement("div",{className:"action-bar"},t.a.createElement(w.a,{className:"oj-select",value:ct,style:{width:100},placeholder:"\u9009\u62E9\u8BED\u8A00",onChange:It},xt==null?void 0:xt.map(function(jt){return t.a.createElement(w.a.Option,{key:jt.language,value:jt.language},jt.language)})),t.a.createElement("span",null),t.a.createElement("a",{title:"\u6062\u590D\u521D\u59CB\u4EE3\u7801",onClick:ln},t.a.createElement("i",{className:"iconfont icon-zhongzhi font-20 "})),t.a.createElement("a",{onClick:_t},t.a.createElement("i",{className:"iconfont icon-shezhi"})))}function zn(gt){var ct=gt.id,xt=gt.input,It=gt.showNote,sn=gt.onShowNote,fn=gt.notes,St=gt.onCancelNote,_t=gt.onAddNote,Yt=gt.debugResult,Ct=gt.language,ln=gt.debuging,jt=gt.submitting,pn=gt.executingMessage,Yn=gt.code,Dn=gt.onSubmitCode,En=gt.onDebugCode,er=gt.onChangeCode,Rn=gt.onChangeInput,Pn=gt.onUpdateCode,Kn=Object(Q.a)(gt,["id","input","showNote","onShowNote","notes","onCancelNote","onAddNote","debugResult","language","debuging","submitting","executingMessage","code","onSubmitCode","onDebugCode","onChangeCode","onChangeInput","onUpdateCode"]);function Cr(lr){return t.a.createElement(Wr,Object(le.a)({},Kn,{onShowCodeSetting:lr}))}var rr={id:ct,input:xt,debugResult:Yt,debuging:ln,submitting:jt,executingMessage:pn,onDebugCode:En,onChangeCode:er,onSubmitCode:Dn,onChangeInput:Rn};return t.a.createElement("div",{className:"right-panel"},t.a.createElement(S.a,{language:Ct,value:Yn,onChange:er,ActionBarRender:Cr}),t.a.createElement("div",{className:"note-form-area ".concat(It?"active":"")},t.a.createElement(ce,{onCancel:St,notes:fn,callback:_t})),t.a.createElement(B.b,rr))}},WaYH:function(et,Ve,z){"use strict";var le=z("rePB"),Q=z("Ff2n"),j=z("VTBJ"),w=z("1OyB"),P=z("vuIU"),_=z("JX7q"),T=z("Ji7U"),C=z("LK+K"),c=z("q1tI"),p=z("TSYQ"),u=z.n(p),o=z("sboe"),a=z("OZM5"),d=function(E){var m=E.prefixCls,y=E.level,x=E.isStart,l=E.isEnd;if(!y)return null;for(var S="".concat(m,"-indent-unit"),O=[],A=0;A1&&arguments[1]!==void 0?arguments[1]:!1,Se=de.getAttribute("id")||de.getAttribute("data-reactid")||de.getAttribute("name");if(Ce&&I[Se])return I[Se];var De=window.getComputedStyle(de),be=De.getPropertyValue("box-sizing")||De.getPropertyValue("-moz-box-sizing")||De.getPropertyValue("-webkit-box-sizing"),_e=parseFloat(De.getPropertyValue("padding-bottom"))+parseFloat(De.getPropertyValue("padding-top")),Ke=parseFloat(De.getPropertyValue("border-bottom-width"))+parseFloat(De.getPropertyValue("border-top-width")),Ne=D.map(function(ze){return"".concat(ze,":").concat(De.getPropertyValue(ze))}).join(";"),Be={sizingStyle:Ne,paddingSize:_e,borderSize:Ke,boxSizing:be};return Ce&&Se&&(I[Se]=Be),Be}function te(de){var Ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Se=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,De=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;B||(B=document.createElement("textarea"),B.setAttribute("tab-index","-1"),B.setAttribute("aria-hidden","true"),document.body.appendChild(B)),de.getAttribute("wrap")?B.setAttribute("wrap",de.getAttribute("wrap")):B.removeAttribute("wrap");var be=H(de,Ce),_e=be.paddingSize,Ke=be.borderSize,Ne=be.boxSizing,Be=be.sizingStyle;B.setAttribute("style","".concat(Be,";").concat(A)),B.value=de.value||de.placeholder||"";var ze=Number.MIN_SAFE_INTEGER,ye=Number.MAX_SAFE_INTEGER,pe=B.scrollHeight,We;if(Ne==="border-box"?pe+=Ke:Ne==="content-box"&&(pe-=_e),Se!==null||De!==null){B.value=" ";var He=B.scrollHeight-_e;Se!==null&&(ze=He*Se,Ne==="border-box"&&(ze=ze+_e+Ke),pe=Math.max(ze,pe)),De!==null&&(ye=He*De,Ne==="border-box"&&(ye=ye+_e+Ke),We=pe>ye?"":"hidden",pe=Math.min(ye,pe))}return{height:pe,minHeight:ze,maxHeight:ye,overflowY:We,resize:"none"}}var W=z("Gytx"),V=z.n(W),X;(function(de){de[de.NONE=0]="NONE",de[de.RESIZING=1]="RESIZING",de[de.RESIZED=2]="RESIZED"})(X||(X={}));var ne=function(de){Object(w.a)(Se,de);var Ce=Object(P.a)(Se);function Se(De){var be;return Object(Q.a)(this,Se),be=Ce.call(this,De),be.nextFrameActionId=void 0,be.resizeFrameId=void 0,be.textArea=void 0,be.saveTextArea=function(_e){be.textArea=_e},be.handleResize=function(_e){var Ke=be.state.resizeStatus,Ne=be.props,Be=Ne.autoSize,ze=Ne.onResize;if(Ke!==X.NONE)return;typeof ze=="function"&&ze(_e),Be&&be.resizeOnNextFrame()},be.resizeOnNextFrame=function(){cancelAnimationFrame(be.nextFrameActionId),be.nextFrameActionId=requestAnimationFrame(be.resizeTextarea)},be.resizeTextarea=function(){var _e=be.props.autoSize;if(!_e||!be.textArea)return;var Ke=_e.minRows,Ne=_e.maxRows,Be=te(be.textArea,!1,Ke,Ne);be.setState({textareaStyles:Be,resizeStatus:X.RESIZING},function(){cancelAnimationFrame(be.resizeFrameId),be.resizeFrameId=requestAnimationFrame(function(){be.setState({resizeStatus:X.RESIZED},function(){be.resizeFrameId=requestAnimationFrame(function(){be.setState({resizeStatus:X.NONE}),be.fixFirefoxAutoScroll()})})})})},be.renderTextArea=function(){var _e=be.props,Ke=_e.prefixCls,Ne=Ke===void 0?"rc-textarea":Ke,Be=_e.autoSize,ze=_e.onResize,ye=_e.className,pe=_e.disabled,We=be.state,He=We.textareaStyles,nt=We.resizeStatus,re=Object(l.a)(be.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),k=O()(Ne,ye,Object(C.a)({},"".concat(Ne,"-disabled"),pe));"value"in re&&(re.value=re.value||"");var U=Object(T.a)(Object(T.a)(Object(T.a)({},be.props.style),He),nt===X.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return _.createElement(x,{onResize:be.handleResize,disabled:!(Be||ze)},_.createElement("textarea",Object(le.a)({},re,{className:k,style:U,ref:be.saveTextArea})))},be.state={textareaStyles:{},resizeStatus:X.NONE},be}return Object(j.a)(Se,[{key:"componentDidUpdate",value:function(be){(be.value!==this.props.value||!V()(be.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 be=this.textArea.selectionStart,_e=this.textArea.selectionEnd;this.textArea.setSelectionRange(be,_e)}}catch(Ke){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Se}(_.Component),$=ne,ee=function(de){Object(w.a)(Se,de);var Ce=Object(P.a)(Se);function Se(De){var be;Object(Q.a)(this,Se),be=Ce.call(this,De),be.resizableTextArea=void 0,be.focus=function(){be.resizableTextArea.textArea.focus()},be.saveTextArea=function(Ke){be.resizableTextArea=Ke},be.handleChange=function(Ke){var Ne=be.props.onChange;be.setValue(Ke.target.value,function(){be.resizableTextArea.resizeTextarea()}),Ne&&Ne(Ke)},be.handleKeyDown=function(Ke){var Ne=be.props,Be=Ne.onPressEnter,ze=Ne.onKeyDown;Ke.keyCode===13&&Be&&Be(Ke),ze&&ze(Ke)};var _e=typeof De.value=="undefined"||De.value===null?De.defaultValue:De.value;return be.state={value:_e},be}return Object(j.a)(Se,[{key:"setValue",value:function(be,_e){"value"in this.props||this.setState({value:be},_e)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return _.createElement($,Object(le.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(be){return"value"in be?{value:be.value}:null}}]),Se}(_.Component),ce=Ve.default=ee},Z8dc:function(et,Ve,z){et.exports={flex_box_center:"flex_box_center___3U5jH",flex_space_between:"flex_space_between___10tgP",flex_box_vertical_center:"flex_box_vertical_center___1e5pu",flex_box_center_end:"flex_box_center_end___WDBuM",flex_box_column:"flex_box_column___3TSEG",listForm:"listForm___264Pu",scroll:"scroll___CK9uS",formWrap:"formWrap___2n6e2",btns:"btns___2wuct",main:"main___1WFqr",mainLoading:"mainLoading___1kJWi",tip:"tip___10JaH",proWarp:"proWarp___TMP84",pro:"pro___1CLLm",mainSucceed:"mainSucceed___3NYgf",del:"del___34rdE"}},ZD9Y:function(et,Ve,z){"use strict";var le=z("BoS7"),Q=z("Sdc0"),j=z("OaEy"),w=z("2fM7"),P=z("q1tI"),_=z.n(P),T=z("lOMy"),C=z.n(T),c=w.a.Option;Ve.a=function(p){var u=p.onFontSizeChange,o=p.cmFontSize,a=p.cmCodeMode,d=p.onCodeModeChange,s=p.onTabToSpace,f=p.className,i=f===void 0?"":f,n=p.tabToSpace,t=p.children;return _.a.createElement("div",{className:"tpi-code-setting ".concat(i)},_.a.createElement("h3",null,"\u4EE3\u7801\u7F16\u8F91\u5668"),_.a.createElement("section",null,_.a.createElement("div",{className:"file-item"},_.a.createElement("b",null,"\u98CE\u683C\u5207\u6362"),_.a.createElement(w.a,{bordered:!1,size:"small",value:a,onChange:d},_.a.createElement(c,{value:"vs"},"\u6D45\u8272\u98CE\u683C"),_.a.createElement(c,{value:"vs-dark"},"\u6DF1\u8272\u98CE\u683C"))),_.a.createElement("div",{className:"file-item"},_.a.createElement("b",null,"\u5B57\u4F53\u5927\u5C0F"),_.a.createElement(w.a,{bordered:!1,size:"small",value:o,onChange:u},_.a.createElement(c,{value:12},"12px"),_.a.createElement(c,{value:14},"14px"),_.a.createElement(c,{value:16},"16px"),_.a.createElement(c,{value:18},"18px"),_.a.createElement(c,{value:20},"20px"),_.a.createElement(c,{value:22},"22px"))),_.a.createElement("div",{className:"file-item"},_.a.createElement("b",null,"Tab\u8F6C\u6362"),_.a.createElement(Q.a,{checked:n,onChange:s}))),_.a.createElement("h3",null,"\u5FEB\u6377\u952E"),_.a.createElement("section",null,_.a.createElement("div",{className:"file-item"},_.a.createElement("b",null,"\u4FDD\u5B58\u4EE3\u7801"),_.a.createElement("span",null,"Ctrl + S")),_.a.createElement("div",{className:"file-item"},_.a.createElement("b",null,"\u5524\u51FA\u5FEB\u6377\u952E\u5217\u8868"),_.a.createElement("span",null,"F1 / Alt + F1")),_.a.createElement("div",{className:"file-item"},_.a.createElement("b",null,"\u5DE6\u53F3\u7F29\u8FDB"),_.a.createElement("span",null,"Ctrl + ]/[")),_.a.createElement("div",{className:"file-item"},_.a.createElement("b",null,"\u8DF3\u5230\u5339\u914D\u7684\u62EC\u53F7"),_.a.createElement("span",null,"Ctrl + Shift + \\")),_.a.createElement("div",{className:"file-item"},_.a.createElement("b",null,"\u8F6C\u5230\u884C\u9996"),_.a.createElement("span",null,"Home")),_.a.createElement("div",{className:"file-item"},_.a.createElement("b",null,"\u8F6C\u5230\u884C\u5C3E"),_.a.createElement("span",null,"End"))),t)}},ZW9T:function(et,Ve,z){"use strict";z.d(Ve,"a",function(){return v});var le=z("k1fw"),Q=z("miYZ"),j=z("tsqr"),w=z("rAM+"),P=z("tJVT"),_=z("PpiC"),T=z("q1tI"),C=z.n(T),c=z("bdgK");function p(g,b,E,m,y){var x=b.getWordUntilPosition(E),l={startLineNumber:E.lineNumber,endLineNumber:E.lineNumber,startColumn:x.startColumn,endColumn:x.endColumn},S=m.map(function(O){return{label:O,kind:g.languages.CompletionItemKind.Keyword,insertText:O,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:l}});return y.map(function(O){S.push(Object(le.a)(Object(le.a)({},O),{},{range:l}))}),S}var u=function(g){var b={label:"ifelse",kind:g.languages.CompletionItemKind.Method,insertText:["if (${1:condition}) {"," $0","} else {"," ","}"].join(` `),insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet},E=["auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while","inline","restrict","_Bool","_Complex","_Imaginary","_Alignas","_Alignof","_Atomic","_Static_assert","_Noreturn","_Thread_local","_Generic"];g.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(l,S){var O=p(g,l,S,E,[b]);return{suggestions:O}}});var m=["False","None","True","and","as","assert","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","nonlocal","not","or","pass","raise","return","try","while","with","yield"];g.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(l,S){var O=[{label:"print",kind:g.languages.CompletionItemKind.Snippet,insertText:["print($0)"].join(` `),insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet}],A=p(g,l,S,m,O);return{suggestions:A}}});var y=["abstract","assert","boolean","break","byte","case","catch","char","class","const","continue","default","do","double","else","enum","extends","final","finally","float","for","goto","if","implements","import","instance of","int","interface","long","native","new","package","private","protected","public","return","strictfp","short","static","super","switch","synchronized","this","throw","throws","transient","try","void","volatile","while"];g.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(l,S){var O=[b,{label:"main",kind:g.languages.CompletionItemKind.Snippet,insertText:["public static void main(String[] args) {"," $0","}"].join(` `),insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet},{label:"System.out.print",kind:g.languages.CompletionItemKind.Snippet,insertText:["System.out.print($0)"].join(` `),insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet}],A=p(g,l,S,y,O);return{suggestions:A}}})},o="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",a=z("LvDl");function d(g){return/^\d+$/.test(g)?"".concat(g,"px"):g}function s(){}var f=!1,i={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python"};function n(){var g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],b=g;if(Array.isArray(g)){for(var E=0;E0||Tt.target.offsetWidth>0)&&ye.current.instance.layout()}}catch(Ht){Ze.e(Ht)}finally{Ze.f()}}),Le.observe(ze.current)),Le}function Y(){j.b.warn(decodeURIComponent(o))}var J=function(){var Te=ye.current.instance;if(x!=null&&Te&&k){var Ze=Te.getModel();Ze&&x!==Ze.getValue()&&(f=!0,Ze.setValue(x),Te.layout(),f=!1)}};Object(T.useEffect)(function(){pe.current&&clearTimeout(pe.current),pe.current=setTimeout(function(){J()},500)},[x,k,ye.current]);function xe(){var Le=ye.current.instance;if(Le){var Te=Le.getSelection(),Ze=ye.current.pastePos||{},ut=new t.Range(Ze.startLineNumber||Te.endLineNumber,Ze.startColumn||Te.endColumn,Ze.endLineNumber||Te.endLineNumber,Ze.endColumn||Te.endColumn);setTimeout(function(){Le.executeEdits("",[{range:ut,text:""}])},300)}}function ke(Le){(window.navigator.platform.match("Mac")?Le.metaKey:Le.ctrlKey)&&Le.keyCode==83&&(Le.preventDefault(),X())}var dt=function(){if($&&ye.current.instance){var Te=ye.current.instance.getContentHeight();Ee(Te0||Se.target.offsetWidth>0)&&$.layout()}}catch(De){de.e(De)}finally{de.f()}}),ee.observe(D.current)),ee}Object(T.useEffect)(function(){D.current&&z.e(27).then(z.t.bind(null,"M/lh",7)).then(function($){t=$;var ee=t.editor.createDiffEditor(D.current,Object(le.a)(Object(le.a)({enableSplitViewResizing:!1,scrollBeyondLastLine:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1,horizontal:"hidden",lineNumbers:"off",ignoreTrimWhitespace:!1,followsCaret:!0,ignoreCharChanges:!0,minimap:{enabled:!1},readOnly:!0},A),{},{wordWrap:!0}));te(ee);var ce=W(ee);return function(){ee.dispose();var de=ee.getModel();de&&de.dispose(),ce.unobserve(D.current)}})},[]),Object(T.useEffect)(function(){H&&H.setModel({original:t.editor.createModel(x,S),modified:t.editor.createModel(l,S)})},[x,l,S,H]);var V=d(E),X=d(y),ne={width:V,height:X};return C.a.createElement("div",{className:"my-diff-editor",ref:D,style:ne})}},ZpRC:function(et,Ve,z){"use strict";function le(u){return typeof u=="object"&&u!=null&&u.nodeType===1}function Q(u,o){return(!o||u!=="hidden")&&u!=="visible"&&u!=="clip"}function j(u,o){if(u.clientHeighto||f>u&&i=o&&n>=a?f-u-d:i>o&&na?i-o+s:0}var P=function(u,o){var a=window,d=o.scrollMode,s=o.block,f=o.inline,i=o.boundary,n=o.skipOverflowHiddenElements,t=typeof i=="function"?i:function(He){return He!==i};if(!le(u))throw new TypeError("Invalid target");for(var h=document.scrollingElement||document.documentElement,v=[],g=u;le(g)&&t(g);){if((g=g.parentElement)===h){v.push(g);break}g!=null&&g===document.body&&j(g)&&!j(document.documentElement)||g!=null&&j(g,n)&&v.push(g)}for(var b=a.visualViewport?a.visualViewport.width:innerWidth,E=a.visualViewport?a.visualViewport.height:innerHeight,m=window.scrollX||pageXOffset,y=window.scrollY||pageYOffset,x=u.getBoundingClientRect(),l=x.height,S=x.width,O=x.top,A=x.right,D=x.bottom,I=x.left,B=s==="start"||s==="nearest"?O:s==="end"?D:O+l/2,H=f==="center"?I+S/2:f==="end"?A:I,te=[],W=0;W=0&&I>=0&&D<=E&&A<=b&&O>=ee&&D<=de&&I>=Ce&&A<=ce)return te;var Se=getComputedStyle(V),De=parseInt(Se.borderLeftWidth,10),be=parseInt(Se.borderTopWidth,10),_e=parseInt(Se.borderRightWidth,10),Ke=parseInt(Se.borderBottomWidth,10),Ne=0,Be=0,ze="offsetWidth"in V?V.offsetWidth-V.clientWidth-De-_e:0,ye="offsetHeight"in V?V.offsetHeight-V.clientHeight-be-Ke:0;if(h===V)Ne=s==="start"?B:s==="end"?B-E:s==="nearest"?w(y,y+E,E,be,Ke,y+B,y+B+l,l):B-E/2,Be=f==="start"?H:f==="center"?H-b/2:f==="end"?H-b:w(m,m+b,b,De,_e,m+H,m+H+S,S),Ne=Math.max(0,Ne+y),Be=Math.max(0,Be+m);else{Ne=s==="start"?B-ee-be:s==="end"?B-de+Ke+ye:s==="nearest"?w(ee,de,ne,be,Ke+ye,B,B+l,l):B-(ee+ne/2)+ye/2,Be=f==="start"?H-Ce-De:f==="center"?H-(Ce+$/2)+ze/2:f==="end"?H-ce+_e+ze:w(Ce,ce,$,De,_e+ze,H,H+S,S);var pe=V.scrollLeft,We=V.scrollTop;B+=We-(Ne=Math.max(0,Math.min(We+Ne,V.scrollHeight-ne+ye))),H+=pe-(Be=Math.max(0,Math.min(pe+Be,V.scrollWidth-$+ze)))}te.push({el:V,top:Ne,left:Be})}return te};function _(u){return u===Object(u)&&Object.keys(u).length!==0}function T(u,o){o===void 0&&(o="auto");var a="scrollBehavior"in document.body.style;u.forEach(function(d){var s=d.el,f=d.top,i=d.left;s.scroll&&a?s.scroll({top:f,left:i,behavior:o}):(s.scrollTop=f,s.scrollLeft=i)})}function C(u){return u===!1?{block:"end",inline:"nearest"}:_(u)?u:{block:"start",inline:"nearest"}}function c(u,o){var a=!u.ownerDocument.documentElement.contains(u);if(_(o)&&typeof o.behavior=="function")return o.behavior(a?[]:P(u,o));if(a)return;var d=C(o);return T(P(u,d),d.behavior)}var p=Ve.a=c},ZsLC:function(et,Ve,z){et.exports={"left-panel":"left-panel___FTwwW","tab-panel-body":"tab-panel-body___2YSOx",b1:"b1___3qx3o","oj-mr":"oj-mr___1GA9N","oj-width-input":"oj-width-input___3GkyP","s-navs":"s-navs___1fGGf","bg-white":"bg-white___1ZAy0",active:"active___39N6D"}},aRTE:function(et,Ve){et.exports={L:1,M:0,Q:3,H:2}},bCnd:function(et,Ve,z){"use strict";z.d(Ve,"b",function(){return w}),z.d(Ve,"a",function(){return P});var le=z("je13"),Q=z.n(le),j=!1;function w(_,T){var C=Q.a.get("__ec");C||(C={}),C[_]=T,Q.a.set("__ec",C)}function P(_,T){var C=Q.a.get("__ec");return C?C[_]===void 0?T:C[_]:T}},bT9E:function(et,Ve,z){"use strict";z.d(Ve,"a",function(){return Q});var le=z("VTBJ");function Q(j,w){var P=Object(le.a)({},j);return Array.isArray(w)&&w.forEach(function(_){delete P[_]}),P}},bdLU:function(et,Ve,z){"use strict";z.d(Ve,"a",function(){return le});var le;(function(Q){Q[Q.NOMATCH=-1]="NOMATCH",Q[Q.OK=0]="OK",Q[Q.TIMEOUT=2]="TIMEOUT",Q[Q.PODFAILURE=3]="PODFAILURE",Q[Q.COMPILEFAILURE=4]="COMPILEFAILURE",Q[Q.EXECUTEFAILURE=5]="EXECUTEFAILURE"})(le||(le={}))},biw7:function(et,Ve,z){"use strict";var le=z("q1tI"),Q=z.n(le),j=le.createContext(null);Ve.a=j},c5Ni:function(et,Ve,z){},cDPC:function(et,Ve,z){"use strict";var le=z("tJVT"),Q=z("q1tI"),j=z.n(Q),w=z("i3hx"),P=z.n(w);Ve.a=function(_){var T=_.defaultX,C=T===void 0?"40%":T,c=_.leftChild,p=_.rightChild,u=_.className,o=_.hideResize,a=o===void 0?!1:o,d=Object(Q.useState)(C),s=Object(le.a)(d,2),f=s[0],i=s[1],n=Object(Q.useRef)();function t(){n.current=!0}Object(Q.useEffect)(function(){function g(E){n.current&&i(E.pageX)}function b(){n.current=!1}return window.addEventListener("mousemove",g),window.addEventListener("mouseup",b),function(){window.removeEventListener("mousemove",g),window.removeEventListener("mouseup",b)}},[]);var h=typeof f=="number"&&f!==.01?"".concat(f,"px"):C,v="calc(100% - ".concat(a?"0px":"4px"," - ").concat(h,")");return j.a.createElement("div",{className:"split-panel-container ".concat(u)},j.a.createElement("section",{style:{width:h,display:f===.01?"none":""}},c),j.a.createElement("section",{className:"resize-x-bar",onMouseDown:t},j.a.createElement("a",{className:"btn-resize"},j.a.createElement("svg",{width:"16",height:"13",viewBox:"0 0 16 13"},j.a.createElement("path",{d:"M12.245 7.53H5.647v1.882h6.598v2.823L16 8.471l-3.755-3.765V7.53zM10.353 4.706H3.755v2.823L0 3.765 3.755 0v2.824h6.598v1.882z"})))),j.a.createElement("section",{style:{width:v}},p))}},dQei:function(et,Ve){for(var z={glog:function(Q){if(Q<1)throw new Error("glog("+Q+")");return z.LOG_TABLE[Q]},gexp:function(Q){for(;Q<0;)Q+=255;for(;Q>=256;)Q-=255;return z.EXP_TABLE[Q]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},le=0;le<8;le++)z.EXP_TABLE[le]=1<1?$-1:0),ce=1;ce<$;ce++)ee[ce-1]=arguments[ce];W.apply(void 0,[H].concat(ee))}},D.onKeyUp=function(H){var te=D.props.onKeyUp;if(D.stop(),D.recordCursorPosition(),te){for(var W=arguments.length,V=new Array(W>1?W-1:0),X=1;X=0)return parseInt(te.slice(te.indexOf("e-")+2),10);var W=0;return te.indexOf(".")>=0&&(W=te.length-te.indexOf(".")-1),W},D.getInputDisplayValue=function(H){var te=H||D.state,W=te.focused,V=te.inputValue,X=te.value,ne;W?ne=V:ne=D.toPrecisionAsStep(X),ne==null&&(ne="");var $=D.formatWrapper(ne);return b(D.props.decimalSeparator)&&($=$.toString().replace(".",D.props.decimalSeparator)),$},D.recordCursorPosition=function(){try{D.cursorStart=D.input.selectionStart,D.cursorEnd=D.input.selectionEnd,D.currentValue=D.input.value,D.cursorBefore=D.input.value.substring(0,D.cursorStart),D.cursorAfter=D.input.value.substring(D.cursorEnd)}catch(H){}},D.restoreByAfter=function(H){if(H===void 0)return!1;var te=D.input.value,W=te.lastIndexOf(H);if(W===-1)return!1;var V=D.cursorBefore.length;return D.lastKeyCode===o.a.DELETE&&D.cursorBefore.charAt(V-1)===H[0]?(D.fixCaret(V,V),!0):W+H.length===te.length?(D.fixCaret(W,W),!0):!1},D.partRestoreByAfter=function(H){return H===void 0?!1:Array.prototype.some.call(H,function(te,W){var V=H.substring(W);return D.restoreByAfter(V)})},D.isNotCompleteNumber=function(H){return isNaN(H)||H===""||H===null||H&&H.toString().indexOf(".")===H.toString().length-1},D.stop=function(){D.autoStepTimer&&clearTimeout(D.autoStepTimer)},D.down=function(H,te,W){D.pressingUpOrDown=!0,D.step("down",H,te,W)},D.up=function(H,te,W){D.pressingUpOrDown=!0,D.step("up",H,te,W)},D.saveInput=function(H){D.input=H};var I=A.value;I===void 0&&(I=A.defaultValue),D.state={focused:A.autoFocus};var B=D.getValidValue(D.toNumber(I));return D.state=d(d({},D.state),{},{inputValue:D.toPrecisionAsStep(B),value:B}),D}return Object(w.a)(O,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(D){var I=this.props,B=I.value,H=I.onChange,te=I.max,W=I.min,V=this.state.focused;if(D){if(!E(D.value,B)||!E(D.max,te)||!E(D.min,W)){var X=V?B:this.getValidValue(B),ne;this.pressingUpOrDown?ne=X:this.inputting?ne=this.rawInput:ne=this.toPrecisionAsStep(X),this.setState({value:X,inputValue:ne})}var $="value"in this.props?B:this.state.value;"max"in this.props&&D.max!==te&&typeof $=="number"&&$>te&&H&&H(te),"min"in this.props&&D.min!==W&&typeof $=="number"&&$1&&arguments[1]!==void 0?arguments[1]:this.props.min,B=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,H=parseFloat(D);return isNaN(H)?D:(HB&&(H=B),H)}},{key:"setValue",value:function(D,I){var B=this.props.precision,H=this.isNotCompleteNumber(parseFloat(D))?null:parseFloat(D),te=this.state.value,W=te===void 0?null:te,V=this.state.inputValue,X=V===void 0?null:V,ne=typeof H=="number"?H.toFixed(B):"".concat(H),$=H!==W||ne!=="".concat(X);return"value"in this.props?(X=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:X},I)):this.setState({value:H,inputValue:this.toPrecisionAsStep(D)},I),$&&this.props.onChange(H),H}},{key:"getMaxPrecision",value:function(D){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,B=this.props,H=B.precision,te=B.step;if(b(H))return H;var W=this.getPrecision(I),V=this.getPrecision(te),X=this.getPrecision(D);return D?Math.max(X,W+V):W+V}},{key:"getPrecisionFactor",value:function(D){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,B=this.getMaxPrecision(D,I);return Math.pow(10,B)}},{key:"focus",value:function(){this.input.focus(),this.recordCursorPosition()}},{key:"blur",value:function(){this.input.blur()}},{key:"select",value:function(){this.input.select()}},{key:"formatWrapper",value:function(D){return this.props.formatter?this.props.formatter(D):D}},{key:"toPrecisionAsStep",value:function(D){if(this.isNotCompleteNumber(D)||D==="")return D;var I=Math.abs(this.getMaxPrecision(D));return isNaN(I)?D.toString():Number(D).toFixed(I)}},{key:"toNumber",value:function(D){var I=this.props.precision,B=this.state.focused,H=D&&D.length>16&&B;return this.isNotCompleteNumber(D)||H?D:b(I)?Math.round(D*Math.pow(10,I))/Math.pow(10,I):Number(D)}},{key:"upStep",value:function(D,I){var B=this.props.step,H=this.getPrecisionFactor(D,I),te=Math.abs(this.getMaxPrecision(D,I)),W=((H*D+H*B*I)/H).toFixed(te);return this.toNumber(W)}},{key:"downStep",value:function(D,I){var B=this.props.step,H=this.getPrecisionFactor(D,I),te=Math.abs(this.getMaxPrecision(D,I)),W=((H*D-H*B*I)/H).toFixed(te);return this.toNumber(W)}},{key:"step",value:function(D,I){var B=this,H=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,te=arguments.length>3?arguments[3]:void 0;this.stop(),I&&(I.persist(),I.preventDefault());var W=this.props;if(W.disabled)return;var V=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(V))return;var X=this["".concat(D,"Step")](V,H),ne=X>W.max||XW.max?X=W.max:X=ee),Xe=(ke||ke===0)&&(isNaN(ke)||Number(ke)<=ce),Fe=Qe||H||te,Ie=Xe||H||te,Me=u()("".concat(B,"-handler"),"".concat(B,"-handler-up"),Object(Q.a)({},"".concat(B,"-handler-up-disabled"),Fe)),Ee=u()("".concat(B,"-handler"),"".concat(B,"-handler-down"),Object(Q.a)({},"".concat(B,"-handler-down-disabled"),Ie)),Ae=W?{onTouchStart:Fe?i:this.up,onTouchEnd:this.stop}:{onMouseDown:Fe?i:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},Le=W?{onTouchStart:Ie?i:this.down,onTouchEnd:this.stop}:{onMouseDown:Ie?i:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return c.a.createElement("div",{className:Ue,style:de,title:Ce,onMouseEnter:Se,onMouseLeave:De,onMouseOver:be,onMouseOut:_e,onFocus:function(){return null},onBlur:function(){return null}},c.a.createElement("div",{className:"".concat(B,"-handler-wrap")},c.a.createElement("span",Object.assign({unselectable:"on"},Ae,{role:"button","aria-label":"Increase Value","aria-disabled":Fe,className:Me}),X||c.a.createElement("span",{unselectable:"on",className:"".concat(B,"-handler-up-inner"),onClick:n})),c.a.createElement("span",Object.assign({unselectable:"on"},Le,{role:"button","aria-label":"Decrease Value","aria-disabled":Ie,className:Ee}),ne||c.a.createElement("span",{unselectable:"on",className:"".concat(B,"-handler-down-inner"),onClick:n}))),c.a.createElement("div",{className:"".concat(B,"-input-wrap")},c.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":ce,"aria-valuemax":ee,"aria-valuenow":ke,required:Ke,type:ze,placeholder:ye,onPaste:q,onClick:Ne,onMouseUp:this.onMouseUp,className:"".concat(B,"-input"),tabIndex:Be,autoComplete:V,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:tt?this.onKeyDown:i,onKeyUp:tt?this.onKeyUp:i,autoFocus:k,maxLength:re,readOnly:te,disabled:H,max:ee,min:ce,step:nt,name:U,title:Ce,id:pe,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(mt),pattern:He,inputMode:We,onInput:Y},je))))}}]),O}(c.a.Component);m.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:g,min:-g,step:1,style:{},onChange:i,onKeyDown:i,onPressEnter:i,onFocus:i,onBlur:i,parser:t,required:!1,autoComplete:"off"};var y=m,x=Ve.a=y},f4xo:function(et,Ve,z){var le=z("nVVt");function Q(j){this.mode=le.MODE_8BIT_BYTE,this.data=j}Q.prototype={getLength:function(j){return this.data.length},write:function(j){for(var w=0;w=ee&&X<0||W.scrollTop<=0&&X>0))||$&&(!be||be&&(W.scrollLeft>=ce&&V<0||W.scrollLeft<=0&&V>0))?H(te,W.parentNode,V,X):!1};function m(H){var te=y();return function(){var V=Object(_.a)(H),X;if(te){var ne=Object(_.a)(this).constructor;X=Reflect.construct(V,arguments,ne)}else X=V.apply(this,arguments);return Object(P.a)(this,X)}}function y(){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(H){return!1}}var x={},l=function(H){Object(w.a)(W,H);var te=m(W);function W(V){var X;return Object(Q.a)(this,W),X=te.call(this,V),X.domFocus=function(){X.dom&&X.dom.focus()},X.removeStartHandler=function(ne){if(ne.touches.length>1)return;X.startPos={x:ne.touches[0].clientX,y:ne.touches[0].clientY}},X.removeMoveHandler=function(ne){if(ne.changedTouches.length>1)return;var $=ne.currentTarget,ee=ne.changedTouches[0].clientX-X.startPos.x,ce=ne.changedTouches[0].clientY-X.startPos.y;($===X.maskDom||$===X.handlerDom||$===X.contentDom&&E($,ne.target,ee,ce))&&ne.cancelable&&ne.preventDefault()},X.transitionEnd=function(ne){var $=ne.target;h($,n,X.transitionEnd),$.style.transition=""},X.onKeyDown=function(ne){if(ne.keyCode===d.a.ESC){var $=X.props.onClose;ne.stopPropagation(),$&&$(ne)}},X.onWrapperTransitionEnd=function(ne){var $=X.props,ee=$.open,ce=$.afterVisibleChange;ne.target===X.contentWrapper&&ne.propertyName.match(/transform$/)&&(X.dom.style.transition="",!ee&&X.getCurrentDrawerSome()&&(document.body.style.overflowX="",X.maskDom&&(X.maskDom.style.left="",X.maskDom.style.width="")),ce&&ce(!!ee))},X.openLevelTransition=function(){var ne=X.props,$=ne.open,ee=ne.width,ce=ne.height,de=X.getHorizontalBoolAndPlacementName(),Ce=de.isHorizontal,Se=de.placementName,De=X.contentDom?X.contentDom.getBoundingClientRect()[Ce?"width":"height"]:0,be=(Ce?ee:ce)||De;X.setLevelAndScrolling($,Se,be)},X.setLevelTransform=function(ne,$,ee,ce){var de=X.props,Ce=de.placement,Se=de.levelMove,De=de.duration,be=de.ease,_e=de.showMask;X.levelDom.forEach(function(Ke){Ke.style.transition="transform ".concat(De," ").concat(be),t(Ke,n,X.transitionEnd);var Ne=ne?ee:0;if(Se){var Be=v(Se,{target:Ke,open:ne});Ne=ne?Be[0]:Be[1]||0}var ze=typeof Ne=="number"?"".concat(Ne,"px"):Ne,ye=Ce==="left"||Ce==="top"?ze:"-".concat(ze);ye=_e&&Ce==="right"&&ce?"calc(".concat(ye," + ").concat(ce,"px)"):ye,Ke.style.transform=Ne?"".concat($,"(").concat(ye,")"):""})},X.setLevelAndScrolling=function(ne,$,ee){var ce=X.props.onChange;if(!b){var de=document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth?Object(a.a)(!0):0;X.setLevelTransform(ne,$,ee,de),X.toggleScrollingToDrawerAndBody(de)}ce&&ce(ne)},X.toggleScrollingToDrawerAndBody=function(ne){var $=X.props,ee=$.getOpenCount,ce=$.getContainer,de=$.showMask,Ce=$.open,Se=ce&&ce(),De=ee&&ee();if(Se&&Se.parentNode===document.body&&de){var be=["touchstart"],_e=[document.body,X.maskDom,X.handlerDom,X.contentDom];Ce&&document.body.style.overflow!=="hidden"?(ne&&X.addScrollingEffect(ne),De===1&&(document.body.style.overflow="hidden"),document.body.style.touchAction="none",_e.forEach(function(Ke,Ne){if(!Ke)return;t(Ke,be[Ne]||"touchmove",Ne?X.removeMoveHandler:X.removeStartHandler,X.passive)})):X.getCurrentDrawerSome()&&(De||(document.body.style.overflow=""),document.body.style.touchAction="",ne&&X.remScrollingEffect(ne),_e.forEach(function(Ke,Ne){if(!Ke)return;h(Ke,be[Ne]||"touchmove",Ne?X.removeMoveHandler:X.removeStartHandler,X.passive)}))}},X.addScrollingEffect=function(ne){var $=X.props,ee=$.placement,ce=$.duration,de=$.ease,Ce=$.getOpenCount,Se=$.switchScrollingEffect,De=Ce&&Ce();De===1&&Se();var be="width ".concat(ce," ").concat(de),_e="transform ".concat(ce," ").concat(de);X.dom.style.transition="none";switch(ee){case"right":X.dom.style.transform="translateX(-".concat(ne,"px)");break;case"top":case"bottom":X.dom.style.width="calc(100% - ".concat(ne,"px)"),X.dom.style.transform="translateZ(0)";break;default:break}clearTimeout(X.timeout),X.timeout=setTimeout(function(){X.dom&&(X.dom.style.transition="".concat(_e,",").concat(be),X.dom.style.width="",X.dom.style.transform="")})},X.remScrollingEffect=function(ne){var $=X.props,ee=$.placement,ce=$.duration,de=$.ease,Ce=$.getOpenCount,Se=$.switchScrollingEffect,De=Ce&&Ce();De||Se(!0),i&&(document.body.style.overflowX="hidden"),X.dom.style.transition="none";var be,_e="width ".concat(ce," ").concat(de),Ke="transform ".concat(ce," ").concat(de);switch(ee){case"left":{X.dom.style.width="100%",_e="width 0s ".concat(de," ").concat(ce);break}case"right":{X.dom.style.transform="translateX(".concat(ne,"px)"),X.dom.style.width="100%",_e="width 0s ".concat(de," ").concat(ce),X.maskDom&&(X.maskDom.style.left="-".concat(ne,"px"),X.maskDom.style.width="calc(100% + ".concat(ne,"px)"));break}case"top":case"bottom":{X.dom.style.width="calc(100% + ".concat(ne,"px)"),X.dom.style.height="100%",X.dom.style.transform="translateZ(0)",be="height 0s ".concat(de," ").concat(ce);break}default:break}clearTimeout(X.timeout),X.timeout=setTimeout(function(){X.dom&&(X.dom.style.transition="".concat(Ke,",").concat(be?"".concat(be,","):"").concat(_e),X.dom.style.transform="",X.dom.style.width="",X.dom.style.height="")})},X.getCurrentDrawerSome=function(){return!Object.keys(x).some(function(ne){return x[ne]})},X.getLevelDom=function(ne){var $=ne.level,ee=ne.getContainer;if(b)return;var ce=ee&&ee(),de=ce?ce.parentNode:null;if(X.levelDom=[],$==="all"){var Ce=de?Array.prototype.slice.call(de.children):[];Ce.forEach(function(Se){Se.nodeName!=="SCRIPT"&&Se.nodeName!=="STYLE"&&Se.nodeName!=="LINK"&&Se!==ce&&X.levelDom.push(Se)})}else $&&s($).forEach(function(Se){document.querySelectorAll(Se).forEach(function(De){X.levelDom.push(De)})})},X.getHorizontalBoolAndPlacementName=function(){var ne=X.props.placement,$=ne==="left"||ne==="right",ee="translate".concat($?"X":"Y");return{isHorizontal:$,placementName:ee}},X.state={_self:Object(p.a)(X)},X}return Object(j.a)(W,[{key:"componentDidMount",value:function(){var X=this;if(!b){var ne=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){return ne=!0,null}}))}catch(Ce){}this.passive=ne?{passive:!1}:!1}var $=this.props,ee=$.open,ce=$.getContainer,de=ce&&ce();this.drawerId="drawer_id_".concat(Number((Date.now()+Math.random()).toString().replace(".",Math.round(Math.random()*9).toString())).toString(16)),this.getLevelDom(this.props),ee&&(de&&de.parentNode===document.body&&(x[this.drawerId]=ee),this.openLevelTransition(),this.forceUpdate(function(){X.domFocus()}))}},{key:"componentDidUpdate",value:function(X){var ne=this.props,$=ne.open,ee=ne.getContainer,ce=ee&&ee();$!==X.open&&($&&this.domFocus(),ce&&ce.parentNode===document.body&&(x[this.drawerId]=!!$),this.openLevelTransition())}},{key:"componentWillUnmount",value:function(){var X=this.props,ne=X.getOpenCount,$=X.open,ee=X.switchScrollingEffect,ce=typeof ne=="function"&&ne();delete x[this.drawerId],$&&(this.setLevelTransform(!1),document.body.style.touchAction=""),ce||(document.body.style.overflow="",ee(!0))}},{key:"render",value:function(){var X,ne=this,$=this.props,ee=$.className,ce=$.children,de=$.style,Ce=$.width,Se=$.height,De=$.defaultOpen,be=$.open,_e=$.prefixCls,Ke=$.placement,Ne=$.level,Be=$.levelMove,ze=$.ease,ye=$.duration,pe=$.getContainer,We=$.handler,He=$.onChange,nt=$.afterVisibleChange,re=$.showMask,k=$.maskClosable,U=$.maskStyle,q=$.onClose,Y=$.onHandleClick,J=$.keyboard,xe=$.getOpenCount,ke=$.switchScrollingEffect,dt=Object(le.a)($,["className","children","style","width","height","defaultOpen","open","prefixCls","placement","level","levelMove","ease","duration","getContainer","handler","onChange","afterVisibleChange","showMask","maskClosable","maskStyle","onClose","onHandleClick","keyboard","getOpenCount","switchScrollingEffect"]),Ue=this.dom?be:!1,je=o()(_e,(X={},Object(c.a)(X,"".concat(_e,"-").concat(Ke),!0),Object(c.a)(X,"".concat(_e,"-open"),Ue),Object(c.a)(X,ee||"",!!ee),Object(c.a)(X,"no-mask",!re),X)),tt=this.getHorizontalBoolAndPlacementName(),mt=tt.placementName,Qe=Ke==="left"||Ke==="top"?"-100%":"100%",Xe=Ue?"":"".concat(mt,"(").concat(Qe,")"),Fe=We&&C.cloneElement(We,{onClick:function(Me){We.props.onClick&&We.props.onClick(),Y&&Y(Me)},ref:function(Me){ne.handlerDom=Me}});return C.createElement("div",Object.assign({},dt,{tabIndex:-1,className:je,style:de,ref:function(Me){ne.dom=Me},onKeyDown:Ue&&J?this.onKeyDown:void 0,onTransitionEnd:this.onWrapperTransitionEnd}),re&&C.createElement("div",{className:"".concat(_e,"-mask"),onClick:k?q:void 0,style:U,ref:function(Me){ne.maskDom=Me}}),C.createElement("div",{className:"".concat(_e,"-content-wrapper"),style:{transform:Xe,msTransform:Xe,width:g(Ce)?"".concat(Ce,"px"):Ce,height:g(Se)?"".concat(Se,"px"):Se},ref:function(Me){ne.contentWrapper=Me}},C.createElement("div",{className:"".concat(_e,"-content"),ref:function(Me){ne.contentDom=Me},onTouchStart:Ue&&re?this.removeStartHandler:void 0,onTouchMove:Ue&&re?this.removeMoveHandler:void 0},ce),Fe))}}],[{key:"getDerivedStateFromProps",value:function(X,ne){var $=ne.prevProps,ee=ne._self,ce={prevProps:X};if($!==void 0){var de=X.placement,Ce=X.level;de!==$.placement&&(ee.contentDom=null),Ce!==$.level&&ee.getLevelDom(X)}return ce}}]),W}(C.Component);l.defaultProps={switchScrollingEffect:function(){}};var S=l;function O(H){var te=A();return function(){var V=Object(_.a)(H),X;if(te){var ne=Object(_.a)(this).constructor;X=Reflect.construct(V,arguments,ne)}else X=V.apply(this,arguments);return Object(P.a)(this,X)}}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(H){return!1}}var D=function(H){Object(w.a)(W,H);var te=O(W);function W(V){var X;Object(Q.a)(this,W),X=te.call(this,V),X.onHandleClick=function($){var ee=X.props,ce=ee.onHandleClick,de=ee.open;if(ce&&ce($),typeof de=="undefined"){var Ce=X.state.open;X.setState({open:!Ce})}},X.onClose=function($){var ee=X.props,ce=ee.onClose,de=ee.open;ce&&ce($),typeof de=="undefined"&&X.setState({open:!1})};var ne=typeof V.open!="undefined"?V.open:!!V.defaultOpen;return X.state={open:ne},"onMaskClick"in V&&console.warn("`onMaskClick` are removed, please use `onClose` instead."),X}return Object(j.a)(W,[{key:"render",value:function(){var X=this,ne=this.props,$=ne.defaultOpen,ee=ne.getContainer,ce=ne.wrapperClassName,de=ne.forceRender,Ce=ne.handler,Se=Object(le.a)(ne,["defaultOpen","getContainer","wrapperClassName","forceRender","handler"]),De=this.state.open;if(!ee)return C.createElement("div",{className:ce,ref:function(Ke){X.dom=Ke}},C.createElement(S,Object.assign({},Se,{open:De,handler:Ce,getContainer:function(){return X.dom},onClose:this.onClose,onHandleClick:this.onHandleClick})));var be=!!Ce||de;return C.createElement(T.a,{visible:De,forceRender:be,getContainer:ee,wrapperClassName:ce},function(_e){var Ke=_e.visible,Ne=_e.afterClose,Be=Object(le.a)(_e,["visible","afterClose"]);return C.createElement(S,Object.assign({},Se,Be,{open:Ke!==void 0?Ke:De,afterVisibleChange:Ne!==void 0?Ne:Se.afterVisibleChange,handler:Ce,onClose:X.onClose,onHandleClick:X.onHandleClick}))})}}],[{key:"getDerivedStateFromProps",value:function(X,ne){var $=ne.prevProps,ee={prevProps:X};return typeof $!="undefined"&&X.open!==$.open&&(ee.open=X.open),ee}}]),W}(C.Component);D.defaultProps={prefixCls:"drawer",placement:"left",getContainer:"body",defaultOpen:!1,level:"all",duration:".3s",ease:"cubic-bezier(0.78, 0.14, 0.15, 0.86)",onChange:function(){},afterVisibleChange:function(){},handler:C.createElement("div",{className:"drawer-handle"},C.createElement("i",{className:"drawer-handle-icon"})),showMask:!0,maskClosable:!0,maskStyle:{},wrapperClassName:"",className:"",keyboard:!0,forceRender:!1};var I=D,B=Ve.a=I},fcyK:function(et,Ve,z){},fyJ8:function(et,Ve,z){"use strict";var le=z("rePB"),Q=z("VTBJ"),j=z("Ff2n"),w=z("U8pU"),P=z("q1tI"),_=z.n(P),T=z("TSYQ"),C=z.n(T),c=z("c+Xe"),p=z("sR1s");function u(f){return f&&Object(w.a)(f)==="object"&&!Array.isArray(f)&&!P.isValidElement(f)}function o(f){return typeof f=="string"?!0:Object(c.c)(f)}function a(f,i){var n,t=f.prefixCls,h=f.className,v=f.record,g=f.index,b=f.dataIndex,E=f.render,m=f.children,y=f.component,x=y===void 0?"td":y,l=f.colSpan,S=f.rowSpan,O=f.fixLeft,A=f.fixRight,D=f.firstFixLeft,I=f.lastFixLeft,B=f.firstFixRight,H=f.lastFixRight,te=f.appendNode,W=f.additionalProps,V=W===void 0?{}:W,X=f.ellipsis,ne=f.align,$=f.rowType,ee=f.isSticky,ce="".concat(t,"-cell"),de,Ce;if(m)Ce=m;else{var Se=Object(p.b)(v,b);if(Ce=Se,E){var De=E(Se,v,g);u(De)?(Ce=De.children,de=De.props):Ce=De}}Object(w.a)(Ce)==="object"&&!Array.isArray(Ce)&&!P.isValidElement(Ce)&&(Ce=null),X&&(I||B)&&(Ce=P.createElement("span",{className:"".concat(ce,"-content")},Ce));var be=de||{},_e=be.colSpan,Ke=be.rowSpan,Ne=be.style,Be=be.className,ze=Object(j.a)(be,["colSpan","rowSpan","style","className"]),ye=_e!==void 0?_e:l,pe=Ke!==void 0?Ke:S;if(ye===0||pe===0)return null;var We={},He=typeof O=="number",nt=typeof A=="number";He&&(We.position="sticky",We.left=O),nt&&(We.position="sticky",We.right=A);var re={};ne&&(re.textAlign=ne);var k,U=X===!0?{showTitle:!0}:X;U&&(U.showTitle||$==="header")&&(typeof Ce=="string"||typeof Ce=="number"?k=Ce.toString():P.isValidElement(Ce)&&typeof Ce.props.children=="string"&&(k=Ce.props.children));var q=Object(Q.a)(Object(Q.a)(Object(Q.a)({title:k},ze),V),{},{colSpan:ye&&ye!==1?ye:null,rowSpan:pe&&pe!==1?pe:null,className:C()(ce,h,(n={},Object(le.a)(n,"".concat(ce,"-fix-left"),He),Object(le.a)(n,"".concat(ce,"-fix-left-first"),D),Object(le.a)(n,"".concat(ce,"-fix-left-last"),I),Object(le.a)(n,"".concat(ce,"-fix-right"),nt),Object(le.a)(n,"".concat(ce,"-fix-right-first"),B),Object(le.a)(n,"".concat(ce,"-fix-right-last"),H),Object(le.a)(n,"".concat(ce,"-ellipsis"),X),Object(le.a)(n,"".concat(ce,"-with-append"),te),Object(le.a)(n,"".concat(ce,"-fix-sticky"),(He||nt)&&ee),n),V.className,Be),style:Object(Q.a)(Object(Q.a)(Object(Q.a)(Object(Q.a)({},V.style),re),We),Ne),ref:o(x)?i:null});return P.createElement(x,Object.assign({},q),te,Ce)}var d=P.forwardRef(a);d.displayName="Cell";var s=P.memo(d,function(f,i){return i.shouldCellUpdate?!i.shouldCellUpdate(i.record,f.record):!1});Ve.a=s},gRFJ:function(et,Ve,z){et.exports=[z("rdUC"),z("ynwM"),z("RELg"),z("DlR+"),z("CrYA"),z("PD8m")]},gaXo:function(module,exports){typeof JSON!="object"&&(JSON={}),function(){"use strict";var rx_one=/^[\],:{}\s]*$/,rx_two=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,rx_three=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,rx_four=/(?:^|:|,)(?:\s*\[)+/g,rx_escapable=/[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,rx_dangerous=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;function f(et){return et<10?"0"+et:et}function this_value(){return this.valueOf()}typeof Date.prototype.toJSON!="function"&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},Boolean.prototype.toJSON=this_value,Number.prototype.toJSON=this_value,String.prototype.toJSON=this_value);var gap,indent,meta,rep;function quote(et){return rx_escapable.lastIndex=0,rx_escapable.test(et)?'"'+et.replace(rx_escapable,function(Ve){var z=meta[Ve];return typeof z=="string"?z:"\\u"+("0000"+Ve.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+et+'"'}function str(et,Ve){var z,le,Q,j,w=gap,P,_=Ve[et];_&&typeof _=="object"&&typeof _.toJSON=="function"&&(_=_.toJSON(et)),typeof rep=="function"&&(_=rep.call(Ve,et,_));switch(typeof _){case"string":return quote(_);case"number":return isFinite(_)?String(_):"null";case"boolean":case"null":return String(_);case"object":if(!_)return"null";if(gap+=indent,P=[],Object.prototype.toString.apply(_)==="[object Array]"){for(j=_.length,z=0;z0&&!this.paused&&!this.ended&&this.readyState>2}});function f(t,h){return t-h}function i(t){t.sort(f);for(var h=0,v=0;v1&&arguments[1]!==void 0?arguments[1]:!1,Fe={point:X.current.currentTime};k?(Fe.log_id=k,Fe.watch_duration=i(ke),Fe.total_duration=nt):(x?(Fe.video_id=parseInt(E,10),Fe.course_id=x):Fe.video_id=E,Fe.duration=He,Fe.device=ye),Xe&&(Fe.ed="1");function Ie(){return Me.apply(this,arguments)}function Me(){return Me=Object(j.a)(P.a.mark(function Ee(){var Ae;return P.a.wrap(function(Te){for(;;)switch(Te.prev=Te.next){case 0:return J=!0,Te.next=3,m(Fe);case 3:Ae=Te.sent,k=Ae,J=!1,Qe&&Qe();case 7:case"end":return Te.stop()}},Ee)})),Me.apply(this,arguments)}Ie()},[E,x]);Object(_.useEffect)(function(){Q.b.destroy();var Qe=null;return C.a.isSupported&&V&&g&&(g==null?void 0:g.indexOf(".m3u8"))<0?(Qe=C.a.createPlayer({type:"flv",volume:.8,cors:!0,url:g,muted:!1}),X.current&&(Qe.attachMediaElement(X.current),Qe.load())):X.current.setAttribute("src",g),je(),function(){Qe&&(Qe.unload(),Qe.pause(),Qe.destroy(),Qe=null)}},[X,V,g]);function Ue(){X.current.paused?(ee.current.style.display="none",ce.current.style.display="block"):(ee.current.style.display="block",ce.current.style.display="none")}function je(){_e.current.style.display="none",Ne.current.style.display="none",Ke.current.style.display="none",X.current.muted||X.current.volume===0?_e.current.style.display="block":X.current.volume>0&&X.current.volume<=.5?Ne.current.style.display="block":Ke.current.style.display="block"}Object(_.useEffect)(function(){var Qe=document.getElementById("play"),Xe=document.querySelectorAll(".playback-icons use");function Fe(){D(),l&&!pe.current&&(X.current.currentTime=l),pe.current=!0,ke.push(X.current.currentTime),U||(U=!0,b&&dt())}function Ie(){return Me.apply(this,arguments)}function Me(){return Me=Object(j.a)(P.a.mark(function at(){return P.a.wrap(function(st){for(;;)switch(st.prev=st.next){case 0:Ue(),ke.push(X.current.currentTime),b&&dt(function(){k=null,re=0,U=!1,J=!1,xe=!1,ke=[],nt=0,Y=1},!0);case 3:case"end":return st.stop()}},at)})),Me.apply(this,arguments)}function Ee(){de.current.value=Math.floor(X.current.currentTime),Ce.current.value=Math.floor(X.current.currentTime)}function Ae(){var at=s(Math.round(X.current.currentTime));De.current.innerText="".concat(at.minutes,":").concat(at.seconds),De.current.setAttribute("datetime","".concat(at.minutes,"m ").concat(at.seconds,"s"))}function Le(){var at=Math.round(X.current.duration);de.current.setAttribute("max",at),Ce.current.setAttribute("max",at);var pt=s(at);Se.current.innerText="".concat(pt.minutes,":").concat(pt.seconds),Se.current.setAttribute("datetime","".concat(pt.minutes,"m ").concat(pt.seconds,"s"))}function Te(){var at=Math.round(X.current.duration);de.current.setAttribute("max",at),Ce.current.setAttribute("max",at);var pt=s(at);Se.current.innerText="".concat(pt.minutes,":").concat(pt.seconds),Se.current.setAttribute("datetime","".concat(pt.minutes,"m ").concat(pt.seconds,"s")),Ee(),Ae();var st=ne.current.getBoundingClientRect(),Pe=st.width,Ge=st.height,yt=st.x,ot=st.y;if(yt<0||ot<0||!Pe)return;if(!xe){var kt=X.current.currentTime,Dt=kt-re;Math.abs(Dt)<10?(nt+=Math.abs(Dt),re=kt,J||nt-Y*q>=0&&(Y++,ke.push(re),b&&dt())):(re=kt,b&&dt())}}function Ze(){xe=!0}function ut(){X.current.playing&&ke.push(X.current.currentTime,re),re=X.current.currentTime,xe=!1}function Tt(){He=X.current.duration,He<=20&&(q=He/3),X.current.addEventListener("play",Fe)}function Ht(at){at.preventDefault(),Object(o.a)()?(X.current.style.width="100%",X.current.style.height="100%"):X.current.style.cssText=""}function Qt(){O()}function bt(at){var pt=at.target.dataset.seek?at.target.dataset.seek:at.target.value;X.current.currentTime=pt,Ce.current.value=pt,de.current.value=pt}function Lt(at){var pt=Math.round(at.offsetX/at.target.clientWidth*parseInt(at.target.getAttribute("max"),10));de.current.setAttribute("data-seek",pt);var st=s(pt);be.current.textContent="".concat(st.minutes,":").concat(st.seconds);var Pe=X.current.getBoundingClientRect();be.current.style.left="".concat(at.pageX-Pe.left,"px")}return $.current.addEventListener(Object(o.c)(),Ht),X.current.addEventListener("canplay",Tt),X.current.addEventListener("ended",Ie),X.current.addEventListener("seeking",Ze),X.current.addEventListener("seeked",ut),X.current.addEventListener("loadedmetadata",Le),de.current.addEventListener("mousemove",Lt),de.current.addEventListener("input",bt),X.current.addEventListener("timeupdate",Te),X.current.addEventListener("pause",Qt),X.current.addEventListener("volumechange",je),function(){X.current.removeEventListener("canplay",Tt),X.current.removeEventListener("play",Fe),X.current.removeEventListener("ended",Ie),X.current.removeEventListener("seeking",Ze),X.current.removeEventListener("seeked",ut),de.current.removeEventListener("mousemove",Lt),de.current.removeEventListener("input",bt),X.current.removeEventListener("timeupdate",Te),X.current.removeEventListener("pause",Qt),X.current.removeEventListener("loadedmetadata",Le),X.current.removeEventListener("volumechange",je),X.current.playing&&(ke.push(re,X.current.currentTime),b&&dt())}},[X,g]),Object(_.useEffect)(function(){if(X.current.onended=function(){B(X)},X.current.oncontextmenu=function(){return!1},(g==null?void 0:g.indexOf(".m3u8"))>-1){if(X.current.canPlayType("application/vnd.apple.mpegurl"))X.current.src=g;else if(p.a.isSupported()){var Qe=new p.a;Qe.loadSource(g),Qe.attachMedia(X.current)}}},[g]),Object(_.useEffect)(function(){X.current.playbackRate=te},[te]);var tt=function(){X.current.paused||X.current.ended?X.current.play():X.current.pause(),Ue()};function mt(){X.current.muted=!X.current.muted,X.current.muted?(Be.current.setAttribute("data-volume",volume.value),Be.current.value=0):Be.current.value=Be.current.dataset.volume}return T.a.createElement("div",{style:{position:"relative"},ref:$},T.a.createElement("div",{ref:ne,className:"".concat(d.a.watermark," animated_alternate animate__animated_10s animate__infinite animate__stepstart ").concat(d.a.animate__loop)},We?We.login:" "),T.a.createElement("div",{className:d.a.container},T.a.createElement("div",{className:d.a["video-container"],id:"video-container"},T.a.createElement("div",{className:d.a["playback-animation"],id:"playback-animation"},T.a.createElement("svg",{className:d.a["playback-icons"]},T.a.createElement("use",{className:"hidden",href:"#play-icon"}),T.a.createElement("use",{href:"#pause"}))),T.a.createElement("video",{className:d.a.video,id:"video",preload:"auto",disablePictureInPicture:!0,ref:X,autoPlay:!1}),T.a.createElement("div",{className:"".concat(d.a["video-controls"]," "),id:"video-controls"},T.a.createElement("div",{className:d.a["bottom-controls"]},T.a.createElement("div",{className:d.a["left-controls"]},T.a.createElement("button",{"data-title":"\u64AD\u653E/\u6682\u505C",id:"play",onClick:tt},T.a.createElement("svg",{className:d.a["playback-icons"]},T.a.createElement("use",{ref:ce,href:"#play-icon"}),T.a.createElement("use",{ref:ee,style:{display:"none"},href:"#pause"}))),T.a.createElement("div",{className:d.a.time},T.a.createElement("time",{id:"time-elapsed",ref:De},"00:00"),T.a.createElement("span",null," / "),T.a.createElement("time",{id:"duration",ref:Se},"00:00"))),T.a.createElement("div",{className:d.a["right-controls"]},T.a.createElement("div",{className:d.a["volume-controls"]},T.a.createElement("button",{"data-title":"\u5F00\u542F/\u5173\u95ED\u58F0\u97F3",className:d.a["volume-button"],id:"volume-button",onClick:mt},T.a.createElement("svg",null,T.a.createElement("use",{ref:_e,href:"#volume-mute"}),T.a.createElement("use",{ref:Ne,href:"#volume-low"}),T.a.createElement("use",{ref:Ke,href:"#volume-high"}))),T.a.createElement("input",{className:d.a.volume,id:"volume",value:"1","data-mute":"0.5",type:"range",max:"1",min:"0",step:"0.01",ref:Be,style:{display:"none"},onClick:je})),T.a.createElement("button",{"data-title":"\u5168\u5C4F/\u9000\u51FA\u5168\u5C4F",className:d.a["fullscreen-button"],onClick:function(){Object(o.a)()?Object(o.b)():Object(o.d)($.current)}},T.a.createElement("svg",null,T.a.createElement("use",{href:"#fullscreen"}),T.a.createElement("use",{href:"#fullscreen-exit",className:"hidden"}))))),T.a.createElement("div",{className:d.a["video-progress"]},T.a.createElement("progress",{ref:Ce,value:"0",min:"0"}),T.a.createElement("input",{className:d.a.seek,ref:de,value:"0",min:"0",type:"range",step:"1"}),T.a.createElement("div",{className:d.a["seek-tooltip"],ref:be,id:"seek-tooltip"},"00:00"))))),T.a.createElement("svg",{style:{display:"none"}},T.a.createElement("defs",null,T.a.createElement("symbol",{id:"pause",viewBox:"0 0 24 24"},T.a.createElement("path",{d:"M14.016 5.016h3.984v13.969h-3.984v-13.969zM6 18.984v-13.969h3.984v13.969h-3.984z"})),T.a.createElement("symbol",{id:"play-icon",viewBox:"0 0 24 24"},T.a.createElement("path",{d:"M8.016 5.016l10.969 6.984-10.969 6.984v-13.969z"})),T.a.createElement("symbol",{id:"volume-high",viewBox:"0 0 24 24"},T.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"})),T.a.createElement("symbol",{id:"volume-low",viewBox:"0 0 24 24"},T.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"})),T.a.createElement("symbol",{id:"volume-mute",viewBox:"0 0 24 24"},T.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"})),T.a.createElement("symbol",{id:"fullscreen",viewBox:"0 0 24 24"},T.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"})),T.a.createElement("symbol",{id:"fullscreen-exit",viewBox:"0 0 24 24"},T.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"})),T.a.createElement("symbol",{id:"pip",viewBox:"0 0 24 24"},T.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"})))))})},i3hx:function(et,Ve,z){},je13:function(et,Ve,z){var le=z("5nXd"),Q=z("gRFJ"),j=[z("uQRt")];et.exports=le.createStore(Q,j)},kSUc:function(et,Ve,z){},"kaH+":function(et,Ve,z){"use strict";var le=z("+L6B"),Q=z("2/Rp"),j=z("tJVT"),w=z("q1tI"),P=z.n(w),_=z("UZu5"),T=z.n(_),C=z("dhSg"),c=z("rLCj"),p=z("dF/Y"),u=z("4i/N");Ve.a=function(){var o=Object(w.useState)(""),a=Object(j.a)(o,2),d=a[0],s=a[1],f=Object(w.useState)(0),i=Object(j.a)(f,2),n=i[0],t=i[1],h=Object(w.useRef)("");Object(w.useEffect)(function(){var E=C.a.subscribe("preview-image",function(m){s(m),document.body.style.overflow="hidden"});return E},[]),Object(w.useEffect)(function(){return document.addEventListener("keydown",v),function(){document.removeEventListener("keydown",v)}},[]),Object(w.useEffect)(function(){h.current=d},[d]);function v(E){E.keyCode==27&&h.current&&g()}function g(){document.body.style.overflow="auto",s("")}function b(){t(n+90)}return P.a.createElement(w.Fragment,null,d?P.a.createElement("div",{className:"image-preview-container"},P.a.createElement("div",{className:"button-group"},P.a.createElement(Q.a,{onClick:b},"\u65CB\u8F6C",P.a.createElement(c.a,null)),P.a.createElement(Q.a,{href:d},"\u4E0B\u8F7D",P.a.createElement(p.a,null)),P.a.createElement(Q.a,{onClick:g},"\u5173\u95ED",P.a.createElement(u.a,null))),P.a.createElement("div",{className:"preview-wrp-group"},P.a.createElement("img",{className:"image-preview",src:d,alt:"\u9884\u89C8\u5927\u56FE",style:{transform:"rotate(".concat(n,"deg)")}}))):null)}},kovY:function(et,Ve,z){et.exports=z.p+"static/e.eabfa286.svg"},lOMy:function(et,Ve,z){},lZu9:function(et,Ve,z){(function(le){le(z("VrN/"),z("1eCo"),z("8EBN"))})(function(le){"use strict";le.defineMode("markdown",function(Q,j){var w=le.getMode(Q,"text/html"),P=w.name=="null";function _(W){if(le.findModeByName){var V=le.findModeByName(W);V&&(W=V.mime||V.mimes[0])}var X=le.getMode(Q,W);return X.name=="null"?null:X}j.highlightFormatting===void 0&&(j.highlightFormatting=!1),j.maxBlockquoteDepth===void 0&&(j.maxBlockquoteDepth=0),j.taskLists===void 0&&(j.taskLists=!1),j.strikethrough===void 0&&(j.strikethrough=!1),j.emoji===void 0&&(j.emoji=!1),j.fencedCodeBlockHighlighting===void 0&&(j.fencedCodeBlockHighlighting=!0),j.fencedCodeBlockDefaultMode===void 0&&(j.fencedCodeBlockDefaultMode="text/plain"),j.xml===void 0&&(j.xml=!0),j.tokenTypeOverrides===void 0&&(j.tokenTypeOverrides={});var T={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var C in T)T.hasOwnProperty(C)&&j.tokenTypeOverrides[C]&&(T[C]=j.tokenTypeOverrides[C]);var c=/^([*\-_])(?:\s*\1){2,}\s*$/,p=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,u=/^\[(x| )\](?=\s)/i,o=j.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,a=/^ {0,3}(?:\={1,}|-{2,})\s*$/,d=/^[^#!\[\]*_\\<>` "'(~:]+/,s=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,f=/^\s*\[[^\]]+?\]:.*$/,i=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,n=" ";function t(W,V,X){return V.f=V.inline=X,X(W,V)}function h(W,V,X){return V.f=V.block=X,X(W,V)}function v(W){return!W||!/\S/.test(W.string)}function g(W){if(W.linkTitle=!1,W.linkHref=!1,W.linkText=!1,W.em=!1,W.strong=!1,W.strikethrough=!1,W.quote=0,W.indentedCode=!1,W.f==E){var V=P;if(!V){var X=le.innerMode(w,W.htmlState);V=X.mode.name=="xml"&&X.state.tagStart===null&&!X.state.context&&X.state.tokenize.isInText}V&&(W.f=l,W.block=b,W.htmlState=null)}return W.trailingSpace=0,W.trailingSpaceNewLine=!1,W.prevLine=W.thisLine,W.thisLine={stream:null},null}function b(W,V){var X=W.column()===V.indentation,ne=v(V.prevLine.stream),$=V.indentedCode,ee=V.prevLine.hr,ce=V.list!==!1,de=(V.listStack[V.listStack.length-1]||0)+3;V.indentedCode=!1;var Ce=V.indentation;if(V.indentationDiff===null&&(V.indentationDiff=V.indentation,ce)){for(V.list=null;Ce=4&&($||V.prevLine.fencedCodeEnd||V.prevLine.header||ne))return W.skipToEnd(),V.indentedCode=!0,T.code;if(W.eatSpace())return null;if(X&&V.indentation<=de&&(be=W.match(o))&&be[1].length<=6)return V.quote=0,V.header=be[1].length,V.thisLine.header=!0,j.highlightFormatting&&(V.formatting="header"),V.f=V.inline,y(V);if(V.indentation<=de&&W.eat(">"))return V.quote=X?1:V.quote+1,j.highlightFormatting&&(V.formatting="quote"),W.eatSpace(),y(V);if(!De&&!V.setext&&X&&V.indentation<=de&&(be=W.match(p))){var _e=be[1]?"ol":"ul";return V.indentation=Ce+W.current().length,V.list=!0,V.quote=0,V.listStack.push(V.indentation),V.em=!1,V.strong=!1,V.code=!1,V.strikethrough=!1,j.taskLists&&W.match(u,!1)&&(V.taskList=!0),V.f=V.inline,j.highlightFormatting&&(V.formatting=["list","list-"+_e]),y(V)}else{if(X&&V.indentation<=de&&(be=W.match(s,!0)))return V.quote=0,V.fencedEndRE=new RegExp(be[1]+"+ *$"),V.localMode=j.fencedCodeBlockHighlighting&&_(be[2]||j.fencedCodeBlockDefaultMode),V.localMode&&(V.localState=le.startState(V.localMode)),V.f=V.block=m,j.highlightFormatting&&(V.formatting="code-block"),V.code=-1,y(V);if(V.setext||(!Se||!ce)&&!V.quote&&V.list===!1&&!V.code&&!De&&!f.test(W.string)&&(be=W.lookAhead(1))&&(be=be.match(a)))return V.setext?(V.header=V.setext,V.setext=0,W.skipToEnd(),j.highlightFormatting&&(V.formatting="header")):(V.header=be[0].charAt(0)=="="?1:2,V.setext=V.header),V.thisLine.header=!0,V.f=V.inline,y(V);if(De)return W.skipToEnd(),V.hr=!0,V.thisLine.hr=!0,T.hr;if(W.peek()==="[")return t(W,V,I)}return t(W,V,V.inline)}function E(W,V){var X=w.token(W,V.htmlState);if(!P){var ne=le.innerMode(w,V.htmlState);(ne.mode.name=="xml"&&ne.state.tagStart===null&&!ne.state.context&&ne.state.tokenize.isInText||V.md_inside&&W.current().indexOf(">")>-1)&&(V.f=l,V.block=b,V.htmlState=null)}return X}function m(W,V){var X=V.listStack[V.listStack.length-1]||0,ne=V.indentation=W.quote?V.push(T.formatting+"-"+W.formatting[X]+"-"+W.quote):V.push("error"))}if(W.taskOpen)return V.push("meta"),V.length?V.join(" "):null;if(W.taskClosed)return V.push("property"),V.length?V.join(" "):null;if(W.linkHref?V.push(T.linkHref,"url"):(W.strong&&V.push(T.strong),W.em&&V.push(T.em),W.strikethrough&&V.push(T.strikethrough),W.emoji&&V.push(T.emoji),W.linkText&&V.push(T.linkText),W.code&&V.push(T.code),W.image&&V.push(T.image),W.imageAltText&&V.push(T.imageAltText,"link"),W.imageMarker&&V.push(T.imageMarker)),W.header&&V.push(T.header,T.header+"-"+W.header),W.quote&&(V.push(T.quote),!j.maxBlockquoteDepth||j.maxBlockquoteDepth>=W.quote?V.push(T.quote+"-"+W.quote):V.push(T.quote+"-"+j.maxBlockquoteDepth)),W.list!==!1){var ne=(W.listStack.length-1)%3;ne?ne===1?V.push(T.list2):V.push(T.list3):V.push(T.list1)}return W.trailingSpaceNewLine?V.push("trailing-space-new-line"):W.trailingSpace&&V.push("trailing-space-"+(W.trailingSpace%2?"a":"b")),V.length?V.join(" "):null}function x(W,V){return W.match(d,!0)?y(V):void 0}function l(W,V){var X=V.text(W,V);if(typeof X!="undefined")return X;if(V.list)return V.list=null,y(V);if(V.taskList){var ne=W.match(u,!0)[1]===" ";return ne?V.taskOpen=!0:V.taskClosed=!0,j.highlightFormatting&&(V.formatting="task"),V.taskList=!1,y(V)}if(V.taskOpen=!1,V.taskClosed=!1,V.header&&W.match(/^#+$/,!0))return j.highlightFormatting&&(V.formatting="header"),y(V);var $=W.next();if(V.linkTitle){V.linkTitle=!1;var ee=$;$==="("&&(ee=")"),ee=(ee+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var ce="^\\s*(?:[^"+ee+"\\\\]+|\\\\\\\\|\\\\.)"+ee;if(W.match(new RegExp(ce),!0))return T.linkHref}if($==="`"){var de=V.formatting;j.highlightFormatting&&(V.formatting="code"),W.eatWhile("`");var Ce=W.current().length;if(V.code==0&&(!V.quote||Ce==1))return V.code=Ce,y(V);if(Ce==V.code){var Se=y(V);return V.code=0,Se}else return V.formatting=de,y(V)}else if(V.code)return y(V);if($==="\\"&&(W.next(),j.highlightFormatting)){var De=y(V),be=T.formatting+"-escape";return De?De+" "+be:be}if($==="!"&&W.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return V.imageMarker=!0,V.image=!0,j.highlightFormatting&&(V.formatting="image"),y(V);if($==="["&&V.imageMarker&&W.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return V.imageMarker=!1,V.imageAltText=!0,j.highlightFormatting&&(V.formatting="image"),y(V);if($==="]"&&V.imageAltText){j.highlightFormatting&&(V.formatting="image");var De=y(V);return V.imageAltText=!1,V.image=!1,V.inline=V.f=O,De}if($==="["&&!V.image)return V.linkText&&W.match(/^.*?\]/)||(V.linkText=!0,j.highlightFormatting&&(V.formatting="link")),y(V);if($==="]"&&V.linkText){j.highlightFormatting&&(V.formatting="link");var De=y(V);return V.linkText=!1,V.inline=V.f=W.match(/\(.*?\)| ?\[.*?\]/,!1)?O:l,De}if($==="<"&&W.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){V.f=V.inline=S,j.highlightFormatting&&(V.formatting="link");var De=y(V);return De?De+=" ":De="",De+T.linkInline}if($==="<"&&W.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){V.f=V.inline=S,j.highlightFormatting&&(V.formatting="link");var De=y(V);return De?De+=" ":De="",De+T.linkEmail}if(j.xml&&$==="<"&&W.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var _e=W.string.indexOf(">",W.pos);if(_e!=-1){var Ke=W.string.substring(W.start,_e);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(Ke)&&(V.md_inside=!0)}return W.backUp(1),V.htmlState=le.startState(w),h(W,V,E)}if(j.xml&&$==="<"&&W.match(/^\/\w*?>/))return V.md_inside=!1,"tag";if($==="*"||$==="_"){for(var Ne=1,Be=W.pos==1?" ":W.string.charAt(W.pos-2);Ne<3&&W.eat($);)Ne++;var ze=W.peek()||" ",ye=!/\s/.test(ze)&&(!i.test(ze)||/\s/.test(Be)||i.test(Be)),pe=!/\s/.test(Be)&&(!i.test(Be)||/\s/.test(ze)||i.test(ze)),We=null,He=null;if(Ne%2&&(!V.em&&ye&&($==="*"||!pe||i.test(Be))?We=!0:V.em==$&&pe&&($==="*"||!ye||i.test(ze))&&(We=!1)),Ne>1&&(!V.strong&&ye&&($==="*"||!pe||i.test(Be))?He=!0:V.strong==$&&pe&&($==="*"||!ye||i.test(ze))&&(He=!1)),He!=null||We!=null){j.highlightFormatting&&(V.formatting=We==null?"strong":He==null?"em":"strong em"),We===!0&&(V.em=$),He===!0&&(V.strong=$);var Se=y(V);return We===!1&&(V.em=!1),He===!1&&(V.strong=!1),Se}}else if($===" "&&(W.eat("*")||W.eat("_"))){if(W.peek()===" ")return y(V);W.backUp(1)}if(j.strikethrough){if($==="~"&&W.eatWhile($)){if(V.strikethrough){j.highlightFormatting&&(V.formatting="strikethrough");var Se=y(V);return V.strikethrough=!1,Se}else if(W.match(/^[^\s]/,!1))return V.strikethrough=!0,j.highlightFormatting&&(V.formatting="strikethrough"),y(V)}else if($===" "&&W.match(/^~~/,!0)){if(W.peek()===" ")return y(V);W.backUp(2)}}if(j.emoji&&$===":"&&W.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){V.emoji=!0,j.highlightFormatting&&(V.formatting="emoji");var nt=y(V);return V.emoji=!1,nt}return $===" "&&(W.match(/^ +$/,!1)?V.trailingSpace++:V.trailingSpace&&(V.trailingSpaceNewLine=!0)),y(V)}function S(W,V){var X=W.next();if(X===">"){V.f=V.inline=l,j.highlightFormatting&&(V.formatting="link");var ne=y(V);return ne?ne+=" ":ne="",ne+T.linkInline}return W.match(/^[^>]+/,!0),T.linkInline}function O(W,V){if(W.eatSpace())return null;var X=W.next();return X==="("||X==="["?(V.f=V.inline=D(X==="("?")":"]"),j.highlightFormatting&&(V.formatting="link-string"),V.linkHref=!0,y(V)):"error"}var A={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function D(W){return function(V,X){var ne=V.next();if(ne===W){X.f=X.inline=l,j.highlightFormatting&&(X.formatting="link-string");var $=y(X);return X.linkHref=!1,$}return V.match(A[W]),X.linkHref=!0,y(X)}}function I(W,V){return W.match(/^([^\]\\]|\\.)*\]:/,!1)?(V.f=B,W.next(),j.highlightFormatting&&(V.formatting="link"),V.linkText=!0,y(V)):t(W,V,l)}function B(W,V){if(W.match(/^\]:/,!0)){V.f=V.inline=H,j.highlightFormatting&&(V.formatting="link");var X=y(V);return V.linkText=!1,X}return W.match(/^([^\]\\]|\\.)+/,!0),T.linkText}function H(W,V){return W.eatSpace()?null:(W.match(/^[^\s]+/,!0),W.peek()===void 0?V.linkTitle=!0:W.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),V.f=V.inline=l,T.linkHref+" url")}var te={startState:function(){return{f:b,prevLine:{stream:null},thisLine:{stream:null},block:b,htmlState:null,indentation:0,inline:l,text:x,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(W){return{f:W.f,prevLine:W.prevLine,thisLine:W.thisLine,block:W.block,htmlState:W.htmlState&&le.copyState(w,W.htmlState),indentation:W.indentation,localMode:W.localMode,localState:W.localMode?le.copyState(W.localMode,W.localState):null,inline:W.inline,text:W.text,formatting:!1,linkText:W.linkText,linkTitle:W.linkTitle,linkHref:W.linkHref,code:W.code,em:W.em,strong:W.strong,strikethrough:W.strikethrough,emoji:W.emoji,header:W.header,setext:W.setext,hr:W.hr,taskList:W.taskList,list:W.list,listStack:W.listStack.slice(0),quote:W.quote,indentedCode:W.indentedCode,trailingSpace:W.trailingSpace,trailingSpaceNewLine:W.trailingSpaceNewLine,md_inside:W.md_inside,fencedEndRE:W.fencedEndRE}},token:function(W,V){if(V.formatting=!1,W!=V.thisLine.stream){if(V.header=0,V.hr=!1,W.match(/^\s*$/,!0))return g(V),null;if(V.prevLine=V.thisLine,V.thisLine={stream:W},V.taskList=!1,V.trailingSpace=0,V.trailingSpaceNewLine=!1,!V.localState&&(V.f=V.block,V.f!=E)){var X=W.match(/^\s*/,!0)[0].replace(/\t/g,n).length;if(V.indentation=X,V.indentationDiff=null,X>0)return null}}return V.f(W,V)},innerMode:function(W){return W.block==E?{state:W.htmlState,mode:w}:W.localState?{state:W.localState,mode:W.localMode}:{state:W,mode:te}},indent:function(W,V,X){return W.block==E&&w.indent?w.indent(W.htmlState,V,X):W.localState&&W.localMode.indent?W.localMode.indent(W.localState,V,X):le.Pass},blankLine:g,getType:y,blockCommentStart:"",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return te},"xml"),le.defineMIME("text/markdown","markdown"),le.defineMIME("text/x-markdown","markdown")})},n6Qo:function(et,Ve,z){"use strict";z.d(Ve,"a",function(){return C});var le=z("q1tI"),Q=z("biw7"),j=z("fyJ8");function w(c){var p=c.className,u=c.index,o=c.children,a=c.colSpan,d=c.rowSpan,s=le.useContext(Q.a),f=s.prefixCls,i=s.fixedInfoList,n=i[u];return le.createElement(j.a,Object.assign({className:p,index:u,component:"td",prefixCls:f,record:null,dataIndex:null,render:function(){return{children:o,props:{colSpan:a,rowSpan:d}}}},n))}function P(c){return le.createElement("tr",Object.assign({},c))}function _(c){var p=c.children,u=le.useContext(Q.a),o=u.prefixCls;return le.createElement("tfoot",{className:"".concat(o,"-summary")},p)}var T=Ve.b=_,C={Cell:w,Row:P}},nCk5:function(et,Ve,z){et.exports=z.p+"static/d.53bf6ae3.svg"},nVVt:function(et,Ve){et.exports={MODE_NUMBER:1<<0,MODE_ALPHA_NUM:1<<1,MODE_8BIT_BYTE:1<<2,MODE_KANJI:1<<3}},nWbc:function(et,Ve,z){},oE5q:function(et,Ve,z){et.exports=z.p+"static/t.0b94c5c3.svg"},oFv4:function(et,Ve,z){et.exports=z.p+"static/internal.da228387.png"},osHv:function(et,Ve,z){(function(le){le(z("VrN/"))})(function(le){"use strict";var Q=le.Pos;function j(i,n){return i.line-n.line||i.ch-n.ch}var w="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",P=w+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",_=new RegExp("<(/?)(["+w+"]["+P+"]*)","g");function T(i,n,t,h){this.line=n,this.ch=t,this.cm=i,this.text=i.getLine(n),this.min=h?Math.max(h.from,i.firstLine()):i.firstLine(),this.max=h?Math.min(h.to-1,i.lastLine()):i.lastLine()}function C(i,n){var t=i.cm.getTokenTypeAt(Q(i.line,n));return t&&/\btag\b/.test(t)}function c(i){return i.line>=i.max?void 0:(i.ch=0,i.text=i.cm.getLine(++i.line),!0)}function p(i){return i.line<=i.min?void 0:(i.text=i.cm.getLine(--i.line),i.ch=i.text.length,!0)}function u(i){for(;;){var n=i.text.indexOf(">",i.ch);if(n==-1){if(c(i))continue;return}if(!C(i,n+1)){i.ch=n+1;continue}var t=i.text.lastIndexOf("/",n),h=t>-1&&!/\S/.test(i.text.slice(t+1,n));return i.ch=n+1,h?"selfClose":"regular"}}function o(i){for(;;){var n=i.ch?i.text.lastIndexOf("<",i.ch-1):-1;if(n==-1){if(p(i))continue;return}if(!C(i,n+1)){i.ch=n;continue}_.lastIndex=n,i.ch=n;var t=_.exec(i.text);if(t&&t.index==n)return t}}function a(i){for(;;){_.lastIndex=i.ch;var n=_.exec(i.text);if(!n){if(c(i))continue;return}if(!C(i,n.index+1)){i.ch=n.index+1;continue}return i.ch=n.index+n[0].length,n}}function d(i){for(;;){var n=i.ch?i.text.lastIndexOf(">",i.ch-1):-1;if(n==-1){if(p(i))continue;return}if(!C(i,n+1)){i.ch=n;continue}var t=i.text.lastIndexOf("/",n),h=t>-1&&!/\S/.test(i.text.slice(t+1,n));return i.ch=n+1,h?"selfClose":"regular"}}function s(i,n){for(var t=[];;){var h=a(i),v,g=i.line,b=i.ch-(h?h[0].length:0);if(!h||!(v=u(i)))return;if(v=="selfClose")continue;if(h[1]){for(var E=t.length-1;E>=0;--E)if(t[E]==h[2]){t.length=E;break}if(E<0&&(!n||n==h[2]))return{tag:h[2],from:Q(g,b),to:Q(i.line,i.ch)}}else t.push(h[2])}}function f(i,n){for(var t=[];;){var h=d(i);if(!h)return;if(h=="selfClose"){o(i);continue}var v=i.line,g=i.ch,b=o(i);if(!b)return;if(b[1])t.push(b[2]);else{for(var E=t.length-1;E>=0;--E)if(t[E]==b[2]){t.length=E;break}if(E<0&&(!n||n==b[2]))return{tag:b[2],from:Q(i.line,i.ch),to:Q(v,g)}}}}le.registerHelper("fold","xml",function(i,n){for(var t=new T(i,n.line,0);;){var h=a(t);if(!h||t.line!=n.line)return;var v=u(t);if(!v)return;if(!h[1]&&v!="selfClose"){var g=Q(t.line,t.ch),b=s(t,h[2]);return b&&j(b.from,g)>0?{from:g,to:b.from}:null}}}),le.findMatchingTag=function(i,n,t){var h=new T(i,n.line,n.ch,t);if(h.text.indexOf(">")==-1&&h.text.indexOf("<")==-1)return;var v=u(h),g=v&&Q(h.line,h.ch),b=v&&o(h);if(!v||!b||j(h,n)>0)return;var E={from:Q(h.line,h.ch),to:g,tag:b[2]};return v=="selfClose"?{open:E,close:null,at:"open"}:b[1]?{open:f(h,b[2]),close:E,at:"close"}:(h=new T(i,g.line,g.ch,t),{open:E,close:s(h,b[2]),at:"open"})},le.findEnclosingTag=function(i,n,t,h){for(var v=new T(i,n.line,n.ch,t);;){var g=f(v,h);if(!g)break;var b=new T(i,n.line,n.ch,t),E=s(b,g.tag);if(E)return{open:g,close:E}}},le.scanForClosingTag=function(i,n,t,h){var v=new T(i,n.line,n.ch,h?{from:0,to:h}:null);return s(v,t)}})},p5ED:function(et,Ve,z){"use strict";var le=z("+L6B"),Q=z("2/Rp"),j=z("5Dmo"),w=z("3S7+"),P=z("k1fw"),_=z("9og8"),T=z("tJVT"),C=z("WmNS"),c=z.n(C),p=z("q1tI"),u=z.n(p),o=z("vHTk"),a=z.n(o),d=z("yEEn"),s=z("ZW9T"),f=z("1vsH"),i=z("V0Rq"),n=z("m3rI"),t=function(v){var g=v.name,b=v.data,E=v.theme,m=v.type,y=v.filename,x=v.monacoEditor,l=v.className,S=v.style,O=v.close,A=v.onClose,D=v.hasMask,I=v.otherData,B=I===void 0?{}:I,H=Object(p.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),te=Object(T.a)(H,2),W=te[0],V=te[1],X=Object(p.useState)(""),ne=Object(T.a)(X,2),$=ne[0],ee=ne[1],ce=Object(p.useState)(),de=Object(T.a)(ce,2),Ce=de[0],Se=de[1],De,be=1024*1024,_e=10*be,Ke=Object(p.useRef)();m==="office"&&(De=Object(f.R)(b).filesize,De>_e&&(m="other")),y&&(x.filename=y),Object(p.useEffect)(function(){var ye,pe,We=(ye=document.cookie)===null||ye===void 0||((pe=ye.replace(/\s/g,""))===null||pe===void 0)?void 0:pe.split(";");We==null||We.map(function(He){var nt=He.split("=");nt[0]==="_educoder_session"&&ee(nt[1])})},[]),Object(p.useEffect)(function(){m==="office"&&Ne()},[m]);var Ne=function(){var ye=Object(_.a)(c.a.mark(function pe(){var We,He,nt;return c.a.wrap(function(k){for(;;)switch(k.prev=k.next){case 0:return console.log("data:",b),We=b,b.startsWith("http")||(We=location.origin+We),He=new URL(We).pathname.split("/").pop(),k.next=6,Object(i.U)({attachment_id:He});case 6:nt=k.sent,Se(nt);case 8:case"end":return k.stop()}},pe)}));return function(){return ye.apply(this,arguments)}}(),Be=function(){if(b.startsWith("http")||b.startsWith("blob:")){ze();return}Object(f.x)(y||"educoder",b,y)},ze=function(){Object(f.v)(y||"educoder",decodeURIComponent(b))};return u.a.createElement("div",{style:Object(P.a)({},S||{}),className:"".concat(D&&a.a.bgBlack," ").concat(m?a.a.wrp:"hide")},O&&u.a.createElement("div",{className:a.a.close,ref:Ke},u.a.createElement(w.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return Ke.current}},u.a.createElement("span",{onClick:ze},u.a.createElement("i",{className:"icon-quxiaozhiding"}))),u.a.createElement(w.a,{title:"\u5173\u95ED",getPopupContainer:function(){return Ke.current}},u.a.createElement("span",{className:"",onClick:function(){A(),Se(null)}},u.a.createElement("i",{className:"icon-guanbi1"})))),u.a.createElement("div",{className:"".concat(a.a[l]," ").concat(l," ").concat(a.a.monaco," ").concat(m==="txt"?"show":"hide")},m==="txt"&&u.a.createElement(s.b,x)),m==="audio"&&u.a.createElement("audio",{src:"".concat((b==null?void 0:b.indexOf("http://"))>-1||(b==null?void 0:b.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(b),autoPlay:!0}),m==="video"&&u.a.createElement(u.a.Fragment,null,(b==null?void 0:b.indexOf("http"))>-1?u.a.createElement("video",{controls:!0,src:"".concat(b),autoPlay:!0}):u.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(b),autoPlay:!0})),m==="office"&&Ce&&u.a.createElement("iframe",{src:"/react/build/office.html?key=".concat(Ce.key,"&url=").concat(n.a.API_SERVER+Ce.url,"&callbackUrl=").concat(n.a.API_SERVER+Ce.callbackUrl,"&fileType=").concat(Ce.fileType,"&title=").concat(Ce.title,"&model=view")}),(m==="xlsx"||m==="doc"||m==="pptx"||m==="docx")&&u.a.createElement("iframe",{src:"/react/build/office.html?key=".concat(B.key,"&url=").concat(n.a.API_SERVER+B.url,"&callbackUrl=").concat(n.a.API_SERVER+B.callbackUrl,"&fileType=").concat(B.fileType,"&title=").concat(B.title,"&model=").concat(B.model)}),m==="html"&&u.a.createElement("iframe",{src:b+"&disposition=inline"}),m==="pdf"&&u.a.createElement("embed",{className:a.a.embed,src:b,type:"application/pdf"}),m==="image"&&u.a.createElement("img",{src:"".concat((b==null?void 0:b.indexOf("http://"))>-1||(b==null?void 0:b.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(b)}),m==="other"&&u.a.createElement("div",null,u.a.createElement(Q.a,{type:"primary",size:"large",onClick:Be},u.a.createElement(d.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),m==="download"&&u.a.createElement(Q.a,{type:"primary",size:"large",onClick:Be},u.a.createElement(d.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))};Ve.a=t},"p77/":function(et,Ve,z){},pYxM:function(et,Ve,z){et.exports={flex_box_center:"flex_box_center___v-DUT",flex_space_between:"flex_space_between___1bRJc",flex_box_vertical_center:"flex_box_vertical_center___k_OZG",flex_box_center_end:"flex_box_center_end___2lt4j",flex_box_column:"flex_box_column___3fVE5",active:"active___-vjVj",line:"line___3pg8N",list:"list___3yqVJ",left:"left___2dr70",mask:"mask___186YH",right:"right___17A6Y",name:"name___v6M7T",title:"title___1BhMz",a:"a___3T4cN",b:"b___1z1Bk",des:"des___29QAn",tag:"tag___FfUI2"}},ppsT:function(et,Ve,z){(function(le){var Q,Q;!function(j){if(!0)window.OSS=j(),et.exports=j();else var w}(function(){var j;return function(){function w(P,_,T){function C(u,o){if(!_[u]){if(!P[u]){var a=typeof Q=="function"&&Q;if(!o&&a)return Q(u,!0);if(c)return c(u,!0);var d=new Error("Cannot find module '"+u+"'");throw d.code="MODULE_NOT_FOUND",d}var s=_[u]={exports:{}};P[u][0].call(s.exports,function(f){return C(P[u][1][f]||f)},s,s.exports,w,P,_,T)}return _[u].exports}for(var c=typeof Q=="function"&&Q,p=0;p0?$["Content-Type"]=ne.mime:$["Content-Type"]=b.getType(ne.mime||v.extname(ne.object||""))||"application/octet-stream"),ne.content&&($["Content-Md5"]=h.createHash("md5").update(new C(ne.content,"utf8")).digest("base64"),$["Content-Length"]||($["Content-Length"]=ne.content.length));var ee=this._getResource(ne);$.authorization=this.authorization(ne.method,ee,ne.subres,$);var ce=this._getReqUrl(ne);t("request %s %s, with headers %j, !!stream: %s",ne.method,ce,$,!!ne.stream);var de=ne.timeout||this.options.timeout;return{url:ce,params:{agent:this.agent,method:ne.method,content:ne.content,stream:ne.stream,headers:$,timeout:de,writeStream:ne.writeStream,customResponse:ne.customResponse,ctx:ne.ctx||this.ctx}}},X.request=f.default.mark(function ne($){var ee,ce,de,Ce;return f.default.wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:return ee=this.createRequest($),ce=void 0,de=void 0,Se.prev=3,Se.next=6,this.urllib.request(ee.url,ee.params);case 6:ce=Se.sent,t("response %s %s, got %s, headers: %j",$.method,ee.url,ce.status,ce.headers),Se.next=13;break;case 10:Se.prev=10,Se.t0=Se.catch(3),de=Se.t0;case 13:if(Ce=void 0,!ce||!$.successStatuses||$.successStatuses.indexOf(ce.status)!==-1){Se.next=26;break}return Se.next=17,this.requestError(ce);case 17:if(Ce=Se.sent,Ce.code!=="RequestTimeTooSkewed"){Se.next=23;break}return this.options.amendTimeSkewed=+new Date(Ce.serverTime)-new Date,Se.next=22,this.request($);case 22:return Se.abrupt("return",Se.sent);case 23:Ce.params=$,Se.next=30;break;case 26:if(!de){Se.next=30;break}return Se.next=29,this.requestError(de);case 29:Ce=Se.sent;case 30:if(!Ce){Se.next=32;break}throw Ce;case 32:if(!$.xmlResponse){Se.next=36;break}return Se.next=35,this.parseXML(ce.data);case 35:ce.data=Se.sent;case 36:return Se.abrupt("return",ce);case 37:case"end":return Se.stop()}},ne,this,[[3,10]])}),X._getResource=function(ne){var $="/";return ne.bucket&&($+=ne.bucket+"/"),ne.object&&($+=ne.object),$},X._isIP=function(ne){return W._isIP(ne)},X._escape=function(ne){return A.encodeURIComponent(ne).replace(/%2F/g,"/")},X._getReqUrl=function(ne){var $={};g(this.options.endpoint).to($);var ee=this._isIP($.hostname),ce=this.options.cname;!ne.bucket||ce||ee||($.host=ne.bucket+"."+$.host);var de="/";ne.bucket&&ee&&(de+=ne.bucket+"/"),ne.object&&(de+=this._escape(ne.object).replace(/\+/g,"%2B")),$.pathname=de;var Ce={};if(ne.query&&x(Ce,ne.query),ne.subres){var Se={};S.string(ne.subres)?Se[ne.subres]="":S.array(ne.subres)?ne.subres.forEach(function(De){Se[De]=""}):Se=ne.subres,x(Ce,Se)}return $.query=Ce,l.format($)},X._getUserAgent=function(){var ne=T&&T.browser?"js":"nodejs",$="aliyun-sdk-"+ne+"/"+I.version,ee=O.description;return!ee&&T&&(ee="Node.js "+T.version.slice(1)+" on "+T.platform+" "+T.arch),this._checkUserAgent($+" "+ee)},X._checkUserAgent=function(ne){return ne.replace(/\u03b1/,"alpha").replace(/\u03b2/,"beta")},X.checkBrowserAndVersion=function(ne,$){return H.name===ne&&H.version.split(".")[0]===$},X.parseXML=function(ne){return function($){C.isBuffer(ne)&&(ne=ne.toString()),E.parseString(ne,{explicitRoot:!1,explicitArray:!1},$)}},X.requestError=f.default.mark(function ne($){var ee,ce,de,Ce;return f.default.wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:if(ee=null,$.data&&$.data.length){Se.next=5;break}$.status===-1||$.status===-2?(ee=new Error($.message),ee.name=$.name,ee.status=$.status,ee.code=$.name):($.status===404?(ee=new Error("Object not exists"),ee.name="NoSuchKeyError",ee.status=404,ee.code="NoSuchKey"):$.status===412?(ee=new Error("Pre condition failed"),ee.name="PreconditionFailedError",ee.status=412,ee.code="PreconditionFailed"):(ee=new Error("Unknow error, status: "+$.status),ee.name="UnknowError",ee.status=$.status),ee.requestId=$.headers["x-oss-request-id"],ee.host=""),Se.next=30;break;case 5:return ce=String($.data),t("request response error data: %s",ce),de=void 0,Se.prev=8,Se.next=11,this.parseXML(ce)||{};case 11:de=Se.sent,Se.next=21;break;case 14:return Se.prev=14,Se.t0=Se.catch(8),t(ce),Se.t0.message+=` raw xml: `+ce,Se.t0.status=$.status,Se.t0.requestId=$.headers["x-oss-request-id"],Se.abrupt("return",Se.t0);case 21:Ce=de.Message||"unknow request error, status: "+$.status,de.Condition&&(Ce+=" (condition: "+de.Condition+")"),ee=new Error(Ce),ee.name=de.Code?de.Code+"Error":"UnknowError",ee.status=$.status,ee.code=de.Code,ee.requestId=de.RequestId,ee.hostId=de.HostId,ee.serverTime=de.ServerTime;case 30:return t("generate error %j",ee),Se.abrupt("return",ee);case 32:case"end":return Se.stop()}},ne,this,[[8,14]])})}).call(this,w("_process"),w("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(w,P,_){(function(T){"use strict";function C(g){return g&&g.__esModule?g:{default:g}}function c(g,b){if(!(this instanceof c))return new c(g,b);v.call(this,b),this.file=g,this.reader=new FileReader,this.start=0,this.finish=!1,this.fileBuffer=null}var p=w("babel-runtime/core-js/array/from"),u=C(p),o=w("babel-runtime/regenerator"),a=C(o),d=w("is-type-of"),s=w("util"),f=w("path"),i=w("mime"),n=w("copy-to"),t=_;t.multipartUpload=a.default.mark(function g(b,E,m){var y,x,l,S,O,A,D,I,B;return a.default.wrap(function(H){for(;;)switch(H.prev=H.next){case 0:if(this.resetCancelFlag(),m=m||{},!m.checkpoint||!m.checkpoint.uploadId){H.next=6;break}return H.next=5,this._resumeMultipart(m.checkpoint,m);case 5:return H.abrupt("return",H.sent);case 6:return y=102400,m.mime||(d.file(E)?m.mime=i.getType(f.extname(E.name)):d.blob(E)?m.mime=E.type:m.mime=i.getType(f.extname(E))),m.headers=m.headers||{},this._convertMetaToHeaders(m.meta,m.headers),H.next=12,this._getFileSize(E);case 12:if(!((x=H.sent)0&&n(S).to(A),D=this._divideParts(y,x),I=D.length,B=!1,H=a.default.mark(function De(be,_e){var Ke,Ne,Be;return a.default.wrap(function(ze){for(;;)switch(ze.prev=ze.next){case 0:if(be.isCancel()){ze.next=21;break}return ze.prev=1,Ke=D[_e-1],Ne={stream:be._createStream(m,Ke.start,Ke.end),size:Ke.end-Ke.start},ze.next=6,be._uploadPart(O,l,_e,Ne);case 6:if(Be=ze.sent,be.isCancel()||B){ze.next=13;break}if(b.doneParts.push({number:_e,etag:Be.res.headers.etag}),A.push({number:_e,etag:Be.res.headers.etag}),!E||!E.progress){ze.next=13;break}return ze.next=13,E.progress(S.length/I,b,Be.res);case 13:ze.next=21;break;case 15:if(ze.prev=15,ze.t0=ze.catch(1),be.isCancel()){ze.next=21;break}throw be.cancel(),ze.t0.partNum=_e,ze.t0;case 21:case"end":return ze.stop()}},De,this,[[1,15]])}),te=(0,u.default)(new Array(I),function(De,be){return be+1}),W=A.map(function(De){return De.number}),V=te.filter(function(De){return W.indexOf(De)<0}),X=5,ne=E.parallel||X,!this.checkBrowserAndVersion("Internet Explorer","10")&&ne!==1){Se.next=26;break}$=0;case 16:if(!($0)){Se.next=37;break}throw this.resetCancelFlag(),Ce=de[0],Ce.message="Failed to upload some parts with error: "+Ce.toString()+" part_num: "+Ce.partNum,Ce;case 37:if(!this.isCancel()){Se.next=40;break}throw ee=null,this._makeCancelEvent();case 40:return Se.next=42,this.completeMultipartUpload(O,l,A,E);case 42:return Se.abrupt("return",Se.sent);case 43:case"end":return Se.stop()}},g,this)}),d.file=function(g){return typeof File!="undefined"&&g instanceof File},d.blob=function(g){return typeof Blob!="undefined"&&g instanceof Blob},t._getFileSize=a.default.mark(function g(b){var E;return a.default.wrap(function(m){for(;;)switch(m.prev=m.next){case 0:if(!d.buffer(b)){m.next=4;break}return m.abrupt("return",b.length);case 4:if(!d.blob(b)&&!d.file(b)){m.next=6;break}return m.abrupt("return",b.size);case 6:if(!d.string(b)){m.next=11;break}return m.next=9,this._statFile(b);case 9:return E=m.sent,m.abrupt("return",E.size);case 11:throw new Error("_getFileSize requires Buffer/File/String.");case 12:case"end":return m.stop()}},g,this)});var h=w("stream"),v=h.Readable;s.inherits(c,v),c.prototype.readFileAndPush=function(g){if(this.fileBuffer)for(var b=!0;b&&this.fileBuffer&&this.startthis.fileBuffer.length?this.fileBuffer.length:m,this.start=m,b=this.push(this.fileBuffer.slice(E,m))}},c.prototype._read=function(g){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);g=g||16384;var b=this;this.reader.onload=function(E){b.fileBuffer=new T(new Uint8Array(E.target.result)),b.file=null,b.readFileAndPush(g)},this.start===0?this.reader.readAsArrayBuffer(this.file):this.readFileAndPush(g)},t._createStream=function(g,b,E){if(d.blob(g)||d.file(g))return new c(g.slice(b,E));throw new Error("_createStream requires File/String.")},t._getPartSize=function(g,b){return b?Math.max(Math.ceil(g/1e4),b):1048576},t._divideParts=function(g,b){for(var E=Math.ceil(g/b),m=[],y=0;y `,m.quiet?y+=` true `:y+=` false `,x=0;x"+a.escape(this._objectName(E[x]))+` `;return y+="",o("delete multi objects: %s",y),m.subres="delete",l=this._objectRequestParams("POST","",m),l.mime="xml",l.content=y,l.xmlResponse=!0,l.successStatuses=[200],D.next=14,this.request(l);case 14:return S=D.sent,O=S.data,A=O&&O.Deleted||null,A&&(Array.isArray(A)||(A=[A]),A=A.map(function(I){return I.Key})),D.abrupt("return",{res:S.res,deleted:A});case 19:case"end":return D.stop()}},b,this)}),g.copy=u.default.mark(function b(E,m,y){var x,l,S;return u.default.wrap(function(O){for(;;)switch(O.prev=O.next){case 0:return y=y||{},y.headers=y.headers||{},(0,c.default)(y.headers).forEach(function(A){y.headers["x-oss-copy-source-"+A.toLowerCase()]=y.headers[A]}),y.meta&&(y.headers["x-oss-metadata-directive"]="REPLACE"),this._convertMetaToHeaders(y.meta,y.headers),m=m[0]!=="/"?"/"+this.options.bucket+"/"+encodeURIComponent(m):"/"+encodeURIComponent(m.slice(1)),y.headers["x-oss-copy-source"]=m,x=this._objectRequestParams("PUT",E,y),x.xmlResponse=!0,x.successStatuses=[200,304],O.next=12,this.request(x);case 12:return l=O.sent,S=l.data,S&&(S={etag:S.ETag,lastModified:S.LastModified}),O.abrupt("return",{data:S,res:l.res});case 16:case"end":return O.stop()}},b,this)}),g.putMeta=u.default.mark(function b(E,m,y){return u.default.wrap(function(x){for(;;)switch(x.prev=x.next){case 0:return x.next=2,this.copy(E,E,{meta:m||{},timeout:y&&y.timeout,ctx:y&&y.ctx});case 2:return x.abrupt("return",x.sent);case 3:case"end":return x.stop()}},b,this)}),g.list=u.default.mark(function b(E,m){var y,x,l,S,O;return u.default.wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return y=this._objectRequestParams("GET","",m),y.query=E,y.xmlResponse=!0,y.successStatuses=[200],A.next=6,this.request(y);case 6:return x=A.sent,l=x.data.Contents,S=this,l&&(Array.isArray(l)||(l=[l]),l=l.map(function(D){return{name:D.Key,url:S._objectUrl(D.Key),lastModified:D.LastModified,etag:D.ETag,type:D.Type,size:Number(D.Size),storageClass:D.StorageClass,owner:{id:D.Owner.ID,displayName:D.Owner.DisplayName}}})),O=x.data.CommonPrefixes||null,O&&(Array.isArray(O)||(O=[O]),O=O.map(function(D){return D.Prefix})),A.abrupt("return",{res:x.res,objects:l,prefixes:O,nextMarker:x.data.NextMarker||null,isTruncated:x.data.IsTruncated==="true"});case 13:case"end":return A.stop()}},b,this)}),g.putACL=u.default.mark(function b(E,m,y){var x,l;return u.default.wrap(function(S){for(;;)switch(S.prev=S.next){case 0:return y=y||{},y.subres="acl",y.headers=y.headers||{},y.headers["x-oss-object-acl"]=m,E=this._objectName(E),x=this._objectRequestParams("PUT",E,y),x.successStatuses=[200],S.next=9,this.request(x);case 9:return l=S.sent,S.abrupt("return",{res:l.res});case 11:case"end":return S.stop()}},b,this)}),g.getACL=u.default.mark(function b(E,m){var y,x;return u.default.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return m=m||{},m.subres="acl",E=this._objectName(E),y=this._objectRequestParams("GET",E,m),y.successStatuses=[200],y.xmlResponse=!0,l.next=8,this.request(y);case 8:return x=l.sent,l.abrupt("return",{acl:x.data.AccessControlList.Grant,owner:{id:x.data.Owner.ID,displayName:x.data.Owner.DisplayName},res:x.res});case 10:case"end":return l.stop()}},b,this)}),g.restore=u.default.mark(function b(E,m){var y,x;return u.default.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return m=m||{},m.subres="restore",y=this._objectRequestParams("POST",E,m),y.successStatuses=[202],l.next=6,this.request(y);case 6:return x=l.sent,l.abrupt("return",{res:x.res});case 8:case"end":return l.stop()}},b,this)}),g.signatureUrl=function(b,E){E=E||{},b=this._objectName(b),E.method=E.method||"GET";var m=a.timestamp()+(E.expires||1800),y={bucket:this.options.bucket,object:b},x=this._getResource(y);this.options.stsToken&&(E["security-token"]=this.options.stsToken);var l=v._signatureForURL(this.options.accessKeySecret,E,x,m),S=f.parse(this._getReqUrl(y));return S.query={OSSAccessKeyId:this.options.accessKeyId,Expires:m,Signature:l.Signature},i(l.subResource).to(S.query),S.format()},g.getObjectUrl=function(b,E){return E?E[E.length-1]!=="/"&&(E+="/"):E=this.options.endpoint.format(),E+this._escape(this._objectName(b))},g._objectUrl=function(b){return this._getReqUrl({bucket:this.options.bucket,object:b})},g.generateObjectUrl=function(b,E){if(E)E[E.length-1]!=="/"&&(E+="/");else{E=this.options.endpoint.format();var m=f.parse(E),y=this.options.bucket;m.hostname=y+"."+m.hostname,m.host=y+"."+m.host,E=m.format()}return E+this._escape(this._objectName(b))},g._objectRequestParams=function(b,E,m){if(!this.options.bucket)throw new Error("Please create a bucket first");m=m||{},E=this._objectName(E);var y={object:E,bucket:this.options.bucket,method:b,subres:m&&m.subres,timeout:m&&m.timeout,ctx:m&&m.ctx};return m.headers&&(y.headers={},i(m.headers).to(y.headers)),y},g._objectName=function(b){return b.replace(/^\/+/,"")},g._statFile=function(b){return function(E){d.stat(b,E)}},g._convertMetaToHeaders=function(b,E){b&&(0,c.default)(b).forEach(function(m){E["x-oss-meta-"+m]=b[m]})},g._deleteFileSafe=function(b){return function(E){d.exists(b,function(m){m?d.unlink(b,function(y){y&&o("unlink %j error: %s",b,y),E()}):E()})}}},{"../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(w,P,_){"use strict";_.version="5.3.1"},{}],6:[function(w,P,_){"use strict";function T(n){return n&&n.__esModule?n:{default:n}}function C(n){return n&&typeof n.next=="function"&&typeof n.throw=="function"}function c(n){if(!n)return!1;var t=n.constructor;return!!t&&(t.name==="GeneratorFunction"||t.displayName==="GeneratorFunction"||C(t.prototype)||C(n.prototype))}function p(n,t){var h=new n(t),v=(0,s.default)(h),g=(0,s.default)((0,a.default)(h));v.concat(g).forEach(function(b){c(h[b])?this[b]=f.wrap(h[b]).bind(h):this[b]=h[b]},this)}function u(n){if(!(this instanceof u))return new u(n);p.call(this,i,n)}var o=w("babel-runtime/core-js/object/get-prototype-of"),a=T(o),d=w("babel-runtime/core-js/object/keys"),s=T(d),f=w("co"),i=w("./client");P.exports=u,u.STS=function n(t){if(!(this instanceof n))return new n(t);p.call(this,i.STS,t)}},{"./client":2,"babel-runtime/core-js/object/get-prototype-of":22,"babel-runtime/core-js/object/keys":23,co:41}],7:[function(w,P,_){(function(T){"use strict";function C(a){return a&&a.__esModule?a:{default:a}}var c=w("babel-runtime/core-js/object/keys"),p=C(c),u=w("babel-runtime/core-js/json/stringify"),o=C(u);_.encodeCallback=function(a,d){if(a.headers=a.headers||{},!Object.prototype.hasOwnProperty.call(a.headers,"x-oss-callback")&&d.callback){var s={callbackUrl:encodeURI(d.callback.url),callbackBody:d.callback.body};d.callback.host&&(s.callbackHost=d.callback.host),d.callback.contentType&&(s.callbackBodyType=d.callback.contentType);var f=new T((0,o.default)(s)).toString("base64");if(a.headers["x-oss-callback"]=f,d.callback.customValue){var i={};(0,p.default)(d.callback.customValue).forEach(function(n){i["x:"+n]=d.callback.customValue[n]}),a.headers["x-oss-callback-var"]=new T((0,o.default)(i)).toString("base64")}}}}).call(this,w("buffer").Buffer)},{"babel-runtime/core-js/json/stringify":17,"babel-runtime/core-js/object/keys":23,buffer:38}],8:[function(w,P,_){"use strict";var T=w("babel-runtime/regenerator"),C=function(o){return o&&o.__esModule?o:{default:o}}(T),c=w("copy-to"),p=w("./callback"),u=_;u.listUploads=C.default.mark(function o(a,d){var s,f,i,n;return C.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return d=d||{},s={},c(d).to(s),s.subres="uploads",f=this._objectRequestParams("GET","",s),f.query=a,f.xmlResponse=!0,f.successStatuses=[200],t.next=10,this.request(f);case 10:return i=t.sent,n=i.data.Upload||[],Array.isArray(n)||(n=[n]),n=n.map(function(h){return{name:h.Key,uploadId:h.UploadId,initiated:h.Initiated}}),t.abrupt("return",{res:i.res,uploads:n,bucket:i.data.Bucket,nextKeyMarker:i.data.NextKeyMarker,nextUploadIdMarker:i.data.NextUploadIdMarker,isTruncated:i.data.IsTruncated==="true"});case 15:case"end":return t.stop()}},o,this)}),u.listParts=C.default.mark(function o(a,d,s,f){var i,n,t;return C.default.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return f=f||{},i={},c(f).to(i),i.subres={uploadId:d},n=this._objectRequestParams("GET",a,i),n.query=s,n.xmlResponse=!0,n.successStatuses=[200],h.next=10,this.request(n);case 10:return t=h.sent,h.abrupt("return",{res:t.res,uploadId:t.data.UploadId,bucket:t.data.Bucket,name:t.data.Key,partNumberMarker:t.data.PartNumberMarker,nextPartNumberMarker:t.data.NextPartNumberMarker,maxParts:t.data.MaxParts,isTruncated:t.data.IsTruncated,parts:t.data.Part||[]});case 12:case"end":return h.stop()}},o,this)}),u.abortMultipartUpload=C.default.mark(function o(a,d,s){var f,i,n;return C.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return this.cancel(),s=s||{},f={},c(s).to(f),f.subres={uploadId:d},i=this._objectRequestParams("DELETE",a,f),i.successStatuses=[204],t.next=9,this.request(i);case 9:return n=t.sent,t.abrupt("return",{res:n.res});case 11:case"end":return t.stop()}},o,this)}),u.initMultipartUpload=C.default.mark(function o(a,d){var s,f,i;return C.default.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return d=d||{},s={},c(d).to(s),s.headers=s.headers||{},this._convertMetaToHeaders(d.meta,s.headers),s.subres="uploads",f=this._objectRequestParams("POST",a,s),f.mime=d.mime,f.xmlResponse=!0,f.successStatuses=[200],n.next=12,this.request(f);case 12:return i=n.sent,n.abrupt("return",{res:i.res,bucket:i.data.Bucket,name:i.data.Key,uploadId:i.data.UploadId});case 14:case"end":return n.stop()}},o,this)}),u.uploadPart=C.default.mark(function o(a,d,s,f,i,n,t){var h;return C.default.wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return h={stream:this._createStream(f,i,n),size:n-i},v.next=3,this._uploadPart(a,d,s,h,t);case 3:return v.abrupt("return",v.sent);case 4:case"end":return v.stop()}},o,this)}),u.completeMultipartUpload=C.default.mark(function o(a,d,s,f){var i,n,t,h,v,g,b,E;return C.default.wrap(function(m){for(;;)switch(m.prev=m.next){case 0:for(i=s.concat().sort(function(y,x){return y.number-x.number}).filter(function(y,x,l){return!x||y.number!==l[x-1].number}),n=` `,t=0;t `,n+=""+h.number+` `,n+=""+h.etag+` `,n+=` `;return n+="",f=f||{},v={},c(f).to(v),v.subres={uploadId:d},g=this._objectRequestParams("POST",a,v),p.encodeCallback(g,v),g.mime="xml",g.content=n,g.headers&&g.headers["x-oss-callback"]||(g.xmlResponse=!0),g.successStatuses=[200],m.next=16,this.request(g);case 16:return b=m.sent,E={res:b.res,bucket:g.bucket,name:a,etag:b.res.headers.etag},g.headers&&g.headers["x-oss-callback"]&&(E.data=JSON.parse(b.data.toString())),m.abrupt("return",E);case 20:case"end":return m.stop()}},o,this)}),u._uploadPart=C.default.mark(function o(a,d,s,f,i){var n,t,h;return C.default.wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return i=i||{},n={},c(i).to(n),n.headers={"Content-Length":f.size},n.subres={partNumber:s,uploadId:d},t=this._objectRequestParams("PUT",a,n),t.mime=n.mime,t.stream=f.stream,t.successStatuses=[200],v.next=11,this.request(t);case 11:return h=v.sent,f.stream=null,t.stream=null,v.abrupt("return",{name:a,etag:h.res.headers.etag,res:h.res});case 15:case"end":return v.stop()}},o,this)})},{"./callback":7,"babel-runtime/regenerator":33,"copy-to":43}],9:[function(w,P,_){(function(T){"use strict";function C(s){return s&&s.__esModule?s:{default:s}}var c=w("babel-runtime/core-js/json/stringify"),p=C(c),u=w("babel-runtime/core-js/object/keys"),o=C(u),a=w("./../../shims/crypto/crypto.js"),d=w("is-type-of");_.buildCanonicalizedResource=function(s,f){var i=""+s,n="?";if(d.string(f)&&f.trim()!=="")i+=n+f;else if(d.array(f))f.sort(),i+=n+f.join("&");else if(f){var t=function(v,g){return v[0]>g[0]?1:v[0]0)throw new Error("Invalid string. Length must be a multiple of 4");var g=h.indexOf("=");return g===-1&&(g=v),[g,g===v?0:4-g%4]}function C(h){var v=T(h),g=v[0],b=v[1];return 3*(g+b)/4-b}function c(h,v,g){return 3*(v+g)/4-g}function p(h){for(var v,g=T(h),b=g[0],E=g[1],m=new f(c(h,b,E)),y=0,x=E>0?b-4:b,l=0;l>16&255,m[y++]=v>>8&255,m[y++]=255&v;return E===2&&(v=s[h.charCodeAt(l)]<<2|s[h.charCodeAt(l+1)]>>4,m[y++]=255&v),E===1&&(v=s[h.charCodeAt(l)]<<10|s[h.charCodeAt(l+1)]<<4|s[h.charCodeAt(l+2)]>>2,m[y++]=v>>8&255,m[y++]=255&v),m}function u(h){return d[h>>18&63]+d[h>>12&63]+d[h>>6&63]+d[63&h]}function o(h,v,g){for(var b,E=[],m=v;my?y:m+16383));return b===1?(v=h[g-1],E.push(d[v>>2]+d[v<<4&63]+"==")):b===2&&(v=(h[g-2]<<8)+h[g-1],E.push(d[v>>10]+d[v>>4&63]+d[v<<2&63]+"=")),E.join("")}_.byteLength=C,_.toByteArray=p,_.fromByteArray=a;for(var d=[],s=[],f=typeof Uint8Array!="undefined"?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,t=i.length;n1&&$[1]||""}function i(ne){var $=s.match(ne);return $&&$.length>1&&$[2]||""}var n,t=f(/(ipod|iphone|ipad)/i).toLowerCase(),h=/like android/i.test(s),v=!h&&/android/i.test(s),g=/nexus\s*[0-6]\s*/i.test(s),b=!g&&/nexus\s*[0-9]+/i.test(s),E=/CrOS/.test(s),m=/silk/i.test(s),y=/sailfish/i.test(s),x=/tizen/i.test(s),l=/(web|hpw)os/i.test(s),S=/windows phone/i.test(s),O=(/SamsungBrowser/i.test(s),!S&&/windows/i.test(s)),A=!t&&!m&&/macintosh/i.test(s),D=!v&&!y&&!x&&!l&&/linux/i.test(s),I=i(/edg([ea]|ios)\/(\d+(\.\d+)?)/i),B=f(/version\/(\d+(\.\d+)?)/i),H=/tablet/i.test(s)&&!/tablet pc/i.test(s),te=!H&&/[^-]mobi/i.test(s),W=/xbox/i.test(s);/opera/i.test(s)?n={name:"Opera",opera:a,version:B||f(/(?:opera|opr|opios)[\s\/](\d+(\.\d+)?)/i)}:/opr\/|opios/i.test(s)?n={name:"Opera",opera:a,version:f(/(?:opr|opios)[\s\/](\d+(\.\d+)?)/i)||B}:/SamsungBrowser/i.test(s)?n={name:"Samsung Internet for Android",samsungBrowser:a,version:B||f(/(?:SamsungBrowser)[\s\/](\d+(\.\d+)?)/i)}:/coast/i.test(s)?n={name:"Opera Coast",coast:a,version:B||f(/(?:coast)[\s\/](\d+(\.\d+)?)/i)}:/yabrowser/i.test(s)?n={name:"Yandex Browser",yandexbrowser:a,version:B||f(/(?:yabrowser)[\s\/](\d+(\.\d+)?)/i)}:/ucbrowser/i.test(s)?n={name:"UC Browser",ucbrowser:a,version:f(/(?:ucbrowser)[\s\/](\d+(?:\.\d+)+)/i)}:/mxios/i.test(s)?n={name:"Maxthon",maxthon:a,version:f(/(?:mxios)[\s\/](\d+(?:\.\d+)+)/i)}:/epiphany/i.test(s)?n={name:"Epiphany",epiphany:a,version:f(/(?:epiphany)[\s\/](\d+(?:\.\d+)+)/i)}:/puffin/i.test(s)?n={name:"Puffin",puffin:a,version:f(/(?:puffin)[\s\/](\d+(?:\.\d+)?)/i)}:/sleipnir/i.test(s)?n={name:"Sleipnir",sleipnir:a,version:f(/(?:sleipnir)[\s\/](\d+(?:\.\d+)+)/i)}:/k-meleon/i.test(s)?n={name:"K-Meleon",kMeleon:a,version:f(/(?:k-meleon)[\s\/](\d+(?:\.\d+)+)/i)}:S?(n={name:"Windows Phone",osname:"Windows Phone",windowsphone:a},I?(n.msedge=a,n.version=I):(n.msie=a,n.version=f(/iemobile\/(\d+(\.\d+)?)/i))):/msie|trident/i.test(s)?n={name:"Internet Explorer",msie:a,version:f(/(?:msie |rv:)(\d+(\.\d+)?)/i)}:E?n={name:"Chrome",osname:"Chrome OS",chromeos:a,chromeBook:a,chrome:a,version:f(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:/edg([ea]|ios)/i.test(s)?n={name:"Microsoft Edge",msedge:a,version:I}:/vivaldi/i.test(s)?n={name:"Vivaldi",vivaldi:a,version:f(/vivaldi\/(\d+(\.\d+)?)/i)||B}:y?n={name:"Sailfish",osname:"Sailfish OS",sailfish:a,version:f(/sailfish\s?browser\/(\d+(\.\d+)?)/i)}:/seamonkey\//i.test(s)?n={name:"SeaMonkey",seamonkey:a,version:f(/seamonkey\/(\d+(\.\d+)?)/i)}:/firefox|iceweasel|fxios/i.test(s)?(n={name:"Firefox",firefox:a,version:f(/(?:firefox|iceweasel|fxios)[ \/](\d+(\.\d+)?)/i)},/\((mobile|tablet);[^\)]*rv:[\d\.]+\)/i.test(s)&&(n.firefoxos=a,n.osname="Firefox OS")):m?n={name:"Amazon Silk",silk:a,version:f(/silk\/(\d+(\.\d+)?)/i)}:/phantom/i.test(s)?n={name:"PhantomJS",phantom:a,version:f(/phantomjs\/(\d+(\.\d+)?)/i)}:/slimerjs/i.test(s)?n={name:"SlimerJS",slimer:a,version:f(/slimerjs\/(\d+(\.\d+)?)/i)}:/blackberry|\bbb\d+/i.test(s)||/rim\stablet/i.test(s)?n={name:"BlackBerry",osname:"BlackBerry OS",blackberry:a,version:B||f(/blackberry[\d]+\/(\d+(\.\d+)?)/i)}:l?(n={name:"WebOS",osname:"WebOS",webos:a,version:B||f(/w(?:eb)?osbrowser\/(\d+(\.\d+)?)/i)},/touchpad\//i.test(s)&&(n.touchpad=a)):/bada/i.test(s)?n={name:"Bada",osname:"Bada",bada:a,version:f(/dolfin\/(\d+(\.\d+)?)/i)}:x?n={name:"Tizen",osname:"Tizen",tizen:a,version:f(/(?:tizen\s?)?browser\/(\d+(\.\d+)?)/i)||B}:/qupzilla/i.test(s)?n={name:"QupZilla",qupzilla:a,version:f(/(?:qupzilla)[\s\/](\d+(?:\.\d+)+)/i)||B}:/chromium/i.test(s)?n={name:"Chromium",chromium:a,version:f(/(?:chromium)[\s\/](\d+(?:\.\d+)?)/i)||B}:/chrome|crios|crmo/i.test(s)?n={name:"Chrome",chrome:a,version:f(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:v?n={name:"Android",version:B}:/safari|applewebkit/i.test(s)?(n={name:"Safari",safari:a},B&&(n.version=B)):t?(n={name:t=="iphone"?"iPhone":t=="ipad"?"iPad":"iPod"},B&&(n.version=B)):n=/googlebot/i.test(s)?{name:"Googlebot",googlebot:a,version:f(/googlebot\/(\d+(\.\d+))/i)||B}:{name:f(/^(.*)\/(.*) /),version:i(/^(.*)\/(.*) /)},!n.msedge&&/(apple)?webkit/i.test(s)?(/(apple)?webkit\/537\.36/i.test(s)?(n.name=n.name||"Blink",n.blink=a):(n.name=n.name||"Webkit",n.webkit=a),!n.version&&B&&(n.version=B)):!n.opera&&/gecko\//i.test(s)&&(n.name=n.name||"Gecko",n.gecko=a,n.version=n.version||f(/gecko\/(\d+(\.\d+)?)/i)),n.windowsphone||!v&&!n.silk?!n.windowsphone&&t?(n[t]=a,n.ios=a,n.osname="iOS"):A?(n.mac=a,n.osname="macOS"):W?(n.xbox=a,n.osname="Xbox"):O?(n.windows=a,n.osname="Windows"):D&&(n.linux=a,n.osname="Linux"):(n.android=a,n.osname="Android");var V="";n.windows?V=function(ne){switch(ne){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}}(f(/Windows ((NT|XP)( \d\d?.\d)?)/i)):n.windowsphone?V=f(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i):n.mac?(V=f(/Mac OS X (\d+([_\.\s]\d+)*)/i),V=V.replace(/[_\s]/g,".")):t?(V=f(/os (\d+([_\s]\d+)*) like mac os x/i),V=V.replace(/[_\s]/g,".")):v?V=f(/android[ \/-](\d+(\.\d+)*)/i):n.webos?V=f(/(?:web|hpw)os\/(\d+(\.\d+)*)/i):n.blackberry?V=f(/rim\stablet\sos\s(\d+(\.\d+)*)/i):n.bada?V=f(/bada\/(\d+(\.\d+)*)/i):n.tizen&&(V=f(/tizen[\/\s](\d+(\.\d+)*)/i)),V&&(n.osversion=V);var X=!n.windows&&V.split(".")[0];return H||b||t=="ipad"||v&&(X==3||X>=4&&!te)||n.silk?n.tablet=a:(te||t=="iphone"||t=="ipod"||v||g||n.blackberry||n.webos||n.bada)&&(n.mobile=a),n.msedge||n.msie&&n.version>=10||n.yandexbrowser&&n.version>=15||n.vivaldi&&n.version>=1||n.chrome&&n.version>=20||n.samsungBrowser&&n.version>=4||n.firefox&&n.version>=20||n.safari&&n.version>=6||n.opera&&n.version>=10||n.ios&&n.osversion&&n.osversion.split(".")[0]>=6||n.blackberry&&n.version>=10.1||n.chromium&&n.version>=20?n.a=a:n.msie&&n.version<10||n.chrome&&n.version<20||n.firefox&&n.version<20||n.safari&&n.version<6||n.opera&&n.version<10||n.ios&&n.osversion&&n.osversion.split(".")[0]<6||n.chromium&&n.version<20?n.c=a:n.x=a,n}function C(s){return s.split(".").length}function c(s,f){var i,n=[];if(Array.prototype.map)return Array.prototype.map.call(s,f);for(i=0;i=0;){if(i[0][f]>i[1][f])return 1;if(i[0][f]!==i[1][f])return-1;if(f===0)return 0}}function u(s,f,i){var n=d;typeof f=="string"&&(i=f,f=void 0),f===void 0&&(f=!1),i&&(n=T(i));var t=""+n.version;for(var h in s)if(s.hasOwnProperty(h)&&n[h]){if(typeof s[h]!="string")throw new Error("Browser version in the minVersion map should be a string: "+h+": "+String(s));return p([t,s[h]])<0}return f}function o(s,f,i){return!u(s,f,i)}var a=!0,d=T(typeof navigator!="undefined"&&navigator.userAgent||"");return d.test=function(s){for(var f=0;f=this.charLength-this.charReceived?this.charLength-this.charReceived:d.length;if(d.copy(this.charBuffer,this.charReceived,0,f),this.charReceived+=f,this.charReceived=55296&&n<=56319)){if(this.charReceived=this.charLength=0,d.length===0)return s;break}this.charLength+=this.surrogateSize,s=""}this.detectIncompleteChar(d);var i=d.length;this.charLength&&(d.copy(this.charBuffer,0,d.length-this.charReceived,i),i-=this.charReceived),s+=d.toString(this.encoding,0,i);var i=s.length-1,n=s.charCodeAt(i);if(n>=55296&&n<=56319){var t=this.surrogateSize;return this.charLength+=t,this.charReceived+=t,this.charBuffer.copy(this.charBuffer,t,0,t),d.copy(this.charBuffer,0,0,t),s.substring(0,i)}return s},a.prototype.detectIncompleteChar=function(d){for(var s=d.length>=3?3:d.length;s>0;s--){var f=d[d.length-s];if(s==1&&f>>5==6){this.charLength=2;break}if(s<=2&&f>>4==14){this.charLength=3;break}if(s<=3&&f>>3==30){this.charLength=4;break}}this.charReceived=s},a.prototype.end=function(d){var s="";if(d&&d.length&&(s=this.write(d)),this.charReceived){var f=this.charReceived,i=this.charBuffer,n=this.encoding;s+=i.slice(0,f).toString(n)}return s}},{buffer:38}],38:[function(w,P,_){(function(T){"use strict";function C(){return p.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function c(k,U){if(C()=C())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+C().toString(16)+" bytes");return 0|k}function h(k){return+k!=k&&(k=0),p.alloc(+k)}function v(k,U){if(p.isBuffer(k))return k.length;if(typeof ArrayBuffer!="undefined"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(k)||k instanceof ArrayBuffer))return k.byteLength;typeof k!="string"&&(k=""+k);var q=k.length;if(q===0)return 0;for(var Y=!1;;)switch(U){case"ascii":case"latin1":case"binary":return q;case"utf8":case"utf-8":case void 0:return _e(k).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*q;case"hex":return q>>>1;case"base64":return Be(k).length;default:if(Y)return _e(k).length;U=(""+U).toLowerCase(),Y=!0}}function g(k,U,q){var Y=!1;if((U===void 0||U<0)&&(U=0),U>this.length)return"";if((q===void 0||q>this.length)&&(q=this.length),q<=0)return"";if(q>>>=0,U>>>=0,q<=U)return"";for(k||(k="utf8");;)switch(k){case"hex":return W(this,U,q);case"utf8":case"utf-8":return I(this,U,q);case"ascii":return H(this,U,q);case"latin1":case"binary":return te(this,U,q);case"base64":return D(this,U,q);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return V(this,U,q);default:if(Y)throw new TypeError("Unknown encoding: "+k);k=(k+"").toLowerCase(),Y=!0}}function b(k,U,q){var Y=k[U];k[U]=k[q],k[q]=Y}function E(k,U,q,Y,J){if(k.length===0)return-1;if(typeof q=="string"?(Y=q,q=0):q>2147483647?q=2147483647:q<-2147483648&&(q=-2147483648),q=+q,isNaN(q)&&(q=J?0:k.length-1),q<0&&(q=k.length+q),q>=k.length){if(J)return-1;q=k.length-1}else if(q<0){if(!J)return-1;q=0}if(typeof U=="string"&&(U=p.from(U,Y)),p.isBuffer(U))return U.length===0?-1:m(k,U,q,Y,J);if(typeof U=="number")return U&=255,p.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?J?Uint8Array.prototype.indexOf.call(k,U,q):Uint8Array.prototype.lastIndexOf.call(k,U,q):m(k,[U],q,Y,J);throw new TypeError("val must be string, number or Buffer")}function m(k,U,q,Y,J){function xe(Xe,Fe){return ke===1?Xe[Fe]:Xe.readUInt16BE(Fe*ke)}var ke=1,dt=k.length,Ue=U.length;if(Y!==void 0&&((Y=String(Y).toLowerCase())==="ucs2"||Y==="ucs-2"||Y==="utf16le"||Y==="utf-16le")){if(k.length<2||U.length<2)return-1;ke=2,dt/=2,Ue/=2,q/=2}var je;if(J){var tt=-1;for(je=q;jedt&&(q=dt-Ue),je=q;je>=0;je--){for(var mt=!0,Qe=0;QeJ&&(Y=J):Y=J;var xe=U.length;if(xe%2!=0)throw new TypeError("Invalid hex string");Y>xe/2&&(Y=xe/2);for(var ke=0;ke239?4:xe>223?3:xe>191?2:1;if(J+dt<=q){var Ue,je,tt,mt;switch(dt){case 1:xe<128&&(ke=xe);break;case 2:Ue=k[J+1],(192&Ue)==128&&(mt=(31&xe)<<6|63&Ue)>127&&(ke=mt);break;case 3:Ue=k[J+1],je=k[J+2],(192&Ue)==128&&(192&je)==128&&(mt=(15&xe)<<12|(63&Ue)<<6|63&je)>2047&&(mt<55296||mt>57343)&&(ke=mt);break;case 4:Ue=k[J+1],je=k[J+2],tt=k[J+3],(192&Ue)==128&&(192&je)==128&&(192&tt)==128&&(mt=(15&xe)<<18|(63&Ue)<<12|(63&je)<<6|63&tt)>65535&&mt<1114112&&(ke=mt)}}ke===null?(ke=65533,dt=1):ke>65535&&(ke-=65536,Y.push(ke>>>10&1023|55296),ke=56320|1023&ke),Y.push(ke),J+=dt}return B(Y)}function B(k){var U=k.length;if(U<=nt)return String.fromCharCode.apply(String,k);for(var q="",Y=0;YY)&&(q=Y);for(var J="",xe=U;xeq)throw new RangeError("Trying to access beyond buffer length")}function ne(k,U,q,Y,J,xe){if(!p.isBuffer(k))throw new TypeError('"buffer" argument must be a Buffer instance');if(U>J||Uk.length)throw new RangeError("Index out of range")}function $(k,U,q,Y){U<0&&(U=65535+U+1);for(var J=0,xe=Math.min(k.length-q,2);J>>8*(Y?J:1-J)}function ee(k,U,q,Y){U<0&&(U=4294967295+U+1);for(var J=0,xe=Math.min(k.length-q,4);J>>8*(Y?J:3-J)&255}function ce(k,U,q,Y,J,xe){if(q+Y>k.length)throw new RangeError("Index out of range");if(q<0)throw new RangeError("Index out of range")}function de(k,U,q,Y,J){return J||ce(k,U,q,4,34028234663852886e22,-34028234663852886e22),We.write(k,U,q,Y,23,4),q+4}function Ce(k,U,q,Y,J){return J||ce(k,U,q,8,17976931348623157e292,-17976931348623157e292),We.write(k,U,q,Y,52,8),q+8}function Se(k){if(k=De(k).replace(re,""),k.length<2)return"";for(;k.length%4!=0;)k+="=";return k}function De(k){return k.trim?k.trim():k.replace(/^\s+|\s+$/g,"")}function be(k){return k<16?"0"+k.toString(16):k.toString(16)}function _e(k,U){U=U||1/0;for(var q,Y=k.length,J=null,xe=[],ke=0;ke55295&&q<57344){if(!J){if(q>56319){(U-=3)>-1&&xe.push(239,191,189);continue}if(ke+1===Y){(U-=3)>-1&&xe.push(239,191,189);continue}J=q;continue}if(q<56320){(U-=3)>-1&&xe.push(239,191,189),J=q;continue}q=65536+(J-55296<<10|q-56320)}else J&&(U-=3)>-1&&xe.push(239,191,189);if(J=null,q<128){if((U-=1)<0)break;xe.push(q)}else if(q<2048){if((U-=2)<0)break;xe.push(q>>6|192,63&q|128)}else if(q<65536){if((U-=3)<0)break;xe.push(q>>12|224,q>>6&63|128,63&q|128)}else{if(!(q<1114112))throw new Error("Invalid code point");if((U-=4)<0)break;xe.push(q>>18|240,q>>12&63|128,q>>6&63|128,63&q|128)}}return xe}function Ke(k){for(var U=[],q=0;q>8,J=q%256,xe.push(J),xe.push(Y);return xe}function Be(k){return pe.toByteArray(Se(k))}function ze(k,U,q,Y){for(var J=0;J=U.length||J>=k.length);++J)U[J+q]=k[J];return J}function ye(k){return k!==k}var pe=w("base64-js"),We=w("ieee754"),He=w("isarray");_.Buffer=p,_.SlowBuffer=h,_.INSPECT_MAX_BYTES=50,p.TYPED_ARRAY_SUPPORT=T.TYPED_ARRAY_SUPPORT!==void 0?T.TYPED_ARRAY_SUPPORT:function(){try{var k=new Uint8Array(1);return k.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},k.foo()===42&&typeof k.subarray=="function"&&k.subarray(1,1).byteLength===0}catch(U){return!1}}(),_.kMaxLength=C(),p.poolSize=8192,p._augment=function(k){return k.__proto__=p.prototype,k},p.from=function(k,U,q){return u(null,k,U,q)},p.TYPED_ARRAY_SUPPORT&&(p.prototype.__proto__=Uint8Array.prototype,p.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&p[Symbol.species]===p&&Object.defineProperty(p,Symbol.species,{value:null,configurable:!0})),p.alloc=function(k,U,q){return a(null,k,U,q)},p.allocUnsafe=function(k){return d(null,k)},p.allocUnsafeSlow=function(k){return d(null,k)},p.isBuffer=function(k){return!(k==null||!k._isBuffer)},p.compare=function(k,U){if(!p.isBuffer(k)||!p.isBuffer(U))throw new TypeError("Arguments must be Buffers");if(k===U)return 0;for(var q=k.length,Y=U.length,J=0,xe=Math.min(q,Y);J0&&(k=this.toString("hex",0,U).match(/.{2}/g).join(" "),this.length>U&&(k+=" ... ")),""},p.prototype.compare=function(k,U,q,Y,J){if(!p.isBuffer(k))throw new TypeError("Argument must be a Buffer");if(U===void 0&&(U=0),q===void 0&&(q=k?k.length:0),Y===void 0&&(Y=0),J===void 0&&(J=this.length),U<0||q>k.length||Y<0||J>this.length)throw new RangeError("out of range index");if(Y>=J&&U>=q)return 0;if(Y>=J)return-1;if(U>=q)return 1;if(U>>>=0,q>>>=0,Y>>>=0,J>>>=0,this===k)return 0;for(var xe=J-Y,ke=q-U,dt=Math.min(xe,ke),Ue=this.slice(Y,J),je=k.slice(U,q),tt=0;ttJ)&&(q=J),k.length>0&&(q<0||U<0)||U>this.length)throw new RangeError("Attempt to write outside buffer bounds");Y||(Y="utf8");for(var xe=!1;;)switch(Y){case"hex":return y(this,k,U,q);case"utf8":case"utf-8":return x(this,k,U,q);case"ascii":return l(this,k,U,q);case"latin1":case"binary":return S(this,k,U,q);case"base64":return O(this,k,U,q);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,k,U,q);default:if(xe)throw new TypeError("Unknown encoding: "+Y);Y=(""+Y).toLowerCase(),xe=!0}},p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var nt=4096;p.prototype.slice=function(k,U){var q=this.length;k=~~k,U=U===void 0?q:~~U,k<0?(k+=q)<0&&(k=0):k>q&&(k=q),U<0?(U+=q)<0&&(U=0):U>q&&(U=q),U0&&(J*=256);)Y+=this[k+--U]*J;return Y},p.prototype.readUInt8=function(k,U){return U||X(k,1,this.length),this[k]},p.prototype.readUInt16LE=function(k,U){return U||X(k,2,this.length),this[k]|this[k+1]<<8},p.prototype.readUInt16BE=function(k,U){return U||X(k,2,this.length),this[k]<<8|this[k+1]},p.prototype.readUInt32LE=function(k,U){return U||X(k,4,this.length),(this[k]|this[k+1]<<8|this[k+2]<<16)+16777216*this[k+3]},p.prototype.readUInt32BE=function(k,U){return U||X(k,4,this.length),16777216*this[k]+(this[k+1]<<16|this[k+2]<<8|this[k+3])},p.prototype.readIntLE=function(k,U,q){k|=0,U|=0,q||X(k,U,this.length);for(var Y=this[k],J=1,xe=0;++xe=J&&(Y-=Math.pow(2,8*U)),Y},p.prototype.readIntBE=function(k,U,q){k|=0,U|=0,q||X(k,U,this.length);for(var Y=U,J=1,xe=this[k+--Y];Y>0&&(J*=256);)xe+=this[k+--Y]*J;return J*=128,xe>=J&&(xe-=Math.pow(2,8*U)),xe},p.prototype.readInt8=function(k,U){return U||X(k,1,this.length),128&this[k]?-1*(255-this[k]+1):this[k]},p.prototype.readInt16LE=function(k,U){U||X(k,2,this.length);var q=this[k]|this[k+1]<<8;return 32768&q?4294901760|q:q},p.prototype.readInt16BE=function(k,U){U||X(k,2,this.length);var q=this[k+1]|this[k]<<8;return 32768&q?4294901760|q:q},p.prototype.readInt32LE=function(k,U){return U||X(k,4,this.length),this[k]|this[k+1]<<8|this[k+2]<<16|this[k+3]<<24},p.prototype.readInt32BE=function(k,U){return U||X(k,4,this.length),this[k]<<24|this[k+1]<<16|this[k+2]<<8|this[k+3]},p.prototype.readFloatLE=function(k,U){return U||X(k,4,this.length),We.read(this,k,!0,23,4)},p.prototype.readFloatBE=function(k,U){return U||X(k,4,this.length),We.read(this,k,!1,23,4)},p.prototype.readDoubleLE=function(k,U){return U||X(k,8,this.length),We.read(this,k,!0,52,8)},p.prototype.readDoubleBE=function(k,U){return U||X(k,8,this.length),We.read(this,k,!1,52,8)},p.prototype.writeUIntLE=function(k,U,q,Y){(k=+k,U|=0,q|=0,!Y)&&ne(this,k,U,q,Math.pow(2,8*q)-1,0);var J=1,xe=0;for(this[U]=255&k;++xe=0&&(xe*=256);)this[U+J]=k/xe&255;return U+q},p.prototype.writeUInt8=function(k,U,q){return k=+k,U|=0,q||ne(this,k,U,1,255,0),p.TYPED_ARRAY_SUPPORT||(k=Math.floor(k)),this[U]=255&k,U+1},p.prototype.writeUInt16LE=function(k,U,q){return k=+k,U|=0,q||ne(this,k,U,2,65535,0),p.TYPED_ARRAY_SUPPORT?(this[U]=255&k,this[U+1]=k>>>8):$(this,k,U,!0),U+2},p.prototype.writeUInt16BE=function(k,U,q){return k=+k,U|=0,q||ne(this,k,U,2,65535,0),p.TYPED_ARRAY_SUPPORT?(this[U]=k>>>8,this[U+1]=255&k):$(this,k,U,!1),U+2},p.prototype.writeUInt32LE=function(k,U,q){return k=+k,U|=0,q||ne(this,k,U,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[U+3]=k>>>24,this[U+2]=k>>>16,this[U+1]=k>>>8,this[U]=255&k):ee(this,k,U,!0),U+4},p.prototype.writeUInt32BE=function(k,U,q){return k=+k,U|=0,q||ne(this,k,U,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[U]=k>>>24,this[U+1]=k>>>16,this[U+2]=k>>>8,this[U+3]=255&k):ee(this,k,U,!1),U+4},p.prototype.writeIntLE=function(k,U,q,Y){if(k=+k,U|=0,!Y){var J=Math.pow(2,8*q-1);ne(this,k,U,q,J-1,-J)}var xe=0,ke=1,dt=0;for(this[U]=255&k;++xe>0)-dt&255;return U+q},p.prototype.writeIntBE=function(k,U,q,Y){if(k=+k,U|=0,!Y){var J=Math.pow(2,8*q-1);ne(this,k,U,q,J-1,-J)}var xe=q-1,ke=1,dt=0;for(this[U+xe]=255&k;--xe>=0&&(ke*=256);)k<0&&dt===0&&this[U+xe+1]!==0&&(dt=1),this[U+xe]=(k/ke>>0)-dt&255;return U+q},p.prototype.writeInt8=function(k,U,q){return k=+k,U|=0,q||ne(this,k,U,1,127,-128),p.TYPED_ARRAY_SUPPORT||(k=Math.floor(k)),k<0&&(k=255+k+1),this[U]=255&k,U+1},p.prototype.writeInt16LE=function(k,U,q){return k=+k,U|=0,q||ne(this,k,U,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[U]=255&k,this[U+1]=k>>>8):$(this,k,U,!0),U+2},p.prototype.writeInt16BE=function(k,U,q){return k=+k,U|=0,q||ne(this,k,U,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[U]=k>>>8,this[U+1]=255&k):$(this,k,U,!1),U+2},p.prototype.writeInt32LE=function(k,U,q){return k=+k,U|=0,q||ne(this,k,U,4,2147483647,-2147483648),p.TYPED_ARRAY_SUPPORT?(this[U]=255&k,this[U+1]=k>>>8,this[U+2]=k>>>16,this[U+3]=k>>>24):ee(this,k,U,!0),U+4},p.prototype.writeInt32BE=function(k,U,q){return k=+k,U|=0,q||ne(this,k,U,4,2147483647,-2147483648),k<0&&(k=4294967295+k+1),p.TYPED_ARRAY_SUPPORT?(this[U]=k>>>24,this[U+1]=k>>>16,this[U+2]=k>>>8,this[U+3]=255&k):ee(this,k,U,!1),U+4},p.prototype.writeFloatLE=function(k,U,q){return de(this,k,U,!0,q)},p.prototype.writeFloatBE=function(k,U,q){return de(this,k,U,!1,q)},p.prototype.writeDoubleLE=function(k,U,q){return Ce(this,k,U,!0,q)},p.prototype.writeDoubleBE=function(k,U,q){return Ce(this,k,U,!1,q)},p.prototype.copy=function(k,U,q,Y){if(q||(q=0),Y||Y===0||(Y=this.length),U>=k.length&&(U=k.length),U||(U=0),Y>0&&Y=this.length)throw new RangeError("sourceStart out of bounds");if(Y<0)throw new RangeError("sourceEnd out of bounds");Y>this.length&&(Y=this.length),k.length-U=0;--J)k[J+U]=this[J+q];else if(xe<1e3||!p.TYPED_ARRAY_SUPPORT)for(J=0;J>>=0,q=q===void 0?this.length:q>>>0,k||(k=0);var xe;if(typeof k=="number")for(xe=U;xe>>1;u(c[d])2&&(g=f.call(arguments,1)),t(g)})})}function p(i){return Promise.all(i.map(C,this))}function u(i){for(var n=new i.constructor,t=Object.keys(i),h=[],v=0;vi;)if((d=s[i++])!=d)return!0}else for(;f>i;i++)if((p||i in s)&&s[i]===o)return p||i||0;return!p&&-1}}},{"./_to-absolute-index":121,"./_to-iobject":123,"./_to-length":124}],63:[function(w,P,_){var T=w("./_cof"),C=w("./_wks")("toStringTag"),c=T(function(){return arguments}())=="Arguments",p=function(u,o){try{return u[o]}catch(a){}};P.exports=function(u){var o,a,d;return u===void 0?"Undefined":u===null?"Null":typeof(a=p(o=Object(u),C))=="string"?a:c?T(o):(d=T(o))=="Object"&&typeof o.callee=="function"?"Arguments":d}},{"./_cof":64,"./_wks":131}],64:[function(w,P,_){var T={}.toString;P.exports=function(C){return T.call(C).slice(8,-1)}},{}],65:[function(w,P,_){var T=P.exports={version:"2.5.7"};typeof __e=="number"&&(__e=T)},{}],66:[function(w,P,_){"use strict";var T=w("./_object-dp"),C=w("./_property-desc");P.exports=function(c,p,u){p in c?T.f(c,p,C(0,u)):c[p]=u}},{"./_object-dp":98,"./_property-desc":111}],67:[function(w,P,_){var T=w("./_a-function");P.exports=function(C,c,p){if(T(C),c===void 0)return C;switch(p){case 1:return function(u){return C.call(c,u)};case 2:return function(u,o){return C.call(c,u,o)};case 3:return function(u,o,a){return C.call(c,u,o,a)}}return function(){return C.apply(c,arguments)}}},{"./_a-function":58}],68:[function(w,P,_){P.exports=function(T){if(T==null)throw TypeError("Can't call method on "+T);return T}},{}],69:[function(w,P,_){P.exports=!w("./_fails")(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7})},{"./_fails":74}],70:[function(w,P,_){var T=w("./_is-object"),C=w("./_global").document,c=T(C)&&T(C.createElement);P.exports=function(p){return c?C.createElement(p):{}}},{"./_global":76,"./_is-object":85}],71:[function(w,P,_){P.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},{}],72:[function(w,P,_){var T=w("./_object-keys"),C=w("./_object-gops"),c=w("./_object-pie");P.exports=function(p){var u=T(p),o=C.f;if(o)for(var a,d=o(p),s=c.f,f=0;d.length>f;)s.call(p,a=d[f++])&&u.push(a);return u}},{"./_object-gops":103,"./_object-keys":106,"./_object-pie":107}],73:[function(w,P,_){var T=w("./_global"),C=w("./_core"),c=w("./_ctx"),p=w("./_hide"),u=w("./_has"),o=function(a,d,s){var f,i,n,t=a&o.F,h=a&o.G,v=a&o.S,g=a&o.P,b=a&o.B,E=a&o.W,m=h?C:C[d]||(C[d]={}),y=m.prototype,x=h?T:v?T[d]:(T[d]||{}).prototype;h&&(s=d);for(f in s)(i=!t&&x&&x[f]!==void 0)&&u(m,f)||(n=i?x[f]:s[f],m[f]=h&&typeof x[f]!="function"?s[f]:b&&i?c(n,T):E&&x[f]==n?function(l){var S=function(O,A,D){if(this instanceof l){switch(arguments.length){case 0:return new l;case 1:return new l(O);case 2:return new l(O,A)}return new l(O,A,D)}return l.apply(this,arguments)};return S.prototype=l.prototype,S}(n):g&&typeof n=="function"?c(Function.call,n):n,g&&((m.virtual||(m.virtual={}))[f]=n,a&o.R&&y&&!y[f]&&p(y,f,n)))};o.F=1,o.G=2,o.S=4,o.P=8,o.B=16,o.W=32,o.U=64,o.R=128,P.exports=o},{"./_core":65,"./_ctx":67,"./_global":76,"./_has":77,"./_hide":78}],74:[function(w,P,_){P.exports=function(T){try{return!!T()}catch(C){return!0}}},{}],75:[function(w,P,_){var T=w("./_ctx"),C=w("./_iter-call"),c=w("./_is-array-iter"),p=w("./_an-object"),u=w("./_to-length"),o=w("./core.get-iterator-method"),a={},d={},_=P.exports=function(s,f,i,n,t){var h,v,g,b,E=t?function(){return s}:o(s),m=T(i,n,f?2:1),y=0;if(typeof E!="function")throw TypeError(s+" is not iterable!");if(c(E)){for(h=u(s.length);h>y;y++)if((b=f?m(p(v=s[y])[0],v[1]):m(s[y]))===a||b===d)return b}else for(g=E.call(s);!(v=g.next()).done;)if((b=C(g,m,v.value,f))===a||b===d)return b};_.BREAK=a,_.RETURN=d},{"./_an-object":61,"./_ctx":67,"./_is-array-iter":83,"./_iter-call":86,"./_to-length":124,"./core.get-iterator-method":132}],76:[function(w,P,_){var T=P.exports=typeof window!="undefined"&&window.Math==Math?window:typeof self!="undefined"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=T)},{}],77:[function(w,P,_){var T={}.hasOwnProperty;P.exports=function(C,c){return T.call(C,c)}},{}],78:[function(w,P,_){var T=w("./_object-dp"),C=w("./_property-desc");P.exports=w("./_descriptors")?function(c,p,u){return T.f(c,p,C(1,u))}:function(c,p,u){return c[p]=u,c}},{"./_descriptors":69,"./_object-dp":98,"./_property-desc":111}],79:[function(w,P,_){var T=w("./_global").document;P.exports=T&&T.documentElement},{"./_global":76}],80:[function(w,P,_){P.exports=!w("./_descriptors")&&!w("./_fails")(function(){return Object.defineProperty(w("./_dom-create")("div"),"a",{get:function(){return 7}}).a!=7})},{"./_descriptors":69,"./_dom-create":70,"./_fails":74}],81:[function(w,P,_){P.exports=function(T,C,c){var p=c===void 0;switch(C.length){case 0:return p?T():T.call(c);case 1:return p?T(C[0]):T.call(c,C[0]);case 2:return p?T(C[0],C[1]):T.call(c,C[0],C[1]);case 3:return p?T(C[0],C[1],C[2]):T.call(c,C[0],C[1],C[2]);case 4:return p?T(C[0],C[1],C[2],C[3]):T.call(c,C[0],C[1],C[2],C[3])}return T.apply(c,C)}},{}],82:[function(w,P,_){var T=w("./_cof");P.exports=Object("z").propertyIsEnumerable(0)?Object:function(C){return T(C)=="String"?C.split(""):Object(C)}},{"./_cof":64}],83:[function(w,P,_){var T=w("./_iterators"),C=w("./_wks")("iterator"),c=Array.prototype;P.exports=function(p){return p!==void 0&&(T.Array===p||c[C]===p)}},{"./_iterators":91,"./_wks":131}],84:[function(w,P,_){var T=w("./_cof");P.exports=Array.isArray||function(C){return T(C)=="Array"}},{"./_cof":64}],85:[function(w,P,_){P.exports=function(T){return typeof T=="object"?T!==null:typeof T=="function"}},{}],86:[function(w,P,_){var T=w("./_an-object");P.exports=function(C,c,p,u){try{return u?c(T(p)[0],p[1]):c(p)}catch(a){var o=C.return;throw o!==void 0&&T(o.call(C)),a}}},{"./_an-object":61}],87:[function(w,P,_){"use strict";var T=w("./_object-create"),C=w("./_property-desc"),c=w("./_set-to-string-tag"),p={};w("./_hide")(p,w("./_wks")("iterator"),function(){return this}),P.exports=function(u,o,a){u.prototype=T(p,{next:C(1,a)}),c(u,o+" Iterator")}},{"./_hide":78,"./_object-create":97,"./_property-desc":111,"./_set-to-string-tag":115,"./_wks":131}],88:[function(w,P,_){"use strict";var T=w("./_library"),C=w("./_export"),c=w("./_redefine"),p=w("./_hide"),u=w("./_iterators"),o=w("./_iter-create"),a=w("./_set-to-string-tag"),d=w("./_object-gpo"),s=w("./_wks")("iterator"),f=!([].keys&&"next"in[].keys()),i=function(){return this};P.exports=function(n,t,h,v,g,b,E){o(h,t,v);var m,y,x,l=function(W){if(!f&&W in D)return D[W];switch(W){case"keys":case"values":return function(){return new h(this,W)}}return function(){return new h(this,W)}},S=t+" Iterator",O=g=="values",A=!1,D=n.prototype,I=D[s]||D["@@iterator"]||g&&D[g],B=I||l(g),H=g?O?l("entries"):B:void 0,te=t=="Array"&&D.entries||I;if(te&&(x=d(te.call(new n)))!==Object.prototype&&x.next&&(a(x,S,!0),T||typeof x[s]=="function"||p(x,s,i)),O&&I&&I.name!=="values"&&(A=!0,B=function(){return I.call(this)}),T&&!E||!f&&!A&&D[s]||p(D,s,B),u[t]=B,u[S]=i,g)if(m={values:O?B:l("values"),keys:b?B:l("keys"),entries:H},E)for(y in m)y in D||c(D,y,m[y]);else C(C.P+C.F*(f||A),t,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(w,P,_){var T=w("./_wks")("iterator"),C=!1;try{var c=[7][T]();c.return=function(){C=!0},Array.from(c,function(){throw 2})}catch(p){}P.exports=function(p,u){if(!u&&!C)return!1;var o=!1;try{var a=[7],d=a[T]();d.next=function(){return{done:o=!0}},a[T]=function(){return d},p(a)}catch(s){}return o}},{"./_wks":131}],90:[function(w,P,_){P.exports=function(T,C){return{value:C,done:!!T}}},{}],91:[function(w,P,_){P.exports={}},{}],92:[function(w,P,_){P.exports=!0},{}],93:[function(w,P,_){var T=w("./_uid")("meta"),C=w("./_is-object"),c=w("./_has"),p=w("./_object-dp").f,u=0,o=Object.isExtensible||function(){return!0},a=!w("./_fails")(function(){return o(Object.preventExtensions({}))}),d=function(t){p(t,T,{value:{i:"O"+ ++u,w:{}}})},s=function(t,h){if(!C(t))return typeof t=="symbol"?t:(typeof t=="string"?"S":"P")+t;if(!c(t,T)){if(!o(t))return"F";if(!h)return"E";d(t)}return t[T].i},f=function(t,h){if(!c(t,T)){if(!o(t))return!0;if(!h)return!1;d(t)}return t[T].w},i=function(t){return a&&n.NEED&&o(t)&&!c(t,T)&&d(t),t},n=P.exports={KEY:T,NEED:!1,fastKey:s,getWeak:f,onFreeze:i}},{"./_fails":74,"./_has":77,"./_is-object":85,"./_object-dp":98,"./_uid":127}],94:[function(w,P,_){var T=w("./_global"),C=w("./_task").set,c=T.MutationObserver||T.WebKitMutationObserver,p=T.process,u=T.Promise,o=w("./_cof")(p)=="process";P.exports=function(){var a,d,s,f=function(){var h,v;for(o&&(h=p.domain)&&h.exit();a;){v=a.fn,a=a.next;try{v()}catch(g){throw a?s():d=void 0,g}}d=void 0,h&&h.enter()};if(o)s=function(){p.nextTick(f)};else if(!c||T.navigator&&T.navigator.standalone)if(u&&u.resolve){var i=u.resolve(void 0);s=function(){i.then(f)}}else s=function(){C.call(T,f)};else{var n=!0,t=document.createTextNode("");new c(f).observe(t,{characterData:!0}),s=function(){t.data=n=!n}}return function(h){var v={fn:h,next:void 0};d&&(d.next=v),a||(a=v,s()),d=v}}},{"./_cof":64,"./_global":76,"./_task":120}],95:[function(w,P,_){"use strict";function T(c){var p,u;this.promise=new c(function(o,a){if(p!==void 0||u!==void 0)throw TypeError("Bad Promise constructor");p=o,u=a}),this.resolve=C(p),this.reject=C(u)}var C=w("./_a-function");P.exports.f=function(c){return new T(c)}},{"./_a-function":58}],96:[function(w,P,_){"use strict";var T=w("./_object-keys"),C=w("./_object-gops"),c=w("./_object-pie"),p=w("./_to-object"),u=w("./_iobject"),o=Object.assign;P.exports=!o||w("./_fails")(function(){var a={},d={},s=Symbol(),f="abcdefghijklmnopqrst";return a[s]=7,f.split("").forEach(function(i){d[i]=i}),o({},a)[s]!=7||Object.keys(o({},d)).join("")!=f})?function(a,d){for(var s=p(a),f=arguments.length,i=1,n=C.f,t=c.f;f>i;)for(var h,v=u(arguments[i++]),g=n?T(v).concat(n(v)):T(v),b=g.length,E=0;b>E;)t.call(v,h=g[E++])&&(s[h]=v[h]);return s}:o},{"./_fails":74,"./_iobject":82,"./_object-gops":103,"./_object-keys":106,"./_object-pie":107,"./_to-object":125}],97:[function(w,P,_){var T=w("./_an-object"),C=w("./_object-dps"),c=w("./_enum-bug-keys"),p=w("./_shared-key")("IE_PROTO"),u=function(){},o=function(){var a,d=w("./_dom-create")("iframe"),s=c.length;for(d.style.display="none",w("./_html").appendChild(d),d.src="javascript:",a=d.contentWindow.document,a.open(),a.write(""),a.close(),o=a.F;s--;)delete o.prototype[c[s]];return o()};P.exports=Object.create||function(a,d){var s;return a!==null?(u.prototype=T(a),s=new u,u.prototype=null,s[p]=a):s=o(),d===void 0?s:C(s,d)}},{"./_an-object":61,"./_dom-create":70,"./_enum-bug-keys":71,"./_html":79,"./_object-dps":99,"./_shared-key":116}],98:[function(w,P,_){var T=w("./_an-object"),C=w("./_ie8-dom-define"),c=w("./_to-primitive"),p=Object.defineProperty;_.f=w("./_descriptors")?Object.defineProperty:function(u,o,a){if(T(u),o=c(o,!0),T(a),C)try{return p(u,o,a)}catch(d){}if("get"in a||"set"in a)throw TypeError("Accessors not supported!");return"value"in a&&(u[o]=a.value),u}},{"./_an-object":61,"./_descriptors":69,"./_ie8-dom-define":80,"./_to-primitive":126}],99:[function(w,P,_){var T=w("./_object-dp"),C=w("./_an-object"),c=w("./_object-keys");P.exports=w("./_descriptors")?Object.defineProperties:function(p,u){C(p);for(var o,a=c(u),d=a.length,s=0;d>s;)T.f(p,o=a[s++],u[o]);return p}},{"./_an-object":61,"./_descriptors":69,"./_object-dp":98,"./_object-keys":106}],100:[function(w,P,_){var T=w("./_object-pie"),C=w("./_property-desc"),c=w("./_to-iobject"),p=w("./_to-primitive"),u=w("./_has"),o=w("./_ie8-dom-define"),a=Object.getOwnPropertyDescriptor;_.f=w("./_descriptors")?a:function(d,s){if(d=c(d),s=p(s,!0),o)try{return a(d,s)}catch(f){}if(u(d,s))return C(!T.f.call(d,s),d[s])}},{"./_descriptors":69,"./_has":77,"./_ie8-dom-define":80,"./_object-pie":107,"./_property-desc":111,"./_to-iobject":123,"./_to-primitive":126}],101:[function(w,P,_){var T=w("./_to-iobject"),C=w("./_object-gopn").f,c={}.toString,p=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],u=function(o){try{return C(o)}catch(a){return p.slice()}};P.exports.f=function(o){return p&&c.call(o)=="[object Window]"?u(o):C(T(o))}},{"./_object-gopn":102,"./_to-iobject":123}],102:[function(w,P,_){var T=w("./_object-keys-internal"),C=w("./_enum-bug-keys").concat("length","prototype");_.f=Object.getOwnPropertyNames||function(c){return T(c,C)}},{"./_enum-bug-keys":71,"./_object-keys-internal":105}],103:[function(w,P,_){_.f=Object.getOwnPropertySymbols},{}],104:[function(w,P,_){var T=w("./_has"),C=w("./_to-object"),c=w("./_shared-key")("IE_PROTO"),p=Object.prototype;P.exports=Object.getPrototypeOf||function(u){return u=C(u),T(u,c)?u[c]:typeof u.constructor=="function"&&u instanceof u.constructor?u.constructor.prototype:u instanceof Object?p:null}},{"./_has":77,"./_shared-key":116,"./_to-object":125}],105:[function(w,P,_){var T=w("./_has"),C=w("./_to-iobject"),c=w("./_array-includes")(!1),p=w("./_shared-key")("IE_PROTO");P.exports=function(u,o){var a,d=C(u),s=0,f=[];for(a in d)a!=p&&T(d,a)&&f.push(a);for(;o.length>s;)T(d,a=o[s++])&&(~c(f,a)||f.push(a));return f}},{"./_array-includes":62,"./_has":77,"./_shared-key":116,"./_to-iobject":123}],106:[function(w,P,_){var T=w("./_object-keys-internal"),C=w("./_enum-bug-keys");P.exports=Object.keys||function(c){return T(c,C)}},{"./_enum-bug-keys":71,"./_object-keys-internal":105}],107:[function(w,P,_){_.f={}.propertyIsEnumerable},{}],108:[function(w,P,_){var T=w("./_export"),C=w("./_core"),c=w("./_fails");P.exports=function(p,u){var o=(C.Object||{})[p]||Object[p],a={};a[p]=u(o),T(T.S+T.F*c(function(){o(1)}),"Object",a)}},{"./_core":65,"./_export":73,"./_fails":74}],109:[function(w,P,_){P.exports=function(T){try{return{e:!1,v:T()}}catch(C){return{e:!0,v:C}}}},{}],110:[function(w,P,_){var T=w("./_an-object"),C=w("./_is-object"),c=w("./_new-promise-capability");P.exports=function(p,u){if(T(p),C(u)&&u.constructor===p)return u;var o=c.f(p);return(0,o.resolve)(u),o.promise}},{"./_an-object":61,"./_is-object":85,"./_new-promise-capability":95}],111:[function(w,P,_){P.exports=function(T,C){return{enumerable:!(1&T),configurable:!(2&T),writable:!(4&T),value:C}}},{}],112:[function(w,P,_){var T=w("./_hide");P.exports=function(C,c,p){for(var u in c)p&&C[u]?C[u]=c[u]:T(C,u,c[u]);return C}},{"./_hide":78}],113:[function(w,P,_){P.exports=w("./_hide")},{"./_hide":78}],114:[function(w,P,_){"use strict";var T=w("./_global"),C=w("./_core"),c=w("./_object-dp"),p=w("./_descriptors"),u=w("./_wks")("species");P.exports=function(o){var a=typeof C[o]=="function"?C[o]:T[o];p&&a&&!a[u]&&c.f(a,u,{configurable:!0,get:function(){return this}})}},{"./_core":65,"./_descriptors":69,"./_global":76,"./_object-dp":98,"./_wks":131}],115:[function(w,P,_){var T=w("./_object-dp").f,C=w("./_has"),c=w("./_wks")("toStringTag");P.exports=function(p,u,o){p&&!C(p=o?p:p.prototype,c)&&T(p,c,{configurable:!0,value:u})}},{"./_has":77,"./_object-dp":98,"./_wks":131}],116:[function(w,P,_){var T=w("./_shared")("keys"),C=w("./_uid");P.exports=function(c){return T[c]||(T[c]=C(c))}},{"./_shared":117,"./_uid":127}],117:[function(w,P,_){var T=w("./_core"),C=w("./_global"),c=C["__core-js_shared__"]||(C["__core-js_shared__"]={});(P.exports=function(p,u){return c[p]||(c[p]=u!==void 0?u:{})})("versions",[]).push({version:T.version,mode:w("./_library")?"pure":"global",copyright:"\u6F0F 2018 Denis Pushkarev (zloirock.ru)"})},{"./_core":65,"./_global":76,"./_library":92}],118:[function(w,P,_){var T=w("./_an-object"),C=w("./_a-function"),c=w("./_wks")("species");P.exports=function(p,u){var o,a=T(p).constructor;return a===void 0||(o=T(a)[c])==null?u:C(o)}},{"./_a-function":58,"./_an-object":61,"./_wks":131}],119:[function(w,P,_){var T=w("./_to-integer"),C=w("./_defined");P.exports=function(c){return function(p,u){var o,a,d=String(C(p)),s=T(u),f=d.length;return s<0||s>=f?c?"":void 0:(o=d.charCodeAt(s),o<55296||o>56319||s+1===f||(a=d.charCodeAt(s+1))<56320||a>57343?c?d.charAt(s):o:c?d.slice(s,s+2):a-56320+(o-55296<<10)+65536)}}},{"./_defined":68,"./_to-integer":122}],120:[function(w,P,_){var T,C,c,p=w("./_ctx"),u=w("./_invoke"),o=w("./_html"),a=w("./_dom-create"),d=w("./_global"),s=d.process,f=d.setImmediate,i=d.clearImmediate,n=d.MessageChannel,t=d.Dispatch,h=0,v={},g=function(){var E=+this;if(v.hasOwnProperty(E)){var m=v[E];delete v[E],m()}},b=function(E){g.call(E.data)};f&&i||(f=function(E){for(var m=[],y=1;arguments.length>y;)m.push(arguments[y++]);return v[++h]=function(){u(typeof E=="function"?E:Function(E),m)},T(h),h},i=function(E){delete v[E]},w("./_cof")(s)=="process"?T=function(E){s.nextTick(p(g,E,1))}:t&&t.now?T=function(E){t.now(p(g,E,1))}:n?(C=new n,c=C.port2,C.port1.onmessage=b,T=p(c.postMessage,c,1)):d.addEventListener&&typeof postMessage=="function"&&!d.importScripts?(T=function(E){d.postMessage(E+"","*")},d.addEventListener("message",b,!1)):T="onreadystatechange"in a("script")?function(E){o.appendChild(a("script")).onreadystatechange=function(){o.removeChild(this),g.call(E)}}:function(E){setTimeout(p(g,E,1),0)}),P.exports={set:f,clear:i}},{"./_cof":64,"./_ctx":67,"./_dom-create":70,"./_global":76,"./_html":79,"./_invoke":81}],121:[function(w,P,_){var T=w("./_to-integer"),C=Math.max,c=Math.min;P.exports=function(p,u){return p=T(p),p<0?C(p+u,0):c(p,u)}},{"./_to-integer":122}],122:[function(w,P,_){var T=Math.ceil,C=Math.floor;P.exports=function(c){return isNaN(c=+c)?0:(c>0?C:T)(c)}},{}],123:[function(w,P,_){var T=w("./_iobject"),C=w("./_defined");P.exports=function(c){return T(C(c))}},{"./_defined":68,"./_iobject":82}],124:[function(w,P,_){var T=w("./_to-integer"),C=Math.min;P.exports=function(c){return c>0?C(T(c),9007199254740991):0}},{"./_to-integer":122}],125:[function(w,P,_){var T=w("./_defined");P.exports=function(C){return Object(T(C))}},{"./_defined":68}],126:[function(w,P,_){var T=w("./_is-object");P.exports=function(C,c){if(!T(C))return C;var p,u;if(c&&typeof(p=C.toString)=="function"&&!T(u=p.call(C)))return u;if(typeof(p=C.valueOf)=="function"&&!T(u=p.call(C)))return u;if(!c&&typeof(p=C.toString)=="function"&&!T(u=p.call(C)))return u;throw TypeError("Can't convert object to primitive value")}},{"./_is-object":85}],127:[function(w,P,_){var T=0,C=Math.random();P.exports=function(c){return"Symbol(".concat(c===void 0?"":c,")_",(++T+C).toString(36))}},{}],128:[function(w,P,_){var T=w("./_global"),C=T.navigator;P.exports=C&&C.userAgent||""},{"./_global":76}],129:[function(w,P,_){var T=w("./_global"),C=w("./_core"),c=w("./_library"),p=w("./_wks-ext"),u=w("./_object-dp").f;P.exports=function(o){var a=C.Symbol||(C.Symbol=c?{}:T.Symbol||{});o.charAt(0)=="_"||o in a||u(a,o,{value:p.f(o)})}},{"./_core":65,"./_global":76,"./_library":92,"./_object-dp":98,"./_wks-ext":130}],130:[function(w,P,_){_.f=w("./_wks")},{"./_wks":131}],131:[function(w,P,_){var T=w("./_shared")("wks"),C=w("./_uid"),c=w("./_global").Symbol,p=typeof c=="function";(P.exports=function(u){return T[u]||(T[u]=p&&c[u]||(p?c:C)("Symbol."+u))}).store=T},{"./_global":76,"./_shared":117,"./_uid":127}],132:[function(w,P,_){var T=w("./_classof"),C=w("./_wks")("iterator"),c=w("./_iterators");P.exports=w("./_core").getIteratorMethod=function(p){if(p!=null)return p[C]||p["@@iterator"]||c[T(p)]}},{"./_classof":63,"./_core":65,"./_iterators":91,"./_wks":131}],133:[function(w,P,_){"use strict";var T=w("./_ctx"),C=w("./_export"),c=w("./_to-object"),p=w("./_iter-call"),u=w("./_is-array-iter"),o=w("./_to-length"),a=w("./_create-property"),d=w("./core.get-iterator-method");C(C.S+C.F*!w("./_iter-detect")(function(s){Array.from(s)}),"Array",{from:function(s){var f,i,n,t,h=c(s),v=typeof this=="function"?this:Array,g=arguments.length,b=g>1?arguments[1]:void 0,E=b!==void 0,m=0,y=d(h);if(E&&(b=T(b,g>2?arguments[2]:void 0,2)),y==null||v==Array&&u(y))for(f=o(h.length),i=new v(f);f>m;m++)a(i,m,E?b(h[m],m):h[m]);else for(t=y.call(h),i=new v;!(n=t.next()).done;m++)a(i,m,E?p(t,b,[n.value,m],!0):n.value);return i.length=m,i}})},{"./_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(w,P,_){"use strict";var T=w("./_add-to-unscopables"),C=w("./_iter-step"),c=w("./_iterators"),p=w("./_to-iobject");P.exports=w("./_iter-define")(Array,"Array",function(u,o){this._t=p(u),this._i=0,this._k=o},function(){var u=this._t,o=this._k,a=this._i++;return!u||a>=u.length?(this._t=void 0,C(1)):o=="keys"?C(0,a):o=="values"?C(0,u[a]):C(0,[a,u[a]])},"values"),c.Arguments=c.Array,T("keys"),T("values"),T("entries")},{"./_add-to-unscopables":59,"./_iter-define":88,"./_iter-step":90,"./_iterators":91,"./_to-iobject":123}],135:[function(w,P,_){"use strict";var T=w("./_is-object"),C=w("./_object-gpo"),c=w("./_wks")("hasInstance"),p=Function.prototype;c in p||w("./_object-dp").f(p,c,{value:function(u){if(typeof this!="function"||!T(u))return!1;if(!T(this.prototype))return u instanceof this;for(;u=C(u);)if(this.prototype===u)return!0;return!1}})},{"./_is-object":85,"./_object-dp":98,"./_object-gpo":104,"./_wks":131}],136:[function(w,P,_){var T=w("./_export");T(T.S+T.F,"Object",{assign:w("./_object-assign")})},{"./_export":73,"./_object-assign":96}],137:[function(w,P,_){var T=w("./_export");T(T.S,"Object",{create:w("./_object-create")})},{"./_export":73,"./_object-create":97}],138:[function(w,P,_){var T=w("./_export");T(T.S+T.F*!w("./_descriptors"),"Object",{defineProperty:w("./_object-dp").f})},{"./_descriptors":69,"./_export":73,"./_object-dp":98}],139:[function(w,P,_){w("./_object-sap")("getOwnPropertyNames",function(){return w("./_object-gopn-ext").f})},{"./_object-gopn-ext":101,"./_object-sap":108}],140:[function(w,P,_){var T=w("./_to-object"),C=w("./_object-gpo");w("./_object-sap")("getPrototypeOf",function(){return function(c){return C(T(c))}})},{"./_object-gpo":104,"./_object-sap":108,"./_to-object":125}],141:[function(w,P,_){var T=w("./_to-object"),C=w("./_object-keys");w("./_object-sap")("keys",function(){return function(c){return C(T(c))}})},{"./_object-keys":106,"./_object-sap":108,"./_to-object":125}],142:[function(w,P,_){arguments[4][36][0].apply(_,arguments)},{dup:36}],143:[function(w,P,_){"use strict";var T,C,c,p,u=w("./_library"),o=w("./_global"),a=w("./_ctx"),d=w("./_classof"),s=w("./_export"),f=w("./_is-object"),i=w("./_a-function"),n=w("./_an-instance"),t=w("./_for-of"),h=w("./_species-constructor"),v=w("./_task").set,g=w("./_microtask")(),b=w("./_new-promise-capability"),E=w("./_perform"),m=w("./_user-agent"),y=w("./_promise-resolve"),x=o.TypeError,l=o.process,S=l&&l.versions,O=S&&S.v8||"",A=o.Promise,D=d(l)=="process",I=function(){},B=C=b.f,H=!!function(){try{var ce=A.resolve(1),de=(ce.constructor={})[w("./_wks")("species")]=function(Ce){Ce(I,I)};return(D||typeof PromiseRejectionEvent=="function")&&ce.then(I)instanceof de&&O.indexOf("6.6")!==0&&m.indexOf("Chrome/66")===-1}catch(Ce){}}(),te=function(ce){var de;return!(!f(ce)||typeof(de=ce.then)!="function")&&de},W=function(ce,de){if(!ce._n){ce._n=!0;var Ce=ce._c;g(function(){for(var Se=ce._v,De=ce._s==1,be=0;Ce.length>be;)!function(_e){var Ke,Ne,Be,ze=De?_e.ok:_e.fail,ye=_e.resolve,pe=_e.reject,We=_e.domain;try{ze?(De||(ce._h==2&&ne(ce),ce._h=1),ze===!0?Ke=Se:(We&&We.enter(),Ke=ze(Se),We&&(We.exit(),Be=!0)),Ke===_e.promise?pe(x("Promise-chain cycle")):(Ne=te(Ke))?Ne.call(Ke,ye,pe):ye(Ke)):pe(Se)}catch(He){We&&!Be&&We.exit(),pe(He)}}(Ce[be++]);ce._c=[],ce._n=!1,de&&!ce._h&&V(ce)})}},V=function(ce){v.call(o,function(){var de,Ce,Se,De=ce._v,be=X(ce);if(be&&(de=E(function(){D?l.emit("unhandledRejection",De,ce):(Ce=o.onunhandledrejection)?Ce({promise:ce,reason:De}):(Se=o.console)&&Se.error&&Se.error("Unhandled promise rejection",De)}),ce._h=D||X(ce)?2:1),ce._a=void 0,be&&de.e)throw de.v})},X=function(ce){return ce._h!==1&&(ce._a||ce._c).length===0},ne=function(ce){v.call(o,function(){var de;D?l.emit("rejectionHandled",ce):(de=o.onrejectionhandled)&&de({promise:ce,reason:ce._v})})},$=function(ce){var de=this;de._d||(de._d=!0,de=de._w||de,de._v=ce,de._s=2,de._a||(de._a=de._c.slice()),W(de,!0))},ee=function(ce){var de,Ce=this;if(!Ce._d){Ce._d=!0,Ce=Ce._w||Ce;try{if(Ce===ce)throw x("Promise can't be resolved itself");(de=te(ce))?g(function(){var Se={_w:Ce,_d:!1};try{de.call(ce,a(ee,Se,1),a($,Se,1))}catch(De){$.call(Se,De)}}):(Ce._v=ce,Ce._s=1,W(Ce,!1))}catch(Se){$.call({_w:Ce,_d:!1},Se)}}};H||(A=function(ce){n(this,A,"Promise","_h"),i(ce),T.call(this);try{ce(a(ee,this,1),a($,this,1))}catch(de){$.call(this,de)}},T=function(ce){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},T.prototype=w("./_redefine-all")(A.prototype,{then:function(ce,de){var Ce=B(h(this,A));return Ce.ok=typeof ce!="function"||ce,Ce.fail=typeof de=="function"&&de,Ce.domain=D?l.domain:void 0,this._c.push(Ce),this._a&&this._a.push(Ce),this._s&&W(this,!1),Ce.promise},catch:function(ce){return this.then(void 0,ce)}}),c=function(){var ce=new T;this.promise=ce,this.resolve=a(ee,ce,1),this.reject=a($,ce,1)},b.f=B=function(ce){return ce===A||ce===p?new c(ce):C(ce)}),s(s.G+s.W+s.F*!H,{Promise:A}),w("./_set-to-string-tag")(A,"Promise"),w("./_set-species")("Promise"),p=w("./_core").Promise,s(s.S+s.F*!H,"Promise",{reject:function(ce){var de=B(this);return(0,de.reject)(ce),de.promise}}),s(s.S+s.F*(u||!H),"Promise",{resolve:function(ce){return y(u&&this===p?A:this,ce)}}),s(s.S+s.F*!(H&&w("./_iter-detect")(function(ce){A.all(ce).catch(I)})),"Promise",{all:function(ce){var de=this,Ce=B(de),Se=Ce.resolve,De=Ce.reject,be=E(function(){var _e=[],Ke=0,Ne=1;t(ce,!1,function(Be){var ze=Ke++,ye=!1;_e.push(void 0),Ne++,de.resolve(Be).then(function(pe){ye||(ye=!0,_e[ze]=pe,--Ne||Se(_e))},De)}),--Ne||Se(_e)});return be.e&&De(be.v),Ce.promise},race:function(ce){var de=this,Ce=B(de),Se=Ce.reject,De=E(function(){t(ce,!1,function(be){de.resolve(be).then(Ce.resolve,Se)})});return De.e&&Se(De.v),Ce.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(w,P,_){var T=w("./_export"),C=w("./_to-absolute-index"),c=String.fromCharCode,p=String.fromCodePoint;T(T.S+T.F*(!!p&&p.length!=1),"String",{fromCodePoint:function(u){for(var o,a=[],d=arguments.length,s=0;d>s;){if(o=+arguments[s++],C(o,1114111)!==o)throw RangeError(o+" is not a valid code point");a.push(o<65536?c(o):c(55296+((o-=65536)>>10),o%1024+56320))}return a.join("")}})},{"./_export":73,"./_to-absolute-index":121}],145:[function(w,P,_){"use strict";var T=w("./_string-at")(!0);w("./_iter-define")(String,"String",function(C){this._t=String(C),this._i=0},function(){var C,c=this._t,p=this._i;return p>=c.length?{value:void 0,done:!0}:(C=T(c,p),this._i+=C.length,{value:C,done:!1})})},{"./_iter-define":88,"./_string-at":119}],146:[function(w,P,_){"use strict";var T=w("./_global"),C=w("./_has"),c=w("./_descriptors"),p=w("./_export"),u=w("./_redefine"),o=w("./_meta").KEY,a=w("./_fails"),d=w("./_shared"),s=w("./_set-to-string-tag"),f=w("./_uid"),i=w("./_wks"),n=w("./_wks-ext"),t=w("./_wks-define"),h=w("./_enum-keys"),v=w("./_is-array"),g=w("./_an-object"),b=w("./_is-object"),E=w("./_to-iobject"),m=w("./_to-primitive"),y=w("./_property-desc"),x=w("./_object-create"),l=w("./_object-gopn-ext"),S=w("./_object-gopd"),O=w("./_object-dp"),A=w("./_object-keys"),D=S.f,I=O.f,B=l.f,H=T.Symbol,te=T.JSON,W=te&&te.stringify,V=i("_hidden"),X=i("toPrimitive"),ne={}.propertyIsEnumerable,$=d("symbol-registry"),ee=d("symbols"),ce=d("op-symbols"),de=Object.prototype,Ce=typeof H=="function",Se=T.QObject,De=!Se||!Se.prototype||!Se.prototype.findChild,be=c&&a(function(){return x(I({},"a",{get:function(){return I(this,"a",{value:7}).a}})).a!=7})?function(q,Y,J){var xe=D(de,Y);xe&&delete de[Y],I(q,Y,J),xe&&q!==de&&I(de,Y,xe)}:I,_e=function(q){var Y=ee[q]=x(H.prototype);return Y._k=q,Y},Ke=Ce&&typeof H.iterator=="symbol"?function(q){return typeof q=="symbol"}:function(q){return q instanceof H},Ne=function(q,Y,J){return q===de&&Ne(ce,Y,J),g(q),Y=m(Y,!0),g(J),C(ee,Y)?(J.enumerable?(C(q,V)&&q[V][Y]&&(q[V][Y]=!1),J=x(J,{enumerable:y(0,!1)})):(C(q,V)||I(q,V,y(1,{})),q[V][Y]=!0),be(q,Y,J)):I(q,Y,J)},Be=function(q,Y){g(q);for(var J,xe=h(Y=E(Y)),ke=0,dt=xe.length;dt>ke;)Ne(q,J=xe[ke++],Y[J]);return q},ze=function(q,Y){return Y===void 0?x(q):Be(x(q),Y)},ye=function(q){var Y=ne.call(this,q=m(q,!0));return!(this===de&&C(ee,q)&&!C(ce,q))&&(!(Y||!C(this,q)||!C(ee,q)||C(this,V)&&this[V][q])||Y)},pe=function(q,Y){if(q=E(q),Y=m(Y,!0),q!==de||!C(ee,Y)||C(ce,Y)){var J=D(q,Y);return!J||!C(ee,Y)||C(q,V)&&q[V][Y]||(J.enumerable=!0),J}},We=function(q){for(var Y,J=B(E(q)),xe=[],ke=0;J.length>ke;)C(ee,Y=J[ke++])||Y==V||Y==o||xe.push(Y);return xe},He=function(q){for(var Y,J=q===de,xe=B(J?ce:E(q)),ke=[],dt=0;xe.length>dt;)!C(ee,Y=xe[dt++])||J&&!C(de,Y)||ke.push(ee[Y]);return ke};Ce||(H=function(){if(this instanceof H)throw TypeError("Symbol is not a constructor!");var q=f(arguments.length>0?arguments[0]:void 0),Y=function(J){this===de&&Y.call(ce,J),C(this,V)&&C(this[V],q)&&(this[V][q]=!1),be(this,q,y(1,J))};return c&&De&&be(de,q,{configurable:!0,set:Y}),_e(q)},u(H.prototype,"toString",function(){return this._k}),S.f=pe,O.f=Ne,w("./_object-gopn").f=l.f=We,w("./_object-pie").f=ye,w("./_object-gops").f=He,c&&!w("./_library")&&u(de,"propertyIsEnumerable",ye,!0),n.f=function(q){return _e(i(q))}),p(p.G+p.W+p.F*!Ce,{Symbol:H});for(var nt="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),re=0;nt.length>re;)i(nt[re++]);for(var k=A(i.store),U=0;k.length>U;)t(k[U++]);p(p.S+p.F*!Ce,"Symbol",{for:function(q){return C($,q+="")?$[q]:$[q]=H(q)},keyFor:function(q){if(!Ke(q))throw TypeError(q+" is not a symbol!");for(var Y in $)if($[Y]===q)return Y},useSetter:function(){De=!0},useSimple:function(){De=!1}}),p(p.S+p.F*!Ce,"Object",{create:ze,defineProperty:Ne,defineProperties:Be,getOwnPropertyDescriptor:pe,getOwnPropertyNames:We,getOwnPropertySymbols:He}),te&&p(p.S+p.F*(!Ce||a(function(){var q=H();return W([q])!="[null]"||W({a:q})!="{}"||W(Object(q))!="{}"})),"JSON",{stringify:function(q){for(var Y,J,xe=[q],ke=1;arguments.length>ke;)xe.push(arguments[ke++]);if(J=Y=xe[1],(b(Y)||q!==void 0)&&!Ke(q))return v(Y)||(Y=function(dt,Ue){if(typeof J=="function"&&(Ue=J.call(this,dt,Ue)),!Ke(Ue))return Ue}),xe[1]=Y,W.apply(te,xe)}}),H.prototype[X]||w("./_hide")(H.prototype,X,H.prototype.valueOf),s(H,"Symbol"),s(Math,"Math",!0),s(T.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(w,P,_){"use strict";var T=w("./_export"),C=w("./_core"),c=w("./_global"),p=w("./_species-constructor"),u=w("./_promise-resolve");T(T.P+T.R,"Promise",{finally:function(o){var a=p(this,C.Promise||c.Promise),d=typeof o=="function";return this.then(d?function(s){return u(a,o()).then(function(){return s})}:o,d?function(s){return u(a,o()).then(function(){throw s})}:o)}})},{"./_core":65,"./_export":73,"./_global":76,"./_promise-resolve":110,"./_species-constructor":118}],148:[function(w,P,_){"use strict";var T=w("./_export"),C=w("./_new-promise-capability"),c=w("./_perform");T(T.S,"Promise",{try:function(p){var u=C.f(this),o=c(p);return(o.e?u.reject:u.resolve)(o.v),u.promise}})},{"./_export":73,"./_new-promise-capability":95,"./_perform":109}],149:[function(w,P,_){w("./_wks-define")("asyncIterator")},{"./_wks-define":129}],150:[function(w,P,_){w("./_wks-define")("observable")},{"./_wks-define":129}],151:[function(w,P,_){w("./es6.array.iterator");for(var T=w("./_global"),C=w("./_hide"),c=w("./_iterators"),p=w("./_wks")("toStringTag"),u="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;o0?"-":"+")+p(100*Math.floor(Math.abs(D)/60)+Math.abs(D)%60,4),S:["th","st","nd","rd"][E%10>3?0:(E%100-E%10!=10)*E%10],W:I,N:B};return t.replace(s,function(te){return te in H?H[te]:te.slice(1,te.length-1)})}}();d.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"},d.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 j=="function"&&j.amd?j(function(){return d}):(_===void 0?"undefined":(0,C.default)(_))==="object"?P.exports=d:c.dateFormat=d}(void 0)},{"babel-runtime/helpers/typeof":32}],155:[function(w,P,_){(function(T){function C(){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 c(a){var d=this.useColors;if(a[0]=(d?"%c":"")+this.namespace+(d?" %c":" ")+a[0]+(d?"%c ":" ")+"+"+_.humanize(this.diff),d){var s="color: "+this.color;a.splice(1,0,s,"color: inherit");var f=0,i=0;a[0].replace(/%[a-zA-Z%]/g,function(n){n!=="%%"&&(f++,n==="%c"&&(i=f))}),a.splice(i,0,s)}}function p(){return typeof console=="object"&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function u(a){try{a==null?_.storage.removeItem("debug"):_.storage.debug=a}catch(d){}}function o(){var a;try{a=_.storage.debug}catch(d){}return!a&&T!==void 0&&"env"in T&&(a=T.env.DEBUG),a}_=P.exports=w("./debug"),_.log=p,_.formatArgs=c,_.save=u,_.load=o,_.useColors=C,_.storage=typeof chrome!="undefined"&&chrome.storage!==void 0?chrome.storage.local:function(){try{return window.localStorage}catch(a){}}(),_.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],_.formatters.j=function(a){try{return JSON.stringify(a)}catch(d){return"[UnexpectedJSONParseError]: "+d.message}},_.enable(o())}).call(this,w("_process"))},{"./debug":156,_process:173}],156:[function(w,P,_){function T(d){var s,f=0;for(s in d)f=(f<<5)-f+d.charCodeAt(s),f|=0;return _.colors[Math.abs(f)%_.colors.length]}function C(d){function s(){if(s.enabled){var f=s,i=+new Date,n=i-(a||i);f.diff=n,f.prev=a,f.curr=i,a=i;for(var t=new Array(arguments.length),h=0;h]/;P.exports=T},{}],158:[function(w,P,_){function T(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function C(o){return typeof o=="function"}function c(o){return typeof o=="number"}function p(o){return typeof o=="object"&&o!==null}function u(o){return o===void 0}P.exports=T,T.EventEmitter=T,T.prototype._events=void 0,T.prototype._maxListeners=void 0,T.defaultMaxListeners=10,T.prototype.setMaxListeners=function(o){if(!c(o)||o<0||isNaN(o))throw TypeError("n must be a positive number");return this._maxListeners=o,this},T.prototype.emit=function(o){var a,d,s,f,i,n;if(this._events||(this._events={}),o==="error"&&(!this._events.error||p(this._events.error)&&!this._events.error.length)){if((a=arguments[1])instanceof Error)throw a;var t=new Error('Uncaught, unspecified "error" event. ('+a+")");throw t.context=a,t}if(d=this._events[o],u(d))return!1;if(C(d))switch(arguments.length){case 1:d.call(this);break;case 2:d.call(this,arguments[1]);break;case 3:d.call(this,arguments[1],arguments[2]);break;default:f=Array.prototype.slice.call(arguments,1),d.apply(this,f)}else if(p(d))for(f=Array.prototype.slice.call(arguments,1),n=d.slice(),s=n.length,i=0;i0&&this._events[o].length>d&&(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},T.prototype.on=T.prototype.addListener,T.prototype.once=function(o,a){function d(){this.removeListener(o,d),s||(s=!0,a.apply(this,arguments))}if(!C(a))throw TypeError("listener must be a function");var s=!1;return d.listener=a,this.on(o,d),this},T.prototype.removeListener=function(o,a){var d,s,f,i;if(!C(a))throw TypeError("listener must be a function");if(!this._events||!this._events[o])return this;if(d=this._events[o],f=d.length,s=-1,d===a||C(d.listener)&&d.listener===a)delete this._events[o],this._events.removeListener&&this.emit("removeListener",o,a);else if(p(d)){for(i=f;i-- >0;)if(d[i]===a||d[i].listener&&d[i].listener===a){s=i;break}if(s<0)return this;d.length===1?(d.length=0,delete this._events[o]):d.splice(s,1),this._events.removeListener&&this.emit("removeListener",o,a)}return this},T.prototype.removeAllListeners=function(o){var a,d;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(a in this._events)a!=="removeListener"&&this.removeAllListeners(a);return this.removeAllListeners("removeListener"),this._events={},this}if(d=this._events[o],C(d))this.removeListener(o,d);else if(d)for(;d.length;)this.removeListener(o,d[d.length-1]);return delete this._events[o],this},T.prototype.listeners=function(o){return this._events&&this._events[o]?C(this._events[o])?[this._events[o]]:this._events[o].slice():[]},T.prototype.listenerCount=function(o){if(this._events){var a=this._events[o];if(C(a))return 1;if(a)return a.length}return 0},T.listenerCount=function(o,a){return o.listenerCount(a)}},{}],159:[function(w,P,_){var T=w("http"),C=P.exports;for(var c in T)T.hasOwnProperty(c)&&(C[c]=T[c]);C.request=function(p,u){return p||(p={}),p.scheme="https",p.protocol="https:",T.request.call(this,p,u)}},{http:196}],160:[function(w,P,_){"use strict";var T=w("util"),C=w("ms");P.exports=function(c){if(typeof c=="number")return c;var p=C(c);if(p===void 0){var u=new Error(T.format("humanize-ms(%j) result undefined",c));console.warn(u.stack)}return p}},{ms:169,util:207}],161:[function(w,P,_){_.read=function(T,C,c,p,u){var o,a,d=8*u-p-1,s=(1<>1,i=-7,n=c?u-1:0,t=c?-1:1,h=T[C+n];for(n+=t,o=h&(1<<-i)-1,h>>=-i,i+=d;i>0;o=256*o+T[C+n],n+=t,i-=8);for(a=o&(1<<-i)-1,o>>=-i,i+=p;i>0;a=256*a+T[C+n],n+=t,i-=8);if(o===0)o=1-f;else{if(o===s)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,p),o-=f}return(h?-1:1)*a*Math.pow(2,o-p)},_.write=function(T,C,c,p,u,o){var a,d,s,f=8*o-u-1,i=(1<>1,t=u===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=p?0:o-1,v=p?1:-1,g=C<0||C===0&&1/C<0?1:0;for(C=Math.abs(C),isNaN(C)||C===1/0?(d=isNaN(C)?1:0,a=i):(a=Math.floor(Math.log(C)/Math.LN2),C*(s=Math.pow(2,-a))<1&&(a--,s*=2),C+=a+n>=1?t/s:t*Math.pow(2,1-n),C*s>=2&&(a++,s/=2),a+n>=i?(d=0,a=i):a+n>=1?(d=(C*s-1)*Math.pow(2,u),a+=n):(d=C*Math.pow(2,n-1)*Math.pow(2,u),a=0));u>=8;T[c+h]=255&d,h+=v,d/=256,u-=8);for(a=a<0;T[c+h]=255&a,h+=v,a/=256,f-=8);T[c+h-v]|=128*g}},{}],162:[function(w,P,_){typeof Object.create=="function"?P.exports=function(T,C){T.super_=C,T.prototype=Object.create(C.prototype,{constructor:{value:T,enumerable:!1,writable:!0,configurable:!0}})}:P.exports=function(T,C){T.super_=C;var c=function(){};c.prototype=C.prototype,T.prototype=new c,T.prototype.constructor=T}},{}],163:[function(w,P,_){function T(c){return!!c.constructor&&typeof c.constructor.isBuffer=="function"&&c.constructor.isBuffer(c)}function C(c){return typeof c.readFloatLE=="function"&&typeof c.slice=="function"&&T(c.slice(0,0))}P.exports=function(c){return c!=null&&(T(c)||C(c)||!!c._isBuffer)}},{}],164:[function(w,P,_){!function(T){function C(u){return p.call(u).replace(/^[^{]*{\s*/,"").replace(/\s*}[^}]*$/,"")}function c(u){return typeof u=="function"&&(/^class(\s|\{\}$)/.test(p.call(u))||/^.*classCallCheck\(/.test(C(u)))}var p=Function.prototype.toString;_!==void 0?(P!==void 0&&P.exports&&(_=P.exports=c),_.isClass=c):typeof j=="function"&&j.amd?j([],function(){return c}):T.isClass=c}(this)},{}],165:[function(w,P,_){"use strict";function T(o){var a=o.slice(2);return a=a[0].toLowerCase()+a.slice(1)}var C=w("core-util-is"),c=w("isstream"),p=w("is-class");Object.keys(C).map(function(o){_[T(o)]=C[o]}),_.stream=c,_.readableStream=c.isReadable,_.writableStream=c.isWritable,_.duplexStream=c.isDuplex,_.class=p,_.finite=function(o){return Number.isFinite(o)},_.NaN=function(o){return Number.isNaN(o)},_.generator=function(o){return o&&typeof o.next=="function"&&typeof o.throw=="function"},_.generatorFunction=function(o){return o&&o.constructor&&o.constructor.name==="GeneratorFunction"},_.asyncFunction=function(o){return o&&o.constructor&&o.constructor.name==="AsyncFunction"},_.promise=function(o){return o&&typeof o.then=="function"};var u=Math.pow(2,31);_.int=function(o){return C.isNumber(o)&&o%1==0},_.int32=function(o){return _.int(o)&&o=-u},_.long=function(o){return _.int(o)&&(o>=u||o<-u)},_.Long=function(o){return _.object(o)&&_.number(o.high)&&_.number(o.low)},_.double=function(o){return C.isNumber(o)&&!isNaN(o)&&o%1!=0},_.date=function(o){return o instanceof Date},_.regExp=function(o){return o instanceof RegExp},_.regexp=_.regExp,_.error=function(o){return o instanceof Error},_.array=function(o){return Array.isArray(o)}},{"core-util-is":153,"is-class":164,isstream:167}],166:[function(w,P,_){var T={}.toString;P.exports=Array.isArray||function(C){return T.call(C)=="[object Array]"}},{}],167:[function(w,P,_){function T(o){return o instanceof u.Stream}function C(o){return T(o)&&typeof o._read=="function"&&typeof o._readableState=="object"}function c(o){return T(o)&&typeof o._write=="function"&&typeof o._writableState=="object"}function p(o){return C(o)&&c(o)}var u=w("stream");P.exports=T,P.exports.isReadable=C,P.exports.isWritable=c,P.exports.isDuplex=p},{stream:195}],168:[function(w,P,_){"use strict";function T(c,p,u){if(!c)throw new TypeError("argument dest is required");if(!p)throw new TypeError("argument src is required");return u===void 0&&(u=!0),Object.getOwnPropertyNames(p).forEach(function(o){if(u||!C.call(c,o)){var a=Object.getOwnPropertyDescriptor(p,o);Object.defineProperty(c,o,a)}}),c}P.exports=T;var C=Object.prototype.hasOwnProperty},{}],169:[function(w,P,_){function T(f){if(f=String(f),!(f.length>100)){var i=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(f);if(i){var n=parseFloat(i[1]);switch((i[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return n*s;case"days":case"day":case"d":return n*d;case"hours":case"hour":case"hrs":case"hr":case"h":return n*a;case"minutes":case"minute":case"mins":case"min":case"m":return n*o;case"seconds":case"second":case"secs":case"sec":case"s":return n*u;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function C(f){return f>=d?Math.round(f/d)+"d":f>=a?Math.round(f/a)+"h":f>=o?Math.round(f/o)+"m":f>=u?Math.round(f/u)+"s":f+"ms"}function c(f){return p(f,d,"day")||p(f,a,"hour")||p(f,o,"minute")||p(f,u,"second")||f+" ms"}function p(f,i,n){if(!(f0)return T(f);if(n==="number"&&isNaN(f)===!1)return i.long?c(f):C(f);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(f))}},{}],170:[function(w,P,_){(function(T){function C(o,a){for(var d=0,s=o.length-1;s>=0;s--){var f=o[s];f==="."?o.splice(s,1):f===".."?(o.splice(s,1),d++):d&&(o.splice(s,1),d--)}if(a)for(;d--;d)o.unshift("..");return o}function c(o){typeof o!="string"&&(o+="");var a,d=0,s=-1,f=!0;for(a=o.length-1;a>=0;--a)if(o.charCodeAt(a)===47){if(!f){d=a+1;break}}else s===-1&&(f=!1,s=a+1);return s===-1?"":o.slice(d,s)}function p(o,a){if(o.filter)return o.filter(a);for(var d=[],s=0;s=-1&&!a;d--){var s=d>=0?arguments[d]:T.cwd();if(typeof s!="string")throw new TypeError("Arguments to path.resolve must be strings");s&&(o=s+"/"+o,a=s.charAt(0)==="/")}return o=C(p(o.split("/"),function(f){return!!f}),!a).join("/"),(a?"/":"")+o||"."},_.normalize=function(o){var a=_.isAbsolute(o),d=u(o,-1)==="/";return o=C(p(o.split("/"),function(s){return!!s}),!a).join("/"),o||a||(o="."),o&&d&&(o+="/"),(a?"/":"")+o},_.isAbsolute=function(o){return o.charAt(0)==="/"},_.join=function(){var o=Array.prototype.slice.call(arguments,0);return _.normalize(p(o,function(a,d){if(typeof a!="string")throw new TypeError("Arguments to path.join must be strings");return a}).join("/"))},_.relative=function(o,a){function d(v){for(var g=0;g=0&&v[b]==="";b--);return g>b?[]:v.slice(g,b-g+1)}o=_.resolve(o).substr(1),a=_.resolve(a).substr(1);for(var s=d(o.split("/")),f=d(a.split("/")),i=Math.min(s.length,f.length),n=i,t=0;t=1;--i)if((a=o.charCodeAt(i))===47){if(!f){s=i;break}}else f=!1;return s===-1?d?"/":".":d&&s===1?"/":o.slice(0,s)},_.basename=function(o,a){var d=c(o);return a&&d.substr(-1*a.length)===a&&(d=d.substr(0,d.length-a.length)),d},_.extname=function(o){typeof o!="string"&&(o+="");for(var a=-1,d=0,s=-1,f=!0,i=0,n=o.length-1;n>=0;--n){var t=o.charCodeAt(n);if(t!==47)s===-1&&(f=!1,s=n+1),t===46?a===-1?a=n:i!==1&&(i=1):a!==-1&&(i=-1);else if(!f){d=n+1;break}}return a===-1||s===-1||i===0||i===1&&a===s-1&&a===d+1?"":o.slice(a,s)};var u="ab".substr(-1)==="b"?function(o,a,d){return o.substr(a,d)}:function(o,a,d){return a<0&&(a=o.length+a),o.substr(a,d)}}).call(this,w("_process"))},{_process:173}],171:[function(w,P,_){(function(T){(function(){"use strict";function C(O){return O=String(O),O.charAt(0).toUpperCase()+O.slice(1)}function c(O,A,D){var I={"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 A&&D&&/^Win/i.test(O)&&!/^Windows Phone /i.test(O)&&(I=I[/[\d.]+$/.exec(O)])&&(O="Windows "+I),O=String(O),A&&D&&(O=O.replace(RegExp(A,"i"),D)),O=u(O.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 p(O,A){var D=-1,I=O?O.length:0;if(typeof I=="number"&&I>-1&&I<=E)for(;++D3&&"WebKit"||/\bOpera\b/.test(He)&&(/\bOPR\b/.test(O)?"Blink":"Presto")||/\b(?:Midori|Nook|Safari)\b/i.test(O)&&!/^(?:Trident|EdgeHTML)$/.test(We)&&"WebKit"||!We&&/\bMSIE\b/i.test(O)&&(k=="Mac OS"?"Tasman":"Trident")||We=="WebKit"&&/\bPlayStation\b(?! Vita\b)/i.test(He)&&"NetFront")&&(We=[W]),He=="IE"&&(W=(/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(O)||0)[1])?(He+=" Mobile",k="Windows Phone "+(/\+$/.test(W)?W:W+".x"),Be.unshift("desktop mode")):/\bWPDesktop\b/i.test(O)?(He="IE Mobile",k="Windows Phone 8.x",Be.unshift("desktop mode"),pe||(pe=(/\brv:([\d.]+)/.exec(O)||0)[1])):He!="IE"&&We=="Trident"&&(W=/\brv:([\d.]+)/.exec(O))&&(He&&Be.push("identifying as "+He+(pe?" "+pe:"")),He="IE",pe=W[1]),ye){if(d(I,"global"))if(de&&(W=de.lang.System,Ne=W.getProperty("os.arch"),k=k||W.getProperty("os.name")+" "+W.getProperty("os.version")),Ce){try{pe=I.require("ringo/engine").version.join("."),He="RingoJS"}catch(q){(W=I.system)&&W.global.system==I.system&&(He="Narwhal",k||(k=W[0].os||null))}He||(He="Rhino")}else typeof I.process=="object"&&!I.process.browser&&(W=I.process)&&(typeof W.versions=="object"&&(typeof W.versions.electron=="string"?(Be.push("Node "+W.versions.node),He="Electron",pe=W.versions.electron):typeof W.versions.nw=="string"&&(Be.push("Chromium "+pe,"Node "+W.versions.node),He="NW.js",pe=W.versions.nw)),He||(He="Node.js",Ne=W.arch,k=W.platform,pe=/[\d.]+/.exec(W.version),pe=pe?pe[0]:null));else a(W=I.runtime)==ne?(He="Adobe AIR",k=W.flash.system.Capabilities.os):a(W=I.phantom)==ce?(He="PhantomJS",pe=(W=W.version||null)&&W.major+"."+W.minor+"."+W.patch):typeof be.documentMode=="number"&&(W=/\bTrident\/(\d+)/i.exec(O))?(pe=[pe,be.documentMode],(W=+W[1]+4)!=pe[1]&&(Be.push("IE "+pe[1]+" mode"),We&&(We[1]=""),pe[1]=W),pe=He=="IE"?String(pe[1].toFixed(1)):pe[0]):typeof be.documentMode=="number"&&/^(?:Chrome|Firefox)\b/.test(He)&&(Be.push("masking as "+He+" "+pe),He="IE",pe="11.0",We=["Trident"],k="Windows");k=k&&u(k)}if(pe&&(W=/(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(pe)||/(?:alpha|beta)(?: ?\d)?/i.exec(O+";"+(ye&&H.appMinorVersion))||/\bMinefield\b/i.test(O)&&"a")&&(ze=/b/i.test(W)?"beta":"alpha",pe=pe.replace(RegExp(W+"\\+?$"),"")+(ze=="beta"?De:Se)+(/\d+\+?/.exec(W)||"")),He=="Fennec"||He=="Firefox"&&/\b(?:Android|Firefox OS)\b/.test(k))He="Firefox Mobile";else if(He=="Maxthon"&&pe)pe=pe.replace(/\.[\d.]+/,".x");else if(/\bXbox\b/i.test(nt))nt=="Xbox 360"&&(k=null),nt=="Xbox 360"&&/\bIEMobile\b/.test(O)&&Be.unshift("mobile mode");else if(!/^(?:Chrome|IE|Opera)$/.test(He)&&(!He||nt||/Browser|Mobi/.test(He))||k!="Windows CE"&&!/Mobi/i.test(O))if(He=="IE"&&ye)try{I.external===null&&Be.unshift("platform preview")}catch(q){Be.unshift("embedded")}else(/\bBlackBerry\b/.test(nt)||/\bBB10\b/.test(O))&&(W=(RegExp(nt.replace(/ +/g," *")+"/([.\\d]+)","i").exec(O)||0)[1]||pe)?(W=[W,/BB10/.test(O)],k=(W[1]?(nt=null,re="BlackBerry"):"Device Software")+" "+W[0],pe=null):this!=o&&nt!="Wii"&&(ye&&_e||/Opera/.test(He)&&/\b(?:MSIE|Firefox)\b/i.test(O)||He=="Firefox"&&/\bOS X (?:\d+\.){2,}/.test(k)||He=="IE"&&(k&&!/^Win/.test(k)&&pe>5.5||/\bWindows XP\b/.test(k)&&pe>8||pe==8&&!/\bTrident\b/.test(O)))&&!m.test(W=n.call(o,O.replace(m,"")+";"))&&W.name&&(W="ing as "+W.name+((W=W.version)?" "+W:""),m.test(He)?(/\bIE\b/.test(W)&&k=="Mac OS"&&(k=null),W="identify"+W):(W="mask"+W,He=Ke?u(Ke.replace(/([a-z])([A-Z])/g,"$1 $2")):"Opera",/\bIE\b/.test(W)&&(k=null),ye||(pe=null)),We=["Presto"],Be.push(W));else He+=" Mobile";(W=(/\bAppleWebKit\/([\d.]+\+?)/i.exec(O)||0)[1])&&(W=[parseFloat(W.replace(/\.(\d)$/,".0$1")),W],He=="Safari"&&W[1].slice(-1)=="+"?(He="WebKit Nightly",ze="alpha",pe=W[1].slice(0,-1)):pe!=W[1]&&pe!=(W[2]=(/\bSafari\/([\d.]+\+?)/i.exec(O)||0)[1])||(pe=null),W[1]=(/\bChrome\/([\d.]+)/i.exec(O)||0)[1],W[0]==537.36&&W[2]==537.36&&parseFloat(W[1])>=28&&We=="WebKit"&&(We=["Blink"]),ye&&(X||W[1])?(We&&(We[1]="like Chrome"),W=W[1]||(W=W[0],W<530?1:W<532?2:W<532.05?3:W<533?4:W<534.03?5:W<534.07?6:W<534.1?7:W<534.13?8:W<534.16?9:W<534.24?10:W<534.3?11:W<535.01?12:W<535.02?"13+":W<535.07?15:W<535.11?16:W<535.19?17:W<536.05?18:W<536.1?19:W<537.01?20:W<537.11?"21+":W<537.13?23:W<537.18?24:W<537.24?25:W<537.36?26:We!="Blink"?"27":"28")):(We&&(We[1]="like Safari"),W=W[0],W=W<400?1:W<500?2:W<526?3:W<533?4:W<534?"4+":W<535?5:W<537?6:W<538?7:W<601?8:"8"),We&&(We[1]+=" "+(W+=typeof W=="number"?".x":/[.+]/.test(W)?"":"+")),He=="Safari"&&(!pe||parseInt(pe)>45)&&(pe=W)),He=="Opera"&&(W=/\bzbov|zvav$/.exec(k))?(He+=" ",Be.unshift("desktop mode"),W=="zvav"?(He+="Mini",pe=null):He+="Mobile",k=k.replace(RegExp(" *"+W+"$"),"")):He=="Safari"&&/\bChrome\b/.exec(We&&We[1])&&(Be.unshift("desktop mode"),He="Chrome Mobile",pe=null,/\bOS X\b/.test(k)?(re="Apple",k="iOS 4.3+"):k=null),pe&&pe.indexOf(W=/[\d.]+$/.exec(k))==0&&O.indexOf("/"+W+"-")>-1&&(k=i(k.replace(W,""))),We&&!/\b(?:Avant|Nook)\b/.test(He)&&(/Browser|Lunascape|Maxthon/.test(He)||He!="Safari"&&/^iOS/.test(k)&&/\bSafari\b/.test(We[1])||/^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|Web)/.test(He)&&We[1])&&(W=We[We.length-1])&&Be.push(W),Be.length&&(Be=["("+Be.join("; ")+")"]),re&&nt&&nt.indexOf(re)<0&&Be.push("on "+re),nt&&Be.push((/^on /.test(Be[Be.length-1])?"":"on ")+nt),k&&(W=/ ([\d.+]+)$/.exec(k),V=W&&k.charAt(k.length-W[0].length-1)=="/",k={architecture:32,family:W&&!V?k.replace(W[0],""):k,version:W?W[1]:null,toString:function(){var q=this.version;return this.family+(q&&!V?" "+q:"")+(this.architecture==64?" 64-bit":"")}}),(W=/\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(Ne))&&!/\bi686\b/i.test(Ne)?(k&&(k.architecture=64,k.family=k.family.replace(RegExp(" *"+W),"")),He&&(/\bWOW64\b/i.test(O)||ye&&/\w(?:86|32)$/.test(H.cpuClass||H.platform)&&!/\bWin64; x64\b/i.test(O))&&Be.unshift("32-bit")):k&&/^OS X/.test(k.family)&&He=="Chrome"&&parseFloat(pe)>=39&&(k.architecture=64),O||(O=null);var U={};return U.description=O,U.layout=We&&We[0],U.manufacturer=re,U.name=He,U.prerelease=ze,U.product=nt,U.ua=O,U.version=He&&pe,U.os=k||{architecture:null,family:null,version:null,toString:function(){return"null"}},U.parse=n,U.toString=D,U.version&&Be.unshift(pe),U.name&&Be.unshift(He),k&&He&&(k!=String(k).split(" ")[0]||k!=He.split(" ")[0]&&!nt)&&Be.push(nt?"("+k+")":"on "+k),Be.length&&(U.description=Be.join(" ")),U}var t={function:!0,object:!0},h=t[typeof window]&&window||this,v=t[typeof _]&&_,g=t[typeof P]&&P&&!P.nodeType&&P,b=v&&g&&typeof T=="object"&&T;!b||b.global!==b&&b.window!==b&&b.self!==b||(h=b);var E=Math.pow(2,53)-1,m=/\bOpera/,y=Object.prototype,x=y.hasOwnProperty,l=y.toString,S=n();typeof j=="function"&&typeof j.amd=="object"&&j.amd?(h.platform=S,j(function(){return S})):v&&g?o(S,function(O,A){v[A]=O}):h.platform=S}).call(this)}).call(this,typeof le!="undefined"?le:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],172:[function(w,P,_){(function(T){"use strict";function C(c,p,u,o){if(typeof c!="function")throw new TypeError('"callback" argument must be a function');var a,d,s=arguments.length;switch(s){case 0:case 1:return T.nextTick(c);case 2:return T.nextTick(function(){c.call(null,p)});case 3:return T.nextTick(function(){c.call(null,p,u)});case 4:return T.nextTick(function(){c.call(null,p,u,o)});default:for(a=new Array(s-1),d=0;d1)for(var E=1;E1&&(Ce=de[0]+"@",ee=de[1]),ee=ee.replace(W,"."),Ce+p(ee.split("."),ce).join(".")}function o(ee){for(var ce,de,Ce=[],Se=0,De=ee.length;Se=55296&&ce<=56319&&Se65535&&(ce-=65536,de+=$(ce>>>10&1023|55296),ce=56320|1023&ce),de+=$(ce)}).join("")}function d(ee){return ee-48<10?ee-22:ee-65<26?ee-65:ee-97<26?ee-97:x}function s(ee,ce){return ee+22+75*(ee<26)-((ce!=0)<<5)}function f(ee,ce,de){var Ce=0;for(ee=de?ne(ee/A):ee>>1,ee+=ne(ee/ce);ee>X*S>>1;Ce+=x)ee=ne(ee/X);return ne(Ce+(X+1)*ee/(ee+O))}function i(ee){var ce,de,Ce,Se,De,be,_e,Ke,Ne,Be,ze=[],ye=ee.length,pe=0,We=I,He=D;for(de=ee.lastIndexOf(B),de<0&&(de=0),Ce=0;Ce=128&&c("not-basic"),ze.push(ee.charCodeAt(Ce));for(Se=de>0?de+1:0;Se=ye&&c("invalid-input"),Ke=d(ee.charCodeAt(Se++)),(Ke>=x||Ke>ne((y-pe)/be))&&c("overflow"),pe+=Ke*be,Ne=_e<=He?l:_e>=He+S?S:_e-He,!(Kene(y/Be)&&c("overflow"),be*=Be;ce=ze.length+1,He=f(pe-De,ce,De==0),ne(pe/ce)>y-We&&c("overflow"),We+=ne(pe/ce),pe%=ce,ze.splice(pe++,0,We)}return a(ze)}function n(ee){var ce,de,Ce,Se,De,be,_e,Ke,Ne,Be,ze,ye,pe,We,He,nt=[];for(ee=o(ee),ye=ee.length,ce=I,de=0,De=D,be=0;be=ce&&ze<_e&&(_e=ze);for(pe=Ce+1,_e-ce>ne((y-de)/pe)&&c("overflow"),de+=(_e-ce)*pe,ce=_e,be=0;bey&&c("overflow"),ze==ce){for(Ke=de,Ne=x;Be=Ne<=De?l:Ne>=De+S?S:Ne-De,!(Ke= 0x80 (not a basic code point)","invalid-input":"Invalid input"},X=x-l,ne=Math.floor,$=String.fromCharCode;if(E={version:"1.4.1",ucs2:{decode:o,encode:a},decode:i,encode:n,toASCII:h,toUnicode:t},typeof j=="function"&&typeof j.amd=="object"&&j.amd)j("punycode",function(){return E});else if(v&&g)if(P.exports==v)g.exports=E;else for(m in E)E.hasOwnProperty(m)&&(v[m]=E[m]);else C.punycode=E}(this)}).call(this,typeof le!="undefined"?le:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],175:[function(w,P,_){"use strict";function T(c,p){return Object.prototype.hasOwnProperty.call(c,p)}P.exports=function(c,p,u,o){p=p||"&",u=u||"=";var a={};if(typeof c!="string"||c.length===0)return a;var d=/\+/g;c=c.split(p);var s=1e3;o&&typeof o.maxKeys=="number"&&(s=o.maxKeys);var f=c.length;s>0&&f>s&&(f=s);for(var i=0;i=0?(n=g.substr(0,b),t=g.substr(b+1)):(n=g,t=""),h=decodeURIComponent(n),v=decodeURIComponent(t),T(a,h)?C(a[h])?a[h].push(v):a[h]=[a[h],v]:a[h]=v}return a};var C=Array.isArray||function(c){return Object.prototype.toString.call(c)==="[object Array]"}},{}],176:[function(w,P,_){"use strict";function T(u,o){if(u.map)return u.map(o);for(var a=[],d=0;d0?(typeof pe=="string"||re.objectMode||(0,V.default)(pe)===de.prototype||(pe=c(pe)),He?re.endEmitted?ye.emit("error",new Error("stream.unshift() after end event")):s(ye,re,pe,!0):re.ended?ye.emit("error",new Error("stream.push() after EOF")):(re.reading=!1,re.decoder&&!We?(pe=re.decoder.write(pe),re.objectMode||pe.length!==0?s(ye,re,pe,!1):b(ye,re)):s(ye,re,pe,!1))):He||(re.reading=!1)}return i(re)}function s(ye,pe,We,He){pe.flowing&&pe.length===0&&!pe.sync?(ye.emit("data",We),ye.read(0)):(pe.length+=pe.objectMode?1:We.length,He?pe.buffer.unshift(We):pe.buffer.push(We),pe.needReadable&&v(ye)),b(ye,pe)}function f(ye,pe){var We;return p(pe)||typeof pe=="string"||pe===void 0||ye.objectMode||(We=new TypeError("Invalid non-string/buffer chunk")),We}function i(ye){return!ye.ended&&(ye.needReadable||ye.length=ze?ye=ze:(ye--,ye|=ye>>>1,ye|=ye>>>2,ye|=ye>>>4,ye|=ye>>>8,ye|=ye>>>16,ye++),ye}function t(ye,pe){return ye<=0||pe.length===0&&pe.ended?0:pe.objectMode?1:ye!==ye?pe.flowing&&pe.length?pe.buffer.head.data.length:pe.length:(ye>pe.highWaterMark&&(pe.highWaterMark=n(ye)),ye<=pe.length?ye:pe.ended?pe.length:(pe.needReadable=!0,0))}function h(ye,pe){if(!pe.ended){if(pe.decoder){var We=pe.decoder.end();We&&We.length&&(pe.buffer.push(We),pe.length+=pe.objectMode?1:We.length)}pe.ended=!0,v(ye)}}function v(ye){var pe=ye._readableState;pe.needReadable=!1,pe.emittedReadable||(be("emitReadable",pe.flowing),pe.emittedReadable=!0,pe.sync?X.nextTick(g,ye):g(ye))}function g(ye){be("emit readable"),ye.emit("readable"),S(ye)}function b(ye,pe){pe.readingMore||(pe.readingMore=!0,X.nextTick(E,ye,pe))}function E(ye,pe){for(var We=pe.length;!pe.reading&&!pe.flowing&&!pe.ended&&pe.length=pe.length?(We=pe.decoder?pe.buffer.join(""):pe.buffer.length===1?pe.buffer.head.data:pe.buffer.concat(pe.length),pe.buffer.clear()):We=A(ye,pe.buffer,pe.decoder),We}function A(ye,pe,We){var He;return yere.length?re.length:ye;if(k===re.length?nt+=re:nt+=re.slice(0,ye),(ye-=k)===0){k===re.length?(++He,We.next?pe.head=We.next:pe.head=pe.tail=null):(pe.head=We,We.data=re.slice(k));break}++He}return pe.length-=He,nt}function I(ye,pe){var We=de.allocUnsafe(ye),He=pe.head,nt=1;for(He.data.copy(We),ye-=He.data.length;He=He.next;){var re=He.data,k=ye>re.length?re.length:ye;if(re.copy(We,We.length-ye,0,k),(ye-=k)===0){k===re.length?(++nt,He.next?pe.head=He.next:pe.head=pe.tail=null):(pe.head=He,He.data=re.slice(k));break}++nt}return pe.length-=nt,We}function B(ye){var pe=ye._readableState;if(pe.length>0)throw new Error('"endReadable()" called on non-empty stream');pe.endEmitted||(pe.ended=!0,X.nextTick(H,pe,ye))}function H(ye,pe){ye.endEmitted||ye.length!==0||(ye.endEmitted=!0,pe.readable=!1,pe.emit("end"))}function te(ye,pe){for(var We=0,He=ye.length;We=pe.highWaterMark||pe.ended))return be("read: emitReadable",pe.length,pe.ended),pe.length===0&&pe.ended?B(this):v(this),null;if((ye=t(ye,pe))===0&&pe.ended)return pe.length===0&&B(this),null;var He=pe.needReadable;be("need readable",He),(pe.length===0||pe.length-ye0?O(ye,pe):null,nt===null?(pe.needReadable=!0,ye=0):pe.length-=ye,pe.length===0&&(pe.ended||(pe.needReadable=!0),We!==ye&&pe.ended&&B(this)),nt!==null&&this.emit("data",nt),nt},a.prototype._read=function(ye){this.emit("error",new Error("_read() is not implemented"))},a.prototype.pipe=function(ye,pe){function We(mt,Qe){be("onunpipe"),mt===J&&Qe&&Qe.hasUnpiped===!1&&(Qe.hasUnpiped=!0,nt())}function He(){be("onend"),ye.end()}function nt(){be("cleanup"),ye.removeListener("close",U),ye.removeListener("finish",q),ye.removeListener("drain",Ue),ye.removeListener("error",k),ye.removeListener("unpipe",We),J.removeListener("end",He),J.removeListener("end",Y),J.removeListener("data",re),je=!0,!xe.awaitDrain||ye._writableState&&!ye._writableState.needDrain||Ue()}function re(mt){be("ondata"),tt=!1,ye.write(mt)!==!1||tt||((xe.pipesCount===1&&xe.pipes===ye||xe.pipesCount>1&&te(xe.pipes,ye)!==-1)&&!je&&(be("false write response, pause",J._readableState.awaitDrain),J._readableState.awaitDrain++,tt=!0),J.pause())}function k(mt){be("onerror",mt),Y(),ye.removeListener("error",k),ee(ye,"error")===0&&ye.emit("error",mt)}function U(){ye.removeListener("finish",q),Y()}function q(){be("onfinish"),ye.removeListener("close",U),Y()}function Y(){be("unpipe"),J.unpipe(ye)}var J=this,xe=this._readableState;switch(xe.pipesCount){case 0:xe.pipes=ye;break;case 1:xe.pipes=[xe.pipes,ye];break;default:xe.pipes.push(ye)}xe.pipesCount+=1,be("pipe count=%d opts=%j",xe.pipesCount,pe);var ke=(!pe||pe.end!==!1)&&ye!==T.stdout&&ye!==T.stderr,dt=ke?He:Y;xe.endEmitted?X.nextTick(dt):J.once("end",dt),ye.on("unpipe",We);var Ue=m(J);ye.on("drain",Ue);var je=!1,tt=!1;return J.on("data",re),u(ye,"error",k),ye.once("close",U),ye.once("finish",q),ye.emit("pipe",J),xe.flowing||(be("pipe resume"),J.resume()),ye},a.prototype.unpipe=function(ye){var pe=this._readableState,We={hasUnpiped:!1};if(pe.pipesCount===0)return this;if(pe.pipesCount===1)return ye&&ye!==pe.pipes?this:(ye||(ye=pe.pipes),pe.pipes=null,pe.pipesCount=0,pe.flowing=!1,ye&&ye.emit("unpipe",this,We),this);if(!ye){var He=pe.pipes,nt=pe.pipesCount;pe.pipes=null,pe.pipesCount=0,pe.flowing=!1;for(var re=0;re-1?ne.default:$.nextTick;s.WritableState=d;var de=w("core-util-is");de.inherits=w("inherits");var Ce={deprecate:w("util-deprecate")},Se=w("./internal/streams/stream"),De=w("safe-buffer").Buffer,be=C.Uint8Array||function(){},_e=w("./internal/streams/destroy");de.inherits(s,Se),d.prototype.getBuffer=function(){for(var Ne=this.bufferedRequest,Be=[];Ne;)Be.push(Ne),Ne=Ne.next;return Be},function(){try{Object.defineProperty(d.prototype,"buffer",{get:Ce.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(Ne){}}();var Ke;typeof V.default=="function"&&te.default&&typeof Function.prototype[te.default]=="function"?(Ke=Function.prototype[te.default],(0,B.default)(s,te.default,{value:function(Ne){return!!Ke.call(this,Ne)||this===s&&Ne&&Ne._writableState instanceof d}})):Ke=function(Ne){return Ne instanceof this},s.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},s.prototype.write=function(Ne,Be,ze){var ye=this._writableState,pe=!1,We=!ye.objectMode&&o(Ne);return We&&!De.isBuffer(Ne)&&(Ne=u(Ne)),typeof Be=="function"&&(ze=Be,Be=null),We?Be="buffer":Be||(Be=ye.defaultEncoding),typeof ze!="function"&&(ze=a),ye.ended?f(this,ze):(We||i(this,ye,Ne,ze))&&(ye.pendingcb++,pe=t(this,ye,We,Ne,Be,ze)),pe},s.prototype.cork=function(){this._writableState.corked++},s.prototype.uncork=function(){var Ne=this._writableState;Ne.corked&&(Ne.corked--,Ne.writing||Ne.corked||Ne.finished||Ne.bufferProcessing||!Ne.bufferedRequest||y(this,Ne))},s.prototype.setDefaultEncoding=function(Ne){if(typeof Ne=="string"&&(Ne=Ne.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((Ne+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+Ne);return this._writableState.defaultEncoding=Ne,this},Object.defineProperty(s.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),s.prototype._write=function(Ne,Be,ze){ze(new Error("_write() is not implemented"))},s.prototype._writev=null,s.prototype.end=function(Ne,Be,ze){var ye=this._writableState;typeof Ne=="function"?(ze=Ne,Ne=null,Be=null):typeof Be=="function"&&(ze=Be,Be=null),Ne!=null&&this.write(Ne,Be),ye.corked&&(ye.corked=1,this.uncork()),ye.ending||ye.finished||A(this,ye,ze)},Object.defineProperty(s.prototype,"destroyed",{get:function(){return this._writableState!==void 0&&this._writableState.destroyed},set:function(Ne){this._writableState&&(this._writableState.destroyed=Ne)}}),s.prototype.destroy=_e.destroy,s.prototype._undestroy=_e.undestroy,s.prototype._destroy=function(Ne,Be){this.end(),Be(Ne)}}).call(this,w("_process"),typeof le!="undefined"?le: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(w,P,_){"use strict";function T(u,o){if(!(u instanceof o))throw new TypeError("Cannot call a class as a function")}function C(u,o,a){u.copy(o,a)}var c=w("safe-buffer").Buffer,p=w("util");P.exports=function(){function u(){T(this,u),this.head=null,this.tail=null,this.length=0}return u.prototype.push=function(o){var a={data:o,next:null};this.length>0?this.tail.next=a:this.head=a,this.tail=a,++this.length},u.prototype.unshift=function(o){var a={data:o,next:this.head};this.length===0&&(this.tail=a),this.head=a,++this.length},u.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}},u.prototype.clear=function(){this.head=this.tail=null,this.length=0},u.prototype.join=function(o){if(this.length===0)return"";for(var a=this.head,d=""+a.data;a=a.next;)d+=o+a.data;return d},u.prototype.concat=function(o){if(this.length===0)return c.alloc(0);if(this.length===1)return this.head.data;for(var a=c.allocUnsafe(o>>>0),d=this.head,s=0;d;)C(d.data,a,s),s+=d.data.length,d=d.next;return a},u}(),p&&p.inspect&&p.inspect.custom&&(P.exports.prototype[p.inspect.custom]=function(){var u=p.inspect({length:this.length});return this.constructor.name+" "+u})},{"safe-buffer":193,util:36}],185:[function(w,P,_){"use strict";function T(u,o){var a=this,d=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return d||s?(o?o(u):!u||this._writableState&&this._writableState.errorEmitted||p.nextTick(c,this,u),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(u||null,function(f){!o&&f?(p.nextTick(c,a,f),a._writableState&&(a._writableState.errorEmitted=!0)):o&&o(f)}),this)}function C(){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 c(u,o){u.emit("error",o)}var p=w("process-nextick-args");P.exports={destroy:T,undestroy:C}},{"process-nextick-args":172}],186:[function(w,P,_){"use strict";P.exports=w("events").EventEmitter},{events:158}],187:[function(w,P,_){P.exports=w("./readable").PassThrough},{"./readable":188}],188:[function(w,P,_){_=P.exports=w("./lib/_stream_readable.js"),_.Stream=_,_.Readable=_,_.Writable=w("./lib/_stream_writable.js"),_.Duplex=w("./lib/_stream_duplex.js"),_.Transform=w("./lib/_stream_transform.js"),_.PassThrough=w("./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(w,P,_){P.exports=w("./readable").Transform},{"./readable":188}],190:[function(w,P,_){P.exports=w("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":183}],191:[function(w,P,_){var T=function(){return this}()||Function("return this")(),C=T.regeneratorRuntime&&Object.getOwnPropertyNames(T).indexOf("regeneratorRuntime")>=0,c=C&&T.regeneratorRuntime;if(T.regeneratorRuntime=void 0,P.exports=w("./runtime"),C)T.regeneratorRuntime=c;else try{delete T.regeneratorRuntime}catch(p){T.regeneratorRuntime=void 0}},{"./runtime":192}],192:[function(w,P,_){!function(T){"use strict";function C(ne,$,ee,ce){var de=$&&$.prototype instanceof p?$:p,Ce=Object.create(de.prototype),Se=new t(ce||[]);return Ce._invoke=s(ne,ee,Se),Ce}function c(ne,$,ee){try{return{type:"normal",arg:ne.call($,ee)}}catch(ce){return{type:"throw",arg:ce}}}function p(){}function u(){}function o(){}function a(ne){["next","throw","return"].forEach(function($){ne[$]=function(ee){return this._invoke($,ee)}})}function d(ne){function $(de,Ce,Se,De){var be=c(ne[de],ne,Ce);if(be.type!=="throw"){var _e=be.arg,Ke=_e.value;return Ke&&typeof Ke=="object"&&E.call(Ke,"__await")?Promise.resolve(Ke.__await).then(function(Ne){$("next",Ne,Se,De)},function(Ne){$("throw",Ne,Se,De)}):Promise.resolve(Ke).then(function(Ne){_e.value=Ne,Se(_e)},De)}De(be.arg)}function ee(de,Ce){function Se(){return new Promise(function(De,be){$(de,Ce,De,be)})}return ce=ce?ce.then(Se,Se):Se()}var ce;this._invoke=ee}function s(ne,$,ee){var ce=A;return function(de,Ce){if(ce===I)throw new Error("Generator is already running");if(ce===B){if(de==="throw")throw Ce;return v()}for(ee.method=de,ee.arg=Ce;;){var Se=ee.delegate;if(Se){var De=f(Se,ee);if(De){if(De===H)continue;return De}}if(ee.method==="next")ee.sent=ee._sent=ee.arg;else if(ee.method==="throw"){if(ce===A)throw ce=B,ee.arg;ee.dispatchException(ee.arg)}else ee.method==="return"&&ee.abrupt("return",ee.arg);ce=I;var be=c(ne,$,ee);if(be.type==="normal"){if(ce=ee.done?B:D,be.arg===H)continue;return{value:be.arg,done:ee.done}}be.type==="throw"&&(ce=B,ee.method="throw",ee.arg=be.arg)}}}function f(ne,$){var ee=ne.iterator[$.method];if(ee===g){if($.delegate=null,$.method==="throw"){if(ne.iterator.return&&($.method="return",$.arg=g,f(ne,$),$.method==="throw"))return H;$.method="throw",$.arg=new TypeError("The iterator does not provide a 'throw' method")}return H}var ce=c(ee,ne.iterator,$.arg);if(ce.type==="throw")return $.method="throw",$.arg=ce.arg,$.delegate=null,H;var de=ce.arg;return de?de.done?($[ne.resultName]=de.value,$.next=ne.nextLoc,$.method!=="return"&&($.method="next",$.arg=g),$.delegate=null,H):de:($.method="throw",$.arg=new TypeError("iterator result is not an object"),$.delegate=null,H)}function i(ne){var $={tryLoc:ne[0]};1 in ne&&($.catchLoc=ne[1]),2 in ne&&($.finallyLoc=ne[2],$.afterLoc=ne[3]),this.tryEntries.push($)}function n(ne){var $=ne.completion||{};$.type="normal",delete $.arg,ne.completion=$}function t(ne){this.tryEntries=[{tryLoc:"root"}],ne.forEach(i,this),this.reset(!0)}function h(ne){if(ne){var $=ne[y];if($)return $.call(ne);if(typeof ne.next=="function")return ne;if(!isNaN(ne.length)){var ee=-1,ce=function de(){for(;++ee=0;--ce){var de=this.tryEntries[ce],Ce=de.completion;if(de.tryLoc==="root")return $("end");if(de.tryLoc<=this.prev){var Se=E.call(de,"catchLoc"),De=E.call(de,"finallyLoc");if(Se&&De){if(this.prev=0;--ee){var ce=this.tryEntries[ee];if(ce.tryLoc<=this.prev&&E.call(ce,"finallyLoc")&&this.prev=0;--$){var ee=this.tryEntries[$];if(ee.finallyLoc===ne)return this.complete(ee.completion,ee.afterLoc),n(ee),H}},catch:function(ne){for(var $=this.tryEntries.length-1;$>=0;--$){var ee=this.tryEntries[$];if(ee.tryLoc===ne){var ce=ee.completion;if(ce.type==="throw"){var de=ce.arg;n(ee)}return de}}throw new Error("illegal catch attempt")},delegateYield:function(ne,$,ee){return this.delegate={iterator:h(ne),resultName:$,nextLoc:ee},this.method==="next"&&(this.arg=g),H}}}(function(){return this}()||Function("return this")())},{}],193:[function(w,P,_){function T(u,o){for(var a in u)o[a]=u[a]}function C(u,o,a){return p(u,o,a)}var c=w("buffer"),p=c.Buffer;p.from&&p.alloc&&p.allocUnsafe&&p.allocUnsafeSlow?P.exports=c:(T(c,_),_.Buffer=C),T(p,C),C.from=function(u,o,a){if(typeof u=="number")throw new TypeError("Argument must not be a number");return p(u,o,a)},C.alloc=function(u,o,a){if(typeof u!="number")throw new TypeError("Argument must be a number");var d=p(u);return o!==void 0?typeof a=="string"?d.fill(o,a):d.fill(o):d.fill(0),d},C.allocUnsafe=function(u){if(typeof u!="number")throw new TypeError("Argument must be a number");return p(u)},C.allocUnsafeSlow=function(u){if(typeof u!="number")throw new TypeError("Argument must be a number");return c.SlowBuffer(u)}},{buffer:38}],194:[function(w,P,_){(function(T){"use strict";function C(v){return v&&v.__esModule?v:{default:v}}var c=w("babel-runtime/core-js/string/from-code-point"),p=C(c),u=w("babel-runtime/core-js/json/stringify"),o=C(u),a=w("babel-runtime/helpers/typeof"),d=C(a),s=w("babel-runtime/core-js/object/define-property"),f=C(s),i=w("babel-runtime/core-js/object/keys"),n=C(i),t=w("babel-runtime/core-js/object/create"),h=C(t);!function(v){function g(Y,J){if(!(this instanceof g))return new g(Y,J);var xe=this;E(xe),xe.q=xe.c="",xe.bufferCheckPosition=v.MAX_BUFFER_LENGTH,xe.opt=J||{},xe.opt.lowercase=xe.opt.lowercase||xe.opt.lowercasetags,xe.looseCase=xe.opt.lowercase?"toLowerCase":"toUpperCase",xe.tags=[],xe.closed=xe.closedRoot=xe.sawRoot=!1,xe.tag=xe.error=null,xe.strict=!!Y,xe.noscript=!(!Y&&!xe.opt.noscript),xe.state=U.BEGIN,xe.strictEntities=xe.opt.strictEntities,xe.ENTITIES=xe.strictEntities?(0,h.default)(v.XML_ENTITIES):(0,h.default)(v.ENTITIES),xe.attribList=[],xe.opt.xmlns&&(xe.ns=(0,h.default)(We)),xe.trackPosition=xe.opt.position!==!1,xe.trackPosition&&(xe.position=xe.line=xe.column=0),I(xe,"onready")}function b(Y){for(var J=Math.max(v.MAX_BUFFER_LENGTH,10),xe=0,ke=0,dt=_e.length;keJ)switch(_e[ke]){case"textNode":H(Y);break;case"cdata":B(Y,"oncdata",Y.cdata),Y.cdata="";break;case"script":B(Y,"onscript",Y.script),Y.script="";break;default:W(Y,"Max buffer length exceeded: "+_e[ke])}xe=Math.max(xe,Ue)}var je=v.MAX_BUFFER_LENGTH-xe;Y.bufferCheckPosition=je+Y.position}function E(Y){for(var J=0,xe=_e.length;J"||l(Y)}function A(Y,J){return Y.test(J)}function D(Y,J){return!A(Y,J)}function I(Y,J,xe){Y[J]&&Y[J](xe)}function B(Y,J,xe){Y.textNode&&H(Y),I(Y,J,xe)}function H(Y){Y.textNode=te(Y.opt,Y.textNode),Y.textNode&&I(Y,"ontext",Y.textNode),Y.textNode=""}function te(Y,J){return Y.trim&&(J=J.trim()),Y.normalize&&(J=J.replace(/\s+/g," ")),J}function W(Y,J){return H(Y),Y.trackPosition&&(J+=` Line: `+Y.line+` Column: `+Y.column+` Char: `+Y.c),J=new Error(J),Y.error=J,I(Y,"onerror",J),Y}function V(Y){return Y.sawRoot&&!Y.closedRoot&&X(Y,"Unclosed root tag"),Y.state!==U.BEGIN&&Y.state!==U.BEGIN_WHITESPACE&&Y.state!==U.TEXT&&W(Y,"Unexpected end"),H(Y),Y.c="",Y.closed=!0,I(Y,"onend"),g.call(Y,Y.strict,Y.opt),Y}function X(Y,J){if((Y===void 0?"undefined":(0,d.default)(Y))!=="object"||!(Y instanceof g))throw new Error("bad call to strictFail");Y.strict&&W(Y,J)}function ne(Y){Y.strict||(Y.tagName=Y.tagName[Y.looseCase]());var J=Y.tags[Y.tags.length-1]||Y,xe=Y.tag={name:Y.tagName,attributes:{}};Y.opt.xmlns&&(xe.ns=J.ns),Y.attribList.length=0,B(Y,"onopentagstart",xe)}function $(Y,J){var xe=Y.indexOf(":"),ke=xe<0?["",Y]:Y.split(":"),dt=ke[0],Ue=ke[1];return J&&Y==="xmlns"&&(dt="xmlns",Ue=""),{prefix:dt,local:Ue}}function ee(Y){if(Y.strict||(Y.attribName=Y.attribName[Y.looseCase]()),Y.attribList.indexOf(Y.attribName)!==-1||Y.tag.attributes.hasOwnProperty(Y.attribName))return void(Y.attribName=Y.attribValue="");if(Y.opt.xmlns){var J=$(Y.attribName,!0),xe=J.prefix,ke=J.local;if(xe==="xmlns")if(ke==="xml"&&Y.attribValue!==ye)X(Y,"xml: prefix must be bound to "+ye+` Actual: `+Y.attribValue);else if(ke==="xmlns"&&Y.attribValue!==pe)X(Y,"xmlns: prefix must be bound to "+pe+` Actual: `+Y.attribValue);else{var dt=Y.tag,Ue=Y.tags[Y.tags.length-1]||Y;dt.ns===Ue.ns&&(dt.ns=(0,h.default)(Ue.ns)),dt.ns[ke]=Y.attribValue}Y.attribList.push([Y.attribName,Y.attribValue])}else Y.tag.attributes[Y.attribName]=Y.attribValue,B(Y,"onattribute",{name:Y.attribName,value:Y.attribValue});Y.attribName=Y.attribValue=""}function ce(Y,J){if(Y.opt.xmlns){var xe=Y.tag,ke=$(Y.tagName);xe.prefix=ke.prefix,xe.local=ke.local,xe.uri=xe.ns[ke.prefix]||"",xe.prefix&&!xe.uri&&(X(Y,"Unbound namespace prefix: "+(0,o.default)(Y.tagName)),xe.uri=ke.prefix);var dt=Y.tags[Y.tags.length-1]||Y;xe.ns&&dt.ns!==xe.ns&&(0,n.default)(xe.ns).forEach(function(Ae){B(Y,"onopennamespace",{prefix:Ae,uri:xe.ns[Ae]})});for(var Ue=0,je=Y.attribList.length;Ue",Y.tagName="",void(Y.state=U.SCRIPT);B(Y,"onscript",Y.script),Y.script=""}var J=Y.tags.length,xe=Y.tagName;Y.strict||(xe=xe[Y.looseCase]());for(var ke=xe;J--&&!(Y.tags[J].name===ke);)X(Y,"Unexpected close tag");if(J<0)return X(Y,"Unmatched closing tag: "+Y.tagName),Y.textNode+="",void(Y.state=U.TEXT);Y.tagName=xe;for(var dt=Y.tags.length;dt-- >J;){var Ue=Y.tag=Y.tags.pop();Y.tagName=Y.tag.name,B(Y,"onclosetag",Y.tagName);var je={};for(var tt in Ue.ns)je[tt]=Ue.ns[tt];var mt=Y.tags[Y.tags.length-1]||Y;Y.opt.xmlns&&Ue.ns!==mt.ns&&(0,n.default)(Ue.ns).forEach(function(Qe){var Xe=Ue.ns[Qe];B(Y,"onclosenamespace",{prefix:Qe,uri:Xe})})}J===0&&(Y.closedRoot=!0),Y.tagName=Y.attribValue=Y.attribName="",Y.attribList.length=0,Y.state=U.TEXT}function Ce(Y){var J,xe=Y.entity,ke=xe.toLowerCase(),dt="";return Y.ENTITIES[xe]?Y.ENTITIES[xe]:Y.ENTITIES[ke]?Y.ENTITIES[ke]:(xe=ke,xe.charAt(0)==="#"&&(xe.charAt(1)==="x"?(xe=xe.slice(2),J=parseInt(xe,16),dt=J.toString(16)):(xe=xe.slice(1),J=parseInt(xe,10),dt=J.toString(10))),xe=xe.replace(/^0+/,""),isNaN(J)||dt.toLowerCase()!==xe?(X(Y,"Invalid character entity"),"&"+Y.entity+";"):(0,p.default)(J))}function Se(Y,J){J==="<"?(Y.state=U.OPEN_WAKA,Y.startTagPosition=Y.position):l(J)||(X(Y,"Non-whitespace before first tag."),Y.textNode=J,Y.state=U.TEXT)}function De(Y,J){var xe="";return J"?(B(J,"onsgmldeclaration",J.sgmlDecl),J.sgmlDecl="",J.state=U.TEXT):(S(ke)&&(J.state=U.SGML_DECL_QUOTED),J.sgmlDecl+=ke);continue;case U.SGML_DECL_QUOTED:ke===J.q&&(J.state=U.SGML_DECL,J.q=""),J.sgmlDecl+=ke;continue;case U.DOCTYPE:ke===">"?(J.state=U.TEXT,B(J,"ondoctype",J.doctype),J.doctype=!0):(J.doctype+=ke,ke==="["?J.state=U.DOCTYPE_DTD:S(ke)&&(J.state=U.DOCTYPE_QUOTED,J.q=ke));continue;case U.DOCTYPE_QUOTED:J.doctype+=ke,ke===J.q&&(J.q="",J.state=U.DOCTYPE);continue;case U.DOCTYPE_DTD:J.doctype+=ke,ke==="]"?J.state=U.DOCTYPE:S(ke)&&(J.state=U.DOCTYPE_DTD_QUOTED,J.q=ke);continue;case U.DOCTYPE_DTD_QUOTED:J.doctype+=ke,ke===J.q&&(J.state=U.DOCTYPE_DTD,J.q="");continue;case U.COMMENT:ke==="-"?J.state=U.COMMENT_ENDING:J.comment+=ke;continue;case U.COMMENT_ENDING:ke==="-"?(J.state=U.COMMENT_ENDED,J.comment=te(J.opt,J.comment),J.comment&&B(J,"oncomment",J.comment),J.comment=""):(J.comment+="-"+ke,J.state=U.COMMENT);continue;case U.COMMENT_ENDED:ke!==">"?(X(J,"Malformed comment"),J.comment+="--"+ke,J.state=U.COMMENT):J.state=U.TEXT;continue;case U.CDATA:ke==="]"?J.state=U.CDATA_ENDING:J.cdata+=ke;continue;case U.CDATA_ENDING:ke==="]"?J.state=U.CDATA_ENDING_2:(J.cdata+="]"+ke,J.state=U.CDATA);continue;case U.CDATA_ENDING_2:ke===">"?(J.cdata&&B(J,"oncdata",J.cdata),B(J,"onclosecdata"),J.cdata="",J.state=U.TEXT):ke==="]"?J.cdata+="]":(J.cdata+="]]"+ke,J.state=U.CDATA);continue;case U.PROC_INST:ke==="?"?J.state=U.PROC_INST_ENDING:l(ke)?J.state=U.PROC_INST_BODY:J.procInstName+=ke;continue;case U.PROC_INST_BODY:if(!J.procInstBody&&l(ke))continue;ke==="?"?J.state=U.PROC_INST_ENDING:J.procInstBody+=ke;continue;case U.PROC_INST_ENDING:ke===">"?(B(J,"onprocessinginstruction",{name:J.procInstName,body:J.procInstBody}),J.procInstName=J.procInstBody="",J.state=U.TEXT):(J.procInstBody+="?"+ke,J.state=U.PROC_INST_BODY);continue;case U.OPEN_TAG:A(nt,ke)?J.tagName+=ke:(ne(J),ke===">"?ce(J):ke==="/"?J.state=U.OPEN_TAG_SLASH:(l(ke)||X(J,"Invalid character in tag name"),J.state=U.ATTRIB));continue;case U.OPEN_TAG_SLASH:ke===">"?(ce(J,!0),de(J)):(X(J,"Forward-slash in opening tag not followed by >"),J.state=U.ATTRIB);continue;case U.ATTRIB:if(l(ke))continue;ke===">"?ce(J):ke==="/"?J.state=U.OPEN_TAG_SLASH:A(He,ke)?(J.attribName=ke,J.attribValue="",J.state=U.ATTRIB_NAME):X(J,"Invalid attribute name");continue;case U.ATTRIB_NAME:ke==="="?J.state=U.ATTRIB_VALUE:ke===">"?(X(J,"Attribute without value"),J.attribValue=J.attribName,ee(J),ce(J)):l(ke)?J.state=U.ATTRIB_NAME_SAW_WHITE:A(nt,ke)?J.attribName+=ke:X(J,"Invalid attribute name");continue;case U.ATTRIB_NAME_SAW_WHITE:if(ke==="=")J.state=U.ATTRIB_VALUE;else{if(l(ke))continue;X(J,"Attribute without value"),J.tag.attributes[J.attribName]="",J.attribValue="",B(J,"onattribute",{name:J.attribName,value:""}),J.attribName="",ke===">"?ce(J):A(He,ke)?(J.attribName=ke,J.state=U.ATTRIB_NAME):(X(J,"Invalid attribute name"),J.state=U.ATTRIB)}continue;case U.ATTRIB_VALUE:if(l(ke))continue;S(ke)?(J.q=ke,J.state=U.ATTRIB_VALUE_QUOTED):(X(J,"Unquoted attribute value"),J.state=U.ATTRIB_VALUE_UNQUOTED,J.attribValue=ke);continue;case U.ATTRIB_VALUE_QUOTED:if(ke!==J.q){ke==="&"?J.state=U.ATTRIB_VALUE_ENTITY_Q:J.attribValue+=ke;continue}ee(J),J.q="",J.state=U.ATTRIB_VALUE_CLOSED;continue;case U.ATTRIB_VALUE_CLOSED:l(ke)?J.state=U.ATTRIB:ke===">"?ce(J):ke==="/"?J.state=U.OPEN_TAG_SLASH:A(He,ke)?(X(J,"No whitespace between attributes"),J.attribName=ke,J.attribValue="",J.state=U.ATTRIB_NAME):X(J,"Invalid attribute name");continue;case U.ATTRIB_VALUE_UNQUOTED:if(!O(ke)){ke==="&"?J.state=U.ATTRIB_VALUE_ENTITY_U:J.attribValue+=ke;continue}ee(J),ke===">"?ce(J):J.state=U.ATTRIB;continue;case U.CLOSE_TAG:if(J.tagName)ke===">"?de(J):A(nt,ke)?J.tagName+=ke:J.script?(J.script+=""?de(J):X(J,"Invalid characters in closing tag");continue;case U.TEXT_ENTITY:case U.ATTRIB_VALUE_ENTITY_Q:case U.ATTRIB_VALUE_ENTITY_U:var je,tt;switch(J.state){case U.TEXT_ENTITY:je=U.TEXT,tt="textNode";break;case U.ATTRIB_VALUE_ENTITY_Q:je=U.ATTRIB_VALUE_QUOTED,tt="attribValue";break;case U.ATTRIB_VALUE_ENTITY_U:je=U.ATTRIB_VALUE_UNQUOTED,tt="attribValue"}ke===";"?(J[tt]+=Ce(J),J.entity="",J.state=je):A(J.entity.length?k:re,ke)?J.entity+=ke:(X(J,"Invalid character in entity name"),J[tt]+="&"+J.entity+ke,J.entity="",J.state=je);continue;default:throw new Error(J,"Unknown state: "+J.state)}return J.position>=J.bufferCheckPosition&&b(J),J}v.parser=function(Y,J){return new g(Y,J)},v.SAXParser=g,v.SAXStream=x,v.createStream=y,v.MAX_BUFFER_LENGTH=65536;var _e=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];v.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"],h.default||(Object.create=function(Y){function J(){}return J.prototype=Y,new J}),n.default||(Object.keys=function(Y){var J=[];for(var xe in Y)Y.hasOwnProperty(xe)&&J.push(xe);return J}),g.prototype={end:function(){V(this)},write:be,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){m(this)}};var Ke;try{Ke=w("stream").Stream}catch(Y){Ke=function(){}}var Ne=v.EVENTS.filter(function(Y){return Y!=="error"&&Y!=="end"});x.prototype=(0,h.default)(Ke.prototype,{constructor:{value:x}}),x.prototype.write=function(Y){if(typeof T=="function"&&typeof T.isBuffer=="function"&&T.isBuffer(Y)){if(!this._decoder){var J=w("string_decoder").StringDecoder;this._decoder=new J("utf8")}Y=this._decoder.write(Y)}return this._parser.write(Y.toString()),this.emit("data",Y),!0},x.prototype.end=function(Y){return Y&&Y.length&&this.write(Y),this._parser.end(),!0},x.prototype.on=function(Y,J){var xe=this;return xe._parser["on"+Y]||Ne.indexOf(Y)===-1||(xe._parser["on"+Y]=function(){var ke=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);ke.splice(0,0,Y),xe.emit.apply(xe,ke)}),Ke.prototype.on.call(xe,Y,J)};var Be="[CDATA[",ze="DOCTYPE",ye="http://www.w3.org/XML/1998/namespace",pe="http://www.w3.org/2000/xmlns/",We={xml:ye,xmlns:pe},He=/[:_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]/,nt=/[:_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-]/,re=/[#:_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]/,k=/[#:_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-]/,U=0;v.STATE={BEGIN:U++,BEGIN_WHITESPACE:U++,TEXT:U++,TEXT_ENTITY:U++,OPEN_WAKA:U++,SGML_DECL:U++,SGML_DECL_QUOTED:U++,DOCTYPE:U++,DOCTYPE_QUOTED:U++,DOCTYPE_DTD:U++,DOCTYPE_DTD_QUOTED:U++,COMMENT_STARTING:U++,COMMENT:U++,COMMENT_ENDING:U++,COMMENT_ENDED:U++,CDATA:U++,CDATA_ENDING:U++,CDATA_ENDING_2:U++,PROC_INST:U++,PROC_INST_BODY:U++,PROC_INST_ENDING:U++,OPEN_TAG:U++,OPEN_TAG_SLASH:U++,ATTRIB:U++,ATTRIB_NAME:U++,ATTRIB_NAME_SAW_WHITE:U++,ATTRIB_VALUE:U++,ATTRIB_VALUE_QUOTED:U++,ATTRIB_VALUE_CLOSED:U++,ATTRIB_VALUE_UNQUOTED:U++,ATTRIB_VALUE_ENTITY_Q:U++,ATTRIB_VALUE_ENTITY_U:U++,CLOSE_TAG:U++,CLOSE_TAG_SAW_WHITE:U++,SCRIPT:U++,SCRIPT_ENDING:U++},v.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},v.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,n.default)(v.ENTITIES).forEach(function(Y){var J=v.ENTITIES[Y],xe=typeof J=="number"?String.fromCharCode(J):J;v.ENTITIES[Y]=xe});for(var q in v.STATE)v.STATE[v.STATE[q]]=q;U=v.STATE,p.default||function(){var Y=String.fromCharCode,J=Math.floor,xe=function(){var ke,dt,Ue=[],je=-1,tt=arguments.length;if(!tt)return"";for(var mt="";++je1114111||J(Qe)!==Qe)throw RangeError("Invalid code point: "+Qe);Qe<=65535?Ue.push(Qe):(Qe-=65536,ke=55296+(Qe>>10),dt=Qe%1024+56320,Ue.push(ke,dt)),(je+1===tt||Ue.length>16384)&&(mt+=Y.apply(null,Ue),Ue.length=0)}return mt};f.default?Object.defineProperty(String,"fromCodePoint",{value:xe,configurable:!0,writable:!0}):String.fromCodePoint=xe}()}(_===void 0?(void 0).sax={}:_)}).call(this,w("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(w,P,_){function T(){C.call(this)}P.exports=T;var C=w("events").EventEmitter;w("inherits")(T,C),T.Readable=w("readable-stream/readable.js"),T.Writable=w("readable-stream/writable.js"),T.Duplex=w("readable-stream/duplex.js"),T.Transform=w("readable-stream/transform.js"),T.PassThrough=w("readable-stream/passthrough.js"),T.Stream=T,T.prototype.pipe=function(c,p){function u(t){c.writable&&c.write(t)===!1&&i.pause&&i.pause()}function o(){i.readable&&i.resume&&i.resume()}function a(){n||(n=!0,c.end())}function d(){n||(n=!0,typeof c.destroy=="function"&&c.destroy())}function s(t){if(f(),C.listenerCount(this,"error")===0)throw t}function f(){i.removeListener("data",u),c.removeListener("drain",o),i.removeListener("end",a),i.removeListener("close",d),i.removeListener("error",s),c.removeListener("error",s),i.removeListener("end",f),i.removeListener("close",f),c.removeListener("close",f)}var i=this;i.on("data",u),c.on("drain",o),c._isStdio||p&&p.end===!1||(i.on("end",a),i.on("close",d));var n=!1;return i.on("error",s),c.on("error",s),i.on("end",f),i.on("close",f),c.on("close",f),c.emit("pipe",i),c}},{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(w,P,_){(function(T){var C=w("./lib/request"),c=w("./lib/response"),p=w("xtend"),u=w("builtin-status-codes"),o=w("url"),a=_;a.request=function(d,s){d=typeof d=="string"?o.parse(d):p(d);var f=T.location.protocol.search(/^https?:$/)===-1?"http:":"",i=d.protocol||f,n=d.hostname||d.host,t=d.port,h=d.path||"/";n&&n.indexOf(":")!==-1&&(n="["+n+"]"),d.url=(n?i+"//"+n:"")+(t?":"+t:"")+h,d.method=(d.method||"GET").toUpperCase(),d.headers=d.headers||{};var v=new C(d);return s&&v.on("response",s),v},a.get=function(d,s){var f=a.request(d,s);return f.end(),f},a.ClientRequest=C,a.IncomingMessage=c.IncomingMessage,a.Agent=function(){},a.Agent.defaultMaxSockets=4,a.globalAgent=new a.Agent,a.STATUS_CODES=u,a.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 le!="undefined"?le:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"./lib/request":198,"./lib/response":199,"builtin-status-codes":39,url:203,xtend:236}],197:[function(w,P,_){(function(T){"use strict";function C(){if(u!==void 0)return u;if(T.XMLHttpRequest){u=new T.XMLHttpRequest;try{u.open("GET",T.XDomainRequest?"/":"https://example.com")}catch(d){u=null}}else u=null;return u}function c(d){var s=C();if(!s)return!1;try{return s.responseType=d,s.responseType===d}catch(f){}return!1}function p(d){return typeof d=="function"}_.fetch=p(T.fetch)&&p(T.ReadableStream),_.writableStream=p(T.WritableStream),_.abortController=p(T.AbortController),_.blobConstructor=!1;try{new Blob([new ArrayBuffer(1)]),_.blobConstructor=!0}catch(d){}var u,o=T.ArrayBuffer!==void 0,a=o&&p(T.ArrayBuffer.prototype.slice);_.arraybuffer=_.fetch||o&&c("arraybuffer"),_.msstream=!_.fetch&&a&&c("ms-stream"),_.mozchunkedarraybuffer=!_.fetch&&o&&c("moz-chunked-arraybuffer"),_.overrideMimeType=_.fetch||!!C()&&p(C().overrideMimeType),_.vbArray=p(T.VBArray),u=null}).call(this,typeof le!="undefined"?le:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],198:[function(w,P,_){(function(T,C,c){"use strict";function p(b,E){return d.fetch&&E?"fetch":d.mozchunkedarraybuffer?"moz-chunked-arraybuffer":d.msstream?"ms-stream":d.arraybuffer&&b?"arraybuffer":d.vbArray&&b?"text:vbarray":"text"}function u(b){try{var E=b.status;return E!==null&&E!==0}catch(m){return!1}}var o=w("babel-runtime/core-js/object/keys"),a=function(b){return b&&b.__esModule?b:{default:b}}(o),d=w("./capability"),s=w("inherits"),f=w("./response"),i=w("readable-stream"),n=w("to-arraybuffer"),t=f.IncomingMessage,h=f.readyStates,v=P.exports=function(b){var E=this;i.Writable.call(E),E._opts=b,E._body=[],E._headers={},b.auth&&E.setHeader("Authorization","Basic "+new c(b.auth).toString("base64")),(0,a.default)(b.headers).forEach(function(x){E.setHeader(x,b.headers[x])});var m,y=!0;if(b.mode==="disable-fetch"||"requestTimeout"in b&&!d.abortController)y=!1,m=!0;else if(b.mode==="prefer-streaming")m=!1;else if(b.mode==="allow-wrong-content-type")m=!d.overrideMimeType;else{if(b.mode&&b.mode!=="default"&&b.mode!=="prefer-fast")throw new Error("Invalid value for opts.mode");m=!0}E._mode=p(m,y),E._fetchTimer=null,E.on("finish",function(){E._onFinish()})};s(v,i.Writable),v.prototype.setHeader=function(b,E){var m=this,y=b.toLowerCase();g.indexOf(y)===-1&&(m._headers[y]={name:b,value:E})},v.prototype.getHeader=function(b){var E=this._headers[b.toLowerCase()];return E?E.value:null},v.prototype.removeHeader=function(b){delete this._headers[b.toLowerCase()]},v.prototype._onFinish=function(){var b=this;if(!b._destroyed){var E=b._opts,m=b._headers,y=null;E.method!=="GET"&&E.method!=="HEAD"&&(y=d.arraybuffer?n(c.concat(b._body)):d.blobConstructor?new C.Blob(b._body.map(function(A){return n(A)}),{type:(m["content-type"]||{}).value||""}):c.concat(b._body).toString());var x=[];if((0,a.default)(m).forEach(function(A){var D=m[A].name,I=m[A].value;Array.isArray(I)?I.forEach(function(B){x.push([D,B])}):x.push([D,I])}),b._mode==="fetch"){var l=null;if(d.abortController){var S=new AbortController;l=S.signal,b._fetchAbortController=S,"requestTimeout"in E&&E.requestTimeout!==0&&(b._fetchTimer=C.setTimeout(function(){b.emit("requestTimeout"),b._fetchAbortController&&b._fetchAbortController.abort()},E.requestTimeout))}C.fetch(b._opts.url,{method:b._opts.method,headers:x,body:y||void 0,mode:"cors",credentials:E.withCredentials?"include":"same-origin",signal:l}).then(function(A){b._fetchResponse=A,b._connect()},function(A){C.clearTimeout(b._fetchTimer),b._destroyed||b.emit("error",A)})}else{var O=b._xhr=new C.XMLHttpRequest;try{O.open(b._opts.method,b._opts.url,!0)}catch(A){return void T.nextTick(function(){b.emit("error",A)})}"responseType"in O&&(O.responseType=b._mode.split(":")[0]),"withCredentials"in O&&(O.withCredentials=!!E.withCredentials),b._mode==="text"&&"overrideMimeType"in O&&O.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in E&&(O.timeout=E.requestTimeout,O.ontimeout=function(){b.emit("requestTimeout")}),x.forEach(function(A){O.setRequestHeader(A[0],A[1])}),b._response=null,O.onreadystatechange=function(){switch(O.readyState){case h.LOADING:case h.DONE:b._onXHRProgress()}},b._mode==="moz-chunked-arraybuffer"&&(O.onprogress=function(){b._onXHRProgress()}),O.onerror=function(){b._destroyed||b.emit("error",new Error("XHR error"))};try{O.send(y)}catch(A){return void T.nextTick(function(){b.emit("error",A)})}}}},v.prototype._onXHRProgress=function(){var b=this;u(b._xhr)&&!b._destroyed&&(b._response||b._connect(),b._response._onXHRProgress())},v.prototype._connect=function(){var b=this;b._destroyed||(b._response=new t(b._xhr,b._fetchResponse,b._mode,b._fetchTimer),b._response.on("error",function(E){b.emit("error",E)}),b.emit("response",b._response))},v.prototype._write=function(b,E,m){this._body.push(b),m()},v.prototype.abort=v.prototype.destroy=function(){var b=this;b._destroyed=!0,C.clearTimeout(b._fetchTimer),b._response&&(b._response._destroyed=!0),b._xhr?b._xhr.abort():b._fetchAbortController&&b._fetchAbortController.abort()},v.prototype.end=function(b,E,m){var y=this;typeof b=="function"&&(m=b,b=void 0),i.Writable.prototype.end.call(y,b,E,m)},v.prototype.flushHeaders=function(){},v.prototype.setTimeout=function(){},v.prototype.setNoDelay=function(){},v.prototype.setSocketKeepAlive=function(){};var g=["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,w("_process"),typeof le!="undefined"?le:typeof self!="undefined"?self:typeof window!="undefined"?window:{},w("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(w,P,_){(function(T,C,c){"use strict";var p=w("babel-runtime/core-js/promise"),u=function(i){return i&&i.__esModule?i:{default:i}}(p),o=w("./capability"),a=w("inherits"),d=w("readable-stream"),s=_.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},f=_.IncomingMessage=function(i,n,t,h){var v=this;if(d.Readable.call(v),v._mode=t,v.headers={},v.rawHeaders=[],v.trailers={},v.rawTrailers=[],v.on("end",function(){T.nextTick(function(){v.emit("close")})}),t==="fetch"){if(v._fetchResponse=n,v.url=n.url,v.statusCode=n.status,v.statusMessage=n.statusText,n.headers.forEach(function(y,x){v.headers[x.toLowerCase()]=y,v.rawHeaders.push(x,y)}),o.writableStream){var g=new WritableStream({write:function(y){return new u.default(function(x,l){v._destroyed?l():v.push(new c(y))?x():v._resumeFetch=x})},close:function(){C.clearTimeout(h),v._destroyed||v.push(null)},abort:function(y){v._destroyed||v.emit("error",y)}});try{return void n.body.pipeTo(g).catch(function(y){C.clearTimeout(h),v._destroyed||v.emit("error",y)})}catch(y){}}var b=n.body.getReader();!function y(){b.read().then(function(x){if(!v._destroyed){if(x.done)return C.clearTimeout(h),void v.push(null);v.push(new c(x.value)),y()}}).catch(function(x){C.clearTimeout(h),v._destroyed||v.emit("error",x)})}()}else if(v._xhr=i,v._pos=0,v.url=i.responseURL,v.statusCode=i.status,v.statusMessage=i.statusText,i.getAllResponseHeaders().split(/\r?\n/).forEach(function(y){var x=y.match(/^([^:]+):\s*(.*)/);if(x){var l=x[1].toLowerCase();l==="set-cookie"?(v.headers[l]===void 0&&(v.headers[l]=[]),v.headers[l].push(x[2])):v.headers[l]!==void 0?v.headers[l]+=", "+x[2]:v.headers[l]=x[2],v.rawHeaders.push(x[1],x[2])}}),v._charset="x-user-defined",!o.overrideMimeType){var E=v.rawHeaders["mime-type"];if(E){var m=E.match(/;\s*charset=([^;])(;|$)/);m&&(v._charset=m[1].toLowerCase())}v._charset||(v._charset="utf-8")}};a(f,d.Readable),f.prototype._read=function(){var i=this,n=i._resumeFetch;n&&(i._resumeFetch=null,n())},f.prototype._onXHRProgress=function(){var i=this,n=i._xhr,t=null;switch(i._mode){case"text:vbarray":if(n.readyState!==s.DONE)break;try{t=new C.VBArray(n.responseBody).toArray()}catch(E){}if(t!==null){i.push(new c(t));break}case"text":try{t=n.responseText}catch(E){i._mode="text:vbarray";break}if(t.length>i._pos){var h=t.substr(i._pos);if(i._charset==="x-user-defined"){for(var v=new c(h.length),g=0;gi._pos&&(i.push(new c(new Uint8Array(b.result.slice(i._pos)))),i._pos=b.result.byteLength)},b.onload=function(){i.push(null)},b.readAsArrayBuffer(t)}i._xhr.readyState===s.DONE&&i._mode!=="ms-stream"&&i.push(null)}}).call(this,w("_process"),typeof le!="undefined"?le:typeof self!="undefined"?self:typeof window!="undefined"?window:{},w("buffer").Buffer)},{"./capability":197,_process:173,"babel-runtime/core-js/promise":24,buffer:38,inherits:162,"readable-stream":188}],200:[function(w,P,_){"use strict";function T(E){if(!E)return"utf8";for(var m;;)switch(E){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 E;default:if(m)return;E=(""+E).toLowerCase(),m=!0}}function C(E){var m=T(E);if(typeof m!="string"&&(g.isEncoding===b||!b(E)))throw new Error("Unknown encoding: "+E);return m||E}function c(E){this.encoding=C(E);var m;switch(this.encoding){case"utf16le":this.text=f,this.end=i,m=4;break;case"utf8":this.fillLast=a,m=4;break;case"base64":this.text=n,this.end=t,m=3;break;default:return this.write=h,void(this.end=v)}this.lastNeed=0,this.lastTotal=0,this.lastChar=g.allocUnsafe(m)}function p(E){return E<=127?0:E>>5==6?2:E>>4==14?3:E>>3==30?4:E>>6==2?-1:-2}function u(E,m,y){var x=m.length-1;if(x=0?(l>0&&(E.lastNeed=l-1),l):--x=0?(l>0&&(E.lastNeed=l-2),l):--x=0?(l>0&&(l===2?l=0:E.lastNeed=l-3),l):0)}function o(E,m,y){if((192&m[0])!=128)return E.lastNeed=0,"\u951F\uFFFD";if(E.lastNeed>1&&m.length>1){if((192&m[1])!=128)return E.lastNeed=1,"\u951F\uFFFD";if(E.lastNeed>2&&m.length>2&&(192&m[2])!=128)return E.lastNeed=2,"\u951F\uFFFD"}}function a(E){var m=this.lastTotal-this.lastNeed,y=o(this,E,m);return y!==void 0?y:this.lastNeed<=E.length?(E.copy(this.lastChar,m,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(E.copy(this.lastChar,m,0,E.length),void(this.lastNeed-=E.length))}function d(E,m){var y=u(this,E,m);if(!this.lastNeed)return E.toString("utf8",m);this.lastTotal=y;var x=E.length-(y-this.lastNeed);return E.copy(this.lastChar,0,x),E.toString("utf8",m,x)}function s(E){var m=E&&E.length?this.write(E):"";return this.lastNeed?m+"\u951F\uFFFD":m}function f(E,m){if((E.length-m)%2==0){var y=E.toString("utf16le",m);if(y){var x=y.charCodeAt(y.length-1);if(x>=55296&&x<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=E[E.length-2],this.lastChar[1]=E[E.length-1],y.slice(0,-1)}return y}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=E[E.length-1],E.toString("utf16le",m,E.length-1)}function i(E){var m=E&&E.length?this.write(E):"";if(this.lastNeed){var y=this.lastTotal-this.lastNeed;return m+this.lastChar.toString("utf16le",0,y)}return m}function n(E,m){var y=(E.length-m)%3;return y===0?E.toString("base64",m):(this.lastNeed=3-y,this.lastTotal=3,y===1?this.lastChar[0]=E[E.length-1]:(this.lastChar[0]=E[E.length-2],this.lastChar[1]=E[E.length-1]),E.toString("base64",m,E.length-y))}function t(E){var m=E&&E.length?this.write(E):"";return this.lastNeed?m+this.lastChar.toString("base64",0,3-this.lastNeed):m}function h(E){return E.toString(this.encoding)}function v(E){return E&&E.length?this.write(E):""}var g=w("safe-buffer").Buffer,b=g.isEncoding||function(E){switch((E=""+E)&&E.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}};_.StringDecoder=c,c.prototype.write=function(E){if(E.length===0)return"";var m,y;if(this.lastNeed){if((m=this.fillLast(E))===void 0)return"";y=this.lastNeed,this.lastNeed=0}else y=0;return y=0&&(s._idleTimeoutId=setTimeout(function(){s._onTimeout&&s._onTimeout()},f))},_.setImmediate=typeof T=="function"?T:function(s){var f=d++,i=!(arguments.length<2)&&o.call(arguments,1);return a[f]=!0,p(function(){a[f]&&(i?s.apply(null,i):s.call(null),_.clearImmediate(f))}),f},_.clearImmediate=typeof C=="function"?C:function(s){delete a[s]}}).call(this,w("timers").setImmediate,w("timers").clearImmediate)},{"process/browser.js":173,timers:201}],202:[function(w,P,_){var T=w("buffer").Buffer;P.exports=function(C){if(C instanceof Uint8Array){if(C.byteOffset===0&&C.byteLength===C.buffer.byteLength)return C.buffer;if(typeof C.buffer.slice=="function")return C.buffer.slice(C.byteOffset,C.byteOffset+C.byteLength)}if(T.isBuffer(C)){for(var c=new Uint8Array(C.length),p=C.length,u=0;u",'"',"`"," ","\r",` `," "],n=["{","}","|","\\","^","`"].concat(i),t=["'"].concat(n),h=["%","/","?",";","#"].concat(t),v=["/","?","#"],g=/^[+a-z0-9A-Z_-]{0,63}$/,b=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,E={javascript:!0,"javascript:":!0},m={javascript:!0,"javascript:":!0},y={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},x=w("querystring");T.prototype.parse=function(l,S,O){if(!a.isString(l))throw new TypeError("Parameter 'url' must be a string, not "+typeof l);var A=l.indexOf("?"),D=A!==-1&&A127?_e+="x":_e+=be[Ke];if(!_e.match(g)){var Be=Se.slice(0,$),ze=Se.slice($+1),ye=be.match(b);ye&&(Be.push(ye[1]),ze.unshift(ye[2])),ze.length&&(H="/"+ze.join(".")+H),this.hostname=Be.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),Ce||(this.hostname=o.toASCII(this.hostname));var pe=this.port?":"+this.port:"",We=this.hostname||"";this.host=We+pe,this.href+=this.host,Ce&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),H[0]!=="/"&&(H="/"+H))}if(!E[V])for(var $=0,De=t.length;$0)&&O.host.split("@");_e&&(O.auth=_e.shift(),O.host=O.hostname=_e.shift())}return O.search=l.search,O.query=l.query,a.isNull(O.pathname)&&a.isNull(O.search)||(O.path=(O.pathname?O.pathname:"")+(O.search?O.search:"")),O.href=O.format(),O}if(!Se.length)return O.pathname=null,O.search?O.path="/"+O.search:O.path=null,O.href=O.format(),O;for(var Ke=Se.slice(-1)[0],Ne=(O.host||l.host||Se.length>1)&&(Ke==="."||Ke==="..")||Ke==="",Be=0,ze=Se.length;ze>=0;ze--)Ke=Se[ze],Ke==="."?Se.splice(ze,1):Ke===".."?(Se.splice(ze,1),Be++):Be&&(Se.splice(ze,1),Be--);if(!de&&!Ce)for(;Be--;Be)Se.unshift("..");!de||Se[0]===""||Se[0]&&Se[0].charAt(0)==="/"||Se.unshift(""),Ne&&Se.join("/").substr(-1)!=="/"&&Se.push("");var ye=Se[0]===""||Se[0]&&Se[0].charAt(0)==="/";if(be){O.hostname=O.host=ye?"":Se.length?Se.shift():"";var _e=!!(O.host&&O.host.indexOf("@")>0)&&O.host.split("@");_e&&(O.auth=_e.shift(),O.host=O.hostname=_e.shift())}return de=de||O.host&&Se.length,de&&!ye&&Se.unshift(""),Se.length?O.pathname=Se.join("/"):(O.pathname=null,O.path=null),a.isNull(O.pathname)&&a.isNull(O.search)||(O.path=(O.pathname?O.pathname:"")+(O.search?O.search:"")),O.auth=l.auth||O.auth,O.slashes=O.slashes||l.slashes,O.href=O.format(),O},T.prototype.parseHost=function(){var l=this.host,S=s.exec(l);S&&(S=S[0],S!==":"&&(this.port=S.substr(1)),l=l.substr(0,l.length-S.length)),l&&(this.hostname=l)}},{"./util":204,punycode:174,querystring:177}],204:[function(w,P,_){"use strict";P.exports={isString:function(T){return typeof T=="string"},isObject:function(T){return typeof T=="object"&&T!==null},isNull:function(T){return T===null},isNullOrUndefined:function(T){return T==null}}},{}],205:[function(w,P,_){(function(T){function C(p,u){function o(){if(!a){if(c("throwDeprecation"))throw new Error(u);c("traceDeprecation")?console.trace(u):console.warn(u),a=!0}return p.apply(this,arguments)}if(c("noDeprecation"))return p;var a=!1;return o}function c(p){try{if(!T.localStorage)return!1}catch(o){return!1}var u=T.localStorage[p];return u!=null&&String(u).toLowerCase()==="true"}P.exports=C}).call(this,typeof le!="undefined"?le:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],206:[function(w,P,_){P.exports=function(T){return T&&typeof T=="object"&&typeof T.copy=="function"&&typeof T.fill=="function"&&typeof T.readUInt8=="function"}},{}],207:[function(w,P,_){(function(T,C){function c($,ee){var ce={seen:[],stylize:u};return arguments.length>=3&&(ce.depth=arguments[2]),arguments.length>=4&&(ce.colors=arguments[3]),h(ee)?ce.showHidden=ee:ee&&_._extend(ce,ee),y(ce.showHidden)&&(ce.showHidden=!1),y(ce.depth)&&(ce.depth=2),y(ce.colors)&&(ce.colors=!1),y(ce.customInspect)&&(ce.customInspect=!0),ce.colors&&(ce.stylize=p),a(ce,$,ce.depth)}function p($,ee){var ce=c.styles[ee];return ce?"["+c.colors[ce][0]+"m"+$+"["+c.colors[ce][1]+"m":$}function u($,ee){return $}function o($){var ee={};return $.forEach(function(ce,de){ee[ce]=!0}),ee}function a($,ee,ce){if($.customInspect&&ee&&A(ee.inspect)&&ee.inspect!==_.inspect&&(!ee.constructor||ee.constructor.prototype!==ee)){var de=ee.inspect(ce,$);return E(de)||(de=a($,de,ce)),de}var Ce=d($,ee);if(Ce)return Ce;var Se=Object.keys(ee),De=o(Se);if($.showHidden&&(Se=Object.getOwnPropertyNames(ee)),O(ee)&&(Se.indexOf("message")>=0||Se.indexOf("description")>=0))return s(ee);if(Se.length===0){if(A(ee)){var be=ee.name?": "+ee.name:"";return $.stylize("[Function"+be+"]","special")}if(x(ee))return $.stylize(RegExp.prototype.toString.call(ee),"regexp");if(S(ee))return $.stylize(Date.prototype.toString.call(ee),"date");if(O(ee))return s(ee)}var _e="",Ke=!1,Ne=["{","}"];if((t(ee)&&(Ke=!0,Ne=["[","]"]),A(ee))&&(_e=" [Function"+(ee.name?": "+ee.name:"")+"]"),x(ee)&&(_e=" "+RegExp.prototype.toString.call(ee)),S(ee)&&(_e=" "+Date.prototype.toUTCString.call(ee)),O(ee)&&(_e=" "+s(ee)),Se.length===0&&(!Ke||ee.length==0))return Ne[0]+_e+Ne[1];if(ce<0)return x(ee)?$.stylize(RegExp.prototype.toString.call(ee),"regexp"):$.stylize("[Object]","special");$.seen.push(ee);var Be;return Be=Ke?f($,ee,ce,De,Se):Se.map(function(ze){return i($,ee,ce,De,ze,Ke)}),$.seen.pop(),n(Be,_e,Ne)}function d($,ee){if(y(ee))return $.stylize("undefined","undefined");if(E(ee)){var ce="'"+JSON.stringify(ee).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return $.stylize(ce,"string")}return b(ee)?$.stylize(""+ee,"number"):h(ee)?$.stylize(""+ee,"boolean"):v(ee)?$.stylize("null","null"):void 0}function s($){return"["+Error.prototype.toString.call($)+"]"}function f($,ee,ce,de,Ce){for(var Se=[],De=0,be=ee.length;De-1&&(be=Se?be.split(` `).map(function(Ke){return" "+Ke}).join(` `).substr(2):` `+be.split(` `).map(function(Ke){return" "+Ke}).join(` `))):be=$.stylize("[Circular]","special")),y(De)){if(Se&&Ce.match(/^\d+$/))return be;De=JSON.stringify(""+Ce),De.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(De=De.substr(1,De.length-2),De=$.stylize(De,"name")):(De=De.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),De=$.stylize(De,"string"))}return De+": "+be}function n($,ee,ce){var de=0;return $.reduce(function(Ce,Se){return de++,Se.indexOf(` `)>=0&&de++,Ce+Se.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?ce[0]+(ee===""?"":ee+` `)+" "+$.join(`, `)+" "+ce[1]:ce[0]+ee+" "+$.join(", ")+" "+ce[1]}function t($){return Array.isArray($)}function h($){return typeof $=="boolean"}function v($){return $===null}function g($){return $==null}function b($){return typeof $=="number"}function E($){return typeof $=="string"}function m($){return typeof $=="symbol"}function y($){return $===void 0}function x($){return l($)&&I($)==="[object RegExp]"}function l($){return typeof $=="object"&&$!==null}function S($){return l($)&&I($)==="[object Date]"}function O($){return l($)&&(I($)==="[object Error]"||$ instanceof Error)}function A($){return typeof $=="function"}function D($){return $===null||typeof $=="boolean"||typeof $=="number"||typeof $=="string"||typeof $=="symbol"||$===void 0}function I($){return Object.prototype.toString.call($)}function B($){return $<10?"0"+$.toString(10):$.toString(10)}function H(){var $=new Date,ee=[B($.getHours()),B($.getMinutes()),B($.getSeconds())].join(":");return[$.getDate(),ne[$.getMonth()],ee].join(" ")}function te($,ee){return Object.prototype.hasOwnProperty.call($,ee)}var W=/%[sdj%]/g;_.format=function($){if(!E($)){for(var ee=[],ce=0;ce=Ce)return _e;switch(_e){case"%s":return String(de[ce++]);case"%d":return Number(de[ce++]);case"%j":try{return JSON.stringify(de[ce++])}catch(Ke){return"[Circular]"}default:return _e}}),De=de[ce];ce=0||n.indexOf(">")>=0||n.indexOf("<")>=0)},f=function(n){return""},d=function(n){return n.replace("]]>","]]]]>")},_.Builder=function(){function n(t){var h,v,g;this.options={},v=a[.2];for(h in v)i.call(v,h)&&(g=v[h],this.options[h]=g);for(h in t)i.call(t,h)&&(g=t[h],this.options[h]=g)}return n.prototype.buildObject=function(t){var h,v,g,b,E;return h=this.options.attrkey,v=this.options.charkey,(0,u.default)(t).length===1&&this.options.rootName===a[.2].rootName?(E=(0,u.default)(t)[0],t=t[E]):E=this.options.rootName,g=function(m){return function(y,x){var l,S,O,A,D,I;if((x===void 0?"undefined":(0,c.default)(x))!=="object")m.options.cdata&&s(x)?y.raw(f(x)):y.txt(x);else if(Array.isArray(x)){for(A in x)if(i.call(x,A)){S=x[A];for(D in S)O=S[D],y=g(y.ele(D),O).up()}}else for(D in x)if(i.call(x,D))if(S=x[D],D===h){if((S===void 0?"undefined":(0,c.default)(S))==="object")for(l in S)I=S[l],y=y.att(l,I)}else if(D===v)y=m.options.cdata&&s(S)?y.raw(f(S)):y.txt(S);else if(Array.isArray(S))for(A in S)i.call(S,A)&&(O=S[A],y=typeof O=="string"?m.options.cdata&&s(O)?y.ele(D).raw(f(O)).up():y.ele(D,O).up():g(y.ele(D),O).up());else(S===void 0?"undefined":(0,c.default)(S))==="object"?y=g(y.ele(D),S).up():typeof S=="string"&&m.options.cdata&&s(S)?y=y.ele(D).raw(f(S)).up():(S==null&&(S=""),y=y.ele(D,S.toString()).up());return y}}(this),b=o.create(E,this.options.xmldec,this.options.doctype,{headless:this.options.headless,allowSurrogateChars:this.options.allowSurrogateChars}),g(b,t).end(this.options.renderOpts)},n}()}).call(void 0)},{"./defaults":210,"babel-runtime/core-js/object/keys":23,"babel-runtime/helpers/typeof":32,xmlbuilder:235}],210:[function(w,P,_){"use strict";(function(){_.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(w,P,_){"use strict";function T(d){return d&&d.__esModule?d:{default:d}}var C=w("babel-runtime/core-js/object/get-own-property-names"),c=T(C),p=w("babel-runtime/core-js/object/keys"),u=T(p),o=w("babel-runtime/helpers/typeof"),a=T(o);(function(){var d,s,f,i,n,t,h,v,g=function(m,y){return function(){return m.apply(y,arguments)}},b=function(m,y){function x(){this.constructor=m}for(var l in y)E.call(y,l)&&(m[l]=y[l]);return x.prototype=y.prototype,m.prototype=new x,m.__super__=y.prototype,m},E={}.hasOwnProperty;h=w("sax"),f=w("events"),d=w("./bom"),t=w("./processors"),v=w("timers").setImmediate,s=w("./defaults").defaults,i=function(m){return(m===void 0?"undefined":(0,a.default)(m))==="object"&&m!=null&&(0,u.default)(m).length===0},n=function(m,y,x){var l,S,O;for(l=0,S=m.length;l0&&(H[A.options.childkey]=W),W=H;return O.length>0?A.assignOrPush(ne,te,W):(A.options.explicitRoot&&(X=W,W={},W[te]=X),A.resultObject=W,A.saxParser.ended=!0,A.emit("end",A.resultObject))}}(this),S=function(A){return function(D){var I,B;if(B=O[O.length-1])return B[l]+=D,A.options.explicitChildren&&A.options.preserveChildrenOrder&&A.options.charsAsChildren&&(A.options.includeWhiteChars||D.replace(/\\n/g,"").trim()!=="")&&(B[A.options.childkey]=B[A.options.childkey]||[],I={"#name":"__text__"},I[l]=D,A.options.normalize&&(I[l]=I[l].replace(/\s{2,}/g," ").trim()),B[A.options.childkey].push(I)),B}}(this),this.saxParser.ontext=S,this.saxParser.oncdata=function(A){return function(D){var I;if(I=S(D))return I.cdata=!0}}()},y.prototype.parseString=function(x,l){var S;l!=null&&typeof l=="function"&&(this.on("end",function(O){return this.reset(),l(null,O)}),this.on("error",function(O){return this.reset(),l(O)}));try{return x=x.toString(),x.trim()===""?(this.emit("end",null),!0):(x=d.stripBOM(x),this.options.async?(this.remaining=x,v(this.processAsync),this.saxParser):this.saxParser.write(x).close())}catch(O){if(S=O,!this.saxParser.errThrown&&!this.saxParser.ended)return this.emit("error",S),this.saxParser.errThrown=!0;if(this.saxParser.ended)throw S}},y}(f.EventEmitter),_.parseString=function(m,y,x){var l,S,O;return x!=null?(typeof x=="function"&&(l=x),(y===void 0?"undefined":(0,a.default)(y))==="object"&&(S=y)):(typeof y=="function"&&(l=y),S={}),O=new _.Parser(S),O.parseString(m,l)}}).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(w,P,_){"use strict";(function(){var T;T=new RegExp(/(?!xmlns)^.*:/),_.normalize=function(C){return C.toLowerCase()},_.firstCharLowerCase=function(C){return C.charAt(0).toLowerCase()+C.slice(1)},_.stripPrefix=function(C){return C.replace(T,"")},_.parseNumbers=function(C){return isNaN(C)||(C=C%1==0?parseInt(C,10):parseFloat(C)),C},_.parseBooleans=function(C){return/^(?:true|false)$/i.test(C)&&(C=C.toLowerCase()==="true"),C}}).call(void 0)},{}],213:[function(w,P,_){"use strict";(function(){var T,C,c,p,u=function(a,d){function s(){this.constructor=a}for(var f in d)o.call(d,f)&&(a[f]=d[f]);return s.prototype=d.prototype,a.prototype=new s,a.__super__=d.prototype,a},o={}.hasOwnProperty;C=w("./defaults"),T=w("./builder"),c=w("./parser"),p=w("./processors"),_.defaults=C.defaults,_.processors=p,_.ValidationError=function(a){function d(s){this.message=s}return u(d,a),d}(Error),_.Builder=T.Builder,_.Parser=c.Parser,_.parseString=c.parseString}).call(void 0)},{"./builder":209,"./defaults":210,"./parser":211,"./processors":212}],214:[function(w,P,_){"use strict";function T(d){return d&&d.__esModule?d:{default:d}}var C=w("babel-runtime/core-js/object/get-prototype-of"),c=T(C),p=w("babel-runtime/helpers/typeof"),u=T(p),o=w("babel-runtime/core-js/object/assign"),a=T(o);(function(){var d,s,f,i,n,t,h=[].slice,v={}.hasOwnProperty;d=function(){var g,b,E,m,y,x;if(x=arguments[0],y=2<=arguments.length?h.call(arguments,1):[],i(a.default))a.default.apply(null,arguments);else for(g=0,E=y.length;g=0;)this.up();return this.onEnd()},x.prototype.openCurrent=function(){if(this.currentNode)return this.currentNode.children=!0,this.openNode(this.currentNode)},x.prototype.openNode=function(l){if(!l.isOpen)return!this.root&&this.currentLevel===0&&l instanceof f&&(this.root=l),this.onData(this.writer.openNode(l,this.currentLevel)),l.isOpen=!0},x.prototype.closeNode=function(l){if(!l.isClosed)return this.onData(this.writer.closeNode(l,this.currentLevel)),l.isClosed=!0},x.prototype.onData=function(l){return this.documentStarted=!0,this.onDataCallback(l)},x.prototype.onEnd=function(){return this.documentCompleted=!0,this.onEndCallback()},x.prototype.ele=function(){return this.element.apply(this,arguments)},x.prototype.nod=function(l,S,O){return this.node(l,S,O)},x.prototype.txt=function(l){return this.text(l)},x.prototype.dat=function(l){return this.cdata(l)},x.prototype.com=function(l){return this.comment(l)},x.prototype.ins=function(l,S){return this.instruction(l,S)},x.prototype.dec=function(l,S,O){return this.declaration(l,S,O)},x.prototype.dtd=function(l,S,O){return this.doctype(l,S,O)},x.prototype.e=function(l,S,O){return this.element(l,S,O)},x.prototype.n=function(l,S,O){return this.node(l,S,O)},x.prototype.t=function(l){return this.text(l)},x.prototype.d=function(l){return this.cdata(l)},x.prototype.c=function(l){return this.comment(l)},x.prototype.r=function(l){return this.raw(l)},x.prototype.i=function(l,S){return this.instruction(l,S)},x.prototype.att=function(){return this.currentNode&&this.currentNode instanceof s?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},x.prototype.a=function(){return this.currentNode&&this.currentNode instanceof s?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},x.prototype.ent=function(l,S){return this.entity(l,S)},x.prototype.pent=function(l,S){return this.pEntity(l,S)},x.prototype.not=function(l,S){return this.notation(l,S)},x}()}).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(w,P,_){"use strict";var T=w("babel-runtime/core-js/object/create"),C=function(c){return c&&c.__esModule?c:{default:c}}(T);(function(){var c,p,u,o,a,d=function(f,i){function n(){this.constructor=f}for(var t in i)s.call(i,t)&&(f[t]=i[t]);return n.prototype=i.prototype,f.prototype=new n,f.__super__=i.prototype,f},s={}.hasOwnProperty;a=w("./Utility"),o=a.isObject,u=a.isFunction,p=w("./XMLNode"),c=w("./XMLAttribute"),P.exports=function(f){function i(n,t,h){if(i.__super__.constructor.call(this,n),t==null)throw new Error("Missing element name");this.name=this.stringify.eleName(t),this.attributes={},h!=null&&this.attribute(h),n.isDocument&&(this.isRoot=!0,this.documentObject=n,n.rootObject=this)}return d(i,f),i.prototype.clone=function(){var n,t,h,v;h=(0,C.default)(this),h.isRoot&&(h.documentObject=null),h.attributes={},v=this.attributes;for(t in v)s.call(v,t)&&(n=v[t],h.attributes[t]=n.clone());return h.children=[],this.children.forEach(function(g){var b;return b=g.clone(),b.parent=h,h.children.push(b)}),h},i.prototype.attribute=function(n,t){var h,v;if(n!=null&&(n=n.valueOf()),o(n))for(h in n)s.call(n,h)&&(v=n[h],this.attribute(h,v));else u(t)&&(t=t.apply()),this.options.skipNullAttributes&&t==null||(this.attributes[n]=new c(this,n,t));return this},i.prototype.removeAttribute=function(n){var t,h,v;if(n==null)throw new Error("Missing attribute name");if(n=n.valueOf(),Array.isArray(n))for(h=0,v=n.length;h"+this.endline(E))},b.prototype.comment=function(E,m){return this.stream.write(this.space(m)+""+this.endline(E))},b.prototype.declaration=function(E,m){return this.stream.write(this.space(m)),this.stream.write('"),this.stream.write(this.endline(E))},b.prototype.docType=function(E,m){var y,x,l,S;if(m||(m=0),this.stream.write(this.space(m)),this.stream.write("0){for(this.stream.write(" ["),this.stream.write(this.endline(E)),S=E.children,x=0,l=S.length;x"),this.stream.write(this.endline(E))},b.prototype.element=function(E,m){var y,x,l,S,O,A,D,I;m||(m=0),I=this.space(m),this.stream.write(I+"<"+E.name),A=E.attributes;for(O in A)v.call(A,O)&&(y=A[O],this.attribute(y));if(E.children.length===0||E.children.every(function(B){return B.value===""}))this.allowEmpty?this.stream.write(">"):this.stream.write(this.spacebeforeslash+"/>");else if(this.pretty&&E.children.length===1&&E.children[0].value!=null)this.stream.write(">"),this.stream.write(E.children[0].value),this.stream.write("");else{for(this.stream.write(">"+this.newline),D=E.children,l=0,S=D.length;l")}return this.stream.write(this.endline(E))},b.prototype.processingInstruction=function(E,m){return this.stream.write(this.space(m)+""+this.endline(E))},b.prototype.raw=function(E,m){return this.stream.write(this.space(m)+E.value+this.endline(E))},b.prototype.text=function(E,m){return this.stream.write(this.space(m)+E.value+this.endline(E))},b.prototype.dtdAttList=function(E,m){return this.stream.write(this.space(m)+""+this.endline(E))},b.prototype.dtdElement=function(E,m){return this.stream.write(this.space(m)+""+this.endline(E))},b.prototype.dtdEntity=function(E,m){return this.stream.write(this.space(m)+""+this.endline(E))},b.prototype.dtdNotation=function(E,m){return this.stream.write(this.space(m)+""+this.endline(E))},b.prototype.endline=function(E){return E.isLastRootNode?"":this.newline},b}(t)}).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(w,P,_){"use strict";(function(){var T,C,c,p,u,o,a,d,s,f,i,n,t,h=function(g,b){function E(){this.constructor=g}for(var m in b)v.call(b,m)&&(g[m]=b[m]);return E.prototype=b.prototype,g.prototype=new E,g.__super__=b.prototype,g},v={}.hasOwnProperty;a=w("./XMLDeclaration"),d=w("./XMLDocType"),T=w("./XMLCData"),C=w("./XMLComment"),s=w("./XMLElement"),i=w("./XMLRaw"),n=w("./XMLText"),f=w("./XMLProcessingInstruction"),c=w("./XMLDTDAttList"),p=w("./XMLDTDElement"),u=w("./XMLDTDEntity"),o=w("./XMLDTDNotation"),t=w("./XMLWriterBase"),P.exports=function(g){function b(E){b.__super__.constructor.call(this,E)}return h(b,g),b.prototype.document=function(E){var m,y,x,l,S;for(this.textispresent=!1,l="",S=E.children,y=0,x=S.length;y"+this.newline},b.prototype.comment=function(E,m){return this.space(m)+""+this.newline},b.prototype.declaration=function(E,m){var y;return y=this.space(m),y+='",y+=this.newline},b.prototype.docType=function(E,m){var y,x,l,S,O;if(m||(m=0),S=this.space(m),S+="0){for(S+=" [",S+=this.newline,O=E.children,x=0,l=O.length;x",S+=this.newline},b.prototype.element=function(E,m){var y,x,l,S,O,A,D,I,B,H,te,W,V;m||(m=0),V=!1,this.textispresent?(this.newline="",this.pretty=!1):(this.newline=this.newlinedefault,this.pretty=this.prettydefault),W=this.space(m),I="",I+=W+"<"+E.name,B=E.attributes;for(D in B)v.call(B,D)&&(y=B[D],I+=this.attribute(y));if(E.children.length===0||E.children.every(function(X){return X.value===""}))this.allowEmpty?I+=">"+this.newline:I+=this.spacebeforeslash+"/>"+this.newline;else if(this.pretty&&E.children.length===1&&E.children[0].value!=null)I+=">",I+=E.children[0].value,I+=""+this.newline;else{if(this.dontprettytextnodes){for(H=E.children,l=0,O=H.length;l"+this.newline,te=E.children,S=0,A=te.length;S"+this.newline}return I},b.prototype.processingInstruction=function(E,m){var y;return y=this.space(m)+""+this.newline},b.prototype.raw=function(E,m){return this.space(m)+E.value+this.newline},b.prototype.text=function(E,m){return this.space(m)+E.value+this.newline},b.prototype.dtdAttList=function(E,m){var y;return y=this.space(m)+""+this.newline},b.prototype.dtdElement=function(E,m){return this.space(m)+""+this.newline},b.prototype.dtdEntity=function(E,m){var y;return y=this.space(m)+""+this.newline},b.prototype.dtdNotation=function(E,m){var y;return y=this.space(m)+""+this.newline},b.prototype.openNode=function(E,m){var y,x,l,S;if(m||(m=0),E instanceof s){l=this.space(m)+"<"+E.name,S=E.attributes;for(x in S)v.call(S,x)&&(y=S[x],l+=this.attribute(y));return l+=(E.children?">":"/>")+this.newline}return l=this.space(m)+"")+this.newline},b.prototype.closeNode=function(E,m){switch(m||(m=0),!1){case!(E instanceof s):return this.space(m)+""+this.newline;case!(E instanceof d):return this.space(m)+"]>"+this.newline}},b}(t)}).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(w,P,_){"use strict";(function(){var T=function(c,p){return function(){return c.apply(p,arguments)}},C={}.hasOwnProperty;P.exports=function(){function c(p){this.assertLegalChar=T(this.assertLegalChar,this);var u,o,a;p||(p={}),this.noDoubleEncoding=p.noDoubleEncoding,o=p.stringify||{};for(u in o)C.call(o,u)&&(a=o[u],this[u]=a)}return c.prototype.eleName=function(p){return p=""+p||"",this.assertLegalChar(p)},c.prototype.eleText=function(p){return p=""+p||"",this.assertLegalChar(this.elEscape(p))},c.prototype.cdata=function(p){return p=""+p||"",p=p.replace("]]>","]]]]>"),this.assertLegalChar(p)},c.prototype.comment=function(p){if(p=""+p||"",p.match(/--/))throw new Error("Comment text cannot contain double-hypen: "+p);return this.assertLegalChar(p)},c.prototype.raw=function(p){return""+p||""},c.prototype.attName=function(p){return p=""+p||""},c.prototype.attValue=function(p){return p=""+p||"",this.attEscape(p)},c.prototype.insTarget=function(p){return""+p||""},c.prototype.insValue=function(p){if(p=""+p||"",p.match(/\?>/))throw new Error("Invalid processing instruction value: "+p);return p},c.prototype.xmlVersion=function(p){if(p=""+p||"",!p.match(/1\.[0-9]+/))throw new Error("Invalid version number: "+p);return p},c.prototype.xmlEncoding=function(p){if(p=""+p||"",!p.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/))throw new Error("Invalid encoding: "+p);return p},c.prototype.xmlStandalone=function(p){return p?"yes":"no"},c.prototype.dtdPubID=function(p){return""+p||""},c.prototype.dtdSysID=function(p){return""+p||""},c.prototype.dtdElementValue=function(p){return""+p||""},c.prototype.dtdAttType=function(p){return""+p||""},c.prototype.dtdAttDefault=function(p){return p!=null?""+p||"":p},c.prototype.dtdEntityValue=function(p){return""+p||""},c.prototype.dtdNData=function(p){return""+p||""},c.prototype.convertAttKey="@",c.prototype.convertPIKey="?",c.prototype.convertTextKey="#text",c.prototype.convertCDataKey="#cdata",c.prototype.convertCommentKey="#comment",c.prototype.convertRawKey="#raw",c.prototype.assertLegalChar=function(p){var u;if(u=p.match(/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/))throw new Error("Invalid character in string: "+p+" at index "+u.index);return p},c.prototype.elEscape=function(p){var u;return u=this.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,p.replace(u,"&").replace(//g,">").replace(/\r/g," ")},c.prototype.attEscape=function(p){var u;return u=this.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,p.replace(u,"&").replace(/0?new Array(p).join(this.indent):""):""},C}()}).call(void 0)},{}],235:[function(w,P,_){"use strict";(function(){var T,C,c,p,u,o,a;a=w("./Utility"),u=a.assign,o=a.isFunction,T=w("./XMLDocument"),C=w("./XMLDocumentCB"),p=w("./XMLStringWriter"),c=w("./XMLStreamWriter"),P.exports.create=function(d,s,f,i){var n,t;if(d==null)throw new Error("Root element needs a name");return i=u({},s,f,i),n=new T(i),t=n.element(d),i.headless||(n.declaration(i),i.pubID==null&&i.sysID==null||n.doctype(i)),t},P.exports.begin=function(d,s,f){var i;return o(d)&&(i=[d,s],s=i[0],f=i[1],d={}),s?new C(d,s,f):new T(d)},P.exports.stringWriter=function(d){return new p(d)},P.exports.streamWriter=function(d,s){return new c(d,s)}}).call(void 0)},{"./Utility":214,"./XMLDocument":224,"./XMLDocumentCB":225,"./XMLStreamWriter":230,"./XMLStringWriter":231}],236:[function(w,P,_){function T(){for(var c={},p=0;ps?n=i(n):n.length>5]|=128<>>9<<4)]=i;for(var n=1732584193,t=-271733879,h=-1732584194,v=271733878,g=0;g>16)+(i>>16)+(n>>16)<<16|65535&n}function d(f,i){return f<>>32-i}var s=w("./helpers");P.exports=function(f){return s.hash(f,T,16)}},{"./helpers":238}],240:[function(w,P,_){"use strict";function T(a,d){a[d>>5]|=128<<24-d%32,a[15+(d+64>>9<<4)]=d;for(var s=Array(80),f=1732584193,i=-271733879,n=-1732584194,t=271733878,h=-1009589776,v=0;v>16)+(d>>16)+(s>>16)<<16|65535&s}function u(a,d){return a<>>32-d}var o=w("./helpers");P.exports=function(a){return o.hash(a,T,20,!0)}},{"./helpers":238}],241:[function(w,P,_){"use strict";var T=w("./helpers"),C=function(n,t){var h=(65535&n)+(65535&t);return(n>>16)+(t>>16)+(h>>16)<<16|65535&h},c=function(n,t){return n>>>t|n<<32-t},p=function(n,t){return n>>>t},u=function(n,t,h){return n&t^~n&h},o=function(n,t,h){return n&t^n&h^t&h},a=function(n){return c(n,2)^c(n,13)^c(n,22)},d=function(n){return c(n,6)^c(n,11)^c(n,25)},s=function(n){return c(n,7)^c(n,18)^p(n,3)},f=function(n){return c(n,17)^c(n,19)^p(n,10)},i=function(n,t){var h,v,g,b,E,m,y,x,l,S,O,A,D=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),I=new Array(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225),B=new Array(64);n[t>>5]|=128<<24-t%32,n[15+(t+64>>9<<4)]=t;for(var l=0;l=0)return v("Request#%d %s: got digest auth header WWW-Authenticate: %s",X,x,Ae),l.headers=l.headers||{},l.headers.Authorization=digestAuthHeader(be.method,be.path,Ae,l.digestAuth),v("Request#%d %s: auth with digest header: %s",X,x,l.headers.Authorization),Ie.headers["set-cookie"]&&(l.headers.Cookie=Ie.headers["set-cookie"].join(";")),_.requestWithCallback(x,l,Me)}var Le=Date.now()-ee;Ue&&(Ue.contentDownload=Le),v("[%sms] done, %s bytes HTTP %s %s %s %s, keepAliveSocket: %s, timing: %j",Le,Y,J,be.method,be.host,be.path,q,Ue);var Te={status:J,statusCode:J,headers:Ee,size:Y,aborted:xe,rt:Le,keepAliveSocket:q,data:Fe,requestUrls:l.requestUrls,timing:Ue,remoteAddress:ke,remotePort:dt};if(Xe){var Ze="";Se&&typeof Se.getCurrentStatus=="function"&&(Ze=", agent status: "+(0,d.default)(Se.getCurrentStatus())),Xe.message+=", "+be.method+" "+x+" "+J+" (connected: "+U+", keepalive socket: "+q+Ze+`) headers: `+(0,d.default)(Ee),Xe.data=Fe,Xe.path=be.path,Xe.status=J,Xe.headers=Ee,Xe.res=Te}Me(Xe,Fe,l.streaming?Ie:Te),l.emitter&&(ne.url=x,ne.socket=Qe&&Qe.connection,ne.options=be,ne.size=We,l.emitter.emit("response",{requestId:X,error:Xe,ctx:l.ctx,req:ne,res:Te}))}function I(Xe){var Fe=null;if(l.followRedirect&&statuses.redirect[Xe.statusCode]){l._followRedirectCount=(l._followRedirectCount||0)+1;var Ie=Xe.headers.location;if(Ie){if(!(l._followRedirectCount>l.maxRedirects)){var Me=l.formatRedirectUrl?l.formatRedirectUrl(x,Ie):n.resolve(x,Ie);v("Request#%d %s: `redirected` from %s to %s",X,be.path,x,Me),A(),l.headers&&l.headers.Host&&m.test(Ie)&&(l.headers.Host=null);var Ee=S;return S=null,_.requestWithCallback(Me,l,Ee),{redirect:!0,error:null}}Fe=new Error("Exceeded maxRedirects. Probably stuck in a redirect loop "+x),Fe.name="MaxRedirectError"}else Fe=new Error("Got statusCode "+Xe.statusCode+" but cannot resolve next location from headers"),Fe.name="FollowRedirectError"}return{redirect:!1,error:Fe}}function B(Xe,Fe,Ie){return Ie(null,Fe,Xe.headers["content-encoding"])}function H(Xe){if(Ue&&(Ue.waiting=Date.now()-ee),v("Request#%d %s `req response` event emit: status %d, headers: %j",X,x,Xe.statusCode,Xe.headers),l.streaming){var Fe=I(Xe);return Fe.redirect?void Xe.resume():Fe.error?(Xe.resume(),D(Fe.error,null,Xe)):D(null,null,Xe)}if(Xe.on("close",function(){v("Request#%d %s: `res close` event emit, total size %d",X,x,Y)}),Xe.on("error",function(){v("Request#%d %s: `res error` event emit, total size %d",X,x,Y)}),Xe.on("aborted",function(){xe=!0,v("Request#%d %s: `res aborted` event emit, total size %d",X,x,Y)}),je){var Fe=I(Xe);return Fe.redirect?void Xe.resume():Fe.error?(Xe.resume(),je.end(),D(Fe.error,null,Xe)):(l.consumeWriteStream===!1?Xe.on("end",D.bind(null,null,null,Xe)):isNode010||isNode012?first([[je,"close"],[Xe,"aborted"]],function(Ee,Ae,Le){v("Request#%d %s: writeStream or res %s event emitted",X,x,Le),D(k||null,null,Xe)}):je.on("close",function(){v("Request#%d %s: writeStream close event emitted",X,x),D(k||null,null,Xe)}),Xe.pipe(je))}var Ie=[];Xe.on("data",function(Me){v("Request#%d %s: `res data` event emit, size %d",X,x,Me.length),Y+=Me.length,Ie.push(Me)}),Xe.on("end",function(){var Me=C.concat(Ie,Y);if(v("Request#%d %s: `res end` event emit, total size %d, _dumped: %s",X,x,Y,Xe._dumped),k)return D(k,Me,Xe);var Ee=I(Xe);if(Ee.error)return D(Ee.error,Me,Xe);Ee.redirect||B(Xe,Me,function(Ae,Le,Te){if(Ae)return D(Ae,Me,Xe);if(!Te&&y.indexOf(l.dataType)>=0){try{Le=decodeBodyByCharset(Le,Xe)}catch(ut){return v("decodeBodyByCharset error: %s",ut),D(null,Le,Xe)}if(l.dataType==="json")if(Y===0)Le=null;else{var Ze=parseJSON(Le,De);Ze.error?Ae=Ze.error:Le=Ze.data}}xe&&v("Request#%d %s: Remote socket was terminated before `response.end()` was called",X,x),D(Ae,Le,Xe)})})}function te(){v("Response timer ticking, timeout: %d",mt),re=setTimeout(function(){re=null;var Xe="Response timeout for "+mt+"ms";k=new Error(Xe),k.name="ResponseTimeoutError",k.requestId=X,v("ResponseTimeout: Request#%d %s %s: %s, connected: %s",X,x,k.name,Xe,U),W()},mt)}function W(){v("Request#%d %s abort, connected: %s",X,x,U),Qe.socket||(k.noSocket=!0,D(k)),Qe.abort()}if(!x||typeof x!="string"&&(x===void 0?"undefined":(0,f.default)(x))!=="object"){var V=i.format("expect request url to be a string or a http request options, but got %j",x);throw new Error(V)}arguments.length===2&&typeof l=="function"&&(S=l,l=null),l=l||{},b>=E&&(b=0);var X=++b;l.requestUrls=l.requestUrls||[];var ne={requestId:X,url:x,args:l,ctx:l.ctx};l.emitter&&l.emitter.emit("request",ne),l.timeout=l.timeout||_.TIMEOUTS,l.maxRedirects=l.maxRedirects||10,l.streaming=l.streaming||l.customResponse;var $,ee=Date.now();typeof x=="string"?(m.test(x)||(x="http://"+x),$=n.parse(x)):$=x;var ce=(l.type||l.method||$.method||"GET").toUpperCase(),de=$.port||80,Ce=t,Se=p(l.agent,_.agent),De=l.fixJSONCtlChars;$.protocol==="https:"&&(Ce=h,Se=p(l.httpsAgent,_.httpsAgent),$.port||(de=443));var be={host:$.hostname||$.host||"localhost",path:$.path||"/",method:ce,port:de,agent:Se,headers:l.headers||{},lookup:l.lookup};Array.isArray(l.timeout)?be.requestTimeout=l.timeout[l.timeout.length-1]:l.timeout!==void 0&&(be.requestTimeout=l.timeout);for(var _e=["pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","secureProtocol","secureOptions"],Ke=0;Ke<_e.length;Ke++){var Ne=_e[Ke];l.hasOwnProperty(Ne)&&(be[Ne]=l[Ne])}be.rejectUnauthorized!==!1||be.hasOwnProperty("secureOptions")||(be.secureOptions=w("constants").SSL_OP_NO_TLSv1_2);var Be=l.auth||$.auth;Be&&(be.auth=Be);var ze=l.content||l.data,ye=ce==="GET"||ce==="HEAD"||l.dataAsQueryString;if(!l.content&&ze&&typeof ze!="string"&&!C.isBuffer(ze))if(ye)ze=l.nestedQuerystring?qs.stringify(ze):querystring.stringify(ze);else{var pe=be.headers["Content-Type"]||be.headers["content-type"];pe||(pe=l.contentType==="json"?"application/json":"application/x-www-form-urlencoded",be.headers["Content-Type"]=pe),ze=parseContentType(pe).type==="application/json"?(0,d.default)(ze):l.nestedQuerystring?qs.stringify(ze):querystring.stringify(ze)}ye&&ze&&(be.path+=($.query?"&":"?")+ze,ze=null);var We=0;if(ze){var He=ze.length;C.isBuffer(ze)||(He=C.byteLength(ze)),We=be.headers["Content-Length"]=He}l.dataType==="json"&&(be.headers.Accept="application/json"),typeof l.beforeRequest=="function"&&l.beforeRequest(be);var nt=null,re=null,k=null,U=!1,q=!1,Y=0,J=-1,xe=!1,ke="",dt="",Ue=null;l.timing&&(Ue={queuing:0,dnslookup:0,connected:0,requestSent:0,waiting:0,contentDownload:0}),be.headers["User-Agent"]||be.headers["user-agent"]||(be.headers["User-Agent"]=navigator.userAgent),l.gzip&&(be.headers["Accept-Encoding"]||be.headers["accept-encoding"]||(be.headers["Accept-Encoding"]="gzip"));var je=l.writeStream;v("Request#%d %s %s with headers %j, options.path: %s",X,ce,x,be.headers,be.path),l.requestUrls.push(x);var tt,mt;Array.isArray(l.timeout)?(tt=g(l.timeout[0]),mt=g(l.timeout[1])):tt=mt=g(l.timeout),v("ConnectTimeout: %d, ResponseTimeout: %d",tt,mt);var Qe;try{Qe=Ce.request(be,H)}catch(Xe){return D(Xe)}return typeof window=="undefined"?function(){v("Connect timer ticking, timeout: %d",tt),nt=setTimeout(function(){nt=null,J===-1&&(J=-2);var Xe="Connect timeout for "+tt+"ms",Fe="ConnectionTimeoutError";Qe.socket||(Fe="SocketAssignTimeoutError",Xe+=", working sockets is full"),k=new Error(Xe),k.name=Fe,k.requestId=X,v("ConnectTimeout: Request#%d %s %s: %s, connected: %s",X,x,k.name,Xe,U),W()},tt)}():Qe.on("requestTimeout",function(){J===-1&&(J=-2);var Xe="Connect timeout for "+tt+"ms";k=new Error(Xe),k.name="ConnectionTimeoutError",k.requestId=X,W()}),Ue&&Qe.on("finish",function(){Ue.requestSent=Date.now()-ee}),Qe.once("socket",function(Xe){Ue&&(Ue.queuing=Date.now()-ee),isNode010&&Xe.socket&&(Xe=Xe.socket);var Fe=Xe.readyState;if(Fe==="opening")return Xe.once("lookup",function(Ie,Me,Ee){v("Request#%d %s lookup: %s, %s, %s",X,x,Ie,Me,Ee),Ue&&(Ue.dnslookup=Date.now()-ee),Me&&(ke=Me)}),void Xe.once("connect",function(){Ue&&(Ue.connected=Date.now()-ee),O(),te(),v("Request#%d %s new socket connected",X,x),U=!0,ke||(ke=Xe.remoteAddress),dt=Xe.remotePort});v("Request#%d %s reuse socket connected, readyState: %s",X,x,Fe),U=!0,q=!0,ke||(ke=Xe.remoteAddress),dt=Xe.remotePort,O(),te()}),Qe.on("error",function(Xe){Xe.name!=="Error"&&Xe.name!=="TypeError"||(Xe.name=U?"ResponseError":"RequestError"),Xe.message+=' (req "error")',v("Request#%d %s `req error` event emit, %s: %s",X,x,Xe.name,Xe.message),D(k||Xe)}),je&&je.once("error",function(Xe){Xe.message+=' (writeStream "error")',k=Xe,v("Request#%d %s `writeStream error` event emit, %s: %s",X,x,Xe.name,Xe.message),W()}),l.stream?(l.stream.pipe(Qe),l.stream.once("error",function(Xe){Xe.message+=' (stream "error")',k=Xe,v("Request#%d %s `readStream error` event emit, %s: %s",X,x,Xe.name,Xe.message),W()})):Qe.end(ze),Qe.requestId=X,Qe}}).call(this,w("_process"),w("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(j){function w(_){if(P[_])return P[_].exports;var T=P[_]={i:_,l:!1,exports:{}};return j[_].call(T.exports,T,T.exports,w),T.l=!0,T.exports}var P={};w.m=j,w.c=P,w.d=function(_,T,C){w.o(_,T)||Object.defineProperty(_,T,{configurable:!1,enumerable:!0,get:C})},w.n=function(_){var T=_&&_.__esModule?function(){return _.default}:function(){return _};return w.d(T,"a",T),T},w.o=function(_,T){return Object.prototype.hasOwnProperty.call(_,T)},w.p="",w(w.s=12)}([function(j,w,P){!function(_,T){j.exports=w=T()}(0,function(){var _=_||function(T,C){var c=Object.create||function(){function h(){}return function(v){var g;return h.prototype=v,g=new h,h.prototype=null,g}}(),p={},u=p.lib={},o=u.Base=function(){return{extend:function(h){var v=c(this);return h&&v.mixIn(h),v.hasOwnProperty("init")&&this.init!==v.init||(v.init=function(){v.$super.init.apply(this,arguments)}),v.init.prototype=v,v.$super=this,v},create:function(){var h=this.extend();return h.init.apply(h,arguments),h},init:function(){},mixIn:function(h){for(var v in h)h.hasOwnProperty(v)&&(this[v]=h[v]);h.hasOwnProperty("toString")&&(this.toString=h.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),a=u.WordArray=o.extend({init:function(h,v){h=this.words=h||[],this.sigBytes=v!=null?v:4*h.length},toString:function(h){return(h||s).stringify(this)},concat:function(h){var v=this.words,g=h.words,b=this.sigBytes,E=h.sigBytes;if(this.clamp(),b%4)for(var m=0;m>>2]>>>24-m%4*8&255;v[b+m>>>2]|=y<<24-(b+m)%4*8}else for(var m=0;m>>2]=g[m>>>2];return this.sigBytes+=E,this},clamp:function(){var h=this.words,v=this.sigBytes;h[v>>>2]&=4294967295<<32-v%4*8,h.length=T.ceil(v/4)},clone:function(){var h=o.clone.call(this);return h.words=this.words.slice(0),h},random:function(h){for(var v,g=[],b=0;b>16)&x,m=18e3*(65535&m)+(m>>16)&x;var l=(y<<16)+m&x;return l/=4294967296,(l+=.5)*(T.random()>.5?1:-1)}}(4294967296*(v||T.random()));v=987654071*E(),g.push(4294967296*E()|0)}return new a.init(g,h)}}),d=p.enc={},s=d.Hex={stringify:function(h){for(var v=h.words,g=h.sigBytes,b=[],E=0;E>>2]>>>24-E%4*8&255;b.push((m>>>4).toString(16)),b.push((15&m).toString(16))}return b.join("")},parse:function(h){for(var v=h.length,g=[],b=0;b>>3]|=parseInt(h.substr(b,2),16)<<24-b%8*4;return new a.init(g,v/2)}},f=d.Latin1={stringify:function(h){for(var v=h.words,g=h.sigBytes,b=[],E=0;E>>2]>>>24-E%4*8&255;b.push(String.fromCharCode(m))}return b.join("")},parse:function(h){for(var v=h.length,g=[],b=0;b>>2]|=(255&h.charCodeAt(b))<<24-b%4*8;return new a.init(g,v)}},i=d.Utf8={stringify:function(h){try{return decodeURIComponent(escape(f.stringify(h)))}catch(v){throw new Error("Malformed UTF-8 data")}},parse:function(h){return f.parse(unescape(encodeURIComponent(h)))}},n=u.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new a.init,this._nDataBytes=0},_append:function(h){typeof h=="string"&&(h=i.parse(h)),this._data.concat(h),this._nDataBytes+=h.sigBytes},_process:function(h){var v=this._data,g=v.words,b=v.sigBytes,E=this.blockSize,m=4*E,y=b/m;y=h?T.ceil(y):T.max((0|y)-this._minBufferSize,0);var x=y*E,l=T.min(4*x,b);if(x){for(var S=0;S",o[0];)p++;return p>4&&p}},{key:"extend",value:function(p,u){for(var o in u)Object.prototype.hasOwnProperty.call(u,o)&&u[o]&&(p[o]=u[o])}},{key:"isArray",value:function(p){return Object.prototype.toString.call(arg)==="[object Array]"}},{key:"getFileType",value:function(p){return p=p.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(p)?"video":/.mp3|.wav|.ape|.cda|.au|.midi|.mac|.aac|.ac3|.acm|.amr|.caf|.flac|.m4a|.ra|.wma/.test(p)?"audio":/.bmp|.jpg|.jpeg|.png/.test(p)?"img":"other"}},{key:"isImage",value:function(p){return p=p.toLowerCase(),!!/.jpg|.jpeg|.png/.test(p)}},{key:"ISODateString",value:function(p){function u(o){return o<10?"0"+o:o}return p.getUTCFullYear()+"-"+u(p.getUTCMonth()+1)+"-"+u(p.getUTCDate())+"T"+u(p.getUTCHours())+":"+u(p.getUTCMinutes())+":"+u(p.getUTCSeconds())+"Z"}},{key:"isIntNum",value:function(p){return!!/^\d+$/.test(p)}}]),c}();w.default=C},function(j,w,P){!function(_,T){j.exports=w=T(P(0))}(0,function(_){return function(T){function C(t,h,v,g,b,E,m){var y=t+(h&v|~h&g)+b+m;return(y<>>32-E)+h}function c(t,h,v,g,b,E,m){var y=t+(h&g|v&~g)+b+m;return(y<>>32-E)+h}function p(t,h,v,g,b,E,m){var y=t+(h^v^g)+b+m;return(y<>>32-E)+h}function u(t,h,v,g,b,E,m){var y=t+(v^(h|~g))+b+m;return(y<>>32-E)+h}var o=_,a=o.lib,d=a.WordArray,s=a.Hasher,f=o.algo,i=[];!function(){for(var t=0;t<64;t++)i[t]=4294967296*T.abs(T.sin(t+1))|0}();var n=f.MD5=s.extend({_doReset:function(){this._hash=new d.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(t,h){for(var v=0;v<16;v++){var g=h+v,b=t[g];t[g]=16711935&(b<<8|b>>>24)|4278255360&(b<<24|b>>>8)}var E=this._hash.words,m=t[h+0],y=t[h+1],x=t[h+2],l=t[h+3],S=t[h+4],O=t[h+5],A=t[h+6],D=t[h+7],I=t[h+8],B=t[h+9],H=t[h+10],te=t[h+11],W=t[h+12],V=t[h+13],X=t[h+14],ne=t[h+15],$=E[0],ee=E[1],ce=E[2],de=E[3];$=C($,ee,ce,de,m,7,i[0]),de=C(de,$,ee,ce,y,12,i[1]),ce=C(ce,de,$,ee,x,17,i[2]),ee=C(ee,ce,de,$,l,22,i[3]),$=C($,ee,ce,de,S,7,i[4]),de=C(de,$,ee,ce,O,12,i[5]),ce=C(ce,de,$,ee,A,17,i[6]),ee=C(ee,ce,de,$,D,22,i[7]),$=C($,ee,ce,de,I,7,i[8]),de=C(de,$,ee,ce,B,12,i[9]),ce=C(ce,de,$,ee,H,17,i[10]),ee=C(ee,ce,de,$,te,22,i[11]),$=C($,ee,ce,de,W,7,i[12]),de=C(de,$,ee,ce,V,12,i[13]),ce=C(ce,de,$,ee,X,17,i[14]),ee=C(ee,ce,de,$,ne,22,i[15]),$=c($,ee,ce,de,y,5,i[16]),de=c(de,$,ee,ce,A,9,i[17]),ce=c(ce,de,$,ee,te,14,i[18]),ee=c(ee,ce,de,$,m,20,i[19]),$=c($,ee,ce,de,O,5,i[20]),de=c(de,$,ee,ce,H,9,i[21]),ce=c(ce,de,$,ee,ne,14,i[22]),ee=c(ee,ce,de,$,S,20,i[23]),$=c($,ee,ce,de,B,5,i[24]),de=c(de,$,ee,ce,X,9,i[25]),ce=c(ce,de,$,ee,l,14,i[26]),ee=c(ee,ce,de,$,I,20,i[27]),$=c($,ee,ce,de,V,5,i[28]),de=c(de,$,ee,ce,x,9,i[29]),ce=c(ce,de,$,ee,D,14,i[30]),ee=c(ee,ce,de,$,W,20,i[31]),$=p($,ee,ce,de,O,4,i[32]),de=p(de,$,ee,ce,I,11,i[33]),ce=p(ce,de,$,ee,te,16,i[34]),ee=p(ee,ce,de,$,X,23,i[35]),$=p($,ee,ce,de,y,4,i[36]),de=p(de,$,ee,ce,S,11,i[37]),ce=p(ce,de,$,ee,D,16,i[38]),ee=p(ee,ce,de,$,H,23,i[39]),$=p($,ee,ce,de,V,4,i[40]),de=p(de,$,ee,ce,m,11,i[41]),ce=p(ce,de,$,ee,l,16,i[42]),ee=p(ee,ce,de,$,A,23,i[43]),$=p($,ee,ce,de,B,4,i[44]),de=p(de,$,ee,ce,W,11,i[45]),ce=p(ce,de,$,ee,ne,16,i[46]),ee=p(ee,ce,de,$,x,23,i[47]),$=u($,ee,ce,de,m,6,i[48]),de=u(de,$,ee,ce,D,10,i[49]),ce=u(ce,de,$,ee,X,15,i[50]),ee=u(ee,ce,de,$,O,21,i[51]),$=u($,ee,ce,de,W,6,i[52]),de=u(de,$,ee,ce,l,10,i[53]),ce=u(ce,de,$,ee,H,15,i[54]),ee=u(ee,ce,de,$,y,21,i[55]),$=u($,ee,ce,de,I,6,i[56]),de=u(de,$,ee,ce,ne,10,i[57]),ce=u(ce,de,$,ee,A,15,i[58]),ee=u(ee,ce,de,$,V,21,i[59]),$=u($,ee,ce,de,S,6,i[60]),de=u(de,$,ee,ce,te,10,i[61]),ce=u(ce,de,$,ee,x,15,i[62]),ee=u(ee,ce,de,$,B,21,i[63]),E[0]=E[0]+$|0,E[1]=E[1]+ee|0,E[2]=E[2]+ce|0,E[3]=E[3]+de|0},_doFinalize:function(){var t=this._data,h=t.words,v=8*this._nDataBytes,g=8*t.sigBytes;h[g>>>5]|=128<<24-g%32;var b=T.floor(v/4294967296),E=v;h[15+(g+64>>>9<<4)]=16711935&(b<<8|b>>>24)|4278255360&(b<<24|b>>>8),h[14+(g+64>>>9<<4)]=16711935&(E<<8|E>>>24)|4278255360&(E<<24|E>>>8),t.sigBytes=4*(h.length+1),this._process();for(var m=this._hash,y=m.words,x=0;x<4;x++){var l=y[x];y[x]=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8)}return m},clone:function(){var t=s.clone.call(this);return t._hash=this._hash.clone(),t}});o.MD5=s._createHelper(n),o.HmacMD5=s._createHmacHelper(n)}(Math),_.MD5})},function(j,w,P){"use strict";Object.defineProperty(w,"__esModule",{value:!0}),w.UPLOADSTATE={INIT:"init",UPLOADING:"uploading",COMPLETE:"complete",INTERRUPT:"interrupt"},w.UPLOADSTEP={INIT:"init",PART:"part",COMPLETE:"complete"},w.UPLOADDEFAULT={PARALLEL:5,PARTSIZE:1048576}},function(j,w,P){"use strict";function _(n){return n&&n.__esModule?n:{default:n}}function T(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(w,"__esModule",{value:!0});var C=function(){function n(t,h){for(var v=0;v-1)return"Baiduspider";if(d.indexOf("PlayStation")>-1)return"PS4";var f=navigator.platform=="Win32"||navigator.platform=="Windows"||d.indexOf("Windows")>-1,i=navigator.platform=="Mac68K"||navigator.platform=="MacPPC"||navigator.platform=="Macintosh"||navigator.platform=="MacIntel";return i&&(s="macOS"),navigator.platform=="X11"&&!f&&!i&&(s="Unix"),String(navigator.platform).indexOf("Linux")>-1&&(s="Linux"),f?"windows":s},c=function(){var a=navigator.userAgent,d="";return(a.indexOf("Windows NT 5.0")>-1||a.indexOf("Windows 2000")>-1)&&(d="2000"),(a.indexOf("Windows NT 5.1")>-1||a.indexOf("Windows XP")>-1)&&(d="XP"),(a.indexOf("Windows NT 5.2")>-1||a.indexOf("Windows 2003")>-1)&&(d="2003"),(a.indexOf("Windows NT 6.0")>-1||a.indexOf("Windows Vista")>-1)&&(d="Vista"),(a.indexOf("Windows NT 6.1")>-1||a.indexOf("Windows 7")>-1)&&(d="7"),(a.indexOf("Windows NT 6.2")>-1||a.indexOf("Windows 8")>-1)&&(d="8"),(a.indexOf("Windows NT 6.3")>-1||a.indexOf("Windows 8.1")>-1)&&(d="8.1"),(a.indexOf("Windows NT 10")>-1||a.indexOf("Windows 10")>-1)&&(d="10"),d},p=function(a){var d=navigator.userAgent.toLowerCase();return a.chrome?"Chrome":a.firefox?"Firefox":a.safari?"Safari":a.webview?"webview":a.ie?/edge/.test(d)?"Edge":"IE":/baiduspider/.test(d)?"Baiduspider":/ucweb/.test(d)||/UCBrowser/.test(d)?"UC":/opera/.test(d)?"Opera":/ucweb/.test(d)?"UC":/360se/.test(d)?"360\u6D4F\u89C8\u5668":/bidubrowser/.test(d)?"\u767E\u5EA6\u6D4F\u89C8\u5668":/metasr/.test(d)?"\u641C\u72D7\u6D4F\u89C8\u5668":/lbbrowser/.test(d)?"\u730E\u8C79\u6D4F\u89C8\u5668":/micromessenger/.test(d)?"\u5FAE\u4FE1\u5185\u7F6E\u6D4F\u89C8\u5668":/qqbrowser/.test(d)?"QQ\u6D4F\u89C8\u5668":/playstation/.test(d)?"PS4\u6D4F\u89C8\u5668":void 0},u=function(){var a={},d={},s=navigator.userAgent,f=navigator.platform,i=s.match(/Web[kK]it[\/]{0,1}([\d.]+)/),n=s.match(/(Android);?[\s\/]+([\d.]+)?/),t=!!s.match(/\(Macintosh\; Intel /),h=s.match(/(iPad).*OS\s([\d_]+)/),v=s.match(/(iPod)(.*OS\s([\d_]+))?/),g=!h&&s.match(/(iPhone\sOS)\s([\d_]+)/),b=s.match(/(webOS|hpwOS)[\s\/]([\d.]+)/),E=/Win\d{2}|Windows/.test(f),m=s.match(/Windows Phone ([\d.]+)/),y=b&&s.match(/TouchPad/),x=s.match(/Kindle\/([\d.]+)/),l=s.match(/Silk\/([\d._]+)/),S=s.match(/(BlackBerry).*Version\/([\d.]+)/),O=s.match(/(BB10).*Version\/([\d.]+)/),A=s.match(/(RIM\sTablet\sOS)\s([\d.]+)/),D=s.match(/PlayBook/),I=s.match(/Chrome\/([\d.]+)/)||s.match(/CriOS\/([\d.]+)/),B=s.match(/Firefox\/([\d.]+)/),H=s.match(/\((?:Mobile|Tablet); rv:([\d.]+)\).*Firefox\/[\d.]+/),te=s.match(/MSIE\s([\d.]+)/)||s.match(/Trident\/[\d](?=[^\?]+).*rv:([0-9.].)/),W=!I&&s.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/),V=W||s.match(/Version\/([\d.]+)([^S](Safari)|[^M]*(Mobile)[^S]*(Safari))/);if((d.webkit=!!i)&&(d.version=i[1]),n&&(a.android=!0,a.version=n[2]),g&&!v&&(a.ios=a.iphone=!0,a.version=g[2].replace(/_/g,".")),h&&(a.ios=a.ipad=!0,a.version=h[2].replace(/_/g,".")),v&&(a.ios=a.ipod=!0,a.version=v[3]?v[3].replace(/_/g,"."):null),m&&(a.wp=!0,a.version=m[1]),b&&(a.webos=!0,a.version=b[2]),y&&(a.touchpad=!0),S&&(a.blackberry=!0,a.version=S[2]),O&&(a.bb10=!0,a.version=O[2]),A&&(a.rimtabletos=!0,a.version=A[2]),D&&(d.playbook=!0),x&&(a.kindle=!0,a.version=x[1]),l&&(d.silk=!0,d.version=l[1]),!l&&a.android&&s.match(/Kindle Fire/)&&(d.silk=!0),I&&(d.chrome=!0,d.version=I[1]),B&&(d.firefox=!0,d.version=B[1]),H&&(a.firefoxos=!0,a.version=H[1]),te&&(d.ie=!0,d.version=te[1]),V&&(t||a.ios||E||n)&&(d.safari=!0,a.ios||(d.version=V[1])),W&&(d.webview=!0),t){var X=s.match(/[\d]*_[\d]*_[\d]*/);X&&X.length>0&&X[0]&&(a.version=X[0].replace(/_/g,"."))}return a.tablet=!!(h||D||n&&!s.match(/Mobile/)||B&&s.match(/Tablet/)||te&&!s.match(/Phone/)&&s.match(/Touch/)),a.phone=!(a.tablet||a.ipod||!(n||g||b||S||O||I&&s.match(/Android/)||I&&s.match(/CriOS\/([\d.]+)/)||B&&s.match(/Mobile/)||te&&s.match(/Touch/))),a.pc=!a.tablet&&!a.phone,t?a.name="macOS":E?(a.name="windows",a.version=c()):a.name=C(a),d.name=p(d),{os:a,browser:d}}(),o=function(){function a(){_(this,a)}return T(a,null,[{key:"getHost",value:function(d){var s="";if(d===void 0||d==null||d=="")return"";var f=d.indexOf("//"),i=d;f>-1&&(i=d.substring(f+2));var s=i,n=i.split("/");return n&&n.length>0&&(s=n[0]),n=s.split(":"),n&&n.length>0&&(s=n[0]),s}},{key:"os",get:function(){return u.os}},{key:"browser",get:function(){var d=u.browser;return d.name||(d.name=p()),d}}]),a}();w.default=o},function(j,w,P){"use strict";function _(c,p){if(!(c instanceof p))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(w,"__esModule",{value:!0});var T=function(){function c(p,u){for(var o=0;o0){X._invalidUserId=!0;var ce=ee.Message+"\uFF0C\u6B63\u786E\u8D26\u53F7ID(userId)\u8BF7\u53C2\u8003\uFF1Ahttps://help.aliyun.com/knowledge_detail/37196.html";console.log(ce)}}catch(de){console.log(de)}})})}H&&(V.videoInfo=H?JSON.parse(H).Vod:{},V.userData=d.default.encode(H)),V.ri=g.default.create(),this._uploadList.push(V),this._reportLog("20001",V,{ql:this._uploadList.length});try{this.options.addFileSuccess&&this.options.addFileSuccess(V)}catch(ne){console.log(ne)}return!0}},{key:"deleteFile",value:function(A){return!!this.cancelFile(A)&&(this._uploadList.splice(A,1),!0)}},{key:"cleanList",value:function(){this.stopUpload(),this._uploadList.length=0,this._curIndex=-1}},{key:"cancelFile",value:function(A){if(this.options,A<0||A>=this._uploadList.length)return!1;var D=this._uploadList[A];if(A==this._curIndex&&D.state==c.UPLOADSTATE.UPLOADING){D.state=c.UPLOADSTATE.CANCELED;var I=this._getCheckoutpoint(D);I&&I.checkpoint&&(I=I.checkpoint),I&&this._ossUpload.abort(D),this._removeCheckoutpoint(D),this.nextUpload()}else D.state!=c.UPLOADSTATE.SUCCESS&&(D.state=c.UPLOADSTATE.CANCELED);return this._reportLog("20008",D),!0}},{key:"resumeFile",value:function(A){if(this.options,A<0||A>=this._uploadList.length)return!1;var D=this._uploadList[A];return D.state==c.UPLOADSTATE.CANCELED&&(D.state=c.UPLOADSTATE.INIT,!0)}},{key:"listFiles",value:function(){return this._uploadList}},{key:"getCheckpoint",value:function(A){return this._getCheckoutpoint({file:A})}},{key:"startUpload",value:function(A){if(this._retryCount=0,this.options,this._state==c.VODSTATE.START||this._state==c.VODSTATE.EXPIRE)return void console.log("already started or expired");if(this._initState(),this._curIndex=this._findUploadIndex(),this._curIndex==-1)return void(this._state=c.VODSTATE.END);var D=this._uploadList[this._curIndex];this._ossUpload=null,this._upload(D),this._state=c.VODSTATE.START}},{key:"nextUpload",value:function(){var A=this.options;if(this._state==c.VODSTATE.START)if(this._curIndex=this._findUploadIndex(),this._curIndex!=-1){var D=this._uploadList[this._curIndex];this._ossUpload=null,this._upload(D)}else{this._state=c.VODSTATE.END;try{A.onUploadEnd&&A.onUploadEnd(D)}catch(I){console.log(I)}}}},{key:"clear",value:function(A){for(var D=this.options,I=0,B=0;Bthis._curIndex&&(H=this._uploadList[this._curIndex]),H&&(this.init(A,D,I,B),this._state=c.VODSTATE.START,this._ossUpload=null,this._uploadCore(H,H.retry),H.retry=!1),!0}},{key:"resumeUploadWithSTSToken",value:function(A,D,I){if(this._curIndex==-1)return!1;if(this._state!=c.VODSTATE.EXPIRE)return!1;if(this._uploadList.length>this._curIndex){var B=this._uploadList[this._curIndex];B.object?this._refreshSTSTokenUpload(B,A,D,I):this.setSTSToken(B,A,D,I)}}},{key:"setSTSTokenDirectlyUpload",value:function(A,D,I,B,H){if(!(D&&I&&B&&H))return console.log("accessKeyId\u3001ccessKeySecret\u3001securityToken and expiration should not be empty."),!1;this._ut="oss";var te=A;this.init(D,I,B,H),te.endpoint=te._endpoint,te.bucket=te._bucket,te.object=te._object,this._ossUpload=null,this._uploadCore(te,A.retry),A.retry=!1}},{key:"setSTSToken",value:function(A,D,I,B){if(!D||!I||!B)return console.log("accessKeyId\u3001ccessKeySecret\u3001securityToken should not be empty."),!1;this._ut="vod",this._uploadWay="sts";var H=A.videoInfo,te={accessKeyId:D,securityToken:B,accessKeySecret:I,fileName:A.file.name,title:H.Title,requestId:A.ri,region:this.options.region};H.ImageType&&(te.imageType=H.ImageType),H.ImageExt&&(te.imageExt=H.ImageExt),H.FileSize&&(te.fileSize=H.FileSize),H.Description&&(te.description=H.Description),H.CateId&&(te.cateId=H.CateId),H.Tags&&(te.tags=H.Tags),H.TemplateGroupId&&(te.templateGroupId=H.TemplateGroupId),H.StorageLocation&&(te.storageLocation=H.StorageLocation),H.CoverURL&&(te.coverUrl=H.CoverURL),H.TransCodeMode&&(te.transCodeMode=H.TransCodeMode),H.UserData&&(te.userData=H.UserData);var W=this,V="getUploadAuth";A.videoId?(te.videoId=A.videoId,V="refreshUploadAuth"):A.isImage&&(V="getImageUploadAuth"),E.default[V](te,function(X){A.videoId=X.VideoId?X.VideoId:A.videoId,W.setUploadAuthAndAddress(A,X.UploadAuth,X.UploadAddress),W._state=c.VODSTATE.START},function(X){W._error(A,{name:X.Code,code:X.Code,message:X.Message,requestId:X.RequestId})})}},{key:"setUploadAuthAndAddress",value:function(A,D,I,B){if(!A||!D||!I)return!1;var H=JSON.parse(d.default.decode(D));if(!(H.AccessKeyId&&H.AccessKeySecret&&H.SecurityToken&&H.Expiration))return console.error("uploadauth is invalid"),!1;var te={},W=A;if(I){if(te=JSON.parse(d.default.decode(I)),!te.Endpoint||!te.Bucket||!te.FileName)return console.error("uploadAddress is invalid"),!1}else te.Endpoint=W.endpoint,te.Bucket=W.bucket,te.FileName=W.object;this._ut="vod",this._uploadWay="vod",this.options.region=H.Region||this.options.region,this.init(H.AccessKeyId,H.AccessKeySecret,H.SecurityToken,H.Expiration),W.endpoint=W._endpoint?W._endpoint:te.Endpoint,W.bucket=W._bucket?W._bucket:te.Bucket,W.object=W._object?W._object:te.FileName,W.region=this.options.region,B&&(W.videoId=B),this._ossUpload=null,this._uploadCore(W,A.retry),A.retry=!1}},{key:"_refreshSTSTokenUpload",value:function(A,D,I,B){if(!D||!I||!B)return console.log("accessKeyId\u3001ccessKeySecret\u3001securityToken should not be empty."),!1;var H={accessKeyId:D,securityToken:B,accessKeySecret:I,videoId:A.object,requestId:A.ri,region:this.options.region},te=this,W="refreshUploadAuth";A.isImage&&(W="getImageUploadAuth"),E.default[W](H,function(V){te.setUploadAuthAndAddress(A,V.UploadAuth,UploadAddress),te._state=c.VODSTATE.START},function(V){te._error(A,{name:V.Code,code:V.Code,message:V.Message,requestId:V.RequestId})})}},{key:"_upload",value:function(A){var D=arguments.length>1&&arguments[1]!==void 0&&arguments[1],I=this.options;if(A.retry=D,I.onUploadstarted&&!D)try{var B=this._getCheckoutpoint(A);B&&B.state!=c.UPLOADSTATE.UPLOADING&&(A.checkpoint=B,A.videoId=B.videoId),I.onUploadstarted(A)}catch(H){console.log(H)}}},{key:"_uploadCore",value:function(A){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(A.state=c.UPLOADSTATE.UPLOADING,!this._ossUpload){A.endpoint=A.endpoint||"http://oss-cn-hangzhou.aliyuncs.com";var D=this;this._ossUpload=new o.default({bucket:A.bucket,endpoint:A.endpoint,AccessKeyId:this._ossCreditor.accessKeyId,AccessKeySecret:this._ossCreditor.accessKeySecret,SecurityToken:this._ossCreditor.securityToken,timeout:this.options.timeout,cname:this.options.cname},{onerror:function(X,ne){D._error.call(D,X,ne)},oncomplete:function(X,ne){D._complete.call(D,X,ne)},onprogress:function(X,ne,$){D._progress.call(D,X,ne,$)}})}var I=h.default.getFileType(A.file.name),B=this._getCheckoutpoint(A),H="",te="";B&&B.checkpoint&&(te=B.state,H=B.videoId,B=B.checkpoint),B&&H==A.videoId&&te!=c.UPLOADSTATE.UPLOADING&&(B.file=A.file,A.checkpoint=B,B.uploadId);var W=this._adjustPartSize(A);this._reportLog("20002",A,{ft:I,fs:A.file.size,bu:A.bucket,ok:A.object,vid:A.videoId||"",fn:A.file.name,fw:null,fh:null,ps:W});var V={headers:{"x-oss-notification":A.userData?A.userData:""},partSize:W,parallel:this.options.parallel};this._ossUpload.upload(A,V)}},{key:"_findUploadIndex",value:function(){for(var A=-1,D=0;D0||D.name=="SignatureDoesNotMatchError"||D.code=="SecurityTokenExpired"||D.code=="InvalidSecurityToken.Expired"||D.code=="InvalidAccessKeyId"&&this._ossCreditor.securityToken){if(this.options.onUploadTokenExpired){this._state=c.VODSTATE.EXPIRE,A.state=c.UPLOADSTATE.FAIlURE;try{this.options.onUploadTokenExpired(A,D)}catch(B){console.log(B)}}return}if((D.name=="RequestTimeoutError"||D.name=="ConnectionTimeout"||D.name=="ConnectionTimeoutError")&&this._retryTotal>this._retryCount){var I=this;return setTimeout(function(){I._uploadCore(A,!0)},1e3*I._retryDuration),void this._retryCount++}D.name=="NoSuchUploadError"&&this._removeCheckoutpoint(A),this._handleError(A,D)}}},{key:"_handleError",value:function(A,D){var I=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],B=c.UPLOADSTATE.FAIlURE;if(A.state!=c.UPLOADSTATE.CANCELED&&(A.state=c.UPLOADSTATE.FAIlURE,this._state=c.VODSTATE.FAILURE,this.options.onUploadFailed&&D&&D.code&&D.message))try{this.options.onUploadFailed(A,D.code,D.message)}catch(te){console.log(te)}if(I&&this._changeState(A,B),this._reportLog("20006",A,{code:D.name,message:D.message,requestId:D.requestId,fs:A.file.size,bu:A.bucket,ok:A.object,fn:A.file.name}),this._reportLog("20004",A,{requestId:D.requestId,fs:A.file.size,bu:A.bucket,ok:A.object,fn:A.file.name}),A.ri=g.default.create(),this._findUploadIndex()!=-1){var H=this;this._state=c.VODSTATE.START,setTimeout(function(){H.nextUpload()},100)}}},{key:"_complete",value:function(A,D){if(A.state=c.UPLOADSTATE.SUCCESS,this.options.onUploadSucceed)try{this.options.onUploadSucceed(A)}catch(H){console.log(H)}var I=0;D&&D.res&&D.res.headers&&(I=D.res.headers["x-oss-request-id"]),this._removeCheckoutpoint(A);var B=this;setTimeout(function(){B.nextUpload()},100),this._retryCount=0,this._reportLog("20003",A,{requestId:I})}},{key:"_progress",value:function(A,D,I){if(this.options.onUploadProgress)try{A.loaded=D.loaded,this.options.onUploadProgress(A,D.total,D.loaded)}catch(ne){console.log(ne)}var B=D.checkpoint,H=0;B&&(A.checkpoint=B,this._saveCheckoutpoint(A,B,c.UPLOADSTATE.UPLOADING),H=B.uploadId),this._retryCount=0;var te=this._getPortNumber(B),W=0;if(I&&I.headers&&(W=I.headers["x-oss-request-id"]),D.loaded!=0&&this._reportLog("20007",A,{pn:te,requestId:W}),D.loaded!=1&&this._reportLog("20005",A,{UploadId:H,pn:te+1,pr:A.retry?1:0,fs:A.file.size,bu:A.bucket,ok:A.object,fn:A.file.name}),!this._invalidUserId&&!A.isImage&&this._ut=="vod"&&this.options.enableUploadProgress){var V={file:A.file,checkpoint:D,userId:this.options.userId,videoId:A.videoId,region:this.options.region,fileHash:A.fileHash};try{var X=this;y.default.upload(V,function(){},function(ne){if((ne=JSON.parse(ne))&&ne.Code=="InvalidParameter"&&ne.Message.indexOf("UserId")>0){X._invalidUserId=!0;var $=ne.Message+"\uFF0C\u6B63\u786E\u8D26\u53F7ID(userId)\u8BF7\u53C2\u8003\uFF1Ahttps://help.aliyun.com/knowledge_detail/37196.html";console.log($)}})}catch(ne){console.log(ne)}}}},{key:"_getPortNumber",value:function(A){if(A){var D=A.doneParts;if(D&&D.length>0)return D[D.length-1].number}return 0}},{key:"_removeCheckoutpoint",value:function(A){var D=this._getCheckoutpointKey(A);f.default.remove(D)}},{key:"_getCheckoutpoint",value:function(A){var D=this._getCheckoutpointKey(A),I=f.default.get(D);if(I)try{return JSON.parse(I)}catch(B){}return""}},{key:"_saveCheckoutpoint",value:function(A,D,I){if(D){var B=this._getCheckoutpointKey(A),H=A.file,te={fileName:H.name,lastModified:H.lastModified,size:H.size,object:A.object,videoId:A.videoId,bucket:A.bucket,endpoint:A.endpoint,checkpoint:D,loaded:A.loaded,state:I};f.default.set(B,JSON.stringify(te))}}},{key:"_changeState",value:function(A,D){var I=this._getCheckoutpoint(A);I&&((this._onbeforeunload=!0)&&(D=c.UPLOADSTATE.STOPED),this._saveCheckoutpoint(A,I.checkpoint,D))}},{key:"_getCheckoutpointKey",value:function(A){return"upload_"+A.file.lastModified+"_"+A.file.name+"_"+A.file.size}},{key:"_getCheckoutpointFromCloud",value:function(A,D,I){var B={userId:this.options.userId,uploadInfoList:[{FileName:A.file.name,FileSize:A.file.size,FileCreateTime:A.file.lastModified,FileHash:A.fileHash}],region:this.options.region};y.default.get(B,function(H){D(H)},I)}},{key:"_reportLog",value:function(A,D,I){I||(I={}),I.ri=D.ri,this._ut&&(I.ut=this._ut),this._log.log(A,I)}},{key:"_initEvent",value:function(){var A=this;window&&(window.onbeforeunload=function(D){if(A._onbeforeunload=!0,A._curIndex!=-1&&A._uploadList.length>A._curIndex){var I=A._uploadList[A._curIndex];A._changeState(I,c.UPLOADSTATE.STOPED)}})}},{key:"_initState",value:function(){for(var A=0;A1e4?A.file.size/9999:this.options.partSize}}]),O}());w.default=S},function(j,w,P){"use strict";Object.defineProperty(w,"__esModule",{value:!0}),w.UPLOADSTATE={INIT:"Ready",UPLOADING:"Uploading",SUCCESS:"Success",FAIlURE:"Failure",CANCELED:"Canceled",STOPED:"Stoped"},w.VODSTATE={INIT:"Init",START:"Start",STOP:"Stop",FAILURE:"Failure",EXPIRE:"Expire",END:"End"}},function(j,w,P){"use strict";function _(a){return a&&a.__esModule?a:{default:a}}function T(a,d){if(!(a instanceof d))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(w,"__esModule",{value:!0});var C=function(){function a(d,s){for(var f=0;f=T())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+T().toString(16)+" bytes");return 0|re}function t(re){return+re!=re&&(re=0),c.alloc(+re)}function h(re,k){if(c.isBuffer(re))return re.length;if(typeof ArrayBuffer!="undefined"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(re)||re instanceof ArrayBuffer))return re.byteLength;typeof re!="string"&&(re=""+re);var U=re.length;if(U===0)return 0;for(var q=!1;;)switch(k){case"ascii":case"latin1":case"binary":return U;case"utf8":case"utf-8":case void 0:return be(re).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*U;case"hex":return U>>>1;case"base64":return Ne(re).length;default:if(q)return be(re).length;k=(""+k).toLowerCase(),q=!0}}function v(re,k,U){var q=!1;if((k===void 0||k<0)&&(k=0),k>this.length)return"";if((U===void 0||U>this.length)&&(U=this.length),U<=0)return"";if(U>>>=0,k>>>=0,U<=k)return"";for(re||(re="utf8");;)switch(re){case"hex":return te(this,k,U);case"utf8":case"utf-8":return D(this,k,U);case"ascii":return B(this,k,U);case"latin1":case"binary":return H(this,k,U);case"base64":return A(this,k,U);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return W(this,k,U);default:if(q)throw new TypeError("Unknown encoding: "+re);re=(re+"").toLowerCase(),q=!0}}function g(re,k,U){var q=re[k];re[k]=re[U],re[U]=q}function b(re,k,U,q,Y){if(re.length===0)return-1;if(typeof U=="string"?(q=U,U=0):U>2147483647?U=2147483647:U<-2147483648&&(U=-2147483648),U=+U,isNaN(U)&&(U=Y?0:re.length-1),U<0&&(U=re.length+U),U>=re.length){if(Y)return-1;U=re.length-1}else if(U<0){if(!Y)return-1;U=0}if(typeof k=="string"&&(k=c.from(k,q)),c.isBuffer(k))return k.length===0?-1:E(re,k,U,q,Y);if(typeof k=="number")return k&=255,c.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?Y?Uint8Array.prototype.indexOf.call(re,k,U):Uint8Array.prototype.lastIndexOf.call(re,k,U):E(re,[k],U,q,Y);throw new TypeError("val must be string, number or Buffer")}function E(re,k,U,q,Y){function J(Qe,Xe){return xe===1?Qe[Xe]:Qe.readUInt16BE(Xe*xe)}var xe=1,ke=re.length,dt=k.length;if(q!==void 0&&((q=String(q).toLowerCase())==="ucs2"||q==="ucs-2"||q==="utf16le"||q==="utf-16le")){if(re.length<2||k.length<2)return-1;xe=2,ke/=2,dt/=2,U/=2}var Ue;if(Y){var je=-1;for(Ue=U;Ueke&&(U=ke-dt),Ue=U;Ue>=0;Ue--){for(var tt=!0,mt=0;mtY&&(q=Y):q=Y;var J=k.length;if(J%2!=0)throw new TypeError("Invalid hex string");q>J/2&&(q=J/2);for(var xe=0;xe239?4:J>223?3:J>191?2:1;if(Y+ke<=U){var dt,Ue,je,tt;switch(ke){case 1:J<128&&(xe=J);break;case 2:dt=re[Y+1],(192&dt)==128&&(tt=(31&J)<<6|63&dt)>127&&(xe=tt);break;case 3:dt=re[Y+1],Ue=re[Y+2],(192&dt)==128&&(192&Ue)==128&&(tt=(15&J)<<12|(63&dt)<<6|63&Ue)>2047&&(tt<55296||tt>57343)&&(xe=tt);break;case 4:dt=re[Y+1],Ue=re[Y+2],je=re[Y+3],(192&dt)==128&&(192&Ue)==128&&(192&je)==128&&(tt=(15&J)<<18|(63&dt)<<12|(63&Ue)<<6|63&je)>65535&&tt<1114112&&(xe=tt)}}xe===null?(xe=65533,ke=1):xe>65535&&(xe-=65536,q.push(xe>>>10&1023|55296),xe=56320|1023&xe),q.push(xe),Y+=ke}return I(q)}function I(re){var k=re.length;if(k<=He)return String.fromCharCode.apply(String,re);for(var U="",q=0;qq)&&(U=q);for(var Y="",J=k;JU)throw new RangeError("Trying to access beyond buffer length")}function X(re,k,U,q,Y,J){if(!c.isBuffer(re))throw new TypeError('"buffer" argument must be a Buffer instance');if(k>Y||kre.length)throw new RangeError("Index out of range")}function ne(re,k,U,q){k<0&&(k=65535+k+1);for(var Y=0,J=Math.min(re.length-U,2);Y>>8*(q?Y:1-Y)}function $(re,k,U,q){k<0&&(k=4294967295+k+1);for(var Y=0,J=Math.min(re.length-U,4);Y>>8*(q?Y:3-Y)&255}function ee(re,k,U,q,Y,J){if(U+q>re.length)throw new RangeError("Index out of range");if(U<0)throw new RangeError("Index out of range")}function ce(re,k,U,q,Y){return Y||ee(re,k,U,4,34028234663852886e22,-34028234663852886e22),pe.write(re,k,U,q,23,4),U+4}function de(re,k,U,q,Y){return Y||ee(re,k,U,8,17976931348623157e292,-17976931348623157e292),pe.write(re,k,U,q,52,8),U+8}function Ce(re){if(re=Se(re).replace(nt,""),re.length<2)return"";for(;re.length%4!=0;)re+="=";return re}function Se(re){return re.trim?re.trim():re.replace(/^\s+|\s+$/g,"")}function De(re){return re<16?"0"+re.toString(16):re.toString(16)}function be(re,k){k=k||1/0;for(var U,q=re.length,Y=null,J=[],xe=0;xe55295&&U<57344){if(!Y){if(U>56319){(k-=3)>-1&&J.push(239,191,189);continue}if(xe+1===q){(k-=3)>-1&&J.push(239,191,189);continue}Y=U;continue}if(U<56320){(k-=3)>-1&&J.push(239,191,189),Y=U;continue}U=65536+(Y-55296<<10|U-56320)}else Y&&(k-=3)>-1&&J.push(239,191,189);if(Y=null,U<128){if((k-=1)<0)break;J.push(U)}else if(U<2048){if((k-=2)<0)break;J.push(U>>6|192,63&U|128)}else if(U<65536){if((k-=3)<0)break;J.push(U>>12|224,U>>6&63|128,63&U|128)}else{if(!(U<1114112))throw new Error("Invalid code point");if((k-=4)<0)break;J.push(U>>18|240,U>>12&63|128,U>>6&63|128,63&U|128)}}return J}function _e(re){for(var k=[],U=0;U>8,Y=U%256,J.push(Y),J.push(q);return J}function Ne(re){return ye.toByteArray(Ce(re))}function Be(re,k,U,q){for(var Y=0;Y=k.length||Y>=re.length);++Y)k[Y+U]=re[Y];return Y}function ze(re){return re!==re}/*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */var ye=P(21),pe=P(22),We=P(23);w.Buffer=c,w.SlowBuffer=t,w.INSPECT_MAX_BYTES=50,c.TYPED_ARRAY_SUPPORT=_.TYPED_ARRAY_SUPPORT!==void 0?_.TYPED_ARRAY_SUPPORT:function(){try{var re=new Uint8Array(1);return re.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},re.foo()===42&&typeof re.subarray=="function"&&re.subarray(1,1).byteLength===0}catch(k){return!1}}(),w.kMaxLength=T(),c.poolSize=8192,c._augment=function(re){return re.__proto__=c.prototype,re},c.from=function(re,k,U){return p(null,re,k,U)},c.TYPED_ARRAY_SUPPORT&&(c.prototype.__proto__=Uint8Array.prototype,c.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&c[Symbol.species]===c&&Object.defineProperty(c,Symbol.species,{value:null,configurable:!0})),c.alloc=function(re,k,U){return o(null,re,k,U)},c.allocUnsafe=function(re){return a(null,re)},c.allocUnsafeSlow=function(re){return a(null,re)},c.isBuffer=function(re){return!(re==null||!re._isBuffer)},c.compare=function(re,k){if(!c.isBuffer(re)||!c.isBuffer(k))throw new TypeError("Arguments must be Buffers");if(re===k)return 0;for(var U=re.length,q=k.length,Y=0,J=Math.min(U,q);Y0&&(re=this.toString("hex",0,k).match(/.{2}/g).join(" "),this.length>k&&(re+=" ... ")),""},c.prototype.compare=function(re,k,U,q,Y){if(!c.isBuffer(re))throw new TypeError("Argument must be a Buffer");if(k===void 0&&(k=0),U===void 0&&(U=re?re.length:0),q===void 0&&(q=0),Y===void 0&&(Y=this.length),k<0||U>re.length||q<0||Y>this.length)throw new RangeError("out of range index");if(q>=Y&&k>=U)return 0;if(q>=Y)return-1;if(k>=U)return 1;if(k>>>=0,U>>>=0,q>>>=0,Y>>>=0,this===re)return 0;for(var J=Y-q,xe=U-k,ke=Math.min(J,xe),dt=this.slice(q,Y),Ue=re.slice(k,U),je=0;jeY)&&(U=Y),re.length>0&&(U<0||k<0)||k>this.length)throw new RangeError("Attempt to write outside buffer bounds");q||(q="utf8");for(var J=!1;;)switch(q){case"hex":return m(this,re,k,U);case"utf8":case"utf-8":return y(this,re,k,U);case"ascii":return x(this,re,k,U);case"latin1":case"binary":return l(this,re,k,U);case"base64":return S(this,re,k,U);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,re,k,U);default:if(J)throw new TypeError("Unknown encoding: "+q);q=(""+q).toLowerCase(),J=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var He=4096;c.prototype.slice=function(re,k){var U=this.length;re=~~re,k=k===void 0?U:~~k,re<0?(re+=U)<0&&(re=0):re>U&&(re=U),k<0?(k+=U)<0&&(k=0):k>U&&(k=U),k0&&(Y*=256);)q+=this[re+--k]*Y;return q},c.prototype.readUInt8=function(re,k){return k||V(re,1,this.length),this[re]},c.prototype.readUInt16LE=function(re,k){return k||V(re,2,this.length),this[re]|this[re+1]<<8},c.prototype.readUInt16BE=function(re,k){return k||V(re,2,this.length),this[re]<<8|this[re+1]},c.prototype.readUInt32LE=function(re,k){return k||V(re,4,this.length),(this[re]|this[re+1]<<8|this[re+2]<<16)+16777216*this[re+3]},c.prototype.readUInt32BE=function(re,k){return k||V(re,4,this.length),16777216*this[re]+(this[re+1]<<16|this[re+2]<<8|this[re+3])},c.prototype.readIntLE=function(re,k,U){re|=0,k|=0,U||V(re,k,this.length);for(var q=this[re],Y=1,J=0;++J=Y&&(q-=Math.pow(2,8*k)),q},c.prototype.readIntBE=function(re,k,U){re|=0,k|=0,U||V(re,k,this.length);for(var q=k,Y=1,J=this[re+--q];q>0&&(Y*=256);)J+=this[re+--q]*Y;return Y*=128,J>=Y&&(J-=Math.pow(2,8*k)),J},c.prototype.readInt8=function(re,k){return k||V(re,1,this.length),128&this[re]?-1*(255-this[re]+1):this[re]},c.prototype.readInt16LE=function(re,k){k||V(re,2,this.length);var U=this[re]|this[re+1]<<8;return 32768&U?4294901760|U:U},c.prototype.readInt16BE=function(re,k){k||V(re,2,this.length);var U=this[re+1]|this[re]<<8;return 32768&U?4294901760|U:U},c.prototype.readInt32LE=function(re,k){return k||V(re,4,this.length),this[re]|this[re+1]<<8|this[re+2]<<16|this[re+3]<<24},c.prototype.readInt32BE=function(re,k){return k||V(re,4,this.length),this[re]<<24|this[re+1]<<16|this[re+2]<<8|this[re+3]},c.prototype.readFloatLE=function(re,k){return k||V(re,4,this.length),pe.read(this,re,!0,23,4)},c.prototype.readFloatBE=function(re,k){return k||V(re,4,this.length),pe.read(this,re,!1,23,4)},c.prototype.readDoubleLE=function(re,k){return k||V(re,8,this.length),pe.read(this,re,!0,52,8)},c.prototype.readDoubleBE=function(re,k){return k||V(re,8,this.length),pe.read(this,re,!1,52,8)},c.prototype.writeUIntLE=function(re,k,U,q){(re=+re,k|=0,U|=0,!q)&&X(this,re,k,U,Math.pow(2,8*U)-1,0);var Y=1,J=0;for(this[k]=255&re;++J=0&&(J*=256);)this[k+Y]=re/J&255;return k+U},c.prototype.writeUInt8=function(re,k,U){return re=+re,k|=0,U||X(this,re,k,1,255,0),c.TYPED_ARRAY_SUPPORT||(re=Math.floor(re)),this[k]=255&re,k+1},c.prototype.writeUInt16LE=function(re,k,U){return re=+re,k|=0,U||X(this,re,k,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[k]=255&re,this[k+1]=re>>>8):ne(this,re,k,!0),k+2},c.prototype.writeUInt16BE=function(re,k,U){return re=+re,k|=0,U||X(this,re,k,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[k]=re>>>8,this[k+1]=255&re):ne(this,re,k,!1),k+2},c.prototype.writeUInt32LE=function(re,k,U){return re=+re,k|=0,U||X(this,re,k,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[k+3]=re>>>24,this[k+2]=re>>>16,this[k+1]=re>>>8,this[k]=255&re):$(this,re,k,!0),k+4},c.prototype.writeUInt32BE=function(re,k,U){return re=+re,k|=0,U||X(this,re,k,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[k]=re>>>24,this[k+1]=re>>>16,this[k+2]=re>>>8,this[k+3]=255&re):$(this,re,k,!1),k+4},c.prototype.writeIntLE=function(re,k,U,q){if(re=+re,k|=0,!q){var Y=Math.pow(2,8*U-1);X(this,re,k,U,Y-1,-Y)}var J=0,xe=1,ke=0;for(this[k]=255&re;++J>0)-ke&255;return k+U},c.prototype.writeIntBE=function(re,k,U,q){if(re=+re,k|=0,!q){var Y=Math.pow(2,8*U-1);X(this,re,k,U,Y-1,-Y)}var J=U-1,xe=1,ke=0;for(this[k+J]=255&re;--J>=0&&(xe*=256);)re<0&&ke===0&&this[k+J+1]!==0&&(ke=1),this[k+J]=(re/xe>>0)-ke&255;return k+U},c.prototype.writeInt8=function(re,k,U){return re=+re,k|=0,U||X(this,re,k,1,127,-128),c.TYPED_ARRAY_SUPPORT||(re=Math.floor(re)),re<0&&(re=255+re+1),this[k]=255&re,k+1},c.prototype.writeInt16LE=function(re,k,U){return re=+re,k|=0,U||X(this,re,k,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[k]=255&re,this[k+1]=re>>>8):ne(this,re,k,!0),k+2},c.prototype.writeInt16BE=function(re,k,U){return re=+re,k|=0,U||X(this,re,k,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[k]=re>>>8,this[k+1]=255&re):ne(this,re,k,!1),k+2},c.prototype.writeInt32LE=function(re,k,U){return re=+re,k|=0,U||X(this,re,k,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[k]=255&re,this[k+1]=re>>>8,this[k+2]=re>>>16,this[k+3]=re>>>24):$(this,re,k,!0),k+4},c.prototype.writeInt32BE=function(re,k,U){return re=+re,k|=0,U||X(this,re,k,4,2147483647,-2147483648),re<0&&(re=4294967295+re+1),c.TYPED_ARRAY_SUPPORT?(this[k]=re>>>24,this[k+1]=re>>>16,this[k+2]=re>>>8,this[k+3]=255&re):$(this,re,k,!1),k+4},c.prototype.writeFloatLE=function(re,k,U){return ce(this,re,k,!0,U)},c.prototype.writeFloatBE=function(re,k,U){return ce(this,re,k,!1,U)},c.prototype.writeDoubleLE=function(re,k,U){return de(this,re,k,!0,U)},c.prototype.writeDoubleBE=function(re,k,U){return de(this,re,k,!1,U)},c.prototype.copy=function(re,k,U,q){if(U||(U=0),q||q===0||(q=this.length),k>=re.length&&(k=re.length),k||(k=0),q>0&&q=this.length)throw new RangeError("sourceStart out of bounds");if(q<0)throw new RangeError("sourceEnd out of bounds");q>this.length&&(q=this.length),re.length-k=0;--Y)re[Y+k]=this[Y+U];else if(J<1e3||!c.TYPED_ARRAY_SUPPORT)for(Y=0;Y>>=0,U=U===void 0?this.length:U>>>0,re||(re=0);var J;if(typeof re=="number")for(J=k;J0)throw new Error("Invalid string. Length must be a multiple of 4");return n[t-2]==="="?2:n[t-1]==="="?1:0}function T(n){return 3*n.length/4-_(n)}function C(n){var t,h,v,g,b,E=n.length;g=_(n),b=new d(3*E/4-g),h=g>0?E-4:E;var m=0;for(t=0;t>16&255,b[m++]=v>>8&255,b[m++]=255&v;return g===2?(v=a[n.charCodeAt(t)]<<2|a[n.charCodeAt(t+1)]>>4,b[m++]=255&v):g===1&&(v=a[n.charCodeAt(t)]<<10|a[n.charCodeAt(t+1)]<<4|a[n.charCodeAt(t+2)]>>2,b[m++]=v>>8&255,b[m++]=255&v),b}function c(n){return o[n>>18&63]+o[n>>12&63]+o[n>>6&63]+o[63&n]}function p(n,t,h){for(var v,g=[],b=t;bm?m:E+16383));return v===1?(t=n[h-1],g+=o[t>>2],g+=o[t<<4&63],g+="=="):v===2&&(t=(n[h-2]<<8)+n[h-1],g+=o[t>>10],g+=o[t>>4&63],g+=o[t<<2&63],g+="="),b.push(g),b.join("")}w.byteLength=T,w.toByteArray=C,w.fromByteArray=u;for(var o=[],a=[],d=typeof Uint8Array!="undefined"?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",f=0,i=s.length;f>1,s=-7,f=T?c-1:0,i=T?-1:1,n=P[_+f];for(f+=i,p=n&(1<<-s)-1,n>>=-s,s+=o;s>0;p=256*p+P[_+f],f+=i,s-=8);for(u=p&(1<<-s)-1,p>>=-s,s+=C;s>0;u=256*u+P[_+f],f+=i,s-=8);if(p===0)p=1-d;else{if(p===a)return u?NaN:1/0*(n?-1:1);u+=Math.pow(2,C),p-=d}return(n?-1:1)*u*Math.pow(2,p-C)},w.write=function(P,_,T,C,c,p){var u,o,a,d=8*p-c-1,s=(1<>1,i=c===23?Math.pow(2,-24)-Math.pow(2,-77):0,n=C?0:p-1,t=C?1:-1,h=_<0||_===0&&1/_<0?1:0;for(_=Math.abs(_),isNaN(_)||_===1/0?(o=isNaN(_)?1:0,u=s):(u=Math.floor(Math.log(_)/Math.LN2),_*(a=Math.pow(2,-u))<1&&(u--,a*=2),_+=u+f>=1?i/a:i*Math.pow(2,1-f),_*a>=2&&(u++,a/=2),u+f>=s?(o=0,u=s):u+f>=1?(o=(_*a-1)*Math.pow(2,c),u+=f):(o=_*Math.pow(2,f-1)*Math.pow(2,c),u=0));c>=8;P[T+n]=255&o,n+=t,o/=256,c-=8);for(u=u<0;P[T+n]=255&u,n+=t,u/=256,d-=8);P[T+n-t]|=128*h}},function(j,w){var P={}.toString;j.exports=Array.isArray||function(_){return P.call(_)=="[object Array]"}},function(j,w,P){"use strict";function _(c,p){if(!(c instanceof p))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(w,"__esModule",{value:!0});var T=function(){function c(p,u){for(var o=0;o>>31}var E=(i<<5|i>>>27)+v+o[g];E+=g<20?1518500249+(n&t|~n&h):g<40?1859775393+(n^t^h):g<60?(n&t|n&h|t&h)-1894007588:(n^t^h)-899497514,v=h,h=t,t=n<<30|n>>>2,n=i,i=E}f[0]=f[0]+i|0,f[1]=f[1]+n|0,f[2]=f[2]+t|0,f[3]=f[3]+h|0,f[4]=f[4]+v|0},_doFinalize:function(){var d=this._data,s=d.words,f=8*this._nDataBytes,i=8*d.sigBytes;return s[i>>>5]|=128<<24-i%32,s[14+(i+64>>>9<<4)]=Math.floor(f/4294967296),s[15+(i+64>>>9<<4)]=f,d.sigBytes=4*s.length,this._process(),this._hash},clone:function(){var d=p.clone.call(this);return d._hash=this._hash.clone(),d}});T.SHA1=p._createHelper(a),T.HmacSHA1=p._createHmacHelper(a)}(),_.SHA1})},function(j,w,P){!function(_,T){j.exports=w=T(P(0))}(0,function(_){!function(){var T=_,C=T.lib,c=C.Base,p=T.enc,u=p.Utf8,o=T.algo;o.HMAC=c.extend({init:function(a,d){a=this._hasher=new a.init,typeof d=="string"&&(d=u.parse(d));var s=a.blockSize,f=4*s;d.sigBytes>f&&(d=a.finalize(d)),d.clamp();for(var i=this._oKey=d.clone(),n=this._iKey=d.clone(),t=i.words,h=n.words,v=0;v>>6-i%4*2;s[f>>>2]|=(n|t)<<24-f%4*8,f++}return p.create(s,f)}var C=_,c=C.lib,p=c.WordArray,u=C.enc;u.Base64={stringify:function(o){var a=o.words,d=o.sigBytes,s=this._map;o.clamp();for(var f=[],i=0;i>>2]>>>24-i%4*8&255,t=a[i+1>>>2]>>>24-(i+1)%4*8&255,h=a[i+2>>>2]>>>24-(i+2)%4*8&255,v=n<<16|t<<8|h,g=0;g<4&&i+.75*g>>6*(3-g)&63));var b=s.charAt(64);if(b)for(;f.length%4;)f.push(b);return f.join("")},parse:function(o){var a=o.length,d=this._map,s=this._reverseMap;if(!s){s=this._reverseMap=[];for(var f=0;f0&&(V=W.UploadProgress.UploadProgressList[0],X=V.ClientId),d.default.setClientId(X),x&&x(V)},function(W){W&&(l(W),console.log(W))})}}]),m}();w.default=E},function(j,w,P){"use strict";function _(u,o){if(!(u instanceof o))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(w,"__esModule",{value:!0});var T=function(){function u(o,a){for(var d=0;d=j.length?{done:!0}:{done:!1,value:j[_++]}},e:function(o){throw o},f:T}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var C=!0,c=!1,p;return{s:function(){P=j[Symbol.iterator]()},n:function(){var o=P.next();return C=o.done,o},e:function(o){c=!0,p=o},f:function(){try{!C&&P.return!=null&&P.return()}finally{if(c)throw p}}}}},rHrb:function(et,Ve,z){"use strict";Object.defineProperty(Ve,"__esModule",{value:!0}),Ve.CopyToClipboard=void 0;var le=j(z("q1tI")),Q=j(z("+QRC"));function j(t){return t&&t.__esModule?t:{default:t}}function w(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?w=function(v){return typeof v}:w=function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},w(t)}function P(t,h){var v=Object.keys(t);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(t);h&&(g=g.filter(function(b){return Object.getOwnPropertyDescriptor(t,b).enumerable})),v.push.apply(v,g)}return v}function _(t){for(var h=1;h=0)continue;if(!Object.prototype.propertyIsEnumerable.call(t,g))continue;v[g]=t[g]}}return v}function C(t,h){if(t==null)return{};var v={},g=Object.keys(t),b,E;for(E=0;E=0)continue;v[b]=t[b]}return v}function c(t,h){if(!(t instanceof h))throw new TypeError("Cannot call a class as a function")}function p(t,h){for(var v=0;v"']/,le=/[&<>"']/g,Q=/[<>"']|&(?!#?\w+;)/,j=/[<>"']|&(?!#?\w+;)/g,w={"&":"&","<":"<",">":">",'"':""","'":"'"},P=m=>w[m];function _(m,y){if(y){if(z.test(m))return m.replace(le,P)}else if(Q.test(m))return m.replace(j,P);return m}const T=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function C(m){return m.replace(T,(y,x)=>(x=x.toLowerCase(),x==="colon"?":":x.charAt(0)==="#"?x.charAt(1)==="x"?String.fromCharCode(parseInt(x.substring(2),16)):String.fromCharCode(+x.substring(1)):""))}const c=/(^|[^\[])\^/g;function p(m,y){m=m.source||m,y=y||"";const x={replace:(l,S)=>(S=S.source||S,S=S.replace(c,"$1"),m=m.replace(l,S),x),getRegex:()=>new RegExp(m,y)};return x}const u=/[^\w:]/g,o=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function a(m,y,x){if(m){let l;try{l=decodeURIComponent(C(x)).replace(u,"").toLowerCase()}catch(S){return null}if(l.indexOf("javascript:")===0||l.indexOf("vbscript:")===0||l.indexOf("data:")===0)return null}y&&!o.test(x)&&(x=n(y,x));try{x=encodeURI(x).replace(/%25/g,"%")}catch(l){return null}return x}const d={},s=/^[^:]+:\/*[^/]*$/,f=/^([^:]+:)[\s\S]*$/,i=/^([^:]+:\/*[^/]*)[\s\S]*$/;function n(m,y){d[" "+m]||(s.test(m)?d[" "+m]=m+"/":d[" "+m]=g(m,"/",!0)),m=d[" "+m];const x=m.indexOf(":")===-1;return y.substring(0,2)==="//"?x?y:m.replace(f,"$1")+y:y.charAt(0)==="/"?x?y:m.replace(i,"$1")+y:m+y}const t={exec:function(){}};function h(m){let y=1,x,l;for(;y{let I=!1,B=A;for(;--B>=0&&D[B]==="\\";)I=!I;return I?"|":" |"}),l=x.split(/ \|/);let S=0;if(l.length>y)l.splice(y);else for(;l.length=0;p--){var u=j().key(p);c(w(u),u)}}function T(c){return j().removeItem(c)}function C(){return j().clear()}},"s8/Y":function(et,Ve,z){et.exports=z.p+"static/jx.6713fc81.svg"},"sB/4":function(et,Ve,z){et.exports=z.p+"static/b.7405990c.svg"},sNtx:function(et,Ve,z){},sR1s:function(et,Ve,z){"use strict";z.d(Ve,"b",function(){return w}),z.d(Ve,"a",function(){return P}),z.d(Ve,"c",function(){return _}),z.d(Ve,"d",function(){return T});var le=z("U8pU"),Q="RC_TABLE_KEY";function j(C){return C==null?[]:Array.isArray(C)?C:[C]}function w(C,c){if(!c&&typeof c!="number")return C;for(var p=j(c),u=C,o=0;o1)Object(p.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(h.length===0)return Object(p.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var v=h[0];if(_.isValidElement(v)&&Object(u.c)(v)){var g=v.ref;h[0]=_.cloneElement(v,{ref:Object(u.a)(g,this.setChildNode)})}return h.length===1?h[0]:h.map(function(b,E){return!_.isValidElement(b)||"key"in b&&b.key!==null?b:_.cloneElement(b,{key:"".concat(a,"-").concat(E)})})}}]),i}(_.Component);d.displayName="ResizeObserver",Ve.a=d},twBr:function(et,Ve,z){et.exports=z.p+"static/s.1f286590.svg"},uMZB:function(et,Ve,z){et.exports={header:"header___3a50V",checkboxs:"checkboxs___3TnBC",field:"field___SHW6f","oj-form-container":"oj-form-container___36KBv","oj-left-panel":"oj-left-panel___3Fdj5","oj-form-info":"oj-form-info___dilPb",footer:"footer___1Ie9U","test-case-name":"test-case-name___356US","btn-remove-case":"btn-remove-case___1Z5cd","icon-tag":"icon-tag___3zUaP",btn_back:"btn_back___2UBbR",testJi:"testJi___1dyLk",upBtn:"upBtn___1I0SJ"}},uQRt:function(et,Ve,z){et.exports=le;function le(){return z("gaXo"),{}}},ulZh:function(et,Ve,z){typeof window!="undefined"&&function(Q,j){et.exports=j()}(this,function(){return function(le){var Q={};function j(w){if(Q[w])return Q[w].exports;var P=Q[w]={i:w,l:!1,exports:{}};return le[w].call(P.exports,P,P.exports,j),P.l=!0,P.exports}return j.m=le,j.c=Q,j.d=function(w,P,_){j.o(w,P)||Object.defineProperty(w,P,{enumerable:!0,get:_})},j.r=function(w){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(w,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(w,"__esModule",{value:!0})},j.t=function(w,P){if(P&1&&(w=j(w)),P&8)return w;if(P&4&&typeof w=="object"&&w&&w.__esModule)return w;var _=Object.create(null);if(j.r(_),Object.defineProperty(_,"default",{enumerable:!0,value:w}),P&2&&typeof w!="string")for(var T in w)j.d(_,T,function(C){return w[C]}.bind(null,T));return _},j.n=function(w){var P=w&&w.__esModule?function(){return w.default}:function(){return w};return j.d(P,"a",P),P},j.o=function(w,P){return Object.prototype.hasOwnProperty.call(w,P)},j.p="/dist/",j(j.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(le,Q,j){"use strict";var w=Object.prototype.hasOwnProperty,P="~";function _(){}Object.create&&(_.prototype=Object.create(null),new _().__proto__||(P=!1));function T(u,o,a){this.fn=u,this.context=o,this.once=a||!1}function C(u,o,a,d,s){if(typeof a!="function")throw new TypeError("The listener must be a function");var f=new T(a,d||u,s),i=P?P+o:o;return u._events[i]?u._events[i].fn?u._events[i]=[u._events[i],f]:u._events[i].push(f):(u._events[i]=f,u._eventsCount++),u}function c(u,o){--u._eventsCount===0?u._events=new _:delete u._events[o]}function p(){this._events=new _,this._eventsCount=0}p.prototype.eventNames=function(){var o=[],a,d;if(this._eventsCount===0)return o;for(d in a=this._events)w.call(a,d)&&o.push(P?d.slice(1):d);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(a)):o},p.prototype.listeners=function(o){var a=P?P+o:o,d=this._events[a];if(!d)return[];if(d.fn)return[d.fn];for(var s=0,f=d.length,i=new Array(f);s0},!1)}function u(o,a){for(var d={main:[a]},s={main:[]},f={main:{}};p(d);)for(var i=Object.keys(d),n=0;n=2*E/y||D<=B)return;var H=Number.POSITIVE_INFINITY,te;for(te=i.level-1;te>l;te--){var W=x[te].maxBitrate;if(H=E*W/(8*.8*A),H=D)return;var V=this.bwEstimator.getEstimate();p.logger.warn("Fragment "+i.sn+(n?" part "+n.index:"")+" of level "+i.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+te+` Current BW estimate: `+(Object(w.isFiniteNumber)(V)?(V/1024).toFixed(3):"Unknown")+` Kb/s Estimated load time for current fragment: `+D.toFixed(3)+` s Estimated load time for the next fragment: `+H.toFixed(3)+` s Time to underbuffer: `+B.toFixed(3)+" s"),t.nextLoadLevel=te,this.bwEstimator.sample(m,b.loaded),this.clearTimer(),i.loader&&(this.fragCurrent=this.partCurrent=null,i.loader.abort()),t.trigger(_.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:i,part:n,stats:b})},s.onFragLoaded=function(i,n){var t=n.frag,h=n.part;if(t.type===c.PlaylistLevelType.MAIN&&Object(w.isFiniteNumber)(t.sn)){var v=h?h.stats:t.stats,g=h?h.duration:t.duration;if(this.clearTimer(),this.lastLoadedFragLevel=t.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var b=this.hls.levels[t.level],E=(b.loaded?b.loaded.bytes:0)+v.loaded,m=(b.loaded?b.loaded.duration:0)+g;b.loaded={bytes:E,duration:m},b.realBitrate=Math.round(8*E/m)}if(t.bitrateTest){var y={stats:v,frag:t,part:h,id:t.type};this.onFragBuffered(_.Events.FRAG_BUFFERED,y),t.bitrateTest=!1}}},s.onFragBuffered=function(i,n){var t=n.frag,h=n.part,v=h?h.stats:t.stats;if(v.aborted)return;if(t.type!==c.PlaylistLevelType.MAIN||t.sn==="initSegment")return;var g=v.parsing.end-v.loading.start;this.bwEstimator.sample(g,v.loaded),v.bwEstimate=this.bwEstimator.getEstimate(),t.bitrateTest?this.bitrateTestDelay=g/1e3:this.bitrateTestDelay=0},s.onError=function(i,n){switch(n.details){case C.ErrorDetails.FRAG_LOAD_ERROR:case C.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},s.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},s.getNextABRAutoLevel=function(){var i=this.fragCurrent,n=this.partCurrent,t=this.hls,h=t.maxAutoLevel,v=t.config,g=t.minAutoLevel,b=t.media,E=n?n.duration:i?i.duration:0,m=b?b.currentTime:0,y=b&&b.playbackRate!==0?Math.abs(b.playbackRate):1,x=this.bwEstimator?this.bwEstimator.getEstimate():v.abrEwmaDefaultEstimate,l=(T.BufferHelper.bufferInfo(b,m,v.maxBufferHole).end-m)/y,S=this.findBestLevel(x,g,h,l,v.abrBandWidthFactor,v.abrBandWidthUpFactor);if(S>=0)return S;p.logger.trace((l?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var O=E?Math.min(E,v.maxStarvationDelay):v.maxStarvationDelay,A=v.abrBandWidthFactor,D=v.abrBandWidthUpFactor;if(!l){var I=this.bitrateTestDelay;if(I){var B=E?Math.min(E,v.maxLoadingDelay):v.maxLoadingDelay;O=B-I,p.logger.trace("bitrate test took "+Math.round(1e3*I)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*O)+" ms"),A=D=1}}return S=this.findBestLevel(x,g,h,l+O,A,D),Math.max(S,0)},s.findBestLevel=function(i,n,t,h,v,g){for(var b,E=this.fragCurrent,m=this.partCurrent,y=this.lastLoadedFragLevel,x=this.hls.levels,l=x[y],S=!!(l!=null&&(b=l.details)!==null&&b!==void 0&&b.live),O=l==null?void 0:l.codecSet,A=m?m.duration:E?E.duration:0,D=t;D>=n;D--){var I=x[D];if(!I||O&&I.codecSet!==O)continue;var B=I.details,H=(m?B==null?void 0:B.partTarget:B==null?void 0:B.averagetargetduration)||A,te=void 0;D<=y?te=v*i:te=g*i;var W=x[D].maxBitrate,V=W*H/te;if(p.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+D+"/"+Math.round(te)+"/"+W+"/"+H+"/"+h+"/"+V),te>W&&(!V||S&&!this.bitrateTestDelay||V0&&l===-1?(this.log("Override startPosition with lastCurrentTime @"+S.toFixed(3)),this.state=P.State.IDLE):(this.loadedmetadata=!1,this.state=P.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=l,this.tick()},y.doTick=function(){switch(this.state){case P.State.IDLE:this.doTickIdle();break;case P.State.WAITING_TRACK:{var l,S=this.levels,O=this.trackId,A=S==null||((l=S[O])===null||l===void 0)?void 0:l.details;if(A){if(this.waitForCdnTuneIn(A))break;this.state=P.State.WAITING_INIT_PTS}break}case P.State.FRAG_LOADING_WAITING_RETRY:{var D,I=performance.now(),B=this.retryDate;(!B||I>=B||(D=this.media)!==null&&D!==void 0&&D.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=P.State.IDLE);break}case P.State.WAITING_INIT_PTS:{var H=this.waitingData;if(H){var te=H.frag,W=H.part,V=H.cache,X=H.complete;if(this.initPTS[te.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=P.State.FRAG_LOADING;var ne=V.flush(),$={frag:te,part:W,payload:ne,networkDetails:null};this._handleFragmentLoadProgress($),X&&E.prototype._handleFragmentLoadComplete.call(this,$)}else if(this.videoTrackCC!==this.waitingVideoCC)n.logger.log("Waiting fragment cc ("+te.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var ee=this.getLoadPosition(),ce=T.BufferHelper.bufferInfo(this.mediaBuffer,ee,this.config.maxBufferHole),de=Object(s.fragmentWithinToleranceTest)(ce.end,this.config.maxFragLookUpTolerance,te);de<0&&(n.logger.log("Waiting fragment cc ("+te.cc+") @ "+te.start+" cancelled because another fragment at "+ce.end+" is needed"),this.clearWaitingFragment())}}else this.state=P.State.IDLE}}this.onTickEnd()},y.clearWaitingFragment=function(){var l=this.waitingData;l&&(this.fragmentTracker.removeFragment(l.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=P.State.IDLE)},y.onTickEnd=function(){var l=this.media;if(!l||!l.readyState)return;var S=this.mediaBuffer?this.mediaBuffer:l,O=S.buffered;!this.loadedmetadata&&O.length&&(this.loadedmetadata=!0),this.lastCurrentTime=l.currentTime},y.doTickIdle=function(){var l,S,O=this.hls,A=this.levels,D=this.media,I=this.trackId,B=O.config;if(!A||!A[I])return;if(!D&&(this.startFragRequested||!B.startFragPrefetch))return;var H=A[I],te=H.details;if(!te||te.live&&this.levelLastLoaded!==I||this.waitForCdnTuneIn(te)){this.state=P.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,u.ElementaryStreamTypes.AUDIO,p.PlaylistLevelType.AUDIO));var W=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,p.PlaylistLevelType.AUDIO);if(W===null)return;var V=W.len,X=this.getMaxBufferLength(),ne=this.audioSwitch;if(V>=X&&!ne)return;if(!ne&&this._streamEnded(W,te)){O.trigger(_.Events.BUFFER_EOS,{type:"audio"}),this.state=P.State.ENDED;return}var $=te.fragments,ee=$[0].start,ce=W.end;if(ne){var de=this.getLoadPosition();ce=de,te.PTSKnown&&deee||W.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),D.currentTime=ee+.05))}var Ce=this.getNextFragment(ce,te);if(!Ce){this.bufferFlushed=!0;return}((l=Ce.decryptdata)===null||l===void 0?void 0:l.keyFormat)==="identity"&&!((S=Ce.decryptdata)!==null&&S!==void 0&&S.key)?this.loadKey(Ce,te):this.loadFragment(Ce,te,ce)},y.getMaxBufferLength=function(){var l=E.prototype.getMaxBufferLength.call(this),S=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,p.PlaylistLevelType.MAIN);return S===null?l:Math.max(l,S.len)},y.onMediaDetaching=function(){this.videoBuffer=null,E.prototype.onMediaDetaching.call(this)},y.onAudioTracksUpdated=function(l,S){var O=S.audioTracks;this.resetTransmuxer(),this.levels=O.map(function(A){return new c.Level(A)})},y.onAudioTrackSwitching=function(l,S){var O=!!S.url;this.trackId=S.id;var A=this.fragCurrent;A!=null&&A.loader&&A.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),O?this.setInterval(g):this.resetTransmuxer(),O?(this.audioSwitch=!0,this.state=P.State.IDLE):this.state=P.State.STOPPED,this.tick()},y.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},y.onLevelLoaded=function(l,S){this.mainDetails=S.details},y.onAudioTrackLoaded=function(l,S){var O,A=this.levels,D=S.details,I=S.id;if(!A){this.warn("Audio tracks were reset while loading level "+I);return}this.log("Track "+I+" loaded ["+D.startSN+","+D.endSN+"],duration:"+D.totalduration);var B=A[I],H=0;if(D.live||(O=B.details)!==null&&O!==void 0&&O.live){var te=this.mainDetails;if(D.fragments[0]||(D.deltaUpdateFailed=!0),D.deltaUpdateFailed||!te)return;!B.details&&D.hasProgramDateTime&&te.hasProgramDateTime?(Object(f.alignMediaPlaylistByPDT)(D,te),H=D.fragments[0].start):H=this.alignPlaylists(D,B.details)}B.details=D,this.levelLastLoaded=I,!this.startFragRequested&&(this.mainDetails||!D.live)&&this.setStartPosition(B.details,H),this.state===P.State.WAITING_TRACK&&!this.waitForCdnTuneIn(D)&&(this.state=P.State.IDLE),this.tick()},y._handleFragmentLoadProgress=function(l){var S,O=l.frag,A=l.part,D=l.payload,I=this.config,B=this.trackId,H=this.levels;if(!H){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+O.sn+" of level "+O.level+" will not be buffered");return}var te=H[B];console.assert(te,"Audio track is defined on fragment load progress");var W=te.details;console.assert(W,"Audio track details are defined on fragment load progress");var V=I.defaultAudioCodec||te.audioCodec||"mp4a.40.2",X=this.transmuxer;X||(X=this.transmuxer=new a.default(this.hls,p.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var ne=this.initPTS[O.cc],$=(S=O.initSegment)===null||S===void 0?void 0:S.data;if(ne!==void 0){var ee=!1,ce=A?A.index:-1,de=ce!==-1,Ce=new d.ChunkMetadata(O.level,O.sn,O.stats.chunkCount,D.byteLength,ce,de);X.push(D,$,V,"",O,A,W.totalduration,ee,Ce,ne)}else{n.logger.log("Unknown video PTS for cc "+O.cc+", waiting for video PTS before demuxing audio frag "+O.sn+" of ["+W.startSN+" ,"+W.endSN+"],track "+B);var Se=this.waitingData=this.waitingData||{frag:O,part:A,cache:new o.default,complete:!1},De=Se.cache;De.push(new Uint8Array(D)),this.waitingVideoCC=this.videoTrackCC,this.state=P.State.WAITING_INIT_PTS}},y._handleFragmentLoadComplete=function(l){if(this.waitingData){this.waitingData.complete=!0;return}E.prototype._handleFragmentLoadComplete.call(this,l)},y.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},y.onBufferCreated=function(l,S){var O=S.tracks.audio;O&&(this.mediaBuffer=O.buffer),S.tracks.video&&(this.videoBuffer=S.tracks.video.buffer)},y.onFragBuffered=function(l,S){var O=S.frag,A=S.part;if(O.type!==p.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(O)){this.warn("Fragment "+O.sn+(A?" p: "+A.index:"")+" of level "+O.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}O.sn!=="initSegment"&&(this.fragPrevious=O,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(_.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(O,A)},y.onError=function(l,S){switch(S.details){case i.ErrorDetails.FRAG_LOAD_ERROR:case i.ErrorDetails.FRAG_LOAD_TIMEOUT:case i.ErrorDetails.KEY_LOAD_ERROR:case i.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(p.PlaylistLevelType.AUDIO,S);break;case i.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case i.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==P.State.ERROR&&this.state!==P.State.STOPPED&&(this.state=S.fatal?P.State.ERROR:P.State.IDLE,this.warn(S.details+" while loading frag, switching to "+this.state+" state"));break;case i.ErrorDetails.BUFFER_FULL_ERROR:if(S.parent==="audio"&&(this.state===P.State.PARSING||this.state===P.State.PARSED)){var O=!0,A=this.getFwdBufferInfo(this.mediaBuffer,p.PlaylistLevelType.AUDIO);A&&A.len>.5&&(O=!this.reduceMaxBufferLength(A.len)),O&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,E.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},y.onBufferFlushed=function(l,S){var O=S.type;O===u.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},y._handleTransmuxComplete=function(l){var S,O="audio",A=this.hls,D=l.remuxResult,I=l.chunkMeta,B=this.getCurrentContext(I);if(!B){this.warn("The loading context changed while buffering fragment "+I.sn+" of level "+I.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(I.level);return}var H=B.frag,te=B.part,W=D.audio,V=D.text,X=D.id3,ne=D.initSegment;if(this.fragContextChanged(H))return;if(this.state=P.State.PARSING,this.audioSwitch&&W&&this.completeAudioSwitch(),ne!=null&&ne.tracks&&(this._bufferInitSegment(ne.tracks,H,I),A.trigger(_.Events.FRAG_PARSING_INIT_SEGMENT,{frag:H,id:O,tracks:ne.tracks})),W){var $=W.startPTS,ee=W.endPTS,ce=W.startDTS,de=W.endDTS;te&&(te.elementaryStreams[u.ElementaryStreamTypes.AUDIO]={startPTS:$,endPTS:ee,startDTS:ce,endDTS:de}),H.setElementaryStreamInfo(u.ElementaryStreamTypes.AUDIO,$,ee,ce,de),this.bufferFragmentData(W,H,te,I)}if(X!=null&&(S=X.samples)!==null&&S!==void 0&&S.length){var Ce=t({frag:H,id:O},X);A.trigger(_.Events.FRAG_PARSING_METADATA,Ce)}if(V){var Se=t({frag:H,id:O},V);A.trigger(_.Events.FRAG_PARSING_USERDATA,Se)}},y._bufferInitSegment=function(l,S,O){if(this.state!==P.State.PARSING)return;l.video&&delete l.video;var A=l.audio;if(!A)return;A.levelCodec=A.codec,A.id="audio",this.log("Init audio buffer, container:"+A.container+", codecs[parsed]=["+A.codec+"]"),this.hls.trigger(_.Events.BUFFER_CODECS,l);var D=A.initSegment;if(D!=null&&D.byteLength){var I={type:"audio",frag:S,part:null,chunkMeta:O,parent:S.type,data:D};this.hls.trigger(_.Events.BUFFER_APPENDING,I)}this.tick()},y.loadFragment=function(l,S,O){var A=this.fragmentTracker.getState(l);this.fragCurrent=l,(this.audioSwitch||A===C.FragmentState.NOT_LOADED||A===C.FragmentState.PARTIAL)&&(l.sn==="initSegment"?this._loadInitSegment(l):S.live&&!Object(w.isFiniteNumber)(this.initPTS[l.cc])?(this.log("Waiting for video PTS in continuity counter "+l.cc+" of live stream before loading audio fragment "+l.sn+" of level "+this.trackId),this.state=P.State.WAITING_INIT_PTS):(this.startFragRequested=!0,E.prototype.loadFragment.call(this,l,S,O)))},y.completeAudioSwitch=function(){var l=this.hls,S=this.media,O=this.trackId;S&&(this.log("Switching audio track : flushing all audio"),E.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,l.trigger(_.Events.AUDIO_TRACK_SWITCHED,{id:O})},m}(P.default);Q.default=b},"./src/controller/audio-track-controller.ts":function(le,Q,j){"use strict";j.r(Q);var w=j("./src/events.ts"),P=j("./src/errors.ts"),_=j("./src/controller/base-playlist-controller.ts"),T=j("./src/types/loader.ts");function C(a,d){for(var s=0;s=n.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var t=n[this.trackId];this.log("Now switching to audio-track index "+i);var h=n[i],v=h.id,g=h.groupId,b=g===void 0?"":g,E=h.name,m=h.type,y=h.url;if(this.trackId=i,this.trackName=E,this.selectDefaultTrack=!1,this.hls.trigger(w.Events.AUDIO_TRACK_SWITCHING,{id:v,groupId:b,name:E,type:m,url:y}),h.details&&!h.details.live)return;var x=this.switchParams(h.url,t==null?void 0:t.details);this.loadPlaylist(x)},s.selectInitialTrack=function(){var i=this.tracksInGroup;console.assert(i.length,"Initial audio track should be selected when tracks are known");var n=this.trackName,t=this.findTrackId(n)||this.findTrackId();t!==-1?this.setAudioTrack(t):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(w.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},s.findTrackId=function(i){for(var n=this.tracksInGroup,t=0;td.partTarget&&(h+=1)}if(Object(w.isFiniteNumber)(t))return new P.HlsUrlParameters(t,Object(w.isFiniteNumber)(h)?h:void 0,P.HlsSkip.No)}}},u.loadPlaylist=function(a){},u.shouldLoadTrack=function(a){return this.canLoad&&a&&!!a.url&&(!a.details||a.details.live)},u.playlistLoaded=function(a,d,s){var f=this,i=d.details,n=d.stats,t=n.loading.end?Math.max(0,self.performance.now()-n.loading.end):0;if(i.advancedDateTime=Date.now()-t,i.live||s!=null&&s.live){if(i.reloaded(s),s&&this.log("live playlist "+a+" "+(i.advanced?"REFRESHED "+i.lastPartSn+"-"+i.lastPartIndex:"MISSED")),s&&i.fragments.length>0&&Object(_.mergeDetails)(s,i),!this.canLoad||!i.live)return;var h,v=void 0,g=void 0;if(i.canBlockReload&&i.endSN&&i.advanced){var b=this.hls.config.lowLatencyMode,E=i.lastPartSn,m=i.endSN,y=i.lastPartIndex,x=y!==-1,l=E===m,S=b?0:y;x?(v=l?m+1:E,g=l?S:y+1):v=m+1;var O=i.age,A=O+i.ageHeader,D=Math.min(A-i.partTarget,i.targetduration*1.5);if(D>0){if(s&&D>s.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+s.tuneInGoal+" to: "+D+" with playlist age: "+i.age),D=0;else{var I=Math.floor(D/i.targetduration);if(v+=I,g!==void 0){var B=Math.round(D%i.targetduration/i.partTarget);g+=B}this.log("CDN Tune-in age: "+i.ageHeader+"s last advanced "+O.toFixed(2)+"s goal: "+D+" skip sn "+I+" to part "+g)}i.tuneInGoal=D}if(h=this.getDeliveryDirectives(i,d.deliveryDirectives,v,g),b||!l){this.loadPlaylist(h);return}}else h=this.getDeliveryDirectives(i,d.deliveryDirectives,v,g);var H=Object(_.computeReloadInterval)(i,n);v!==void 0&&i.canBlockReload&&(H-=i.partTarget||1),this.log("reload live playlist "+a+" in "+Math.round(H)+" ms"),this.timer=self.setTimeout(function(){return f.loadPlaylist(h)},H)}else this.clearTimer()},u.getDeliveryDirectives=function(a,d,s,f){var i=Object(P.getSkipValue)(a,s);return d!=null&&d.skip&&a.deltaUpdateFailed&&(s=d.msn,f=d.part,i=P.HlsSkip.No),new P.HlsUrlParameters(s,f,i)},u.retryLoadingOrFail=function(a){var d=this,s=this.hls.config,f=this.retryCount-1&&(i=a.context)!==null&&i!==void 0&&i.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+a.details+'"'),this.loadPlaylist();else{var n=Math.min(Math.pow(2,this.retryCount)*s.levelLoadingRetryDelay,s.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return d.loadPlaylist()},n),this.warn("retry playlist loading #"+this.retryCount+" in "+n+' ms after "'+a.details+'"')}}else this.warn('cannot recover from error "'+a.details+'"'),this.clearTimer(),a.fatal=!0;return f},p}()},"./src/controller/base-stream-controller.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"State",function(){return m}),j.d(Q,"default",function(){return y});var w=j("./src/polyfills/number.ts"),P=j("./src/task-loop.ts"),_=j("./src/controller/fragment-tracker.ts"),T=j("./src/utils/buffer-helper.ts"),C=j("./src/utils/logger.ts"),c=j("./src/events.ts"),p=j("./src/errors.ts"),u=j("./src/types/transmuxer.ts"),o=j("./src/utils/mp4-tools.ts"),a=j("./src/utils/discontinuities.ts"),d=j("./src/controller/fragment-finders.ts"),s=j("./src/controller/level-helper.ts"),f=j("./src/loader/fragment-loader.ts"),i=j("./src/crypt/decrypter.ts"),n=j("./src/utils/time-ranges.ts"),t=j("./src/types/loader.ts");function h(x,l){for(var S=0;Sne;(te0&&te&&te.key&&te.iv&&te.method==="AES-128"){var W=self.performance.now();return D.decrypter.webCryptoDecrypt(new Uint8Array(H),te.key.buffer,te.iv.buffer).then(function(V){var X=self.performance.now();return B.trigger(c.Events.FRAG_DECRYPTED,{frag:A,payload:V,stats:{tstart:W,tdecrypt:X}}),I.payload=V,I})}return I}).then(function(I){var B=D.fragCurrent,H=D.hls,te=D.levels;if(!te)throw new Error("init load aborted, missing levels");var W=te[A.level].details;console.assert(W,"Level details are defined when init segment is loaded");var V=A.stats;D.state=m.IDLE,D.fragLoadError=0,A.data=new Uint8Array(I.payload),V.parsing.start=V.buffering.start=self.performance.now(),V.parsing.end=V.buffering.end=self.performance.now(),I.frag===B&&H.trigger(c.Events.FRAG_BUFFERED,{stats:V,frag:B,part:null,id:A.type}),D.tick()}).catch(function(I){D.warn(I),D.resetFragmentLoading(A)})},S.fragContextChanged=function(A){var D=this.fragCurrent;return!A||!D||A.level!==D.level||A.sn!==D.sn||A.urlId!==D.urlId},S.fragBufferedComplete=function(A,D){var I=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+A.type+" sn: "+A.sn+(D?" part: "+D.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+A.level+" "+n.default.toString(T.BufferHelper.getBuffered(I))),this.state=m.IDLE,this.tick()},S._handleFragmentLoadComplete=function(A){var D=this.transmuxer;if(!D)return;var I=A.frag,B=A.part,H=A.partsLoaded,te=!H||H.length===0||H.some(function(V){return!V}),W=new u.ChunkMetadata(I.level,I.sn,I.stats.chunkCount+1,0,B?B.index:-1,!te);D.flush(W)},S._handleFragmentLoadProgress=function(A){},S._doFragLoad=function(A,D,I,B){var H=this;if(I===void 0&&(I=null),!this.levels)throw new Error("frag load aborted, missing levels");if(I=Math.max(A.start,I||0),this.config.lowLatencyMode&&D){var te=D.partList;if(te&&B){I>A.end&&D.fragmentHint&&(A=D.fragmentHint);var W=this.getNextPart(te,A,I);if(W>-1){var V=te[W];return this.log("Loading part sn: "+A.sn+" p: "+V.index+" cc: "+A.cc+" of playlist ["+D.startSN+"-"+D.endSN+"] parts [0-"+W+"-"+(te.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+A.level+", target: "+parseFloat(I.toFixed(3))),this.nextLoadPosition=V.start+V.duration,this.state=m.FRAG_LOADING,this.hls.trigger(c.Events.FRAG_LOADING,{frag:A,part:te[W],targetBufferTime:I}),this.doFragPartsLoad(A,te,W,B).catch(function(X){return H.handleFragLoadError(X)})}else if(!A.url||this.loadedEndOfParts(te,I))return Promise.resolve(null)}}return this.log("Loading fragment "+A.sn+" cc: "+A.cc+" "+(D?"of ["+D.startSN+"-"+D.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+A.level+", target: "+parseFloat(I.toFixed(3))),Object(w.isFiniteNumber)(A.sn)&&!this.bitrateTest&&(this.nextLoadPosition=A.start+A.duration),this.state=m.FRAG_LOADING,this.hls.trigger(c.Events.FRAG_LOADING,{frag:A,targetBufferTime:I}),this.fragmentLoader.load(A,B).catch(function(X){return H.handleFragLoadError(X)})},S.doFragPartsLoad=function(A,D,I,B){var H=this;return new Promise(function(te,W){var V=[],X=function ne($){var ee=D[$];H.fragmentLoader.loadPart(A,ee,B).then(function(ce){V[ee.index]=ce;var de=ce.part;H.hls.trigger(c.Events.FRAG_LOADED,ce);var Ce=D[$+1];if(Ce&&Ce.fragment===A)ne($+1);else return te({frag:A,part:de,partsLoaded:V})}).catch(W)};X(I)})},S.handleFragLoadError=function(A){var D=A.data;return D&&D.details===p.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(D.frag,D.part):this.hls.trigger(c.Events.ERROR,D),null},S._handleTransmuxerFlush=function(A){var D=this.getCurrentContext(A);if(!D||this.state!==m.PARSING){this.fragCurrent||(this.state=m.IDLE);return}var I=D.frag,B=D.part,H=D.level,te=self.performance.now();I.stats.parsing.end=te,B&&(B.stats.parsing.end=te),this.updateLevelTiming(I,B,H,A.partial)},S.getCurrentContext=function(A){var D=this.levels,I=A.level,B=A.sn,H=A.part;if(!D||!D[I])return this.warn("Levels object was unset while buffering fragment "+B+" of level "+I+". The current chunk will not be buffered."),null;var te=D[I],W=H>-1?Object(s.getPartWith)(te,B,H):null,V=W?W.fragment:Object(s.getFragmentWithSN)(te,B,this.fragCurrent);return V?{frag:V,part:W,level:te}:null},S.bufferFragmentData=function(A,D,I,B){if(!A||this.state!==m.PARSING)return;var H=A.data1,te=A.data2,W=H;if(H&&te&&(W=Object(o.appendUint8Array)(H,te)),!W||!W.length)return;var V={type:A.type,frag:D,part:I,chunkMeta:B,parent:D.type,data:W};this.hls.trigger(c.Events.BUFFER_APPENDING,V),A.dropped&&A.independent&&!I&&this.flushBufferGap(D)},S.flushBufferGap=function(A){var D=this.media;if(!D)return;if(!T.BufferHelper.isBuffered(D,D.currentTime)){this.flushMainBuffer(0,A.start);return}var I=D.currentTime,B=T.BufferHelper.bufferInfo(D,I,0),H=A.duration,te=Math.min(this.config.maxFragLookUpTolerance*2,H*.25),W=Math.max(Math.min(A.start-te,B.end-te),I+te);A.start-W>te&&this.flushMainBuffer(W,A.start)},S.getFwdBufferInfo=function(A,D){var I=this.config,B=this.getLoadPosition();if(!Object(w.isFiniteNumber)(B))return null;var H=T.BufferHelper.bufferInfo(A,B,I.maxBufferHole);if(H.len===0&&H.nextStart!==void 0){var te=this.fragmentTracker.getBufferedFrag(B,D);if(te&&H.nextStart=I?(D.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+D.maxMaxBufferLength+"s"),!0):!1},S.getNextFragment=function(A,D){var I,B,H=D.fragments,te=H.length;if(!te)return null;var W=this.config,V=H[0].start,X;if(D.live){var ne=W.initialLiveManifestSize;if(te-1&&II.start&&I.loaded},S.getInitialLiveFragment=function(A,D){var I=this.fragPrevious,B=null;if(I){if(A.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+I.programDateTime),B=Object(d.findFragmentByPDT)(D,I.endProgramDateTime,this.config.maxFragLookUpTolerance)),!B){var H=I.sn+1;if(H>=A.startSN&&H<=A.endSN){var te=D[H-A.startSN];I.cc===te.cc&&(B=te,this.log("Live playlist, switching playlist, load frag with next SN: "+B.sn))}B||(B=Object(d.findFragWithCC)(D,I.cc),B&&this.log("Live playlist, switching playlist, load frag with same CC: "+B.sn))}}else{var W=this.hls.liveSyncPosition;W!==null&&(B=this.getFragmentAtPosition(W,this.bitrateTest?A.fragmentEnd:A.edge,A))}return B},S.getFragmentAtPosition=function(A,D,I){var B=this.config,H=this.fragPrevious,te=I.fragments,W=I.endSN,V=I.fragmentHint,X=B.maxFragLookUpTolerance,ne=!!(B.lowLatencyMode&&I.partList&&V);ne&&V&&!this.bitrateTest&&(te=te.concat(V),W=V.sn);var $;if(AD-X?0:X;$=Object(d.findFragmentByPTS)(H,te,A,ee)}else $=te[te.length-1];if($){var ce=$.sn-I.startSN,de=H&&$.level===H.level,Ce=te[ce+1],Se=this.fragmentTracker.getState($);if(Se===_.FragmentState.BACKTRACKED){$=null;for(var De=ce;te[De]&&this.fragmentTracker.getState(te[De])===_.FragmentState.BACKTRACKED;)H?$=te[De--]:$=te[--De];$||($=Ce)}else H&&$.sn===H.sn&&!ne&&(de&&($.sn=te-D.maxFragLookUpTolerance&&H<=W;if(B!==null&&I.duration>B&&(H"+A.startSN+" prev-sn: "+(H?H.sn:"na")+" fragments: "+W),$}return V},S.waitForCdnTuneIn=function(A){var D=3;return A.live&&A.canBlockReload&&A.tuneInGoal>Math.max(A.partHoldBack,A.partTarget*D)},S.setStartPosition=function(A,D){var I=this.startPosition;if(I"+A))}}]),l}(P.default)},"./src/controller/buffer-controller.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"default",function(){return d});var w=j("./src/polyfills/number.ts"),P=j("./src/events.ts"),_=j("./src/utils/logger.ts"),T=j("./src/errors.ts"),C=j("./src/utils/buffer-helper.ts"),c=j("./src/utils/mediasource-helper.ts"),p=j("./src/loader/fragment.ts"),u=j("./src/controller/buffer-operation-queue.ts"),o=Object(c.getMediaSource)(),a=/([ha]vc.)(?:\.[^.,]+)+/,d=function(){function s(i){var n=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 t=n.hls,h=n.media,v=n.mediaSource;_.logger.log("[buffer-controller]: Media source opened"),h&&(n.updateMediaElementDuration(),t.trigger(P.Events.MEDIA_ATTACHED,{media:h})),v&&v.removeEventListener("sourceopen",n._onMediaSourceOpen),n.checkPendingTracks()},this._onMediaSourceClose=function(){_.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){_.logger.log("[buffer-controller]: Media source ended")},this.hls=i,this._initSourceBuffer(),this.registerListeners()}var f=s.prototype;return f.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},f.destroy=function(){this.unregisterListeners(),this.details=null},f.registerListeners=function(){var n=this.hls;n.on(P.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),n.on(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.on(P.Events.MANIFEST_PARSED,this.onManifestParsed,this),n.on(P.Events.BUFFER_RESET,this.onBufferReset,this),n.on(P.Events.BUFFER_APPENDING,this.onBufferAppending,this),n.on(P.Events.BUFFER_CODECS,this.onBufferCodecs,this),n.on(P.Events.BUFFER_EOS,this.onBufferEos,this),n.on(P.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),n.on(P.Events.LEVEL_UPDATED,this.onLevelUpdated,this),n.on(P.Events.FRAG_PARSED,this.onFragParsed,this),n.on(P.Events.FRAG_CHANGED,this.onFragChanged,this)},f.unregisterListeners=function(){var n=this.hls;n.off(P.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),n.off(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.off(P.Events.MANIFEST_PARSED,this.onManifestParsed,this),n.off(P.Events.BUFFER_RESET,this.onBufferReset,this),n.off(P.Events.BUFFER_APPENDING,this.onBufferAppending,this),n.off(P.Events.BUFFER_CODECS,this.onBufferCodecs,this),n.off(P.Events.BUFFER_EOS,this.onBufferEos,this),n.off(P.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),n.off(P.Events.LEVEL_UPDATED,this.onLevelUpdated,this),n.off(P.Events.FRAG_PARSED,this.onFragParsed,this),n.off(P.Events.FRAG_CHANGED,this.onFragChanged,this)},f._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new u.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},f.onManifestParsed=function(n,t){var h=2;(t.audio&&!t.video||!t.altAudio)&&(h=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=h,this.details=null,_.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},f.onMediaAttaching=function(n,t){var h=this.media=t.media;if(h&&o){var v=this.mediaSource=new o;v.addEventListener("sourceopen",this._onMediaSourceOpen),v.addEventListener("sourceended",this._onMediaSourceEnded),v.addEventListener("sourceclose",this._onMediaSourceClose),h.src=self.URL.createObjectURL(v),this._objectUrl=h.src}},f.onMediaDetaching=function(){var n=this.media,t=this.mediaSource,h=this._objectUrl;if(t){if(_.logger.log("[buffer-controller]: media source detaching"),t.readyState==="open")try{t.endOfStream()}catch(v){_.logger.warn("[buffer-controller]: onMediaDetaching: "+v.message+" while calling endOfStream")}this.onBufferReset(),t.removeEventListener("sourceopen",this._onMediaSourceOpen),t.removeEventListener("sourceended",this._onMediaSourceEnded),t.removeEventListener("sourceclose",this._onMediaSourceClose),n&&(h&&self.URL.revokeObjectURL(h),n.src===h?(n.removeAttribute("src"),n.load()):_.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(P.Events.MEDIA_DETACHED,void 0)},f.onBufferReset=function(){var n=this;this.getSourceBufferTypes().forEach(function(t){var h=n.sourceBuffer[t];try{h&&(n.removeBufferListeners(t),n.mediaSource&&n.mediaSource.removeSourceBuffer(h),n.sourceBuffer[t]=void 0)}catch(v){_.logger.warn("[buffer-controller]: Failed to reset the "+t+" buffer",v)}}),this._initSourceBuffer()},f.onBufferCodecs=function(n,t){var h=this,v=this.getSourceBufferTypes().length;if(Object.keys(t).forEach(function(g){if(v){var b=h.tracks[g];if(b&&typeof b.buffer.changeType=="function"){var E=t[g],m=E.codec,y=E.levelCodec,x=E.container,l=(b.levelCodec||b.codec).replace(a,"$1"),S=(y||m).replace(a,"$1");if(l!==S){var O=x+";codecs="+(y||m);h.appendChangeType(g,O)}}}else h.pendingTracks[g]=t[g]}),v)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},f.appendChangeType=function(n,t){var h=this,v=this.operationQueue,g={execute:function(){var E=h.sourceBuffer[n];E&&(_.logger.log("[buffer-controller]: changing "+n+" sourceBuffer type to "+t),E.changeType(t)),v.shiftAndExecuteNext(n)},onStart:function(){},onComplete:function(){},onError:function(E){_.logger.warn("[buffer-controller]: Failed to change "+n+" SourceBuffer type",E)}};v.append(g,n)},f.onBufferAppending=function(n,t){var h=this,v=this.hls,g=this.operationQueue,b=this.tracks,E=t.data,m=t.type,y=t.frag,x=t.part,l=t.chunkMeta,S=l.buffering[m],O=self.performance.now();S.start=O;var A=y.stats.buffering,D=x?x.stats.buffering:null;A.start===0&&(A.start=O),D&&D.start===0&&(D.start=O);var I=b.audio,B=m==="audio"&&l.id===1&&(I==null?void 0:I.container)==="audio/mpeg",H={execute:function(){if(S.executeStart=self.performance.now(),B){var W=h.sourceBuffer[m];if(W){var V=y.start-W.timestampOffset;Math.abs(V)>=.1&&(_.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+y.start+" (delta: "+V+") sn: "+y.sn+")"),W.timestampOffset=y.start)}}h.appendExecutor(E,m)},onStart:function(){},onComplete:function(){var W=self.performance.now();S.executeEnd=S.end=W,A.first===0&&(A.first=W),D&&D.first===0&&(D.first=W);var V=h.sourceBuffer,X={};for(var ne in V)X[ne]=C.BufferHelper.getBuffered(V[ne]);h.appendError=0,h.hls.trigger(P.Events.BUFFER_APPENDED,{type:m,frag:y,part:x,chunkMeta:l,parent:y.type,timeRanges:X})},onError:function(W){_.logger.error("[buffer-controller]: Error encountered while trying to append to the "+m+" SourceBuffer",W);var V={type:T.ErrorTypes.MEDIA_ERROR,parent:y.type,details:T.ErrorDetails.BUFFER_APPEND_ERROR,err:W,fatal:!1};W.code===DOMException.QUOTA_EXCEEDED_ERR?V.details=T.ErrorDetails.BUFFER_FULL_ERROR:(h.appendError++,V.details=T.ErrorDetails.BUFFER_APPEND_ERROR,h.appendError>v.config.appendErrorMaxRetry&&(_.logger.error("[buffer-controller]: Failed "+v.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),V.fatal=!0)),v.trigger(P.Events.ERROR,V)}};g.append(H,m)},f.onBufferFlushing=function(n,t){var h=this,v=this.operationQueue,g=function(E){return{execute:h.removeExecutor.bind(h,E,t.startOffset,t.endOffset),onStart:function(){},onComplete:function(){h.hls.trigger(P.Events.BUFFER_FLUSHED,{type:E})},onError:function(y){_.logger.warn("[buffer-controller]: Failed to remove from "+E+" SourceBuffer",y)}}};t.type?v.append(g(t.type),t.type):this.getSourceBufferTypes().forEach(function(b){v.append(g(b),b)})},f.onFragParsed=function(n,t){var h=this,v=t.frag,g=t.part,b=[],E=g?g.elementaryStreams:v.elementaryStreams;E[p.ElementaryStreamTypes.AUDIOVIDEO]?b.push("audiovideo"):(E[p.ElementaryStreamTypes.AUDIO]&&b.push("audio"),E[p.ElementaryStreamTypes.VIDEO]&&b.push("video"));var m=function(){var x=self.performance.now();v.stats.buffering.end=x,g&&(g.stats.buffering.end=x);var l=g?g.stats:v.stats;h.hls.trigger(P.Events.FRAG_BUFFERED,{frag:v,part:g,stats:l,id:v.type})};b.length===0&&_.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+v.type+" level: "+v.level+" sn: "+v.sn),this.blockBuffers(m,b)},f.onFragChanged=function(n,t){this.flushBackBuffer()},f.onBufferEos=function(n,t){var h=this,v=this.getSourceBufferTypes().reduce(function(g,b){var E=h.sourceBuffer[b];return(!t.type||t.type===b)&&(E&&!E.ended&&(E.ended=!0,_.logger.log("[buffer-controller]: "+b+" sourceBuffer now EOS"))),g&&!!(!E||E.ended)},!0);v&&this.blockBuffers(function(){var g=h.mediaSource;if(!g||g.readyState!=="open")return;g.endOfStream()})},f.onLevelUpdated=function(n,t){var h=t.details;if(!h.fragments.length)return;this.details=h,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},f.flushBackBuffer=function(){var n=this.hls,t=this.details,h=this.media,v=this.sourceBuffer;if(!h||t===null)return;var g=this.getSourceBufferTypes();if(!g.length)return;var b=t.live&&n.config.liveBackBufferLength!==null?n.config.liveBackBufferLength:n.config.backBufferLength;if(!Object(w.isFiniteNumber)(b)||b<0)return;var E=h.currentTime,m=t.levelTargetDuration,y=Math.max(b,m),x=Math.floor(E/m)*m-y;g.forEach(function(l){var S=v[l];if(S){var O=C.BufferHelper.getBuffered(S);O.length>0&&x>O.start(0)&&(n.trigger(P.Events.BACK_BUFFER_REACHED,{bufferEnd:x}),t.live&&n.trigger(P.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:x}),n.trigger(P.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:x,type:l}))}})},f.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var n=this.details,t=this.hls,h=this.media,v=this.mediaSource,g=n.fragments[0].start+n.totalduration,b=h.duration,E=Object(w.isFiniteNumber)(v.duration)?v.duration:0;n.live&&t.config.liveDurationInfinity?(_.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),v.duration=Infinity,this.updateSeekableRange(n)):(g>E&&g>b||!Object(w.isFiniteNumber)(b))&&(_.logger.log("[buffer-controller]: Updating Media Source duration to "+g.toFixed(3)),v.duration=g)},f.updateSeekableRange=function(n){var t=this.mediaSource,h=n.fragments,v=h.length;if(v&&n.live&&t!==null&&t!==void 0&&t.setLiveSeekableRange){var g=Math.max(0,h[0].start),b=Math.max(g,g+n.totalduration);t.setLiveSeekableRange(g,b)}},f.checkPendingTracks=function(){var n=this.bufferCodecEventsExpected,t=this.operationQueue,h=this.pendingTracks,v=Object.keys(h).length;if(v&&!n||v===2){this.createSourceBuffers(h),this.pendingTracks={};var g=this.getSourceBufferTypes();if(g.length===0){this.hls.trigger(P.Events.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}g.forEach(function(b){t.executeNext(b)})}},f.createSourceBuffers=function(n){var t=this.sourceBuffer,h=this.mediaSource;if(!h)throw Error("createSourceBuffers called when mediaSource was null");var v=0;for(var g in n)if(!t[g]){var b=n[g];if(!b)throw Error("source buffer exists for track "+g+", however track does not");var E=b.levelCodec||b.codec,m=b.container+";codecs="+E;_.logger.log("[buffer-controller]: creating sourceBuffer("+m+")");try{var y=t[g]=h.addSourceBuffer(m),x=g;this.addBufferListener(x,"updatestart",this._onSBUpdateStart),this.addBufferListener(x,"updateend",this._onSBUpdateEnd),this.addBufferListener(x,"error",this._onSBUpdateError),this.tracks[g]={buffer:y,codec:E,container:b.container,levelCodec:b.levelCodec,id:b.id},v++}catch(l){_.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+l.message),this.hls.trigger(P.Events.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:l,mimeType:m})}}v&&this.hls.trigger(P.Events.BUFFER_CREATED,{tracks:this.tracks})},f._onSBUpdateStart=function(n){var t=this.operationQueue,h=t.current(n);h.onStart()},f._onSBUpdateEnd=function(n){var t=this.operationQueue,h=t.current(n);h.onComplete(),t.shiftAndExecuteNext(n)},f._onSBUpdateError=function(n,t){_.logger.error("[buffer-controller]: "+n+" SourceBuffer error",t),this.hls.trigger(P.Events.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var h=this.operationQueue.current(n);h&&h.onError(t)},f.removeExecutor=function(n,t,h){var v=this.media,g=this.mediaSource,b=this.operationQueue,E=this.sourceBuffer,m=E[n];if(!v||!g||!m){_.logger.warn("[buffer-controller]: Attempting to remove from the "+n+" SourceBuffer, but it does not exist"),b.shiftAndExecuteNext(n);return}var y=Object(w.isFiniteNumber)(v.duration)?v.duration:Infinity,x=Object(w.isFiniteNumber)(g.duration)?g.duration:Infinity,l=Math.max(0,t),S=Math.min(h,y,x);S>l?(_.logger.log("[buffer-controller]: Removing ["+l+","+S+"] from the "+n+" SourceBuffer"),console.assert(!m.updating,n+" sourceBuffer must not be updating"),m.remove(l,S)):b.shiftAndExecuteNext(n)},f.appendExecutor=function(n,t){var h=this.operationQueue,v=this.sourceBuffer,g=v[t];if(!g){_.logger.warn("[buffer-controller]: Attempting to append to the "+t+" SourceBuffer, but it does not exist"),h.shiftAndExecuteNext(t);return}g.ended=!1,console.assert(!g.updating,t+" sourceBuffer must not be updating"),g.appendBuffer(n)},f.blockBuffers=function(n,t){var h=this;if(t===void 0&&(t=this.getSourceBufferTypes()),!t.length){_.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(n);return}var v=this.operationQueue,g=t.map(function(b){return v.appendBlocker(b)});Promise.all(g).then(function(){n(),t.forEach(function(b){var E=h.sourceBuffer[b];(!E||!E.updating)&&v.shiftAndExecuteNext(b)})})},f.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},f.addBufferListener=function(n,t,h){var v=this.sourceBuffer[n];if(!v)return;var g=h.bind(this,n);this.listeners[n].push({event:t,listener:g}),v.addEventListener(t,g)},f.removeBufferListeners=function(n){var t=this.sourceBuffer[n];if(!t)return;this.listeners[n].forEach(function(h){t.removeEventListener(h.event,h.listener)})},s}()},"./src/controller/buffer-operation-queue.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"default",function(){return P});var w=j("./src/utils/logger.ts"),P=function(){function _(C){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=C}var T=_.prototype;return T.append=function(c,p){var u=this.queues[p];u.push(c),u.length===1&&this.buffers[p]&&this.executeNext(p)},T.insertAbort=function(c,p){var u=this.queues[p];u.unshift(c),this.executeNext(p)},T.appendBlocker=function(c){var p,u=new Promise(function(a){p=a}),o={execute:p,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(o,c),u},T.executeNext=function(c){var p=this.buffers,u=this.queues,o=p[c],a=u[c];if(a.length){var d=a[0];try{d.execute()}catch(s){w.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),d.onError(s),(!o||!o.updating)&&(a.shift(),this.executeNext(c))}}},T.shiftAndExecuteNext=function(c){this.queues[c].shift(),this.executeNext(c)},T.current=function(c){return this.queues[c][0]},_}()},"./src/controller/cap-level-controller.ts":function(le,Q,j){"use strict";j.r(Q);var w=j("./src/events.ts");function P(C,c){for(var p=0;p0&&this.mediaWidth>0){var u=this.hls.levels;if(u.length){var o=this.hls;o.autoLevelCapping=this.getMaxLevel(u.length-1),o.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=o.autoLevelCapping}}},c.getMaxLevel=function(u){var o=this,a=this.hls.levels;if(!a.length)return-1;var d=a.filter(function(s,f){return C.isLevelAllowed(f,o.restrictedLevels)&&f<=u});return this.clientRect=null,C.getMaxLevelByMediaSize(d,this.mediaWidth,this.mediaHeight)},c.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()},c.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},c.getDimensions=function(){if(this.clientRect)return this.clientRect;var u=this.media,o={width:0,height:0};if(u){var a=u.getBoundingClientRect();o.width=a.width,o.height=a.height,!o.width&&!o.height&&(o.width=a.right-a.left||u.width||0,o.height=a.bottom-a.top||u.height||0)}return this.clientRect=o,o},C.isLevelAllowed=function(u,o){return o===void 0&&(o=[]),o.indexOf(u)===-1},C.getMaxLevelByMediaSize=function(u,o,a){if(!u||!u.length)return-1;for(var d=function(t,h){return h?t.width!==h.width||t.height!==h.height:!0},s=u.length-1,f=0;f=o||i.height>=a)&&d(i,u[f+1])){s=f;break}}return s},_(C,[{key:"mediaWidth",get:function(){return this.getDimensions().width*C.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*C.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var u=1;try{u=self.devicePixelRatio}catch(o){}return u}}]),C}();Q.default=T},"./src/controller/cmcd-controller.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"default",function(){return d});var w=j("./src/events.ts"),P=j("./src/types/cmcd.ts"),_=j("./src/utils/buffer-helper.ts"),T=j("./src/utils/logger.ts");function C(s,f){for(var i=0;i=s.length?{done:!0}:{done:!1,value:s[n++]}}}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 u(s,f){if(!s)return;if(typeof s=="string")return o(s,f);var i=Object.prototype.toString.call(s).slice(8,-1);if(i==="Object"&&s.constructor&&(i=s.constructor.name),i==="Map"||i==="Set")return Array.from(s);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return o(s,f)}function o(s,f){(f==null||f>s.length)&&(f=s.length);for(var i=0,n=new Array(f);it&&(t=b.bitrate)}return t>0?t:NaN},f.getBufferLength=function(n){var t=this.hls.media,h=n===P.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!h||!t)return NaN;var v=_.BufferHelper.bufferInfo(h,t.currentTime,this.config.maxBufferHole);return v.len*1e3},f.createPlaylistLoader=function(){var n=this.config.pLoader,t=this.applyPlaylistData,h=n||this.config.loader;return function(){function v(b){this.loader=void 0,this.loader=new h(b)}var g=v.prototype;return g.destroy=function(){this.loader.destroy()},g.abort=function(){this.loader.abort()},g.load=function(E,m,y){t(E),this.loader.load(E,m,y)},c(v,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),v}()},f.createFragmentLoader=function(){var n=this.config.fLoader,t=this.applyFragmentData,h=n||this.config.loader;return function(){function v(b){this.loader=void 0,this.loader=new h(b)}var g=v.prototype;return g.destroy=function(){this.loader.destroy()},g.abort=function(){this.loader.abort()},g.load=function(E,m,y){t(E),this.loader.load(E,m,y)},c(v,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),v}()},s.uuid=function(){var n=URL.createObjectURL(new Blob),t=n.toString();return URL.revokeObjectURL(n),t.substr(t.lastIndexOf("/")+1)},s.serialize=function(n){for(var t=[],h=function(B){return!Number.isNaN(B)&&B!=null&&B!==""&&B!==!1},v=function(B){return Math.round(B)},g=function(B){return v(B/100)*100},b=function(B){return encodeURIComponent(B)},E={br:v,d:v,bl:g,dl:g,mtp:g,nor:b,rtp:g,tb:v},m=Object.keys(n||{}).sort(),y=p(m),x;!(x=y()).done;){var l=x.value,S=n[l];if(!h(S))continue;if(l==="v"&&S===1)continue;if(l=="pr"&&S===1)continue;var O=E[l];O&&(S=O(S));var A=typeof S,D=void 0;l==="ot"||l==="sf"||l==="st"?D=l+"="+S:A==="boolean"?D=l:A==="number"?D=l+"="+S:D=l+"="+JSON.stringify(S),t.push(D)}return t.join(",")},s.toHeaders=function(n){for(var t=Object.keys(n),h={},v=["Object","Request","Session","Status"],g=[{},{},{},{}],b={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},E=0,m=t;Ep){this.hls.trigger(w.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var b=p-this._requestLicenseFailureCount+1;_.logger.warn("Retrying license request, "+b+" attempts left"),this._requestLicense(t,h)}break}},s._generateLicenseRequestChallenge=function(i,n){switch(i.mediaKeySystemDomain){case T.KeySystems.WIDEVINE:return n}throw new Error("unsupported key-system: "+i.mediaKeySystemDomain)},s._requestLicense=function(i,n){_.logger.log("Requesting content license for key-system");var t=this._mediaKeysList[0];if(!t){_.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(w.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var h=this.getLicenseServerUrl(t.mediaKeySystemDomain),v=this._createLicenseXhr(h,i,n);_.logger.log("Sending license request to URL: "+h);var g=this._generateLicenseRequestChallenge(t,i);v.send(g)}catch(b){_.logger.error("Failure requesting DRM license: "+b),this.hls.trigger(w.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},s.onMediaAttached=function(i,n){if(!this._emeEnabled)return;var t=n.media;this._media=t,t.addEventListener("encrypted",this._onMediaEncrypted)},s.onMediaDetached=function(){var i=this._media,n=this._mediaKeysList;if(!i)return;i.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(n.map(function(t){if(t.mediaKeysSession)return t.mediaKeysSession.close().catch(function(){})})).then(function(){return i.setMediaKeys(null)}).catch(function(){})},s.onManifestParsed=function(i,n){if(!this._emeEnabled)return;var t=n.levels.map(function(v){return v.audioCodec}).filter(function(v){return!!v}),h=n.levels.map(function(v){return v.videoCodec}).filter(function(v){return!!v});this._attemptKeySystemAccess(T.KeySystems.WIDEVINE,t,h)},c(d,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),d}();Q.default=a},"./src/controller/fps-controller.ts":function(le,Q,j){"use strict";j.r(Q);var w=j("./src/events.ts"),P=j("./src/utils/logger.ts"),_=function(){function T(c){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=c,this.registerListeners()}var C=T.prototype;return C.setStreamController=function(p){this.streamController=p},C.registerListeners=function(){this.hls.on(w.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},C.unregisterListeners=function(){this.hls.off(w.Events.MEDIA_ATTACHING,this.onMediaAttaching)},C.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},C.onMediaAttaching=function(p,u){var o=this.hls.config;if(o.capLevelOnFPSDrop){var a=u.media instanceof self.HTMLVideoElement?u.media:null;this.media=a,a&&typeof a.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),o.fpsDroppedMonitoringPeriod)}},C.checkFPS=function(p,u,o){var a=performance.now();if(u){if(this.lastTime){var d=a-this.lastTime,s=o-this.lastDroppedFrames,f=u-this.lastDecodedFrames,i=1e3*s/d,n=this.hls;if(n.trigger(w.Events.FPS_DROP,{currentDropped:s,currentDecoded:f,totalDroppedFrames:o}),i>0&&s>n.config.fpsDroppedMonitoringThreshold*f){var t=n.currentLevel;P.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+t),t>0&&(n.autoLevelCapping===-1||n.autoLevelCapping>=t)&&(t=t-1,n.trigger(w.Events.FPS_DROP_LEVEL_CAPPING,{level:t,droppedLevel:n.currentLevel}),n.autoLevelCapping=t,this.streamController.nextLevelSwitch())}}this.lastTime=a,this.lastDroppedFrames=o,this.lastDecodedFrames=u}},C.checkFPSInterval=function(){var p=this.media;if(p)if(this.isVideoPlaybackQualityAvailable){var u=p.getVideoPlaybackQuality();this.checkFPS(p,u.totalVideoFrames,u.droppedVideoFrames)}else this.checkFPS(p,p.webkitDecodedFrameCount,p.webkitDroppedFrameCount)},T}();Q.default=_},"./src/controller/fragment-finders.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"findFragmentByPDT",function(){return _}),j.d(Q,"findFragmentByPTS",function(){return T}),j.d(Q,"fragmentWithinToleranceTest",function(){return C}),j.d(Q,"pdtWithinToleranceTest",function(){return c}),j.d(Q,"findFragWithCC",function(){return p});var w=j("./src/polyfills/number.ts"),P=j("./src/utils/binary-search.ts");function _(u,o,a){if(o===null||!Array.isArray(u)||!u.length||!Object(w.isFiniteNumber)(o))return null;var d=u[0].programDateTime;if(o<(d||0))return null;var s=u[u.length-1].endProgramDateTime;if(o>=(s||0))return null;a=a||0;for(var f=0;fu&&a.start?-1:0}function c(u,o,a){var d=Math.min(o,a.duration+(a.deltaPTS?a.deltaPTS:0))*1e3,s=a.endProgramDateTime||0;return s-d>u}function p(u,o){return P.default.search(u,function(a){return a.cco?-1:0})}},"./src/controller/fragment-tracker.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"FragmentState",function(){return _}),j.d(Q,"FragmentTracker",function(){return T});var w=j("./src/events.ts"),P=j("./src/types/loader.ts"),_;(function(p){p.NOT_LOADED="NOT_LOADED",p.BACKTRACKED="BACKTRACKED",p.APPENDING="APPENDING",p.PARTIAL="PARTIAL",p.OK="OK"})(_||(_={}));var T=function(){function p(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 u=p.prototype;return u._registerListeners=function(){var a=this.hls;a.on(w.Events.BUFFER_APPENDED,this.onBufferAppended,this),a.on(w.Events.FRAG_BUFFERED,this.onFragBuffered,this),a.on(w.Events.FRAG_LOADED,this.onFragLoaded,this)},u._unregisterListeners=function(){var a=this.hls;a.off(w.Events.BUFFER_APPENDED,this.onBufferAppended,this),a.off(w.Events.FRAG_BUFFERED,this.onFragBuffered,this),a.off(w.Events.FRAG_LOADED,this.onFragLoaded,this)},u.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},u.getAppendedFrag=function(a,d){if(d===P.PlaylistLevelType.MAIN){var s=this.activeFragment,f=this.activeParts;if(!s)return null;if(f)for(var i=f.length;i--;){var n=f[i],t=n?n.end:s.appendedPTS;if(n.start<=a&&t!==void 0&&a<=t)return i>9&&(this.activeParts=f.slice(i-9)),n}else if(s.start<=a&&s.appendedPTS!==void 0&&a<=s.appendedPTS)return s}return this.getBufferedFrag(a,d)},u.getBufferedFrag=function(a,d){for(var s=this.fragments,f=Object.keys(s),i=f.length;i--;){var n=s[f[i]];if((n==null?void 0:n.body.type)===d&&n.buffered){var t=n.body;if(t.start<=a&&a<=t.end)return t}}return null},u.detectEvictedFragments=function(a,d,s){var f=this;Object.keys(this.fragments).forEach(function(i){var n=f.fragments[i];if(!n)return;if(!n.buffered){n.body.type===s&&f.removeFragment(n.body);return}var t=n.range[a];if(!t)return;t.time.some(function(h){var v=!f.isTimeBuffered(h.startPTS,h.endPTS,d);return v&&f.removeFragment(n.body),v})})},u.detectPartialFragments=function(a){var d=this,s=this.timeRanges,f=a.frag,i=a.part;if(!s||f.sn==="initSegment")return;var n=c(f),t=this.fragments[n];if(!t)return;Object.keys(s).forEach(function(h){var v=f.elementaryStreams[h];if(!v)return;var g=s[h],b=i!==null||v.partial===!0;t.range[h]=d.getBufferedTimes(f,i,b,g)}),t.backtrack=t.loaded=null,Object.keys(t.range).length?t.buffered=!0:this.removeFragment(t.body)},u.fragBuffered=function(a){var d=c(a),s=this.fragments[d];s&&(s.backtrack=s.loaded=null,s.buffered=!0)},u.getBufferedTimes=function(a,d,s,f){for(var i={time:[],partial:s},n=d?d.start:a.start,t=d?d.end:a.end,h=a.minEndPTS||t,v=a.maxStartPTS||n,g=0;g=b&&h<=E){i.time.push({startPTS:Math.max(n,f.start(g)),endPTS:Math.min(t,f.end(g))});break}else if(nb)i.partial=!0,i.time.push({startPTS:Math.max(n,f.start(g)),endPTS:Math.min(t,f.end(g))});else if(t<=b)break}return i},u.getPartialFragment=function(a){var d=null,s,f,i,n=0,t=this.bufferPadding,h=this.fragments;return Object.keys(h).forEach(function(v){var g=h[v];if(!g)return;C(g)&&(f=g.body.start-t,i=g.body.end+t,a>=f&&a<=i&&(s=Math.min(a-f,i-a),n<=s&&(d=g.body,n=s)))}),d},u.getState=function(a){var d=c(a),s=this.fragments[d];return s?s.buffered?C(s)?_.PARTIAL:_.OK:s.backtrack?_.BACKTRACKED:_.APPENDING:_.NOT_LOADED},u.backtrack=function(a,d){var s=c(a),f=this.fragments[s];if(!f||f.backtrack)return null;var i=f.backtrack=d||f.loaded;return f.loaded=null,i},u.getBacktrackData=function(a){var d=c(a),s=this.fragments[d];if(s){var f,i=s.backtrack;if(i!=null&&(f=i.payload)!==null&&f!==void 0&&f.byteLength)return i;this.removeFragment(a)}return null},u.isTimeBuffered=function(a,d,s){for(var f,i,n=0;n=f&&d<=i)return!0;if(d<=f)return!1}return!1},u.onFragLoaded=function(a,d){var s=d.frag,f=d.part;if(s.sn==="initSegment"||s.bitrateTest||f)return;var i=c(s);this.fragments[i]={body:s,loaded:d,backtrack:null,buffered:!1,range:Object.create(null)}},u.onBufferAppended=function(a,d){var s=this,f=d.frag,i=d.part,n=d.timeRanges;if(f.type===P.PlaylistLevelType.MAIN)if(this.activeFragment=f,i){var t=this.activeParts;t||(this.activeParts=t=[]),t.push(i)}else this.activeParts=null;this.timeRanges=n,Object.keys(n).forEach(function(h){var v=n[h];if(s.detectEvictedFragments(h,v),!i)for(var g=0;ga&&f.removeFragment(t)}})},u.removeFragment=function(a){var d=c(a);a.stats.loaded=0,a.clearElementaryStreamInfo(),delete this.fragments[d]},u.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},p}();function C(p){var u,o;return p.buffered&&(((u=p.range.video)===null||u===void 0?void 0:u.partial)||((o=p.range.audio)===null||o===void 0?void 0:o.partial))}function c(p){return p.type+"_"+p.level+"_"+p.urlId+"_"+p.sn}},"./src/controller/gap-controller.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"STALL_MINIMUM_DURATION_MS",function(){return C}),j.d(Q,"MAX_START_GAP_JUMP",function(){return c}),j.d(Q,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return p}),j.d(Q,"SKIP_BUFFER_RANGE_START",function(){return u}),j.d(Q,"default",function(){return o});var w=j("./src/utils/buffer-helper.ts"),P=j("./src/errors.ts"),_=j("./src/events.ts"),T=j("./src/utils/logger.ts"),C=250,c=2,p=.1,u=.05,o=function(){function a(s,f,i,n){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=f,this.fragmentTracker=i,this.hls=n}var d=a.prototype;return d.destroy=function(){this.hls=this.fragmentTracker=this.media=null},d.poll=function(f){var i=this.config,n=this.media,t=this.stalled,h=n.currentTime,v=n.seeking,g=this.seeking&&!v,b=!this.seeking&&v;if(this.seeking=v,h!==f){if(this.moved=!0,t!==null){if(this.stallReported){var E=self.performance.now()-t;T.logger.warn("playback not stuck anymore @"+h+", after "+Math.round(E)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((b||g)&&(this.stalled=null),n.paused||n.ended||n.playbackRate===0||!w.BufferHelper.getBuffered(n).length)return;var m=w.BufferHelper.bufferInfo(n,h,0),y=m.len>0,x=m.nextStart||0;if(!y&&!x)return;if(v){var l=m.len>c,S=!x||x-h>c&&!this.fragmentTracker.getPartialFragment(h);if(l||S)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var O,A=Math.max(x,m.start||0)-h,D=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,I=D==null||((O=D.details)===null||O===void 0)?void 0:O.live,B=I?D.details.targetduration*2:c;if(A>0&&A<=B){this._trySkipBufferHole(null);return}}var H=self.performance.now();if(t===null){this.stalled=H;return}var te=H-t;!v&&te>=C&&this._reportStall(m.len);var W=w.BufferHelper.bufferInfo(n,h,i.maxBufferHole);this._tryFixBufferStall(W,te)},d._tryFixBufferStall=function(f,i){var n=this.config,t=this.fragmentTracker,h=this.media,v=h.currentTime,g=t.getPartialFragment(v);if(g){var b=this._trySkipBufferHole(g);if(b)return}f.len>n.maxBufferHole&&i>n.highBufferWatchdogPeriod*1e3&&(T.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},d._reportStall=function(f){var i=this.hls,n=this.media,t=this.stallReported;t||(this.stallReported=!0,T.logger.warn("Playback stalling at @"+n.currentTime+" due to low buffer (buffer="+f+")"),i.trigger(_.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:f}))},d._trySkipBufferHole=function(f){for(var i=this.config,n=this.hls,t=this.media,h=t.currentTime,v=0,g=w.BufferHelper.getBuffered(t),b=0;b=v&&h.05&&this.forwardBufferLength>1){var b=Math.min(2,Math.max(1,n)),E=Math.round(2/(1+Math.exp(-.75*h-this.edgeStalled))*20)/20;a.playbackRate=Math.min(b,Math.max(1,E))}else a.playbackRate!==1&&a.playbackRate!==0&&(a.playbackRate=1)},u.estimateLiveEdge=function(){var a=this.levelDetails;return a===null?null:a.edge+a.age},u.computeLatency=function(){var a=this.estimateLiveEdge();return a===null?null:a-this.currentTime},C(p,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var a=this.config,d=this.levelDetails;return a.liveMaxLatencyDuration!==void 0?a.liveMaxLatencyDuration:d?a.liveMaxLatencyDurationCount*d.targetduration:0}},{key:"targetLatency",get:function(){var a=this.levelDetails;if(a===null)return null;var d=a.holdBack,s=a.partHoldBack,f=a.targetduration,i=this.config,n=i.liveSyncDuration,t=i.liveSyncDurationCount,h=i.lowLatencyMode,v=this.hls.userConfig,g=h&&s||d;(v.liveSyncDuration||v.liveSyncDurationCount||g===0)&&(g=n!==void 0?n:t*f);var b=f,E=1;return g+Math.min(this.stallCount*E,b)}},{key:"liveSyncPosition",get:function(){var a=this.estimateLiveEdge(),d=this.targetLatency,s=this.levelDetails;if(a===null||d===null||s===null)return null;var f=s.edge,i=a-d-this.edgeStalled,n=f-s.totalduration,t=f-(this.config.lowLatencyMode&&s.partTarget||s.targetduration);return Math.min(Math.max(n,i),t)}},{key:"drift",get:function(){var a=this.levelDetails;return a===null?1:a.drift}},{key:"edgeStalled",get:function(){var a=this.levelDetails;if(a===null)return 0;var d=(this.config.lowLatencyMode&&a.partTarget||a.targetduration)*3;return Math.max(a.age-d,0)}},{key:"forwardBufferLength",get:function(){var a=this.media,d=this.levelDetails;if(!a||!d)return 0;var s=a.buffered.length;return s?a.buffered.end(s-1):d.edge-this.currentTime}}]),p}()},"./src/controller/level-controller.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"default",function(){return i});var w=j("./src/types/level.ts"),P=j("./src/events.ts"),_=j("./src/errors.ts"),T=j("./src/utils/codecs.ts"),C=j("./src/controller/level-helper.ts"),c=j("./src/controller/base-playlist-controller.ts"),p=j("./src/types/loader.ts");function u(){return u=Object.assign||function(n){for(var t=1;t0){x=E[0].bitrate,E.sort(function(te,W){return te.bitrate-W.bitrate}),this._levels=E;for(var I=0;Ithis.hls.config.fragLoadingMaxRetry&&(l=b.frag.level)):l=b.frag.level}break;case _.ErrorDetails.LEVEL_LOAD_ERROR:case _.ErrorDetails.LEVEL_LOAD_TIMEOUT:E&&(E.deliveryDirectives&&(x=!1),l=E.level),y=!0;break;case _.ErrorDetails.REMUX_ALLOC_ERROR:l=b.level,y=!0;break}l!==void 0&&this.recoverLevel(b,l,y,x)},h.recoverLevel=function(g,b,E,m){var y=g.details,x=this._levels[b];if(x.loadError++,E){var l=this.retryLoadingOrFail(g);if(l)g.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(m){var S=x.url.length;if(S>1&&x.loadError1){var m=(b.urlId+1)%E;this.warn("Switching to redundant URL-id "+m),this._levels.forEach(function(y){y.urlId=m}),this.level=g}},h.onFragLoaded=function(g,b){var E=b.frag;if(E!==void 0&&E.type===p.PlaylistLevelType.MAIN){var m=this._levels[E.level];m!==void 0&&(m.fragmentError=0,m.loadError=0)}},h.onLevelLoaded=function(g,b){var E,m=b.level,y=b.details,x=this._levels[m];if(!x){var l;this.warn("Invalid level index "+m),(l=b.deliveryDirectives)!==null&&l!==void 0&&l.skip&&(y.deltaUpdateFailed=!0);return}m===this.currentLevelIndex?(x.fragmentError===0&&(x.loadError=0,this.retryCount=0),this.playlistLoaded(m,b,x.details)):(E=b.deliveryDirectives)!==null&&E!==void 0&&E.skip&&(y.deltaUpdateFailed=!0)},h.onAudioTrackSwitched=function(g,b){var E=this.hls.levels[this.currentLevelIndex];if(!E)return;if(E.audioGroupIds){for(var m=-1,y=this.hls.audioTracks[b.id].groupId,x=0;x0){var m=E.urlId,y=E.url[m];if(g)try{y=g.addDirectives(y)}catch(x){this.warn("Could not construct new URL with HLS Delivery Directives: "+x)}this.log("Attempt loading level index "+b+(g?" at sn "+g.msn+" part "+g.part:"")+" with URL-id "+m+" "+y),this.clearTimer(),this.hls.trigger(P.Events.LEVEL_LOADING,{url:y,level:b,id:m,deliveryDirectives:g||null})}},h.removeLevel=function(g,b){var E=function(x,l){return l!==b},m=this._levels.filter(function(y,x){return x!==g?!0:y.url.length>1&&b!==void 0?(y.url=y.url.filter(E),y.audioGroupIds&&(y.audioGroupIds=y.audioGroupIds.filter(E)),y.textGroupIds&&(y.textGroupIds=y.textGroupIds.filter(E)),y.urlId=0,!0):!1}).map(function(y,x){var l=y.details;return l!=null&&l.fragments&&l.fragments.forEach(function(S){S.level=x}),y});this._levels=m,this.hls.trigger(P.Events.LEVELS_UPDATED,{levels:m})},a(t,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(g){var b,E=this._levels;if(E.length===0)return;if(this.currentLevelIndex===g&&(b=E[g])!==null&&b!==void 0&&b.details)return;if(g<0||g>=E.length){var m=g<0;if(this.hls.trigger(P.Events.ERROR,{type:_.ErrorTypes.OTHER_ERROR,details:_.ErrorDetails.LEVEL_SWITCH_ERROR,level:g,fatal:m,reason:"invalid level idx"}),m)return;g=Math.min(g,E.length-1)}this.clearTimer();var y=this.currentLevelIndex,x=E[y],l=E[g];this.log("switching to level "+g+" from "+y),this.currentLevelIndex=g;var S=u({},l,{level:g,maxBitrate:l.maxBitrate,uri:l.uri,urlId:l.urlId});delete S._urlId,this.hls.trigger(P.Events.LEVEL_SWITCHING,S);var O=l.details;if(!O||O.live){var A=this.switchParams(l.uri,x==null?void 0:x.details);this.loadPlaylist(A)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(g){this.manualLevelIndex=g,this._startLevel===void 0&&(this._startLevel=g),g!==-1&&(this.level=g)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(g){this._firstLevel=g}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var g=this.hls.config.startLevel;return g!==void 0?g:this._firstLevel}else return this._startLevel},set:function(g){this._startLevel=g}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(g){this.level=g,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=g)}}]),t}(c.default)},"./src/controller/level-helper.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"addGroupId",function(){return _}),j.d(Q,"assignTrackIdsByGroup",function(){return T}),j.d(Q,"updatePTS",function(){return C}),j.d(Q,"updateFragPTSDTS",function(){return p}),j.d(Q,"mergeDetails",function(){return u}),j.d(Q,"mapPartIntersection",function(){return o}),j.d(Q,"mapFragmentIntersection",function(){return a}),j.d(Q,"adjustSliding",function(){return d}),j.d(Q,"addSliding",function(){return s}),j.d(Q,"computeReloadInterval",function(){return f}),j.d(Q,"getFragmentWithSN",function(){return i}),j.d(Q,"getPartWith",function(){return n});var w=j("./src/polyfills/number.ts"),P=j("./src/utils/logger.ts");function _(t,h,v){switch(h){case"audio":t.audioGroupIds||(t.audioGroupIds=[]),t.audioGroupIds.push(v);break;case"text":t.textGroupIds||(t.textGroupIds=[]),t.textGroupIds.push(v);break}}function T(t){var h={};t.forEach(function(v){var g=v.groupId||"";v.id=h[g]=h[g]||0,h[g]++})}function C(t,h,v){var g=t[h],b=t[v];c(g,b)}function c(t,h){var v=h.startPTS;if(Object(w.isFiniteNumber)(v)){var g=0,b;h.sn>t.sn?(g=v-t.start,b=t):(g=t.start-v,b=h),b.duration!==g&&(b.duration=g)}else if(h.sn>t.sn){var E=t.cc===h.cc;E&&t.minEndPTS?h.start=t.start+(t.minEndPTS-t.start):h.start=t.start+t.duration}else h.start=Math.max(t.start-h.duration,0)}function p(t,h,v,g,b,E){var m=g-v;m<=0&&(P.logger.warn("Fragment should have a positive duration",h),g=v+h.duration,E=b+h.duration);var y=v,x=g,l=h.startPTS,S=h.endPTS;if(Object(w.isFiniteNumber)(l)){var O=Math.abs(l-v);Object(w.isFiniteNumber)(h.deltaPTS)?h.deltaPTS=Math.max(O,h.deltaPTS):h.deltaPTS=O,y=Math.max(v,l),v=Math.min(v,l),b=Math.min(b,h.startDTS),x=Math.min(g,S),g=Math.max(g,S),E=Math.max(E,h.endDTS)}h.duration=g-v;var A=v-h.start;h.appendedPTS=g,h.start=h.startPTS=v,h.maxStartPTS=y,h.startDTS=b,h.endPTS=g,h.minEndPTS=x,h.endDTS=E;var D=h.sn;if(!t||Dt.endSN)return 0;var I,B=D-t.startSN,H=t.fragments;for(H[B]=h,I=B;I>0;I--)c(H[I],H[I-1]);for(I=B;I=0;b--){var E=g[b].initSegment;if(E){v=E;break}}t.fragmentHint&&delete t.fragmentHint.endPTS;var m=0,y;if(a(t,h,function(I,B){I.relurl&&(m=I.cc-B.cc),Object(w.isFiniteNumber)(I.startPTS)&&Object(w.isFiniteNumber)(I.endPTS)&&(B.start=B.startPTS=I.startPTS,B.startDTS=I.startDTS,B.appendedPTS=I.appendedPTS,B.maxStartPTS=I.maxStartPTS,B.endPTS=I.endPTS,B.endDTS=I.endDTS,B.minEndPTS=I.minEndPTS,B.duration=I.endPTS-I.startPTS,B.duration&&(y=B),h.PTSKnown=h.alignedSliding=!0),B.elementaryStreams=I.elementaryStreams,B.loader=I.loader,B.stats=I.stats,B.urlId=I.urlId,I.initSegment&&(B.initSegment=I.initSegment,v=I.initSegment)}),v){var x=h.fragmentHint?h.fragments.concat(h.fragmentHint):h.fragments;x.forEach(function(I){var B;(!I.initSegment||I.initSegment.relurl===((B=v)===null||B===void 0?void 0:B.relurl))&&(I.initSegment=v)})}if(h.skippedSegments&&(h.deltaUpdateFailed=h.fragments.some(function(I){return!I}),h.deltaUpdateFailed)){P.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var l=h.skippedSegments;l--;)h.fragments.shift();h.startSN=h.fragments[0].sn,h.startCC=h.fragments[0].cc}var S=h.fragments;if(m){P.logger.warn("discontinuity sliding from playlist, take drift into account");for(var O=0;O=g.length)return;s(h,g[v].start)}function s(t,h){if(h){for(var v=t.fragments,g=t.skippedSegments;g0&&b0&&x===-1&&(this.log("Override startPosition with lastCurrentTime @"+l.toFixed(3)),x=l),this.state=P.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=x,this.tick()}else this._forceStartLoad=!0,this.state=P.State.STOPPED},m.stopLoad=function(){this._forceStartLoad=!1,b.prototype.stopLoad.call(this)},m.doTick=function(){switch(this.state){case P.State.IDLE:this.doTickIdle();break;case P.State.WAITING_LEVEL:{var x,l=this.levels,S=this.level,O=l==null||((x=l[S])===null||x===void 0)?void 0:x.details;if(O&&(!O.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(O))break;this.state=P.State.IDLE;break}break}case P.State.FRAG_LOADING_WAITING_RETRY:{var A,D=self.performance.now(),I=this.retryDate;(!I||D>=I||(A=this.media)!==null&&A!==void 0&&A.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=P.State.IDLE)}break;default:break}this.onTickEnd()},m.onTickEnd=function(){b.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},m.doTickIdle=function(){var x,l,S=this.hls,O=this.levelLastLoaded,A=this.levels,D=this.media,I=S.config,B=S.nextLoadLevel;if(O===null||!D&&(this.startFragRequested||!I.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!A||!A[B])return;var H=A[B];this.level=S.nextLoadLevel=B;var te=H.details;if(!te||this.state===P.State.WAITING_LEVEL||te.live&&this.levelLastLoaded!==B){this.state=P.State.WAITING_LEVEL;return}var W=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:D,p.PlaylistLevelType.MAIN);if(W===null)return;var V=W.len,X=this.getMaxBufferLength(H.maxBitrate);if(V>=X)return;if(this._streamEnded(W,te)){var ne={};this.altAudio&&(ne.type="video"),this.hls.trigger(T.Events.BUFFER_EOS,ne),this.state=P.State.ENDED;return}var $=W.end,ee=this.getNextFragment($,te);if(this.couldBacktrack&&!this.fragPrevious&&ee&&ee.sn!=="initSegment"){var ce=ee.sn-te.startSN;ce>1&&(ee=te.fragments[ce-1],this.fragmentTracker.removeFragment(ee))}if(ee&&this.fragmentTracker.getState(ee)===c.FragmentState.OK&&this.nextLoadPosition>$){var de=this.audioOnly&&!this.altAudio?u.ElementaryStreamTypes.AUDIO:u.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(D,de,p.PlaylistLevelType.MAIN),ee=this.getNextFragment(this.nextLoadPosition,te)}if(!ee)return;ee.initSegment&&!ee.initSegment.data&&!this.bitrateTest&&(ee=ee.initSegment),((x=ee.decryptdata)===null||x===void 0?void 0:x.keyFormat)==="identity"&&!((l=ee.decryptdata)!==null&&l!==void 0&&l.key)?this.loadKey(ee,te):this.loadFragment(ee,te,$)},m.loadFragment=function(x,l,S){var O,A=this.fragmentTracker.getState(x);if(this.fragCurrent=x,A===c.FragmentState.BACKTRACKED){var D=this.fragmentTracker.getBacktrackData(x);if(D){this._handleFragmentLoadProgress(D),this._handleFragmentLoadComplete(D);return}else A=c.FragmentState.NOT_LOADED}A===c.FragmentState.NOT_LOADED||A===c.FragmentState.PARTIAL?x.sn==="initSegment"?this._loadInitSegment(x):this.bitrateTest?(x.bitrateTest=!0,this.log("Fragment "+x.sn+" of level "+x.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(x)):(this.startFragRequested=!0,b.prototype.loadFragment.call(this,x,l,S)):A===c.FragmentState.APPENDING?this.reduceMaxBufferLength(x.duration)&&this.fragmentTracker.removeFragment(x):((O=this.media)===null||O===void 0?void 0:O.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},m.getAppendedFrag=function(x){var l=this.fragmentTracker.getAppendedFrag(x,p.PlaylistLevelType.MAIN);return l&&"fragment"in l?l.fragment:l},m.getBufferedFrag=function(x){return this.fragmentTracker.getBufferedFrag(x,p.PlaylistLevelType.MAIN)},m.followingBufferedFrag=function(x){return x?this.getBufferedFrag(x.end+.5):null},m.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},m.nextLevelSwitch=function(){var x=this.levels,l=this.media;if(l!=null&&l.readyState){var S,O=this.getAppendedFrag(l.currentTime);if(O&&O.start>1&&this.flushMainBuffer(0,O.start-1),!l.paused&&x){var A=this.hls.nextLoadLevel,D=x[A],I=this.fragLastKbps;I&&this.fragCurrent?S=this.fragCurrent.duration*D.maxBitrate/(1e3*I)+1:S=0}else S=0;var B=this.getBufferedFrag(l.currentTime+S);if(B){var H=this.followingBufferedFrag(B);if(H){this.abortCurrentFrag();var te=H.maxStartPTS?H.maxStartPTS:H.start,W=H.duration,V=Math.max(B.end,te+Math.min(Math.max(W-this.config.maxFragLookUpTolerance,W*.5),W*.75));this.flushMainBuffer(V,Number.POSITIVE_INFINITY)}}}},m.abortCurrentFrag=function(){var x=this.fragCurrent;this.fragCurrent=null,x!=null&&x.loader&&x.loader.abort(),this.state===P.State.KEY_LOADING&&(this.state=P.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},m.flushMainBuffer=function(x,l){b.prototype.flushMainBuffer.call(this,x,l,this.altAudio?"video":null)},m.onMediaAttached=function(x,l){b.prototype.onMediaAttached.call(this,x,l);var S=l.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),S.addEventListener("playing",this.onvplaying),S.addEventListener("seeked",this.onvseeked),this.gapController=new d.default(this.config,S,this.fragmentTracker,this.hls)},m.onMediaDetaching=function(){var x=this.media;x&&(x.removeEventListener("playing",this.onvplaying),x.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),b.prototype.onMediaDetaching.call(this)},m.onMediaPlaying=function(){this.tick()},m.onMediaSeeked=function(){var x=this.media,l=x?x.currentTime:null;Object(w.isFiniteNumber)(l)&&this.log("Media seeked to "+l.toFixed(3)),this.tick()},m.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(T.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},m.onManifestParsed=function(x,l){var S=!1,O=!1,A;l.levels.forEach(function(D){A=D.audioCodec,A&&(A.indexOf("mp4a.40.2")!==-1&&(S=!0),A.indexOf("mp4a.40.5")!==-1&&(O=!0))}),this.audioCodecSwitch=S&&O&&!Object(_.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=l.levels,this.startFragRequested=!1},m.onLevelLoading=function(x,l){var S=this.levels;if(!S||this.state!==P.State.IDLE)return;var O=S[l.level];(!O.details||O.details.live&&this.levelLastLoaded!==l.level||this.waitForCdnTuneIn(O.details))&&(this.state=P.State.WAITING_LEVEL)},m.onLevelLoaded=function(x,l){var S,O=this.levels,A=l.level,D=l.details,I=D.totalduration;if(!O){this.warn("Levels were reset while loading level "+A);return}this.log("Level "+A+" loaded ["+D.startSN+","+D.endSN+"], cc ["+D.startCC+", "+D.endCC+"] duration:"+I);var B=this.fragCurrent;B&&(this.state===P.State.FRAG_LOADING||this.state===P.State.FRAG_LOADING_WAITING_RETRY)&&(B.level!==l.level&&B.loader&&(this.state=P.State.IDLE,B.loader.abort()));var H=O[A],te=0;if(D.live||(S=H.details)!==null&&S!==void 0&&S.live){if(D.fragments[0]||(D.deltaUpdateFailed=!0),D.deltaUpdateFailed)return;te=this.alignPlaylists(D,H.details)}if(H.details=D,this.levelLastLoaded=A,this.hls.trigger(T.Events.LEVEL_UPDATED,{details:D,level:A}),this.state===P.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(D))return;this.state=P.State.IDLE}this.startFragRequested?D.live&&this.synchronizeToLiveEdge(D):this.setStartPosition(D,te),this.tick()},m._handleFragmentLoadProgress=function(x){var l,S=x.frag,O=x.part,A=x.payload,D=this.levels;if(!D){this.warn("Levels were reset while fragment load was in progress. Fragment "+S.sn+" of level "+S.level+" will not be buffered");return}var I=D[S.level],B=I.details;if(!B){this.warn("Dropping fragment "+S.sn+" of level "+S.level+" after level details were reset");return}var H=I.videoCodec,te=B.PTSKnown||!B.live,W=(l=S.initSegment)===null||l===void 0?void 0:l.data,V=this._getAudioCodec(I),X=this.transmuxer=this.transmuxer||new o.default(this.hls,p.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),ne=O?O.index:-1,$=ne!==-1,ee=new a.ChunkMetadata(S.level,S.sn,S.stats.chunkCount,A.byteLength,ne,$),ce=this.initPTS[S.cc];X.push(A,W,V,H,S,O,B.totalduration,te,ee,ce)},m.onAudioTrackSwitching=function(x,l){var S=this.altAudio,O=!!l.url,A=l.id;if(!O){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var D=this.fragCurrent;D!=null&&D.loader&&(this.log("Switching to main audio track, cancel main fragment load"),D.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var I=this.hls;S&&I.trigger(T.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),I.trigger(T.Events.AUDIO_TRACK_SWITCHED,{id:A})}},m.onAudioTrackSwitched=function(x,l){var S=l.id,O=!!this.hls.audioTracks[S].url;if(O){var A=this.videoBuffer;A&&this.mediaBuffer!==A&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=A)}this.altAudio=O,this.tick()},m.onBufferCreated=function(x,l){var S=l.tracks,O,A,D=!1;for(var I in S){var B=S[I];if(B.id==="main"){if(A=I,O=B,I==="video"){var H=S[I];H&&(this.videoBuffer=H.buffer)}}else D=!0}D&&O?(this.log("Alternate track found, use "+A+".buffered to schedule main fragment loading"),this.mediaBuffer=O.buffer):this.mediaBuffer=this.media},m.onFragBuffered=function(x,l){var S=l.frag,O=l.part;if(S&&S.type!==p.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(S)){this.warn("Fragment "+S.sn+(O?" p: "+O.index:"")+" of level "+S.level+" finished buffering, but was aborted. state: "+this.state),this.state===P.State.PARSED&&(this.state=P.State.IDLE);return}var A=O?O.stats:S.stats;this.fragLastKbps=Math.round(8*A.total/(A.buffering.end-A.loading.first)),S.sn!=="initSegment"&&(this.fragPrevious=S),this.fragBufferedComplete(S,O)},m.onError=function(x,l){switch(l.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(p.PlaylistLevelType.MAIN,l);break;case s.ErrorDetails.LEVEL_LOAD_ERROR:case s.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==P.State.ERROR&&(l.fatal?(this.warn(""+l.details),this.state=P.State.ERROR):!l.levelRetry&&this.state===P.State.WAITING_LEVEL&&(this.state=P.State.IDLE));break;case s.ErrorDetails.BUFFER_FULL_ERROR:if(l.parent==="main"&&(this.state===P.State.PARSING||this.state===P.State.PARSED)){var S=!0,O=this.getFwdBufferInfo(this.media,p.PlaylistLevelType.MAIN);O&&O.len>.5&&(S=!this.reduceMaxBufferLength(O.len)),S&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},m.checkBuffer=function(){var x=this.media,l=this.gapController;if(!x||!l||!x.readyState)return;var S=C.BufferHelper.getBuffered(x);!this.loadedmetadata&&S.length?(this.loadedmetadata=!0,this.seekToStartPos()):l.poll(this.lastCurrentTime),this.lastCurrentTime=x.currentTime},m.onFragLoadEmergencyAborted=function(){this.state=P.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},m.onBufferFlushed=function(x,l){var S=l.type;if(S!==u.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var O=(S===u.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(O,S,p.PlaylistLevelType.MAIN)}},m.onLevelsUpdated=function(x,l){this.levels=l.levels},m.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},m.seekToStartPos=function(){var x=this.media,l=x.currentTime,S=this.startPosition;if(S>=0&&l0&&(D1&&x.seeking===!1){var S=x.currentTime;if(C.BufferHelper.isBuffered(x,S)?l=this.getAppendedFrag(S):C.BufferHelper.isBuffered(x,S+.1)&&(l=this.getAppendedFrag(S+.1)),l){var O=this.fragPlaying,A=l.level;(!O||l.sn!==O.sn||O.level!==A||l.urlId!==O.urlId)&&(this.hls.trigger(T.Events.FRAG_CHANGED,{frag:l}),(!O||O.level!==A)&&this.hls.trigger(T.Events.LEVEL_SWITCHED,{level:A}),this.fragPlaying=l)}}},n(E,[{key:"nextLevel",get:function(){var x=this.nextBufferedFrag;return x?x.level:-1}},{key:"currentLevel",get:function(){var x=this.media;if(x){var l=this.getAppendedFrag(x.currentTime);if(l)return l.level}return-1}},{key:"nextBufferedFrag",get:function(){var x=this.media;if(x){var l=this.getAppendedFrag(x.currentTime);return this.followingBufferedFrag(l)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),E}(P.default)},"./src/controller/subtitle-stream-controller.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"SubtitleStreamController",function(){return t});var w=j("./src/events.ts"),P=j("./src/utils/logger.ts"),_=j("./src/utils/buffer-helper.ts"),T=j("./src/controller/fragment-finders.ts"),C=j("./src/utils/discontinuities.ts"),c=j("./src/controller/level-helper.ts"),p=j("./src/controller/fragment-tracker.ts"),u=j("./src/controller/base-stream-controller.ts"),o=j("./src/types/loader.ts"),a=j("./src/types/level.ts");function d(h,v){for(var g=0;g=l[A].start&&O<=l[A].end){S=l[A];break}var D=y.start+y.duration;S?S.end=D:(S={start:O,end:D},l.push(S)),this.fragmentTracker.fragBuffered(y)},g.onBufferFlushing=function(E,m){var y=m.startOffset,x=m.endOffset;if(y===0&&x!==Number.POSITIVE_INFINITY){var l=this.currentTrackId,S=this.levels;if(!S.length||!S[l]||!S[l].details)return;var O=S[l].details,A=O.targetduration,D=x-A;if(D<=0)return;m.endOffsetSubtitles=Math.max(0,D),this.tracksBuffered.forEach(function(I){for(var B=0;B=O.length||l!==S||!A)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,x.live||(y=A.details)!==null&&y!==void 0&&y.live){var D=this.mainDetails;if(x.deltaUpdateFailed||!D)return;var I=D.fragments[0];if(!A.details)x.hasProgramDateTime&&D.hasProgramDateTime?Object(C.alignMediaPlaylistByPDT)(x,D):I&&Object(c.addSliding)(x,I.start);else{var B=this.alignPlaylists(x,A.details);B===0&&I&&Object(c.addSliding)(x,I.start)}}if(A.details=x,this.levelLastLoaded=l,this.tick(),x.live&&!this.fragCurrent&&this.media&&this.state===u.State.IDLE){var H=Object(T.findFragmentByPTS)(null,x.fragments,this.media.currentTime,0);H||(this.warn("Subtitle playlist not aligned with playback"),A.details=void 0)}},g._handleFragmentLoadComplete=function(E){var m=E.frag,y=E.payload,x=m.decryptdata,l=this.hls;if(this.fragContextChanged(m))return;if(y&&y.byteLength>0&&x&&x.key&&x.iv&&x.method==="AES-128"){var S=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(y),x.key.buffer,x.iv.buffer).then(function(O){var A=performance.now();l.trigger(w.Events.FRAG_DECRYPTED,{frag:m,payload:O,stats:{tstart:S,tdecrypt:A}})})}},g.doTick=function(){if(!this.media){this.state=u.State.IDLE;return}if(this.state===u.State.IDLE){var E,m=this.currentTrackId,y=this.levels;if(!y.length||!y[m]||!y[m].details)return;var x=y[m].details,l=x.targetduration,S=this.config,O=this.media,A=_.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,O.currentTime-l,S.maxBufferHole),D=A.end,I=A.len,B=this.getMaxBufferLength()+l;if(I>B)return;console.assert(x,"Subtitle track details are defined on idle subtitle stream controller tick");var H=x.fragments,te=H.length,W=x.edge,V,X=this.fragPrevious;if(D-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)},f.pollTrackChange=function(n){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,n)},f.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 n=a(this.media.textTracks);n.forEach(function(t){Object(P.clearCurrentCues)(t)}),this.subtitleTrack=-1,this.media=null},f.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},f.onManifestParsed=function(n,t){this.tracks=t.subtitleTracks},f.onSubtitleTrackLoaded=function(n,t){var h=t.id,v=t.details,g=this.trackId,b=this.tracksInGroup[g];if(!b){this.warn("Invalid subtitle track id "+h);return}var E=b.details;b.details=t.details,this.log("subtitle track "+h+" loaded ["+v.startSN+"-"+v.endSN+"]"),h===this.trackId&&(this.retryCount=0,this.playlistLoaded(h,t,E))},f.onLevelLoading=function(n,t){this.switchLevel(t.level)},f.onLevelSwitching=function(n,t){this.switchLevel(t.level)},f.switchLevel=function(n){var t=this.hls.levels[n];if(!(t!=null&&t.textGroupIds))return;var h=t.textGroupIds[t.urlId];if(this.groupId!==h){var v=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,g=this.tracks.filter(function(m){return!h||m.groupId===h});this.tracksInGroup=g;var b=this.findTrackId(v==null?void 0:v.name)||this.findTrackId();this.groupId=h;var E={subtitleTracks:g};this.log("Updating subtitle tracks, "+g.length+' track(s) found in "'+h+'" group-id'),this.hls.trigger(w.Events.SUBTITLE_TRACKS_UPDATED,E),b!==-1&&this.setSubtitleTrack(b,v)}},f.findTrackId=function(n){for(var t=this.tracksInGroup,h=0;h=v.length)return;this.clearTimer();var g=v[n];if(this.log("Switching to subtitle track "+n),this.trackId=n,g){var b=g.id,E=g.groupId,m=E===void 0?"":E,y=g.name,x=g.type,l=g.url;this.hls.trigger(w.Events.SUBTITLE_TRACK_SWITCH,{id:b,groupId:m,name:y,type:x,url:l});var S=this.switchParams(g.url,t==null?void 0:t.details);this.loadPlaylist(S)}else this.hls.trigger(w.Events.SUBTITLE_TRACK_SWITCH,{id:n})},f.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var n=-1,t=a(this.media.textTracks),h=0;h=0&&(x[0]=Math.min(x[0],v),x[1]=Math.max(x[1],g),m=!0,l/(g-v)>.5))return}if(m||E.push([v,g]),this.config.renderTextTracksNatively){var S=this.captionsTracks[h];this.Cues.newCue(S,v,g,b)}else{var O=this.Cues.newCue(null,v,g,b);this.hls.trigger(P.Events.CUES_PARSED,{type:"captions",cues:O,track:h})}},n.onInitPtsFound=function(h,v){var g=this,b=v.frag,E=v.id,m=v.initPTS,y=v.timescale,x=this.unparsedVttFrags;E==="main"&&(this.initPTS[b.cc]=m,this.timescale[b.cc]=y),x.length&&(this.unparsedVttFrags=[],x.forEach(function(l){g.onFragLoaded(P.Events.FRAG_LOADED,l)}))},n.getExistingTrack=function(h){var v=this.media;if(v)for(var g=0;g>>8^y&255^99,p[b]=y,u[y]=b;var x=g[b],l=g[x],S=g[l],O=g[y]*257^y*16843008;a[b]=O<<24|O>>>8,d[b]=O<<16|O>>>16,s[b]=O<<8|O>>>24,f[b]=O,O=S*16843009^l*65537^x*257^b*16843008,n[y]=O<<24|O>>>8,t[y]=O<<16|O>>>16,h[y]=O<<8|O>>>24,v[y]=O,b?(b=x^g[g[g[S^x]]],E^=g[g[E]]):b=E=1}},C.expandKey=function(p){for(var u=this.uint8ArrayToUint32Array_(p),o=!0,a=0;a>>6)+1;var O=(h[v+2]&60)>>>2;if(O>S.length-1){t.trigger(_.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+O});return}return m=(h[v+2]&1)<<2,m|=(h[v+3]&192)>>>6,w.logger.log("manifest codec:"+g+", ADTS type:"+b+", samplingIndex:"+O),/firefox/i.test(x)?O>=6?(b=5,y=new Array(4),E=O-3):(b=2,y=new Array(2),E=O):x.indexOf("android")!==-1?(b=2,y=new Array(2),E=O):(b=5,y=new Array(4),g&&(g.indexOf("mp4a.40.29")!==-1||g.indexOf("mp4a.40.5")!==-1)||!g&&O>=6?E=O-3:((g&&g.indexOf("mp4a.40.2")!==-1&&(O>=6&&m===1||/vivaldi/i.test(x))||!g&&m===1)&&(b=2,y=new Array(2)),E=O)),y[0]=b<<3,y[0]|=(O&14)>>1,y[1]|=(O&1)<<7,y[1]|=m<<3,b===5&&(y[1]|=(E&14)>>1,y[2]=(E&1)<<7,y[2]|=2<<2,y[3]=0),{config:y,samplerate:S[O],channelCount:m,codec:"mp4a.40."+b,manifestCodec:l}}function C(t,h){return t[h]===255&&(t[h+1]&246)===240}function c(t,h){return t[h+1]&1?7:9}function p(t,h){return(t[h+3]&3)<<11|t[h+4]<<3|(t[h+5]&224)>>>5}function u(t,h){return h+5=t.length)return!1;var g=p(t,h);if(g<=v)return!1;var b=h+g;return b===t.length||o(t,b)}return!1}function s(t,h,v,g,b){if(!t.samplerate){var E=T(h,v,g,b);if(!E)return;t.config=E.config,t.samplerate=E.samplerate,t.channelCount=E.channelCount,t.codec=E.codec,t.manifestCodec=E.manifestCodec,w.logger.log("parsed codec:"+t.codec+", rate:"+E.samplerate+", channels:"+E.channelCount)}}function f(t){return 1024*9e4/t}function i(t,h,v,g,b){var E=c(t,h),m=p(t,h);if(m-=E,m>0){var y=v+g*b;return{headerLength:E,frameLength:m,stamp:y}}}function n(t,h,v,g,b){var E=f(t.samplerate),m=i(h,v,g,b,E);if(m){var y=m.frameLength,x=m.headerLength,l=m.stamp,S=x+y,O=Math.max(0,v+S-h.length),A;O?(A=new Uint8Array(S-x),A.set(h.subarray(v+x,h.length),0)):A=h.subarray(v+x,v+S);var D={unit:A,pts:l};return O||t.samples.push(D),{sample:D,length:S,missing:O}}}},"./src/demux/base-audio-demuxer.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"initPTSFn",function(){return p});var w=j("./src/polyfills/number.ts"),P=j("./src/demux/id3.ts"),_=j("./src/demux/dummy-demuxed-track.ts"),T=j("./src/utils/mp4-tools.ts"),C=j("./src/utils/typed-array.ts"),c=function(){function u(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var o=u.prototype;return o.resetInitSegment=function(d,s,f){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},o.resetTimeStamp=function(){},o.resetContiguity=function(){},o.canParse=function(d,s){return!1},o.appendFrame=function(d,s,f){},o.demux=function(d,s){this.cachedData&&(d=Object(T.appendUint8Array)(this.cachedData,d),this.cachedData=null);var f=P.getID3Data(d,0),i=f?f.length:0,n,t,h=this._audioTrack,v=this._id3Track,g=f?P.getTimeStamp(f):void 0,b=d.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=p(g,s)),f&&f.length>0&&v.samples.push({pts:this.initPTS,dts:this.initPTS,data:f}),t=this.initPTS;ic?(this.word<<=c,this.bitsAvailable-=c):(c-=this.bitsAvailable,p=c>>3,c-=p>>3,this.bytesAvailable-=p,this.loadWord(),this.word<<=c,this.bitsAvailable-=c)},T.readBits=function(c){var p=Math.min(this.bitsAvailable,c),u=this.word>>>32-p;return c>32&&w.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=p,this.bitsAvailable>0?this.word<<=p:this.bytesAvailable>0&&this.loadWord(),p=c-p,p>0&&this.bitsAvailable?u<>>c)!==0)return this.word<<=c,this.bitsAvailable-=c,c;return this.loadWord(),c+this.skipLZ()},T.skipUEG=function(){this.skipBits(1+this.skipLZ())},T.skipEG=function(){this.skipBits(1+this.skipLZ())},T.readUEG=function(){var c=this.skipLZ();return this.readBits(c+1)-1},T.readEG=function(){var c=this.readUEG();return 1&c?1+c>>>1:-1*(c>>>1)},T.readBoolean=function(){return this.readBits(1)===1},T.readUByte=function(){return this.readBits(8)},T.readUShort=function(){return this.readBits(16)},T.readUInt=function(){return this.readBits(32)},T.skipScalingList=function(c){for(var p=8,u=8,o,a=0;a0?b.subarray(m,m+y):void 0},T=function(b,E){var m=0;return m=(b[E]&127)<<21,m|=(b[E+1]&127)<<14,m|=(b[E+2]&127)<<7,m|=b[E+3]&127,m},C=function(b,E){return w(b,E)&&T(b,E+6)+10<=b.length-E},c=function(b){for(var E=o(b),m=0;m>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:D+=String.fromCharCode(S);break;case 12:case 13:O=b[I++],D+=String.fromCharCode((S&31)<<6|O&63);break;case 14:O=b[I++],A=b[I++],D+=String.fromCharCode((S&15)<<12|(O&63)<<6|(A&63)<<0);break;default:}}return D},t={decodeTextFrame:s},h;function v(){return!h&&typeof self.TextDecoder!="undefined"&&(h=new self.TextDecoder("utf-8")),h}},"./src/demux/mp3demuxer.ts":function(le,Q,j){"use strict";j.r(Q);var w=j("./src/demux/base-audio-demuxer.ts"),P=j("./src/demux/id3.ts"),_=j("./src/utils/logger.ts"),T=j("./src/demux/mpegaudio.ts");function C(u,o){u.prototype=Object.create(o.prototype),u.prototype.constructor=u,c(u,o)}function c(u,o){return c=Object.setPrototypeOf||function(d,s){return d.__proto__=s,d},c(u,o)}var p=function(u){C(o,u);function o(){return u.apply(this,arguments)||this}var a=o.prototype;return a.resetInitSegment=function(s,f,i){u.prototype.resetInitSegment.call(this,s,f,i),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:s,duration:i,inputTimeScale:9e4,dropped:0}},o.probe=function(s){if(!s)return!1;for(var f=P.getID3Data(s,0)||[],i=f.length,n=s.length;i0},C.demux=function(p){var u=p,o=Object(P.dummyTrack)();if(this.config.progressive){this.remainderData&&(u=Object(w.appendUint8Array)(this.remainderData,p));var a=Object(w.segmentValidRange)(u);this.remainderData=a.remainder,o.samples=a.valid||new Uint8Array}else o.samples=u;return{audioTrack:Object(P.dummyTrack)(),avcTrack:o,id3Track:Object(P.dummyTrack)(),textTrack:Object(P.dummyTrack)()}},C.flush=function(){var p=Object(P.dummyTrack)();return p.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(P.dummyTrack)(),avcTrack:p,id3Track:Object(P.dummyTrack)(),textTrack:Object(P.dummyTrack)()}},C.demuxSampleAes=function(p,u,o){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},C.destroy=function(){},T}();_.minProbeByteLength=1024,Q.default=_},"./src/demux/mpegaudio.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"appendFrame",function(){return c}),j.d(Q,"parseHeader",function(){return p}),j.d(Q,"isHeaderPattern",function(){return u}),j.d(Q,"isHeader",function(){return o}),j.d(Q,"canParse",function(){return a}),j.d(Q,"probe",function(){return d});var w=null,P=[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],_=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],T=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],C=[0,1,1,4];function c(s,f,i,n,t){if(i+24>f.length)return;var h=p(f,i);if(h&&i+h.frameLength<=f.length){var v=h.samplesPerFrame*9e4/h.sampleRate,g=n+t*v,b={unit:f.subarray(i,i+h.frameLength),pts:g,dts:g};return s.config=[],s.channelCount=h.channelCount,s.samplerate=h.sampleRate,s.samples.push(b),{sample:b,length:h.frameLength,missing:0}}}function p(s,f){var i=s[f+1]>>3&3,n=s[f+1]>>1&3,t=s[f+2]>>4&15,h=s[f+2]>>2&3;if(i!==1&&t!==0&&t!==15&&h!==3){var v=s[f+2]>>1&1,g=s[f+3]>>6,b=i===3?3-n:n===3?3:4,E=P[b*14+t-1]*1e3,m=i===3?0:i===2?1:2,y=_[m*3+h],x=g===3?1:2,l=T[i][n],S=C[n],O=l*8*S,A=Math.floor(l*E/y+v)*S;if(w===null){var D=navigator.userAgent||"",I=D.match(/Chrome\/(\d+)/i);w=I?parseInt(I[1]):0}var B=!!w&&w<=87;return B&&n===2&&E>=224e3&&g===0&&(s[f+3]=s[f+3]|128),{sampleRate:y,channelCount:x,frameLength:A,samplesPerFrame:O}}}function u(s,f){return s[f]===255&&(s[f+1]&224)===224&&(s[f+1]&6)!==0}function o(s,f){return f+1=p.length){o();return}if(p[u].unit.length<32)continue;var a=this.decrypter.isSync();if(this.decryptAacSample(p,u,o,a),!a)return}},C.getAvcEncryptedData=function(p){for(var u=Math.floor((p.length-48)/160)*16+16,o=new Int8Array(u),a=0,d=32;d<=p.length-16;d+=160,a+=16)o.set(p.subarray(d,d+16),a);return o},C.getAvcDecryptedUnit=function(p,u){for(var o=new Uint8Array(u),a=0,d=32;d<=p.length-16;d+=160,a+=16)p.set(o.subarray(a,a+16),d);return p},C.decryptAvcSample=function(p,u,o,a,d,s){var f=Object(P.discardEPB)(d.data),i=this.getAvcEncryptedData(f),n=this;this.decryptBuffer(i.buffer,function(t){d.data=n.getAvcDecryptedUnit(f,t),s||n.decryptAvcSamples(p,u,o+1,a)})},C.decryptAvcSamples=function(p,u,o,a){if(p instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;u++,o=0){if(u>=p.length){a();return}for(var d=p[u].units;!(o>=d.length);o++){var s=d[o];if(s.data.length<=48||s.type!==1&&s.type!==5)continue;var f=this.decrypter.isSync();if(this.decryptAvcSample(p,u,o,a,s,f),!f)return}}},T}();Q.default=_},"./src/demux/transmuxer-interface.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"default",function(){return d});var w=j("./node_modules/webworkify-webpack/index.js"),P=j.n(w),_=j("./src/events.ts"),T=j("./src/demux/transmuxer.ts"),C=j("./src/utils/logger.ts"),c=j("./src/errors.ts"),p=j("./src/utils/mediasource-helper.ts"),u=j("./node_modules/eventemitter3/index.js"),o=j.n(u),a=Object(p.getMediaSource)()||{isTypeSupported:function(){return!1}},d=function(){function s(i,n,t,h){var v=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=i,this.id=n,this.onTransmuxComplete=t,this.onFlush=h;var g=i.config,b=function(l,S){S=S||{},S.frag=v.frag,S.id=v.id,i.trigger(l,S)};this.observer=new u.EventEmitter,this.observer.on(_.Events.FRAG_DECRYPTED,b),this.observer.on(_.Events.ERROR,b);var E={mp4:a.isTypeSupported("video/mp4"),mpeg:a.isTypeSupported("audio/mpeg"),mp3:a.isTypeSupported('audio/mp4; codecs="mp3"')},m=navigator.vendor;if(g.enableWorker&&typeof Worker!="undefined"){C.logger.log("demuxing in webworker");var y;try{y=this.worker=w("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),y.addEventListener("message",this.onwmsg),y.onerror=function(x){i.trigger(_.Events.ERROR,{type:c.ErrorTypes.OTHER_ERROR,details:c.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(x.message+" ("+x.filename+":"+x.lineno+")")})},y.postMessage({cmd:"init",typeSupported:E,vendor:m,id:n,config:JSON.stringify(g)})}catch(x){C.logger.warn("Error in worker:",x),C.logger.error("Error while initializing DemuxerWorker, fallback to inline"),y&&self.URL.revokeObjectURL(y.objectURL),this.transmuxer=new T.default(this.observer,E,g,m,n),this.worker=null}}else this.transmuxer=new T.default(this.observer,E,g,m,n)}var f=s.prototype;return f.destroy=function(){var n=this.worker;if(n)n.removeEventListener("message",this.onwmsg),n.terminate(),this.worker=null;else{var t=this.transmuxer;t&&(t.destroy(),this.transmuxer=null)}var h=this.observer;h&&h.removeAllListeners(),this.observer=null},f.push=function(n,t,h,v,g,b,E,m,y,x){var l=this;y.transmuxing.start=self.performance.now();var S=this.transmuxer,O=this.worker,A=b?b.start:g.start,D=g.decryptdata,I=this.frag,B=!(I&&g.cc===I.cc),H=!(I&&y.level===I.level),te=I?y.sn-I.sn:-1,W=this.part?y.part-this.part.index:1,V=!H&&(te===1||te===0&&W===1),X=self.performance.now();(H||te||g.stats.parsing.start===0)&&(g.stats.parsing.start=X),b&&(W||!V)&&(b.stats.parsing.start=X);var ne=new T.TransmuxState(B,V,m,H,A);if(!V||B){C.logger.log("[transmuxer-interface, "+g.type+"]: Starting new transmux session for sn: "+y.sn+" p: "+y.part+" level: "+y.level+" id: "+y.id+` discontinuity: `+B+` trackSwitch: `+H+` contiguous: `+V+` accurateTimeOffset: `+m+` timeOffset: `+A);var $=new T.TransmuxConfig(h,v,t,E,x);this.configureTransmuxer($)}if(this.frag=g,this.part=b,O)O.postMessage({cmd:"demux",data:n,decryptdata:D,chunkMeta:y,state:ne},n instanceof ArrayBuffer?[n]:[]);else if(S){var ee=S.push(n,D,y,ne);Object(T.isPromise)(ee)?ee.then(function(ce){l.handleTransmuxComplete(ce)}):this.handleTransmuxComplete(ee)}},f.flush=function(n){var t=this;n.transmuxing.start=self.performance.now();var h=this.transmuxer,v=this.worker;if(v)v.postMessage({cmd:"flush",chunkMeta:n});else if(h){var g=h.flush(n);Object(T.isPromise)(g)?g.then(function(b){t.handleFlushResult(b,n)}):this.handleFlushResult(g,n)}},f.handleFlushResult=function(n,t){var h=this;n.forEach(function(v){h.handleTransmuxComplete(v)}),this.onFlush(t)},f.onWorkerMessage=function(n){var t=n.data,h=this.hls;switch(t.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(t.data);break}case"flush":{this.onFlush(t.data);break}default:{t.data=t.data||{},t.data.frag=this.frag,t.data.id=this.id,h.trigger(t.event,t.data);break}}},f.configureTransmuxer=function(n){var t=this.worker,h=this.transmuxer;t?t.postMessage({cmd:"configure",config:n}):h&&h.configure(n)},f.handleTransmuxComplete=function(n){n.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(n)},s}()},"./src/demux/transmuxer-worker.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"default",function(){return c});var w=j("./src/demux/transmuxer.ts"),P=j("./src/events.ts"),_=j("./src/utils/logger.ts"),T=j("./node_modules/eventemitter3/index.js"),C=j.n(T);function c(d){var s=new T.EventEmitter,f=function(n,t){d.postMessage({event:n,data:t})};s.on(P.Events.FRAG_DECRYPTED,f),s.on(P.Events.ERROR,f),d.addEventListener("message",function(i){var n=i.data;switch(n.cmd){case"init":{var t=JSON.parse(n.config);d.transmuxer=new w.default(s,n.typeSupported,t,n.vendor,n.id),Object(_.enableLogs)(t.debug),f("init",null);break}case"configure":{d.transmuxer.configure(n.config);break}case"demux":{var h=d.transmuxer.push(n.data,n.decryptdata,n.chunkMeta,n.state);Object(w.isPromise)(h)?h.then(function(b){p(d,b)}):p(d,h);break}case"flush":{var v=n.chunkMeta,g=d.transmuxer.flush(v);Object(w.isPromise)(g)?g.then(function(b){o(d,b,v)}):o(d,g,v);break}default:break}})}function p(d,s){if(a(s.remuxResult))return;var f=[],i=s.remuxResult,n=i.audio,t=i.video;n&&u(f,n),t&&u(f,t),d.postMessage({event:"transmuxComplete",data:s},f)}function u(d,s){s.data1&&d.push(s.data1.buffer),s.data2&&d.push(s.data2.buffer)}function o(d,s,f){s.forEach(function(i){p(d,i)}),d.postMessage({event:"flush",data:f})}function a(d){return!d.audio&&!d.video&&!d.text&&!d.id3&&!d.initSegment}},"./src/demux/transmuxer.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"default",function(){return t}),j.d(Q,"isPromise",function(){return g}),j.d(Q,"TransmuxConfig",function(){return b}),j.d(Q,"TransmuxState",function(){return E});var w=j("./src/events.ts"),P=j("./src/errors.ts"),_=j("./src/crypt/decrypter.ts"),T=j("./src/demux/aacdemuxer.ts"),C=j("./src/demux/mp4demuxer.ts"),c=j("./src/demux/tsdemuxer.ts"),p=j("./src/demux/mp3demuxer.ts"),u=j("./src/remux/mp4-remuxer.ts"),o=j("./src/remux/passthrough-remuxer.ts"),a=j("./src/demux/chunk-cache.ts"),d=j("./src/utils/mp4-tools.ts"),s=j("./src/utils/logger.ts"),f;try{f=self.performance.now.bind(self.performance)}catch(m){s.logger.debug("Unable to use Performance API on this environment"),f=self.Date.now}var i=[{demux:c.default,remux:u.default},{demux:C.default,remux:o.default},{demux:T.default,remux:u.default},{demux:p.default,remux:u.default}],n=1024;i.forEach(function(m){var y=m.demux;n=Math.max(n,y.minProbeByteLength)});var t=function(){function m(x,l,S,O,A){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 a.default,this.observer=x,this.typeSupported=l,this.config=S,this.vendor=O,this.id=A}var y=m.prototype;return y.configure=function(l){this.transmuxConfig=l,this.decrypter&&this.decrypter.reset()},y.push=function(l,S,O,A){var D=this,I=O.transmuxing;I.executeStart=f();var B=new Uint8Array(l),H=this.cache,te=this.config,W=this.currentTransmuxState,V=this.transmuxConfig;A&&(this.currentTransmuxState=A);var X=h(B,S);if(X&&X.method==="AES-128"){var ne=this.getDecrypter();if(te.enableSoftwareAES){var $=ne.softwareDecrypt(B,X.key.buffer,X.iv.buffer);if(!$)return I.executeEnd=f(),v(O);B=new Uint8Array($)}else return this.decryptionPromise=ne.webCryptoDecrypt(B,X.key.buffer,X.iv.buffer).then(function(We){var He=D.push(We,null,O);return D.decryptionPromise=null,He}),this.decryptionPromise}var ee=A||W,ce=ee.contiguous,de=ee.discontinuity,Ce=ee.trackSwitch,Se=ee.accurateTimeOffset,De=ee.timeOffset,be=V.audioCodec,_e=V.videoCodec,Ke=V.defaultInitPts,Ne=V.duration,Be=V.initSegmentData;if((de||Ce)&&this.resetInitSegment(Be,be,_e,Ne),de&&this.resetInitialTimestamp(Ke),ce||this.resetContiguity(),this.needsProbing(B,de,Ce)){if(H.dataLength){var ze=H.flush();B=Object(d.appendUint8Array)(ze,B)}this.configureTransmuxer(B,V)}var ye=this.transmux(B,X,De,Se,O),pe=this.currentTransmuxState;return pe.contiguous=!0,pe.discontinuity=!1,pe.trackSwitch=!1,I.executeEnd=f(),ye},y.flush=function(l){var S=this,O=l.transmuxing;O.executeStart=f();var A=this.decrypter,D=this.cache,I=this.currentTransmuxState,B=this.decryptionPromise;if(B)return B.then(function(){return S.flush(l)});var H=[],te=I.timeOffset;if(A){var W=A.flush();W&&H.push(this.push(W,null,l))}var V=D.dataLength;D.reset();var X=this.demuxer,ne=this.remuxer;if(!X||!ne)return V>=n&&this.observer.emit(w.Events.ERROR,w.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),O.executeEnd=f(),[v(l)];var $=X.flush(te);return g($)?$.then(function(ee){return S.flushRemux(H,ee,l),H}):(this.flushRemux(H,$,l),H)},y.flushRemux=function(l,S,O){var A=S.audioTrack,D=S.avcTrack,I=S.id3Track,B=S.textTrack,H=this.currentTransmuxState,te=H.accurateTimeOffset,W=H.timeOffset;s.logger.log("[transmuxer.ts]: Flushed fragment "+O.sn+(O.part>-1?" p: "+O.part:"")+" of level "+O.level);var V=this.remuxer.remux(A,D,I,B,W,te,!0,this.id);l.push({remuxResult:V,chunkMeta:O}),O.transmuxing.executeEnd=f()},y.resetInitialTimestamp=function(l){var S=this.demuxer,O=this.remuxer;if(!S||!O)return;S.resetTimeStamp(l),O.resetTimeStamp(l)},y.resetContiguity=function(){var l=this.demuxer,S=this.remuxer;if(!l||!S)return;l.resetContiguity(),S.resetNextTimestamp()},y.resetInitSegment=function(l,S,O,A){var D=this.demuxer,I=this.remuxer;if(!D||!I)return;D.resetInitSegment(S,O,A),I.resetInitSegment(l,S,O)},y.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},y.transmux=function(l,S,O,A,D){var I;return S&&S.method==="SAMPLE-AES"?I=this.transmuxSampleAes(l,S,O,A,D):I=this.transmuxUnencrypted(l,O,A,D),I},y.transmuxUnencrypted=function(l,S,O,A){var D=this.demuxer.demux(l,S,!1,!this.config.progressive),I=D.audioTrack,B=D.avcTrack,H=D.id3Track,te=D.textTrack,W=this.remuxer.remux(I,B,H,te,S,O,!1,this.id);return{remuxResult:W,chunkMeta:A}},y.transmuxSampleAes=function(l,S,O,A,D){var I=this;return this.demuxer.demuxSampleAes(l,S,O).then(function(B){var H=I.remuxer.remux(B.audioTrack,B.avcTrack,B.id3Track,B.textTrack,O,A,!1,I.id);return{remuxResult:H,chunkMeta:D}})},y.configureTransmuxer=function(l,S){for(var O=this.config,A=this.observer,D=this.typeSupported,I=this.vendor,B=S.audioCodec,H=S.defaultInitPts,te=S.duration,W=S.initSegmentData,V=S.videoCodec,X,ne=0,$=i.length;ne<$;ne++)if(i[ne].demux.probe(l)){X=i[ne];break}X||(s.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),X={demux:C.default,remux:o.default});var ee=this.demuxer,ce=this.remuxer,de=X.remux,Ce=X.demux;(!ce||!(ce instanceof de))&&(this.remuxer=new de(A,O,D,I)),(!ee||!(ee instanceof Ce))&&(this.demuxer=new Ce(A,O,D),this.probe=Ce.probe),this.resetInitSegment(W,B,V,te),this.resetInitialTimestamp(H)},y.needsProbing=function(l,S,O){return!this.demuxer||!this.remuxer||S||O},y.getDecrypter=function(){var l=this.decrypter;return l||(l=this.decrypter=new _.default(this.observer,this.config)),l},m}();function h(m,y){var x=null;return m.byteLength>0&&y!=null&&y.key!=null&&y.iv!==null&&y.method!=null&&(x=y),x}var v=function(y){return{remuxResult:{},chunkMeta:y}};function g(m){return"then"in m&&m.then instanceof Function}var b=function(y,x,l,S,O){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=y,this.videoCodec=x,this.initSegmentData=l,this.duration=S,this.defaultInitPts=O},E=function(y,x,l,S,O){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=y,this.contiguous=x,this.accurateTimeOffset=l,this.trackSwitch=S,this.timeOffset=O}},"./src/demux/tsdemuxer.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"discardEPB",function(){return v});var w=j("./src/demux/adts.ts"),P=j("./src/demux/mpegaudio.ts"),_=j("./src/demux/exp-golomb.ts"),T=j("./src/demux/id3.ts"),C=j("./src/demux/sample-aes.ts"),c=j("./src/events.ts"),p=j("./src/utils/mp4-tools.ts"),u=j("./src/utils/logger.ts"),o=j("./src/errors.ts"),a={video:1,audio:2,id3:3,text:4},d=function(){function g(E,m,y){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=E,this.config=m,this.typeSupported=y}g.probe=function(m){var y=g.syncOffset(m);return y<0?!1:(y&&u.logger.warn("MPEG2-TS detected but first sync word found @ offset "+y+", junk ahead ?"),!0)},g.syncOffset=function(m){for(var y=Math.min(1e3,m.length-3*188),x=0;x>4,be=void 0;if(De>1){if(be=de+5+m[de+4],be===de+188)continue}else be=de+4;switch(Se){case I:Ce&&(B&&(S=n(B))&&this.parseAVCPES(S,!1),B={data:[],size:0}),B&&(B.data.push(m.subarray(be,de+188)),B.size+=de+188-be);break;case H:Ce&&(W&&(S=n(W))&&(A.isAAC?this.parseAACPES(S):this.parseMPEGPES(S)),W={data:[],size:0}),W&&(W.data.push(m.subarray(be,de+188)),W.size+=de+188-be);break;case te:Ce&&(V&&(S=n(V))&&this.parseID3PES(S),V={data:[],size:0}),V&&(V.data.push(m.subarray(be,de+188)),V.size+=de+188-be);break;case 0:Ce&&(be+=m[be]+1),$=this._pmtId=f(m,be);break;case $:{Ce&&(be+=m[be]+1);var _e=i(m,be,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,x);I=_e.avc,I>0&&(O.pid=I),H=_e.audio,H>0&&(A.pid=H,A.isAAC=_e.isAAC),te=_e.id3,te>0&&(D.pid=te),X&&!ne&&(u.logger.log("reparse from beginning"),X=!1,de=ce-188),ne=this.pmtParsed=!0;break}case 17:case 8191:break;default:X=!0;break}}else this.observer.emit(c.Events.ERROR,c.Events.ERROR,{type:o.ErrorTypes.MEDIA_ERROR,details:o.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});O.pesData=B,A.pesData=W,D.pesData=V;var Ke={audioTrack:A,avcTrack:O,id3Track:D,textTrack:this._txtTrack};return l&&this.extractRemainingSamples(Ke),Ke},b.flush=function(){var m=this.remainderData;this.remainderData=null;var y;return m?y=this.demux(m,-1,!1,!0):y={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(y),this.sampleAes?this.decrypt(y,this.sampleAes):y},b.extractRemainingSamples=function(m){var y=m.audioTrack,x=m.avcTrack,l=m.id3Track,S=x.pesData,O=y.pesData,A=l.pesData,D;S&&(D=n(S))?(this.parseAVCPES(D,!0),x.pesData=null):x.pesData=S,O&&(D=n(O))?(y.isAAC?this.parseAACPES(D):this.parseMPEGPES(D),y.pesData=null):(O!=null&&O.size&&u.logger.log("last AAC PES packet truncated,might overlap between fragments"),y.pesData=O),A&&(D=n(A))?(this.parseID3PES(D),l.pesData=null):l.pesData=A},b.demuxSampleAes=function(m,y,x){var l=this.demux(m,x,!0,!this.config.progressive),S=this.sampleAes=new C.default(this.observer,this.config,y);return this.decrypt(l,S)},b.decrypt=function(m,y){return new Promise(function(x){var l=m.audioTrack,S=m.avcTrack;l.samples&&l.isAAC?y.decryptAacSamples(l.samples,0,function(){S.samples?y.decryptAvcSamples(S.samples,0,0,function(){x(m)}):x(m)}):S.samples&&y.decryptAvcSamples(S.samples,0,0,function(){x(m)})})},b.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},b.parseAVCPES=function(m,y){var x=this,l=this._avcTrack,S=this.parseAVCNALu(m.data),O=!1,A=this.avcSample,D,I=!1;m.data=null,A&&S.length&&!l.audFound&&(t(A,l),A=this.avcSample=s(!1,m.pts,m.dts,"")),S.forEach(function(B){switch(B.type){case 1:{D=!0,A||(A=x.avcSample=s(!0,m.pts,m.dts,"")),O&&(A.debug+="NDR "),A.frame=!0;var H=B.data;if(I&&H.length>4){var te=new _.default(H).readSliceType();(te===2||te===4||te===7||te===9)&&(A.key=!0)}break}case 5:D=!0,A||(A=x.avcSample=s(!0,m.pts,m.dts,"")),O&&(A.debug+="IDR "),A.key=!0,A.frame=!0;break;case 6:{D=!0,O&&A&&(A.debug+="SEI ");var W=new _.default(v(B.data));W.readUByte();for(var V=0,X=0,ne=!1,$=0;!ne&&W.bytesAvailable>1;){V=0;do $=W.readUByte(),V+=$;while($===255);X=0;do $=W.readUByte(),X+=$;while($===255);if(V===4&&W.bytesAvailable!==0){ne=!0;var ee=W.readUByte();if(ee===181){var ce=W.readUShort();if(ce===49){var de=W.readUInt();if(de===1195456820){var Ce=W.readUByte();if(Ce===3){for(var Se=W.readUByte(),De=W.readUByte(),be=31&Se,_e=[Se,De],Ke=0;Ke16){for(var Ne=[],Be=0;Be<16;Be++)Ne.push(W.readUByte().toString(16)),(Be===3||Be===5||Be===7||Be===9)&&Ne.push("-");for(var ze=X-16,ye=new Uint8Array(ze),pe=0;pe=0){var W={data:m.subarray(H,A-l-1),type:te};O.push(W)}else{var V=this.getLastNalUnit();if(V&&(S&&A<=4-S&&(V.state&&(V.data=V.data.subarray(0,V.data.byteLength-S))),I=A-l-1,I>0)){var X=new Uint8Array(V.data.byteLength+I);X.set(V.data,0),X.set(m.subarray(0,I),V.data.byteLength),V.data=X,V.state=0}}A=0&&l>=0){var ne={data:m.subarray(H,y),type:te,state:l};O.push(ne)}if(O.length===0){var $=this.getLastNalUnit();if($){var ee=new Uint8Array($.data.byteLength+m.byteLength);ee.set($.data,0),ee.set(m,$.data.byteLength),$.data=ee}}return x.naluState=l,O},b.parseAACPES=function(m){var y=0,x=this._audioTrack,l=this.aacOverFlow,S=m.data;if(l){this.aacOverFlow=null;var O=l.sample.unit.byteLength,A=Math.min(l.missing,O),D=O-A;l.sample.unit.set(S.subarray(0,A),D),x.samples.push(l.sample),y=l.missing}var I,B;for(I=y,B=S.length;I1;){var O=new Uint8Array(S[0].length+S[1].length);O.set(S[0]),O.set(S[1],S[0].length),S[0]=O,S.splice(1,1)}E=S[0];var A=(E[0]<<16)+(E[1]<<8)+E[2];if(A===1){if(m=(E[4]<<8)+E[5],m&&m>g.size-6)return null;var D=E[7];D&192&&(x=(E[9]&14)*536870912+(E[10]&255)*4194304+(E[11]&254)*16384+(E[12]&255)*128+(E[13]&254)/2,D&64?(l=(E[14]&14)*536870912+(E[15]&255)*4194304+(E[16]&254)*16384+(E[17]&255)*128+(E[18]&254)/2,x-l>60*9e4&&(u.logger.warn(Math.round((x-l)/9e4)+"s delta between PTS and DTS, align them"),x=l)):l=x),y=E[8];var I=y+9;if(g.size<=I)return null;g.size-=I;for(var B=new Uint8Array(g.size),H=0,te=S.length;HW){I-=W;continue}else E=E.subarray(I),W-=I,I=0;B.set(E,b),b+=W}return m&&(m-=y+3),{data:B,pts:x,dts:l,len:m}}return null}function t(g,b){if(g.units.length&&g.frame){if(g.pts===void 0){var E=b.samples,m=E.length;if(m){var y=E[m-1];g.pts=y.pts,g.dts=y.dts}else{b.dropped++;return}}b.samples.push(g)}g.debug.length&&u.logger.log(g.pts+"/"+g.dts+":"+g.debug)}function h(g,b){var E=g.length;if(E>0){if(b.pts>=g[E-1].pts)g.push(b);else for(var m=E-1;m>=0;m--)if(b.ptsx)return S;return 0}},{key:"maxAutoLevel",get:function(){var y=this.levels,x=this.autoLevelCapping,l;return x===-1&&y&&y.length?l=y.length-1:l=x,l}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(y){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,y)}},{key:"audioTracks",get:function(){var y=this.audioTrackController;return y?y.audioTracks:[]}},{key:"audioTrack",get:function(){var y=this.audioTrackController;return y?y.audioTrack:-1},set:function(y){var x=this.audioTrackController;x&&(x.audioTrack=y)}},{key:"subtitleTracks",get:function(){var y=this.subtitleTrackController;return y?y.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var y=this.subtitleTrackController;return y?y.subtitleTrack:-1},set:function(y){var x=this.subtitleTrackController;x&&(x.subtitleTrack=y)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var y=this.subtitleTrackController;return y?y.subtitleDisplay:!1},set:function(y){var x=this.subtitleTrackController;x&&(x.subtitleDisplay=y)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(y){this.config.lowLatencyMode=y}},{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 n.Events}},{key:"ErrorTypes",get:function(){return t.ErrorTypes}},{key:"ErrorDetails",get:function(){return t.ErrorDetails}},{key:"DefaultConfig",get:function(){return b.defaultConfig?b.defaultConfig:s.hlsDefaultConfig},set:function(y){b.defaultConfig=y}}]),b}();g.defaultConfig=void 0},"./src/is-supported.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"isSupported",function(){return _}),j.d(Q,"changeTypeSupported",function(){return T});var w=j("./src/utils/mediasource-helper.ts");function P(){return self.SourceBuffer||self.WebKitSourceBuffer}function _(){var C=Object(w.getMediaSource)();if(!C)return!1;var c=P(),p=C&&typeof C.isTypeSupported=="function"&&C.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),u=!c||c.prototype&&typeof c.prototype.appendBuffer=="function"&&typeof c.prototype.remove=="function";return!!p&&!!u}function T(){var C,c=P();return typeof(c==null||((C=c.prototype)===null||C===void 0)?void 0:C.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"default",function(){return d}),j.d(Q,"LoadError",function(){return f});var w=j("./src/polyfills/number.ts"),P=j("./src/errors.ts");function _(i,n){i.prototype=Object.create(n.prototype),i.prototype.constructor=i,u(i,n)}function T(i){var n=typeof Map=="function"?new Map:void 0;return T=function(h){if(h===null||!p(h))return h;if(typeof h!="function")throw new TypeError("Super expression must either be null or a function");if(typeof n!="undefined"){if(n.has(h))return n.get(h);n.set(h,v)}function v(){return C(h,arguments,o(this).constructor)}return v.prototype=Object.create(h.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),u(v,h)},T(i)}function C(i,n,t){return c()?C=Reflect.construct:C=function(v,g,b){var E=[null];E.push.apply(E,g);var m=Function.bind.apply(v,E),y=new m;return b&&u(y,b.prototype),y},C.apply(null,arguments)}function c(){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(i){return!1}}function p(i){return Function.toString.call(i).indexOf("[native code]")!==-1}function u(i,n){return u=Object.setPrototypeOf||function(h,v){return h.__proto__=v,h},u(i,n)}function o(i){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},o(i)}var a=Math.pow(2,17),d=function(){function i(t){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=t}var n=i.prototype;return n.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},n.abort=function(){this.loader&&this.loader.abort()},n.load=function(h,v){var g=this,b=h.url;if(!b)return Promise.reject(new f({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:h,networkDetails:null},"Fragment does not have a "+(b?"part list":"url")));this.abort();var E=this.config,m=E.fLoader,y=E.loader;return new Promise(function(x,l){g.loader&&g.loader.destroy();var S=g.loader=h.loader=m?new m(E):new y(E),O=s(h),A={timeout:E.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:E.fragLoadingMaxRetryTimeout,highWaterMark:a};h.stats=S.stats,S.load(O,A,{onSuccess:function(I,B,H,te){g.resetLoader(h,S),x({frag:h,part:null,payload:I.data,networkDetails:te})},onError:function(I,B,H){g.resetLoader(h,S),l(new f({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:h,response:I,networkDetails:H}))},onAbort:function(I,B,H){g.resetLoader(h,S),l(new f({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:h,networkDetails:H}))},onTimeout:function(I,B,H){g.resetLoader(h,S),l(new f({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:h,networkDetails:H}))},onProgress:function(I,B,H,te){v&&v({frag:h,part:null,payload:H,networkDetails:te})}})})},n.loadPart=function(h,v,g){var b=this;this.abort();var E=this.config,m=E.fLoader,y=E.loader;return new Promise(function(x,l){b.loader&&b.loader.destroy();var S=b.loader=h.loader=m?new m(E):new y(E),O=s(h,v),A={timeout:E.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:E.fragLoadingMaxRetryTimeout,highWaterMark:a};v.stats=S.stats,S.load(O,A,{onSuccess:function(I,B,H,te){b.resetLoader(h,S),b.updateStatsFromPart(h,v);var W={frag:h,part:v,payload:I.data,networkDetails:te};g(W),x(W)},onError:function(I,B,H){b.resetLoader(h,S),l(new f({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:h,part:v,response:I,networkDetails:H}))},onAbort:function(I,B,H){h.stats.aborted=v.stats.aborted,b.resetLoader(h,S),l(new f({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:h,part:v,networkDetails:H}))},onTimeout:function(I,B,H){b.resetLoader(h,S),l(new f({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:h,part:v,networkDetails:H}))}})})},n.updateStatsFromPart=function(h,v){var g=h.stats,b=v.stats,E=b.total;if(g.loaded+=b.loaded,E){var m=Math.round(h.duration/v.duration),y=Math.min(Math.round(g.loaded/E),m),x=m-y,l=x*Math.round(g.loaded/y);g.total=g.loaded+l}else g.total=Math.max(g.loaded,g.total);var S=g.loading,O=b.loading;S.start?S.first+=O.first-O.start:(S.start=O.start,S.first=O.first),S.end=O.end},n.resetLoader=function(h,v){h.loader=null,this.loader===v&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),v.destroy()},i}();function s(i,n){n===void 0&&(n=null);var t=n||i,h={frag:i,part:n,responseType:"arraybuffer",url:t.url,headers:{},rangeStart:0,rangeEnd:0},v=t.byteRangeStartOffset,g=t.byteRangeEndOffset;return Object(w.isFiniteNumber)(v)&&Object(w.isFiniteNumber)(g)&&(h.rangeStart=v,h.rangeEnd=g),h}var f=function(i){_(n,i);function n(t){for(var h,v=arguments.length,g=new Array(v>1?v-1:0),b=1;b>8*(15-E)&255;return b},h.setDecryptDataFromLevelKey=function(g,b){var E=g;return(g==null?void 0:g.method)==="AES-128"&&g.uri&&!g.iv&&(E=C.LevelKey.fromURI(g.uri),E.method=g.method,E.iv=this.createInitializationVector(b),E.keyFormat="identity"),E},h.setElementaryStreamInfo=function(g,b,E,m,y,x){x===void 0&&(x=!1);var l=this.elementaryStreams,S=l[g];if(!S){l[g]={startPTS:b,endPTS:E,startDTS:m,endDTS:y,partial:x};return}S.startPTS=Math.min(S.startPTS,b),S.endPTS=Math.max(S.endPTS,E),S.startDTS=Math.min(S.startDTS,m),S.endDTS=Math.max(S.endDTS,y)},h.clearElementaryStreamInfo=function(){var g=this.elementaryStreams;g[d.AUDIO]=null,g[d.VIDEO]=null,g[d.AUDIOVIDEO]=null},a(t,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var g=this.sn;typeof g!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&T.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),g=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,g)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(w.isFiniteNumber)(this.programDateTime))return null;var g=Object(w.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+g*1e3}},{key:"encrypted",get:function(){var g;return!!((g=this.decryptdata)!==null&&g!==void 0&&g.keyFormat&&this.decryptdata.uri)}}]),t}(s),i=function(n){p(t,n);function t(h,v,g,b,E){var m;m=n.call(this,g)||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 c.LoadStats,m.duration=h.decimalFloatingPoint("DURATION"),m.gap=h.bool("GAP"),m.independent=h.bool("INDEPENDENT"),m.relurl=h.enumeratedString("URI"),m.fragment=v,m.index=b;var y=h.enumeratedString("BYTERANGE");return y&&m.setByteRange(y,E),E&&(m.fragOffset=E.fragOffset+E.duration),m}return a(t,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var v=this.elementaryStreams;return!!(v.audio||v.video||v.audiovideo)}}]),t}(s)},"./src/loader/key-loader.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"default",function(){return T});var w=j("./src/events.ts"),P=j("./src/errors.ts"),_=j("./src/utils/logger.ts"),T=function(){function C(p){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=p,this._registerListeners()}var c=C.prototype;return c._registerListeners=function(){this.hls.on(w.Events.KEY_LOADING,this.onKeyLoading,this)},c._unregisterListeners=function(){this.hls.off(w.Events.KEY_LOADING,this.onKeyLoading)},c.destroy=function(){this._unregisterListeners();for(var u in this.loaders){var o=this.loaders[u];o&&o.destroy()}this.loaders={}},c.onKeyLoading=function(u,o){var a=o.frag,d=a.type,s=this.loaders[d];if(!a.decryptdata){_.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var f=a.decryptdata.uri;if(f!==this.decrypturl||this.decryptkey===null){var i=this.hls.config;if(s&&(_.logger.warn("abort previous key loader for type:"+d),s.abort()),!f){_.logger.warn("key uri is falsy");return}var n=i.loader,t=a.loader=this.loaders[d]=new n(i);this.decrypturl=f,this.decryptkey=null;var h={url:f,frag:a,responseType:"arraybuffer"},v={timeout:i.fragLoadingTimeOut,maxRetry:0,retryDelay:i.fragLoadingRetryDelay,maxRetryDelay:i.fragLoadingMaxRetryTimeout,highWaterMark:0},g={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};t.load(h,v,g)}else this.decryptkey&&(a.decryptdata.key=this.decryptkey,this.hls.trigger(w.Events.KEY_LOADED,{frag:a}))},c.loadsuccess=function(u,o,a){var d=a.frag;if(!d.decryptdata){_.logger.error("after key load, decryptdata unset");return}this.decryptkey=d.decryptdata.key=new Uint8Array(u.data),d.loader=null,delete this.loaders[d.type],this.hls.trigger(w.Events.KEY_LOADED,{frag:d})},c.loaderror=function(u,o){var a=o.frag,d=a.loader;d&&d.abort(),delete this.loaders[a.type],this.hls.trigger(w.Events.ERROR,{type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:a,response:u})},c.loadtimeout=function(u,o){var a=o.frag,d=a.loader;d&&d.abort(),delete this.loaders[a.type],this.hls.trigger(w.Events.ERROR,{type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:a})},C}()},"./src/loader/level-details.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"LevelDetails",function(){return C});var w=j("./src/polyfills/number.ts");function P(c,p){for(var u=0;uo.endSN||a>0||a===0&&d>0,this.updated||this.advanced?this.misses=Math.floor(o.misses*.6):this.misses=o.misses+1,this.availabilityDelay=o.availabilityDelay},_(c,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(w.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||T}},{key:"drift",get:function(){var o=this.driftEndTime-this.driftStartTime;if(o>0){var a=this.driftEnd-this.driftStart;return a*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}}]),c}()},"./src/loader/level-key.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"LevelKey",function(){return C});var w=j("./node_modules/url-toolkit/src/url-toolkit.js"),P=j.n(w);function _(c,p){for(var u=0;u2){var l=x.shift()+".";return l+=parseInt(x.shift()).toString(16),l+=("000"+parseInt(x.shift()).toString(16)).substr(-4),l}return y},E.resolve=function(y,x){return P.buildAbsoluteURL(x,y,{alwaysNormalize:!0})},E.parseMasterPlaylist=function(y,x){var l=[],S={},O=!1;a.lastIndex=0;for(var A;(A=a.exec(y))!=null;)if(A[1]){var D=new p.AttrList(A[1]),I={attrs:D,bitrate:D.decimalInteger("AVERAGE-BANDWIDTH")||D.decimalInteger("BANDWIDTH"),name:D.NAME,url:E.resolve(A[2],x)},B=D.decimalResolution("RESOLUTION");B&&(I.width=B.width,I.height=B.height),h((D.CODECS||"").split(/[ ,]+/).filter(function(te){return te}),I),I.videoCodec&&I.videoCodec.indexOf("avc1")!==-1&&(I.videoCodec=E.convertAVC1ToAVCOTI(I.videoCodec)),l.push(I)}else if(A[3]){var H=new p.AttrList(A[3]);H["DATA-ID"]&&(O=!0,S[H["DATA-ID"]]=H)}return{levels:l,sessionData:O?S:null}},E.parseMasterPlaylistMedia=function(y,x,l,S){S===void 0&&(S=[]);var O,A=[],D=0;for(d.lastIndex=0;(O=d.exec(y))!==null;){var I=new p.AttrList(O[1]);if(I.TYPE===l){var B={attrs:I,bitrate:0,id:D++,groupId:I["GROUP-ID"],instreamId:I["INSTREAM-ID"],name:I.NAME||I.LANGUAGE||"",type:l,default:I.bool("DEFAULT"),autoselect:I.bool("AUTOSELECT"),forced:I.bool("FORCED"),lang:I.LANGUAGE,url:I.URI?E.resolve(I.URI,x):""};if(S.length){var H=E.findGroup(S,B.groupId)||S[0];v(B,H,"audioCodec"),v(B,H,"textCodec")}A.push(B)}}return A},E.parseLevelPlaylist=function(y,x,l,S,O){var A=new C.LevelDetails(x),D=A.fragments,I=null,B=0,H=0,te=0,W=0,V=null,X=new T.Fragment(S,x),ne,$,ee,ce=-1,de=!1;for(s.lastIndex=0,A.m3u8=y;(ne=s.exec(y))!==null;){de&&(de=!1,X=new T.Fragment(S,x),X.start=te,X.sn=B,X.cc=W,X.level=l,I&&(X.initSegment=I,X.rawProgramDateTime=I.rawProgramDateTime));var Ce=ne[1];if(Ce){X.duration=parseFloat(Ce);var Se=(" "+ne[2]).slice(1);X.title=Se||null,X.tagList.push(Se?["INF",Ce,Se]:["INF",Ce])}else if(ne[3])Object(w.isFiniteNumber)(X.duration)&&(X.start=te,ee&&(X.levelkey=ee),X.sn=B,X.level=l,X.cc=W,X.urlId=O,D.push(X),X.relurl=(" "+ne[3]).slice(1),b(X,V),V=X,te+=X.duration,B++,H=0,de=!0);else if(ne[4]){var De=(" "+ne[4]).slice(1);V?X.setByteRange(De,V):X.setByteRange(De)}else if(ne[5])X.rawProgramDateTime=(" "+ne[5]).slice(1),X.tagList.push(["PROGRAM-DATE-TIME",X.rawProgramDateTime]),ce===-1&&(ce=D.length);else{if(ne=ne[0].match(f),!ne){u.logger.warn("No matches on slow regex match for level playlist!");continue}for($=1;$-1){u.logger.warn("Keyformat "+q+" is not supported from the manifest");continue}else if(q!=="identity")continue;He&&(ee=c.LevelKey.fromURL(x,nt),nt&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(He)>=0&&(ee.method=He,ee.keyFormat=q,U&&(ee.keyID=U),k&&(ee.keyFormatVersions=k),ee.iv=re));break}case"START":{var J=new p.AttrList(_e),xe=J.decimalFloatingPoint("TIME-OFFSET");Object(w.isFiniteNumber)(xe)&&(A.startTimeOffset=xe);break}case"MAP":{var ke=new p.AttrList(_e);X.relurl=ke.URI,ke.BYTERANGE&&X.setByteRange(ke.BYTERANGE),X.level=l,X.sn="initSegment",ee&&(X.levelkey=ee),X.initSegment=null,I=X,de=!0;break}case"SERVER-CONTROL":{var dt=new p.AttrList(_e);A.canBlockReload=dt.bool("CAN-BLOCK-RELOAD"),A.canSkipUntil=dt.optionalFloat("CAN-SKIP-UNTIL",0),A.canSkipDateRanges=A.canSkipUntil>0&&dt.bool("CAN-SKIP-DATERANGES"),A.partHoldBack=dt.optionalFloat("PART-HOLD-BACK",0),A.holdBack=dt.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Ue=new p.AttrList(_e);A.partTarget=Ue.decimalFloatingPoint("PART-TARGET");break}case"PART":{var je=A.partList;je||(je=A.partList=[]);var tt=H>0?je[je.length-1]:void 0,mt=H++,Qe=new T.Part(new p.AttrList(_e),X,x,mt,tt);je.push(Qe),X.duration+=Qe.duration;break}case"PRELOAD-HINT":{var Xe=new p.AttrList(_e);A.preloadHint=Xe;break}case"RENDITION-REPORT":{var Fe=new p.AttrList(_e);A.renditionReports=A.renditionReports||[],A.renditionReports.push(Fe);break}default:u.logger.warn("line parsed but not handled: "+ne);break}}}V&&!V.relurl?(D.pop(),te-=V.duration,A.partList&&(A.fragmentHint=V)):A.partList&&(b(X,V),X.cc=W,A.fragmentHint=X);var Ie=D.length,Me=D[0],Ee=D[Ie-1];if(te+=A.skippedSegments*A.targetduration,te>0&&Ie&&Ee){A.averagetargetduration=te/Ie;var Ae=Ee.sn;A.endSN=Ae!=="initSegment"?Ae:0,Me&&(A.startCC=Me.cc,Me.initSegment||A.fragments.every(function(Le){return Le.relurl&&n(Le.relurl)})&&(u.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),X=new T.Fragment(S,x),X.relurl=Ee.relurl,X.level=l,X.sn="initSegment",Me.initSegment=X,A.needSidxRanges=!0))}else A.endSN=0,A.startCC=0;return A.fragmentHint&&(te+=A.fragmentHint.duration),A.totalduration=te,A.endCC=W,ce>0&&g(D,ce),A},E}();function h(E,m){["video","audio","text"].forEach(function(y){var x=E.filter(function(S){return Object(o.isCodecType)(S,y)});if(x.length){var l=x.filter(function(S){return S.lastIndexOf("avc1",0)===0||S.lastIndexOf("mp4a",0)===0});m[y+"Codec"]=l.length>0?l[0]:x[0],E=E.filter(function(S){return x.indexOf(S)===-1})}}),m.unknownCodecs=E}function v(E,m,y){var x=m[y];x&&(E[y]=x)}function g(E,m){for(var y=E[m],x=m;x--;){var l=E[x];if(!l)return;l.programDateTime=y.programDateTime-l.duration*1e3,y=l}}function b(E,m){E.rawProgramDateTime?E.programDateTime=Date.parse(E.rawProgramDateTime):m!=null&&m.programDateTime&&(E.programDateTime=m.endProgramDateTime),Object(w.isFiniteNumber)(E.programDateTime)||(E.programDateTime=null,E.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(le,Q,j){"use strict";j.r(Q);var w=j("./src/polyfills/number.ts"),P=j("./src/events.ts"),_=j("./src/errors.ts"),T=j("./src/utils/logger.ts"),C=j("./src/utils/mp4-tools.ts"),c=j("./src/loader/m3u8-parser.ts"),p=j("./src/types/loader.ts"),u=j("./src/utils/attr-list.ts");function o(s){var f=s.type;switch(f){case p.PlaylistContextType.AUDIO_TRACK:return p.PlaylistLevelType.AUDIO;case p.PlaylistContextType.SUBTITLE_TRACK:return p.PlaylistLevelType.SUBTITLE;default:return p.PlaylistLevelType.MAIN}}function a(s,f){var i=s.url;return(i===void 0||i.indexOf("data:")===0)&&(i=f.url),i}var d=function(){function s(i){this.hls=void 0,this.loaders=Object.create(null),this.hls=i,this.registerListeners()}var f=s.prototype;return f.registerListeners=function(){var n=this.hls;n.on(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.on(P.Events.LEVEL_LOADING,this.onLevelLoading,this),n.on(P.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),n.on(P.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},f.unregisterListeners=function(){var n=this.hls;n.off(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.off(P.Events.LEVEL_LOADING,this.onLevelLoading,this),n.off(P.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),n.off(P.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},f.createInternalLoader=function(n){var t=this.hls.config,h=t.pLoader,v=t.loader,g=h||v,b=new g(t);return n.loader=b,this.loaders[n.type]=b,b},f.getInternalLoader=function(n){return this.loaders[n.type]},f.resetInternalLoader=function(n){this.loaders[n]&&delete this.loaders[n]},f.destroyInternalLoaders=function(){for(var n in this.loaders){var t=this.loaders[n];t&&t.destroy(),this.resetInternalLoader(n)}},f.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},f.onManifestLoading=function(n,t){var h=t.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:p.PlaylistContextType.MANIFEST,url:h,deliveryDirectives:null})},f.onLevelLoading=function(n,t){var h=t.id,v=t.level,g=t.url,b=t.deliveryDirectives;this.load({id:h,groupId:null,level:v,responseType:"text",type:p.PlaylistContextType.LEVEL,url:g,deliveryDirectives:b})},f.onAudioTrackLoading=function(n,t){var h=t.id,v=t.groupId,g=t.url,b=t.deliveryDirectives;this.load({id:h,groupId:v,level:null,responseType:"text",type:p.PlaylistContextType.AUDIO_TRACK,url:g,deliveryDirectives:b})},f.onSubtitleTrackLoading=function(n,t){var h=t.id,v=t.groupId,g=t.url,b=t.deliveryDirectives;this.load({id:h,groupId:v,level:null,responseType:"text",type:p.PlaylistContextType.SUBTITLE_TRACK,url:g,deliveryDirectives:b})},f.load=function(n){var t,h=this.hls.config,v=this.getInternalLoader(n);if(v){var g=v.context;if(g&&g.url===n.url){T.logger.trace("[playlist-loader]: playlist request ongoing");return}T.logger.log("[playlist-loader]: aborting previous loader for type: "+n.type),v.abort()}var b,E,m,y;switch(n.type){case p.PlaylistContextType.MANIFEST:b=h.manifestLoadingMaxRetry,E=h.manifestLoadingTimeOut,m=h.manifestLoadingRetryDelay,y=h.manifestLoadingMaxRetryTimeout;break;case p.PlaylistContextType.LEVEL:case p.PlaylistContextType.AUDIO_TRACK:case p.PlaylistContextType.SUBTITLE_TRACK:b=0,E=h.levelLoadingTimeOut;break;default:b=h.levelLoadingMaxRetry,E=h.levelLoadingTimeOut,m=h.levelLoadingRetryDelay,y=h.levelLoadingMaxRetryTimeout;break}if(v=this.createInternalLoader(n),(t=n.deliveryDirectives)!==null&&t!==void 0&&t.part){var x;if(n.type===p.PlaylistContextType.LEVEL&&n.level!==null?x=this.hls.levels[n.level].details:n.type===p.PlaylistContextType.AUDIO_TRACK&&n.id!==null?x=this.hls.audioTracks[n.id].details:n.type===p.PlaylistContextType.SUBTITLE_TRACK&&n.id!==null&&(x=this.hls.subtitleTracks[n.id].details),x){var l=x.partTarget,S=x.targetduration;l&&S&&(E=Math.min(Math.max(l*3,S*.8)*1e3,E))}}var O={timeout:E,maxRetry:b,retryDelay:m,maxRetryDelay:y,highWaterMark:0},A={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};v.load(n,O,A)},f.loadsuccess=function(n,t,h,v){if(v===void 0&&(v=null),h.isSidxRequest){this.handleSidxRequest(n,h),this.handlePlaylistLoaded(n,t,h,v);return}this.resetInternalLoader(h.type);var g=n.data;if(g.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(n,h,"no EXTM3U delimiter",v);return}t.parsing.start=performance.now(),g.indexOf("#EXTINF:")>0||g.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(n,t,h,v):this.handleMasterPlaylist(n,t,h,v)},f.loaderror=function(n,t,h){h===void 0&&(h=null),this.handleNetworkError(t,h,!1,n)},f.loadtimeout=function(n,t,h){h===void 0&&(h=null),this.handleNetworkError(t,h,!0)},f.handleMasterPlaylist=function(n,t,h,v){var g=this.hls,b=n.data,E=a(n,h),m=c.default.parseMasterPlaylist(b,E),y=m.levels,x=m.sessionData;if(!y.length){this.handleManifestParsingError(n,h,"no level found in manifest",v);return}var l=y.map(function(B){return{id:B.attrs.AUDIO,audioCodec:B.audioCodec}}),S=y.map(function(B){return{id:B.attrs.SUBTITLES,textCodec:B.textCodec}}),O=c.default.parseMasterPlaylistMedia(b,E,"AUDIO",l),A=c.default.parseMasterPlaylistMedia(b,E,"SUBTITLES",S),D=c.default.parseMasterPlaylistMedia(b,E,"CLOSED-CAPTIONS");if(O.length){var I=O.some(function(B){return!B.url});!I&&y[0].audioCodec&&!y[0].attrs.AUDIO&&(T.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),O.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new u.AttrList({}),bitrate:0,url:""}))}g.trigger(P.Events.MANIFEST_LOADED,{levels:y,audioTracks:O,subtitles:A,captions:D,url:E,stats:t,networkDetails:v,sessionData:x})},f.handleTrackOrLevelPlaylist=function(n,t,h,v){var g=this.hls,b=h.id,E=h.level,m=h.type,y=a(n,h),x=Object(w.isFiniteNumber)(b)?b:0,l=Object(w.isFiniteNumber)(E)?E:x,S=o(h),O=c.default.parseLevelPlaylist(n.data,y,l,S,x);if(!O.fragments.length){g.trigger(P.Events.ERROR,{type:_.ErrorTypes.NETWORK_ERROR,details:_.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:y,reason:"no fragments found in level",level:typeof h.level=="number"?h.level:void 0});return}if(m===p.PlaylistContextType.MANIFEST){var A={attrs:new u.AttrList({}),bitrate:0,details:O,name:"",url:y};g.trigger(P.Events.MANIFEST_LOADED,{levels:[A],audioTracks:[],url:y,stats:t,networkDetails:v,sessionData:null})}if(t.parsing.end=performance.now(),O.needSidxRanges){var D,I=(D=O.fragments[0].initSegment)===null||D===void 0?void 0:D.url;this.load({url:I,isSidxRequest:!0,type:m,level:E,levelDetails:O,id:b,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}h.levelDetails=O,this.handlePlaylistLoaded(n,t,h,v)},f.handleSidxRequest=function(n,t){var h=Object(C.parseSegmentIndex)(new Uint8Array(n.data));if(!h)return;var v=h.references,g=t.levelDetails;v.forEach(function(b,E){var m=b.info,y=g.fragments[E];y.byteRange.length===0&&y.setByteRange(String(1+m.end-m.start)+"@"+String(m.start)),y.initSegment&&y.initSegment.setByteRange(String(h.moovEndOffset)+"@0")})},f.handleManifestParsingError=function(n,t,h,v){this.hls.trigger(P.Events.ERROR,{type:_.ErrorTypes.NETWORK_ERROR,details:_.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:t.type===p.PlaylistContextType.MANIFEST,url:n.url,reason:h,response:n,context:t,networkDetails:v})},f.handleNetworkError=function(n,t,h,v){h===void 0&&(h=!1),T.logger.warn("[playlist-loader]: A network "+(h?"timeout":"error")+" occurred while loading "+n.type+" level: "+n.level+" id: "+n.id+' group-id: "'+n.groupId+'"');var g=_.ErrorDetails.UNKNOWN,b=!1,E=this.getInternalLoader(n);switch(n.type){case p.PlaylistContextType.MANIFEST:g=h?_.ErrorDetails.MANIFEST_LOAD_TIMEOUT:_.ErrorDetails.MANIFEST_LOAD_ERROR,b=!0;break;case p.PlaylistContextType.LEVEL:g=h?_.ErrorDetails.LEVEL_LOAD_TIMEOUT:_.ErrorDetails.LEVEL_LOAD_ERROR,b=!1;break;case p.PlaylistContextType.AUDIO_TRACK:g=h?_.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:_.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,b=!1;break;case p.PlaylistContextType.SUBTITLE_TRACK:g=h?_.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:_.ErrorDetails.SUBTITLE_LOAD_ERROR,b=!1;break}E&&this.resetInternalLoader(n.type);var m={type:_.ErrorTypes.NETWORK_ERROR,details:g,fatal:b,url:n.url,loader:E,context:n,networkDetails:t};v&&(m.response=v),this.hls.trigger(P.Events.ERROR,m)},f.handlePlaylistLoaded=function(n,t,h,v){var g=h.type,b=h.level,E=h.id,m=h.groupId,y=h.loader,x=h.levelDetails,l=h.deliveryDirectives;if(!(x!=null&&x.targetduration)){this.handleManifestParsingError(n,h,"invalid target duration",v);return}if(!y)return;x.live&&(y.getCacheAge&&(x.ageHeader=y.getCacheAge()||0),(!y.getCacheAge||isNaN(x.ageHeader))&&(x.ageHeader=0));switch(g){case p.PlaylistContextType.MANIFEST:case p.PlaylistContextType.LEVEL:this.hls.trigger(P.Events.LEVEL_LOADED,{details:x,level:b||0,id:E||0,stats:t,networkDetails:v,deliveryDirectives:l});break;case p.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(P.Events.AUDIO_TRACK_LOADED,{details:x,id:E||0,groupId:m||"",stats:t,networkDetails:v,deliveryDirectives:l});break;case p.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(P.Events.SUBTITLE_TRACK_LOADED,{details:x,id:E||0,groupId:m||"",stats:t,networkDetails:v,deliveryDirectives:l});break}},s}();Q.default=d},"./src/polyfills/number.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"isFiniteNumber",function(){return w}),j.d(Q,"MAX_SAFE_INTEGER",function(){return P});var w=Number.isFinite||function(_){return typeof _=="number"&&isFinite(_)},P=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(le,Q,j){"use strict";j.r(Q);var w=function(){function P(){}return P.getSilentFrame=function(T,C){switch(T){case"mp4a.40.2":if(C===1)return new Uint8Array([0,200,0,128,35,128]);if(C===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(C===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(C===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(C===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(C===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(C===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(C===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(C===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},P}();Q.default=w},"./src/remux/mp4-generator.ts":function(le,Q,j){"use strict";j.r(Q);var w=Math.pow(2,32)-1,P=function(){function _(){}return _.init=function(){_.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 C;for(C in _.types)_.types.hasOwnProperty(C)&&(_.types[C]=[C.charCodeAt(0),C.charCodeAt(1),C.charCodeAt(2),C.charCodeAt(3)]);var c=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]),p=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]);_.HDLR_TYPES={video:c,audio:p};var u=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]);_.STTS=_.STSC=_.STCO=o,_.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),_.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),_.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),_.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var a=new Uint8Array([105,115,111,109]),d=new Uint8Array([97,118,99,49]),s=new Uint8Array([0,0,0,1]);_.FTYP=_.box(_.types.ftyp,a,s,a,d),_.DINF=_.box(_.types.dinf,_.box(_.types.dref,u))},_.box=function(C){for(var c=8,p=arguments.length,u=new Array(p>1?p-1:0),o=1;o>24&255,s[1]=c>>16&255,s[2]=c>>8&255,s[3]=c&255,s.set(C,4),a=0,c=8;a>24&255,C>>16&255,C>>8&255,C&255,p>>24,p>>16&255,p>>8&255,p&255,u>>24,u>>16&255,u>>8&255,u&255,85,196,0,0]))},_.mdia=function(C){return _.box(_.types.mdia,_.mdhd(C.timescale,C.duration),_.hdlr(C.type),_.minf(C))},_.mfhd=function(C){return _.box(_.types.mfhd,new Uint8Array([0,0,0,0,C>>24,C>>16&255,C>>8&255,C&255]))},_.minf=function(C){return C.type==="audio"?_.box(_.types.minf,_.box(_.types.smhd,_.SMHD),_.DINF,_.stbl(C)):_.box(_.types.minf,_.box(_.types.vmhd,_.VMHD),_.DINF,_.stbl(C))},_.moof=function(C,c,p){return _.box(_.types.moof,_.mfhd(C),_.traf(p,c))},_.moov=function(C){for(var c=C.length,p=[];c--;)p[c]=_.trak(C[c]);return _.box.apply(null,[_.types.moov,_.mvhd(C[0].timescale,C[0].duration)].concat(p).concat(_.mvex(C)))},_.mvex=function(C){for(var c=C.length,p=[];c--;)p[c]=_.trex(C[c]);return _.box.apply(null,[_.types.mvex].concat(p))},_.mvhd=function(C,c){c*=C;var p=Math.floor(c/(w+1)),u=Math.floor(c%(w+1)),o=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,C>>24&255,C>>16&255,C>>8&255,C&255,p>>24,p>>16&255,p>>8&255,p&255,u>>24,u>>16&255,u>>8&255,u&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 _.box(_.types.mvhd,o)},_.sdtp=function(C){var c=C.samples||[],p=new Uint8Array(4+c.length),u,o;for(u=0;u>>8&255),c.push(a&255),c=c.concat(Array.prototype.slice.call(o));for(u=0;u>>8&255),p.push(a&255),p=p.concat(Array.prototype.slice.call(o));var d=_.box(_.types.avcC,new Uint8Array([1,c[3],c[4],c[5],252|3,224|C.sps.length].concat(c).concat([C.pps.length]).concat(p))),s=C.width,f=C.height,i=C.pixelRatio[0],n=C.pixelRatio[1];return _.box(_.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,f>>8&255,f&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]),d,_.box(_.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),_.box(_.types.pasp,new Uint8Array([i>>24,i>>16&255,i>>8&255,i&255,n>>24,n>>16&255,n>>8&255,n&255])))},_.esds=function(C){var c=C.config.length;return new Uint8Array([0,0,0,0,3,23+c,0,1,0,4,15+c,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([c]).concat(C.config).concat([6,1,2]))},_.mp4a=function(C){var c=C.samplerate;return _.box(_.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,C.channelCount,0,16,0,0,0,0,c>>8&255,c&255,0,0]),_.box(_.types.esds,_.esds(C)))},_.mp3=function(C){var c=C.samplerate;return _.box(_.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,C.channelCount,0,16,0,0,0,0,c>>8&255,c&255,0,0]))},_.stsd=function(C){return C.type==="audio"?!C.isAAC&&C.codec==="mp3"?_.box(_.types.stsd,_.STSD,_.mp3(C)):_.box(_.types.stsd,_.STSD,_.mp4a(C)):_.box(_.types.stsd,_.STSD,_.avc1(C))},_.tkhd=function(C){var c=C.id,p=C.duration*C.timescale,u=C.width,o=C.height,a=Math.floor(p/(w+1)),d=Math.floor(p%(w+1));return _.box(_.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,c>>24&255,c>>16&255,c>>8&255,c&255,0,0,0,0,a>>24,a>>16&255,a>>8&255,a&255,d>>24,d>>16&255,d>>8&255,d&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,u>>8&255,u&255,0,0,o>>8&255,o&255,0,0]))},_.traf=function(C,c){var p=_.sdtp(C),u=C.id,o=Math.floor(c/(w+1)),a=Math.floor(c%(w+1));return _.box(_.types.traf,_.box(_.types.tfhd,new Uint8Array([0,0,0,0,u>>24,u>>16&255,u>>8&255,u&255])),_.box(_.types.tfdt,new Uint8Array([1,0,0,0,o>>24,o>>16&255,o>>8&255,o&255,a>>24,a>>16&255,a>>8&255,a&255])),_.trun(C,p.length+16+20+8+16+8+8),p)},_.trak=function(C){return C.duration=C.duration||4294967295,_.box(_.types.trak,_.tkhd(C),_.mdia(C))},_.trex=function(C){var c=C.id;return _.box(_.types.trex,new Uint8Array([0,0,0,0,c>>24,c>>16&255,c>>8&255,c&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},_.trun=function(C,c){var p=C.samples||[],u=p.length,o=12+16*u,a=new Uint8Array(o),d,s,f,i,n,t;for(c+=8+o,a.set([0,0,15,1,u>>>24&255,u>>>16&255,u>>>8&255,u&255,c>>>24&255,c>>>16&255,c>>>8&255,c&255],0),d=0;d>>24&255,f>>>16&255,f>>>8&255,f&255,i>>>24&255,i>>>16&255,i>>>8&255,i&255,n.isLeading<<2|n.dependsOn,n.isDependedOn<<6|n.hasRedundancy<<4|n.paddingValue<<1|n.isNonSync,n.degradPrio&240<<8,n.degradPrio&15,t>>>24&255,t>>>16&255,t>>>8&255,t&255],12+16*d);return _.box(_.types.trun,a)},_.initSegment=function(C){_.types||_.init();var c=_.moov(C),p=new Uint8Array(_.FTYP.byteLength+c.byteLength);return p.set(_.FTYP),p.set(c,_.FTYP.byteLength),p},_}();P.types=void 0,P.HDLR_TYPES=void 0,P.STTS=void 0,P.STSC=void 0,P.STCO=void 0,P.STSZ=void 0,P.VMHD=void 0,P.SMHD=void 0,P.STSD=void 0,P.FTYP=void 0,P.DINF=void 0,Q.default=P},"./src/remux/mp4-remuxer.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"default",function(){return t}),j.d(Q,"normalizePts",function(){return h});var w=j("./src/polyfills/number.ts"),P=j("./src/remux/aac-helper.ts"),_=j("./src/remux/mp4-generator.ts"),T=j("./src/events.ts"),C=j("./src/errors.ts"),c=j("./src/utils/logger.ts"),p=j("./src/types/loader.ts"),u=j("./src/utils/timescale-conversion.ts");function o(){return o=Object.assign||function(E){for(var m=1;m0?O:A.pts},x[0].pts);return l&&c.logger.debug("PTS rollover detected"),S},m.remux=function(x,l,S,O,A,D,I,B){var H,te,W,V,X,ne,$=A,ee=A,ce=x.pid>-1,de=l.pid>-1,Ce=l.samples.length,Se=x.samples.length>0,De=Ce>1,be=(!ce||Se)&&(!de||De)||this.ISGenerated||I;if(be){this.ISGenerated||(W=this.generateIS(x,l,A));var _e=this.isVideoContiguous,Ke=-1;if(De&&(Ke=v(l.samples),!_e&&this.config.forceKeyFrameOnDiscontinuity))if(ne=!0,Ke>0){c.logger.warn("[mp4-remuxer]: Dropped "+Ke+" out of "+Ce+" video samples due to a missing keyframe");var Ne=this.getVideoStartPts(l.samples);l.samples=l.samples.slice(Ke),l.dropped+=Ke,ee+=(l.samples[0].pts-Ne)/(l.timescale||9e4)}else Ke===-1&&(c.logger.warn("[mp4-remuxer]: No keyframe found out of "+Ce+" video samples"),ne=!1);if(this.ISGenerated){if(Se&&De){var Be=this.getVideoStartPts(l.samples),ze=h(x.samples[0].pts,Be)-Be,ye=ze/l.inputTimeScale;$+=Math.max(0,ye),ee+=Math.max(0,-ye)}if(Se){if(x.samplerate||(c.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),W=this.generateIS(x,l,A)),te=this.remuxAudio(x,$,this.isAudioContiguous,D,de||De||B===p.PlaylistLevelType.AUDIO?ee:void 0),De){var pe=te?te.endPTS-te.startPTS:0;l.inputTimeScale||(c.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),W=this.generateIS(x,l,A)),H=this.remuxVideo(l,ee,_e,pe)}}else De&&(H=this.remuxVideo(l,ee,_e,0));H&&(H.firstKeyFrame=Ke,H.independent=Ke!==-1)}}return this.ISGenerated&&(S.samples.length&&(X=this.remuxID3(S,A)),O.samples.length&&(V=this.remuxText(O,A))),{audio:te,video:H,initSegment:W,independent:ne,text:V,id3:X}},m.generateIS=function(x,l,S){var O=x.samples,A=l.samples,D=this.typeSupported,I={},B=!Object(w.isFiniteNumber)(this._initPTS),H="audio/mp4",te,W,V;if(B&&(te=W=Infinity),x.config&&O.length&&(x.timescale=x.samplerate,x.isAAC||(D.mpeg?(H="audio/mpeg",x.codec=""):D.mp3&&(x.codec="mp3")),I.audio={id:"audio",container:H,codec:x.codec,initSegment:!x.isAAC&&D.mpeg?new Uint8Array(0):_.default.initSegment([x]),metadata:{channelCount:x.channelCount}},B&&(V=x.inputTimeScale,te=W=O[0].pts-Math.round(V*S))),l.sps&&l.pps&&A.length&&(l.timescale=l.inputTimeScale,I.video={id:"main",container:"video/mp4",codec:l.codec,initSegment:_.default.initSegment([l]),metadata:{width:l.width,height:l.height}},B)){V=l.inputTimeScale;var X=this.getVideoStartPts(A),ne=Math.round(V*S);W=Math.min(W,h(A[0].dts,X)-ne),te=Math.min(te,X-ne)}if(Object.keys(I).length)return this.ISGenerated=!0,B&&(this._initPTS=te,this._initDTS=W),{tracks:I,initPTS:te,timescale:V}},m.remuxVideo=function(x,l,S,O){var A=x.inputTimeScale,D=x.samples,I=[],B=D.length,H=this._initPTS,te=this.nextAvcDts,W=8,V,X,ne,$=Number.POSITIVE_INFINITY,ee=Number.NEGATIVE_INFINITY,ce=0,de=!1;if(!S||te===null){var Ce=l*A,Se=D[0].pts-h(D[0].dts,D[0].pts);te=Ce-Se}for(var De=0;Debe.pts){var _e=9e4*.2;ce=Math.max(Math.min(ce,be.pts-be.dts),-1*_e)}be.dts0?De-1:De].dts&&(de=!0)}de&&D.sort(function(Lt,at){var pt=Lt.dts-at.dts,st=Lt.pts-at.pts;return pt||st}),X=D[0].dts,ne=D[D.length-1].dts;var Ke=Math.round((ne-X)/(B-1));if(ce<0){if(ceKe,We=ye<-1;if(pe||We){pe?c.logger.warn("AVC: "+Object(u.toMsFromMpegTsClock)(ye,!0)+" ms ("+ye+"dts) hole between fragments detected, filling it"):c.logger.warn("AVC: "+Object(u.toMsFromMpegTsClock)(-ye,!0)+" ms ("+ye+"dts) overlapping between fragments detected"),X=te;var He=D[0].pts-ye;D[0].dts=X,D[0].pts=He,c.logger.log("Video: First PTS/DTS adjusted: "+Object(u.toMsFromMpegTsClock)(He,!0)+"/"+Object(u.toMsFromMpegTsClock)(X,!0)+", delta: "+Object(u.toMsFromMpegTsClock)(ye,!0)+" ms")}}n&&(X=Math.max(0,X));for(var nt=0,re=0,k=0;k0?je-1:je].dts;if(Ae.stretchShortVideoTrack&&this.nextAudioPts!==null){var Te=Math.floor(Ae.maxBufferHole*A),Ze=(O?$+O*A:this.nextAudioPts)-tt.pts;Ze>Te?(V=Ze-Le,V<0&&(V=Le),c.logger.log("[mp4-remuxer]: It is approximately "+Ze/90+" ms to the next segment; using duration "+V/90+" ms for the last video frame.")):V=Le}else V=Le}var ut=Math.round(tt.pts-tt.dts);I.push(new g(tt.key,V,Qe,ut))}if(I.length&&f&&f<70){var Tt=I[0].flags;Tt.dependsOn=2,Tt.isNonSync=0}console.assert(V!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=te=ne+V,this.isVideoContiguous=!0;var Ht=_.default.moof(x.sequenceNumber++,X,o({},x,{samples:I})),Qt="video",bt={data1:Ht,data2:dt,startPTS:$/A,endPTS:(ee+V)/A,startDTS:X/A,endDTS:te/A,type:Qt,hasAudio:!1,hasVideo:!0,nb:I.length,dropped:x.dropped};return x.samples=[],x.dropped=0,console.assert(dt.length,"MDAT length must not be zero"),bt},m.remuxAudio=function(x,l,S,O,A){var D=x.inputTimeScale,I=x.samplerate?x.samplerate:D,B=D/I,H=x.isAAC?d:s,te=H*B,W=this._initPTS,V=!x.isAAC&&this.typeSupported.mpeg,X=[],ne=x.samples,$=V?0:8,ee=this.nextAudioPts||-1,ce=l*D;if(this.isAudioContiguous=S=S||ne.length&&ee>0&&(O&&Math.abs(ce-ee)<9e3||Math.abs(h(ne[0].pts-W,ce)-ee)<20*te),ne.forEach(function(Me){Me.pts=h(Me.pts-W,ce)}),!S||ee<0){if(ne=ne.filter(function(Me){return Me.pts>=0}),!ne.length)return;A===0?ee=0:O?ee=Math.max(0,ce):ee=ne[0].pts}if(x.isAAC)for(var de=A!==void 0,Ce=this.config.maxAudioFramesDrift,Se=0,De=ee;Se=Ce*te&&Ne0){re+=$;try{nt=new Uint8Array(re)}catch(Me){this.observer.emit(T.Events.ERROR,T.Events.ERROR,{type:C.ErrorTypes.MUX_ERROR,details:C.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:re,reason:"fail allocating audio mdat "+re});return}if(!V){var dt=new DataView(nt.buffer);dt.setUint32(0,re),nt.set(_.default.types.mdat,4)}}else return;nt.set(J,$);var Ue=J.byteLength;$+=Ue,X.push(new g(!0,H,Ue,0)),He=xe}var je=X.length;if(!je)return;var tt=X[X.length-1];this.nextAudioPts=ee=He+B*tt.duration;var mt=V?new Uint8Array(0):_.default.moof(x.sequenceNumber++,We/B,o({},x,{samples:X}));x.samples=[];var Qe=We/D,Xe=ee/D,Fe="audio",Ie={data1:mt,data2:nt,startPTS:Qe,endPTS:Xe,startDTS:Qe,endDTS:Xe,type:Fe,hasAudio:!0,hasVideo:!1,nb:je};return this.isAudioContiguous=!0,console.assert(nt.length,"MDAT length must not be zero"),Ie},m.remuxEmptyAudio=function(x,l,S,O){var A=x.inputTimeScale,D=x.samplerate?x.samplerate:A,I=A/D,B=this.nextAudioPts,H=(B!==null?B:O.startDTS*A)+this._initDTS,te=O.endDTS*A+this._initDTS,W=I*d,V=Math.ceil((te-H)/W),X=P.default.getSilentFrame(x.manifestCodec||x.codec,x.channelCount);if(c.logger.warn("[mp4-remuxer]: remux empty Audio"),!X){c.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var ne=[],$=0;$4294967296;)E+=y;return E}function v(E){for(var m=0;m0?this.lastEndDTS=x:(T.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var l=!!E.audio,S=!!E.video,O="";l&&(O+="audio"),S&&(O+="video");var A={data1:g,startPTS:y,startDTS:y,endPTS:x,endDTS:x,type:O,hasAudio:l,hasVideo:S,nb:1,dropped:0};return v.audio=A.type==="audio"?A:void 0,v.video=A.type!=="audio"?A:void 0,v.text=i,v.id3=f,v.initSegment=b,v},u}(),c=function(o,a,d){return Object(P.getStartDTS)(o,a)-d};function p(u,o){var a=u==null?void 0:u.codec;return a&&a.length>4?a:a==="hvc1"?"hvc1.1.c.L120.90":a==="av01"?"av01.0.04M.08":a==="avc1"||o===_.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}Q.default=C},"./src/task-loop.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"default",function(){return w});var w=function(){function P(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var _=P.prototype;return _.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},_.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},_.onHandlerDestroyed=function(){},_.hasInterval=function(){return!!this._tickInterval},_.hasNextTick=function(){return!!this._tickTimer},_.setInterval=function(C){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,C),!0)},_.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},_.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},_.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},_.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},_.doTick=function(){},P}()},"./src/types/cmcd.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"CMCDVersion",function(){return w}),j.d(Q,"CMCDObjectType",function(){return P}),j.d(Q,"CMCDStreamingFormat",function(){return _}),j.d(Q,"CMCDStreamType",function(){return T});var w=1,P;(function(C){C.MANIFEST="m",C.AUDIO="a",C.VIDEO="v",C.MUXED="av",C.INIT="i",C.CAPTION="c",C.TIMED_TEXT="tt",C.KEY="k",C.OTHER="o"})(P||(P={}));var _;(function(C){C.DASH="d",C.HLS="h",C.SMOOTH="s",C.OTHER="o"})(_||(_={}));var T;(function(C){C.VOD="v",C.LIVE="l"})(T||(T={}))},"./src/types/level.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"HlsSkip",function(){return _}),j.d(Q,"getSkipValue",function(){return T}),j.d(Q,"HlsUrlParameters",function(){return C}),j.d(Q,"Level",function(){return c});function w(p,u){for(var o=0;oNumber.MAX_SAFE_INTEGER?Infinity:u},C.hexadecimalInteger=function(p){if(this[p]){var u=(this[p]||"0x").slice(2);u=(u.length&1?"0":"")+u;for(var o=new Uint8Array(u.length/2),a=0;aNumber.MAX_SAFE_INTEGER?Infinity:u},C.decimalFloatingPoint=function(p){return parseFloat(this[p])},C.optionalFloat=function(p,u){var o=this[p];return o?parseFloat(o):u},C.enumeratedString=function(p){return this[p]},C.bool=function(p){return this[p]==="YES"},C.decimalResolution=function(p){var u=w.exec(this[p]);return u===null?void 0:{width:parseInt(u[1],10),height:parseInt(u[2],10)}},T.parseAttrList=function(p){var u,o={},a='"';for(P.lastIndex=0;(u=P.exec(p))!==null;){var d=u[2];d.indexOf(a)===0&&d.lastIndexOf(a)===d.length-1&&(d=d.slice(1,-1)),o[u[1]]=d}return o},T}()},"./src/utils/binary-search.ts":function(le,Q,j){"use strict";j.r(Q);var w={search:function(_,T){for(var C=0,c=_.length-1,p=null,u=null;C<=c;){p=(C+c)/2|0,u=_[p];var o=T(u);if(o>0)C=p+1;else if(o<0)c=p-1;else return u}return null}};Q.default=w},"./src/utils/buffer-helper.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"BufferHelper",function(){return _});var w=j("./src/utils/logger.ts"),P={length:0,start:function(){return 0},end:function(){return 0}},_=function(){function T(){}return T.isBuffered=function(c,p){try{if(c){for(var u=T.getBuffered(c),o=0;o=u.start(o)&&p<=u.end(o))return!0}}catch(a){}return!1},T.bufferInfo=function(c,p,u){try{if(c){var o=T.getBuffered(c),a=[],d;for(d=0;ds&&(o[d-1].end=c[a].end):o.push(c[a])}else o.push(c[a])}else o=c;for(var f=0,i,n=p,t=p,h=0;h=v&&p=S&&w.logger.log(this.time+" ["+S+"] "+O)},y}(),f=function(x){for(var l=[],S=0;SC&&(this.logger.log(d.DEBUG,"Too large cursor position "+this.pos),this.pos=C)},x.moveCursor=function(S){var O=this.pos+S;if(S>1)for(var A=this.pos+1;A=144&&this.backSpace();var O=_(S);if(this.pos>=C){this.logger.log(d.ERROR,"Cannot insert "+S.toString(16)+" ("+O+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(O,this.currPenState),this.moveCursor(1)},x.clearFromPos=function(S){var O;for(O=S;O0&&(S?A="["+O.join(" | ")+"]":A=O.join(` `)),A},x.getTextAndFormat=function(){return this.rows},y}(),v=function(){function y(l,S,O){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=l,this.outputFilter=S,this.mode=null,this.verbose=0,this.displayedMemory=new h(O),this.nonDisplayedMemory=new h(O),this.lastOutputScreen=new h(O),this.currRollUpRow=this.displayedMemory.rows[T-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=O}var x=y.prototype;return x.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[T-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},x.getHandler=function(){return this.outputFilter},x.setHandler=function(S){this.outputFilter=S},x.setPAC=function(S){this.writeScreen.setPAC(S)},x.setBkgData=function(S){this.writeScreen.setBkgData(S)},x.setMode=function(S){if(S===this.mode)return;this.mode=S,this.logger.log(d.INFO,"MODE="+S),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=S},x.insertChars=function(S){for(var O=0;O=46,O.italics)O.foreground="white";else{var A=Math.floor(S/2)-16,D=["white","green","blue","cyan","red","yellow","magenta"];O.foreground=D[A]}this.logger.log(d.INFO,"MIDROW: "+JSON.stringify(O)),this.writeScreen.setPen(O)},x.outputDataUpdate=function(S){S===void 0&&(S=!1);var O=this.logger.time;if(O===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=O:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,O,this.lastOutputScreen),S&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:O),this.lastOutputScreen.copy(this.displayedMemory))},x.cueSplitAtTime=function(S){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,S,this.displayedMemory),this.cueStartTime=S))},y}(),g=function(){function y(l,S,O){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var A=new s;this.channels=[null,new v(l,S,A),new v(l+1,O,A)],this.cmdHistory=m(),this.logger=A}var x=y.prototype;return x.getHandler=function(S){return this.channels[S].getHandler()},x.setHandler=function(S,O){this.channels[S].setHandler(O)},x.addData=function(S,O){var A,D,I,B=!1;this.logger.time=S;for(var H=0;H ("+f([D,I])+")"),A=this.parseCmd(D,I),A||(A=this.parseMidrow(D,I)),A||(A=this.parsePAC(D,I)),A||(A=this.parseBackgroundAttributes(D,I)),!A&&(B=this.parseChars(D,I),B)){var te=this.currentChannel;if(te&&te>0){var W=this.channels[te];W.insertChars(B)}else this.logger.log(d.WARNING,"No channel found yet. TEXT-MODE?")}!A&&!B&&this.logger.log(d.WARNING,"Couldn't parse cleaned data "+f([D,I])+" orig: "+f([O[H],O[H+1]]))}},x.parseCmd=function(S,O){var A=this.cmdHistory,D=(S===20||S===28||S===21||S===29)&&O>=32&&O<=47,I=(S===23||S===31)&&O>=33&&O<=35;if(!(D||I))return!1;if(E(S,O,A))return b(null,null,A),this.logger.log(d.DEBUG,"Repeated command ("+f([S,O])+") is dropped"),!0;var B=S===20||S===21||S===23?1:2,H=this.channels[B];return S===20||S===21||S===28||S===29?O===32?H.ccRCL():O===33?H.ccBS():O===34?H.ccAOF():O===35?H.ccAON():O===36?H.ccDER():O===37?H.ccRU(2):O===38?H.ccRU(3):O===39?H.ccRU(4):O===40?H.ccFON():O===41?H.ccRDC():O===42?H.ccTR():O===43?H.ccRTD():O===44?H.ccEDM():O===45?H.ccCR():O===46?H.ccENM():O===47&&H.ccEOC():H.ccTO(O-32),b(S,O,A),this.currentChannel=B,!0},x.parseMidrow=function(S,O){var A=0;if((S===17||S===25)&&O>=32&&O<=47){if(S===17?A=1:A=2,A!==this.currentChannel)return this.logger.log(d.ERROR,"Mismatch channel in midrow parsing"),!1;var D=this.channels[A];return D?(D.ccMIDROW(O),this.logger.log(d.DEBUG,"MIDROW ("+f([S,O])+")"),!0):!1}return!1},x.parsePAC=function(S,O){var A,D=this.cmdHistory,I=(S>=17&&S<=23||S>=25&&S<=31)&&O>=64&&O<=127,B=(S===16||S===24)&&O>=64&&O<=95;if(!(I||B))return!1;if(E(S,O,D))return b(null,null,D),!0;var H=S<=23?1:2;O>=64&&O<=95?A=H===1?c[S]:u[S]:A=H===1?p[S]:o[S];var te=this.channels[H];return te?(te.setPAC(this.interpretPAC(A,O)),b(S,O,D),this.currentChannel=H,!0):!1},x.interpretPAC=function(S,O){var A,D={color:null,italics:!1,indent:null,underline:!1,row:S};return O>95?A=O-96:A=O-64,D.underline=(A&1)===1,A<=13?D.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(A/2)]:A<=15?(D.italics=!0,D.color="white"):D.indent=Math.floor((A-16)/2)*4,D},x.parseChars=function(S,O){var A,D=null,I=null;if(S>=25?(A=2,I=S-8):(A=1,I=S),I>=17&&I<=19){var B;I===17?B=O+80:I===18?B=O+112:B=O+144,this.logger.log(d.INFO,"Special char '"+_(B)+"' in channel "+A),D=[B]}else S>=32&&S<=127&&(D=O===0?[S]:[S,O]);if(D){var H=f(D);this.logger.log(d.DEBUG,"Char codes = "+H.join(",")),b(S,O,this.cmdHistory)}return D},x.parseBackgroundAttributes=function(S,O){var A=(S===16||S===24)&&O>=32&&O<=47,D=(S===23||S===31)&&O>=45&&O<=47;if(!(A||D))return!1;var I,B={};S===16||S===24?(I=Math.floor((O-32)/2),B.background=a[I],O%2===1&&(B.background=B.background+"_semi")):O===45?B.background="transparent":(B.foreground="black",O===47&&(B.underline=!0));var H=S<=23?1:2,te=this.channels[H];return te.setBkgData(B),b(S,O,this.cmdHistory),!0},x.reset=function(){for(var S=0;S=16?n--:n++;var b=Object(w.fixLineBreaks)(t.trim()),E=Object(P.generateCueId)(u,o,b);(!p||!p.cues||!p.cues.getCueById(E))&&(f=new h(u,o,b),f.id=E,f.line=v+1,f.align="left",f.position=10+Math.min(80,Math.floor(n*8/32)*10),d.push(f))}return p&&d.length&&(d.sort(function(m,y){return m.line==="auto"||y.line==="auto"?0:m.line>8&&y.line>8?y.line-m.line:m.line-y.line}),d.forEach(function(m){return Object(_.addCueToTrack)(p,m)})),d}};Q.default=C},"./src/utils/discontinuities.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"findFirstFragWithCC",function(){return T}),j.d(Q,"shouldAlignOnDiscontinuities",function(){return C}),j.d(Q,"findDiscontinuousReferenceFrag",function(){return c}),j.d(Q,"adjustSlidingStart",function(){return u}),j.d(Q,"alignStream",function(){return o}),j.d(Q,"alignPDT",function(){return d}),j.d(Q,"alignFragmentByPDTDelta",function(){return s}),j.d(Q,"alignMediaPlaylistByPDT",function(){return f});var w=j("./src/polyfills/number.ts"),P=j("./src/utils/logger.ts"),_=j("./src/controller/level-helper.ts");function T(i,n){for(var t=null,h=0,v=i.length;ht.startCC||i&&i.cc=this.minWeight_},T.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},T.destroy=function(){},_}();Q.default=P},"./src/utils/ewma.ts":function(le,Q,j){"use strict";j.r(Q);var w=function(){function P(T,C,c){C===void 0&&(C=0),c===void 0&&(c=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=T,this.alpha_=T?Math.exp(Math.log(.5)/T):0,this.estimate_=C,this.totalWeight_=c}var _=P.prototype;return _.sample=function(C,c){var p=Math.pow(this.alpha_,C);this.estimate_=c*(1-p)+p*this.estimate_,this.totalWeight_+=C},_.getTotalWeight=function(){return this.totalWeight_},_.getEstimate=function(){if(this.alpha_){var C=1-Math.pow(this.alpha_,this.totalWeight_);if(C)return this.estimate_/C}return this.estimate_},P}();Q.default=w},"./src/utils/fetch-loader.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"fetchSupported",function(){return s});var w=j("./src/polyfills/number.ts"),P=j("./src/loader/load-stats.ts"),_=j("./src/demux/chunk-cache.ts");function T(h,v){h.prototype=Object.create(v.prototype),h.prototype.constructor=h,o(h,v)}function C(h){var v=typeof Map=="function"?new Map:void 0;return C=function(b){if(b===null||!u(b))return b;if(typeof b!="function")throw new TypeError("Super expression must either be null or a function");if(typeof v!="undefined"){if(v.has(b))return v.get(b);v.set(b,E)}function E(){return c(b,arguments,a(this).constructor)}return E.prototype=Object.create(b.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),o(E,b)},C(h)}function c(h,v,g){return p()?c=Reflect.construct:c=function(E,m,y){var x=[null];x.push.apply(x,m);var l=Function.bind.apply(E,x),S=new l;return y&&o(S,y.prototype),S},c.apply(null,arguments)}function p(){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(h){return!1}}function u(h){return Function.toString.call(h).indexOf("[native code]")!==-1}function o(h,v){return o=Object.setPrototypeOf||function(b,E){return b.__proto__=E,b},o(h,v)}function a(h){return a=Object.setPrototypeOf?Object.getPrototypeOf:function(g){return g.__proto__||Object.getPrototypeOf(g)},a(h)}function d(){return d=Object.assign||function(h){for(var v=1;v=y&&x(E,m,l.flush(),b)):x(E,m,I,b),A()}).catch(function(){return Promise.reject()})};return O()},h}();function i(h,v){var g={method:"GET",mode:"cors",credentials:"same-origin",signal:v,headers:new self.Headers(d({},h.headers))};return h.rangeEnd&&g.headers.set("Range","bytes="+h.rangeStart+"-"+String(h.rangeEnd-1)),g}function n(h,v){return new self.Request(h.url,v)}var t=function(h){T(v,h);function v(g,b,E){var m;return m=h.call(this,g)||this,m.code=void 0,m.details=void 0,m.code=b,m.details=E,m}return v}(C(Error));Q.default=f},"./src/utils/imsc1-ttml-parser.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"IMSC1_CODEC",function(){return u}),j.d(Q,"parseIMSC1",function(){return s});var w=j("./src/utils/mp4-tools.ts"),P=j("./src/utils/vttparser.ts"),_=j("./src/utils/vttcue.ts"),T=j("./src/demux/id3.ts"),C=j("./src/utils/timescale-conversion.ts"),c=j("./src/utils/webvtt-parser.ts");function p(){return p=Object.assign||function(y){for(var x=1;x"):w}function C(u){for(var o=arguments.length,a=new Array(o>1?o-1:0),d=1;d>24,v[g+1]=b>>16&255,v[g+2]=b>>8&255,v[g+3]=b&255}function o(v,g){var b=[];if(!g.length)return b;var E,m,y;"data"in v?(E=v.data,m=v.start,y=v.end):(E=v,m=0,y=E.byteLength);for(var x=m;x1?x+l:y;if(S===g[0])if(g.length===1)b.push({data:E,start:x+8,end:O});else{var A=o({data:E,start:x+8,end:O},g.slice(1));A.length&&T.apply(b,A)}x=O}return b}function a(v){var g=o(v,["moov"]),b=g[0],E=b?b.end:null,m=o(v,["sidx"]);if(!m||!m[0])return null;var y=[],x=m[0],l=x.data[0],S=l===0?8:16,O=p(x,S);S+=4;var A=0,D=0;l===0?S+=8:S+=16,S+=2;var I=x.end+D,B=c(x,S);S+=2;for(var H=0;H>>31;if(X===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var ne=p(x,te);te+=4,y.push({referenceSize:V,subsegmentDuration:ne,info:{duration:ne/O,start:I,end:I+V-1}}),I+=V,te+=4,S=te}return{earliestPresentationTime:A,timescale:O,version:l,referencesCount:B,references:y,moovEndOffset:E}}function d(v){for(var g=[],b=o(v,["moov","trak"]),E=0;EC)&&(this.startTime=C),this.endTime=c,this.screen=p,this.timelineController.createCaptionsTrack(this.trackName)},_.reset=function(){this.cueRanges=[]},P}()},"./src/utils/texttrack-utils.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"sendAddTrackEvent",function(){return P}),j.d(Q,"addCueToTrack",function(){return _}),j.d(Q,"clearCurrentCues",function(){return T}),j.d(Q,"removeCuesInRange",function(){return C}),j.d(Q,"getCuesInRange",function(){return p});var w=j("./src/utils/logger.ts");function P(u,o){var a;try{a=new Event("addtrack")}catch(d){a=document.createEvent("Event"),a.initEvent("addtrack",!1,!1)}a.track=u,o.dispatchEvent(a)}function _(u,o){var a=u.mode;if(a==="disabled"&&(u.mode="hidden"),u.cues&&!u.cues.getCueById(o.id))try{if(u.addCue(o),!u.cues.getCueById(o.id))throw new Error("addCue is failed for: "+o)}catch(s){w.logger.debug("[texttrack-utils]: "+s);var d=new self.TextTrackCue(o.startTime,o.endTime,o.text);d.id=o.id,u.addCue(d)}a==="disabled"&&(u.mode=a)}function T(u){var o=u.mode;if(o==="disabled"&&(u.mode="hidden"),u.cues)for(var a=u.cues.length;a--;)u.removeCue(u.cues[a]);o==="disabled"&&(u.mode=o)}function C(u,o,a){var d=u.mode;if(d==="disabled"&&(u.mode="hidden"),u.cues&&u.cues.length>0)for(var s=p(u.cues,o,a),f=0;fu[a].endTime)return-1;for(var d=0,s=a;d<=s;){var f=Math.floor((s+d)/2);if(ou[f].startTime&&d-1)for(var f=s,i=u.length;f=o&&n.endTime<=a)d.push(n);else if(n.startTime>a)return d}return d}},"./src/utils/time-ranges.ts":function(le,Q,j){"use strict";j.r(Q);var w={toString:function(_){for(var T="",C=_.length,c=0;c1?o-1:0),d=1;d100)throw new Error("Position must be between 0 and 100.");y=A,this.hasBeenReset=!0}})),Object.defineProperty(d,"positionAlign",c({},s,{get:function(){return x},set:function(A){var D=C(A);if(!D)throw new SyntaxError("An invalid or illegal string was specified.");x=D,this.hasBeenReset=!0}})),Object.defineProperty(d,"size",c({},s,{get:function(){return l},set:function(A){if(A<0||A>100)throw new Error("Size must be between 0 and 100.");l=A,this.hasBeenReset=!0}})),Object.defineProperty(d,"align",c({},s,{get:function(){return S},set:function(A){var D=C(A);if(!D)throw new SyntaxError("An invalid or illegal string was specified.");S=D,this.hasBeenReset=!0}})),d.displayState=void 0}return p.prototype.getCueAsHTML=function(){var u=self.WebVTT;return u.convertCueToDOMTree(self,this.text)},p}()},"./src/utils/vttparser.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"parseTimeStamp",function(){return _}),j.d(Q,"fixLineBreaks",function(){return o}),j.d(Q,"VTTParser",function(){return a});var w=j("./src/utils/vttcue.ts"),P=function(){function d(){}var s=d.prototype;return s.decode=function(i,n){if(!i)return"";if(typeof i!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(i))},d}();function _(d){function s(i,n,t,h){return(i|0)*3600+(n|0)*60+(t|0)+parseFloat(h||0)}var f=d.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return f?parseFloat(f[2])>59?s(f[2],f[3],0,f[4]):s(f[1],f[2],f[3],f[4]):null}var T=function(){function d(){this.values=Object.create(null)}var s=d.prototype;return s.set=function(i,n){!this.get(i)&&n!==""&&(this.values[i]=n)},s.get=function(i,n,t){return t?this.has(i)?this.values[i]:n[t]:this.has(i)?this.values[i]:n},s.has=function(i){return i in this.values},s.alt=function(i,n,t){for(var h=0;h=0&&t<=100)return this.set(i,t),!0}return!1},d}();function C(d,s,f,i){var n=i?d.split(i):[d];for(var t in n){if(typeof n[t]!="string")continue;var h=n[t].split(f);if(h.length!==2)continue;var v=h[0],g=h[1];s(v,g)}}var c=new w.default(0,0,""),p=c.align==="middle"?"middle":"center";function u(d,s,f){var i=d;function n(){var v=_(d);if(v===null)throw new Error("Malformed timestamp: "+i);return d=d.replace(/^[^\sa-zA-Z-]+/,""),v}function t(v,g){var b=new T;C(v,function(y,x){var l;switch(y){case"region":for(var S=f.length-1;S>=0;S--)if(f[S].id===x){b.set(y,f[S].region);break}break;case"vertical":b.alt(y,x,["rl","lr"]);break;case"line":l=x.split(","),b.integer(y,l[0]),b.percent(y,l[0])&&b.set("snapToLines",!1),b.alt(y,l[0],["auto"]),l.length===2&&b.alt("lineAlign",l[1],["start",p,"end"]);break;case"position":l=x.split(","),b.percent(y,l[0]),l.length===2&&b.alt("positionAlign",l[1],["start",p,"end","line-left","line-right","auto"]);break;case"size":b.percent(y,x);break;case"align":b.alt(y,x,["start",p,"end","left","right"]);break}},/:/,/\s/),g.region=b.get("region",null),g.vertical=b.get("vertical","");var E=b.get("line","auto");E==="auto"&&c.line===-1&&(E=-1),g.line=E,g.lineAlign=b.get("lineAlign","start"),g.snapToLines=b.get("snapToLines",!0),g.size=b.get("size",100),g.align=b.get("align",p);var m=b.get("position","auto");m==="auto"&&c.position===50&&(m=g.align==="start"||g.align==="left"?0:g.align==="end"||g.align==="right"?100:50),g.position=m}function h(){d=d.replace(/^\s+/,"")}if(h(),s.startTime=n(),h(),d.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+i);d=d.substr(3),h(),s.endTime=n(),h(),t(d,s)}function o(d){return d.replace(//gi,` `)}var a=function(){function d(){this.state="INITIAL",this.buffer="",this.decoder=new P,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var s=d.prototype;return s.parse=function(i){var n=this;i&&(n.buffer+=n.decoder.decode(i,{stream:!0}));function t(){var m=n.buffer,y=0;for(m=o(m);y")===-1){n.cue.id=v;continue}case"CUE":if(!n.cue){n.state="BADCUE";continue}try{u(v,n.cue,n.regionList)}catch(m){n.cue=null,n.state="BADCUE";continue}n.state="CUETEXT";continue;case"CUETEXT":{var E=v.indexOf("-->")!==-1;if(!v||E&&(b=!0)){n.oncue&&n.cue&&n.oncue(n.cue),n.cue=null,n.state="ID";continue}if(n.cue===null)continue;n.cue.text&&(n.cue.text+=` `),n.cue.text+=v}continue;case"BADCUE":v||(n.state="ID")}}}catch(m){n.state==="CUETEXT"&&n.cue&&n.oncue&&n.oncue(n.cue),n.cue=null,n.state=n.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},s.flush=function(){var i=this;try{if((i.cue||i.state==="HEADER")&&(i.buffer+=` `,i.parse()),i.state==="INITIAL"||i.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(n){i.onparsingerror&&i.onparsingerror(n)}return i.onflush&&i.onflush(),this},d}()},"./src/utils/webvtt-parser.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"generateCueId",function(){return a}),j.d(Q,"parseWebVTT",function(){return s});var w=j("./src/polyfills/number.ts"),P=j("./src/utils/vttparser.ts"),_=j("./src/demux/id3.ts"),T=j("./src/utils/timescale-conversion.ts"),C=j("./src/remux/mp4-remuxer.ts"),c=/\r\n|\n\r|\n|\r/g,p=function(i,n,t){return t===void 0&&(t=0),i.substr(t,n.length)===n},u=function(i){var n=parseInt(i.substr(-3)),t=parseInt(i.substr(-6,2)),h=parseInt(i.substr(-9,2)),v=i.length>9?parseInt(i.substr(0,i.indexOf(":"))):0;if(!Object(w.isFiniteNumber)(n)||!Object(w.isFiniteNumber)(t)||!Object(w.isFiniteNumber)(h)||!Object(w.isFiniteNumber)(v))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+i);return n+=1e3*t,n+=60*1e3*h,n+=60*60*1e3*v,n},o=function(i){for(var n=5381,t=i.length;t;)n=n*33^i.charCodeAt(--t);return(n>>>0).toString()};function a(f,i,n){return o(f.toString())+o(i.toString())+o(n)}var d=function(i,n,t){var h=i[n],v=i[h.prevCC];if(!v||!v.new&&h.new){i.ccOffset=i.presentationOffset=h.start,h.new=!1;return}for(;(g=v)!==null&&g!==void 0&&g.new;){var g;i.ccOffset+=h.start-v.start,h.new=!1,h=v,v=i[h.prevCC]}i.presentationOffset=t};function s(f,i,n,t,h,v,g,b){var E=new P.VTTParser,m=Object(_.utf8ArrayToStr)(new Uint8Array(f)).trim().replace(c,` `).split(` `),y=[],x=Object(T.toMpegTsClockFromTimescale)(i,n),l="00:00.000",S=0,O=0,A,D=!0,I=!1;E.oncue=function(B){var H=t[h],te=t.ccOffset,W=(S-x)/9e4;if(H!=null&&H.new&&(O!==void 0?te=t.ccOffset=H.start:d(t,h,W)),W&&(te=W-t.presentationOffset),I){var V=B.endTime-B.startTime,X=Object(C.normalizePts)((B.startTime+te-O)*9e4,v*9e4)/9e4;B.startTime=X,B.endTime=X+V}var ne=B.text.trim();B.text=decodeURIComponent(encodeURIComponent(ne)),B.id||(B.id=a(B.startTime,B.endTime,ne)),B.endTime>0&&y.push(B)},E.onparsingerror=function(B){A=B},E.onflush=function(){if(A){b(A);return}g(y)},m.forEach(function(B){if(D)if(p(B,"X-TIMESTAMP-MAP=")){D=!1,I=!0,B.substr(16).split(",").forEach(function(H){p(H,"LOCAL:")?l=H.substr(6):p(H,"MPEGTS:")&&(S=parseInt(H.substr(7)))});try{O=u(l)/1e3}catch(H){I=!1,A=H}return}else B===""&&(D=!1);E.parse(B+` `)}),E.flush()}},"./src/utils/xhr-loader.ts":function(le,Q,j){"use strict";j.r(Q);var w=j("./src/utils/logger.ts"),P=j("./src/loader/load-stats.ts"),_=/^age:\s*[\d.]+\s*$/m,T=function(){function C(p){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=p?p.xhrSetup:null,this.stats=new P.LoadStats,this.retryDelay=0}var c=C.prototype;return c.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},c.abortInternal=function(){var u=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),u&&(u.onreadystatechange=null,u.onprogress=null,u.readyState!==4&&(this.stats.aborted=!0,u.abort()))},c.abort=function(){var u;this.abortInternal(),(u=this.callbacks)!==null&&u!==void 0&&u.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},c.load=function(u,o,a){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=u,this.config=o,this.callbacks=a,this.retryDelay=o.retryDelay,this.loadInternal()},c.loadInternal=function(){var u=this.config,o=this.context;if(!u)return;var a=this.loader=new self.XMLHttpRequest,d=this.stats;d.loading.first=0,d.loaded=0;var s=this.xhrSetup;try{if(s)try{s(a,o.url)}catch(n){a.open("GET",o.url,!0),s(a,o.url)}a.readyState||a.open("GET",o.url,!0);var f=this.context.headers;if(f)for(var i in f)a.setRequestHeader(i,f[i])}catch(n){this.callbacks.onError({code:a.status,text:n.message},o,a);return}o.rangeEnd&&a.setRequestHeader("Range","bytes="+o.rangeStart+"-"+(o.rangeEnd-1)),a.onreadystatechange=this.readystatechange.bind(this),a.onprogress=this.loadprogress.bind(this),a.responseType=o.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),u.timeout),a.send()},c.readystatechange=function(){var u=this.context,o=this.loader,a=this.stats;if(!u||!o)return;var d=o.readyState,s=this.config;if(a.aborted)return;if(d>=2)if(self.clearTimeout(this.requestTimeout),a.loading.first===0&&(a.loading.first=Math.max(self.performance.now(),a.loading.start)),d===4){o.onreadystatechange=null,o.onprogress=null;var f=o.status;if(f>=200&&f<300){a.loading.end=Math.max(self.performance.now(),a.loading.first);var i,n;if(u.responseType==="arraybuffer"?(i=o.response,n=i.byteLength):(i=o.responseText,n=i.length),a.loaded=a.total=n,!this.callbacks)return;var t=this.callbacks.onProgress;if(t&&t(a,u,i,o),!this.callbacks)return;var h={url:o.responseURL,data:i};this.callbacks.onSuccess(h,a,u,o)}else a.retry>=s.maxRetry||f>=400&&f<499?(w.logger.error(f+" while loading "+u.url),this.callbacks.onError({code:f,text:o.statusText},u,o)):(w.logger.warn(f+" while loading "+u.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),a.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),s.timeout)},c.loadtimeout=function(){w.logger.warn("timeout while loading "+this.context.url);var u=this.callbacks;u&&(this.abortInternal(),u.onTimeout(this.stats,this.context,this.loader))},c.loadprogress=function(u){var o=this.stats;o.loaded=u.loaded,u.lengthComputable&&(o.total=u.total)},c.getCacheAge=function(){var u=null;if(this.loader&&_.test(this.loader.getAllResponseHeaders())){var o=this.loader.getResponseHeader("age");u=o?parseFloat(o):null}return u},C}();Q.default=T}}).default})},vHTk:function(et,Ve,z){et.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wCXF:function(et,Ve,z){"use strict";z.d(Ve,"a",function(){return J});var le=z("rePB"),Q=z("VTBJ"),j=z("KQm4"),w=z("U8pU"),P=z("ODXe"),_=z("q1tI"),T=z("TSYQ"),C=z.n(T),c=z("Gytx"),p=z.n(c),u=z("Kwbf"),o=z("t23M"),a=z("qx4F"),d=z("6eGT"),s=z("IBYe"),f=z("Ff2n"),i=z("c+Xe"),n=z("fyJ8"),t=z("biw7");function h(Ue,je,tt,mt,Qe){var Xe=tt[Ue]||{},Fe=tt[je]||{},Ie,Me;Xe.fixed==="left"?Ie=mt.left[Ue]:Fe.fixed==="right"&&(Me=mt.right[je]);var Ee=!1,Ae=!1,Le=!1,Te=!1,Ze=tt[je+1],ut=tt[Ue-1];if(Qe==="rtl"){if(Ie!==void 0){var Tt=ut&&ut.fixed==="left";Te=!Tt}else if(Me!==void 0){var Ht=Ze&&Ze.fixed==="right";Le=!Ht}}else if(Ie!==void 0){var Qt=Ze&&Ze.fixed==="left";Ee=!Qt}else if(Me!==void 0){var bt=ut&&ut.fixed==="right";Ae=!bt}return{fixLeft:Ie,fixRight:Me,lastFixLeft:Ee,firstFixRight:Ae,lastFixRight:Le,firstFixLeft:Te,isSticky:mt.isSticky}}var v=z("sR1s");function g(Ue){var je=Ue.cells,tt=Ue.stickyOffsets,mt=Ue.flattenColumns,Qe=Ue.rowComponent,Xe=Ue.cellComponent,Fe=Ue.onHeaderRow,Ie=Ue.index,Me=_.useContext(t.a),Ee=Me.prefixCls,Ae=Me.direction,Le;Fe&&(Le=Fe(je.map(function(Ze){return Ze.column}),Ie));var Te=Object(v.a)(je.map(function(Ze){return Ze.column}));return _.createElement(Qe,Object.assign({},Le),je.map(function(Ze,ut){var Tt=Ze.column,Ht=h(Ze.colStart,Ze.colEnd,mt,tt,Ae),Qt;return Tt&&Tt.onHeaderCell&&(Qt=Ze.column.onHeaderCell(Tt)),_.createElement(n.a,Object.assign({},Ze,{ellipsis:Tt.ellipsis,align:Tt.align,component:Xe,prefixCls:Ee,key:Te[ut]},Ht,{additionalProps:Qt,rowType:"header"}))}))}g.displayName="HeaderRow";var b=g;function E(Ue){var je=[];function tt(Fe,Ie){var Me=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;je[Me]=je[Me]||[];var Ee=Ie,Ae=Fe.filter(Boolean).map(function(Le){var Te={key:Le.key,className:Le.className||"",children:Le.title,column:Le,colStart:Ee},Ze=1,ut=Le.children;return ut&&ut.length>0&&(Ze=tt(ut,Ee,Me+1).reduce(function(Tt,Ht){return Tt+Ht},0),Te.hasSubColumns=!0),"colSpan"in Le&&(Ze=Le.colSpan),"rowSpan"in Le&&(Te.rowSpan=Le.rowSpan),Te.colSpan=Ze,Te.colEnd=Te.colStart+Ze-1,je[Me].push(Te),Ee+=Ze,Ze});return Ae}tt(Ue,0);for(var mt=je.length,Qe=function(Ie){je[Ie].forEach(function(Me){!("rowSpan"in Me)&&!Me.hasSubColumns&&(Me.rowSpan=mt-Ie)})},Xe=0;Xe=0;Ie-=1){var Me=je[Ie],Ee=tt&&tt[Ie],Ae=Ee&&Ee[x.a];(Me||Ae||Fe)&&(Qe.unshift(_.createElement("col",Object.assign({key:Ie,style:{width:Me,minWidth:Me}},Ae))),Fe=!0)}return _.createElement("colgroup",null,Qe)}var S=l;function O(Ue,je){return Object(_.useMemo)(function(){for(var tt=[],mt=0;mt1?ae-1:0),se=1;se=Le&&(Zt=Le-Te),Fe({scrollLeft:Zt/Le*(Ae+2)}),bt.current.x=rt.pageX},ot=function(){var rt=Object(nt.b)(Xe.current).top,wt=rt+Xe.current.offsetHeight,Bt=document.documentElement.scrollTop+window.innerHeight;wt-Object(a.a)()<=Bt||rt>=Bt-Ie?Qt(function(zt){return Object(Q.a)(Object(Q.a)({},zt),{},{isHiddenScrollBar:!0})}):Qt(function(zt){return Object(Q.a)(Object(Q.a)({},zt),{},{isHiddenScrollBar:!1})})},kt=function(rt){Qt(function(wt){return Object(Q.a)(Object(Q.a)({},wt),{},{scrollLeft:rt/Ae*Le||0})})};return _.useImperativeHandle(tt,function(){return{setScrollLeft:kt}}),_.useEffect(function(){var Dt=Object(He.a)(document.body,"mouseup",Pe,!1),rt=Object(He.a)(document.body,"mousemove",yt,!1);return ot(),function(){Dt.remove(),rt.remove()}},[Te,pt]),_.useEffect(function(){var Dt=Object(He.a)(window,"scroll",ot,!1),rt=Object(He.a)(window,"resize",ot,!1);return function(){Dt.remove(),rt.remove()}},[]),_.useEffect(function(){Ht.isHiddenScrollBar||Qt(function(Dt){var rt,wt;return Object(Q.a)(Object(Q.a)({},Dt),{},{scrollLeft:Xe.current.scrollLeft/((rt=Xe.current)===null||rt===void 0?void 0:rt.scrollWidth)*((wt=Xe.current)===null||wt===void 0?void 0:wt.clientWidth)})})},[Ht.isHiddenScrollBar]),Ae<=Le||!Te||Ht.isHiddenScrollBar?null:_.createElement("div",{style:{height:Object(a.a)(),width:Le,bottom:Ie},className:"".concat(Ee,"-sticky-scroll")},_.createElement("div",{onMouseDown:Ge,ref:Ze,className:C()("".concat(Ee,"-sticky-scroll-bar"),Object(le.a)({},"".concat(Ee,"-sticky-scroll-bar-active"),pt)),style:{width:"".concat(Te,"px"),transform:"translate3d(".concat(Ht.scrollLeft,"px, 0, 0)")}}))},k=_.forwardRef(re);function U(Ue,je){return _.useMemo(function(){var tt=!!Ue;return{isSticky:tt,stickyClassName:tt?"".concat(je,"-sticky-header"):"",offsetHeader:Object(w.a)(Ue)==="object"&&Ue.offsetHeader||0,offsetScroll:Object(w.a)(Ue)==="object"&&Ue.offsetScroll||0}},[Ue,je])}var q=[],Y={},J="rc-table-internal-hook",xe=_.memo(function(Ue){var je=Ue.children;return je},function(Ue,je){return p()(Ue.props,je.props)?Ue.pingLeft!==je.pingLeft||Ue.pingRight!==je.pingRight:!1});function ke(Ue){var je,tt=Ue.prefixCls,mt=Ue.className,Qe=Ue.rowClassName,Xe=Ue.style,Fe=Ue.data,Ie=Ue.rowKey,Me=Ue.scroll,Ee=Ue.tableLayout,Ae=Ue.direction,Le=Ue.title,Te=Ue.footer,Ze=Ue.summary,ut=Ue.id,Tt=Ue.showHeader,Ht=Ue.components,Qt=Ue.emptyText,bt=Ue.onRow,Lt=Ue.onHeaderRow,at=Ue.internalHooks,pt=Ue.transformColumns,st=Ue.internalRefs,Pe=Ue.sticky,Ge=Fe||q,yt=!!Ge.length,ot=_.useState(0),kt=Object(P.a)(ot,2),Dt=kt[0],rt=kt[1];_.useEffect(function(){rt(Object(a.a)())});var wt=_.useMemo(function(){return Object(v.c)(Ht,{})},[Ht]),Bt=_.useCallback(function(ct,xt){return Object(v.b)(wt,ct)||xt},[wt]),zt=_.useMemo(function(){return typeof Ie=="function"?Ie:function(ct){var xt=ct&&ct[Ie];return xt}},[Ie]),Zt=Object(x.c)(Ue),Re=Zt.expandIcon,ve=Zt.expandedRowKeys,K=Zt.defaultExpandedRowKeys,Z=Zt.defaultExpandAllRows,oe=Zt.expandedRowRender,he=Zt.onExpand,Oe=Zt.onExpandedRowsChange,Je=Zt.expandRowByClick,lt=Zt.rowExpandable,Pt=Zt.expandIconColumnIndex,Nt=Zt.expandedRowClassName,ht=Zt.childrenColumnName,Mt=Zt.indentSize,nn=Re||pe,Rt=ht||"children",cn=_.useMemo(function(){return oe?"row":Ue.expandable&&at===J&&Ue.expandable.__PARENT_RENDER_ICON__||Ge.some(function(ct){return ct&&Object(w.a)(ct)==="object"&&ct[Rt]})?"nest":!1},[!!oe,Ge]),an=_.useState(function(){return K||(Z?We(Ge,zt,Rt):[])}),ie=Object(P.a)(an,2),N=ie[0],F=ie[1],ae=_.useMemo(function(){return new Set(ve||N||[])},[ve,N]),me=_.useCallback(function(ct){var xt=zt(ct,Ge.indexOf(ct)),It,sn=ae.has(xt);sn?(ae.delete(xt),It=Object(j.a)(ae)):It=[].concat(Object(j.a)(ae),[xt]),F(It),he&&he(!sn,ct),Oe&&Oe(It)},[zt,ae,Ge,he,Oe]),se=_.useState(0),$e=Object(P.a)(se,2),Et=$e[0],it=$e[1],Vt=Object(Ce.b)(Object(Q.a)(Object(Q.a)(Object(Q.a)({},Ue),Zt),{},{expandable:!!oe,expandedKeys:ae,getRowKey:zt,onTriggerExpand:me,expandIcon:nn,expandIconColumnIndex:Pt,direction:Ae}),at===J?pt:null),At=Object(P.a)(Vt,2),Ft=At[0],on=At[1],In=_.useMemo(function(){return{columns:Ft,flattenColumns:on}},[Ft,on]),Lr=_.useRef(),Sr=_.useRef(),Un=_.useRef(),ur=_.useState(!1),mi=Object(P.a)(ur,2),Ar=mi[0],fr=mi[1],br=_.useState(!1),Xr=Object(P.a)(br,2),Dr=Xr[0],Yr=Xr[1],gr=be(new Map),gi=Object(P.a)(gr,2),si=gi[0],Pr=gi[1],Fr=Object(v.a)(on),Ei=Fr.map(function(ct){return si.get(ct)}),vi=_.useMemo(function(){return Ei},[Ei.join("_")]),di=Ne(vi,on.length,Ae),Fn=Me&&Object(v.d)(Me.y),wn=Me&&Object(v.d)(Me.x),_r=wn&&on.some(function(ct){var xt=ct.fixed;return xt}),qn=_.useRef(),kr=U(Pe,tt),hr=kr.isSticky,Ui=kr.offsetHeader,Nr=kr.offsetScroll,Ur=kr.stickyClassName,yi,Zr,Li;Fn&&(Zr={overflowY:"scroll",maxHeight:Me.y}),wn&&(yi={overflowX:"auto"},Fn||(Zr={overflowY:"hidden"}),Li={width:Me.x===!0?"auto":Me.x,minWidth:"100%"});var qi=_.useCallback(function(ct,xt){Pr(function(It){var sn=new Map(It);return sn.set(ct,xt),sn})},[]),xi=_e(null),Pi=Object(P.a)(xi,2),li=Pi[0],Wi=Pi[1];function Si(ct,xt){if(!xt)return;typeof xt=="function"?xt(ct):xt.scrollLeft!==ct&&(xt.scrollLeft=ct)}var hi=function(xt){var It=xt.currentTarget,sn=xt.scrollLeft,fn=typeof sn=="number"?sn:It.scrollLeft,St=It||Y;if(!Wi()||Wi()===St){var _t;li(St),Si(fn,Sr.current),Si(fn,Un.current),Si(fn,(_t=qn.current)===null||_t===void 0?void 0:_t.setScrollLeft)}if(It){var Yt=It.scrollWidth,Ct=It.clientWidth;fr(fn>0),Yr(fn0?[].concat(Object(Q.a)(f),Object(Q.a)(u(h).map(function(v){return Object(j.a)({fixed:t},v)}))):[].concat(Object(Q.a)(f),[Object(j.a)(Object(j.a)({},i),{},{fixed:t})])},[])}function o(s){for(var f=!0,i=0;i=0;h-=1){var v=s[h];if(t&&v.fixed!=="right")t=!1;else if(!t&&v.fixed==="right"){Object(T.a)(!1,"Index ".concat(h+1," of `columns` missing `fixed='right'` prop."));break}}}function a(s){return s.map(function(f){var i=f.fixed,n=Object(w.a)(f,["fixed"]),t=i;return i==="left"?t="right":i==="right"&&(t="left"),Object(j.a)({fixed:t},n)})}function d(s,f){var i=s.prefixCls,n=s.columns,t=s.children,h=s.expandable,v=s.expandedKeys,g=s.getRowKey,b=s.onTriggerExpand,E=s.expandIcon,m=s.rowExpandable,y=s.expandIconColumnIndex,x=s.direction,l=s.expandRowByClick,S=P.useMemo(function(){return n||p(t)},[n,t]),O=P.useMemo(function(){if(h){var I,B=y||0,H=S[B],te=(I={},Object(le.a)(I,c.a,{className:"".concat(i,"-expand-icon-col")}),Object(le.a)(I,"title",""),Object(le.a)(I,"fixed",H?H.fixed:null),Object(le.a)(I,"className","".concat(i,"-row-expand-icon-cell")),Object(le.a)(I,"render",function(X,ne,$){var ee=g(ne,$),ce=v.has(ee),de=m?m(ne):!0,Ce=E({prefixCls:i,expanded:ce,expandable:de,record:ne,onExpand:b});return l?P.createElement("span",{onClick:function(De){return De.stopPropagation()}},Ce):Ce}),I),W=S.slice();return B>=0&&W.splice(B,0,te),W}return S},[h,S,g,v,E,x]),A=P.useMemo(function(){var I=O;return f&&(I=f(I)),I.length||(I=[{render:function(){return null}}]),I},[f,O,x]),D=P.useMemo(function(){return x==="rtl"?a(u(A)):u(A)},[A,x]);return[A,D]}Ve.b=d},wU8J:function(et,Ve){function z(){this.buffer=new Array,this.length=0}z.prototype={get:function(le){var Q=Math.floor(le/8);return(this.buffer[Q]>>>7-le%8&1)==1},put:function(le,Q){for(var j=0;j>>Q-j-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(le){var Q=Math.floor(this.length/8);this.buffer.length<=Q&&this.buffer.push(0),le&&(this.buffer[Q]|=128>>>this.length%8),this.length++}},et.exports=z},wW8i:function(et,Ve,z){et.exports={flex_box_center:"flex_box_center___3xqQI",flex_space_between:"flex_space_between___1fvHN",flex_box_vertical_center:"flex_box_vertical_center___1Gb4J",flex_box_center_end:"flex_box_center_end___8RbQi",flex_box_column:"flex_box_column___3xL78",discuss:"discuss___ybobd",reply:"reply___3EgHc",pagination:"pagination___2EiMG"}},"y0+3":function(et,Ve,z){"use strict";z.d(Ve,"a",function(){return u}),z.d(Ve,"b",function(){return a});var le=/margin|padding|width|height|max|min|offset/,Q={left:!0,top:!0},j={cssFloat:1,styleFloat:1,float:1};function w(d){return d.nodeType===1?d.ownerDocument.defaultView.getComputedStyle(d,null):{}}function P(d,s,f){if(s=s.toLowerCase(),f==="auto"){if(s==="height")return d.offsetHeight;if(s==="width")return d.offsetWidth}return s in Q||(Q[s]=le.test(s)),Q[s]?parseFloat(f)||0:f}function _(d,s){var f=arguments.length,i=w(d);return s=j[s]?"cssFloat"in d.style?"cssFloat":"styleFloat":s,f===1?i:P(d,s,i[s]||d.style[s])}function T(d,s,f){var i=arguments.length;if(s=j[s]?"cssFloat"in d.style?"cssFloat":"styleFloat":s,i===3)return typeof f=="number"&&le.test(s)&&(f="".concat(f,"px")),d.style[s]=f,f;for(var n in s)s.hasOwnProperty(n)&&T(d,n,s[n]);return w(d)}function C(d){return d===document.body?document.documentElement.clientWidth:d.offsetWidth}function c(d){return d===document.body?window.innerHeight||document.documentElement.clientHeight:d.offsetHeight}function p(){var d=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),s=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);return{width:d,height:s}}function u(){var d=document.documentElement.clientWidth,s=window.innerHeight||document.documentElement.clientHeight;return{width:d,height:s}}function o(){return{scrollLeft:Math.max(document.documentElement.scrollLeft,document.body.scrollLeft),scrollTop:Math.max(document.documentElement.scrollTop,document.body.scrollTop)}}function a(d){var s=d.getBoundingClientRect(),f=document.documentElement;return{left:s.left+(window.pageXOffset||f.scrollLeft)-(f.clientLeft||document.body.clientLeft||0),top:s.top+(window.pageYOffset||f.scrollTop)-(f.clientTop||document.body.clientTop||0)}}},ynwM:function(et,Ve,z){var le=z("MFOe"),Q=le.Global;et.exports={name:"oldFF-globalStorage",read:w,write:P,each:_,remove:T,clearAll:C};var j=Q.globalStorage;function w(c){return j[c]}function P(c,p){j[c]=p}function _(c){for(var p=j.length-1;p>=0;p--){var u=j.key(p);c(j[u],u)}}function T(c){return j.removeItem(c)}function C(){_(function(c,p){delete j[c]})}}}]);