(window.webpackJsonp=window.webpackJsonp||[]).push([[194,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(u,s){u.cmdState.push(s)}function P(u){return u.cmdState.length>0?u.cmdState[u.cmdState.length-1]:null}function b(u){var s=u.cmdState.pop();s&&s.closeBracket()}function T(u){for(var s=u.cmdState,h=s.length-1;h>=0;h--){var i=s[h];if(i.name=="DEFAULT")continue;return i}return{styleIdentifier:function(){return null}}}function C(u,s,h){return function(){this.name=u,this.bracketNo=0,this.style=s,this.styles=h,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(u,s){u.f=s}function d(u,s){var h;if(u.match(/^\\[a-zA-Z@]+/)){var i=u.current().slice(1);return h=c.hasOwnProperty(i)?c[i]:c.DEFAULT,h=new h,w(s,h),p(s,a),h.style}if(u.match(/^\\[$&%#{}_]/))return"tag";if(u.match(/^\\[,;!\/\\]/))return"tag";if(u.match("\\["))return p(s,function(t,f){return o(t,f,"\\]")}),"keyword";if(u.match("\\("))return p(s,function(t,f){return o(t,f,"\\)")}),"keyword";if(u.match("$$"))return p(s,function(t,f){return o(t,f,"$$")}),"keyword";if(u.match("$"))return p(s,function(t,f){return o(t,f,"$")}),"keyword";var n=u.next();if(n=="%")return u.skipToEnd(),"comment";if(n=="}"||n=="]"){if(h=P(s),h)h.closeBracket(n),p(s,a);else return"error";return"bracket"}else return n=="{"||n=="["?(h=c.DEFAULT,h=new h,w(s,h),"bracket"):/\d/.test(n)?(u.eatWhile(/[\w.%]/),"atom"):(u.eatWhile(/[\w\-_]/),h=T(s),h.name=="begin"&&(h.argument=u.current()),h.styleIdentifier())}function o(u,s,h){if(u.eatSpace())return null;if(h&&u.match(h))return p(s,d),"keyword";if(u.match(/^\\[a-zA-Z@]+/))return"tag";if(u.match(/^[a-zA-Z]+/))return"variable-2";if(u.match(/^\\[$&%#{}_]/))return"tag";if(u.match(/^\\[,;!\/]/))return"tag";if(u.match(/^[\^_&]/))return"tag";if(u.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(u.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var i=u.next();return i=="{"||i=="}"||i=="["||i=="]"||i=="("||i==")"?"bracket":i=="%"?(u.skipToEnd(),"comment"):"error"}function a(u,s){var h=u.peek(),i;return h=="{"||h=="["?(i=P(s),i.openBracket(h),u.eat(h),p(s,d),"bracket"):/[ \t\r]/.test(h)?(u.eat(h),null):(p(s,d),b(s),d(u,s))}return{startState:function(){var u=j.inMathMode?function(s,h){return o(s,h)}:d;return{cmdState:[],f:u}},copyState:function(u){return{cmdState:u.cmdState.slice(),f:u.f}},token:function(u,s){return s.f(u,s)},blankLine:function(u){u.f=d,u.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(b){var T=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return b.replace(/#{\s*key\s*}/g,T)}function P(b,T){var C,c,p,d,o,a,u=!1;T||(T={}),C=T.debug||!1;try{p=le(),d=document.createRange(),o=document.getSelection(),a=document.createElement("span"),a.textContent=b,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(h){if(h.stopPropagation(),T.format)if(h.preventDefault(),typeof h.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,b)}else h.clipboardData.clearData(),h.clipboardData.setData(T.format,b);T.onCopy&&(h.preventDefault(),T.onCopy(h.clipboardData))}),document.body.appendChild(a),d.selectNodeContents(a),o.addRange(d);var s=document.execCommand("copy");if(!s)throw new Error("copy command was unsuccessful");u=!0}catch(h){C&&console.error("unable to copy using execCommand: ",h),C&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(T.format||"text",b),T.onCopy&&T.onCopy(window.clipboardData),u=!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,b)}}finally{o&&(typeof o.removeRange=="function"?o.removeRange(d):o.removeAllRanges()),a&&document.body.removeChild(a),p()}return u}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 b,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(h(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=f,O.tagName=O.tagStart=null;var D=O.tokenize(S,O);return D?D+" tag error":"tag error"}else return/[\'\"]/.test(A)?(O.tokenize=u(A),O.stringStartCol=S.column(),O.tokenize(S,O)):(S.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function u(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 h(S){return function(O,A){for(var D;(D=O.next())!=null;){if(D=="<")return A.tokenize=h(S+1),A.tokenize(O,A);if(D==">")if(S==1){A.tokenize=o;break}else return A.tokenize=h(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 f(S,O,A){return S=="openTag"?(A.tagStart=O.column(),v):S=="closeTag"?m:f}function v(S,O,A){return S=="word"?(A.tagName=O.current(),d="tag",g):T.allowMissingTagName&&S=="endTag"?(d="tag bracket",g(S,O,A)):(d="error",v)}function m(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?(d="tag",_):(d="tag error",E)}else return T.allowMissingTagName&&S=="endTag"?(d="tag bracket",_(S,O,A)):(d="error",E)}function _(S,O,A){return S!="endTag"?(d="error",_):(n(A),f)}function E(S,O,A){return d="error",_(S,O,A)}function g(S,O,A){if(S=="word")return d="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)),f}return d="error",g}function y(S,O,A){return S=="equals"?x:(T.allowMissing||(d="error"),g(S,O,A))}function x(S,O,A){return S=="string"?l:S=="word"&&T.allowUnquoted?(d="string",g):(d="error",g(S,O,A))}function l(S,O,A){return S=="string"?l:g(S,O,A)}return{startState:function(S){var O={tokenize:o,state:f,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"&&(d=null,O.state=O.state(p||A,S,O),d&&(A=d=="error"?A+" error":d)),A},indent:function(S,O,A){var D=S.context;if(S.tokenize.isInAttribute)return S.tagStart==S.indented?S.stringStartCol+1:S.indented+b;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+b*(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=g)},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 Ct}),z.d(Ve,"a",function(){return Qt});var le=z("VTBJ"),Q=z("1OyB"),j=z("vuIU"),w=z("JX7q"),P=z("Ji7U"),b=z("LK+K"),T=z("q1tI"),C=z("I8Z2"),c=z("BGR+"),p=z("wx14"),d=z("rePB"),o=z("4IlW"),a=z("2GS6"),u=z("Gytx"),s=z.n(u),h=z("TSYQ"),i=z.n(h),n=z("U8pU"),t=z("ODXe"),f=/iPhone/i,v=/iPod/i,m=/iPad/i,_=/\bAndroid(?:.+)Mobile\b/i,E=/Android/i,g=/\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,De=Object(t.a)(st,1);at=De[0]}if(pt=at.split("Twitter"),typeof pt[1]!="undefined"){var Ke=pt,yt=Object(t.a)(Ke,1);at=yt[0]}var ot={apple:{phone:B(f,at)&&!B(x,at),ipod:B(v,at),tablet:!B(f,at)&&B(m,at)&&!B(x,at),device:(B(f,at)||B(v,at)||B(m,at))&&!B(x,at)},amazon:{phone:B(g,at),tablet:!B(g,at)&&B(y,at),device:B(g,at)||B(y,at)},android:{phone:!B(x,at)&&B(g,at)||!B(x,at)&&B(_,at),tablet:!B(x,at)&&!B(g,at)&&!B(_,at)&&(B(y,at)||B(E,at)),device:!B(x,at)&&(B(g,at)||B(y,at)||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 Y(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(De){pt+=1,at(De,pt)}):at(st,pt)})}function ee(Lt,at,pt){if(!Lt||pt.find)return;T.Children.forEach(Lt,function(st){if(st){var De=st.type;if(!De||!(De.isSubMenu||De.isMenuItem||De.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 De=getComputedStyle(at),Ke=De.marginLeft,yt=De.marginRight;st+=+Ke.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},Pe=z("KQm4"),ye=z("Ff2n"),Ee=z("i8i4"),Ge=z("bdgK"),Ue=z("uciX"),Fe=z("8XRh"),He={adjustX:1,adjustY:1},be={topLeft:{points:["bl","tl"],overflow:He,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:He,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:He,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:He,offset:[4,0]}},me={topLeft:{points:["bl","tl"],overflow:He,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:He,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:He,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:He,offset:[4,0]}},We=be,ze=0,nt={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},re=function(at,pt,st){var De=ne(pt),Ke=at.getState();at.setState({defaultActiveFirst:Object(le.a)(Object(le.a)({},Ke.defaultActiveFirst),{},Object(d.a)({},De,st))})},k=function(Lt){Object(P.a)(pt,Lt);var at=Object(b.a)(pt);function pt(st){var De;Object(Q.a)(this,pt),De=at.call(this,st),De.onDestroy=function(rt){De.props.onDestroy(rt)},De.onKeyDown=function(rt){var Tt=rt.keyCode,Ft=De.menuInstance,zt=De.props,Zt=zt.isOpen,Re=zt.store;if(Tt===o.a.ENTER)return De.onTitleClick(rt),re(Re,De.props.eventKey,!0),!0;if(Tt===o.a.RIGHT)return Zt?Ft.onKeyDown(rt):(De.triggerOpenChange(!0),re(Re,De.props.eventKey,!0)),!0;if(Tt===o.a.LEFT){var ve;if(Zt)ve=Ft.onKeyDown(rt);else return;return ve||(De.triggerOpenChange(!1),ve=!0),ve}return Zt&&(Tt===o.a.UP||Tt===o.a.DOWN)?Ft.onKeyDown(rt):void 0},De.onOpenChange=function(rt){De.props.onOpenChange(rt)},De.onPopupVisibleChange=function(rt){De.triggerOpenChange(rt,rt?"mouseenter":"mouseleave")},De.onMouseEnter=function(rt){var Tt=De.props,Ft=Tt.eventKey,zt=Tt.onMouseEnter,Zt=Tt.store;re(Zt,De.props.eventKey,!1),zt({key:Ft,domEvent:rt})},De.onMouseLeave=function(rt){var Tt=De.props,Ft=Tt.parentMenu,zt=Tt.eventKey,Zt=Tt.onMouseLeave;Ft.subMenuInstance=Object(w.a)(De),Zt({key:zt,domEvent:rt})},De.onTitleMouseEnter=function(rt){var Tt=De.props,Ft=Tt.eventKey,zt=Tt.onItemHover,Zt=Tt.onTitleMouseEnter;zt({key:Ft,hover:!0}),Zt({key:Ft,domEvent:rt})},De.onTitleMouseLeave=function(rt){var Tt=De.props,Ft=Tt.parentMenu,zt=Tt.eventKey,Zt=Tt.onItemHover,Re=Tt.onTitleMouseLeave;Ft.subMenuInstance=Object(w.a)(De),Zt({key:zt,hover:!1}),Re({key:zt,domEvent:rt})},De.onTitleClick=function(rt){var Tt=Object(w.a)(De),Ft=Tt.props;if(Ft.onTitleClick({key:Ft.eventKey,domEvent:rt}),Ft.triggerSubMenuAction==="hover")return;De.triggerOpenChange(!Ft.isOpen,"click"),re(Ft.store,De.props.eventKey,!1)},De.onSubMenuClick=function(rt){typeof De.props.onClick=="function"&&De.props.onClick(De.addKeyPath(rt))},De.onSelect=function(rt){De.props.onSelect(rt)},De.onDeselect=function(rt){De.props.onDeselect(rt)},De.getPrefixCls=function(){return"".concat(De.props.rootPrefixCls,"-submenu")},De.getActiveClassName=function(){return"".concat(De.getPrefixCls(),"-active")},De.getDisabledClassName=function(){return"".concat(De.getPrefixCls(),"-disabled")},De.getSelectedClassName=function(){return"".concat(De.getPrefixCls(),"-selected")},De.getOpenClassName=function(){return"".concat(De.props.rootPrefixCls,"-submenu-open")},De.saveMenuInstance=function(rt){De.menuInstance=rt},De.addKeyPath=function(rt){return Object(le.a)(Object(le.a)({},rt),{},{keyPath:(rt.keyPath||[]).concat(De.props.eventKey)})},De.triggerOpenChange=function(rt,Tt){var Ft=De.props.eventKey,zt=function(){De.onOpenChange({key:Ft,item:Object(w.a)(De),trigger:Tt,open:rt})};Tt==="mouseenter"?De.mouseenterTimeout=setTimeout(function(){zt()},0):zt()},De.isChildrenSelected=function(){var rt={find:!1};return ee(De.props.children,De.props.selectedKeys,rt),rt.find},De.isOpen=function(){return De.props.openKeys.indexOf(De.props.eventKey)!==-1},De.adjustWidth=function(){if(!De.subMenuTitle||!De.menuInstance)return;var rt=Ee.findDOMNode(De.menuInstance);if(rt.offsetWidth>=De.subMenuTitle.offsetWidth)return;rt.style.minWidth="".concat(De.subMenuTitle.offsetWidth,"px")},De.saveSubMenuTitle=function(rt){De.subMenuTitle=rt},De.getBaseProps=function(){var rt=Object(w.a)(De),Tt=rt.props;return{mode:Tt.mode==="horizontal"?"vertical":Tt.mode,visible:De.props.isOpen,level:Tt.level+1,inlineIndent:Tt.inlineIndent,focusable:!1,onClick:De.onSubMenuClick,onSelect:De.onSelect,onDeselect:De.onDeselect,onDestroy:De.onDestroy,selectedKeys:Tt.selectedKeys,eventKey:"".concat(Tt.eventKey,"-menu-"),openKeys:Tt.openKeys,motion:Tt.motion,onOpenChange:De.onOpenChange,subMenuOpenDelay:Tt.subMenuOpenDelay,parentMenu:Object(w.a)(De),subMenuCloseDelay:Tt.subMenuCloseDelay,forceSubMenuRender:Tt.forceSubMenuRender,triggerSubMenuAction:Tt.triggerSubMenuAction,builtinPlacements:Tt.builtinPlacements,defaultActiveFirst:Tt.store.getState().defaultActiveFirst[ne(Tt.eventKey)],multiple:Tt.multiple,prefixCls:Tt.rootPrefixCls,id:De.internalMenuId,manualRef:De.saveMenuInstance,itemIcon:Tt.itemIcon,expandIcon:Tt.expandIcon,direction:Tt.direction}},De.getMotion=function(rt,Tt){var Ft=Object(w.a)(De),zt=Ft.haveRendered,Zt=De.props,Re=Zt.motion,ve=Zt.rootPrefixCls,K=Object(le.a)(Object(le.a)({},Re),{},{leavedClassName:"".concat(ve,"-hidden"),removeOnLeave:!1,motionAppear:zt||!Tt||rt!=="inline"});return K};var Ke=st.store,yt=st.eventKey,ot=Ke.getState(),kt=ot.defaultActiveFirst;De.isRootMenu=!1;var Dt=!1;return kt&&(Dt=kt[yt]),re(Ke,yt,Dt),De}return Object(j.a)(pt,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var De=this,Ke=this.props,yt=Ke.mode,ot=Ke.parentMenu,kt=Ke.manualRef;if(kt&&kt(this),yt!=="horizontal"||!ot.isRootMenu||!this.props.isOpen)return;this.minWidthTimeout=setTimeout(function(){return De.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var De=this.props,Ke=De.onDestroy,yt=De.eventKey;Ke&&Ke(yt),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout)}},{key:"renderChildren",value:function(De){var Ke=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(Fe.default,Object.assign({visible:yt.visible},ot),function(Dt){var rt=Dt.className,Tt=Dt.style,Ft=i()("".concat(yt.prefixCls,"-sub"),rt,Object(d.a)({},"".concat(yt.prefixCls,"-rtl"),kt==="rtl"));return T.createElement(Be,Object.assign({},yt,{id:Ke.internalMenuId,className:Ft,style:Tt}),De)})}},{key:"render",value:function(){var De,Ke=Object(le.a)({},this.props),yt=Ke.isOpen,ot=this.getPrefixCls(),kt=Ke.mode==="inline",Dt=i()(ot,"".concat(ot,"-").concat(Ke.mode),(De={},Object(d.a)(De,Ke.className,!!Ke.className),Object(d.a)(De,this.getOpenClassName(),yt),Object(d.a)(De,this.getActiveClassName(),Ke.active||yt&&!kt),Object(d.a)(De,this.getDisabledClassName(),Ke.disabled),Object(d.a)(De,this.getSelectedClassName(),this.isChildrenSelected()),De));this.internalMenuId||(Ke.eventKey?this.internalMenuId="".concat(Ke.eventKey,"$Menu"):(ze+=1,this.internalMenuId="$__$".concat(ze,"$Menu")));var rt={},Tt={},Ft={};Ke.disabled||(rt={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},Tt={onClick:this.onTitleClick},Ft={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var zt={},Zt=Ke.direction;kt&&(Zt==="rtl"?zt.paddingRight=Ke.inlineIndent*Ke.level:zt.paddingLeft=Ke.inlineIndent*Ke.level);var Re={};this.props.isOpen&&(Re={"aria-owns":this.internalMenuId});var ve=null;Ke.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"},Ft,Tt,{"aria-expanded":yt},Re,{"aria-haspopup":"true",title:typeof Ke.title=="string"?Ke.title:void 0}),Ke.title,ve||T.createElement("i",{className:"".concat(ot,"-arrow")})),Z=this.renderChildren(Ke.children),oe=Ke.parentMenu.isRootMenu?Ke.parentMenu.props.getPopupContainer:function(cn){return cn.parentNode},he=nt[Ke.mode],Oe=Ke.popupOffset?{offset:Ke.popupOffset}:{},Je=Ke.mode==="inline"?"":Ke.popupClassName;Je+=Zt==="rtl"?" ".concat(ot,"-rtl"):"";var lt=Ke.disabled,Pt=Ke.triggerSubMenuAction,Nt=Ke.subMenuOpenDelay,ht=Ke.forceSubMenuRender,Mt=Ke.subMenuCloseDelay,nn=Ke.builtinPlacements;ce.forEach(function(cn){return delete Ke[cn]}),delete Ke.onClick;var Rt=Zt==="rtl"?Object.assign({},me,nn):Object.assign({},be,nn);return delete Ke.direction,T.createElement("li",Object.assign({},Ke,rt,{className:Dt,role:"menuitem"}),kt&&K,kt&&Z,!kt&&T.createElement(Ue.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,De=Lt.selectedKeys,Ke=at.eventKey,yt=at.subMenuKey;return{isOpen:pt.indexOf(Ke)>-1,active:st[yt]===Ke,selectedKeys:De}})(k);U.isSubMenu=!0;var q=U,$="menuitem-overflowed",J=.5,xe=function(Lt){Object(P.a)(pt,Lt);var at=Object(b.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 De=st.props.prefixCls,Ke=Ee.findDOMNode(Object(w.a)(st));return Ke?[].slice.call(Ke.children).filter(function(yt){return yt.className.split(" ").indexOf("".concat(De,"-overflowed-submenu"))<0}):[]},st.getOverflowedSubMenuItem=function(De,Ke,yt){var ot=st.props,kt=ot.overflowedIndicator,Dt=ot.level,rt=ot.mode,Tt=ot.prefixCls,Ft=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(ye.a)(Zt,["children","title","style"]),oe=Object(le.a)({},K),he="".concat(De,"-overflowed-indicator"),Oe="".concat(De,"-overflowed-indicator");Ke.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=Ft?"".concat(Tt,"-").concat(Ft):"",lt={};return ce.forEach(function(Pt){Z[Pt]!==void 0&&(lt[Pt]=Z[Pt])}),T.createElement(q,Object.assign({title:kt,className:"".concat(Tt,"-overflowed-submenu"),popupClassName:Je},lt,{key:he,eventKey:Oe,disabled:!1,style:oe}),Ke)},st.setChildrenWidthAndResize=function(){if(st.props.mode!=="horizontal")return;var De=Ee.findDOMNode(Object(w.a)(st));if(!De)return;var Ke=De.children;if(!Ke||Ke.length===0)return;var yt=De.children[Ke.length-1];Ce(yt,"display","inline-block");var ot=st.getMenuItemNodes(),kt=ot.filter(function(Dt){return Dt.className.split(" ").indexOf($)>=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(De.children[De.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 De=Ee.findDOMNode(Object(w.a)(st));if(!De)return;var Ke=de(De);st.overflowedItems=[];var yt=0,ot;st.originalTotalWidth>Ke+J&&(ot=-1,st.menuItemSizes.forEach(function(kt){yt+=kt,yt+st.overflowedIndicatorWidth<=Ke&&(ot+=1)})),st.setState({lastVisibleIndex:ot})},st}return Object(j.a)(pt,[{key:"componentDidMount",value:function(){var De=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var Ke=Ee.findDOMNode(this);if(!Ke)return;this.resizeObserver=new Ge.default(function(yt){yt.forEach(function(){var ot=De.cancelFrameId;cancelAnimationFrame(ot),De.cancelFrameId=requestAnimationFrame(De.setChildrenWidthAndResize)})}),[].slice.call(Ke.children).concat(Ke).forEach(function(yt){De.resizeObserver.observe(yt)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){De.resizeObserver.disconnect(),[].slice.call(Ke.children).concat(Ke).forEach(function(yt){De.resizeObserver.observe(yt)}),De.setChildrenWidthAndResize()}),this.mutationObserver.observe(Ke,{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(De){var Ke=this,yt=this.state.lastVisibleIndex;return(De||[]).reduce(function(ot,kt,Dt){var rt=kt;if(Ke.props.mode==="horizontal"){var Tt=Ke.getOverflowedSubMenuItem(kt.props.eventKey,[]);yt!==void 0&&Ke.props.className.indexOf("".concat(Ke.props.prefixCls,"-root"))!==-1&&(Dt>yt&&(rt=T.cloneElement(kt,{style:{display:"none"},eventKey:"".concat(kt.props.eventKey,"-hidden"),className:"".concat($)})),Dt===yt+1&&(Ke.overflowedItems=De.slice(yt+1).map(function(zt){return T.cloneElement(zt,{key:zt.props.eventKey,mode:"vertical-left"})}),Tt=Ke.getOverflowedSubMenuItem(kt.props.eventKey,Ke.overflowedItems)));var Ft=[].concat(Object(Pe.a)(ot),[Tt,rt]);return Dt===De.length-1&&Ft.push(Ke.getOverflowedSubMenuItem(kt.props.eventKey,[],!0)),Ft}return[].concat(Object(Pe.a)(ot),[rt])},[])}},{key:"render",value:function(){var De=this.props,Ke=De.visible,yt=De.prefixCls,ot=De.overflowedIndicator,kt=De.mode,Dt=De.level,rt=De.tag,Tt=De.children,Ft=De.theme,zt=Object(ye.a)(De,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),Zt=rt;return T.createElement(Zt,Object.assign({},zt),this.renderChildren(Tt))}}]),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 Ne(Lt,at,pt){var st=Lt.getState();Lt.setState({activeKey:Object(le.a)(Object(le.a)({},st.activeKey),{},Object(d.a)({},at,pt))})}function je(Lt){return Lt.eventKey||"0-menu-"}function tt(Lt,at){var pt=at,st=Lt.children,De=Lt.eventKey;if(pt){var Ke;if(Y(st,function(yt,ot){yt&&yt.props&&!yt.props.disabled&&pt===X(yt,De,ot)&&(Ke=!0)}),Ke)return pt}return pt=null,Lt.defaultActiveFirst&&Y(st,function(yt,ot){!pt&&yt&&!yt.props.disabled&&(pt=X(yt,De,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(b.a)(pt);function pt(st){var De;return Object(Q.a)(this,pt),De=at.call(this,st),De.onKeyDown=function(Ke,yt){var ot=Ke.keyCode,kt;if(De.getFlatInstanceArray().forEach(function(rt){rt&&rt.props.active&&rt.onKeyDown&&(kt=rt.onKeyDown(Ke))}),kt)return 1;var Dt=null;return(ot===o.a.UP||ot===o.a.DOWN)&&(Dt=De.step(ot===o.a.UP?-1:1)),Dt?(Ke.preventDefault(),Ne(De.props.store,je(De.props),Dt.props.eventKey),typeof yt=="function"&&yt(Dt),1):void 0},De.onItemHover=function(Ke){var yt=Ke.key,ot=Ke.hover;Ne(De.props.store,je(De.props),ot?yt:null)},De.onDeselect=function(Ke){De.props.onDeselect(Ke)},De.onSelect=function(Ke){De.props.onSelect(Ke)},De.onClick=function(Ke){De.props.onClick(Ke)},De.onOpenChange=function(Ke){De.props.onOpenChange(Ke)},De.onDestroy=function(Ke){De.props.onDestroy(Ke)},De.getFlatInstanceArray=function(){return De.instanceArray},De.step=function(Ke){var yt=De.getFlatInstanceArray(),ot=De.props.store.getState().activeKey[je(De.props)],kt=yt.length;if(!kt)return null;Ke<0&&(yt=yt.concat().reverse());var Dt=-1;if(yt.every(function(zt,Zt){return zt&&zt.props.eventKey===ot?(Dt=Zt,!1):!0}),!De.props.defaultActiveFirst&&Dt!==-1&&dt(yt.slice(Dt,kt-1)))return;var rt=(Dt+1)%kt,Tt=rt;do{var Ft=yt[Tt];if(!Ft||Ft.props.disabled)Tt=(Tt+1)%kt;else return Ft}while(Tt!==rt);return null},De.renderCommonMenuItem=function(Ke,yt,ot){var kt=De.props.store.getState(),Dt=Object(w.a)(De),rt=Dt.props,Tt=X(Ke,rt.eventKey,yt),Ft=Ke.props;if(!Ft||typeof Ke.type=="string")return Ke;var zt=Tt===kt.activeKey,Zt=Object(le.a)(Object(le.a)({mode:Ft.mode||rt.mode,level:rt.level,inlineIndent:rt.inlineIndent,renderMenuItem:De.renderMenuItem,rootPrefixCls:rt.prefixCls,index:yt,parentMenu:rt.parentMenu,manualRef:Ft.disabled?void 0:Object(a.a)(Ke.ref,mt.bind(Object(w.a)(De))),eventKey:Tt,active:!Ft.disabled&&zt,multiple:rt.multiple,onClick:function(ve){(Ft.onClick||V)(ve),De.onClick(ve)},onItemHover:De.onItemHover,motion:rt.motion,subMenuOpenDelay:rt.subMenuOpenDelay,subMenuCloseDelay:rt.subMenuCloseDelay,forceSubMenuRender:rt.forceSubMenuRender,onOpenChange:De.onOpenChange,onDeselect:De.onDeselect,onSelect:De.onSelect,builtinPlacements:rt.builtinPlacements,itemIcon:Ft.itemIcon||De.props.itemIcon,expandIcon:Ft.expandIcon||De.props.expandIcon},ot),{},{direction:rt.direction});return(rt.mode==="inline"||Se())&&(Zt.triggerSubMenuAction="click"),T.cloneElement(Ke,Zt)},De.renderMenuItem=function(Ke,yt,ot){if(!Ke)return null;var kt=De.props.store.getState(),Dt={openKeys:kt.openKeys,selectedKeys:kt.selectedKeys,triggerSubMenuAction:De.props.triggerSubMenuAction,subMenuKey:ot};return De.renderCommonMenuItem(Ke,yt,Dt)},st.store.setState({activeKey:Object(le.a)(Object(le.a)({},st.store.getState().activeKey),{},Object(d.a)({},st.eventKey,tt(st,st.activeKey)))}),De.instanceArray=[],De}return Object(j.a)(pt,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(De){return this.props.visible||De.visible||this.props.className!==De.className||!s()(this.props.style,De.style)}},{key:"componentDidUpdate",value:function(De){var Ke=this.props,yt="activeKey"in Ke?Ke.activeKey:Ke.store.getState().activeKey[je(Ke)],ot=tt(Ke,yt);if(ot!==yt)Ne(Ke.store,je(Ke),ot);else if("activeKey"in De){var kt=tt(De,De.activeKey);ot!==kt&&Ne(Ke.store,je(Ke),ot)}}},{key:"render",value:function(){var De=this,Ke=Object(p.a)({},this.props);this.instanceArray=[];var yt=i()(Ke.prefixCls,Ke.className,"".concat(Ke.prefixCls,"-").concat(Ke.mode)),ot={className:yt,role:Ke.role||"menu"};Ke.id&&(ot.id=Ke.id),Ke.focusable&&(ot.tabIndex=0,ot.onKeyDown=this.onKeyDown);var kt=Ke.prefixCls,Dt=Ke.eventKey,rt=Ke.visible,Tt=Ke.level,Ft=Ke.mode,zt=Ke.overflowedIndicator,Zt=Ke.theme;return ce.forEach(function(Re){return delete Ke[Re]}),delete Ke.onClick,T.createElement(ke,Object.assign({},Ke,{prefixCls:kt,mode:Ft,tag:"ul",level:Tt,theme:Zt,visible:rt,overflowedIndicator:zt},ot),T.Children.map(Ke.children,function(Re,ve){return De.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),Be=Xe,Ie=z("Kwbf");function Me(Lt,at,pt){var st=Lt.prefixCls,De=Lt.motion,Ke=Lt.defaultMotions,yt=Ke===void 0?{}:Ke,ot=Lt.openAnimation,kt=Lt.openTransitionName,Dt=at.switchingModeFromInline;if(De)return De;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 _e=function(Lt){Object(P.a)(pt,Lt);var at=Object(b.a)(pt);function pt(st){var De;Object(Q.a)(this,pt),De=at.call(this,st),De.inlineOpenKeys=[],De.onSelect=function(ot){var kt=Object(w.a)(De),Dt=kt.props;if(Dt.selectable){var rt=De.store.getState(),Tt=rt.selectedKeys,Ft=ot.key;Dt.multiple?Tt=Tt.concat([Ft]):Tt=[Ft],"selectedKeys"in Dt||De.store.setState({selectedKeys:Tt}),Dt.onSelect(Object(le.a)(Object(le.a)({},ot),{},{selectedKeys:Tt}))}},De.onClick=function(ot){var kt=De.getRealMenuMode(),Dt=Object(w.a)(De),rt=Dt.store,Tt=Dt.props.onOpenChange;kt!=="inline"&&!("openKeys"in De.props)&&(rt.setState({openKeys:[]}),Tt([])),De.props.onClick(ot)},De.onKeyDown=function(ot,kt){De.innerMenu.getWrappedInstance().onKeyDown(ot,kt)},De.onOpenChange=function(ot){var kt=Object(w.a)(De),Dt=kt.props,rt=De.store.getState().openKeys.concat(),Tt=!1,Ft=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)}Tt=Tt||Re};Array.isArray(ot)?ot.forEach(Ft):Ft(ot),Tt&&("openKeys"in De.props||De.store.setState({openKeys:rt}),Dt.onOpenChange(rt))},De.onDeselect=function(ot){var kt=Object(w.a)(De),Dt=kt.props;if(Dt.selectable){var rt=De.store.getState().selectedKeys.concat(),Tt=ot.key,Ft=rt.indexOf(Tt);Ft!==-1&&rt.splice(Ft,1),"selectedKeys"in Dt||De.store.setState({selectedKeys:rt}),Dt.onDeselect(Object(le.a)(Object(le.a)({},ot),{},{selectedKeys:rt}))}},De.onMouseEnter=function(ot){De.restoreModeVerticalFromInline();var kt=De.props.onMouseEnter;kt&&kt(ot)},De.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,Tt=ot.propertyName==="font-size"&&rt.indexOf("anticon")>=0;(kt||Tt)&&De.restoreModeVerticalFromInline()},De.setInnerMenu=function(ot){De.innerMenu=ot},De.isRootMenu=!0;var Ke=st.defaultSelectedKeys,yt=st.defaultOpenKeys;return"selectedKeys"in st&&(Ke=st.selectedKeys||[]),"openKeys"in st&&(yt=st.openKeys||[]),De.store=Object(C.c)({selectedKeys:Ke,openKeys:yt,activeKey:{"0-menu-":tt(st,st.activeKey)}}),De.state={switchingModeFromInline:!1},De}return Object(j.a)(pt,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(De){this.updateOpentKeysWhenSwitchMode(De),this.updateMiniStore();var Ke=this.props,yt=Ke.siderCollapsed,ot=Ke.inlineCollapsed,kt=Ke.onOpenChange;(!De.inlineCollapsed&&ot||!De.siderCollapsed&&yt)&&kt([]),this.updateMenuDisplay()}},{key:"updateOpentKeysWhenSwitchMode",value:function(De){var Ke=this.props,yt=this.store,ot=this.inlineOpenKeys,kt=yt.getState(),Dt={};De.mode==="inline"&&Ke.mode!=="inline"&&this.setState({switchingModeFromInline:!0}),"openKeys"in Ke||((Ke.inlineCollapsed&&!De.inlineCollapsed||Ke.siderCollapsed&&!De.siderCollapsed)&&(this.setState({switchingModeFromInline:!0}),this.inlineOpenKeys=kt.openKeys.concat(),Dt.openKeys=[]),(!Ke.inlineCollapsed&&De.inlineCollapsed||!Ke.siderCollapsed&&De.siderCollapsed)&&(Dt.openKeys=ot,this.inlineOpenKeys=[])),Object.keys(Dt).length&&yt.setState(Dt)}},{key:"updateMenuDisplay",value:function(){var De=this.props.collapsedWidth,Ke=this.store,yt=this.prevOpenKeys,ot=this.getInlineCollapsed()&&(De===0||De==="0"||De==="0px");ot?(this.prevOpenKeys=Ke.getState().openKeys.concat(),this.store.setState({openKeys:[]})):yt&&(this.store.setState({openKeys:yt}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var De=this.props.mode,Ke=this.state.switchingModeFromInline,yt=this.getInlineCollapsed();return Ke&&yt?"inline":yt?"vertical":De}},{key:"getInlineCollapsed",value:function(){var De=this.props,Ke=De.inlineCollapsed,yt=De.siderCollapsed;return yt!==void 0?yt:Ke}},{key:"restoreModeVerticalFromInline",value:function(){var De=this.state.switchingModeFromInline;De&&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 De=Object(le.a)({},Object(c.default)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),Ke=this.getRealMenuMode();return De.className+=" ".concat(De.prefixCls,"-root"),De.direction==="rtl"&&(De.className+=" ".concat(De.prefixCls,"-rtl")),De=Object(le.a)(Object(le.a)({},De),{},{mode:Ke,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,Ke)}),delete De.openAnimation,delete De.openTransitionName,T.createElement(C.a,{store:this.store},T.createElement(Be,Object.assign({},De,{ref:this.setInnerMenu}),this.props.children))}}]),pt}(T.Component);_e.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=_e,Le=function(Lt){Object(P.a)(pt,Lt);var at=Object(b.a)(pt);function pt(){var st;return Object(Q.a)(this,pt),st=at.apply(this,arguments),st.onKeyDown=function(De){var Ke=De.keyCode;return Ke===o.a.ENTER?(st.onClick(De),!0):void 0},st.onMouseLeave=function(De){var Ke=st.props,yt=Ke.eventKey,ot=Ke.onItemHover,kt=Ke.onMouseLeave;ot({key:yt,hover:!1}),kt({key:yt,domEvent:De})},st.onMouseEnter=function(De){var Ke=st.props,yt=Ke.eventKey,ot=Ke.onItemHover,kt=Ke.onMouseEnter;ot({key:yt,hover:!0}),kt({key:yt,domEvent:De})},st.onClick=function(De){var Ke=st.props,yt=Ke.eventKey,ot=Ke.multiple,kt=Ke.onClick,Dt=Ke.onSelect,rt=Ke.onDeselect,Tt=Ke.isSelected,Ft={key:yt,keyPath:[yt],item:Object(w.a)(st),domEvent:De};kt(Ft),ot?Tt?rt(Ft):Dt(Ft):Tt||Dt(Ft)},st.saveNode=function(De){st.node=De},st}return Object(j.a)(pt,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var De=this.props;De.onDestroy&&De.onDestroy(De.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 De,Ke=Object(le.a)({},this.props),yt=i()(this.getPrefixCls(),Ke.className,(De={},Object(d.a)(De,this.getActiveClassName(),!Ke.disabled&&Ke.active),Object(d.a)(De,this.getSelectedClassName(),Ke.isSelected),Object(d.a)(De,this.getDisabledClassName(),Ke.disabled),De)),ot=Object(le.a)(Object(le.a)({},Ke.attribute),{},{title:typeof Ke.title=="string"?Ke.title:void 0,className:yt,role:Ke.role||"menuitem","aria-disabled":Ke.disabled});Ke.role==="option"?ot=Object(le.a)(Object(le.a)({},ot),{},{role:"option","aria-selected":Ke.isSelected}):(Ke.role===null||Ke.role==="none")&&(ot.role="none");var kt={onClick:Ke.disabled?null:this.onClick,onMouseLeave:Ke.disabled?null:this.onMouseLeave,onMouseEnter:Ke.disabled?null:this.onMouseEnter},Dt=Object(le.a)({},Ke.style);Ke.mode==="inline"&&(Ke.direction==="rtl"?Dt.paddingRight=Ke.inlineIndent*Ke.level:Dt.paddingLeft=Ke.inlineIndent*Ke.level),ce.forEach(function(Tt){return delete Ke[Tt]}),delete Ke.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)(Ke,["onClick","onMouseEnter","onMouseLeave","onSelect"]),ot,kt,{style:Dt,ref:this.saveNode}),Ke.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,De=at.eventKey,Ke=at.subMenuKey;return{active:pt[Ke]===De,isSelected:st.indexOf(De)!==-1}})(Le),Ze=Te,ut=function(Lt){Object(P.a)(pt,Lt);var at=Object(b.a)(pt);function pt(){var st;return Object(Q.a)(this,pt),st=at.apply(this,arguments),st.renderInnerMenuItem=function(De){var Ke=st.props,yt=Ke.renderMenuItem,ot=Ke.index;return yt(De,ot,st.props.subMenuKey)},st}return Object(j.a)(pt,[{key:"render",value:function(){var De=Object(p.a)({},this.props),Ke=De.className,yt=Ke===void 0?"":Ke,ot=De.rootPrefixCls,kt="".concat(ot,"-item-group-title"),Dt="".concat(ot,"-item-group-list"),rt=De.title,Tt=De.children;return ce.forEach(function(Ft){return delete De[Ft]}),delete De.onClick,delete De.direction,T.createElement("li",Object.assign({},De,{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(Tt,this.renderInnerMenuItem)))}}]),pt}(T.Component);ut.isMenuItemGroup=!0,ut.defaultProps={disabled:!0};var Ct=ut,Ht=function(at){var pt=at.className,st=at.rootPrefixCls,De=at.style;return T.createElement("li",{className:"".concat(pt," ").concat(st,"-item-divider"),style:De})};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 g});var le=z("Ty5D"),Q=z("dI71"),j=z("q1tI"),w=z.n(j),P=z("YS25"),b=z("17x9"),T=z.n(b),C=z("wx14"),c=z("zLVn"),p=z("9R94"),d=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===u.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,Y="".concat(D,"-options"),ee=te,ce=null,de=null,Ce=null;if(!I&&!B)return null;var Se=this.getPageSizeOptions();if(I&&ee){var Pe=Se.map(function(ye,Ee){return c.a.createElement(ee.Option,{key:Ee,value:ye.toString()},(W||l.buildOptionText)(ye))});ce=c.a.createElement(ee,{disabled:X,prefixCls:V,showSearch:!1,className:"".concat(Y,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(O||Se[0]).toString(),onChange:this.changeSize,getPopupContainer:function(Ee){return Ee.parentNode}},Pe)}return B&&(H&&(Ce=typeof H=="boolean"?c.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:X,className:"".concat(Y,"-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(Y,"-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(Y)},ce,de)}}]),y}(c.a.Component);s.defaultProps={pageSizeOptions:["10","20","50","100"]};var h=s,i=z("N2Kk");function n(){}function t(E){return typeof E=="number"&&isFinite(E)&&Math.floor(E)===E}function f(E,g,y){return y}function v(E,g,y){var x=typeof E=="undefined"?g.pageSize:E;return Math.floor((y.total-1)/x)+1}var m=function(E){Object(b.a)(y,E);var g=Object(T.a)(y);function y(x){var l;Object(w.a)(this,y),l=g.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===u.ARROW_UP||I.keyCode===u.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===u.ENTER?l.handleChange(B):I.keyCode===u.ARROW_UP?l.handleChange(B-1):I.keyCode===u.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,Y=S.simple,ee=S.itemRender,ce=S.showPrevNextJumpers,de=S.jumpPrevIcon,Ce=S.jumpNextIcon,Se=S.selectComponentClass,Pe=S.selectPrefixCls,ye=S.pageSizeOptions,Ee=this.state,Ge=Ee.current,Ue=Ee.pageSize,Fe=Ee.currentInputValue;if(B===!0&&H<=Ue)return null;var He=v(void 0,this.state,this.props),be=[],me=null,We=null,ze=null,nt=null,re=null,k=W&&W.goButton,U=V?1:2,q=Ge-1>0?Ge-1:0,$=Ge+1=U*2&&Ge!==1+2&&(be[0]=Object(C.cloneElement)(be[0],{className:"".concat(O,"-item-after-jump-prev")}),be.unshift(me)),He-Ge>=U*2&&Ge!==He-2&&(be[be.length-1]=Object(C.cloneElement)(be[be.length-1],{className:"".concat(O,"-item-before-jump-next")}),be.push(We)),tt!==1&&be.unshift(ze),mt!==He&&be.push(nt)}var Be=null;ne&&(Be=c.a.createElement("li",{className:"".concat(O,"-total-text")},ne(H,[H===0?0:(Ge-1)*Ue+1,Ge*Ue>H?H:Ge*Ue])));var Ie=!this.hasPrev()||!He,Me=!this.hasNext()||!He;return c.a.createElement("ul",Object(le.a)({className:d()(O,A,Object(Q.a)({},"".concat(O,"-disabled"),I)),style:D,unselectable:"unselectable",ref:this.savePaginationNode},J),Be,c.a.createElement("li",{title:X?te.prev_page:null,onClick:this.prev,tabIndex:Ie?null:0,onKeyPress:this.runIfEnterPrev,className:d()("".concat(O,"-prev"),Object(Q.a)({},"".concat(O,"-disabled"),Ie)),"aria-disabled":Ie},this.renderPrev(q)),be,c.a.createElement("li",{title:X?te.next_page:null,onClick:this.next,tabIndex:Me?null:0,onKeyPress:this.runIfEnterNext,className:d()("".concat(O,"-next"),Object(Q.a)({},"".concat(O,"-disabled"),Me)),"aria-disabled":Me},this.renderNext($)),c.a.createElement(h,{disabled:I,locale:te,rootPrefixCls:O,selectComponentClass:Se,selectPrefixCls:Pe,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:Ge,pageSize:Ue,pageSizeOptions:ye,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);m.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:f,totalBoundaryShowSizeChanger:50};var _=m},"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 b=P,T=[],C=0;C<256;++C)T.push((C+256).toString(16).substr(1));function c(a){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=(T[a[u+0]]+T[a[u+1]]+T[a[u+2]]+T[a[u+3]]+"-"+T[a[u+4]]+T[a[u+5]]+"-"+T[a[u+6]]+T[a[u+7]]+"-"+T[a[u+8]]+T[a[u+9]]+"-"+T[a[u+10]]+T[a[u+11]]+T[a[u+12]]+T[a[u+13]]+T[a[u+14]]+T[a[u+15]]).toLowerCase();if(!b(s))throw TypeError("Stringified UUID is invalid");return s}var p=c;function d(a,u,s){a=a||{};var h=a.random||(a.rng||j)();if(h[6]=h[6]&15|64,h[8]=h[8]&63|128,u){s=s||0;for(var i=0;i<16;++i)u[s+i]=h[i];return u}return p(h)}var o=Ve.a=d},"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"),b=z("Vl3Y"),T=z("tJVT"),C=z("OaEy"),c=z("2fM7"),p=z("q1tI"),d=z.n(p),o=z("VrN/"),a=z.n(o),u=z("p77/"),s=z.n(u),h=z("c5Ni"),i=z.n(h),n=c.a.Option,t={labelCol:{span:4},wrapperCol:{span:20}},f={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(m){var _=m.callback,E=m.onCancel,g=Object(p.useState)("python"),y=Object(T.a)(g,2),x=y[0],l=y[1];function S(A){l(f[A][1])}function O(A){_(A)}return d.a.createElement(b.a,Object(Q.a)({},t,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:O}),d.a.createElement(b.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},d.a.createElement(c.a,{onChange:S},Object.keys(f).map(function(A){return d.a.createElement(n,{key:A,value:A},f[A][0])}))),d.a.createElement(b.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},d.a.createElement(v,{mode:x})),d.a.createElement("div",{className:"flex-container flex-end"},d.a.createElement(w.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),d.a.createElement(w.a,{type:"ghost",onClick:E},"\u53D6\u6D88")))};function v(m){var _=m.value,E=m.onChange,g=m.mode,y=m.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",g)},[A,g]),Object(p.useEffect)(function(){A&&((_!==A.getValue()||_==="")&&setTimeout(function(){A.setValue(_||" ")},300))},[A,_]),Object(p.useEffect)(function(){if(l.current&&!A){var I=a.a.fromTextArea(l.current,Object(le.a)({mode:g,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},x));D(I)}},[l.current,A]),d.a.createElement("div",{className:"my-codemirror-container"},d.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 b}),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 d}),z.d(Ve,"w",function(){return o}),z.d(Ve,"u",function(){return a}),z.d(Ve,"p",function(){return u}),z.d(Ve,"f",function(){return s}),z.d(Ve,"a",function(){return h}),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 f}),z.d(Ve,"c",function(){return v}),z.d(Ve,"e",function(){return m}),z.d(Ve,"i",function(){return _}),z.d(Ve,"r",function(){return E});var le=z("ErOA");function Q(g){return Object(le.c)("mypractices/".concat(g,".json"),{hidePopLogin:!0})}function j(g,y){return Object(le.f)("mypractices/".concat(g,"/code_submit.json"),y)}function w(g,y){return Object(le.c)("mypractices/".concat(g,"/code_debug.json"),y)}function P(g,y){return Object(le.c)("mypractices/".concat(g,"/submit_records.json"),y)}function b(g){return Object(le.c)("mypractices/record_detail.json",{id:g})}function T(g,y){return Object(le.c)("mypractices/".concat(g,"/result.json"),{mode:y})}function C(g,y){return Object(le.f)("mypractices/".concat(g,"/add_notes.json"),y)}function c(g,y){return Object(le.f)("mypractices/".concat(g,"/restore_initial_code.json"),y)}function p(g,y){return Object(le.f)("mypractices/".concat(g,"/sync_code.json"),y)}function d(g,y){return Object(le.f)("mypractices/".concat(g,"/update_code.json"),y)}function o(g){return Object(le.f)("mypractices/".concat(g,"/initial_codes.json"))}function a(g,y){return Object(le.f)("discusses/".concat(g,"/plus.json"),y)}function u(g){return Object(le.c)("practices/practices_list.json",g)}function s(g,y){return Object(le.c)("practices/".concat(g,"/question_solution_articles"),y)}function h(g,y){return Object(le.f)("practices/".concat(g,"/question_solution_articles"),y)}function i(g,y){return Object(le.g)("practices/".concat(g,"/question_solution_articles/").concat(y==null?void 0:y.active),y)}function n(g,y){return Object(le.c)("practices/".concat(g,"/question_solution_articles/").concat(y==null?void 0:y.active,"/edit"),y)}function t(g,y){return Object(le.c)("practices/".concat(g,"/question_solution_articles/").concat(y==null?void 0:y.active),y)}function f(g,y){return Object(le.f)("practices/".concat(g,"/question_solution_articles/").concat(y==null?void 0:y.active,"/set_authority_or_excellent"),y)}function v(g,y){return Object(le.f)("practices/".concat(g,"/question_solution_articles/").concat(y==null?void 0:y.active,"/praise_or_treads"),y)}function m(g,y){return Object(le.f)("practices/".concat(g,"/question_solution_articles/").concat(y==null?void 0:y.active,"/hide"))}function _(g,y){return Object(le.b)("practices/".concat(g,"/question_solution_articles/").concat(y==null?void 0:y.active),y)}function E(g,y){return Object(le.f)("mypractices/".concat(g,"/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 u});var le=z("KQm4"),Q=z("VTBJ"),j=z("Ff2n"),w=z("Zm9Q"),P=z("Kwbf"),b=z("OZM5");function T(s,h){return s!=null?s:h}function C(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],h=new Map;function i(n){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(n||[]).forEach(function(f){var v=f.key,m=f.children;Object(P.a)(v!=null,"Tree node must have a certain key: [".concat(t).concat(v,"]"));var _=String(v);Object(P.a)(!h.has(_)||v===null||v===void 0,"Same 'key' exist in the Tree: ".concat(_)),h.set(_,!0),i(m,"".concat(t).concat(_," > "))})}i(s)}function c(s){function h(i){var n=Object(w.a)(i);return n.map(function(t){if(!Object(b.i)(t))return Object(P.a)(!t,"Tree/TreeNode can only accept TreeNode as children."),null;var f=t.key,v=t.props,m=v.children,_=Object(j.a)(v,["children"]),E=Object(Q.a)({key:f},_),g=h(m);return g.length&&(E.children=g),E}).filter(function(t){return t})}return h(s)}function p(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=new Set(h===!0?[]:h),n=[];function t(f){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return f.map(function(m,_){var E=Object(b.h)(v?v.pos:"0",_),g=T(m.key,E),y=Object(Q.a)(Object(Q.a)({},m),{},{parent:v,pos:E,children:null,data:m,isStart:[].concat(Object(le.a)(v?v.isStart:[]),[_===0]),isEnd:[].concat(Object(le.a)(v?v.isEnd:[]),[_===f.length-1])});return n.push(y),h===!0||i.has(g)?y.children=t(m.children||[],y):y.children=[],y})}return t(s),n}function d(s,h,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,m){return T(v.key,m)};function t(f,v,m){var _=f?f.children:s,E=f?Object(b.h)(m.pos,v):"0";if(f){var g=n(f,E),y={node:f,index:v,pos:E,key:g,parentPos:m.node?m.pos:null,level:m.level+1};h(y)}_&&_.forEach(function(x,l){t(x,l,{node:f,pos:E,level:m?m.level+1:-1})})}t(null)}function o(s){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=h.initWrapper,n=h.processEntity,t=h.onProcessFinished,f=arguments.length>2?arguments[2]:void 0,v={},m={},_={posEntities:v,keyEntities:m};return i&&(_=i(_)||_),d(s,function(E){var g=E.node,y=E.index,x=E.pos,l=E.key,S=E.parentPos,O=E.level,A={node:g,index:y,key:l,pos:x,level:O},D=T(l,x);v[x]=A,m[D]=A,A.parent=v[S],A.parent&&(A.parent.children=A.parent.children||[],A.parent.children.push(A)),n&&n(A,_)},f),t&&t(_),_}function a(s,h){var i=h.expandedKeys,n=h.selectedKeys,t=h.loadedKeys,f=h.loadingKeys,v=h.checkedKeys,m=h.halfCheckedKeys,_=h.dragOverNodeKey,E=h.dropPosition,g=h.keyEntities,y=g[s],x={eventKey:s,expanded:i.indexOf(s)!==-1,selected:n.indexOf(s)!==-1,loaded:t.indexOf(s)!==-1,loading:f.indexOf(s)!==-1,checked:v.indexOf(s)!==-1,halfChecked:m.indexOf(s)!==-1,pos:String(y?y.pos:""),dragOver:_===s&&E===0,dragOverGapTop:_===s&&E===-1,dragOverGapBottom:_===s&&E===1};return x}function u(s){var h=s.data,i=s.expanded,n=s.selected,t=s.checked,f=s.loaded,v=s.loading,m=s.halfChecked,_=s.dragOver,E=s.dragOverGapTop,g=s.dragOverGapBottom,y=s.pos,x=s.active,l=Object(Q.a)(Object(Q.a)({},h),{},{expanded:i,selected:n,checked:t,loaded:f,loading:v,halfChecked:m,dragOver:_,dragOverGapTop:E,dragOverGapBottom:g,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?pe.slice(ae.length):pe}).join(` `)}var i=[],n=["
    "],t=new u.a.Renderer,f=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function v(){i.length=0,n=["
      "]}var m={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function _(ie,N,F,ae){if(N>=ie.length||ie[N].level<=F)return N;var pe=ie[N];ae.push("
    • "+pe.text+""),N++;var se=[];return N=_(ie,N,pe.level,se),se.length>0&&(ae.push("
        "),se.forEach(function($e){ae.push($e)}),ae.push("
      ")),ae.push("
    • "),N=_(ie,N,F,ae),N}function E(){return _(i,0,0,n),n.push("
    "),n.join("")}var g={heading:function(N){var F=f.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],pe=h(ae,F[3]||""),se=F[2]?F[2].trim():F[2];if(["latex","katex","math"].indexOf(se)>=0){var $e=l(),_t=pe;pe=$e,S[$e]={type:"block",expression:_t}}return{type:"code",raw:ae,lang:se,text:pe}}}},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+""},u.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),u.a.use({tokenizer:g,renderer:t});var te=u.a,W=z("SJMd"),V=z("ulZh"),X=z.n(V),ne=z("m3rI"),Y=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 pe in ae)Object.prototype.hasOwnProperty.call(ae,pe)&&(F[pe]=ae[pe])})(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(pe,se){function $e(Vt){try{it(ae.next(Vt))}catch(At){se(At)}}function _t(Vt){try{it(ae.throw(Vt))}catch(At){se(At)}}function it(Vt){var At;Vt.done?pe(Vt.value):(At=Vt.value,At instanceof F?At:new F(function(Bt){Bt(At)})).then($e,_t)}it((ae=ae.apply(ie,N||[])).next())})}function Pe(ie,N){var F,ae,pe,se,$e={label:0,sent:function(){if(1&pe[0])throw pe[1];return pe[1]},trys:[],ops:[]};return se={next:_t(0),throw:_t(1),return:_t(2)},typeof Symbol=="function"&&(se[Symbol.iterator]=function(){return this}),se;function _t(it){return function(Vt){return function(At){if(F)throw new TypeError("Generator is already executing.");for(;$e;)try{if(F=1,ae&&(pe=2&At[0]?ae.return:At[0]?ae.throw||((pe=ae.return)&&pe.call(ae),0):ae.next)&&!(pe=pe.call(ae,At[1])).done)return pe;switch(ae=0,pe&&(At=[2&At[0],pe.value]),At[0]){case 0:case 1:pe=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(!(pe=$e.trys,(pe=pe.length>0&&pe[pe.length-1])||At[0]!==6&&At[0]!==2)){$e=0;continue}if(At[0]===3&&(!pe||At[1]>pe[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 pe=document.createElement("div");pe.className=this.toolbarBlockStyleClass.name,pe.style.whiteSpace="nowrap",pe.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(pe),this.addActionButton(pe,'',"render"),this.addActionButton(pe,'',"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}(),ze=function(){function ie(N,F,ae,pe){this.panels=[],this.panelButtons=[],this.markerjsContainer=N,this.displayMode=F,this.uiStyleSettings=ae,this.styles=pe,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return ie.prototype.addStyles=function(){var N;this.toolboxStyleClass=this.styles.addClass(new me("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 me("toolbox_colors",` color: `+this.uiStyleSettings.toolboxColor+`; `));var F=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new me("toolbox-button-row",` display: flex; cursor: default; box-sizing: content-box; `)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new me("toolbox-button-row_colors",` background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`; `)),this.toolboxPanelRowStyleClass=this.styles.addClass(new me("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 me("toolbox-panel-row_colors",` background-color: `+((N=this.uiStyleSettings.toolboxBackgroundColor)!==null&&N!==void 0?N:this.uiStyleSettings.toolbarBackgroundHoverColor)+`; `)),this.toolboxButtonStyleClass=this.styles.addClass(new me("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 me("toolbox-button_colors",` fill: `+this.uiStyleSettings.toolbarColor+`; `)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new me("toolbox-active-button_colors",` background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`; fill: `+this.uiStyleSettings.toolbarColor+`; `)),this.styles.addRule(new be("."+this.toolboxButtonStyleColorsClass.name+":hover",` background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+` `)),this.styles.addRule(new be("."+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,pe=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=pe.uiStyleSettings;var _t=document.createElement("div");_t.className=pe.toolboxButtonStyleClass.name+" "+(($e=pe.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&$e!==void 0?$e:pe.toolboxButtonStyleColorsClass.name),_t.innerHTML=se.icon,_t.title=se.title,_t.addEventListener("click",function(){pe.panelButtonClick(se)}),pe.panelButtons.push(_t),pe.buttonRow.appendChild(_t)}),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 pe=N.getUi();pe.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(pe),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 _t,it;se.className=F.toolboxButtonStyleClass.name+" "+($e===ae?""+((_t=F.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&_t!==void 0?_t: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,pe,se){var $e=ie.call(this,F,se||'')||this;return $e.colors=[],$e.addTransparent=!1,$e.colorBoxes=[],$e.colors=ae,$e.currentColor=pe,$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(pe){var se=F.getColorBox(pe);ae.appendChild(se),F.colorBoxes.push(se)}),ae},N.prototype.getColorBox=function(F){var ae=this,pe=this.uiStyleSettings.toolbarHeight/4,se=this.uiStyleSettings.toolbarHeight-pe,$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 _t=document.createElement("div");return _t.style.display="inline-block",_t.style.width=se-2+"px",_t.style.height=se-2+"px",_t.style.backgroundColor=F,_t.style.borderRadius=se/2+"px",F==="transparent"&&(_t.style.fill=this.uiStyleSettings.toolboxAccentColor,_t.innerHTML=` `),$e.appendChild(_t),$e},N.prototype.setCurrentColor=function(F,ae){var pe=this;this.currentColor=F,this.colorBoxes.forEach(function(se){se.style.borderColor=se===ae?pe.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=Ee.createGroup(),this.visual.appendChild(Ee.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Ee.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}(),$=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,pe){var se=ie.call(this,F,ae,pe)||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(Ee.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=Ee.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 pe=this.unrotatePoint(F);if(this.manipulationStartX=pe.x,this.manipulationStartY=pe.y,this.offsetX=pe.x-this.left,this.offsetY=pe.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,pe=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,pe=this.manipulationStartWidth+this.manipulationStartLeft-ae;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:pe=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}pe>=0?(this.left=ae,this.width=pe):(this.left=ae+pe,this.width=-pe),$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(),pe=Ee.createPoint(F.x,F.y);return{x:(pe=pe.matrixTransform(ae)).x,y:pe.y}},N.prototype.unrotatePoint=function(F){if(this.rotationAngle===0)return F;var ae=this.container.getCTM();ae=ae.inverse();var pe=Ee.createPoint(F.x,F.y);return{x:(pe=pe.matrixTransform(ae)).x,y:pe.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=Ee.createGroup();var F=Ee.createTransform();F.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(F),this.container.appendChild(this.controlBox),this.controlRect=Ee.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=Ee.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(Ee.createTransform()),this.controlBox.appendChild(F.visual),F},N.prototype.positionGrips=function(){var F=this.controlGrips.topLeft.GRIP_SIZE,ae=-F/2,pe=ae,se=(this.width+this.CB_DISTANCE)/2-F/2,$e=(this.height+this.CB_DISTANCE)/2-F/2,_t=this.height+this.CB_DISTANCE-F/2,it=this.width+this.CB_DISTANCE-F/2;this.positionGrip(this.controlGrips.topLeft.visual,ae,pe),this.positionGrip(this.controlGrips.topCenter.visual,se,pe),this.positionGrip(this.controlGrips.topRight.visual,it,pe),this.positionGrip(this.controlGrips.centerLeft.visual,ae,$e),this.positionGrip(this.controlGrips.centerRight.visual,it,$e),this.positionGrip(this.controlGrips.bottomLeft.visual,ae,_t),this.positionGrip(this.controlGrips.bottomCenter.visual,se,_t),this.positionGrip(this.controlGrips.bottomRight.visual,it,_t),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,se,pe-3*this.CB_DISTANCE)},N.prototype.positionGrip=function(F,ae,pe){var se=F.transform.baseVal.getItem(0);se.setTranslate(ae,pe),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:$.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:$.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($.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,ae.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix($.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,ae.containerTransformMatrix))},N.prototype.scale=function(F,ae){ie.prototype.scale.call(this,F,ae);var pe=this.rotatePoint({x:this.left,y:this.top}),se=this.unrotatePoint({x:pe.x*F,y:pe.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,pe){var se=ie.call(this,F,ae,pe)||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=Ee.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),Ee.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&&Ee.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(F),this.stateChanged()},N.prototype.setFillColor=function(F){this.fillColor=F,this.visual&&Ee.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},N.prototype.setStrokeWidth=function(F){this.strokeWidth=F,this.visual&&Ee.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},N.prototype.setStrokeDasharray=function(F){this.strokeDasharray=F,this.visual&&Ee.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,pe,se){var $e=ie.call(this,F,se||'')||this;return $e.widths=[],$e.widthBoxes=[],$e.widths=ae,$e.currentWidth=pe,$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(pe){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=pe===F.currentWidth?F.uiStyleSettings.toolboxAccentColor:"transparent",se.addEventListener("click",function(){F.setCurrentWidth(pe,se)}),ae.appendChild(se);var $e=document.createElement("div");$e.innerText=pe.toString(),$e.style.marginRight="5px",se.appendChild($e);var _t=document.createElement("div");_t.style.minHeight="20px",_t.style.flexGrow="2",_t.style.display="flex",_t.style.alignItems="center";var it=document.createElement("hr");it.style.minWidth="20px",it.style.border="0px",it.style.borderTop=pe+"px solid "+F.uiStyleSettings.toolboxColor,it.style.flexGrow="2",_t.appendChild(it),se.appendChild(_t),F.widthBoxes.push(se)}),ae},N.prototype.setCurrentWidth=function(F,ae){var pe=this;this.currentWidth=F,this.widthBoxes.forEach(function(se){se.style.borderColor=se===ae?pe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},N}(nt),dt=function(ie){function N(F,ae,pe,se){var $e=ie.call(this,F,se||'')||this;return $e.styles=[],$e.styleBoxes=[],$e.styles=ae,$e.currentStyle=pe,$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(pe){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=pe===F.currentStyle?F.uiStyleSettings.toolboxAccentColor:"transparent",se.addEventListener("click",function(){F.setCurrentStyle(pe,se)}),ae.appendChild(se);var $e=document.createElement("div");$e.style.minHeight="20px",$e.style.flexGrow="2",$e.style.overflow="hidden";var _t=` `;$e.innerHTML=_t,se.appendChild($e),F.styleBoxes.push(se)}),ae},N.prototype.setCurrentStyle=function(F,ae){var pe=this;this.currentStyle=F,this.styleBoxes.forEach(function(se){se.style.borderColor=se===ae?pe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},N}(nt),Ne=function(ie){function N(F,ae,pe){var se=ie.call(this,F,ae,pe)||this;return se.strokeColor=pe.defaultColor,se.strokeWidth=pe.defaultStrokeWidth,se.strokeDasharray=pe.defaultStrokeDasharray,se.strokePanel=new re("Line color",pe.defaultColorSet,pe.defaultColor),se.strokePanel.onColorChanged=se.setStrokeColor,se.strokeWidthPanel=new ke("Line width",pe.defaultStrokeWidths,pe.defaultStrokeWidth),se.strokeWidthPanel.onWidthChanged=se.setStrokeWidth,se.strokeStylePanel=new dt("Line style",pe.defaultStrokeDasharrays,pe.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,pe){var se=ie.call(this,F,ae,pe)||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=Ee.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(Ee.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,pe){var se=F.transform.baseVal.getItem(0);se.setTranslate(ae,pe),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,pe){var se=ie.call(this,F,ae,pe)||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=pe.defaultColor,se.strokeWidth=pe.defaultStrokeWidth,se.strokeDasharray=pe.defaultStrokeDasharray,se.strokePanel=new re("Line color",pe.defaultColorSet,pe.defaultColor),se.strokePanel.onColorChanged=se.setStrokeColor,se.strokeWidthPanel=new ke("Line width",pe.defaultStrokeWidths,pe.defaultStrokeWidth),se.strokeWidthPanel.onWidthChanged=se.setStrokeWidth,se.strokeStylePanel=new dt("Line style",pe.defaultStrokeDasharrays,pe.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=Ee.createGroup(),this.selectorLine=Ee.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=Ee.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()),Ee.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),Ee.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),Ee.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,pe,se){var $e=ie.call(this,F,se||'')||this;return $e.fonts=[],$e.fontBoxes=[],$e.fonts=ae,$e.currentFont=pe,$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(pe){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=pe===F.currentFont?F.uiStyleSettings.toolboxAccentColor:"transparent",se.addEventListener("click",function(){F.setCurrentFont(pe,se)}),ae.appendChild(se);var $e=document.createElement("div");$e.style.display="flex",$e.style.minHeight="20px",$e.style.flexGrow="2",$e.style.fontFamily=pe,$e.style.overflow="hidden";var _t=document.createElement("div");_t.style.whiteSpace="nowrap",_t.style.overflow="hidden",_t.style.textOverflow="ellipsis",_t.innerHTML="The quick brown fox jumps over the lazy dog",$e.appendChild(_t),se.appendChild($e),F.fontBoxes.push(se)}),ae},N.prototype.setCurrentFont=function(F,ae){var pe=this;this.currentFont=F,this.fontBoxes.forEach(function(se){se.style.borderColor=se===ae?pe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},N}(nt),Xe=function(ie){function N(F,ae,pe){var se=ie.call(this,F,ae,pe)||this;return se.color="transparent",se.padding=5,se.DEFAULT_TEXT="your text here",se.text=se.DEFAULT_TEXT,se.isMoved=!1,se.color=pe.defaultColor,se.fontFamily=pe.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",pe.defaultColorSet,pe.defaultColor),se.colorPanel.onColorChanged=se.setColor,se.fontFamilyPanel=new Qe("Font",pe.defaultFontFamilies,pe.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(pe){pe===F&&(ae=!0)}),ae},N.prototype.createVisual=function(){this.visual=Ee.createGroup(),this.bgRectangle=Ee.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=Ee.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(Ee.createTransform()),this.textElement.transform.baseVal.appendItem(Ee.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(Ee.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 pe=(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(pe,se)}return ae},N.prototype.getTextPosition=function(F){var ae=this.textElement.getBBox(),pe=0,se=0;return ae.width>0&&ae.height>0&&(pe=(this.width-ae.width*F)/2,se=this.height/2-ae.height*F/2),{x:pe,y:se}},N.prototype.sizeText=function(){var F=this.textElement.getBBox(),ae=this.getTextScale(),pe=this.getTextPosition(ae);pe.y-=F.y*ae,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+pe.x+"px, "+pe.y+"px) scale("+ae+", "+ae+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(pe.x,pe.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&&(Ee.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),Ee.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 pe=ae.clipboardData.getData("text"),se=window.getSelection();if(!se.rangeCount)return!1;se.deleteFromDocument(),se.getRangeAt(0).insertNode(document.createTextNode(pe)),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}),pe=this.textElement.getBBox(),se={x:pe.width*F,y:pe.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&&Ee.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&&Ee.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),Be=function(ie){function N(F,ae,pe){var se=ie.call(this,F,ae,pe)||this;return se.color="transparent",se.lineWidth=3,se.drawing=!1,se.pixelRatio=1,se.color=pe.defaultColor,se.lineWidth=pe.defaultStrokeWidth,se.pixelRatio=pe.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",pe.defaultColorSet,pe.defaultColor),se.colorPanel.onColorChanged=se.setColor,se.lineWidthPanel=new ke("Line width",pe.defaultStrokeWidths,pe.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=Ee.createGroup(),this.drawingImage=Ee.createImage(),this.visual.appendChild(this.drawingImage);var F=Ee.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),Ee.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),Ee.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],pe=ae[0],se=ae[1],$e=ae[2],_t=ae[3],it=!1,Vt=0;Vt0&&(it=!0,Vt_t&&(_t=Vt),At>$e&&($e=At));if(it){this.left=pe/this.pixelRatio,this.top=se/this.pixelRatio,this.width=($e-pe)/this.pixelRatio,this.height=(_t-se)/this.pixelRatio;var Bt=document.createElement("canvas");Bt.width=$e-pe,Bt.height=_t-se,Bt.getContext("2d").putImageData(this.canvasContext.getImageData(pe,se,$e-pe,_t-se),0,0),this.drawingImgUrl=Bt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},N.prototype.setDrawingImage=function(){Ee.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),Ee.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,pe){var se=ie.call(this,F,pe||'')||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 pe=function(_t){var it="both";switch(_t){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 Bt=document.createElement("div");Bt.style.display="flex",Bt.style.alignItems="center",Bt.style.minHeight="20px",Bt.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",Bt.appendChild(on),Vt.appendChild(Bt),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++)pe($e);return ae},N.prototype.setCurrentType=function(F,ae){var pe=this;this.currentType=F,this.typeBoxes.forEach(function(se){se.style.borderColor=se===ae?pe.uiStyleSettings!==void 0?pe.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},N}(nt),Me=function(ie){function N(F,ae,pe){var se=ie.call(this,F,ae,pe)||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 pe=this.arrowBaseWidth+2*this.strokeWidth,se=this.arrowBaseHeight+2*this.strokeWidth;return F-pe/2+","+(ae+se/2)+" "+F+","+(ae-se/2)+" "+(F+pe/2)+","+(ae+se/2)},N.prototype.createTips=function(){this.arrow1=Ee.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(Ee.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=Ee.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(Ee.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",Ee.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),Ee.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 pe=this.arrow2.transform.baseVal.getItem(0);pe.setRotate(F+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(pe,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),_e=function(ie){function N(F,ae,pe){var se=ie.call(this,F,ae,pe)||this;return se.fillColor=pe.defaultFillColor,se.strokeWidth=0,se.fillPanel=new re("Color",pe.defaultColorSet,pe.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,pe,se){var $e=ie.call(this,F,se||'')||this;return $e.opacities=[],$e.opacityBoxes=[],$e.opacities=ae,$e.currentOpacity=pe,$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(pe){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=pe===F.currentOpacity?F.uiStyleSettings.toolboxAccentColor:"transparent",se.addEventListener("click",function(){F.setCurrentOpacity(pe,se)}),ae.appendChild(se);var $e=document.createElement("div");$e.innerText=100*pe+"%",se.appendChild($e),F.opacityBoxes.push(se)}),ae},N.prototype.setCurrentOpacity=function(F,ae){var pe=this;this.currentOpacity=F,this.opacityBoxes.forEach(function(se){se.style.borderColor=se===ae?pe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},N}(nt),Le=function(ie){function N(F,ae,pe){var se=ie.call(this,F,ae,pe)||this;return se.setOpacity=se.setOpacity.bind(se),se.fillColor=pe.defaultHighlightColor,se.strokeWidth=0,se.opacity=pe.defaultHighlightOpacity,se.fillPanel=new re("Color",pe.defaultColorSet,se.fillColor),se.fillPanel.onColorChanged=se.setFillColor,se.opacityPanel=new Ae("Opacity",pe.defaultOpacitySteps,se.opacity),se.opacityPanel.onOpacityChanged=se.setOpacity,se}return Ce(N,ie),N.prototype.setOpacity=function(F){this.opacity=F,this.visual&&Ee.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}(_e),Te='',Ze=function(ie){function N(F,ae,pe){var se=ie.call(this,F,ae,pe)||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=pe.defaultStrokeColor,se.bgColor=pe.defaultFillColor,se.fontFamily=pe.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",pe.defaultColorSet,se.color,''),se.colorPanel.onColorChanged=se.setColor,se.bgColorPanel=new re("Fill color",pe.defaultColorSet,se.bgColor,Te),se.bgColorPanel.onColorChanged=se.setBgColor,se.fontFamilyPanel=new Qe("Font",pe.defaultFontFamilies,pe.defaultFontFamily),se.fontFamilyPanel.onFontChanged=se.setFont,se.tipGrip=new q,se.tipGrip.visual.transform.baseVal.appendItem(Ee.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(){Ee.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=Ee.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&&(Ee.setAttributes(this.bgRectangle,[["fill",F]]),Ee.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),pe=this.height/5;F&&(this.tipPosition={x:ae+pe/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 pe=this.tip2.transform.baseVal.getItem(0);pe.setRotate(F+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(pe,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,pe){var se=ie.call(this,F,ae,pe)||this;return se.strokePanel.colors=pe.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,pe){var se=ie.call(this,F,ae,pe)||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=pe.defaultColor,se.strokeWidth=pe.defaultStrokeWidth,se.strokeDasharray=pe.defaultStrokeDasharray,se.strokePanel=new re("Line color",pe.defaultColorSet,pe.defaultColor),se.strokePanel.onColorChanged=se.setStrokeColor,se.strokeWidthPanel=new ke("Line width",pe.defaultStrokeWidths,pe.defaultStrokeWidth),se.strokeWidthPanel.onWidthChanged=se.setStrokeWidth,se.strokeStylePanel=new dt("Line style",pe.defaultStrokeDasharrays,pe.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=Ee.createGroup(),this.selectorCurve=Ee.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=Ee.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()),Ee.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),Ee.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),Ee.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},N.prototype.setupControlBox=function(){ie.prototype.setupControlBox.call(this),this.curveControlLine1=Ee.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=Ee.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,pe){var se=ie.call(this,F,!1)||this;return se.dataUrl=ae,se.state=pe,se}return Ce(N,ie),N}(Lt),pt=function(ie){function N(F,ae,pe){pe===void 0&&(pe=!1);var se=ie.call(this,F,pe)||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}(),De=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 He(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[Ne,Be,Me,Xe,Ht,ut,Le,Ze,Ct,_e,mt,bt]},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[Ne,Be,Me,Xe,ut,Le,Ze]},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"BASIC_MARKER_TYPES",{get:function(){return[Ne,Be,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 pe=F.ALL_MARKER_TYPES.find(function(se){return se.typeName===ae});pe!==void 0&&F._availableMarkerTypes.push(pe)}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(),Ge.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},ie.prototype.show=function(){var N=this;this.styles.styleSheetRoot===void 0&&Fe.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=Fe.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 Pe(this,function(F){switch(F.label){case 0:return this.setCurrentMarker(),(N=new Ue).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(pe){var se=new Lt(F,!0);pe(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(pe){return pe(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(pe){var se=new pt(N,N._currentMarker,!0);pe(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(pe){return pe(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 _t=new pt(N,void 0,!0);$e(_t),_t.defaultPrevented&&(F=!0)}),!F)){this.setCurrentMarker();for(var ae=function($e){var _t=pe.markers[$e];pe.setCurrentMarker(pe.markers[$e]),pe._currentMarker.dispose(),pe.markerImage.removeChild(pe._currentMarker.container),pe.markers.splice(pe.markers.indexOf(pe._currentMarker),1),pe.eventListeners.markerdelete.forEach(function(it){return it(new pt(N,_t))})},pe=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 pe=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(F),pe1&&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){Ge.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 Ke=function(ie,N){return(Ke=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(F,ae){F.__proto__=ae}||function(F,ae){for(var pe in ae)Object.prototype.hasOwnProperty.call(ae,pe)&&(F[pe]=ae[pe])})(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}Ke(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(pe,se){function $e(Vt){try{it(ae.next(Vt))}catch(At){se(At)}}function _t(Vt){try{it(ae.throw(Vt))}catch(At){se(At)}}function it(Vt){var At;Vt.done?pe(Vt.value):(At=Vt.value,At instanceof F?At:new F(function(Bt){Bt(At)})).then($e,_t)}it((ae=ae.apply(ie,N||[])).next())})}function kt(ie,N){var F,ae,pe,se,$e={label:0,sent:function(){if(1&pe[0])throw pe[1];return pe[1]},trys:[],ops:[]};return se={next:_t(0),throw:_t(1),return:_t(2)},typeof Symbol=="function"&&(se[Symbol.iterator]=function(){return this}),se;function _t(it){return function(Vt){return function(At){if(F)throw new TypeError("Generator is already executing.");for(;$e;)try{if(F=1,ae&&(pe=2&At[0]?ae.return:At[0]?ae.throw||((pe=ae.return)&&pe.call(ae),0):ae.next)&&!(pe=pe.call(ae,At[1])).done)return pe;switch(ae=0,pe&&(At=[2&At[0],pe.value]),At[0]){case 0:case 1:pe=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(!(pe=$e.trys,(pe=pe.length>0&&pe[pe.length-1])||At[0]!==6&&At[0]!==2)){$e=0;continue}if(At[0]===3&&(!pe||At[1]>pe[0]&&At[1]0&&F>0){var ae=new oe(N,F),pe=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 _t=rt.createDefs();$e.appendChild(_t);var it=rt.createElement("clipPath",[["id","text-bg-clip"]]);_t.appendChild(it);var Vt=rt.createPath(rt.getHollowRectanglePath((24-pe)/2,(24-se)/2,pe,se,(24-pe)/2+2,(24-se)/2+2,pe-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 Bt=At.getBBox();rt.setAttributes(At,[["x",((24-Bt.width)/2).toString()],["y",((24-Bt.height)/2-Bt.y).toString()]]);var on=rt.createPath(rt.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Bt.width))/2,(24-Math.ceil(Bt.height))/2,Math.ceil(Bt.width),Math.ceil(Bt.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,pe){var se=ie.call(this,F,ae)||this;return se.isDropdownOpen=!1,se.onClick=se.dropdownButtonClicked,se.dropdownButtons=pe,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,pe){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=pe,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 _t=F.y+ae*($e+1);rt.setAttributes(se,[["x1",""+F.x],["y1",""+_t],["x2",""+(F.x+F.width)],["y2",""+_t]])});var pe=F.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(se,$e){var _t=F.x+pe*($e+1);rt.setAttributes(se,[["x1",""+_t],["y1",""+F.y],["x2",""+_t],["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,pe=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+=pe,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+=pe}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),pe=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,pe,se,$e){var _t=ae/N,it=pe/F;return{x:(se.x-$e)*_t+$e,y:(se.y-$e)*it+$e,width:se.width*_t,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 pe=ae%5==0?this.height/3:this.height/6;F+="h4v"+-pe+"h1v"+pe}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,pe,se,$e,_t){var it=this;return new Promise(function(Vt){var At=document.createElement("canvas");At.width=N.width.baseVal.value-2*pe,At.height=N.height.baseVal.value-2*pe;var Bt=1,on=1;it.naturalSize===!0?(Bt=F.naturalWidth/(N.width.baseVal.value-2*pe)/$e,on=F.naturalHeight/(N.height.baseVal.value-2*pe)/_t,At.width=F.naturalWidth/$e,At.height=F.naturalHeight/_t):it.width!==void 0&&it.height!==void 0&&(Bt=it.width/ae.width,on=it.height/ae.height,At.width*=Bt,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,_t),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*Bt,Lr.height=ae.height*on,Lr.getContext("2d").putImageData(In.getImageData((ae.x-pe)*Bt,(ae.y-pe)*on,ae.width*Bt,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 Tt(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 pe=new K('',"Toggle grid");pe.isActive=this.isGridVisible,pe.onClick=function(){N.isGridVisible=!N.isGridVisible,pe.isActive=N.isGridVisible},F.addButton(pe);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 _t=document.createElement("div");_t.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='',_t.appendChild(it),$e.addElement(_t)}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 Bt=new K('',"Close");Bt.onClick=this.close,Vt.addButton(Bt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Bt.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 pe=new K('',"Rotate right");pe.onClick=this.rotateRightButtonClicked,F.addButton(pe);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 _t=new K('',"Flip horizontal");_t.onClick=this.flipHorizontallyButtonClicked,$e.addButton(_t);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(pe){return pe(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 Ft("."+this.toolbarButtonStyleClass.name+" svg",` height: `+this.toolbarHeight/2+`px; `)),this.styles.addRule(new Ft("."+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,pe=ae===void 0?!1:ae,se=ie.className,$e=ie.showTextOnly,_t=ie.showLines,it=ie.replaces,Vt=ie.zoomImg,At=ie.hasMask,Bt=ie.style,on=Bt===void 0?{}:Bt,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 Er=Object(b.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 Er.apply(this,arguments)}}()),wn.show()},si=function(){var wn=new De(ur.current);wn.settings.displayMode="popup",wn.addEventListener("render",function(){var Er=Object(b.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 Er.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,Er=/\(\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(Er,'"'+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(Y.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)();m.WebkitLineClamp=_t,_t&&(on=Object(P.a)(Object(P.a)({},on),m));function _i(Fn){var wn=Fn.target;if(wn.tagName.toUpperCase()==="IMG"){if(Vt){var Er=wn.getAttribute("src");br(Er),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,Er=(wn=Fr.current)===null||wn===void 0?void 0:wn.querySelectorAll("video");Er==null||Er.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",_i),function(){Fr.current.removeEventListener("click",_i),A(),v()}},[Pr,Fr.current,_i]);var di=function(wn){if(!pe)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 d.a.createElement("div",{style:{position:"relative"}},d.a.createElement("div",{ref:Fr,style:Object(P.a)({},on),className:"".concat(se||""," markdown-body ").concat(nn.a.mdBody),onMouseOver:di,dangerouslySetInnerHTML:{__html:Pr}}),d.a.createElement("div",{ref:Un,className:nn.a.button},d.a.createElement(Q.a,null,d.a.createElement(w.a,{onClick:function(){return gi()}},"\u88C1\u526A"),d.a.createElement(w.a,{onClick:function(){return si()}},"\u7F16\u8F91"))),d.a.createElement("img",{ref:ur,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1,top:"-10000px"}}),d.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 b=Object(le.useRef)();Object(le.useEffect)(function(){b.current=w}),Object(le.useEffect)(function(){function T(){b.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),b=z("nWbc"),T=z.n(b),C=z("Ot1p");Ve.a=function(c){var p=c.id,d=c.activeDiscussIndex,o=c.onReplyDiscuss,a=Object(w.useState)(""),u=Object(j.a)(a,2),s=u[0],h=u[1];function i(t){h(t)}function n(){if(!s){Q.b.info("\u56DE\u590D\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7A7A!");return}o(p,s),h("")}return P.a.createElement("div",{key:p,className:"discuss-item-editor",style:{display:d===p?"block":"none",width:"100%"}},P.a.createElement(C.a,{miniToolbar:!0,startInit:d===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,b="";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 h="/api/users/".concat(w,"/video_auths.json");Object(le.a)(h,{method:"put",body:{video_id:o.videoId,title:a,file_name:a,virtual_classroom_id:b}}).then(function(i){if(i.status==-1){p.onUploadError&&p.onUploadError(o);return}var n=i.data,t=n.UploadAuth,f=n.UploadAddress,v=n.VideoId;P.setUploadAuthAndAddress(o,t,f)}).catch(function(i){P.deleteFile(P._curIndex),P.nextUpload(),console.log(i)})}else{var u="/api/users/".concat(w,"/video_auths.json"),s="";Object(le.a)(u,{method:"Post",body:{title:s+a,file_name:s+a,virtual_classroom_id:b}}).then(function(i){if(i){var n=i.data,t=n.UploadAuth,f=n.UploadAddress,v=n.VideoId;P.setUploadAuthAndAddress(o,t,f,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,u){p.onUploadFailed&&p.onUploadFailed(o),console.log("\u6587\u4EF6\u4E0A\u4F20\u5931\u8D25!")},onUploadCanceled:function(o,a,u){console.log("\u6587\u4EF6\u4E0A\u4F20\u5DF2\u6682\u505C!")},onUploadProgress:function(o,a,u){p.onUploadProgress&&p.onUploadProgress(o,a,u);var s=Math.ceil(u*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(u){var s=u.data,h=s.UploadAuth;P.resumeUploadWithAuth(h)}).catch(function(u){console.log(u)})},onUploadEnd:function(o){p.onUploadEnd&&p.onUploadEnd(o),console.log("onUploadEnd: uploaded all the files")}}),p.gotUploader&&p.gotUploader(P)}function c(p,d,o){p&&(w=p),d&&(b=d),T(o)}},BU3w:function(et,Ve,z){"use strict";z.d(Ve,"a",function(){return b});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 d;p.nonce=(d=c.csp)===null||d===void 0?void 0:d.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 b(T,C){var c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},p=j(c);if(!P.has(p)){var d=w("",c),o=d.parentNode;P.set(p,o),o.removeChild(d)}var a=Array.from(P.get(p).children).find(function(n){return n.tagName==="STYLE"&&n[Q]===C});if(a){var u,s;if(((u=c.csp)===null||u===void 0?void 0:u.nonce)&&a.nonce!==((s=c.csp)===null||s===void 0?void 0:s.nonce)){var h;a.nonce=(h=c.csp)===null||h===void 0?void 0:h.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,d){if(d!=le.Init&&d&&c.removeKeyMap("autoCloseTags"),!p)return;var o={name:"autoCloseTags"};(typeof p!="object"||p.whenClosing!==!1)&&(o["'/'"]=function(a){return b(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(),d=[],o=c.getOption("autoCloseTags"),a=0;au.ch&&(t=t.slice(0,t.length-s.end+u.ch));var _=t.toLowerCase();if(!t||s.type=="string"&&(s.end!=u.ch||!/[\"\']/.test(s.string.charAt(s.string.length-1))||s.string.length==1)||s.type=="tag"&&n.close||s.string.indexOf("/")==u.ch-s.start-1||v&&T(v,_)>-1||C(c,h.mode.xmlCurrentContext&&h.mode.xmlCurrentContext(i)||[],t,u,!0))return le.Pass;var E=typeof o=="object"&&o.emptyTags;if(E&&T(E,t)>-1){d[a]={text:"/>",newPos:le.Pos(u.line,u.ch+2)};continue}var g=m&&T(m,_)>-1;d[a]={indent:g,text:">"+(g?` `:"")+"",newPos:g?le.Pos(u.line+1,0):le.Pos(u.line,u.ch+1)}}for(var y=typeof o=="object"&&o.dontIndentOnAutoClose,a=p.length-1;a>=0;a--){var x=d[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 d=c.listSelections(),o=[],a=p?"/":""&&(v+=">"),o[h]=v}if(c.replaceSelections(o),d=c.listSelections(),!s)for(var h=0;h=0&&p[i]==d;i--)++h;o=s.to;for(var i=1;i0){for(var p=0;p1&&arguments[1]!==void 0?arguments[1]:"",p=[],d=0;d=0;p--){var d=j().key(p);c(w(d),d)}}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 b(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},m={},_=4,E=.1;function g(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?_:0,V=I.length+W*2,X=Math.floor(H*E),ne=V/H,Y=(B.width||X)*ne,ee=(B.height||X)*ne,ce=B.x==null?I.length/2-Y/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),Pe=Math.floor(de),ye=Math.ceil(Y+ce-Se),Ee=Math.ceil(ee+de-Pe);Ce={x:Se,y:Pe,w:ye,h:Ee}}return{x:ce,y:de,h:ee,w:Y,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;VBe.length)&&(Ie=Be.length);for(var Me=0,_e=new Array(Ie);Me=Be.length?{done:!0}:{done:!1,value:Be[_e++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return Me=Be[Symbol.iterator](),Me.next.bind(Me)}function b(Be,Ie){return Ie={exports:{}},Be(Ie,Ie.exports),Ie.exports}var T=b(function(Be){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(_e){Be.exports.defaults=_e}Be.exports={defaults:Ie(),getDefaults:Ie,changeDefaults:Me}}),C=T.defaults,c=T.getDefaults,p=T.changeDefaults,d=/[&<>"']/,o=/[&<>"']/g,a=/[<>"']|&(?!#?\w+;)/,u=/[<>"']|&(?!#?\w+;)/g,s={"&":"&","<":"<",">":">",'"':""","'":"'"},h=function(Ie){return s[Ie]};function i(Be,Ie){if(Ie){if(d.test(Be))return Be.replace(o,h)}else if(a.test(Be))return Be.replace(u,h);return Be}var n=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function t(Be){return Be.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 f=/(^|[^\[])\^/g;function v(Be,Ie){Be=Be.source||Be,Ie=Ie||"";var Me={replace:function(Ae,Le){return Le=Le.source||Le,Le=Le.replace(f,"$1"),Be=Be.replace(Ae,Le),Me},getRegex:function(){return new RegExp(Be,Ie)}};return Me}var m=/[^\w:]/g,_=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function E(Be,Ie,Me){if(Be){var _e;try{_e=decodeURIComponent(t(Me)).replace(m,"").toLowerCase()}catch(Ae){return null}if(_e.indexOf("javascript:")===0||_e.indexOf("vbscript:")===0||_e.indexOf("data:")===0)return null}Ie&&!_.test(Me)&&(Me=S(Ie,Me));try{Me=encodeURI(Me).replace(/%25/g,"%")}catch(Ae){return null}return Me}var g={},y=/^[^:]+:\/*[^/]*$/,x=/^([^:]+:)[\s\S]*$/,l=/^([^:]+:\/*[^/]*)[\s\S]*$/;function S(Be,Ie){g[" "+Be]||(y.test(Be)?g[" "+Be]=Be+"/":g[" "+Be]=I(Be,"/",!0)),Be=g[" "+Be];var Me=Be.indexOf(":")===-1;return Ie.substring(0,2)==="//"?Me?Ie:Be.replace(x,"$1")+Ie:Ie.charAt(0)==="/"?Me?Ie:Be.replace(l,"$1")+Ie:Be+Ie}var O={exec:function(){}};function A(Be){for(var Ie=1,Me,_e;Ie=0&&Ze[Ct]==="\\";)ut=!ut;return ut?"|":" |"}),_e=Me.split(/ \|/),Ae=0;if(_e.length>Ie)_e.splice(Ie);else for(;_e.length=_e.length?Ae.slice(_e.length):Ae}).join(` `)}var de=function(){function Be(Me){this.options=Me||W}var Ie=Be.prototype;return Ie.space=function(_e){var Ae=this.rules.block.newline.exec(_e);if(Ae)return Ae[0].length>1?{type:"space",raw:Ae[0]}:{raw:` `}},Ie.code=function(_e,Ae){var Le=this.rules.block.code.exec(_e);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(_e){var Ae=this.rules.block.fences.exec(_e);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(_e){var Ae=this.rules.block.heading.exec(_e);if(Ae)return{type:"heading",raw:Ae[0],depth:Ae[1].length,text:Ae[2]}},Ie.nptable=function(_e){var Ae=this.rules.block.nptable.exec(_e);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(_e){var Ae=this.rules.block.list.exec(_e);if(Ae){for(var Le=Ae[0],Te=Ae[2],Ze=Te.length>1,ut=Te[Te.length-1]===")",Ct={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,De,Ke,yt=Ht.length,ot=0;ot1||this.options.smartLists&&at!==Te)&&(pt=Ht.slice(ot+1).join(` `),Ct.raw=Ct.raw.substring(0,Ct.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&&(Ct.loose=!0),De=/^\[[ xX]\] /.test(bt),Ke=void 0,De&&(Ke=bt[1]!==" ",bt=bt.replace(/^\[[ xX]\] +/,"")),Ct.items.push({type:"list_item",raw:Le,task:De,checked:Ke,loose:st,text:bt});return Ct}},Ie.html=function(_e){var Ae=this.rules.block.html.exec(_e);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(_e){var Ae=this.rules.block.def.exec(_e);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(_e){var Ae=this.rules.block.table.exec(_e);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(_e){var Ae=this.rules.inline.link.exec(_e);if(Ae){var Le=Y(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],Ct="";if(this.options.pedantic){var Ht=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(ut);Ht?(ut=Ht[1],Ct=Ht[3]):Ct=""}else Ct=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:Ct&&Ct.replace(this.rules.inline._escapes,"$1")},Ae[0]);return Qt}},Ie.reflink=function(_e,Ae){var Le;if((Le=this.rules.inline.reflink.exec(_e))||(Le=this.rules.inline.nolink.exec(_e))){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(_e,Ae,Le){Le===void 0&&(Le="");var Te=this.rules.inline.strong.start.exec(_e);if(Te&&(!Te[1]||Te[1]&&(Le===""||this.rules.inline.punctuation.exec(Le)))){Ae=Ae.slice(-1*_e.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:_e.slice(0,ut[0].length),text:_e.slice(2,ut[0].length-2)}}},Ie.em=function(_e,Ae,Le){Le===void 0&&(Le="");var Te=this.rules.inline.em.start.exec(_e);if(Te&&(!Te[1]||Te[1]&&(Le===""||this.rules.inline.punctuation.exec(Le)))){Ae=Ae.slice(-1*_e.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:_e.slice(0,ut[0].length),text:_e.slice(1,ut[0].length-1)}}},Ie.codespan=function(_e){var Ae=this.rules.inline.code.exec(_e);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(_e){var Ae=this.rules.inline.br.exec(_e);if(Ae)return{type:"br",raw:Ae[0]}},Ie.del=function(_e){var Ae=this.rules.inline.del.exec(_e);if(Ae)return{type:"del",raw:Ae[0],text:Ae[1]}},Ie.autolink=function(_e,Ae){var Le=this.rules.inline.autolink.exec(_e);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(_e,Ae){var Le;if(Le=this.rules.inline.url.exec(_e)){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(_e,Ae,Le){var Te=this.rules.inline.text.exec(_e);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}}},Be}(),Ce=te.noopTest,Se=te.edit,Pe=te.merge,ye={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]+/};ye._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,ye._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,ye.def=Se(ye.def).replace("label",ye._label).replace("title",ye._title).getRegex(),ye.bullet=/(?:[*+-]|\d{1,9}[.)])/,ye.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,ye.item=Se(ye.item,"gm").replace(/bull/g,ye.bullet).getRegex(),ye.list=Se(ye.list).replace(/bull/g,ye.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ye.def.source+")").getRegex(),ye._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",ye._comment=//,ye.html=Se(ye.html,"i").replace("comment",ye._comment).replace("tag",ye._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ye.paragraph=Se(ye._paragraph).replace("hr",ye.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",ye._tag).getRegex(),ye.blockquote=Se(ye.blockquote).replace("paragraph",ye.paragraph).getRegex(),ye.normal=Pe({},ye),ye.gfm=Pe({},ye.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*|$)"}),ye.gfm.nptable=Se(ye.gfm.nptable).replace("hr",ye.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",ye._tag).getRegex(),ye.gfm.table=Se(ye.gfm.table).replace("hr",ye.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",ye._tag).getRegex(),ye.pedantic=Pe({},ye.normal,{html:Se(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ye._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(ye.normal._paragraph).replace("hr",ye.hr).replace("heading",` *#{1,6} *[^ ]`).replace("lheading",ye.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var Ee={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]*?(?:(?=[\\?@\\[\\]`^{|}~",Ee.punctuation=Se(Ee.punctuation).replace(/punctuation/g,Ee._punctuation).getRegex(),Ee._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",Ee._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",Ee.em.start=Se(Ee.em.start).replace(/punctuation/g,Ee._punctuation).getRegex(),Ee.em.middle=Se(Ee.em.middle).replace(/punctuation/g,Ee._punctuation).replace(/overlapSkip/g,Ee._overlapSkip).getRegex(),Ee.em.endAst=Se(Ee.em.endAst,"g").replace(/punctuation/g,Ee._punctuation).getRegex(),Ee.em.endUnd=Se(Ee.em.endUnd,"g").replace(/punctuation/g,Ee._punctuation).getRegex(),Ee.strong.start=Se(Ee.strong.start).replace(/punctuation/g,Ee._punctuation).getRegex(),Ee.strong.middle=Se(Ee.strong.middle).replace(/punctuation/g,Ee._punctuation).replace(/blockSkip/g,Ee._blockSkip).getRegex(),Ee.strong.endAst=Se(Ee.strong.endAst,"g").replace(/punctuation/g,Ee._punctuation).getRegex(),Ee.strong.endUnd=Se(Ee.strong.endUnd,"g").replace(/punctuation/g,Ee._punctuation).getRegex(),Ee.blockSkip=Se(Ee._blockSkip,"g").getRegex(),Ee.overlapSkip=Se(Ee._overlapSkip,"g").getRegex(),Ee._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,Ee._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Ee._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])?)+(?![-_])/,Ee.autolink=Se(Ee.autolink).replace("scheme",Ee._scheme).replace("email",Ee._email).getRegex(),Ee._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Ee.tag=Se(Ee.tag).replace("comment",ye._comment).replace("attribute",Ee._attribute).getRegex(),Ee._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Ee._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,Ee._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Ee.link=Se(Ee.link).replace("label",Ee._label).replace("href",Ee._href).replace("title",Ee._title).getRegex(),Ee.reflink=Se(Ee.reflink).replace("label",Ee._label).getRegex(),Ee.reflinkSearch=Se(Ee.reflinkSearch,"g").replace("reflink",Ee.reflink).replace("nolink",Ee.nolink).getRegex(),Ee.normal=Pe({},Ee),Ee.pedantic=Pe({},Ee.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",Ee._label).getRegex(),reflink:Se(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ee._label).getRegex()}),Ee.gfm=Pe({},Ee.normal,{escape:Se(Ee.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&&(_e="x"+_e.toString(16)),Ie+="&#"+_e+";";return Ie}var We=function(){function Be(Me){this.tokens=[],this.tokens.links=Object.create(null),this.options=Me||Ue,this.options.tokenizer=this.options.tokenizer||new de,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var _e={block:Fe.normal,inline:He.normal};this.options.pedantic?(_e.block=Fe.pedantic,_e.inline=He.pedantic):this.options.gfm&&(_e.block=Fe.gfm,this.options.breaks?_e.inline=He.breaks:_e.inline=He.gfm),this.tokenizer.rules=_e}Be.lex=function(_e,Ae){var Le=new Be(Ae);return Le.lex(_e)};var Ie=Be.prototype;return Ie.lex=function(_e){return _e=_e.replace(/\r\n|\r/g,` `).replace(/\t/g," "),this.blockTokens(_e,this.tokens,!0),this.inline(this.tokens),this.tokens},Ie.blockTokens=function(_e,Ae,Le){Ae===void 0&&(Ae=[]),Le===void 0&&(Le=!0),_e=_e.replace(/^ +$/gm,"");for(var Te,Ze,ut,Ct;_e;){if(Te=this.tokenizer.space(_e)){_e=_e.substring(Te.raw.length),Te.type&&Ae.push(Te);continue}if(Te=this.tokenizer.code(_e,Ae)){_e=_e.substring(Te.raw.length),Te.type?Ae.push(Te):(Ct=Ae[Ae.length-1],Ct.raw+=` `+Te.raw,Ct.text+=` `+Te.text);continue}if(Te=this.tokenizer.fences(_e)){_e=_e.substring(Te.raw.length),Ae.push(Te);continue}if(Te=this.tokenizer.heading(_e)){_e=_e.substring(Te.raw.length),Ae.push(Te);continue}if(Te=this.tokenizer.nptable(_e)){_e=_e.substring(Te.raw.length),Ae.push(Te);continue}if(Te=this.tokenizer.hr(_e)){_e=_e.substring(Te.raw.length),Ae.push(Te);continue}if(Te=this.tokenizer.blockquote(_e)){_e=_e.substring(Te.raw.length),Te.tokens=this.blockTokens(Te.text,[],Le),Ae.push(Te);continue}if(Te=this.tokenizer.list(_e)){for(_e=_e.substring(Te.raw.length),ut=Te.items.length,Ze=0;Ze0)for(;(Ht=this.tokenizer.rules.inline.reflinkSearch.exec(Ct))!=null;)Qt.includes(Ht[0].slice(Ht[0].lastIndexOf("[")+1,-1))&&(Ct=Ct.slice(0,Ht.index)+"["+"a".repeat(Ht[0].length-2)+"]"+Ct.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Ht=this.tokenizer.rules.inline.blockSkip.exec(Ct))!=null;)Ct=Ct.slice(0,Ht.index)+"["+"a".repeat(Ht[0].length-2)+"]"+Ct.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;_e;){if(ut=this.tokenizer.escape(_e)){_e=_e.substring(ut.raw.length),Ae.push(ut);continue}if(ut=this.tokenizer.tag(_e,Le,Te)){_e=_e.substring(ut.raw.length),Le=ut.inLink,Te=ut.inRawBlock,Ae.push(ut);continue}if(ut=this.tokenizer.link(_e)){_e=_e.substring(ut.raw.length),ut.type==="link"&&(ut.tokens=this.inlineTokens(ut.text,[],!0,Te)),Ae.push(ut);continue}if(ut=this.tokenizer.reflink(_e,this.tokens.links)){_e=_e.substring(ut.raw.length),ut.type==="link"&&(ut.tokens=this.inlineTokens(ut.text,[],!0,Te)),Ae.push(ut);continue}if(ut=this.tokenizer.strong(_e,Ct,Ze)){_e=_e.substring(ut.raw.length),ut.tokens=this.inlineTokens(ut.text,[],Le,Te),Ae.push(ut);continue}if(ut=this.tokenizer.em(_e,Ct,Ze)){_e=_e.substring(ut.raw.length),ut.tokens=this.inlineTokens(ut.text,[],Le,Te),Ae.push(ut);continue}if(ut=this.tokenizer.codespan(_e)){_e=_e.substring(ut.raw.length),Ae.push(ut);continue}if(ut=this.tokenizer.br(_e)){_e=_e.substring(ut.raw.length),Ae.push(ut);continue}if(ut=this.tokenizer.del(_e)){_e=_e.substring(ut.raw.length),ut.tokens=this.inlineTokens(ut.text,[],Le,Te),Ae.push(ut);continue}if(ut=this.tokenizer.autolink(_e,me)){_e=_e.substring(ut.raw.length),Ae.push(ut);continue}if(!Le&&(ut=this.tokenizer.url(_e,me))){_e=_e.substring(ut.raw.length),Ae.push(ut);continue}if(ut=this.tokenizer.inlineText(_e,Te,be)){_e=_e.substring(ut.raw.length),Ze=ut.raw.slice(-1),Ae.push(ut);continue}if(_e){var bt="Infinite loop on byte: "+_e.charCodeAt(0);if(this.options.silent){console.error(bt);break}else throw new Error(bt)}}return Ae},Q(Be,null,[{key:"rules",get:function(){return{block:Fe,inline:He}}}]),Be}(),ze=T.defaults,nt=te.cleanUrl,re=te.escape,k=function(){function Be(Me){this.options=Me||ze}var Ie=Be.prototype;return Ie.code=function(_e,Ae,Le){var Te=(Ae||"").match(/\S*/)[0];if(this.options.highlight){var Ze=this.options.highlight(_e,Te);Ze!=null&&Ze!==_e&&(Le=!0,_e=Ze)}return Te?'
    '+(Le?_e:re(_e,!0))+`
    `:"
    "+(Le?_e:re(_e,!0))+`
    `},Ie.blockquote=function(_e){return`
    `+_e+`
    `},Ie.html=function(_e){return _e},Ie.heading=function(_e,Ae,Le,Te){return this.options.headerIds?"'+_e+" `:""+_e+" `},Ie.hr=function(){return this.options.xhtml?`
    `:`
    `},Ie.list=function(_e,Ae,Le){var Te=Ae?"ol":"ul",Ze=Ae&&Le!==1?' start="'+Le+'"':"";return"<"+Te+Ze+`> `+_e+" `},Ie.listitem=function(_e){return"
  • "+_e+`
  • `},Ie.checkbox=function(_e){return" "},Ie.paragraph=function(_e){return"

    "+_e+`

    `},Ie.table=function(_e,Ae){return Ae&&(Ae=""+Ae+""),` `+_e+` `+Ae+`
    `},Ie.tablerow=function(_e){return` `+_e+` `},Ie.tablecell=function(_e,Ae){var Le=Ae.header?"th":"td",Te=Ae.align?"<"+Le+' align="'+Ae.align+'">':"<"+Le+">";return Te+_e+" `},Ie.strong=function(_e){return""+_e+""},Ie.em=function(_e){return""+_e+""},Ie.codespan=function(_e){return""+_e+""},Ie.br=function(){return this.options.xhtml?"
    ":"
    "},Ie.del=function(_e){return""+_e+""},Ie.link=function(_e,Ae,Le){if(_e=nt(this.options.sanitize,this.options.baseUrl,_e),_e===null)return Le;var Te='",Te},Ie.image=function(_e,Ae,Le){if(_e=nt(this.options.sanitize,this.options.baseUrl,_e),_e===null)return Le;var Te=''+Le+'":">",Te},Ie.text=function(_e){return _e},Be}(),U=function(){function Be(){}var Ie=Be.prototype;return Ie.strong=function(_e){return _e},Ie.em=function(_e){return _e},Ie.codespan=function(_e){return _e},Ie.del=function(_e){return _e},Ie.html=function(_e){return _e},Ie.text=function(_e){return _e},Ie.link=function(_e,Ae,Le){return""+Le},Ie.image=function(_e,Ae,Le){return""+Le},Ie.br=function(){return""},Be}(),q=function(){function Be(){this.seen={}}var Ie=Be.prototype;return Ie.slug=function(_e){var Ae=_e.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},Be}(),$=T.defaults,J=te.unescape,xe=function(){function Be(Me){this.options=Me||$,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}Be.parse=function(_e,Ae){var Le=new Be(Ae);return Le.parse(_e)};var Ie=Be.prototype;return Ie.parse=function(_e,Ae){Ae===void 0&&(Ae=!0);var Le="",Te,Ze,ut,Ct,Ht,Qt,bt,Lt,at,pt,st,De,Ke,yt,ot,kt,Dt,rt,Tt=_e.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,Ke),at+=this.renderer.listitem(yt,Dt,kt);Le+=this.renderer.list(at,st,De);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:

    "+Ne(ut.message+"",!0)+"
    ";throw ut}}Qe.options=Qe.setOptions=function(Be){return ke(Qe.defaults,Be),tt(Qe.defaults),Qe},Qe.getDefaults=je,Qe.defaults=mt,Qe.use=function(Be){var Ie=ke({},Be);if(Be.renderer&&function(){var _e=Qe.defaults.renderer||new k,Ae=function(Ze){var ut=_e[Ze];_e[Ze]=function(){for(var Ct=arguments.length,Ht=new Array(Ct),Qt=0;Qt=0;a--){if(!j(o[a]))continue;var u=o[a].split("="),s=unescape(u[0]),h=unescape(u[1]);d(h,s)}}function T(d,o){if(!d)return;w.cookie=escape(d)+"="+escape(o)+"; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/"}function C(d){if(!d||!p(d))return;w.cookie=escape(d)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/"}function c(){b(function(d,o){C(o)})}function p(d){return new RegExp("(?:^|;\\s*)"+escape(d).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 b=P,T=0,C=void 0,c=void 0,p=function(U,q){_[T]=U,_[T+1]=q,T+=2,T===2&&(c?c(E):y())};function d(k){c=k}function o(k){p=k}var a=typeof window!="undefined"?window:void 0,u=a||{},s=u.MutationObserver||u.WebKitMutationObserver,h=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)}:m()}function f(){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 m(){var k=setTimeout;return function(){return k(E,1)}}var _=new Array(1e3);function E(){for(var k=0;k`,triples:"",explode:"[]{}"},j=le.Pos;le.defineOption("autoCloseBrackets",!1,function(s,h,i){i&&i!=le.Init&&(s.removeKeyMap(P),s.state.closeBrackets=null),h&&(b(w(h,"pairs")),s.state.closeBrackets=h,s.addKeyMap(P))});function w(s,h){return h=="pairs"&&typeof s=="string"?s:typeof s=="object"&&s[h]!=null?s[h]:Q[h]}var P={Backspace:c,Enter:p};function b(s){for(var h=0;h=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 h=C(s),i=h&&w(h,"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+(h?-1:1)),head:new j(s.head.line,s.head.ch+(h?1:-1))}}function o(s,h){var i=C(s);if(!i||s.getOption("disableInput"))return le.Pass;var n=w(i,"pairs"),t=n.indexOf(h);if(t==-1)return le.Pass;for(var f=w(i,"closeBefore"),v=w(i,"triples"),m=n.charAt(t+1)==h,_=s.listSelections(),E=t%2==0,g,y=0;y<_.length;y++){var x=_[y],l=x.head,S,O=s.getRange(l,j(l.line,l.ch+1));if(E&&!x.empty())S="surround";else if((m||!E)&&O==h)m&&u(s,l)?S="both":v.indexOf(h)>=0&&s.getRange(l,j(l.line,l.ch+3))==h+h+h?S="skipThree":S="skip";else if(m&&l.ch>1&&v.indexOf(h)>=0&&s.getRange(j(l.line,l.ch-2),l)==h+h){if(l.ch>2&&/\bstring/.test(s.getTokenTypeAt(j(l.line,l.ch-2))))return le.Pass;S="addFour"}else if(m){var A=l.ch==0?" ":s.getRange(j(l.line,l.ch-1),l);if(!le.isWordChar(O)&&A!=h&&!le.isWordChar(A))S="both";else return le.Pass}else if(E&&(O.length===0||/\s/.test(O)||f.indexOf(O)>-1))S="both";else return le.Pass;if(!g)g=S;else if(g!=S)return le.Pass}var D=t%2?n.charAt(t-1):h,I=t%2?h:n.charAt(t+1);s.operation(function(){if(g=="skip")s.execCommand("goCharRight");else if(g=="skipThree")for(var B=0;B<3;B++)s.execCommand("goCharRight");else if(g=="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 b.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,d=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}(),u=function(Re){Object(d.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(d.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),h=function(Re){Object(d.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 h("Unimplemented abstract function!")}},{key:"abort",value:function(){throw new h("Unimplemented abstract function!")}}]),Re}(),f=z("oZsa");function v(Re,ve){for(;!Object.prototype.hasOwnProperty.call(Re,ve)&&!(Re=Object(f.a)(Re),Re===null););return Re}function m(Re,ve,K){return typeof Reflect!="undefined"&&Reflect.get?m=Reflect.get:m=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},m(Re,ve,K||Re)}var _={};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 _)_.hasOwnProperty(Nt)&&delete _[Nt];Object.assign(_,oe)}E();var g=_,y=function(Re){Object(d.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(),m(Object(f.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=g.msedge?oe:!0;return self.fetch&&self.ReadableStream&&he}catch(Oe){return!1}}}]),K}(t),x=y,l=function(Re){Object(d.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),m(Object(f.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}();ye.emitter=new b.a;var Ee=ye,Ge=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(Fe(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&&Fe(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 be=He,me=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 u("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 u("Data not enough when parse String");var he=new DataView(K,Z,oe),Oe=he.getUint16(0,!me),Je;return Oe>0?Je=be(new Uint8Array(K,Z+2,Oe)):Je="",{data:Je,size:2+Oe}}},{key:"parseLongString",value:function(K,Z,oe){if(oe<4)throw new u("Data not enough when parse LongString");var he=new DataView(K,Z,oe),Oe=he.getUint32(0,!me),Je;return Oe>0?Je=be(new Uint8Array(K,Z+4,Oe)):Je="",{data:Je,size:4+Oe}}},{key:"parseDate",value:function(K,Z,oe){if(oe<10)throw new u("Data size invalid when parse Date");var he=new DataView(K,Z,oe),Oe=he.getFloat64(0,!me),Je=he.getInt16(8,!me);return Oe+=Je*60*1e3,{data:new Date(Oe),size:8+2}}},{key:"parseValue",value:function(K,Z,oe){if(oe<1)throw new u("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,!me),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,!me)&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],Bt=Ar[ur-1]):ur===255&&(At=oe.readByte()<<8|oe.readByte(),Bt=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||Bt!==1)&&(Xr=At/Bt);var Dr=0,Yr=0;if(Pt===0)Dr=1,Yr=2-pe;else{var gr=Pt===3?1:2,gi=Pt===1?2:1;Dr=gr,Yr=gi*(2-pe)}var si=(F+1)*16,Pr=(2-pe)*((ae+1)*16);si-=(se+$e)*Dr,Pr-=(_t+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:Bt},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 Ue,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 Ue}},{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 u("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=ze.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($.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($.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 pe=this._parseMP3AudioData(K,Z+1,oe-1,!0);if(pe==null)return;Rt.audioSampleRate=pe.samplingRate,Rt.channelCount=pe.channelCount,Rt.codec=pe.codec,Rt.originalCodec=pe.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=pe.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 _t=this._timestampBase+he,it={unit:$e,length:$e.byteLength,dts:_t,pts:_t};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($.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($.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($.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($.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($.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord");return}if(this._naluLengthSize=(lt.getUint8(4)&3)+1,this._naluLengthSize!==3&&this._naluLengthSize!==4){this._onError($.FORMAT_ERROR,"Flv: Strange NaluLengthSizeMinusOne: ".concat(this._naluLengthSize-1));return}var nn=lt.getUint8(5)&31;if(nn===0){this._onError($.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 pe=this._videoTrack,se={units:ht,length:Mt,isKeyframe:an,dts:cn,cts:lt,pts:cn+lt};an&&(se.fileposition=Oe),pe.samples.push(se),pe.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}(),Ne=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},Be=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}(),_e=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=!!(g.chrome&&(g.version.major<50||g.version.major===50&&g.version.build<2661)),this._fillSilentAfterSeek=g.msedge||g.msie,this._mp3UseMpegAudio=!g.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 u("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 u("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 pe=F-(ae.originalDts+ae.duration);pe<=3&&(pe=0);var se=ae.dts+ae.duration+pe;Oe=F-se}else Oe=0}if(nn){var $e=F-Oe,_t=this._videoSegmentInfoList.getLastSegmentBefore(F);if(_t!=null&&_t.beginDts<$e){var it=Qe.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);if(it){var Vt=_t.beginDts,At=$e-_t.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 Bt=[],on=0;on=1?ur=Bt[Bt.length-1].duration:ur=Math.floor(Nt);var fr=!1,br=null;if(ur>Nt*1.5&&this._audioMeta.codec!=="mp3"&&this._fillAudioTimestampGap&&!g.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 _i=br[br.length-1];_i.duration=Un+ur-_i.dts,ur=Math.round(Nt)}Bt.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&&Bt.push.apply(Bt,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 Be,pe=[],se=0;se=1?on=pe[pe.length-1].duration:on=Math.floor(this._videoMeta.refSampleDuration);if(it){var Sr=new Xe(Vt,Bt,on,$e.dts,!0);Sr.fileposition=$e.fileposition,ae.appendSyncPoint(Sr)}pe.push({dts:Vt,pts:Bt,cts:At,units:$e.units,size:$e.length,isKeyframe:it,duration:on,originalDts:_t,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=Ne.probe(K)).match){this._demuxer=new Ne(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,$.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,Ue.prototype));var oe=Object.assign({},K);Object.setPrototypeOf(oe,Ue.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,Ct=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;Ee.applyConfig(N),N.enableCallback===!0?Ee.addLogListener(oe):Ee.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=Ct,Qt=function(){function Re(ve,K){if(Object(le.a)(this,Re),this.TAG="Transmuxer",this._emitter=new b.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)},Ee.registerListener(this.e.onLoggingConfigChanged),this._worker.postMessage({cmd:"logging_config",param:Ee.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"}),Ee.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,Ue.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 b.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 u("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(),g.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,De={NETWORK_ERROR:"NetworkError",MEDIA_ERROR:"MediaError",OTHER_ERROR:"OtherError"},Ke={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:$.FORMAT_ERROR,MEDIA_FORMAT_UNSUPPORTED:$.FORMAT_UNSUPPORTED,MEDIA_CODEC_UNSUPPORTED:$.CODEC_UNSUPPORTED},yt=function(){function Re(ve,K){if(Object(le.a)(this,Re),this.TAG="FlvPlayer",this._type="FlvPlayer",this._emitter=new b.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=g.chrome&&(g.version.major<50||g.version.major===50&&g.version.build<2661);this._alwaysSeekKeyframe=!!(Z||g.msedge||g.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===Pe.MEDIA_INFO?this._mediaInfo!=null&&Promise.resolve().then(function(){oe._emitter.emit(Pe.MEDIA_INFO,oe.mediaInfo)}):K===Pe.STATISTICS_INFO&&(this._statisticsInfo!=null&&Promise.resolve().then(function(){oe._emitter.emit(Pe.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(Pe.ERROR,De.MEDIA_ERROR,Ke.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 u("HTMLMediaElement must be attached before load()!");if(this._transmuxer)throw new u("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(Pe.LOADING_COMPLETE)}),this._transmuxer.on(Te.RECOVERED_EARLY_EOF,function(){K._emitter.emit(Pe.RECOVERED_EARLY_EOF)}),this._transmuxer.on(Te.IO_ERROR,function(Z,oe){K._emitter.emit(Pe.ERROR,De.NETWORK_ERROR,Z,oe)}),this._transmuxer.on(Te.DEMUX_ERROR,function(Z,oe){K._emitter.emit(Pe.ERROR,De.MEDIA_ERROR,Z,{code:-1,msg:oe})}),this._transmuxer.on(Te.MEDIA_INFO,function(Z){K._mediaInfo=Z,K._emitter.emit(Pe.MEDIA_INFO,Object.assign({},Z))}),this._transmuxer.on(Te.METADATA_ARRIVED,function(Z){K._emitter.emit(Pe.METADATA_ARRIVED,Z)}),this._transmuxer.on(Te.SCRIPTDATA_ARRIVED,function(Z){K._emitter.emit(Pe.SCRIPTDATA_ARRIVED,Z)}),this._transmuxer.on(Te.STATISTICS_INFO,function(Z){K._statisticsInfo=K._fillStatisticsInfo(Z),K._emitter.emit(Pe.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(Pe.MEDIA_INFO,this.mediaInfo)}},{key:"_reportStatisticsInfo",value:function(){this._emitter.emit(Pe.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 Tt(){return Ce.supportMSEH264Playback()}function Ft(){return Ce.getFeatureList()}var zt={};zt.createPlayer=rt,zt.isSupported=Tt,zt.getFeatureList=Ft,zt.BaseLoader=t,zt.LoaderStatus=i,zt.LoaderErrors=n,zt.Events=Pe,zt.ErrorTypes=De,zt.ErrorDetails=Ke,zt.FlvPlayer=ot,zt.NativePlayer=Dt,zt.LoggingControl=Ee,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 b=Object.keys(le),T=Object.keys(Q);if(b.length!==T.length)return!1;for(var C=Object.prototype.hasOwnProperty.bind(Q),c=0;c=7&&this.setupTypeNumber(C),this.dataCache==null&&(this.dataCache=b.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 d=-1;d<=7;d++){if(c+d<=-1||this.moduleCount<=c+d)continue;0<=p&&p<=6&&(d==0||d==6)||0<=d&&d<=6&&(p==0||p==6)||2<=p&&p<=4&&2<=d&&d<=4?this.modules[C+p][c+d]=!0:this.modules[C+p][c+d]=!1}}},T.getBestMaskPattern=function(){for(var C=0,c=0,p=0;p<8;p++){this.makeImpl(!0,p);var d=w.getLostPoint(this);(p==0||C>d)&&(C=d,c=p)}return c},T.createMovieClip=function(C,c,p){var d=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]=d}for(var p=0;p<18;p++){var d=!C&&(c>>p&1)==1;this.modules[p%3+this.moduleCount-8-3][Math.floor(p/3)]=d}},T.setupTypeInfo=function(C,c){for(var p=this.errorCorrectLevel<<3|c,d=w.getBCHTypeInfo(p),o=0;o<15;o++){var a=!C&&(d>>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&&(d>>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,d=this.moduleCount-1,o=7,a=0,u=this.moduleCount-1;u>0;u-=2)for(u==6&&u--;;){for(var s=0;s<2;s++)if(this.modules[d][u-s]==null){var h=!1;a>>o&1)==1);var i=w.getMask(c,d,u-s);i&&(h=!h),this.modules[d][u-s]=h,o--,o==-1&&(a++,o=7)}if(d+=p,d<0||this.moduleCount<=d){d-=p,p=-p;break}}},b.PAD0=236,b.PAD1=17,b.createData=function(C,c,p){for(var d=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(b.PAD0,8),o.getLengthInBits()>=s*8)break;o.put(b.PAD1,8)}return b.createBytes(o,d)},b.createBytes=function(C,c){for(var p=0,d=0,o=0,a=new Array(c.length),u=new Array(c.length),s=0;s=0?v.get(m):0}}for(var _=0,n=0;n=0;)T^=P.G15<=0;)T^=P.G18<>>=1;return T},getPatternPosition:function(b){return P.PATTERN_POSITION_TABLE[b-1]},getMask:function(b,T,C){switch(b){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:"+b)}},getErrorCorrectPolynomial:function(b){for(var T=new Q([1],0),C=0;C5&&(C+=3+d-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)}},d=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,o=function(D){return D.replace(d,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("")},u=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 u(o(String(D)))},h=function(D){return D.replace(/[+\/]/g,function(I){return I=="+"?"-":"_"}).replace(/=/g,"")},i=function(D,I){return I?h(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?h(B):B});var f=/[\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))}},m=function(D){return D.replace(f,v)},_=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,_)},g=function(D){return E(String(D).replace(/[^A-Za-z0-9\+\/]/g,""))},y=function(D){return m(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(g(x(D)),function(I){return I.charCodeAt(0)})});var O=function(){var D=w.Base64;return w.Base64=P,D};if(w.Base64={VERSION:b,atob:g,btoa:u,fromBase64:l,toBase64:i,utob:o,encode:i,encodeURI:n,btou:m,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 f}),z.d(Ve,"a",function(){return m});var le=z("1OyB"),Q=z("vuIU"),j=z("Ji7U"),w=z("LK+K"),P=z("q1tI"),b=z("rePB"),T=z("Ff2n"),C=z("ODXe"),c=z("4IlW"),p=z("bX4T"),d=z("YrtM"),o=z("TSYQ"),a=z.n(o),u=z("+nKL"),s=z("8OUc"),h=function(X,ne){var Y=X.prefixCls,ee=X.id,ce=X.flattenOptions,de=X.childrenAsData,Ce=X.values,Se=X.searchValue,Pe=X.multiple,ye=X.defaultActiveFirstOption,Ee=X.height,Ge=X.itemHeight,Ue=X.notFoundContent,Fe=X.open,He=X.menuItemSelectedIcon,be=X.virtual,me=X.onSelect,We=X.onToggleOpen,ze=X.onActiveValue,nt=X.onScroll,re=X.onMouseEnter,k="".concat(Y,"-item"),U=Object(d.a)(function(){return ce},[Fe,ce],function(Xe,Be){return Be[0]&&Xe[1]!==Be[1]}),q=P.useRef(null),$=function(Be){Be.preventDefault()},J=function(Be){q.current&&q.current.scrollTo({index:Be})},xe=function(Be){for(var Ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Me=U.length,_e=0;_e1&&arguments[1]!==void 0?arguments[1]:!1;return Object(E.a)(V).map(function(ne,Y){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?g(ne):Object(_.a)(Object(_.a)({key:"__RC_SELECT_GRP__".concat(ce===null?Y: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,Y=V.children,ee=V.backfill,ce=V.allowClear,de=V.placeholder,Ce=V.getInputElement,Se=V.showSearch,Pe=V.onSearch,ye=V.defaultOpen,Ee=V.autoFocus,Ge=V.labelInValue,Ue=V.value,Fe=V.inputValue,He=V.optionLabelProp,be=X==="multiple"||X==="tags",me=Se!==void 0?Se:be||X==="combobox",We=ne||y(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 ze=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)(!ze,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(O.a)(X!=="combobox"||!He,"`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`."),Pe&&!me&&X!=="combobox"&&X!=="tags"&&Object(O.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(O.b)(!ye||Ee,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),Ue!=null){var nt=Object(A.d)(Ue);Object(O.a)(!Ge||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)(!be||Array.isArray(Ue),"`value` should be array when `mode` is `multiple` or `tags`")}if(Y){var re=null;Object(E.a)(Y).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($){return!P.isValidElement($)||!k.type||$.type.isSelectOption?!0:(re=$.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)(Fe===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 Y;return Object(le.a)(this,ne),Y=X.apply(this,arguments),Y.selectRef=P.createRef(),Y.focus=function(){Y.selectRef.current.focus()},Y.blur=function(){Y.selectRef.current.blur()},Y}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=f,H.OptGroup=m;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"),b=z.n(P),T=z("i8i4"),C=z.n(T),c=function(p){Object(j.a)(o,p);var d=Object(w.a)(o);function o(a){var u;Object(le.a)(this,o),u=d.call(this,a);var s=window.document;return u.node=s.createElement("div"),s.body.appendChild(u.node),u}return Object(Q.a)(o,[{key:"render",value:function(){var u=this.props.children;return Object(T.createPortal)(u,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),o}(b.a.Component)},MFOe:function(et,Ve,z){(function(le){var Q=b(),j=T(),w=C(),P=typeof window!="undefined"?window:le;et.exports={assign:Q,create:j,trim:w,bind:c,slice:p,each:d,map:o,pluck:a,isList:u,isFunction:s,isObject:h,Global:P};function b(){return Object.assign?Object.assign:function(n,t,f,v){for(var m=1;m=0;h-=1){var i=C.get(h)||new Set;i.forEach(function(n){var t=n.parent,f=n.node;if(p(f)||!n.parent||s.has(n.parent.key))return;if(p(n.parent.node)){s.add(t.key);return}var v=!0,m=!1;(t.children||[]).filter(function(_){return!p(_.node)}).forEach(function(_){var E=_.key,g=d.has(E);v&&!g&&(v=!1),!m&&(g||o.has(E))&&(m=!0)}),v&&d.add(t.key),m&&o.add(t.key),s.add(t.key)})}return{checkedKeys:Array.from(d),halfCheckedKeys:Array.from(Q(o,d))}}function P(T,C,c,p,d){for(var o=new Set(T),a=new Set(C),u=0;u<=p;u+=1){var s=c.get(u)||new Set;s.forEach(function(t){var f=t.key,v=t.node,m=t.children,_=m===void 0?[]:m;!o.has(f)&&!a.has(f)&&!d(v)&&_.filter(function(E){return!d(E.node)}).forEach(function(E){o.delete(E.key)})})}a=new Set;for(var h=new Set,i=p;i>=0;i-=1){var n=c.get(i)||new Set;n.forEach(function(t){var f=t.parent,v=t.node;if(d(v)||!t.parent||h.has(t.parent.key))return;if(d(t.parent.node)){h.add(f.key);return}var m=!0,_=!1;(f.children||[]).filter(function(E){return!d(E.node)}).forEach(function(E){var g=E.key,y=o.has(g);m&&!y&&(m=!1),!_&&(y||a.has(g))&&(_=!0)}),m||o.delete(f.key),_&&a.add(f.key),h.add(f.key)})}return{checkedKeys:Array.from(o),halfCheckedKeys:Array.from(Q(a,o))}}function b(T,C,c,p){var d=[],o;p?o=p:o=j;var a=new Set(T.filter(function(i){var n=!!c[i];return n||d.push(i),n})),u=new Map,s=0;Object.keys(c).forEach(function(i){var n=c[i],t=n.level,f=u.get(t);f||(f=new Set,u.set(t,f)),f.add(n),s=Math.max(s,t)}),Object(le.a)(!d.length,"Tree missing follow keys: ".concat(d.slice(0,100).map(function(i){return"'".concat(i,"'")}).join(", ")));var h;return C===!0?h=w(a,u,s,o):h=P(a,C.halfCheckedKeys,u,s,o),h}},OLES:function(et,Ve,z){"use strict";var le=z("U8pU"),Q=z("VTBJ"),j=z("Ff2n"),w=z("q1tI"),P=z("uciX"),b=z("7ixt"),T=function(a){var u=a.overlay,s=a.prefixCls,h=a.id,i=a.overlayInnerStyle;return w.createElement("div",{className:"".concat(s,"-inner"),id:h,role:"tooltip",style:i},typeof u=="function"?u():u)},C=T,c=function(a,u){var s=a.overlayClassName,h=a.trigger,i=h===void 0?["hover"]:h,n=a.mouseEnterDelay,t=n===void 0?0:n,f=a.mouseLeaveDelay,v=f===void 0?.1:f,m=a.overlayStyle,_=a.prefixCls,E=_===void 0?"rc-tooltip":_,g=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)(u,function(){return ne.current});var Y=Object(Q.a)({},X);"visible"in a&&(Y.popupVisible=a.visible);var ee=function(){var Pe=a.arrowContent,ye=Pe===void 0?null:Pe,Ee=a.overlay,Ge=a.id;return[w.createElement("div",{className:"".concat(E,"-arrow"),key:"arrow"},ye),w.createElement(C,{key:"content",prefixCls:E,id:Ge,overlay:Ee,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:b.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:m,mouseEnterDelay:t},Y),g)},p=Object(w.forwardRef)(c),d=Ve.a=p},OZM5:function(et,Ve,z){"use strict";z.d(Ve,"b",function(){return p}),z.d(Ve,"a",function(){return d}),z.d(Ve,"k",function(){return o}),z.d(Ve,"h",function(){return a}),z.d(Ve,"i",function(){return u}),z.d(Ve,"g",function(){return s}),z.d(Ve,"c",function(){return h}),z.d(Ve,"d",function(){return i}),z.d(Ve,"j",function(){return f}),z.d(Ve,"e",function(){return v}),z.d(Ve,"f",function(){return m});var le=z("KQm4"),Q=z("U8pU"),j=z("Ff2n"),w=z("q1tI"),P=z.n(w),b=z("Kwbf"),T=z("WaYH"),C=.25,c=2;function p(_,E){var g=_.slice(),y=g.indexOf(E);return y>=0&&g.splice(y,1),g}function d(_,E){var g=_.slice();return g.indexOf(E)===-1&&g.push(E),g}function o(_){return _.split("-")}function a(_,E){return"".concat(_,"-").concat(E)}function u(_){return _&&_.type&&_.type.isTreeNode}function s(_,E){var g=[_],y=E[_];function x(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];l.forEach(function(S){var O=S.key,A=S.children;g.push(O),x(A)})}return x(y.children),g}function h(_,E){var g=_.clientY,y=E.selectHandle.getBoundingClientRect(),x=y.top,l=y.bottom,S=y.height,O=Math.max(S*C,c);return g<=x+O?-1:g>=l-O?1:0}function i(_,E){if(!_)return;var g=E.multiple;return g?_.slice():_.length?[_[0]]:_}var n=function(E){return E};function t(_,E){if(!_)return[];var g=E||{},y=g.processProps,x=y===void 0?n:y,l=Array.isArray(_)?_:[_];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 f(_){if(!_)return null;var E;if(Array.isArray(_))E={checkedKeys:_,halfCheckedKeys:void 0};else if(Object(Q.a)(_)==="object")E={checkedKeys:_.checked||void 0,halfCheckedKeys:_.halfChecked||void 0};else return Object(b.a)(!1,"`checkedKeys` is not an array or an object"),null;return E}function v(_,E){var g=new Set;function y(x){if(g.has(x))return;var l=E[x];if(!l)return;g.add(x);var S=l.parent,O=l.node;if(O.disabled)return;S&&y(S.key)}return(_||[]).forEach(function(x){y(x)}),Object(le.a)(g)}function m(_){var E={};return Object.keys(_).forEach(function(g){(g.startsWith("data-")||g.startsWith("aria-"))&&(E[g]=_[g])}),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"),b=z("9og8"),T=z("tJVT"),C=z("jrin"),c=z("WmNS"),p=z.n(c),d=z("q1tI"),o=z.n(d),a=z("VrN/"),u=z.n(a),s=z("bdgK"),h=z("p77/"),i=z("Bd2K"),n=z("ELLl"),t=z("19Vz"),f=z("lZu9"),v=z("+NIl"),m=z("kSUc"),_=z("9Bee"),E=function(bt){var Lt=bt.value,at=Lt===void 0?"":Lt,pt=bt.className,st=bt.showTextOnly,De=bt.showLines,Ke=bt.style,yt=Ke===void 0?{}:Ke,ot=Object(d.useMemo)(function(){return""},[at]);return o.a.createElement(o.a.Fragment,null,o.a.createElement("div",{dangerouslySetInnerHTML:{__html:ot}}))},g=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,De=bt.className,Ke=De===void 0?"":De,yt=bt.children;function ot(){Lt(st)}return o.a.createElement("a",{title:at,className:Ke,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,De=bt.insertTemp,Ke=bt.hidetoolBar,yt=bt.uuid,ot=bt.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(D.E)("_educoder_session_login"),"&_educoder_session=").concat(Object(D.E)("_educoder_session"),"&key=").concat(yt,"&api=").concat(encodeURIComponent(I.a.PROXY_SERVER)));var kt=[].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"},!Ke&&kt.map(function(Dt,rt){return o.a.createElement("li",{key:rt},Dt.actionName?o.a.createElement(H,Object(x.a)({},Dt,{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,De&&o.a.createElement("li",null,o.a.createElement(H,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(De),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(A.a,{size:150,fgColor:"#000",value:"https://test2.educoder.net/upload.html?_educoder_session_login=".concat(Object(D.E)("_educoder_session_login"),"&_educoder_session=").concat(Object(D.E)("_educoder_session"),"&key=").concat(yt,"&api=").concat(encodeURIComponent(I.a.PROXY_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"),Y=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(Y.a,Object(x.a)({},de,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:pt}),o.a.createElement(Y.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(Y.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"),Pe=z("k1fw"),ye=z("HmJG"),Ee=z("BjJ7"),Ge=Y.a.useForm,Ue={width:280,marginRight:10},Fe={labelCol:{span:5},wrapperCol:{span:19}},He=function(bt){var Lt=bt.callback,at=bt.onCancel,pt=Ge(),st=Object(T.a)(pt,1),De=st[0],Ke=Object(d.useRef)();function yt(Dt){Lt(Object(Pe.a)(Object(Pe.a)({},Dt),{},{name:Ke.current}))}function ot(Dt,rt){De.setFieldsValue({src:"/api/attachments/".concat(Dt.id,"?type=").concat(Dt.content_type),type:rt.type})}function kt(Dt){var rt=Dt.target.files[0];Ke.current=rt.name,me(rt,ot)}return o.a.createElement(Y.a,Object(x.a)({form:De},Fe,{className:"upload-image-panel",onFinish:yt}),o.a.createElement(Y.a.Item,{label:"\u6587\u4EF6\u5730\u5740",required:!0},o.a.createElement("div",{className:"flex-container"},o.a.createElement(Y.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5730\u5740"}]},o.a.createElement(ce.a,{style:Ue})),o.a.createElement(be,{onFileChange:kt}))),o.a.createElement(Y.a.Item,{label:"\u6587\u4EF6\u63CF\u8FF0",name:"alt"},o.a.createElement(ce.a,{style:{width:264}})),o.a.createElement(Y.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 be(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 me(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(Ee.a,"/api/attachments.json")),pt.send(at)}var We=z("giR+"),ze=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(Y.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(Y.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},o.a.createElement(ze.a,null)),o.a.createElement("span",{style:U},"\u5217\u6570"),o.a.createElement(Y.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},o.a.createElement(ze.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(Y.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")))},$=z("ErOA"),J=z("7Cbv"),xe="link",ke="upload-image",dt="code-block",Ne="add-table",je="------------",tt={default:je,left:":".concat(je),center:":".concat(je,":"),right:"".concat(je,":")},mt=z("9VGf"),Qe,Xe;function Be(){}var Ie=0,Me=1e4,_e="\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"],Ct=(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,Ne,"\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,De=st===void 0?"100%":st,Ke=bt.height,yt=Ke===void 0?400:Ke,ot=bt.miniToolbar,kt=ot===void 0?!1:ot,Dt=bt.isFocus,rt=Dt===void 0?!1:Dt,Tt=bt.watch,Ft=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,pe=bt.values,se=pe===void 0?"":pe,$e=Object(d.useState)(null),_t=Object(T.a)($e,2),it=_t[0],Vt=_t[1],At=Object(d.useState)(at),Bt=Object(T.a)(At,2),on=Bt[0],In=Bt[1],Lr=Object(d.useState)(Tt),Sr=Object(T.a)(Lr,2),Un=Sr[0],ur=Sr[1],mi=Object(d.useState)(ht),Ar=Object(T.a)(mi,2),fr=Ar[0],br=Ar[1],Xr=Object(d.useState)(""),Dr=Object(T.a)(Xr,2),Yr=Dr[0],gr=Dr[1],gi=Object(d.useState)(0),si=Object(T.a)(gi,2),Pr=si[0],Fr=si[1],_i=Object(d.useState)(yt),vi=Object(T.a)(_i,2),di=vi[0],Fn=vi[1],wn=Object(d.useState)(!1),Er=Object(T.a)(wn,2),qn=Er[0],kr=Er[1],hr=Object(d.useRef)(Object(J.a)()),Ui=Object(d.useRef)(!1),Nr=Object(d.useRef)(),Ur=Object(d.useRef)(),yi=Object(d.useRef)(),Zr=Object(d.useRef)(),Li=Object(d.useRef)(),qi=function(){var dn=Object(b.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($.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(d.useEffect)(function(){In(se),it==null||it.setValue(se)},[se]),Object(d.useEffect)(function(){Rt==null||Rt(fr)},[fr]),Object(d.useEffect)(function(){if(Ur.current){var dn=u.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();me(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();me(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(d.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(Ct);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(d.useEffect)(function(){ur(Tt)},[it,Tt]),Object(d.useEffect)(function(){it&&(rt&&it.focus())},[it,rt]),Object(d.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(d.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(d.useEffect)(function(){if(it&&Mt){function dn(){Mt(it.getValue())}return it.on("blur",dn),function(){it.off("blur",dn)}}},[it,Mt]),Object(d.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(d.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(d.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(_e),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 Ne:gr(Ne);return;default:throw new Error}},[it,Un,fr]),li=Object(d.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 Ne: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(d.useEffect)(function(){Fn(yt)},[yt]);var hi=Le(De),Zi=Le(di),pa={width:hi,height:Zi},ma=Object(d.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(d.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:Ft,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(_.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(b){return z[b]}function Q(b,T){z[b]=T}function j(b){for(var T in z)z.hasOwnProperty(T)&&b(z[T],T)}function w(b){delete z[b]}function P(b){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:d};var j="storejs",w=Q.document,P=u(),b=(Q.navigator?Q.navigator.userAgent:"").match(/ (MSIE 8|MSIE 9|MSIE 10)\./);function T(s,h){if(b)return;var i=a(s);P(function(n){n.setAttribute(i,h),n.save(j)})}function C(s){if(b)return;var h=a(s),i=null;return P(function(n){i=n.getAttribute(h)}),i}function c(s){P(function(h){for(var i=h.XMLDocument.documentElement.attributes,n=i.length-1;n>=0;n--){var t=i[n];s(h.getAttribute(t.name),t.name)}})}function p(s){var h=a(s);P(function(i){i.removeAttribute(h),i.save(j)})}function d(){P(function(s){var h=s.XMLDocument.documentElement.attributes;s.load(j);for(var i=h.length-1;i>=0;i--)s.removeAttribute(h[i].name);s.save(j)})}var o=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g");function a(s){return s.replace(/^\d/,"___$&").replace(o,"___")}function u(){if(!w||!w.documentElement||!w.documentElement.addBehavior)return null;var s="script",h,i,n;try{i=new ActiveXObject("htmlfile"),i.open(),i.write("<"+s+">document.w=window'),i.close(),h=i.w.frames[0].document,n=h.createElement("div")}catch(t){n=w.createElement("div"),h=w.body}return function(t){var f=[].slice.call(arguments,0);f.unshift(n),h.appendChild(n),n.addBehavior("#default#userData"),n.load(j),t.apply(this,f),h.removeChild(n);return}}},RpDr:function(et,Ve,z){"use strict";z.d(Ve,"a",function(){return _}),z.d(Ve,"c",function(){return y});var le=z("+L6B"),Q=z("2/Rp"),j=z("tJVT"),w=z("k1fw"),P=z("jrin"),b=z("5NDa"),T=z("5rEg"),C=z("q1tI"),c=z.n(C),p=z("8Skl"),d=z("y3Kf"),o=z("bdLU"),a=z("J66h"),u=z.n(a),s=z("++UQ"),h=z.n(s),i=z("IxHN"),n=z("9Bee"),t=z("1vsH"),f,v=T.a.TextArea,m={visible:!1,tabIndex:"0"},_=(f={},Object(P.a)(f,o.a.NOMATCH,"\u6D4B\u8BD5\u7528\u4F8B\u7ED3\u679C\u4E0D\u5339\u914D"),Object(P.a)(f,o.a.OK,"\u8C03\u8BD5\u901A\u8FC7"),Object(P.a)(f,2,"\u8C03\u8BD5\u8D85\u65F6"),Object(P.a)(f,3,"\u8C03\u8BD5pod\u5931\u8D25"),Object(P.a)(f,4,"\u7F16\u8BD1\u5931\u8D25"),Object(P.a)(f,5,"\u6267\u884C\u5931\u8D25"),f),E;(function(l){l[l.SET_VISIBLE=0]="SET_VISIBLE",l[l.SET_TABINDEX=1]="SET_TABINDEX"})(E||(E={}));function g(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)(g,m),X=Object(j.a)(V,2),ne=X[0],Y=X[1],ee=ne.visible,ce=ne.tabIndex;Object(C.useEffect)(function(){Y({type:E.SET_VISIBLE,payload:!1})},[S]);function de(ye){var Ee=ye.target.id;Y({type:E.SET_TABINDEX,payload:Ee})}function Ce(){Y({type:E.SET_VISIBLE,payload:!ee})}var Se=Object(C.useMemo)(function(){if(B){var ye=B.status;return c.a.createElement(c.a.Fragment,null,x(B))}return null},[B]);function Pe(){Y({type:E.SET_VISIBLE,payload:!0}),Y({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(d.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:Pe},"\u8C03\u8BD5\u4EE3\u7801"),c.a.createElement(Q.a,{type:"primary",loading:D,disabled:D,onClick:function(){Y({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(b){return le(b)||Q(b)||j(b)||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 b,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"],d=[p,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],o=[d,"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=[d,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],u=[d,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",h=[d,"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"],f=[c,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],v=[o,u,a,h,i,n,t,f],m=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,_="str",E="kwd",g="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(me){for(var We=0,ze=!1,nt=!1,re=0,k=me.length;re122||(_e<65||Me>90||tt.push([Math.max(65,Me)|32,Math.min(_e,90)|32]),_e<97||Me>122||tt.push([Math.max(97,Me)&~32,Math.min(_e,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(Ne){for(var je=Ne.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(Be):Me!=="\\"&&(je[Qe]=Be.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=me.length;re=0;)ze[dt.charAt(Ne)]=ke;var je=ke[1],tt=""+je;$.hasOwnProperty(tt)||(q.push(je),$[tt]=null)}q.push(/[\0-\uffff]/),nt=W(q)})();var re=We.length,k=function(U){for(var q=U.sourceCode,$=U.basePos,J=U.sourceNode,xe=[$,S],ke=0,dt=q.match(nt)||[],Ne={},je=0,tt=dt.length;je=5&&Qe.substring(0,5)==="lang-",Be&&!(Xe&&typeof Xe[1]=="string")&&(Be=!1,Qe=D),Be||(Ne[mt]=Qe)}var _e=ke;if(ke+=mt.length,!Be)xe.push($+_e,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,$+_e,mt.substring(0,Le),k,xe),X(J,$+_e+Le,Ae,Ee(Ze,Ae),xe),X(J,$+_e+Te,mt.substring(Te),k,xe)}}U.decorations=xe};return k}function ce(me){var We=[],ze=[];me.tripleQuotedStrings?We.push([_,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):me.multiLineStrings?We.push([_,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):We.push([_,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),me.verbatimStrings&&ze.push([_,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var nt=me.hashComments;nt&&(me.cStyleComments?(nt>1?We.push([g,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):We.push([g,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),ze.push([_,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):We.push([g,/^#[^\r\n]*/,null,"#"])),me.cStyleComments&&(ze.push([g,/^\/\/[^\r\n]*/,null]),ze.push([g,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var re=me.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|$))+/";ze.push(["lang-regex",RegExp("^"+te+"("+q+")")])}var $=me.types;$&&ze.push([y,$]);var J=(""+me.keywords).replace(/^ | $/g,"");J.length&&ze.push([E,new RegExp("^(?:"+J.replace(/[\s,]+/g,"|")+")\\b"),null]),We.push([S,/^\s+/,null,` \r \xA0`]);var xe="^.[^\\s\\w.$@'\"`/\\\\]*";return me.regexLiterals&&(xe+="(?!s*/)"),ze.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,ze)}var de=ce({keywords:v,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Ce(me,We,ze){for(var nt=/(?:^|\s)nocode(?:\s|$)/,re=/\r\n?|\n/,k=me.ownerDocument,U=k.createElement("li");me.firstChild;)U.appendChild(me.firstChild);var q=[U];function $(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)$(mt);else if((tt==3||tt==4)&&ze){var Qe=je.nodeValue,Xe=Qe.match(re);if(Xe){var Be=Qe.substring(0,Xe.index);je.nodeValue=Be;var Ie=Qe.substring(Xe.index+Xe[0].length);if(Ie){var Me=je.parentNode;Me.insertBefore(k.createTextNode(Ie),je.nextSibling)}J(je),Be||je.parentNode.removeChild(je)}}}function J(je){for(;!je.nextSibling;)if(je=je.parentNode,!je)return;function tt(Xe,Be){var Ie=Be?Xe.cloneNode(!1):Xe,Me=Xe.parentNode;if(Me){var _e=tt(Me,1),Ae=Xe.nextSibling;_e.appendChild(Ie);for(var Le=Ae;Le;Le=Ae)Ae=Le.nextSibling,_e.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&&($+=2),k>=_e&&(ke+=2)}}finally{Qe&&(Qe.style.display=Xe)}}var Pe={};function ye(me,We){for(var ze=We.length;--ze>=0;){var nt=We[ze];Pe.hasOwnProperty(nt)?C.console&&console.warn("cannot override language handler %s",nt):Pe[nt]=me}}function Ee(me,We){return me&&Pe.hasOwnProperty(me)||(me=/^\s*]*(?:>|$)/],[g,/^<\!--[\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"]),ye(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"]),ye(ee([],[[B,/^[\s\S]+/]]),["uq.val"]),ye(ce({keywords:o,hashComments:!0,cStyleComments:!0,types:m}),["c","cc","cpp","cxx","cyc","m"]),ye(ce({keywords:"null,true,false"}),["json"]),ye(ce({keywords:u,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:m}),["cs"]),ye(ce({keywords:a,cStyleComments:!0}),["java"]),ye(ce({keywords:f,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),ye(ce({keywords:n,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),ye(ce({keywords:i,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),ye(ce({keywords:t,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),ye(ce({keywords:h,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),ye(ce({keywords:s,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),ye(ee([],[[_,/^[\s\S]+/]]),["regex"]);function Ge(me){var We=me.langExtension;try{var ze=V(me.sourceNode,me.pre),nt=ze.sourceCode;me.sourceCode=nt,me.spans=ze.spans,me.basePos=0,Ee(We,nt)(me),Se(me)}catch(re){C.console&&console.log(re&&re.stack||re)}}function Ue(me,We,ze){var nt=ze||!1,re=We||null,k=document.createElement("div");k.innerHTML="
    "+me+"
    ",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 Ge(U),k.innerHTML}function Fe(me,We){var ze=We||document.body,nt=ze.ownerDocument||document;function re(Ie){return ze.getElementsByTagName(Ie)}for(var k=[re("pre"),re("code"),re("xmp")],U=[],q=0;q=15&&(o=!1,c=!0);var _=t&&(p||o&&(m==null||m<12.11)),E=j||T&&C>=9;function g(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var y=function(e,r){var R=e.className,L=g(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 ye=[""];function Ee(e){for(;ye.length<=e;)ye.push(Ge(ye)+" ");return ye[e]}function Ge(e){return e[e.length-1]}function Ue(e,r){for(var R=[],L=0;L"\x80"&&(e.toUpperCase()!=e.toLowerCase()||me.test(e))}function ze(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 $(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 _e(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){_e(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 Ct=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")}(),De=null;function Ke(e){if(De!=null)return De;var r=l(e,S("span","x")),R=r.getBoundingClientRect(),L=A(r,0,1).getBoundingClientRect();return De=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=be(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 Tt(e,r){r=rt(r);var R=yt[r.name];if(!R)return Tt(e,"text/plain");var L=R(e,r);if(Ft.hasOwnProperty(r.name)){var M=Ft[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 Ft={};function zt(e,r){var R=Ft.hasOwnProperty(e)?Ft[e]:Ft[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 pe?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 pe(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(Bt(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 pe?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 pe)||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||Er(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,_t(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",Ee($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&&En.to==ge&&En.from==ge)){if(En.to!=null&&En.to!=ge&&ft>En.to&&(ft=En.to,Ut=""),Qn.className&&(Ot+=" "+Qn.className),Qn.css&&(vt=(vt?vt+";":"")+Qn.css),Qn.startStyle&&En.from==ge&&(Wt+=" "+Qn.startStyle),Qn.endStyle&&En.to==ft&&(un||(un=[])).push(Qn.endStyle,En.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||Er($t.marker,Qn)<0)&&($t=En)}else En.from>ge&&ft>En.from&&(ft=En.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(Ge(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 En=ar(e,G,An);return En.top+=ue,En.bottom+=ue,$r(En,L,M,!1)?(En.top<=M&&En.left<=L&&(vt=An,ft=En),!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=[]);Y(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=_r(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||Eo(e,{top:r}),Ho(e,r,!0),j&&Eo(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&&!u?"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 Ea(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)-_r(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 Eo(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 _o(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=Y(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,Ge(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(),Ge(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=Ge(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=Ge(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,Ge(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=Ge(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&&(Ge(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&&Y(L,M.history)==-1&&(Es(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(Ue(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?_l(e.cm,r,L):To(e,r,L),lo(e,R,de),e.cantEdit&&uo(e,ht(e.firstLine(),0))&&(e.cantEdit=!1)}function _l(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&&Be(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&&Ea(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?Ge(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=En?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&&_e(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=f?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&&Ct&&!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||(_e(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;_e(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,En=X(Z(G,R.line).text,R.ch,An),Qn=X(Z(G,Jt.line).text,Jt.ch,An),Or=Math.min(En,Qn),ai=Math.max(En,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=Pe(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,Pe(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 En=Fi(M,G);(An.line>=En.to||An.lineft.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&&(_e(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&&_e(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(),_e(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+Ge(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=_t(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=ze(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(Ge(qe)==Ge(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=Ge(qe),Jt=Ge(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),En=ht(we,vt.length?Ge(vt).length-Ot:0);if(qe.length>1||qe[0]||Mt(An,En))return Aa(e.doc,qe,An,En,"+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)||_e(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=Pe,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=Tt,e.modeExtensions=Ft,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=_e,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)&&Y(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"),b=z("W9HT"),T=z("miYZ"),C=z("tsqr"),c=z("2qtc"),p=z("kLXV"),d=z("9og8"),o=z("tJVT"),a=z("k1fw"),u=z("aHsQ"),s=z("sGsY"),h=z("WmNS"),i=z.n(h),n=z("q1tI"),t=z.n(n),f=z("Fvcw"),v=z("GIiI"),m=z("Ty5D"),_=z("9kvl"),E=z("55Ip"),g=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"),Y=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(Y,{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"),Pe=z("NUBc"),ye=z("g9YV"),Ee=z("wCAj"),Ge=z("Hw79"),Ue=z.n(Ge),Fe=z("ye1Q"),He=z("lfch"),be=z("bdLU"),me=z("1vsH"),We=z("wd/R"),ze=z.n(We),nt=Ee.a.Column,re=function(gt){var ct=gt.submitResult,xt=gt.submitting,It=gt.submitRecords,sn=gt.page,fn=gt.onPageChange,St=gt.topicId,Et=ct||{},Yt=Et.status,wt=Et.id,ln=Et.input,jt=Et.output,pn=Et.expected_output,Yn=Et.is_file,Dn=Et.input_file_url,_n=Et.output_file_url,er=Et.expected_output_file_url,Rn=Et.error_msg,Pn=It||{},Kn=Pn.records,Cr=Pn.records_count,rr=Object(m.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(b.a,{spinning:xt,tip:"\u8BC4\u6D4B\u4E2D...",indicator:t.a.createElement(Fe.a,{style:{fontSize:24},spin:!0})},wt?t.a.createElement(t.a.Fragment,null,t.a.createElement("ul",{className:Ue.a.info},t.a.createElement("li",null,"\u6267\u884C\u7ED3\u679C\uFF1A",t.a.createElement("span",{className:Yt===be.a.OK?"c-green":"c-red"},B.a[Yt])),t.a.createElement("li",{className:Ue.a.error},t.a.createElement("a",{onClick:lr},"\u590D\u5236\u9519\u8BEF\u4FE1\u606F ",t.a.createElement(He.a,null)," ")),t.a.createElement("li",null,t.a.createElement(E.a,{to:"/problems/".concat(St,"/record-detail/").concat(wt,"?backId=").concat(rr==null?void 0:rr.save_identifier)},"\u663E\u793A\u8BE6\u60C5 > "))),Yt!==be.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(me.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(me.w)(_n,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(me.w)(er,pn)}},pn))):null):null,(Kn==null?void 0:Kn.length)>0?t.a.createElement(Ee.a,{dataSource:Kn,rowKey:"id",pagination:!1},t.a.createElement(nt,{title:"\u63D0\u4EA4\u65F6\u95F4",dataIndex:"created_at",key:"created_at",render:function(_r,ir){return t.a.createElement("span",null," ",ze()(_r).format("YYYY-MM-DD HH:mm:ss"))}}),t.a.createElement(nt,{title:"\u63D0\u4EA4\u7ED3\u679C",dataIndex:"status",key:"status",render:function(_r,ir){var dr;return t.a.createElement(E.a,{className:_r===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[_r])===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(Pe.a,{className:Ue.a.pagination,current:sn,pageSize:15,total:Cr,onChange:fn}):null)},k=z("BdwD"),U=z("DYRE"),q=z("zeV3"),$=z("+BJd"),J=z("mr32"),xe=z("TcMa"),ke=z.n(xe),dt=z("9Bee"),Ne={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,Et=ct.username,Yt=ct.user_path,wt=ct.user_praise,ln=ct.comments_count,jt=ct.praises_count,pn=ct.description,Yn=ct.pass_count,Dn=ct.submit_count,_n=Object(m.h)();console.log(ct.language,"language");var er=Ne[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"),Be=z("M8RZ"),Ie=z("OkW/"),Me=z("ErOA");function _e(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 Ct=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,Et=ct.can_delete,Yt=ct.content,wt=ct.id,ln=ct.time;function jt(){fn({id:wt,index:xt,type:"delete-discuss",parentDiscussIndex:It,message:"\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417"})}var pn=sn.admin||Et||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,Et=gt.onReplyDiscuss,Yt=gt.onSetActiveDiscussIndex,wt=xt.content,ln=xt.children,jt=xt.hidden,pn=xt.id,Yn=xt.praise_count,Dn=xt.time,_n=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,!_n,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:wt}),ln&&ln.length>0?t.a.createElement("div",{className:"reply-discuss-container"},ln.map(function(pr,_r){return t.a.createElement(Lt,{key:pr.id,data:pr,index:_r,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:_n?"c-orange":""},t.a.createElement("i",{className:_n?"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:Et})))},pt=z("kaH+"),st=z("Wx9E"),De=z("Ot1p"),Ke=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),Et=Object(o.a)(St,2),Yt=Et[0],wt=Et[1],ln=Object(n.useState)(""),jt=Object(o.a)(ln,2),pn=jt[0],Yn=jt[1];function Dn(Kn){Yn(Kn)}function _n(){wt(!0)}function er(){wt(!1)}function Rn(){return Pn.apply(this,arguments)}function Pn(){return Pn=Object(d.a)(i.a.mark(function Kn(){return i.a.wrap(function(rr){for(;;)switch(rr.prev=rr.next){case 0:sn(pn),Yn(""),wt(!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:_n}),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(De.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),Et=Object(o.a)(St,2),Yt=Et[0],wt=Et[1],ln=Yt.loading,jt=Yt.page,pn=Yt.data,Yn=Yt.count,Dn=Yt.actionType,_n=Yt.activeDiscussIndex,er=Object(n.useCallback)(Object(d.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 wt({type:ot.SHOW_DISCUSSES_LOADING}),Jn.next=3,_e({container_type:"Practice",container_identifier:xt,limit:10,page:jt});case 3:tr=Jn.sent,ar=tr.comments,mr=tr.disscuss_count,wt({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){wt({type:ot.SET_PAGE,page:vn})}function Pn(vn){wt({type:ot.SET_ACTION_TYPE,payload:{actionType:vn}})}function Kn(vn){_n===vn?wt({type:ot.ACTIVE_DISCUSS_INDEX,payload:{activeDiscussIndex:null}}):wt({type:ot.ACTIVE_DISCUSS_INDEX,payload:{activeDiscussIndex:vn}})}function Cr(vn,tr,ar){return rr.apply(this,arguments)}function rr(){return rr=Object(d.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,wt({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(d.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,wt({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 wt({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 _r(){wt({type:ot.SET_ACTION_TYPE,payload:{actionType:null}})}function ir(vn,tr){return dr.apply(this,arguments)}function dr(){return dr=Object(d.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(d.a)(i.a.mark(function vn(tr){return i.a.wrap(function(mr){for(;;)switch(mr.prev=mr.next){case 0:return wt({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:_n})}),Yn>10?t.a.createElement("div",{className:"pagination-container"},t.a.createElement(Pe.a,{showQuickJumper:!0,onChange:Rn,current:jt,total:Yn})):null),t.a.createElement(Ke,{user_praise:It.user_praise,praise_count:It.praises_count,praisePlus:sn,discuss_count:It.comments_count,onCreateDiscuss:jn}),t.a.createElement(Be.a,null,t.a.createElement(p.a,{centered:!0,title:"\u63D0\u793A",visible:!!Dn,onOk:lr,onCancel:_r},t.a.createElement("p",null,Dn?Dn.message:"")),t.a.createElement(pt.a,null)))},rt=z("1FX+"),Tt=z.n(rt),Ft=z("pYxM"),zt=z.n(Ft),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,Et=ct.data,Yt=ct.active,wt=ct.showLine;return t.a.createElement(t.a.Fragment,null,t.a.createElement("div",{className:Yt===(Et==null?void 0:Et.id)?"".concat(zt.a.list," ").concat(zt.a.active):zt.a.list,style:It,onClick:function(){return sn(Et)}},(Et==null?void 0:Et.video)&&t.a.createElement("div",{className:zt.a.left},t.a.createElement("img",{src:Et==null?void 0:Et.video_cover}),t.a.createElement("div",null,t.a.createElement("img",{src:Re.a}),t.a.createElement("span",null,Et==null?void 0:Et.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/"+(Et==null?void 0:Et.image_url),width:30,height:30}),t.a.createElement("div",{title:Et==null?void 0:Et.name,className:zt.a.title},Et==null?void 0:Et.name),(Et==null?void 0:Et.is_authority)&&t.a.createElement("div",{className:zt.a.b},"\u5B98\u65B9"),(Et==null?void 0:Et.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:(Et==null?void 0:Et.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(Et)}},t.a.createElement("img",{src:Et!=null&&Et.user_liker?oe.a:K.a}),t.a.createElement("span",{style:{color:Et!=null&&Et.user_liker?"#0152d9":"#656f87"}},Et==null?void 0:Et.praises_count)),t.a.createElement("span",null,t.a.createElement("img",{src:Oe.a}),t.a.createElement("span",null,Et==null?void 0:Et.discusses_count)),t.a.createElement("span",null,t.a.createElement("img",{src:lt.a}),t.a.createElement("span",null,Et==null?void 0:Et.viewed_count)),Object(Qt.v)()&&t.a.createElement("span",{className:"current",style:{color:"#0152d9",marginRight:0,userSelect:"none"},onClick:function(jt){jt.stopPropagation(),St(Et)}},Et!=null&&Et.is_hidden?"\u53D6\u6D88\u9690\u85CF":"\u9690\u85CF")))),wt&&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"),pe=z.n(ae),se=function(ct,xt){var It,sn,fn,St=xt.payload.uploadInfo,Et=St===void 0?{}:St;switch(xt.type){case"addVideo":return{videoList:[].concat(Object(Xe.a)(ct.videoList),[{name:Et.file.name,size:Et.file.size,type:Et.file.type,fileHash:Et.fileHash,state:Et.state,video_id:Et.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:Et.videoId,fileHash:Et.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,Et=ct.active,Yt=V.a.useForm(),wt=Object(o.a)(Yt,1),ln=wt[0],jt=Object(n.useState)({}),pn=Object(o.a)(jt,2),Yn=pn[0],Dn=pn[1],_n=Object(n.useState)(!1),er=Object(o.a)(_n,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:[]}),_r=Object(o.a)(pr,2),ir=_r[0],dr=_r[1],jn=Object(Qt.x)(),Gt=Object(m.i)(),vn=Object(n.useRef)();Object(n.useEffect)(function(){Et&&tr()},[Et]);var tr=function(){var bn=Object(d.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(g.k)(St,{active:Et});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(d.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),!Et){$r.next=9;break}return or.active=Et,$r.next=6,Object(g.j)(St,or);case 6:vr=$r.sent,$r.next=12;break;case 9:return $r.next=11,Object(g.a)(St,or);case 11:vr=$r.sent;case 12:((Gn=vr)===null||Gn===void 0?void 0:Gn.status)===0&&(console.log(Et||((Rr=vr)===null||Rr===void 0?void 0:Rr.id),44),fn(Et||((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:pe.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:pe.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,Et?"\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(De.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")))},_t=$e,it=z("cWXX"),Vt=z("/ezw"),At=z("CaVn"),Bt=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],Et=fn[1];return t.a.createElement("aside",{className:"mt10"},t.a.createElement(De.a,{defaultValue:St,id:"writeForumsReviewId",onChange:function(wt){Et(wt)},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(d.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,Et=ct.onReplyDiscuss,Yt=ct.thirdlyReply,wt=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 wt(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:Et}),t.a.createElement("div",{style:{textAlign:"end",paddingTop:20},onClick:function(){return wt(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,Et=ct.onReplyDiscuss,Yt=ct.secondReply,wt=ct.setSecondReply,ln=ct.thirdlyReply,jt=ct.setThirdlyReply,pn=ct.onPlusDiscuss,Yn=Object(n.useState)(!1),Dn=Object(o.a)(Yn,2),_n=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;wt(null),er(!_n)},style:{color:_n?"#0152d9":"#999999"}},t.a.createElement("i",{className:"iconfont icon-xiaopinglun2 mr3"}),t.a.createElement("span",null,_n?"\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),wt(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){Et(Pn,Kn),er(!0)}}),_n&&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:Et})})))))},_i=Fr,vi=function(ct){var xt=ct.identifier,It=ct.active,sn=ct.onOk,fn=Object(n.useState)(""),St=Object(o.a)(fn,2),Et=St[0],Yt=St[1],wt=Object(n.useState)(1),ln=Object(o.a)(wt,2),jt=ln[0],pn=ln[1],Yn=Object(n.useState)([]),Dn=Object(o.a)(Yn,2),_n=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],_r=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(d.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,_e({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(d.a)(i.a.mark(function yn(){var Ln;return i.a.wrap(function(Xt){for(;;)switch(Xt.prev=Xt.next){case 0:if(!(Et==="")){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:Et},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(d.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,_r(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(d.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(De.a,{defaultValue:Et,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")))),_n==null?void 0:_n.map(function(Jn){return t.a.createElement(_i,{secondReply:pr,setSecondReply:_r,thirdlyReply:jn,setThirdlyReply:Gt,key:Jn.id,data:Jn,onReplyDiscuss:ar,onPlusDiscuss:mr})}),t.a.createElement(Pe.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,Et,Yt,wt,ln,jt,pn=ct.active,Yn=ct.identifier,Dn=ct.onAssist,_n=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),_r=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(d.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(g.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(d.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(g.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(d.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(g.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:Bt.a.listDetails},t.a.createElement(Vt.a,{className:"pt20 pl20 pr20",loading:_r,active:!0,paragraph:{rows:5}},t.a.createElement("div",{className:Bt.a.head},t.a.createElement("div",{className:Bt.a.name},t.a.createElement("div",{title:Gt==null?void 0:Gt.name,className:Bt.a.title},Gt==null?void 0:Gt.name),(Gt==null?void 0:Gt.is_authority)&&t.a.createElement("div",{className:Bt.a.b},"\u5B98\u65B9"),(Gt==null?void 0:Gt.is_excellent)&&t.a.createElement("div",{className:Bt.a.a},"\u7CBE\u9009")),t.a.createElement("div",{className:Bt.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",ze()(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:Bt.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 _n(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:Bt.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:Bt.a.video},t.a.createElement(b.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||((Et=St[0])===null||Et===void 0))?void 0:Et.cover_url,src:(Gt==null||((Yt=Gt.videos)===null||Yt===void 0||((wt=Yt[0])===null||wt===void 0))?void 0:wt.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:Bt.a.html,value:(Gt==null?void 0:Gt.content)||""}),t.a.createElement("div",{onClick:function(){return mr(Gt)},className:Bt.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:Bt.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"))))},Er=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},Et=Object(n.useState)(Object(a.a)({},St)),Yt=Object(o.a)(Et,2),wt=Yt[0],ln=Yt[1],jt=Object(n.useState)(!1),pn=Object(o.a)(jt,2),Yn=pn[0],Dn=pn[1],_n=Object(n.useState)(0),er=Object(o.a)(_n,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),_r=Object(o.a)(pr,2),ir=_r[0],dr=_r[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(d.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&&wt.page===1&&(nr[0]=!1),(wt.page-1)*wt.limit+(sr+1)===wt.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(d.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(g.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(){(wt==null?void 0:wt.sort_direction)===null?wt.sort_direction="asc":(wt==null?void 0:wt.sort_direction)==="asc"?wt.sort_direction="desc":(wt==null?void 0:wt.sort_direction)==="desc"&&(wt.sort_direction=null),wt.page=1,Rr(),ln(Object(a.a)({},wt)),Bn(wt)},Mn=function(){wt.page=1,wt.search=wt==null?void 0:wt.save_search,Rr(),ln(Object(a.a)({},wt)),Bn(wt)},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),wt.page=1,ln(Object(a.a)({},wt)),Bn(wt)},ki=function(Tn){Xt(3),dr(Tn),ln(Object(a.a)({},wt)),Bn(wt)},$r=function(Tn){ln(Object(a.a)({},wt)),Bn(wt)},ji=function(){var Vn=Object(d.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(g.c)(xt,{active:nr==null?void 0:nr.id});case 2:sr=Nn.sent,sr.status===0&&(Bn(wt),lr(rr+1));case 4:case"end":return Nn.stop()}},Tn)}));return function(nr){return Vn.apply(this,arguments)}}(),na=function(){var Vn=Object(d.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(g.e)(xt,{active:nr==null?void 0:nr.id});case 2:sr=Nn.sent,sr.status===0&&(Bn(wt),lr(rr+1));case 4:case"end":return Nn.stop()}},Tn)}));return function(nr){return Vn.apply(this,arguments)}}(),Hi=function(){var Vn=Object(d.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(g.i)(xt,{active:nr==null?void 0:nr.id});case 2:sr=Nn.sent,sr.status===0&&(Rr(),Bn(wt));case 4:case"end":return Nn.stop()}},Tn)}));return function(nr){return Vn.apply(this,arguments)}}(),ui=function(Tn){wt.page=Tn,ln(Object(a.a)({},wt)),Bn(wt)},zi=function(){var Vn=Object(d.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(!(wt.page===1)){kn.next=10;break}return C.b.warn("\u4E0A\u4E00\u9898\u89E3\u4E0D\u5B58\u5728"),kn.abrupt("return");case 10:if(!(wt.page!==1)){kn.next=17;break}return wt.page=wt.page-1,ln(Object(a.a)({},wt)),kn.next=15,Bn(wt);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(!((wt.page-1)*wt.limit+(Hr+1)===wt.total)){kn.next=28;break}return C.b.warn("\u4E0B\u4E00\u9898\u89E3\u4E0D\u5B58\u5728"),kn.abrupt("return");case 28:if(!(Hr+1===wt.limit)){kn.next=37;break}return wt.page=wt.page+1,ln(Object(a.a)({},wt)),kn.next=33,Bn(wt);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:Tt.a.wrap,ref:en},t.a.createElement("div",{className:Tt.a.head},t.a.createElement("div",{className:Tt.a.sort,onClick:bn},t.a.createElement("span",null,"\u6700\u65B0"),t.a.createElement("aside",null,t.a.createElement(hr.a,{style:{color:(wt==null?void 0:wt.sort_direction)==="asc"?"#0152d9":"#bfbfbf"}}),t.a.createElement(Ui.a,{style:{color:(wt==null?void 0:wt.sort_direction)==="desc"?"#0152d9":"#bfbfbf"}}))),t.a.createElement(ne.a.Search,{value:wt.save_search,className:Tt.a["oj-width-input"],placeholder:"\u641C\u7D22\u9898\u89E3",onChange:function(Tn){wt.save_search=Tn.target.value,ln(Object(a.a)({},wt))},onSearch:Mn}),t.a.createElement("div",{onClick:Gn,className:Tt.a.btn},t.a.createElement("img",{src:kr.a}),"\u5199\u9898\u89E3")),t.a.createElement("div",{className:Tt.a.listWarp},t.a.createElement(b.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(Pe.a,{className:Tt.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:wt.total,showSizeChanger:!1,current:wt==null?void 0:wt.page,onChange:ui,hideOnSinglePage:!0,showQuickJumper:!0}),Kt>0&&t.a.createElement("div",{className:Tt.a.fixedRight,style:{width:Rn}},Kt===1&&t.a.createElement(_t,{identifier:xt,onClose:Rr,onOk:ei}),Kt===2&&t.a.createElement(_t,{active:ir,identifier:xt,onClose:Rr,onOk:ki}),Kt===3&&t.a.createElement(Er,{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,Et=ct.setIndex,Yt={page:1,per_page:30,total:0,tag_discipline_id:[],search:"",save_search:"",difficulty:null},wt=Object(n.useState)(Yt),ln=Object(o.a)(wt,2),jt=ln[0],pn=ln[1],Yn=Object(n.useState)([]),Dn=Object(o.a)(Yn,2),_n=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],_r=lr[1],ir=Object(n.useRef)([]),dr=Object(n.useRef)(null),jn=Object(m.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(d.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(g.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(d.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:Et("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:Et("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(d.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(d.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 _r(!0),or.next=3,Object(g.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"}),Et({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(g.o)(wt,{limit:15,page:Kn});case 16:Ji=Mr.sent,Et({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(g.s)(wt,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),Et({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(d.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,Et({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(d.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(g.l)(wt,"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&&(Et({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"}),Et({type:qt.SET_DEBUGING,payload:!1}),Mr.abrupt("return");case 13:Fi===0&&(Et({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"}),Et({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(_n.test_case.input)},mn.next=13,Object(g.h)(wt,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:Et({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),Et({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;Et({type:qt.SET_DATA,payload:Object(a.a)(Object(a.a)({},_n),{},{test_case:{input:Sn}})})}var Vn=function(){var Wn=Object(d.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 Et({type:qt.SET_LOADING,payload:!0}),mn.next=3,ei();case 3:if(tn=mn.sent,!(tn.status===0)){mn.next=14;break}return Et({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(g.w)(wt);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(){Et({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(d.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(g.q)(wt,{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(d.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(g.t)(wt,{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(){Et({type:qt.SET_SHOW_NOTE,payload:!0})}function Nn(){Et({type:qt.SET_SHOW_NOTE,payload:!1})}function ni(Wn){return jr.apply(this,arguments)}function jr(){return jr=Object(d.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(g.b)(wt,Sn);case 2:Et({type:qt.GET_DATA,payload:{showNote:!1,data:Object(a.a)(Object(a.a)({},_n),{},{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:_n==null||((ct=_n.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:wt,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(d.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(g.u)(bn.id,{container_type:"Hack",type:1});case 2:Sn=Tr.sent,Xn=Sn.praise_count,tn=Object(a.a)(Object(a.a)({},_n),{},{hack:Object(a.a)(Object(a.a)({},bn),{},{praises_count:Xn,user_praise:!bn.user_praise})}),Et({type:qt.SET_DATA,payload:tn});case 6:case"end":return Tr.stop()}},Wn)})),Mi.apply(this,arguments)}var Ki={topicId:wt,submitResult:Rn,submitRecords:Pn,submitting:lr,page:Kn,onPageChange:Rr,hack:bn,user:_n==null?void 0:_n.user,onTriggerPraise:wi};return console.log(_n,hn==null?void 0:hn.current,"data--------"),t.a.createElement(t.a.Fragment,null,t.a.createElement(b.a,{className:"oj-custom-large-spin",size:"large",spinning:Dn},_n?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(f.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,Et=gt.onShowCodeSetting,Yt=gt.onResetCode,wt=Object(m.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:Et},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,Et=gt.onAddNote,Yt=gt.debugResult,wt=gt.language,ln=gt.debuging,jt=gt.submitting,pn=gt.executingMessage,Yn=gt.code,Dn=gt.onSubmitCode,_n=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:_n,onChangeCode:er,onSubmitCode:Dn,onChangeInput:Rn};return t.a.createElement("div",{className:"right-panel"},t.a.createElement(S.a,{language:wt,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:Et})),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"),b=z("JX7q"),T=z("Ji7U"),C=z("LK+K"),c=z("q1tI"),p=z("TSYQ"),d=z.n(p),o=z("sboe"),a=z("OZM5"),u=function(E){var g=E.prefixCls,y=E.level,x=E.isStart,l=E.isEnd;if(!y)return null;for(var S="".concat(g,"-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 Pe=window.getComputedStyle(de),ye=Pe.getPropertyValue("box-sizing")||Pe.getPropertyValue("-moz-box-sizing")||Pe.getPropertyValue("-webkit-box-sizing"),Ee=parseFloat(Pe.getPropertyValue("padding-bottom"))+parseFloat(Pe.getPropertyValue("padding-top")),Ge=parseFloat(Pe.getPropertyValue("border-bottom-width"))+parseFloat(Pe.getPropertyValue("border-top-width")),Ue=D.map(function(He){return"".concat(He,":").concat(Pe.getPropertyValue(He))}).join(";"),Fe={sizingStyle:Ue,paddingSize:Ee,borderSize:Ge,boxSizing:ye};return Ce&&Se&&(I[Se]=Fe),Fe}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,Pe=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 ye=H(de,Ce),Ee=ye.paddingSize,Ge=ye.borderSize,Ue=ye.boxSizing,Fe=ye.sizingStyle;B.setAttribute("style","".concat(Fe,";").concat(A)),B.value=de.value||de.placeholder||"";var He=Number.MIN_SAFE_INTEGER,be=Number.MAX_SAFE_INTEGER,me=B.scrollHeight,We;if(Ue==="border-box"?me+=Ge:Ue==="content-box"&&(me-=Ee),Se!==null||Pe!==null){B.value=" ";var ze=B.scrollHeight-Ee;Se!==null&&(He=ze*Se,Ue==="border-box"&&(He=He+Ee+Ge),me=Math.max(He,me)),Pe!==null&&(be=ze*Pe,Ue==="border-box"&&(be=be+Ee+Ge),We=me>be?"":"hidden",me=Math.min(be,me))}return{height:me,minHeight:He,maxHeight:be,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(Pe){var ye;return Object(Q.a)(this,Se),ye=Ce.call(this,Pe),ye.nextFrameActionId=void 0,ye.resizeFrameId=void 0,ye.textArea=void 0,ye.saveTextArea=function(Ee){ye.textArea=Ee},ye.handleResize=function(Ee){var Ge=ye.state.resizeStatus,Ue=ye.props,Fe=Ue.autoSize,He=Ue.onResize;if(Ge!==X.NONE)return;typeof He=="function"&&He(Ee),Fe&&ye.resizeOnNextFrame()},ye.resizeOnNextFrame=function(){cancelAnimationFrame(ye.nextFrameActionId),ye.nextFrameActionId=requestAnimationFrame(ye.resizeTextarea)},ye.resizeTextarea=function(){var Ee=ye.props.autoSize;if(!Ee||!ye.textArea)return;var Ge=Ee.minRows,Ue=Ee.maxRows,Fe=te(ye.textArea,!1,Ge,Ue);ye.setState({textareaStyles:Fe,resizeStatus:X.RESIZING},function(){cancelAnimationFrame(ye.resizeFrameId),ye.resizeFrameId=requestAnimationFrame(function(){ye.setState({resizeStatus:X.RESIZED},function(){ye.resizeFrameId=requestAnimationFrame(function(){ye.setState({resizeStatus:X.NONE}),ye.fixFirefoxAutoScroll()})})})})},ye.renderTextArea=function(){var Ee=ye.props,Ge=Ee.prefixCls,Ue=Ge===void 0?"rc-textarea":Ge,Fe=Ee.autoSize,He=Ee.onResize,be=Ee.className,me=Ee.disabled,We=ye.state,ze=We.textareaStyles,nt=We.resizeStatus,re=Object(l.a)(ye.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),k=O()(Ue,be,Object(C.a)({},"".concat(Ue,"-disabled"),me));"value"in re&&(re.value=re.value||"");var U=Object(T.a)(Object(T.a)(Object(T.a)({},ye.props.style),ze),nt===X.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return b.createElement(x,{onResize:ye.handleResize,disabled:!(Fe||He)},b.createElement("textarea",Object(le.a)({},re,{className:k,style:U,ref:ye.saveTextArea})))},ye.state={textareaStyles:{},resizeStatus:X.NONE},ye}return Object(j.a)(Se,[{key:"componentDidUpdate",value:function(ye){(ye.value!==this.props.value||!V()(ye.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 ye=this.textArea.selectionStart,Ee=this.textArea.selectionEnd;this.textArea.setSelectionRange(ye,Ee)}}catch(Ge){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Se}(b.Component),Y=ne,ee=function(de){Object(w.a)(Se,de);var Ce=Object(P.a)(Se);function Se(Pe){var ye;Object(Q.a)(this,Se),ye=Ce.call(this,Pe),ye.resizableTextArea=void 0,ye.focus=function(){ye.resizableTextArea.textArea.focus()},ye.saveTextArea=function(Ge){ye.resizableTextArea=Ge},ye.handleChange=function(Ge){var Ue=ye.props.onChange;ye.setValue(Ge.target.value,function(){ye.resizableTextArea.resizeTextarea()}),Ue&&Ue(Ge)},ye.handleKeyDown=function(Ge){var Ue=ye.props,Fe=Ue.onPressEnter,He=Ue.onKeyDown;Ge.keyCode===13&&Fe&&Fe(Ge),He&&He(Ge)};var Ee=typeof Pe.value=="undefined"||Pe.value===null?Pe.defaultValue:Pe.value;return ye.state={value:Ee},ye}return Object(j.a)(Se,[{key:"setValue",value:function(ye,Ee){"value"in this.props||this.setState({value:ye},Ee)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return b.createElement(Y,Object(le.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(ye){return"value"in ye?{value:ye.value}:null}}]),Se}(b.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"),b=z.n(P),T=z("lOMy"),C=z.n(T),c=w.a.Option;Ve.a=function(p){var d=p.onFontSizeChange,o=p.cmFontSize,a=p.cmCodeMode,u=p.onCodeModeChange,s=p.onTabToSpace,h=p.className,i=h===void 0?"":h,n=p.tabToSpace,t=p.children;return b.a.createElement("div",{className:"tpi-code-setting ".concat(i)},b.a.createElement("h3",null,"\u4EE3\u7801\u683C\u5F0F"),b.a.createElement("section",null,b.a.createElement("div",{className:"file-item"},b.a.createElement("b",null,"\u663E\u793A\u6A21\u5F0F"),b.a.createElement(w.a,{bordered:!1,size:"small",value:a,onChange:u},b.a.createElement(c,{value:"vs"},"\u767D\u8272\u80CC\u666F"),b.a.createElement(c,{value:"vs-dark"},"\u9ED1\u8272\u80CC\u666F"))),b.a.createElement("div",{className:"file-item"},b.a.createElement("b",null,"\u5B57\u4F53\u5927\u5C0F"),b.a.createElement(w.a,{bordered:!1,size:"small",value:o,onChange:d},b.a.createElement(c,{value:12},"12px"),b.a.createElement(c,{value:14},"14px"),b.a.createElement(c,{value:16},"16px"),b.a.createElement(c,{value:18},"18px"),b.a.createElement(c,{value:20},"20px"),b.a.createElement(c,{value:22},"22px"))),b.a.createElement("div",{className:"file-item"},b.a.createElement("b",null,"Tab\u8F6C\u6362"),b.a.createElement(Q.a,{checked:n,onChange:s}))),b.a.createElement("h3",null,"\u5FEB\u6377\u952E"),b.a.createElement("section",null,b.a.createElement("div",{className:"file-item"},b.a.createElement("b",null,"\u4FDD\u5B58\u4EE3\u7801"),b.a.createElement("span",null,"Ctrl + S")),b.a.createElement("div",{className:"file-item"},b.a.createElement("b",null,"\u5524\u51FA\u5FEB\u6377\u952E\u5217\u8868"),b.a.createElement("span",null,"F1 / Alt + F1")),b.a.createElement("div",{className:"file-item"},b.a.createElement("b",null,"\u5DE6\u53F3\u7F29\u8FDB"),b.a.createElement("span",null,"Ctrl + ]/[")),b.a.createElement("div",{className:"file-item"},b.a.createElement("b",null,"\u8DF3\u5230\u5339\u914D\u7684\u62EC\u53F7"),b.a.createElement("span",null,"Ctrl + Shift + \\")),b.a.createElement("div",{className:"file-item"},b.a.createElement("b",null,"\u8F6C\u5230\u884C\u9996"),b.a.createElement("span",null,"Home")),b.a.createElement("div",{className:"file-item"},b.a.createElement("b",null,"\u8F6C\u5230\u884C\u5C3E"),b.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"),b=z("PpiC"),T=z("q1tI"),C=z.n(T),c=z("bdgK");function p(m,_,E,g,y){var x=_.getWordUntilPosition(E),l={startLineNumber:E.lineNumber,endLineNumber:E.lineNumber,startColumn:x.startColumn,endColumn:x.endColumn},S=g.map(function(O){return{label:O,kind:m.languages.CompletionItemKind.Keyword,insertText:O,insertTextRules:m.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:l}});return y.map(function(O){S.push(Object(le.a)(Object(le.a)({},O),{},{range:l}))}),S}var d=function(m){var _={label:"ifelse",kind:m.languages.CompletionItemKind.Method,insertText:["if (${1:condition}) {"," $0","} else {"," ","}"].join(` `),insertTextRules:m.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"];m.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(l,S){var O=p(m,l,S,E,[_]);return{suggestions:O}}});var g=["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"];m.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(l,S){var O=[{label:"print",kind:m.languages.CompletionItemKind.Snippet,insertText:["print($0)"].join(` `),insertTextRules:m.languages.CompletionItemInsertTextRule.InsertAsSnippet}],A=p(m,l,S,g,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"];m.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(l,S){var O=[_,{label:"main",kind:m.languages.CompletionItemKind.Snippet,insertText:["public static void main(String[] args) {"," $0","}"].join(` `),insertTextRules:m.languages.CompletionItemInsertTextRule.InsertAsSnippet},{label:"System.out.print",kind:m.languages.CompletionItemKind.Snippet,insertText:["System.out.print($0)"].join(` `),insertTextRules:m.languages.CompletionItemInsertTextRule.InsertAsSnippet}],A=p(m,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 u(m){return/^\d+$/.test(m)?"".concat(m,"px"):m}function s(){}var h=!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 m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],_=m;if(Array.isArray(m)){for(var E=0;E0||Ct.target.offsetWidth>0)&&be.current.instance.layout()}}catch(Ht){Ze.e(Ht)}finally{Ze.f()}}),Le.observe(He.current)),Le}function $(){j.b.warn(decodeURIComponent(o))}var J=function(){var Te=be.current.instance;if(x!=null&&Te&&k){var Ze=Te.getModel();Ze&&x!==Ze.getValue()&&(h=!0,Ze.setValue(x),Te.layout(),h=!1)}};Object(T.useEffect)(function(){me.current&&clearTimeout(me.current),me.current=setTimeout(function(){J()},500)},[x,k,be.current]);function xe(){var Le=be.current.instance;if(Le){var Te=Le.getSelection(),Ze=be.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(Y&&be.current.instance){var Te=be.current.instance.getContentHeight();_e(Te0||Se.target.offsetWidth>0)&&Y.layout()}}catch(Pe){de.e(Pe)}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(Y){t=Y;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=u(E),X=u(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(d){return typeof d=="object"&&d!=null&&d.nodeType===1}function Q(d,o){return(!o||d!=="hidden")&&d!=="visible"&&d!=="clip"}function j(d,o){if(d.clientHeighto||h>d&&i=o&&n>=a?h-d-u:i>o&&na?i-o+s:0}var P=function(d,o){var a=window,u=o.scrollMode,s=o.block,h=o.inline,i=o.boundary,n=o.skipOverflowHiddenElements,t=typeof i=="function"?i:function(ze){return ze!==i};if(!le(d))throw new TypeError("Invalid target");for(var f=document.scrollingElement||document.documentElement,v=[],m=d;le(m)&&t(m);){if((m=m.parentElement)===f){v.push(m);break}m!=null&&m===document.body&&j(m)&&!j(document.documentElement)||m!=null&&j(m,n)&&v.push(m)}for(var _=a.visualViewport?a.visualViewport.width:innerWidth,E=a.visualViewport?a.visualViewport.height:innerHeight,g=window.scrollX||pageXOffset,y=window.scrollY||pageYOffset,x=d.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=h==="center"?I+S/2:h==="end"?A:I,te=[],W=0;W=0&&I>=0&&D<=E&&A<=_&&O>=ee&&D<=de&&I>=Ce&&A<=ce)return te;var Se=getComputedStyle(V),Pe=parseInt(Se.borderLeftWidth,10),ye=parseInt(Se.borderTopWidth,10),Ee=parseInt(Se.borderRightWidth,10),Ge=parseInt(Se.borderBottomWidth,10),Ue=0,Fe=0,He="offsetWidth"in V?V.offsetWidth-V.clientWidth-Pe-Ee:0,be="offsetHeight"in V?V.offsetHeight-V.clientHeight-ye-Ge:0;if(f===V)Ue=s==="start"?B:s==="end"?B-E:s==="nearest"?w(y,y+E,E,ye,Ge,y+B,y+B+l,l):B-E/2,Fe=h==="start"?H:h==="center"?H-_/2:h==="end"?H-_:w(g,g+_,_,Pe,Ee,g+H,g+H+S,S),Ue=Math.max(0,Ue+y),Fe=Math.max(0,Fe+g);else{Ue=s==="start"?B-ee-ye:s==="end"?B-de+Ge+be:s==="nearest"?w(ee,de,ne,ye,Ge+be,B,B+l,l):B-(ee+ne/2)+be/2,Fe=h==="start"?H-Ce-Pe:h==="center"?H-(Ce+Y/2)+He/2:h==="end"?H-ce+Ee+He:w(Ce,ce,Y,Pe,Ee+He,H,H+S,S);var me=V.scrollLeft,We=V.scrollTop;B+=We-(Ue=Math.max(0,Math.min(We+Ue,V.scrollHeight-ne+be))),H+=me-(Fe=Math.max(0,Math.min(me+Fe,V.scrollWidth-Y+He)))}te.push({el:V,top:Ue,left:Fe})}return te};function b(d){return d===Object(d)&&Object.keys(d).length!==0}function T(d,o){o===void 0&&(o="auto");var a="scrollBehavior"in document.body.style;d.forEach(function(u){var s=u.el,h=u.top,i=u.left;s.scroll&&a?s.scroll({top:h,left:i,behavior:o}):(s.scrollTop=h,s.scrollLeft=i)})}function C(d){return d===!1?{block:"end",inline:"nearest"}:b(d)?d:{block:"start",inline:"nearest"}}function c(d,o){var a=!d.ownerDocument.documentElement.contains(d);if(b(o)&&typeof o.behavior=="function")return o.behavior(a?[]:P(d,o));if(a)return;var u=C(o);return T(P(d,u),u.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(b,T){var C=Q.a.get("__ec");C||(C={}),C[b]=T,Q.a.set("__ec",C)}function P(b,T){var C=Q.a.get("__ec");return C?C[b]===void 0?T:C[b]: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(b){delete P[b]}),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(b){var T=b.defaultX,C=T===void 0?"40%":T,c=b.leftChild,p=b.rightChild,d=b.className,o=b.hideResize,a=o===void 0?!1:o,u=Object(Q.useState)(C),s=Object(le.a)(u,2),h=s[0],i=s[1],n=Object(Q.useRef)();function t(){n.current=!0}Object(Q.useEffect)(function(){function m(E){n.current&&i(E.pageX)}function _(){n.current=!1}return window.addEventListener("mousemove",m),window.addEventListener("mouseup",_),function(){window.removeEventListener("mousemove",m),window.removeEventListener("mouseup",_)}},[]);var f=typeof h=="number"&&h!==.01?"".concat(h,"px"):C,v="calc(100% - ".concat(a?"0px":"4px"," - ").concat(f,")");return j.a.createElement("div",{className:"split-panel-container ".concat(d)},j.a.createElement("section",{style:{width:f,display:h===.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?Y-1:0),ce=1;ce1?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 Y=D.formatWrapper(ne);return _(D.props.decimalSeparator)&&(Y=Y.toString().replace(".",D.props.decimalSeparator)),Y},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=u(u({},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 Y="value"in this.props?B:this.state.value;"max"in this.props&&D.max!==te&&typeof Y=="number"&&Y>te&&H&&H(te),"min"in this.props&&D.min!==W&&typeof Y=="number"&&Y1&&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),Y=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),Y&&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(_(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:_(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),Be=Qe||H||te,Ie=Xe||H||te,Me=d()("".concat(B,"-handler"),"".concat(B,"-handler-up"),Object(Q.a)({},"".concat(B,"-handler-up-disabled"),Be)),_e=d()("".concat(B,"-handler"),"".concat(B,"-handler-down"),Object(Q.a)({},"".concat(B,"-handler-down-disabled"),Ie)),Ae=W?{onTouchStart:Be?i:this.up,onTouchEnd:this.stop}:{onMouseDown:Be?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:Ne,style:de,title:Ce,onMouseEnter:Se,onMouseLeave:Pe,onMouseOver:ye,onMouseOut:Ee,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":Be,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:_e}),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:Ge,type:He,placeholder:be,onPaste:q,onClick:Ue,onMouseUp:this.onMouseUp,className:"".concat(B,"-input"),tabIndex:Fe,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:me,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(mt),pattern:ze,inputMode:We,onInput:$},je))))}}]),O}(c.a.Component);g.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:m,min:-m,step:1,style:{},onChange:i,onKeyDown:i,onPressEnter:i,onFocus:i,onBlur:i,parser:t,required:!1,autoComplete:"off"};var y=g,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))||Y&&(!ye||ye&&(W.scrollLeft>=ce&&V<0||W.scrollLeft<=0&&V>0))?H(te,W.parentNode,V,X):!1};function g(H){var te=y();return function(){var V=Object(b.a)(H),X;if(te){var ne=Object(b.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=g(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 Y=ne.currentTarget,ee=ne.changedTouches[0].clientX-X.startPos.x,ce=ne.changedTouches[0].clientY-X.startPos.y;(Y===X.maskDom||Y===X.handlerDom||Y===X.contentDom&&E(Y,ne.target,ee,ce))&&ne.cancelable&&ne.preventDefault()},X.transitionEnd=function(ne){var Y=ne.target;f(Y,n,X.transitionEnd),Y.style.transition=""},X.onKeyDown=function(ne){if(ne.keyCode===u.a.ESC){var Y=X.props.onClose;ne.stopPropagation(),Y&&Y(ne)}},X.onWrapperTransitionEnd=function(ne){var Y=X.props,ee=Y.open,ce=Y.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,Y=ne.open,ee=ne.width,ce=ne.height,de=X.getHorizontalBoolAndPlacementName(),Ce=de.isHorizontal,Se=de.placementName,Pe=X.contentDom?X.contentDom.getBoundingClientRect()[Ce?"width":"height"]:0,ye=(Ce?ee:ce)||Pe;X.setLevelAndScrolling(Y,Se,ye)},X.setLevelTransform=function(ne,Y,ee,ce){var de=X.props,Ce=de.placement,Se=de.levelMove,Pe=de.duration,ye=de.ease,Ee=de.showMask;X.levelDom.forEach(function(Ge){Ge.style.transition="transform ".concat(Pe," ").concat(ye),t(Ge,n,X.transitionEnd);var Ue=ne?ee:0;if(Se){var Fe=v(Se,{target:Ge,open:ne});Ue=ne?Fe[0]:Fe[1]||0}var He=typeof Ue=="number"?"".concat(Ue,"px"):Ue,be=Ce==="left"||Ce==="top"?He:"-".concat(He);be=Ee&&Ce==="right"&&ce?"calc(".concat(be," + ").concat(ce,"px)"):be,Ge.style.transform=Ue?"".concat(Y,"(").concat(be,")"):""})},X.setLevelAndScrolling=function(ne,Y,ee){var ce=X.props.onChange;if(!_){var de=document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth?Object(a.a)(!0):0;X.setLevelTransform(ne,Y,ee,de),X.toggleScrollingToDrawerAndBody(de)}ce&&ce(ne)},X.toggleScrollingToDrawerAndBody=function(ne){var Y=X.props,ee=Y.getOpenCount,ce=Y.getContainer,de=Y.showMask,Ce=Y.open,Se=ce&&ce(),Pe=ee&&ee();if(Se&&Se.parentNode===document.body&&de){var ye=["touchstart"],Ee=[document.body,X.maskDom,X.handlerDom,X.contentDom];Ce&&document.body.style.overflow!=="hidden"?(ne&&X.addScrollingEffect(ne),Pe===1&&(document.body.style.overflow="hidden"),document.body.style.touchAction="none",Ee.forEach(function(Ge,Ue){if(!Ge)return;t(Ge,ye[Ue]||"touchmove",Ue?X.removeMoveHandler:X.removeStartHandler,X.passive)})):X.getCurrentDrawerSome()&&(Pe||(document.body.style.overflow=""),document.body.style.touchAction="",ne&&X.remScrollingEffect(ne),Ee.forEach(function(Ge,Ue){if(!Ge)return;f(Ge,ye[Ue]||"touchmove",Ue?X.removeMoveHandler:X.removeStartHandler,X.passive)}))}},X.addScrollingEffect=function(ne){var Y=X.props,ee=Y.placement,ce=Y.duration,de=Y.ease,Ce=Y.getOpenCount,Se=Y.switchScrollingEffect,Pe=Ce&&Ce();Pe===1&&Se();var ye="width ".concat(ce," ").concat(de),Ee="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(Ee,",").concat(ye),X.dom.style.width="",X.dom.style.transform="")})},X.remScrollingEffect=function(ne){var Y=X.props,ee=Y.placement,ce=Y.duration,de=Y.ease,Ce=Y.getOpenCount,Se=Y.switchScrollingEffect,Pe=Ce&&Ce();Pe||Se(!0),i&&(document.body.style.overflowX="hidden"),X.dom.style.transition="none";var ye,Ee="width ".concat(ce," ").concat(de),Ge="transform ".concat(ce," ").concat(de);switch(ee){case"left":{X.dom.style.width="100%",Ee="width 0s ".concat(de," ").concat(ce);break}case"right":{X.dom.style.transform="translateX(".concat(ne,"px)"),X.dom.style.width="100%",Ee="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)",ye="height 0s ".concat(de," ").concat(ce);break}default:break}clearTimeout(X.timeout),X.timeout=setTimeout(function(){X.dom&&(X.dom.style.transition="".concat(Ge,",").concat(ye?"".concat(ye,","):"").concat(Ee),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 Y=ne.level,ee=ne.getContainer;if(_)return;var ce=ee&&ee(),de=ce?ce.parentNode:null;if(X.levelDom=[],Y==="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 Y&&s(Y).forEach(function(Se){document.querySelectorAll(Se).forEach(function(Pe){X.levelDom.push(Pe)})})},X.getHorizontalBoolAndPlacementName=function(){var ne=X.props.placement,Y=ne==="left"||ne==="right",ee="translate".concat(Y?"X":"Y");return{isHorizontal:Y,placementName:ee}},X.state={_self:Object(p.a)(X)},X}return Object(j.a)(W,[{key:"componentDidMount",value:function(){var X=this;if(!_){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 Y=this.props,ee=Y.open,ce=Y.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,Y=ne.open,ee=ne.getContainer,ce=ee&&ee();Y!==X.open&&(Y&&this.domFocus(),ce&&ce.parentNode===document.body&&(x[this.drawerId]=!!Y),this.openLevelTransition())}},{key:"componentWillUnmount",value:function(){var X=this.props,ne=X.getOpenCount,Y=X.open,ee=X.switchScrollingEffect,ce=typeof ne=="function"&&ne();delete x[this.drawerId],Y&&(this.setLevelTransform(!1),document.body.style.touchAction=""),ce||(document.body.style.overflow="",ee(!0))}},{key:"render",value:function(){var X,ne=this,Y=this.props,ee=Y.className,ce=Y.children,de=Y.style,Ce=Y.width,Se=Y.height,Pe=Y.defaultOpen,ye=Y.open,Ee=Y.prefixCls,Ge=Y.placement,Ue=Y.level,Fe=Y.levelMove,He=Y.ease,be=Y.duration,me=Y.getContainer,We=Y.handler,ze=Y.onChange,nt=Y.afterVisibleChange,re=Y.showMask,k=Y.maskClosable,U=Y.maskStyle,q=Y.onClose,$=Y.onHandleClick,J=Y.keyboard,xe=Y.getOpenCount,ke=Y.switchScrollingEffect,dt=Object(le.a)(Y,["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"]),Ne=this.dom?ye:!1,je=o()(Ee,(X={},Object(c.a)(X,"".concat(Ee,"-").concat(Ge),!0),Object(c.a)(X,"".concat(Ee,"-open"),Ne),Object(c.a)(X,ee||"",!!ee),Object(c.a)(X,"no-mask",!re),X)),tt=this.getHorizontalBoolAndPlacementName(),mt=tt.placementName,Qe=Ge==="left"||Ge==="top"?"-100%":"100%",Xe=Ne?"":"".concat(mt,"(").concat(Qe,")"),Be=We&&C.cloneElement(We,{onClick:function(Me){We.props.onClick&&We.props.onClick(),$&&$(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:Ne&&J?this.onKeyDown:void 0,onTransitionEnd:this.onWrapperTransitionEnd}),re&&C.createElement("div",{className:"".concat(Ee,"-mask"),onClick:k?q:void 0,style:U,ref:function(Me){ne.maskDom=Me}}),C.createElement("div",{className:"".concat(Ee,"-content-wrapper"),style:{transform:Xe,msTransform:Xe,width:m(Ce)?"".concat(Ce,"px"):Ce,height:m(Se)?"".concat(Se,"px"):Se},ref:function(Me){ne.contentWrapper=Me}},C.createElement("div",{className:"".concat(Ee,"-content"),ref:function(Me){ne.contentDom=Me},onTouchStart:Ne&&re?this.removeStartHandler:void 0,onTouchMove:Ne&&re?this.removeMoveHandler:void 0},ce),Be))}}],[{key:"getDerivedStateFromProps",value:function(X,ne){var Y=ne.prevProps,ee=ne._self,ce={prevProps:X};if(Y!==void 0){var de=X.placement,Ce=X.level;de!==Y.placement&&(ee.contentDom=null),Ce!==Y.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(b.a)(H),X;if(te){var ne=Object(b.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(Y){var ee=X.props,ce=ee.onHandleClick,de=ee.open;if(ce&&ce(Y),typeof de=="undefined"){var Ce=X.state.open;X.setState({open:!Ce})}},X.onClose=function(Y){var ee=X.props,ce=ee.onClose,de=ee.open;ce&&ce(Y),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,Y=ne.defaultOpen,ee=ne.getContainer,ce=ne.wrapperClassName,de=ne.forceRender,Ce=ne.handler,Se=Object(le.a)(ne,["defaultOpen","getContainer","wrapperClassName","forceRender","handler"]),Pe=this.state.open;if(!ee)return C.createElement("div",{className:ce,ref:function(Ge){X.dom=Ge}},C.createElement(S,Object.assign({},Se,{open:Pe,handler:Ce,getContainer:function(){return X.dom},onClose:this.onClose,onHandleClick:this.onHandleClick})));var ye=!!Ce||de;return C.createElement(T.a,{visible:Pe,forceRender:ye,getContainer:ee,wrapperClassName:ce},function(Ee){var Ge=Ee.visible,Ue=Ee.afterClose,Fe=Object(le.a)(Ee,["visible","afterClose"]);return C.createElement(S,Object.assign({},Se,Fe,{open:Ge!==void 0?Ge:Pe,afterVisibleChange:Ue!==void 0?Ue:Se.afterVisibleChange,handler:Ce,onClose:X.onClose,onHandleClick:X.onHandleClick}))})}}],[{key:"getDerivedStateFromProps",value:function(X,ne){var Y=ne.prevProps,ee={prevProps:X};return typeof Y!="undefined"&&X.open!==Y.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"),b=z.n(P),T=z("TSYQ"),C=z.n(T),c=z("c+Xe"),p=z("sR1s");function d(h){return h&&Object(w.a)(h)==="object"&&!Array.isArray(h)&&!P.isValidElement(h)}function o(h){return typeof h=="string"?!0:Object(c.c)(h)}function a(h,i){var n,t=h.prefixCls,f=h.className,v=h.record,m=h.index,_=h.dataIndex,E=h.render,g=h.children,y=h.component,x=y===void 0?"td":y,l=h.colSpan,S=h.rowSpan,O=h.fixLeft,A=h.fixRight,D=h.firstFixLeft,I=h.lastFixLeft,B=h.firstFixRight,H=h.lastFixRight,te=h.appendNode,W=h.additionalProps,V=W===void 0?{}:W,X=h.ellipsis,ne=h.align,Y=h.rowType,ee=h.isSticky,ce="".concat(t,"-cell"),de,Ce;if(g)Ce=g;else{var Se=Object(p.b)(v,_);if(Ce=Se,E){var Pe=E(Se,v,m);d(Pe)?(Ce=Pe.children,de=Pe.props):Ce=Pe}}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 ye=de||{},Ee=ye.colSpan,Ge=ye.rowSpan,Ue=ye.style,Fe=ye.className,He=Object(j.a)(ye,["colSpan","rowSpan","style","className"]),be=Ee!==void 0?Ee:l,me=Ge!==void 0?Ge:S;if(be===0||me===0)return null;var We={},ze=typeof O=="number",nt=typeof A=="number";ze&&(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||Y==="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},He),V),{},{colSpan:be&&be!==1?be:null,rowSpan:me&&me!==1?me:null,className:C()(ce,f,(n={},Object(le.a)(n,"".concat(ce,"-fix-left"),ze),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"),(ze||nt)&&ee),n),V.className,Fe),style:Object(Q.a)(Object(Q.a)(Object(Q.a)(Object(Q.a)({},V.style),re),We),Ue),ref:o(x)?i:null});return P.createElement(x,Object.assign({},q),te,Ce)}var u=P.forwardRef(a);u.displayName="Cell";var s=P.memo(u,function(h,i){return i.shouldCellUpdate?!i.shouldCellUpdate(i.record,h.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,b=Ve[et];b&&typeof b=="object"&&typeof b.toJSON=="function"&&(b=b.toJSON(et)),typeof rep=="function"&&(b=rep.call(Ve,et,b));switch(typeof b){case"string":return quote(b);case"number":return isFinite(b)?String(b):"null";case"boolean":case"null":return String(b);case"object":if(!b)return"null";if(gap+=indent,P=[],Object.prototype.toString.apply(b)==="[object Array]"){for(j=b.length,z=0;z0&&!this.paused&&!this.ended&&this.readyState>2}});function h(t,f){return t-f}function i(t){t.sort(h);for(var f=0,v=0;v1&&arguments[1]!==void 0?arguments[1]:!1,Be={point:X.current.currentTime};k?(Be.log_id=k,Be.watch_duration=i(ke),Be.total_duration=nt):(x?(Be.video_id=parseInt(E,10),Be.course_id=x):Be.video_id=E,Be.duration=ze,Be.device=be),Xe&&(Be.ed="1");function Ie(){return Me.apply(this,arguments)}function Me(){return Me=Object(j.a)(P.a.mark(function _e(){var Ae;return P.a.wrap(function(Te){for(;;)switch(Te.prev=Te.next){case 0:return J=!0,Te.next=3,g(Be);case 3:Ae=Te.sent,k=Ae,J=!1,Qe&&Qe();case 7:case"end":return Te.stop()}},_e)})),Me.apply(this,arguments)}Ie()},[E,x]);Object(b.useEffect)(function(){Q.b.destroy();var Qe=null;return C.a.isSupported&&V&&m&&(m==null?void 0:m.indexOf(".m3u8"))<0?(Qe=C.a.createPlayer({type:"flv",volume:.8,cors:!0,url:m,muted:!1}),X.current&&(Qe.attachMediaElement(X.current),Qe.load())):X.current.setAttribute("src",m),je(),function(){Qe&&(Qe.unload(),Qe.pause(),Qe.destroy(),Qe=null)}},[X,V,m]);function Ne(){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(){Ee.current.style.display="none",Ue.current.style.display="none",Ge.current.style.display="none",X.current.muted||X.current.volume===0?Ee.current.style.display="block":X.current.volume>0&&X.current.volume<=.5?Ue.current.style.display="block":Ge.current.style.display="block"}Object(b.useEffect)(function(){var Qe=document.getElementById("play"),Xe=document.querySelectorAll(".playback-icons use");function Be(){D(),l&&!me.current&&(X.current.currentTime=l),me.current=!0,ke.push(X.current.currentTime),U||(U=!0,_&&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:Ne(),ke.push(X.current.currentTime),_&&dt(function(){k=null,re=0,U=!1,J=!1,xe=!1,ke=[],nt=0,$=1},!0);case 3:case"end":return st.stop()}},at)})),Me.apply(this,arguments)}function _e(){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));Pe.current.innerText="".concat(at.minutes,":").concat(at.seconds),Pe.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")),_e(),Ae();var st=ne.current.getBoundingClientRect(),De=st.width,Ke=st.height,yt=st.x,ot=st.y;if(yt<0||ot<0||!De)return;if(!xe){var kt=X.current.currentTime,Dt=kt-re;Math.abs(Dt)<10?(nt+=Math.abs(Dt),re=kt,J||nt-$*q>=0&&($++,ke.push(re),_&&dt())):(re=kt,_&&dt())}}function Ze(){xe=!0}function ut(){X.current.playing&&ke.push(X.current.currentTime,re),re=X.current.currentTime,xe=!1}function Ct(){ze=X.current.duration,ze<=20&&(q=ze/3),X.current.addEventListener("play",Be)}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);ye.current.textContent="".concat(st.minutes,":").concat(st.seconds);var De=X.current.getBoundingClientRect();ye.current.style.left="".concat(at.pageX-De.left,"px")}return Y.current.addEventListener(Object(o.c)(),Ht),X.current.addEventListener("canplay",Ct),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",Ct),X.current.removeEventListener("play",Be),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),_&&dt())}},[X,m]),Object(b.useEffect)(function(){if(X.current.onended=function(){B(X)},X.current.oncontextmenu=function(){return!1},(m==null?void 0:m.indexOf(".m3u8"))>-1){if(X.current.canPlayType("application/vnd.apple.mpegurl"))X.current.src=m;else if(p.a.isSupported()){var Qe=new p.a;Qe.loadSource(m),Qe.attachMedia(X.current)}}},[m]),Object(b.useEffect)(function(){X.current.playbackRate=te},[te]);var tt=function(){X.current.paused||X.current.ended?X.current.play():X.current.pause(),Ne()};function mt(){X.current.muted=!X.current.muted,X.current.muted?(Fe.current.setAttribute("data-volume",volume.value),Fe.current.value=0):Fe.current.value=Fe.current.dataset.volume}return T.a.createElement("div",{style:{position:"relative"},ref:Y},T.a.createElement("div",{ref:ne,className:"".concat(u.a.watermark," animated_alternate animate__animated_10s animate__infinite animate__stepstart ").concat(u.a.animate__loop)},We?We.login:" "),T.a.createElement("div",{className:u.a.container},T.a.createElement("div",{className:u.a["video-container"],id:"video-container"},T.a.createElement("div",{className:u.a["playback-animation"],id:"playback-animation"},T.a.createElement("svg",{className:u.a["playback-icons"]},T.a.createElement("use",{className:"hidden",href:"#play-icon"}),T.a.createElement("use",{href:"#pause"}))),T.a.createElement("video",{className:u.a.video,id:"video",preload:"auto",disablePictureInPicture:!0,ref:X,autoPlay:!1}),T.a.createElement("div",{className:"".concat(u.a["video-controls"]," "),id:"video-controls"},T.a.createElement("div",{className:u.a["bottom-controls"]},T.a.createElement("div",{className:u.a["left-controls"]},T.a.createElement("button",{"data-title":"\u64AD\u653E/\u6682\u505C",id:"play",onClick:tt},T.a.createElement("svg",{className:u.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:u.a.time},T.a.createElement("time",{id:"time-elapsed",ref:Pe},"00:00"),T.a.createElement("span",null," / "),T.a.createElement("time",{id:"duration",ref:Se},"00:00"))),T.a.createElement("div",{className:u.a["right-controls"]},T.a.createElement("div",{className:u.a["volume-controls"]},T.a.createElement("button",{"data-title":"\u5F00\u542F/\u5173\u95ED\u58F0\u97F3",className:u.a["volume-button"],id:"volume-button",onClick:mt},T.a.createElement("svg",null,T.a.createElement("use",{ref:Ee,href:"#volume-mute"}),T.a.createElement("use",{ref:Ue,href:"#volume-low"}),T.a.createElement("use",{ref:Ge,href:"#volume-high"}))),T.a.createElement("input",{className:u.a.volume,id:"volume",value:"1","data-mute":"0.5",type:"range",max:"1",min:"0",step:"0.01",ref:Fe,style:{display:"none"},onClick:je})),T.a.createElement("button",{"data-title":"\u5168\u5C4F/\u9000\u51FA\u5168\u5C4F",className:u.a["fullscreen-button"],onClick:function(){Object(o.a)()?Object(o.b)():Object(o.d)(Y.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:u.a["video-progress"]},T.a.createElement("progress",{ref:Ce,value:"0",min:"0"}),T.a.createElement("input",{className:u.a.seek,ref:de,value:"0",min:"0",type:"range",step:"1"}),T.a.createElement("div",{className:u.a["seek-tooltip"],ref:ye,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),b=z("UZu5"),T=z.n(b),C=z("dhSg"),c=z("rLCj"),p=z("dF/Y"),d=z("4i/N");Ve.a=function(){var o=Object(w.useState)(""),a=Object(j.a)(o,2),u=a[0],s=a[1],h=Object(w.useState)(0),i=Object(j.a)(h,2),n=i[0],t=i[1],f=Object(w.useRef)("");Object(w.useEffect)(function(){var E=C.a.subscribe("preview-image",function(g){s(g),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(){f.current=u},[u]);function v(E){E.keyCode==27&&f.current&&m()}function m(){document.body.style.overflow="auto",s("")}function _(){t(n+90)}return P.a.createElement(w.Fragment,null,u?P.a.createElement("div",{className:"image-preview-container"},P.a.createElement("div",{className:"button-group"},P.a.createElement(Q.a,{onClick:_},"\u65CB\u8F6C",P.a.createElement(c.a,null)),P.a.createElement(Q.a,{href:u},"\u4E0B\u8F7D",P.a.createElement(p.a,null)),P.a.createElement(Q.a,{onClick:m},"\u5173\u95ED",P.a.createElement(d.a,null))),P.a.createElement("div",{className:"preview-wrp-group"},P.a.createElement("img",{className:"image-preview",src:u,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 b(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+/,d=/^\[(x| )\](?=\s)/i,o=j.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,a=/^ {0,3}(?:\={1,}|-{2,})\s*$/,u=/^[^#!\[\]*_\\<>` "'(~:]+/,s=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,h=/^\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 f(W,V,X){return V.f=V.block=X,X(W,V)}function v(W){return!W||!/\S/.test(W.string)}function m(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=_,W.htmlState=null)}return W.trailingSpace=0,W.trailingSpaceNewLine=!1,W.prevLine=W.thisLine,W.thisLine={stream:null},null}function _(W,V){var X=W.column()===V.indentation,ne=v(V.prevLine.stream),Y=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&&(Y||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&&(ye=W.match(o))&&ye[1].length<=6)return V.quote=0,V.header=ye[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(!Pe&&!V.setext&&X&&V.indentation<=de&&(ye=W.match(p))){var Ee=ye[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(d,!1)&&(V.taskList=!0),V.f=V.inline,j.highlightFormatting&&(V.formatting=["list","list-"+Ee]),y(V)}else{if(X&&V.indentation<=de&&(ye=W.match(s,!0)))return V.quote=0,V.fencedEndRE=new RegExp(ye[1]+"+ *$"),V.localMode=j.fencedCodeBlockHighlighting&&b(ye[2]||j.fencedCodeBlockDefaultMode),V.localMode&&(V.localState=le.startState(V.localMode)),V.f=V.block=g,j.highlightFormatting&&(V.formatting="code-block"),V.code=-1,y(V);if(V.setext||(!Se||!ce)&&!V.quote&&V.list===!1&&!V.code&&!Pe&&!h.test(W.string)&&(ye=W.lookAhead(1))&&(ye=ye.match(a)))return V.setext?(V.header=V.setext,V.setext=0,W.skipToEnd(),j.highlightFormatting&&(V.formatting="header")):(V.header=ye[0].charAt(0)=="="?1:2,V.setext=V.header),V.thisLine.header=!0,V.f=V.inline,y(V);if(Pe)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=_,V.htmlState=null)}return X}function g(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(u,!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(d,!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 Y=W.next();if(V.linkTitle){V.linkTitle=!1;var ee=Y;Y==="("&&(ee=")"),ee=(ee+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var ce="^\\s*(?:[^"+ee+"\\\\]+|\\\\\\\\|\\\\.)"+ee;if(W.match(new RegExp(ce),!0))return T.linkHref}if(Y==="`"){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(Y==="\\"&&(W.next(),j.highlightFormatting)){var Pe=y(V),ye=T.formatting+"-escape";return Pe?Pe+" "+ye:ye}if(Y==="!"&&W.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return V.imageMarker=!0,V.image=!0,j.highlightFormatting&&(V.formatting="image"),y(V);if(Y==="["&&V.imageMarker&&W.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return V.imageMarker=!1,V.imageAltText=!0,j.highlightFormatting&&(V.formatting="image"),y(V);if(Y==="]"&&V.imageAltText){j.highlightFormatting&&(V.formatting="image");var Pe=y(V);return V.imageAltText=!1,V.image=!1,V.inline=V.f=O,Pe}if(Y==="["&&!V.image)return V.linkText&&W.match(/^.*?\]/)||(V.linkText=!0,j.highlightFormatting&&(V.formatting="link")),y(V);if(Y==="]"&&V.linkText){j.highlightFormatting&&(V.formatting="link");var Pe=y(V);return V.linkText=!1,V.inline=V.f=W.match(/\(.*?\)| ?\[.*?\]/,!1)?O:l,Pe}if(Y==="<"&&W.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){V.f=V.inline=S,j.highlightFormatting&&(V.formatting="link");var Pe=y(V);return Pe?Pe+=" ":Pe="",Pe+T.linkInline}if(Y==="<"&&W.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){V.f=V.inline=S,j.highlightFormatting&&(V.formatting="link");var Pe=y(V);return Pe?Pe+=" ":Pe="",Pe+T.linkEmail}if(j.xml&&Y==="<"&&W.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var Ee=W.string.indexOf(">",W.pos);if(Ee!=-1){var Ge=W.string.substring(W.start,Ee);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(Ge)&&(V.md_inside=!0)}return W.backUp(1),V.htmlState=le.startState(w),f(W,V,E)}if(j.xml&&Y==="<"&&W.match(/^\/\w*?>/))return V.md_inside=!1,"tag";if(Y==="*"||Y==="_"){for(var Ue=1,Fe=W.pos==1?" ":W.string.charAt(W.pos-2);Ue<3&&W.eat(Y);)Ue++;var He=W.peek()||" ",be=!/\s/.test(He)&&(!i.test(He)||/\s/.test(Fe)||i.test(Fe)),me=!/\s/.test(Fe)&&(!i.test(Fe)||/\s/.test(He)||i.test(He)),We=null,ze=null;if(Ue%2&&(!V.em&&be&&(Y==="*"||!me||i.test(Fe))?We=!0:V.em==Y&&me&&(Y==="*"||!be||i.test(He))&&(We=!1)),Ue>1&&(!V.strong&&be&&(Y==="*"||!me||i.test(Fe))?ze=!0:V.strong==Y&&me&&(Y==="*"||!be||i.test(He))&&(ze=!1)),ze!=null||We!=null){j.highlightFormatting&&(V.formatting=We==null?"strong":ze==null?"em":"strong em"),We===!0&&(V.em=Y),ze===!0&&(V.strong=Y);var Se=y(V);return We===!1&&(V.em=!1),ze===!1&&(V.strong=!1),Se}}else if(Y===" "&&(W.eat("*")||W.eat("_"))){if(W.peek()===" ")return y(V);W.backUp(1)}if(j.strikethrough){if(Y==="~"&&W.eatWhile(Y)){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(Y===" "&&W.match(/^~~/,!0)){if(W.peek()===" ")return y(V);W.backUp(2)}}if(j.emoji&&Y===":"&&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 Y===" "&&(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=y(X);return X.linkHref=!1,Y}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:_,prevLine:{stream:null},thisLine:{stream:null},block:_,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 m(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:m,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,d=c.index,o=c.children,a=c.colSpan,u=c.rowSpan,s=le.useContext(Q.a),h=s.prefixCls,i=s.fixedInfoList,n=i[d];return le.createElement(j.a,Object.assign({className:p,index:d,component:"td",prefixCls:h,record:null,dataIndex:null,render:function(){return{children:o,props:{colSpan:a,rowSpan:u}}}},n))}function P(c){return le.createElement("tr",Object.assign({},c))}function b(c){var p=c.children,d=le.useContext(Q.a),o=d.prefixCls;return le.createElement("tfoot",{className:"".concat(o,"-summary")},p)}var T=Ve.b=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",b=new RegExp("<(/?)(["+w+"]["+P+"]*)","g");function T(i,n,t,f){this.line=n,this.ch=t,this.cm=i,this.text=i.getLine(n),this.min=f?Math.max(f.from,i.firstLine()):i.firstLine(),this.max=f?Math.min(f.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 d(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),f=t>-1&&!/\S/.test(i.text.slice(t+1,n));return i.ch=n+1,f?"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}b.lastIndex=n,i.ch=n;var t=b.exec(i.text);if(t&&t.index==n)return t}}function a(i){for(;;){b.lastIndex=i.ch;var n=b.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 u(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),f=t>-1&&!/\S/.test(i.text.slice(t+1,n));return i.ch=n+1,f?"selfClose":"regular"}}function s(i,n){for(var t=[];;){var f=a(i),v,m=i.line,_=i.ch-(f?f[0].length:0);if(!f||!(v=d(i)))return;if(v=="selfClose")continue;if(f[1]){for(var E=t.length-1;E>=0;--E)if(t[E]==f[2]){t.length=E;break}if(E<0&&(!n||n==f[2]))return{tag:f[2],from:Q(m,_),to:Q(i.line,i.ch)}}else t.push(f[2])}}function h(i,n){for(var t=[];;){var f=u(i);if(!f)return;if(f=="selfClose"){o(i);continue}var v=i.line,m=i.ch,_=o(i);if(!_)return;if(_[1])t.push(_[2]);else{for(var E=t.length-1;E>=0;--E)if(t[E]==_[2]){t.length=E;break}if(E<0&&(!n||n==_[2]))return{tag:_[2],from:Q(i.line,i.ch),to:Q(v,m)}}}}le.registerHelper("fold","xml",function(i,n){for(var t=new T(i,n.line,0);;){var f=a(t);if(!f||t.line!=n.line)return;var v=d(t);if(!v)return;if(!f[1]&&v!="selfClose"){var m=Q(t.line,t.ch),_=s(t,f[2]);return _&&j(_.from,m)>0?{from:m,to:_.from}:null}}}),le.findMatchingTag=function(i,n,t){var f=new T(i,n.line,n.ch,t);if(f.text.indexOf(">")==-1&&f.text.indexOf("<")==-1)return;var v=d(f),m=v&&Q(f.line,f.ch),_=v&&o(f);if(!v||!_||j(f,n)>0)return;var E={from:Q(f.line,f.ch),to:m,tag:_[2]};return v=="selfClose"?{open:E,close:null,at:"open"}:_[1]?{open:h(f,_[2]),close:E,at:"close"}:(f=new T(i,m.line,m.ch,t),{open:E,close:s(f,_[2]),at:"open"})},le.findEnclosingTag=function(i,n,t,f){for(var v=new T(i,n.line,n.ch,t);;){var m=h(v,f);if(!m)break;var _=new T(i,n.line,n.ch,t),E=s(_,m.tag);if(E)return{open:m,close:E}}},le.scanForClosingTag=function(i,n,t,f){var v=new T(i,n.line,n.ch,f?{from:0,to:f}: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"),b=z("tJVT"),T=z("q1tI"),C=z.n(T),c=z("vHTk"),p=z.n(c),d=z("yEEn"),o=z("ZW9T"),a=z("1vsH");Ve.a=function(u){var s=u.name,h=u.data,i=u.theme,n=u.type,t=u.filename,f=u.monacoEditor,v=u.className,m=u.style,_=u.close,E=u.onClose,g=u.hasMask,y=Object(T.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),x=Object(b.a)(y,2),l=x[0],S=x[1],O=Object(T.useState)(""),A=Object(b.a)(O,2),D=A[0],I=A[1],B=Object(T.useRef)();t&&(f.filename=t),Object(T.useEffect)(function(){var W,V,X=(W=document.cookie)===null||W===void 0||((V=W.replace(/\s/g,""))===null||V===void 0)?void 0:V.split(";");X==null||X.map(function(ne){var Y=ne.split("=");Y[0]==="_educoder_session"&&I(Y[1])})},[]);var H=function(){if(h.startsWith("http")||h.startsWith("/")){te();return}Object(a.x)(t||"educoder",h,t)},te=function(){Object(a.v)(t||s,h)};return console.log("data:",h,"fileanme:",t," name:",s),C.a.createElement("div",{style:Object(P.a)({},m||{}),className:"".concat(g&&p.a.bgBlack," ").concat(n?p.a.wrp:"hide")},_&&C.a.createElement("div",{className:p.a.close,ref:B},C.a.createElement(w.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return B.current}},C.a.createElement("span",{onClick:te},C.a.createElement("i",{className:"icon-quxiaozhiding"}))),C.a.createElement(w.a,{title:"\u5173\u95ED",getPopupContainer:function(){return B.current}},C.a.createElement("span",{className:"",onClick:E},C.a.createElement("i",{className:"icon-guanbi1"})))),C.a.createElement("div",{className:"".concat(p.a[v]," ").concat(v," ").concat(p.a.monaco," ").concat(n==="txt"?"show":"hide")},n==="txt"&&C.a.createElement(o.b,f)),n==="audio"&&C.a.createElement("audio",{src:"".concat(h!=null&&h.startsWith("/")||(h==null?void 0:h.indexOf("https://"))>-1?h:"data:audio/mp3;base64,").concat(h),autoPlay:!0}),n==="video"&&C.a.createElement(C.a.Fragment,null,h!=null&&h.startsWith("/")?C.a.createElement("video",{controls:!0,src:"".concat(h),autoPlay:!0}):C.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(h),autoPlay:!0})),n==="html"&&C.a.createElement("iframe",{src:h+"&disposition=inline"}),n==="pdf"&&C.a.createElement("embed",{className:p.a.embed,src:h}),n==="image"&&C.a.createElement(C.a.Fragment,null,C.a.createElement("img",{src:"".concat(h!=null&&h.startsWith("/")||(h==null?void 0:h.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(h)})),n==="other"&&C.a.createElement("div",null,C.a.createElement(Q.a,{type:"primary",size:"large",onClick:H},C.a.createElement(d.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),(n==="download"||n==="office")&&C.a.createElement(Q.a,{type:"primary",size:"large",onClick:H},C.a.createElement(d.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"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,b,T){function C(d,o){if(!b[d]){if(!P[d]){var a=typeof Q=="function"&&Q;if(!o&&a)return Q(d,!0);if(c)return c(d,!0);var u=new Error("Cannot find module '"+d+"'");throw u.code="MODULE_NOT_FOUND",u}var s=b[d]={exports:{}};P[d][0].call(s.exports,function(h){return C(P[d][1][h]||h)},s,s.exports,w,P,b,T)}return b[d].exports}for(var c=typeof Q=="function"&&Q,p=0;p0?Y["Content-Type"]=ne.mime:Y["Content-Type"]=_.getType(ne.mime||v.extname(ne.object||""))||"application/octet-stream"),ne.content&&(Y["Content-Md5"]=f.createHash("md5").update(new C(ne.content,"utf8")).digest("base64"),Y["Content-Length"]||(Y["Content-Length"]=ne.content.length));var ee=this._getResource(ne);Y.authorization=this.authorization(ne.method,ee,ne.subres,Y);var ce=this._getReqUrl(ne);t("request %s %s, with headers %j, !!stream: %s",ne.method,ce,Y,!!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:Y,timeout:de,writeStream:ne.writeStream,customResponse:ne.customResponse,ctx:ne.ctx||this.ctx}}},X.request=h.default.mark(function ne(Y){var ee,ce,de,Ce;return h.default.wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:return ee=this.createRequest(Y),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",Y.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||!Y.successStatuses||Y.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(Y);case 22:return Se.abrupt("return",Se.sent);case 23:Ce.params=Y,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(!Y.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 Y="/";return ne.bucket&&(Y+=ne.bucket+"/"),ne.object&&(Y+=ne.object),Y},X._isIP=function(ne){return W._isIP(ne)},X._escape=function(ne){return A.encodeURIComponent(ne).replace(/%2F/g,"/")},X._getReqUrl=function(ne){var Y={};m(this.options.endpoint).to(Y);var ee=this._isIP(Y.hostname),ce=this.options.cname;!ne.bucket||ce||ee||(Y.host=ne.bucket+"."+Y.host);var de="/";ne.bucket&&ee&&(de+=ne.bucket+"/"),ne.object&&(de+=this._escape(ne.object).replace(/\+/g,"%2B")),Y.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(Pe){Se[Pe]=""}):Se=ne.subres,x(Ce,Se)}return Y.query=Ce,l.format(Y)},X._getUserAgent=function(){var ne=T&&T.browser?"js":"nodejs",Y="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(Y+" "+ee)},X._checkUserAgent=function(ne){return ne.replace(/\u03b1/,"alpha").replace(/\u03b2/,"beta")},X.checkBrowserAndVersion=function(ne,Y){return H.name===ne&&H.version.split(".")[0]===Y},X.parseXML=function(ne){return function(Y){C.isBuffer(ne)&&(ne=ne.toString()),E.parseString(ne,{explicitRoot:!1,explicitArray:!1},Y)}},X.requestError=h.default.mark(function ne(Y){var ee,ce,de,Ce;return h.default.wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:if(ee=null,Y.data&&Y.data.length){Se.next=5;break}Y.status===-1||Y.status===-2?(ee=new Error(Y.message),ee.name=Y.name,ee.status=Y.status,ee.code=Y.name):(Y.status===404?(ee=new Error("Object not exists"),ee.name="NoSuchKeyError",ee.status=404,ee.code="NoSuchKey"):Y.status===412?(ee=new Error("Pre condition failed"),ee.name="PreconditionFailedError",ee.status=412,ee.code="PreconditionFailed"):(ee=new Error("Unknow error, status: "+Y.status),ee.name="UnknowError",ee.status=Y.status),ee.requestId=Y.headers["x-oss-request-id"],ee.host=""),Se.next=30;break;case 5:return ce=String(Y.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=Y.status,Se.t0.requestId=Y.headers["x-oss-request-id"],Se.abrupt("return",Se.t0);case 21:Ce=de.Message||"unknow request error, status: "+Y.status,de.Condition&&(Ce+=" (condition: "+de.Condition+")"),ee=new Error(Ce),ee.name=de.Code?de.Code+"Error":"UnknowError",ee.status=Y.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,b){(function(T){"use strict";function C(m){return m&&m.__esModule?m:{default:m}}function c(m,_){if(!(this instanceof c))return new c(m,_);v.call(this,_),this.file=m,this.reader=new FileReader,this.start=0,this.finish=!1,this.fileBuffer=null}var p=w("babel-runtime/core-js/array/from"),d=C(p),o=w("babel-runtime/regenerator"),a=C(o),u=w("is-type-of"),s=w("util"),h=w("path"),i=w("mime"),n=w("copy-to"),t=b;t.multipartUpload=a.default.mark(function m(_,E,g){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(),g=g||{},!g.checkpoint||!g.checkpoint.uploadId){H.next=6;break}return H.next=5,this._resumeMultipart(g.checkpoint,g);case 5:return H.abrupt("return",H.sent);case 6:return y=102400,g.mime||(u.file(E)?g.mime=i.getType(h.extname(E.name)):u.blob(E)?g.mime=E.type:g.mime=i.getType(h.extname(E))),g.headers=g.headers||{},this._convertMetaToHeaders(g.meta,g.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 Pe(ye,Ee){var Ge,Ue,Fe;return a.default.wrap(function(He){for(;;)switch(He.prev=He.next){case 0:if(ye.isCancel()){He.next=21;break}return He.prev=1,Ge=D[Ee-1],Ue={stream:ye._createStream(g,Ge.start,Ge.end),size:Ge.end-Ge.start},He.next=6,ye._uploadPart(O,l,Ee,Ue);case 6:if(Fe=He.sent,ye.isCancel()||B){He.next=13;break}if(_.doneParts.push({number:Ee,etag:Fe.res.headers.etag}),A.push({number:Ee,etag:Fe.res.headers.etag}),!E||!E.progress){He.next=13;break}return He.next=13,E.progress(S.length/I,_,Fe.res);case 13:He.next=21;break;case 15:if(He.prev=15,He.t0=He.catch(1),ye.isCancel()){He.next=21;break}throw ye.cancel(),He.t0.partNum=Ee,He.t0;case 21:case"end":return He.stop()}},Pe,this,[[1,15]])}),te=(0,d.default)(new Array(I),function(Pe,ye){return ye+1}),W=A.map(function(Pe){return Pe.number}),V=te.filter(function(Pe){return W.indexOf(Pe)<0}),X=5,ne=E.parallel||X,!this.checkBrowserAndVersion("Internet Explorer","10")&&ne!==1){Se.next=26;break}Y=0;case 16:if(!(Y0)){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()}},m,this)}),u.file=function(m){return typeof File!="undefined"&&m instanceof File},u.blob=function(m){return typeof Blob!="undefined"&&m instanceof Blob},t._getFileSize=a.default.mark(function m(_){var E;return a.default.wrap(function(g){for(;;)switch(g.prev=g.next){case 0:if(!u.buffer(_)){g.next=4;break}return g.abrupt("return",_.length);case 4:if(!u.blob(_)&&!u.file(_)){g.next=6;break}return g.abrupt("return",_.size);case 6:if(!u.string(_)){g.next=11;break}return g.next=9,this._statFile(_);case 9:return E=g.sent,g.abrupt("return",E.size);case 11:throw new Error("_getFileSize requires Buffer/File/String.");case 12:case"end":return g.stop()}},m,this)});var f=w("stream"),v=f.Readable;s.inherits(c,v),c.prototype.readFileAndPush=function(m){if(this.fileBuffer)for(var _=!0;_&&this.fileBuffer&&this.startthis.fileBuffer.length?this.fileBuffer.length:g,this.start=g,_=this.push(this.fileBuffer.slice(E,g))}},c.prototype._read=function(m){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);m=m||16384;var _=this;this.reader.onload=function(E){_.fileBuffer=new T(new Uint8Array(E.target.result)),_.file=null,_.readFileAndPush(m)},this.start===0?this.reader.readAsArrayBuffer(this.file):this.readFileAndPush(m)},t._createStream=function(m,_,E){if(u.blob(m)||u.file(m))return new c(m.slice(_,E));throw new Error("_createStream requires File/String.")},t._getPartSize=function(m,_){return _?Math.max(Math.ceil(m/1e4),_):1048576},t._divideParts=function(m,_){for(var E=Math.ceil(m/_),g=[],y=0;y `,g.quiet?y+=` true `:y+=` false `,x=0;x"+a.escape(this._objectName(E[x]))+` `;return y+="",o("delete multi objects: %s",y),g.subres="delete",l=this._objectRequestParams("POST","",g),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()}},_,this)}),m.copy=d.default.mark(function _(E,g,y){var x,l,S;return d.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),g=g[0]!=="/"?"/"+this.options.bucket+"/"+encodeURIComponent(g):"/"+encodeURIComponent(g.slice(1)),y.headers["x-oss-copy-source"]=g,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()}},_,this)}),m.putMeta=d.default.mark(function _(E,g,y){return d.default.wrap(function(x){for(;;)switch(x.prev=x.next){case 0:return x.next=2,this.copy(E,E,{meta:g||{},timeout:y&&y.timeout,ctx:y&&y.ctx});case 2:return x.abrupt("return",x.sent);case 3:case"end":return x.stop()}},_,this)}),m.list=d.default.mark(function _(E,g){var y,x,l,S,O;return d.default.wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return y=this._objectRequestParams("GET","",g),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()}},_,this)}),m.putACL=d.default.mark(function _(E,g,y){var x,l;return d.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"]=g,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()}},_,this)}),m.getACL=d.default.mark(function _(E,g){var y,x;return d.default.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return g=g||{},g.subres="acl",E=this._objectName(E),y=this._objectRequestParams("GET",E,g),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()}},_,this)}),m.restore=d.default.mark(function _(E,g){var y,x;return d.default.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return g=g||{},g.subres="restore",y=this._objectRequestParams("POST",E,g),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()}},_,this)}),m.signatureUrl=function(_,E){E=E||{},_=this._objectName(_),E.method=E.method||"GET";var g=a.timestamp()+(E.expires||1800),y={bucket:this.options.bucket,object:_},x=this._getResource(y);this.options.stsToken&&(E["security-token"]=this.options.stsToken);var l=v._signatureForURL(this.options.accessKeySecret,E,x,g),S=h.parse(this._getReqUrl(y));return S.query={OSSAccessKeyId:this.options.accessKeyId,Expires:g,Signature:l.Signature},i(l.subResource).to(S.query),S.format()},m.getObjectUrl=function(_,E){return E?E[E.length-1]!=="/"&&(E+="/"):E=this.options.endpoint.format(),E+this._escape(this._objectName(_))},m._objectUrl=function(_){return this._getReqUrl({bucket:this.options.bucket,object:_})},m.generateObjectUrl=function(_,E){if(E)E[E.length-1]!=="/"&&(E+="/");else{E=this.options.endpoint.format();var g=h.parse(E),y=this.options.bucket;g.hostname=y+"."+g.hostname,g.host=y+"."+g.host,E=g.format()}return E+this._escape(this._objectName(_))},m._objectRequestParams=function(_,E,g){if(!this.options.bucket)throw new Error("Please create a bucket first");g=g||{},E=this._objectName(E);var y={object:E,bucket:this.options.bucket,method:_,subres:g&&g.subres,timeout:g&&g.timeout,ctx:g&&g.ctx};return g.headers&&(y.headers={},i(g.headers).to(y.headers)),y},m._objectName=function(_){return _.replace(/^\/+/,"")},m._statFile=function(_){return function(E){u.stat(_,E)}},m._convertMetaToHeaders=function(_,E){_&&(0,c.default)(_).forEach(function(g){E["x-oss-meta-"+g]=_[g]})},m._deleteFileSafe=function(_){return function(E){u.exists(_,function(g){g?u.unlink(_,function(y){y&&o("unlink %j error: %s",_,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,b){"use strict";b.version="5.3.1"},{}],6:[function(w,P,b){"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 f=new n(t),v=(0,s.default)(f),m=(0,s.default)((0,a.default)(f));v.concat(m).forEach(function(_){c(f[_])?this[_]=h.wrap(f[_]).bind(f):this[_]=f[_]},this)}function d(n){if(!(this instanceof d))return new d(n);p.call(this,i,n)}var o=w("babel-runtime/core-js/object/get-prototype-of"),a=T(o),u=w("babel-runtime/core-js/object/keys"),s=T(u),h=w("co"),i=w("./client");P.exports=d,d.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,b){(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),d=w("babel-runtime/core-js/json/stringify"),o=C(d);b.encodeCallback=function(a,u){if(a.headers=a.headers||{},!Object.prototype.hasOwnProperty.call(a.headers,"x-oss-callback")&&u.callback){var s={callbackUrl:encodeURI(u.callback.url),callbackBody:u.callback.body};u.callback.host&&(s.callbackHost=u.callback.host),u.callback.contentType&&(s.callbackBodyType=u.callback.contentType);var h=new T((0,o.default)(s)).toString("base64");if(a.headers["x-oss-callback"]=h,u.callback.customValue){var i={};(0,p.default)(u.callback.customValue).forEach(function(n){i["x:"+n]=u.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,b){"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"),d=b;d.listUploads=C.default.mark(function o(a,u){var s,h,i,n;return C.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return u=u||{},s={},c(u).to(s),s.subres="uploads",h=this._objectRequestParams("GET","",s),h.query=a,h.xmlResponse=!0,h.successStatuses=[200],t.next=10,this.request(h);case 10:return i=t.sent,n=i.data.Upload||[],Array.isArray(n)||(n=[n]),n=n.map(function(f){return{name:f.Key,uploadId:f.UploadId,initiated:f.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)}),d.listParts=C.default.mark(function o(a,u,s,h){var i,n,t;return C.default.wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return h=h||{},i={},c(h).to(i),i.subres={uploadId:u},n=this._objectRequestParams("GET",a,i),n.query=s,n.xmlResponse=!0,n.successStatuses=[200],f.next=10,this.request(n);case 10:return t=f.sent,f.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 f.stop()}},o,this)}),d.abortMultipartUpload=C.default.mark(function o(a,u,s){var h,i,n;return C.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return this.cancel(),s=s||{},h={},c(s).to(h),h.subres={uploadId:u},i=this._objectRequestParams("DELETE",a,h),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)}),d.initMultipartUpload=C.default.mark(function o(a,u){var s,h,i;return C.default.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return u=u||{},s={},c(u).to(s),s.headers=s.headers||{},this._convertMetaToHeaders(u.meta,s.headers),s.subres="uploads",h=this._objectRequestParams("POST",a,s),h.mime=u.mime,h.xmlResponse=!0,h.successStatuses=[200],n.next=12,this.request(h);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)}),d.uploadPart=C.default.mark(function o(a,u,s,h,i,n,t){var f;return C.default.wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return f={stream:this._createStream(h,i,n),size:n-i},v.next=3,this._uploadPart(a,u,s,f,t);case 3:return v.abrupt("return",v.sent);case 4:case"end":return v.stop()}},o,this)}),d.completeMultipartUpload=C.default.mark(function o(a,u,s,h){var i,n,t,f,v,m,_,E;return C.default.wrap(function(g){for(;;)switch(g.prev=g.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+=""+f.number+` `,n+=""+f.etag+` `,n+=` `;return n+="",h=h||{},v={},c(h).to(v),v.subres={uploadId:u},m=this._objectRequestParams("POST",a,v),p.encodeCallback(m,v),m.mime="xml",m.content=n,m.headers&&m.headers["x-oss-callback"]||(m.xmlResponse=!0),m.successStatuses=[200],g.next=16,this.request(m);case 16:return _=g.sent,E={res:_.res,bucket:m.bucket,name:a,etag:_.res.headers.etag},m.headers&&m.headers["x-oss-callback"]&&(E.data=JSON.parse(_.data.toString())),g.abrupt("return",E);case 20:case"end":return g.stop()}},o,this)}),d._uploadPart=C.default.mark(function o(a,u,s,h,i){var n,t,f;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":h.size},n.subres={partNumber:s,uploadId:u},t=this._objectRequestParams("PUT",a,n),t.mime=n.mime,t.stream=h.stream,t.successStatuses=[200],v.next=11,this.request(t);case 11:return f=v.sent,h.stream=null,t.stream=null,v.abrupt("return",{name:a,etag:f.res.headers.etag,res:f.res});case 15:case"end":return v.stop()}},o,this)})},{"./callback":7,"babel-runtime/regenerator":33,"copy-to":43}],9:[function(w,P,b){(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),d=w("babel-runtime/core-js/object/keys"),o=C(d),a=w("./../../shims/crypto/crypto.js"),u=w("is-type-of");b.buildCanonicalizedResource=function(s,h){var i=""+s,n="?";if(u.string(h)&&h.trim()!=="")i+=n+h;else if(u.array(h))h.sort(),i+=n+h.join("&");else if(h){var t=function(v,m){return v[0]>m[0]?1:v[0]0)throw new Error("Invalid string. Length must be a multiple of 4");var m=f.indexOf("=");return m===-1&&(m=v),[m,m===v?0:4-m%4]}function C(f){var v=T(f),m=v[0],_=v[1];return 3*(m+_)/4-_}function c(f,v,m){return 3*(v+m)/4-m}function p(f){for(var v,m=T(f),_=m[0],E=m[1],g=new h(c(f,_,E)),y=0,x=E>0?_-4:_,l=0;l>16&255,g[y++]=v>>8&255,g[y++]=255&v;return E===2&&(v=s[f.charCodeAt(l)]<<2|s[f.charCodeAt(l+1)]>>4,g[y++]=255&v),E===1&&(v=s[f.charCodeAt(l)]<<10|s[f.charCodeAt(l+1)]<<4|s[f.charCodeAt(l+2)]>>2,g[y++]=v>>8&255,g[y++]=255&v),g}function d(f){return u[f>>18&63]+u[f>>12&63]+u[f>>6&63]+u[63&f]}function o(f,v,m){for(var _,E=[],g=v;gy?y:g+16383));return _===1?(v=f[m-1],E.push(u[v>>2]+u[v<<4&63]+"==")):_===2&&(v=(f[m-2]<<8)+f[m-1],E.push(u[v>>10]+u[v>>4&63]+u[v<<2&63]+"=")),E.join("")}b.byteLength=C,b.toByteArray=p,b.fromByteArray=a;for(var u=[],s=[],h=typeof Uint8Array!="undefined"?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,t=i.length;n1&&Y[1]||""}function i(ne){var Y=s.match(ne);return Y&&Y.length>1&&Y[2]||""}var n,t=h(/(ipod|iphone|ipad)/i).toLowerCase(),f=/like android/i.test(s),v=!f&&/android/i.test(s),m=/nexus\s*[0-6]\s*/i.test(s),_=!m&&/nexus\s*[0-9]+/i.test(s),E=/CrOS/.test(s),g=/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&&!g&&/macintosh/i.test(s),D=!v&&!y&&!x&&!l&&/linux/i.test(s),I=i(/edg([ea]|ios)\/(\d+(\.\d+)?)/i),B=h(/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||h(/(?:opera|opr|opios)[\s\/](\d+(\.\d+)?)/i)}:/opr\/|opios/i.test(s)?n={name:"Opera",opera:a,version:h(/(?:opr|opios)[\s\/](\d+(\.\d+)?)/i)||B}:/SamsungBrowser/i.test(s)?n={name:"Samsung Internet for Android",samsungBrowser:a,version:B||h(/(?:SamsungBrowser)[\s\/](\d+(\.\d+)?)/i)}:/coast/i.test(s)?n={name:"Opera Coast",coast:a,version:B||h(/(?:coast)[\s\/](\d+(\.\d+)?)/i)}:/yabrowser/i.test(s)?n={name:"Yandex Browser",yandexbrowser:a,version:B||h(/(?:yabrowser)[\s\/](\d+(\.\d+)?)/i)}:/ucbrowser/i.test(s)?n={name:"UC Browser",ucbrowser:a,version:h(/(?:ucbrowser)[\s\/](\d+(?:\.\d+)+)/i)}:/mxios/i.test(s)?n={name:"Maxthon",maxthon:a,version:h(/(?:mxios)[\s\/](\d+(?:\.\d+)+)/i)}:/epiphany/i.test(s)?n={name:"Epiphany",epiphany:a,version:h(/(?:epiphany)[\s\/](\d+(?:\.\d+)+)/i)}:/puffin/i.test(s)?n={name:"Puffin",puffin:a,version:h(/(?:puffin)[\s\/](\d+(?:\.\d+)?)/i)}:/sleipnir/i.test(s)?n={name:"Sleipnir",sleipnir:a,version:h(/(?:sleipnir)[\s\/](\d+(?:\.\d+)+)/i)}:/k-meleon/i.test(s)?n={name:"K-Meleon",kMeleon:a,version:h(/(?: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=h(/iemobile\/(\d+(\.\d+)?)/i))):/msie|trident/i.test(s)?n={name:"Internet Explorer",msie:a,version:h(/(?:msie |rv:)(\d+(\.\d+)?)/i)}:E?n={name:"Chrome",osname:"Chrome OS",chromeos:a,chromeBook:a,chrome:a,version:h(/(?: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:h(/vivaldi\/(\d+(\.\d+)?)/i)||B}:y?n={name:"Sailfish",osname:"Sailfish OS",sailfish:a,version:h(/sailfish\s?browser\/(\d+(\.\d+)?)/i)}:/seamonkey\//i.test(s)?n={name:"SeaMonkey",seamonkey:a,version:h(/seamonkey\/(\d+(\.\d+)?)/i)}:/firefox|iceweasel|fxios/i.test(s)?(n={name:"Firefox",firefox:a,version:h(/(?:firefox|iceweasel|fxios)[ \/](\d+(\.\d+)?)/i)},/\((mobile|tablet);[^\)]*rv:[\d\.]+\)/i.test(s)&&(n.firefoxos=a,n.osname="Firefox OS")):g?n={name:"Amazon Silk",silk:a,version:h(/silk\/(\d+(\.\d+)?)/i)}:/phantom/i.test(s)?n={name:"PhantomJS",phantom:a,version:h(/phantomjs\/(\d+(\.\d+)?)/i)}:/slimerjs/i.test(s)?n={name:"SlimerJS",slimer:a,version:h(/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||h(/blackberry[\d]+\/(\d+(\.\d+)?)/i)}:l?(n={name:"WebOS",osname:"WebOS",webos:a,version:B||h(/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:h(/dolfin\/(\d+(\.\d+)?)/i)}:x?n={name:"Tizen",osname:"Tizen",tizen:a,version:h(/(?:tizen\s?)?browser\/(\d+(\.\d+)?)/i)||B}:/qupzilla/i.test(s)?n={name:"QupZilla",qupzilla:a,version:h(/(?:qupzilla)[\s\/](\d+(?:\.\d+)+)/i)||B}:/chromium/i.test(s)?n={name:"Chromium",chromium:a,version:h(/(?:chromium)[\s\/](\d+(?:\.\d+)?)/i)||B}:/chrome|crios|crmo/i.test(s)?n={name:"Chrome",chrome:a,version:h(/(?: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:h(/googlebot\/(\d+(\.\d+))/i)||B}:{name:h(/^(.*)\/(.*) /),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||h(/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}}(h(/Windows ((NT|XP)( \d\d?.\d)?)/i)):n.windowsphone?V=h(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i):n.mac?(V=h(/Mac OS X (\d+([_\.\s]\d+)*)/i),V=V.replace(/[_\s]/g,".")):t?(V=h(/os (\d+([_\s]\d+)*) like mac os x/i),V=V.replace(/[_\s]/g,".")):v?V=h(/android[ \/-](\d+(\.\d+)*)/i):n.webos?V=h(/(?:web|hpw)os\/(\d+(\.\d+)*)/i):n.blackberry?V=h(/rim\stablet\sos\s(\d+(\.\d+)*)/i):n.bada?V=h(/bada\/(\d+(\.\d+)*)/i):n.tizen&&(V=h(/tizen[\/\s](\d+(\.\d+)*)/i)),V&&(n.osversion=V);var X=!n.windows&&V.split(".")[0];return H||_||t=="ipad"||v&&(X==3||X>=4&&!te)||n.silk?n.tablet=a:(te||t=="iphone"||t=="ipod"||v||m||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,h){var i,n=[];if(Array.prototype.map)return Array.prototype.map.call(s,h);for(i=0;i=0;){if(i[0][h]>i[1][h])return 1;if(i[0][h]!==i[1][h])return-1;if(h===0)return 0}}function d(s,h,i){var n=u;typeof h=="string"&&(i=h,h=void 0),h===void 0&&(h=!1),i&&(n=T(i));var t=""+n.version;for(var f in s)if(s.hasOwnProperty(f)&&n[f]){if(typeof s[f]!="string")throw new Error("Browser version in the minVersion map should be a string: "+f+": "+String(s));return p([t,s[f]])<0}return h}function o(s,h,i){return!d(s,h,i)}var a=!0,u=T(typeof navigator!="undefined"&&navigator.userAgent||"");return u.test=function(s){for(var h=0;h=this.charLength-this.charReceived?this.charLength-this.charReceived:u.length;if(u.copy(this.charBuffer,this.charReceived,0,h),this.charReceived+=h,this.charReceived=55296&&n<=56319)){if(this.charReceived=this.charLength=0,u.length===0)return s;break}this.charLength+=this.surrogateSize,s=""}this.detectIncompleteChar(u);var i=u.length;this.charLength&&(u.copy(this.charBuffer,0,u.length-this.charReceived,i),i-=this.charReceived),s+=u.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),u.copy(this.charBuffer,0,0,t),s.substring(0,i)}return s},a.prototype.detectIncompleteChar=function(u){for(var s=u.length>=3?3:u.length;s>0;s--){var h=u[u.length-s];if(s==1&&h>>5==6){this.charLength=2;break}if(s<=2&&h>>4==14){this.charLength=3;break}if(s<=3&&h>>3==30){this.charLength=4;break}}this.charReceived=s},a.prototype.end=function(u){var s="";if(u&&u.length&&(s=this.write(u)),this.charReceived){var h=this.charReceived,i=this.charBuffer,n=this.encoding;s+=i.slice(0,h).toString(n)}return s}},{buffer:38}],38:[function(w,P,b){(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 f(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 $=!1;;)switch(U){case"ascii":case"latin1":case"binary":return q;case"utf8":case"utf-8":case void 0:return Ee(k).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*q;case"hex":return q>>>1;case"base64":return Fe(k).length;default:if($)return Ee(k).length;U=(""+U).toLowerCase(),$=!0}}function m(k,U,q){var $=!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($)throw new TypeError("Unknown encoding: "+k);k=(k+"").toLowerCase(),$=!0}}function _(k,U,q){var $=k[U];k[U]=k[q],k[q]=$}function E(k,U,q,$,J){if(k.length===0)return-1;if(typeof q=="string"?($=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,$)),p.isBuffer(U))return U.length===0?-1:g(k,U,q,$,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):g(k,[U],q,$,J);throw new TypeError("val must be string, number or Buffer")}function g(k,U,q,$,J){function xe(Xe,Be){return ke===1?Xe[Be]:Xe.readUInt16BE(Be*ke)}var ke=1,dt=k.length,Ne=U.length;if($!==void 0&&(($=String($).toLowerCase())==="ucs2"||$==="ucs-2"||$==="utf16le"||$==="utf-16le")){if(k.length<2||U.length<2)return-1;ke=2,dt/=2,Ne/=2,q/=2}var je;if(J){var tt=-1;for(je=q;jedt&&(q=dt-Ne),je=q;je>=0;je--){for(var mt=!0,Qe=0;QeJ&&($=J):$=J;var xe=U.length;if(xe%2!=0)throw new TypeError("Invalid hex string");$>xe/2&&($=xe/2);for(var ke=0;ke<$;++ke){var dt=parseInt(U.substr(2*ke,2),16);if(isNaN(dt))return ke;k[q+ke]=dt}return ke}function x(k,U,q,$){return He(Ee(U,k.length-q),k,q,$)}function l(k,U,q,$){return He(Ge(U),k,q,$)}function S(k,U,q,$){return l(k,U,q,$)}function O(k,U,q,$){return He(Fe(U),k,q,$)}function A(k,U,q,$){return He(Ue(U,k.length-q),k,q,$)}function D(k,U,q){return U===0&&q===k.length?me.fromByteArray(k):me.fromByteArray(k.slice(U,q))}function I(k,U,q){q=Math.min(k.length,q);for(var $=[],J=U;J239?4:xe>223?3:xe>191?2:1;if(J+dt<=q){var Ne,je,tt,mt;switch(dt){case 1:xe<128&&(ke=xe);break;case 2:Ne=k[J+1],(192&Ne)==128&&(mt=(31&xe)<<6|63&Ne)>127&&(ke=mt);break;case 3:Ne=k[J+1],je=k[J+2],(192&Ne)==128&&(192&je)==128&&(mt=(15&xe)<<12|(63&Ne)<<6|63&je)>2047&&(mt<55296||mt>57343)&&(ke=mt);break;case 4:Ne=k[J+1],je=k[J+2],tt=k[J+3],(192&Ne)==128&&(192&je)==128&&(192&tt)==128&&(mt=(15&xe)<<18|(63&Ne)<<12|(63&je)<<6|63&tt)>65535&&mt<1114112&&(ke=mt)}}ke===null?(ke=65533,dt=1):ke>65535&&(ke-=65536,$.push(ke>>>10&1023|55296),ke=56320|1023&ke),$.push(ke),J+=dt}return B($)}function B(k){var U=k.length;if(U<=nt)return String.fromCharCode.apply(String,k);for(var q="",$=0;$$)&&(q=$);for(var J="",xe=U;xeq)throw new RangeError("Trying to access beyond buffer length")}function ne(k,U,q,$,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 Y(k,U,q,$){U<0&&(U=65535+U+1);for(var J=0,xe=Math.min(k.length-q,2);J>>8*($?J:1-J)}function ee(k,U,q,$){U<0&&(U=4294967295+U+1);for(var J=0,xe=Math.min(k.length-q,4);J>>8*($?J:3-J)&255}function ce(k,U,q,$,J,xe){if(q+$>k.length)throw new RangeError("Index out of range");if(q<0)throw new RangeError("Index out of range")}function de(k,U,q,$,J){return J||ce(k,U,q,4,34028234663852886e22,-34028234663852886e22),We.write(k,U,q,$,23,4),q+4}function Ce(k,U,q,$,J){return J||ce(k,U,q,8,17976931348623157e292,-17976931348623157e292),We.write(k,U,q,$,52,8),q+8}function Se(k){if(k=Pe(k).replace(re,""),k.length<2)return"";for(;k.length%4!=0;)k+="=";return k}function Pe(k){return k.trim?k.trim():k.replace(/^\s+|\s+$/g,"")}function ye(k){return k<16?"0"+k.toString(16):k.toString(16)}function Ee(k,U){U=U||1/0;for(var q,$=k.length,J=null,xe=[],ke=0;ke<$;++ke){if((q=k.charCodeAt(ke))>55295&&q<57344){if(!J){if(q>56319){(U-=3)>-1&&xe.push(239,191,189);continue}if(ke+1===$){(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 Ge(k){for(var U=[],q=0;q>8,J=q%256,xe.push(J),xe.push($);return xe}function Fe(k){return me.toByteArray(Se(k))}function He(k,U,q,$){for(var J=0;J<$&&!(J+q>=U.length||J>=k.length);++J)U[J+q]=k[J];return J}function be(k){return k!==k}var me=w("base64-js"),We=w("ieee754"),ze=w("isarray");b.Buffer=p,b.SlowBuffer=f,b.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}}(),b.kMaxLength=C(),p.poolSize=8192,p._augment=function(k){return k.__proto__=p.prototype,k},p.from=function(k,U,q){return d(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 u(null,k)},p.allocUnsafeSlow=function(k){return u(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,$=U.length,J=0,xe=Math.min(q,$);J0&&(k=this.toString("hex",0,U).match(/.{2}/g).join(" "),this.length>U&&(k+=" ... ")),""},p.prototype.compare=function(k,U,q,$,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),$===void 0&&($=0),J===void 0&&(J=this.length),U<0||q>k.length||$<0||J>this.length)throw new RangeError("out of range index");if($>=J&&U>=q)return 0;if($>=J)return-1;if(U>=q)return 1;if(U>>>=0,q>>>=0,$>>>=0,J>>>=0,this===k)return 0;for(var xe=J-$,ke=q-U,dt=Math.min(xe,ke),Ne=this.slice($,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");$||($="utf8");for(var xe=!1;;)switch($){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: "+$);$=(""+$).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);)$+=this[k+--U]*J;return $},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 $=this[k],J=1,xe=0;++xe=J&&($-=Math.pow(2,8*U)),$},p.prototype.readIntBE=function(k,U,q){k|=0,U|=0,q||X(k,U,this.length);for(var $=U,J=1,xe=this[k+--$];$>0&&(J*=256);)xe+=this[k+--$]*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,$){(k=+k,U|=0,q|=0,!$)&&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):Y(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):Y(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,$){if(k=+k,U|=0,!$){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,$){if(k=+k,U|=0,!$){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):Y(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):Y(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,$){if(q||(q=0),$||$===0||($=this.length),U>=k.length&&(U=k.length),U||(U=0),$>0&&$=this.length)throw new RangeError("sourceStart out of bounds");if($<0)throw new RangeError("sourceEnd out of bounds");$>this.length&&($=this.length),k.length-U<$-q&&($=k.length-U+q);var J,xe=$-q;if(this===k&&q=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;d(c[u])2&&(m=h.call(arguments,1)),t(m)})})}function p(i){return Promise.all(i.map(C,this))}function d(i){for(var n=new i.constructor,t=Object.keys(i),f=[],v=0;vi;)if((u=s[i++])!=u)return!0}else for(;h>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,b){var T=w("./_cof"),C=w("./_wks")("toStringTag"),c=T(function(){return arguments}())=="Arguments",p=function(d,o){try{return d[o]}catch(a){}};P.exports=function(d){var o,a,u;return d===void 0?"Undefined":d===null?"Null":typeof(a=p(o=Object(d),C))=="string"?a:c?T(o):(u=T(o))=="Object"&&typeof o.callee=="function"?"Arguments":u}},{"./_cof":64,"./_wks":131}],64:[function(w,P,b){var T={}.toString;P.exports=function(C){return T.call(C).slice(8,-1)}},{}],65:[function(w,P,b){var T=P.exports={version:"2.5.7"};typeof __e=="number"&&(__e=T)},{}],66:[function(w,P,b){"use strict";var T=w("./_object-dp"),C=w("./_property-desc");P.exports=function(c,p,d){p in c?T.f(c,p,C(0,d)):c[p]=d}},{"./_object-dp":98,"./_property-desc":111}],67:[function(w,P,b){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(d){return C.call(c,d)};case 2:return function(d,o){return C.call(c,d,o)};case 3:return function(d,o,a){return C.call(c,d,o,a)}}return function(){return C.apply(c,arguments)}}},{"./_a-function":58}],68:[function(w,P,b){P.exports=function(T){if(T==null)throw TypeError("Can't call method on "+T);return T}},{}],69:[function(w,P,b){P.exports=!w("./_fails")(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7})},{"./_fails":74}],70:[function(w,P,b){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,b){P.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},{}],72:[function(w,P,b){var T=w("./_object-keys"),C=w("./_object-gops"),c=w("./_object-pie");P.exports=function(p){var d=T(p),o=C.f;if(o)for(var a,u=o(p),s=c.f,h=0;u.length>h;)s.call(p,a=u[h++])&&d.push(a);return d}},{"./_object-gops":103,"./_object-keys":106,"./_object-pie":107}],73:[function(w,P,b){var T=w("./_global"),C=w("./_core"),c=w("./_ctx"),p=w("./_hide"),d=w("./_has"),o=function(a,u,s){var h,i,n,t=a&o.F,f=a&o.G,v=a&o.S,m=a&o.P,_=a&o.B,E=a&o.W,g=f?C:C[u]||(C[u]={}),y=g.prototype,x=f?T:v?T[u]:(T[u]||{}).prototype;f&&(s=u);for(h in s)(i=!t&&x&&x[h]!==void 0)&&d(g,h)||(n=i?x[h]:s[h],g[h]=f&&typeof x[h]!="function"?s[h]:_&&i?c(n,T):E&&x[h]==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):m&&typeof n=="function"?c(Function.call,n):n,m&&((g.virtual||(g.virtual={}))[h]=n,a&o.R&&y&&!y[h]&&p(y,h,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,b){P.exports=function(T){try{return!!T()}catch(C){return!0}}},{}],75:[function(w,P,b){var T=w("./_ctx"),C=w("./_iter-call"),c=w("./_is-array-iter"),p=w("./_an-object"),d=w("./_to-length"),o=w("./core.get-iterator-method"),a={},u={},b=P.exports=function(s,h,i,n,t){var f,v,m,_,E=t?function(){return s}:o(s),g=T(i,n,h?2:1),y=0;if(typeof E!="function")throw TypeError(s+" is not iterable!");if(c(E)){for(f=d(s.length);f>y;y++)if((_=h?g(p(v=s[y])[0],v[1]):g(s[y]))===a||_===u)return _}else for(m=E.call(s);!(v=m.next()).done;)if((_=C(m,g,v.value,h))===a||_===u)return _};b.BREAK=a,b.RETURN=u},{"./_an-object":61,"./_ctx":67,"./_is-array-iter":83,"./_iter-call":86,"./_to-length":124,"./core.get-iterator-method":132}],76:[function(w,P,b){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,b){var T={}.hasOwnProperty;P.exports=function(C,c){return T.call(C,c)}},{}],78:[function(w,P,b){var T=w("./_object-dp"),C=w("./_property-desc");P.exports=w("./_descriptors")?function(c,p,d){return T.f(c,p,C(1,d))}:function(c,p,d){return c[p]=d,c}},{"./_descriptors":69,"./_object-dp":98,"./_property-desc":111}],79:[function(w,P,b){var T=w("./_global").document;P.exports=T&&T.documentElement},{"./_global":76}],80:[function(w,P,b){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,b){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,b){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,b){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,b){var T=w("./_cof");P.exports=Array.isArray||function(C){return T(C)=="Array"}},{"./_cof":64}],85:[function(w,P,b){P.exports=function(T){return typeof T=="object"?T!==null:typeof T=="function"}},{}],86:[function(w,P,b){var T=w("./_an-object");P.exports=function(C,c,p,d){try{return d?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,b){"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(d,o,a){d.prototype=T(p,{next:C(1,a)}),c(d,o+" Iterator")}},{"./_hide":78,"./_object-create":97,"./_property-desc":111,"./_set-to-string-tag":115,"./_wks":131}],88:[function(w,P,b){"use strict";var T=w("./_library"),C=w("./_export"),c=w("./_redefine"),p=w("./_hide"),d=w("./_iterators"),o=w("./_iter-create"),a=w("./_set-to-string-tag"),u=w("./_object-gpo"),s=w("./_wks")("iterator"),h=!([].keys&&"next"in[].keys()),i=function(){return this};P.exports=function(n,t,f,v,m,_,E){o(f,t,v);var g,y,x,l=function(W){if(!h&&W in D)return D[W];switch(W){case"keys":case"values":return function(){return new f(this,W)}}return function(){return new f(this,W)}},S=t+" Iterator",O=m=="values",A=!1,D=n.prototype,I=D[s]||D["@@iterator"]||m&&D[m],B=I||l(m),H=m?O?l("entries"):B:void 0,te=t=="Array"&&D.entries||I;if(te&&(x=u(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||!h&&!A&&D[s]||p(D,s,B),d[t]=B,d[S]=i,m)if(g={values:O?B:l("values"),keys:_?B:l("keys"),entries:H},E)for(y in g)y in D||c(D,y,g[y]);else C(C.P+C.F*(h||A),t,g);return g}},{"./_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,b){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,d){if(!d&&!C)return!1;var o=!1;try{var a=[7],u=a[T]();u.next=function(){return{done:o=!0}},a[T]=function(){return u},p(a)}catch(s){}return o}},{"./_wks":131}],90:[function(w,P,b){P.exports=function(T,C){return{value:C,done:!!T}}},{}],91:[function(w,P,b){P.exports={}},{}],92:[function(w,P,b){P.exports=!0},{}],93:[function(w,P,b){var T=w("./_uid")("meta"),C=w("./_is-object"),c=w("./_has"),p=w("./_object-dp").f,d=0,o=Object.isExtensible||function(){return!0},a=!w("./_fails")(function(){return o(Object.preventExtensions({}))}),u=function(t){p(t,T,{value:{i:"O"+ ++d,w:{}}})},s=function(t,f){if(!C(t))return typeof t=="symbol"?t:(typeof t=="string"?"S":"P")+t;if(!c(t,T)){if(!o(t))return"F";if(!f)return"E";u(t)}return t[T].i},h=function(t,f){if(!c(t,T)){if(!o(t))return!0;if(!f)return!1;u(t)}return t[T].w},i=function(t){return a&&n.NEED&&o(t)&&!c(t,T)&&u(t),t},n=P.exports={KEY:T,NEED:!1,fastKey:s,getWeak:h,onFreeze:i}},{"./_fails":74,"./_has":77,"./_is-object":85,"./_object-dp":98,"./_uid":127}],94:[function(w,P,b){var T=w("./_global"),C=w("./_task").set,c=T.MutationObserver||T.WebKitMutationObserver,p=T.process,d=T.Promise,o=w("./_cof")(p)=="process";P.exports=function(){var a,u,s,h=function(){var f,v;for(o&&(f=p.domain)&&f.exit();a;){v=a.fn,a=a.next;try{v()}catch(m){throw a?s():u=void 0,m}}u=void 0,f&&f.enter()};if(o)s=function(){p.nextTick(h)};else if(!c||T.navigator&&T.navigator.standalone)if(d&&d.resolve){var i=d.resolve(void 0);s=function(){i.then(h)}}else s=function(){C.call(T,h)};else{var n=!0,t=document.createTextNode("");new c(h).observe(t,{characterData:!0}),s=function(){t.data=n=!n}}return function(f){var v={fn:f,next:void 0};u&&(u.next=v),a||(a=v,s()),u=v}}},{"./_cof":64,"./_global":76,"./_task":120}],95:[function(w,P,b){"use strict";function T(c){var p,d;this.promise=new c(function(o,a){if(p!==void 0||d!==void 0)throw TypeError("Bad Promise constructor");p=o,d=a}),this.resolve=C(p),this.reject=C(d)}var C=w("./_a-function");P.exports.f=function(c){return new T(c)}},{"./_a-function":58}],96:[function(w,P,b){"use strict";var T=w("./_object-keys"),C=w("./_object-gops"),c=w("./_object-pie"),p=w("./_to-object"),d=w("./_iobject"),o=Object.assign;P.exports=!o||w("./_fails")(function(){var a={},u={},s=Symbol(),h="abcdefghijklmnopqrst";return a[s]=7,h.split("").forEach(function(i){u[i]=i}),o({},a)[s]!=7||Object.keys(o({},u)).join("")!=h})?function(a,u){for(var s=p(a),h=arguments.length,i=1,n=C.f,t=c.f;h>i;)for(var f,v=d(arguments[i++]),m=n?T(v).concat(n(v)):T(v),_=m.length,E=0;_>E;)t.call(v,f=m[E++])&&(s[f]=v[f]);return s}:o},{"./_fails":74,"./_iobject":82,"./_object-gops":103,"./_object-keys":106,"./_object-pie":107,"./_to-object":125}],97:[function(w,P,b){var T=w("./_an-object"),C=w("./_object-dps"),c=w("./_enum-bug-keys"),p=w("./_shared-key")("IE_PROTO"),d=function(){},o=function(){var a,u=w("./_dom-create")("iframe"),s=c.length;for(u.style.display="none",w("./_html").appendChild(u),u.src="javascript:",a=u.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,u){var s;return a!==null?(d.prototype=T(a),s=new d,d.prototype=null,s[p]=a):s=o(),u===void 0?s:C(s,u)}},{"./_an-object":61,"./_dom-create":70,"./_enum-bug-keys":71,"./_html":79,"./_object-dps":99,"./_shared-key":116}],98:[function(w,P,b){var T=w("./_an-object"),C=w("./_ie8-dom-define"),c=w("./_to-primitive"),p=Object.defineProperty;b.f=w("./_descriptors")?Object.defineProperty:function(d,o,a){if(T(d),o=c(o,!0),T(a),C)try{return p(d,o,a)}catch(u){}if("get"in a||"set"in a)throw TypeError("Accessors not supported!");return"value"in a&&(d[o]=a.value),d}},{"./_an-object":61,"./_descriptors":69,"./_ie8-dom-define":80,"./_to-primitive":126}],99:[function(w,P,b){var T=w("./_object-dp"),C=w("./_an-object"),c=w("./_object-keys");P.exports=w("./_descriptors")?Object.defineProperties:function(p,d){C(p);for(var o,a=c(d),u=a.length,s=0;u>s;)T.f(p,o=a[s++],d[o]);return p}},{"./_an-object":61,"./_descriptors":69,"./_object-dp":98,"./_object-keys":106}],100:[function(w,P,b){var T=w("./_object-pie"),C=w("./_property-desc"),c=w("./_to-iobject"),p=w("./_to-primitive"),d=w("./_has"),o=w("./_ie8-dom-define"),a=Object.getOwnPropertyDescriptor;b.f=w("./_descriptors")?a:function(u,s){if(u=c(u),s=p(s,!0),o)try{return a(u,s)}catch(h){}if(d(u,s))return C(!T.f.call(u,s),u[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,b){var T=w("./_to-iobject"),C=w("./_object-gopn").f,c={}.toString,p=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],d=function(o){try{return C(o)}catch(a){return p.slice()}};P.exports.f=function(o){return p&&c.call(o)=="[object Window]"?d(o):C(T(o))}},{"./_object-gopn":102,"./_to-iobject":123}],102:[function(w,P,b){var T=w("./_object-keys-internal"),C=w("./_enum-bug-keys").concat("length","prototype");b.f=Object.getOwnPropertyNames||function(c){return T(c,C)}},{"./_enum-bug-keys":71,"./_object-keys-internal":105}],103:[function(w,P,b){b.f=Object.getOwnPropertySymbols},{}],104:[function(w,P,b){var T=w("./_has"),C=w("./_to-object"),c=w("./_shared-key")("IE_PROTO"),p=Object.prototype;P.exports=Object.getPrototypeOf||function(d){return d=C(d),T(d,c)?d[c]:typeof d.constructor=="function"&&d instanceof d.constructor?d.constructor.prototype:d instanceof Object?p:null}},{"./_has":77,"./_shared-key":116,"./_to-object":125}],105:[function(w,P,b){var T=w("./_has"),C=w("./_to-iobject"),c=w("./_array-includes")(!1),p=w("./_shared-key")("IE_PROTO");P.exports=function(d,o){var a,u=C(d),s=0,h=[];for(a in u)a!=p&&T(u,a)&&h.push(a);for(;o.length>s;)T(u,a=o[s++])&&(~c(h,a)||h.push(a));return h}},{"./_array-includes":62,"./_has":77,"./_shared-key":116,"./_to-iobject":123}],106:[function(w,P,b){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,b){b.f={}.propertyIsEnumerable},{}],108:[function(w,P,b){var T=w("./_export"),C=w("./_core"),c=w("./_fails");P.exports=function(p,d){var o=(C.Object||{})[p]||Object[p],a={};a[p]=d(o),T(T.S+T.F*c(function(){o(1)}),"Object",a)}},{"./_core":65,"./_export":73,"./_fails":74}],109:[function(w,P,b){P.exports=function(T){try{return{e:!1,v:T()}}catch(C){return{e:!0,v:C}}}},{}],110:[function(w,P,b){var T=w("./_an-object"),C=w("./_is-object"),c=w("./_new-promise-capability");P.exports=function(p,d){if(T(p),C(d)&&d.constructor===p)return d;var o=c.f(p);return(0,o.resolve)(d),o.promise}},{"./_an-object":61,"./_is-object":85,"./_new-promise-capability":95}],111:[function(w,P,b){P.exports=function(T,C){return{enumerable:!(1&T),configurable:!(2&T),writable:!(4&T),value:C}}},{}],112:[function(w,P,b){var T=w("./_hide");P.exports=function(C,c,p){for(var d in c)p&&C[d]?C[d]=c[d]:T(C,d,c[d]);return C}},{"./_hide":78}],113:[function(w,P,b){P.exports=w("./_hide")},{"./_hide":78}],114:[function(w,P,b){"use strict";var T=w("./_global"),C=w("./_core"),c=w("./_object-dp"),p=w("./_descriptors"),d=w("./_wks")("species");P.exports=function(o){var a=typeof C[o]=="function"?C[o]:T[o];p&&a&&!a[d]&&c.f(a,d,{configurable:!0,get:function(){return this}})}},{"./_core":65,"./_descriptors":69,"./_global":76,"./_object-dp":98,"./_wks":131}],115:[function(w,P,b){var T=w("./_object-dp").f,C=w("./_has"),c=w("./_wks")("toStringTag");P.exports=function(p,d,o){p&&!C(p=o?p:p.prototype,c)&&T(p,c,{configurable:!0,value:d})}},{"./_has":77,"./_object-dp":98,"./_wks":131}],116:[function(w,P,b){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,b){var T=w("./_core"),C=w("./_global"),c=C["__core-js_shared__"]||(C["__core-js_shared__"]={});(P.exports=function(p,d){return c[p]||(c[p]=d!==void 0?d:{})})("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,b){var T=w("./_an-object"),C=w("./_a-function"),c=w("./_wks")("species");P.exports=function(p,d){var o,a=T(p).constructor;return a===void 0||(o=T(a)[c])==null?d:C(o)}},{"./_a-function":58,"./_an-object":61,"./_wks":131}],119:[function(w,P,b){var T=w("./_to-integer"),C=w("./_defined");P.exports=function(c){return function(p,d){var o,a,u=String(C(p)),s=T(d),h=u.length;return s<0||s>=h?c?"":void 0:(o=u.charCodeAt(s),o<55296||o>56319||s+1===h||(a=u.charCodeAt(s+1))<56320||a>57343?c?u.charAt(s):o:c?u.slice(s,s+2):a-56320+(o-55296<<10)+65536)}}},{"./_defined":68,"./_to-integer":122}],120:[function(w,P,b){var T,C,c,p=w("./_ctx"),d=w("./_invoke"),o=w("./_html"),a=w("./_dom-create"),u=w("./_global"),s=u.process,h=u.setImmediate,i=u.clearImmediate,n=u.MessageChannel,t=u.Dispatch,f=0,v={},m=function(){var E=+this;if(v.hasOwnProperty(E)){var g=v[E];delete v[E],g()}},_=function(E){m.call(E.data)};h&&i||(h=function(E){for(var g=[],y=1;arguments.length>y;)g.push(arguments[y++]);return v[++f]=function(){d(typeof E=="function"?E:Function(E),g)},T(f),f},i=function(E){delete v[E]},w("./_cof")(s)=="process"?T=function(E){s.nextTick(p(m,E,1))}:t&&t.now?T=function(E){t.now(p(m,E,1))}:n?(C=new n,c=C.port2,C.port1.onmessage=_,T=p(c.postMessage,c,1)):u.addEventListener&&typeof postMessage=="function"&&!u.importScripts?(T=function(E){u.postMessage(E+"","*")},u.addEventListener("message",_,!1)):T="onreadystatechange"in a("script")?function(E){o.appendChild(a("script")).onreadystatechange=function(){o.removeChild(this),m.call(E)}}:function(E){setTimeout(p(m,E,1),0)}),P.exports={set:h,clear:i}},{"./_cof":64,"./_ctx":67,"./_dom-create":70,"./_global":76,"./_html":79,"./_invoke":81}],121:[function(w,P,b){var T=w("./_to-integer"),C=Math.max,c=Math.min;P.exports=function(p,d){return p=T(p),p<0?C(p+d,0):c(p,d)}},{"./_to-integer":122}],122:[function(w,P,b){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,b){var T=w("./_iobject"),C=w("./_defined");P.exports=function(c){return T(C(c))}},{"./_defined":68,"./_iobject":82}],124:[function(w,P,b){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,b){var T=w("./_defined");P.exports=function(C){return Object(T(C))}},{"./_defined":68}],126:[function(w,P,b){var T=w("./_is-object");P.exports=function(C,c){if(!T(C))return C;var p,d;if(c&&typeof(p=C.toString)=="function"&&!T(d=p.call(C)))return d;if(typeof(p=C.valueOf)=="function"&&!T(d=p.call(C)))return d;if(!c&&typeof(p=C.toString)=="function"&&!T(d=p.call(C)))return d;throw TypeError("Can't convert object to primitive value")}},{"./_is-object":85}],127:[function(w,P,b){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,b){var T=w("./_global"),C=T.navigator;P.exports=C&&C.userAgent||""},{"./_global":76}],129:[function(w,P,b){var T=w("./_global"),C=w("./_core"),c=w("./_library"),p=w("./_wks-ext"),d=w("./_object-dp").f;P.exports=function(o){var a=C.Symbol||(C.Symbol=c?{}:T.Symbol||{});o.charAt(0)=="_"||o in a||d(a,o,{value:p.f(o)})}},{"./_core":65,"./_global":76,"./_library":92,"./_object-dp":98,"./_wks-ext":130}],130:[function(w,P,b){b.f=w("./_wks")},{"./_wks":131}],131:[function(w,P,b){var T=w("./_shared")("wks"),C=w("./_uid"),c=w("./_global").Symbol,p=typeof c=="function";(P.exports=function(d){return T[d]||(T[d]=p&&c[d]||(p?c:C)("Symbol."+d))}).store=T},{"./_global":76,"./_shared":117,"./_uid":127}],132:[function(w,P,b){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,b){"use strict";var T=w("./_ctx"),C=w("./_export"),c=w("./_to-object"),p=w("./_iter-call"),d=w("./_is-array-iter"),o=w("./_to-length"),a=w("./_create-property"),u=w("./core.get-iterator-method");C(C.S+C.F*!w("./_iter-detect")(function(s){Array.from(s)}),"Array",{from:function(s){var h,i,n,t,f=c(s),v=typeof this=="function"?this:Array,m=arguments.length,_=m>1?arguments[1]:void 0,E=_!==void 0,g=0,y=u(f);if(E&&(_=T(_,m>2?arguments[2]:void 0,2)),y==null||v==Array&&d(y))for(h=o(f.length),i=new v(h);h>g;g++)a(i,g,E?_(f[g],g):f[g]);else for(t=y.call(f),i=new v;!(n=t.next()).done;g++)a(i,g,E?p(t,_,[n.value,g],!0):n.value);return i.length=g,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,b){"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(d,o){this._t=p(d),this._i=0,this._k=o},function(){var d=this._t,o=this._k,a=this._i++;return!d||a>=d.length?(this._t=void 0,C(1)):o=="keys"?C(0,a):o=="values"?C(0,d[a]):C(0,[a,d[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,b){"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(d){if(typeof this!="function"||!T(d))return!1;if(!T(this.prototype))return d instanceof this;for(;d=C(d);)if(this.prototype===d)return!0;return!1}})},{"./_is-object":85,"./_object-dp":98,"./_object-gpo":104,"./_wks":131}],136:[function(w,P,b){var T=w("./_export");T(T.S+T.F,"Object",{assign:w("./_object-assign")})},{"./_export":73,"./_object-assign":96}],137:[function(w,P,b){var T=w("./_export");T(T.S,"Object",{create:w("./_object-create")})},{"./_export":73,"./_object-create":97}],138:[function(w,P,b){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,b){w("./_object-sap")("getOwnPropertyNames",function(){return w("./_object-gopn-ext").f})},{"./_object-gopn-ext":101,"./_object-sap":108}],140:[function(w,P,b){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,b){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,b){arguments[4][36][0].apply(b,arguments)},{dup:36}],143:[function(w,P,b){"use strict";var T,C,c,p,d=w("./_library"),o=w("./_global"),a=w("./_ctx"),u=w("./_classof"),s=w("./_export"),h=w("./_is-object"),i=w("./_a-function"),n=w("./_an-instance"),t=w("./_for-of"),f=w("./_species-constructor"),v=w("./_task").set,m=w("./_microtask")(),_=w("./_new-promise-capability"),E=w("./_perform"),g=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=u(l)=="process",I=function(){},B=C=_.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&&g.indexOf("Chrome/66")===-1}catch(Ce){}}(),te=function(ce){var de;return!(!h(ce)||typeof(de=ce.then)!="function")&&de},W=function(ce,de){if(!ce._n){ce._n=!0;var Ce=ce._c;m(function(){for(var Se=ce._v,Pe=ce._s==1,ye=0;Ce.length>ye;)!function(Ee){var Ge,Ue,Fe,He=Pe?Ee.ok:Ee.fail,be=Ee.resolve,me=Ee.reject,We=Ee.domain;try{He?(Pe||(ce._h==2&&ne(ce),ce._h=1),He===!0?Ge=Se:(We&&We.enter(),Ge=He(Se),We&&(We.exit(),Fe=!0)),Ge===Ee.promise?me(x("Promise-chain cycle")):(Ue=te(Ge))?Ue.call(Ge,be,me):be(Ge)):me(Se)}catch(ze){We&&!Fe&&We.exit(),me(ze)}}(Ce[ye++]);ce._c=[],ce._n=!1,de&&!ce._h&&V(ce)})}},V=function(ce){v.call(o,function(){var de,Ce,Se,Pe=ce._v,ye=X(ce);if(ye&&(de=E(function(){D?l.emit("unhandledRejection",Pe,ce):(Ce=o.onunhandledrejection)?Ce({promise:ce,reason:Pe}):(Se=o.console)&&Se.error&&Se.error("Unhandled promise rejection",Pe)}),ce._h=D||X(ce)?2:1),ce._a=void 0,ye&&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})})},Y=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))?m(function(){var Se={_w:Ce,_d:!1};try{de.call(ce,a(ee,Se,1),a(Y,Se,1))}catch(Pe){Y.call(Se,Pe)}}):(Ce._v=ce,Ce._s=1,W(Ce,!1))}catch(Se){Y.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(Y,this,1))}catch(de){Y.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(f(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(Y,ce,1)},_.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*(d||!H),"Promise",{resolve:function(ce){return y(d&&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,Pe=Ce.reject,ye=E(function(){var Ee=[],Ge=0,Ue=1;t(ce,!1,function(Fe){var He=Ge++,be=!1;Ee.push(void 0),Ue++,de.resolve(Fe).then(function(me){be||(be=!0,Ee[He]=me,--Ue||Se(Ee))},Pe)}),--Ue||Se(Ee)});return ye.e&&Pe(ye.v),Ce.promise},race:function(ce){var de=this,Ce=B(de),Se=Ce.reject,Pe=E(function(){t(ce,!1,function(ye){de.resolve(ye).then(Ce.resolve,Se)})});return Pe.e&&Se(Pe.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,b){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(d){for(var o,a=[],u=arguments.length,s=0;u>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,b){"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,b){"use strict";var T=w("./_global"),C=w("./_has"),c=w("./_descriptors"),p=w("./_export"),d=w("./_redefine"),o=w("./_meta").KEY,a=w("./_fails"),u=w("./_shared"),s=w("./_set-to-string-tag"),h=w("./_uid"),i=w("./_wks"),n=w("./_wks-ext"),t=w("./_wks-define"),f=w("./_enum-keys"),v=w("./_is-array"),m=w("./_an-object"),_=w("./_is-object"),E=w("./_to-iobject"),g=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,Y=u("symbol-registry"),ee=u("symbols"),ce=u("op-symbols"),de=Object.prototype,Ce=typeof H=="function",Se=T.QObject,Pe=!Se||!Se.prototype||!Se.prototype.findChild,ye=c&&a(function(){return x(I({},"a",{get:function(){return I(this,"a",{value:7}).a}})).a!=7})?function(q,$,J){var xe=D(de,$);xe&&delete de[$],I(q,$,J),xe&&q!==de&&I(de,$,xe)}:I,Ee=function(q){var $=ee[q]=x(H.prototype);return $._k=q,$},Ge=Ce&&typeof H.iterator=="symbol"?function(q){return typeof q=="symbol"}:function(q){return q instanceof H},Ue=function(q,$,J){return q===de&&Ue(ce,$,J),m(q),$=g($,!0),m(J),C(ee,$)?(J.enumerable?(C(q,V)&&q[V][$]&&(q[V][$]=!1),J=x(J,{enumerable:y(0,!1)})):(C(q,V)||I(q,V,y(1,{})),q[V][$]=!0),ye(q,$,J)):I(q,$,J)},Fe=function(q,$){m(q);for(var J,xe=f($=E($)),ke=0,dt=xe.length;dt>ke;)Ue(q,J=xe[ke++],$[J]);return q},He=function(q,$){return $===void 0?x(q):Fe(x(q),$)},be=function(q){var $=ne.call(this,q=g(q,!0));return!(this===de&&C(ee,q)&&!C(ce,q))&&(!($||!C(this,q)||!C(ee,q)||C(this,V)&&this[V][q])||$)},me=function(q,$){if(q=E(q),$=g($,!0),q!==de||!C(ee,$)||C(ce,$)){var J=D(q,$);return!J||!C(ee,$)||C(q,V)&&q[V][$]||(J.enumerable=!0),J}},We=function(q){for(var $,J=B(E(q)),xe=[],ke=0;J.length>ke;)C(ee,$=J[ke++])||$==V||$==o||xe.push($);return xe},ze=function(q){for(var $,J=q===de,xe=B(J?ce:E(q)),ke=[],dt=0;xe.length>dt;)!C(ee,$=xe[dt++])||J&&!C(de,$)||ke.push(ee[$]);return ke};Ce||(H=function(){if(this instanceof H)throw TypeError("Symbol is not a constructor!");var q=h(arguments.length>0?arguments[0]:void 0),$=function(J){this===de&&$.call(ce,J),C(this,V)&&C(this[V],q)&&(this[V][q]=!1),ye(this,q,y(1,J))};return c&&Pe&&ye(de,q,{configurable:!0,set:$}),Ee(q)},d(H.prototype,"toString",function(){return this._k}),S.f=me,O.f=Ue,w("./_object-gopn").f=l.f=We,w("./_object-pie").f=be,w("./_object-gops").f=ze,c&&!w("./_library")&&d(de,"propertyIsEnumerable",be,!0),n.f=function(q){return Ee(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(Y,q+="")?Y[q]:Y[q]=H(q)},keyFor:function(q){if(!Ge(q))throw TypeError(q+" is not a symbol!");for(var $ in Y)if(Y[$]===q)return $},useSetter:function(){Pe=!0},useSimple:function(){Pe=!1}}),p(p.S+p.F*!Ce,"Object",{create:He,defineProperty:Ue,defineProperties:Fe,getOwnPropertyDescriptor:me,getOwnPropertyNames:We,getOwnPropertySymbols:ze}),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 $,J,xe=[q],ke=1;arguments.length>ke;)xe.push(arguments[ke++]);if(J=$=xe[1],(_($)||q!==void 0)&&!Ge(q))return v($)||($=function(dt,Ne){if(typeof J=="function"&&(Ne=J.call(this,dt,Ne)),!Ge(Ne))return Ne}),xe[1]=$,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,b){"use strict";var T=w("./_export"),C=w("./_core"),c=w("./_global"),p=w("./_species-constructor"),d=w("./_promise-resolve");T(T.P+T.R,"Promise",{finally:function(o){var a=p(this,C.Promise||c.Promise),u=typeof o=="function";return this.then(u?function(s){return d(a,o()).then(function(){return s})}:o,u?function(s){return d(a,o()).then(function(){throw s})}:o)}})},{"./_core":65,"./_export":73,"./_global":76,"./_promise-resolve":110,"./_species-constructor":118}],148:[function(w,P,b){"use strict";var T=w("./_export"),C=w("./_new-promise-capability"),c=w("./_perform");T(T.S,"Promise",{try:function(p){var d=C.f(this),o=c(p);return(o.e?d.reject:d.resolve)(o.v),d.promise}})},{"./_export":73,"./_new-promise-capability":95,"./_perform":109}],149:[function(w,P,b){w("./_wks-define")("asyncIterator")},{"./_wks-define":129}],150:[function(w,P,b){w("./_wks-define")("observable")},{"./_wks-define":129}],151:[function(w,P,b){w("./es6.array.iterator");for(var T=w("./_global"),C=w("./_hide"),c=w("./_iterators"),p=w("./_wks")("toStringTag"),d="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)})}}();u.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"},u.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 u}):(b===void 0?"undefined":(0,C.default)(b))==="object"?P.exports=u:c.dateFormat=u}(void 0)},{"babel-runtime/helpers/typeof":32}],155:[function(w,P,b){(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 u=this.useColors;if(a[0]=(u?"%c":"")+this.namespace+(u?" %c":" ")+a[0]+(u?"%c ":" ")+"+"+b.humanize(this.diff),u){var s="color: "+this.color;a.splice(1,0,s,"color: inherit");var h=0,i=0;a[0].replace(/%[a-zA-Z%]/g,function(n){n!=="%%"&&(h++,n==="%c"&&(i=h))}),a.splice(i,0,s)}}function p(){return typeof console=="object"&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function d(a){try{a==null?b.storage.removeItem("debug"):b.storage.debug=a}catch(u){}}function o(){var a;try{a=b.storage.debug}catch(u){}return!a&&T!==void 0&&"env"in T&&(a=T.env.DEBUG),a}b=P.exports=w("./debug"),b.log=p,b.formatArgs=c,b.save=d,b.load=o,b.useColors=C,b.storage=typeof chrome!="undefined"&&chrome.storage!==void 0?chrome.storage.local:function(){try{return window.localStorage}catch(a){}}(),b.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],b.formatters.j=function(a){try{return JSON.stringify(a)}catch(u){return"[UnexpectedJSONParseError]: "+u.message}},b.enable(o())}).call(this,w("_process"))},{"./debug":156,_process:173}],156:[function(w,P,b){function T(u){var s,h=0;for(s in u)h=(h<<5)-h+u.charCodeAt(s),h|=0;return b.colors[Math.abs(h)%b.colors.length]}function C(u){function s(){if(s.enabled){var h=s,i=+new Date,n=i-(a||i);h.diff=n,h.prev=a,h.curr=i,a=i;for(var t=new Array(arguments.length),f=0;f]/;P.exports=T},{}],158:[function(w,P,b){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 d(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,u,s,h,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(u=this._events[o],d(u))return!1;if(C(u))switch(arguments.length){case 1:u.call(this);break;case 2:u.call(this,arguments[1]);break;case 3:u.call(this,arguments[1],arguments[2]);break;default:h=Array.prototype.slice.call(arguments,1),u.apply(this,h)}else if(p(u))for(h=Array.prototype.slice.call(arguments,1),n=u.slice(),s=n.length,i=0;i0&&this._events[o].length>u&&(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 u(){this.removeListener(o,u),s||(s=!0,a.apply(this,arguments))}if(!C(a))throw TypeError("listener must be a function");var s=!1;return u.listener=a,this.on(o,u),this},T.prototype.removeListener=function(o,a){var u,s,h,i;if(!C(a))throw TypeError("listener must be a function");if(!this._events||!this._events[o])return this;if(u=this._events[o],h=u.length,s=-1,u===a||C(u.listener)&&u.listener===a)delete this._events[o],this._events.removeListener&&this.emit("removeListener",o,a);else if(p(u)){for(i=h;i-- >0;)if(u[i]===a||u[i].listener&&u[i].listener===a){s=i;break}if(s<0)return this;u.length===1?(u.length=0,delete this._events[o]):u.splice(s,1),this._events.removeListener&&this.emit("removeListener",o,a)}return this},T.prototype.removeAllListeners=function(o){var a,u;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(u=this._events[o],C(u))this.removeListener(o,u);else if(u)for(;u.length;)this.removeListener(o,u[u.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,b){var T=w("http"),C=P.exports;for(var c in T)T.hasOwnProperty(c)&&(C[c]=T[c]);C.request=function(p,d){return p||(p={}),p.scheme="https",p.protocol="https:",T.request.call(this,p,d)}},{http:196}],160:[function(w,P,b){"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 d=new Error(T.format("humanize-ms(%j) result undefined",c));console.warn(d.stack)}return p}},{ms:169,util:207}],161:[function(w,P,b){b.read=function(T,C,c,p,d){var o,a,u=8*d-p-1,s=(1<>1,i=-7,n=c?d-1:0,t=c?-1:1,f=T[C+n];for(n+=t,o=f&(1<<-i)-1,f>>=-i,i+=u;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-h;else{if(o===s)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,p),o-=h}return(f?-1:1)*a*Math.pow(2,o-p)},b.write=function(T,C,c,p,d,o){var a,u,s,h=8*o-d-1,i=(1<>1,t=d===23?Math.pow(2,-24)-Math.pow(2,-77):0,f=p?0:o-1,v=p?1:-1,m=C<0||C===0&&1/C<0?1:0;for(C=Math.abs(C),isNaN(C)||C===1/0?(u=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?(u=0,a=i):a+n>=1?(u=(C*s-1)*Math.pow(2,d),a+=n):(u=C*Math.pow(2,n-1)*Math.pow(2,d),a=0));d>=8;T[c+f]=255&u,f+=v,u/=256,d-=8);for(a=a<0;T[c+f]=255&a,f+=v,a/=256,h-=8);T[c+f-v]|=128*m}},{}],162:[function(w,P,b){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,b){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,b){!function(T){function C(d){return p.call(d).replace(/^[^{]*{\s*/,"").replace(/\s*}[^}]*$/,"")}function c(d){return typeof d=="function"&&(/^class(\s|\{\}$)/.test(p.call(d))||/^.*classCallCheck\(/.test(C(d)))}var p=Function.prototype.toString;b!==void 0?(P!==void 0&&P.exports&&(b=P.exports=c),b.isClass=c):typeof j=="function"&&j.amd?j([],function(){return c}):T.isClass=c}(this)},{}],165:[function(w,P,b){"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){b[T(o)]=C[o]}),b.stream=c,b.readableStream=c.isReadable,b.writableStream=c.isWritable,b.duplexStream=c.isDuplex,b.class=p,b.finite=function(o){return Number.isFinite(o)},b.NaN=function(o){return Number.isNaN(o)},b.generator=function(o){return o&&typeof o.next=="function"&&typeof o.throw=="function"},b.generatorFunction=function(o){return o&&o.constructor&&o.constructor.name==="GeneratorFunction"},b.asyncFunction=function(o){return o&&o.constructor&&o.constructor.name==="AsyncFunction"},b.promise=function(o){return o&&typeof o.then=="function"};var d=Math.pow(2,31);b.int=function(o){return C.isNumber(o)&&o%1==0},b.int32=function(o){return b.int(o)&&o=-d},b.long=function(o){return b.int(o)&&(o>=d||o<-d)},b.Long=function(o){return b.object(o)&&b.number(o.high)&&b.number(o.low)},b.double=function(o){return C.isNumber(o)&&!isNaN(o)&&o%1!=0},b.date=function(o){return o instanceof Date},b.regExp=function(o){return o instanceof RegExp},b.regexp=b.regExp,b.error=function(o){return o instanceof Error},b.array=function(o){return Array.isArray(o)}},{"core-util-is":153,"is-class":164,isstream:167}],166:[function(w,P,b){var T={}.toString;P.exports=Array.isArray||function(C){return T.call(C)=="[object Array]"}},{}],167:[function(w,P,b){function T(o){return o instanceof d.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 d=w("stream");P.exports=T,P.exports.isReadable=C,P.exports.isWritable=c,P.exports.isDuplex=p},{stream:195}],168:[function(w,P,b){"use strict";function T(c,p,d){if(!c)throw new TypeError("argument dest is required");if(!p)throw new TypeError("argument src is required");return d===void 0&&(d=!0),Object.getOwnPropertyNames(p).forEach(function(o){if(d||!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,b){function T(h){if(h=String(h),!(h.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(h);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*u;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*d;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function C(h){return h>=u?Math.round(h/u)+"d":h>=a?Math.round(h/a)+"h":h>=o?Math.round(h/o)+"m":h>=d?Math.round(h/d)+"s":h+"ms"}function c(h){return p(h,u,"day")||p(h,a,"hour")||p(h,o,"minute")||p(h,d,"second")||h+" ms"}function p(h,i,n){if(!(h0)return T(h);if(n==="number"&&isNaN(h)===!1)return i.long?c(h):C(h);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(h))}},{}],170:[function(w,P,b){(function(T){function C(o,a){for(var u=0,s=o.length-1;s>=0;s--){var h=o[s];h==="."?o.splice(s,1):h===".."?(o.splice(s,1),u++):u&&(o.splice(s,1),u--)}if(a)for(;u--;u)o.unshift("..");return o}function c(o){typeof o!="string"&&(o+="");var a,u=0,s=-1,h=!0;for(a=o.length-1;a>=0;--a)if(o.charCodeAt(a)===47){if(!h){u=a+1;break}}else s===-1&&(h=!1,s=a+1);return s===-1?"":o.slice(u,s)}function p(o,a){if(o.filter)return o.filter(a);for(var u=[],s=0;s=-1&&!a;u--){var s=u>=0?arguments[u]: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(h){return!!h}),!a).join("/"),(a?"/":"")+o||"."},b.normalize=function(o){var a=b.isAbsolute(o),u=d(o,-1)==="/";return o=C(p(o.split("/"),function(s){return!!s}),!a).join("/"),o||a||(o="."),o&&u&&(o+="/"),(a?"/":"")+o},b.isAbsolute=function(o){return o.charAt(0)==="/"},b.join=function(){var o=Array.prototype.slice.call(arguments,0);return b.normalize(p(o,function(a,u){if(typeof a!="string")throw new TypeError("Arguments to path.join must be strings");return a}).join("/"))},b.relative=function(o,a){function u(v){for(var m=0;m=0&&v[_]==="";_--);return m>_?[]:v.slice(m,_-m+1)}o=b.resolve(o).substr(1),a=b.resolve(a).substr(1);for(var s=u(o.split("/")),h=u(a.split("/")),i=Math.min(s.length,h.length),n=i,t=0;t=1;--i)if((a=o.charCodeAt(i))===47){if(!h){s=i;break}}else h=!1;return s===-1?u?"/":".":u&&s===1?"/":o.slice(0,s)},b.basename=function(o,a){var u=c(o);return a&&u.substr(-1*a.length)===a&&(u=u.substr(0,u.length-a.length)),u},b.extname=function(o){typeof o!="string"&&(o+="");for(var a=-1,u=0,s=-1,h=!0,i=0,n=o.length-1;n>=0;--n){var t=o.charCodeAt(n);if(t!==47)s===-1&&(h=!1,s=n+1),t===46?a===-1?a=n:i!==1&&(i=1):a!==-1&&(i=-1);else if(!h){u=n+1;break}}return a===-1||s===-1||i===0||i===1&&a===s-1&&a===u+1?"":o.slice(a,s)};var d="ab".substr(-1)==="b"?function(o,a,u){return o.substr(a,u)}:function(o,a,u){return a<0&&(a=o.length+a),o.substr(a,u)}}).call(this,w("_process"))},{_process:173}],171:[function(w,P,b){(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=d(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(ze)&&(/\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(ze)&&"NetFront")&&(We=[W]),ze=="IE"&&(W=(/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(O)||0)[1])?(ze+=" Mobile",k="Windows Phone "+(/\+$/.test(W)?W:W+".x"),Fe.unshift("desktop mode")):/\bWPDesktop\b/i.test(O)?(ze="IE Mobile",k="Windows Phone 8.x",Fe.unshift("desktop mode"),me||(me=(/\brv:([\d.]+)/.exec(O)||0)[1])):ze!="IE"&&We=="Trident"&&(W=/\brv:([\d.]+)/.exec(O))&&(ze&&Fe.push("identifying as "+ze+(me?" "+me:"")),ze="IE",me=W[1]),be){if(u(I,"global"))if(de&&(W=de.lang.System,Ue=W.getProperty("os.arch"),k=k||W.getProperty("os.name")+" "+W.getProperty("os.version")),Ce){try{me=I.require("ringo/engine").version.join("."),ze="RingoJS"}catch(q){(W=I.system)&&W.global.system==I.system&&(ze="Narwhal",k||(k=W[0].os||null))}ze||(ze="Rhino")}else typeof I.process=="object"&&!I.process.browser&&(W=I.process)&&(typeof W.versions=="object"&&(typeof W.versions.electron=="string"?(Fe.push("Node "+W.versions.node),ze="Electron",me=W.versions.electron):typeof W.versions.nw=="string"&&(Fe.push("Chromium "+me,"Node "+W.versions.node),ze="NW.js",me=W.versions.nw)),ze||(ze="Node.js",Ue=W.arch,k=W.platform,me=/[\d.]+/.exec(W.version),me=me?me[0]:null));else a(W=I.runtime)==ne?(ze="Adobe AIR",k=W.flash.system.Capabilities.os):a(W=I.phantom)==ce?(ze="PhantomJS",me=(W=W.version||null)&&W.major+"."+W.minor+"."+W.patch):typeof ye.documentMode=="number"&&(W=/\bTrident\/(\d+)/i.exec(O))?(me=[me,ye.documentMode],(W=+W[1]+4)!=me[1]&&(Fe.push("IE "+me[1]+" mode"),We&&(We[1]=""),me[1]=W),me=ze=="IE"?String(me[1].toFixed(1)):me[0]):typeof ye.documentMode=="number"&&/^(?:Chrome|Firefox)\b/.test(ze)&&(Fe.push("masking as "+ze+" "+me),ze="IE",me="11.0",We=["Trident"],k="Windows");k=k&&d(k)}if(me&&(W=/(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(me)||/(?:alpha|beta)(?: ?\d)?/i.exec(O+";"+(be&&H.appMinorVersion))||/\bMinefield\b/i.test(O)&&"a")&&(He=/b/i.test(W)?"beta":"alpha",me=me.replace(RegExp(W+"\\+?$"),"")+(He=="beta"?Pe:Se)+(/\d+\+?/.exec(W)||"")),ze=="Fennec"||ze=="Firefox"&&/\b(?:Android|Firefox OS)\b/.test(k))ze="Firefox Mobile";else if(ze=="Maxthon"&&me)me=me.replace(/\.[\d.]+/,".x");else if(/\bXbox\b/i.test(nt))nt=="Xbox 360"&&(k=null),nt=="Xbox 360"&&/\bIEMobile\b/.test(O)&&Fe.unshift("mobile mode");else if(!/^(?:Chrome|IE|Opera)$/.test(ze)&&(!ze||nt||/Browser|Mobi/.test(ze))||k!="Windows CE"&&!/Mobi/i.test(O))if(ze=="IE"&&be)try{I.external===null&&Fe.unshift("platform preview")}catch(q){Fe.unshift("embedded")}else(/\bBlackBerry\b/.test(nt)||/\bBB10\b/.test(O))&&(W=(RegExp(nt.replace(/ +/g," *")+"/([.\\d]+)","i").exec(O)||0)[1]||me)?(W=[W,/BB10/.test(O)],k=(W[1]?(nt=null,re="BlackBerry"):"Device Software")+" "+W[0],me=null):this!=o&&nt!="Wii"&&(be&&Ee||/Opera/.test(ze)&&/\b(?:MSIE|Firefox)\b/i.test(O)||ze=="Firefox"&&/\bOS X (?:\d+\.){2,}/.test(k)||ze=="IE"&&(k&&!/^Win/.test(k)&&me>5.5||/\bWindows XP\b/.test(k)&&me>8||me==8&&!/\bTrident\b/.test(O)))&&!g.test(W=n.call(o,O.replace(g,"")+";"))&&W.name&&(W="ing as "+W.name+((W=W.version)?" "+W:""),g.test(ze)?(/\bIE\b/.test(W)&&k=="Mac OS"&&(k=null),W="identify"+W):(W="mask"+W,ze=Ge?d(Ge.replace(/([a-z])([A-Z])/g,"$1 $2")):"Opera",/\bIE\b/.test(W)&&(k=null),be||(me=null)),We=["Presto"],Fe.push(W));else ze+=" Mobile";(W=(/\bAppleWebKit\/([\d.]+\+?)/i.exec(O)||0)[1])&&(W=[parseFloat(W.replace(/\.(\d)$/,".0$1")),W],ze=="Safari"&&W[1].slice(-1)=="+"?(ze="WebKit Nightly",He="alpha",me=W[1].slice(0,-1)):me!=W[1]&&me!=(W[2]=(/\bSafari\/([\d.]+\+?)/i.exec(O)||0)[1])||(me=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"]),be&&(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)?"":"+")),ze=="Safari"&&(!me||parseInt(me)>45)&&(me=W)),ze=="Opera"&&(W=/\bzbov|zvav$/.exec(k))?(ze+=" ",Fe.unshift("desktop mode"),W=="zvav"?(ze+="Mini",me=null):ze+="Mobile",k=k.replace(RegExp(" *"+W+"$"),"")):ze=="Safari"&&/\bChrome\b/.exec(We&&We[1])&&(Fe.unshift("desktop mode"),ze="Chrome Mobile",me=null,/\bOS X\b/.test(k)?(re="Apple",k="iOS 4.3+"):k=null),me&&me.indexOf(W=/[\d.]+$/.exec(k))==0&&O.indexOf("/"+W+"-")>-1&&(k=i(k.replace(W,""))),We&&!/\b(?:Avant|Nook)\b/.test(ze)&&(/Browser|Lunascape|Maxthon/.test(ze)||ze!="Safari"&&/^iOS/.test(k)&&/\bSafari\b/.test(We[1])||/^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|Web)/.test(ze)&&We[1])&&(W=We[We.length-1])&&Fe.push(W),Fe.length&&(Fe=["("+Fe.join("; ")+")"]),re&&nt&&nt.indexOf(re)<0&&Fe.push("on "+re),nt&&Fe.push((/^on /.test(Fe[Fe.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(Ue))&&!/\bi686\b/i.test(Ue)?(k&&(k.architecture=64,k.family=k.family.replace(RegExp(" *"+W),"")),ze&&(/\bWOW64\b/i.test(O)||be&&/\w(?:86|32)$/.test(H.cpuClass||H.platform)&&!/\bWin64; x64\b/i.test(O))&&Fe.unshift("32-bit")):k&&/^OS X/.test(k.family)&&ze=="Chrome"&&parseFloat(me)>=39&&(k.architecture=64),O||(O=null);var U={};return U.description=O,U.layout=We&&We[0],U.manufacturer=re,U.name=ze,U.prerelease=He,U.product=nt,U.ua=O,U.version=ze&&me,U.os=k||{architecture:null,family:null,version:null,toString:function(){return"null"}},U.parse=n,U.toString=D,U.version&&Fe.unshift(me),U.name&&Fe.unshift(ze),k&&ze&&(k!=String(k).split(" ")[0]||k!=ze.split(" ")[0]&&!nt)&&Fe.push(nt?"("+k+")":"on "+k),Fe.length&&(U.description=Fe.join(" ")),U}var t={function:!0,object:!0},f=t[typeof window]&&window||this,v=t[typeof b]&&b,m=t[typeof P]&&P&&!P.nodeType&&P,_=v&&m&&typeof T=="object"&&T;!_||_.global!==_&&_.window!==_&&_.self!==_||(f=_);var E=Math.pow(2,53)-1,g=/\bOpera/,y=Object.prototype,x=y.hasOwnProperty,l=y.toString,S=n();typeof j=="function"&&typeof j.amd=="object"&&j.amd?(f.platform=S,j(function(){return S})):v&&m?o(S,function(O,A){v[A]=O}):f.platform=S}).call(this)}).call(this,typeof le!="undefined"?le:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],172:[function(w,P,b){(function(T){"use strict";function C(c,p,d,o){if(typeof c!="function")throw new TypeError('"callback" argument must be a function');var a,u,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,d)});case 4:return T.nextTick(function(){c.call(null,p,d,o)});default:for(a=new Array(s-1),u=0;u1)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,Pe=ee.length;Se=55296&&ce<=56319&&Se65535&&(ce-=65536,de+=Y(ce>>>10&1023|55296),ce=56320|1023&ce),de+=Y(ce)}).join("")}function u(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 h(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,Pe,ye,Ee,Ge,Ue,Fe,He=[],be=ee.length,me=0,We=I,ze=D;for(de=ee.lastIndexOf(B),de<0&&(de=0),Ce=0;Ce=128&&c("not-basic"),He.push(ee.charCodeAt(Ce));for(Se=de>0?de+1:0;Se=be&&c("invalid-input"),Ge=u(ee.charCodeAt(Se++)),(Ge>=x||Ge>ne((y-me)/ye))&&c("overflow"),me+=Ge*ye,Ue=Ee<=ze?l:Ee>=ze+S?S:Ee-ze,!(Gene(y/Fe)&&c("overflow"),ye*=Fe;ce=He.length+1,ze=h(me-Pe,ce,Pe==0),ne(me/ce)>y-We&&c("overflow"),We+=ne(me/ce),me%=ce,He.splice(me++,0,We)}return a(He)}function n(ee){var ce,de,Ce,Se,Pe,ye,Ee,Ge,Ue,Fe,He,be,me,We,ze,nt=[];for(ee=o(ee),be=ee.length,ce=I,de=0,Pe=D,ye=0;ye=ce&&Hene((y-de)/me)&&c("overflow"),de+=(Ee-ce)*me,ce=Ee,ye=0;yey&&c("overflow"),He==ce){for(Ge=de,Ue=x;Fe=Ue<=Pe?l:Ue>=Pe+S?S:Ue-Pe,!(Ge= 0x80 (not a basic code point)","invalid-input":"Invalid input"},X=x-l,ne=Math.floor,Y=String.fromCharCode;if(E={version:"1.4.1",ucs2:{decode:o,encode:a},decode:i,encode:n,toASCII:f,toUnicode:t},typeof j=="function"&&typeof j.amd=="object"&&j.amd)j("punycode",function(){return E});else if(v&&m)if(P.exports==v)m.exports=E;else for(g in E)E.hasOwnProperty(g)&&(v[g]=E[g]);else C.punycode=E}(this)}).call(this,typeof le!="undefined"?le:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],175:[function(w,P,b){"use strict";function T(c,p){return Object.prototype.hasOwnProperty.call(c,p)}P.exports=function(c,p,d,o){p=p||"&",d=d||"=";var a={};if(typeof c!="string"||c.length===0)return a;var u=/\+/g;c=c.split(p);var s=1e3;o&&typeof o.maxKeys=="number"&&(s=o.maxKeys);var h=c.length;s>0&&h>s&&(h=s);for(var i=0;i=0?(n=m.substr(0,_),t=m.substr(_+1)):(n=m,t=""),f=decodeURIComponent(n),v=decodeURIComponent(t),T(a,f)?C(a[f])?a[f].push(v):a[f]=[a[f],v]:a[f]=v}return a};var C=Array.isArray||function(c){return Object.prototype.toString.call(c)==="[object Array]"}},{}],176:[function(w,P,b){"use strict";function T(d,o){if(d.map)return d.map(o);for(var a=[],u=0;u0?(typeof me=="string"||re.objectMode||(0,V.default)(me)===de.prototype||(me=c(me)),ze?re.endEmitted?be.emit("error",new Error("stream.unshift() after end event")):s(be,re,me,!0):re.ended?be.emit("error",new Error("stream.push() after EOF")):(re.reading=!1,re.decoder&&!We?(me=re.decoder.write(me),re.objectMode||me.length!==0?s(be,re,me,!1):_(be,re)):s(be,re,me,!1))):ze||(re.reading=!1)}return i(re)}function s(be,me,We,ze){me.flowing&&me.length===0&&!me.sync?(be.emit("data",We),be.read(0)):(me.length+=me.objectMode?1:We.length,ze?me.buffer.unshift(We):me.buffer.push(We),me.needReadable&&v(be)),_(be,me)}function h(be,me){var We;return p(me)||typeof me=="string"||me===void 0||be.objectMode||(We=new TypeError("Invalid non-string/buffer chunk")),We}function i(be){return!be.ended&&(be.needReadable||be.length=He?be=He:(be--,be|=be>>>1,be|=be>>>2,be|=be>>>4,be|=be>>>8,be|=be>>>16,be++),be}function t(be,me){return be<=0||me.length===0&&me.ended?0:me.objectMode?1:be!==be?me.flowing&&me.length?me.buffer.head.data.length:me.length:(be>me.highWaterMark&&(me.highWaterMark=n(be)),be<=me.length?be:me.ended?me.length:(me.needReadable=!0,0))}function f(be,me){if(!me.ended){if(me.decoder){var We=me.decoder.end();We&&We.length&&(me.buffer.push(We),me.length+=me.objectMode?1:We.length)}me.ended=!0,v(be)}}function v(be){var me=be._readableState;me.needReadable=!1,me.emittedReadable||(ye("emitReadable",me.flowing),me.emittedReadable=!0,me.sync?X.nextTick(m,be):m(be))}function m(be){ye("emit readable"),be.emit("readable"),S(be)}function _(be,me){me.readingMore||(me.readingMore=!0,X.nextTick(E,be,me))}function E(be,me){for(var We=me.length;!me.reading&&!me.flowing&&!me.ended&&me.length=me.length?(We=me.decoder?me.buffer.join(""):me.buffer.length===1?me.buffer.head.data:me.buffer.concat(me.length),me.buffer.clear()):We=A(be,me.buffer,me.decoder),We}function A(be,me,We){var ze;return bere.length?re.length:be;if(k===re.length?nt+=re:nt+=re.slice(0,be),(be-=k)===0){k===re.length?(++ze,We.next?me.head=We.next:me.head=me.tail=null):(me.head=We,We.data=re.slice(k));break}++ze}return me.length-=ze,nt}function I(be,me){var We=de.allocUnsafe(be),ze=me.head,nt=1;for(ze.data.copy(We),be-=ze.data.length;ze=ze.next;){var re=ze.data,k=be>re.length?re.length:be;if(re.copy(We,We.length-be,0,k),(be-=k)===0){k===re.length?(++nt,ze.next?me.head=ze.next:me.head=me.tail=null):(me.head=ze,ze.data=re.slice(k));break}++nt}return me.length-=nt,We}function B(be){var me=be._readableState;if(me.length>0)throw new Error('"endReadable()" called on non-empty stream');me.endEmitted||(me.ended=!0,X.nextTick(H,me,be))}function H(be,me){be.endEmitted||be.length!==0||(be.endEmitted=!0,me.readable=!1,me.emit("end"))}function te(be,me){for(var We=0,ze=be.length;We=me.highWaterMark||me.ended))return ye("read: emitReadable",me.length,me.ended),me.length===0&&me.ended?B(this):v(this),null;if((be=t(be,me))===0&&me.ended)return me.length===0&&B(this),null;var ze=me.needReadable;ye("need readable",ze),(me.length===0||me.length-be0?O(be,me):null,nt===null?(me.needReadable=!0,be=0):me.length-=be,me.length===0&&(me.ended||(me.needReadable=!0),We!==be&&me.ended&&B(this)),nt!==null&&this.emit("data",nt),nt},a.prototype._read=function(be){this.emit("error",new Error("_read() is not implemented"))},a.prototype.pipe=function(be,me){function We(mt,Qe){ye("onunpipe"),mt===J&&Qe&&Qe.hasUnpiped===!1&&(Qe.hasUnpiped=!0,nt())}function ze(){ye("onend"),be.end()}function nt(){ye("cleanup"),be.removeListener("close",U),be.removeListener("finish",q),be.removeListener("drain",Ne),be.removeListener("error",k),be.removeListener("unpipe",We),J.removeListener("end",ze),J.removeListener("end",$),J.removeListener("data",re),je=!0,!xe.awaitDrain||be._writableState&&!be._writableState.needDrain||Ne()}function re(mt){ye("ondata"),tt=!1,be.write(mt)!==!1||tt||((xe.pipesCount===1&&xe.pipes===be||xe.pipesCount>1&&te(xe.pipes,be)!==-1)&&!je&&(ye("false write response, pause",J._readableState.awaitDrain),J._readableState.awaitDrain++,tt=!0),J.pause())}function k(mt){ye("onerror",mt),$(),be.removeListener("error",k),ee(be,"error")===0&&be.emit("error",mt)}function U(){be.removeListener("finish",q),$()}function q(){ye("onfinish"),be.removeListener("close",U),$()}function $(){ye("unpipe"),J.unpipe(be)}var J=this,xe=this._readableState;switch(xe.pipesCount){case 0:xe.pipes=be;break;case 1:xe.pipes=[xe.pipes,be];break;default:xe.pipes.push(be)}xe.pipesCount+=1,ye("pipe count=%d opts=%j",xe.pipesCount,me);var ke=(!me||me.end!==!1)&&be!==T.stdout&&be!==T.stderr,dt=ke?ze:$;xe.endEmitted?X.nextTick(dt):J.once("end",dt),be.on("unpipe",We);var Ne=g(J);be.on("drain",Ne);var je=!1,tt=!1;return J.on("data",re),d(be,"error",k),be.once("close",U),be.once("finish",q),be.emit("pipe",J),xe.flowing||(ye("pipe resume"),J.resume()),be},a.prototype.unpipe=function(be){var me=this._readableState,We={hasUnpiped:!1};if(me.pipesCount===0)return this;if(me.pipesCount===1)return be&&be!==me.pipes?this:(be||(be=me.pipes),me.pipes=null,me.pipesCount=0,me.flowing=!1,be&&be.emit("unpipe",this,We),this);if(!be){var ze=me.pipes,nt=me.pipesCount;me.pipes=null,me.pipesCount=0,me.flowing=!1;for(var re=0;re-1?ne.default:Y.nextTick;s.WritableState=u;var de=w("core-util-is");de.inherits=w("inherits");var Ce={deprecate:w("util-deprecate")},Se=w("./internal/streams/stream"),Pe=w("safe-buffer").Buffer,ye=C.Uint8Array||function(){},Ee=w("./internal/streams/destroy");de.inherits(s,Se),u.prototype.getBuffer=function(){for(var Ue=this.bufferedRequest,Fe=[];Ue;)Fe.push(Ue),Ue=Ue.next;return Fe},function(){try{Object.defineProperty(u.prototype,"buffer",{get:Ce.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(Ue){}}();var Ge;typeof V.default=="function"&&te.default&&typeof Function.prototype[te.default]=="function"?(Ge=Function.prototype[te.default],(0,B.default)(s,te.default,{value:function(Ue){return!!Ge.call(this,Ue)||this===s&&Ue&&Ue._writableState instanceof u}})):Ge=function(Ue){return Ue instanceof this},s.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},s.prototype.write=function(Ue,Fe,He){var be=this._writableState,me=!1,We=!be.objectMode&&o(Ue);return We&&!Pe.isBuffer(Ue)&&(Ue=d(Ue)),typeof Fe=="function"&&(He=Fe,Fe=null),We?Fe="buffer":Fe||(Fe=be.defaultEncoding),typeof He!="function"&&(He=a),be.ended?h(this,He):(We||i(this,be,Ue,He))&&(be.pendingcb++,me=t(this,be,We,Ue,Fe,He)),me},s.prototype.cork=function(){this._writableState.corked++},s.prototype.uncork=function(){var Ue=this._writableState;Ue.corked&&(Ue.corked--,Ue.writing||Ue.corked||Ue.finished||Ue.bufferProcessing||!Ue.bufferedRequest||y(this,Ue))},s.prototype.setDefaultEncoding=function(Ue){if(typeof Ue=="string"&&(Ue=Ue.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((Ue+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+Ue);return this._writableState.defaultEncoding=Ue,this},Object.defineProperty(s.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),s.prototype._write=function(Ue,Fe,He){He(new Error("_write() is not implemented"))},s.prototype._writev=null,s.prototype.end=function(Ue,Fe,He){var be=this._writableState;typeof Ue=="function"?(He=Ue,Ue=null,Fe=null):typeof Fe=="function"&&(He=Fe,Fe=null),Ue!=null&&this.write(Ue,Fe),be.corked&&(be.corked=1,this.uncork()),be.ending||be.finished||A(this,be,He)},Object.defineProperty(s.prototype,"destroyed",{get:function(){return this._writableState!==void 0&&this._writableState.destroyed},set:function(Ue){this._writableState&&(this._writableState.destroyed=Ue)}}),s.prototype.destroy=Ee.destroy,s.prototype._undestroy=Ee.undestroy,s.prototype._destroy=function(Ue,Fe){this.end(),Fe(Ue)}}).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,b){"use strict";function T(d,o){if(!(d instanceof o))throw new TypeError("Cannot call a class as a function")}function C(d,o,a){d.copy(o,a)}var c=w("safe-buffer").Buffer,p=w("util");P.exports=function(){function d(){T(this,d),this.head=null,this.tail=null,this.length=0}return d.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},d.prototype.unshift=function(o){var a={data:o,next:this.head};this.length===0&&(this.tail=a),this.head=a,++this.length},d.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}},d.prototype.clear=function(){this.head=this.tail=null,this.length=0},d.prototype.join=function(o){if(this.length===0)return"";for(var a=this.head,u=""+a.data;a=a.next;)u+=o+a.data;return u},d.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),u=this.head,s=0;u;)C(u.data,a,s),s+=u.data.length,u=u.next;return a},d}(),p&&p.inspect&&p.inspect.custom&&(P.exports.prototype[p.inspect.custom]=function(){var d=p.inspect({length:this.length});return this.constructor.name+" "+d})},{"safe-buffer":193,util:36}],185:[function(w,P,b){"use strict";function T(d,o){var a=this,u=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return u||s?(o?o(d):!d||this._writableState&&this._writableState.errorEmitted||p.nextTick(c,this,d),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(d||null,function(h){!o&&h?(p.nextTick(c,a,h),a._writableState&&(a._writableState.errorEmitted=!0)):o&&o(h)}),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(d,o){d.emit("error",o)}var p=w("process-nextick-args");P.exports={destroy:T,undestroy:C}},{"process-nextick-args":172}],186:[function(w,P,b){"use strict";P.exports=w("events").EventEmitter},{events:158}],187:[function(w,P,b){P.exports=w("./readable").PassThrough},{"./readable":188}],188:[function(w,P,b){b=P.exports=w("./lib/_stream_readable.js"),b.Stream=b,b.Readable=b,b.Writable=w("./lib/_stream_writable.js"),b.Duplex=w("./lib/_stream_duplex.js"),b.Transform=w("./lib/_stream_transform.js"),b.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,b){P.exports=w("./readable").Transform},{"./readable":188}],190:[function(w,P,b){P.exports=w("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":183}],191:[function(w,P,b){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,b){!function(T){"use strict";function C(ne,Y,ee,ce){var de=Y&&Y.prototype instanceof p?Y:p,Ce=Object.create(de.prototype),Se=new t(ce||[]);return Ce._invoke=s(ne,ee,Se),Ce}function c(ne,Y,ee){try{return{type:"normal",arg:ne.call(Y,ee)}}catch(ce){return{type:"throw",arg:ce}}}function p(){}function d(){}function o(){}function a(ne){["next","throw","return"].forEach(function(Y){ne[Y]=function(ee){return this._invoke(Y,ee)}})}function u(ne){function Y(de,Ce,Se,Pe){var ye=c(ne[de],ne,Ce);if(ye.type!=="throw"){var Ee=ye.arg,Ge=Ee.value;return Ge&&typeof Ge=="object"&&E.call(Ge,"__await")?Promise.resolve(Ge.__await).then(function(Ue){Y("next",Ue,Se,Pe)},function(Ue){Y("throw",Ue,Se,Pe)}):Promise.resolve(Ge).then(function(Ue){Ee.value=Ue,Se(Ee)},Pe)}Pe(ye.arg)}function ee(de,Ce){function Se(){return new Promise(function(Pe,ye){Y(de,Ce,Pe,ye)})}return ce=ce?ce.then(Se,Se):Se()}var ce;this._invoke=ee}function s(ne,Y,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 Pe=h(Se,ee);if(Pe){if(Pe===H)continue;return Pe}}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 ye=c(ne,Y,ee);if(ye.type==="normal"){if(ce=ee.done?B:D,ye.arg===H)continue;return{value:ye.arg,done:ee.done}}ye.type==="throw"&&(ce=B,ee.method="throw",ee.arg=ye.arg)}}}function h(ne,Y){var ee=ne.iterator[Y.method];if(ee===m){if(Y.delegate=null,Y.method==="throw"){if(ne.iterator.return&&(Y.method="return",Y.arg=m,h(ne,Y),Y.method==="throw"))return H;Y.method="throw",Y.arg=new TypeError("The iterator does not provide a 'throw' method")}return H}var ce=c(ee,ne.iterator,Y.arg);if(ce.type==="throw")return Y.method="throw",Y.arg=ce.arg,Y.delegate=null,H;var de=ce.arg;return de?de.done?(Y[ne.resultName]=de.value,Y.next=ne.nextLoc,Y.method!=="return"&&(Y.method="next",Y.arg=m),Y.delegate=null,H):de:(Y.method="throw",Y.arg=new TypeError("iterator result is not an object"),Y.delegate=null,H)}function i(ne){var Y={tryLoc:ne[0]};1 in ne&&(Y.catchLoc=ne[1]),2 in ne&&(Y.finallyLoc=ne[2],Y.afterLoc=ne[3]),this.tryEntries.push(Y)}function n(ne){var Y=ne.completion||{};Y.type="normal",delete Y.arg,ne.completion=Y}function t(ne){this.tryEntries=[{tryLoc:"root"}],ne.forEach(i,this),this.reset(!0)}function f(ne){if(ne){var Y=ne[y];if(Y)return Y.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 Y("end");if(de.tryLoc<=this.prev){var Se=E.call(de,"catchLoc"),Pe=E.call(de,"finallyLoc");if(Se&&Pe){if(this.prev=0;--ee){var ce=this.tryEntries[ee];if(ce.tryLoc<=this.prev&&E.call(ce,"finallyLoc")&&this.prev=0;--Y){var ee=this.tryEntries[Y];if(ee.finallyLoc===ne)return this.complete(ee.completion,ee.afterLoc),n(ee),H}},catch:function(ne){for(var Y=this.tryEntries.length-1;Y>=0;--Y){var ee=this.tryEntries[Y];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,Y,ee){return this.delegate={iterator:f(ne),resultName:Y,nextLoc:ee},this.method==="next"&&(this.arg=m),H}}}(function(){return this}()||Function("return this")())},{}],193:[function(w,P,b){function T(d,o){for(var a in d)o[a]=d[a]}function C(d,o,a){return p(d,o,a)}var c=w("buffer"),p=c.Buffer;p.from&&p.alloc&&p.allocUnsafe&&p.allocUnsafeSlow?P.exports=c:(T(c,b),b.Buffer=C),T(p,C),C.from=function(d,o,a){if(typeof d=="number")throw new TypeError("Argument must not be a number");return p(d,o,a)},C.alloc=function(d,o,a){if(typeof d!="number")throw new TypeError("Argument must be a number");var u=p(d);return o!==void 0?typeof a=="string"?u.fill(o,a):u.fill(o):u.fill(0),u},C.allocUnsafe=function(d){if(typeof d!="number")throw new TypeError("Argument must be a number");return p(d)},C.allocUnsafeSlow=function(d){if(typeof d!="number")throw new TypeError("Argument must be a number");return c.SlowBuffer(d)}},{buffer:38}],194:[function(w,P,b){(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),d=w("babel-runtime/core-js/json/stringify"),o=C(d),a=w("babel-runtime/helpers/typeof"),u=C(a),s=w("babel-runtime/core-js/object/define-property"),h=C(s),i=w("babel-runtime/core-js/object/keys"),n=C(i),t=w("babel-runtime/core-js/object/create"),f=C(t);!function(v){function m($,J){if(!(this instanceof m))return new m($,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=!!$,xe.noscript=!(!$&&!xe.opt.noscript),xe.state=U.BEGIN,xe.strictEntities=xe.opt.strictEntities,xe.ENTITIES=xe.strictEntities?(0,f.default)(v.XML_ENTITIES):(0,f.default)(v.ENTITIES),xe.attribList=[],xe.opt.xmlns&&(xe.ns=(0,f.default)(We)),xe.trackPosition=xe.opt.position!==!1,xe.trackPosition&&(xe.position=xe.line=xe.column=0),I(xe,"onready")}function _($){for(var J=Math.max(v.MAX_BUFFER_LENGTH,10),xe=0,ke=0,dt=Ee.length;keJ)switch(Ee[ke]){case"textNode":H($);break;case"cdata":B($,"oncdata",$.cdata),$.cdata="";break;case"script":B($,"onscript",$.script),$.script="";break;default:W($,"Max buffer length exceeded: "+Ee[ke])}xe=Math.max(xe,Ne)}var je=v.MAX_BUFFER_LENGTH-xe;$.bufferCheckPosition=je+$.position}function E($){for(var J=0,xe=Ee.length;J"||l($)}function A($,J){return $.test(J)}function D($,J){return!A($,J)}function I($,J,xe){$[J]&&$[J](xe)}function B($,J,xe){$.textNode&&H($),I($,J,xe)}function H($){$.textNode=te($.opt,$.textNode),$.textNode&&I($,"ontext",$.textNode),$.textNode=""}function te($,J){return $.trim&&(J=J.trim()),$.normalize&&(J=J.replace(/\s+/g," ")),J}function W($,J){return H($),$.trackPosition&&(J+=` Line: `+$.line+` Column: `+$.column+` Char: `+$.c),J=new Error(J),$.error=J,I($,"onerror",J),$}function V($){return $.sawRoot&&!$.closedRoot&&X($,"Unclosed root tag"),$.state!==U.BEGIN&&$.state!==U.BEGIN_WHITESPACE&&$.state!==U.TEXT&&W($,"Unexpected end"),H($),$.c="",$.closed=!0,I($,"onend"),m.call($,$.strict,$.opt),$}function X($,J){if(($===void 0?"undefined":(0,u.default)($))!=="object"||!($ instanceof m))throw new Error("bad call to strictFail");$.strict&&W($,J)}function ne($){$.strict||($.tagName=$.tagName[$.looseCase]());var J=$.tags[$.tags.length-1]||$,xe=$.tag={name:$.tagName,attributes:{}};$.opt.xmlns&&(xe.ns=J.ns),$.attribList.length=0,B($,"onopentagstart",xe)}function Y($,J){var xe=$.indexOf(":"),ke=xe<0?["",$]:$.split(":"),dt=ke[0],Ne=ke[1];return J&&$==="xmlns"&&(dt="xmlns",Ne=""),{prefix:dt,local:Ne}}function ee($){if($.strict||($.attribName=$.attribName[$.looseCase]()),$.attribList.indexOf($.attribName)!==-1||$.tag.attributes.hasOwnProperty($.attribName))return void($.attribName=$.attribValue="");if($.opt.xmlns){var J=Y($.attribName,!0),xe=J.prefix,ke=J.local;if(xe==="xmlns")if(ke==="xml"&&$.attribValue!==be)X($,"xml: prefix must be bound to "+be+` Actual: `+$.attribValue);else if(ke==="xmlns"&&$.attribValue!==me)X($,"xmlns: prefix must be bound to "+me+` Actual: `+$.attribValue);else{var dt=$.tag,Ne=$.tags[$.tags.length-1]||$;dt.ns===Ne.ns&&(dt.ns=(0,f.default)(Ne.ns)),dt.ns[ke]=$.attribValue}$.attribList.push([$.attribName,$.attribValue])}else $.tag.attributes[$.attribName]=$.attribValue,B($,"onattribute",{name:$.attribName,value:$.attribValue});$.attribName=$.attribValue=""}function ce($,J){if($.opt.xmlns){var xe=$.tag,ke=Y($.tagName);xe.prefix=ke.prefix,xe.local=ke.local,xe.uri=xe.ns[ke.prefix]||"",xe.prefix&&!xe.uri&&(X($,"Unbound namespace prefix: "+(0,o.default)($.tagName)),xe.uri=ke.prefix);var dt=$.tags[$.tags.length-1]||$;xe.ns&&dt.ns!==xe.ns&&(0,n.default)(xe.ns).forEach(function(Ae){B($,"onopennamespace",{prefix:Ae,uri:xe.ns[Ae]})});for(var Ne=0,je=$.attribList.length;Ne",$.tagName="",void($.state=U.SCRIPT);B($,"onscript",$.script),$.script=""}var J=$.tags.length,xe=$.tagName;$.strict||(xe=xe[$.looseCase]());for(var ke=xe;J--&&!($.tags[J].name===ke);)X($,"Unexpected close tag");if(J<0)return X($,"Unmatched closing tag: "+$.tagName),$.textNode+="",void($.state=U.TEXT);$.tagName=xe;for(var dt=$.tags.length;dt-- >J;){var Ne=$.tag=$.tags.pop();$.tagName=$.tag.name,B($,"onclosetag",$.tagName);var je={};for(var tt in Ne.ns)je[tt]=Ne.ns[tt];var mt=$.tags[$.tags.length-1]||$;$.opt.xmlns&&Ne.ns!==mt.ns&&(0,n.default)(Ne.ns).forEach(function(Qe){var Xe=Ne.ns[Qe];B($,"onclosenamespace",{prefix:Qe,uri:Xe})})}J===0&&($.closedRoot=!0),$.tagName=$.attribValue=$.attribName="",$.attribList.length=0,$.state=U.TEXT}function Ce($){var J,xe=$.entity,ke=xe.toLowerCase(),dt="";return $.ENTITIES[xe]?$.ENTITIES[xe]:$.ENTITIES[ke]?$.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($,"Invalid character entity"),"&"+$.entity+";"):(0,p.default)(J))}function Se($,J){J==="<"?($.state=U.OPEN_WAKA,$.startTagPosition=$.position):l(J)||(X($,"Non-whitespace before first tag."),$.textNode=J,$.state=U.TEXT)}function Pe($,J){var xe="";return J<$.length&&(xe=$.charAt(J)),xe}function ye($){var J=this;if(this.error)throw this.error;if(J.closed)return W(J,"Cannot write after close. Assign an onready handler.");if($===null)return V(J);($===void 0?"undefined":(0,u.default)($))==="object"&&($=$.toString());for(var xe=0,ke="";!(ke=Pe($,xe++),J.c=ke,!ke);)switch(J.trackPosition&&(J.position++,ke===` `?(J.line++,J.column=0):J.column++),J.state){case U.BEGIN:if(J.state=U.BEGIN_WHITESPACE,ke==="\uFEFF")continue;Se(J,ke);continue;case U.BEGIN_WHITESPACE:Se(J,ke);continue;case U.TEXT:if(J.sawRoot&&!J.closedRoot){for(var dt=xe-1;ke&&ke!=="<"&&ke!=="&";)(ke=Pe($,xe++))&&J.trackPosition&&(J.position++,ke===` `?(J.line++,J.column=0):J.column++);J.textNode+=$.substring(dt,xe-1)}ke!=="<"||J.sawRoot&&J.closedRoot&&!J.strict?(l(ke)||J.sawRoot&&!J.closedRoot||X(J,"Text data outside of root node."),ke==="&"?J.state=U.TEXT_ENTITY:J.textNode+=ke):(J.state=U.OPEN_WAKA,J.startTagPosition=J.position);continue;case U.SCRIPT:ke==="<"?J.state=U.SCRIPT_ENDING:J.script+=ke;continue;case U.SCRIPT_ENDING:ke==="/"?J.state=U.CLOSE_TAG:(J.script+="<"+ke,J.state=U.SCRIPT);continue;case U.OPEN_WAKA:if(ke==="!")J.state=U.SGML_DECL,J.sgmlDecl="";else if(!l(ke))if(A(ze,ke))J.state=U.OPEN_TAG,J.tagName=ke;else if(ke==="/")J.state=U.CLOSE_TAG,J.tagName="";else if(ke==="?")J.state=U.PROC_INST,J.procInstName=J.procInstBody="";else{if(X(J,"Unencoded <"),J.startTagPosition+1"?(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(ze,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(ze,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(ze,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&&_(J),J}v.parser=function($,J){return new m($,J)},v.SAXParser=m,v.SAXStream=x,v.createStream=y,v.MAX_BUFFER_LENGTH=65536;var Ee=["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"],f.default||(Object.create=function($){function J(){}return J.prototype=$,new J}),n.default||(Object.keys=function($){var J=[];for(var xe in $)$.hasOwnProperty(xe)&&J.push(xe);return J}),m.prototype={end:function(){V(this)},write:ye,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){g(this)}};var Ge;try{Ge=w("stream").Stream}catch($){Ge=function(){}}var Ue=v.EVENTS.filter(function($){return $!=="error"&&$!=="end"});x.prototype=(0,f.default)(Ge.prototype,{constructor:{value:x}}),x.prototype.write=function($){if(typeof T=="function"&&typeof T.isBuffer=="function"&&T.isBuffer($)){if(!this._decoder){var J=w("string_decoder").StringDecoder;this._decoder=new J("utf8")}$=this._decoder.write($)}return this._parser.write($.toString()),this.emit("data",$),!0},x.prototype.end=function($){return $&&$.length&&this.write($),this._parser.end(),!0},x.prototype.on=function($,J){var xe=this;return xe._parser["on"+$]||Ue.indexOf($)===-1||(xe._parser["on"+$]=function(){var ke=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);ke.splice(0,0,$),xe.emit.apply(xe,ke)}),Ge.prototype.on.call(xe,$,J)};var Fe="[CDATA[",He="DOCTYPE",be="http://www.w3.org/XML/1998/namespace",me="http://www.w3.org/2000/xmlns/",We={xml:be,xmlns:me},ze=/[:_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($){var J=v.ENTITIES[$],xe=typeof J=="number"?String.fromCharCode(J):J;v.ENTITIES[$]=xe});for(var q in v.STATE)v.STATE[v.STATE[q]]=q;U=v.STATE,p.default||function(){var $=String.fromCharCode,J=Math.floor,xe=function(){var ke,dt,Ne=[],je=-1,tt=arguments.length;if(!tt)return"";for(var mt="";++je1114111||J(Qe)!==Qe)throw RangeError("Invalid code point: "+Qe);Qe<=65535?Ne.push(Qe):(Qe-=65536,ke=55296+(Qe>>10),dt=Qe%1024+56320,Ne.push(ke,dt)),(je+1===tt||Ne.length>16384)&&(mt+=$.apply(null,Ne),Ne.length=0)}return mt};h.default?Object.defineProperty(String,"fromCodePoint",{value:xe,configurable:!0,writable:!0}):String.fromCodePoint=xe}()}(b===void 0?(void 0).sax={}:b)}).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,b){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 d(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 u(){n||(n=!0,typeof c.destroy=="function"&&c.destroy())}function s(t){if(h(),C.listenerCount(this,"error")===0)throw t}function h(){i.removeListener("data",d),c.removeListener("drain",o),i.removeListener("end",a),i.removeListener("close",u),i.removeListener("error",s),c.removeListener("error",s),i.removeListener("end",h),i.removeListener("close",h),c.removeListener("close",h)}var i=this;i.on("data",d),c.on("drain",o),c._isStdio||p&&p.end===!1||(i.on("end",a),i.on("close",u));var n=!1;return i.on("error",s),c.on("error",s),i.on("end",h),i.on("close",h),c.on("close",h),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,b){(function(T){var C=w("./lib/request"),c=w("./lib/response"),p=w("xtend"),d=w("builtin-status-codes"),o=w("url"),a=b;a.request=function(u,s){u=typeof u=="string"?o.parse(u):p(u);var h=T.location.protocol.search(/^https?:$/)===-1?"http:":"",i=u.protocol||h,n=u.hostname||u.host,t=u.port,f=u.path||"/";n&&n.indexOf(":")!==-1&&(n="["+n+"]"),u.url=(n?i+"//"+n:"")+(t?":"+t:"")+f,u.method=(u.method||"GET").toUpperCase(),u.headers=u.headers||{};var v=new C(u);return s&&v.on("response",s),v},a.get=function(u,s){var h=a.request(u,s);return h.end(),h},a.ClientRequest=C,a.IncomingMessage=c.IncomingMessage,a.Agent=function(){},a.Agent.defaultMaxSockets=4,a.globalAgent=new a.Agent,a.STATUS_CODES=d,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,b){(function(T){"use strict";function C(){if(d!==void 0)return d;if(T.XMLHttpRequest){d=new T.XMLHttpRequest;try{d.open("GET",T.XDomainRequest?"/":"https://example.com")}catch(u){d=null}}else d=null;return d}function c(u){var s=C();if(!s)return!1;try{return s.responseType=u,s.responseType===u}catch(h){}return!1}function p(u){return typeof u=="function"}b.fetch=p(T.fetch)&&p(T.ReadableStream),b.writableStream=p(T.WritableStream),b.abortController=p(T.AbortController),b.blobConstructor=!1;try{new Blob([new ArrayBuffer(1)]),b.blobConstructor=!0}catch(u){}var d,o=T.ArrayBuffer!==void 0,a=o&&p(T.ArrayBuffer.prototype.slice);b.arraybuffer=b.fetch||o&&c("arraybuffer"),b.msstream=!b.fetch&&a&&c("ms-stream"),b.mozchunkedarraybuffer=!b.fetch&&o&&c("moz-chunked-arraybuffer"),b.overrideMimeType=b.fetch||!!C()&&p(C().overrideMimeType),b.vbArray=p(T.VBArray),d=null}).call(this,typeof le!="undefined"?le:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],198:[function(w,P,b){(function(T,C,c){"use strict";function p(_,E){return u.fetch&&E?"fetch":u.mozchunkedarraybuffer?"moz-chunked-arraybuffer":u.msstream?"ms-stream":u.arraybuffer&&_?"arraybuffer":u.vbArray&&_?"text:vbarray":"text"}function d(_){try{var E=_.status;return E!==null&&E!==0}catch(g){return!1}}var o=w("babel-runtime/core-js/object/keys"),a=function(_){return _&&_.__esModule?_:{default:_}}(o),u=w("./capability"),s=w("inherits"),h=w("./response"),i=w("readable-stream"),n=w("to-arraybuffer"),t=h.IncomingMessage,f=h.readyStates,v=P.exports=function(_){var E=this;i.Writable.call(E),E._opts=_,E._body=[],E._headers={},_.auth&&E.setHeader("Authorization","Basic "+new c(_.auth).toString("base64")),(0,a.default)(_.headers).forEach(function(x){E.setHeader(x,_.headers[x])});var g,y=!0;if(_.mode==="disable-fetch"||"requestTimeout"in _&&!u.abortController)y=!1,g=!0;else if(_.mode==="prefer-streaming")g=!1;else if(_.mode==="allow-wrong-content-type")g=!u.overrideMimeType;else{if(_.mode&&_.mode!=="default"&&_.mode!=="prefer-fast")throw new Error("Invalid value for opts.mode");g=!0}E._mode=p(g,y),E._fetchTimer=null,E.on("finish",function(){E._onFinish()})};s(v,i.Writable),v.prototype.setHeader=function(_,E){var g=this,y=_.toLowerCase();m.indexOf(y)===-1&&(g._headers[y]={name:_,value:E})},v.prototype.getHeader=function(_){var E=this._headers[_.toLowerCase()];return E?E.value:null},v.prototype.removeHeader=function(_){delete this._headers[_.toLowerCase()]},v.prototype._onFinish=function(){var _=this;if(!_._destroyed){var E=_._opts,g=_._headers,y=null;E.method!=="GET"&&E.method!=="HEAD"&&(y=u.arraybuffer?n(c.concat(_._body)):u.blobConstructor?new C.Blob(_._body.map(function(A){return n(A)}),{type:(g["content-type"]||{}).value||""}):c.concat(_._body).toString());var x=[];if((0,a.default)(g).forEach(function(A){var D=g[A].name,I=g[A].value;Array.isArray(I)?I.forEach(function(B){x.push([D,B])}):x.push([D,I])}),_._mode==="fetch"){var l=null;if(u.abortController){var S=new AbortController;l=S.signal,_._fetchAbortController=S,"requestTimeout"in E&&E.requestTimeout!==0&&(_._fetchTimer=C.setTimeout(function(){_.emit("requestTimeout"),_._fetchAbortController&&_._fetchAbortController.abort()},E.requestTimeout))}C.fetch(_._opts.url,{method:_._opts.method,headers:x,body:y||void 0,mode:"cors",credentials:E.withCredentials?"include":"same-origin",signal:l}).then(function(A){_._fetchResponse=A,_._connect()},function(A){C.clearTimeout(_._fetchTimer),_._destroyed||_.emit("error",A)})}else{var O=_._xhr=new C.XMLHttpRequest;try{O.open(_._opts.method,_._opts.url,!0)}catch(A){return void T.nextTick(function(){_.emit("error",A)})}"responseType"in O&&(O.responseType=_._mode.split(":")[0]),"withCredentials"in O&&(O.withCredentials=!!E.withCredentials),_._mode==="text"&&"overrideMimeType"in O&&O.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in E&&(O.timeout=E.requestTimeout,O.ontimeout=function(){_.emit("requestTimeout")}),x.forEach(function(A){O.setRequestHeader(A[0],A[1])}),_._response=null,O.onreadystatechange=function(){switch(O.readyState){case f.LOADING:case f.DONE:_._onXHRProgress()}},_._mode==="moz-chunked-arraybuffer"&&(O.onprogress=function(){_._onXHRProgress()}),O.onerror=function(){_._destroyed||_.emit("error",new Error("XHR error"))};try{O.send(y)}catch(A){return void T.nextTick(function(){_.emit("error",A)})}}}},v.prototype._onXHRProgress=function(){var _=this;d(_._xhr)&&!_._destroyed&&(_._response||_._connect(),_._response._onXHRProgress())},v.prototype._connect=function(){var _=this;_._destroyed||(_._response=new t(_._xhr,_._fetchResponse,_._mode,_._fetchTimer),_._response.on("error",function(E){_.emit("error",E)}),_.emit("response",_._response))},v.prototype._write=function(_,E,g){this._body.push(_),g()},v.prototype.abort=v.prototype.destroy=function(){var _=this;_._destroyed=!0,C.clearTimeout(_._fetchTimer),_._response&&(_._response._destroyed=!0),_._xhr?_._xhr.abort():_._fetchAbortController&&_._fetchAbortController.abort()},v.prototype.end=function(_,E,g){var y=this;typeof _=="function"&&(g=_,_=void 0),i.Writable.prototype.end.call(y,_,E,g)},v.prototype.flushHeaders=function(){},v.prototype.setTimeout=function(){},v.prototype.setNoDelay=function(){},v.prototype.setSocketKeepAlive=function(){};var m=["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,b){(function(T,C,c){"use strict";var p=w("babel-runtime/core-js/promise"),d=function(i){return i&&i.__esModule?i:{default:i}}(p),o=w("./capability"),a=w("inherits"),u=w("readable-stream"),s=b.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},h=b.IncomingMessage=function(i,n,t,f){var v=this;if(u.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 m=new WritableStream({write:function(y){return new d.default(function(x,l){v._destroyed?l():v.push(new c(y))?x():v._resumeFetch=x})},close:function(){C.clearTimeout(f),v._destroyed||v.push(null)},abort:function(y){v._destroyed||v.emit("error",y)}});try{return void n.body.pipeTo(m).catch(function(y){C.clearTimeout(f),v._destroyed||v.emit("error",y)})}catch(y){}}var _=n.body.getReader();!function y(){_.read().then(function(x){if(!v._destroyed){if(x.done)return C.clearTimeout(f),void v.push(null);v.push(new c(x.value)),y()}}).catch(function(x){C.clearTimeout(f),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 g=E.match(/;\s*charset=([^;])(;|$)/);g&&(v._charset=g[1].toLowerCase())}v._charset||(v._charset="utf-8")}};a(h,u.Readable),h.prototype._read=function(){var i=this,n=i._resumeFetch;n&&(i._resumeFetch=null,n())},h.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 f=t.substr(i._pos);if(i._charset==="x-user-defined"){for(var v=new c(f.length),m=0;mi._pos&&(i.push(new c(new Uint8Array(_.result.slice(i._pos)))),i._pos=_.result.byteLength)},_.onload=function(){i.push(null)},_.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,b){"use strict";function T(E){if(!E)return"utf8";for(var g;;)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(g)return;E=(""+E).toLowerCase(),g=!0}}function C(E){var g=T(E);if(typeof g!="string"&&(m.isEncoding===_||!_(E)))throw new Error("Unknown encoding: "+E);return g||E}function c(E){this.encoding=C(E);var g;switch(this.encoding){case"utf16le":this.text=h,this.end=i,g=4;break;case"utf8":this.fillLast=a,g=4;break;case"base64":this.text=n,this.end=t,g=3;break;default:return this.write=f,void(this.end=v)}this.lastNeed=0,this.lastTotal=0,this.lastChar=m.allocUnsafe(g)}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 d(E,g,y){var x=g.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,g,y){if((192&g[0])!=128)return E.lastNeed=0,"\u951F\uFFFD";if(E.lastNeed>1&&g.length>1){if((192&g[1])!=128)return E.lastNeed=1,"\u951F\uFFFD";if(E.lastNeed>2&&g.length>2&&(192&g[2])!=128)return E.lastNeed=2,"\u951F\uFFFD"}}function a(E){var g=this.lastTotal-this.lastNeed,y=o(this,E,g);return y!==void 0?y:this.lastNeed<=E.length?(E.copy(this.lastChar,g,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(E.copy(this.lastChar,g,0,E.length),void(this.lastNeed-=E.length))}function u(E,g){var y=d(this,E,g);if(!this.lastNeed)return E.toString("utf8",g);this.lastTotal=y;var x=E.length-(y-this.lastNeed);return E.copy(this.lastChar,0,x),E.toString("utf8",g,x)}function s(E){var g=E&&E.length?this.write(E):"";return this.lastNeed?g+"\u951F\uFFFD":g}function h(E,g){if((E.length-g)%2==0){var y=E.toString("utf16le",g);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",g,E.length-1)}function i(E){var g=E&&E.length?this.write(E):"";if(this.lastNeed){var y=this.lastTotal-this.lastNeed;return g+this.lastChar.toString("utf16le",0,y)}return g}function n(E,g){var y=(E.length-g)%3;return y===0?E.toString("base64",g):(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",g,E.length-y))}function t(E){var g=E&&E.length?this.write(E):"";return this.lastNeed?g+this.lastChar.toString("base64",0,3-this.lastNeed):g}function f(E){return E.toString(this.encoding)}function v(E){return E&&E.length?this.write(E):""}var m=w("safe-buffer").Buffer,_=m.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}};b.StringDecoder=c,c.prototype.write=function(E){if(E.length===0)return"";var g,y;if(this.lastNeed){if((g=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()},h))},b.setImmediate=typeof T=="function"?T:function(s){var h=u++,i=!(arguments.length<2)&&o.call(arguments,1);return a[h]=!0,p(function(){a[h]&&(i?s.apply(null,i):s.call(null),b.clearImmediate(h))}),h},b.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,b){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,d=0;d",'"',"`"," ","\r",` `," "],n=["{","}","|","\\","^","`"].concat(i),t=["'"].concat(n),f=["%","/","?",";","#"].concat(t),v=["/","?","#"],m=/^[+a-z0-9A-Z_-]{0,63}$/,_=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,E={javascript:!0,"javascript:":!0},g={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?Ee+="x":Ee+=ye[Ge];if(!Ee.match(m)){var Fe=Se.slice(0,Y),He=Se.slice(Y+1),be=ye.match(_);be&&(Fe.push(be[1]),He.unshift(be[2])),He.length&&(H="/"+He.join(".")+H),this.hostname=Fe.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),Ce||(this.hostname=o.toASCII(this.hostname));var me=this.port?":"+this.port:"",We=this.hostname||"";this.host=We+me,this.href+=this.host,Ce&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),H[0]!=="/"&&(H="/"+H))}if(!E[V])for(var Y=0,Pe=t.length;Y0)&&O.host.split("@");Ee&&(O.auth=Ee.shift(),O.host=O.hostname=Ee.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 Ge=Se.slice(-1)[0],Ue=(O.host||l.host||Se.length>1)&&(Ge==="."||Ge==="..")||Ge==="",Fe=0,He=Se.length;He>=0;He--)Ge=Se[He],Ge==="."?Se.splice(He,1):Ge===".."?(Se.splice(He,1),Fe++):Fe&&(Se.splice(He,1),Fe--);if(!de&&!Ce)for(;Fe--;Fe)Se.unshift("..");!de||Se[0]===""||Se[0]&&Se[0].charAt(0)==="/"||Se.unshift(""),Ue&&Se.join("/").substr(-1)!=="/"&&Se.push("");var be=Se[0]===""||Se[0]&&Se[0].charAt(0)==="/";if(ye){O.hostname=O.host=be?"":Se.length?Se.shift():"";var Ee=!!(O.host&&O.host.indexOf("@")>0)&&O.host.split("@");Ee&&(O.auth=Ee.shift(),O.host=O.hostname=Ee.shift())}return de=de||O.host&&Se.length,de&&!be&&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,b){"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,b){(function(T){function C(p,d){function o(){if(!a){if(c("throwDeprecation"))throw new Error(d);c("traceDeprecation")?console.trace(d):console.warn(d),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 d=T.localStorage[p];return d!=null&&String(d).toLowerCase()==="true"}P.exports=C}).call(this,typeof le!="undefined"?le:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],206:[function(w,P,b){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,b){(function(T,C){function c(Y,ee){var ce={seen:[],stylize:d};return arguments.length>=3&&(ce.depth=arguments[2]),arguments.length>=4&&(ce.colors=arguments[3]),f(ee)?ce.showHidden=ee:ee&&b._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,Y,ce.depth)}function p(Y,ee){var ce=c.styles[ee];return ce?"["+c.colors[ce][0]+"m"+Y+"["+c.colors[ce][1]+"m":Y}function d(Y,ee){return Y}function o(Y){var ee={};return Y.forEach(function(ce,de){ee[ce]=!0}),ee}function a(Y,ee,ce){if(Y.customInspect&&ee&&A(ee.inspect)&&ee.inspect!==b.inspect&&(!ee.constructor||ee.constructor.prototype!==ee)){var de=ee.inspect(ce,Y);return E(de)||(de=a(Y,de,ce)),de}var Ce=u(Y,ee);if(Ce)return Ce;var Se=Object.keys(ee),Pe=o(Se);if(Y.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 ye=ee.name?": "+ee.name:"";return Y.stylize("[Function"+ye+"]","special")}if(x(ee))return Y.stylize(RegExp.prototype.toString.call(ee),"regexp");if(S(ee))return Y.stylize(Date.prototype.toString.call(ee),"date");if(O(ee))return s(ee)}var Ee="",Ge=!1,Ue=["{","}"];if((t(ee)&&(Ge=!0,Ue=["[","]"]),A(ee))&&(Ee=" [Function"+(ee.name?": "+ee.name:"")+"]"),x(ee)&&(Ee=" "+RegExp.prototype.toString.call(ee)),S(ee)&&(Ee=" "+Date.prototype.toUTCString.call(ee)),O(ee)&&(Ee=" "+s(ee)),Se.length===0&&(!Ge||ee.length==0))return Ue[0]+Ee+Ue[1];if(ce<0)return x(ee)?Y.stylize(RegExp.prototype.toString.call(ee),"regexp"):Y.stylize("[Object]","special");Y.seen.push(ee);var Fe;return Fe=Ge?h(Y,ee,ce,Pe,Se):Se.map(function(He){return i(Y,ee,ce,Pe,He,Ge)}),Y.seen.pop(),n(Fe,Ee,Ue)}function u(Y,ee){if(y(ee))return Y.stylize("undefined","undefined");if(E(ee)){var ce="'"+JSON.stringify(ee).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return Y.stylize(ce,"string")}return _(ee)?Y.stylize(""+ee,"number"):f(ee)?Y.stylize(""+ee,"boolean"):v(ee)?Y.stylize("null","null"):void 0}function s(Y){return"["+Error.prototype.toString.call(Y)+"]"}function h(Y,ee,ce,de,Ce){for(var Se=[],Pe=0,ye=ee.length;Pe-1&&(ye=Se?ye.split(` `).map(function(Ge){return" "+Ge}).join(` `).substr(2):` `+ye.split(` `).map(function(Ge){return" "+Ge}).join(` `))):ye=Y.stylize("[Circular]","special")),y(Pe)){if(Se&&Ce.match(/^\d+$/))return ye;Pe=JSON.stringify(""+Ce),Pe.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(Pe=Pe.substr(1,Pe.length-2),Pe=Y.stylize(Pe,"name")):(Pe=Pe.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),Pe=Y.stylize(Pe,"string"))}return Pe+": "+ye}function n(Y,ee,ce){var de=0;return Y.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+` `)+" "+Y.join(`, `)+" "+ce[1]:ce[0]+ee+" "+Y.join(", ")+" "+ce[1]}function t(Y){return Array.isArray(Y)}function f(Y){return typeof Y=="boolean"}function v(Y){return Y===null}function m(Y){return Y==null}function _(Y){return typeof Y=="number"}function E(Y){return typeof Y=="string"}function g(Y){return typeof Y=="symbol"}function y(Y){return Y===void 0}function x(Y){return l(Y)&&I(Y)==="[object RegExp]"}function l(Y){return typeof Y=="object"&&Y!==null}function S(Y){return l(Y)&&I(Y)==="[object Date]"}function O(Y){return l(Y)&&(I(Y)==="[object Error]"||Y instanceof Error)}function A(Y){return typeof Y=="function"}function D(Y){return Y===null||typeof Y=="boolean"||typeof Y=="number"||typeof Y=="string"||typeof Y=="symbol"||Y===void 0}function I(Y){return Object.prototype.toString.call(Y)}function B(Y){return Y<10?"0"+Y.toString(10):Y.toString(10)}function H(){var Y=new Date,ee=[B(Y.getHours()),B(Y.getMinutes()),B(Y.getSeconds())].join(":");return[Y.getDate(),ne[Y.getMonth()],ee].join(" ")}function te(Y,ee){return Object.prototype.hasOwnProperty.call(Y,ee)}var W=/%[sdj%]/g;b.format=function(Y){if(!E(Y)){for(var ee=[],ce=0;ce=Ce)return Ee;switch(Ee){case"%s":return String(de[ce++]);case"%d":return Number(de[ce++]);case"%j":try{return JSON.stringify(de[ce++])}catch(Ge){return"[Circular]"}default:return Ee}}),Pe=de[ce];ce=0||n.indexOf(">")>=0||n.indexOf("<")>=0)},h=function(n){return""},u=function(n){return n.replace("]]>","]]]]>")},b.Builder=function(){function n(t){var f,v,m;this.options={},v=a[.2];for(f in v)i.call(v,f)&&(m=v[f],this.options[f]=m);for(f in t)i.call(t,f)&&(m=t[f],this.options[f]=m)}return n.prototype.buildObject=function(t){var f,v,m,_,E;return f=this.options.attrkey,v=this.options.charkey,(0,d.default)(t).length===1&&this.options.rootName===a[.2].rootName?(E=(0,d.default)(t)[0],t=t[E]):E=this.options.rootName,m=function(g){return function(y,x){var l,S,O,A,D,I;if((x===void 0?"undefined":(0,c.default)(x))!=="object")g.options.cdata&&s(x)?y.raw(h(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=m(y.ele(D),O).up()}}else for(D in x)if(i.call(x,D))if(S=x[D],D===f){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=g.options.cdata&&s(S)?y.raw(h(S)):y.txt(S);else if(Array.isArray(S))for(A in S)i.call(S,A)&&(O=S[A],y=typeof O=="string"?g.options.cdata&&s(O)?y.ele(D).raw(h(O)).up():y.ele(D,O).up():m(y.ele(D),O).up());else(S===void 0?"undefined":(0,c.default)(S))==="object"?y=m(y.ele(D),S).up():typeof S=="string"&&g.options.cdata&&s(S)?y=y.ele(D).raw(h(S)).up():(S==null&&(S=""),y=y.ele(D,S.toString()).up());return y}}(this),_=o.create(E,this.options.xmldec,this.options.doctype,{headless:this.options.headless,allowSurrogateChars:this.options.allowSurrogateChars}),m(_,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,b){"use strict";(function(){b.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,b){"use strict";function T(u){return u&&u.__esModule?u:{default:u}}var C=w("babel-runtime/core-js/object/get-own-property-names"),c=T(C),p=w("babel-runtime/core-js/object/keys"),d=T(p),o=w("babel-runtime/helpers/typeof"),a=T(o);(function(){var u,s,h,i,n,t,f,v,m=function(g,y){return function(){return g.apply(y,arguments)}},_=function(g,y){function x(){this.constructor=g}for(var l in y)E.call(y,l)&&(g[l]=y[l]);return x.prototype=y.prototype,g.prototype=new x,g.__super__=y.prototype,g},E={}.hasOwnProperty;f=w("sax"),h=w("events"),u=w("./bom"),t=w("./processors"),v=w("timers").setImmediate,s=w("./defaults").defaults,i=function(g){return(g===void 0?"undefined":(0,a.default)(g))==="object"&&g!=null&&(0,d.default)(g).length===0},n=function(g,y,x){var l,S,O;for(l=0,S=g.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=u.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}(h.EventEmitter),b.parseString=function(g,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 b.Parser(S),O.parseString(g,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,b){"use strict";(function(){var T;T=new RegExp(/(?!xmlns)^.*:/),b.normalize=function(C){return C.toLowerCase()},b.firstCharLowerCase=function(C){return C.charAt(0).toLowerCase()+C.slice(1)},b.stripPrefix=function(C){return C.replace(T,"")},b.parseNumbers=function(C){return isNaN(C)||(C=C%1==0?parseInt(C,10):parseFloat(C)),C},b.parseBooleans=function(C){return/^(?:true|false)$/i.test(C)&&(C=C.toLowerCase()==="true"),C}}).call(void 0)},{}],213:[function(w,P,b){"use strict";(function(){var T,C,c,p,d=function(a,u){function s(){this.constructor=a}for(var h in u)o.call(u,h)&&(a[h]=u[h]);return s.prototype=u.prototype,a.prototype=new s,a.__super__=u.prototype,a},o={}.hasOwnProperty;C=w("./defaults"),T=w("./builder"),c=w("./parser"),p=w("./processors"),b.defaults=C.defaults,b.processors=p,b.ValidationError=function(a){function u(s){this.message=s}return d(u,a),u}(Error),b.Builder=T.Builder,b.Parser=c.Parser,b.parseString=c.parseString}).call(void 0)},{"./builder":209,"./defaults":210,"./parser":211,"./processors":212}],214:[function(w,P,b){"use strict";function T(u){return u&&u.__esModule?u:{default:u}}var C=w("babel-runtime/core-js/object/get-prototype-of"),c=T(C),p=w("babel-runtime/helpers/typeof"),d=T(p),o=w("babel-runtime/core-js/object/assign"),a=T(o);(function(){var u,s,h,i,n,t,f=[].slice,v={}.hasOwnProperty;u=function(){var m,_,E,g,y,x;if(x=arguments[0],y=2<=arguments.length?f.call(arguments,1):[],i(a.default))a.default.apply(null,arguments);else for(m=0,E=y.length;m=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 h&&(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,b){"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,d,o,a,u=function(h,i){function n(){this.constructor=h}for(var t in i)s.call(i,t)&&(h[t]=i[t]);return n.prototype=i.prototype,h.prototype=new n,h.__super__=i.prototype,h},s={}.hasOwnProperty;a=w("./Utility"),o=a.isObject,d=a.isFunction,p=w("./XMLNode"),c=w("./XMLAttribute"),P.exports=function(h){function i(n,t,f){if(i.__super__.constructor.call(this,n),t==null)throw new Error("Missing element name");this.name=this.stringify.eleName(t),this.attributes={},f!=null&&this.attribute(f),n.isDocument&&(this.isRoot=!0,this.documentObject=n,n.rootObject=this)}return u(i,h),i.prototype.clone=function(){var n,t,f,v;f=(0,C.default)(this),f.isRoot&&(f.documentObject=null),f.attributes={},v=this.attributes;for(t in v)s.call(v,t)&&(n=v[t],f.attributes[t]=n.clone());return f.children=[],this.children.forEach(function(m){var _;return _=m.clone(),_.parent=f,f.children.push(_)}),f},i.prototype.attribute=function(n,t){var f,v;if(n!=null&&(n=n.valueOf()),o(n))for(f in n)s.call(n,f)&&(v=n[f],this.attribute(f,v));else d(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,f,v;if(n==null)throw new Error("Missing attribute name");if(n=n.valueOf(),Array.isArray(n))for(f=0,v=n.length;f"+this.endline(E))},_.prototype.comment=function(E,g){return this.stream.write(this.space(g)+""+this.endline(E))},_.prototype.declaration=function(E,g){return this.stream.write(this.space(g)),this.stream.write('"),this.stream.write(this.endline(E))},_.prototype.docType=function(E,g){var y,x,l,S;if(g||(g=0),this.stream.write(this.space(g)),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))},_.prototype.element=function(E,g){var y,x,l,S,O,A,D,I;g||(g=0),I=this.space(g),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))},_.prototype.processingInstruction=function(E,g){return this.stream.write(this.space(g)+""+this.endline(E))},_.prototype.raw=function(E,g){return this.stream.write(this.space(g)+E.value+this.endline(E))},_.prototype.text=function(E,g){return this.stream.write(this.space(g)+E.value+this.endline(E))},_.prototype.dtdAttList=function(E,g){return this.stream.write(this.space(g)+""+this.endline(E))},_.prototype.dtdElement=function(E,g){return this.stream.write(this.space(g)+""+this.endline(E))},_.prototype.dtdEntity=function(E,g){return this.stream.write(this.space(g)+""+this.endline(E))},_.prototype.dtdNotation=function(E,g){return this.stream.write(this.space(g)+""+this.endline(E))},_.prototype.endline=function(E){return E.isLastRootNode?"":this.newline},_}(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,b){"use strict";(function(){var T,C,c,p,d,o,a,u,s,h,i,n,t,f=function(m,_){function E(){this.constructor=m}for(var g in _)v.call(_,g)&&(m[g]=_[g]);return E.prototype=_.prototype,m.prototype=new E,m.__super__=_.prototype,m},v={}.hasOwnProperty;a=w("./XMLDeclaration"),u=w("./XMLDocType"),T=w("./XMLCData"),C=w("./XMLComment"),s=w("./XMLElement"),i=w("./XMLRaw"),n=w("./XMLText"),h=w("./XMLProcessingInstruction"),c=w("./XMLDTDAttList"),p=w("./XMLDTDElement"),d=w("./XMLDTDEntity"),o=w("./XMLDTDNotation"),t=w("./XMLWriterBase"),P.exports=function(m){function _(E){_.__super__.constructor.call(this,E)}return f(_,m),_.prototype.document=function(E){var g,y,x,l,S;for(this.textispresent=!1,l="",S=E.children,y=0,x=S.length;y"+this.newline},_.prototype.comment=function(E,g){return this.space(g)+""+this.newline},_.prototype.declaration=function(E,g){var y;return y=this.space(g),y+='",y+=this.newline},_.prototype.docType=function(E,g){var y,x,l,S,O;if(g||(g=0),S=this.space(g),S+="0){for(S+=" [",S+=this.newline,O=E.children,x=0,l=O.length;x",S+=this.newline},_.prototype.element=function(E,g){var y,x,l,S,O,A,D,I,B,H,te,W,V;g||(g=0),V=!1,this.textispresent?(this.newline="",this.pretty=!1):(this.newline=this.newlinedefault,this.pretty=this.prettydefault),W=this.space(g),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},_.prototype.processingInstruction=function(E,g){var y;return y=this.space(g)+""+this.newline},_.prototype.raw=function(E,g){return this.space(g)+E.value+this.newline},_.prototype.text=function(E,g){return this.space(g)+E.value+this.newline},_.prototype.dtdAttList=function(E,g){var y;return y=this.space(g)+""+this.newline},_.prototype.dtdElement=function(E,g){return this.space(g)+""+this.newline},_.prototype.dtdEntity=function(E,g){var y;return y=this.space(g)+""+this.newline},_.prototype.dtdNotation=function(E,g){var y;return y=this.space(g)+""+this.newline},_.prototype.openNode=function(E,g){var y,x,l,S;if(g||(g=0),E instanceof s){l=this.space(g)+"<"+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(g)+"")+this.newline},_.prototype.closeNode=function(E,g){switch(g||(g=0),!1){case!(E instanceof s):return this.space(g)+""+this.newline;case!(E instanceof u):return this.space(g)+"]>"+this.newline}},_}(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,b){"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 d,o,a;p||(p={}),this.noDoubleEncoding=p.noDoubleEncoding,o=p.stringify||{};for(d in o)C.call(o,d)&&(a=o[d],this[d]=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 d;if(d=p.match(/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/))throw new Error("Invalid character in string: "+p+" at index "+d.index);return p},c.prototype.elEscape=function(p){var d;return d=this.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,p.replace(d,"&").replace(//g,">").replace(/\r/g," ")},c.prototype.attEscape=function(p){var d;return d=this.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,p.replace(d,"&").replace(/0?new Array(p).join(this.indent):""):""},C}()}).call(void 0)},{}],235:[function(w,P,b){"use strict";(function(){var T,C,c,p,d,o,a;a=w("./Utility"),d=a.assign,o=a.isFunction,T=w("./XMLDocument"),C=w("./XMLDocumentCB"),p=w("./XMLStringWriter"),c=w("./XMLStreamWriter"),P.exports.create=function(u,s,h,i){var n,t;if(u==null)throw new Error("Root element needs a name");return i=d({},s,h,i),n=new T(i),t=n.element(u),i.headless||(n.declaration(i),i.pubID==null&&i.sysID==null||n.doctype(i)),t},P.exports.begin=function(u,s,h){var i;return o(u)&&(i=[u,s],s=i[0],h=i[1],u={}),s?new C(u,s,h):new T(u)},P.exports.stringWriter=function(u){return new p(u)},P.exports.streamWriter=function(u,s){return new c(u,s)}}).call(void 0)},{"./Utility":214,"./XMLDocument":224,"./XMLDocumentCB":225,"./XMLStreamWriter":230,"./XMLStringWriter":231}],236:[function(w,P,b){function T(){for(var c={},p=0;ps?n=i(n):n.length>5]|=128<>>9<<4)]=i;for(var n=1732584193,t=-271733879,f=-1732584194,v=271733878,m=0;m>16)+(i>>16)+(n>>16)<<16|65535&n}function u(h,i){return h<>>32-i}var s=w("./helpers");P.exports=function(h){return s.hash(h,T,16)}},{"./helpers":238}],240:[function(w,P,b){"use strict";function T(a,u){a[u>>5]|=128<<24-u%32,a[15+(u+64>>9<<4)]=u;for(var s=Array(80),h=1732584193,i=-271733879,n=-1732584194,t=271733878,f=-1009589776,v=0;v>16)+(u>>16)+(s>>16)<<16|65535&s}function d(a,u){return a<>>32-u}var o=w("./helpers");P.exports=function(a){return o.hash(a,T,20,!0)}},{"./helpers":238}],241:[function(w,P,b){"use strict";var T=w("./helpers"),C=function(n,t){var f=(65535&n)+(65535&t);return(n>>16)+(t>>16)+(f>>16)<<16|65535&f},c=function(n,t){return n>>>t|n<<32-t},p=function(n,t){return n>>>t},d=function(n,t,f){return n&t^~n&f},o=function(n,t,f){return n&t^n&f^t&f},a=function(n){return c(n,2)^c(n,13)^c(n,22)},u=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)},h=function(n){return c(n,17)^c(n,19)^p(n,10)},i=function(n,t){var f,v,m,_,E,g,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(ye.method,ye.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(";")),b.requestWithCallback(x,l,Me)}var Le=Date.now()-ee;Ne&&(Ne.contentDownload=Le),v("[%sms] done, %s bytes HTTP %s %s %s %s, keepAliveSocket: %s, timing: %j",Le,$,J,ye.method,ye.host,ye.path,q,Ne);var Te={status:J,statusCode:J,headers:_e,size:$,aborted:xe,rt:Le,keepAliveSocket:q,data:Be,requestUrls:l.requestUrls,timing:Ne,remoteAddress:ke,remotePort:dt};if(Xe){var Ze="";Se&&typeof Se.getCurrentStatus=="function"&&(Ze=", agent status: "+(0,u.default)(Se.getCurrentStatus())),Xe.message+=", "+ye.method+" "+x+" "+J+" (connected: "+U+", keepalive socket: "+q+Ze+`) headers: `+(0,u.default)(_e),Xe.data=Be,Xe.path=ye.path,Xe.status=J,Xe.headers=_e,Xe.res=Te}Me(Xe,Be,l.streaming?Ie:Te),l.emitter&&(ne.url=x,ne.socket=Qe&&Qe.connection,ne.options=ye,ne.size=We,l.emitter.emit("response",{requestId:X,error:Xe,ctx:l.ctx,req:ne,res:Te}))}function I(Xe){var Be=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,ye.path,x,Me),A(),l.headers&&l.headers.Host&&g.test(Ie)&&(l.headers.Host=null);var _e=S;return S=null,b.requestWithCallback(Me,l,_e),{redirect:!0,error:null}}Be=new Error("Exceeded maxRedirects. Probably stuck in a redirect loop "+x),Be.name="MaxRedirectError"}else Be=new Error("Got statusCode "+Xe.statusCode+" but cannot resolve next location from headers"),Be.name="FollowRedirectError"}return{redirect:!1,error:Be}}function B(Xe,Be,Ie){return Ie(null,Be,Xe.headers["content-encoding"])}function H(Xe){if(Ne&&(Ne.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 Be=I(Xe);return Be.redirect?void Xe.resume():Be.error?(Xe.resume(),D(Be.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,$)}),Xe.on("error",function(){v("Request#%d %s: `res error` event emit, total size %d",X,x,$)}),Xe.on("aborted",function(){xe=!0,v("Request#%d %s: `res aborted` event emit, total size %d",X,x,$)}),je){var Be=I(Xe);return Be.redirect?void Xe.resume():Be.error?(Xe.resume(),je.end(),D(Be.error,null,Xe)):(l.consumeWriteStream===!1?Xe.on("end",D.bind(null,null,null,Xe)):isNode010||isNode012?first([[je,"close"],[Xe,"aborted"]],function(_e,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),$+=Me.length,Ie.push(Me)}),Xe.on("end",function(){var Me=C.concat(Ie,$);if(v("Request#%d %s: `res end` event emit, total size %d, _dumped: %s",X,x,$,Xe._dumped),k)return D(k,Me,Xe);var _e=I(Xe);if(_e.error)return D(_e.error,Me,Xe);_e.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($===0)Le=null;else{var Ze=parseJSON(Le,Pe);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,h.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||{},_>=E&&(_=0);var X=++_;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||b.TIMEOUTS,l.maxRedirects=l.maxRedirects||10,l.streaming=l.streaming||l.customResponse;var Y,ee=Date.now();typeof x=="string"?(g.test(x)||(x="http://"+x),Y=n.parse(x)):Y=x;var ce=(l.type||l.method||Y.method||"GET").toUpperCase(),de=Y.port||80,Ce=t,Se=p(l.agent,b.agent),Pe=l.fixJSONCtlChars;Y.protocol==="https:"&&(Ce=f,Se=p(l.httpsAgent,b.httpsAgent),Y.port||(de=443));var ye={host:Y.hostname||Y.host||"localhost",path:Y.path||"/",method:ce,port:de,agent:Se,headers:l.headers||{},lookup:l.lookup};Array.isArray(l.timeout)?ye.requestTimeout=l.timeout[l.timeout.length-1]:l.timeout!==void 0&&(ye.requestTimeout=l.timeout);for(var Ee=["pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","secureProtocol","secureOptions"],Ge=0;Ge>>2]>>>24-g%4*8&255;v[_+g>>>2]|=y<<24-(_+g)%4*8}else for(var g=0;g>>2]=m[g>>>2];return this.sigBytes+=E,this},clamp:function(){var f=this.words,v=this.sigBytes;f[v>>>2]&=4294967295<<32-v%4*8,f.length=T.ceil(v/4)},clone:function(){var f=o.clone.call(this);return f.words=this.words.slice(0),f},random:function(f){for(var v,m=[],_=0;_>16)&x,g=18e3*(65535&g)+(g>>16)&x;var l=(y<<16)+g&x;return l/=4294967296,(l+=.5)*(T.random()>.5?1:-1)}}(4294967296*(v||T.random()));v=987654071*E(),m.push(4294967296*E()|0)}return new a.init(m,f)}}),u=p.enc={},s=u.Hex={stringify:function(f){for(var v=f.words,m=f.sigBytes,_=[],E=0;E>>2]>>>24-E%4*8&255;_.push((g>>>4).toString(16)),_.push((15&g).toString(16))}return _.join("")},parse:function(f){for(var v=f.length,m=[],_=0;_>>3]|=parseInt(f.substr(_,2),16)<<24-_%8*4;return new a.init(m,v/2)}},h=u.Latin1={stringify:function(f){for(var v=f.words,m=f.sigBytes,_=[],E=0;E>>2]>>>24-E%4*8&255;_.push(String.fromCharCode(g))}return _.join("")},parse:function(f){for(var v=f.length,m=[],_=0;_>>2]|=(255&f.charCodeAt(_))<<24-_%4*8;return new a.init(m,v)}},i=u.Utf8={stringify:function(f){try{return decodeURIComponent(escape(h.stringify(f)))}catch(v){throw new Error("Malformed UTF-8 data")}},parse:function(f){return h.parse(unescape(encodeURIComponent(f)))}},n=d.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new a.init,this._nDataBytes=0},_append:function(f){typeof f=="string"&&(f=i.parse(f)),this._data.concat(f),this._nDataBytes+=f.sigBytes},_process:function(f){var v=this._data,m=v.words,_=v.sigBytes,E=this.blockSize,g=4*E,y=_/g;y=f?T.ceil(y):T.max((0|y)-this._minBufferSize,0);var x=y*E,l=T.min(4*x,_);if(x){for(var S=0;S",o[0];)p++;return p>4&&p}},{key:"extend",value:function(p,d){for(var o in d)Object.prototype.hasOwnProperty.call(d,o)&&d[o]&&(p[o]=d[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 d(o){return o<10?"0"+o:o}return p.getUTCFullYear()+"-"+d(p.getUTCMonth()+1)+"-"+d(p.getUTCDate())+"T"+d(p.getUTCHours())+":"+d(p.getUTCMinutes())+":"+d(p.getUTCSeconds())+"Z"}},{key:"isIntNum",value:function(p){return!!/^\d+$/.test(p)}}]),c}();w.default=C},function(j,w,P){!function(b,T){j.exports=w=T(P(0))}(0,function(b){return function(T){function C(t,f,v,m,_,E,g){var y=t+(f&v|~f&m)+_+g;return(y<>>32-E)+f}function c(t,f,v,m,_,E,g){var y=t+(f&m|v&~m)+_+g;return(y<>>32-E)+f}function p(t,f,v,m,_,E,g){var y=t+(f^v^m)+_+g;return(y<>>32-E)+f}function d(t,f,v,m,_,E,g){var y=t+(v^(f|~m))+_+g;return(y<>>32-E)+f}var o=b,a=o.lib,u=a.WordArray,s=a.Hasher,h=o.algo,i=[];!function(){for(var t=0;t<64;t++)i[t]=4294967296*T.abs(T.sin(t+1))|0}();var n=h.MD5=s.extend({_doReset:function(){this._hash=new u.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(t,f){for(var v=0;v<16;v++){var m=f+v,_=t[m];t[m]=16711935&(_<<8|_>>>24)|4278255360&(_<<24|_>>>8)}var E=this._hash.words,g=t[f+0],y=t[f+1],x=t[f+2],l=t[f+3],S=t[f+4],O=t[f+5],A=t[f+6],D=t[f+7],I=t[f+8],B=t[f+9],H=t[f+10],te=t[f+11],W=t[f+12],V=t[f+13],X=t[f+14],ne=t[f+15],Y=E[0],ee=E[1],ce=E[2],de=E[3];Y=C(Y,ee,ce,de,g,7,i[0]),de=C(de,Y,ee,ce,y,12,i[1]),ce=C(ce,de,Y,ee,x,17,i[2]),ee=C(ee,ce,de,Y,l,22,i[3]),Y=C(Y,ee,ce,de,S,7,i[4]),de=C(de,Y,ee,ce,O,12,i[5]),ce=C(ce,de,Y,ee,A,17,i[6]),ee=C(ee,ce,de,Y,D,22,i[7]),Y=C(Y,ee,ce,de,I,7,i[8]),de=C(de,Y,ee,ce,B,12,i[9]),ce=C(ce,de,Y,ee,H,17,i[10]),ee=C(ee,ce,de,Y,te,22,i[11]),Y=C(Y,ee,ce,de,W,7,i[12]),de=C(de,Y,ee,ce,V,12,i[13]),ce=C(ce,de,Y,ee,X,17,i[14]),ee=C(ee,ce,de,Y,ne,22,i[15]),Y=c(Y,ee,ce,de,y,5,i[16]),de=c(de,Y,ee,ce,A,9,i[17]),ce=c(ce,de,Y,ee,te,14,i[18]),ee=c(ee,ce,de,Y,g,20,i[19]),Y=c(Y,ee,ce,de,O,5,i[20]),de=c(de,Y,ee,ce,H,9,i[21]),ce=c(ce,de,Y,ee,ne,14,i[22]),ee=c(ee,ce,de,Y,S,20,i[23]),Y=c(Y,ee,ce,de,B,5,i[24]),de=c(de,Y,ee,ce,X,9,i[25]),ce=c(ce,de,Y,ee,l,14,i[26]),ee=c(ee,ce,de,Y,I,20,i[27]),Y=c(Y,ee,ce,de,V,5,i[28]),de=c(de,Y,ee,ce,x,9,i[29]),ce=c(ce,de,Y,ee,D,14,i[30]),ee=c(ee,ce,de,Y,W,20,i[31]),Y=p(Y,ee,ce,de,O,4,i[32]),de=p(de,Y,ee,ce,I,11,i[33]),ce=p(ce,de,Y,ee,te,16,i[34]),ee=p(ee,ce,de,Y,X,23,i[35]),Y=p(Y,ee,ce,de,y,4,i[36]),de=p(de,Y,ee,ce,S,11,i[37]),ce=p(ce,de,Y,ee,D,16,i[38]),ee=p(ee,ce,de,Y,H,23,i[39]),Y=p(Y,ee,ce,de,V,4,i[40]),de=p(de,Y,ee,ce,g,11,i[41]),ce=p(ce,de,Y,ee,l,16,i[42]),ee=p(ee,ce,de,Y,A,23,i[43]),Y=p(Y,ee,ce,de,B,4,i[44]),de=p(de,Y,ee,ce,W,11,i[45]),ce=p(ce,de,Y,ee,ne,16,i[46]),ee=p(ee,ce,de,Y,x,23,i[47]),Y=d(Y,ee,ce,de,g,6,i[48]),de=d(de,Y,ee,ce,D,10,i[49]),ce=d(ce,de,Y,ee,X,15,i[50]),ee=d(ee,ce,de,Y,O,21,i[51]),Y=d(Y,ee,ce,de,W,6,i[52]),de=d(de,Y,ee,ce,l,10,i[53]),ce=d(ce,de,Y,ee,H,15,i[54]),ee=d(ee,ce,de,Y,y,21,i[55]),Y=d(Y,ee,ce,de,I,6,i[56]),de=d(de,Y,ee,ce,ne,10,i[57]),ce=d(ce,de,Y,ee,A,15,i[58]),ee=d(ee,ce,de,Y,V,21,i[59]),Y=d(Y,ee,ce,de,S,6,i[60]),de=d(de,Y,ee,ce,te,10,i[61]),ce=d(ce,de,Y,ee,x,15,i[62]),ee=d(ee,ce,de,Y,B,21,i[63]),E[0]=E[0]+Y|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,f=t.words,v=8*this._nDataBytes,m=8*t.sigBytes;f[m>>>5]|=128<<24-m%32;var _=T.floor(v/4294967296),E=v;f[15+(m+64>>>9<<4)]=16711935&(_<<8|_>>>24)|4278255360&(_<<24|_>>>8),f[14+(m+64>>>9<<4)]=16711935&(E<<8|E>>>24)|4278255360&(E<<24|E>>>8),t.sigBytes=4*(f.length+1),this._process();for(var g=this._hash,y=g.words,x=0;x<4;x++){var l=y[x];y[x]=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8)}return g},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),b.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 b(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,f){for(var v=0;v-1)return"Baiduspider";if(u.indexOf("PlayStation")>-1)return"PS4";var h=navigator.platform=="Win32"||navigator.platform=="Windows"||u.indexOf("Windows")>-1,i=navigator.platform=="Mac68K"||navigator.platform=="MacPPC"||navigator.platform=="Macintosh"||navigator.platform=="MacIntel";return i&&(s="macOS"),navigator.platform=="X11"&&!h&&!i&&(s="Unix"),String(navigator.platform).indexOf("Linux")>-1&&(s="Linux"),h?"windows":s},c=function(){var a=navigator.userAgent,u="";return(a.indexOf("Windows NT 5.0")>-1||a.indexOf("Windows 2000")>-1)&&(u="2000"),(a.indexOf("Windows NT 5.1")>-1||a.indexOf("Windows XP")>-1)&&(u="XP"),(a.indexOf("Windows NT 5.2")>-1||a.indexOf("Windows 2003")>-1)&&(u="2003"),(a.indexOf("Windows NT 6.0")>-1||a.indexOf("Windows Vista")>-1)&&(u="Vista"),(a.indexOf("Windows NT 6.1")>-1||a.indexOf("Windows 7")>-1)&&(u="7"),(a.indexOf("Windows NT 6.2")>-1||a.indexOf("Windows 8")>-1)&&(u="8"),(a.indexOf("Windows NT 6.3")>-1||a.indexOf("Windows 8.1")>-1)&&(u="8.1"),(a.indexOf("Windows NT 10")>-1||a.indexOf("Windows 10")>-1)&&(u="10"),u},p=function(a){var u=navigator.userAgent.toLowerCase();return a.chrome?"Chrome":a.firefox?"Firefox":a.safari?"Safari":a.webview?"webview":a.ie?/edge/.test(u)?"Edge":"IE":/baiduspider/.test(u)?"Baiduspider":/ucweb/.test(u)||/UCBrowser/.test(u)?"UC":/opera/.test(u)?"Opera":/ucweb/.test(u)?"UC":/360se/.test(u)?"360\u6D4F\u89C8\u5668":/bidubrowser/.test(u)?"\u767E\u5EA6\u6D4F\u89C8\u5668":/metasr/.test(u)?"\u641C\u72D7\u6D4F\u89C8\u5668":/lbbrowser/.test(u)?"\u730E\u8C79\u6D4F\u89C8\u5668":/micromessenger/.test(u)?"\u5FAE\u4FE1\u5185\u7F6E\u6D4F\u89C8\u5668":/qqbrowser/.test(u)?"QQ\u6D4F\u89C8\u5668":/playstation/.test(u)?"PS4\u6D4F\u89C8\u5668":void 0},d=function(){var a={},u={},s=navigator.userAgent,h=navigator.platform,i=s.match(/Web[kK]it[\/]{0,1}([\d.]+)/),n=s.match(/(Android);?[\s\/]+([\d.]+)?/),t=!!s.match(/\(Macintosh\; Intel /),f=s.match(/(iPad).*OS\s([\d_]+)/),v=s.match(/(iPod)(.*OS\s([\d_]+))?/),m=!f&&s.match(/(iPhone\sOS)\s([\d_]+)/),_=s.match(/(webOS|hpwOS)[\s\/]([\d.]+)/),E=/Win\d{2}|Windows/.test(h),g=s.match(/Windows Phone ([\d.]+)/),y=_&&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((u.webkit=!!i)&&(u.version=i[1]),n&&(a.android=!0,a.version=n[2]),m&&!v&&(a.ios=a.iphone=!0,a.version=m[2].replace(/_/g,".")),f&&(a.ios=a.ipad=!0,a.version=f[2].replace(/_/g,".")),v&&(a.ios=a.ipod=!0,a.version=v[3]?v[3].replace(/_/g,"."):null),g&&(a.wp=!0,a.version=g[1]),_&&(a.webos=!0,a.version=_[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&&(u.playbook=!0),x&&(a.kindle=!0,a.version=x[1]),l&&(u.silk=!0,u.version=l[1]),!l&&a.android&&s.match(/Kindle Fire/)&&(u.silk=!0),I&&(u.chrome=!0,u.version=I[1]),B&&(u.firefox=!0,u.version=B[1]),H&&(a.firefoxos=!0,a.version=H[1]),te&&(u.ie=!0,u.version=te[1]),V&&(t||a.ios||E||n)&&(u.safari=!0,a.ios||(u.version=V[1])),W&&(u.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=!!(f||D||n&&!s.match(/Mobile/)||B&&s.match(/Tablet/)||te&&!s.match(/Phone/)&&s.match(/Touch/)),a.phone=!(a.tablet||a.ipod||!(n||m||_||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),u.name=p(u),{os:a,browser:u}}(),o=function(){function a(){b(this,a)}return T(a,null,[{key:"getHost",value:function(u){var s="";if(u===void 0||u==null||u=="")return"";var h=u.indexOf("//"),i=u;h>-1&&(i=u.substring(h+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 d.os}},{key:"browser",get:function(){var u=d.browser;return u.name||(u.name=p()),u}}]),a}();w.default=o},function(j,w,P){"use strict";function b(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,d){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=u.default.encode(H)),V.ri=m.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(u.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(u.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,Y){D._progress.call(D,X,ne,Y)}})}var I=f.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=m.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 Y=ne.Message+"\uFF0C\u6B63\u786E\u8D26\u53F7ID(userId)\u8BF7\u53C2\u8003\uFF1Ahttps://help.aliyun.com/knowledge_detail/37196.html";console.log(Y)}})}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);h.default.remove(D)}},{key:"_getCheckoutpoint",value:function(A){var D=this._getCheckoutpointKey(A),I=h.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};h.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 b(a){return a&&a.__esModule?a:{default:a}}function T(a,u){if(!(a instanceof u))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(w,"__esModule",{value:!0});var C=function(){function a(u,s){for(var h=0;h=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 f(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 ye(re).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*U;case"hex":return U>>>1;case"base64":return Ue(re).length;default:if(q)return ye(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 m(re,k,U){var q=re[k];re[k]=re[U],re[U]=q}function _(re,k,U,q,$){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=$?0:re.length-1),U<0&&(U=re.length+U),U>=re.length){if($)return-1;U=re.length-1}else if(U<0){if(!$)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,$);if(typeof k=="number")return k&=255,c.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?$?Uint8Array.prototype.indexOf.call(re,k,U):Uint8Array.prototype.lastIndexOf.call(re,k,U):E(re,[k],U,q,$);throw new TypeError("val must be string, number or Buffer")}function E(re,k,U,q,$){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 Ne;if($){var je=-1;for(Ne=U;Neke&&(U=ke-dt),Ne=U;Ne>=0;Ne--){for(var tt=!0,mt=0;mt$&&(q=$):q=$;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($+ke<=U){var dt,Ne,je,tt;switch(ke){case 1:J<128&&(xe=J);break;case 2:dt=re[$+1],(192&dt)==128&&(tt=(31&J)<<6|63&dt)>127&&(xe=tt);break;case 3:dt=re[$+1],Ne=re[$+2],(192&dt)==128&&(192&Ne)==128&&(tt=(15&J)<<12|(63&dt)<<6|63&Ne)>2047&&(tt<55296||tt>57343)&&(xe=tt);break;case 4:dt=re[$+1],Ne=re[$+2],je=re[$+3],(192&dt)==128&&(192&Ne)==128&&(192&je)==128&&(tt=(15&J)<<18|(63&dt)<<12|(63&Ne)<<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),$+=ke}return I(q)}function I(re){var k=re.length;if(k<=ze)return String.fromCharCode.apply(String,re);for(var U="",q=0;qq)&&(U=q);for(var $="",J=k;JU)throw new RangeError("Trying to access beyond buffer length")}function X(re,k,U,q,$,J){if(!c.isBuffer(re))throw new TypeError('"buffer" argument must be a Buffer instance');if(k>$||kre.length)throw new RangeError("Index out of range")}function ne(re,k,U,q){k<0&&(k=65535+k+1);for(var $=0,J=Math.min(re.length-U,2);$>>8*(q?$:1-$)}function Y(re,k,U,q){k<0&&(k=4294967295+k+1);for(var $=0,J=Math.min(re.length-U,4);$>>8*(q?$:3-$)&255}function ee(re,k,U,q,$,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,$){return $||ee(re,k,U,4,34028234663852886e22,-34028234663852886e22),me.write(re,k,U,q,23,4),U+4}function de(re,k,U,q,$){return $||ee(re,k,U,8,17976931348623157e292,-17976931348623157e292),me.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 Pe(re){return re<16?"0"+re.toString(16):re.toString(16)}function ye(re,k){k=k||1/0;for(var U,q=re.length,$=null,J=[],xe=0;xe55295&&U<57344){if(!$){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}$=U;continue}if(U<56320){(k-=3)>-1&&J.push(239,191,189),$=U;continue}U=65536+($-55296<<10|U-56320)}else $&&(k-=3)>-1&&J.push(239,191,189);if($=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 Ee(re){for(var k=[],U=0;U>8,$=U%256,J.push($),J.push(q);return J}function Ue(re){return be.toByteArray(Ce(re))}function Fe(re,k,U,q){for(var $=0;$=k.length||$>=re.length);++$)k[$+U]=re[$];return $}function He(re){return re!==re}/*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */var be=P(21),me=P(22),We=P(23);w.Buffer=c,w.SlowBuffer=t,w.INSPECT_MAX_BYTES=50,c.TYPED_ARRAY_SUPPORT=b.TYPED_ARRAY_SUPPORT!==void 0?b.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,$=0,J=Math.min(U,q);$0&&(re=this.toString("hex",0,k).match(/.{2}/g).join(" "),this.length>k&&(re+=" ... ")),""},c.prototype.compare=function(re,k,U,q,$){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),$===void 0&&($=this.length),k<0||U>re.length||q<0||$>this.length)throw new RangeError("out of range index");if(q>=$&&k>=U)return 0;if(q>=$)return-1;if(k>=U)return 1;if(k>>>=0,U>>>=0,q>>>=0,$>>>=0,this===re)return 0;for(var J=$-q,xe=U-k,ke=Math.min(J,xe),dt=this.slice(q,$),Ne=re.slice(k,U),je=0;je$)&&(U=$),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 g(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 ze=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&&($*=256);)q+=this[re+--k]*$;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],$=1,J=0;++J=$&&(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,$=1,J=this[re+--q];q>0&&($*=256);)J+=this[re+--q]*$;return $*=128,J>=$&&(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),me.read(this,re,!0,23,4)},c.prototype.readFloatBE=function(re,k){return k||V(re,4,this.length),me.read(this,re,!1,23,4)},c.prototype.readDoubleLE=function(re,k){return k||V(re,8,this.length),me.read(this,re,!0,52,8)},c.prototype.readDoubleBE=function(re,k){return k||V(re,8,this.length),me.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 $=1,J=0;for(this[k]=255&re;++J=0&&(J*=256);)this[k+$]=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):Y(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):Y(this,re,k,!1),k+4},c.prototype.writeIntLE=function(re,k,U,q){if(re=+re,k|=0,!q){var $=Math.pow(2,8*U-1);X(this,re,k,U,$-1,-$)}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 $=Math.pow(2,8*U-1);X(this,re,k,U,$-1,-$)}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):Y(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):Y(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;--$)re[$+k]=this[$+U];else if(J<1e3||!c.TYPED_ARRAY_SUPPORT)for($=0;$>>=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-b(n)}function C(n){var t,f,v,m,_,E=n.length;m=b(n),_=new u(3*E/4-m),f=m>0?E-4:E;var g=0;for(t=0;t>16&255,_[g++]=v>>8&255,_[g++]=255&v;return m===2?(v=a[n.charCodeAt(t)]<<2|a[n.charCodeAt(t+1)]>>4,_[g++]=255&v):m===1&&(v=a[n.charCodeAt(t)]<<10|a[n.charCodeAt(t+1)]<<4|a[n.charCodeAt(t+2)]>>2,_[g++]=v>>8&255,_[g++]=255&v),_}function c(n){return o[n>>18&63]+o[n>>12&63]+o[n>>6&63]+o[63&n]}function p(n,t,f){for(var v,m=[],_=t;_g?g:E+16383));return v===1?(t=n[f-1],m+=o[t>>2],m+=o[t<<4&63],m+="=="):v===2&&(t=(n[f-2]<<8)+n[f-1],m+=o[t>>10],m+=o[t>>4&63],m+=o[t<<2&63],m+="="),_.push(m),_.join("")}w.byteLength=T,w.toByteArray=C,w.fromByteArray=d;for(var o=[],a=[],u=typeof Uint8Array!="undefined"?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h=0,i=s.length;h>1,s=-7,h=T?c-1:0,i=T?-1:1,n=P[b+h];for(h+=i,p=n&(1<<-s)-1,n>>=-s,s+=o;s>0;p=256*p+P[b+h],h+=i,s-=8);for(d=p&(1<<-s)-1,p>>=-s,s+=C;s>0;d=256*d+P[b+h],h+=i,s-=8);if(p===0)p=1-u;else{if(p===a)return d?NaN:1/0*(n?-1:1);d+=Math.pow(2,C),p-=u}return(n?-1:1)*d*Math.pow(2,p-C)},w.write=function(P,b,T,C,c,p){var d,o,a,u=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,f=b<0||b===0&&1/b<0?1:0;for(b=Math.abs(b),isNaN(b)||b===1/0?(o=isNaN(b)?1:0,d=s):(d=Math.floor(Math.log(b)/Math.LN2),b*(a=Math.pow(2,-d))<1&&(d--,a*=2),b+=d+h>=1?i/a:i*Math.pow(2,1-h),b*a>=2&&(d++,a/=2),d+h>=s?(o=0,d=s):d+h>=1?(o=(b*a-1)*Math.pow(2,c),d+=h):(o=b*Math.pow(2,h-1)*Math.pow(2,c),d=0));c>=8;P[T+n]=255&o,n+=t,o/=256,c-=8);for(d=d<0;P[T+n]=255&d,n+=t,d/=256,u-=8);P[T+n-t]|=128*f}},function(j,w){var P={}.toString;j.exports=Array.isArray||function(b){return P.call(b)=="[object Array]"}},function(j,w,P){"use strict";function b(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,d){for(var o=0;o>>31}var E=(i<<5|i>>>27)+v+o[m];E+=m<20?1518500249+(n&t|~n&f):m<40?1859775393+(n^t^f):m<60?(n&t|n&f|t&f)-1894007588:(n^t^f)-899497514,v=f,f=t,t=n<<30|n>>>2,n=i,i=E}h[0]=h[0]+i|0,h[1]=h[1]+n|0,h[2]=h[2]+t|0,h[3]=h[3]+f|0,h[4]=h[4]+v|0},_doFinalize:function(){var u=this._data,s=u.words,h=8*this._nDataBytes,i=8*u.sigBytes;return s[i>>>5]|=128<<24-i%32,s[14+(i+64>>>9<<4)]=Math.floor(h/4294967296),s[15+(i+64>>>9<<4)]=h,u.sigBytes=4*s.length,this._process(),this._hash},clone:function(){var u=p.clone.call(this);return u._hash=this._hash.clone(),u}});T.SHA1=p._createHelper(a),T.HmacSHA1=p._createHmacHelper(a)}(),b.SHA1})},function(j,w,P){!function(b,T){j.exports=w=T(P(0))}(0,function(b){!function(){var T=b,C=T.lib,c=C.Base,p=T.enc,d=p.Utf8,o=T.algo;o.HMAC=c.extend({init:function(a,u){a=this._hasher=new a.init,typeof u=="string"&&(u=d.parse(u));var s=a.blockSize,h=4*s;u.sigBytes>h&&(u=a.finalize(u)),u.clamp();for(var i=this._oKey=u.clone(),n=this._iKey=u.clone(),t=i.words,f=n.words,v=0;v>>6-i%4*2;s[h>>>2]|=(n|t)<<24-h%4*8,h++}return p.create(s,h)}var C=b,c=C.lib,p=c.WordArray,d=C.enc;d.Base64={stringify:function(o){var a=o.words,u=o.sigBytes,s=this._map;o.clamp();for(var h=[],i=0;i>>2]>>>24-i%4*8&255,t=a[i+1>>>2]>>>24-(i+1)%4*8&255,f=a[i+2>>>2]>>>24-(i+2)%4*8&255,v=n<<16|t<<8|f,m=0;m<4&&i+.75*m>>6*(3-m)&63));var _=s.charAt(64);if(_)for(;h.length%4;)h.push(_);return h.join("")},parse:function(o){var a=o.length,u=this._map,s=this._reverseMap;if(!s){s=this._reverseMap=[];for(var h=0;h0&&(V=W.UploadProgress.UploadProgressList[0],X=V.ClientId),u.default.setClientId(X),x&&x(V)},function(W){W&&(l(W),console.log(W))})}}]),g}();w.default=E},function(j,w,P){"use strict";function b(d,o){if(!(d instanceof o))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(w,"__esModule",{value:!0});var T=function(){function d(o,a){for(var u=0;u=j.length?{done:!0}:{done:!1,value:j[b++]}},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,f){var v=Object.keys(t);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(t);f&&(m=m.filter(function(_){return Object.getOwnPropertyDescriptor(t,_).enumerable})),v.push.apply(v,m)}return v}function b(t){for(var f=1;f=0)continue;if(!Object.prototype.propertyIsEnumerable.call(t,m))continue;v[m]=t[m]}}return v}function C(t,f){if(t==null)return{};var v={},m=Object.keys(t),_,E;for(E=0;E=0)continue;v[_]=t[_]}return v}function c(t,f){if(!(t instanceof f))throw new TypeError("Cannot call a class as a function")}function p(t,f){for(var v=0;v"']/,le=/[&<>"']/g,Q=/[<>"']|&(?!#?\w+;)/,j=/[<>"']|&(?!#?\w+;)/g,w={"&":"&","<":"<",">":">",'"':""","'":"'"},P=g=>w[g];function b(g,y){if(y){if(z.test(g))return g.replace(le,P)}else if(Q.test(g))return g.replace(j,P);return g}const T=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function C(g){return g.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(g,y){g=g.source||g,y=y||"";const x={replace:(l,S)=>(S=S.source||S,S=S.replace(c,"$1"),g=g.replace(l,S),x),getRegex:()=>new RegExp(g,y)};return x}const d=/[^\w:]/g,o=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function a(g,y,x){if(g){let l;try{l=decodeURIComponent(C(x)).replace(d,"").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 u={},s=/^[^:]+:\/*[^/]*$/,h=/^([^:]+:)[\s\S]*$/,i=/^([^:]+:\/*[^/]*)[\s\S]*$/;function n(g,y){u[" "+g]||(s.test(g)?u[" "+g]=g+"/":u[" "+g]=m(g,"/",!0)),g=u[" "+g];const x=g.indexOf(":")===-1;return y.substring(0,2)==="//"?x?y:g.replace(h,"$1")+y:y.charAt(0)==="/"?x?y:g.replace(i,"$1")+y:g+y}const t={exec:function(){}};function f(g){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 d=j().key(p);c(w(d),d)}}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 b}),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),d=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(f.length===0)return Object(p.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var v=f[0];if(b.isValidElement(v)&&Object(d.c)(v)){var m=v.ref;f[0]=b.cloneElement(v,{ref:Object(d.a)(m,this.setChildNode)})}return f.length===1?f[0]:f.map(function(_,E){return!b.isValidElement(_)||"key"in _&&_.key!==null?_:b.cloneElement(_,{key:"".concat(a,"-").concat(E)})})}}]),i}(b.Component);u.displayName="ResizeObserver",Ve.a=u},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,b){j.o(w,P)||Object.defineProperty(w,P,{enumerable:!0,get:b})},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 b=Object.create(null);if(j.r(b),Object.defineProperty(b,"default",{enumerable:!0,value:w}),P&2&&typeof w!="string")for(var T in w)j.d(b,T,function(C){return w[C]}.bind(null,T));return b},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 b(){}Object.create&&(b.prototype=Object.create(null),new b().__proto__||(P=!1));function T(d,o,a){this.fn=d,this.context=o,this.once=a||!1}function C(d,o,a,u,s){if(typeof a!="function")throw new TypeError("The listener must be a function");var h=new T(a,u||d,s),i=P?P+o:o;return d._events[i]?d._events[i].fn?d._events[i]=[d._events[i],h]:d._events[i].push(h):(d._events[i]=h,d._eventsCount++),d}function c(d,o){--d._eventsCount===0?d._events=new b:delete d._events[o]}function p(){this._events=new b,this._eventsCount=0}p.prototype.eventNames=function(){var o=[],a,u;if(this._eventsCount===0)return o;for(u in a=this._events)w.call(a,u)&&o.push(P?u.slice(1):u);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(a)):o},p.prototype.listeners=function(o){var a=P?P+o:o,u=this._events[a];if(!u)return[];if(u.fn)return[u.fn];for(var s=0,h=u.length,i=new Array(h);s0},!1)}function d(o,a){for(var u={main:[a]},s={main:[]},h={main:{}};p(u);)for(var i=Object.keys(u),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(g,_.loaded),this.clearTimer(),i.loader&&(this.fragCurrent=this.partCurrent=null,i.loader.abort()),t.trigger(b.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:i,part:n,stats:_})},s.onFragLoaded=function(i,n){var t=n.frag,f=n.part;if(t.type===c.PlaylistLevelType.MAIN&&Object(w.isFiniteNumber)(t.sn)){var v=f?f.stats:t.stats,m=f?f.duration:t.duration;if(this.clearTimer(),this.lastLoadedFragLevel=t.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var _=this.hls.levels[t.level],E=(_.loaded?_.loaded.bytes:0)+v.loaded,g=(_.loaded?_.loaded.duration:0)+m;_.loaded={bytes:E,duration:g},_.realBitrate=Math.round(8*E/g)}if(t.bitrateTest){var y={stats:v,frag:t,part:f,id:t.type};this.onFragBuffered(b.Events.FRAG_BUFFERED,y),t.bitrateTest=!1}}},s.onFragBuffered=function(i,n){var t=n.frag,f=n.part,v=f?f.stats:t.stats;if(v.aborted)return;if(t.type!==c.PlaylistLevelType.MAIN||t.sn==="initSegment")return;var m=v.parsing.end-v.loading.start;this.bwEstimator.sample(m,v.loaded),v.bwEstimate=this.bwEstimator.getEstimate(),t.bitrateTest?this.bitrateTestDelay=m/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,f=t.maxAutoLevel,v=t.config,m=t.minAutoLevel,_=t.media,E=n?n.duration:i?i.duration:0,g=_?_.currentTime:0,y=_&&_.playbackRate!==0?Math.abs(_.playbackRate):1,x=this.bwEstimator?this.bwEstimator.getEstimate():v.abrEwmaDefaultEstimate,l=(T.BufferHelper.bufferInfo(_,g,v.maxBufferHole).end-g)/y,S=this.findBestLevel(x,m,f,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,m,f,l+O,A,D),Math.max(S,0)},s.findBestLevel=function(i,n,t,f,v,m){for(var _,E=this.fragCurrent,g=this.partCurrent,y=this.lastLoadedFragLevel,x=this.hls.levels,l=x[y],S=!!(l!=null&&(_=l.details)!==null&&_!==void 0&&_.live),O=l==null?void 0:l.codecSet,A=g?g.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=(g?B==null?void 0:B.partTarget:B==null?void 0:B.averagetargetduration)||A,te=void 0;D<=y?te=v*i:te=m*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+"/"+f+"/"+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(),Y={frag:te,part:W,payload:ne,networkDetails:null};this._handleFragmentLoadProgress(Y),X&&E.prototype._handleFragmentLoadComplete.call(this,Y)}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,d.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(b.Events.BUFFER_EOS,{type:"audio"}),this.state=P.State.ENDED;return}var Y=te.fragments,ee=Y[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(m):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(h.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],Y=(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 u.ChunkMetadata(O.level,O.sn,O.stats.chunkCount,D.byteLength,ce,de);X.push(D,Y,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},Pe=Se.cache;Pe.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(b.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===d.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(b.Events.FRAG_PARSING_INIT_SEGMENT,{frag:H,id:O,tracks:ne.tracks})),W){var Y=W.startPTS,ee=W.endPTS,ce=W.startDTS,de=W.endDTS;te&&(te.elementaryStreams[d.ElementaryStreamTypes.AUDIO]={startPTS:Y,endPTS:ee,startDTS:ce,endDTS:de}),H.setElementaryStreamInfo(d.ElementaryStreamTypes.AUDIO,Y,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(b.Events.FRAG_PARSING_METADATA,Ce)}if(V){var Se=t({frag:H,id:O},V);A.trigger(b.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(b.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(b.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(b.Events.AUDIO_TRACK_SWITCHED,{id:O})},g}(P.default);Q.default=_},"./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"),b=j("./src/controller/base-playlist-controller.ts"),T=j("./src/types/loader.ts");function C(a,u){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 f=n[i],v=f.id,m=f.groupId,_=m===void 0?"":m,E=f.name,g=f.type,y=f.url;if(this.trackId=i,this.trackName=E,this.selectDefaultTrack=!1,this.hls.trigger(w.Events.AUDIO_TRACK_SWITCHING,{id:v,groupId:_,name:E,type:g,url:y}),f.details&&!f.details.live)return;var x=this.switchParams(f.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;tu.partTarget&&(f+=1)}if(Object(w.isFiniteNumber)(t))return new P.HlsUrlParameters(t,Object(w.isFiniteNumber)(f)?f:void 0,P.HlsSkip.No)}}},d.loadPlaylist=function(a){},d.shouldLoadTrack=function(a){return this.canLoad&&a&&!!a.url&&(!a.details||a.details.live)},d.playlistLoaded=function(a,u,s){var h=this,i=u.details,n=u.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(b.mergeDetails)(s,i),!this.canLoad||!i.live)return;var f,v=void 0,m=void 0;if(i.canBlockReload&&i.endSN&&i.advanced){var _=this.hls.config.lowLatencyMode,E=i.lastPartSn,g=i.endSN,y=i.lastPartIndex,x=y!==-1,l=E===g,S=_?0:y;x?(v=l?g+1:E,m=l?S:y+1):v=g+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,m!==void 0){var B=Math.round(D%i.targetduration/i.partTarget);m+=B}this.log("CDN Tune-in age: "+i.ageHeader+"s last advanced "+O.toFixed(2)+"s goal: "+D+" skip sn "+I+" to part "+m)}i.tuneInGoal=D}if(f=this.getDeliveryDirectives(i,u.deliveryDirectives,v,m),_||!l){this.loadPlaylist(f);return}}else f=this.getDeliveryDirectives(i,u.deliveryDirectives,v,m);var H=Object(b.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 h.loadPlaylist(f)},H)}else this.clearTimer()},d.getDeliveryDirectives=function(a,u,s,h){var i=Object(P.getSkipValue)(a,s);return u!=null&&u.skip&&a.deltaUpdateFailed&&(s=u.msn,h=u.part,i=P.HlsSkip.No),new P.HlsUrlParameters(s,h,i)},d.retryLoadingOrFail=function(a){var u=this,s=this.hls.config,h=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 u.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 h},p}()},"./src/controller/base-stream-controller.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"State",function(){return g}),j.d(Q,"default",function(){return y});var w=j("./src/polyfills/number.ts"),P=j("./src/task-loop.ts"),b=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"),d=j("./src/types/transmuxer.ts"),o=j("./src/utils/mp4-tools.ts"),a=j("./src/utils/discontinuities.ts"),u=j("./src/controller/fragment-finders.ts"),s=j("./src/controller/level-helper.ts"),h=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 f(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=g.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=g.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 d.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=g.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=g.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(Y){var ee=D[Y];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[Y+1];if(Ce&&Ce.fragment===A)ne(Y+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!==g.PARSING){this.fragCurrent||(this.state=g.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!==g.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(u.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(u.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 Y;if(AD-X?0:X;Y=Object(u.findFragmentByPTS)(H,te,A,ee)}else Y=te[te.length-1];if(Y){var ce=Y.sn-I.startSN,de=H&&Y.level===H.level,Ce=te[ce+1],Se=this.fragmentTracker.getState(Y);if(Se===b.FragmentState.BACKTRACKED){Y=null;for(var Pe=ce;te[Pe]&&this.fragmentTracker.getState(te[Pe])===b.FragmentState.BACKTRACKED;)H?Y=te[Pe--]:Y=te[--Pe];Y||(Y=Ce)}else H&&Y.sn===H.sn&&!ne&&(de&&(Y.sn=te-D.maxFragLookUpTolerance&&H<=W;if(B!==null&&I.duration>B&&(H"+A.startSN+" prev-sn: "+(H?H.sn:"na")+" fragments: "+W),Y}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 u});var w=j("./src/polyfills/number.ts"),P=j("./src/events.ts"),b=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"),d=j("./src/controller/buffer-operation-queue.ts"),o=Object(c.getMediaSource)(),a=/([ha]vc.)(?:\.[^.,]+)+/,u=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,f=n.media,v=n.mediaSource;b.logger.log("[buffer-controller]: Media source opened"),f&&(n.updateMediaElementDuration(),t.trigger(P.Events.MEDIA_ATTACHED,{media:f})),v&&v.removeEventListener("sourceopen",n._onMediaSourceOpen),n.checkPendingTracks()},this._onMediaSourceClose=function(){b.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){b.logger.log("[buffer-controller]: Media source ended")},this.hls=i,this._initSourceBuffer(),this.registerListeners()}var h=s.prototype;return h.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},h.destroy=function(){this.unregisterListeners(),this.details=null},h.registerListeners=function(){var 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)},h.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)},h._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new d.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},h.onManifestParsed=function(n,t){var f=2;(t.audio&&!t.video||!t.altAudio)&&(f=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=f,this.details=null,b.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},h.onMediaAttaching=function(n,t){var f=this.media=t.media;if(f&&o){var v=this.mediaSource=new o;v.addEventListener("sourceopen",this._onMediaSourceOpen),v.addEventListener("sourceended",this._onMediaSourceEnded),v.addEventListener("sourceclose",this._onMediaSourceClose),f.src=self.URL.createObjectURL(v),this._objectUrl=f.src}},h.onMediaDetaching=function(){var n=this.media,t=this.mediaSource,f=this._objectUrl;if(t){if(b.logger.log("[buffer-controller]: media source detaching"),t.readyState==="open")try{t.endOfStream()}catch(v){b.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&&(f&&self.URL.revokeObjectURL(f),n.src===f?(n.removeAttribute("src"),n.load()):b.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)},h.onBufferReset=function(){var n=this;this.getSourceBufferTypes().forEach(function(t){var f=n.sourceBuffer[t];try{f&&(n.removeBufferListeners(t),n.mediaSource&&n.mediaSource.removeSourceBuffer(f),n.sourceBuffer[t]=void 0)}catch(v){b.logger.warn("[buffer-controller]: Failed to reset the "+t+" buffer",v)}}),this._initSourceBuffer()},h.onBufferCodecs=function(n,t){var f=this,v=this.getSourceBufferTypes().length;if(Object.keys(t).forEach(function(m){if(v){var _=f.tracks[m];if(_&&typeof _.buffer.changeType=="function"){var E=t[m],g=E.codec,y=E.levelCodec,x=E.container,l=(_.levelCodec||_.codec).replace(a,"$1"),S=(y||g).replace(a,"$1");if(l!==S){var O=x+";codecs="+(y||g);f.appendChangeType(m,O)}}}else f.pendingTracks[m]=t[m]}),v)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},h.appendChangeType=function(n,t){var f=this,v=this.operationQueue,m={execute:function(){var E=f.sourceBuffer[n];E&&(b.logger.log("[buffer-controller]: changing "+n+" sourceBuffer type to "+t),E.changeType(t)),v.shiftAndExecuteNext(n)},onStart:function(){},onComplete:function(){},onError:function(E){b.logger.warn("[buffer-controller]: Failed to change "+n+" SourceBuffer type",E)}};v.append(m,n)},h.onBufferAppending=function(n,t){var f=this,v=this.hls,m=this.operationQueue,_=this.tracks,E=t.data,g=t.type,y=t.frag,x=t.part,l=t.chunkMeta,S=l.buffering[g],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=_.audio,B=g==="audio"&&l.id===1&&(I==null?void 0:I.container)==="audio/mpeg",H={execute:function(){if(S.executeStart=self.performance.now(),B){var W=f.sourceBuffer[g];if(W){var V=y.start-W.timestampOffset;Math.abs(V)>=.1&&(b.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+y.start+" (delta: "+V+") sn: "+y.sn+")"),W.timestampOffset=y.start)}}f.appendExecutor(E,g)},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=f.sourceBuffer,X={};for(var ne in V)X[ne]=C.BufferHelper.getBuffered(V[ne]);f.appendError=0,f.hls.trigger(P.Events.BUFFER_APPENDED,{type:g,frag:y,part:x,chunkMeta:l,parent:y.type,timeRanges:X})},onError:function(W){b.logger.error("[buffer-controller]: Error encountered while trying to append to the "+g+" 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:(f.appendError++,V.details=T.ErrorDetails.BUFFER_APPEND_ERROR,f.appendError>v.config.appendErrorMaxRetry&&(b.logger.error("[buffer-controller]: Failed "+v.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),V.fatal=!0)),v.trigger(P.Events.ERROR,V)}};m.append(H,g)},h.onBufferFlushing=function(n,t){var f=this,v=this.operationQueue,m=function(E){return{execute:f.removeExecutor.bind(f,E,t.startOffset,t.endOffset),onStart:function(){},onComplete:function(){f.hls.trigger(P.Events.BUFFER_FLUSHED,{type:E})},onError:function(y){b.logger.warn("[buffer-controller]: Failed to remove from "+E+" SourceBuffer",y)}}};t.type?v.append(m(t.type),t.type):this.getSourceBufferTypes().forEach(function(_){v.append(m(_),_)})},h.onFragParsed=function(n,t){var f=this,v=t.frag,m=t.part,_=[],E=m?m.elementaryStreams:v.elementaryStreams;E[p.ElementaryStreamTypes.AUDIOVIDEO]?_.push("audiovideo"):(E[p.ElementaryStreamTypes.AUDIO]&&_.push("audio"),E[p.ElementaryStreamTypes.VIDEO]&&_.push("video"));var g=function(){var x=self.performance.now();v.stats.buffering.end=x,m&&(m.stats.buffering.end=x);var l=m?m.stats:v.stats;f.hls.trigger(P.Events.FRAG_BUFFERED,{frag:v,part:m,stats:l,id:v.type})};_.length===0&&b.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+v.type+" level: "+v.level+" sn: "+v.sn),this.blockBuffers(g,_)},h.onFragChanged=function(n,t){this.flushBackBuffer()},h.onBufferEos=function(n,t){var f=this,v=this.getSourceBufferTypes().reduce(function(m,_){var E=f.sourceBuffer[_];return(!t.type||t.type===_)&&(E&&!E.ended&&(E.ended=!0,b.logger.log("[buffer-controller]: "+_+" sourceBuffer now EOS"))),m&&!!(!E||E.ended)},!0);v&&this.blockBuffers(function(){var m=f.mediaSource;if(!m||m.readyState!=="open")return;m.endOfStream()})},h.onLevelUpdated=function(n,t){var f=t.details;if(!f.fragments.length)return;this.details=f,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},h.flushBackBuffer=function(){var n=this.hls,t=this.details,f=this.media,v=this.sourceBuffer;if(!f||t===null)return;var m=this.getSourceBufferTypes();if(!m.length)return;var _=t.live&&n.config.liveBackBufferLength!==null?n.config.liveBackBufferLength:n.config.backBufferLength;if(!Object(w.isFiniteNumber)(_)||_<0)return;var E=f.currentTime,g=t.levelTargetDuration,y=Math.max(_,g),x=Math.floor(E/g)*g-y;m.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}))}})},h.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var n=this.details,t=this.hls,f=this.media,v=this.mediaSource,m=n.fragments[0].start+n.totalduration,_=f.duration,E=Object(w.isFiniteNumber)(v.duration)?v.duration:0;n.live&&t.config.liveDurationInfinity?(b.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),v.duration=Infinity,this.updateSeekableRange(n)):(m>E&&m>_||!Object(w.isFiniteNumber)(_))&&(b.logger.log("[buffer-controller]: Updating Media Source duration to "+m.toFixed(3)),v.duration=m)},h.updateSeekableRange=function(n){var t=this.mediaSource,f=n.fragments,v=f.length;if(v&&n.live&&t!==null&&t!==void 0&&t.setLiveSeekableRange){var m=Math.max(0,f[0].start),_=Math.max(m,m+n.totalduration);t.setLiveSeekableRange(m,_)}},h.checkPendingTracks=function(){var n=this.bufferCodecEventsExpected,t=this.operationQueue,f=this.pendingTracks,v=Object.keys(f).length;if(v&&!n||v===2){this.createSourceBuffers(f),this.pendingTracks={};var m=this.getSourceBufferTypes();if(m.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}m.forEach(function(_){t.executeNext(_)})}},h.createSourceBuffers=function(n){var t=this.sourceBuffer,f=this.mediaSource;if(!f)throw Error("createSourceBuffers called when mediaSource was null");var v=0;for(var m in n)if(!t[m]){var _=n[m];if(!_)throw Error("source buffer exists for track "+m+", however track does not");var E=_.levelCodec||_.codec,g=_.container+";codecs="+E;b.logger.log("[buffer-controller]: creating sourceBuffer("+g+")");try{var y=t[m]=f.addSourceBuffer(g),x=m;this.addBufferListener(x,"updatestart",this._onSBUpdateStart),this.addBufferListener(x,"updateend",this._onSBUpdateEnd),this.addBufferListener(x,"error",this._onSBUpdateError),this.tracks[m]={buffer:y,codec:E,container:_.container,levelCodec:_.levelCodec,id:_.id},v++}catch(l){b.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:g})}}v&&this.hls.trigger(P.Events.BUFFER_CREATED,{tracks:this.tracks})},h._onSBUpdateStart=function(n){var t=this.operationQueue,f=t.current(n);f.onStart()},h._onSBUpdateEnd=function(n){var t=this.operationQueue,f=t.current(n);f.onComplete(),t.shiftAndExecuteNext(n)},h._onSBUpdateError=function(n,t){b.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 f=this.operationQueue.current(n);f&&f.onError(t)},h.removeExecutor=function(n,t,f){var v=this.media,m=this.mediaSource,_=this.operationQueue,E=this.sourceBuffer,g=E[n];if(!v||!m||!g){b.logger.warn("[buffer-controller]: Attempting to remove from the "+n+" SourceBuffer, but it does not exist"),_.shiftAndExecuteNext(n);return}var y=Object(w.isFiniteNumber)(v.duration)?v.duration:Infinity,x=Object(w.isFiniteNumber)(m.duration)?m.duration:Infinity,l=Math.max(0,t),S=Math.min(f,y,x);S>l?(b.logger.log("[buffer-controller]: Removing ["+l+","+S+"] from the "+n+" SourceBuffer"),console.assert(!g.updating,n+" sourceBuffer must not be updating"),g.remove(l,S)):_.shiftAndExecuteNext(n)},h.appendExecutor=function(n,t){var f=this.operationQueue,v=this.sourceBuffer,m=v[t];if(!m){b.logger.warn("[buffer-controller]: Attempting to append to the "+t+" SourceBuffer, but it does not exist"),f.shiftAndExecuteNext(t);return}m.ended=!1,console.assert(!m.updating,t+" sourceBuffer must not be updating"),m.appendBuffer(n)},h.blockBuffers=function(n,t){var f=this;if(t===void 0&&(t=this.getSourceBufferTypes()),!t.length){b.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(n);return}var v=this.operationQueue,m=t.map(function(_){return v.appendBlocker(_)});Promise.all(m).then(function(){n(),t.forEach(function(_){var E=f.sourceBuffer[_];(!E||!E.updating)&&v.shiftAndExecuteNext(_)})})},h.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},h.addBufferListener=function(n,t,f){var v=this.sourceBuffer[n];if(!v)return;var m=f.bind(this,n);this.listeners[n].push({event:t,listener:m}),v.addEventListener(t,m)},h.removeBufferListeners=function(n){var t=this.sourceBuffer[n];if(!t)return;this.listeners[n].forEach(function(f){t.removeEventListener(f.event,f.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 b(C){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=C}var T=b.prototype;return T.append=function(c,p){var d=this.queues[p];d.push(c),d.length===1&&this.buffers[p]&&this.executeNext(p)},T.insertAbort=function(c,p){var d=this.queues[p];d.unshift(c),this.executeNext(p)},T.appendBlocker=function(c){var p,d=new Promise(function(a){p=a}),o={execute:p,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(o,c),d},T.executeNext=function(c){var p=this.buffers,d=this.queues,o=p[c],a=d[c];if(a.length){var u=a[0];try{u.execute()}catch(s){w.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),u.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]},b}()},"./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 d=this.hls.levels;if(d.length){var o=this.hls;o.autoLevelCapping=this.getMaxLevel(d.length-1),o.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=o.autoLevelCapping}}},c.getMaxLevel=function(d){var o=this,a=this.hls.levels;if(!a.length)return-1;var u=a.filter(function(s,h){return C.isLevelAllowed(h,o.restrictedLevels)&&h<=d});return this.clientRect=null,C.getMaxLevelByMediaSize(u,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 d=this.media,o={width:0,height:0};if(d){var a=d.getBoundingClientRect();o.width=a.width,o.height=a.height,!o.width&&!o.height&&(o.width=a.right-a.left||d.width||0,o.height=a.bottom-a.top||d.height||0)}return this.clientRect=o,o},C.isLevelAllowed=function(d,o){return o===void 0&&(o=[]),o.indexOf(d)===-1},C.getMaxLevelByMediaSize=function(d,o,a){if(!d||!d.length)return-1;for(var u=function(t,f){return f?t.width!==f.width||t.height!==f.height:!0},s=d.length-1,h=0;h=o||i.height>=a)&&u(i,d[h+1])){s=h;break}}return s},b(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 d=1;try{d=self.devicePixelRatio}catch(o){}return d}}]),C}();Q.default=T},"./src/controller/cmcd-controller.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"default",function(){return u});var w=j("./src/events.ts"),P=j("./src/types/cmcd.ts"),b=j("./src/utils/buffer-helper.ts"),T=j("./src/utils/logger.ts");function C(s,h){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 d(s,h){if(!s)return;if(typeof s=="string")return o(s,h);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,h)}function o(s,h){(h==null||h>s.length)&&(h=s.length);for(var i=0,n=new Array(h);it&&(t=_.bitrate)}return t>0?t:NaN},h.getBufferLength=function(n){var t=this.hls.media,f=n===P.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!f||!t)return NaN;var v=b.BufferHelper.bufferInfo(f,t.currentTime,this.config.maxBufferHole);return v.len*1e3},h.createPlaylistLoader=function(){var n=this.config.pLoader,t=this.applyPlaylistData,f=n||this.config.loader;return function(){function v(_){this.loader=void 0,this.loader=new f(_)}var m=v.prototype;return m.destroy=function(){this.loader.destroy()},m.abort=function(){this.loader.abort()},m.load=function(E,g,y){t(E),this.loader.load(E,g,y)},c(v,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),v}()},h.createFragmentLoader=function(){var n=this.config.fLoader,t=this.applyFragmentData,f=n||this.config.loader;return function(){function v(_){this.loader=void 0,this.loader=new f(_)}var m=v.prototype;return m.destroy=function(){this.loader.destroy()},m.abort=function(){this.loader.abort()},m.load=function(E,g,y){t(E),this.loader.load(E,g,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=[],f=function(B){return!Number.isNaN(B)&&B!=null&&B!==""&&B!==!1},v=function(B){return Math.round(B)},m=function(B){return v(B/100)*100},_=function(B){return encodeURIComponent(B)},E={br:v,d:v,bl:m,dl:m,mtp:m,nor:_,rtp:m,tb:v},g=Object.keys(n||{}).sort(),y=p(g),x;!(x=y()).done;){var l=x.value,S=n[l];if(!f(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),f={},v=["Object","Request","Session","Status"],m=[{},{},{},{}],_={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,g=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 _=p-this._requestLicenseFailureCount+1;b.logger.warn("Retrying license request, "+_+" attempts left"),this._requestLicense(t,f)}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){b.logger.log("Requesting content license for key-system");var t=this._mediaKeysList[0];if(!t){b.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 f=this.getLicenseServerUrl(t.mediaKeySystemDomain),v=this._createLicenseXhr(f,i,n);b.logger.log("Sending license request to URL: "+f);var m=this._generateLicenseRequestChallenge(t,i);v.send(m)}catch(_){b.logger.error("Failure requesting DRM license: "+_),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}),f=n.levels.map(function(v){return v.videoCodec}).filter(function(v){return!!v});this._attemptKeySystemAccess(T.KeySystems.WIDEVINE,t,f)},c(u,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),u}();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"),b=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,d){var o=this.hls.config;if(o.capLevelOnFPSDrop){var a=d.media instanceof self.HTMLVideoElement?d.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,d,o){var a=performance.now();if(d){if(this.lastTime){var u=a-this.lastTime,s=o-this.lastDroppedFrames,h=d-this.lastDecodedFrames,i=1e3*s/u,n=this.hls;if(n.trigger(w.Events.FPS_DROP,{currentDropped:s,currentDecoded:h,totalDroppedFrames:o}),i>0&&s>n.config.fpsDroppedMonitoringThreshold*h){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=d}},C.checkFPSInterval=function(){var p=this.media;if(p)if(this.isVideoPlaybackQualityAvailable){var d=p.getVideoPlaybackQuality();this.checkFPS(p,d.totalVideoFrames,d.droppedVideoFrames)}else this.checkFPS(p,p.webkitDecodedFrameCount,p.webkitDroppedFrameCount)},T}();Q.default=b},"./src/controller/fragment-finders.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"findFragmentByPDT",function(){return b}),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 b(d,o,a){if(o===null||!Array.isArray(d)||!d.length||!Object(w.isFiniteNumber)(o))return null;var u=d[0].programDateTime;if(o<(u||0))return null;var s=d[d.length-1].endProgramDateTime;if(o>=(s||0))return null;a=a||0;for(var h=0;hd&&a.start?-1:0}function c(d,o,a){var u=Math.min(o,a.duration+(a.deltaPTS?a.deltaPTS:0))*1e3,s=a.endProgramDateTime||0;return s-u>d}function p(d,o){return P.default.search(d,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 b}),j.d(Q,"FragmentTracker",function(){return T});var w=j("./src/events.ts"),P=j("./src/types/loader.ts"),b;(function(p){p.NOT_LOADED="NOT_LOADED",p.BACKTRACKED="BACKTRACKED",p.APPENDING="APPENDING",p.PARTIAL="PARTIAL",p.OK="OK"})(b||(b={}));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 d=p.prototype;return d._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)},d._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)},d.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},d.getAppendedFrag=function(a,u){if(u===P.PlaylistLevelType.MAIN){var s=this.activeFragment,h=this.activeParts;if(!s)return null;if(h)for(var i=h.length;i--;){var n=h[i],t=n?n.end:s.appendedPTS;if(n.start<=a&&t!==void 0&&a<=t)return i>9&&(this.activeParts=h.slice(i-9)),n}else if(s.start<=a&&s.appendedPTS!==void 0&&a<=s.appendedPTS)return s}return this.getBufferedFrag(a,u)},d.getBufferedFrag=function(a,u){for(var s=this.fragments,h=Object.keys(s),i=h.length;i--;){var n=s[h[i]];if((n==null?void 0:n.body.type)===u&&n.buffered){var t=n.body;if(t.start<=a&&a<=t.end)return t}}return null},d.detectEvictedFragments=function(a,u,s){var h=this;Object.keys(this.fragments).forEach(function(i){var n=h.fragments[i];if(!n)return;if(!n.buffered){n.body.type===s&&h.removeFragment(n.body);return}var t=n.range[a];if(!t)return;t.time.some(function(f){var v=!h.isTimeBuffered(f.startPTS,f.endPTS,u);return v&&h.removeFragment(n.body),v})})},d.detectPartialFragments=function(a){var u=this,s=this.timeRanges,h=a.frag,i=a.part;if(!s||h.sn==="initSegment")return;var n=c(h),t=this.fragments[n];if(!t)return;Object.keys(s).forEach(function(f){var v=h.elementaryStreams[f];if(!v)return;var m=s[f],_=i!==null||v.partial===!0;t.range[f]=u.getBufferedTimes(h,i,_,m)}),t.backtrack=t.loaded=null,Object.keys(t.range).length?t.buffered=!0:this.removeFragment(t.body)},d.fragBuffered=function(a){var u=c(a),s=this.fragments[u];s&&(s.backtrack=s.loaded=null,s.buffered=!0)},d.getBufferedTimes=function(a,u,s,h){for(var i={time:[],partial:s},n=u?u.start:a.start,t=u?u.end:a.end,f=a.minEndPTS||t,v=a.maxStartPTS||n,m=0;m=_&&f<=E){i.time.push({startPTS:Math.max(n,h.start(m)),endPTS:Math.min(t,h.end(m))});break}else if(n_)i.partial=!0,i.time.push({startPTS:Math.max(n,h.start(m)),endPTS:Math.min(t,h.end(m))});else if(t<=_)break}return i},d.getPartialFragment=function(a){var u=null,s,h,i,n=0,t=this.bufferPadding,f=this.fragments;return Object.keys(f).forEach(function(v){var m=f[v];if(!m)return;C(m)&&(h=m.body.start-t,i=m.body.end+t,a>=h&&a<=i&&(s=Math.min(a-h,i-a),n<=s&&(u=m.body,n=s)))}),u},d.getState=function(a){var u=c(a),s=this.fragments[u];return s?s.buffered?C(s)?b.PARTIAL:b.OK:s.backtrack?b.BACKTRACKED:b.APPENDING:b.NOT_LOADED},d.backtrack=function(a,u){var s=c(a),h=this.fragments[s];if(!h||h.backtrack)return null;var i=h.backtrack=u||h.loaded;return h.loaded=null,i},d.getBacktrackData=function(a){var u=c(a),s=this.fragments[u];if(s){var h,i=s.backtrack;if(i!=null&&(h=i.payload)!==null&&h!==void 0&&h.byteLength)return i;this.removeFragment(a)}return null},d.isTimeBuffered=function(a,u,s){for(var h,i,n=0;n=h&&u<=i)return!0;if(u<=h)return!1}return!1},d.onFragLoaded=function(a,u){var s=u.frag,h=u.part;if(s.sn==="initSegment"||s.bitrateTest||h)return;var i=c(s);this.fragments[i]={body:s,loaded:u,backtrack:null,buffered:!1,range:Object.create(null)}},d.onBufferAppended=function(a,u){var s=this,h=u.frag,i=u.part,n=u.timeRanges;if(h.type===P.PlaylistLevelType.MAIN)if(this.activeFragment=h,i){var t=this.activeParts;t||(this.activeParts=t=[]),t.push(i)}else this.activeParts=null;this.timeRanges=n,Object.keys(n).forEach(function(f){var v=n[f];if(s.detectEvictedFragments(f,v),!i)for(var m=0;ma&&h.removeFragment(t)}})},d.removeFragment=function(a){var u=c(a);a.stats.loaded=0,a.clearElementaryStreamInfo(),delete this.fragments[u]},d.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},p}();function C(p){var d,o;return p.buffered&&(((d=p.range.video)===null||d===void 0?void 0:d.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 d}),j.d(Q,"default",function(){return o});var w=j("./src/utils/buffer-helper.ts"),P=j("./src/errors.ts"),b=j("./src/events.ts"),T=j("./src/utils/logger.ts"),C=250,c=2,p=.1,d=.05,o=function(){function a(s,h,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=h,this.fragmentTracker=i,this.hls=n}var u=a.prototype;return u.destroy=function(){this.hls=this.fragmentTracker=this.media=null},u.poll=function(h){var i=this.config,n=this.media,t=this.stalled,f=n.currentTime,v=n.seeking,m=this.seeking&&!v,_=!this.seeking&&v;if(this.seeking=v,f!==h){if(this.moved=!0,t!==null){if(this.stallReported){var E=self.performance.now()-t;T.logger.warn("playback not stuck anymore @"+f+", after "+Math.round(E)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((_||m)&&(this.stalled=null),n.paused||n.ended||n.playbackRate===0||!w.BufferHelper.getBuffered(n).length)return;var g=w.BufferHelper.bufferInfo(n,f,0),y=g.len>0,x=g.nextStart||0;if(!y&&!x)return;if(v){var l=g.len>c,S=!x||x-f>c&&!this.fragmentTracker.getPartialFragment(f);if(l||S)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var O,A=Math.max(x,g.start||0)-f,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(g.len);var W=w.BufferHelper.bufferInfo(n,f,i.maxBufferHole);this._tryFixBufferStall(W,te)},u._tryFixBufferStall=function(h,i){var n=this.config,t=this.fragmentTracker,f=this.media,v=f.currentTime,m=t.getPartialFragment(v);if(m){var _=this._trySkipBufferHole(m);if(_)return}h.len>n.maxBufferHole&&i>n.highBufferWatchdogPeriod*1e3&&(T.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},u._reportStall=function(h){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="+h+")"),i.trigger(b.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:h}))},u._trySkipBufferHole=function(h){for(var i=this.config,n=this.hls,t=this.media,f=t.currentTime,v=0,m=w.BufferHelper.getBuffered(t),_=0;_=v&&f.05&&this.forwardBufferLength>1){var _=Math.min(2,Math.max(1,n)),E=Math.round(2/(1+Math.exp(-.75*f-this.edgeStalled))*20)/20;a.playbackRate=Math.min(_,Math.max(1,E))}else a.playbackRate!==1&&a.playbackRate!==0&&(a.playbackRate=1)},d.estimateLiveEdge=function(){var a=this.levelDetails;return a===null?null:a.edge+a.age},d.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,u=this.levelDetails;return a.liveMaxLatencyDuration!==void 0?a.liveMaxLatencyDuration:u?a.liveMaxLatencyDurationCount*u.targetduration:0}},{key:"targetLatency",get:function(){var a=this.levelDetails;if(a===null)return null;var u=a.holdBack,s=a.partHoldBack,h=a.targetduration,i=this.config,n=i.liveSyncDuration,t=i.liveSyncDurationCount,f=i.lowLatencyMode,v=this.hls.userConfig,m=f&&s||u;(v.liveSyncDuration||v.liveSyncDurationCount||m===0)&&(m=n!==void 0?n:t*h);var _=h,E=1;return m+Math.min(this.stallCount*E,_)}},{key:"liveSyncPosition",get:function(){var a=this.estimateLiveEdge(),u=this.targetLatency,s=this.levelDetails;if(a===null||u===null||s===null)return null;var h=s.edge,i=a-u-this.edgeStalled,n=h-s.totalduration,t=h-(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 u=(this.config.lowLatencyMode&&a.partTarget||a.targetduration)*3;return Math.max(a.age-u,0)}},{key:"forwardBufferLength",get:function(){var a=this.media,u=this.levelDetails;if(!a||!u)return 0;var s=a.buffered.length;return s?a.buffered.end(s-1):u.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"),b=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 d(){return d=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=_.frag.level)):l=_.frag.level}break;case b.ErrorDetails.LEVEL_LOAD_ERROR:case b.ErrorDetails.LEVEL_LOAD_TIMEOUT:E&&(E.deliveryDirectives&&(x=!1),l=E.level),y=!0;break;case b.ErrorDetails.REMUX_ALLOC_ERROR:l=_.level,y=!0;break}l!==void 0&&this.recoverLevel(_,l,y,x)},f.recoverLevel=function(m,_,E,g){var y=m.details,x=this._levels[_];if(x.loadError++,E){var l=this.retryLoadingOrFail(m);if(l)m.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(g){var S=x.url.length;if(S>1&&x.loadError1){var g=(_.urlId+1)%E;this.warn("Switching to redundant URL-id "+g),this._levels.forEach(function(y){y.urlId=g}),this.level=m}},f.onFragLoaded=function(m,_){var E=_.frag;if(E!==void 0&&E.type===p.PlaylistLevelType.MAIN){var g=this._levels[E.level];g!==void 0&&(g.fragmentError=0,g.loadError=0)}},f.onLevelLoaded=function(m,_){var E,g=_.level,y=_.details,x=this._levels[g];if(!x){var l;this.warn("Invalid level index "+g),(l=_.deliveryDirectives)!==null&&l!==void 0&&l.skip&&(y.deltaUpdateFailed=!0);return}g===this.currentLevelIndex?(x.fragmentError===0&&(x.loadError=0,this.retryCount=0),this.playlistLoaded(g,_,x.details)):(E=_.deliveryDirectives)!==null&&E!==void 0&&E.skip&&(y.deltaUpdateFailed=!0)},f.onAudioTrackSwitched=function(m,_){var E=this.hls.levels[this.currentLevelIndex];if(!E)return;if(E.audioGroupIds){for(var g=-1,y=this.hls.audioTracks[_.id].groupId,x=0;x0){var g=E.urlId,y=E.url[g];if(m)try{y=m.addDirectives(y)}catch(x){this.warn("Could not construct new URL with HLS Delivery Directives: "+x)}this.log("Attempt loading level index "+_+(m?" at sn "+m.msn+" part "+m.part:"")+" with URL-id "+g+" "+y),this.clearTimer(),this.hls.trigger(P.Events.LEVEL_LOADING,{url:y,level:_,id:g,deliveryDirectives:m||null})}},f.removeLevel=function(m,_){var E=function(x,l){return l!==_},g=this._levels.filter(function(y,x){return x!==m?!0:y.url.length>1&&_!==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=g,this.hls.trigger(P.Events.LEVELS_UPDATED,{levels:g})},a(t,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(m){var _,E=this._levels;if(E.length===0)return;if(this.currentLevelIndex===m&&(_=E[m])!==null&&_!==void 0&&_.details)return;if(m<0||m>=E.length){var g=m<0;if(this.hls.trigger(P.Events.ERROR,{type:b.ErrorTypes.OTHER_ERROR,details:b.ErrorDetails.LEVEL_SWITCH_ERROR,level:m,fatal:g,reason:"invalid level idx"}),g)return;m=Math.min(m,E.length-1)}this.clearTimer();var y=this.currentLevelIndex,x=E[y],l=E[m];this.log("switching to level "+m+" from "+y),this.currentLevelIndex=m;var S=d({},l,{level:m,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(m){this.manualLevelIndex=m,this._startLevel===void 0&&(this._startLevel=m),m!==-1&&(this.level=m)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(m){this._firstLevel=m}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var m=this.hls.config.startLevel;return m!==void 0?m:this._firstLevel}else return this._startLevel},set:function(m){this._startLevel=m}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(m){this.level=m,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=m)}}]),t}(c.default)},"./src/controller/level-helper.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"addGroupId",function(){return b}),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 d}),j.d(Q,"mapPartIntersection",function(){return o}),j.d(Q,"mapFragmentIntersection",function(){return a}),j.d(Q,"adjustSliding",function(){return u}),j.d(Q,"addSliding",function(){return s}),j.d(Q,"computeReloadInterval",function(){return h}),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 b(t,f,v){switch(f){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 f={};t.forEach(function(v){var m=v.groupId||"";v.id=f[m]=f[m]||0,f[m]++})}function C(t,f,v){var m=t[f],_=t[v];c(m,_)}function c(t,f){var v=f.startPTS;if(Object(w.isFiniteNumber)(v)){var m=0,_;f.sn>t.sn?(m=v-t.start,_=t):(m=t.start-v,_=f),_.duration!==m&&(_.duration=m)}else if(f.sn>t.sn){var E=t.cc===f.cc;E&&t.minEndPTS?f.start=t.start+(t.minEndPTS-t.start):f.start=t.start+t.duration}else f.start=Math.max(t.start-f.duration,0)}function p(t,f,v,m,_,E){var g=m-v;g<=0&&(P.logger.warn("Fragment should have a positive duration",f),m=v+f.duration,E=_+f.duration);var y=v,x=m,l=f.startPTS,S=f.endPTS;if(Object(w.isFiniteNumber)(l)){var O=Math.abs(l-v);Object(w.isFiniteNumber)(f.deltaPTS)?f.deltaPTS=Math.max(O,f.deltaPTS):f.deltaPTS=O,y=Math.max(v,l),v=Math.min(v,l),_=Math.min(_,f.startDTS),x=Math.min(m,S),m=Math.max(m,S),E=Math.max(E,f.endDTS)}f.duration=m-v;var A=v-f.start;f.appendedPTS=m,f.start=f.startPTS=v,f.maxStartPTS=y,f.startDTS=_,f.endPTS=m,f.minEndPTS=x,f.endDTS=E;var D=f.sn;if(!t||Dt.endSN)return 0;var I,B=D-t.startSN,H=t.fragments;for(H[B]=f,I=B;I>0;I--)c(H[I],H[I-1]);for(I=B;I=0;_--){var E=m[_].initSegment;if(E){v=E;break}}t.fragmentHint&&delete t.fragmentHint.endPTS;var g=0,y;if(a(t,f,function(I,B){I.relurl&&(g=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),f.PTSKnown=f.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=f.fragmentHint?f.fragments.concat(f.fragmentHint):f.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(f.skippedSegments&&(f.deltaUpdateFailed=f.fragments.some(function(I){return!I}),f.deltaUpdateFailed)){P.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var l=f.skippedSegments;l--;)f.fragments.shift();f.startSN=f.fragments[0].sn,f.startCC=f.fragments[0].cc}var S=f.fragments;if(g){P.logger.warn("discontinuity sliding from playlist, take drift into account");for(var O=0;O=m.length)return;s(f,m[v].start)}function s(t,f){if(f){for(var v=t.fragments,m=t.skippedSegments;m0&&_0&&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},g.stopLoad=function(){this._forceStartLoad=!1,_.prototype.stopLoad.call(this)},g.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()},g.onTickEnd=function(){_.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},g.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 Y=W.end,ee=this.getNextFragment(Y,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>Y){var de=this.audioOnly&&!this.altAudio?d.ElementaryStreamTypes.AUDIO:d.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,Y)},g.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,_.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()},g.getAppendedFrag=function(x){var l=this.fragmentTracker.getAppendedFrag(x,p.PlaylistLevelType.MAIN);return l&&"fragment"in l?l.fragment:l},g.getBufferedFrag=function(x){return this.fragmentTracker.getBufferedFrag(x,p.PlaylistLevelType.MAIN)},g.followingBufferedFrag=function(x){return x?this.getBufferedFrag(x.end+.5):null},g.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},g.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)}}}},g.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()},g.flushMainBuffer=function(x,l){_.prototype.flushMainBuffer.call(this,x,l,this.altAudio?"video":null)},g.onMediaAttached=function(x,l){_.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 u.default(this.config,S,this.fragmentTracker,this.hls)},g.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),_.prototype.onMediaDetaching.call(this)},g.onMediaPlaying=function(){this.tick()},g.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()},g.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},g.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(b.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},g.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)},g.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()},g._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,Y=ne!==-1,ee=new a.ChunkMetadata(S.level,S.sn,S.stats.chunkCount,A.byteLength,ne,Y),ce=this.initPTS[S.cc];X.push(A,W,V,H,S,O,B.totalduration,te,ee,ce)},g.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})}},g.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()},g.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},g.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)},g.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}},g.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},g.onFragLoadEmergencyAborted=function(){this.state=P.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},g.onBufferFlushed=function(x,l){var S=l.type;if(S!==d.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var O=(S===d.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(O,S,p.PlaylistLevelType.MAIN)}},g.onLevelsUpdated=function(x,l){this.levels=l.levels},g.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},g.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"),b=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"),d=j("./src/controller/base-stream-controller.ts"),o=j("./src/types/loader.ts"),a=j("./src/types/level.ts");function u(f,v){for(var m=0;m=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)},m.onBufferFlushing=function(E,g){var y=g.startOffset,x=g.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;g.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===d.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)}},m._handleFragmentLoadComplete=function(E){var g=E.frag,y=E.payload,x=g.decryptdata,l=this.hls;if(this.fragContextChanged(g))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:g,payload:O,stats:{tstart:S,tdecrypt:A}})})}},m.doTick=function(){if(!this.media){this.state=d.State.IDLE;return}if(this.state===d.State.IDLE){var E,g=this.currentTrackId,y=this.levels;if(!y.length||!y[g]||!y[g].details)return;var x=y[g].details,l=x.targetduration,S=this.config,O=this.media,A=b.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)},h.pollTrackChange=function(n){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,n)},h.onMediaDetaching=function(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId);var n=a(this.media.textTracks);n.forEach(function(t){Object(P.clearCurrentCues)(t)}),this.subtitleTrack=-1,this.media=null},h.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},h.onManifestParsed=function(n,t){this.tracks=t.subtitleTracks},h.onSubtitleTrackLoaded=function(n,t){var f=t.id,v=t.details,m=this.trackId,_=this.tracksInGroup[m];if(!_){this.warn("Invalid subtitle track id "+f);return}var E=_.details;_.details=t.details,this.log("subtitle track "+f+" loaded ["+v.startSN+"-"+v.endSN+"]"),f===this.trackId&&(this.retryCount=0,this.playlistLoaded(f,t,E))},h.onLevelLoading=function(n,t){this.switchLevel(t.level)},h.onLevelSwitching=function(n,t){this.switchLevel(t.level)},h.switchLevel=function(n){var t=this.hls.levels[n];if(!(t!=null&&t.textGroupIds))return;var f=t.textGroupIds[t.urlId];if(this.groupId!==f){var v=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,m=this.tracks.filter(function(g){return!f||g.groupId===f});this.tracksInGroup=m;var _=this.findTrackId(v==null?void 0:v.name)||this.findTrackId();this.groupId=f;var E={subtitleTracks:m};this.log("Updating subtitle tracks, "+m.length+' track(s) found in "'+f+'" group-id'),this.hls.trigger(w.Events.SUBTITLE_TRACKS_UPDATED,E),_!==-1&&this.setSubtitleTrack(_,v)}},h.findTrackId=function(n){for(var t=this.tracksInGroup,f=0;f=v.length)return;this.clearTimer();var m=v[n];if(this.log("Switching to subtitle track "+n),this.trackId=n,m){var _=m.id,E=m.groupId,g=E===void 0?"":E,y=m.name,x=m.type,l=m.url;this.hls.trigger(w.Events.SUBTITLE_TRACK_SWITCH,{id:_,groupId:g,name:y,type:x,url:l});var S=this.switchParams(m.url,t==null?void 0:t.details);this.loadPlaylist(S)}else this.hls.trigger(w.Events.SUBTITLE_TRACK_SWITCH,{id:n})},h.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),f=0;f=0&&(x[0]=Math.min(x[0],v),x[1]=Math.max(x[1],m),g=!0,l/(m-v)>.5))return}if(g||E.push([v,m]),this.config.renderTextTracksNatively){var S=this.captionsTracks[f];this.Cues.newCue(S,v,m,_)}else{var O=this.Cues.newCue(null,v,m,_);this.hls.trigger(P.Events.CUES_PARSED,{type:"captions",cues:O,track:f})}},n.onInitPtsFound=function(f,v){var m=this,_=v.frag,E=v.id,g=v.initPTS,y=v.timescale,x=this.unparsedVttFrags;E==="main"&&(this.initPTS[_.cc]=g,this.timescale[_.cc]=y),x.length&&(this.unparsedVttFrags=[],x.forEach(function(l){m.onFragLoaded(P.Events.FRAG_LOADED,l)}))},n.getExistingTrack=function(f){var v=this.media;if(v)for(var m=0;m>>8^y&255^99,p[_]=y,d[y]=_;var x=m[_],l=m[x],S=m[l],O=m[y]*257^y*16843008;a[_]=O<<24|O>>>8,u[_]=O<<16|O>>>16,s[_]=O<<8|O>>>24,h[_]=O,O=S*16843009^l*65537^x*257^_*16843008,n[y]=O<<24|O>>>8,t[y]=O<<16|O>>>16,f[y]=O<<8|O>>>24,v[y]=O,_?(_=x^m[m[m[S^x]]],E^=m[m[E]]):_=E=1}},C.expandKey=function(p){for(var d=this.uint8ArrayToUint32Array_(p),o=!0,a=0;a>>6)+1;var O=(f[v+2]&60)>>>2;if(O>S.length-1){t.trigger(b.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+O});return}return g=(f[v+2]&1)<<2,g|=(f[v+3]&192)>>>6,w.logger.log("manifest codec:"+m+", ADTS type:"+_+", samplingIndex:"+O),/firefox/i.test(x)?O>=6?(_=5,y=new Array(4),E=O-3):(_=2,y=new Array(2),E=O):x.indexOf("android")!==-1?(_=2,y=new Array(2),E=O):(_=5,y=new Array(4),m&&(m.indexOf("mp4a.40.29")!==-1||m.indexOf("mp4a.40.5")!==-1)||!m&&O>=6?E=O-3:((m&&m.indexOf("mp4a.40.2")!==-1&&(O>=6&&g===1||/vivaldi/i.test(x))||!m&&g===1)&&(_=2,y=new Array(2)),E=O)),y[0]=_<<3,y[0]|=(O&14)>>1,y[1]|=(O&1)<<7,y[1]|=g<<3,_===5&&(y[1]|=(E&14)>>1,y[2]=(E&1)<<7,y[2]|=2<<2,y[3]=0),{config:y,samplerate:S[O],channelCount:g,codec:"mp4a.40."+_,manifestCodec:l}}function C(t,f){return t[f]===255&&(t[f+1]&246)===240}function c(t,f){return t[f+1]&1?7:9}function p(t,f){return(t[f+3]&3)<<11|t[f+4]<<3|(t[f+5]&224)>>>5}function d(t,f){return f+5=t.length)return!1;var m=p(t,f);if(m<=v)return!1;var _=f+m;return _===t.length||o(t,_)}return!1}function s(t,f,v,m,_){if(!t.samplerate){var E=T(f,v,m,_);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 h(t){return 1024*9e4/t}function i(t,f,v,m,_){var E=c(t,f),g=p(t,f);if(g-=E,g>0){var y=v+m*_;return{headerLength:E,frameLength:g,stamp:y}}}function n(t,f,v,m,_){var E=h(t.samplerate),g=i(f,v,m,_,E);if(g){var y=g.frameLength,x=g.headerLength,l=g.stamp,S=x+y,O=Math.max(0,v+S-f.length),A;O?(A=new Uint8Array(S-x),A.set(f.subarray(v+x,f.length),0)):A=f.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"),b=j("./src/demux/dummy-demuxed-track.ts"),T=j("./src/utils/mp4-tools.ts"),C=j("./src/utils/typed-array.ts"),c=function(){function d(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var o=d.prototype;return o.resetInitSegment=function(u,s,h){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},o.resetTimeStamp=function(){},o.resetContiguity=function(){},o.canParse=function(u,s){return!1},o.appendFrame=function(u,s,h){},o.demux=function(u,s){this.cachedData&&(u=Object(T.appendUint8Array)(this.cachedData,u),this.cachedData=null);var h=P.getID3Data(u,0),i=h?h.length:0,n,t,f=this._audioTrack,v=this._id3Track,m=h?P.getTimeStamp(h):void 0,_=u.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=p(m,s)),h&&h.length>0&&v.samples.push({pts:this.initPTS,dts:this.initPTS,data:h}),t=this.initPTS;i<_;){if(this.canParse(u,i)){var E=this.appendFrame(f,u,i);E?(this.frameIndex++,t=E.sample.pts,i+=E.length,n=i):i=_}else P.canParse(u,i)?(h=P.getID3Data(u,i),v.samples.push({pts:t,dts:t,data:h}),i+=h.length,n=i):i++;if(i===_&&n!==_){var g=Object(C.sliceUint8)(u,n);this.cachedData?this.cachedData=Object(T.appendUint8Array)(this.cachedData,g):this.cachedData=g}}return{audioTrack:f,avcTrack:Object(b.dummyTrack)(),id3Track:v,textTrack:Object(b.dummyTrack)()}},o.demuxSampleAes=function(u,s,h){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},o.flush=function(u){var s=this.cachedData;return s&&(this.cachedData=null,this.demux(s,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(b.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(b.dummyTrack)()}},o.destroy=function(){},d}(),p=function(o,a){return Object(w.isFiniteNumber)(o)?o*90:a*9e4};Q.default=c},"./src/demux/chunk-cache.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"default",function(){return w});var w=function(){function b(){this.chunks=[],this.dataLength=0}var T=b.prototype;return T.push=function(c){this.chunks.push(c),this.dataLength+=c.length},T.flush=function(){var c=this.chunks,p=this.dataLength,d;if(c.length)c.length===1?d=c[0]:d=P(c,p);else return new Uint8Array(0);return this.reset(),d},T.reset=function(){this.chunks.length=0,this.dataLength=0},b}();function P(b,T){for(var C=new Uint8Array(T),c=0,p=0;pc?(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),d=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?d<>>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,d=8,o,a=0;a0?_.subarray(g,g+y):void 0},T=function(_,E){var g=0;return g=(_[E]&127)<<21,g|=(_[E+1]&127)<<14,g|=(_[E+2]&127)<<7,g|=_[E+3]&127,g},C=function(_,E){return w(_,E)&&T(_,E+6)+10<=_.length-E},c=function(_){for(var E=o(_),g=0;g>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=_[I++],D+=String.fromCharCode((S&31)<<6|O&63);break;case 14:O=_[I++],A=_[I++],D+=String.fromCharCode((S&15)<<12|(O&63)<<6|(A&63)<<0);break;default:}}return D},t={decodeTextFrame:s},f;function v(){return!f&&typeof self.TextDecoder!="undefined"&&(f=new self.TextDecoder("utf-8")),f}},"./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"),b=j("./src/utils/logger.ts"),T=j("./src/demux/mpegaudio.ts");function C(d,o){d.prototype=Object.create(o.prototype),d.prototype.constructor=d,c(d,o)}function c(d,o){return c=Object.setPrototypeOf||function(u,s){return u.__proto__=s,u},c(d,o)}var p=function(d){C(o,d);function o(){return d.apply(this,arguments)||this}var a=o.prototype;return a.resetInitSegment=function(s,h,i){d.prototype.resetInitSegment.call(this,s,h,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 h=P.getID3Data(s,0)||[],i=h.length,n=s.length;i0},C.demux=function(p){var d=p,o=Object(P.dummyTrack)();if(this.config.progressive){this.remainderData&&(d=Object(w.appendUint8Array)(this.remainderData,p));var a=Object(w.segmentValidRange)(d);this.remainderData=a.remainder,o.samples=a.valid||new Uint8Array}else o.samples=d;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,d,o){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},C.destroy=function(){},T}();b.minProbeByteLength=1024,Q.default=b},"./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 d}),j.d(Q,"isHeader",function(){return o}),j.d(Q,"canParse",function(){return a}),j.d(Q,"probe",function(){return u});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],b=[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,h,i,n,t){if(i+24>h.length)return;var f=p(h,i);if(f&&i+f.frameLength<=h.length){var v=f.samplesPerFrame*9e4/f.sampleRate,m=n+t*v,_={unit:h.subarray(i,i+f.frameLength),pts:m,dts:m};return s.config=[],s.channelCount=f.channelCount,s.samplerate=f.sampleRate,s.samples.push(_),{sample:_,length:f.frameLength,missing:0}}}function p(s,h){var i=s[h+1]>>3&3,n=s[h+1]>>1&3,t=s[h+2]>>4&15,f=s[h+2]>>2&3;if(i!==1&&t!==0&&t!==15&&f!==3){var v=s[h+2]>>1&1,m=s[h+3]>>6,_=i===3?3-n:n===3?3:4,E=P[_*14+t-1]*1e3,g=i===3?0:i===2?1:2,y=b[g*3+f],x=m===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&&m===0&&(s[h+3]=s[h+3]|128),{sampleRate:y,channelCount:x,frameLength:A,samplesPerFrame:O}}}function d(s,h){return s[h]===255&&(s[h+1]&224)===224&&(s[h+1]&6)!==0}function o(s,h){return h+1=p.length){o();return}if(p[d].unit.length<32)continue;var a=this.decrypter.isSync();if(this.decryptAacSample(p,d,o,a),!a)return}},C.getAvcEncryptedData=function(p){for(var d=Math.floor((p.length-48)/160)*16+16,o=new Int8Array(d),a=0,u=32;u<=p.length-16;u+=160,a+=16)o.set(p.subarray(u,u+16),a);return o},C.getAvcDecryptedUnit=function(p,d){for(var o=new Uint8Array(d),a=0,u=32;u<=p.length-16;u+=160,a+=16)p.set(o.subarray(a,a+16),u);return p},C.decryptAvcSample=function(p,d,o,a,u,s){var h=Object(P.discardEPB)(u.data),i=this.getAvcEncryptedData(h),n=this;this.decryptBuffer(i.buffer,function(t){u.data=n.getAvcDecryptedUnit(h,t),s||n.decryptAvcSamples(p,d,o+1,a)})},C.decryptAvcSamples=function(p,d,o,a){if(p instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;d++,o=0){if(d>=p.length){a();return}for(var u=p[d].units;!(o>=u.length);o++){var s=u[o];if(s.data.length<=48||s.type!==1&&s.type!==5)continue;var h=this.decrypter.isSync();if(this.decryptAvcSample(p,d,o,a,s,h),!h)return}}},T}();Q.default=b},"./src/demux/transmuxer-interface.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"default",function(){return u});var w=j("./node_modules/webworkify-webpack/index.js"),P=j.n(w),b=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"),d=j("./node_modules/eventemitter3/index.js"),o=j.n(d),a=Object(p.getMediaSource)()||{isTypeSupported:function(){return!1}},u=function(){function s(i,n,t,f){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=f;var m=i.config,_=function(l,S){S=S||{},S.frag=v.frag,S.id=v.id,i.trigger(l,S)};this.observer=new d.EventEmitter,this.observer.on(b.Events.FRAG_DECRYPTED,_),this.observer.on(b.Events.ERROR,_);var E={mp4:a.isTypeSupported("video/mp4"),mpeg:a.isTypeSupported("audio/mpeg"),mp3:a.isTypeSupported('audio/mp4; codecs="mp3"')},g=navigator.vendor;if(m.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(b.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:g,id:n,config:JSON.stringify(m)})}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,m,g,n),this.worker=null}}else this.transmuxer=new T.default(this.observer,E,m,g,n)}var h=s.prototype;return h.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 f=this.observer;f&&f.removeAllListeners(),this.observer=null},h.push=function(n,t,f,v,m,_,E,g,y,x){var l=this;y.transmuxing.start=self.performance.now();var S=this.transmuxer,O=this.worker,A=_?_.start:m.start,D=m.decryptdata,I=this.frag,B=!(I&&m.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||m.stats.parsing.start===0)&&(m.stats.parsing.start=X),_&&(W||!V)&&(_.stats.parsing.start=X);var ne=new T.TransmuxState(B,V,g,H,A);if(!V||B){C.logger.log("[transmuxer-interface, "+m.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: `+g+` timeOffset: `+A);var Y=new T.TransmuxConfig(f,v,t,E,x);this.configureTransmuxer(Y)}if(this.frag=m,this.part=_,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)}},h.flush=function(n){var t=this;n.transmuxing.start=self.performance.now();var f=this.transmuxer,v=this.worker;if(v)v.postMessage({cmd:"flush",chunkMeta:n});else if(f){var m=f.flush(n);Object(T.isPromise)(m)?m.then(function(_){t.handleFlushResult(_,n)}):this.handleFlushResult(m,n)}},h.handleFlushResult=function(n,t){var f=this;n.forEach(function(v){f.handleTransmuxComplete(v)}),this.onFlush(t)},h.onWorkerMessage=function(n){var t=n.data,f=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,f.trigger(t.event,t.data);break}}},h.configureTransmuxer=function(n){var t=this.worker,f=this.transmuxer;t?t.postMessage({cmd:"configure",config:n}):f&&f.configure(n)},h.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"),b=j("./src/utils/logger.ts"),T=j("./node_modules/eventemitter3/index.js"),C=j.n(T);function c(u){var s=new T.EventEmitter,h=function(n,t){u.postMessage({event:n,data:t})};s.on(P.Events.FRAG_DECRYPTED,h),s.on(P.Events.ERROR,h),u.addEventListener("message",function(i){var n=i.data;switch(n.cmd){case"init":{var t=JSON.parse(n.config);u.transmuxer=new w.default(s,n.typeSupported,t,n.vendor,n.id),Object(b.enableLogs)(t.debug),h("init",null);break}case"configure":{u.transmuxer.configure(n.config);break}case"demux":{var f=u.transmuxer.push(n.data,n.decryptdata,n.chunkMeta,n.state);Object(w.isPromise)(f)?f.then(function(_){p(u,_)}):p(u,f);break}case"flush":{var v=n.chunkMeta,m=u.transmuxer.flush(v);Object(w.isPromise)(m)?m.then(function(_){o(u,_,v)}):o(u,m,v);break}default:break}})}function p(u,s){if(a(s.remuxResult))return;var h=[],i=s.remuxResult,n=i.audio,t=i.video;n&&d(h,n),t&&d(h,t),u.postMessage({event:"transmuxComplete",data:s},h)}function d(u,s){s.data1&&u.push(s.data1.buffer),s.data2&&u.push(s.data2.buffer)}function o(u,s,h){s.forEach(function(i){p(u,i)}),u.postMessage({event:"flush",data:h})}function a(u){return!u.audio&&!u.video&&!u.text&&!u.id3&&!u.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 m}),j.d(Q,"TransmuxConfig",function(){return _}),j.d(Q,"TransmuxState",function(){return E});var w=j("./src/events.ts"),P=j("./src/errors.ts"),b=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"),d=j("./src/remux/mp4-remuxer.ts"),o=j("./src/remux/passthrough-remuxer.ts"),a=j("./src/demux/chunk-cache.ts"),u=j("./src/utils/mp4-tools.ts"),s=j("./src/utils/logger.ts"),h;try{h=self.performance.now.bind(self.performance)}catch(g){s.logger.debug("Unable to use Performance API on this environment"),h=self.Date.now}var i=[{demux:c.default,remux:d.default},{demux:C.default,remux:o.default},{demux:T.default,remux:d.default},{demux:p.default,remux:d.default}],n=1024;i.forEach(function(g){var y=g.demux;n=Math.max(n,y.minProbeByteLength)});var t=function(){function g(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=g.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=h();var B=new Uint8Array(l),H=this.cache,te=this.config,W=this.currentTransmuxState,V=this.transmuxConfig;A&&(this.currentTransmuxState=A);var X=f(B,S);if(X&&X.method==="AES-128"){var ne=this.getDecrypter();if(te.enableSoftwareAES){var Y=ne.softwareDecrypt(B,X.key.buffer,X.iv.buffer);if(!Y)return I.executeEnd=h(),v(O);B=new Uint8Array(Y)}else return this.decryptionPromise=ne.webCryptoDecrypt(B,X.key.buffer,X.iv.buffer).then(function(We){var ze=D.push(We,null,O);return D.decryptionPromise=null,ze}),this.decryptionPromise}var ee=A||W,ce=ee.contiguous,de=ee.discontinuity,Ce=ee.trackSwitch,Se=ee.accurateTimeOffset,Pe=ee.timeOffset,ye=V.audioCodec,Ee=V.videoCodec,Ge=V.defaultInitPts,Ue=V.duration,Fe=V.initSegmentData;if((de||Ce)&&this.resetInitSegment(Fe,ye,Ee,Ue),de&&this.resetInitialTimestamp(Ge),ce||this.resetContiguity(),this.needsProbing(B,de,Ce)){if(H.dataLength){var He=H.flush();B=Object(u.appendUint8Array)(He,B)}this.configureTransmuxer(B,V)}var be=this.transmux(B,X,Pe,Se,O),me=this.currentTransmuxState;return me.contiguous=!0,me.discontinuity=!1,me.trackSwitch=!1,I.executeEnd=h(),be},y.flush=function(l){var S=this,O=l.transmuxing;O.executeStart=h();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=h(),[v(l)];var Y=X.flush(te);return m(Y)?Y.then(function(ee){return S.flushRemux(H,ee,l),H}):(this.flushRemux(H,Y,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=h()},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,Y=i.length;ne0&&y!=null&&y.key!=null&&y.iv!==null&&y.method!=null&&(x=y),x}var v=function(y){return{remuxResult:{},chunkMeta:y}};function m(g){return"then"in g&&g.then instanceof Function}var _=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"),b=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"),d=j("./src/utils/logger.ts"),o=j("./src/errors.ts"),a={video:1,audio:2,id3:3,text:4},u=function(){function m(E,g,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=g,this.typeSupported=y}m.probe=function(g){var y=m.syncOffset(g);return y<0?!1:(y&&d.logger.warn("MPEG2-TS detected but first sync word found @ offset "+y+", junk ahead ?"),!0)},m.syncOffset=function(g){for(var y=Math.min(1e3,g.length-3*188),x=0;x>4,ye=void 0;if(Pe>1){if(ye=de+5+g[de+4],ye===de+188)continue}else ye=de+4;switch(Se){case I:Ce&&(B&&(S=n(B))&&this.parseAVCPES(S,!1),B={data:[],size:0}),B&&(B.data.push(g.subarray(ye,de+188)),B.size+=de+188-ye);break;case H:Ce&&(W&&(S=n(W))&&(A.isAAC?this.parseAACPES(S):this.parseMPEGPES(S)),W={data:[],size:0}),W&&(W.data.push(g.subarray(ye,de+188)),W.size+=de+188-ye);break;case te:Ce&&(V&&(S=n(V))&&this.parseID3PES(S),V={data:[],size:0}),V&&(V.data.push(g.subarray(ye,de+188)),V.size+=de+188-ye);break;case 0:Ce&&(ye+=g[ye]+1),Y=this._pmtId=h(g,ye);break;case Y:{Ce&&(ye+=g[ye]+1);var Ee=i(g,ye,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,x);I=Ee.avc,I>0&&(O.pid=I),H=Ee.audio,H>0&&(A.pid=H,A.isAAC=Ee.isAAC),te=Ee.id3,te>0&&(D.pid=te),X&&!ne&&(d.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 Ge={audioTrack:A,avcTrack:O,id3Track:D,textTrack:this._txtTrack};return l&&this.extractRemainingSamples(Ge),Ge},_.flush=function(){var g=this.remainderData;this.remainderData=null;var y;return g?y=this.demux(g,-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},_.extractRemainingSamples=function(g){var y=g.audioTrack,x=g.avcTrack,l=g.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&&d.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},_.demuxSampleAes=function(g,y,x){var l=this.demux(g,x,!0,!this.config.progressive),S=this.sampleAes=new C.default(this.observer,this.config,y);return this.decrypt(l,S)},_.decrypt=function(g,y){return new Promise(function(x){var l=g.audioTrack,S=g.avcTrack;l.samples&&l.isAAC?y.decryptAacSamples(l.samples,0,function(){S.samples?y.decryptAvcSamples(S.samples,0,0,function(){x(g)}):x(g)}):S.samples&&y.decryptAvcSamples(S.samples,0,0,function(){x(g)})})},_.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},_.parseAVCPES=function(g,y){var x=this,l=this._avcTrack,S=this.parseAVCNALu(g.data),O=!1,A=this.avcSample,D,I=!1;g.data=null,A&&S.length&&!l.audFound&&(t(A,l),A=this.avcSample=s(!1,g.pts,g.dts,"")),S.forEach(function(B){switch(B.type){case 1:{D=!0,A||(A=x.avcSample=s(!0,g.pts,g.dts,"")),O&&(A.debug+="NDR "),A.frame=!0;var H=B.data;if(I&&H.length>4){var te=new b.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,g.pts,g.dts,"")),O&&(A.debug+="IDR "),A.key=!0,A.frame=!0;break;case 6:{D=!0,O&&A&&(A.debug+="SEI ");var W=new b.default(v(B.data));W.readUByte();for(var V=0,X=0,ne=!1,Y=0;!ne&&W.bytesAvailable>1;){V=0;do Y=W.readUByte(),V+=Y;while(Y===255);X=0;do Y=W.readUByte(),X+=Y;while(Y===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(),Pe=W.readUByte(),ye=31&Se,Ee=[Se,Pe],Ge=0;Ge16){for(var Ue=[],Fe=0;Fe<16;Fe++)Ue.push(W.readUByte().toString(16)),(Fe===3||Fe===5||Fe===7||Fe===9)&&Ue.push("-");for(var He=X-16,be=new Uint8Array(He),me=0;me=0){var W={data:g.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(g.subarray(0,I),V.data.byteLength),V.data=X,V.state=0}}A=0&&l>=0){var ne={data:g.subarray(H,y),type:te,state:l};O.push(ne)}if(O.length===0){var Y=this.getLastNalUnit();if(Y){var ee=new Uint8Array(Y.data.byteLength+g.byteLength);ee.set(Y.data,0),ee.set(g,Y.data.byteLength),Y.data=ee}}return x.naluState=l,O},_.parseAACPES=function(g){var y=0,x=this._audioTrack,l=this.aacOverFlow,S=g.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(g=(E[4]<<8)+E[5],g&&g>m.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&&(d.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(m.size<=I)return null;m.size-=I;for(var B=new Uint8Array(m.size),H=0,te=S.length;HW){I-=W;continue}else E=E.subarray(I),W-=I,I=0;B.set(E,_),_+=W}return g&&(g-=y+3),{data:B,pts:x,dts:l,len:g}}return null}function t(m,_){if(m.units.length&&m.frame){if(m.pts===void 0){var E=_.samples,g=E.length;if(g){var y=E[g-1];m.pts=y.pts,m.dts=y.dts}else{_.dropped++;return}}_.samples.push(m)}m.debug.length&&d.logger.log(m.pts+"/"+m.dts+":"+m.debug)}function f(m,_){var E=m.length;if(E>0){if(_.pts>=m[E-1].pts)m.push(_);else for(var g=E-1;g>=0;g--)if(_.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 _.defaultConfig?_.defaultConfig:s.hlsDefaultConfig},set:function(y){_.defaultConfig=y}}]),_}();m.defaultConfig=void 0},"./src/is-supported.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"isSupported",function(){return b}),j.d(Q,"changeTypeSupported",function(){return T});var w=j("./src/utils/mediasource-helper.ts");function P(){return self.SourceBuffer||self.WebKitSourceBuffer}function b(){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"'),d=!c||c.prototype&&typeof c.prototype.appendBuffer=="function"&&typeof c.prototype.remove=="function";return!!p&&!!d}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 u}),j.d(Q,"LoadError",function(){return h});var w=j("./src/polyfills/number.ts"),P=j("./src/errors.ts");function b(i,n){i.prototype=Object.create(n.prototype),i.prototype.constructor=i,d(i,n)}function T(i){var n=typeof Map=="function"?new Map:void 0;return T=function(f){if(f===null||!p(f))return f;if(typeof f!="function")throw new TypeError("Super expression must either be null or a function");if(typeof n!="undefined"){if(n.has(f))return n.get(f);n.set(f,v)}function v(){return C(f,arguments,o(this).constructor)}return v.prototype=Object.create(f.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),d(v,f)},T(i)}function C(i,n,t){return c()?C=Reflect.construct:C=function(v,m,_){var E=[null];E.push.apply(E,m);var g=Function.bind.apply(v,E),y=new g;return _&&d(y,_.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 d(i,n){return d=Object.setPrototypeOf||function(f,v){return f.__proto__=v,f},d(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),u=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(f,v){var m=this,_=f.url;if(!_)return Promise.reject(new h({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:f,networkDetails:null},"Fragment does not have a "+(_?"part list":"url")));this.abort();var E=this.config,g=E.fLoader,y=E.loader;return new Promise(function(x,l){m.loader&&m.loader.destroy();var S=m.loader=f.loader=g?new g(E):new y(E),O=s(f),A={timeout:E.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:E.fragLoadingMaxRetryTimeout,highWaterMark:a};f.stats=S.stats,S.load(O,A,{onSuccess:function(I,B,H,te){m.resetLoader(f,S),x({frag:f,part:null,payload:I.data,networkDetails:te})},onError:function(I,B,H){m.resetLoader(f,S),l(new h({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:f,response:I,networkDetails:H}))},onAbort:function(I,B,H){m.resetLoader(f,S),l(new h({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:f,networkDetails:H}))},onTimeout:function(I,B,H){m.resetLoader(f,S),l(new h({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:f,networkDetails:H}))},onProgress:function(I,B,H,te){v&&v({frag:f,part:null,payload:H,networkDetails:te})}})})},n.loadPart=function(f,v,m){var _=this;this.abort();var E=this.config,g=E.fLoader,y=E.loader;return new Promise(function(x,l){_.loader&&_.loader.destroy();var S=_.loader=f.loader=g?new g(E):new y(E),O=s(f,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){_.resetLoader(f,S),_.updateStatsFromPart(f,v);var W={frag:f,part:v,payload:I.data,networkDetails:te};m(W),x(W)},onError:function(I,B,H){_.resetLoader(f,S),l(new h({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:f,part:v,response:I,networkDetails:H}))},onAbort:function(I,B,H){f.stats.aborted=v.stats.aborted,_.resetLoader(f,S),l(new h({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:f,part:v,networkDetails:H}))},onTimeout:function(I,B,H){_.resetLoader(f,S),l(new h({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:f,part:v,networkDetails:H}))}})})},n.updateStatsFromPart=function(f,v){var m=f.stats,_=v.stats,E=_.total;if(m.loaded+=_.loaded,E){var g=Math.round(f.duration/v.duration),y=Math.min(Math.round(m.loaded/E),g),x=g-y,l=x*Math.round(m.loaded/y);m.total=m.loaded+l}else m.total=Math.max(m.loaded,m.total);var S=m.loading,O=_.loading;S.start?S.first+=O.first-O.start:(S.start=O.start,S.first=O.first),S.end=O.end},n.resetLoader=function(f,v){f.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,f={frag:i,part:n,responseType:"arraybuffer",url:t.url,headers:{},rangeStart:0,rangeEnd:0},v=t.byteRangeStartOffset,m=t.byteRangeEndOffset;return Object(w.isFiniteNumber)(v)&&Object(w.isFiniteNumber)(m)&&(f.rangeStart=v,f.rangeEnd=m),f}var h=function(i){b(n,i);function n(t){for(var f,v=arguments.length,m=new Array(v>1?v-1:0),_=1;_>8*(15-E)&255;return _},f.setDecryptDataFromLevelKey=function(m,_){var E=m;return(m==null?void 0:m.method)==="AES-128"&&m.uri&&!m.iv&&(E=C.LevelKey.fromURI(m.uri),E.method=m.method,E.iv=this.createInitializationVector(_),E.keyFormat="identity"),E},f.setElementaryStreamInfo=function(m,_,E,g,y,x){x===void 0&&(x=!1);var l=this.elementaryStreams,S=l[m];if(!S){l[m]={startPTS:_,endPTS:E,startDTS:g,endDTS:y,partial:x};return}S.startPTS=Math.min(S.startPTS,_),S.endPTS=Math.max(S.endPTS,E),S.startDTS=Math.min(S.startDTS,g),S.endDTS=Math.max(S.endDTS,y)},f.clearElementaryStreamInfo=function(){var m=this.elementaryStreams;m[u.AUDIO]=null,m[u.VIDEO]=null,m[u.AUDIOVIDEO]=null},a(t,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var m=this.sn;typeof m!="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'),m=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,m)}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 m=Object(w.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+m*1e3}},{key:"encrypted",get:function(){var m;return!!((m=this.decryptdata)!==null&&m!==void 0&&m.keyFormat&&this.decryptdata.uri)}}]),t}(s),i=function(n){p(t,n);function t(f,v,m,_,E){var g;g=n.call(this,m)||this,g.fragOffset=0,g.duration=0,g.gap=!1,g.independent=!1,g.relurl=void 0,g.fragment=void 0,g.index=void 0,g.stats=new c.LoadStats,g.duration=f.decimalFloatingPoint("DURATION"),g.gap=f.bool("GAP"),g.independent=f.bool("INDEPENDENT"),g.relurl=f.enumeratedString("URI"),g.fragment=v,g.index=_;var y=f.enumeratedString("BYTERANGE");return y&&g.setByteRange(y,E),E&&(g.fragOffset=E.fragOffset+E.duration),g}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"),b=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 d in this.loaders){var o=this.loaders[d];o&&o.destroy()}this.loaders={}},c.onKeyLoading=function(d,o){var a=o.frag,u=a.type,s=this.loaders[u];if(!a.decryptdata){b.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var h=a.decryptdata.uri;if(h!==this.decrypturl||this.decryptkey===null){var i=this.hls.config;if(s&&(b.logger.warn("abort previous key loader for type:"+u),s.abort()),!h){b.logger.warn("key uri is falsy");return}var n=i.loader,t=a.loader=this.loaders[u]=new n(i);this.decrypturl=h,this.decryptkey=null;var f={url:h,frag:a,responseType:"arraybuffer"},v={timeout:i.fragLoadingTimeOut,maxRetry:0,retryDelay:i.fragLoadingRetryDelay,maxRetryDelay:i.fragLoadingMaxRetryTimeout,highWaterMark:0},m={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};t.load(f,v,m)}else this.decryptkey&&(a.decryptdata.key=this.decryptkey,this.hls.trigger(w.Events.KEY_LOADED,{frag:a}))},c.loadsuccess=function(d,o,a){var u=a.frag;if(!u.decryptdata){b.logger.error("after key load, decryptdata unset");return}this.decryptkey=u.decryptdata.key=new Uint8Array(d.data),u.loader=null,delete this.loaders[u.type],this.hls.trigger(w.Events.KEY_LOADED,{frag:u})},c.loaderror=function(d,o){var a=o.frag,u=a.loader;u&&u.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:d})},c.loadtimeout=function(d,o){var a=o.frag,u=a.loader;u&&u.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 d=0;do.endSN||a>0||a===0&&u>0,this.updated||this.advanced?this.misses=Math.floor(o.misses*.6):this.misses=o.misses+1,this.availabilityDelay=o.availabilityDelay},b(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 b(c,p){for(var d=0;d2){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),f((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(u.lastIndex=0;(O=u.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,Y,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),_(X,V),V=X,te+=X.duration,B++,H=0,de=!0);else if(ne[4]){var Pe=(" "+ne[4]).slice(1);V?X.setByteRange(Pe,V):X.setByteRange(Pe)}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(h),!ne){d.logger.warn("No matches on slow regex match for level playlist!");continue}for(Y=1;Y-1){d.logger.warn("Keyformat "+q+" is not supported from the manifest");continue}else if(q!=="identity")continue;ze&&(ee=c.LevelKey.fromURL(x,nt),nt&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(ze)>=0&&(ee.method=ze,ee.keyFormat=q,U&&(ee.keyID=U),k&&(ee.keyFormatVersions=k),ee.iv=re));break}case"START":{var J=new p.AttrList(Ee),xe=J.decimalFloatingPoint("TIME-OFFSET");Object(w.isFiniteNumber)(xe)&&(A.startTimeOffset=xe);break}case"MAP":{var ke=new p.AttrList(Ee);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(Ee);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 Ne=new p.AttrList(Ee);A.partTarget=Ne.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(Ee),X,x,mt,tt);je.push(Qe),X.duration+=Qe.duration;break}case"PRELOAD-HINT":{var Xe=new p.AttrList(Ee);A.preloadHint=Xe;break}case"RENDITION-REPORT":{var Be=new p.AttrList(Ee);A.renditionReports=A.renditionReports||[],A.renditionReports.push(Be);break}default:d.logger.warn("line parsed but not handled: "+ne);break}}}V&&!V.relurl?(D.pop(),te-=V.duration,A.partList&&(A.fragmentHint=V)):A.partList&&(_(X,V),X.cc=W,A.fragmentHint=X);var Ie=D.length,Me=D[0],_e=D[Ie-1];if(te+=A.skippedSegments*A.targetduration,te>0&&Ie&&_e){A.averagetargetduration=te/Ie;var Ae=_e.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)})&&(d.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=_e.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&&m(D,ce),A},E}();function f(E,g){["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});g[y+"Codec"]=l.length>0?l[0]:x[0],E=E.filter(function(S){return x.indexOf(S)===-1})}}),g.unknownCodecs=E}function v(E,g,y){var x=g[y];x&&(E[y]=x)}function m(E,g){for(var y=E[g],x=g;x--;){var l=E[x];if(!l)return;l.programDateTime=y.programDateTime-l.duration*1e3,y=l}}function _(E,g){E.rawProgramDateTime?E.programDateTime=Date.parse(E.rawProgramDateTime):g!=null&&g.programDateTime&&(E.programDateTime=g.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"),b=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"),d=j("./src/utils/attr-list.ts");function o(s){var h=s.type;switch(h){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,h){var i=s.url;return(i===void 0||i.indexOf("data:")===0)&&(i=h.url),i}var u=function(){function s(i){this.hls=void 0,this.loaders=Object.create(null),this.hls=i,this.registerListeners()}var h=s.prototype;return h.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)},h.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)},h.createInternalLoader=function(n){var t=this.hls.config,f=t.pLoader,v=t.loader,m=f||v,_=new m(t);return n.loader=_,this.loaders[n.type]=_,_},h.getInternalLoader=function(n){return this.loaders[n.type]},h.resetInternalLoader=function(n){this.loaders[n]&&delete this.loaders[n]},h.destroyInternalLoaders=function(){for(var n in this.loaders){var t=this.loaders[n];t&&t.destroy(),this.resetInternalLoader(n)}},h.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},h.onManifestLoading=function(n,t){var f=t.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:p.PlaylistContextType.MANIFEST,url:f,deliveryDirectives:null})},h.onLevelLoading=function(n,t){var f=t.id,v=t.level,m=t.url,_=t.deliveryDirectives;this.load({id:f,groupId:null,level:v,responseType:"text",type:p.PlaylistContextType.LEVEL,url:m,deliveryDirectives:_})},h.onAudioTrackLoading=function(n,t){var f=t.id,v=t.groupId,m=t.url,_=t.deliveryDirectives;this.load({id:f,groupId:v,level:null,responseType:"text",type:p.PlaylistContextType.AUDIO_TRACK,url:m,deliveryDirectives:_})},h.onSubtitleTrackLoading=function(n,t){var f=t.id,v=t.groupId,m=t.url,_=t.deliveryDirectives;this.load({id:f,groupId:v,level:null,responseType:"text",type:p.PlaylistContextType.SUBTITLE_TRACK,url:m,deliveryDirectives:_})},h.load=function(n){var t,f=this.hls.config,v=this.getInternalLoader(n);if(v){var m=v.context;if(m&&m.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 _,E,g,y;switch(n.type){case p.PlaylistContextType.MANIFEST:_=f.manifestLoadingMaxRetry,E=f.manifestLoadingTimeOut,g=f.manifestLoadingRetryDelay,y=f.manifestLoadingMaxRetryTimeout;break;case p.PlaylistContextType.LEVEL:case p.PlaylistContextType.AUDIO_TRACK:case p.PlaylistContextType.SUBTITLE_TRACK:_=0,E=f.levelLoadingTimeOut;break;default:_=f.levelLoadingMaxRetry,E=f.levelLoadingTimeOut,g=f.levelLoadingRetryDelay,y=f.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:_,retryDelay:g,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)},h.loadsuccess=function(n,t,f,v){if(v===void 0&&(v=null),f.isSidxRequest){this.handleSidxRequest(n,f),this.handlePlaylistLoaded(n,t,f,v);return}this.resetInternalLoader(f.type);var m=n.data;if(m.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(n,f,"no EXTM3U delimiter",v);return}t.parsing.start=performance.now(),m.indexOf("#EXTINF:")>0||m.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(n,t,f,v):this.handleMasterPlaylist(n,t,f,v)},h.loaderror=function(n,t,f){f===void 0&&(f=null),this.handleNetworkError(t,f,!1,n)},h.loadtimeout=function(n,t,f){f===void 0&&(f=null),this.handleNetworkError(t,f,!0)},h.handleMasterPlaylist=function(n,t,f,v){var m=this.hls,_=n.data,E=a(n,f),g=c.default.parseMasterPlaylist(_,E),y=g.levels,x=g.sessionData;if(!y.length){this.handleManifestParsingError(n,f,"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(_,E,"AUDIO",l),A=c.default.parseMasterPlaylistMedia(_,E,"SUBTITLES",S),D=c.default.parseMasterPlaylistMedia(_,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 d.AttrList({}),bitrate:0,url:""}))}m.trigger(P.Events.MANIFEST_LOADED,{levels:y,audioTracks:O,subtitles:A,captions:D,url:E,stats:t,networkDetails:v,sessionData:x})},h.handleTrackOrLevelPlaylist=function(n,t,f,v){var m=this.hls,_=f.id,E=f.level,g=f.type,y=a(n,f),x=Object(w.isFiniteNumber)(_)?_:0,l=Object(w.isFiniteNumber)(E)?E:x,S=o(f),O=c.default.parseLevelPlaylist(n.data,y,l,S,x);if(!O.fragments.length){m.trigger(P.Events.ERROR,{type:b.ErrorTypes.NETWORK_ERROR,details:b.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:y,reason:"no fragments found in level",level:typeof f.level=="number"?f.level:void 0});return}if(g===p.PlaylistContextType.MANIFEST){var A={attrs:new d.AttrList({}),bitrate:0,details:O,name:"",url:y};m.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:g,level:E,levelDetails:O,id:_,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}f.levelDetails=O,this.handlePlaylistLoaded(n,t,f,v)},h.handleSidxRequest=function(n,t){var f=Object(C.parseSegmentIndex)(new Uint8Array(n.data));if(!f)return;var v=f.references,m=t.levelDetails;v.forEach(function(_,E){var g=_.info,y=m.fragments[E];y.byteRange.length===0&&y.setByteRange(String(1+g.end-g.start)+"@"+String(g.start)),y.initSegment&&y.initSegment.setByteRange(String(f.moovEndOffset)+"@0")})},h.handleManifestParsingError=function(n,t,f,v){this.hls.trigger(P.Events.ERROR,{type:b.ErrorTypes.NETWORK_ERROR,details:b.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:t.type===p.PlaylistContextType.MANIFEST,url:n.url,reason:f,response:n,context:t,networkDetails:v})},h.handleNetworkError=function(n,t,f,v){f===void 0&&(f=!1),T.logger.warn("[playlist-loader]: A network "+(f?"timeout":"error")+" occurred while loading "+n.type+" level: "+n.level+" id: "+n.id+' group-id: "'+n.groupId+'"');var m=b.ErrorDetails.UNKNOWN,_=!1,E=this.getInternalLoader(n);switch(n.type){case p.PlaylistContextType.MANIFEST:m=f?b.ErrorDetails.MANIFEST_LOAD_TIMEOUT:b.ErrorDetails.MANIFEST_LOAD_ERROR,_=!0;break;case p.PlaylistContextType.LEVEL:m=f?b.ErrorDetails.LEVEL_LOAD_TIMEOUT:b.ErrorDetails.LEVEL_LOAD_ERROR,_=!1;break;case p.PlaylistContextType.AUDIO_TRACK:m=f?b.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:b.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,_=!1;break;case p.PlaylistContextType.SUBTITLE_TRACK:m=f?b.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:b.ErrorDetails.SUBTITLE_LOAD_ERROR,_=!1;break}E&&this.resetInternalLoader(n.type);var g={type:b.ErrorTypes.NETWORK_ERROR,details:m,fatal:_,url:n.url,loader:E,context:n,networkDetails:t};v&&(g.response=v),this.hls.trigger(P.Events.ERROR,g)},h.handlePlaylistLoaded=function(n,t,f,v){var m=f.type,_=f.level,E=f.id,g=f.groupId,y=f.loader,x=f.levelDetails,l=f.deliveryDirectives;if(!(x!=null&&x.targetduration)){this.handleManifestParsingError(n,f,"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(m){case p.PlaylistContextType.MANIFEST:case p.PlaylistContextType.LEVEL:this.hls.trigger(P.Events.LEVEL_LOADED,{details:x,level:_||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:g||"",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:g||"",stats:t,networkDetails:v,deliveryDirectives:l});break}},s}();Q.default=u},"./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(b){return typeof b=="number"&&isFinite(b)},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 b(){}return b.init=function(){b.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 b.types)b.types.hasOwnProperty(C)&&(b.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]);b.HDLR_TYPES={video:c,audio:p};var d=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]);b.STTS=b.STSC=b.STCO=o,b.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),b.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),b.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),b.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var a=new Uint8Array([105,115,111,109]),u=new Uint8Array([97,118,99,49]),s=new Uint8Array([0,0,0,1]);b.FTYP=b.box(b.types.ftyp,a,s,a,u),b.DINF=b.box(b.types.dinf,b.box(b.types.dref,d))},b.box=function(C){for(var c=8,p=arguments.length,d=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,d>>24,d>>16&255,d>>8&255,d&255,85,196,0,0]))},b.mdia=function(C){return b.box(b.types.mdia,b.mdhd(C.timescale,C.duration),b.hdlr(C.type),b.minf(C))},b.mfhd=function(C){return b.box(b.types.mfhd,new Uint8Array([0,0,0,0,C>>24,C>>16&255,C>>8&255,C&255]))},b.minf=function(C){return C.type==="audio"?b.box(b.types.minf,b.box(b.types.smhd,b.SMHD),b.DINF,b.stbl(C)):b.box(b.types.minf,b.box(b.types.vmhd,b.VMHD),b.DINF,b.stbl(C))},b.moof=function(C,c,p){return b.box(b.types.moof,b.mfhd(C),b.traf(p,c))},b.moov=function(C){for(var c=C.length,p=[];c--;)p[c]=b.trak(C[c]);return b.box.apply(null,[b.types.moov,b.mvhd(C[0].timescale,C[0].duration)].concat(p).concat(b.mvex(C)))},b.mvex=function(C){for(var c=C.length,p=[];c--;)p[c]=b.trex(C[c]);return b.box.apply(null,[b.types.mvex].concat(p))},b.mvhd=function(C,c){c*=C;var p=Math.floor(c/(w+1)),d=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,d>>24,d>>16&255,d>>8&255,d&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 b.box(b.types.mvhd,o)},b.sdtp=function(C){var c=C.samples||[],p=new Uint8Array(4+c.length),d,o;for(d=0;d>>8&255),c.push(a&255),c=c.concat(Array.prototype.slice.call(o));for(d=0;d>>8&255),p.push(a&255),p=p.concat(Array.prototype.slice.call(o));var u=b.box(b.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,h=C.height,i=C.pixelRatio[0],n=C.pixelRatio[1];return b.box(b.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,s>>8&255,s&255,h>>8&255,h&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),u,b.box(b.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),b.box(b.types.pasp,new Uint8Array([i>>24,i>>16&255,i>>8&255,i&255,n>>24,n>>16&255,n>>8&255,n&255])))},b.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]))},b.mp4a=function(C){var c=C.samplerate;return b.box(b.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]),b.box(b.types.esds,b.esds(C)))},b.mp3=function(C){var c=C.samplerate;return b.box(b.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]))},b.stsd=function(C){return C.type==="audio"?!C.isAAC&&C.codec==="mp3"?b.box(b.types.stsd,b.STSD,b.mp3(C)):b.box(b.types.stsd,b.STSD,b.mp4a(C)):b.box(b.types.stsd,b.STSD,b.avc1(C))},b.tkhd=function(C){var c=C.id,p=C.duration*C.timescale,d=C.width,o=C.height,a=Math.floor(p/(w+1)),u=Math.floor(p%(w+1));return b.box(b.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,u>>24,u>>16&255,u>>8&255,u&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,d>>8&255,d&255,0,0,o>>8&255,o&255,0,0]))},b.traf=function(C,c){var p=b.sdtp(C),d=C.id,o=Math.floor(c/(w+1)),a=Math.floor(c%(w+1));return b.box(b.types.traf,b.box(b.types.tfhd,new Uint8Array([0,0,0,0,d>>24,d>>16&255,d>>8&255,d&255])),b.box(b.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])),b.trun(C,p.length+16+20+8+16+8+8),p)},b.trak=function(C){return C.duration=C.duration||4294967295,b.box(b.types.trak,b.tkhd(C),b.mdia(C))},b.trex=function(C){var c=C.id;return b.box(b.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]))},b.trun=function(C,c){var p=C.samples||[],d=p.length,o=12+16*d,a=new Uint8Array(o),u,s,h,i,n,t;for(c+=8+o,a.set([0,0,15,1,d>>>24&255,d>>>16&255,d>>>8&255,d&255,c>>>24&255,c>>>16&255,c>>>8&255,c&255],0),u=0;u>>24&255,h>>>16&255,h>>>8&255,h&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*u);return b.box(b.types.trun,a)},b.initSegment=function(C){b.types||b.init();var c=b.moov(C),p=new Uint8Array(b.FTYP.byteLength+c.byteLength);return p.set(b.FTYP),p.set(c,b.FTYP.byteLength),p},b}();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 f});var w=j("./src/polyfills/number.ts"),P=j("./src/remux/aac-helper.ts"),b=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"),d=j("./src/utils/timescale-conversion.ts");function o(){return o=Object.assign||function(E){for(var g=1;g0?O:A.pts},x[0].pts);return l&&c.logger.debug("PTS rollover detected"),S},g.remux=function(x,l,S,O,A,D,I,B){var H,te,W,V,X,ne,Y=A,ee=A,ce=x.pid>-1,de=l.pid>-1,Ce=l.samples.length,Se=x.samples.length>0,Pe=Ce>1,ye=(!ce||Se)&&(!de||Pe)||this.ISGenerated||I;if(ye){this.ISGenerated||(W=this.generateIS(x,l,A));var Ee=this.isVideoContiguous,Ge=-1;if(Pe&&(Ge=v(l.samples),!Ee&&this.config.forceKeyFrameOnDiscontinuity))if(ne=!0,Ge>0){c.logger.warn("[mp4-remuxer]: Dropped "+Ge+" out of "+Ce+" video samples due to a missing keyframe");var Ue=this.getVideoStartPts(l.samples);l.samples=l.samples.slice(Ge),l.dropped+=Ge,ee+=(l.samples[0].pts-Ue)/(l.timescale||9e4)}else Ge===-1&&(c.logger.warn("[mp4-remuxer]: No keyframe found out of "+Ce+" video samples"),ne=!1);if(this.ISGenerated){if(Se&&Pe){var Fe=this.getVideoStartPts(l.samples),He=f(x.samples[0].pts,Fe)-Fe,be=He/l.inputTimeScale;Y+=Math.max(0,be),ee+=Math.max(0,-be)}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,Y,this.isAudioContiguous,D,de||Pe||B===p.PlaylistLevelType.AUDIO?ee:void 0),Pe){var me=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,Ee,me)}}else Pe&&(H=this.remuxVideo(l,ee,Ee,0));H&&(H.firstKeyFrame=Ge,H.independent=Ge!==-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}},g.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):b.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:b.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,f(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}},g.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,Y=Number.POSITIVE_INFINITY,ee=Number.NEGATIVE_INFINITY,ce=0,de=!1;if(!S||te===null){var Ce=l*A,Se=D[0].pts-f(D[0].dts,D[0].pts);te=Ce-Se}for(var Pe=0;Peye.pts){var Ee=9e4*.2;ce=Math.max(Math.min(ce,ye.pts-ye.dts),-1*Ee)}ye.dts0?Pe-1:Pe].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 Ge=Math.round((ne-X)/(B-1));if(ce<0){if(ceGe,We=be<-1;if(me||We){me?c.logger.warn("AVC: "+Object(d.toMsFromMpegTsClock)(be,!0)+" ms ("+be+"dts) hole between fragments detected, filling it"):c.logger.warn("AVC: "+Object(d.toMsFromMpegTsClock)(-be,!0)+" ms ("+be+"dts) overlapping between fragments detected"),X=te;var ze=D[0].pts-be;D[0].dts=X,D[0].pts=ze,c.logger.log("Video: First PTS/DTS adjusted: "+Object(d.toMsFromMpegTsClock)(ze,!0)+"/"+Object(d.toMsFromMpegTsClock)(X,!0)+", delta: "+Object(d.toMsFromMpegTsClock)(be,!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?Y+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 m(tt.key,V,Qe,ut))}if(I.length&&h&&h<70){var Ct=I[0].flags;Ct.dependsOn=2,Ct.isNonSync=0}console.assert(V!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=te=ne+V,this.isVideoContiguous=!0;var Ht=b.default.moof(x.sequenceNumber++,X,o({},x,{samples:I})),Qt="video",bt={data1:Ht,data2:dt,startPTS:Y/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},g.remuxAudio=function(x,l,S,O,A){var D=x.inputTimeScale,I=x.samplerate?x.samplerate:D,B=D/I,H=x.isAAC?u:s,te=H*B,W=this._initPTS,V=!x.isAAC&&this.typeSupported.mpeg,X=[],ne=x.samples,Y=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(f(ne[0].pts-W,ce)-ee)<20*te),ne.forEach(function(Me){Me.pts=f(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,Pe=ee;Se=Ce*te&&Ue0){re+=Y;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(b.default.types.mdat,4)}}else return;nt.set(J,Y);var Ne=J.byteLength;Y+=Ne,X.push(new m(!0,H,Ne,0)),ze=xe}var je=X.length;if(!je)return;var tt=X[X.length-1];this.nextAudioPts=ee=ze+B*tt.duration;var mt=V?new Uint8Array(0):b.default.moof(x.sequenceNumber++,We/B,o({},x,{samples:X}));x.samples=[];var Qe=We/D,Xe=ee/D,Be="audio",Ie={data1:mt,data2:nt,startPTS:Qe,endPTS:Xe,startDTS:Qe,endDTS:Xe,type:Be,hasAudio:!0,hasVideo:!1,nb:je};return this.isAudioContiguous=!0,console.assert(nt.length,"MDAT length must not be zero"),Ie},g.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*u,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=[],Y=0;Y4294967296;)E+=y;return E}function v(E){for(var g=0;g0?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:m,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=h,v.initSegment=_,v},d}(),c=function(o,a,u){return Object(P.getStartDTS)(o,a)-u};function p(d,o){var a=d==null?void 0:d.codec;return a&&a.length>4?a:a==="hvc1"?"hvc1.1.c.L120.90":a==="av01"?"av01.0.04M.08":a==="avc1"||o===b.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 b=P.prototype;return b.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},b.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},b.onHandlerDestroyed=function(){},b.hasInterval=function(){return!!this._tickInterval},b.hasNextTick=function(){return!!this._tickTimer},b.setInterval=function(C){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,C),!0)},b.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},b.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},b.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},b.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},b.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 b}),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 b;(function(C){C.DASH="d",C.HLS="h",C.SMOOTH="s",C.OTHER="o"})(b||(b={}));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 b}),j.d(Q,"getSkipValue",function(){return T}),j.d(Q,"HlsUrlParameters",function(){return C}),j.d(Q,"Level",function(){return c});function w(p,d){for(var o=0;oNumber.MAX_SAFE_INTEGER?Infinity:d},C.hexadecimalInteger=function(p){if(this[p]){var d=(this[p]||"0x").slice(2);d=(d.length&1?"0":"")+d;for(var o=new Uint8Array(d.length/2),a=0;aNumber.MAX_SAFE_INTEGER?Infinity:d},C.decimalFloatingPoint=function(p){return parseFloat(this[p])},C.optionalFloat=function(p,d){var o=this[p];return o?parseFloat(o):d},C.enumeratedString=function(p){return this[p]},C.bool=function(p){return this[p]==="YES"},C.decimalResolution=function(p){var d=w.exec(this[p]);return d===null?void 0:{width:parseInt(d[1],10),height:parseInt(d[2],10)}},T.parseAttrList=function(p){var d,o={},a='"';for(P.lastIndex=0;(d=P.exec(p))!==null;){var u=d[2];u.indexOf(a)===0&&u.lastIndexOf(a)===u.length-1&&(u=u.slice(1,-1)),o[d[1]]=u}return o},T}()},"./src/utils/binary-search.ts":function(le,Q,j){"use strict";j.r(Q);var w={search:function(b,T){for(var C=0,c=b.length-1,p=null,d=null;C<=c;){p=(C+c)/2|0,d=b[p];var o=T(d);if(o>0)C=p+1;else if(o<0)c=p-1;else return d}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 b});var w=j("./src/utils/logger.ts"),P={length:0,start:function(){return 0},end:function(){return 0}},b=function(){function T(){}return T.isBuffered=function(c,p){try{if(c){for(var d=T.getBuffered(c),o=0;o=d.start(o)&&p<=d.end(o))return!0}}catch(a){}return!1},T.bufferInfo=function(c,p,d){try{if(c){var o=T.getBuffered(c),a=[],u;for(u=0;us&&(o[u-1].end=c[a].end):o.push(c[a])}else o.push(c[a])}else o=c;for(var h=0,i,n=p,t=p,f=0;f=v&&p=S&&w.logger.log(this.time+" ["+S+"] "+O)},y}(),h=function(x){for(var l=[],S=0;SC&&(this.logger.log(u.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=b(S);if(this.pos>=C){this.logger.log(u.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 f(O),this.nonDisplayedMemory=new f(O),this.lastOutputScreen=new f(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(u.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(u.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}(),m=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=g(),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 ("+h([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(u.WARNING,"No channel found yet. TEXT-MODE?")}!A&&!B&&this.logger.log(u.WARNING,"Couldn't parse cleaned data "+h([D,I])+" orig: "+h([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 _(null,null,A),this.logger.log(u.DEBUG,"Repeated command ("+h([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),_(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(u.ERROR,"Mismatch channel in midrow parsing"),!1;var D=this.channels[A];return D?(D.ccMIDROW(O),this.logger.log(u.DEBUG,"MIDROW ("+h([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 _(null,null,D),!0;var H=S<=23?1:2;O>=64&&O<=95?A=H===1?c[S]:d[S]:A=H===1?p[S]:o[S];var te=this.channels[H];return te?(te.setPAC(this.interpretPAC(A,O)),_(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(u.INFO,"Special char '"+b(B)+"' in channel "+A),D=[B]}else S>=32&&S<=127&&(D=O===0?[S]:[S,O]);if(D){var H=h(D);this.logger.log(u.DEBUG,"Char codes = "+H.join(",")),_(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),_(S,O,this.cmdHistory),!0},x.reset=function(){for(var S=0;S=16?n--:n++;var _=Object(w.fixLineBreaks)(t.trim()),E=Object(P.generateCueId)(d,o,_);(!p||!p.cues||!p.cues.getCueById(E))&&(h=new f(d,o,_),h.id=E,h.line=v+1,h.align="left",h.position=10+Math.min(80,Math.floor(n*8/32)*10),u.push(h))}return p&&u.length&&(u.sort(function(g,y){return g.line==="auto"||y.line==="auto"?0:g.line>8&&y.line>8?y.line-g.line:g.line-y.line}),u.forEach(function(g){return Object(b.addCueToTrack)(p,g)})),u}};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 d}),j.d(Q,"alignStream",function(){return o}),j.d(Q,"alignPDT",function(){return u}),j.d(Q,"alignFragmentByPDTDelta",function(){return s}),j.d(Q,"alignMediaPlaylistByPDT",function(){return h});var w=j("./src/polyfills/number.ts"),P=j("./src/utils/logger.ts"),b=j("./src/controller/level-helper.ts");function T(i,n){for(var t=null,f=0,v=i.length;ft.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(){},b}();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 b=P.prototype;return b.sample=function(C,c){var p=Math.pow(this.alpha_,C);this.estimate_=c*(1-p)+p*this.estimate_,this.totalWeight_+=C},b.getTotalWeight=function(){return this.totalWeight_},b.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"),b=j("./src/demux/chunk-cache.ts");function T(f,v){f.prototype=Object.create(v.prototype),f.prototype.constructor=f,o(f,v)}function C(f){var v=typeof Map=="function"?new Map:void 0;return C=function(_){if(_===null||!d(_))return _;if(typeof _!="function")throw new TypeError("Super expression must either be null or a function");if(typeof v!="undefined"){if(v.has(_))return v.get(_);v.set(_,E)}function E(){return c(_,arguments,a(this).constructor)}return E.prototype=Object.create(_.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),o(E,_)},C(f)}function c(f,v,m){return p()?c=Reflect.construct:c=function(E,g,y){var x=[null];x.push.apply(x,g);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(f){return!1}}function d(f){return Function.toString.call(f).indexOf("[native code]")!==-1}function o(f,v){return o=Object.setPrototypeOf||function(_,E){return _.__proto__=E,_},o(f,v)}function a(f){return a=Object.setPrototypeOf?Object.getPrototypeOf:function(m){return m.__proto__||Object.getPrototypeOf(m)},a(f)}function u(){return u=Object.assign||function(f){for(var v=1;v=y&&x(E,g,l.flush(),_)):x(E,g,I,_),A()}).catch(function(){return Promise.reject()})};return O()},f}();function i(f,v){var m={method:"GET",mode:"cors",credentials:"same-origin",signal:v,headers:new self.Headers(u({},f.headers))};return f.rangeEnd&&m.headers.set("Range","bytes="+f.rangeStart+"-"+String(f.rangeEnd-1)),m}function n(f,v){return new self.Request(f.url,v)}var t=function(f){T(v,f);function v(m,_,E){var g;return g=f.call(this,m)||this,g.code=void 0,g.details=void 0,g.code=_,g.details=E,g}return v}(C(Error));Q.default=h},"./src/utils/imsc1-ttml-parser.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"IMSC1_CODEC",function(){return d}),j.d(Q,"parseIMSC1",function(){return s});var w=j("./src/utils/mp4-tools.ts"),P=j("./src/utils/vttparser.ts"),b=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(d){for(var o=arguments.length,a=new Array(o>1?o-1:0),u=1;u>24,v[m+1]=_>>16&255,v[m+2]=_>>8&255,v[m+3]=_&255}function o(v,m){var _=[];if(!m.length)return _;var E,g,y;"data"in v?(E=v.data,g=v.start,y=v.end):(E=v,g=0,y=E.byteLength);for(var x=g;x1?x+l:y;if(S===m[0])if(m.length===1)_.push({data:E,start:x+8,end:O});else{var A=o({data:E,start:x+8,end:O},m.slice(1));A.length&&T.apply(_,A)}x=O}return _}function a(v){var m=o(v,["moov"]),_=m[0],E=_?_.end:null,g=o(v,["sidx"]);if(!g||!g[0])return null;var y=[],x=g[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 u(v){for(var m=[],_=o(v,["moov","trak"]),E=0;E<_.length;E++){var g=_[E],y=o(g,["tkhd"])[0];if(y){var x=y.data[y.start],l=x===0?12:20,S=p(y,l),O=o(g,["mdia","mdhd"])[0];if(O){x=O.data[O.start],l=x===0?12:20;var A=p(O,l),D=o(g,["mdia","hdlr"])[0];if(D){var I=C(D.data.subarray(D.start+8,D.start+12)),B={soun:P.ElementaryStreamTypes.AUDIO,vide:P.ElementaryStreamTypes.VIDEO}[I];if(B){var H=o(g,["mdia","minf","stbl","stsd"])[0],te=void 0;H&&(te=C(H.data.subarray(H.start+12,H.start+16))),m[S]={timescale:A,type:B},m[B]={timescale:A,id:S,codec:te}}}}}}var W=o(v,["moov","mvex","trex"]);return W.forEach(function(V){var X=p(V,4),ne=m[X];ne&&(ne.default={duration:p(V,12),flags:p(V,20)})}),m}function s(v,m){return o(m,["moof","traf"]).reduce(function(_,E){var g=o(E,["tfdt"])[0],y=g.data[g.start],x=o(E,["tfhd"]).reduce(function(l,S){var O=p(S,4),A=v[O];if(A){var D=p(g,4);y===1&&(D*=Math.pow(2,32),D+=p(g,8));var I=A.timescale||9e4,B=D/I;if(isFinite(B)&&(l===null||BC)&&(this.startTime=C),this.endTime=c,this.screen=p,this.timelineController.createCaptionsTrack(this.trackName)},b.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 b}),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(d,o){var a;try{a=new Event("addtrack")}catch(u){a=document.createEvent("Event"),a.initEvent("addtrack",!1,!1)}a.track=d,o.dispatchEvent(a)}function b(d,o){var a=d.mode;if(a==="disabled"&&(d.mode="hidden"),d.cues&&!d.cues.getCueById(o.id))try{if(d.addCue(o),!d.cues.getCueById(o.id))throw new Error("addCue is failed for: "+o)}catch(s){w.logger.debug("[texttrack-utils]: "+s);var u=new self.TextTrackCue(o.startTime,o.endTime,o.text);u.id=o.id,d.addCue(u)}a==="disabled"&&(d.mode=a)}function T(d){var o=d.mode;if(o==="disabled"&&(d.mode="hidden"),d.cues)for(var a=d.cues.length;a--;)d.removeCue(d.cues[a]);o==="disabled"&&(d.mode=o)}function C(d,o,a){var u=d.mode;if(u==="disabled"&&(d.mode="hidden"),d.cues&&d.cues.length>0)for(var s=p(d.cues,o,a),h=0;hd[a].endTime)return-1;for(var u=0,s=a;u<=s;){var h=Math.floor((s+u)/2);if(od[h].startTime&&u-1)for(var h=s,i=d.length;h=o&&n.endTime<=a)u.push(n);else if(n.startTime>a)return u}return u}},"./src/utils/time-ranges.ts":function(le,Q,j){"use strict";j.r(Q);var w={toString:function(b){for(var T="",C=b.length,c=0;c1?o-1:0),u=1;u100)throw new Error("Position must be between 0 and 100.");y=A,this.hasBeenReset=!0}})),Object.defineProperty(u,"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(u,"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(u,"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}})),u.displayState=void 0}return p.prototype.getCueAsHTML=function(){var d=self.WebVTT;return d.convertCueToDOMTree(self,this.text)},p}()},"./src/utils/vttparser.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"parseTimeStamp",function(){return b}),j.d(Q,"fixLineBreaks",function(){return o}),j.d(Q,"VTTParser",function(){return a});var w=j("./src/utils/vttcue.ts"),P=function(){function u(){}var s=u.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))},u}();function b(u){function s(i,n,t,f){return(i|0)*3600+(n|0)*60+(t|0)+parseFloat(f||0)}var h=u.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return h?parseFloat(h[2])>59?s(h[2],h[3],0,h[4]):s(h[1],h[2],h[3],h[4]):null}var T=function(){function u(){this.values=Object.create(null)}var s=u.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 f=0;f=0&&t<=100)return this.set(i,t),!0}return!1},u}();function C(u,s,h,i){var n=i?u.split(i):[u];for(var t in n){if(typeof n[t]!="string")continue;var f=n[t].split(h);if(f.length!==2)continue;var v=f[0],m=f[1];s(v,m)}}var c=new w.default(0,0,""),p=c.align==="middle"?"middle":"center";function d(u,s,h){var i=u;function n(){var v=b(u);if(v===null)throw new Error("Malformed timestamp: "+i);return u=u.replace(/^[^\sa-zA-Z-]+/,""),v}function t(v,m){var _=new T;C(v,function(y,x){var l;switch(y){case"region":for(var S=h.length-1;S>=0;S--)if(h[S].id===x){_.set(y,h[S].region);break}break;case"vertical":_.alt(y,x,["rl","lr"]);break;case"line":l=x.split(","),_.integer(y,l[0]),_.percent(y,l[0])&&_.set("snapToLines",!1),_.alt(y,l[0],["auto"]),l.length===2&&_.alt("lineAlign",l[1],["start",p,"end"]);break;case"position":l=x.split(","),_.percent(y,l[0]),l.length===2&&_.alt("positionAlign",l[1],["start",p,"end","line-left","line-right","auto"]);break;case"size":_.percent(y,x);break;case"align":_.alt(y,x,["start",p,"end","left","right"]);break}},/:/,/\s/),m.region=_.get("region",null),m.vertical=_.get("vertical","");var E=_.get("line","auto");E==="auto"&&c.line===-1&&(E=-1),m.line=E,m.lineAlign=_.get("lineAlign","start"),m.snapToLines=_.get("snapToLines",!0),m.size=_.get("size",100),m.align=_.get("align",p);var g=_.get("position","auto");g==="auto"&&c.position===50&&(g=m.align==="start"||m.align==="left"?0:m.align==="end"||m.align==="right"?100:50),m.position=g}function f(){u=u.replace(/^\s+/,"")}if(f(),s.startTime=n(),f(),u.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+i);u=u.substr(3),f(),s.endTime=n(),f(),t(u,s)}function o(u){return u.replace(//gi,` `)}var a=function(){function u(){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=u.prototype;return s.parse=function(i){var n=this;i&&(n.buffer+=n.decoder.decode(i,{stream:!0}));function t(){var g=n.buffer,y=0;for(g=o(g);y")===-1){n.cue.id=v;continue}case"CUE":if(!n.cue){n.state="BADCUE";continue}try{d(v,n.cue,n.regionList)}catch(g){n.cue=null,n.state="BADCUE";continue}n.state="CUETEXT";continue;case"CUETEXT":{var E=v.indexOf("-->")!==-1;if(!v||E&&(_=!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(g){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},u}()},"./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"),b=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},d=function(i){var n=parseInt(i.substr(-3)),t=parseInt(i.substr(-6,2)),f=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)(f)||!Object(w.isFiniteNumber)(v))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+i);return n+=1e3*t,n+=60*1e3*f,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(h,i,n){return o(h.toString())+o(i.toString())+o(n)}var u=function(i,n,t){var f=i[n],v=i[f.prevCC];if(!v||!v.new&&f.new){i.ccOffset=i.presentationOffset=f.start,f.new=!1;return}for(;(m=v)!==null&&m!==void 0&&m.new;){var m;i.ccOffset+=f.start-v.start,f.new=!1,f=v,v=i[f.prevCC]}i.presentationOffset=t};function s(h,i,n,t,f,v,m,_){var E=new P.VTTParser,g=Object(b.utf8ArrayToStr)(new Uint8Array(h)).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[f],te=t.ccOffset,W=(S-x)/9e4;if(H!=null&&H.new&&(O!==void 0?te=t.ccOffset=H.start:u(t,f,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){_(A);return}m(y)},g.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=d(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"),b=/^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 d=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),d&&(d.onreadystatechange=null,d.onprogress=null,d.readyState!==4&&(this.stats.aborted=!0,d.abort()))},c.abort=function(){var d;this.abortInternal(),(d=this.callbacks)!==null&&d!==void 0&&d.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},c.load=function(d,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=d,this.config=o,this.callbacks=a,this.retryDelay=o.retryDelay,this.loadInternal()},c.loadInternal=function(){var d=this.config,o=this.context;if(!d)return;var a=this.loader=new self.XMLHttpRequest,u=this.stats;u.loading.first=0,u.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 h=this.context.headers;if(h)for(var i in h)a.setRequestHeader(i,h[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),d.timeout),a.send()},c.readystatechange=function(){var d=this.context,o=this.loader,a=this.stats;if(!d||!o)return;var u=o.readyState,s=this.config;if(a.aborted)return;if(u>=2)if(self.clearTimeout(this.requestTimeout),a.loading.first===0&&(a.loading.first=Math.max(self.performance.now(),a.loading.start)),u===4){o.onreadystatechange=null,o.onprogress=null;var h=o.status;if(h>=200&&h<300){a.loading.end=Math.max(self.performance.now(),a.loading.first);var i,n;if(d.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,d,i,o),!this.callbacks)return;var f={url:o.responseURL,data:i};this.callbacks.onSuccess(f,a,d,o)}else a.retry>=s.maxRetry||h>=400&&h<499?(w.logger.error(h+" while loading "+d.url),this.callbacks.onError({code:h,text:o.statusText},d,o)):(w.logger.warn(h+" while loading "+d.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 d=this.callbacks;d&&(this.abortInternal(),d.onTimeout(this.stats,this.context,this.loader))},c.loadprogress=function(d){var o=this.stats;o.loaded=d.loaded,d.lengthComputable&&(o.total=d.total)},c.getCacheAge=function(){var d=null;if(this.loader&&b.test(this.loader.getAllResponseHeaders())){var o=this.loader.getResponseHeader("age");d=o?parseFloat(o):null}return d},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"),b=z("q1tI"),T=z("TSYQ"),C=z.n(T),c=z("Gytx"),p=z.n(c),d=z("Kwbf"),o=z("t23M"),a=z("qx4F"),u=z("6eGT"),s=z("IBYe"),h=z("Ff2n"),i=z("c+Xe"),n=z("fyJ8"),t=z("biw7");function f(Ne,je,tt,mt,Qe){var Xe=tt[Ne]||{},Be=tt[je]||{},Ie,Me;Xe.fixed==="left"?Ie=mt.left[Ne]:Be.fixed==="right"&&(Me=mt.right[je]);var _e=!1,Ae=!1,Le=!1,Te=!1,Ze=tt[je+1],ut=tt[Ne-1];if(Qe==="rtl"){if(Ie!==void 0){var Ct=ut&&ut.fixed==="left";Te=!Ct}else if(Me!==void 0){var Ht=Ze&&Ze.fixed==="right";Le=!Ht}}else if(Ie!==void 0){var Qt=Ze&&Ze.fixed==="left";_e=!Qt}else if(Me!==void 0){var bt=ut&&ut.fixed==="right";Ae=!bt}return{fixLeft:Ie,fixRight:Me,lastFixLeft:_e,firstFixRight:Ae,lastFixRight:Le,firstFixLeft:Te,isSticky:mt.isSticky}}var v=z("sR1s");function m(Ne){var je=Ne.cells,tt=Ne.stickyOffsets,mt=Ne.flattenColumns,Qe=Ne.rowComponent,Xe=Ne.cellComponent,Be=Ne.onHeaderRow,Ie=Ne.index,Me=b.useContext(t.a),_e=Me.prefixCls,Ae=Me.direction,Le;Be&&(Le=Be(je.map(function(Ze){return Ze.column}),Ie));var Te=Object(v.a)(je.map(function(Ze){return Ze.column}));return b.createElement(Qe,Object.assign({},Le),je.map(function(Ze,ut){var Ct=Ze.column,Ht=f(Ze.colStart,Ze.colEnd,mt,tt,Ae),Qt;return Ct&&Ct.onHeaderCell&&(Qt=Ze.column.onHeaderCell(Ct)),b.createElement(n.a,Object.assign({},Ze,{ellipsis:Ct.ellipsis,align:Ct.align,component:Xe,prefixCls:_e,key:Te[ut]},Ht,{additionalProps:Qt,rowType:"header"}))}))}m.displayName="HeaderRow";var _=m;function E(Ne){var je=[];function tt(Be,Ie){var Me=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;je[Me]=je[Me]||[];var _e=Ie,Ae=Be.filter(Boolean).map(function(Le){var Te={key:Le.key,className:Le.className||"",children:Le.title,column:Le,colStart:_e},Ze=1,ut=Le.children;return ut&&ut.length>0&&(Ze=tt(ut,_e,Me+1).reduce(function(Ct,Ht){return Ct+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),_e+=Ze,Ze});return Ae}tt(Ne,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],_e=tt&&tt[Ie],Ae=_e&&_e[x.a];(Me||Ae||Be)&&(Qe.unshift(b.createElement("col",Object.assign({key:Ie,style:{width:Me,minWidth:Me}},Ae))),Be=!0)}return b.createElement("colgroup",null,Qe)}var S=l;function O(Ne,je){return Object(b.useMemo)(function(){for(var tt=[],mt=0;mt1?ae-1:0),se=1;se=Le&&(Zt=Le-Te),Be({scrollLeft:Zt/Le*(Ae+2)}),bt.current.x=rt.pageX},ot=function(){var rt=Object(nt.b)(Xe.current).top,Tt=rt+Xe.current.offsetHeight,Ft=document.documentElement.scrollTop+window.innerHeight;Tt-Object(a.a)()<=Ft||rt>=Ft-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(Tt){return Object(Q.a)(Object(Q.a)({},Tt),{},{scrollLeft:rt/Ae*Le||0})})};return b.useImperativeHandle(tt,function(){return{setScrollLeft:kt}}),b.useEffect(function(){var Dt=Object(ze.a)(document.body,"mouseup",De,!1),rt=Object(ze.a)(document.body,"mousemove",yt,!1);return ot(),function(){Dt.remove(),rt.remove()}},[Te,pt]),b.useEffect(function(){var Dt=Object(ze.a)(window,"scroll",ot,!1),rt=Object(ze.a)(window,"resize",ot,!1);return function(){Dt.remove(),rt.remove()}},[]),b.useEffect(function(){Ht.isHiddenScrollBar||Qt(function(Dt){var rt,Tt;return Object(Q.a)(Object(Q.a)({},Dt),{},{scrollLeft:Xe.current.scrollLeft/((rt=Xe.current)===null||rt===void 0?void 0:rt.scrollWidth)*((Tt=Xe.current)===null||Tt===void 0?void 0:Tt.clientWidth)})})},[Ht.isHiddenScrollBar]),Ae<=Le||!Te||Ht.isHiddenScrollBar?null:b.createElement("div",{style:{height:Object(a.a)(),width:Le,bottom:Ie},className:"".concat(_e,"-sticky-scroll")},b.createElement("div",{onMouseDown:Ke,ref:Ze,className:C()("".concat(_e,"-sticky-scroll-bar"),Object(le.a)({},"".concat(_e,"-sticky-scroll-bar-active"),pt)),style:{width:"".concat(Te,"px"),transform:"translate3d(".concat(Ht.scrollLeft,"px, 0, 0)")}}))},k=b.forwardRef(re);function U(Ne,je){return b.useMemo(function(){var tt=!!Ne;return{isSticky:tt,stickyClassName:tt?"".concat(je,"-sticky-header"):"",offsetHeader:Object(w.a)(Ne)==="object"&&Ne.offsetHeader||0,offsetScroll:Object(w.a)(Ne)==="object"&&Ne.offsetScroll||0}},[Ne,je])}var q=[],$={},J="rc-table-internal-hook",xe=b.memo(function(Ne){var je=Ne.children;return je},function(Ne,je){return p()(Ne.props,je.props)?Ne.pingLeft!==je.pingLeft||Ne.pingRight!==je.pingRight:!1});function ke(Ne){var je,tt=Ne.prefixCls,mt=Ne.className,Qe=Ne.rowClassName,Xe=Ne.style,Be=Ne.data,Ie=Ne.rowKey,Me=Ne.scroll,_e=Ne.tableLayout,Ae=Ne.direction,Le=Ne.title,Te=Ne.footer,Ze=Ne.summary,ut=Ne.id,Ct=Ne.showHeader,Ht=Ne.components,Qt=Ne.emptyText,bt=Ne.onRow,Lt=Ne.onHeaderRow,at=Ne.internalHooks,pt=Ne.transformColumns,st=Ne.internalRefs,De=Ne.sticky,Ke=Be||q,yt=!!Ke.length,ot=b.useState(0),kt=Object(P.a)(ot,2),Dt=kt[0],rt=kt[1];b.useEffect(function(){rt(Object(a.a)())});var Tt=b.useMemo(function(){return Object(v.c)(Ht,{})},[Ht]),Ft=b.useCallback(function(ct,xt){return Object(v.b)(Tt,ct)||xt},[Tt]),zt=b.useMemo(function(){return typeof Ie=="function"?Ie:function(ct){var xt=ct&&ct[Ie];return xt}},[Ie]),Zt=Object(x.c)(Ne),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||me,Rt=ht||"children",cn=b.useMemo(function(){return oe?"row":Ne.expandable&&at===J&&Ne.expandable.__PARENT_RENDER_ICON__||Ke.some(function(ct){return ct&&Object(w.a)(ct)==="object"&&ct[Rt]})?"nest":!1},[!!oe,Ke]),an=b.useState(function(){return K||(Z?We(Ke,zt,Rt):[])}),ie=Object(P.a)(an,2),N=ie[0],F=ie[1],ae=b.useMemo(function(){return new Set(ve||N||[])},[ve,N]),pe=b.useCallback(function(ct){var xt=zt(ct,Ke.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,Ke,he,Oe]),se=b.useState(0),$e=Object(P.a)(se,2),_t=$e[0],it=$e[1],Vt=Object(Ce.b)(Object(Q.a)(Object(Q.a)(Object(Q.a)({},Ne),Zt),{},{expandable:!!oe,expandedKeys:ae,getRowKey:zt,onTriggerExpand:pe,expandIcon:nn,expandIconColumnIndex:Pt,direction:Ae}),at===J?pt:null),At=Object(P.a)(Vt,2),Bt=At[0],on=At[1],In=b.useMemo(function(){return{columns:Bt,flattenColumns:on}},[Bt,on]),Lr=b.useRef(),Sr=b.useRef(),Un=b.useRef(),ur=b.useState(!1),mi=Object(P.a)(ur,2),Ar=mi[0],fr=mi[1],br=b.useState(!1),Xr=Object(P.a)(br,2),Dr=Xr[0],Yr=Xr[1],gr=ye(new Map),gi=Object(P.a)(gr,2),si=gi[0],Pr=gi[1],Fr=Object(v.a)(on),_i=Fr.map(function(ct){return si.get(ct)}),vi=b.useMemo(function(){return _i},[_i.join("_")]),di=Ue(vi,on.length,Ae),Fn=Me&&Object(v.d)(Me.y),wn=Me&&Object(v.d)(Me.x),Er=wn&&on.some(function(ct){var xt=ct.fixed;return xt}),qn=b.useRef(),kr=U(De,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=b.useCallback(function(ct,xt){Pr(function(It){var sn=new Map(It);return sn.set(ct,xt),sn})},[]),xi=Ee(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||$;if(!Wi()||Wi()===St){var Et;li(St),Si(fn,Sr.current),Si(fn,Un.current),Si(fn,(Et=qn.current)===null||Et===void 0?void 0:Et.setScrollLeft)}if(It){var Yt=It.scrollWidth,wt=It.clientWidth;fr(fn>0),Yr(fn0?[].concat(Object(Q.a)(h),Object(Q.a)(d(f).map(function(v){return Object(j.a)({fixed:t},v)}))):[].concat(Object(Q.a)(h),[Object(j.a)(Object(j.a)({},i),{},{fixed:t})])},[])}function o(s){for(var h=!0,i=0;i=0;f-=1){var v=s[f];if(t&&v.fixed!=="right")t=!1;else if(!t&&v.fixed==="right"){Object(T.a)(!1,"Index ".concat(f+1," of `columns` missing `fixed='right'` prop."));break}}}function a(s){return s.map(function(h){var i=h.fixed,n=Object(w.a)(h,["fixed"]),t=i;return i==="left"?t="right":i==="right"&&(t="left"),Object(j.a)({fixed:t},n)})}function u(s,h){var i=s.prefixCls,n=s.columns,t=s.children,f=s.expandable,v=s.expandedKeys,m=s.getRowKey,_=s.onTriggerExpand,E=s.expandIcon,g=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(f){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,Y){var ee=m(ne,Y),ce=v.has(ee),de=g?g(ne):!0,Ce=E({prefixCls:i,expanded:ce,expandable:de,record:ne,onExpand:_});return l?P.createElement("span",{onClick:function(Pe){return Pe.stopPropagation()}},Ce):Ce}),I),W=S.slice();return B>=0&&W.splice(B,0,te),W}return S},[f,S,m,v,E,x]),A=P.useMemo(function(){var I=O;return h&&(I=h(I)),I.length||(I=[{render:function(){return null}}]),I},[h,O,x]),D=P.useMemo(function(){return x==="rtl"?a(d(A)):d(A)},[A,x]);return[A,D]}Ve.b=u},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 d}),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(u){return u.nodeType===1?u.ownerDocument.defaultView.getComputedStyle(u,null):{}}function P(u,s,h){if(s=s.toLowerCase(),h==="auto"){if(s==="height")return u.offsetHeight;if(s==="width")return u.offsetWidth}return s in Q||(Q[s]=le.test(s)),Q[s]?parseFloat(h)||0:h}function b(u,s){var h=arguments.length,i=w(u);return s=j[s]?"cssFloat"in u.style?"cssFloat":"styleFloat":s,h===1?i:P(u,s,i[s]||u.style[s])}function T(u,s,h){var i=arguments.length;if(s=j[s]?"cssFloat"in u.style?"cssFloat":"styleFloat":s,i===3)return typeof h=="number"&&le.test(s)&&(h="".concat(h,"px")),u.style[s]=h,h;for(var n in s)s.hasOwnProperty(n)&&T(u,n,s[n]);return w(u)}function C(u){return u===document.body?document.documentElement.clientWidth:u.offsetWidth}function c(u){return u===document.body?window.innerHeight||document.documentElement.clientHeight:u.offsetHeight}function p(){var u=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),s=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);return{width:u,height:s}}function d(){var u=document.documentElement.clientWidth,s=window.innerHeight||document.documentElement.clientHeight;return{width:u,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(u){var s=u.getBoundingClientRect(),h=document.documentElement;return{left:s.left+(window.pageXOffset||h.scrollLeft)-(h.clientLeft||document.body.clientLeft||0),top:s.top+(window.pageYOffset||h.scrollTop)-(h.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:b,remove:T,clearAll:C};var j=Q.globalStorage;function w(c){return j[c]}function P(c,p){j[c]=p}function b(c){for(var p=j.length-1;p>=0;p--){var d=j.key(p);c(j[d],d)}}function T(c){return j.removeItem(c)}function C(){b(function(c,p){delete j[c]})}}}]);