|
|
(window.webpackJsonp=window.webpackJsonp||[]).push([[197,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<c;C++){var p=T[C],d=Q[p].exports;if(d===w||d&&d.default===w){b=p;break}}if(!b){b=Math.floor(Math.pow(16,8)*Math.random()).toString(16);for(var o={},C=0,c=T.length;C<c;C++){var p=T[C];o[p]=p}le[b]=["function(require,module,exports){"+w+"(self); }",o]}var a=Math.floor(Math.pow(16,8)*Math.random()).toString(16),u={};u[b]=b,le[a]=["function(require,module,exports){var f = require("+j(b)+");(f.default ? f.default : f)(self);}",u];var s={};h(a);function h(m){s[m]=!0;for(var E in le[m][1]){var _=le[m][1][E];s[_]||h(_)}}var i="("+z+")({"+Object.keys(s).map(function(m){return j(m)+":["+le[m][0]+","+j(le[m][1])+"]"}).join(",")+"},{},["+j(a)+"])",n=window.URL||window.webkitURL||window.mozURL||window.msURL,t=new Blob([i],{type:"text/javascript"});if(P&&P.bare)return t;var f=n.createObjectURL(t),v=new Worker(f);return v.objectURL=f,v}},"19Vz":function(et,Ve,z){(function(le){le(z("VrN/"))})(function(le){le.defineOption("placeholder","",function(C,c,p){var d=p&&p!=le.Init;if(c&&!d)C.on("blur",P),C.on("change",b),C.on("swapDoc",b),le.on(C.getInputField(),"compositionupdate",C.state.placeholderCompose=function(){w(C)}),b(C);else if(!c&&d){C.off("blur",P),C.off("change",b),C.off("swapDoc",b),le.off(C.getInputField(),"compositionupdate",C.state.placeholderCompose),Q(C);var o=C.getWrapperElement();o.className=o.className.replace(" CodeMirror-empty","")}c&&!C.hasFocus()&&P(C)});function Q(C){C.state.placeholder&&(C.state.placeholder.parentNode.removeChild(C.state.placeholder),C.state.placeholder=null)}function j(C){Q(C);var c=C.state.placeholder=document.createElement("pre");c.style.cssText="height: 0; overflow: visible",c.style.direction=C.getOption("direction"),c.className="CodeMirror-placeholder CodeMirror-line-like";var p=C.getOption("placeholder");typeof p=="string"&&(p=document.createTextNode(p)),c.appendChild(p),C.display.lineSpace.insertBefore(c,C.display.lineSpace.firstChild)}function w(C){setTimeout(function(){var c=!1,p=C.getInputField();p.nodeName=="TEXTAREA"?c=!p.value:C.lineCount()==1&&(c=!/[^\u200b]/.test(p.querySelector(".CodeMirror-line").textContent)),c?j(C):Q(C)},20)}function P(C){T(C)&&j(C)}function b(C){var c=C.getWrapperElement(),p=T(C);c.className=c.className.replace(" CodeMirror-empty","")+(p?" CodeMirror-empty":""),p?j(C):Q(C)}function T(C){return C.lineCount()===1&&C.getLine(0)===""}})},"1FX+":function(et,Ve,z){et.exports={flex_box_center:"flex_box_center___t3HuD",flex_space_between:"flex_space_between___3eY6W",flex_box_vertical_center:"flex_box_vertical_center___SMD2f",flex_box_center_end:"flex_box_center_end___1qy96",flex_box_column:"flex_box_column___1iEso",wrap:"wrap___3Vyua",head:"head___HUi2n",sort:"sort___1UPxB",btn:"btn___2b6SJ",listWarp:"listWarp___1pNnP",pagination:"pagination___3I0F3",fixedRight:"fixedRight___527Xj","oj-width-input":"oj-width-input___QQMFK"}},"1eCo":function(et,Ve,z){(function(le){le(z("VrN/"))})(function(le){"use strict";var Q={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},j={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};le.defineMode("xml",function(w,P){var b=w.indentUnit,T={},C=P.htmlMode?Q:j;for(var c in C)T[c]=C[c];for(var c in P)T[c]=P[c];var p,d;function o(S,O){function A(B){return O.tokenize=B,B(S,O)}var D=S.next();if(D=="<")return S.eat("!")?S.eat("[")?S.match("CDATA[")?A(s("atom","]]>")):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",E):(d="tag error",_)}else return T.allowMissingTagName&&S=="endTag"?(d="tag bracket",E(S,O,A)):(d="error",_)}function E(S,O,A){return S!="endTag"?(d="error",E):(n(A),f)}function _(S,O,A){return d="error",E(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&&/<!\[CDATA\[/.test(O))return 0;var I=O&&/^<(\/)?([\w_:\.-]*)/.exec(O);if(I&&I[1])for(;D;)if(D.tagName==I[2]){D=D.prev;break}else if(T.implicitlyClosed.hasOwnProperty(D.tagName))D=D.prev;else break;else if(I)for(;D;){var B=T.contextGrabbers[D.tagName];if(B&&B.hasOwnProperty(I[2]))D=D.prev;else break}for(;D&&D.prev&&!D.startOfLine;)D=D.prev;return D?D.indent+b:S.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",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,E=/\bAndroid(?:.+)Mobile\b/i,_=/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(E,at),tablet:!B(x,at)&&!B(g,at)&&!B(E,at)&&(B(y,at)||B(_,at)),device:!B(x,at)&&(B(g,at)||B(y,at)||B(E,at)||B(_,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"),_e=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=_e.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=_e.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=_e.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=_e.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=_e.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 Ee=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);Ee.defaultProps={selectable:!0,onClick:V,onSelect:V,onOpenChange:V,onDeselect:V,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:T.createElement("span",null,"\xB7\xB7\xB7")};var Ae=Ee,Le=function(Lt){Object(P.a)(pt,Lt);var at=Object(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<A;I++)D[I]=arguments[I];return O=x.call.apply(x,[this].concat(D))||this,O.history=Object(P.a)(O.props),O}var S=l.prototype;return S.render=function(){return w.a.createElement(le.c,{history:this.history,children:this.props.children})},l}(w.a.Component),o=function(x){Object(Q.a)(l,x);function l(){for(var O,A=arguments.length,D=new Array(A),I=0;I<A;I++)D[I]=arguments[I];return O=x.call.apply(x,[this].concat(D))||this,O.history=Object(P.b)(O.props),O}var S=l.prototype;return S.render=function(){return w.a.createElement(le.c,{history:this.history,children:this.props.children})},l}(w.a.Component),a=function(l,S){return typeof l=="function"?l(S):l},u=function(l,S){return typeof l=="string"?Object(P.c)(l,null,null,S):l},s=function(l){return l},h=w.a.forwardRef;typeof h=="undefined"&&(h=s);function i(x){return!!(x.metaKey||x.altKey||x.ctrlKey||x.shiftKey)}var n=h(function(x,l){var S=x.innerRef,O=x.navigate,A=x.onClick,D=Object(c.a)(x,["innerRef","navigate","onClick"]),I=D.target,B=Object(C.a)({},D,{onClick:function(te){try{A&&A(te)}catch(W){throw te.preventDefault(),W}!te.defaultPrevented&&te.button===0&&(!I||I==="_self")&&!i(te)&&(te.preventDefault(),O())}});return s!==h?B.ref=l||S:B.ref=S,w.a.createElement("a",B)}),t=h(function(x,l){var S=x.component,O=S===void 0?n:S,A=x.replace,D=x.to,I=x.innerRef,B=Object(c.a)(x,["component","replace","to","innerRef"]);return w.a.createElement(le.e.Consumer,null,function(H){H||Object(p.a)(!1);var te=H.history,W=u(a(D,H.location),H.location),V=W?te.createHref(W):"",X=Object(C.a)({},B,{href:V,navigate:function(){var Y=a(D,H.location),ee=A?te.replace:te.push;ee(Y)}});return s!==h?X.ref=l||I:X.innerRef=I,w.a.createElement(O,X)})});if(!1)var f,v;var m=function(l){return l},E=w.a.forwardRef;typeof E=="undefined"&&(E=m);function _(){for(var x=arguments.length,l=new Array(x),S=0;S<x;S++)l[S]=arguments[S];return l.filter(function(O){return O}).join(" ")}var g=E(function(x,l){var S=x["aria-current"],O=S===void 0?"page":S,A=x.activeClassName,D=A===void 0?"active":A,I=x.activeStyle,B=x.className,H=x.exact,te=x.isActive,W=x.location,V=x.sensitive,X=x.strict,ne=x.style,Y=x.to,ee=x.innerRef,ce=Object(c.a)(x,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return w.a.createElement(le.e.Consumer,null,function(de){de||Object(p.a)(!1);var Ce=W||de.location,Se=u(a(Y,Ce),Ce),Pe=Se.pathname,ye=Pe&&Pe.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),_e=ye?Object(le.f)(Ce.pathname,{path:ye,exact:H,sensitive:V,strict:X}):null,Ge=!!(te?te(_e,Ce):_e),Ue=Ge?_(B,D):B,Fe=Ge?Object(C.a)({},ne,{},I):ne,He=Object(C.a)({"aria-current":Ge&&O||null,className:Ue,style:Fe,to:Se},ce);return m!==E?He.ref=l||ee:He.innerRef=ee,w.a.createElement(t,He)})});if(!1)var y},"5nXd":function(et,Ve,z){var le=z("MFOe"),Q=le.slice,j=le.pluck,w=le.each,P=le.bind,b=le.create,T=le.isList,C=le.isFunction,c=le.isObject;et.exports={createStore:o};var p={version:"2.0.12",enabled:!1,get:function(a,u){var s=this.storage.read(this._namespacePrefix+a);return this._deserialize(s,u)},set:function(a,u){return u===void 0?this.remove(a):(this.storage.write(this._namespacePrefix+a,this._serialize(u)),u)},remove:function(a){this.storage.remove(this._namespacePrefix+a)},each:function(a){var u=this;this.storage.each(function(s,h){a.call(u,u._deserialize(s),(h||"").replace(u._namespaceRegexp,""))})},clearAll:function(){this.storage.clearAll()},hasNamespace:function(a){return this._namespacePrefix=="__storejs_"+a+"_"},createStore:function(){return o.apply(this,arguments)},addPlugin:function(a){this._addPlugin(a)},namespace:function(a){return o(this.storage,this.plugins,a)}};function d(){var a=typeof console=="undefined"?null:console;if(!a)return;var u=a.warn?a.warn:a.log;u.apply(a,arguments)}function o(a,u,s){s||(s=""),a&&!T(a)&&(a=[a]),u&&!T(u)&&(u=[u]);var h=s?"__storejs_"+s+"_":"",i=s?new RegExp("^"+h):null,n=/^[a-zA-Z0-9_\-]*$/;if(!n.test(s))throw new Error("store.js namespaces can only have alphanumerics + underscores and dashes");var t={_namespacePrefix:h,_namespaceRegexp:i,_testStorage:function(v){try{var m="__storejs__test__";v.write(m,m);var E=v.read(m)===m;return v.remove(m),E}catch(_){return!1}},_assignPluginFnProp:function(v,m){var E=this[m];this[m]=function(){var g=Q(arguments,0),y=this;function x(){return E?(w(arguments,function(S,O){g[O]=S}),E.apply(y,g)):void 0}var l=[x].concat(g);return v.apply(y,l)}},_serialize:function(v){return JSON.stringify(v)},_deserialize:function(v,m){if(!v)return m;var E="";try{E=JSON.parse(v)}catch(_){E=v}return E!==void 0?E:m},_addStorage:function(v){if(this.enabled)return;this._testStorage(v)&&(this.storage=v,this.enabled=!0)},_addPlugin:function(v){var m=this;if(T(v)){w(v,function(g){m._addPlugin(g)});return}var E=j(this.plugins,function(g){return v===g});if(E)return;if(this.plugins.push(v),!C(v))throw new Error("Plugins must be function values that return objects");var _=v.call(this);if(!c(_))throw new Error("Plugins must return an object of function properties");w(_,function(g,y){if(!C(g))throw new Error("Bad plugin property: "+y+" from plugin "+v.name+". Plugins should only return functions.");m._assignPluginFnProp(g,y)})},addStorage:function(v){d("store.addStorage(storage) is deprecated. Use createStore([storages])"),this._addStorage(v)}},f=b(t,p,{plugins:[]});return f.raw={},w(f,function(v,m){C(v)&&(f.raw[m]=P(f,v))}),w(a,function(v){f._addStorage(v)}),w(u,function(v){f._addPlugin(v)}),f}},"6+eU":function(et,Ve,z){"use strict";z.d(Ve,"a",function(){return E});var le=z("wx14"),Q=z("rePB"),j=z("VTBJ"),w=z("1OyB"),P=z("vuIU"),b=z("Ji7U"),T=z("LK+K"),C=z("q1tI"),c=z.n(C),p=z("TSYQ"),d=z.n(p),o=function(g){var y,x="".concat(g.rootPrefixCls,"-item"),l=d()(x,"".concat(x,"-").concat(g.page),(y={},Object(Q.a)(y,"".concat(x,"-active"),g.active),Object(Q.a)(y,g.className,!!g.className),Object(Q.a)(y,"".concat(x,"-disabled"),!g.page),y)),S=function(){g.onClick(g.page)},O=function(D){g.onKeyPress(D,g.onClick,g.page)};return c.a.createElement("li",{title:g.showTitle?g.page:null,className:l,onClick:S,onKeyPress:O,tabIndex:"0"},g.itemRender(g.page,"page",c.a.createElement("a",{rel:"nofollow"},g.page)))},a=o,u={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},s=function(_){Object(b.a)(y,_);var g=Object(T.a)(y);function y(){var x;Object(w.a)(this,y);for(var l=arguments.length,S=new Array(l),O=0;O<l;O++)S[O]=arguments[O];return x=g.call.apply(g,[this].concat(S)),x.state={goInputText:""},x.buildOptionText=function(A){return"".concat(A," ").concat(x.props.locale.items_per_page)},x.changeSize=function(A){x.props.changeSize(Number(A))},x.handleChange=function(A){x.setState({goInputText:A.target.value})},x.handleBlur=function(A){var D=x.props,I=D.goButton,B=D.quickGo,H=D.rootPrefixCls,te=x.state.goInputText;if(I||te==="")return;if(A.relatedTarget&&(A.relatedTarget.className.indexOf("".concat(H,"-prev"))>=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,_e){return c.a.createElement(ee.Option,{key:_e,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(_e){return _e.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(_){return typeof _=="number"&&isFinite(_)&&Math.floor(_)===_}function f(_,g,y){return y}function v(_,g,y){var x=typeof _=="undefined"?g.pageSize:_;return Math.floor((y.total-1)/x)+1}var m=function(_){Object(b.a)(y,_);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.current<v(void 0,l.state,l.props)},l.runIfEnter=function(I,B){if(I.key==="Enter"||I.charCode===13){for(var H=arguments.length,te=new Array(H>2?H-2:0),W=2;W<H;W++)te[W-2]=arguments[W];B.apply(void 0,te)}},l.runIfEnterPrev=function(I){l.runIfEnter(I,l.prev)},l.runIfEnterNext=function(I){l.runIfEnter(I,l.next)},l.runIfEnterJumpPrev=function(I){l.runIfEnter(I,l.jumpPrev)},l.runIfEnterJumpNext=function(I){l.runIfEnter(I,l.jumpNext)},l.handleGoTO=function(I){(I.keyCode===u.ENTER||I.type==="click")&&l.handleChange(l.state.currentInputValue)};var S=x.onChange!==n,O="current"in x;O&&!S&&console.warn("Warning: You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.");var A=x.defaultCurrent;"current"in x&&(A=x.current);var D=x.defaultPageSize;return"pageSize"in x&&(D=x.pageSize),A=Math.min(A,v(D,void 0,x)),l.state={current:A,currentInputValue:A,pageSize:D},l}return Object(P.a)(y,[{key:"componentDidUpdate",value:function(l,S){var O=this.props.prefixCls;if(S.current!==this.state.current&&this.paginationNode){var A=this.paginationNode.querySelector(".".concat(O,"-item-").concat(S.current));A&&document.activeElement===A&&A.blur()}}},{key:"getValidValue",value:function(l){var S=l.target.value,O=v(void 0,this.state,this.props),A=this.state.currentInputValue,D;return S===""?D=S:isNaN(Number(S))?D=A:S>=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,_e=this.state,Ge=_e.current,Ue=_e.pageSize,Fe=_e.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<He?Ge+1:He,J=Object.keys(this.props).reduce(function(Ee,Ae){return(Ae.substr(0,5)==="data-"||Ae.substr(0,5)==="aria-"||Ae==="role")&&(Ee[Ae]=l.props[Ae]),Ee},{});if(Y)return k&&(typeof k=="boolean"?re=c.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},te.jump_to_confirm):re=c.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},k),re=c.a.createElement("li",{title:X?"".concat(te.jump_to).concat(Ge,"/").concat(He):null,className:"".concat(O,"-simple-pager")},re)),c.a.createElement("ul",Object(le.a)({className:d()(O,"".concat(O,"-simple"),Object(Q.a)({},"".concat(O,"-disabled"),I),A),style:D,ref:this.savePaginationNode},J),c.a.createElement("li",{title:X?te.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:d()("".concat(O,"-prev"),Object(Q.a)({},"".concat(O,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(q)),c.a.createElement("li",{title:X?"".concat(Ge,"/").concat(He):null,className:"".concat(O,"-simple-pager")},c.a.createElement("input",{type:"text",value:Fe,disabled:I,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),c.a.createElement("span",{className:"".concat(O,"-slash")},"/"),He),c.a.createElement("li",{title:X?te.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:d()("".concat(O,"-next"),Object(Q.a)({},"".concat(O,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext($)),re);if(He<=3+U*2){var xe={locale:te,rootPrefixCls:O,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:X,itemRender:ee};He||be.push(c.a.createElement(a,Object(le.a)({},xe,{key:"noPager",page:He,className:"".concat(O,"-disabled")})));for(var ke=1;ke<=He;ke+=1){var dt=Ge===ke;be.push(c.a.createElement(a,Object(le.a)({},xe,{key:ke,page:ke,active:dt})))}}else{var Ne=V?te.prev_3:te.prev_5,je=V?te.next_3:te.next_5;ce&&(me=c.a.createElement("li",{title:X?Ne:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:d()("".concat(O,"-jump-prev"),Object(Q.a)({},"".concat(O,"-jump-prev-custom-icon"),!!de))},ee(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(de,"prev page"))),We=c.a.createElement("li",{title:X?je:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:d()("".concat(O,"-jump-next"),Object(Q.a)({},"".concat(O,"-jump-next-custom-icon"),!!Ce))},ee(this.getJumpNextPage(),"jump-next",this.getItemIcon(Ce,"next page")))),nt=c.a.createElement(a,{locale:te,last:!0,rootPrefixCls:O,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:He,page:He,active:!1,showTitle:X,itemRender:ee}),ze=c.a.createElement(a,{locale:te,rootPrefixCls:O,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:X,itemRender:ee});var tt=Math.max(1,Ge-U),mt=Math.min(Ge+U,He);Ge-1<=U&&(mt=1+U*2),He-Ge<=U&&(tt=He-U*2);for(var Qe=tt;Qe<=mt;Qe+=1){var Xe=Ge===Qe;be.push(c.a.createElement(a,{locale:te,rootPrefixCls:O,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:Qe,page:Qe,active:Xe,showTitle:X,itemRender:ee}))}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 E=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 E=m.callback,_=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){E(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:_},"\u53D6\u6D88")))};function v(m){var E=m.value,_=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();_&&_(H)}return A.on("change",I),function(){A.off("change",I)}}},[A,_]),Object(p.useEffect)(function(){A&&A.setOption("mode",g)},[A,g]),Object(p.useEffect)(function(){A&&((E!==A.getValue()||E==="")&&setTimeout(function(){A.setValue(E||" ")},300))},[A,E]),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 E}),z.d(Ve,"r",function(){return _});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 E(g,y){return Object(le.b)("practices/".concat(g,"/question_solution_articles/").concat(y==null?void 0:y.active),y)}function _(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 E=String(v);Object(P.a)(!h.has(E)||v===null||v===void 0,"Same 'key' exist in the Tree: ".concat(E)),h.set(E,!0),i(m,"".concat(t).concat(E," > "))})}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,E=Object(j.a)(v,["children"]),_=Object(Q.a)({key:f},E),g=h(m);return g.length&&(_.children=g),_}).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,E){var _=Object(b.h)(v?v.pos:"0",E),g=T(m.key,_),y=Object(Q.a)(Object(Q.a)({},m),{},{parent:v,pos:_,children:null,data:m,isStart:[].concat(Object(le.a)(v?v.isStart:[]),[E===0]),isEnd:[].concat(Object(le.a)(v?v.isEnd:[]),[E===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 E=f?f.children:s,_=f?Object(b.h)(m.pos,v):"0";if(f){var g=n(f,_),y={node:f,index:v,pos:_,key:g,parentPos:m.node?m.pos:null,level:m.level+1};h(y)}E&&E.forEach(function(x,l){t(x,l,{node:f,pos:_,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={},E={posEntities:v,keyEntities:m};return i&&(E=i(E)||E),d(s,function(_){var g=_.node,y=_.index,x=_.pos,l=_.key,S=_.parentPos,O=_.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,E)},f),t&&t(E),E}function a(s,h){var i=h.expandedKeys,n=h.selectedKeys,t=h.loadedKeys,f=h.loadingKeys,v=h.checkedKeys,m=h.halfCheckedKeys,E=h.dragOverNodeKey,_=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:E===s&&_===0,dragOverGapTop:E===s&&_===-1,dragOverGapBottom:E===s&&_===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,E=s.dragOver,_=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:E,dragOverGapTop:_,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<le.modeInfo.length;Q++){var j=le.modeInfo[Q];j.mimes&&(j.mime=j.mimes[0])}le.findModeByMIME=function(w){w=w.toLowerCase();for(var P=0;P<le.modeInfo.length;P++){var b=le.modeInfo[P];if(b.mime==w)return b;if(b.mimes){for(var T=0;T<b.mimes.length;T++)if(b.mimes[T]==w)return b}}if(/\+xml$/.test(w))return le.findModeByMIME("application/xml");if(/\+json$/.test(w))return le.findModeByMIME("application/json")},le.findModeByExtension=function(w){w=w.toLowerCase();for(var P=0;P<le.modeInfo.length;P++){var b=le.modeInfo[P];if(b.ext){for(var T=0;T<b.ext.length;T++)if(b.ext[T]==w)return b}}},le.findModeByFileName=function(w){for(var P=0;P<le.modeInfo.length;P++){var b=le.modeInfo[P];if(b.file&&b.file.test(w))return b}var T=w.lastIndexOf("."),C=T>-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<le.modeInfo.length;P++){var b=le.modeInfo[P];if(b.name.toLowerCase()==w)return b;if(b.alias){for(var T=0;T<b.alias.length;T++)if(b.alias[T].toLowerCase()==w)return b}}}})},"8hTe":function(et,Ve,z){et.exports={button:"button___1wy9m"}},"9Bee":function(et,Ve,z){"use strict";var le=z("DYRE"),Q=z("zeV3"),j=z("+L6B"),w=z("2/Rp"),P=z("k1fw"),b=z("9og8"),T=z("tJVT"),C=z("WmNS"),c=z.n(C),p=z("q1tI"),d=z.n(p),o=z("vg9a"),a=z("DlQD"),u=z.n(a),s=z("rUJ1");function h(ie,N){var F=ie.match(/^(\s+)(?:```)/);if(F===null)return N;var ae=F[1];return N.split(`
|
|
|
`).map(function(pe){var se=pe.match(/^\s+/);if(se===null)return pe;var $e=Object(T.a)(se,1),Et=$e[0];return Et.length>=ae.length?pe.slice(ae.length):pe}).join(`
|
|
|
`)}var i=[],n=["<ul>"],t=new u.a.Renderer,f=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function v(){i.length=0,n=["<ul>"]}var m={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function E(ie,N,F,ae){if(N>=ie.length||ie[N].level<=F)return N;var pe=ie[N];ae.push("<li><a href='#"+pe.anchor+"'>"+pe.text+"</a>"),N++;var se=[];return N=E(ie,N,pe.level,se),se.length>0&&(ae.push("<ul>"),se.forEach(function($e){ae.push($e)}),ae.push("</ul>")),ae.push("</li>"),N=E(ie,N,F,ae),N}function _(){return E(i,0,0,n),n.push("</ul>"),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(),Et=pe;pe=$e,S[$e]={type:"block",expression:Et}}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?"<p class='editormd-tex'>".concat(ie,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(N,'">').concat(F?ie:Object(s.escape)(ie,!0),`</code></pre>
|
|
|
`):'<pre class="prettyprint linenums"><code>'+(F?ie:Object(s.escape)(ie,!0))+"</code></pre>"},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}),"<h"+N+' id="'+ae+'">'+ie+"</h"+N+">"},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 Et(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,Et)}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:Et(0),throw:Et(1),return:Et(2)},typeof Symbol=="function"&&(se[Symbol.iterator]=function(){return this}),se;function Et(it){return function(Vt){return function(At){if(F)throw new TypeError("Generator is already executing.");for(;$e;)try{if(F=1,ae&&(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]<pe[3])){$e.label=At[1];break}if(At[0]===6&&$e.label<pe[1]){$e.label=pe[1],pe=At;break}if(pe&&$e.label<pe[2]){$e.label=pe[2],$e.ops.push(At);break}pe[2]&&$e.ops.pop(),$e.trys.pop();continue}At=N.call(ie,$e)}catch(Bt){At=[6,Bt],ae=0}finally{F=pe=0}if(5&At[0])throw At[1];return{value:At[0]?At[1]:void 0,done:!0}}([it,Vt])}}}function ye(){for(var ie=0,N=0,F=arguments.length;N<F;N++)ie+=arguments[N].length;var ae=Array(ie),pe=0;for(N=0;N<F;N++)for(var se=arguments[N],$e=0,Et=se.length;$e<Et;$e++,pe++)ae[pe]=se[$e];return ae}var _e=function(){function ie(){}return ie.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},ie.setAttributes=function(N,F){for(var ae=0,pe=F;ae<pe.length;ae++){var se=pe[ae],$e=se[0],Et=se[1];N.setAttribute($e,Et)}},ie.createRect=function(N,F,ae){var pe=document.createElementNS("http://www.w3.org/2000/svg","rect");return pe.setAttribute("width",N.toString()),pe.setAttribute("height",F.toString()),ae&&ie.setAttributes(pe,ae),pe},ie.createLine=function(N,F,ae,pe,se){var $e=document.createElementNS("http://www.w3.org/2000/svg","line");return $e.setAttribute("x1",N.toString()),$e.setAttribute("y1",F.toString()),$e.setAttribute("x2",ae.toString()),$e.setAttribute("y2",pe.toString()),se&&ie.setAttributes($e,se),$e},ie.createPolygon=function(N,F){var ae=document.createElementNS("http://www.w3.org/2000/svg","polygon");return ae.setAttribute("points",N),F&&ie.setAttributes(ae,F),ae},ie.createCircle=function(N,F){var ae=document.createElementNS("http://www.w3.org/2000/svg","circle");return ae.setAttribute("cx",(N/2).toString()),ae.setAttribute("cy",(N/2).toString()),ae.setAttribute("r",N.toString()),F&&ie.setAttributes(ae,F),ae},ie.createEllipse=function(N,F,ae){var pe=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return pe.setAttribute("cx",(N/2).toString()),pe.setAttribute("cy",(F/2).toString()),pe.setAttribute("rx",(N/2).toString()),pe.setAttribute("ry",(F/2).toString()),ae&&ie.setAttributes(pe,ae),pe},ie.createGroup=function(N){var F=document.createElementNS("http://www.w3.org/2000/svg","g");return N&&ie.setAttributes(F,N),F},ie.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},ie.createMarker=function(N,F,ae,pe,se,$e,Et){var it=document.createElementNS("http://www.w3.org/2000/svg","marker");return ie.setAttributes(it,[["id",N],["orient",F],["markerWidth",ae.toString()],["markerHeight",pe.toString()],["refX",se.toString()],["refY",$e.toString()]]),it.appendChild(Et),it},ie.createText=function(N){var F=document.createElementNS("http://www.w3.org/2000/svg","text");return F.setAttribute("x","0"),F.setAttribute("y","0"),N&&ie.setAttributes(F,N),F},ie.createTSpan=function(N,F){var ae=document.createElementNS("http://www.w3.org/2000/svg","tspan");return ae.textContent=N,F&&ie.setAttributes(ae,F),ae},ie.createImage=function(N){var F=document.createElementNS("http://www.w3.org/2000/svg","image");return N&&ie.setAttributes(F,N),F},ie.createPoint=function(N,F){var ae=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return ae.x=N,ae.y=F,ae},ie.createPath=function(N,F){var ae=document.createElementNS("http://www.w3.org/2000/svg","path");return ae.setAttribute("d",N),F&&ie.setAttributes(ae,F),ae},ie}(),Ge=function(){function ie(){}return ie.addKey=function(N){ie.key=N},Object.defineProperty(ie,"isLicensed",{get:function(){return!!ie.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(ie.key)},enumerable:!1,configurable:!0}),ie}(),Ue=function(){function ie(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return ie.prototype.rasterize=function(N,F,ae){var pe=this;return new Promise(function(se){var $e=ae!==void 0?ae:document.createElement("canvas");N===null&&(pe.markersOnly=!0,pe.naturalSize=!1);var Et=document.createElementNS("http://www.w3.org/2000/svg","svg");Et.setAttribute("xmlns","http://www.w3.org/2000/svg"),Et.setAttribute("width",F.width.baseVal.valueAsString),Et.setAttribute("height",F.height.baseVal.valueAsString),Et.setAttribute("viewBox","0 0 "+F.viewBox.baseVal.width.toString()+" "+F.viewBox.baseVal.height.toString()),Et.innerHTML=F.innerHTML,pe.naturalSize===!0?(Et.width.baseVal.value=N.naturalWidth,Et.height.baseVal.value=N.naturalHeight):pe.width!==void 0&&pe.height!==void 0&&(Et.width.baseVal.value=pe.width,Et.height.baseVal.value=pe.height),$e.width=Et.width.baseVal.value,$e.height=Et.height.baseVal.value;var it=Et.outerHTML,Vt=$e.getContext("2d");pe.markersOnly!==!0&&Vt.drawImage(N,0,0,$e.width,$e.height);var At=window.URL,Bt=new Image($e.width,$e.height);Bt.setAttribute("crossOrigin","anonymous");var on=new Blob([it],{type:"image/svg+xml"}),In=At.createObjectURL(on);Bt.onload=function(){Vt.drawImage(Bt,0,0),At.revokeObjectURL(In);var Lr=$e.toDataURL(pe.imageType,pe.imageQuality);se(Lr)},Bt.src=In})},ie}(),Fe=function(){},He=function(){function ie(N){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+N+"_"}return Object.defineProperty(ie.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#ffffff",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarColor:"#eeeeee",toolbarHeight:40,toolboxColor:"#eeeeee",toolboxAccentColor:"#3080c3",undoButtonVisible:!0,redoButtonVisible:!1,zoomButtonVisible:!1,zoomOutButtonVisible:!1,clearButtonVisible:!1,resultButtonBlockVisible:!0,logoPosition:"left"}},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),ie.prototype.addClass=function(N){return this.styleSheet===void 0&&this.addStyleSheet(),N.name=""+this.classNamePrefix+N.localName,this.classes.push(N),this.styleSheet.sheet.insertRule("."+N.name+" {"+N.style+"}",this.styleSheet.sheet.cssRules.length),N},ie.prototype.addRule=function(N){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(N),this.styleSheet.sheet.insertRule(N.selector+" {"+N.style+"}",this.styleSheet.sheet.cssRules.length)},ie.prototype.addStyleSheet=function(){var N;this.styleSheet=document.createElement("style"),((N=this.styleSheetRoot)!==null&&N!==void 0?N:document.head).appendChild(this.styleSheet),this.addRule(new be("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new be("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
|
from {
|
|
|
opacity: 0;
|
|
|
}
|
|
|
to {
|
|
|
opacity: 1;
|
|
|
}
|
|
|
`)),this.addRule(new be("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
|
from {
|
|
|
opacity: 1;
|
|
|
}
|
|
|
to {
|
|
|
opacity: 0;
|
|
|
}
|
|
|
`)),this.addClass(new me("fade_in",`
|
|
|
animation-duration: 0.3s;
|
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
|
`)),this.addClass(new me("fade_out",`
|
|
|
animation-duration: 0.3s;
|
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
|
`))},ie.prototype.removeStyleSheet=function(){var N;this.styleSheet&&(((N=this.styleSheetRoot)!==null&&N!==void 0?N:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},ie}(),be=function(ie,N){this.selector=ie,this.style=N},me=function(ie,N){this.localName=ie,this.style=N},We=function(){function ie(N,F,ae,pe,se){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=N,this.displayMode=F,this.markerItems=ae,this.uiStyleSettings=pe,this.styles=se,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return ie.prototype.show=function(N){var F=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=N,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var ae=document.createElement("div");ae.className=this.toolbarBlockStyleClass.name,ae.style.whiteSpace="nowrap",this.uiContainer.appendChild(ae),this.addActionButton(ae,'<svg viewBox="0 0 24 24"><path d="M10.07 14.27a.997.997 0 011.33.48l2.3 4.99 1.8-.85-2.31-4.98c-.24-.5-.02-1.1.48-1.33l.28-.08 2.3-.45L8 5.12V15.9l1.82-1.47.25-.16m3.57 7.7a.99.99 0 01-1.33-.47l-2.18-4.74-2.51 2.02c-.17.14-.38.22-.62.22a1 1 0 01-1-1V3a1 1 0 011-1c.24 0 .47.09.64.23l.01-.01 11.49 9.64a1.001 1.001 0 01-.44 1.75l-3.16.62 2.2 4.73c.26.5.02 1.09-.48 1.32l-3.62 1.69z"/></svg>',"select"),this.addActionButton(ae,'<svg viewBox="0 0 24 24"><path d="M9 3v1H4v2h1v13a2 2 0 002 2h10a2 2 0 002-2V6h1V4h-5V3H9M7 6h10v13H7V6m2 2v9h2V8H9m4 0v9h2V8h-2z"/></svg>',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(ae,'<svg viewBox="0 0 24 24"><path d="M19.36 2.72l1.42 1.42-5.72 5.71c1.07 1.54 1.22 3.39.32 4.59L9.06 8.12c1.2-.9 3.05-.75 4.59.32l5.71-5.72M5.93 17.57c-2.01-2.01-3.24-4.41-3.58-6.65l4.88-2.09 7.44 7.44-2.09 4.88c-2.24-.34-4.64-1.57-6.65-3.58z"/></svg>',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(ae,'<svg viewBox="0 0 24 24"><path d="M12.5 8c-2.65 0-5.05 1-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"/></svg>',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(ae,'<svg viewBox="0 0 24 24"><path d="M18.4 10.6C16.55 9 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8.002 8.002 0 017.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"/></svg>',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(ae,'<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(ae,'<svg viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 009.5 3 6.5 6.5 0 003 9.5 6.5 6.5 0 009.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5 1.5-1.5-5-5m-6 0C7 14 5 12 5 9.5S7 5 9.5 5 14 7 14 9.5 12 14 9.5 14M7 9h5v1H7V9z"/></svg>',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(ae,'<svg viewBox="0 0 24 24"><path d="M18.13 12l1.26-1.26c.44-.44 1-.68 1.61-.74V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 002 2h6v-1.87l.13-.13H5V5h7v7h6.13M14 4.5l5.5 5.5H14V4.5m5.13 9.33l2.04 2.04L15.04 22H13v-2.04l6.13-6.13m3.72.36l-.98.98-2.04-2.04.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72z"/></svg>',"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='<svg viewBox="0 0 24 24"><path d="M12 16a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2z"/></svg>',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,'<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"render"),this.addActionButton(pe,'<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"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;F<this.markerButtons.length;F++)F<N||F===N&&this.markerButtons.length-1===N?this.markerButtonBlock.appendChild(this.markerButtons[F]):(F===N&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[F]))}},ie.prototype.overflowButtonClicked=function(){this.markerButtonOverflowBlock.style.display!=="none"?(this.markerButtonOverflowBlock.className=this.markerButtonOverflowBlock.className.replace(this.styles.fadeInAnimationClassName,""),this.markerButtonOverflowBlock.style.display="none"):(this.markerButtonOverflowBlock.className+=" "+this.styles.fadeInAnimationClassName,this.markerButtonOverflowBlock.style.top=this.uiContainer.offsetTop+this.overflowButton.offsetHeight+"px",this.markerButtonOverflowBlock.style.right=this.uiContainer.offsetWidth-this.overflowButton.offsetLeft-this.overflowButton.offsetWidth+2*this.uiContainer.offsetLeft+"px",this.markerButtonOverflowBlock.style.display="inline-block")},ie.prototype.resetButtonStyles=function(){var N=this;this.buttons.forEach(function(F){F.className=F.className.replace(N.uiStyleSettings.toolbarButtonStyleColorsClassName?N.uiStyleSettings.toolbarButtonStyleColorsClassName:N.toolbarButtonStyleColorsClass.name,"").trim(),F.className=F.className.replace(N.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?N.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:N.toolbarActiveButtonStyleColorsClass.name,"").trim(),F.className+=" "+(N.uiStyleSettings.toolbarButtonStyleColorsClassName?N.uiStyleSettings.toolbarButtonStyleColorsClassName:N.toolbarButtonStyleColorsClass.name)})},ie.prototype.addActionButton=function(N,F,ae){var pe=this,se=document.createElement("div");switch(se.className=""+this.toolbarButtonStyleClass.name,se.innerHTML=F,se.setAttribute("data-action",ae),se.addEventListener("click",function(){pe.actionToolbarButtonClicked(se,ae)}),ae){case"select":se.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":se.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":se.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":se.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":se.style.fill=this.uiStyleSettings.closeButtonColor}N.appendChild(se),this.buttons.push(se)},ie.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new me("toolbar",`
|
|
|
width: 100%;
|
|
|
flex-shrink: 0;
|
|
|
display: flex;
|
|
|
flex-direction: row;
|
|
|
justify-content: space-between;
|
|
|
height: `+this.uiStyleSettings.toolbarHeight+`px;
|
|
|
box-sizing: content-box;
|
|
|
`+(this.displayMode==="inline"?"border-top-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
|
`+(this.displayMode==="inline"?"border-top-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
|
overflow: hidden;
|
|
|
`)),this.toolbarStyleColorsClass=this.styles.addClass(new me("toolbar_colors",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
|
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
|
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new me("toolbar-block",`
|
|
|
display: inline-block;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new me("toolbar-overflow-block",`
|
|
|
position: absolute;
|
|
|
top: `+this.uiStyleSettings.toolbarHeight+`px;
|
|
|
max-width: `+2*this.uiStyleSettings.toolbarHeight+`px;
|
|
|
z-index: 10;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolbarOverflowBlockStyleColorsClass=this.styles.addClass(new me("toolbar-overflow-block_colors",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
|
`));var N=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new me("toolbar_button",`
|
|
|
display: inline-block;
|
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*N)+`px;
|
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*N)+`px;
|
|
|
padding: `+N+`px;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new me("toolbar_button_colors",`
|
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new me("toolbar_active_button",`
|
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
|
`)),this.styles.addRule(new be("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
|
`)),this.styles.addRule(new be("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
|
`))},ie.prototype.markerToolbarButtonClicked=function(N,F){this.setActiveButton(N),this.buttonClickListeners&&this.buttonClickListeners.length>0&&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 Et=document.createElement("div");Et.className=pe.toolboxButtonStyleClass.name+" "+(($e=pe.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&$e!==void 0?$e:pe.toolboxButtonStyleColorsClass.name),Et.innerHTML=se.icon,Et.title=se.title,Et.addEventListener("click",function(){pe.panelButtonClick(se)}),pe.panelButtons.push(Et),pe.buttonRow.appendChild(Et)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},ie.prototype.panelButtonClick=function(N){var F=this,ae=-1;if(N!==this.activePanel){ae=this.panels.indexOf(N),this.panelRow.innerHTML="";var 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 Et,it;se.className=F.toolboxButtonStyleClass.name+" "+($e===ae?""+((Et=F.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Et!==void 0?Et:F.toolboxActiveButtonStyleColorsClass.name):""+((it=F.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&it!==void 0?it:F.toolboxButtonStyleColorsClass.name))})},ie}(),nt=function(ie,N){this.title=ie,this.icon=N},re=function(ie){function N(F,ae,pe,se){var $e=ie.call(this,F,se||'<svg viewBox="0 0 24 24"><path d="M17.5 12a1.5 1.5 0 01-1.5-1.5A1.5 1.5 0 0117.5 9a1.5 1.5 0 011.5 1.5 1.5 1.5 0 01-1.5 1.5m-3-4A1.5 1.5 0 0113 6.5 1.5 1.5 0 0114.5 5 1.5 1.5 0 0116 6.5 1.5 1.5 0 0114.5 8m-5 0A1.5 1.5 0 018 6.5 1.5 1.5 0 019.5 5 1.5 1.5 0 0111 6.5 1.5 1.5 0 019.5 8m-3 4A1.5 1.5 0 015 10.5 1.5 1.5 0 016.5 9 1.5 1.5 0 018 10.5 1.5 1.5 0 016.5 12M12 3a9 9 0 00-9 9 9 9 0 009 9 1.5 1.5 0 001.5-1.5c0-.39-.15-.74-.39-1-.23-.27-.38-.62-.38-1a1.5 1.5 0 011.5-1.5H16a5 5 0 005-5c0-4.42-4.03-8-9-8z"/></svg>')||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 Et=document.createElement("div");return Et.style.display="inline-block",Et.style.width=se-2+"px",Et.style.height=se-2+"px",Et.style.backgroundColor=F,Et.style.borderRadius=se/2+"px",F==="transparent"&&(Et.style.fill=this.uiStyleSettings.toolboxAccentColor,Et.innerHTML=`<svg viewBox="0 0 24 24">
|
|
|
<path d="M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z" />
|
|
|
</svg>`),$e.appendChild(Et),$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=_e.createGroup(),this.visual.appendChild(_e.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(_e.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return ie.prototype.ownsTarget=function(N){return N===this.visual||N===this.visual.childNodes[0]||N===this.visual.childNodes[1]},ie}(),$=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(_e.createTransform()),se.setupControlBox(),se}return Ce(N,ie),Object.defineProperty(N.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"visual",{get:function(){return this._visual},set:function(F){this._visual=F;var ae=_e.createTransform();this._visual.transform.baseVal.appendItem(ae)},enumerable:!1,configurable:!0}),N.prototype.ownsTarget=function(F){return!!ie.prototype.ownsTarget.call(this,F)||!!(this.controlGrips.findGripByVisual(F)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(F))},N.prototype.pointerDown=function(F,ae){ie.prototype.pointerDown.call(this,F,ae),this.state==="new"&&(this.left=F.x,this.top=F.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var 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=_e.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=_e.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=_e.createGroup();var F=_e.createTransform();F.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(F),this.container.appendChild(this.controlBox),this.controlRect=_e.createRect(this.width+this.CB_DISTANCE,this.height+this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"],["fill","transparent"],["pointer-events","none"]]),this.controlBox.appendChild(this.controlRect),this.globalSettings.disableRotation!==!0&&(this.rotatorGripLine=_e.createLine((this.width+2*this.CB_DISTANCE)/2,this.top-this.CB_DISTANCE,(this.width+2*this.CB_DISTANCE)/2,this.top-3*this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.appendChild(this.rotatorGripLine)),this.controlGrips=new U,this.addControlGrips(),this.controlBox.style.display="none"},N.prototype.adjustControlBox=function(){var F=this.controlBox.transform.baseVal.getItem(0);F.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(F,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},N.prototype.addControlGrips=function(){this.controlGrips.topLeft=this.createGrip(),this.controlGrips.topCenter=this.createGrip(),this.controlGrips.topRight=this.createGrip(),this.controlGrips.centerLeft=this.createGrip(),this.controlGrips.centerRight=this.createGrip(),this.controlGrips.bottomLeft=this.createGrip(),this.controlGrips.bottomCenter=this.createGrip(),this.controlGrips.bottomRight=this.createGrip(),this.globalSettings.disableRotation!==!0&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},N.prototype.createGrip=function(){var F=new q;return F.visual.transform.baseVal.appendItem(_e.createTransform()),this.controlBox.appendChild(F.visual),F},N.prototype.positionGrips=function(){var F=this.controlGrips.topLeft.GRIP_SIZE,ae=-F/2,pe=ae,se=(this.width+this.CB_DISTANCE)/2-F/2,$e=(this.height+this.CB_DISTANCE)/2-F/2,Et=this.height+this.CB_DISTANCE-F/2,it=this.width+this.CB_DISTANCE-F/2;this.positionGrip(this.controlGrips.topLeft.visual,ae,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,Et),this.positionGrip(this.controlGrips.bottomCenter.visual,se,Et),this.positionGrip(this.controlGrips.bottomRight.visual,it,Et),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,se,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=_e.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},N.prototype.pointerDown=function(F,ae){ie.prototype.pointerDown.call(this,F,ae),this.state==="new"&&(this.createVisual(),this.moveVisual(F),this._state="creating")},N.prototype.manipulate=function(F){ie.prototype.manipulate.call(this,F)},N.prototype.resize=function(F){ie.prototype.resize.call(this,F),this.setSize()},N.prototype.setSize=function(){ie.prototype.setSize.call(this),_e.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},N.prototype.pointerUp=function(F){ie.prototype.pointerUp.call(this,F),this.setSize()},N.prototype.setStrokeColor=function(F){this.strokeColor=F,this.visual&&_e.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(F),this.stateChanged()},N.prototype.setFillColor=function(F){this.fillColor=F,this.visual&&_e.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},N.prototype.setStrokeWidth=function(F){this.strokeWidth=F,this.visual&&_e.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},N.prototype.setStrokeDasharray=function(F){this.strokeDasharray=F,this.visual&&_e.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},N.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},ie.prototype.getState.call(this))},N.prototype.restoreState=function(F){var ae=F;this.fillColor=ae.fillColor,this.strokeColor=ae.strokeColor,this.strokeWidth=ae.strokeWidth,this.strokeDasharray=ae.strokeDasharray,this.opacity=ae.opacity,this.createVisual(),ie.prototype.restoreState.call(this,F),this.setSize()},N.prototype.scale=function(F,ae){ie.prototype.scale.call(this,F,ae),this.setSize()},N.title="Rectangle marker",N}(J),ke=function(ie){function N(F,ae,pe,se){var $e=ie.call(this,F,se||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||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 Et=document.createElement("div");Et.style.minHeight="20px",Et.style.flexGrow="2",Et.style.display="flex",Et.style.alignItems="center";var it=document.createElement("hr");it.style.minWidth="20px",it.style.border="0px",it.style.borderTop=pe+"px solid "+F.uiStyleSettings.toolboxColor,it.style.flexGrow="2",Et.appendChild(it),se.appendChild(Et),F.widthBoxes.push(se)}),ae},N.prototype.setCurrentWidth=function(F,ae){var 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||'<svg viewBox="0 0 24 24"><path d="M3 16h5v-2H3v2m6.5 0h5v-2h-5v2m6.5 0h5v-2h-5v2M3 20h2v-2H3v2m4 0h2v-2H7v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2M3 12h8v-2H3v2m10 0h8v-2h-8v2M3 4v4h18V4H3z"/></svg>')||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 Et=`<svg width="100" height="20">
|
|
|
<line x1="0" y1="10" x2="100" y2="10" stroke="`+F.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(pe!==""?'stroke-dasharray="'+pe+'"':"")+` />
|
|
|
</svg>`;$e.innerHTML=Et,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='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',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=_e.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},N.prototype.adjustControlBox=function(){this.positionGrips()},N.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},N.prototype.createGrip=function(){var F=new q;return F.visual.transform.baseVal.appendItem(_e.createTransform()),this.controlBox.appendChild(F.visual),F},N.prototype.positionGrips=function(){var F=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-F/2,this.y1-F/2),this.positionGrip(this.grip2.visual,this.x2-F/2,this.y2-F/2)},N.prototype.positionGrip=function(F,ae,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=_e.createGroup(),this.selectorLine=_e.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=_e.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},N.prototype.pointerDown=function(F,ae){ie.prototype.pointerDown.call(this,F,ae),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},N.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),_e.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),_e.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),_e.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},N.prototype.setStrokeColor=function(F){this.strokeColor=F,this.adjustVisual(),this.colorChanged(F)},N.prototype.setStrokeWidth=function(F){this.strokeWidth=F,this.adjustVisual()},N.prototype.setStrokeDasharray=function(F){this.strokeDasharray=F,this.adjustVisual(),this.stateChanged()},Object.defineProperty(N.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),N.prototype.getState=function(){var F=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},ie.prototype.getState.call(this));return F.typeName=N.typeName,F},N.prototype.restoreState=function(F){ie.prototype.restoreState.call(this,F);var ae=F;this.strokeColor=ae.strokeColor,this.strokeWidth=ae.strokeWidth,this.strokeDasharray=ae.strokeDasharray,this.createVisual(),this.adjustVisual()},N.typeName="LineMarker",N.title="Line marker",N.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',N}(tt),Qe=function(ie){function N(F,ae,pe,se){var $e=ie.call(this,F,se||'<svg viewBox="0 0 24 24"><path d="M17 8h3v12h1v1h-4v-1h1v-3h-4l-1.5 3H14v1h-4v-1h1l6-12m1 1l-3.5 7H18V9M5 3h5c1.11 0 2 .89 2 2v11H9v-5H6v5H3V5c0-1.11.89-2 2-2m1 2v4h3V5H6z"/></svg>')||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 Et=document.createElement("div");Et.style.whiteSpace="nowrap",Et.style.overflow="hidden",Et.style.textOverflow="ellipsis",Et.innerHTML="The quick brown fox jumps over the lazy dog",$e.appendChild(Et),se.appendChild($e),F.fontBoxes.push(se)}),ae},N.prototype.setCurrentFont=function(F,ae){var 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=_e.createGroup(),this.bgRectangle=_e.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=_e.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(_e.createTransform()),this.textElement.transform.baseVal.appendItem(_e.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},N.prototype.pointerDown=function(F,ae){ie.prototype.pointerDown.call(this,F,ae),this.isMoved=!1,this.pointerDownPoint=F,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(F),this._state="creating")},N.prototype.renderText=function(){var F=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(ae){F.textElement.appendChild(_e.createTSpan(ae.trim()===""?" ":ae.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},N.prototype.getTextScale=function(){var F=this.textElement.getBBox(),ae=1;if(F.width>0&&F.height>0){var 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&&(_e.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),_e.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},N.prototype.pointerUp=function(F){var ae=this.state;ae==="creating"&&(this._suppressMarkerCreateEvent=!0),ie.prototype.pointerUp.call(this,F),this.setSize(),(ae==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},N.prototype.showTextEditor=function(){var F=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(ae){ae.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var ae=Number.parseFloat(F.textEditor.style.fontSize);F.textEditor.clientWidth>=Number.parseInt(F.textEditor.style.maxWidth)&&ae>.9;)ae-=.1,F.textEditor.style.fontSize=Math.max(ae,.9)+"em"}),this.textEditor.addEventListener("keyup",function(ae){ae.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(ae){if(ae.clipboardData){var 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&&_e.setAttributes(this.textElement,[["fill",F]]),this.color=F,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(F)},N.prototype.setFont=function(F){this.textElement&&_e.setAttributes(this.textElement,[["font-family",F]]),this.fontFamily=F,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},N.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},N.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(N.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),N.prototype.getState=function(){var F=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},ie.prototype.getState.call(this));return F.typeName=N.typeName,F},N.prototype.restoreState=function(F){var ae=F;this.color=ae.color,this.fontFamily=ae.fontFamily,this.padding=ae.padding,this.text=ae.text,this.createVisual(),ie.prototype.restoreState.call(this,F),this.setSize()},N.prototype.scale=function(F,ae){ie.prototype.scale.call(this,F,ae),this.setSize(),this.sizeText(),this.positionTextEditor()},N.typeName="TextMarker",N.title="Text marker",N.icon='<svg viewBox="0 0 24 24"><path d="M9.6 14L12 7.7l2.4 6.3M11 5L5.5 19h2.2l1.1-3H15l1.1 3h2.2L13 5h-2z"/></svg>',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=_e.createGroup(),this.drawingImage=_e.createImage(),this.visual.appendChild(this.drawingImage);var F=_e.createTransform();this.visual.transform.baseVal.appendItem(F),this.addMarkerVisualToContainer(this.visual)},N.prototype.pointerDown=function(F,ae){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(F.x,F.y),this.drawing=!0):ie.prototype.pointerDown.call(this,F,ae)},N.prototype.manipulate=function(F){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(F.x,F.y),this.canvasContext.stroke()):ie.prototype.manipulate.call(this,F)},N.prototype.resize=function(F){ie.prototype.resize.call(this,F),_e.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),_e.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},N.prototype.pointerUp=function(F){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):ie.prototype.pointerUp.call(this,F)},N.prototype.addCanvas=function(){this.overlayContainer.innerHTML="",this.canvasElement=document.createElement("canvas"),this.canvasElement.width=this.overlayContainer.clientWidth*this.pixelRatio,this.canvasElement.height=this.overlayContainer.clientHeight*this.pixelRatio,this.canvasContext=this.canvasElement.getContext("2d"),this.canvasContext.scale(this.pixelRatio,this.pixelRatio),this.overlayContainer.appendChild(this.canvasElement)},N.prototype.select=function(){this.state==="creating"&&this.finishCreation(),ie.prototype.select.call(this)},N.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),ie.prototype.deselect.call(this)},N.prototype.finishCreation=function(){for(var F=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),ae=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],pe=ae[0],se=ae[1],$e=ae[2],Et=ae[3],it=!1,Vt=0;Vt<this.canvasElement.height;Vt++)for(var At=0;At<this.canvasElement.width;At++)F.data[Vt*this.canvasElement.width*4+4*At+3]>0&&(it=!0,Vt<se&&(se=Vt),At<pe&&(pe=At),Vt>Et&&(Et=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=(Et-se)/this.pixelRatio;var Bt=document.createElement("canvas");Bt.width=$e-pe,Bt.height=Et-se,Bt.getContext("2d").putImageData(this.canvasContext.getImageData(pe,se,$e-pe,Et-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(){_e.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),_e.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},N.prototype.setColor=function(F){this.color=F,this.colorChanged(F)},N.prototype.setLineWidth=function(F){this.lineWidth=F},Object.defineProperty(N.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),N.prototype.getState=function(){var F=Object.assign({drawingImgUrl:this.drawingImgUrl},ie.prototype.getState.call(this));return F.typeName=N.typeName,F},N.prototype.restoreState=function(F){this.createVisual(),ie.prototype.restoreState.call(this,F),this.drawingImgUrl=F.drawingImgUrl,this.setDrawingImage()},N.prototype.scale=function(F,ae){ie.prototype.scale.call(this,F,ae),this.setDrawingImage()},N.typeName="FreehandMarker",N.title="Freehand marker",N.icon='<svg viewBox="0 0 24 24"><path d="M9.75 20.85c1.78-.7 1.39-2.63.49-3.85-.89-1.25-2.12-2.11-3.36-2.94A9.817 9.817 0 014.54 12c-.28-.33-.85-.94-.27-1.06.59-.12 1.61.46 2.13.68.91.38 1.81.82 2.65 1.34l1.01-1.7C8.5 10.23 6.5 9.32 4.64 9.05c-1.06-.16-2.18.06-2.54 1.21-.32.99.19 1.99.77 2.77 1.37 1.83 3.5 2.71 5.09 4.29.34.33.75.72.95 1.18.21.44.16.47-.31.47-1.24 0-2.79-.97-3.8-1.61l-1.01 1.7c1.53.94 4.09 2.41 5.96 1.79m11.09-15.6c.22-.22.22-.58 0-.79l-1.3-1.3a.562.562 0 00-.78 0l-1.02 1.02 2.08 2.08M11 10.92V13h2.08l6.15-6.15-2.08-2.08L11 10.92z"/></svg>',N}(J),Ie=function(ie){function N(F,ae,pe){var se=ie.call(this,F,pe||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||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(Et){var it="both";switch(Et){case 0:it="both";break;case 1:it="start";break;case 2:it="end";break;case 3:it="none"}var Vt=document.createElement("div");if(Vt.style.display="flex",Vt.style.flexGrow="2",Vt.style.alignItems="center",Vt.style.justifyContent="space-between",Vt.style.padding="5px",Vt.style.borderWidth="2px",Vt.style.borderStyle="solid",Vt.style.borderColor=it===se.currentType?se.uiStyleSettings.toolboxAccentColor:"transparent",Vt.addEventListener("click",function(){F.setCurrentType(it,Vt)}),ae.appendChild(Vt),it==="both"||it==="start"){var At=document.createElement("div");At.style.display="flex",At.style.alignItems="center",At.style.minHeight="20px",At.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
|
|
|
<polygon points="0,5 10,0 10,10" fill="`+(se.uiStyleSettings!==void 0?se.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
|
</svg>`,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=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
|
|
|
<polygon points="0,0 10,5 0,10" fill="`+(se.uiStyleSettings!==void 0?se.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
|
</svg>`,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=_e.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(_e.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=_e.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(_e.createTransform()),this.visual.appendChild(this.arrow2)},N.prototype.pointerDown=function(F,ae){ie.prototype.pointerDown.call(this,F,ae),this.state==="creating"&&this.createTips()},N.prototype.adjustVisual=function(){if(ie.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",_e.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),_e.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var F=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),ae=this.arrow1.transform.baseVal.getItem(0);ae.setRotate(F,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(ae,0);var 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='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',N}(mt),Ee=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='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',N}(xe),Ae=function(ie){function N(F,ae,pe,se){var $e=ie.call(this,F,se||'<svg viewBox="0 0 24 24"><path d="M17.66 8L12 2.35 6.34 8A8.02 8.02 0 004 13.64c0 2 .78 4.11 2.34 5.67a7.99 7.99 0 0011.32 0c1.56-1.56 2.34-3.67 2.34-5.67S19.22 9.56 17.66 8M6 14c0-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 18 12 18 14H6z"/></svg>')||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&&_e.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(N.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),N.prototype.getState=function(){var F=ie.prototype.getState.call(this);return F.typeName=N.typeName,F},N.typeName="HighlightMarker",N.title="Highlight marker",N.icon='<svg viewBox="0 0 24 24"><path d="M18.5 1.15c-.53 0-1.04.19-1.43.58l-5.81 5.82 5.65 5.65 5.82-5.81c.77-.78.77-2.04 0-2.83l-2.84-2.83c-.39-.39-.89-.58-1.39-.58M10.3 8.5l-5.96 5.96c-.78.78-.78 2.04.02 2.85C3.14 18.54 1.9 19.77.67 21h5.66l.86-.86c.78.76 2.03.75 2.81-.02l5.95-5.96"/></svg>',N}(Ee),Te='<svg viewBox="0 0 24 24"><path d="M19 11.5s-2 2.17-2 3.5a2 2 0 002 2 2 2 0 002-2c0-1.33-2-3.5-2-3.5M5.21 10L10 5.21 14.79 10m1.77-1.06L7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.56-.59 1.53 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.59.59-1.56 0-2.12z"/></svg>',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,'<svg viewBox="0 0 24 24"><path d="M9.62 12L12 5.67 14.37 12M11 3L5.5 17h2.25l1.12-3h6.25l1.13 3h2.25L13 3h-2z"/></svg>'),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(_e.createTransform()),se.controlBox.appendChild(se.tipGrip.visual),se}return Ce(N,ie),N.prototype.ownsTarget=function(F){return ie.prototype.ownsTarget.call(this,F)||this.tipGrip.ownsTarget(F)||this.tip===F},N.prototype.createTip=function(){_e.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=_e.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},N.prototype.pointerDown=function(F,ae){this.state==="new"&&ie.prototype.pointerDown.call(this,F,ae),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(ae)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):ie.prototype.pointerDown.call(this,F,ae)},N.prototype.pointerUp=function(F){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,ie.prototype.pointerUp.call(this,F);else{var ae=this.state==="creating";ie.prototype.pointerUp.call(this,F),this.setTipPoints(ae),this.positionTip()}},N.prototype.manipulate=function(F){if(this.tipMoving){var ae=this.unrotatePoint(F);this.tipPosition={x:ae.x-this.manipulationStartLeft,y:ae.y-this.manipulationStartTop},this.positionTip()}else ie.prototype.manipulate.call(this,F)},N.prototype.setBgColor=function(F){this.bgRectangle&&this.tip&&(_e.setAttributes(this.bgRectangle,[["fill",F]]),_e.setAttributes(this.tip,[["fill",F]])),this.bgColor=F,this.fillColorChanged(F)},N.prototype.getTipPoints=function(){return this.setTipPoints(this.state==="creating"),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},N.prototype.setTipPoints=function(F){F===void 0&&(F=!1);var ae=Math.min(this.height/2,15),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.height/2?se<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(pe=this.width/5,ae=Math.min(this.width/2,15),this.tipBase1Position={x:ae,y:0},this.tipBase2Position={x:ae+pe,y:0}):(this.tipBase1Position={x:0,y:ae},this.tipBase2Position={x:0,y:ae+pe}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?se<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(pe=this.width/5,ae=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-ae-pe,y:0},this.tipBase2Position={x:this.width-ae,y:0}):(this.tipBase1Position={x:this.width,y:ae},this.tipBase2Position={x:this.width,y:ae+pe}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?se<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(pe=this.width/5,ae=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-ae-pe,y:this.height},this.tipBase2Position={x:this.width-ae,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-ae-pe},this.tipBase2Position={x:this.width,y:this.height-ae}):se<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(pe=this.width/5,ae=Math.min(this.width/2,15),this.tipBase1Position={x:ae,y:this.height},this.tipBase2Position={x:ae+pe,y:this.height}):(this.tipBase1Position={x:0,y:this.height-ae},this.tipBase2Position={x:0,y:this.height-ae-pe})},N.prototype.resize=function(F){ie.prototype.resize.call(this,F),this.positionTip()},N.prototype.positionTip=function(){_e.setAttributes(this.tip,[["points",this.getTipPoints()]]);var F=this.tipGrip.visual.transform.baseVal.getItem(0);F.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(F,0)},Object.defineProperty(N.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),N.prototype.select=function(){this.positionTip(),ie.prototype.select.call(this)},N.prototype.getState=function(){var F=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},ie.prototype.getState.call(this));return F.typeName=N.typeName,F},N.prototype.restoreState=function(F){var ae=F;this.bgColor=ae.bgColor,this.tipPosition=ae.tipPosition,ie.prototype.restoreState.call(this,F),this.createTip(),this.setTipPoints()},N.prototype.scale=function(F,ae){ie.prototype.scale.call(this,F,ae),this.tipPosition={x:this.tipPosition.x*F,y:this.tipPosition.y*ae},this.positionTip()},N.typeName="CalloutMarker",N.title="Callout marker",N.icon='<svg viewBox="0 0 24 24"><path d="M4 2h16a2 2 0 012 2v12a2 2 0 01-2 2h-4l-4 4-4-4H4a2 2 0 01-2-2V4a2 2 0 012-2m0 2v12h4.83L12 19.17 15.17 16H20V4H4m2 3h12v2H6V7m0 4h10v2H6v-2z"/></svg>',N}(Xe),ut=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.strokeColor=pe.defaultColor,se.strokeWidth=pe.defaultStrokeWidth,se.strokeDasharray=pe.defaultStrokeDasharray,se.fillColor=pe.defaultFillColor,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.setOpacity=se.setOpacity.bind(se),se.createVisual=se.createVisual.bind(se),se.strokePanel=new re("Line color",ye(pe.defaultColorSet,["transparent"]),pe.defaultColor),se.strokePanel.onColorChanged=se.setStrokeColor,se.fillPanel=new re("Fill color",ye(pe.defaultColorSet,["transparent"]),se.fillColor,Te),se.fillPanel.onColorChanged=se.setFillColor,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.opacityPanel=new Ae("Opacity",pe.defaultOpacitySteps,se.opacity),se.opacityPanel.onOpacityChanged=se.setOpacity,se}return Ce(N,ie),N.prototype.ownsTarget=function(F){return!(!ie.prototype.ownsTarget.call(this,F)&&F!==this.visual)},N.prototype.createVisual=function(){this.visual=_e.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},N.prototype.pointerDown=function(F,ae){ie.prototype.pointerDown.call(this,F,ae),this.state==="new"&&(this.createVisual(),this.moveVisual(F),this._state="creating")},N.prototype.manipulate=function(F){ie.prototype.manipulate.call(this,F)},N.prototype.resize=function(F){ie.prototype.resize.call(this,F),this.setSize()},N.prototype.setSize=function(){ie.prototype.setSize.call(this),_e.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},N.prototype.pointerUp=function(F){ie.prototype.pointerUp.call(this,F),this.setSize()},N.prototype.setStrokeColor=function(F){this.strokeColor=F,this.visual&&_e.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(F),this.stateChanged()},N.prototype.setFillColor=function(F){this.fillColor=F,this.visual&&_e.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(F),this.stateChanged()},N.prototype.setStrokeWidth=function(F){this.strokeWidth=F,this.visual&&_e.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},N.prototype.setStrokeDasharray=function(F){this.strokeDasharray=F,this.visual&&_e.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},N.prototype.setOpacity=function(F){this.opacity=F,this.visual&&_e.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(N.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),N.prototype.getState=function(){var F=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},ie.prototype.getState.call(this));return F.typeName=N.typeName,F},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.typeName="EllipseMarker",N.title="Ellipse marker",N.icon='<svg viewBox="0 0 24 24"><path d="M12 4C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',N}(J),Ct=function(ie){function N(F,ae,pe){return ie.call(this,F,ae,pe)||this}return Ce(N,ie),Object.defineProperty(N.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),N.prototype.ownsTarget=function(F){return!(!ie.prototype.ownsTarget.call(this,F)&&F!==this.tip1&&F!==this.tip2)},N.prototype.createTips=function(){this.tip1=_e.createLine(this.x1-this.tipLength/2,this.y1,this.x1+this.tipLength/2,this.y1,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip1.transform.baseVal.appendItem(_e.createTransform()),this.visual.appendChild(this.tip1),this.tip2=_e.createLine(this.x2-this.tipLength/2,this.y2,this.x2+this.tipLength/2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip2.transform.baseVal.appendItem(_e.createTransform()),this.visual.appendChild(this.tip2)},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.tip1&&this.tip2&&(_e.setAttributes(this.tip1,[["x1",(this.x1-this.tipLength/2).toString()],["y1",this.y1.toString()],["x2",(this.x1+this.tipLength/2).toString()],["y2",this.y1.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),_e.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),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.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='<svg viewBox="0 0 24 24"><path d="M1.39 18.36l1.77-1.76L4.58 18l1.06-1.05-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.42 1.41L10.59 12l-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.41 1.41 1.07-1.06-1.42-1.41 1.42-1.42L18 6.7l1.07-1.06-2.47-2.48 1.76-1.77 4.25 4.25L5.64 22.61l-4.25-4.25z"/></svg>',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='<svg viewBox="0 0 24 24"><path d="M12 6c4.41 0 8 2.69 8 6s-3.59 6-8 6-8-2.69-8-6 3.59-6 8-6m0-2C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',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=_e.createGroup(),this.selectorCurve=_e.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=_e.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},N.prototype.pointerDown=function(F,ae){ie.prototype.pointerDown.call(this,F,ae),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=F.x,this.curveY=F.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(ae)&&(this.activeGrip=this.curveGrip,this._state="resize")},N.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),_e.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),_e.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),_e.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},N.prototype.setupControlBox=function(){ie.prototype.setupControlBox.call(this),this.curveControlLine1=_e.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=_e.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},N.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,ie.prototype.addControlGrips.call(this)},N.prototype.positionGrips=function(){ie.prototype.positionGrips.call(this);var F=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-F/2,this.curveY-F/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},N.prototype.manipulate=function(F){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+F.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+F.y-this.manipulationStartY),ie.prototype.manipulate.call(this,F)},N.prototype.resize=function(F){this.activeGrip===this.curveGrip&&(this.curveX=F.x,this.curveY=F.y),ie.prototype.resize.call(this,F),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},N.prototype.setStrokeColor=function(F){this.strokeColor=F,this.adjustVisual(),this.colorChanged(F)},N.prototype.setStrokeWidth=function(F){this.strokeWidth=F,this.adjustVisual()},N.prototype.setStrokeDasharray=function(F){this.strokeDasharray=F,this.adjustVisual()},N.prototype.scale=function(F,ae){this.curveX=this.curveX*F,this.curveY=this.curveY*ae,ie.prototype.scale.call(this,F,ae)},Object.defineProperty(N.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),N.prototype.getState=function(){var F=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},ie.prototype.getState.call(this));return F.typeName=N.typeName,F},N.prototype.restoreState=function(F){ie.prototype.restoreState.call(this,F);var ae=F;this.strokeColor=ae.strokeColor,this.strokeWidth=ae.strokeWidth,this.strokeDasharray=ae.strokeDasharray,this.curveX=ae.curveX,this.curveY=ae.curveY,this.createVisual(),this.adjustVisual()},N.typeName="CurveMarker",N.title="Curve marker",N.icon='<svg viewBox="0 0 24 24"><path d="M18.5 2A1.5 1.5 0 0120 3.5 1.5 1.5 0 0118.5 5c-.23 0-.45-.05-.65-.15l-3.69 3.7.34.45c2.19-1.26 4.76-2 7.5-2l1 .03v2.01L22 9c-2.58 0-5 .75-7 2.04A3.96 3.96 0 0111.04 15C9.75 17 9 19.42 9 22l.04 1H7.03L7 22c0-2.74.74-5.31 2-7.5l-.45-.34-3.7 3.69c.1.2.15.42.15.65A1.5 1.5 0 013.5 20 1.5 1.5 0 012 18.5 1.5 1.5 0 013.5 17c.23 0 .45.05.65.15l3.69-3.7C7.31 12.78 7 11.92 7 11a4 4 0 014-4c.92 0 1.78.31 2.45.84l3.7-3.69c-.1-.2-.15-.42-.15-.65A1.5 1.5 0 0118.5 2M11 9a2 2 0 00-2 2 2 2 0 002 2 2 2 0 002-2 2 2 0 00-2-2z"/></svg>',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,Ee,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;ae<arguments.length;ae++)F[ae]=arguments[ae];(N=this._availableMarkerTypes).push.apply(N,F)},ie.prototype.addRenderEventListener=function(N){this.addEventListener("render",function(F){N(F.dataUrl,F.state)})},ie.prototype.removeRenderEventListener=function(N){},ie.prototype.addCloseEventListener=function(N){this.addEventListener("close",function(){N()})},ie.prototype.removeCloseEventListener=function(N){},ie.prototype.setupResizeObserver=function(){var N=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){N.resize(N.target.clientWidth,N.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return N.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},ie.prototype.onPopupTargetResize=function(){var N=1*this.target.clientWidth/this.target.clientHeight,F=this.editorCanvas.clientWidth/N>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*N:this.editorCanvas.clientWidth,ae=F<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/N;this.resize(F,ae)},ie.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},ie.prototype.resize=function(N,F){this._isResizing=!0;var ae=N/this.imageWidth,pe=F/this.imageHeight;this.imageWidth=Math.round(N),this.imageHeight=Math.round(F),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px",this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.settings.displayMode!=="popup"?this.coverDiv.style.width=this.imageWidth.toString()+"px":(this.setTopLeft(),this.positionMarkerImage()),this.toolbar!==void 0&&this.toolbar.adjustLayout(),this.positionLogo(),this.scaleMarkers(ae,pe),this._isResizing=!1},ie.prototype.scaleMarkers=function(N,F){var ae,pe=this;this._currentMarker&&this._currentMarker instanceof Xe?this._currentMarker.scale(N,F):(ae=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(se){se!==pe._currentMarker&&se.scale(N,F)}),ae!==void 0&&this.setCurrentMarker(ae)},ie.prototype.setEditingTarget=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px"},ie.prototype.setTopLeft=function(){var N=this.editingTarget.getBoundingClientRect(),F=this.editorCanvas.getBoundingClientRect();this.left=N.left-F.left,this.top=N.top-F.top},ie.prototype.initMarkerCanvas=function(){this.markerImageHolder=document.createElement("div"),this.markerImageHolder.style.setProperty("touch-action","pinch-zoom"),this.markerImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.markerImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImage.style.pointerEvents="auto",this.markerImageHolder.style.position="absolute",this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.markerImageHolder.style.transformOrigin="top left",this.positionMarkerImage(),this.markerImageHolder.appendChild(this.markerImage),this.editorCanvas.appendChild(this.markerImageHolder)},ie.prototype.addDefs=function(){for(var N,F=[],ae=0;ae<arguments.length;ae++)F[ae]=arguments[ae];this.defs=_e.createDefs(),this.addDefsToImage(),(N=this.defs).append.apply(N,F)},ie.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},ie.prototype.initOverlay=function(){this.overlayContainer=document.createElement("div"),this.overlayContainer.style.position="absolute",this.overlayContainer.style.left="0px",this.overlayContainer.style.top="0px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.overlayContainer.style.display="flex",this.markerImageHolder.appendChild(this.overlayContainer)},ie.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},ie.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},ie.prototype.attachWindowEvents=function(){window.addEventListener("pointermove",this.onPointerMove),window.addEventListener("pointerup",this.onPointerUp),window.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("pointerout",this.onPointerOut),window.addEventListener("pointerleave",this.onPointerUp),window.addEventListener("resize",this.onWindowResize),window.addEventListener("keyup",this.onKeyUp)},ie.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},ie.prototype.detachWindowEvents=function(){window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("pointerout",this.onPointerOut),window.removeEventListener("pointerleave",this.onPointerUp),window.removeEventListener("resize",this.onWindowResize),window.removeEventListener("keyup",this.onKeyUp)},ie.prototype.addLogo=function(){this.logoUI=document.createElement("div"),this.logoUI.style.display="inline-block",this.logoUI.style.margin="0px",this.logoUI.style.padding="0px",this.logoUI.style.fill="#333333";var N=document.createElement("a");N.href="https://markerjs.com/",N.target="_blank",N.innerHTML='<svg viewBox="0 0 112 96" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path fill="#e5f20d" fill-opacity=".647" d="M0 40.386h111.96V95.62H0z"/><path d="M93.61 61.452c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.591 1.048-1.481 0-2.222-.74-2.222-2.22 0-16.617-.533-29.347-1.604-38.192-1.068-8.842-2.92-13.265-5.552-13.265-4.443 0-10.94 15.509-19.497 46.52v.124c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.592 1.048-1.48 0-2.22-.74-2.22-2.22 0-3.29.165-8.392.493-15.302.33-7.732.494-13.82.494-18.262 0-6.17-.186-10.55-.556-13.142-.37-2.591-1.172-3.887-2.406-3.887-2.796 0-6.333 5.12-10.612 15.363C38.494 34.367 34.01 46.44 29.32 60.34l-1.11 3.209a5.714 5.714 0 01-1.42 2.097c-.617.578-1.295.864-2.036.864-.987 0-1.644-.081-1.974-.247-.328-.162-.533-.656-.617-1.48-.41-4.03-.74-9.418-.987-16.165-.163-1.728-.329-4.566-.494-8.515-.822-13.901-1.562-23.3-2.221-28.196-.657-4.893-.987-7.628-.987-8.205 0-.657.33-1.44.987-2.345.659-.903 1.276-1.357 1.85-1.357 1.319 0 2.387.947 3.21 2.838.411.906.863 4.526 1.357 10.859.493 6.335.905 14.19 1.233 23.568l.617 18.88c4.527-13.983 9.216-26.673 14.068-38.068C45.65 6.686 50.093.988 54.123.988c2.715 0 4.566 1.974 5.553 5.923.987 3.949 1.481 9.667 1.481 17.152 0 3.949-.081 9.625-.247 17.029l-.123 5.676c3.373-11.762 6.725-21.634 10.057-29.615 3.331-7.979 6.685-11.97 10.056-11.97 8.475 0 12.71 18.757 12.71 56.269z" fill-rule="nonzero"/></svg>',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<this.styles.settings.toolbarHeight&&(this.editingTarget.style.marginTop=this.target.offsetTop-this.styles.settings.toolbarHeight+"px"),this.editorCanvas.appendChild(this.editingTarget),this.toolbox=new ze(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},ie.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},ie.prototype.removeMarker=function(N){this.markerImage.removeChild(N.container),this.markers.indexOf(N)>-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 Et=new pt(N,void 0,!0);$e(Et),Et.defaultPrevented&&(F=!0)}),!F)){this.setCurrentMarker();for(var ae=function($e){var Et=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,Et))})},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),pe<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(se){return se(new Lt(N))})}else this.undoRedoManager.replaceLastUndoStep(F),this.eventListeners.statechange.forEach(function(se){return se(new Lt(N))})}},ie.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},ie.prototype.undoStep=function(){var N=this,F=this.undoRedoManager.undo();F!==void 0&&(this.restoreState(F),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(ae){return ae(new Lt(N))}))},ie.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},ie.prototype.redoStep=function(){var N=this,F=this.undoRedoManager.redo();F!==void 0&&(this.restoreState(F),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(ae){return ae(new Lt(N))}))},ie.prototype.stepZoom=function(){var N=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=N<this.zoomSteps.length-1?this.zoomSteps[N+1]:this.zoomSteps[0]},ie.prototype.panTo=function(N){this.contentDiv.scrollBy({left:this.prevPanPoint.x-N.x,top:this.prevPanPoint.y-N.y}),this.prevPanPoint=N},ie.prototype.startRenderAndClose=function(){return Se(this,void 0,void 0,function(){var N,F,ae=this;return Pe(this,function(pe){switch(pe.label){case 0:return[4,this.render()];case 1:return N=pe.sent(),F=this.getState(),this.eventListeners.render.forEach(function(se){return se(new at(ae,N,F))}),this.close(!0),[2]}})})},ie.prototype.getState=function(N){N===!0&&this.setCurrentMarker();var F={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(ae){return F.markers.push(ae.getState())}),F},ie.prototype.restoreState=function(N){var F=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);N.markers.forEach(function(ae){var pe=F._availableMarkerTypes.find(function($e){return $e.typeName===ae.typeName});if(pe!==void 0){var se=F.addNewMarker(pe);se.restoreState(ae),F.markers.push(se)}}),N.width&&N.height&&(N.width!==this.imageWidth||N.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/N.width,this.imageHeight/N.height),this.eventListeners.restorestate.forEach(function(ae){return ae(new Lt(F))})},ie.prototype.addNewMarker=function(N){var F=_e.createGroup();return this.markerImage.appendChild(F),new N(F,this.overlayContainer,this.settings)},ie.prototype.createNewMarker=function(N){var F,ae=this;(F=typeof N=="string"?this._availableMarkerTypes.find(function(pe){return pe.typeName===N}):N)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(F),this._currentMarker.onMarkerCreated=this.markerCreated,this._currentMarker.onColorChanged=this.colorChanged,this._currentMarker.onFillColorChanged=this.fillColorChanged,this._currentMarker.onStateChanged=this.markerStateChanged,this.markerImage.style.cursor="crosshair",this.toolbar.setActiveMarkerButton(F.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(pe){return pe(new pt(ae,ae._currentMarker))}))},ie.prototype.markerCreated=function(N){var F=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(N),this.setCurrentMarker(N),N instanceof Be&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(Be):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(ae){return ae(new pt(F,F._currentMarker))})},ie.prototype.colorChanged=function(N){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=N,this.settings.defaultStrokeColor=N)},ie.prototype.fillColorChanged=function(N){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=N)},ie.prototype.markerStateChanged=function(N){var F=this;this.eventListeners.markerchange.forEach(function(ae){return ae(new pt(F,N))})},ie.prototype.setCurrentMarker=function(N){var F=this;this._currentMarker!==N&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(ae){return ae(new pt(F,F._currentMarker))})),this._currentMarker=N,this._currentMarker===void 0||this._currentMarker.isSelected||(this._currentMarker.state!=="new"&&this._currentMarker.select(),this.toolbar.setCurrentMarker(this._currentMarker),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this._isResizing||this.eventListeners.markerselect.forEach(function(ae){return ae(new pt(F,F._currentMarker))}))},ie.prototype.onPointerDown=function(N){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||N.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var F=this.markers.find(function(ae){return ae.ownsTarget(N.target)});F!==void 0?(this.setCurrentMarker(F),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(N.clientX,N.clientY),N.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:N.clientX,y:N.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(N.clientX,N.clientY))},ie.prototype.onDblClick=function(N){if(this._isFocused||this.focus(),this.mode==="select"){var F=this.markers.find(function(ae){return ae.ownsTarget(N.target)});F!==void 0&&F!==this._currentMarker&&this.setCurrentMarker(F),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(N.clientX,N.clientY),N.target):this.setCurrentMarker()}},ie.prototype.onPointerMove=function(N){this.touchPoints!==1&&N.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||N.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(N.clientX,N.clientY)):this.zoomLevel>1&&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 Et(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,Et)}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:Et(0),throw:Et(1),return:Et(2)},typeof Symbol=="function"&&(se[Symbol.iterator]=function(){return this}),se;function Et(it){return function(Vt){return function(At){if(F)throw new TypeError("Generator is already executing.");for(;$e;)try{if(F=1,ae&&(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]<pe[3])){$e.label=At[1];break}if(At[0]===6&&$e.label<pe[1]){$e.label=pe[1],pe=At;break}if(pe&&$e.label<pe[2]){$e.label=pe[2],$e.ops.push(At);break}pe[2]&&$e.ops.pop(),$e.trys.pop();continue}At=N.call(ie,$e)}catch(Bt){At=[6,Bt],ae=0}finally{F=pe=0}if(5&At[0])throw At[1];return{value:At[0]?At[1]:void 0,done:!0}}([it,Vt])}}}var Dt=function(){function ie(){}return ie.addKey=function(N){ie.key=N},Object.defineProperty(ie,"isLicensed",{get:function(){return!!ie.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(ie.key)},enumerable:!1,configurable:!0}),ie}(),rt=function(){function ie(){}return ie.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},ie.setAttributes=function(N,F){for(var ae=0,pe=F;ae<pe.length;ae++){var se=pe[ae],$e=se[0],Et=se[1];N.setAttribute($e,Et)}},ie.createRect=function(N,F,ae){var pe=document.createElementNS("http://www.w3.org/2000/svg","rect");return pe.setAttribute("width",N.toString()),pe.setAttribute("height",F.toString()),ae&&ie.setAttributes(pe,ae),pe},ie.createLine=function(N,F,ae,pe,se){var $e=document.createElementNS("http://www.w3.org/2000/svg","line");return $e.setAttribute("x1",N.toString()),$e.setAttribute("y1",F.toString()),$e.setAttribute("x2",ae.toString()),$e.setAttribute("y2",pe.toString()),se&&ie.setAttributes($e,se),$e},ie.createPolygon=function(N,F){var ae=document.createElementNS("http://www.w3.org/2000/svg","polygon");return ae.setAttribute("points",N),F&&ie.setAttributes(ae,F),ae},ie.createCircle=function(N,F){var ae=document.createElementNS("http://www.w3.org/2000/svg","circle");return ae.setAttribute("cx",(N/2).toString()),ae.setAttribute("cy",(N/2).toString()),ae.setAttribute("r",N.toString()),F&&ie.setAttributes(ae,F),ae},ie.createEllipse=function(N,F,ae){var pe=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return pe.setAttribute("cx",(N/2).toString()),pe.setAttribute("cy",(F/2).toString()),pe.setAttribute("rx",(N/2).toString()),pe.setAttribute("ry",(F/2).toString()),ae&&ie.setAttributes(pe,ae),pe},ie.createGroup=function(N){var F=document.createElementNS("http://www.w3.org/2000/svg","g");return N&&ie.setAttributes(F,N),F},ie.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},ie.createMarker=function(N,F,ae,pe,se,$e,Et){var it=document.createElementNS("http://www.w3.org/2000/svg","marker");return ie.setAttributes(it,[["id",N],["orient",F],["markerWidth",ae.toString()],["markerHeight",pe.toString()],["refX",se.toString()],["refY",$e.toString()]]),it.appendChild(Et),it},ie.createText=function(N){var F=document.createElementNS("http://www.w3.org/2000/svg","text");return F.setAttribute("x","0"),F.setAttribute("y","0"),N&&ie.setAttributes(F,N),F},ie.createTSpan=function(N,F){var ae=document.createElementNS("http://www.w3.org/2000/svg","tspan");return ae.textContent=N,F&&ie.setAttributes(ae,F),ae},ie.createImage=function(N){var F=document.createElementNS("http://www.w3.org/2000/svg","image");return N&&ie.setAttributes(F,N),F},ie.createPoint=function(N,F){var ae=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return ae.x=N,ae.y=F,ae},ie.createPath=function(N,F){var ae=document.createElementNS("http://www.w3.org/2000/svg","path");return ae.setAttribute("d",N),F&&ie.setAttributes(ae,F),ae},ie.createElement=function(N,F){var ae=document.createElementNS("http://www.w3.org/2000/svg",N);return F&&ie.setAttributes(ae,F),ae},ie.getHollowRectanglePath=function(N,F,ae,pe,se,$e,Et,it){return"M"+N+","+F+"V"+(F+pe)+"H"+(N+ae)+"V"+F+"H"+se+"V"+$e+"H"+(se+Et)+"V"+($e+it)+"H"+se+"V"+F+"Z"},ie}(),Tt=function(){function ie(N){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+N+"_"}return Object.defineProperty(ie.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#333333",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarBackgroundActiveColor:"#282828",toolbarColor:"#eeeeee",cropShadeColor:"#ffffff",cropFrameColor:"#ffffff",gripColor:"#333333",gripFillColor:"#cccccc",toolbarHeight:40}},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),ie.prototype.addClass=function(N){return this.styleSheet===void 0&&this.addStyleSheet(),N.name=""+this.classNamePrefix+N.localName,this.classes.push(N),this.styleSheet.sheet.insertRule("."+N.name+" {"+N.style+"}",this.styleSheet.sheet.cssRules.length),N},ie.prototype.addRule=function(N){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(N),this.styleSheet.sheet.insertRule(N.selector+" {"+N.style+"}",this.styleSheet.sheet.cssRules.length)},ie.prototype.addStyleSheet=function(){var N;this.styleSheet=document.createElement("style"),((N=this.styleSheetRoot)!==null&&N!==void 0?N:document.head).appendChild(this.styleSheet),this.addRule(new Ft("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Ft("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
|
from {
|
|
|
opacity: 0;
|
|
|
}
|
|
|
to {
|
|
|
opacity: 1;
|
|
|
}
|
|
|
`)),this.addRule(new Ft("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
|
from {
|
|
|
opacity: 1;
|
|
|
}
|
|
|
to {
|
|
|
opacity: 0;
|
|
|
}
|
|
|
`)),this.addClass(new zt("_fade_in",`
|
|
|
animation-duration: 0.3s;
|
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
|
`)),this.addClass(new zt("_fade_out",`
|
|
|
animation-duration: 0.3s;
|
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
|
`))},ie.prototype.removeStyleSheet=function(){var N;this.styleSheet&&(((N=this.styleSheetRoot)!==null&&N!==void 0?N:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},ie}(),Ft=function(ie,N){this.selector=ie,this.style=N},zt=function(ie,N){this.localName=ie,this.style=N},Zt=function(){function ie(){this.blocks=[],this.display=""}return ie.prototype.addButtonBlock=function(N){N.className=this.blockClassName,N.buttonClassName=this.buttonClassName,N.buttonColorsClassName=this.buttonColorsClassName,N.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(N)},ie.prototype.addElementBlock=function(N){N.className===void 0&&(N.className=this.blockClassName),this.blocks.push(N)},ie.prototype.getUI=function(){var N=document.createElement("div");return N.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,N.style.display=this.display,this.blocks.forEach(function(F){return N.appendChild(F.getUI())}),N},ie}(),Re=function(){function ie(){}return ie.prototype.getUI=function(){var N=document.createElement("div");if(N.className=this.className,this.minWidth!==void 0&&(N.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":N.style.justifyContent="flex-start";break;case"center":N.style.justifyContent="center";break;case"end":N.style.justifyContent="flex-end"}return N.style.whiteSpace="nowrap",N},ie}(),ve=function(ie){function N(){var F=ie!==null&&ie.apply(this,arguments)||this;return F.buttons=[],F}return yt(N,ie),N.prototype.addButton=function(F){F.className=this.buttonClassName,F.colorsClassName=this.buttonColorsClassName,F.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(F)},N.prototype.getUI=function(){var F=ie.prototype.getUI.call(this);return this.buttons.forEach(function(ae){return F.appendChild(ae.getUI())}),F},N}(Re),K=function(){function ie(N,F){this._isActive=!1,this._isHidden=!1,this._icon=N,this.title=F,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(ie.prototype,"icon",{get:function(){return this._icon},set:function(N){this._icon=N,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"isActive",{get:function(){return this._isActive},set:function(N){this._isActive=N,this.adjustClassName()},enumerable:!1,configurable:!0}),ie.prototype.getUI=function(){var N=this;return this.buttonContainer=document.createElement("div"),this.buttonContainer.title=this.title,this.buttonContainer.className=this.className+" "+this.colorsClassName,this.adjustClassName(),this.buttonContainer.innerHTML=this._icon,this.onClick&&this.buttonContainer.addEventListener("click",function(){return N.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},ie.prototype.adjustClassName=function(){this.activeColorsClassName&&(this._isActive&&this.buttonContainer.className.indexOf(this.activeColorsClassName)<0?this.buttonContainer.className+=" "+this.activeColorsClassName:this._isActive||(this.buttonContainer.className=this.buttonContainer.className.replace(this.activeColorsClassName,"")))},ie.prototype.hide=function(){this._isHidden=!0},ie}(),Z=function(ie){function N(){var F=ie!==null&&ie.apply(this,arguments)||this;return F.elements=[],F}return yt(N,ie),N.prototype.addElement=function(F){this.elements.push(F)},N.prototype.getUI=function(){var F=ie.prototype.getUI.call(this);return this.elements.forEach(function(ae){return F.appendChild(ae)}),F},N}(Re),oe=function(){function ie(N,F){this.horizontal=N,this.vertical=F}return Object.defineProperty(ie.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),ie.prototype.getVerticalLength=function(N){return N/this.ratio},ie.prototype.getHorizontalLength=function(N){return N*this.ratio},ie}(),he=function(){function ie(){}return ie.getIcon=function(N,F){if(N>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 Et=rt.createDefs();$e.appendChild(Et);var it=rt.createElement("clipPath",[["id","text-bg-clip"]]);Et.appendChild(it);var Vt=rt.createPath(rt.getHollowRectanglePath((24-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'<svg viewBox="0 0 24 24"><path d="M19 12h-2v3h-3v2h5v-5M7 9h3V7H5v5h2V9m14-6H3a2 2 0 00-2 2v14a2 2 0 002 2h18a2 2 0 002-2V5a2 2 0 00-2-2m0 16H3V5h18v14z"/></svg>'},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;F<this.numberOfGridLines;F++)this.horizontalGridLines.push(rt.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(rt.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(ae){return N.gridContainer.appendChild(ae)}),this.verticalGridLines.forEach(function(ae){return N.gridContainer.appendChild(ae)}),this.cropRectElement=rt.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new Je(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new Je(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new Je(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new Je(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},ie.prototype.setCropRectangle=function(N){this.cropRect=N;var F=Object.assign({},this.cropRect);this.zoomFactor!==1&&(F.width=this.cropRect.width*this.zoomFactor,F.height=this.cropRect.height*this.zoomFactor,F.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-F.width/2,F.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-F.height/2),rt.setAttributes(this.cropRectElement,[["x",F.x.toString()],["y",F.y.toString()],["width",F.width.toString()],["height",F.height.toString()]]);var ae=F.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(se,$e){var Et=F.y+ae*($e+1);rt.setAttributes(se,[["x1",""+F.x],["y1",""+Et],["x2",""+(F.x+F.width)],["y2",""+Et]])});var pe=F.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(se,$e){var Et=F.x+pe*($e+1);rt.setAttributes(se,[["x1",""+Et],["y1",""+F.y],["x2",""+Et],["y2",""+(F.y+F.height)]])}),rt.setAttributes(this.cropShadeElement,[["d",rt.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,F.x,F.y,F.width,F.height)]]),this.topLeftGrip.setCenter(F.x,F.y),this.topRightGrip.setCenter(F.x+F.width,F.y),this.bottomLeftGrip.setCenter(F.x,F.y+F.height),this.bottomRightGrip.setCenter(F.x+F.width,F.y+F.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},ie.prototype.attachEvents=function(){this.container.style.touchAction="none",this.container.addEventListener("pointerdown",this.onPointerDown),this.container.addEventListener("pointermove",this.onPointerMove),this.container.addEventListener("pointerup",this.onPointerUp)},ie.prototype.clientToLocalCoordinates=function(N,F){var ae=this.container.getBoundingClientRect();return{x:N-ae.left+this.margin,y:F-ae.top+this.margin}},ie.prototype.onPointerDown=function(N){this.container.setPointerCapture(N.pointerId),this.previousPoint=this.clientToLocalCoordinates(N.clientX,N.clientY),this.cropRectElement===N.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(N.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(N.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(N.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(N.target)&&(this.activeGrip=this.bottomRightGrip)},ie.prototype.onPointerMove=function(N){if(this.isMoving)this.move(this.clientToLocalCoordinates(N.clientX,N.clientY));else if(this.activeGrip){var F=this.clientToLocalCoordinates(N.clientX,N.clientY);this.resize(F)}N.preventDefault()},ie.prototype.onPointerUp=function(N){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(N.pointerId)},ie.prototype.move=function(N){var F=N.x-this.previousPoint.x,ae=N.y-this.previousPoint.y;this.zoomFactor!==1&&(F=-F/this.zoomFactor,ae=-ae/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+F),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+ae),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=N},ie.prototype.resize=function(N){var F=Object.assign({},this.cropRect),ae=N.x-this.previousPoint.x,pe=N.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:F.x+ae<this.margin&&(ae=this.margin-F.x),F.x+=ae,F.width=this.cropRect.x+this.cropRect.width-F.x;break;case this.bottomRightGrip:case this.topRightGrip:F.width+ae>this.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.canvasWidth<pe/this.canvasHeight?this.cropRect.width=ae:this.cropRect.height=pe,this.cropRect.width>this.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 Et=ae/N,it=pe/F;return{x:(se.x-$e)*Et+$e,y:(se.y-$e)*it+$e,width:se.width*Et,height:se.height*it}},ie.prototype.scaleCanvas=function(N,F){var ae=this.getRescaledRect(this.canvasWidth,this.canvasHeight,N,F,this.cropRect,this.margin);this.canvasWidth=N,this.canvasHeight=F,this.onCropChange&&this.onCropChange(ae),this.setCropRectangle(ae)},ie}(),Pt=function(){function ie(N){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=N,this.uiContainer=document.createElement("div"),this.getUI=this.getUI.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.setAngleLabel=this.setAngleLabel.bind(this),this.positionScaleShape=this.positionScaleShape.bind(this)}return Object.defineProperty(ie.prototype,"angle",{get:function(){return this._angle},set:function(N){this._angle=N,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),ie.prototype.getUI=function(){return this.controlContainer=document.createElement("div"),this.controlContainer.title=this.title,this.controlContainer.className=this.className+" "+this.colorsClassName,this.controlContainer.appendChild(this.getVisual()),this.controlContainer.addEventListener("pointerdown",this.onPointerDown),this.controlContainer.addEventListener("pointermove",this.onPointerMove),this.controlContainer.addEventListener("pointerup",this.onPointerUp),this.uiContainer.appendChild(this.controlContainer),this.uiContainer.style.display="inline-block",this.uiContainer.style.touchAction="none",this.setAngleLabel(),this.positionScaleShape(),this.uiContainer},ie.prototype.onPointerDown=function(N){this.controlContainer.setPointerCapture(N.pointerId),this.isDragging=!0,this.previousPoint={x:N.clientX,y:N.clientY}},ie.prototype.onPointerMove=function(N){this.isDragging&&(this.onAngleChange&&this.onAngleChange((N.clientX-this.previousPoint.x)/5),this.previousPoint.x=N.clientX)},ie.prototype.onPointerUp=function(N){this.isDragging&&this.onAngleChange&&this.onAngleChange((N.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(N.pointerId)},ie.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var N=this.angleLabelText.getBBox();rt.setAttributes(this.angleLabelElement,[["x",((this.width-N.width)/2).toString()],["y",(this.height/2).toString()]])}},ie.prototype.positionScaleShape=function(){if(this.scaleShape){var N=this.scaleShape.transform.baseVal.getItem(0);N.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(N,0)}},ie.prototype.getVisual=function(){var N=document.createElementNS("http://www.w3.org/2000/svg","svg");N.setAttribute("xmlns","http://www.w3.org/2000/svg"),N.setAttribute("width",this.width+"px"),N.setAttribute("height",this.height+"px"),N.setAttribute("viewBox","0 0 "+this.width+" "+this.height),N.style.flexShrink="0",document.body.appendChild(N);for(var F="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,ae=1;ae<=this.width/5+10;ae++){var 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,Et){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)/Et,At.width=F.naturalWidth/$e,At.height=F.naturalHeight/Et):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,Et),In.translate(-At.width/2,-At.height/2),In.drawImage(F,0,0,At.width,At.height);var Lr=document.createElement("canvas");Lr.width=ae.width*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_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/N;this.resize(F,ae)}},ie.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},ie.prototype.setEditingTargetSize=function(){this.editorCanvas.style.width=this.imageWidth+2*this.CANVAS_MARGIN+"px",this.editorCanvas.style.height=this.imageHeight+2*this.CANVAS_MARGIN+"px",rt.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},ie.prototype.resize=function(N,F){this.imageWidth=Math.round(N),this.imageHeight=Math.round(F),this.setEditingTargetSize(),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.displayMode!=="popup"?this.coverDiv.style.width=this.paddedImageWidth+"px":(this.setTopLeft(),this.positionCropImage()),this.cropLayer.scaleCanvas(this.imageWidth,this.imageHeight),this.applyRotation()},ie.prototype.setEditingTarget=function(){var N=document.createElement("canvas");N.width=this.target.naturalWidth,N.height=this.target.naturalHeight,N.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var F=N.toDataURL();rt.setAttributes(this.editingTarget,[["href",F]]),this.setEditingTargetSize()},ie.prototype.setTopLeft=function(){var N=this.target.getBoundingClientRect(),F=this.editorCanvas.getBoundingClientRect();this.left=N.left-F.left-this.CANVAS_MARGIN,this.top=N.top-F.top-this.CANVAS_MARGIN},ie.prototype.initCropCanvas=function(){this.cropImageHolder=document.createElement("div"),this.cropImageHolder.style.setProperty("touch-action","none"),this.cropImageHolder.style.setProperty("-ms-touch-action","none"),this.cropImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.cropImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImage.style.pointerEvents="auto",this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.cropImageHolder.style.transformOrigin="top left",this.positionCropImage(),this.defs=rt.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=rt.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=rt.createGroup(),this.editingTargetRotationScaleContainer=rt.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var N=rt.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(N);var F=rt.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(F),this.editingTargetContainer=rt.createGroup(),this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px)",this.editingTargetContainer.appendChild(this.editingTargetRotationContainer),this.cropImage.appendChild(this.editingTargetContainer),this.cropImageHolder.appendChild(this.cropImage),this.editorCanvas.appendChild(this.cropImageHolder)},ie.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},ie.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=rt.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new lt(this.imageWidth,this.imageHeight,this.CANVAS_MARGIN,this.cropLayerContainer),this.cropLayer.onCropChange=this.cropRectChanged,this.cropLayer.numberOfGridLines=this.gridLines,this.cropLayer.isGridVisible=this.isGridVisible,this.cropLayer.cropShadeColor=this.styles.settings.cropShadeColor,this.cropLayer.cropFrameColor=this.styles.settings.cropFrameColor,this.cropLayer.gripColor=this.styles.settings.gripColor,this.cropLayer.gripFillColor=this.styles.settings.gripFillColor,this.cropLayer.open(),this.cropLayer.setCropRectangle(this.cropRect),this.zoomToCropEnabled&&this.zoomToCrop()},ie.prototype.zoomToCrop=function(){if(this.cropRect){var N=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,F=this.cropRect.y-this.CANVAS_MARGIN+this.cropRect.height/2;this.zoomFactor=Math.min(this.imageWidth/this.cropRect.width,this.imageHeight/this.cropRect.height),this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin=N+"px "+F+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-N+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-F+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},ie.prototype.unzoomFromCrop=function(){this.zoomFactor=1,this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin="center",this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px) scale(1)",this.cropLayer.zoomFactor=this.zoomFactor)},ie.prototype.cropRectChanged=function(N){this.cropRect=N,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},ie.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},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.addStyles(),this.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.displayMode){case"inline":this.coverDiv.style.position="absolute";var N=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,F=this.target.offsetTop>N+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('<svg viewBox="0 0 24 24"><path d="M10 4v4h4V4h-4m6 0v4h4V4h-4m0 6v4h4v-4h-4m0 6v4h4v-4h-4m-2 4v-4h-4v4h4m-6 0v-4H4v4h4m0-6v-4H4v4h4m0-6V4H4v4h4m2 6h4v-4h-4v4M4 2h16a2 2 0 012 2v16a2 2 0 01-2 2H4c-1.08 0-2-.9-2-2V4a2 2 0 012-2z"/></svg>',"Toggle grid");pe.isActive=this.isGridVisible,pe.onClick=function(){N.isGridVisible=!N.isGridVisible,pe.isActive=N.isGridVisible},F.addButton(pe);var se=new K('<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"Zoom to selection");if(se.isActive=this.zoomToCropEnabled,se.onClick=function(){N.zoomToCropEnabled=!N.zoomToCropEnabled,se.isActive=N.zoomToCropEnabled},F.addButton(se),!Dt.isLicensed){var $e=new Z;this.topToolbar.addElementBlock($e);var Et=document.createElement("div");Et.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var it=document.createElement("a");it.style.color="currentColor",it.href="https://markerjs.com/products/cropro",it.target="_blank",it.innerHTML='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2"><path d="M16.326 14.895c0 1.126-.558 1.688-1.673 1.688H9.931c-1.116 0-1.674-.562-1.674-1.688V3.733c0-1.126.558-1.688 1.674-1.688h4.722c1.115 0 1.673.562 1.673 1.688v2.899h-1.957V3.793h-4.124v11.042h4.124v-3.242h1.957v3.302z" fill="currentColor"/><path d="M15.94 7.364a.783.783 0 00-1.065-.304l-11.01 6.126a.783.783 0 00-.303 1.065l4.498 8.085a.783.783 0 001.065.304l11.01-6.126a.783.783 0 00.303-1.065L15.94 7.364zM5.311 14.173l3.737 6.718 9.641-5.364-3.737-6.718-9.641 5.364z" fill="#eef762"/></svg>',Et.appendChild(it),$e.addElement(Et)}var Vt=new ve;Vt.minWidth=3*this.toolbarHeight+"px",Vt.contentAlign="end",this.topToolbar.addButtonBlock(Vt);var At=new K('<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"OK");At.onClick=this.startRenderAndClose,Vt.addButton(At),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(At.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Bt=new K('<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"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('<svg viewBox="0 0 24 24"><path d="M13 4.07V1L8.45 5.55 13 10V6.09c2.84.48 5 2.94 5 5.91s-2.16 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93s-3.05-7.44-7-7.93M7.1 18.32c1.16.9 2.51 1.44 3.9 1.61V17.9c-.87-.15-1.71-.49-2.46-1.03L7.1 18.32M6.09 13H4.07c.17 1.39.72 2.73 1.62 3.89l1.41-1.42c-.52-.75-.87-1.59-1.01-2.47m1.02-4.47L5.7 7.11C4.8 8.27 4.24 9.61 4.07 11h2.02c.14-.87.49-1.72 1.02-2.47z"/></svg>',"Rotate left");ae.onClick=this.rotateLeftButtonClicked,F.addButton(ae);var pe=new K('<svg viewBox="0 0 24 24"><path d="M16.89 15.5l1.42 1.39c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.5M13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03m6.93-6.9a7.906 7.906 0 00-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47m-2.36-5.45L11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45z"/></svg>',"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 Et=new K('<svg viewBox="0 0 24 24"><path d="M15 21h2v-2h-2m4-10h2V7h-2M3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2m16-2v2h2c0-1.1-.9-2-2-2m-8 20h2V1h-2m8 16h2v-2h-2M15 5h2V3h-2m4 10h2v-2h-2m0 10c1.1 0 2-.9 2-2h-2z"/></svg>',"Flip horizontal");Et.onClick=this.flipHorizontallyButtonClicked,$e.addButton(Et);var it=new K('<svg viewBox="0 0 24 24"><path d="M3 15v2h2v-2m10 4v2h2v-2m2-16H5c-1.1 0-2 .9-2 2v4h2V5h14v4h2V5c0-1.1-.9-2-2-2m2 16h-2v2c1.1 0 2-.9 2-2M1 11v2h22v-2M7 19v2h2v-2m10-4v2h2v-2m-10 4v2h2v-2M3 19c0 1.1.9 2 2 2v-2z"/></svg>',"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=/<pre[^>]*>/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,Et=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 _r=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 _r.apply(this,arguments)}}()),wn.show()},si=function(){var wn=new De(ur.current);wn.settings.displayMode="popup",wn.addEventListener("render",function(){var _r=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 _r.apply(this,arguments)}}()),wn.show(),window.markerArea=wn},Pr=Object(p.useMemo)(function(){try{var Fn=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,wn=/\"\/api\/attachments\/|\"\/attachments\/download\//g,_r=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Sr=Sr.replace(Fn,"("+ne.a.API_SERVER+"/api/attachments/").replace(wn,'"'+ne.a.API_SERVER+"/api/attachments/").replace(_r,'"'+ne.a.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
|
|
|
`),Sr=Sr.replace(new RegExp("(?<!\\n)\\n(?!\\n)","g"),`
|
|
|
`)}catch(Ui){}var qn=te(Sr),kr=O();if(Sr.match(/\[TOC\]/)&&(qn=qn.replace("<p>[TOC]</p>",_()),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=Et,Et&&(on=Object(P.a)(Object(P.a)({},on),m));function Ei(Fn){var wn=Fn.target;if(wn.tagName.toUpperCase()==="IMG"){if(Vt){var _r=wn.getAttribute("src");br(_r),gr("image")}}else if(wn.tagName.toUpperCase()==="A"){var qn=wn.getAttribute("href");if(qn.indexOf("office")>-1)Fn.preventDefault(),br(qn),gr("office");else if(qn.indexOf("application/pdf")>-1)Fn.preventDefault(),br(qn),gr("pdf");else if(qn.indexOf("type=text")>-1)Fn.preventDefault(),br(qn),gr("html");else if(qn.startsWith("#")){Fn.preventDefault();var kr=document.getElementById(qn.replace("#",""));kr&&kr.scrollIntoView(!0)}}}var vi=function(){var wn,_r=(wn=Fr.current)===null||wn===void 0?void 0:wn.querySelectorAll("video");_r==null||_r.forEach(function(qn){if(qn.oncontextmenu=function(){return!1},qn.src.indexOf(".m3u8")>-1&&!qn.canPlayType("application/vnd.apple.mpegurl")){if(X.a.isSupported()){var kr=new X.a;kr.loadSource(qn.src),kr.attachMedia(qn)}}})};Object(p.useEffect)(function(){if(Fr.current&&Pr&&(Pr.match(Rt)&&window.PR.prettyPrint()),Fr.current)return Fr.current.addEventListener("click",Ei),function(){Fr.current.removeEventListener("click",Ei),A(),v()}},[Pr,Fr.current,Ei]);var di=function(wn){if(!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;a<p.length;a++){if(!p[a].empty())return le.Pass;var u=p[a].head,s=c.getTokenAt(u),h=le.innerMode(c.getMode(),s.state),i=h.state,n=h.mode.xmlCurrentTag&&h.mode.xmlCurrentTag(i),t=n&&n.name;if(!t)return le.Pass;var f=h.mode.configuration=="html",v=typeof o=="object"&&o.dontCloseTags||f&&Q,m=typeof o=="object"&&o.indentTags||f&&j;s.end>u.ch&&(t=t.slice(0,t.length-s.end+u.ch));var E=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,E)>-1||C(c,h.mode.xmlCurrentContext&&h.mode.xmlCurrentContext(i)||[],t,u,!0))return le.Pass;var _=typeof o=="object"&&o.emptyTags;if(_&&T(_,t)>-1){d[a]={text:"/>",newPos:le.Pos(u.line,u.ch+2)};continue}var g=m&&T(m,E)>-1;d[a]={indent:g,text:">"+(g?`
|
|
|
|
|
|
`:"")+"</"+t+">",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?"/":"</",u=c.getOption("autoCloseTags"),s=typeof u=="object"&&u.dontIndentOnSlash,h=0;h<d.length;h++){if(!d[h].empty())return le.Pass;var i=d[h].head,n=c.getTokenAt(i),t=le.innerMode(c.getMode(),n.state),f=t.state;if(p&&(n.type=="string"||n.string.charAt(0)!="<"||n.start!=i.ch-1))return le.Pass;var v,m=t.mode.name!="xml"&&c.getMode().name=="htmlmixed";if(m&&t.mode.name=="javascript")v=a+"script";else if(m&&t.mode.name=="css")v=a+"style";else{var E=t.mode.xmlCurrentContext&&t.mode.xmlCurrentContext(f);if(!E||E.length&&C(c,E,E[E.length-1],i))return le.Pass;v=a+E[E.length-1]}c.getLine(i.line).charAt(n.end)!=">"&&(v+=">"),o[h]=v}if(c.replaceSelections(o),d=c.listSelections(),!s)for(var h=0;h<d.length;h++)(h==d.length-1||d[h].head.line<d[h+1].head.line)&&c.indentLine(d[h].head.line)}function b(c){return c.getOption("disableInput")?le.Pass:P(c,!0)}le.commands.closeTag=function(c){return P(c)};function T(c,p){if(c.indexOf)return c.indexOf(p);for(var d=0,o=c.length;d<o;++d)if(c[d]==p)return d;return-1}function C(c,p,d,o,a){if(!le.scanForClosingTag)return!1;var u=Math.min(c.lastLine()+1,o.line+500),s=le.scanForClosingTag(c,o,null,u);if(!s||s.tag!=d)return!1;for(var h=a?1:0,i=p.length-1;i>=0&&p[i]==d;i--)++h;o=s.to;for(var i=1;i<h;i++){var n=le.scanForClosingTag(c,o,null,u);if(!n||n.tag!=d)return!1;o=n.to}return!0}})},BdwD:function(et,Ve,z){"use strict";var le=z("+L6B"),Q=z("2/Rp"),j=z("0Owb"),w=z("k1fw"),P=z("q1tI"),b=z.n(P),T=z("FOrL"),C=z.n(T),c=function(d){var o=d.buttonProps,a=o===void 0?{}:o,u=d.styles,s=u===void 0?{}:u,h=d.customText,i=d.ButtonText,n=d.ButtonClick,t=d.Buttonclass,f=d.ButtonTwo;return b.a.createElement("section",{className:"tc animated fadeIn",style:Object(w.a)(Object(w.a)({},{color:"#999",margin:"200px auto"}),s)},b.a.createElement("img",{src:C.a}),b.a.createElement("p",{className:"mt20 font14"},h||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),i&&b.a.createElement(Q.a,Object(j.a)({className:t,onClick:n},a),i),f&&f)};Ve.a=c},BjJ7:function(et,Ve,z){"use strict";z.d(Ve,"d",function(){return Q}),z.d(Ve,"c",function(){return j}),z.d(Ve,"e",function(){return w}),z.d(Ve,"b",function(){return P}),z.d(Ve,"a",function(){return T});var le=z("m3rI");function Q(C){var c=!0;if(C.length>0){for(var p=0;p<C.length;p++)if(C[p].compile_success==0||!C[p].compile_success){c=!1;break}}else c=!1;return c}function j(C){for(var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",p=[],d=0;d<C.length;d++){var o=C[d],a=c?"".concat(c,"/").concat(o.name):"".concat(o.name);p.push({title:o.name,isLeaf:!(o.type==="tree"),key:a})}return p}function w(C,c,p){for(var d=0;d<C.length;d++){var o=C[d];if(o.key===c){o.children=p;break}o.children&&w(o.children,c,p)}return C}function P(C,c,p){var d;return function(){var o=this,a=arguments,u=function(){d=null,p||C.apply(o,a)},s=p&&!d;clearTimeout(d),d=setTimeout(u,c),s&&C.apply(o,a)}}var b=!0,T=le.a.API_SERVER},"C+DQ":function(et,Ve,z){},CNDd:function(et,Ve,z){et.exports=z.p+"static/c1.7850f139.svg"},CaVn:function(et,Ve,z){et.exports={flex_box_center:"flex_box_center___2wZ0h",flex_space_between:"flex_space_between___3MVWH",flex_box_vertical_center:"flex_box_vertical_center___O0jNB",flex_box_center_end:"flex_box_center_end___2q4xj",flex_box_column:"flex_box_column___13R-8",listDetails:"listDetails___3lMam",head:"head___2jzWe",name:"name___3xIfG",title:"title___3-ce8",a:"a___1ZME1",b:"b___oiiqU",tag:"tag___32Ulf",btn:"btn___lJ5fA",scroll:"scroll___anvih",video:"video___1gujl",html:"html___z0BU7",g:"g___3sfQf",btns:"btns___OWbut"}},CrYA:function(et,Ve,z){var le=z("MFOe"),Q=le.Global;et.exports={name:"sessionStorage",read:w,write:P,each:b,remove:T,clearAll:C};function j(){return Q.sessionStorage}function w(c){return j().getItem(c)}function P(c,p){return j().setItem(c,p)}function b(c){for(var p=j().length-1;p>=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<arguments.length;I++){var B=arguments[I];for(var H in B)Object.prototype.hasOwnProperty.call(B,H)&&(D[H]=B[H])}return D},Q.apply(this,arguments)}function j(D,I){var B=Object.keys(D);if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols(D);I&&(H=H.filter(function(te){return Object.getOwnPropertyDescriptor(D,te).enumerable})),B.push.apply(B,H)}return B}function w(D){for(var I=1;I<arguments.length;I++){var B=arguments[I]!=null?arguments[I]:{};I%2?j(B,!0).forEach(function(H){s(D,H,B[H])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(B)):j(B).forEach(function(H){Object.defineProperty(D,H,Object.getOwnPropertyDescriptor(B,H))})}return D}function P(D,I){if(D==null)return{};var B=b(D,I),H,te;if(Object.getOwnPropertySymbols){var W=Object.getOwnPropertySymbols(D);for(te=0;te<W.length;te++){if(H=W[te],I.indexOf(H)>=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<H.length;W++){if(te=H[W],I.indexOf(te)>=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<I.length;B++){var H=I[B];H.enumerable=H.enumerable||!1,H.configurable=!0,"value"in H&&(H.writable=!0),Object.defineProperty(D,H.key,H)}}function c(D,I,B){return I&&C(D.prototype,I),B&&C(D,B),D}function p(D,I){return I&&(le(I)==="object"||typeof I=="function")?I:o(D)}function d(D){return d=Object.setPrototypeOf?Object.getPrototypeOf:function(B){return B.__proto__||Object.getPrototypeOf(B)},d(D)}function o(D){if(D===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return D}function a(D,I){if(typeof I!="function"&&I!==null)throw new TypeError("Super expression must either be null or a function");D.prototype=Object.create(I&&I.prototype,{constructor:{value:D,writable:!0,configurable:!0}}),I&&u(D,I)}function u(D,I){return u=Object.setPrototypeOf||function(H,te){return H.__proto__=te,H},u(D,I)}function s(D,I,B){return I in D?Object.defineProperty(D,I,{value:B,enumerable:!0,configurable:!0,writable:!0}):D[I]=B,D}var h=z("q1tI"),i=z("17x9"),n=z("H38U"),t=z("aRTE");function f(D){for(var I="",B=0;B<D.length;B++){var H=D.charCodeAt(B);H<128?I+=String.fromCharCode(H):H<2048?(I+=String.fromCharCode(192|H>>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={},E=4,_=.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||H>=I.y+I.h?B:B.map(function(te,W){return W<I.x||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?E:0,V=I.length+W*2,X=Math.floor(H*_),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),_e=Math.ceil(ee+de-Pe);Ce={x:Se,y:Pe,w:ye,h:_e}}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;V<te;V++)W[V]=arguments[V];return H=p(this,(B=d(I)).call.apply(B,[this].concat(W))),s(o(H),"_canvas",void 0),s(o(H),"_image",void 0),s(o(H),"state",{imgLoaded:!1}),s(o(H),"handleImageLoad",function(){H.setState({imgLoaded:!0})}),H}return c(I,[{key:"componentDidMount",value:function(){this.update()}},{key:"componentDidUpdate",value:function(){this.update()}},{key:"update",value:function(){var H=this.props,te=H.value,W=H.size,V=H.level,X=H.bgColor,ne=H.fgColor,Y=H.includeMargin,ee=H.imageSettings,ce=new n(-1,t[V]);if(ce.addData(f(te)),ce.make(),this._canvas!=null){var de=this._canvas,Ce=de.getContext("2d");if(!Ce)return;var Se=ce.modules;if(Se===null)return;var Pe=Y?E:0,ye=Se.length+Pe*2,_e=x(this.props,Se);ee!=null&&_e!=null&&(_e.excavation!=null&&(Se=y(Se,_e.excavation)));var Ge=window.devicePixelRatio||1;de.height=de.width=W*Ge;var Ue=W/ye*Ge;Ce.scale(Ue,Ue),Ce.fillStyle=X,Ce.fillRect(0,0,ye,ye),Ce.fillStyle=ne,l?Ce.fill(new Path2D(g(Se,Pe))):Se.forEach(function(Fe,He){Fe.forEach(function(be,me){be&&Ce.fillRect(me+Pe,He+Pe,1,1)})}),this.state.imgLoaded&&this._image&&_e!=null&&Ce.drawImage(this._image,_e.x+Pe,_e.y+Pe,_e.w,_e.h)}}},{key:"render",value:function(){var H=this,te=this.props,W=te.value,V=te.size,X=te.level,ne=te.bgColor,Y=te.fgColor,ee=te.style,ce=te.includeMargin,de=te.imageSettings,Ce=P(te,["value","size","level","bgColor","fgColor","style","includeMargin","imageSettings"]),Se=w({height:V,width:V},ee),Pe=null,ye=de&&de.src;return de!=null&&ye!=null&&(Pe=h.createElement("img",{src:ye,style:{display:"none"},onLoad:this.handleImageLoad,ref:function(Ge){return H._image=Ge}})),h.createElement(h.Fragment,null,h.createElement("canvas",Q({style:Se,height:V,width:V,ref:function(Ge){return H._canvas=Ge}},Ce)),Pe)}}]),I}(h.PureComponent);s(S,"defaultProps",v);var O=function(D){a(I,D);function I(){return T(this,I),p(this,d(I).apply(this,arguments))}return c(I,[{key:"render",value:function(){var H=this.props,te=H.value,W=H.size,V=H.level,X=H.bgColor,ne=H.fgColor,Y=H.includeMargin,ee=H.imageSettings,ce=P(H,["value","size","level","bgColor","fgColor","includeMargin","imageSettings"]),de=new n(-1,t[V]);de.addData(f(te)),de.make();var Ce=de.modules;if(Ce===null)return null;var Se=Y?E:0,Pe=Ce.length+Se*2,ye=x(this.props,Ce),_e=null;ee!=null&&ye!=null&&(ye.excavation!=null&&(Ce=y(Ce,ye.excavation)),_e=h.createElement("image",{xlinkHref:ee.src,height:ye.h,width:ye.w,x:ye.x+Se,y:ye.y+Se,preserveAspectRatio:"none"}));var Ge=g(Ce,Se);return h.createElement("svg",Q({shapeRendering:"crispEdges",height:W,width:W,viewBox:"0 0 ".concat(Pe," ").concat(Pe)},ce),h.createElement("path",{fill:X,d:"M0,0 h".concat(Pe,"v").concat(Pe,"H0z")}),h.createElement("path",{fill:ne,d:Ge}),_e)}}]),I}(h.PureComponent);s(O,"defaultProps",v);var A=function(I){var B=I.renderAs,H=P(I,["renderAs"]),te=B==="svg"?O:S;return h.createElement(te,H)};A.defaultProps=w({renderAs:"canvas"},v),et.exports=A},DlQD:function(et,Ve,z){(function(le,Q){et.exports=Q()})(this,function(){"use strict";function le(Be,Ie){for(var Me=0;Me<Ie.length;Me++){var Ee=Ie[Me];Ee.enumerable=Ee.enumerable||!1,Ee.configurable=!0,"value"in Ee&&(Ee.writable=!0),Object.defineProperty(Be,Ee.key,Ee)}}function Q(Be,Ie,Me){return Ie&&le(Be.prototype,Ie),Me&&le(Be,Me),Be}function j(Be,Ie){if(!Be)return;if(typeof Be=="string")return w(Be,Ie);var Me=Object.prototype.toString.call(Be).slice(8,-1);if(Me==="Object"&&Be.constructor&&(Me=Be.constructor.name),Me==="Map"||Me==="Set")return Array.from(Be);if(Me==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Me))return w(Be,Ie)}function w(Be,Ie){(Ie==null||Ie>Be.length)&&(Ie=Be.length);for(var Me=0,Ee=new Array(Ie);Me<Ie;Me++)Ee[Me]=Be[Me];return Ee}function P(Be,Ie){var Me;if(typeof Symbol=="undefined"||Be[Symbol.iterator]==null){if(Array.isArray(Be)||(Me=j(Be))||Ie&&Be&&typeof Be.length=="number"){Me&&(Be=Me);var Ee=0;return function(){return Ee>=Be.length?{done:!0}:{done:!1,value:Be[Ee++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return Me=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(Ee){Be.exports.defaults=Ee}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,E=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function _(Be,Ie,Me){if(Be){var Ee;try{Ee=decodeURIComponent(t(Me)).replace(m,"").toLowerCase()}catch(Ae){return null}if(Ee.indexOf("javascript:")===0||Ee.indexOf("vbscript:")===0||Ee.indexOf("data:")===0)return null}Ie&&!E.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,Ee;Ie<arguments.length;Ie++){Me=arguments[Ie];for(Ee in Me)Object.prototype.hasOwnProperty.call(Me,Ee)&&(Be[Ee]=Me[Ee])}return Be}function D(Be,Ie){var Me=Be.replace(/\|/g,function(Le,Te,Ze){for(var ut=!1,Ct=Te;--Ct>=0&&Ze[Ct]==="\\";)ut=!ut;return ut?"|":" |"}),Ee=Me.split(/ \|/),Ae=0;if(Ee.length>Ie)Ee.splice(Ie);else for(;Ee.length<Ie;)Ee.push("");for(;Ae<Ee.length;Ae++)Ee[Ae]=Ee[Ae].trim().replace(/\\\|/g,"|");return Ee}function I(Be,Ie,Me){var Ee=Be.length;if(Ee===0)return"";for(var Ae=0;Ae<Ee;){var Le=Be.charAt(Ee-Ae-1);if(Le===Ie&&!Me)Ae++;else if(Le!==Ie&&Me)Ae++;else break}return Be.substr(0,Ee-Ae)}function B(Be,Ie){if(Be.indexOf(Ie[1])===-1)return-1;for(var Me=Be.length,Ee=0,Ae=0;Ae<Me;Ae++)if(Be[Ae]==="\\")Ae++;else if(Be[Ae]===Ie[0])Ee++;else if(Be[Ae]===Ie[1]&&(Ee--,Ee<0))return Ae;return-1}function H(Be){Be&&Be.sanitize&&!Be.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}var te={escape:i,unescape:t,edit:v,cleanUrl:_,resolveUrl:S,noopTest:O,merge:A,splitCells:D,rtrim:I,findClosingBracket:B,checkSanitizeDeprecation:H},W=T.defaults,V=te.rtrim,X=te.splitCells,ne=te.escape,Y=te.findClosingBracket;function ee(Be,Ie,Me){var Ee=Ie.href,Ae=Ie.title?ne(Ie.title):null,Le=Be[1].replace(/\\([\[\]])/g,"$1");return Be[0].charAt(0)!=="!"?{type:"link",raw:Me,href:Ee,title:Ae,text:Le}:{type:"image",raw:Me,href:Ee,title:Ae,text:ne(Le)}}function ce(Be,Ie){var Me=Be.match(/^(\s+)(?:```)/);if(Me===null)return Ie;var Ee=Me[1];return Ie.split(`
|
|
|
`).map(function(Ae){var Le=Ae.match(/^\s+/);if(Le===null)return Ae;var Te=Le[0];return Te.length>=Ee.length?Ae.slice(Ee.length):Ae}).join(`
|
|
|
`)}var de=function(){function Be(Me){this.options=Me||W}var Ie=Be.prototype;return Ie.space=function(Ee){var Ae=this.rules.block.newline.exec(Ee);if(Ae)return Ae[0].length>1?{type:"space",raw:Ae[0]}:{raw:`
|
|
|
`}},Ie.code=function(Ee,Ae){var Le=this.rules.block.code.exec(Ee);if(Le){var Te=Ae[Ae.length-1];if(Te&&Te.type==="paragraph")return{raw:Le[0],text:Le[0].trimRight()};var Ze=Le[0].replace(/^ {4}/gm,"");return{type:"code",raw:Le[0],codeBlockStyle:"indented",text:this.options.pedantic?Ze:V(Ze,`
|
|
|
`)}}},Ie.fences=function(Ee){var Ae=this.rules.block.fences.exec(Ee);if(Ae){var Le=Ae[0],Te=ce(Le,Ae[3]||"");return{type:"code",raw:Le,lang:Ae[2]?Ae[2].trim():Ae[2],text:Te}}},Ie.heading=function(Ee){var Ae=this.rules.block.heading.exec(Ee);if(Ae)return{type:"heading",raw:Ae[0],depth:Ae[1].length,text:Ae[2]}},Ie.nptable=function(Ee){var Ae=this.rules.block.nptable.exec(Ee);if(Ae){var Le={type:"table",header:X(Ae[1].replace(/^ *| *\| *$/g,"")),align:Ae[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Ae[3]?Ae[3].replace(/\n$/,"").split(`
|
|
|
`):[],raw:Ae[0]};if(Le.header.length===Le.align.length){var Te=Le.align.length,Ze;for(Ze=0;Ze<Te;Ze++)/^ *-+: *$/.test(Le.align[Ze])?Le.align[Ze]="right":/^ *:-+: *$/.test(Le.align[Ze])?Le.align[Ze]="center":/^ *:-+ *$/.test(Le.align[Ze])?Le.align[Ze]="left":Le.align[Ze]=null;for(Te=Le.cells.length,Ze=0;Ze<Te;Ze++)Le.cells[Ze]=X(Le.cells[Ze],Le.header.length);return Le}}},Ie.hr=function(Ee){var Ae=this.rules.block.hr.exec(Ee);if(Ae)return{type:"hr",raw:Ae[0]}},Ie.blockquote=function(Ee){var Ae=this.rules.block.blockquote.exec(Ee);if(Ae){var Le=Ae[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:Ae[0],text:Le}}},Ie.list=function(Ee){var Ae=this.rules.block.list.exec(Ee);if(Ae){for(var Le=Ae[0],Te=Ae[2],Ze=Te.length>1,ut=Te[Te.length-1]===")",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;ot<yt;ot++)bt=Ht[ot],Le=bt,Lt=bt.length,bt=bt.replace(/^ *([*+-]|\d+[.)]) */,""),~bt.indexOf(`
|
|
|
`)&&(Lt-=bt.length,bt=this.options.pedantic?bt.replace(/^ {1,4}/gm,""):bt.replace(new RegExp("^ {1,"+Lt+"}","gm"),"")),ot!==yt-1&&(at=this.rules.block.bullet.exec(Ht[ot+1])[0],(Ze?at.length===1||!ut&&at[at.length-1]===")":at.length>1||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(Ee){var Ae=this.rules.block.html.exec(Ee);if(Ae)return{type:this.options.sanitize?"paragraph":"html",raw:Ae[0],pre:!this.options.sanitizer&&(Ae[1]==="pre"||Ae[1]==="script"||Ae[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Ae[0]):ne(Ae[0]):Ae[0]}},Ie.def=function(Ee){var Ae=this.rules.block.def.exec(Ee);if(Ae){Ae[3]&&(Ae[3]=Ae[3].substring(1,Ae[3].length-1));var Le=Ae[1].toLowerCase().replace(/\s+/g," ");return{tag:Le,raw:Ae[0],href:Ae[2],title:Ae[3]}}},Ie.table=function(Ee){var Ae=this.rules.block.table.exec(Ee);if(Ae){var Le={type:"table",header:X(Ae[1].replace(/^ *| *\| *$/g,"")),align:Ae[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Ae[3]?Ae[3].replace(/\n$/,"").split(`
|
|
|
`):[]};if(Le.header.length===Le.align.length){Le.raw=Ae[0];var Te=Le.align.length,Ze;for(Ze=0;Ze<Te;Ze++)/^ *-+: *$/.test(Le.align[Ze])?Le.align[Ze]="right":/^ *:-+: *$/.test(Le.align[Ze])?Le.align[Ze]="center":/^ *:-+ *$/.test(Le.align[Ze])?Le.align[Ze]="left":Le.align[Ze]=null;for(Te=Le.cells.length,Ze=0;Ze<Te;Ze++)Le.cells[Ze]=X(Le.cells[Ze].replace(/^ *\| *| *\| *$/g,""),Le.header.length);return Le}}},Ie.lheading=function(Ee){var Ae=this.rules.block.lheading.exec(Ee);if(Ae)return{type:"heading",raw:Ae[0],depth:Ae[2].charAt(0)==="="?1:2,text:Ae[1]}},Ie.paragraph=function(Ee){var Ae=this.rules.block.paragraph.exec(Ee);if(Ae)return{type:"paragraph",raw:Ae[0],text:Ae[1].charAt(Ae[1].length-1)===`
|
|
|
`?Ae[1].slice(0,-1):Ae[1]}},Ie.text=function(Ee,Ae){var Le=this.rules.block.text.exec(Ee);if(Le){var Te=Ae[Ae.length-1];return Te&&Te.type==="text"?{raw:Le[0],text:Le[0]}:{type:"text",raw:Le[0],text:Le[0]}}},Ie.escape=function(Ee){var Ae=this.rules.inline.escape.exec(Ee);if(Ae)return{type:"escape",raw:Ae[0],text:ne(Ae[1])}},Ie.tag=function(Ee,Ae,Le){var Te=this.rules.inline.tag.exec(Ee);if(Te)return!Ae&&/^<a /i.test(Te[0])?Ae=!0:Ae&&/^<\/a>/i.test(Te[0])&&(Ae=!1),!Le&&/^<(pre|code|kbd|script)(\s|>)/i.test(Te[0])?Le=!0:Le&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(Te[0])&&(Le=!1),{type:this.options.sanitize?"text":"html",raw:Te[0],inLink:Ae,inRawBlock:Le,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Te[0]):ne(Te[0]):Te[0]}},Ie.link=function(Ee){var Ae=this.rules.inline.link.exec(Ee);if(Ae){var Le=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(Ee,Ae){var Le;if((Le=this.rules.inline.reflink.exec(Ee))||(Le=this.rules.inline.nolink.exec(Ee))){var Te=(Le[2]||Le[1]).replace(/\s+/g," ");if(Te=Ae[Te.toLowerCase()],!Te||!Te.href){var Ze=Le[0].charAt(0);return{type:"text",raw:Ze,text:Ze}}var ut=ee(Le,Te,Le[0]);return ut}},Ie.strong=function(Ee,Ae,Le){Le===void 0&&(Le="");var Te=this.rules.inline.strong.start.exec(Ee);if(Te&&(!Te[1]||Te[1]&&(Le===""||this.rules.inline.punctuation.exec(Le)))){Ae=Ae.slice(-1*Ee.length);var Ze=Te[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Ze.lastIndex=0;for(var ut;(Te=Ze.exec(Ae))!=null;)if(ut=this.rules.inline.strong.middle.exec(Ae.slice(0,Te.index+3)),ut)return{type:"strong",raw:Ee.slice(0,ut[0].length),text:Ee.slice(2,ut[0].length-2)}}},Ie.em=function(Ee,Ae,Le){Le===void 0&&(Le="");var Te=this.rules.inline.em.start.exec(Ee);if(Te&&(!Te[1]||Te[1]&&(Le===""||this.rules.inline.punctuation.exec(Le)))){Ae=Ae.slice(-1*Ee.length);var Ze=Te[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Ze.lastIndex=0;for(var ut;(Te=Ze.exec(Ae))!=null;)if(ut=this.rules.inline.em.middle.exec(Ae.slice(0,Te.index+2)),ut)return{type:"em",raw:Ee.slice(0,ut[0].length),text:Ee.slice(1,ut[0].length-1)}}},Ie.codespan=function(Ee){var Ae=this.rules.inline.code.exec(Ee);if(Ae){var Le=Ae[2].replace(/\n/g," "),Te=/[^ ]/.test(Le),Ze=Le.startsWith(" ")&&Le.endsWith(" ");return Te&&Ze&&(Le=Le.substring(1,Le.length-1)),Le=ne(Le,!0),{type:"codespan",raw:Ae[0],text:Le}}},Ie.br=function(Ee){var Ae=this.rules.inline.br.exec(Ee);if(Ae)return{type:"br",raw:Ae[0]}},Ie.del=function(Ee){var Ae=this.rules.inline.del.exec(Ee);if(Ae)return{type:"del",raw:Ae[0],text:Ae[1]}},Ie.autolink=function(Ee,Ae){var Le=this.rules.inline.autolink.exec(Ee);if(Le){var Te,Ze;return Le[2]==="@"?(Te=ne(this.options.mangle?Ae(Le[1]):Le[1]),Ze="mailto:"+Te):(Te=ne(Le[1]),Ze=Te),{type:"link",raw:Le[0],text:Te,href:Ze,tokens:[{type:"text",raw:Te,text:Te}]}}},Ie.url=function(Ee,Ae){var Le;if(Le=this.rules.inline.url.exec(Ee)){var Te,Ze;if(Le[2]==="@")Te=ne(this.options.mangle?Ae(Le[0]):Le[0]),Ze="mailto:"+Te;else{var ut;do ut=Le[0],Le[0]=this.rules.inline._backpedal.exec(Le[0])[0];while(ut!==Le[0]);Te=ne(Le[0]),Le[1]==="www."?Ze="http://"+Te:Ze=Te}return{type:"link",raw:Le[0],text:Te,href:Ze,tokens:[{type:"text",raw:Te,text:Te}]}}},Ie.inlineText=function(Ee,Ae,Le){var Te=this.rules.inline.text.exec(Ee);if(Te){var Ze;return Ae?Ze=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Te[0]):ne(Te[0]):Te[0]:Ze=ne(this.options.smartypants?Le(Te[0]):Te[0]),{type:"text",raw:Te[0],text:Ze}}},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]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable: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=/<!--(?!-?>)[\s\S]*?-->/,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","</?(?:tag)(?: +|\\n|/?>)|<(?: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","</?(?:tag)(?: +|\\n|/?>)|<(?: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","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",ye._tag).getRegex(),ye.pedantic=Pe({},ye.normal,{html:Se(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\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:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\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 _e={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Ce,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Ce,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};_e._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",_e.punctuation=Se(_e.punctuation).replace(/punctuation/g,_e._punctuation).getRegex(),_e._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",_e._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",_e.em.start=Se(_e.em.start).replace(/punctuation/g,_e._punctuation).getRegex(),_e.em.middle=Se(_e.em.middle).replace(/punctuation/g,_e._punctuation).replace(/overlapSkip/g,_e._overlapSkip).getRegex(),_e.em.endAst=Se(_e.em.endAst,"g").replace(/punctuation/g,_e._punctuation).getRegex(),_e.em.endUnd=Se(_e.em.endUnd,"g").replace(/punctuation/g,_e._punctuation).getRegex(),_e.strong.start=Se(_e.strong.start).replace(/punctuation/g,_e._punctuation).getRegex(),_e.strong.middle=Se(_e.strong.middle).replace(/punctuation/g,_e._punctuation).replace(/blockSkip/g,_e._blockSkip).getRegex(),_e.strong.endAst=Se(_e.strong.endAst,"g").replace(/punctuation/g,_e._punctuation).getRegex(),_e.strong.endUnd=Se(_e.strong.endUnd,"g").replace(/punctuation/g,_e._punctuation).getRegex(),_e.blockSkip=Se(_e._blockSkip,"g").getRegex(),_e.overlapSkip=Se(_e._overlapSkip,"g").getRegex(),_e._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,_e._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,_e._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,_e.autolink=Se(_e.autolink).replace("scheme",_e._scheme).replace("email",_e._email).getRegex(),_e._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,_e.tag=Se(_e.tag).replace("comment",ye._comment).replace("attribute",_e._attribute).getRegex(),_e._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,_e._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,_e._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,_e.link=Se(_e.link).replace("label",_e._label).replace("href",_e._href).replace("title",_e._title).getRegex(),_e.reflink=Se(_e.reflink).replace("label",_e._label).getRegex(),_e.reflinkSearch=Se(_e.reflinkSearch,"g").replace("reflink",_e.reflink).replace("nolink",_e.nolink).getRegex(),_e.normal=Pe({},_e),_e.pedantic=Pe({},_e.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Se(/^!?\[(label)\]\((.*?)\)/).replace("label",_e._label).getRegex(),reflink:Se(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",_e._label).getRegex()}),_e.gfm=Pe({},_e.normal,{escape:Se(_e.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*~]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))|(?= {2,}\n|[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))/}),_e.gfm.url=Se(_e.gfm.url,"i").replace("email",_e.gfm._extended_email).getRegex(),_e.breaks=Pe({},_e.gfm,{br:Se(_e.br).replace("{2,}","*").getRegex(),text:Se(_e.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var Ge={block:ye,inline:_e},Ue=T.defaults,Fe=Ge.block,He=Ge.inline;function be(Be){return Be.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026")}function me(Be){var Ie="",Me,Ee,Ae=Be.length;for(Me=0;Me<Ae;Me++)Ee=Be.charCodeAt(Me),Math.random()>.5&&(Ee="x"+Ee.toString(16)),Ie+="&#"+Ee+";";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 Ee={block:Fe.normal,inline:He.normal};this.options.pedantic?(Ee.block=Fe.pedantic,Ee.inline=He.pedantic):this.options.gfm&&(Ee.block=Fe.gfm,this.options.breaks?Ee.inline=He.breaks:Ee.inline=He.gfm),this.tokenizer.rules=Ee}Be.lex=function(Ee,Ae){var Le=new Be(Ae);return Le.lex(Ee)};var Ie=Be.prototype;return Ie.lex=function(Ee){return Ee=Ee.replace(/\r\n|\r/g,`
|
|
|
`).replace(/\t/g," "),this.blockTokens(Ee,this.tokens,!0),this.inline(this.tokens),this.tokens},Ie.blockTokens=function(Ee,Ae,Le){Ae===void 0&&(Ae=[]),Le===void 0&&(Le=!0),Ee=Ee.replace(/^ +$/gm,"");for(var Te,Ze,ut,Ct;Ee;){if(Te=this.tokenizer.space(Ee)){Ee=Ee.substring(Te.raw.length),Te.type&&Ae.push(Te);continue}if(Te=this.tokenizer.code(Ee,Ae)){Ee=Ee.substring(Te.raw.length),Te.type?Ae.push(Te):(Ct=Ae[Ae.length-1],Ct.raw+=`
|
|
|
`+Te.raw,Ct.text+=`
|
|
|
`+Te.text);continue}if(Te=this.tokenizer.fences(Ee)){Ee=Ee.substring(Te.raw.length),Ae.push(Te);continue}if(Te=this.tokenizer.heading(Ee)){Ee=Ee.substring(Te.raw.length),Ae.push(Te);continue}if(Te=this.tokenizer.nptable(Ee)){Ee=Ee.substring(Te.raw.length),Ae.push(Te);continue}if(Te=this.tokenizer.hr(Ee)){Ee=Ee.substring(Te.raw.length),Ae.push(Te);continue}if(Te=this.tokenizer.blockquote(Ee)){Ee=Ee.substring(Te.raw.length),Te.tokens=this.blockTokens(Te.text,[],Le),Ae.push(Te);continue}if(Te=this.tokenizer.list(Ee)){for(Ee=Ee.substring(Te.raw.length),ut=Te.items.length,Ze=0;Ze<ut;Ze++)Te.items[Ze].tokens=this.blockTokens(Te.items[Ze].text,[],!1);Ae.push(Te);continue}if(Te=this.tokenizer.html(Ee)){Ee=Ee.substring(Te.raw.length),Ae.push(Te);continue}if(Le&&(Te=this.tokenizer.def(Ee))){Ee=Ee.substring(Te.raw.length),this.tokens.links[Te.tag]||(this.tokens.links[Te.tag]={href:Te.href,title:Te.title});continue}if(Te=this.tokenizer.table(Ee)){Ee=Ee.substring(Te.raw.length),Ae.push(Te);continue}if(Te=this.tokenizer.lheading(Ee)){Ee=Ee.substring(Te.raw.length),Ae.push(Te);continue}if(Le&&(Te=this.tokenizer.paragraph(Ee))){Ee=Ee.substring(Te.raw.length),Ae.push(Te);continue}if(Te=this.tokenizer.text(Ee,Ae)){Ee=Ee.substring(Te.raw.length),Te.type?Ae.push(Te):(Ct=Ae[Ae.length-1],Ct.raw+=`
|
|
|
`+Te.raw,Ct.text+=`
|
|
|
`+Te.text);continue}if(Ee){var Ht="Infinite loop on byte: "+Ee.charCodeAt(0);if(this.options.silent){console.error(Ht);break}else throw new Error(Ht)}}return Ae},Ie.inline=function(Ee){var Ae,Le,Te,Ze,ut,Ct,Ht=Ee.length;for(Ae=0;Ae<Ht;Ae++){Ct=Ee[Ae];switch(Ct.type){case"paragraph":case"text":case"heading":{Ct.tokens=[],this.inlineTokens(Ct.text,Ct.tokens);break}case"table":{for(Ct.tokens={header:[],cells:[]},Ze=Ct.header.length,Le=0;Le<Ze;Le++)Ct.tokens.header[Le]=[],this.inlineTokens(Ct.header[Le],Ct.tokens.header[Le]);for(Ze=Ct.cells.length,Le=0;Le<Ze;Le++)for(ut=Ct.cells[Le],Ct.tokens.cells[Le]=[],Te=0;Te<ut.length;Te++)Ct.tokens.cells[Le][Te]=[],this.inlineTokens(ut[Te],Ct.tokens.cells[Le][Te]);break}case"blockquote":{this.inline(Ct.tokens);break}case"list":{for(Ze=Ct.items.length,Le=0;Le<Ze;Le++)this.inline(Ct.items[Le].tokens);break}}}return Ee},Ie.inlineTokens=function(Ee,Ae,Le,Te,Ze){Ae===void 0&&(Ae=[]),Le===void 0&&(Le=!1),Te===void 0&&(Te=!1),Ze===void 0&&(Ze="");var ut,Ct=Ee,Ht;if(this.tokens.links){var Qt=Object.keys(this.tokens.links);if(Qt.length>0)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(;Ee;){if(ut=this.tokenizer.escape(Ee)){Ee=Ee.substring(ut.raw.length),Ae.push(ut);continue}if(ut=this.tokenizer.tag(Ee,Le,Te)){Ee=Ee.substring(ut.raw.length),Le=ut.inLink,Te=ut.inRawBlock,Ae.push(ut);continue}if(ut=this.tokenizer.link(Ee)){Ee=Ee.substring(ut.raw.length),ut.type==="link"&&(ut.tokens=this.inlineTokens(ut.text,[],!0,Te)),Ae.push(ut);continue}if(ut=this.tokenizer.reflink(Ee,this.tokens.links)){Ee=Ee.substring(ut.raw.length),ut.type==="link"&&(ut.tokens=this.inlineTokens(ut.text,[],!0,Te)),Ae.push(ut);continue}if(ut=this.tokenizer.strong(Ee,Ct,Ze)){Ee=Ee.substring(ut.raw.length),ut.tokens=this.inlineTokens(ut.text,[],Le,Te),Ae.push(ut);continue}if(ut=this.tokenizer.em(Ee,Ct,Ze)){Ee=Ee.substring(ut.raw.length),ut.tokens=this.inlineTokens(ut.text,[],Le,Te),Ae.push(ut);continue}if(ut=this.tokenizer.codespan(Ee)){Ee=Ee.substring(ut.raw.length),Ae.push(ut);continue}if(ut=this.tokenizer.br(Ee)){Ee=Ee.substring(ut.raw.length),Ae.push(ut);continue}if(ut=this.tokenizer.del(Ee)){Ee=Ee.substring(ut.raw.length),ut.tokens=this.inlineTokens(ut.text,[],Le,Te),Ae.push(ut);continue}if(ut=this.tokenizer.autolink(Ee,me)){Ee=Ee.substring(ut.raw.length),Ae.push(ut);continue}if(!Le&&(ut=this.tokenizer.url(Ee,me))){Ee=Ee.substring(ut.raw.length),Ae.push(ut);continue}if(ut=this.tokenizer.inlineText(Ee,Te,be)){Ee=Ee.substring(ut.raw.length),Ze=ut.raw.slice(-1),Ae.push(ut);continue}if(Ee){var bt="Infinite loop on byte: "+Ee.charCodeAt(0);if(this.options.silent){console.error(bt);break}else throw new Error(bt)}}return Ae},Q(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(Ee,Ae,Le){var Te=(Ae||"").match(/\S*/)[0];if(this.options.highlight){var Ze=this.options.highlight(Ee,Te);Ze!=null&&Ze!==Ee&&(Le=!0,Ee=Ze)}return Te?'<pre><code class="'+this.options.langPrefix+re(Te,!0)+'">'+(Le?Ee:re(Ee,!0))+`</code></pre>
|
|
|
`:"<pre><code>"+(Le?Ee:re(Ee,!0))+`</code></pre>
|
|
|
`},Ie.blockquote=function(Ee){return`<blockquote>
|
|
|
`+Ee+`</blockquote>
|
|
|
`},Ie.html=function(Ee){return Ee},Ie.heading=function(Ee,Ae,Le,Te){return this.options.headerIds?"<h"+Ae+' id="'+this.options.headerPrefix+Te.slug(Le)+'">'+Ee+"</h"+Ae+`>
|
|
|
`:"<h"+Ae+">"+Ee+"</h"+Ae+`>
|
|
|
`},Ie.hr=function(){return this.options.xhtml?`<hr/>
|
|
|
`:`<hr>
|
|
|
`},Ie.list=function(Ee,Ae,Le){var Te=Ae?"ol":"ul",Ze=Ae&&Le!==1?' start="'+Le+'"':"";return"<"+Te+Ze+`>
|
|
|
`+Ee+"</"+Te+`>
|
|
|
`},Ie.listitem=function(Ee){return"<li>"+Ee+`</li>
|
|
|
`},Ie.checkbox=function(Ee){return"<input "+(Ee?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},Ie.paragraph=function(Ee){return"<p>"+Ee+`</p>
|
|
|
`},Ie.table=function(Ee,Ae){return Ae&&(Ae="<tbody>"+Ae+"</tbody>"),`<table>
|
|
|
<thead>
|
|
|
`+Ee+`</thead>
|
|
|
`+Ae+`</table>
|
|
|
`},Ie.tablerow=function(Ee){return`<tr>
|
|
|
`+Ee+`</tr>
|
|
|
`},Ie.tablecell=function(Ee,Ae){var Le=Ae.header?"th":"td",Te=Ae.align?"<"+Le+' align="'+Ae.align+'">':"<"+Le+">";return Te+Ee+"</"+Le+`>
|
|
|
`},Ie.strong=function(Ee){return"<strong>"+Ee+"</strong>"},Ie.em=function(Ee){return"<em>"+Ee+"</em>"},Ie.codespan=function(Ee){return"<code>"+Ee+"</code>"},Ie.br=function(){return this.options.xhtml?"<br/>":"<br>"},Ie.del=function(Ee){return"<del>"+Ee+"</del>"},Ie.link=function(Ee,Ae,Le){if(Ee=nt(this.options.sanitize,this.options.baseUrl,Ee),Ee===null)return Le;var Te='<a href="'+re(Ee)+'"';return Ae&&(Te+=' title="'+Ae+'"'),Te+=">"+Le+"</a>",Te},Ie.image=function(Ee,Ae,Le){if(Ee=nt(this.options.sanitize,this.options.baseUrl,Ee),Ee===null)return Le;var Te='<img src="'+Ee+'" alt="'+Le+'"';return Ae&&(Te+=' title="'+Ae+'"'),Te+=this.options.xhtml?"/>":">",Te},Ie.text=function(Ee){return Ee},Be}(),U=function(){function Be(){}var Ie=Be.prototype;return Ie.strong=function(Ee){return Ee},Ie.em=function(Ee){return Ee},Ie.codespan=function(Ee){return Ee},Ie.del=function(Ee){return Ee},Ie.html=function(Ee){return Ee},Ie.text=function(Ee){return Ee},Ie.link=function(Ee,Ae,Le){return""+Le},Ie.image=function(Ee,Ae,Le){return""+Le},Ie.br=function(){return""},Be}(),q=function(){function Be(){this.seen={}}var Ie=Be.prototype;return Ie.slug=function(Ee){var Ae=Ee.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(Ae)){var Le=Ae;do this.seen[Le]++,Ae=Le+"-"+this.seen[Le];while(this.seen.hasOwnProperty(Ae))}return this.seen[Ae]=0,Ae},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(Ee,Ae){var Le=new Be(Ae);return Le.parse(Ee)};var Ie=Be.prototype;return Ie.parse=function(Ee,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=Ee.length;for(Te=0;Te<Tt;Te++){pt=Ee[Te];switch(pt.type){case"space":continue;case"hr":{Le+=this.renderer.hr();continue}case"heading":{Le+=this.renderer.heading(this.parseInline(pt.tokens),pt.depth,J(this.parseInline(pt.tokens,this.textRenderer)),this.slugger);continue}case"code":{Le+=this.renderer.code(pt.text,pt.lang,pt.escaped);continue}case"table":{for(Lt="",bt="",Ct=pt.header.length,Ze=0;Ze<Ct;Ze++)bt+=this.renderer.tablecell(this.parseInline(pt.tokens.header[Ze]),{header:!0,align:pt.align[Ze]});for(Lt+=this.renderer.tablerow(bt),at="",Ct=pt.cells.length,Ze=0;Ze<Ct;Ze++){for(Qt=pt.tokens.cells[Ze],bt="",Ht=Qt.length,ut=0;ut<Ht;ut++)bt+=this.renderer.tablecell(this.parseInline(Qt[ut]),{header:!1,align:pt.align[ut]});at+=this.renderer.tablerow(bt)}Le+=this.renderer.table(Lt,at);continue}case"blockquote":{at=this.parse(pt.tokens),Le+=this.renderer.blockquote(at);continue}case"list":{for(st=pt.ordered,De=pt.start,Ke=pt.loose,Ct=pt.items.length,at="",Ze=0;Ze<Ct;Ze++)ot=pt.items[Ze],kt=ot.checked,Dt=ot.task,yt="",ot.task&&(rt=this.renderer.checkbox(kt),Ke?ot.tokens.length>0&&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+1<Tt&&Ee[Te+1].type==="text";)pt=Ee[++Te],at+=`
|
|
|
`+(pt.tokens?this.parseInline(pt.tokens):pt.text);Le+=Ae?this.renderer.paragraph(at):at;continue}default:{var Ft='Token with "'+pt.type+'" type was not found.';if(this.options.silent){console.error(Ft);return}else throw new Error(Ft)}}}return Le},Ie.parseInline=function(Ee,Ae){Ae=Ae||this.renderer;var Le="",Te,Ze,ut=Ee.length;for(Te=0;Te<ut;Te++){Ze=Ee[Te];switch(Ze.type){case"escape":{Le+=Ae.text(Ze.text);break}case"html":{Le+=Ae.html(Ze.text);break}case"link":{Le+=Ae.link(Ze.href,Ze.title,this.parseInline(Ze.tokens,Ae));break}case"image":{Le+=Ae.image(Ze.href,Ze.title,Ze.text);break}case"strong":{Le+=Ae.strong(this.parseInline(Ze.tokens,Ae));break}case"em":{Le+=Ae.em(this.parseInline(Ze.tokens,Ae));break}case"codespan":{Le+=Ae.codespan(Ze.text);break}case"br":{Le+=Ae.br();break}case"del":{Le+=Ae.del(this.parseInline(Ze.tokens,Ae));break}case"text":{Le+=Ae.text(Ze.text);break}default:{var Ct='Token with "'+Ze.type+'" type was not found.';if(this.options.silent){console.error(Ct);return}else throw new Error(Ct)}}}return Le},Be}(),ke=te.merge,dt=te.checkSanitizeDeprecation,Ne=te.escape,je=T.getDefaults,tt=T.changeDefaults,mt=T.defaults;function Qe(Be,Ie,Me){if(typeof Be=="undefined"||Be===null)throw new Error("marked(): input parameter is undefined or null");if(typeof Be!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(Be)+", string expected");if(typeof Ie=="function"&&(Me=Ie,Ie=null),Ie=ke({},Qe.defaults,Ie||{}),dt(Ie),Me){var Ee=Ie.highlight,Ae;try{Ae=We.lex(Be,Ie)}catch(ut){return Me(ut)}var Le=function(Ct){var Ht;if(!Ct)try{Ht=xe.parse(Ae,Ie)}catch(Qt){Ct=Qt}return Ie.highlight=Ee,Ct?Me(Ct):Me(null,Ht)};if(!Ee||Ee.length<3)return Le();if(delete Ie.highlight,!Ae.length)return Le();var Te=0;Qe.walkTokens(Ae,function(ut){ut.type==="code"&&(Te++,setTimeout(function(){Ee(ut.text,ut.lang,function(Ct,Ht){if(Ct)return Le(Ct);Ht!=null&&Ht!==ut.text&&(ut.text=Ht,ut.escaped=!0),Te--,Te===0&&Le()})},0))}),Te===0&&Le();return}try{var Ze=We.lex(Be,Ie);return Ie.walkTokens&&Qe.walkTokens(Ze,Ie.walkTokens),xe.parse(Ze,Ie)}catch(ut){if(ut.message+=`
|
|
|
Please report this to https://github.com/markedjs/marked.`,Ie.silent)return"<p>An error occurred:</p><pre>"+Ne(ut.message+"",!0)+"</pre>";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 Ee=Qe.defaults.renderer||new k,Ae=function(Ze){var ut=Ee[Ze];Ee[Ze]=function(){for(var Ct=arguments.length,Ht=new Array(Ct),Qt=0;Qt<Ct;Qt++)Ht[Qt]=arguments[Qt];var bt=Be.renderer[Ze].apply(Ee,Ht);return bt===!1&&(bt=ut.apply(Ee,Ht)),bt}};for(var Le in Be.renderer)Ae(Le);Ie.renderer=Ee}(),Be.tokenizer&&function(){var Ee=Qe.defaults.tokenizer||new de,Ae=function(Ze){var ut=Ee[Ze];Ee[Ze]=function(){for(var Ct=arguments.length,Ht=new Array(Ct),Qt=0;Qt<Ct;Qt++)Ht[Qt]=arguments[Qt];var bt=Be.tokenizer[Ze].apply(Ee,Ht);return bt===!1&&(bt=ut.apply(Ee,Ht)),bt}};for(var Le in Be.tokenizer)Ae(Le);Ie.tokenizer=Ee}(),Be.walkTokens){var Me=Qe.defaults.walkTokens;Ie.walkTokens=function(Ee){Be.walkTokens(Ee),Me&&Me(Ee)}}Qe.setOptions(Ie)},Qe.walkTokens=function(Be,Ie){for(var Me=P(Be),Ee;!(Ee=Me()).done;){var Ae=Ee.value;Ie(Ae);switch(Ae.type){case"table":{for(var Le=P(Ae.tokens.header),Te;!(Te=Le()).done;){var Ze=Te.value;Qe.walkTokens(Ze,Ie)}for(var ut=P(Ae.tokens.cells),Ct;!(Ct=ut()).done;)for(var Ht=Ct.value,Qt=P(Ht),bt;!(bt=Qt()).done;){var Lt=bt.value;Qe.walkTokens(Lt,Ie)}break}case"list":{Qe.walkTokens(Ae.items,Ie);break}default:Ae.tokens&&Qe.walkTokens(Ae.tokens,Ie)}}},Qe.Parser=xe,Qe.parser=xe.parse,Qe.Renderer=k,Qe.TextRenderer=U,Qe.Lexer=We,Qe.lexer=We.lex,Qe.Tokenizer=de,Qe.Slugger=q,Qe.parse=Qe;var Xe=Qe;return Xe})},"DlR+":function(et,Ve,z){var le=z("MFOe"),Q=le.Global,j=le.trim;et.exports={name:"cookieStorage",read:P,write:T,each:b,remove:C,clearAll:c};var w=Q.document;function P(d){if(!d||!p(d))return null;var o="(?:^|.*;\\s*)"+escape(d).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*((?:[^;](?!;))*[^;]?).*";return unescape(w.cookie.replace(new RegExp(o),"$1"))}function b(d){for(var o=w.cookie.split(/; ?/g),a=o.length-1;a>=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){E[T]=U,E[T+1]=q,T+=2,T===2&&(c?c(_):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(_)}}function t(){return typeof C!="undefined"?function(){C(_)}:m()}function f(){var k=0,U=new s(_),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=_,function(){return k.port2.postMessage(0)}}function m(){var k=setTimeout;return function(){return k(_,1)}}var E=new Array(1e3);function _(){for(var k=0;k<T;k+=2){var U=E[k],q=E[k+1];U(q),E[k]=void 0,E[k+1]=void 0}T=0}function g(){try{var k=Function("return this")().require("vertx");return C=k.runOnLoop||k.runOnContext,t()}catch(U){return m()}}var y=void 0;h?y=n():s?y=f():i?y=v():a===void 0&&!0?y=g():y=m();function x(k,U){var q=this,$=new this.constructor(O);$[S]===void 0&&Ge($);var J=q._state;if(J){var xe=arguments[J-1];p(function(){return Se(J,$,xe,q._result)})}else de(q,$,k,U);return $}function l(k){var U=this;if(k&&typeof k=="object"&&k.constructor===U)return k;var q=new U(O);return ne(q,k),q}var S=Math.random().toString(36).substring(2);function O(){}var A=void 0,D=1,I=2;function B(){return new TypeError("You cannot resolve a promise with itself")}function H(){return new TypeError("A promises callback cannot return that same promise.")}function te(k,U,q,$){try{k.call(U,q,$)}catch(J){return J}}function W(k,U,q){p(function($){var J=!1,xe=te(q,U,function(ke){if(J)return;J=!0,U!==ke?ne($,ke):ee($,ke)},function(ke){if(J)return;J=!0,ce($,ke)},"Settle: "+($._label||" unknown promise"));!J&&xe&&(J=!0,ce($,xe))},k)}function V(k,U){U._state===D?ee(k,U._result):U._state===I?ce(k,U._result):de(U,void 0,function(q){return ne(k,q)},function(q){return ce(k,q)})}function X(k,U,q){U.constructor===k.constructor&&q===x&&U.constructor.resolve===l?V(k,U):q===void 0?ee(k,U):w(q)?W(k,U,q):ee(k,U)}function ne(k,U){if(k===U)ce(k,B());else if(j(U)){var q=void 0;try{q=U.then}catch($){ce(k,$);return}X(k,U,q)}else ee(k,U)}function Y(k){k._onerror&&k._onerror(k._result),Ce(k)}function ee(k,U){if(k._state!==A)return;k._result=U,k._state=D,k._subscribers.length!==0&&p(Ce,k)}function ce(k,U){if(k._state!==A)return;k._state=I,k._result=U,p(Y,k)}function de(k,U,q,$){var J=k._subscribers,xe=J.length;k._onerror=null,J[xe]=U,J[xe+D]=q,J[xe+I]=$,xe===0&&k._state&&p(Ce,k)}function Ce(k){var U=k._subscribers,q=k._state;if(U.length===0)return;for(var $=void 0,J=void 0,xe=k._result,ke=0;ke<U.length;ke+=3)$=U[ke],J=U[ke+q],$?Se(q,$,J,xe):J(xe);k._subscribers.length=0}function Se(k,U,q,$){var J=w(q),xe=void 0,ke=void 0,dt=!0;if(J){try{xe=q($)}catch(Ne){dt=!1,ke=Ne}if(U===xe){ce(U,H());return}}else xe=$;U._state!==A||(J&&dt?ne(U,xe):dt===!1?ce(U,ke):k===D?ee(U,xe):k===I&&ce(U,xe))}function Pe(k,U){try{U(function($){ne(k,$)},function($){ce(k,$)})}catch(q){ce(k,q)}}var ye=0;function _e(){return ye++}function Ge(k){k[S]=ye++,k._state=void 0,k._result=void 0,k._subscribers=[]}function Ue(){return new Error("Array Methods must be provided an Array")}var Fe=function(){function k(U,q){this._instanceConstructor=U,this.promise=new U(O),this.promise[S]||Ge(this.promise),b(q)?(this.length=q.length,this._remaining=q.length,this._result=new Array(this.length),this.length===0?ee(this.promise,this._result):(this.length=this.length||0,this._enumerate(q),this._remaining===0&&ee(this.promise,this._result))):ce(this.promise,Ue())}return k.prototype._enumerate=function(q){for(var $=0;this._state===A&&$<q.length;$++)this._eachEntry(q[$],$)},k.prototype._eachEntry=function(q,$){var J=this._instanceConstructor,xe=J.resolve;if(xe===l){var ke=void 0,dt=void 0,Ne=!1;try{ke=q.then}catch(tt){Ne=!0,dt=tt}if(ke===x&&q._state!==A)this._settledAt(q._state,$,q._result);else if(typeof ke!="function")this._remaining--,this._result[$]=q;else if(J===nt){var je=new J(O);Ne?ce(je,dt):X(je,q,ke),this._willSettleAt(je,$)}else this._willSettleAt(new J(function(tt){return tt(q)}),$)}else this._willSettleAt(xe(q),$)},k.prototype._settledAt=function(q,$,J){var xe=this.promise;xe._state===A&&(this._remaining--,q===I?ce(xe,J):this._result[$]=J),this._remaining===0&&ee(xe,this._result)},k.prototype._willSettleAt=function(q,$){var J=this;de(q,void 0,function(xe){return J._settledAt(D,$,xe)},function(xe){return J._settledAt(I,$,xe)})},k}();function He(k){return new Fe(this,k).promise}function be(k){var U=this;return b(k)?new U(function(q,$){for(var J=k.length,xe=0;xe<J;xe++)U.resolve(k[xe]).then(q,$)}):new U(function(q,$){return $(new TypeError("You must pass an array to race."))})}function me(k){var U=this,q=new U(O);return ce(q,k),q}function We(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function ze(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}var nt=function(){function k(U){this[S]=_e(),this._result=this._state=void 0,this._subscribers=[],O!==U&&(typeof U!="function"&&We(),this instanceof k?Pe(this,U):ze())}return k.prototype.catch=function(q){return this.then(null,q)},k.prototype.finally=function(q){var $=this,J=$.constructor;return w(q)?$.then(function(xe){return J.resolve(q()).then(function(){return xe})},function(xe){return J.resolve(q()).then(function(){throw xe})}):$.then(q,q)},k}();nt.prototype.then=x,nt.all=He,nt.race=be,nt.resolve=l,nt.reject=me,nt._setScheduler=d,nt._setAsap=o,nt._asap=p;function re(){var k=void 0;if(typeof Q!="undefined")k=Q;else if(typeof self!="undefined")k=self;else try{k=Function("return this")()}catch($){throw new Error("polyfill failed because global object is unavailable in this environment")}var U=k.Promise;if(U){var q=null;try{q=Object.prototype.toString.call(U.resolve())}catch($){}if(q==="[object Promise]"&&!U.cast)return}k.Promise=nt}return nt.polyfill=re,nt.Promise=nt,nt})}).call(this,z("Q2Ig"),z("IyRk"))},E9nw:function(et,Ve){et.exports=function(){var z=document.getSelection();if(!z.rangeCount)return function(){};for(var le=document.activeElement,Q=[],j=0;j<z.rangeCount;j++)Q.push(z.getRangeAt(j));switch(le.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":le.blur();break;default:le=null;break}return z.removeAllRanges(),function(){z.type==="Caret"&&z.removeAllRanges(),z.rangeCount||Q.forEach(function(w){z.addRange(w)}),le&&le.focus()}}},EHPI:function(et,Ve,z){"use strict";var le=z("bbsP"),Q=z("/wGt"),j=z("tJVT"),w=z("k1fw"),P=z("q1tI"),b=z.n(P),T=z("ZW9T"),C=z("ZD9Y"),c=z("M8RZ"),p=z("bCnd"),d=z("fcyK"),o=z.n(d),a={theme:Object(p.a)("cmCodeMode","vs-dark"),fontSize:Object(p.a)("cmFontSize",14),showEditorSetting:!1,tabToSpace:Object(p.a)("cmTabToSpace",!0)},u;(function(i){i[i.set_font_size=0]="set_font_size",i[i.set_theme=1]="set_theme",i[i.on_tab_to_space=2]="on_tab_to_space",i[i.set_show_editor_setting=3]="set_show_editor_setting"})(u||(u={}));function s(i,n){switch(n.type){case u.set_show_editor_setting:return Object(w.a)(Object(w.a)({},i),{},{showEditorSetting:n.payload});case u.set_theme:return Object(w.a)(Object(w.a)({},i),{},{theme:n.payload});case u.set_font_size:return Object(w.a)(Object(w.a)({},i),{},{fontSize:n.payload});case u.on_tab_to_space:return Object(w.a)(Object(w.a)({},i),{},{tabToSpace:n.payload});default:throw new Error}}Ve.a=function(i){var n=i.value,t=i.onChange,f=i.language,v=i.ActionBarRender,m=v===void 0?function(H){return b.a.createElement(h,{onShowCodeSetting:H})}:v,E=Object(P.useReducer)(s,a),_=Object(j.a)(E,2),g=_[0],y=_[1],x=g.theme,l=g.fontSize,S=g.showEditorSetting,O=g.tabToSpace,A={onFontSizeChange:function(te){y({type:u.set_font_size,payload:te}),Object(p.b)("cmFontSize",te)},tabToSpace:O,cmFontSize:l,className:"oj",cmCodeMode:x,onTabToSpace:function(te){y({type:u.on_tab_to_space,payload:te}),Object(p.b)("cmTabToSpace",te)},onCodeModeChange:function(te){y({type:u.set_theme,payload:te}),Object(p.b)("cmCodeMode",te)}};function D(){y({type:u.set_show_editor_setting,payload:!1})}function I(){y({type:u.set_show_editor_setting,payload:!0})}var B={value:n,language:f,onChange:t,theme:x,height:"calc(100% - 56px)",options:{fontSize:l,insertSpaces:O}};return b.a.createElement(P.Fragment,null,b.a.createElement("div",{className:"code-panel-container"},m(I),b.a.createElement(T.b,B)),b.a.createElement(c.a,null,b.a.createElement(Q.a,{className:"oj",title:null,placement:"right",closable:!1,visible:S,onClose:D},b.a.createElement(C.a,A))))};function h(i){var n=i.onShowCodeSetting;return b.a.createElement("div",{className:"action-bar"},b.a.createElement("span",null,"\u5B66\u5458\u521D\u59CB\u4EE3\u7801\u6587\u4EF6"),b.a.createElement("a",{onClick:n},b.a.createElement("i",{className:"iconfont icon-shezhi"})))}},ELLl:function(et,Ve,z){(function(le){le(z("VrN/"))})(function(le){var Q={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,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<s.length;h++){var i=s.charAt(h),n="'"+i+"'";P[n]||(P[n]=T(i))}}b(Q.pairs+"`");function T(s){return function(h){return o(h,s)}}function C(s){var h=s.state.closeBrackets;if(!h||h.override)return h;var i=s.getModeAt(s.getCursor());return i.closeBrackets||h}function c(s){var h=C(s);if(!h||s.getOption("disableInput"))return le.Pass;for(var i=w(h,"pairs"),n=s.listSelections(),t=0;t<n.length;t++){if(!n[t].empty())return le.Pass;var f=a(s,n[t].head);if(!f||i.indexOf(f)%2!=0)return le.Pass}for(var t=n.length-1;t>=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;t<n.length;t++){if(!n[t].empty())return le.Pass;var f=a(s,n[t].head);if(!f||i.indexOf(f)%2!=0)return le.Pass}s.operation(function(){var v=s.lineSeparator()||`
|
|
|
`;s.replaceSelection(v+v,null),s.execCommand("goCharLeft"),n=s.listSelections();for(var m=0;m<n.length;m++){var E=n[m].head.line;s.indentLine(E,null,!0),s.indentLine(E+1,null,!0)}})}function d(s){var h=le.cmpPos(s.anchor,s.head)>0;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,E=s.listSelections(),_=t%2==0,g,y=0;y<E.length;y++){var x=E[y],l=x.head,S,O=s.getRange(l,j(l.line,l.ch+1));if(_&&!x.empty())S="surround";else if((m||!_)&&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(_&&(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<H.length;B++)H[B]=D+H[B]+I;s.replaceSelections(H,"around"),H=s.listSelections().slice();for(var B=0;B<H.length;B++)H[B]=d(H[B]);s.setSelections(H)}else g=="both"?(s.replaceSelection(D+I,null),s.triggerElectric(D+I),s.execCommand("goCharLeft")):g=="addFour"&&(s.replaceSelection(D+D+D+D,"before"),s.execCommand("goCharRight"))})}function a(s,h){var i=s.getRange(j(h.line,h.ch-1),j(h.line,h.ch+1));return i.length==2?i:null}function u(s,h){var i=s.getTokenAt(j(h.line,h.ch+1));return/\bstring/.test(i.type)&&i.start==h.ch&&(h.ch==0||!/\bstring/.test(s.getTokenTypeAt(h)))}})},FOrL:function(et,Ve,z){et.exports=z.p+"static/nodata.a6b3f948.png"},GUcZ:function(et,Ve,z){"use strict";var le=z("fWQN"),Q=z("mtLc"),j=function(){function Re(){Object(le.a)(this,Re)}return Object(Q.a)(Re,null,[{key:"install",value:function(){Object.setPrototypeOf=Object.setPrototypeOf||function(K,Z){return K.__proto__=Z,K},Object.assign=Object.assign||function(K){if(K==null)throw new TypeError("Cannot convert undefined or null to object");for(var Z=Object(K),oe=1;oe<arguments.length;oe++){var he=arguments[oe];if(he!=null)for(var Oe in he)he.hasOwnProperty(Oe)&&(Z[Oe]=he[Oe])}return Z},typeof self.Promise!="function"&&z("E2g8").polyfill()}}]),Re}();j.install();var w=j,P=z("+qE3"),b=z.n(P),T=function(){function Re(){Object(le.a)(this,Re)}return Object(Q.a)(Re,null,[{key:"e",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","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 E={};function _(){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 E)E.hasOwnProperty(Nt)&&delete E[Nt];Object.assign(E,oe)}_();var g=E,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<he._contentLength){he._status=i.kError;var Je=n.EARLY_EOF,lt={code:-1,msg:"Fetch stream meet Early-EOF"};if(he._onError)he._onError(Je,lt);else throw new a(lt.msg)}else he._status=i.kComplete,he._onComplete&&he._onComplete(he._range.from,he._range.from+he._receivedLength-1);else{if(he._requestAbort===!0)return he._requestAbort=!1,he._status=i.kComplete,oe.cancel();he._status=i.kBuffering;var Pt=Oe.value.buffer,Nt=he._range.from+he._receivedLength;he._receivedLength+=Pt.byteLength,he._onDataArrival&&he._onDataArrival(Pt,Nt,he._receivedLength),he._pump(oe)}}).catch(function(Oe){if(Oe.code===11&&g.msedge)return;he._status=i.kError;var Je=0,lt=null;if((Oe.code===19||Oe.message==="network error")&&(he._contentLength===null||he._contentLength!==null&&he._receivedLength<he._contentLength)?(Je=n.EARLY_EOF,lt={code:Oe.code,msg:"Fetch stream meet Early-EOF"}):(Je=n.EXCEPTION,lt={code:Oe.code,msg:Oe.message}),he._onError)he._onError(Je,lt);else throw new a(lt.msg)})}}],[{key:"isSupported",value:function(){try{var oe=g.msedge&&g.version.minor>=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<this._contentLength?(he=n.EARLY_EOF,Oe={code:-1,msg:"Moz-Chunked stream meet Early-Eof"}):(he=n.EXCEPTION,Oe={code:-1,msg:oe.constructor.name+" "+oe.type}),this._onError)this._onError(he,Oe);else throw new a(Oe.msg)}}],[{key:"isSupported",value:function(){try{var oe=new XMLHttpRequest;return oe.open("GET","https://example.com",!0),oe.responseType="moz-chunked-arraybuffer",oe.responseType==="moz-chunked-arraybuffer"}catch(he){return C.w("MozChunkedLoader",he.message),!1}}}]),K}(t),S=l,O=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-msstream-loader"),he.TAG="MSStreamLoader",he._seekHandler=Z,he._config=oe,he._needStash=!0,he._xhr=null,he._reader=null,he._totalRange=null,he._currentRange=null,he._currentRequestURL=null,he._currentRedirectedURL=null,he._contentLength=null,he._receivedLength=0,he._bufferLimit=16*1024*1024,he._lastTimeBufferSize=0,he._isReconnecting=!1,he}return Object(Q.a)(K,[{key:"destroy",value:function(){this.isWorking()&&this.abort(),this._reader&&(this._reader.onprogress=null,this._reader.onload=null,this._reader.onerror=null,this._reader=null),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr=null),m(Object(f.a)(K.prototype),"destroy",this).call(this)}},{key:"open",value:function(oe,he){this._internalOpen(oe,he,!1)}},{key:"_internalOpen",value:function(oe,he,Oe){this._dataSource=oe,Oe?this._currentRange=he:this._totalRange=he;var Je=oe.url;this._config.reuseRedirectedURL&&(this._currentRedirectedURL!=null?Je=this._currentRedirectedURL:oe.redirectedURL!=null&&(Je=oe.redirectedURL));var lt=this._seekHandler.getConfig(Je,he);this._currentRequestURL=lt.url;var Pt=this._reader=new self.MSStreamReader;Pt.onprogress=this._msrOnProgress.bind(this),Pt.onload=this._msrOnLoad.bind(this),Pt.onerror=this._msrOnError.bind(this);var Nt=this._xhr=new XMLHttpRequest;if(Nt.open("GET",lt.url,!0),Nt.responseType="ms-stream",Nt.onreadystatechange=this._xhrOnReadyStateChange.bind(this),Nt.onerror=this._xhrOnError.bind(this),oe.withCredentials&&(Nt.withCredentials=!0),typeof lt.headers=="object"){var ht=lt.headers;for(var Mt in ht)ht.hasOwnProperty(Mt)&&Nt.setRequestHeader(Mt,ht[Mt])}if(typeof this._config.headers=="object"){var nn=this._config.headers;for(var Rt in nn)nn.hasOwnProperty(Rt)&&Nt.setRequestHeader(Rt,nn[Rt])}this._isReconnecting?this._isReconnecting=!1:this._status=i.kConnecting,Nt.send()}},{key:"abort",value:function(){this._internalAbort(),this._status=i.kComplete}},{key:"_internalAbort",value:function(){this._reader&&(this._reader.readyState===1&&this._reader.abort(),this._reader.onprogress=null,this._reader.onload=null,this._reader.onerror=null,this._reader=null),this._xhr&&(this._xhr.abort(),this._xhr.onreadystatechange=null,this._xhr=null)}},{key:"_xhrOnReadyStateChange",value:function(oe){var he=oe.target;if(he.readyState===2)if(he.status>=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){this._isReconnecting=!0,this._lastTimeBufferSize=0,this._internalAbort();var oe={from:this._totalRange.from+this._receivedLength,to:-1};this._internalOpen(this._dataSource,oe,!0)}}},{key:"_msrOnLoad",value:function(oe){this._status=i.kComplete,this._onComplete&&this._onComplete(this._totalRange.from,this._totalRange.from+this._receivedLength-1)}},{key:"_msrOnError",value:function(oe){this._status=i.kError;var he=0,Oe=null;if(this._contentLength&&this._receivedLength<this._contentLength?(he=n.EARLY_EOF,Oe={code:-1,msg:"MSStream meet Early-Eof"}):(he=n.EARLY_EOF,Oe={code:-1,msg:oe.constructor.name+" "+oe.type}),this._onError)this._onError(he,Oe);else throw new a(Oe.msg)}}],[{key:"isSupported",value:function(){try{if(typeof self.MSStream=="undefined"||typeof self.MSStreamReader=="undefined")return!1;var oe=new XMLHttpRequest;return oe.open("GET","https://example.com",!0),oe.responseType="ms-stream",oe.responseType==="ms-stream"}catch(he){return C.w("MSStreamLoader",he.message),!1}}}]),K}(t),A=O,D=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-range-loader"),he.TAG="RangeLoader",he._seekHandler=Z,he._config=oe,he._needStash=!1,he._chunkSizeKBList=[128,256,384,512,768,1024,1536,2048,3072,4096,5120,6144,7168,8192],he._currentChunkSizeKB=384,he._currentSpeedNormalized=0,he._zeroSpeedChunkCount=0,he._xhr=null,he._speedSampler=new p,he._requestAbort=!1,he._waitForTotalLength=!1,he._totalLengthReceived=!1,he._currentRequestURL=null,he._currentRedirectedURL=null,he._currentRequestRange=null,he._totalLength=null,he._contentLength=null,he._receivedLength=0,he._lastTimeLoaded=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.onload=null,this._xhr.onerror=null,this._xhr=null),m(Object(f.a)(K.prototype),"destroy",this).call(this)}},{key:"currentSpeed",get:function(){return this._speedSampler.lastSecondKBps}},{key:"open",value:function(oe,he){this._dataSource=oe,this._range=he,this._status=i.kConnecting;var Oe=!1;this._dataSource.filesize!=null&&this._dataSource.filesize!==0&&(Oe=!0,this._totalLength=this._dataSource.filesize),!this._totalLengthReceived&&!Oe?(this._waitForTotalLength=!0,this._internalOpen(this._dataSource,{from:0,to:-1})):this._openSubRange()}},{key:"_openSubRange",value:function(){var oe=this._currentChunkSizeKB*1024,he=this._range.from+this._receivedLength,Oe=he+oe;this._contentLength!=null&&(Oe-this._range.from>=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[0])return he[0];for(;lt<=Pt;){if(Je=lt+Math.floor((Pt-lt)/2),Je===Oe||oe>=he[Je]&&oe<he[Je+1])return he[Je];he[Je]<oe?lt=Je+1:Pt=Je-1}}},{key:"_onLoad",value:function(oe){if(this._status===i.kError)return;if(this._waitForTotalLength){this._waitForTotalLength=!1;return}this._lastTimeLoaded=0;var he=this._speedSampler.lastSecondKBps;if(he===0&&(this._zeroSpeedChunkCount++,this._zeroSpeedChunkCount>=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._receivedLength<this._contentLength?this._openSubRange():Pt=!0,this._onDataArrival&&this._onDataArrival(Je,lt,this._receivedLength),Pt&&(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&&this._receivedLength>0&&this._receivedLength<this._contentLength?(he=n.EARLY_EOF,Oe={code:-1,msg:"RangeLoader meet Early-Eof"}):(he=n.EXCEPTION,Oe={code:-1,msg:oe.constructor.name+" "+oe.type}),this._onError)this._onError(he,Oe);else throw new a(Oe.msg)}}],[{key:"isSupported",value:function(){try{var oe=new XMLHttpRequest;return oe.open("GET","https://example.com",!0),oe.responseType="arraybuffer",oe.responseType==="arraybuffer"}catch(he){return C.w("RangeLoader",he.message),!1}}}]),K}(t),I=D,B=function(Re){Object(d.a)(K,Re);var ve=Object(o.a)(K);function K(){var Z;return Object(le.a)(this,K),Z=ve.call(this,"websocket-loader"),Z.TAG="WebSocketLoader",Z._needStash=!0,Z._ws=null,Z._requestAbort=!1,Z._receivedLength=0,Z}return Object(Q.a)(K,[{key:"destroy",value:function(){this._ws&&this.abort(),m(Object(f.a)(K.prototype),"destroy",this).call(this)}},{key:"open",value:function(oe){try{var he=this._ws=new self.WebSocket(oe.url);he.binaryType="arraybuffer",he.onopen=this._onWebSocketOpen.bind(this),he.onclose=this._onWebSocketClose.bind(this),he.onmessage=this._onWebSocketMessage.bind(this),he.onerror=this._onWebSocketError.bind(this),this._status=i.kConnecting}catch(Je){this._status=i.kError;var Oe={code:Je.code,msg:Je.message};if(this._onError)this._onError(n.EXCEPTION,Oe);else throw new a(Oe.msg)}}},{key:"abort",value:function(){var oe=this._ws;oe&&(oe.readyState===0||oe.readyState===1)&&(this._requestAbort=!0,oe.close()),this._ws=null,this._status=i.kComplete}},{key:"_onWebSocketOpen",value:function(oe){this._status=i.kBuffering}},{key:"_onWebSocketClose",value:function(oe){if(this._requestAbort===!0){this._requestAbort=!1;return}this._status=i.kComplete,this._onComplete&&this._onComplete(0,this._receivedLength-1)}},{key:"_onWebSocketMessage",value:function(oe){var he=this;if(oe.data instanceof ArrayBuffer)this._dispatchArrayBuffer(oe.data);else if(oe.data instanceof Blob){var Oe=new FileReader;Oe.onload=function(){he._dispatchArrayBuffer(Oe.result)},Oe.readAsArrayBuffer(oe.data)}else{this._status=i.kError;var Je={code:-1,msg:"Unsupported WebSocket message type: "+oe.data.constructor.name};if(this._onError)this._onError(n.EXCEPTION,Je);else throw new a(Je.msg)}}},{key:"_dispatchArrayBuffer",value:function(oe){var he=oe,Oe=this._receivedLength;this._receivedLength+=he.byteLength,this._onDataArrival&&this._onDataArrival(he,Oe,this._receivedLength)}},{key:"_onWebSocketError",value:function(oe){this._status=i.kError;var he={code:oe.code,msg:oe.message};if(this._onError)this._onError(n.EXCEPTION,he);else throw new a(he.msg)}}],[{key:"isSupported",value:function(){try{return typeof self.WebSocket!="undefined"}catch(oe){return!1}}}]),K}(t),H=B,te=function(){function Re(ve){Object(le.a)(this,Re),this._zeroStart=ve||!1}return Object(Q.a)(Re,[{key:"getConfig",value:function(K,Z){var oe={};if(Z.from!==0||Z.to!==-1){var he;Z.to!==-1?he="bytes=".concat(Z.from.toString(),"-").concat(Z.to.toString()):he="bytes=".concat(Z.from.toString(),"-"),oe.Range=he}else this._zeroStart&&(oe.Range="bytes=0-");return{url:K,headers:oe}}},{key:"removeURLParameters",value:function(K){return K}}]),Re}(),W=te,V=function(){function Re(ve,K){Object(le.a)(this,Re),this._startName=ve,this._endName=K}return Object(Q.a)(Re,[{key:"getConfig",value:function(K,Z){var oe=K;if(Z.from!==0||Z.to!==-1){var he=!0;oe.indexOf("?")===-1&&(oe+="?",he=!1),he&&(oe+="&"),oe+="".concat(this._startName,"=").concat(Z.from.toString()),Z.to!==-1&&(oe+="&".concat(this._endName,"=").concat(Z.to.toString()))}return{url:oe,headers:{}}}},{key:"removeURLParameters",value:function(K){var Z=K.split("?")[0],oe=void 0,he=K.indexOf("?");he!==-1&&(oe=K.substring(he+1));var Oe="";if(oe!=null&&oe.length>0)for(var Je=oe.split("&"),lt=0;lt<Je.length;lt++){var Pt=Je[lt].split("="),Nt=lt>0;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*1<K;)Z*=2;if(Z+=1024*1024*1,Z===this._bufferSize)return;var oe=new ArrayBuffer(Z);if(this._stashUsed>0){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[0])return Z[0];for(;Oe<=Je;){if(he=Oe+Math.floor((Je-Oe)/2),he===oe||K>=Z[he]&&K<Z[he+1])return Z[he];Z[he]<K?Oe=he+1:Je=he-1}}},{key:"_adjustStashSize",value:function(K){var Z=0;this._config.isLive||K<512?Z=K: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._bufferSize<oe&&this._expandBuffer(oe),this._stashSize=Z*1024}},{key:"_dispatchChunks",value:function(K,Z){return this._currentRange.to=Z+K.byteLength-1,this._onDataArrival(K,Z)}},{key:"_onURLRedirect",value:function(K){this._redirectedURL=K,this._onRedirect&&this._onRedirect(K)}},{key:"_onContentLengthKnown",value:function(K){K&&this._fullRequestFlag&&(this._totalLength=K,this._fullRequestFlag=!1)}},{key:"_onLoaderChunkArrival",value:function(K,Z,oe){if(!this._onDataArrival)throw new u("IOController: No existing consumer (onDataArrival) callback!");if(this._paused)return;this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,this._onRecoveredEarlyEof&&this._onRecoveredEarlyEof()),this._speedSampler.addBytes(K.byteLength);var he=this._speedSampler.lastSecondKBps;if(he!==0){var Oe=this._normalizeSpeed(he);this._speedNormalized!==Oe&&(this._speedNormalized=Oe,this._adjustStashSize(Oe))}if(this._enableStash)if(this._stashUsed===0&&this._stashByteStart===0&&(this._stashByteStart=Z),this._stashUsed+K.byteLength<=this._stashSize){var nn=new Uint8Array(this._stashBuffer,0,this._stashSize);nn.set(new Uint8Array(K),this._stashUsed),this._stashUsed+=K.byteLength}else{var Rt=new Uint8Array(this._stashBuffer,0,this._bufferSize);if(this._stashUsed>0){var cn=this._stashBuffer.slice(0,this._stashUsed),an=this._dispatchChunks(cn,this._stashByteStart);if(an<cn.byteLength){if(an>0){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(N<K.byteLength){var F=K.byteLength-N;F>this._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(Je<K.byteLength){var lt=K.byteLength-Je;lt>this._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(ht<this._stashUsed&&ht>0){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(oe<Z.byteLength)if(K)C.w(this.TAG,"".concat(he," bytes unconsumed data remain when flush buffer, dropped"));else{if(oe>0){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;oe<this._totalLength&&(C.w(this.TAG,"Connection lost, trying reconnect..."),this._isEarlyEofReconnecting=!0,this._internalSeek(oe,!1));return}K=n.UNRECOVERABLE_EARLY_EOF;break}case n.UNRECOVERABLE_EARLY_EOF:case n.CONNECTING_TIMEOUT:case n.HTTP_STATUS_CODE_INVALID:case n.EXCEPTION:break}if(this._onError)this._onError(K,Z);else throw new a("IOException: "+Z.msg)}}]),Re}(),Y=ne,ee={enableWorker:!1,enableStashBuffer:!0,stashInitialSize:void 0,isLive:!1,lazyLoad:!0,lazyLoadMaxDuration:3*60,lazyLoadRecoverDuration:30,deferLoadAfterSourceOpen:!0,autoCleanupMaxBackwardDuration:3*60,autoCleanupMinBackwardDuration:2*60,statisticsInfoReportInterval:600,fixAudioTimestampGap:!0,accurateSeek:!1,seekType:"range",seekParamStart:"bstart",seekParamEnd:"bend",rangeLoadZeroStart:!1,customSeekHandler:void 0,reuseRedirectedURL:!1,headers:void 0,customLoader:void 0};function ce(){return Object.assign({},ee)}var de=function(){function Re(){Object(le.a)(this,Re)}return Object(Q.a)(Re,null,[{key:"supportMSEH264Playback",value:function(){return window.MediaSource&&window.MediaSource.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"')}},{key:"supportNetworkStreamIO",value:function(){var K=new Y({},ce()),Z=K.loaderType;return K.destroy(),Z=="fetch-stream-loader"||Z=="xhr-moz-chunked-loader"}},{key:"getNetworkLoaderTypeName",value:function(){var K=new Y({},ce()),Z=K.loaderType;return K.destroy(),Z}},{key:"supportNativeMediaPlayback",value:function(K){Re.videoElement==null&&(Re.videoElement=window.document.createElement("video"));var Z=Re.videoElement.canPlayType(K);return Z==="probably"||Z=="maybe"}},{key:"getFeatureList",value:function(){var K={mseFlvPlayback:!1,mseLiveFlvPlayback:!1,networkStreamIO:!1,networkLoaderName:"",nativeMP4H264Playback:!1,nativeWebmVP8Playback:!1,nativeWebmVP9Playback:!1};return K.mseFlvPlayback=Re.supportMSEH264Playback(),K.networkStreamIO=Re.supportNetworkStreamIO(),K.networkLoaderName=Re.getNetworkLoaderTypeName(),K.mseLiveFlvPlayback=K.mseFlvPlayback&&K.networkStreamIO,K.nativeMP4H264Playback=Re.supportNativeMediaPlayback('video/mp4; codecs="avc1.42001E, mp4a.40.2"'),K.nativeWebmVP8Playback=Re.supportNativeMediaPlayback('video/webm; codecs="vp8.0, vorbis"'),K.nativeWebmVP9Playback=Re.supportNativeMediaPlayback('video/webm; codecs="vp9"'),K}}]),Re}(),Ce=de,Se={ERROR:"error",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",METADATA_ARRIVED:"metadata_arrived",SCRIPTDATA_ARRIVED:"scriptdata_arrived",STATISTICS_INFO:"statistics_info"},Pe=Se,ye=function(){function Re(){Object(le.a)(this,Re)}return Object(Q.a)(Re,null,[{key:"forceGlobalTag",get:function(){return C.FORCE_GLOBAL_TAG},set:function(K){C.FORCE_GLOBAL_TAG=K,Re._notifyChange()}},{key:"globalTag",get:function(){return C.GLOBAL_TAG},set:function(K){C.GLOBAL_TAG=K,Re._notifyChange()}},{key:"enableAll",get:function(){return C.ENABLE_VERBOSE&&C.ENABLE_DEBUG&&C.ENABLE_INFO&&C.ENABLE_WARN&&C.ENABLE_ERROR},set:function(K){C.ENABLE_VERBOSE=K,C.ENABLE_DEBUG=K,C.ENABLE_INFO=K,C.ENABLE_WARN=K,C.ENABLE_ERROR=K,Re._notifyChange()}},{key:"enableDebug",get:function(){return C.ENABLE_DEBUG},set:function(K){C.ENABLE_DEBUG=K,Re._notifyChange()}},{key:"enableVerbose",get:function(){return C.ENABLE_VERBOSE},set:function(K){C.ENABLE_VERBOSE=K,Re._notifyChange()}},{key:"enableInfo",get:function(){return C.ENABLE_INFO},set:function(K){C.ENABLE_INFO=K,Re._notifyChange()}},{key:"enableWarn",get:function(){return C.ENABLE_WARN},set:function(K){C.ENABLE_WARN=K,Re._notifyChange()}},{key:"enableError",get:function(){return C.ENABLE_ERROR},set:function(K){C.ENABLE_ERROR=K,Re._notifyChange()}},{key:"getConfig",value:function(){return{globalTag:C.GLOBAL_TAG,forceGlobalTag:C.FORCE_GLOBAL_TAG,enableVerbose:C.ENABLE_VERBOSE,enableDebug:C.ENABLE_DEBUG,enableInfo:C.ENABLE_INFO,enableWarn:C.ENABLE_WARN,enableError:C.ENABLE_ERROR,enableCallback:C.ENABLE_CALLBACK}}},{key:"applyConfig",value:function(K){C.GLOBAL_TAG=K.globalTag,C.FORCE_GLOBAL_TAG=K.forceGlobalTag,C.ENABLE_VERBOSE=K.enableVerbose,C.ENABLE_DEBUG=K.enableDebug,C.ENABLE_INFO=K.enableInfo,C.ENABLE_WARN=K.enableWarn,C.ENABLE_ERROR=K.enableError,C.ENABLE_CALLBACK=K.enableCallback}},{key:"_notifyChange",value:function(){var K=Re.emitter;if(K.listenerCount("change")>0){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 _e=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[0]&&(oe=0,Je=lt+1);Je<=lt;)if(Oe=Je+Math.floor((lt-Je)/2),Oe===he||Z>=K[Oe]&&Z<K[Oe+1]){oe=Oe;break}else K[Oe]<Z?Je=Oe+1:lt=Oe-1;return oe}}]),Re}(),Ue=Ge;function Fe(Re,ve,K){var Z=Re;if(ve+K<Z.length){for(;K--;)if((Z[++ve]&192)!==128)return!1;return!0}else return!1}function He(Re){for(var ve=[],K=Re,Z=0,oe=Re.length;Z<oe;){if(K[Z]<128){ve.push(String.fromCharCode(K[Z])),++Z;continue}else if(!(K[Z]<192)){if(K[Z]<224){if(Fe(K,Z,1)){var he=(K[Z]&31)<<6|K[Z+1]&63;if(he>=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);Oe<oe-4;){var nn=Re.parseObject(K,Z+Oe,oe-Oe-Mt);if(nn.objectEnd)break;lt[nn.data.name]=nn.data.value,Oe+=nn.size}if(Oe<=oe-3){var Rt=he.getUint32(Oe-1,!me)&16777215;Rt===9&&(Oe+=3)}break}case 8:{lt={},Oe+=4;var cn=0;for((he.getUint32(oe-4,!me)&16777215)===9&&(cn=3);Oe<oe-8;){var an=Re.parseVariable(K,Z+Oe,oe-Oe-cn);if(an.objectEnd)break;lt[an.data.name]=an.data.value,Oe+=an.size}if(Oe<=oe-3){var ie=he.getUint32(Oe-1,!me)&16777215;ie===9&&(Oe+=3)}break}case 9:lt=void 0,Oe=1,Pt=!0;break;case 10:{lt=[];var N=he.getUint32(1,!me);Oe+=4;for(var F=0;F<N;F++){var ae=Re.parseValue(K,Z+Oe,oe-Oe);lt.push(ae.data),Oe+=ae.size}break}case 11:{var pe=Re.parseDate(K,Z+1,oe-1);lt=pe.data,Oe+=pe.size;break}case 12:{var se=Re.parseString(K,Z+1,oe-1);lt=se.data,Oe+=se.size;break}default:Oe=oe,C.w("AMF","Unsupported AMF value type "+Je)}}catch($e){C.e("AMF",$e.toString())}return{data:lt,size:Oe,objectEnd:Pt}}}]),Re}(),ze=We,nt=function(){function Re(ve){Object(le.a)(this,Re),this.TAG="ExpGolomb",this._buffer=ve,this._buffer_index=0,this._total_bytes=ve.byteLength,this._total_bits=ve.byteLength*8,this._current_word=0,this._current_word_bits_left=0}return Object(Q.a)(Re,[{key:"destroy",value:function(){this._buffer=null}},{key:"_fillCurrentWord",value:function(){var K=this._total_bytes-this._buffer_index;if(K<=0)throw new u("ExpGolomb: _fillCurrentWord() but no bytes available");var Z=Math.min(4,K),oe=new Uint8Array(4);oe.set(this._buffer.subarray(this._buffer_index,this._buffer_index+Z)),this._current_word=new DataView(oe.buffer).getUint32(0,!1),this._buffer_index+=Z,this._current_word_bits_left=Z*8}},{key:"readBits",value:function(K){if(K>32)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<<Oe|Je,oe}},{key:"readBool",value:function(){return this.readBits(1)===1}},{key:"readByte",value:function(){return this.readBits(8)}},{key:"_skipLeadingZero",value:function(){var K;for(K=0;K<this._current_word_bits_left;K++)if((this._current_word&2147483648>>>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<oe;Je++){if(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;Rt<nn;Rt++)oe.readBool()&&(Rt<6?Re._skipScalingList(oe,16):Re._skipScalingList(oe,64));oe.readUEG();var cn=oe.readUEG();if(cn===0)oe.readUEG();else if(cn===1){oe.readBits(1),oe.readSEG(),oe.readSEG();for(var an=oe.readUEG(),ie=0;ie<an;ie++)oe.readSEG()}var N=oe.readUEG();oe.readBits(1);var F=oe.readUEG(),ae=oe.readUEG(),pe=oe.readBits(1);pe===0&&oe.readBits(1),oe.readBits(1);var se=0,$e=0,Et=0,it=0,Vt=oe.readBool();Vt&&(se=oe.readUEG(),$e=oe.readUEG(),Et=oe.readUEG(),it=oe.readUEG());var At=1,Bt=1,on=0,In=!0,Lr=0,Sr=0,Un=oe.readBool();if(Un){if(oe.readBool()){var ur=oe.readByte(),mi=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2],Ar=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1];ur>0&&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-=(Et+it)*Yr;var Fr=Math.ceil(si*Xr);return oe.destroy(),oe=null,{profile_string:Je,level_string:lt,bit_depth:Mt,ref_frames:N,chroma_format:Nt,chroma_format_string:Re.getChromaFormatString(Nt),frame_rate:{fixed:In,fps:on,fps_den:Sr,fps_num:Lr},sar_ratio:{width:At,height: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<Z;Je++)he!==0&&(Oe=K.readSEG(),he=(oe+Oe+256)%256),oe=he===0?oe:he}},{key:"getProfileString",value:function(K){switch(K){case 66:return"Baseline";case 77:return"Main";case 88:return"Extended";case 100:return"High";case 110:return"High10";case 122:return"High422";case 244:return"High444";default:return"Unknown"}}},{key:"getLevelString",value:function(K){return(K/10).toFixed(1)}},{key:"getChromaFormatString",value:function(K){switch(K){case 420:return"4:2:0";case 422:return"4:2:2";case 444:return"4:4:4";default:return"Unknown"}}}]),Re}(),U=k,q={OK:"OK",FORMAT_ERROR:"FormatError",FORMAT_UNSUPPORTED:"FormatUnsupported",CODEC_UNSUPPORTED:"CodecUnsupported"},$=q;function J(Re){return Re>>>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(;oe<K.byteLength;){this._dispatch=!0;var Pt=new DataView(K,oe);if(oe+11+4>K.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<K.times.length;he++){var Oe=this._timestampBase+Math.floor(K.times[he]*1e3);Z.push(Oe),oe.push(K.filepositions[he])}return{times:Z,filepositions:oe}}},{key:"_parseAudioData",value:function(K,Z,oe,he){if(oe<=1){C.w(this.TAG,"Flv: Invalid audio packet, missing SoundData payload!");return}if(this._hasAudioFlagOverrided===!0&&this._hasAudio===!1)return;var Oe=this._littleEndian,Je=new DataView(K,Z,oe),lt=Je.getUint8(0),Pt=lt>>>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 Et=this._timestampBase+he,it={unit:$e,length:$e.byteLength,dts:Et,pts:Et};cn.samples.push(it),cn.length+=$e.length}}},{key:"_parseAACAudioData",value:function(K,Z,oe){if(oe<=1){C.w(this.TAG,"Flv: Invalid AAC packet, missing AACPacketType or/and Data!");return}var he={},Oe=new Uint8Array(K,Z,oe);return he.packetType=Oe[0],Oe[0]===0?he.data=this._parseAACAudioSpecificConfig(K,Z+1,oe-1):he.data=Oe.subarray(1),he}},{key:"_parseAACAudioSpecificConfig",value:function(K,Z,oe){var he=new Uint8Array(K,Z,oe),Oe=null,Je=0,lt=0,Pt=null,Nt=0,ht=null;if(Je=lt=he[0]>>>3,Nt=(he[0]&7)<<1|he[1]>>>7,Nt<0||Nt>=this._mpegSamplingRates.length){this._onError($.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<this._mpegAudioL3BitRateTable.length&&(an=this._mpegAudioL3BitRateTable[ht]);break;case 2:ie=33,ht<this._mpegAudioL2BitRateTable.length&&(an=this._mpegAudioL2BitRateTable[ht]);break;case 3:ie=32,ht<this._mpegAudioL1BitRateTable.length&&(an=this._mpegAudioL1BitRateTable[ht]);break}lt={bitRate:an,samplingRate:cn,channelCount:Rt,codec:N,originalCodec:N}}else lt=Je;return lt}},{key:"_parseVideoData",value:function(K,Z,oe,he,Oe){if(oe<=1){C.w(this.TAG,"Flv: Invalid video packet, missing VideoData payload!");return}if(this._hasVideoFlagOverrided===!0&&this._hasVideo===!1)return;var Je=new Uint8Array(K,Z,oe)[0],lt=(Je&240)>>>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;cn<nn;cn++){var an=lt.getUint16(Rt,!Je);if(Rt+=2,an===0)continue;var ie=new Uint8Array(K,Z+Rt,an);Rt+=an;var N=U.parseSPS(ie);if(cn!==0)continue;he.codecWidth=N.codec_size.width,he.codecHeight=N.codec_size.height,he.presentWidth=N.present_size.width,he.presentHeight=N.present_size.height,he.profile=N.profile_string,he.level=N.level_string,he.bitDepth=N.bit_depth,he.chromaFormat=N.chroma_format,he.sarRatio=N.sar_ratio,he.frameRate=N.frame_rate,(N.frame_rate.fixed===!1||N.frame_rate.fps_num===0||N.frame_rate.fps_den===0)&&(he.frameRate=this._referenceFrameRate);var F=he.frameRate.fps_den,ae=he.frameRate.fps_num;he.refSampleDuration=he.timescale*(F/ae);for(var pe=ie.subarray(1,4),se="avc1.",$e=0;$e<3;$e++){var Et=pe[$e].toString(16);Et.length<2&&(Et="0"+Et),se+=Et}he.codec=se;var it=this._mediaInfo;it.width=he.codecWidth,it.height=he.codecHeight,it.fps=he.frameRate.fps,it.profile=he.profile,it.level=he.level,it.refFrames=N.ref_frames,it.chromaFormat=N.chroma_format_string,it.sarNum=he.sarRatio.width,it.sarDen=he.sarRatio.height,it.videoCodec=se,it.hasAudio?it.audioCodec!=null&&(it.mimeType='video/x-flv; codecs="'+it.videoCodec+","+it.audioCodec+'"'):it.mimeType='video/x-flv; codecs="'+it.videoCodec+'"',it.isComplete()&&this._onMediaInfo(it)}var Vt=lt.getUint8(Rt);if(Vt===0){this._onError($.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No PPS");return}else Vt>1&&C.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: PPS Count = ".concat(Vt));Rt++;for(var At=0;At<Vt;At++){var Bt=lt.getUint16(Rt,!Je);if(Rt+=2,Bt===0)continue;Rt+=Bt}he.avcc=new Uint8Array(oe),he.avcc.set(new Uint8Array(K,Z,oe),0),C.v(this.TAG,"Parsed AVCDecoderConfigurationRecord"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._videoInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("video",he)}},{key:"_parseAVCVideoData",value:function(K,Z,oe,he,Oe,Je,lt){for(var Pt=this._littleEndian,Nt=new DataView(K,Z,oe),ht=[],Mt=0,nn=0,Rt=this._naluLengthSize,cn=this._timestampBase+he,an=Je===1;nn<oe;){if(nn+4>=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<Oe;Je++)Z+=he[Je].byteLength;oe=new Uint8Array(Z),oe[0]=Z>>>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<Oe;Pt++)oe.set(he[Pt],lt),lt+=he[Pt].byteLength;return oe}},{key:"generateInitSegment",value:function(K){var Z=Re.box(Re.types.ftyp,Re.constants.FTYP),oe=Re.moov(K),he=new Uint8Array(Z.byteLength+oe.byteLength);return he.set(Z,0),he.set(oe,Z.byteLength),he}},{key:"moov",value:function(K){var Z=Re.mvhd(K.timescale,K.duration),oe=Re.trak(K),he=Re.mvex(K);return Re.box(Re.types.moov,Z,oe,he)}},{key:"mvhd",value:function(K,Z){return Re.box(Re.types.mvhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,K>>>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<oe;Oe++){var Je=Z[Oe].flags;he[Oe+4]=Je.isLeading<<6|Je.dependsOn<<4|Je.isDependedOn<<2|Je.hasRedundancy}return Re.box(Re.types.sdtp,he)}},{key:"trun",value:function(K,Z){var oe=K.samples||[],he=oe.length,Oe=12+16*he,Je=new Uint8Array(Oe);Z+=8+Oe,Je.set([0,0,15,1,he>>>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<he;lt++){var Pt=oe[lt].duration,Nt=oe[lt].size,ht=oe[lt].flags,Mt=oe[lt].cts;Je.set([Pt>>>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[Z.length-1].originalDts&&this.clear(),Array.prototype.push.apply(Z,K)}},{key:"getLastSyncPointBeforeDts",value:function(K){if(this._list.length==0)return null;var Z=this._list,oe=0,he=Z.length-1,Oe=0,Je=0,lt=he;for(K<Z[0].dts&&(oe=0,Je=lt+1);Je<=lt;)if(Oe=Je+Math.floor((lt-Je)/2),Oe===he||K>=Z[Oe].dts&&K<Z[Oe+1].dts){oe=Oe;break}else Z[Oe].dts<K?Je=Oe+1:lt=Oe-1;return this._list[oe]}}]),Re}(),Me=function(){function Re(ve){Object(le.a)(this,Re),this._type=ve,this._list=[],this._lastAppendLocation=-1}return Object(Q.a)(Re,[{key:"type",get:function(){return this._type}},{key:"length",get:function(){return this._list.length}},{key:"isEmpty",value:function(){return this._list.length===0}},{key:"clear",value:function(){this._list=[],this._lastAppendLocation=-1}},{key:"_searchNearestSegmentBefore",value:function(K){var Z=this._list;if(Z.length===0)return-2;var oe=Z.length-1,he=0,Oe=0,Je=oe,lt=0;if(K<Z[0].originalBeginDts)return lt=-1,lt;for(;Oe<=Je;)if(he=Oe+Math.floor((Je-Oe)/2),he===oe||K>Z[he].lastSample.originalDts&&K<Z[he+1].originalBeginDts){lt=he;break}else Z[he].originalBeginDts<K?Oe=he+1:Je=he-1;return lt}},{key:"_searchNearestSegmentAfter",value:function(K){return this._searchNearestSegmentBefore(K)+1}},{key:"append",value:function(K){var Z=this._list,oe=K,he=this._lastAppendLocation,Oe=0;he!==-1&&he<Z.length&&oe.originalBeginDts>=Z[he].lastSample.originalDts&&(he===Z.length-1||he<Z.length-1&&oe.originalBeginDts<Z[he+1].originalBeginDts)?Oe=he+1:Z.length>0&&(Oe=this._searchNearestSegmentBefore(oe.originalBeginDts)+1),this._lastAppendLocation=Oe,this._list.splice(Oe,0,oe)}},{key:"getLastSegmentBefore",value:function(K){var Z=this._searchNearestSegmentBefore(K);return Z>=0?this._list[Z]:null}},{key:"getLastSampleBefore",value:function(K){var Z=this.getLastSegmentBefore(K);return Z!=null?Z.lastSample:null}},{key:"getLastSyncPointBefore",value:function(K){for(var Z=this._searchNearestSegmentBefore(K),oe=this._list[Z].syncPoints;oe.length===0&&Z>0;)Z--,oe=this._list[Z].syncPoints;return oe.length>0?oe[oe.length-1]:null}}]),Re}(),Ee=function(){function Re(ve){Object(le.a)(this,Re),this.TAG="MP4Remuxer",this._config=ve,this._isLive=ve.isLive===!0,this._dtsBase=-1,this._dtsBaseInited=!1,this._audioDtsBase=Infinity,this._videoDtsBase=Infinity,this._audioNextDts=void 0,this._videoNextDts=void 0,this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList=new Me("audio"),this._videoSegmentInfoList=new Me("video"),this._onInitSegment=null,this._onMediaSegment=null,this._forceFirstIDR=!!(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,Et=this._videoSegmentInfoList.getLastSegmentBefore(F);if(Et!=null&&Et.beginDts<$e){var it=Qe.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);if(it){var Vt=Et.beginDts,At=$e-Et.beginDts;C.v(this.TAG,"InsertPrefixSilentAudio: dts: ".concat(Vt,", duration: ").concat(At)),he.unshift({unit:it,dts:Vt,pts:Vt}),an+=it.byteLength}}else nn=!1}for(var Bt=[],on=0;on<he.length;on++){var In=he[on],Lr=In.unit,Sr=In.dts-this._dtsBase,Un=Sr-Oe;Je===-1&&(Je=Un);var ur=0;if(on!==he.length-1){var mi=he[on+1].dts-this._dtsBase-Oe;ur=mi-Un}else if(ie!=null){var Ar=ie.dts-this._dtsBase-Oe;ur=Ar-Un}else Bt.length>=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;gi<Dr;gi++){var si=Math.round(Yr);if(br.length>0){var Pr=br[br.length-1];Pr.duration=si-Pr.dts}var Fr={dts:si,pts:si,cts:0,unit:gr,size:gr.byteLength,duration:0,originalDts:Sr,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}};br.push(Fr),an+=Fr.size,Yr+=Nt}var Ei=br[br.length-1];Ei.duration=Un+ur-Ei.dts,ur=Math.round(Nt)}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;vi<Bt.length;vi++){var di=Bt[vi].unit;cn.set(di,Rt),Rt+=di.byteLength}var Fn=Bt[Bt.length-1];lt=Fn.dts+Fn.duration,this._audioNextDts=lt;var wn=new Be;wn.beginDts=Je,wn.endDts=lt,wn.beginPts=Je,wn.endPts=lt,wn.originalBeginDts=Bt[0].originalDts,wn.originalEndDts=Fn.originalDts+Fn.duration,wn.firstSample=new Xe(Bt[0].dts,Bt[0].pts,Bt[0].duration,Bt[0].originalDts,!1),wn.lastSample=new Xe(Fn.dts,Fn.pts,Fn.duration,Fn.originalDts,!1),this._isLive||this._audioSegmentInfoList.append(wn),oe.samples=Bt,oe.sequenceNumber++;var _r=null;ht?_r=new Uint8Array:_r=tt.moof(oe,Je),oe.samples=[],oe.length=0;var qn={type:"audio",data:this._mergeBoxes(_r,cn).buffer,sampleCount:Bt.length,info:wn};ht&&Mt&&(qn.timestampOffset=Je),this._onMediaSegment("audio",qn)}},{key:"_remuxVideo",value:function(K,Z){if(this._videoMeta==null)return;var oe=K,he=oe.samples,Oe=void 0,Je=-1,lt=-1,Pt=-1,Nt=-1;if(!he||he.length===0)return;if(he.length===1&&!Z)return;var ht=8,Mt=null,nn=8+K.length,Rt=null;if(he.length>1&&(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<he.length;se++){var $e=he[se],Et=$e.dts-this._dtsBase,it=$e.isKeyframe,Vt=Et-Oe,At=$e.cts,Bt=Vt+At;Je===-1&&(Je=Vt,Pt=Bt);var on=0;if(se!==he.length-1){var In=he[se+1].dts-this._dtsBase-Oe;on=In-Vt}else if(Rt!=null){var Lr=Rt.dts-this._dtsBase-Oe;on=Lr-Vt}else pe.length>=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:Et,flags:{isLeading:0,dependsOn:it?2:1,isDependedOn:it?1:0,hasRedundancy:0,isNonSync:it?0:1}})}Mt=new Uint8Array(nn),Mt[0]=nn>>>24&255,Mt[1]=nn>>>16&255,Mt[2]=nn>>>8&255,Mt[3]=nn&255,Mt.set(tt.types.mdat,4);for(var Un=0;Un<pe.length;Un++)for(var ur=pe[Un].units;ur.length;){var mi=ur.shift(),Ar=mi.data;Mt.set(Ar,ht),ht+=Ar.byteLength}var fr=pe[pe.length-1];if(lt=fr.dts+fr.duration,Nt=fr.pts+fr.duration,this._videoNextDts=lt,ae.beginDts=Je,ae.endDts=lt,ae.beginPts=Pt,ae.endPts=Nt,ae.originalBeginDts=pe[0].originalDts,ae.originalEndDts=fr.originalDts+fr.duration,ae.firstSample=new Xe(pe[0].dts,pe[0].pts,pe[0].duration,pe[0].originalDts,pe[0].isKeyframe),ae.lastSample=new Xe(fr.dts,fr.pts,fr.duration,fr.originalDts,fr.isKeyframe),this._isLive||this._videoSegmentInfoList.append(ae),oe.samples=pe,oe.sequenceNumber++,this._forceFirstIDR){var br=pe[0].flags;br.dependsOn=2,br.isNonSync=0}var Xr=tt.moof(oe,Je);oe.samples=[],oe.length=0,this._onMediaSegment("video",{type:"video",data:this._mergeBoxes(Xr,Mt).buffer,sampleCount:pe.length,info:ae})}},{key:"_mergeBoxes",value:function(K,Z){var oe=new Uint8Array(K.byteLength+Z.byteLength);return oe.set(K,0),oe.set(Z,K.byteLength),oe}}]),Re}(),Ae=Ee,Le={IO_ERROR:"io_error",DEMUX_ERROR:"demux_error",INIT_SEGMENT:"init_segment",MEDIA_SEGMENT:"media_segment",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",METADATA_ARRIVED:"metadata_arrived",SCRIPTDATA_ARRIVED:"scriptdata_arrived",STATISTICS_INFO:"statistics_info",RECOMMEND_SEEKPOINT:"recommend_seekpoint"},Te=Le,Ze=function(){function Re(ve,K){Object(le.a)(this,Re),this.TAG="TransmuxingController",this._emitter=new b.a,this._config=K,ve.segments||(ve.segments=[{duration:ve.duration,filesize:ve.filesize,url:ve.url}]),typeof ve.cors!="boolean"&&(ve.cors=!0),typeof ve.withCredentials!="boolean"&&(ve.withCredentials=!1),this._mediaDataSource=ve,this._currentSegmentIndex=0;var Z=0;this._mediaDataSource.segments.forEach(function(oe){oe.timestampBase=Z,Z+=oe.duration,oe.cors=ve.cors,oe.withCredentials=ve.withCredentials,K.referrerPolicy&&(oe.referrerPolicy=K.referrerPolicy)}),!isNaN(Z)&&this._mediaDataSource.duration!==Z&&(this._mediaDataSource.duration=Z),this._mediaInfo=null,this._demuxer=null,this._remuxer=null,this._ioctl=null,this._pendingSeekTime=null,this._pendingResolveSeekPoint=null,this._statisticsReporter=null}return Object(Q.a)(Re,[{key:"destroy",value:function(){this._mediaInfo=null,this._mediaDataSource=null,this._statisticsReporter&&this._disableStatisticsReporter(),this._ioctl&&(this._ioctl.destroy(),this._ioctl=null),this._demuxer&&(this._demuxer.destroy(),this._demuxer=null),this._remuxer&&(this._remuxer.destroy(),this._remuxer=null),this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(K,Z){this._emitter.addListener(K,Z)}},{key:"off",value:function(K,Z){this._emitter.removeListener(K,Z)}},{key:"start",value:function(){this._loadSegment(0),this._enableStatisticsReporter()}},{key:"_loadSegment",value:function(K,Z){this._currentSegmentIndex=K;var oe=this._mediaDataSource.segments[K],he=this._ioctl=new Y(oe,this._config,K);he.onError=this._onIOException.bind(this),he.onSeeked=this._onIOSeeked.bind(this),he.onComplete=this._onIOComplete.bind(this),he.onRedirect=this._onIORedirect.bind(this),he.onRecoveredEarlyEof=this._onIORecoveredEarlyEof.bind(this),Z?this._demuxer.bindDataSource(this._ioctl):he.onDataArrival=this._onInitChunkArrival.bind(this),he.open(Z)}},{key:"stop",value:function(){this._internalAbort(),this._disableStatisticsReporter()}},{key:"_internalAbort",value:function(){this._ioctl&&(this._ioctl.destroy(),this._ioctl=null)}},{key:"pause",value:function(){this._ioctl&&this._ioctl.isWorking()&&(this._ioctl.pause(),this._disableStatisticsReporter())}},{key:"resume",value:function(){this._ioctl&&this._ioctl.isPaused()&&(this._ioctl.resume(),this._enableStatisticsReporter())}},{key:"seek",value:function(K){if(this._mediaInfo==null||!this._mediaInfo.isSeekable())return;var Z=this._searchSegmentIndexContains(K);if(Z===this._currentSegmentIndex){var oe=this._mediaInfo.segments[Z];if(oe==null)this._pendingSeekTime=K;else{var he=oe.getNearestKeyframe(K);this._remuxer.seek(he.milliseconds),this._ioctl.seek(he.fileposition),this._pendingResolveSeekPoint=he.milliseconds}}else{var Oe=this._mediaInfo.segments[Z];if(Oe==null)this._pendingSeekTime=K,this._internalAbort(),this._remuxer.seek(),this._remuxer.insertDiscontinuity(),this._loadSegment(Z);else{var Je=Oe.getNearestKeyframe(K);this._internalAbort(),this._remuxer.seek(K),this._remuxer.insertDiscontinuity(),this._demuxer.resetMediaInfo(),this._demuxer.timestampBase=this._mediaDataSource.segments[Z].timestampBase,this._loadSegment(Z,Je.fileposition),this._pendingResolveSeekPoint=Je.milliseconds,this._reportSegmentMediaInfo(Z)}}this._enableStatisticsReporter()}},{key:"_searchSegmentIndexContains",value:function(K){for(var Z=this._mediaDataSource.segments,oe=Z.length-1,he=0;he<Z.length;he++)if(K<Z[he].timestampBase){oe=he-1;break}return oe}},{key:"_onInitChunkArrival",value:function(K,Z){var oe=this,he=null,Oe=0;if(Z>0)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;oe<this._mediaDataSource.segments.length?(this._internalAbort(),this._remuxer.flushStashedSamples(),this._loadSegment(oe)):(this._remuxer.flushStashedSamples(),this._emitter.emit(Te.LOADING_COMPLETE),this._disableStatisticsReporter())}},{key:"_onIORedirect",value:function(K){var Z=this._ioctl.extraData;this._mediaDataSource.segments[Z].redirectedURL=K}},{key:"_onIORecoveredEarlyEof",value:function(){this._emitter.emit(Te.RECOVERED_EARLY_EOF)}},{key:"_onIOException",value:function(K,Z){C.e(this.TAG,"IOException: type = ".concat(K,", code = ").concat(Z.code,", msg = ").concat(Z.msg)),this._emitter.emit(Te.IO_ERROR,K,Z),this._disableStatisticsReporter()}},{key:"_onDemuxException",value:function(K,Z){C.e(this.TAG,"DemuxException: type = ".concat(K,", info = ").concat(Z)),this._emitter.emit(Te.DEMUX_ERROR,K,Z)}},{key:"_onRemuxerInitSegmentArrival",value:function(K,Z){this._emitter.emit(Te.INIT_SEGMENT,K,Z)}},{key:"_onRemuxerMediaSegmentArrival",value:function(K,Z){if(this._pendingSeekTime!=null)return;if(this._emitter.emit(Te.MEDIA_SEGMENT,K,Z),this._pendingResolveSeekPoint!=null&&K==="video"){var oe=Z.info.syncPoints,he=this._pendingResolveSeekPoint;this._pendingResolveSeekPoint=null,g.safari&&oe.length>0&&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;_e.applyConfig(N),N.enableCallback===!0?_e.addLogListener(oe):_e.removeLogListener(oe);break}}});function he(ie,N){var F={msg:Te.INIT_SEGMENT,data:{type:ie,data:N}};ve.postMessage(F,[N.data])}function Oe(ie,N){var F={msg:Te.MEDIA_SEGMENT,data:{type:ie,data:N}};ve.postMessage(F,[N.data])}function Je(){var ie={msg:Te.LOADING_COMPLETE};ve.postMessage(ie)}function lt(){var ie={msg:Te.RECOVERED_EARLY_EOF};ve.postMessage(ie)}function Pt(ie){var N={msg:Te.MEDIA_INFO,data:ie};ve.postMessage(N)}function Nt(ie){var N={msg:Te.METADATA_ARRIVED,data:ie};ve.postMessage(N)}function ht(ie){var N={msg:Te.SCRIPTDATA_ARRIVED,data:ie};ve.postMessage(N)}function Mt(ie){var N={msg:Te.STATISTICS_INFO,data:ie};ve.postMessage(N)}function nn(ie,N){ve.postMessage({msg:Te.IO_ERROR,data:{type:ie,info:N}})}function Rt(ie,N){ve.postMessage({msg:Te.DEMUX_ERROR,data:{type:ie,info:N}})}function cn(ie){ve.postMessage({msg:Te.RECOMMEND_SEEKPOINT,data:ie})}function an(ie,N){ve.postMessage({msg:"logcat_callback",data:{type:ie,logcat:N}})}},Ht=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)},_e.registerListener(this.e.onLoggingConfigChanged),this._worker.postMessage({cmd:"logging_config",param:_e.getConfig()})}catch(he){C.e(this.TAG,"Error while initialize transmuxing worker, fallback to inline transmuxing"),this._worker=null,this._controller=new ut(ve,K)}else this._controller=new ut(ve,K);if(this._controller){var oe=this._controller;oe.on(Te.IO_ERROR,this._onIOError.bind(this)),oe.on(Te.DEMUX_ERROR,this._onDemuxError.bind(this)),oe.on(Te.INIT_SEGMENT,this._onInitSegment.bind(this)),oe.on(Te.MEDIA_SEGMENT,this._onMediaSegment.bind(this)),oe.on(Te.LOADING_COMPLETE,this._onLoadingComplete.bind(this)),oe.on(Te.RECOVERED_EARLY_EOF,this._onRecoveredEarlyEof.bind(this)),oe.on(Te.MEDIA_INFO,this._onMediaInfo.bind(this)),oe.on(Te.METADATA_ARRIVED,this._onMetaDataArrived.bind(this)),oe.on(Te.SCRIPTDATA_ARRIVED,this._onScriptDataArrived.bind(this)),oe.on(Te.STATISTICS_INFO,this._onStatisticsInfo.bind(this)),oe.on(Te.RECOMMEND_SEEKPOINT,this._onRecommendSeekpoint.bind(this))}}return Object(Q.a)(Re,[{key:"destroy",value:function(){this._worker?this._workerDestroying||(this._workerDestroying=!0,this._worker.postMessage({cmd:"destroy"}),_e.removeListener(this.e.onLoggingConfigChanged),this.e=null):(this._controller.destroy(),this._controller=null),this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(K,Z){this._emitter.addListener(K,Z)}},{key:"off",value:function(K,Z){this._emitter.removeListener(K,Z)}},{key:"hasWorker",value:function(){return this._worker!=null}},{key:"open",value:function(){this._worker?this._worker.postMessage({cmd:"start"}):this._controller.start()}},{key:"close",value:function(){this._worker?this._worker.postMessage({cmd:"stop"}):this._controller.stop()}},{key:"seek",value:function(K){this._worker?this._worker.postMessage({cmd:"seek",param:K}):this._controller.seek(K)}},{key:"pause",value:function(){this._worker?this._worker.postMessage({cmd:"pause"}):this._controller.pause()}},{key:"resume",value:function(){this._worker?this._worker.postMessage({cmd:"resume"}):this._controller.resume()}},{key:"_onInitSegment",value:function(K,Z){var oe=this;Promise.resolve().then(function(){oe._emitter.emit(Te.INIT_SEGMENT,K,Z)})}},{key:"_onMediaSegment",value:function(K,Z){var oe=this;Promise.resolve().then(function(){oe._emitter.emit(Te.MEDIA_SEGMENT,K,Z)})}},{key:"_onLoadingComplete",value:function(){var K=this;Promise.resolve().then(function(){K._emitter.emit(Te.LOADING_COMPLETE)})}},{key:"_onRecoveredEarlyEof",value:function(){var K=this;Promise.resolve().then(function(){K._emitter.emit(Te.RECOVERED_EARLY_EOF)})}},{key:"_onMediaInfo",value:function(K){var Z=this;Promise.resolve().then(function(){Z._emitter.emit(Te.MEDIA_INFO,K)})}},{key:"_onMetaDataArrived",value:function(K){var Z=this;Promise.resolve().then(function(){Z._emitter.emit(Te.METADATA_ARRIVED,K)})}},{key:"_onScriptDataArrived",value:function(K){var Z=this;Promise.resolve().then(function(){Z._emitter.emit(Te.SCRIPTDATA_ARRIVED,K)})}},{key:"_onStatisticsInfo",value:function(K){var Z=this;Promise.resolve().then(function(){Z._emitter.emit(Te.STATISTICS_INFO,K)})}},{key:"_onIOError",value:function(K,Z){var oe=this;Promise.resolve().then(function(){oe._emitter.emit(Te.IO_ERROR,K,Z)})}},{key:"_onDemuxError",value:function(K,Z){var oe=this;Promise.resolve().then(function(){oe._emitter.emit(Te.DEMUX_ERROR,K,Z)})}},{key:"_onRecommendSeekpoint",value:function(K){var Z=this;Promise.resolve().then(function(){Z._emitter.emit(Te.RECOMMEND_SEEKPOINT,K)})}},{key:"_onLoggingConfigChanged",value:function(K){this._worker&&this._worker.postMessage({cmd:"logging_config",param:K})}},{key:"_onWorkerMessage",value:function(K){var Z=K.data,oe=Z.data;if(Z.msg==="destroyed"||this._workerDestroying){this._workerDestroying=!1,this._worker.terminate(),this._worker=null;return}switch(Z.msg){case Te.INIT_SEGMENT:case Te.MEDIA_SEGMENT:this._emitter.emit(Z.msg,oe.type,oe.data);break;case Te.LOADING_COMPLETE:case Te.RECOVERED_EARLY_EOF:this._emitter.emit(Z.msg);break;case Te.MEDIA_INFO:Object.setPrototypeOf(oe,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<oe.buffered.length;Oe++){var Je=oe.buffered.start(Oe),lt=oe.buffered.end(Oe);this._pendingRemoveRanges[Z].push({start:Je,end:lt})}if(oe.updating||this._doRemoveRanges(),g.safari){var Pt=this._lastInitSegments[Z];Pt&&(this._pendingSegments[Z].push(Pt),oe.updating||this._doAppendSegments())}}}},{key:"endOfStream",value:function(){var K=this._mediaSource,Z=this._sourceBuffers;if(!K||K.readyState!=="open"){K&&K.readyState==="closed"&&this._hasPendingSegments()&&(this._hasPendingEos=!0);return}Z.video&&Z.video.updating||Z.audio&&Z.audio.updating?this._hasPendingEos=!0:(this._hasPendingEos=!1,K.endOfStream())}},{key:"getNearestKeyframe",value:function(K){return this._idrList.getLastSyncPointBeforeDts(K)}},{key:"_needCleanupSourceBuffer",value:function(){if(!this._config.autoCleanupSourceBuffer)return!1;var K=this._mediaElement.currentTime;for(var Z in this._sourceBuffers){var oe=this._sourceBuffers[Z];if(oe){var he=oe.buffered;if(he.length>=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<he.length;Je++){var lt=he.start(Je),Pt=he.end(Je);if(lt<=K&&K<Pt+3){if(K-lt>=this._config.autoCleanupMaxBackwardDuration){Oe=!0;var Nt=K-this._config.autoCleanupMinBackwardDuration;this._pendingRemoveRanges[Z].push({start:lt,end:Nt})}}else Pt<K&&(Oe=!0,this._pendingRemoveRanges[Z].push({start:lt,end:Pt}))}Oe&&!oe.updating&&this._doRemoveRanges()}}}},{key:"_updateMediaSourceDuration",value:function(){var K=this._sourceBuffers;if(this._mediaElement.readyState===0||this._mediaSource.readyState!=="open")return;if(K.video&&K.video.updating||K.audio&&K.audio.updating)return;var Z=this._mediaSource.duration,oe=this._pendingMediaDuration;oe>0&&(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<K.length;Oe++){var Je=K.start(Oe),lt=K.end(Oe);if(Je<=Z&&Z<lt){oe=Je,he=lt;break}}he>=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<Z.length;he++){var Oe=Z.start(he),Je=Z.end(he);if(K>=Oe&&K<Je){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<Z.length;oe++){var he=Z.start(oe),Oe=Z.end(oe);if(K>=he&&K<Oe)return!0}return!1}},{key:"_internalSeek",value:function(K){var Z=this._isTimepointBuffered(K),oe=!1,he=0;if(K<1&&this._mediaElement.buffered.length>0){var Oe=this._mediaElement.buffered.start(0);(Oe<1&&K<Oe||g.safari)&&(oe=!0,he=g.safari?.1:Oe)}if(oe)this._requestSetTime=!0,this._mediaElement.currentTime=he;else if(Z){if(!this._alwaysSeekKeyframe)this._requestSetTime=!0,this._mediaElement.currentTime=K;else{var Je=this._msectl.getNearestKeyframe(Math.floor(K*1e3));this._requestSetTime=!0,Je!=null?this._mediaElement.currentTime=Je.dts/1e3:this._mediaElement.currentTime=K}this._progressChecker!=null&&this._checkProgressAndResume()}else this._progressChecker!=null&&(window.clearInterval(this._progressChecker),this._progressChecker=null),this._msectl.seek(K),this._transmuxer.seek(Math.floor(K*1e3)),this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement.currentTime=K)}},{key:"_checkAndApplyUnbufferedSeekpoint",value:function(){if(this._seekpointRecord)if(this._seekpointRecord.recordTime<=this._now()-100){var K=this._mediaElement.currentTime;this._seekpointRecord=null,this._isTimepointBuffered(K)||(this._progressChecker!=null&&(window.clearTimeout(this._progressChecker),this._progressChecker=null),this._msectl.seek(K),this._transmuxer.seek(Math.floor(K*1e3)),this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement.currentTime=K))}else window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this),50)}},{key:"_checkAndResumeStuckPlayback",value:function(K){var Z=this._mediaElement;if(K||!this._receivedCanPlay||Z.readyState<2){var oe=Z.buffered;oe.length>0&&Z.currentTime<oe.start(0)&&(C.w(this.TAG,"Playback seems stuck at ".concat(Z.currentTime,", seek to ").concat(oe.start(0))),this._requestSetTime=!0,this._mediaElement.currentTime=oe.start(0),this._mediaElement.removeEventListener("progress",this.e.onvProgress))}else this._mediaElement.removeEventListener("progress",this.e.onvProgress)}},{key:"_onvLoadedMetadata",value:function(K){this._pendingSeekTime!=null&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null)}},{key:"_onvSeeking",value:function(K){var Z=this._mediaElement.currentTime,oe=this._mediaElement.buffered;if(this._requestSetTime){this._requestSetTime=!1;return}if(Z<1&&oe.length>0){var he=oe.start(0);if(he<1&&Z<he||g.safari){this._requestSetTime=!0,this._mediaElement.currentTime=g.safari?.1:he;return}}if(this._isTimepointBuffered(Z)){if(this._alwaysSeekKeyframe){var Oe=this._msectl.getNearestKeyframe(Math.floor(Z*1e3));Oe!=null&&(this._requestSetTime=!0,this._mediaElement.currentTime=Oe.dts/1e3)}this._progressChecker!=null&&this._checkProgressAndResume();return}this._seekpointRecord={seekPoint:Z,recordTime:this._now()},window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this),50)}},{key:"_onvCanPlay",value:function(K){this._receivedCanPlay=!0,this._mediaElement.removeEventListener("canplay",this.e.onvCanPlay)}},{key:"_onvStalled",value:function(K){this._checkAndResumeStuckPlayback(!0)}},{key:"_onvProgress",value:function(K){this._checkAndResumeStuckPlayback()}}]),Re}(),ot=yt,kt=function(){function Re(ve,K){if(Object(le.a)(this,Re),this.TAG="NativePlayer",this._type="NativePlayer",this._emitter=new b.a,this._config=ce(),typeof K=="object"&&Object.assign(this._config,K),ve.type.toLowerCase()==="flv")throw new s("NativePlayer does't support flv MediaDataSource input!");if(ve.hasOwnProperty("segments"))throw new s("NativePlayer(".concat(ve.type,") doesn't support multipart playback!"));this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this)},this._pendingSeekTime=null,this._statisticsReporter=null,this._mediaDataSource=ve,this._mediaElement=null}return Object(Q.a)(Re,[{key:"destroy",value:function(){this._mediaElement&&(this.unload(),this.detachMediaElement()),this.e=null,this._mediaDataSource=null,this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(K,Z){var oe=this;K===Pe.MEDIA_INFO?this._mediaElement!=null&&this._mediaElement.readyState!==0&&Promise.resolve().then(function(){oe._emitter.emit(Pe.MEDIA_INFO,oe.mediaInfo)}):K===Pe.STATISTICS_INFO&&(this._mediaElement!=null&&this._mediaElement.readyState!==0&&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){if(this._mediaElement=K,K.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._pendingSeekTime!=null)try{K.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(Z){}}},{key:"detachMediaElement",value:function(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement.removeEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._mediaElement=null),this._statisticsReporter!=null&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}},{key:"load",value:function(){if(!this._mediaElement)throw new u("HTMLMediaElement must be attached before load()!");this._mediaElement.src=this._mediaDataSource.url,this._mediaElement.readyState>0&&(this._mediaElement.currentTime=0),this._mediaElement.preload="auto",this._mediaElement.load(),this._statisticsReporter=window.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval)}},{key:"unload",value:function(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src")),this._statisticsReporter!=null&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}},{key:"play",value:function(){return this._mediaElement.play()}},{key:"pause",value:function(){this._mediaElement.pause()}},{key:"type",get:function(){return this._type}},{key:"buffered",get:function(){return this._mediaElement.buffered}},{key:"duration",get:function(){return this._mediaElement.duration}},{key:"volume",get:function(){return this._mediaElement.volume},set:function(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=_e,Object.defineProperty(zt,"version",{enumerable:!0,get:function(){return"__VERSION__"}});var Zt=Ve.a=zt},GgEA:function(et,Ve,z){},Gytx:function(et,Ve){et.exports=function(le,Q,j,w){var P=j?j.call(w,le,Q):void 0;if(P!==void 0)return!!P;if(le===Q)return!0;if(typeof le!="object"||!le||typeof Q!="object"||!Q)return!1;var 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<b.length;c++){var p=b[c];if(!C(p))return!1;var d=le[p],o=Q[p];if(P=j?j.call(w,d,o,p):void 0,P===!1||P===void 0&&d!==o)return!1}return!0}},H38U:function(et,Ve,z){var le=z("f4xo"),Q=z("rcnY"),j=z("wU8J"),w=z("Iq15"),P=z("dWSS");function b(C,c){this.typeNumber=C,this.errorCorrectLevel=c,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}var T=b.prototype;T.addData=function(C){var c=new le(C);this.dataList.push(c),this.dataCache=null},T.isDark=function(C,c){if(C<0||this.moduleCount<=C||c<0||this.moduleCount<=c)throw new Error(C+","+c);return this.modules[C][c]},T.getModuleCount=function(){return this.moduleCount},T.make=function(){if(this.typeNumber<1){var C=1;for(C=1;C<40;C++){for(var c=Q.getRSBlocks(C,this.errorCorrectLevel),p=new j,d=0,o=0;o<c.length;o++)d+=c[o].dataCount;for(var o=0;o<this.dataList.length;o++){var a=this.dataList[o];p.put(a.mode,4),p.put(a.getLength(),w.getLengthInBits(a.mode,C)),a.write(p)}if(p.getLengthInBits()<=d*8)break}this.typeNumber=C}this.makeImpl(!1,this.getBestMaskPattern())},T.makeImpl=function(C,c){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var p=0;p<this.moduleCount;p++){this.modules[p]=new Array(this.moduleCount);for(var d=0;d<this.moduleCount;d++)this.modules[p][d]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(C,c),this.typeNumber>=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<this.modules.length;a++)for(var u=a*o,s=0;s<this.modules[a].length;s++){var h=s*o,i=this.modules[a][s];i&&(d.beginFill(0,100),d.moveTo(h,u),d.lineTo(h+o,u),d.lineTo(h+o,u+o),d.lineTo(h,u+o),d.endFill())}return d},T.setupTimingPattern=function(){for(var C=8;C<this.moduleCount-8;C++){if(this.modules[C][6]!=null)continue;this.modules[C][6]=C%2==0}for(var c=8;c<this.moduleCount-8;c++){if(this.modules[6][c]!=null)continue;this.modules[6][c]=c%2==0}},T.setupPositionAdjustPattern=function(){for(var C=w.getPatternPosition(this.typeNumber),c=0;c<C.length;c++)for(var p=0;p<C.length;p++){var d=C[c],o=C[p];if(this.modules[d][o]!=null)continue;for(var a=-2;a<=2;a++)for(var u=-2;u<=2;u++)a==-2||a==2||u==-2||u==2||a==0&&u==0?this.modules[d+a][o+u]=!0:this.modules[d+a][o+u]=!1}},T.setupTypeNumber=function(C){for(var c=w.getBCHTypeNumber(this.typeNumber),p=0;p<18;p++){var d=!C&&(c>>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<C.length&&(h=(C[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;a<p.length;a++){var u=p[a];o.put(u.mode,4),o.put(u.getLength(),w.getLengthInBits(u.mode,C)),u.write(o)}for(var s=0,a=0;a<d.length;a++)s+=d[a].dataCount;if(o.getLengthInBits()>s*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<c.length;s++){var h=c[s].dataCount,i=c[s].totalCount-h;d=Math.max(d,h),o=Math.max(o,i),a[s]=new Array(h);for(var n=0;n<a[s].length;n++)a[s][n]=255&C.buffer[n+p];p+=h;var t=w.getErrorCorrectPolynomial(i),f=new P(a[s],t.getLength()-1),v=f.mod(t);u[s]=new Array(t.getLength()-1);for(var n=0;n<u[s].length;n++){var m=n+v.getLength()-u[s].length;u[s][n]=m>=0?v.get(m):0}}for(var E=0,n=0;n<c.length;n++)E+=c[n].totalCount;for(var _=new Array(E),g=0,n=0;n<d;n++)for(var s=0;s<c.length;s++)n<a[s].length&&(_[g++]=a[s][n]);for(var n=0;n<o;n++)for(var s=0;s<c.length;s++)n<u[s].length&&(_[g++]=u[s][n]);return _},et.exports=b},HmJG:function(et,Ve,z){},Hw79:function(et,Ve,z){et.exports={pagination:"pagination___2VQzP",info:"info___1saw2"}},I8Z2:function(et,Ve,z){"use strict";z.d(Ve,"a",function(){return w}),z.d(Ve,"b",function(){return a}),z.d(Ve,"c",function(){return s});var le=z("q1tI"),Q=function(){var h=function(i,n){return h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,f){t.__proto__=f}||function(t,f){for(var v in f)f.hasOwnProperty(v)&&(t[v]=f[v])},h(i,n)};return function(i,n){h(i,n);function t(){this.constructor=i}i.prototype=n===null?Object.create(n):(t.prototype=n.prototype,new t)}}(),j=le.createContext(null),w=function(h){Q(i,h);function i(){return h!==null&&h.apply(this,arguments)||this}return i.prototype.render=function(){return le.createElement(j.Provider,{value:this.props.store},this.props.children)},i}(le.Component),P=z("Gytx"),b=z.n(P),T=z("2mql"),C=z.n(T),c=function(){var h=function(i,n){return h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,f){t.__proto__=f}||function(t,f){for(var v in f)f.hasOwnProperty(v)&&(t[v]=f[v])},h(i,n)};return function(i,n){h(i,n);function t(){this.constructor=i}i.prototype=n===null?Object.create(n):(t.prototype=n.prototype,new t)}}(),p=function(){return p=Object.assign||function(h){for(var i,n=1,t=arguments.length;n<t;n++){i=arguments[n];for(var f in i)Object.prototype.hasOwnProperty.call(i,f)&&(h[f]=i[f])}return h},p.apply(this,arguments)};function d(h){return h.displayName||h.name||"Component"}var o=function(){return{}};function a(h,i){i===void 0&&(i={});var n=!!h,t=h||o;return function(v){var m=function(_){c(g,_);function g(y,x){var l=_.call(this,y,x)||this;return l.unsubscribe=null,l.handleChange=function(){if(!l.unsubscribe)return;var S=t(l.store.getState(),l.props);l.setState({subscribed:S})},l.store=l.context,l.state={subscribed:t(l.store.getState(),y),store:l.store,props:y},l}return g.getDerivedStateFromProps=function(y,x){return h&&h.length===2&&y!==x.props?{subscribed:t(x.store.getState(),y),props:y}:{props:y}},g.prototype.componentDidMount=function(){this.trySubscribe()},g.prototype.componentWillUnmount=function(){this.tryUnsubscribe()},g.prototype.shouldComponentUpdate=function(y,x){return!b()(this.props,y)||!b()(this.state.subscribed,x.subscribed)},g.prototype.trySubscribe=function(){n&&(this.unsubscribe=this.store.subscribe(this.handleChange),this.handleChange())},g.prototype.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null)},g.prototype.render=function(){var y=p(p(p({},this.props),this.state.subscribed),{store:this.store});return le.createElement(v,p({},y,{ref:this.props.miniStoreForwardedRef}))},g.displayName="Connect("+d(v)+")",g.contextType=j,g}(le.Component);if(i.forwardRef){var E=le.forwardRef(function(_,g){return le.createElement(m,p({},_,{miniStoreForwardedRef:g}))});return C()(E,v)}return C()(m,v)}}var u=function(){return u=Object.assign||function(h){for(var i,n=1,t=arguments.length;n<t;n++){i=arguments[n];for(var f in i)Object.prototype.hasOwnProperty.call(i,f)&&(h[f]=i[f])}return h},u.apply(this,arguments)};function s(h){var i=h,n=[];function t(m){i=u(u({},i),m);for(var E=0;E<n.length;E++)n[E]()}function f(){return i}function v(m){return n.push(m),function(){var _=n.indexOf(m);n.splice(_,1)}}return{setState:t,getState:f,subscribe:v}}},IBYe:function(et,Ve,z){"use strict";function le(Q){return null}Ve.a=le},Iq15:function(et,Ve,z){var le=z("nVVt"),Q=z("dWSS"),j=z("dQei"),w={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},P={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1<<10|1<<8|1<<5|1<<4|1<<2|1<<1|1<<0,G18:1<<12|1<<11|1<<10|1<<9|1<<8|1<<5|1<<2|1<<0,G15_MASK:1<<14|1<<12|1<<10|1<<4|1<<1,getBCHTypeInfo:function(b){for(var T=b<<10;P.getBCHDigit(T)-P.getBCHDigit(P.G15)>=0;)T^=P.G15<<P.getBCHDigit(T)-P.getBCHDigit(P.G15);return(b<<10|T)^P.G15_MASK},getBCHTypeNumber:function(b){for(var T=b<<12;P.getBCHDigit(T)-P.getBCHDigit(P.G18)>=0;)T^=P.G18<<P.getBCHDigit(T)-P.getBCHDigit(P.G18);return b<<12|T},getBCHDigit:function(b){for(var T=0;b!=0;)T++,b>>>=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;C<b;C++)T=T.multiply(new Q([1,j.gexp(C)],0));return T},getLengthInBits:function(b,T){if(1<=T&&T<10)switch(b){case le.MODE_NUMBER:return 10;case le.MODE_ALPHA_NUM:return 9;case le.MODE_8BIT_BYTE:return 8;case le.MODE_KANJI:return 8;default:throw new Error("mode:"+b)}else if(T<27)switch(b){case le.MODE_NUMBER:return 12;case le.MODE_ALPHA_NUM:return 11;case le.MODE_8BIT_BYTE:return 16;case le.MODE_KANJI:return 10;default:throw new Error("mode:"+b)}else if(T<41)switch(b){case le.MODE_NUMBER:return 14;case le.MODE_ALPHA_NUM:return 13;case le.MODE_8BIT_BYTE:return 16;case le.MODE_KANJI:return 12;default:throw new Error("mode:"+b)}else throw new Error("type:"+T)},getLostPoint:function(b){for(var T=b.getModuleCount(),C=0,c=0;c<T;c++)for(var p=0;p<T;p++){for(var d=0,o=b.isDark(c,p),a=-1;a<=1;a++){if(c+a<0||T<=c+a)continue;for(var u=-1;u<=1;u++){if(p+u<0||T<=p+u)continue;if(a==0&&u==0)continue;o==b.isDark(c+a,p+u)&&d++}}d>5&&(C+=3+d-5)}for(var c=0;c<T-1;c++)for(var p=0;p<T-1;p++){var s=0;b.isDark(c,p)&&s++,b.isDark(c+1,p)&&s++,b.isDark(c,p+1)&&s++,b.isDark(c+1,p+1)&&s++,(s==0||s==4)&&(C+=3)}for(var c=0;c<T;c++)for(var p=0;p<T-6;p++)b.isDark(c,p)&&!b.isDark(c,p+1)&&b.isDark(c,p+2)&&b.isDark(c,p+3)&&b.isDark(c,p+4)&&!b.isDark(c,p+5)&&b.isDark(c,p+6)&&(C+=40);for(var p=0;p<T;p++)for(var c=0;c<T-6;c++)b.isDark(c,p)&&!b.isDark(c+1,p)&&b.isDark(c+2,p)&&b.isDark(c+3,p)&&b.isDark(c+4,p)&&!b.isDark(c+5,p)&&b.isDark(c+6,p)&&(C+=40);for(var h=0,p=0;p<T;p++)for(var c=0;c<T;c++)b.isDark(c,p)&&h++;var i=Math.abs(100*h/T/T-50)/5;return C+=i*10,C}};et.exports=P},IxHN:function(et,Ve,z){"use strict";var le=z("q1tI"),Q=z.n(le),j=z("07cG"),w=z.n(j);Ve.a=function(P){var b=P.message,T=P.className,C=P.children,c=P.style,p=c===void 0?{}:c;return Q.a.createElement("div",{className:"".concat(w.a.idsRingWrapper," ").concat(T)},Q.a.createElement("div",{className:w.a.ldsRing},Q.a.createElement("div",null),Q.a.createElement("div",null),Q.a.createElement("div",null),Q.a.createElement("div",null)),b?Q.a.createElement("p",{style:p},b):null,C)}},J66h:function(et,Ve,z){(function(le){var Q,j;(function(w,P){et.exports=P(w)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof le!="undefined"?le:this,function(w){"use strict";w=w||{};var P=w.Base64,b="2.6.4",T="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",C=function(D){for(var I={},B=0,H=D.length;B<H;B++)I[D.charAt(B)]=B;return I}(T),c=String.fromCharCode,p=function(D){if(D.length<2){var I=D.charCodeAt(0);return I<128?D:I<2048?c(192|I>>>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<te;H+=3){var W=D[H],V=D[H+1],X=D[H+2],ne=W<<16|V<<8|X;B+=T.charAt(ne>>>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)},E=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("")},_=w.atob&&typeof w.atob=="function"?function(D){return w.atob(D)}:function(D){return D.replace(/\S{1,4}/g,E)},g=function(D){return _(String(D).replace(/[^A-Za-z0-9\+\/]/g,""))},y=function(D){return m(_(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,_e=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,Ee=0;Ee<Me;Ee+=1){var Ae=(Be+Ee*Ie+Me)%Me,Le=U[Ae],Te=Le.group,Ze=Le.data;if(!Te&&!Ze.disabled)return Ae}return-1},ke=P.useState(function(){return xe(0)}),dt=Object(C.a)(ke,2),Ne=dt[0],je=dt[1],tt=function(Be){je(Be);var Ie=U[Be];if(!Ie){ze(null,-1);return}ze(Ie.data.value,Be)};P.useEffect(function(){tt(ye!==!1?xe(0):-1)},[U.length,Se]),P.useEffect(function(){var Xe=setTimeout(function(){if(!Pe&&Fe&&Ce.size===1){var Be=Array.from(Ce)[0],Ie=U.findIndex(function(Me){var Ee=Me.data;return Ee.value===Be});tt(Ie),J(Ie)}});return function(){return clearTimeout(Xe)}},[Fe]);var mt=function(Be){Be!==void 0&&me(Be,{selected:!Ce.has(Be)}),Pe||We(!1)};if(P.useImperativeHandle(ne,function(){return{onKeyDown:function(Be){var Ie=Be.which;switch(Ie){case c.a.UP:case c.a.DOWN:{var Me=0;if(Ie===c.a.UP?Me=-1:Ie===c.a.DOWN&&(Me=1),Me!==0){var Ee=xe(Ne+Me,Me);J(Ee),tt(Ee)}break}case c.a.ENTER:{var Ae=U[Ne];Ae&&!Ae.data.disabled?mt(Ae.data.value):mt(void 0),Fe&&Be.preventDefault();break}case c.a.ESC:We(!1)}},onKeyUp:function(){},scrollTo:function(Be){J(Be)}}}),U.length===0)return P.createElement("div",{role:"listbox",id:"".concat(ee,"_list"),className:"".concat(k,"-empty"),onMouseDown:$},Ue);function Qe(Xe){var Be=U[Xe];if(!Be)return null;var Ie=Be.data||{},Me=Ie.value,Ee=Ie.label,Ae=Ie.children,Le=Object(p.a)(Ie,!0),Te=de?Ae:Ee;return Be?P.createElement("div",Object.assign({"aria-label":typeof Te=="string"?Te:null},Le,{key:Xe,role:"option",id:"".concat(ee,"_list_").concat(Xe),"aria-selected":Ce.has(Me)}),Me):null}return P.createElement(P.Fragment,null,P.createElement("div",{role:"listbox",id:"".concat(ee,"_list"),style:{height:0,width:0,overflow:"hidden"}},Qe(Ne-1),Qe(Ne),Qe(Ne+1)),P.createElement(u.a,{itemKey:"key",ref:q,data:U,height:_e,itemHeight:Ge,fullHeight:!1,onMouseDown:$,onScroll:nt,virtual:be,onMouseEnter:re},function(Xe,Be){var Ie,Me=Xe.group,Ee=Xe.groupOption,Ae=Xe.data,Le=Ae.label,Te=Ae.key;if(Me)return P.createElement("div",{className:a()(k,"".concat(k,"-group"))},Le!==void 0?Le:Te);var Ze=Ae.disabled,ut=Ae.value,Ct=Ae.title,Ht=Ae.children,Qt=Ae.style,bt=Ae.className,Lt=Object(T.a)(Ae,["disabled","value","title","children","style","className"]),at=Ce.has(ut),pt="".concat(k,"-option"),st=a()(k,pt,bt,(Ie={},Object(b.a)(Ie,"".concat(pt,"-grouped"),Ee),Object(b.a)(Ie,"".concat(pt,"-active"),Ne===Be&&!Ze),Object(b.a)(Ie,"".concat(pt,"-disabled"),Ze),Object(b.a)(Ie,"".concat(pt,"-selected"),at),Ie)),De=de?Ht:Le,Ke=!He||typeof He=="function"||at;return P.createElement("div",Object.assign({},Lt,{"aria-selected":at,className:st,title:Ct,onMouseMove:function(){if(Ne===Be||Ze)return;tt(Be)},onClick:function(){Ze||mt(ut)},style:Qt}),P.createElement("div",{className:"".concat(pt,"-content")},De||ut),P.isValidElement(He)||at,Ke&&P.createElement(s.a,{className:"".concat(k,"-option-state"),customizeIcon:He,customizeIconProps:{isSelected:at}},at?"\u2713":null))}))},i=P.forwardRef(h);i.displayName="OptionList";var n=i,t=function(){return null};t.isSelectOption=!0;var f=t,v=function(){return null};v.isSelectOptGroup=!0;var m=v,E=z("VTBJ"),_=z("Zm9Q");function g(V){var X=V.key,ne=V.props,Y=ne.children,ee=ne.value,ce=Object(T.a)(ne,["children","value"]);return Object(E.a)({key:X,value:ee!==void 0?ee:X,children:Y},ce)}function y(V){var X=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(_.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(E.a)(Object(E.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,_e=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||_e,"`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(_.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(_.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<arguments.length;m++)d(Object(arguments[m]),function(E,_){n[_]=E});return n}}function T(){if(Object.create)return function(t,f,v,m){var E=p(arguments,1);return Q.apply(this,[Object.create(t)].concat(E))};{function i(){}return function(t,f,v,m){var E=p(arguments,1);return i.prototype=t,Q.apply(this,[new i].concat(E))}}}function C(){return String.prototype.trim?function(n){return String.prototype.trim.call(n)}:function(n){return n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}}function c(i,n){return function(){return n.apply(i,Array.prototype.slice.call(arguments,0))}}function p(i,n){return Array.prototype.slice.call(i,n||0)}function d(i,n){a(i,function(t,f){return n(t,f),!1})}function o(i,n){var t=u(i)?[]:{};return a(i,function(f,v){return t[v]=n(f,v),!1}),t}function a(i,n){if(u(i)){for(var t=0;t<i.length;t++)if(n(i[t],t))return i[t]}else for(var f in i)if(i.hasOwnProperty(f)&&n(i[f],f))return i[f]}function u(i){return i!=null&&typeof i!="function"&&typeof i.length=="number"}function s(i){return i&&{}.toString.call(i)==="[object Function]"}function h(i){return i&&{}.toString.call(i)==="[object Object]"}}).call(this,z("IyRk"))},MVJL:function(et,Ve,z){et.exports={flex_box_center:"flex_box_center___2gBaY",flex_space_between:"flex_space_between___2uD--",flex_box_vertical_center:"flex_box_vertical_center___3Bq-4",flex_box_center_end:"flex_box_center_end___2MOXm",flex_box_column:"flex_box_column___1Sq4x",discussItem:"discussItem___Mk503",wrap:"wrap___VPGVq",list:"list___2zNHf",btns:"btns___1hoB3",secondLevelDiscuss:"secondLevelDiscuss___9Ixoa",line:"line___20Ukm",thirdlyLevelDiscuss:"thirdlyLevelDiscuss___3ZS-s"}},NvD2:function(et,Ve,z){"use strict";z.d(Ve,"a",function(){return b});var le=z("Kwbf");function Q(T,C){var c=new Set;return T.forEach(function(p){C.has(p)||c.add(p)}),c}function j(T){var C=T||{},c=C.disabled,p=C.disableCheckbox,d=C.checkable;return!!(c||p)||d===!1}function w(T,C,c,p){for(var d=new Set(T),o=new Set,a=0;a<=c;a+=1){var u=C.get(a)||new Set;u.forEach(function(n){var t=n.key,f=n.node,v=n.children,m=v===void 0?[]:v;d.has(t)&&!p(f)&&m.filter(function(E){return!p(E.node)}).forEach(function(E){d.add(E.key)})})}for(var s=new Set,h=c;h>=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(E){return!p(E.node)}).forEach(function(E){var _=E.key,g=d.has(_);v&&!g&&(v=!1),!m&&(g||o.has(_))&&(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,E=m===void 0?[]:m;!o.has(f)&&!a.has(f)&&!d(v)&&E.filter(function(_){return!d(_.node)}).forEach(function(_){o.delete(_.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,E=!1;(f.children||[]).filter(function(_){return!d(_.node)}).forEach(function(_){var g=_.key,y=o.has(g);m&&!y&&(m=!1),!E&&(y||a.has(g))&&(E=!0)}),m||o.delete(f.key),E&&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,E=a.prefixCls,_=E===void 0?"rc-tooltip":E,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,_e=a.overlay,Ge=a.id;return[w.createElement("div",{className:"".concat(_,"-arrow"),key:"arrow"},ye),w.createElement(C,{key:"content",prefixCls:_,id:Ge,overlay:_e,overlayInnerStyle:V})]},ce=!1,de=!1;if(typeof H=="boolean")ce=H;else if(H&&Object(le.a)(H)==="object"){var Ce=H.keepParent;ce=Ce===!0,de=Ce===!1}return w.createElement(P.a,Object.assign({popupClassName:s,prefixCls:_,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=E.slice(),y=g.indexOf(_);return y>=0&&g.splice(y,1),g}function d(E,_){var g=E.slice();return g.indexOf(_)===-1&&g.push(_),g}function o(E){return E.split("-")}function a(E,_){return"".concat(E,"-").concat(_)}function u(E){return E&&E.type&&E.type.isTreeNode}function s(E,_){var g=[E],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=E.clientY,y=_.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(!E)return;var g=_.multiple;return g?E.slice():E.length?[E[0]]:E}var n=function(_){return _};function t(E,_){if(!E)return[];var g=_||{},y=g.processProps,x=y===void 0?n:y,l=Array.isArray(E)?E:[E];return l.map(function(S){var O=S.children,A=Object(j.a)(S,["children"]),D=t(O,_);return P.a.createElement(T.a,Object.assign({},x(A)),D)})}function f(E){if(!E)return null;var _;if(Array.isArray(E))_={checkedKeys:E,halfCheckedKeys:void 0};else if(Object(Q.a)(E)==="object")_={checkedKeys:E.checked||void 0,halfCheckedKeys:E.halfChecked||void 0};else return Object(b.a)(!1,"`checkedKeys` is not an array or an object"),null;return _}function v(E,_){var g=new Set;function y(x){if(g.has(x))return;var l=_[x];if(!l)return;g.add(x);var S=l.parent,O=l.node;if(O.disabled)return;S&&y(S.key)}return(E||[]).forEach(function(x){y(x)}),Object(le.a)(g)}function m(E){var _={};return Object.keys(E).forEach(function(g){(g.startsWith("data-")||g.startsWith("aria-"))&&(_[g]=E[g])}),_}},"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"),E=z("9Bee"),_=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"),_e=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(_e.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,Ee="\u2581",Ae=`
|
|
|
**\u6A21\u677F\u6807\u9898**
|
|
|
\u6A21\u677F\u6B63\u6587\u5185\u5BB9\uFF0C\u53EF\u8F93\u5165\u6587\u672C\u5185\u5BB9\u548C\u7C98\u8D34\u56FE\u7247\u7B49\u64CD\u4F5C`;function Le(bt){return/^\d+$/.test(bt)?"".concat(bt,"px"):bt}var Te=navigator.platform.toUpperCase().indexOf("MAC")>=0,Ze=Te?"Cmd":"Ctrl",ut=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"],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),Et=Object(T.a)($e,2),it=Et[0],Vt=Et[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],Ei=Object(d.useState)(yt),vi=Object(T.a)(Ei,2),di=vi[0],Fn=vi[1],wn=Object(d.useState)(!1),_r=Object(T.a)(wn,2),qn=_r[0],kr=_r[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(".concat(Zn.content_type,")")):Zn.content_type.indexOf("video")>-1?it.replaceSelection('<video width="100%" controls src="'.concat(I.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):Zn.content_type.indexOf("pdf")>-1?it.replaceSelection('<a href="'.concat(I.a.API_SERVER,"/api/attachments/").concat(Zn.id,"?type=").concat(Zn.content_type,'&disposition=inline" target="_blank">').concat(Zn.name,"</a>")):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(".concat(ct.content_type,")")):(zn==null||((It=zn.type)===null||It===void 0)?void 0:It.indexOf("video"))>-1?dn.replaceSelection('<video width="100%" controls src="'.concat(I.a.API_SERVER,"/api/attachments/").concat(ct.id,'"></video>')):(zn==null||((sn=zn.type)===null||sn===void 0)?void 0:sn.indexOf("pdf"))>-1?dn.replaceSelection('<a href="'.concat(I.a.API_SERVER,"/api/attachments/").concat(ct.id,"?type=").concat(zn.type,'&disposition=inline" target="_blank">').concat(zn.name,"</a>")):ut.includes(gt)?dn.replaceSelection('<a href="'.concat(I.a.API_SERVER,"/api/attachments/").concat(ct.id,'?type=office&disposition=inline" target="_blank">').concat(zn.name,"</a>")):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(".concat(ct.content_type,")")):(zn==null||((It=zn.type)===null||It===void 0)?void 0:It.indexOf("video"))>-1?dn.replaceSelection('<video width="100%" controls src="'.concat(I.a.API_SERVER,"/api/attachments/").concat(ct.id,'"></video>')):(zn==null||((sn=zn.type)===null||sn===void 0)?void 0:sn.indexOf("pdf"))>-1?dn.replaceSelection('<a href="'.concat(I.a.API_SERVER,"/api/attachments/").concat(ct.id,"?type=").concat(zn.type,'&disposition=inline" target="_blank">').concat(zn.name,"</a>")):ut.includes(gt)?dn.replaceSelection('<a href="'.concat(I.a.API_SERVER,"/api/attachments/").concat(ct.id,'?type=office&disposition=inline" target="_blank">').concat(zn.name,"</a>")):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;Zn<Hn.length;Zn++)cr(Zn)}}),Vt(dn),function(){dn.off("paste",On)}}},[]);var xi=Object(d.useCallback)(function(){if(yi.current)try{}catch(dn){console.log(dn,"---- to set md editor body height")}},[di,yi,fr]);Object(d.useEffect)(function(){function dn(){var gn=new s.default(function(qt){var Hn=Object(j.a)(qt),cr;try{for(Hn.s();!(cr=Hn.n()).done;){var Zn=cr.value;(Zn.target.offsetHeight>0||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);gn<qt.length;gn++){var Hn;On()}return Nr.current=setInterval(function(){Ui.current&&qi()},4e3),function(){clearInterval(Nr.current);var cr=Object(j.a)(dn),Zn;try{for(cr.s();!(Zn=cr.n()).done;){var wr=Zn.value;it.removeKeyMap(wr)}}catch(Wr){cr.e(Wr)}finally{cr.f()}}}},[it]),Object(d.useEffect)(function(){ht!==fr&&br(ht)},[ht]),Object(mt.a)(function(){if(!he&&Pr>0){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(`<br/>
|
|
|
`),it.focus();case"list-ul":return gn===""?it.replaceSelection("- "+gn):it.replaceSelection(qt.map(function(Hn){return Hn===""?"":"- ".concat(Hn)}).join(`
|
|
|
`)),it.focus();case"list-ol":return gn===""?it.replaceSelection("1. "+gn):it.replaceSelection(qt.map(function(Hn,cr){return Hn===""?"":"".concat(cr+1,". ").concat(Hn)}).join(`
|
|
|
`)),it.focus();case"add-null-ch":return gn===""&&it.setCursor(On.line,On.ch+1),it.replaceSelection(Ee),it.focus();case"inster-template-1":return gn===""&&it.setCursor(On.line,On.ch),it.replaceSelection(Ae),it.focus();case"eraser":return it.setValue(""),it.focus();case"trigger-watch":return ur(!Un),it.focus();case"trigger-full-screen":return br(!fr),it.focus();case xe:gr(xe);return;case dt:gr(dt);return;case ke:gr(ke);return;case 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(cr,' "').concat(Zn||"",'" )')):cr.indexOf("type=application/pdf")>-1?it.replaceSelection('<a href="'.concat(cr,'&disposition=inline" target="_blank">').concat(wr,"</a>")):it.replaceSelection('<a href="'.concat(cr,'" target="_blank">').concat(wr,"</a>")),it.focus();case Ne:for(var Wr=dn.row,zn=dn.col,gt=dn.align,ct=`
|
|
|
`,xt=0;xt<Wr;xt++){for(var It=[],sn=[],fn=0;fn<zn;fn++)xt===1&&sn.push(tt[gt]),It.push(" ");xt===1&&(ct+="| ".concat(sn.join(" | "),` |
|
|
|
`)),ct+="| ".concat(It.join(zn===1?"":" | "),` |
|
|
|
`)}return it.replaceSelection(ct+`
|
|
|
`),it.focus();default:throw new Error}},[it,Yr]),Wi=Object(d.useMemo)(function(){switch(Yr){case xe:return o.a.createElement(Ce,{callback:li,onCancel:Si});case dt:return o.a.createElement(Se.b,{callback:li,onCancel:Si});case ke:return o.a.createElement(He,{callback:li,onCancel:Si});case Ne:return o.a.createElement(q,{callback:li,onCancel:Si});default:return null}},[Yr]);function Si(){gr("")}Object(d.useEffect)(function(){if(Zr.current){var dn=Zr.current,On=!1,gn=0;function qt(Zn){On=!0,gn=Zn.pageY}function Hn(){On=!1}function cr(Zn){if(On){var wr=Zn.pageY-gn;wr<0&&(wr=0),wr>300&&(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(_,{value:on}),Zt!=="stex"&&o.a.createElement(E.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</"+s+'><iframe src="/favicon.ico"></iframe>'),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 E}),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"},E=(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),_;(function(l){l[l.SET_VISIBLE=0]="SET_VISIBLE",l[l.SET_TABINDEX=1]="SET_TABINDEX"})(_||(_={}));function g(l,S){switch(S.type){case _.SET_VISIBLE:return Object(w.a)(Object(w.a)({},l),{},{visible:S.payload});case _.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:_.SET_VISIBLE,payload:!1})},[S]);function de(ye){var _e=ye.target.id;Y({type:_.SET_TABINDEX,payload:_e})}function Ce(){Y({type:_.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:_.SET_VISIBLE,payload:!0}),Y({type:_.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:_.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/,E="str",_="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;re<k;++re){var U=me[re];if(U.ignoreCase)nt=!0;else if(/[a-z]/i.test(U.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){ze=!0,nt=!1;break}}var q={b:8,t:9,n:10,v:11,f:12,r:13};function $(Ne){var je=Ne.charCodeAt(0);if(je!==92)return je;var tt=Ne.charAt(1);return je=q[tt],je||("0"<=tt&&tt<="7"?parseInt(Ne.substring(1),8):tt==="u"||tt==="x"?parseInt(Ne.substring(2),16):Ne.charCodeAt(1))}function J(Ne){if(Ne<32)return(Ne<16?"\\x0":"\\x")+Ne.toString(16);var je=String.fromCharCode(Ne);return je==="\\"||je==="-"||je==="]"||je==="^"?"\\"+je:je}function xe(Ne){var je=Ne.substring(1,Ne.length-1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g")),tt=[],mt=je[0]==="^",Qe=["["];mt&&Qe.push("^");for(var Xe=mt?1:0,Be=je.length;Xe<Be;++Xe){var Ie=je[Xe];if(/\\[bdsw]/i.test(Ie))Qe.push(Ie);else{var Me=$(Ie),Ee;Xe+2<Be&&je[Xe+1]==="-"?(Ee=$(je[Xe+2]),Xe+=2):Ee=Me,tt.push([Me,Ee]),Ee<65||Me>122||(Ee<65||Me>90||tt.push([Math.max(65,Me)|32,Math.min(Ee,90)|32]),Ee<97||Me>122||tt.push([Math.max(97,Me)&~32,Math.min(Ee,122)&~32]))}}tt.sort(function(Ze,ut){return Ze[0]-ut[0]||ut[1]-Ze[1]});for(var Ae=[],Le=[],Xe=0;Xe<tt.length;++Xe){var Te=tt[Xe];Te[0]<=Le[1]+1?Le[1]=Math.max(Le[1],Te[1]):Ae.push(Le=Te)}for(var Xe=0;Xe<Ae.length;++Xe){var Te=Ae[Xe];Qe.push(J(Te[0])),Te[1]>Te[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<tt;++Qe){var Be=je[Qe];if(Be==="(")++Xe;else if(Be.charAt(0)==="\\"){var Ie=+Be.substring(1);Ie&&(Ie<=Xe?mt[Ie]=-1:je[Qe]=J(Ie))}}for(var Qe=1;Qe<mt.length;++Qe)mt[Qe]===-1&&(mt[Qe]=++We);for(var Qe=0,Xe=0;Qe<tt;++Qe){var Be=je[Qe];if(Be==="(")++Xe,mt[Xe]||(je[Qe]="(?:");else if(Be.charAt(0)==="\\"){var Ie=+Be.substring(1);Ie&&Ie<=Xe&&(je[Qe]="\\"+mt[Ie])}}for(var Qe=0;Qe<tt;++Qe)je[Qe]==="^"&&je[Qe+1]!=="^"&&(je[Qe]="");if(Ne.ignoreCase&&ze)for(var Qe=0;Qe<tt;++Qe){var Be=je[Qe],Me=Be.charAt(0);Be.length>=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<k;++re){var U=me[re];if(U.global||U.multiline)throw new Error(""+U);dt.push("(?:"+ke(U)+")")}return new RegExp(dt.join("|"),nt?"gi":"g")}function V(me,We){var ze=/(?:^|\s)nocode(?:\s|$)/,nt=[],re=0,k=[],U=0;function q($){var J=$.nodeType;if(J==1){if(ze.test($.className))return;for(var xe=$.firstChild;xe;xe=xe.nextSibling)q(xe);var ke=$.nodeName.toLowerCase();(ke==="br"||ke==="li")&&(nt[U]=`
|
|
|
`,k[U<<1]=re++,k[U++<<1|1]=$)}else if(J==3||J==4){var dt=$.nodeValue;dt.length&&(We?dt=dt.replace(/\r\n?/g,`
|
|
|
`):dt=dt.replace(/[ \t\r\n]+/g," "),nt[U]=dt,k[U<<1]=re,re+=dt.length,k[U++<<1|1]=$)}}return q(me),{sourceCode:nt.join("").replace(/\n$/,""),spans:k}}function X(me,We,ze,nt,re){if(!ze)return;var k={sourceNode:me,pre:1,langExtension:null,numberLines:null,sourceCode:ze,spans:null,basePos:We,decorations:null};nt(k),re.push.apply(re,k.decorations)}var ne=/\S/;function Y(me){for(var We=void 0,ze=me.firstChild;ze;ze=ze.nextSibling){var nt=ze.nodeType;We=nt===1?We?me:ze:nt===3&&ne.test(ze.nodeValue)?me:We}return We===me?void 0:We}function ee(me,We){var ze={},nt;(function(){for(var U=me.concat(We),q=[],$={},J=0,xe=U.length;J<xe;++J){var ke=U[J],dt=ke[3];if(dt)for(var Ne=dt.length;--Ne>=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<tt;++je){var mt=dt[je],Qe=Ne[mt],Xe=void 0,Be;if(typeof Qe=="string")Be=!1;else{var Ie=ze[mt.charAt(0)];if(Ie)Xe=mt.match(Ie[1]),Qe=Ie[0];else{for(var Me=0;Me<re;++Me)if(Ie=We[Me],Xe=mt.match(Ie[1]),Xe){Qe=Ie[0];break}Xe||(Qe=S)}Be=Qe.length>=5&&Qe.substring(0,5)==="lang-",Be&&!(Xe&&typeof Xe[1]=="string")&&(Be=!1,Qe=D),Be||(Ne[mt]=Qe)}var Ee=ke;if(ke+=mt.length,!Be)xe.push($+Ee,Qe);else{var Ae=Xe[1],Le=mt.indexOf(Ae),Te=Le+Ae.length;Xe[2]&&(Te=mt.length-Xe[2].length,Le=Te-Ae.length);var Ze=Qe.substring(5);X(J,$+Ee,mt.substring(0,Le),k,xe),X(J,$+Ee+Le,Ae,_e(Ze,Ae),xe),X(J,$+Ee+Te,mt.substring(Te),k,xe)}}U.decorations=xe};return k}function ce(me){var We=[],ze=[];me.tripleQuotedStrings?We.push([E,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):me.multiLineStrings?We.push([E,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):We.push([E,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),me.verbatimStrings&&ze.push([E,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,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([E,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\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([_,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 Ee=tt(Me,1),Ae=Xe.nextSibling;Ee.appendChild(Ie);for(var Le=Ae;Le;Le=Ae)Ae=Le.nextSibling,Ee.appendChild(Le)}return Ie}for(var mt=tt(je.nextSibling,0),Qe;(Qe=mt.parentNode)&&Qe.nodeType===1;)mt=Qe;q.push(mt)}for(var xe=0;xe<q.length;++xe)$(q[xe]);We===(We|0)&&q[0].setAttribute("value",We);var ke=k.createElement("ol");ke.className="linenums";for(var dt=Math.max(0,We-1|0)||0,xe=0,Ne=q.length;xe<Ne;++xe)U=q[xe],U.className="L"+(xe+dt)%10,U.firstChild||U.appendChild(k.createTextNode("\xA0")),ke.appendChild(U);me.appendChild(ke)}function Se(me){var We=/\bMSIE\s(\d+)/.exec(navigator.userAgent);We=We&&+We[1]<=8;var ze=/\n/g,nt=me.sourceCode,re=nt.length,k=0,U=me.spans,q=U.length,$=0,J=me.decorations,xe=J.length,ke=0;J[xe]=re;var dt,Ne;for(Ne=dt=0;Ne<xe;)J[Ne]!==J[Ne+2]?(J[dt++]=J[Ne++],J[dt++]=J[Ne++]):Ne+=2;for(xe=dt,Ne=dt=0;Ne<xe;){for(var je=J[Ne],tt=J[Ne+1],mt=Ne+2;mt+2<=xe&&J[mt+1]===tt;)mt+=2;J[dt++]=je,J[dt++]=tt,Ne=mt}xe=J.length=dt;var Qe=me.sourceNode,Xe="";Qe&&(Xe=Qe.style.display,Qe.style.display="none");try{for(var Be=null;$<q;){var Ie=U[$],Me=U[$+2]||re,Ee=J[ke+2]||re,mt=Math.min(Me,Ee),Ae=U[$+1],Le;if(Ae.nodeType!==1&&(Le=nt.substring(k,mt))){We&&(Le=Le.replace(ze,"\r")),Ae.nodeValue=Le;var Te=Ae.ownerDocument,Ze=Te.createElement("span");Ze.className=J[ke+1];var ut=Ae.parentNode;ut.replaceChild(Ze,Ae),Ze.appendChild(Ae),k<Me&&(U[$+1]=Ae=Te.createTextNode(nt.substring(mt,Me)),ut.insertBefore(Ae,Ze.nextSibling))}k=mt,k>=Me&&($+=2),k>=Ee&&(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 _e(me,We){return me&&Pe.hasOwnProperty(me)||(me=/^\s*</.test(We)?"default-markup":"default-code"),Pe[me]}ye(de,["default-code"]),ye(ee([],[[S,/^[^<?]+/],[A,/^<!\w[^>]*(?:>|$)/],[g,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[l,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),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([],[[E,/^[\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,_e(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="<pre>"+me+"</pre>",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<k.length;++q)for(var $=0,J=k[q].length;$<J;++$)U.push(k[q][$]);k=null;var xe=Date;xe.now||(xe={now:function(){return+new Date}});var ke=0,dt=/\blang(?:uage)?-([\w.]+)(?!\S)/,Ne=/\bprettyprint\b/,je=/\bprettyprinted\b/,tt=/pre|xmp/i,mt=/^code$/i,Qe=/^(?:pre|code|xmp)$/i,Xe={};function Be(){for(var Ie=C.PR_SHOULD_USE_CONTINUATION?xe.now()+250:Infinity;ke<U.length&&xe.now()<Ie;ke++){for(var Me=U[ke],Ee=Xe,Ae=Me;Ae=Ae.previousSibling;){var Le=Ae.nodeType,Te=(Le===7||Le===8)&&Ae.nodeValue;if(Te?!/^\??prettify\b/.test(Te):Le!==3||/\S/.test(Ae.nodeValue))break;if(Te){Ee={},Te.replace(/\b(\w+)=([\w:.%+-]+)/g,function(yt,ot,kt){Ee[ot]=kt});break}}var Ze=Me.className;if((Ee!==Xe||Ne.test(Ze))&&!je.test(Ze)){for(var ut=!1,Ct=Me.parentNode;Ct;Ct=Ct.parentNode){var Ht=Ct.tagName;if(Qe.test(Ht)&&Ct.className&&Ne.test(Ct.className)){ut=!0;break}}if(!ut){Me.className+=" prettyprinted";var Qt=Ee.lang;if(!Qt){Qt=Ze.match(dt);var bt;!Qt&&(bt=Y(Me))&&mt.test(bt.tagName)&&(Qt=bt.className.match(dt)),Qt&&(Qt=Qt[1])}var Lt;if(tt.test(Me.tagName))Lt=1;else{var at=Me.currentStyle,pt=nt.defaultView,st=at?at.whiteSpace:pt&&pt.getComputedStyle?pt.getComputedStyle(Me,null).getPropertyValue("white-space"):0;Lt=st&&st.substring(0,3)==="pre"}var De=Ee.linenums;(De=De==="true"||+De)||(De=Ze.match(/\blinenums\b(?::(\d+))?/),De=De?De[1]&&De[1].length?+De[1]:!0:!1),De&&Ce(Me,De,Lt);var Ke={langExtension:Qt,sourceNode:Me,numberLines:De,pre:Lt,sourceCode:null,basePos:null,spans:null,decorations:null};Ge(Ke)}}}ke<U.length?C.setTimeout(Be,250):typeof me=="function"&&me()}Be()}var He=C.PR={createSimpleLexer:ee,registerLangHandler:ye,sourceDecorator:ce,PR_ATTRIB_NAME:I,PR_ATTRIB_VALUE:B,PR_COMMENT:g,PR_DECLARATION:A,PR_KEYWORD:_,PR_LITERAL:x,PR_NOCODE:H,PR_PLAIN:S,PR_PUNCTUATION:l,PR_SOURCE:D,PR_STRING:E,PR_TAG:O,PR_TYPE:y,prettyPrintOne:j?C.prettyPrintOne=Ue:b=Ue,prettyPrint:T=j?C.prettyPrint=Fe:T=Fe},be=C.define;typeof be=="function"&&be.amd&&be("google-code-prettify",[],function(){return He})})()},TcMa:function(et,Ve,z){et.exports={desc:"desc___qlRMF",info:"info___JEaKq","commit-info":"commit-info___3-4e0"}},UZu5:function(et,Ve,z){},VEzc:function(et,Ve,z){et.exports={flex_box_center:"flex_box_center___z2AYj",flex_space_between:"flex_space_between___2PZH7",flex_box_vertical_center:"flex_box_vertical_center___3Vw8I",flex_box_center_end:"flex_box_center_end___1dJQf",flex_box_column:"flex_box_column___kstqC",wrap:"wrap___wWYG3",head:"head___1xABk",title:"title___yYb50",content:"content___fzoVv",list:"list___2q90P",footer:"footer___3zT-e"}},"VrN/":function(et,Ve,z){(function(le,Q){et.exports=Q()})(this,function(){"use strict";var le=navigator.userAgent,Q=navigator.platform,j=/gecko\/\d/i.test(le),w=/MSIE \d/.test(le),P=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(le),b=/Edge\/(\d+)/.exec(le),T=w||P||b,C=T&&(w?document.documentMode||6:+(b||P)[1]),c=!b&&/WebKit\//.test(le),p=c&&/Qt\/\d+\.\d+/.test(le),d=!b&&/Chrome\//.test(le),o=/Opera\//.test(le),a=/Apple Computer/.test(navigator.vendor),u=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(le),s=/PhantomJS/.test(le),h=!b&&/AppleWebKit/.test(le)&&/Mobile\/\w+/.test(le),i=/Android/.test(le),n=h||i||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(le),t=h||/Mac/.test(Q),f=/\bCrOS\b/.test(le),v=/win/i.test(Q),m=o&&le.match(/Version\/(\d*\.\d*)/);m&&(m=Number(m[1])),m&&m>=15&&(o=!1,c=!0);var E=t&&(p||o&&(m==null||m<12.11)),_=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.length;++G)M.appendChild(r[G]);return M}function O(e,r,R,L){var M=S(e,r,R,L);return M.setAttribute("role","presentation"),M}var A;document.createRange?A=function(e,r,R,L){var M=document.createRange();return M.setEnd(L||e,R),M.setStart(e,r),M}:A=function(e,r,R){var L=document.body.createTextRange();try{L.moveToElementText(e.parentNode)}catch(M){return L}return L.collapse(!0),L.moveEnd("character",R),L.moveStart("character",r),L};function D(e,r){if(r.nodeType==3&&(r=r.parentNode),e.contains)return e.contains(r);do if(r.nodeType==11&&(r=r.host),r==e)return!0;while(r=r.parentNode)}function I(){var e;try{e=document.activeElement}catch(r){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function B(e,r){var R=e.className;g(r).test(R)||(e.className+=(R?" ":"")+r)}function H(e,r){for(var R=e.split(" "),L=0;L<R.length;L++)R[L]&&!g(R[L]).test(r)&&(r+=" "+R[L]);return r}var te=function(e){e.select()};h?te=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:T&&(te=function(e){try{e.select()}catch(r){}});function W(e){var r=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,r)}}function V(e,r,R){r||(r={});for(var L in e)e.hasOwnProperty(L)&&(R!==!1||!r.hasOwnProperty(L))&&(r[L]=e[L]);return r}function X(e,r,R,L,M){r==null&&(r=e.search(/[^\s\u00a0]/),r==-1&&(r=e.length));for(var G=L||0,ue=M||0;;){var fe=e.indexOf(" ",G);if(fe<0||fe>=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<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=R)};function Y(e,r){for(var R=0;R<e.length;++R)if(e[R]==r)return R;return-1}var ee=50,ce={toString:function(){return"CodeMirror.Pass"}},de={scroll:!1},Ce={origin:"*mouse"},Se={origin:"+move"};function Pe(e,r,R){for(var L=0,M=0;;){var G=e.indexOf(" ",L);G==-1&&(G=e.length);var ue=G-L;if(G==e.length||M+ue>=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 _e(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<e.length;L++)R[L]=r(e[L],L);return R}function Fe(e,r,R){for(var L=0,M=R(r);L<e.length&&R(e[L])<=M;)L++;e.splice(L,0,r)}function He(){}function be(e,r){var R;return Object.create?R=Object.create(e):(He.prototype=e,R=new He),r&&V(r,R),R}var me=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function We(e){return/\w/.test(e)||e>"\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:r<e.length)&&k(e.charAt(r));)r+=R;return r}function q(e,r,R){for(var L=r>R?-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;G<e.length;++G){var ue=e[G];(ue.from<R&&ue.to>r||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;M<e.length;++M){var G=e[M];if(G.from<r&&G.to>r)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<vt;++Ot)ft.push(R(we.charCodeAt(Ot)));for(var Ut=0,Wt=qe;Ut<vt;++Ut){var $t=ft[Ut];$t=="m"?ft[Ut]=Wt:Wt=$t}for(var rn=0,Jt=qe;rn<vt;++rn){var un=ft[rn];un=="1"&&Jt=="r"?ft[rn]="n":G.test(un)&&(Jt=un,un=="r"&&(ft[rn]="R"))}for(var An=1,_n=ft[0];An<vt-1;++An){var Qn=ft[An];Qn=="+"&&_n=="1"&&ft[An+1]=="1"?ft[An]="1":Qn==","&&_n==ft[An+1]&&(_n=="1"||_n=="n")&&(ft[An]=_n),_n=Qn}for(var Or=0;Or<vt;++Or){var ai=ft[Or];if(ai==",")ft[Or]="N";else if(ai=="%"){var Br=void 0;for(Br=Or+1;Br<vt&&ft[Br]=="%";++Br);for(var Di=Or&&ft[Or-1]=="!"||Br<vt&&ft[Br]=="1"?"1":"N",Ti=Or;Ti<Br;++Ti)ft[Ti]=Di;Or=Br-1}}for(var Qr=0,Ai=qe;Qr<vt;++Qr){var ci=ft[Qr];Ai=="L"&&ci=="1"?ft[Qr]="L":G.test(ci)&&(Ai=ci)}for(var ti=0;ti<vt;++ti)if(M.test(ft[ti])){var qr=void 0;for(qr=ti+1;qr<vt&&M.test(ft[qr]);++qr);for(var zr=(ti?ft[ti-1]:qe)=="L",Oi=(qr<vt?ft[qr]:qe)=="L",ka=zr==Oi?zr?"L":"R":qe,fa=ti;fa<qr;++fa)ft[fa]=ka;ti=qr-1}for(var pi=[],Qi,oi=0;oi<vt;)if(ue.test(ft[oi])){var Bo=oi;for(++oi;oi<vt&&ue.test(ft[oi]);++oi);pi.push(new ge(0,Bo,oi))}else{var ia=oi,Ea=pi.length,xa=Ye=="rtl"?1:0;for(++oi;oi<vt&&ft[oi]!="L";++oi);for(var _i=ia;_i<oi;)if(fe.test(ft[_i])){ia<_i&&(pi.splice(Ea,0,new ge(1,ia,_i)),Ea+=xa);var Ma=_i;for(++_i;_i<oi&&fe.test(ft[_i]);++_i);pi.splice(Ea,0,new ge(2,Ma,_i)),Ea+=xa,ia=_i}else++_i;ia<oi&&pi.splice(Ea,0,new ge(1,ia,oi))}return Ye=="ltr"&&(pi[0].level==1&&(Qi=we.match(/^\s+/))&&(pi[0].from=Qi[0].length,pi.unshift(new ge(0,0,Qi[0].length))),Ge(pi).level==1&&(Qi=we.match(/\s+$/))&&(Ge(pi).to-=Qi[0].length,pi.push(new ge(0,vt-Qi[0].length,vt)))),Ye=="rtl"?pi.reverse():pi}}();function dt(e,r){var R=e.order;return R==null&&(R=e.order=ke(e.text,r)),R}var Ne=[],je=function(e,r,R){if(e.addEventListener)e.addEventListener(r,R,!1);else if(e.attachEvent)e.attachEvent("on"+r,R);else{var L=e._handlers||(e._handlers={});L[r]=(L[r]||Ne).concat(R)}};function tt(e,r){return e._handlers&&e._handlers[r]||Ne}function mt(e,r,R){if(e.removeEventListener)e.removeEventListener(r,R,!1);else if(e.detachEvent)e.detachEvent("on"+r,R);else{var L=e._handlers,M=L&&L[r];if(M){var G=Y(M,R);G>-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;M<R.length;++M)R[M].apply(null,L)}function Xe(e,r,R){return typeof r=="string"&&(r={type:r,preventDefault:function(){this.defaultPrevented=!0}}),Qe(e,R||r.type,e,r),Le(r)||r.codemirrorIgnore}function Be(e){var r=e._handlers&&e._handlers.cursorActivity;if(!r)return;for(var R=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),L=0;L<r.length;++L)Y(R,r[L])==-1&&R.push(r[L])}function Ie(e,r){return tt(e,r).length>0}function Me(e){e.prototype.on=function(r,R){je(this,r,R)},e.prototype.off=function(r,R){mt(this,r,R)}}function Ee(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Ae(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Le(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function Te(e){Ee(e),Ae(e)}function Ze(e){return e.target||e.srcElement}function ut(e){var r=e.which;return r==null&&(e.button&1?r=1:e.button&2?r=3:e.button&4&&(r=2)),t&&e.ctrlKey&&r==1&&(r=3),r}var 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.pos<this.string.length)return this.string.charAt(this.pos++)},K.prototype.eat=function(e){var r=this.string.charAt(this.pos),R;if(typeof e=="string"?R=r==e:R=r&&(e.test?e.test(r):e(r)),R)return++this.pos,r},K.prototype.eatWhile=function(e){for(var r=this.pos;this.eat(e););return this.pos>r},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.lastColumnPos<this.start&&(this.lastColumnValue=X(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?X(this.string,this.lineStart,this.tabSize):0)},K.prototype.indentation=function(){return X(this.string,null,this.tabSize)-(this.lineStart?X(this.string,this.lineStart,this.tabSize):0)},K.prototype.match=function(e,r,R){if(typeof e=="string"){var L=function(ue){return R?ue.toLowerCase():ue},M=this.string.substr(this.pos,e.length);if(L(M)==L(e))return r!==!1&&(this.pos+=e.length),!0}else{var G=this.string.slice(this.pos).match(e);return G&&G.index>0?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<G){R=M;break}r-=G}return R.lines[r]}function oe(e,r,R){var L=[],M=r.line;return e.iter(r.line,R.line+1,function(G){var ue=G.text;M==R.line&&(ue=ue.slice(0,R.ch)),M==r.line&&(ue=ue.slice(r.ch)),L.push(ue),++M}),L}function he(e,r,R){var L=[];return e.iter(r,R,function(M){L.push(M.text)}),L}function Oe(e,r){var R=r-e.height;if(R)for(var L=e;L;L=L.parent)L.height+=R}function Je(e){if(e.parent==null)return null;for(var r=e.parent,R=Y(r.lines,e),L=r.parent;L;r=L,L=L.parent)for(var M=0;!(L.children[M]==r);++M)R+=L.children[M].chunkSize();return R+r.first}function lt(e,r){var R=e.first;e:do{for(var L=0;L<e.children.length;++L){var M=e.children[L],G=M.height;if(r<G){e=M;continue e}r-=G,R+=M.chunkSize()}return R}while(!e.lines);for(var ue=0;ue<e.lines.length;++ue){var fe=e.lines[ue],ge=fe.height;if(r<ge)break;r-=ge}return R+ue}function Pt(e,r){return r>=e.first&&r<e.first+e.size}function Nt(e,r){return String(e.lineNumberFormatter(r+e.firstLineNumber))}function ht(e,r,R){if(R===void 0&&(R=null),!(this instanceof ht))return new ht(e,r,R);this.line=e,this.ch=r,this.sticky=R}function Mt(e,r){return e.line-r.line||e.ch-r.ch}function nn(e,r){return e.sticky==r.sticky&&Mt(e,r)==0}function Rt(e){return ht(e.line,e.ch)}function cn(e,r){return Mt(e,r)<0?r:e}function an(e,r){return Mt(e,r)<0?e:r}function ie(e,r){return Math.max(e.first,Math.min(r,e.first+e.size-1))}function N(e,r){if(r.line<e.first)return ht(e.first,0);var R=e.first+e.size-1;return r.line>R?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;L<r.length;L++)R[L]=N(e,r[L]);return R}var pe=function(e,r){this.state=e,this.lookAhead=r},se=function(e,r,R,L){this.state=r,this.doc=e,this.line=R,this.maxLookAhead=L||0,this.baseTokens=null,this.baseTokenPos=1};se.prototype.lookAhead=function(e){var r=this.doc.getLine(this.line+e);return r!=null&&e>this.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;vt<ft;){var Wt=M[qe];Wt>ft&&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(;Ut<qe;Ut+=2){var $t=M[Ut+1];M[Ut+1]=($t?$t+" ":"")+"overlay "+Ot}},G),R.state=ue,R.baseTokens=null,R.baseTokenPos=1},ge=0;ge<e.state.overlays.length;++ge)fe(ge);return{styles:M,classes:G.bgClass||G.textClass?G:null}}function Et(e,r,R){if(!r.styles||r.styles[0]!=e.state.modeGen){var L=it(e,Je(r)),M=r.text.length>e.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&&we<M.viewTo?fe.save():null,fe.nextLine()}),R&&(L.modeFrontier=fe.line),fe}function Vt(e,r,R,L){var M=e.doc.mode,G=new K(r,e.options.tabSize,R);for(G.start=G.pos=L||0,r==""&&At(M,R.state);!G.eol();)Bt(M,G,R.state),G.start=G.pos}function At(e,r){if(e.blankLine)return e.blankLine(r);if(!e.innerMode)return;var R=Re(e,r);if(R.mode.blankLine)return R.mode.blankLine(R.state)}function Bt(e,r,R,L){for(var M=0;M<10;M++){L&&(L[0]=Re(e,R).mode);var G=e.token(r,R);if(r.pos>r.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.pos<r.ch)&&!we.eol();)we.start=we.pos,ue=Bt(G,we,ge.state),L&&Ye.push(new on(we,ue,Zt(M.mode,ge.state)));return L?Ye:new on(we,ue,ge.state)}function Lr(e,r){if(e)for(;;){var R=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!R)break;e=e.slice(0,R.index)+e.slice(R.index+R[0].length);var L=R[1]?"bgClass":"textClass";r[L]==null?r[L]=R[2]:new RegExp("(?:^|\\s)"+R[2]+"(?:$|\\s)").test(r[L])||(r[L]+=" "+R[2])}return e}function Sr(e,r,R,L,M,G,ue){var fe=R.flattenSpans;fe==null&&(fe=e.options.flattenSpans);var ge=0,we=null,Ye=new K(r,e.options.tabSize,L),qe,vt=e.options.addModeClass&&[null];for(r==""&&Lr(At(R,L.state),G);!Ye.eol();){if(Ye.pos>e.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(;ge<Ye.start;)ge=Math.min(Ye.start,ge+5e3),M(ge,we);we=qe}Ye.start=Ye.pos}for(;ge<Ye.pos;){var Ot=Math.min(Ye.pos,ge+5e3);M(Ot,we),ge=Ot}}function Un(e,r,R){for(var L,M,G=e.doc,ue=R?-1:r-(e.doc.mode.innerMode?1e3:100),fe=r;fe>ue;--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.highlightFrontier<r-10)return;for(var R=e.first,L=r-1;L>R;L--){var M=Z(e,L).stateAfter;if(M&&(!(M instanceof pe)||L+M.lookAhead<r)){R=L+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,R)}var mi=!1,Ar=!1;function fr(){mi=!0}function br(){Ar=!0}function Xr(e,r,R){this.marker=e,this.from=r,this.to=R}function Dr(e,r){if(e)for(var R=0;R<e.length;++R){var L=e[R];if(L.marker==r)return L}}function Yr(e,r){for(var R,L=0;L<e.length;++L)e[L]!=r&&(R||(R=[])).push(e[L]);return R}function gr(e,r){e.markedSpans=e.markedSpans?e.markedSpans.concat([r]):[r],r.marker.attachLine(e)}function gi(e,r,R){var L;if(e)for(var M=0;M<e.length;++M){var G=e[M],ue=G.marker,fe=G.from==null||(ue.inclusiveLeft?G.from<=r:G.from<r);if(fe||G.from==r&&ue.type=="bookmark"&&(!R||!G.marker.insertLeft)){var ge=G.to==null||(ue.inclusiveRight?G.to>=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<e.length;++M){var G=e[M],ue=G.marker,fe=G.to==null||(ue.inclusiveRight?G.to>=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.from<r);(L||(L=[])).push(new Xr(ue,ge?null:G.from-r,G.to==null?null:G.to-r))}}return L}function Pr(e,r){if(r.full)return null;var R=Pt(e,r.from.line)&&Z(e,r.from.line).markedSpans,L=Pt(e,r.to.line)&&Z(e,r.to.line).markedSpans;if(!R&&!L)return null;var M=r.from.ch,G=r.to.ch,ue=Mt(r.from,r.to)==0,fe=gi(R,M,ue),ge=si(L,G,ue),we=r.text.length==1,Ye=Ge(r.text).length+(we?M:0);if(fe)for(var qe=0;qe<fe.length;++qe){var vt=fe[qe];if(vt.to==null){var ft=Dr(ge,vt.marker);ft?we&&(vt.to=ft.to==null?null:ft.to+Ye):vt.to=M}}if(ge)for(var Ot=0;Ot<ge.length;++Ot){var Ut=ge[Ot];if(Ut.to!=null&&(Ut.to+=Ye),Ut.from==null){var Wt=Dr(fe,Ut.marker);Wt||(Ut.from=Ye,we&&(fe||(fe=[])).push(Ut))}else Ut.from+=Ye,we&&(fe||(fe=[])).push(Ut)}fe&&(fe=Fr(fe)),ge&&ge!=fe&&(ge=Fr(ge));var $t=[fe];if(!we){var rn=r.text.length-2,Jt;if(rn>0&&fe)for(var un=0;un<fe.length;++un)fe[un].to==null&&(Jt||(Jt=[])).push(new Xr(fe[un].marker,null,null));for(var An=0;An<rn;++An)$t.push(Jt);$t.push(ge)}return $t}function Fr(e){for(var r=0;r<e.length;++r){var R=e[r];R.from!=null&&R.from==R.to&&R.marker.clearWhenEmpty!==!1&&e.splice(r--,1)}return e.length?e:null}function Ei(e,r,R){var L=null;if(e.iter(r.line,R.line+1,function(ft){if(ft.markedSpans)for(var Ot=0;Ot<ft.markedSpans.length;++Ot){var Ut=ft.markedSpans[Ot].marker;Ut.readOnly&&(!L||Y(L,Ut)==-1)&&(L||(L=[])).push(Ut)}}),!L)return null;for(var M=[{from:r,to:R}],G=0;G<L.length;++G)for(var ue=L[G],fe=ue.find(0),ge=0;ge<M.length;++ge){var we=M[ge];if(Mt(we.to,fe.from)<0||Mt(we.from,fe.to)>0)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;R<r.length;++R)r[R].marker.detachLine(e);e.markedSpans=null}function di(e,r){if(!r)return;for(var R=0;R<r.length;++R)r[R].marker.attachLine(e);e.markedSpans=r}function Fn(e){return e.inclusiveLeft?-1:0}function wn(e){return e.inclusiveRight?1:0}function _r(e,r){var R=e.lines.length-r.lines.length;if(R!=0)return R;var L=e.find(),M=r.find(),G=Mt(L.from,M.from)||Fn(e)-Fn(r);if(G)return-G;var ue=Mt(L.to,M.to)||wn(e)-wn(r);return ue||r.id-e.id}function qn(e,r){var R=Ar&&e.markedSpans,L;if(R)for(var M=void 0,G=0;G<R.length;++G)M=R[G],M.marker.collapsed&&(r?M.from:M.to)==null&&(!L||_r(L,M.marker)<0)&&(L=M.marker);return L}function kr(e){return qn(e,!0)}function hr(e){return qn(e,!1)}function Ui(e,r){var R=Ar&&e.markedSpans,L;if(R)for(var M=0;M<R.length;++M){var G=R[M];G.marker.collapsed&&(G.from==null||G.from<r)&&(G.to==null||G.to>r)&&(!L||_r(L,G.marker)<0)&&(L=G.marker)}return L}function Nr(e,r,R,L,M){var G=Z(e,r),ue=Ar&&G.markedSpans;if(ue)for(var fe=0;fe<ue.length;++fe){var ge=ue[fe];if(!ge.marker.collapsed)continue;var we=ge.marker.find(0),Ye=Mt(we.from,R)||Fn(ge.marker)-Fn(M),qe=Mt(we.to,L)||wn(ge.marker)-wn(M);if(Ye>=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;M<R.length;++M){if(L=R[M],!L.marker.collapsed)continue;if(L.from==null)return!0;if(L.marker.widgetNode)continue;if(L.from==0&&L.marker.inclusiveLeft&&Pi(e,r,L))return!0}}function Pi(e,r,R){if(R.to==null){var L=R.marker.find(1,!0);return Pi(e,L.line,Dr(L.line.markedSpans,R.marker))}if(R.marker.inclusiveRight&&R.to==r.text.length)return!0;for(var M=void 0,G=0;G<r.markedSpans.length;++G)if(M=r.markedSpans[G],M.marker.collapsed&&!M.marker.widgetNode&&M.from==R.to&&(M.to==null||M.to!=R.from)&&(M.marker.inclusiveLeft||R.marker.inclusiveRight)&&Pi(e,r,M))return!0}function li(e){e=Ur(e);for(var r=0,R=e.parent,L=0;L<R.lines.length;++L){var M=R.lines[L];if(M==e)break;r+=M.height}for(var G=R.parent;G;R=G,G=R.parent)for(var ue=0;ue<G.children.length;++ue){var fe=G.children[ue];if(fe==R)break;r+=fe.height}return r}function Wi(e){if(e.height==0)return 0;for(var r=e.text.length,R,L=e;R=kr(L);){var M=R.find(0,!0);L=M.from.line,r+=M.from.ch-M.to.ch}for(L=e;R=hr(L);){var G=R.find(0,!0);r-=L.text.length-G.from.ch,L=G.to.line,r+=L.text.length-G.to.ch}return r}function Si(e){var r=e.display,R=e.doc;r.maxLine=Z(R,R.first),r.maxLineLength=Wi(r.maxLine),r.maxLineChanged=!0,R.iter(function(L){var M=Wi(L);M>r.maxLineLength&&(r.maxLineLength=M,r.maxLine=L)})}var hi=function(e,r,R){this.text=e,di(this,r),this.height=R?R(this):1};hi.prototype.lineNo=function(){return Je(this)},Me(hi);function Zi(e,r,R,L){e.text=r,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),vi(e),di(e,R);var M=L?L(e):1;M!=e.height&&Oe(e,M)}function pa(e){e.parent=null,vi(e)}var ma={},ea={};function ta(e,r){if(!e||/^\s*$/.test(e))return null;var R=r.addModeClass?ea:ma;return R[e]||(R[e]=e.replace(/\S+/g,"cm-$&"))}function $i(e,r){var R=O("span",null,null,c?"padding-right: .1px":null),L={pre:O("pre",[R],"CodeMirror-line"),content:R,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};r.measure={};for(var M=0;M<=(r.rest?r.rest.length:0);M++){var G=M?r.rest[M-1]:r.line,ue=void 0;L.pos=0,L.addToken=On,Lt(e.display.measure)&&(ue=dt(G,e.doc.direction))&&(L.addToken=qt(L.addToken,ue)),L.map=[];var fe=r!=e.display.externalMeasured&&Je(G);cr(G,L,Et(e,G,fe)),G.styleClasses&&(G.styleClasses.bgClass&&(L.bgClass=H(G.styleClasses.bgClass,L.bgClass||"")),G.styleClasses.textClass&&(L.textClass=H(G.styleClasses.textClass,L.textClass||""))),L.map.length==0&&L.map.push(0,0,L.content.appendChild(Qt(e.display.measure))),M==0?(r.measure.map=L.map,r.measure.cache={}):((r.measure.maps||(r.measure.maps=[])).push(L.map),(r.measure.caches||(r.measure.caches=[])).push({}))}if(c){var ge=L.content.lastChild;(/\bcm-tab\b/.test(ge.className)||ge.querySelector&&ge.querySelector(".cm-tab"))&&(L.content.className="cm-tab-wrap-hack")}return Qe(e,"renderLine",e,r.line,L.pre),L.pre.className&&(L.textClass=H(L.pre.className,L.textClass||"")),L}function dn(e){var r=S("span","\u2022","cm-invalidchar");return r.title="\\u"+e.charCodeAt(0).toString(16),r.setAttribute("aria-label",r.title),r}function On(e,r,R,L,M,G,ue){if(!r)return;var fe=e.splitSpaces?gn(r,e.trailingSpace):r,ge=e.cm.state.specialChars,we=!1,Ye;if(!ge.test(r))e.col+=r.length,Ye=document.createTextNode(fe),e.map.push(e.pos,e.pos+r.length,Ye),T&&C<9&&(we=!0),e.pos+=r.length;else{Ye=document.createDocumentFragment();for(var qe=0;;){ge.lastIndex=qe;var vt=ge.exec(r),ft=vt?vt.index-qe:r.length-qe;if(ft){var Ot=document.createTextNode(fe.slice(qe,qe+ft));T&&C<9?Ye.appendChild(S("span",[Ot])):Ye.appendChild(Ot),e.map.push(e.pos,e.pos+ft,Ot),e.col+=ft,e.pos+=ft}if(!vt)break;qe+=ft+1;var Ut=void 0;if(vt[0]==" "){var Wt=e.cm.options.tabSize,$t=Wt-e.col%Wt;Ut=Ye.appendChild(S("span",_e($t),"cm-tab")),Ut.setAttribute("role","presentation"),Ut.setAttribute("cm-text"," "),e.col+=$t}else vt[0]=="\r"||vt[0]==`
|
|
|
`?(Ut=Ye.appendChild(S("span",vt[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Ut.setAttribute("cm-text",vt[0]),e.col+=1):(Ut=e.cm.options.specialCharPlaceholder(vt[0]),Ut.setAttribute("cm-text",vt[0]),T&&C<9?Ye.appendChild(S("span",[Ut])):Ye.appendChild(Ut),e.col+=1);e.map.push(e.pos,e.pos+1,Ut),e.pos++}}if(e.trailingSpace=fe.charCodeAt(r.length-1)==32,R||L||M||we||G||ue){var rn=R||"";L&&(rn+=L),M&&(rn+=M);var Jt=S("span",[Ye],rn,G);if(ue)for(var un in ue)ue.hasOwnProperty(un)&&un!="style"&&un!="class"&&Jt.setAttribute(un,ue[un]);return e.content.appendChild(Jt)}e.content.appendChild(Ye)}function gn(e,r){if(e.length>1&&!/ /.test(e))return e;for(var R=r,L="",M=0;M<e.length;M++){var G=e.charAt(M);G==" "&&R&&(M==e.length-1||e.charCodeAt(M+1)==32)&&(G="\xA0"),L+=G,R=G==" "}return L}function qt(e,r){return function(R,L,M,G,ue,fe,ge){M=M?M+" cm-force-border":"cm-force-border";for(var we=R.pos,Ye=we+L.length;;){for(var qe=void 0,vt=0;vt<r.length&&!(qe=r[vt],qe.to>we&&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;ue<R.length;ue+=2)r.addToken(r,M.slice(G,G=R[ue]),ta(R[ue+1],r.cm.options));return}for(var fe=M.length,ge=0,we=1,Ye="",qe,vt,ft=0,Ot,Ut,Wt,$t,rn;;){if(ft==ge){Ot=Ut=Wt=vt="",rn=null,$t=null,ft=Infinity;for(var Jt=[],un=void 0,An=0;An<L.length;++An){var _n=L[An],Qn=_n.marker;if(Qn.type=="bookmark"&&_n.from==ge&&Qn.widgetNode)Jt.push(Qn);else if(_n.from<=ge&&(_n.to==null||_n.to>ge||Qn.collapsed&&_n.to==ge&&_n.from==ge)){if(_n.to!=null&&_n.to!=ge&&ft>_n.to&&(ft=_n.to,Ut=""),Qn.className&&(Ot+=" "+Qn.className),Qn.css&&(vt=(vt?vt+";":"")+Qn.css),Qn.startStyle&&_n.from==ge&&(Wt+=" "+Qn.startStyle),Qn.endStyle&&_n.to==ft&&(un||(un=[])).push(Qn.endStyle,_n.to),Qn.title&&((rn||(rn={})).title=Qn.title),Qn.attributes)for(var Or in Qn.attributes)(rn||(rn={}))[Or]=Qn.attributes[Or];Qn.collapsed&&(!$t||_r($t.marker,Qn)<0)&&($t=_n)}else _n.from>ge&&ft>_n.from&&(ft=_n.from)}if(un)for(var ai=0;ai<un.length;ai+=2)un[ai+1]==ft&&(Ut+=" "+un[ai]);if(!$t||$t.from==ge)for(var Br=0;Br<Jt.length;++Br)Hn(r,0,Jt[Br]);if($t&&($t.from||0)==ge){if(Hn(r,($t.to==null?fe+1:$t.to)-ge,$t.marker,$t.from==null),$t.to==null)return;$t.to==ge&&($t=!1)}}if(ge>=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;G<R;G=M){var ue=new Zn(e.doc,Z(e.doc,G),G);M=G+ue.size,L.push(ue)}return L}var Wr=null;function zn(e){Wr?Wr.ops.push(e):e.ownsGroup=Wr={ops:[e],delayedCallbacks:[]}}function gt(e){var r=e.delayedCallbacks,R=0;do{for(;R<r.length;R++)r[R].call(null);for(var L=0;L<e.ops.length;L++){var M=e.ops[L];if(M.cursorActivityHandlers)for(;M.cursorActivityCalled<M.cursorActivityHandlers.length;)M.cursorActivityHandlers[M.cursorActivityCalled++].call(null,M.cm)}}while(R<r.length)}function ct(e,r){var R=e.ownsGroup;if(!R)return;try{gt(R)}finally{Wr=null,r(R)}}var xt=null;function It(e,r){var R=tt(e,r);if(!R.length)return;var L=Array.prototype.slice.call(arguments,2),M;Wr?M=Wr.delayedCallbacks:xt?M=xt:(M=xt=[],setTimeout(sn,0));for(var G=function(fe){M.push(function(){return R[fe].apply(null,L)})},ue=0;ue<R.length;++ue)G(ue)}function sn(){var e=xt;xt=null;for(var r=0;r<e.length;++r)e[r]()}function fn(e,r,R,L){for(var M=0;M<r.changes.length;M++){var G=r.changes[M];G=="text"?wt(e,r):G=="gutter"?jt(e,r,R,L):G=="class"?ln(e,r):G=="widget"&&pn(e,r,L)}r.changes=null}function St(e){return e.node==e.text&&(e.node=S("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),T&&C<8&&(e.node.style.zIndex=2)),e.node}function _t(e,r){var R=r.bgClass?r.bgClass+" "+(r.line.bgClass||""):r.line.bgClass;if(R&&(R+=" CodeMirror-linebackground"),r.background)R?r.background.className=R:(r.background.parentNode.removeChild(r.background),r.background=null);else if(R){var L=St(r);r.background=L.insertBefore(S("div",null,R),L.firstChild),e.display.input.setUneditable(r.background)}}function Yt(e,r){var R=e.display.externalMeasured;return R&&R.line==r.line?(e.display.externalMeasured=null,r.measure=R.measure,R.built):$i(e,r)}function wt(e,r){var R=r.text.className,L=Yt(e,r);r.text==r.node&&(r.node=L.pre),r.text.parentNode.replaceChild(L.pre,r.text),r.text=L.pre,L.bgClass!=r.bgClass||L.textClass!=r.textClass?(r.bgClass=L.bgClass,r.textClass=L.textClass,ln(e,r)):R&&(r.text.className=R)}function ln(e,r){_t(e,r),r.line.wrapClass?St(r).className=r.line.wrapClass:r.node!=r.text&&(r.node.className="");var R=r.textClass?r.textClass+" "+(r.line.textClass||""):r.line.textClass;r.text.className=R||""}function jt(e,r,R,L){if(r.gutter&&(r.node.removeChild(r.gutter),r.gutter=null),r.gutterBackground&&(r.node.removeChild(r.gutterBackground),r.gutterBackground=null),r.line.gutterClass){var M=St(r);r.gutterBackground=S("div",null,"CodeMirror-gutter-background "+r.line.gutterClass,"left: "+(e.options.fixedGutter?L.fixedPos:-L.gutterTotalWidth)+"px; width: "+L.gutterTotalWidth+"px"),e.display.input.setUneditable(r.gutterBackground),M.insertBefore(r.gutterBackground,r.text)}var G=r.line.gutterMarkers;if(e.options.lineNumbers||G){var ue=St(r),fe=r.gutter=S("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?L.fixedPos:-L.gutterTotalWidth)+"px");if(e.display.input.setUneditable(fe),ue.insertBefore(fe,r.text),r.line.gutterClass&&(fe.className+=" "+r.line.gutterClass),e.options.lineNumbers&&(!G||!G["CodeMirror-linenumbers"])&&(r.lineNumber=fe.appendChild(S("div",Nt(e.options,R),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+L.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),G)for(var ge=0;ge<e.display.gutterSpecs.length;++ge){var we=e.display.gutterSpecs[ge].className,Ye=G.hasOwnProperty(we)&&G[we];Ye&&fe.appendChild(S("div",[Ye],"CodeMirror-gutter-elt","left: "+L.gutterLeft[we]+"px; width: "+L.gutterWidth[we]+"px"))}}}function pn(e,r,R){r.alignable&&(r.alignable=null);for(var L=g("CodeMirror-linewidget"),M=r.node.firstChild,G=void 0;M;M=G)G=M.nextSibling,L.test(M.className)&&r.node.removeChild(M);Dn(e,r,R)}function Yn(e,r,R,L){var M=Yt(e,r);return r.text=r.node=M.pre,M.bgClass&&(r.bgClass=M.bgClass),M.textClass&&(r.textClass=M.textClass),ln(e,r),jt(e,r,R,L),Dn(e,r,L),r.node}function Dn(e,r,R){if(En(e,r.line,r,R,!0),r.rest)for(var L=0;L<r.rest.length;L++)En(e,r.rest[L],r,R,!1)}function En(e,r,R,L,M){if(!r.widgets)return;for(var G=St(R),ue=0,fe=r.widgets;ue<fe.length;++ue){var ge=fe[ue],we=S("div",[ge.node],"CodeMirror-linewidget"+(ge.className?" "+ge.className:""));ge.handleMouseEvents||we.setAttribute("cm-ignore-events","true"),er(ge,we,R,L),e.display.input.setUneditable(we),M&&ge.above?G.insertBefore(we,R.gutter||R.text):G.appendChild(we),It(ge,"redraw")}}function er(e,r,R,L){if(e.noHScroll){(R.alignable||(R.alignable=[])).push(r);var M=L.wrapperWidth;r.style.left=L.fixedPos+"px",e.coverGutter||(M-=L.gutterTotalWidth,r.style.paddingLeft=L.gutterTotalWidth+"px"),r.style.width=M+"px"}e.coverGutter&&(r.style.zIndex=5,r.style.position="relative",e.noHScroll||(r.style.marginLeft=-L.gutterTotalWidth+"px"))}function Rn(e){if(e.height!=null)return e.height;var r=e.doc.cm;if(!r)return 0;if(!D(document.body,e.node)){var R="position: relative;";e.coverGutter&&(R+="margin-left: -"+r.display.gutters.offsetWidth+"px;"),e.noHScroll&&(R+="width: "+r.display.wrapper.clientWidth+"px;"),l(r.display.measure,S("div",[e.node],null,R))}return e.height=e.node.parentNode.offsetHeight}function Pn(e,r){for(var R=Ze(r);R!=e.wrapper;R=R.parentNode)if(!R||R.nodeType==1&&R.getAttribute("cm-ignore-events")=="true"||R.parentNode==e.sizer&&R!=e.mover)return!0}function Kn(e){return e.lineSpace.offsetTop}function Cr(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function rr(e){if(e.cachedPaddingH)return e.cachedPaddingH;var r=l(e.measure,S("pre","x","CodeMirror-line-like")),R=window.getComputedStyle?window.getComputedStyle(r):r.currentStyle,L={left:parseInt(R.paddingLeft),right:parseInt(R.paddingRight)};return!isNaN(L.left)&&!isNaN(L.right)&&(e.cachedPaddingH=L),L}function lr(e){return ee-e.display.nativeBarWidth}function pr(e){return e.display.scroller.clientWidth-lr(e)-e.display.barWidth}function Er(e){return e.display.scroller.clientHeight-lr(e)-e.display.barHeight}function ir(e,r,R){var L=e.options.lineWrapping,M=L&&pr(e);if(!r.measure.heights||L&&r.measure.width!=M){var G=r.measure.heights=[];if(L){r.measure.width=M;for(var ue=r.text.firstChild.getClientRects(),fe=0;fe<ue.length-1;fe++){var ge=ue[fe],we=ue[fe+1];Math.abs(ge.bottom-we.bottom)>2&&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;L<e.rest.length;L++)if(e.rest[L]==r)return{map:e.measure.maps[L],cache:e.measure.caches[L]};for(var M=0;M<e.rest.length;M++)if(Je(e.rest[M])>R)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<e.display.viewTo)return e.display.view[ni(e,r)];var R=e.display.externalMeasured;if(R&&r>=R.lineN&&r<R.lineN+R.size)return R}function tr(e,r){var R=Je(r),L=vn(e,R);L&&!L.text?L=null:L&&L.changes&&(fn(e,L,R,Tn(e)),e.curOp.forceUpdate=!0),L||(L=jn(e,r));var M=dr(L,r,R);return{line:r,view:L,rect:null,map:M.map,cache:M.cache,before:M.before,hasHeights:!1}}function ar(e,r,R,L,M){r.before&&(R=-1);var G=R+(L||""),ue;return r.cache.hasOwnProperty(G)?ue=r.cache[G]:(r.rect||(r.rect=r.view.text.getBoundingClientRect()),r.hasHeights||(ir(e,r.view,r.rect),r.hasHeights=!0),ue=yn(e,r,R,L),ue.bogus||(r.cache[G]=ue)),{left:ue.left,right:ue.right,top:M?ue.rtop:ue.top,bottom:M?ue.rbottom:ue.bottom}}var mr={left:0,right:0,top:0,bottom:0};function $n(e,r,R){for(var L,M,G,ue,fe,ge,we=0;we<e.length;we+=3)if(fe=e[we],ge=e[we+1],r<fe?(M=0,G=1,ue="left"):r<ge?(M=r-fe,G=M+1):(we==e.length-3||r==ge&&e[we+3]>r)&&(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<e.length-3&&e[we+3]==e[we+4]&&!e[we+5].insertLeft;)L=e[(we+=3)+2],ue="right";break}return{node:L,start:M,end:G,collapse:ue,coverStart:fe,coverEnd:ge}}function Jn(e,r){var R=mr;if(r=="left")for(var L=0;L<e.length&&!((R=e[L]).left!=R.right);L++);else for(var M=e.length-1;M>=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+fe<M.coverEnd&&k(r.line.text.charAt(M.coverStart+fe));)++fe;if(T&&C<9&&ue==0&&fe==M.coverEnd-M.coverStart?we=G.parentNode.getBoundingClientRect():we=Jn(A(G,ue,fe).getClientRects(),L),we.left||we.right||ue==0)break;fe=ue,ue=ue-1,ge="right"}T&&C<11&&(we=Ln(e.display.measure,we))}else{ue>0&&(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<Wt.length-1&&!(Ut<Wt[$t]);$t++);var rn=$t?Wt[$t-1]:0,Jt=Wt[$t],un={left:(ge=="right"?we.right:we.left)-r.rect.left,right:(ge=="left"?we.left:we.right)-r.rect.left,top:rn,bottom:Jt};return!we.left&&!we.right&&(un.bogus=!0),e.options.singleCursorHeightPerLine||(un.rtop=ft,un.rbottom=Ot),un}function Ln(e,r){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Ke(e))return r;var R=screen.logicalXDPI/screen.deviceXDPI,L=screen.logicalYDPI/screen.deviceYDPI;return{left:r.left*R,right:r.right*R,top:r.top*L,bottom:r.bottom*L}}function Kt(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var r=0;r<e.rest.length;r++)e.measure.caches[r]={}}function Xt(e){e.display.externalMeasure=null,x(e.display.lineMeasure);for(var r=0;r<e.display.view.length;r++)Kt(e.display.view[r])}function en(e){Xt(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function xn(){return d&&i?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function hn(){return d&&i?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Bn(e){var r=0;if(e.widgets)for(var R=0;R<e.widgets.length;++R)e.widgets[R].above&&(r+=Rn(e.widgets[R]));return r}function bn(e,r,R,L,M){if(!M){var G=Bn(r);R.top+=G,R.bottom+=G}if(L=="line")return R;L||(L="local");var ue=li(r);if(L=="local"?ue+=Kn(e.display):ue-=e.display.viewOffset,L=="page"||L=="window"){var fe=e.display.lineSpace.getBoundingClientRect();ue+=fe.top+(L=="window"?0:hn());var ge=fe.left+(L=="window"?0:xn());R.left+=ge,R.right+=ge}return R.top+=ue,R.bottom+=ue,R}function Mn(e,r,R){if(R=="div")return r;var L=r.left,M=r.top;if(R=="page")L-=xn(),M-=hn();else if(R=="local"||!R){var G=e.display.sizer.getBoundingClientRect();L+=G.left,M+=G.top}var ue=e.display.lineSpace.getBoundingClientRect();return{left:L-ue.left,top:M-ue.top}}function Cn(e,r,R,L,M){return L||(L=Z(e.doc,r.line)),bn(e,L,Gt(e,L,r.ch,M),R)}function Gn(e,r,R,L,M,G){L=L||Z(e.doc,r.line),M||(M=tr(e,L));function ue(Ot,Ut){var Wt=ar(e,M,Ot,Ut?"right":"left",G);return Ut?Wt.left=Wt.right:Wt.right=Wt.left,bn(e,L,Wt,R)}var fe=dt(L,e.doc.direction),ge=r.ch,we=r.sticky;if(ge>=L.text.length?(ge=L.text.length,we="before"):ge<=0&&(ge=0,we="after"),!fe)return ue(we=="before"?ge-1:ge,we=="before");function Ye(Ot,Ut,Wt){var $t=fe[Ut],rn=$t.level==1;return ue(Wt?Ot-1:Ot,rn!=Wt)}var qe=xe(fe,ge,we),vt=J,ft=Ye(ge,qe,we=="before");return vt!=null&&(ft.other=Ye(ge,vt,we!="before")),ft}function or(e,r){var R=0;r=N(e.doc,r),e.options.lineWrapping||(R=Vn(e.display)*r.ch);var L=Z(e.doc,r.line),M=li(L)+Kn(e.display);return{left:R,right:R,top:M,bottom:M+L.height}}function vr(e,r,R,L,M){var G=ht(e,r,R);return G.xRel=M,L&&(G.outside=L),G}function Rr(e,r,R){var L=e.doc;if(R+=e.display.viewOffset,R<0)return vr(L.first,0,null,-1,-1);var M=lt(L,R),G=L.first+L.size-1;if(M>G)return vr(L.first+L.size-1,Z(L,G).text.length,null,1,1);r<0&&(r=0);for(var ue=Z(L,M);;){var fe=ji(e,ue,M,r,R),ge=Ui(ue,fe.ch+(fe.xRel>0||fe.outside>0?1:0));if(!ge)return fe;var we=ge.find(1);if(we.line==M)return we;ue=Z(L,M=we.line)}}function ei(e,r,R,L){L-=Bn(r);var M=r.text.length,G=q(function(ue){return ar(e,R,ue-1).bottom<=L},M,0);return M=q(function(ue){return ar(e,R,ue).top>L},G,M),{begin:G,end:M}}function ki(e,r,R,L){R||(R=tr(e,r));var M=bn(e,r,ar(e,R,L),"line").top;return ei(e,r,R,M)}function $r(e,r,R,L){return e.bottom<=R?!1:e.top>R?!0:(L?e.left:e.right)>r}function ji(e,r,R,L,M){M-=li(r);var G=tr(e,r),ue=Bn(r),fe=0,ge=r.text.length,we=!0,Ye=dt(r,e.doc.direction);if(Ye){var qe=(e.options.lineWrapping?Hi:na)(e,r,R,G,Ye,L,M);we=qe.level!=1,fe=we?qe.from:qe.to-1,ge=we?qe.to:qe.from-1}var vt=null,ft=null,Ot=q(function(An){var _n=ar(e,G,An);return _n.top+=ue,_n.bottom+=ue,$r(_n,L,M,!1)?(_n.top<=M&&_n.left<=L&&(vt=An,ft=_n),!0):!1},fe,ge),Ut,Wt,$t=!1;if(ft){var rn=L-ft.left<ft.right-L,Jt=rn==we;Ot=vt+(Jt?0:1),Wt=Jt?"after":"before",Ut=rn?ft.left:ft.right}else{!we&&(Ot==ge||Ot==fe)&&Ot++,Wt=Ot==0?"after":Ot==r.text.length?"before":ar(e,G,Ot-(we?1:0)).bottom+ue<=M==we?"after":"before";var un=Gn(e,ht(R,Ot,Wt),"line",r,G);Ut=un.left,$t=M<un.top?-1:M>=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<M.length;vt++){var ft=M[vt];if(ft.from>=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=Ut<G?G-Ut+1e9:Ut-G;(!Ye||qe>Wt)&&(Ye=ft,qe=Wt)}return Ye||(Ye=M[M.length-1]),Ye.from<ge&&(Ye={from:ge,to:Ye.to,level:Ye.level}),Ye.to>we&&(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;ue<M.widgets.length;ue++)M.widgets[ue].height&&(G+=M.widgets[ue].height);return R?G+(Math.ceil(M.text.length/L)||1)*r:G+r}}function Hr(e){var r=e.doc,R=sr(e);r.iter(function(L){var M=R(L);M!=L.height&&Oe(L,M)})}function Nn(e,r,R,L){var M=e.display;if(!R&&Ze(r).getAttribute("cm-not-content")=="true")return null;var G,ue,fe=M.lineSpace.getBoundingClientRect();try{G=r.clientX-fe.left,ue=r.clientY-fe.top}catch(qe){return null}var ge=Rr(e,G,ue),we;if(L&&ge.xRel>0&&(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;L<R.length;L++)if(r-=R[L].size,r<0)return L}function jr(e,r,R,L){r==null&&(r=e.doc.first),R==null&&(R=e.doc.first+e.doc.size),L||(L=0);var M=e.display;if(L&&R<M.viewTo&&(M.updateLineNumbers==null||M.updateLineNumbers>r)&&(M.updateLineNumbers=r),e.curOp.viewChanged=!0,r>=M.viewTo)Ar&&Li(e.doc,r)<M.viewTo&&wi(e);else if(R<=M.viewFrom)Ar&&qi(e.doc,R+L)>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<we.lineN?we.lineN+=L:r<we.lineN+we.size&&(M.externalMeasured=null))}function Jr(e,r,R){e.curOp.viewChanged=!0;var L=e.display,M=e.display.externalMeasured;if(M&&r>=M.lineN&&r<M.lineN+M.size&&(L.externalMeasured=null),r<L.viewFrom||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;ge<M;ge++)fe+=ue[ge].size;if(fe!=r){if(L>0){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.viewFrom<r&&(L.view=L.view.slice(ni(e,r))),L.viewFrom=r,L.viewTo<R?L.view=L.view.concat(wr(e,L.viewTo,R)):L.viewTo>R&&(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<r.length;L++){var M=r[L];!M.hidden&&(!M.node||M.changes)&&++R}return R}function Sn(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Xn(e,r){r===void 0&&(r=!0);for(var R=e.doc,L={},M=L.cursors=document.createDocumentFragment(),G=L.selection=document.createDocumentFragment(),ue=0;ue<R.sel.ranges.length;ue++){if(!r&&ue==R.sel.primIndex)continue;var fe=R.sel.ranges[ue];if(fe.from().line>=e.display.viewTo||fe.to().line<e.display.viewFrom)continue;var ge=fe.empty();(ge||e.options.showCursorWhenSelecting)&&tn(e,fe.head,M),ge||Tr(e,fe,G)}return L}function tn(e,r,R){var L=Gn(e,r,"div",null,null,!e.options.singleCursorHeightPerLine),M=R.appendChild(S("div","\xA0","CodeMirror-cursor"));if(M.style.left=L.left+"px",M.style.top=L.top+"px",M.style.height=Math.max(0,L.bottom-L.top)*e.options.cursorHeight+"px",L.other){var G=R.appendChild(S("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));G.style.display="",G.style.left=L.other.left+"px",G.style.top=L.other.top+"px",G.style.height=(L.other.bottom-L.other.top)*.85+"px"}}function kn(e,r){return e.top-r.top||e.left-r.left}function Tr(e,r,R){var L=e.display,M=e.doc,G=document.createDocumentFragment(),ue=rr(e.display),fe=ue.left,ge=Math.max(L.sizerWidth,pr(e)-L.sizer.offsetLeft)-ue.right,we=M.direction=="ltr";function Ye(Jt,un,An,_n){un<0&&(un=0),un=Math.round(un),_n=Math.round(_n),G.appendChild(S("div",null,"CodeMirror-selected","position: absolute; left: "+Jt+`px;
|
|
|
top: `+un+"px; width: "+(An==null?ge-Jt:An)+`px;
|
|
|
height: `+(_n-un)+"px"))}function qe(Jt,un,An){var _n=Z(M,Jt),Qn=_n.text.length,Or,ai;function Br(Qr,Ai){return Cn(e,ht(Jt,Qr),"div",_n,Ai)}function Di(Qr,Ai,ci){var ti=ki(e,_n,null,Qr),qr=Ai=="ltr"==(ci=="after")?"left":"right",zr=ci=="after"?ti.begin:ti.end-(/\s/.test(_n.text.charAt(ti.end-1))?2:1);return Br(zr,qr)[qr]}var Ti=dt(_n,M.direction);return $(Ti,un||0,An==null?Qn:An,function(Qr,Ai,ci,ti){var qr=ci=="ltr",zr=Br(Qr,qr?"left":"right"),Oi=Br(Ai-1,qr?"right":"left"),ka=un==null&&Qr==0,fa=An==null&&Ai==Qn,pi=ti==0,Qi=!Ti||ti==Ti.length-1;if(Oi.top-zr.top<=3){var oi=(we?ka:fa)&&pi,Bo=(we?fa:ka)&&Qi,ia=oi?fe:(qr?zr:Oi).left,Ea=Bo?ge:(qr?Oi:zr).right;Ye(ia,zr.top,Ea-ia,zr.bottom)}else{var xa,_i,Ma,Fo;qr?(xa=we&&ka&&pi?fe:zr.left,_i=we?ge:Di(Qr,ci,"before"),Ma=we?fe:Di(Ai,ci,"after"),Fo=we&&fa&&Qi?ge:Oi.right):(xa=we?Di(Qr,ci,"before"):fe,_i=!we&&ka&&pi?ge:zr.right,Ma=!we&&fa&&Qi?fe:Oi.left,Fo=we?Di(Ai,ci,"after"):ge),Ye(xa,zr.top,_i-xa,zr.bottom),zr.bottom<Oi.top&&Ye(fe,zr.bottom,null,Oi.top),Ye(Ma,Oi.top,Fo-Ma,Oi.bottom)}(!Or||kn(zr,Or)<0)&&(Or=zr),kn(Oi,Or)<0&&(Or=Oi),(!ai||kn(zr,ai)<0)&&(ai=zr),kn(Oi,ai)<0&&(ai=Oi)}),{start:Or,end:ai}}var vt=r.from(),ft=r.to();if(vt.line==ft.line)qe(vt.line,vt.ch,ft.ch);else{var Ot=Z(M,vt.line),Ut=Z(M,ft.line),Wt=Ur(Ot)==Ur(Ut),$t=qe(vt.line,vt.ch,Wt?Ot.text.length+1:null).end,rn=qe(ft.line,Wt?0:null,ft.ch).start;Wt&&($t.top<rn.top-2?(Ye($t.right,$t.top,null,$t.bottom),Ye(fe,rn.top,rn.left,rn.bottom)):Ye($t.right,$t.top,rn.left-$t.right,$t.bottom)),$t.bottom<rn.top&&Ye(fe,$t.bottom,null,rn.top)}R.appendChild(G)}function Kr(e){if(!e.state.focused)return;var r=e.display;clearInterval(r.blinker);var R=!0;r.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?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<r.view.length;L++){var M=r.view[L],G=e.options.lineWrapping,ue=void 0,fe=0;if(M.hidden)continue;if(T&&C<8){var ge=M.node.offsetTop+M.node.offsetHeight;ue=ge-R,R=ge}else{var we=M.node.getBoundingClientRect();ue=we.bottom-we.top,!G&&M.text.firstChild&&(fe=M.text.firstChild.getBoundingClientRect().right-we.left-1)}var Ye=M.line.height-ue;if((Ye>.005||Ye<-.005)&&(Oe(M.line,ue),Gi(M.line),M.rest))for(var qe=0;qe<M.rest.length;qe++)Gi(M.rest[qe]);if(fe>e.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<e.widgets.length;++r){var R=e.widgets[r],L=R.node.parentNode;L&&(R.height=L.offsetHeight)}}function Fi(e,r,R){var L=R&&R.top!=null?Math.max(0,R.top):e.scroller.scrollTop;L=Math.floor(L-Kn(e));var M=R&&R.bottom!=null?R.bottom:L+e.wrapper.clientHeight,G=lt(r,L),ue=lt(r,M);if(R&&R.ensure){var fe=R.ensure.from.line,ge=R.ensure.to.line;fe<G?(G=fe,ue=lt(r,li(Z(r,fe))+e.wrapper.clientHeight)):Math.min(ge,r.lastLine())>=ue&&(G=lt(r,li(Z(r,ge))-e.wrapper.clientHeight),ue=ge)}return{from:G,to:Math.max(ue,G+1)}}function Vi(e,r){if(Xe(e,"scrollCursorIntoView"))return;var R=e.display,L=R.sizer.getBoundingClientRect(),M=null;if(r.top+L.top<0?M=!0:r.bottom+L.top>(window.innerHeight||document.documentElement.clientHeight)&&(M=!1),M!=null&&!s){var G=S("div","\u200B",null,`position: absolute;
|
|
|
top: `+(r.top-R.viewOffset-Kn(e.display))+`px;
|
|
|
height: `+(r.bottom-r.top+lr(e)+R.barHeight)+`px;
|
|
|
left: `+r.left+"px; width: "+Math.max(2,r.right-r.left)+"px;");e.display.lineSpace.appendChild(G),G.scrollIntoView(M),e.display.lineSpace.removeChild(G)}}function oa(e,r,R,L){L==null&&(L=0);var M;!e.options.lineWrapping&&r==R&&(r=r.ch?ht(r.line,r.sticky=="before"?r.ch-1:r.ch,"after"):r,R=r.sticky=="before"?ht(r.line,r.ch+1,"before"):r);for(var G=0;G<5;G++){var ue=!1,fe=Gn(e,r),ge=!R||R==r?fe:Gn(e,R);M={left:Math.min(fe.left,ge.left),top:Math.min(fe.top,ge.top)-L,right:Math.max(fe.left,ge.left),bottom:Math.max(fe.bottom,ge.bottom)+L};var we=Ji(e,M),Ye=e.doc.scrollTop,qe=e.doc.scrollLeft;if(we.scrollTop!=null&&(Ua(e,we.scrollTop),Math.abs(e.doc.scrollTop-Ye)>1&&(ue=!0)),we.scrollLeft!=null&&(va(e,we.scrollLeft),Math.abs(e.doc.scrollLeft-qe)>1&&(ue=!0)),!ue)break}return M}function sa(e,r){var R=Ji(e,r);R.scrollTop!=null&&Ua(e,R.scrollTop),R.scrollLeft!=null&&va(e,R.scrollLeft)}function Ji(e,r){var R=e.display,L=zi(e.display);r.top<0&&(r.top=0);var M=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:R.scroller.scrollTop,G=Er(e),ue={};r.bottom-r.top>G&&(r.bottom=r.top+G);var fe=e.doc.height+Cr(R),ge=r.top<L,we=r.bottom>fe-L;if(r.top<M)ue.scrollTop=ge?0:r.top;else if(r.bottom>M+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.left<vt?ue.scrollLeft=Math.max(0,r.left+qe-(Ot?0:10)):r.right>ft+vt-3&&(ue.scrollLeft=r.right+(Ot?0:10)-ft),ue}function Ia(e,r){if(r==null)return;no(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+r}function Mr(e){no(e);var r=e.getCursor();e.curOp.scrollToPos={from:r,to:r,margin:e.options.cursorScrollMargin}}function Na(e,r,R){(r!=null||R!=null)&&no(e),r!=null&&(e.curOp.scrollLeft=r),R!=null&&(e.curOp.scrollTop=R)}function Qs(e,r){no(e),e.curOp.scrollToPos=r}function no(e){var r=e.curOp.scrollToPos;if(r){e.curOp.scrollToPos=null;var R=or(e,r.from),L=or(e,r.to);Wo(e,R,L,r.margin)}}function Wo(e,r,R,L){var M=Ji(e,{left:Math.min(r.left,R.left),top:Math.min(r.top,R.top)-L,right:Math.max(r.right,R.right),bottom:Math.max(r.bottom,R.bottom)+L});Na(e,M.scrollLeft,M.scrollTop)}function Ua(e,r){if(Math.abs(e.doc.scrollTop-r)<2)return;j||_o(e,{top:r}),Ho(e,r,!0),j&&_o(e),Fa(e,100)}function Ho(e,r,R){if(r=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,r)),e.display.scroller.scrollTop==r&&!R)return;e.doc.scrollTop=r,e.display.scrollbars.setScrollTop(r),e.display.scroller.scrollTop!=r&&(e.display.scroller.scrollTop=r)}function va(e,r,R,L){if(r=Math.max(0,Math.min(r,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(R?r==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-r)<2)&&!L)return;e.doc.scrollLeft=r,Xo(e),e.display.scroller.scrollLeft!=r&&(e.display.scroller.scrollLeft=r),e.display.scrollbars.setScrollLeft(r)}function ja(e){var r=e.display,R=r.gutters.offsetWidth,L=Math.round(e.doc.height+Cr(e.display));return{clientHeight:r.scroller.clientHeight,viewHeight:r.wrapper.clientHeight,scrollWidth:r.scroller.scrollWidth,clientWidth:r.scroller.clientWidth,viewWidth:r.wrapper.clientWidth,barLeft:e.options.fixedGutter?R:0,docHeight:L,scrollHeight:L+lr(e)+r.barHeight,nativeBarWidth:r.nativeBarWidth,gutterWidth:R}}var ya=function(e,r,R){this.cm=R;var L=this.vert=S("div",[S("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),M=this.horiz=S("div",[S("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");L.tabIndex=M.tabIndex=-1,e(L),e(M),je(L,"scroll",function(){L.clientHeight&&r(L.scrollTop,"vertical")}),je(M,"scroll",function(){M.clientWidth&&r(M.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,T&&C<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};ya.prototype.update=function(e){var r=e.scrollWidth>e.clientWidth+1,R=e.scrollHeight>e.clientHeight+1,L=e.nativeBarWidth;if(R){this.vert.style.display="block",this.vert.style.bottom=r?L+"px":"0";var M=e.viewHeight-(r?L:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+M)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(r){this.horiz.style.display="block",this.horiz.style.right=R?L+"px":"0",this.horiz.style.left=e.barLeft+"px";var G=e.viewWidth-e.barLeft-(R?L:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+G)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(L==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:R?L:0,bottom:r?L:0}},ya.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},ya.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},ya.prototype.zeroWidthHack=function(){var e=t&&!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 _a(e){var r=e.curOp;r&&ct(r,function(R){for(var L=0;L<R.ops.length;L++)R.ops[L].cm.curOp=null;el(R)})}function el(e){for(var r=e.ops,R=0;R<r.length;R++)tl(r[R]);for(var L=0;L<r.length;L++)nl(r[L]);for(var M=0;M<r.length;M++)rl(r[M]);for(var G=0;G<r.length;G++)il(r[G]);for(var ue=0;ue<r.length;ue++)al(r[ue])}function tl(e){var r=e.cm,R=r.display;sl(r),e.updateMaxLine&&Si(r),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<R.viewFrom||e.scrollToPos.to.line>=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<r.doc.scrollLeft&&va(r,Math.min(r.display.scroller.scrollLeft,e.maxScrollLeft),!0),r.display.maxLineChanged=!1);var R=e.focus&&e.focus==I();e.preparedSelection&&r.display.input.showSelection(e.preparedSelection,R),(e.updatedDisplay||e.startHeight!=r.doc.height)&&Sa(r,e.barMeasure),e.updatedDisplay&&xo(r,e.barMeasure),e.selectionChanged&&Kr(r),r.state.focused&&e.updateInput&&r.display.input.reset(e.typing),R&&Gr(e.cm)}function al(e){var r=e.cm,R=r.display,L=r.doc;if(e.updatedDisplay&&Vo(r,e.update),R.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(R.wheelStartX=R.wheelStartY=null),e.scrollTop!=null&&Ho(r,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&va(r,e.scrollLeft,!0,!0),e.scrollToPos){var M=oa(r,N(L,e.scrollToPos.from),N(L,e.scrollToPos.to),e.scrollToPos.margin);Vi(r,M)}var G=e.maybeHiddenMarkers,ue=e.maybeUnhiddenMarkers;if(G)for(var fe=0;fe<G.length;++fe)G[fe].lines.length||Qe(G[fe],"hide");if(ue)for(var ge=0;ge<ue.length;++ge)ue[ge].lines.length&&Qe(ue[ge],"unhide");R.wrapper.offsetHeight&&(L.scrollTop=r.display.scroller.scrollTop),e.changeObjs&&Qe(r,"changes",r,e.changeObjs),e.update&&e.update.finish()}function Ri(e,r){if(e.curOp)return r();ba(e);try{return r()}finally{_a(e)}}function ri(e,r){return function(){if(e.curOp)return r.apply(e,arguments);ba(e);try{return r.apply(e,arguments)}finally{_a(e)}}}function bi(e){return function(){if(this.curOp)return e.apply(this,arguments);ba(this);try{return e.apply(this,arguments)}finally{_a(this)}}}function ii(e){return function(){var r=this.cm;if(!r||r.curOp)return e.apply(this,arguments);ba(r);try{return e.apply(this,arguments)}finally{_a(r)}}}function Fa(e,r){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(r,W(ol,e))}function ol(e){var r=e.doc;if(r.highlightFrontier>=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&&vt<ue.length;++vt)qe=ue[vt]!=G.styles[vt];qe&&M.push(L.line),G.stateAfter=L.save(),L.nextLine()}else G.text.length<=e.options.maxHighlightLength&&Vt(e,G.text,L),G.stateAfter=L.line%5==0?L.save():null,L.nextLine();if(+new Date>R)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<M.length;G++)Jr(e,M[G],"text")})}var ro=function(e,r,R){var L=e.display;this.viewport=r,this.visible=Fi(L,e.doc,r),this.editorIsHidden=!L.wrapper.offsetWidth,this.wrapperHeight=L.wrapper.clientHeight,this.wrapperWidth=L.wrapper.clientWidth,this.oldDisplayWidth=pr(e),this.force=R,this.dims=Tn(e),this.events=[]};ro.prototype.signal=function(e,r){Ie(e,r)&&this.events.push(arguments)},ro.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Qe.apply(null,this.events[e])};function sl(e){var r=e.display;!r.scrollbarsClipped&&r.scroller.offsetWidth&&(r.nativeBarWidth=r.scroller.offsetWidth-r.scroller.clientWidth,r.heightForcer.style.height=lr(e)+"px",r.sizer.style.marginBottom=-r.nativeBarWidth+"px",r.sizer.style.borderRightWidth=lr(e)+"px",r.scrollbarsClipped=!0)}function ll(e){if(e.hasFocus())return null;var r=I();if(!r||!D(e.display.lineDiv,r))return null;var R={activeElt:r};if(window.getSelection){var L=window.getSelection();L.anchorNode&&L.extend&&D(e.display.lineDiv,L.anchorNode)&&(R.anchorNode=L.anchorNode,R.anchorOffset=L.anchorOffset,R.focusNode=L.focusNode,R.focusOffset=L.focusOffset)}return R}function ul(e){if(!e||!e.activeElt||e.activeElt==I())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&D(document.body,e.anchorNode)&&D(document.body,e.focusNode)){var r=window.getSelection(),R=document.createRange();R.setEnd(e.anchorNode,e.anchorOffset),R.collapse(!1),r.removeAllRanges(),r.addRange(R),r.extend(e.focusNode,e.focusOffset)}}function bo(e,r){var R=e.display,L=e.doc;if(r.editorIsHidden)return wi(e),!1;if(!r.force&&r.visible.from>=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.viewFrom<G&&G-R.viewFrom<20&&(G=Math.max(L.first,R.viewFrom)),R.viewTo>ue&&R.viewTo-ue<20&&(ue=Math.min(M,R.viewTo)),Ar&&(G=Li(e.doc,G),ue=qi(e.doc,ue));var fe=G!=R.viewFrom||ue!=R.viewTo||R.lastWrapHeight!=r.wrapperHeight||R.lastWrapWidth!=r.wrapperWidth;Ki(e,G,ue),R.viewOffset=li(Z(e.doc,R.viewFrom)),e.display.mover.style.top=R.viewOffset+"px";var ge=Wn(e);if(!fe&&ge==0&&!r.force&&R.renderedView==R.view&&(R.updateLineNumbers==null||R.updateLineNumbers>=R.viewTo))return!1;var we=ll(e);return ge>4&&(R.lineDiv.style.display="none"),cl(e,R.updateLineNumbers,r.dims),ge>4&&(R.lineDiv.style.display=""),R.renderedView=R.view,ul(we),x(R.cursorDiv),x(R.selectionDiv),R.gutters.style.height=R.sizer.style.minHeight=0,fe&&(R.lastWrapHeight=r.wrapperHeight,R.lastWrapWidth=r.wrapperWidth,Fa(e,400)),R.updateLineNumbers=null,!0}function Vo(e,r){for(var R=r.viewport,L=!0;;L=!1){if(!L||!e.options.lineWrapping||r.oldDisplayWidth==pr(e)){if(R&&R.top!=null&&(R={top:Math.min(e.doc.height+Cr(e.display)-Er(e),R.top)}),r.visible=Fi(e.display,e.doc,R),r.visible.from>=e.display.viewFrom&&r.visible.to<=e.display.viewTo)break}else L&&(r.visible=Fi(e.display,e.doc,R));if(!bo(e,r))break;aa(e);var M=ja(e);Sn(e),Sa(e,M),xo(e,M),r.force=!1}r.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(r.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function _o(e,r){var R=new ro(e,r);if(bo(e,R)){aa(e),Vo(e,R);var L=ja(e);Sn(e),Sa(e,L),xo(e,L),R.finish()}}function cl(e,r,R){var L=e.display,M=e.options.lineNumbers,G=L.lineDiv,ue=G.firstChild;function fe(Ot){var Ut=Ot.nextSibling;return c&&t&&e.display.currentWheelTarget==Ot?Ot.style.display="none":Ot.parentNode.removeChild(Ot),Ut}for(var ge=L.view,we=L.viewFrom,Ye=0;Ye<ge.length;Ye++){var qe=ge[Ye];if(!qe.hidden)if(!qe.node||qe.node.parentNode!=G){var vt=Yn(e,qe,we,R);G.insertBefore(vt,ue)}else{for(;ue!=qe.node;)ue=fe(ue);var ft=M&&r!=null&&r<=we&&qe.lineNumber;qe.changes&&(Y(qe.changes,"gutter")>-1&&(ft=!1),fn(e,qe,we,R)),ft&&(x(qe.lineNumber),qe.lineNumber.appendChild(document.createTextNode(Nt(e.options,we)))),ue=qe.node.nextSibling}we+=qe.size}for(;ue;)ue=fe(ue)}function Eo(e){var r=e.gutters.offsetWidth;e.sizer.style.marginLeft=r+"px"}function xo(e,r){e.display.sizer.style.minHeight=r.docHeight+"px",e.display.heightForcer.style.top=r.docHeight+"px",e.display.gutters.style.height=r.docHeight+e.display.barHeight+lr(e)+"px"}function Xo(e){var r=e.display,R=r.view;if(!r.alignWidgets&&(!r.gutters.firstChild||!e.options.fixedGutter))return;for(var L=nr(r)-r.scroller.scrollLeft+e.doc.scrollLeft,M=r.gutters.offsetWidth,G=L+"px",ue=0;ue<R.length;ue++)if(!R[ue].hidden){e.options.fixedGutter&&(R[ue].gutter&&(R[ue].gutter.style.left=G),R[ue].gutterBackground&&(R[ue].gutterBackground.style.left=G));var fe=R[ue].alignable;if(fe)for(var ge=0;ge<fe.length;ge++)fe[ge].style.left=G}e.options.fixedGutter&&(r.gutters.style.left=L+M+"px")}function Yo(e){if(!e.options.lineNumbers)return!1;var r=e.doc,R=Nt(e.options,r.first+r.size-1),L=e.display;if(R.length!=L.lineNumChars){var M=L.measure.appendChild(S("div",[S("div",R)],"CodeMirror-linenumber CodeMirror-gutter-elt")),G=M.firstChild.offsetWidth,ue=M.offsetWidth-G;return L.lineGutter.style.width="",L.lineNumInnerWidth=Math.max(G,L.lineGutter.offsetWidth-ue)+1,L.lineNumWidth=L.lineNumInnerWidth+ue,L.lineNumChars=L.lineNumInnerWidth?R.length:-1,L.lineGutter.style.width=L.lineNumWidth+"px",Eo(e.display),!0}return!1}function So(e,r){for(var R=[],L=!1,M=0;M<e.length;M++){var G=e[M],ue=null;if(typeof G!="string"&&(ue=G.style,G=G.className),G=="CodeMirror-linenumbers")if(r)L=!0;else continue;R.push({className:G,style:ue})}return r&&!L&&R.push({className:"CodeMirror-linenumbers",style:null}),R}function $o(e){var r=e.gutters,R=e.gutterSpecs;x(r),e.lineGutter=null;for(var L=0;L<R.length;++L){var M=R[L],G=M.className,ue=M.style,fe=r.appendChild(S("div",null,"CodeMirror-gutter "+G));ue&&(fe.style.cssText=ue),G=="CodeMirror-linenumbers"&&(e.lineGutter=fe,fe.style.width=(e.lineNumWidth||1)+"px")}r.style.display=R.length?"":"none",Eo(e)}function Wa(e){$o(e.display),jr(e),Xo(e)}function dl(e,r,R,L){var M=this;this.input=R,M.scrollbarFiller=S("div",null,"CodeMirror-scrollbar-filler"),M.scrollbarFiller.setAttribute("cm-not-content","true"),M.gutterFiller=S("div",null,"CodeMirror-gutter-filler"),M.gutterFiller.setAttribute("cm-not-content","true"),M.lineDiv=O("div",null,"CodeMirror-code"),M.selectionDiv=S("div",null,null,"position: relative; z-index: 1"),M.cursorDiv=S("div",null,"CodeMirror-cursors"),M.measure=S("div",null,"CodeMirror-measure"),M.lineMeasure=S("div",null,"CodeMirror-measure"),M.lineSpace=O("div",[M.measure,M.lineMeasure,M.selectionDiv,M.cursorDiv,M.lineDiv],null,"position: relative; outline: none");var G=O("div",[M.lineSpace],"CodeMirror-lines");M.mover=S("div",[G],null,"position: relative"),M.sizer=S("div",[M.mover],"CodeMirror-sizer"),M.sizerWidth=null,M.heightForcer=S("div",null,null,"position: absolute; height: "+ee+"px; width: 1px;"),M.gutters=S("div",null,"CodeMirror-gutters"),M.lineGutter=null,M.scroller=S("div",[M.sizer,M.heightForcer,M.gutters],"CodeMirror-scroll"),M.scroller.setAttribute("tabIndex","-1"),M.wrapper=S("div",[M.scrollbarFiller,M.gutterFiller,M.scroller],"CodeMirror"),T&&C<8&&(M.gutters.style.zIndex=-1,M.scroller.style.paddingRight=0),!c&&!(j&&n)&&(M.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(M.wrapper):e(M.wrapper)),M.viewFrom=M.viewTo=r.first,M.reportedViewFrom=M.reportedViewTo=r.first,M.view=[],M.renderedView=null,M.externalMeasured=null,M.viewOffset=0,M.lastWrapHeight=M.lastWrapWidth=0,M.updateLineNumbers=null,M.nativeBarWidth=M.barHeight=M.barWidth=0,M.scrollbarsClipped=!1,M.lineNumWidth=M.lineNumInnerWidth=M.lineNumChars=null,M.alignWidgets=!1,M.cachedCharWidth=M.cachedTextHeight=M.cachedPaddingH=null,M.maxLine=null,M.maxLineLength=0,M.maxLineChanged=!1,M.wheelDX=M.wheelDY=M.wheelStartX=M.wheelStartY=null,M.shift=!1,M.selForContextMenu=null,M.activeTouch=null,M.gutterSpecs=So(L.gutters,L.lineNumbers),$o(M),R.init(M)}var io=0,Ii=null;T?Ii=-.53:j?Ii=15:d?Ii=-.7:a&&(Ii=-1/3);function Jo(e){var r=e.wheelDeltaX,R=e.wheelDeltaY;return r==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(r=e.detail),R==null&&e.detail&&e.axis==e.VERTICAL_AXIS?R=e.detail:R==null&&(R=e.wheelDelta),{x:r,y:R}}function hl(e){var r=Jo(e);return r.x*=Ii,r.y*=Ii,r}function Qo(e,r){var R=Jo(r),L=R.x,M=R.y,G=e.display,ue=G.scroller,fe=ue.scrollWidth>ue.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<Ye.length;qe++)if(Ye[qe].node==we){e.display.currentWheelTarget=we;break e}}if(L&&!j&&!o&&Ii!=null){M&&ge&&Ua(e,Math.max(0,ue.scrollTop+M*Ii)),va(e,Math.max(0,ue.scrollLeft+L*Ii)),(!M||M&&ge)&&Ee(r),G.wheelStartX=null;return}if(M&&Ii!=null){var vt=M*Ii,ft=e.doc.scrollTop,Ot=ft+G.wrapper.clientHeight;vt<0?ft=Math.max(0,ft+vt-50):Ot=Math.min(e.doc.height,Ot+vt+50),_o(e,{top:ft,bottom:Ot})}io<20&&(G.wheelStartX==null?(G.wheelStartX=ue.scrollLeft,G.wheelStartY=ue.scrollTop,G.wheelDX=L,G.wheelDY=M,setTimeout(function(){if(G.wheelStartX==null)return;var Ut=ue.scrollLeft-G.wheelStartX,Wt=ue.scrollTop-G.wheelStartY,$t=Wt&&G.wheelDY&&Wt/G.wheelDY||Ut&&G.wheelDX&&Ut/G.wheelDX;if(G.wheelStartX=G.wheelStartY=null,!$t)return;Ii=(Ii*io+$t)/(io+1),++io},200)):(G.wheelDX+=L,G.wheelDY+=M))}var Ni=function(e,r){this.ranges=e,this.primIndex=r};Ni.prototype.primary=function(){return this.ranges[this.primIndex]},Ni.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var r=0;r<this.ranges.length;r++){var R=this.ranges[r],L=e.ranges[r];if(!nn(R.anchor,L.anchor)||!nn(R.head,L.head))return!1}return!0},Ni.prototype.deepCopy=function(){for(var e=[],r=0;r<this.ranges.length;r++)e[r]=new yr(Rt(this.ranges[r].anchor),Rt(this.ranges[r].head));return new Ni(e,this.primIndex)},Ni.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Ni.prototype.contains=function(e,r){r||(r=e);for(var R=0;R<this.ranges.length;R++){var L=this.ranges[R];if(Mt(r,L.from())>=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;G<r.length;G++){var ue=r[G],fe=r[G-1],ge=Mt(fe.to(),ue.from());if(L&&!ue.empty()?ge>0: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;L<e.sel.ranges.length;L++){var M=e.sel.ranges[L];R.push(new yr(qo(M.anchor,r),qo(M.head,r)))}return Xi(e.cm,R,e.sel.primIndex)}function Zo(e,r,R){return e.line==r.line?ht(R.line,e.ch-r.ch+R.ch):ht(R.line+(e.line-r.line),e.ch)}function fl(e,r,R){for(var L=[],M=ht(e.first,0),G=M,ue=0;ue<r.length;ue++){var fe=r[ue],ge=Zo(fe.from,M,G),we=Zo(ua(fe),M,G);if(M=fe.to,G=we,R=="around"){var Ye=e.sel.ranges[ue],qe=Mt(Ye.head,Ye.anchor)<0;L[ue]=new yr(qe?we:ge,qe?ge:we)}else L[ue]=new yr(ge,ge)}return new Ni(L,e.sel.primIndex)}function Co(e){e.doc.mode=Tt(e.options,e.doc.modeOption),Ha(e)}function Ha(e){e.doc.iter(function(r){r.stateAfter&&(r.stateAfter=null),r.styles&&(r.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,Fa(e,100),e.state.modeGen++,e.curOp&&jr(e)}function es(e,r){return r.from.ch==0&&r.to.ch==0&&Ge(r.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function To(e,r,R,L){function M(rn){return R?R[rn]:null}function G(rn,Jt,un){Zi(rn,Jt,un,L),It(rn,"change",rn,r)}function ue(rn,Jt){for(var un=[],An=rn;An<Jt;++An)un.push(new hi(we[An],M(An),L));return un}var fe=r.from,ge=r.to,we=r.text,Ye=Z(e,fe.line),qe=Z(e,ge.line),vt=Ge(we),ft=M(we.length-1),Ot=ge.line-fe.line;if(r.full)e.insert(0,ue(0,we.length)),e.remove(we.length,e.size-we.length);else if(es(e,r)){var Ut=ue(0,we.length-1);G(qe,qe.text,ft),Ot&&e.remove(fe.line,Ot),Ut.length&&e.insert(fe.line,Ut)}else if(Ye==qe)if(we.length==1)G(Ye,Ye.text.slice(0,fe.ch)+vt+Ye.text.slice(ge.ch),ft);else{var Wt=ue(1,we.length-1);Wt.push(new hi(vt+Ye.text.slice(ge.ch),ft,L)),G(Ye,Ye.text.slice(0,fe.ch)+we[0],M(0)),e.insert(fe.line+1,Wt)}else if(we.length==1)G(Ye,Ye.text.slice(0,fe.ch)+we[0]+qe.text.slice(ge.ch),M(0)),e.remove(fe.line+1,Ot);else{G(Ye,Ye.text.slice(0,fe.ch)+we[0],M(0)),G(qe,vt+qe.text.slice(ge.ch),ft);var $t=ue(1,we.length-1);Ot>1&&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;fe<M.linked.length;++fe){var ge=M.linked[fe];if(ge.doc==G)continue;var we=ue&&ge.sharedHist;if(R&&!we)continue;r(ge.doc,we),L(ge.doc,M,we)}}L(e,null,!0)}function ts(e,r){if(r.cm)throw new Error("This document is already in use.");e.doc=r,r.cm=e,Hr(e),Co(e),ns(e),e.options.lineWrapping||Si(e),e.options.mode=r.modeOption,jr(e)}function ns(e){(e.doc.direction=="rtl"?B:y)(e.display.lineDiv,"CodeMirror-rtl")}function pl(e){Ri(e,function(){ns(e),jr(e)})}function ao(e){this.done=[],this.undone=[],this.undoDepth=Infinity,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function Ao(e,r){var R={from:Rt(r.from),to:ua(r),text:oe(e,r.from,r.to)};return as(e,R,r.from.line,r.to.line+1),ca(e,function(L){return as(L,R,r.from.line,r.to.line+1)},!0),R}function rs(e){for(;e.length;){var r=Ge(e);if(r.ranges)e.pop();else break}}function ml(e,r){if(r)return rs(e.done),Ge(e.done);if(e.done.length&&!Ge(e.done).ranges)return Ge(e.done);if(e.done.length>1&&!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<e.length;++R)e[R].marker.explicitlyCleared?r||(r=e.slice(0,R)):r&&r.push(e[R]);return r?r.length?r:null:e}function bl(e,r){var R=r["spans_"+e.id];if(!R)return null;for(var L=[],M=0;M<r.text.length;++M)L.push(yl(R[M]));return L}function os(e,r){var R=bl(e,r),L=Pr(e,r);if(!R)return L;if(!L)return R;for(var M=0;M<R.length;++M){var G=R[M],ue=L[M];if(G&&ue){e:for(var fe=0;fe<ue.length;++fe){for(var ge=ue[fe],we=0;we<G.length;++we)if(G[we].marker==ge.marker)continue e;G.push(ge)}}else ue&&(R[M]=ue)}return R}function wa(e,r,R){for(var L=[],M=0;M<e.length;++M){var G=e[M];if(G.ranges){L.push(R?Ni.prototype.deepCopy.call(G):G);continue}var ue=G.changes,fe=[];L.push({changes:fe});for(var ge=0;ge<ue.length;++ge){var we=ue[ge],Ye=void 0;if(fe.push({from:we.from,to:we.to,text:we.text}),r)for(var qe in we)(Ye=qe.match(/^spans_(\d+)$/))&&(Y(r,Number(Ye[1]))>-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<e.sel.ranges.length;G++)L[G]=Oo(e.sel.ranges[G],r[G],null,M);var ue=Xi(e.cm,L,e.sel.primIndex);fi(e,ue,R)}function Lo(e,r,R,L){var M=e.sel.ranges.slice(0);M[r]=R,fi(e,Xi(e.cm,M,e.sel.primIndex),L)}function ls(e,r,R,L){fi(e,la(r,R),L)}function _l(e,r,R){var L={ranges:r.ranges,update:function(M){this.ranges=[];for(var G=0;G<M.length;G++)this.ranges[G]=new yr(N(e,M[G].anchor),N(e,M[G].head))},origin:R&&R.origin};return Qe(e,"beforeSelectionChange",e,L),e.cm&&Qe(e.cm,"beforeSelectionChange",e.cm,L),L.ranges!=r.ranges?Xi(e.cm,L.ranges,L.ranges.length-1):r}function us(e,r,R){var L=e.history.done,M=Ge(L);M&&M.ranges?(L[L.length-1]=r,lo(e,r,R)):fi(e,r,R)}function fi(e,r,R){lo(e,r,R),vl(e,e.sel,e.cm?e.cm.curOp.id:NaN,R)}function lo(e,r,R){(Ie(e,"beforeSelectionChange")||e.cm&&Ie(e.cm,"beforeSelectionChange"))&&(r=_l(e,r,R));var L=R&&R.bias||(Mt(r.primary().head,e.sel.primary().head)<0?-1:1);cs(e,hs(e,r,L,!0)),!(R&&R.scroll===!1)&&e.cm&&Mr(e.cm)}function cs(e,r){if(r.equals(e.sel))return;e.sel=r,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,Be(e.cm)),It(e,"cursorActivity",e)}function ds(e){cs(e,hs(e,e.sel,null,!1))}function hs(e,r,R,L){for(var M,G=0;G<r.ranges.length;G++){var ue=r.ranges[G],fe=r.ranges.length==e.sel.ranges.length&&e.sel.ranges[G],ge=uo(e,ue.anchor,fe&&fe.anchor,R,L),we=uo(e,ue.head,fe&&fe.head,R,L);(M||ge!=ue.anchor||we!=ue.head)&&(M||(M=r.ranges.slice(0,G)),M[G]=new yr(ge,we))}return M?Xi(e.cm,M,r.primIndex):r}function Ca(e,r,R,L,M){var G=Z(e,r.line);if(G.markedSpans)for(var ue=0;ue<G.markedSpans.length;++ue){var fe=G.markedSpans[ue],ge=fe.marker,we="selectLeft"in ge?!ge.selectLeft:ge.inclusiveLeft,Ye="selectRight"in ge?!ge.selectRight:ge.inclusiveRight;if((fe.from==null||(we?fe.from<=r.ch:fe.from<r.ch))&&(fe.to==null||(Ye?fe.to>=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<e.first+e.size-1?ht(r.line+1,0):null:new ht(r.line,r.ch+R)}function ps(e){e.setSelection(ht(e.firstLine(),0),ht(e.lastLine()),de)}function ms(e,r,R){var L={canceled:!1,from:r.from,to:r.to,text:r.text,origin:r.origin,cancel:function(){return L.canceled=!0}};return R&&(L.update=function(M,G,ue,fe){M&&(L.from=N(e,M)),G&&(L.to=N(e,G)),ue&&(L.text=ue),fe!==void 0&&(L.origin=fe)}),Qe(e,"beforeChange",e,L),e.cm&&Qe(e.cm,"beforeChange",e.cm,L),L.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:L.from,to:L.to,text:L.text,origin:L.origin}}function Ta(e,r,R){if(e.cm){if(!e.cm.curOp)return ri(e.cm,Ta)(e,r,R);if(e.cm.state.suppressEdits)return}if((Ie(e,"beforeChange")||e.cm&&Ie(e.cm,"beforeChange"))&&(r=ms(e,r,!0),!r))return;var L=mi&&!R&&Ei(e,r.from,r.to);if(L)for(var M=L.length-1;M>=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&&(_s(M.history,r),L.push(M.history)),za(M,r,null,Pr(M,r))})}function co(e,r,R){var L=e.cm&&e.cm.state.suppressEdits;if(L&&!R)return;for(var M=e.history,G,ue=e.sel,fe=r=="undo"?M.done:M.undone,ge=r=="undo"?M.undone:M.done,we=0;we<fe.length&&!(G=fe[we],R?G.ranges&&!G.equals(e.sel):!G.ranges);we++);if(we==fe.length)return;for(M.lastOrigin=M.lastSelOrigin=null;;)if(G=fe.pop(),G.ranges){if(oo(G,ge),R&&!G.equals(e.sel)){fi(e,G,{clearRedo:!1});return}ue=G}else if(L){fe.push(G);return}else break;var Ye=[];oo(ue,ge),ge.push({changes:Ye,generation:M.generation}),M.generation=G.generation||++M.maxGeneration;for(var qe=Ie(e,"beforeChange")||e.cm&&Ie(e.cm,"beforeChange"),vt=function(Ut){var Wt=G.changes[Ut];if(Wt.origin=r,qe&&!ms(e,Wt,!1))return fe.length=0,{};Ye.push(Ao(e,Wt));var $t=Ut?wo(e,Wt):Ge(fe);za(e,Wt,$t,os(e,Wt)),!Ut&&e.cm&&e.cm.scrollIntoView({from:Wt.from,to:ua(Wt)});var rn=[];ca(e,function(Jt,un){!un&&Y(rn,Jt.history)==-1&&(_s(Jt.history,Wt),rn.push(Jt.history)),za(Jt,Wt,null,os(Jt,Wt))})},ft=G.changes.length-1;ft>=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;L<R.viewTo;L++)Jr(e.cm,L,"gutter")}}function za(e,r,R,L){if(e.cm&&!e.cm.curOp)return ri(e.cm,za)(e,r,R,L);if(r.to.line<e.first){vs(e,r.text.length-1-(r.to.line-r.from.line));return}if(r.from.line>e.lastLine())return;if(r.from.line<e.first){var M=r.text.length-1-(e.first-r.from.line);vs(e,M),r={from:ht(e.first,0),to:ht(r.to.line+M,r.to.ch),text:[Ge(r.text)],origin:r.origin}}var G=e.lastLine();r.to.line>G&&(r={from:r.from,to:ht(G,Z(e,G).text.length),text:[r.text[0]],origin:r.origin}),r.removed=oe(e,r.from,r.to),R||(R=wo(e,r)),e.cm?El(e.cm,r,L):To(e,r,L),lo(e,R,de),e.cantEdit&&uo(e,ht(e.firstLine(),0))&&(e.cantEdit=!1)}function El(e,r,R){var L=e.doc,M=e.display,G=r.from,ue=r.to,fe=!1,ge=G.line;e.options.lineWrapping||(ge=Je(Ur(Z(L,G.line))),L.iter(ge,ue.line+1,function(ft){if(ft==M.maxLine)return fe=!0,!0})),L.sel.contains(r.from,r.to)>-1&&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){R<e.line?e.line+=L:r<e.line&&(e.line=r,e.ch=0)}function bs(e,r,R,L){for(var M=0;M<e.length;++M){var G=e[M],ue=!0;if(G.ranges){G.copied||(G=e[M]=G.deepCopy(),G.copied=!0);for(var fe=0;fe<G.ranges.length;fe++)ys(G.ranges[fe].anchor,r,R,L),ys(G.ranges[fe].head,r,R,L);continue}for(var ge=0;ge<G.changes.length;++ge){var we=G.changes[ge];if(R<we.from.line)we.from=ht(we.from.line+L,we.from.ch),we.to=ht(we.to.line+L,we.to.ch);else if(r<=we.to.line){ue=!1;break}}ue||(e.splice(0,M+1),M=0)}}function _s(e,r){var R=r.from.line,L=r.to.line,M=r.text.length-(L-R)-1;bs(e.done,R,L,M),bs(e.undone,R,L,M)}function Ka(e,r,R,L){var M=r,G=r;return typeof r=="number"?G=Z(e,ie(e,r)):M=Je(r),M==null?null:(L(G,M)&&e.cm&&Jr(e.cm,M,R),G)}function Ga(e){this.lines=e,this.parent=null;for(var r=0,R=0;R<e.length;++R)e[R].parent=this,r+=e[R].height;this.height=r}Ga.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,r){for(var R=e,L=e+r;R<L;++R){var M=this.lines[R];this.height-=M.height,pa(M),It(M,"delete")}this.lines.splice(e,r)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,r,R){this.height+=R,this.lines=this.lines.slice(0,e).concat(r).concat(this.lines.slice(e));for(var L=0;L<r.length;++L)r[L].parent=this},iterN:function(e,r,R){for(var L=e+r;e<L;++e)if(R(this.lines[e]))return!0}};function Va(e){this.children=e;for(var r=0,R=0,L=0;L<e.length;++L){var M=e[L];r+=M.chunkSize(),R+=M.height,M.parent=this}this.size=r,this.height=R,this.parent=null}Va.prototype={chunkSize:function(){return this.size},removeInner:function(e,r){this.size-=r;for(var R=0;R<this.children.length;++R){var L=this.children[R],M=L.chunkSize();if(e<M){var G=Math.min(r,M-e),ue=L.height;if(L.removeInner(e,G),this.height-=ue-L.height,M==G&&(this.children.splice(R--,1),L.parent=null),(r-=G)==0)break;e=0}else e-=M}if(this.size-r<25&&(this.children.length>1||!(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;r<this.children.length;++r)this.children[r].collapse(e)},insertInner:function(e,r,R){this.size+=r.length,this.height+=R;for(var L=0;L<this.children.length;++L){var M=this.children[L],G=M.chunkSize();if(e<=G){if(M.insertInner(e,r,R),M.lines&&M.lines.length>50){for(var ue=M.lines.length%25+25,fe=ue;fe<M.lines.length;){var ge=new Ga(M.lines.slice(fe,fe+=25));M.height-=ge.height,this.children.splice(++L,0,ge),ge.parent=this}M.lines=M.lines.slice(0,ue),this.maybeSpill()}break}e-=G}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var r=e.children.splice(e.children.length-5,5),R=new Va(r);if(e.parent){e.size-=R.size,e.height-=R.height;var M=Y(e.parent.children,e);e.parent.children.splice(M+1,0,R)}else{var L=new Va(e.children);L.parent=e,e.children=[L,R],e=L}R.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,r,R){for(var L=0;L<this.children.length;++L){var M=this.children[L],G=M.chunkSize();if(e<G){var ue=Math.min(r,G-e);if(M.iterN(e,ue,R))return!0;if((r-=ue)==0)break;e=0}else e-=G}}};var Xa=function(e,r,R){if(R)for(var L in R)R.hasOwnProperty(L)&&(this[L]=R[L]);this.doc=e,this.node=r};Xa.prototype.clear=function(){var e=this.doc.cm,r=this.line.widgets,R=this.line,L=Je(R);if(L==null||!r)return;for(var M=0;M<r.length;++M)r[M]==this&&r.splice(M--,1);r.length||(R.widgets=null);var G=Rn(this);Oe(R,Math.max(0,R.height-G)),e&&(Ri(e,function(){Es(e,R,-G),Jr(e,L,"widget")}),It(e,"lineWidgetCleared",e,this,L))},Xa.prototype.changed=function(){var e=this,r=this.height,R=this.doc.cm,L=this.line;this.height=null;var M=Rn(this)-r;if(!M)return;xi(this.doc,L)||Oe(L,L.height+M),R&&Ri(R,function(){R.curOp.forceUpdate=!0,Es(R,L,M),It(R,"lineWidgetChanged",R,e,Je(L))})},Me(Xa);function Es(e,r,R){li(r)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Ia(e,R)}function xl(e,r,R,L){var M=new Xa(e,R,L),G=e.cm;return G&&M.noHScroll&&(G.display.alignWidgets=!0),Ka(e,r,"widget",function(ue){var fe=ue.widgets||(ue.widgets=[]);if(M.insertAt==null?fe.push(M):fe.splice(Math.min(fe.length-1,Math.max(0,M.insertAt)),0,M),M.line=ue,G&&!xi(e,ue)){var ge=li(ue)<e.scrollTop;Oe(ue,ue.height+Rn(M)),ge&&Ia(G,M.height),G.curOp.forceUpdate=!0}return!0}),G&&It(G,"lineWidgetAdded",G,M,typeof r=="number"?r:Je(r)),M}var xs=0,da=function(e,r){this.lines=[],this.type=r,this.doc=e,this.id=++xs};da.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,r=e&&!e.curOp;if(r&&ba(e),Ie(this,"clear")){var R=this.find();R&&It(this,"clear",R.from,R.to)}for(var L=null,M=null,G=0;G<this.lines.length;++G){var ue=this.lines[G],fe=Dr(ue.markedSpans,this);e&&!this.collapsed?Jr(e,Je(ue),"text"):e&&(fe.to!=null&&(M=Je(ue)),fe.from!=null&&(L=Je(ue))),ue.markedSpans=Yr(ue.markedSpans,fe),fe.from==null&&this.collapsed&&!xi(this.doc,ue)&&e&&Oe(ue,zi(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var ge=0;ge<this.lines.length;++ge){var we=Ur(this.lines[ge]),Ye=Wi(we);Ye>e.display.maxLineLength&&(e.display.maxLine=we,e.display.maxLineLength=Ye,e.display.maxLineChanged=!0)}L!=null&&e&&this.collapsed&&jr(e,L,M+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&ds(e.doc)),e&&It(e,"markerCleared",e,this,L,M),r&&_a(e),this.parent&&this.parent.clear()},da.prototype.find=function(e,r){e==null&&this.type=="bookmark"&&(e=1);for(var R,L,M=0;M<this.lines.length;++M){var G=this.lines[M],ue=Dr(G.markedSpans,this);if(ue.from!=null&&(R=ht(r?G:Je(G),ue.from),e==-1))return R;if(ue.to!=null&&(L=ht(r?G:Je(G),ue.to),e==1))return L}return R&&{from:R,to:L}},da.prototype.changed=function(){var e=this,r=this.find(-1,!0),R=this,L=this.doc.cm;if(!r||!L)return;Ri(L,function(){var M=r.line,G=Je(r.line),ue=vn(L,G);if(ue&&(Kt(ue),L.curOp.selectionChanged=L.curOp.forceUpdate=!0),L.curOp.updateMaxLine=!0,!xi(R.doc,M)&&R.height!=null){var fe=R.height;R.height=null;var ge=Rn(R)-fe;ge&&Oe(M,M.height+ge)}It(L,"markerChanged",L,e)})},da.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var r=this.doc.cm.curOp;(!r.maybeHiddenMarkers||Y(r.maybeHiddenMarkers,this)==-1)&&(r.maybeUnhiddenMarkers||(r.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},da.prototype.detachLine=function(e){if(this.lines.splice(Y(this.lines,e),1),!this.lines.length&&this.doc.cm){var r=this.doc.cm.curOp;(r.maybeHiddenMarkers||(r.maybeHiddenMarkers=[])).push(this)}},Me(da);function Oa(e,r,R,L,M){if(L&&L.shared)return Sl(e,r,R,L,M);if(e.cm&&!e.cm.curOp)return ri(e.cm,Oa)(e,r,R,L,M);var G=new da(e,M),ue=Mt(r,R);if(L&&V(L,G,!1),ue>0||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<e.length;++R)e[R].parent=this};Ya.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();It(this,"clear")},Ya.prototype.find=function(e,r){return this.primary.find(e,r)},Me(Ya);function Sl(e,r,R,L,M){L=V(L),L.shared=!1;var G=[Oa(e,r,R,L,M)],ue=G[0],fe=L.widgetNode;return ca(e,function(ge){fe&&(L.widgetNode=fe.cloneNode(!0)),G.push(Oa(ge,N(ge,r),N(ge,R),L,M));for(var we=0;we<ge.linked.length;++we)if(ge.linked[we].isParent)return;ue=Ge(G)}),new Ya(G,ue)}function Ss(e){return e.findMarks(ht(e.first,0),e.clipPos(ht(e.lastLine())),function(r){return r.parent})}function wl(e,r){for(var R=0;R<r.length;R++){var L=r[R],M=L.find(),G=e.clipPos(M.from),ue=e.clipPos(M.to);if(Mt(G,ue)){var fe=Oa(e,G,ue,L.primary,L.primary.type);L.markers.push(fe),fe.parent=L}}}function Cl(e){for(var r=function(L){var M=e[L],G=[M.primary.doc];ca(M.primary.doc,function(ge){return G.push(ge)});for(var ue=0;ue<M.markers.length;ue++){var fe=M.markers[ue];Y(G,fe.doc)==-1&&(fe.parent=null,M.markers.splice(ue--,1))}},R=0;R<e.length;R++)r(R)}var Tl=0,Ci=function(e,r,R,L,M){if(!(this instanceof Ci))return new Ci(e,r,R,L,M);R==null&&(R=0),Va.call(this,[new Ga([new hi("",null)])]),this.first=R,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=R;var G=ht(R,0);this.sel=la(G),this.history=new ao(null),this.id=++Tl,this.modeOption=r,this.lineSep=L,this.direction=M=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),To(this,{from:G,to:G,text:e}),fi(this,la(G),de)};Ci.prototype=be(Va.prototype,{constructor:Ci,iter:function(e,r,R){R?this.iterN(e-this.first,r-e,R):this.iterN(this.first,this.first+this.size,e)},insert:function(e,r){for(var R=0,L=0;L<r.length;++L)R+=r[L].height;this.insertInner(e-this.first,r,R)},remove:function(e,r){this.removeInner(e-this.first,r)},getValue:function(e){var r=he(this,this.first,this.first+this.size);return e===!1?r:r.join(e||this.lineSeparator())},setValue:ii(function(e){var r=ht(this.first,0),R=this.first+this.size-1;Ta(this,{from:r,to:ht(R,Z(this,R).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Na(this.cm,0,0),fi(this,la(r),de)}),replaceRange:function(e,r,R,L){r=N(this,r),R=R?N(this,R):r,Aa(this,e,r,R,L)},getRange:function(e,r,R){var L=oe(this,N(this,e),N(this,r));return R===!1?L:L.join(R||this.lineSeparator())},getLine:function(e){var r=this.getLineHandle(e);return r&&r.text},getLineHandle:function(e){if(Pt(this,e))return Z(this,e)},getLineNumber:function(e){return Je(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=Z(this,e)),Ur(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return N(this,e)},getCursor:function(e){var r=this.sel.primary(),R;return e==null||e=="head"?R=r.head:e=="anchor"?R=r.anchor:e=="end"||e=="to"||e===!1?R=r.to():R=r.from(),R},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:ii(function(e,r,R){ls(this,N(this,typeof e=="number"?ht(e,r||0):e),null,R)}),setSelection:ii(function(e,r,R){ls(this,N(this,e),N(this,r||e),R)}),extendSelection:ii(function(e,r,R){so(this,N(this,e),r&&N(this,r),R)}),extendSelections:ii(function(e,r){ss(this,ae(this,e),r)}),extendSelectionsBy:ii(function(e,r){var R=Ue(this.sel.ranges,e);ss(this,ae(this,R),r)}),setSelections:ii(function(e,r,R){if(!e.length)return;for(var L=[],M=0;M<e.length;M++)L[M]=new yr(N(this,e[M].anchor),N(this,e[M].head));r==null&&(r=Math.min(e.length-1,this.sel.primIndex)),fi(this,Xi(this.cm,L,r),R)}),addSelection:ii(function(e,r,R){var L=this.sel.ranges.slice(0);L.push(new yr(N(this,e),N(this,r||e))),fi(this,Xi(this.cm,L,L.length-1),R)}),getSelection:function(e){for(var r=this.sel.ranges,R,L=0;L<r.length;L++){var M=oe(this,r[L].from(),r[L].to());R=R?R.concat(M):M}return e===!1?R:R.join(e||this.lineSeparator())},getSelections:function(e){for(var r=[],R=this.sel.ranges,L=0;L<R.length;L++){var M=oe(this,R[L].from(),R[L].to());e!==!1&&(M=M.join(e||this.lineSeparator())),r[L]=M}return r},replaceSelection:function(e,r,R){for(var L=[],M=0;M<this.sel.ranges.length;M++)L[M]=e;this.replaceSelections(L,r,R||"+input")},replaceSelections:ii(function(e,r,R){for(var L=[],M=this.sel,G=0;G<M.ranges.length;G++){var ue=M.ranges[G];L[G]={from:ue.from(),to:ue.to(),text:this.splitLines(e[G]),origin:R}}for(var fe=r&&r!="end"&&fl(this,L,r),ge=L.length-1;ge>=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.done.length;L++)e.done[L].ranges||++r;for(var M=0;M<e.undone.length;M++)e.undone[M].ranges||++R;return{undo:r,redo:R}},clearHistory:function(){var e=this;this.history=new ao(this.history.maxGeneration),ca(this,function(r){return r.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:wa(this.history.done),undone:wa(this.history.undone)}},setHistory:function(e){var r=this.history=new ao(this.history.maxGeneration);r.done=wa(e.done.slice(0),null,!0),r.undone=wa(e.undone.slice(0),null,!0)},setGutterMarker:ii(function(e,r,R){return Ka(this,e,"gutter",function(L){var M=L.gutterMarkers||(L.gutterMarkers={});return M[r]=R,!R&&nt(M)&&(L.gutterMarkers=null),!0})}),clearGutter:ii(function(e){var r=this;this.iter(function(R){R.gutterMarkers&&R.gutterMarkers[e]&&Ka(r,R,"gutter",function(){return R.gutterMarkers[e]=null,nt(R.gutterMarkers)&&(R.gutterMarkers=null),!0})})}),lineInfo:function(e){var r;if(typeof e=="number"){if(!Pt(this,e))return null;if(r=e,e=Z(this,e),!e)return null}else if(r=Je(e),r==null)return null;return{line:r,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:ii(function(e,r,R){return Ka(this,e,r=="gutter"?"gutter":"class",function(L){var M=r=="text"?"textClass":r=="background"?"bgClass":r=="gutter"?"gutterClass":"wrapClass";if(!L[M])L[M]=R;else{if(g(R).test(L[M]))return!1;L[M]+=" "+R}return!0})}),removeLineClass:ii(function(e,r,R){return Ka(this,e,r=="gutter"?"gutter":"class",function(L){var M=r=="text"?"textClass":r=="background"?"bgClass":r=="gutter"?"gutterClass":"wrapClass",G=L[M];if(G)if(R==null)L[M]=null;else{var ue=G.match(g(R));if(!ue)return!1;var fe=ue.index+ue[0].length;L[M]=G.slice(0,ue.index)+(!ue.index||fe==G.length?"":" ")+G.slice(fe)||null}else return!1;return!0})}),addLineWidget:ii(function(e,r,R){return xl(this,e,r,R)}),removeLineWidget:function(e){e.clear()},markText:function(e,r,R){return Oa(this,N(this,e),N(this,r),R,R&&R.type||"range")},setBookmark:function(e,r){var R={replacedWith:r&&(r.nodeType==null?r.widget:r),insertLeft:r&&r.insertLeft,clearWhenEmpty:!1,shared:r&&r.shared,handleMouseEvents:r&&r.handleMouseEvents};return e=N(this,e),Oa(this,e,e,R,"bookmark")},findMarksAt:function(e){e=N(this,e);var r=[],R=Z(this,e.line).markedSpans;if(R)for(var L=0;L<R.length;++L){var M=R[L];(M.from==null||M.from<=e.ch)&&(M.to==null||M.to>=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<ue.length;fe++){var ge=ue[fe];!(ge.to!=null&&M==e.line&&e.ch>=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;L<R.length;++L)R[L].from!=null&&e.push(R[L].marker)}),e},posFromIndex:function(e){var r,R=this.first,L=this.lineSeparator().length;return this.iter(function(M){var G=M.text.length+L;if(G>e)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.line<this.first||e.ch<0)return 0;var R=this.lineSeparator().length;return this.iter(this.first,e.line,function(L){r+=L.text.length+R}),r},copy:function(e){var r=new Ci(he(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return r.scrollTop=this.scrollTop,r.scrollLeft=this.scrollLeft,r.sel=this.sel,r.extend=!1,e&&(r.history.undoDepth=this.history.undoDepth,r.setHistory(this.getHistory())),r},linkedDoc:function(e){e||(e={});var r=this.first,R=this.first+this.size;e.from!=null&&e.from>r&&(r=e.from),e.to!=null&&e.to<R&&(R=e.to);var L=new Ci(he(this,r,R),e.mode||this.modeOption,r,this.lineSep,this.direction);return e.sharedHist&&(L.history=this.history),(this.linked||(this.linked=[])).push({doc:L,sharedHist:e.sharedHist}),L.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],wl(L,Ss(this)),L},unlinkDoc:function(e){if(e instanceof Ir&&(e=e.doc),this.linked)for(var r=0;r<this.linked.length;++r){var R=this.linked[r];if(R.doc!=e)continue;this.linked.splice(r,1),e.unlinkDoc(this),Cl(Ss(this));break}if(e.history==this.history){var L=[e.id];ca(e,function(M){return L.push(M.id)},!0),e.history=new ao(null),e.history.done=wa(this.history.done,L),e.history.undone=wa(this.history.undone,L)}},iterLinkedDocs:function(e){ca(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):at(e)},lineSeparator:function(){return this.lineSep||`
|
|
|
`},setDirection:ii(function(e){if(e!="rtl"&&(e="ltr"),e==this.direction)return;this.direction=e,this.iter(function(r){return r.order=null}),this.cm&&pl(this.cm)})}),Ci.prototype.eachLine=Ci.prototype.iter;var ws=0;function Al(e){var r=this;if(Cs(r),Xe(r,e)||Pn(r.display,e))return;Ee(e),T&&(ws=+new Date);var R=Nn(r,e,!0),L=e.dataTransfer.files;if(!R||r.isReadOnly())return;if(L&&L.length&&window.FileReader&&window.File)for(var M=L.length,G=Array(M),ue=0,fe=function(){++ue==M&&ri(r,function(){R=N(r.doc,R);var ft={from:R,to:R,text:r.doc.splitLines(G.filter(function(Ot){return Ot!=null}).join(r.doc.lineSeparator())),origin:"paste"};Ta(r.doc,ft),us(r.doc,la(N(r.doc,R),N(r.doc,ua(ft))))})()},ge=function(ft,Ot){if(r.options.allowDropFileTypes&&Y(r.options.allowDropFileTypes,ft.type)==-1){fe();return}var Ut=new FileReader;Ut.onerror=function(){return fe()},Ut.onload=function(){var Wt=Ut.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(Wt)){fe();return}G[Ot]=Wt,fe()},Ut.readAsText(ft)},we=0;we<L.length;we++)ge(L[we],we);else{if(r.state.draggingText&&r.doc.sel.contains(R)>-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<qe.length;++vt)Aa(r.doc,"",qe[vt].anchor,qe[vt].head,"drag");r.replaceSelection(Ye,"around","paste"),r.display.input.focus()}}catch(ft){}}}function Ol(e,r){if(T&&(!e.state.draggingText||+new Date-ws<100)){Te(r);return}if(Xe(e,r)||Pn(e.display,r))return;if(r.dataTransfer.setData("Text",e.getSelection()),r.dataTransfer.effectAllowed="copyMove",r.dataTransfer.setDragImage&&!a){var R=S("img",null,null,"position: fixed; left: 0; top: 0;");R.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",o&&(R.width=R.height=1,e.display.wrapper.appendChild(R),R._top=R.offsetTop),r.dataTransfer.setDragImage(R,0,0),o&&R.parentNode.removeChild(R)}}function Ll(e,r){var R=Nn(e,r);if(!R)return;var L=document.createDocumentFragment();tn(e,R,L),e.display.dragCursor||(e.display.dragCursor=S("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),l(e.display.dragCursor,L)}function Cs(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Ts(e){if(!document.getElementsByClassName)return;for(var r=document.getElementsByClassName("CodeMirror"),R=[],L=0;L<r.length;L++){var M=r[L].CodeMirror;M&&R.push(M)}R.length&&R[0].operation(function(){for(var G=0;G<R.length;G++)e(R[G])})}var As=!1;function Rl(){if(As)return;Dl(),As=!0}function Dl(){var e;je(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,Ts(Pl)},100))}),je(window,"blur",function(){return Ts(Bi)})}function Pl(e){var r=e.display;r.cachedCharWidth=r.cachedTextHeight=r.cachedPaddingH=null,r.scrollbarsClipped=!1,e.setSize()}for(var ha={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},$a=0;$a<10;$a++)ha[$a+48]=ha[$a+96]=String($a);for(var ho=65;ho<=90;ho++)ha[ho]=String.fromCharCode(ho);for(var Ja=1;Ja<=12;Ja++)ha[Ja+111]=ha[Ja+63235]="F"+Ja;var ra={};ra.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},ra.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},ra.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},ra.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},ra.default=t?ra.macDefault:ra.pcDefault;function kl(e){var r=e.split(/-(?!$)/);e=r[r.length-1];for(var R,L,M,G,ue=0;ue<r.length-1;ue++){var fe=r[ue];if(/^(cmd|meta|m)$/i.test(fe))G=!0;else if(/^a(lt)?$/i.test(fe))R=!0;else if(/^(c|ctrl|control)$/i.test(fe))L=!0;else if(/^s(hift)?$/i.test(fe))M=!0;else throw new Error("Unrecognized modifier name: "+fe)}return R&&(e="Alt-"+e),L&&(e="Ctrl-"+e),G&&(e="Cmd-"+e),M&&(e="Shift-"+e),e}function Ml(e){var r={};for(var R in e)if(e.hasOwnProperty(R)){var L=e[R];if(/^(name|fallthrough|(de|at)tach)$/.test(R))continue;if(L=="..."){delete e[R];continue}for(var M=Ue(R.split(" "),kl),G=0;G<M.length;G++){var ue=void 0,fe=void 0;G==M.length-1?(fe=M.join(" "),ue=L):(fe=M.slice(0,G+1).join(" "),ue="...");var ge=r[fe];if(!ge)r[fe]=ue;else if(ge!=ue)throw new Error("Inconsistent bindings for "+fe)}delete e[R]}for(var we in r)e[we]=r[we];return e}function La(e,r,R,L){r=fo(r);var M=r.call?r.call(e,L):r[e];if(M===!1)return"nothing";if(M==="...")return"multi";if(M!=null&&R(M))return"handled";if(r.fallthrough){if(Object.prototype.toString.call(r.fallthrough)!="[object Array]")return La(e,r.fallthrough,R,L);for(var G=0;G<r.fallthrough.length;G++){var ue=La(e,r.fallthrough[G],R,L);if(ue)return ue}}}function Os(e){var r=typeof e=="string"?e:ha[e.keyCode];return r=="Ctrl"||r=="Alt"||r=="Shift"||r=="Mod"}function Ls(e,r,R){var L=e;return r.altKey&&L!="Alt"&&(e="Alt-"+e),(E?r.metaKey:r.ctrlKey)&&L!="Ctrl"&&(e="Ctrl-"+e),(E?r.ctrlKey:r.metaKey)&&L!="Mod"&&(e="Cmd-"+e),!R&&r.shiftKey&&L!="Shift"&&(e="Shift-"+e),e}function Rs(e,r){if(o&&e.keyCode==34&&e.char)return!1;var R=ha[e.keyCode];return R==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(R=e.code),Ls(R,e,r))}function fo(e){return typeof e=="string"?ra[e]:e}function Ra(e,r){for(var R=e.doc.sel.ranges,L=[],M=0;M<R.length;M++){for(var G=r(R[M]);L.length&&Mt(G.from,Ge(L).to)<=0;){var ue=L.pop();if(Mt(ue.from,G.from)<0){G.from=ue.from;break}}L.push(G)}Ri(e,function(){for(var fe=L.length-1;fe>=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<R.ch))return Do(r,R,L);var fe=function($t,rn){return Ro(r,$t instanceof ht?$t.ch:$t,rn)},ge,we=function($t){return e.options.lineWrapping?(ge=ge||tr(e,r),ki(e,r,ge,$t)):{begin:0,end:r.text.length}},Ye=we(R.sticky=="before"?fe(R,-1):R.ch);if(e.doc.direction=="rtl"||ue.level==1){var qe=ue.level==1==L<0,vt=fe(R,qe?1:-1);if(vt!=null&&(qe?vt<=ue.to&&vt<=Ye.end:vt>=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&&$t<M.length;$t+=rn){var An=M[$t],_n=rn>0==(An.level!=1),Qn=_n?Jt.begin:fe(Jt.end,-1);if(An.from<=Qn&&Qn<An.to)return un(Qn,_n);if(Qn=_n?An.from:fe(An.to,-1),Jt.begin<=Qn&&Qn<Jt.end)return un(Qn,_n)}},Ut=Ot(G+L,L,Ye);if(Ut)return Ut;var Wt=L>0?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.line<e.lastLine()?{from:r.head,to:ht(r.head.line+1,0)}:{from:r.head,to:ht(r.head.line,R)}}else return{from:r.from(),to:r.to()}})},deleteLine:function(e){return Ra(e,function(r){return{from:ht(r.from().line,0),to:N(e.doc,ht(r.to().line+1,0))}})},delLineLeft:function(e){return Ra(e,function(r){return{from:ht(r.from().line,0),to:r.from()}})},delWrappedLineLeft:function(e){return Ra(e,function(r){var R=e.charCoords(r.head,"div").top+5,L=e.coordsChar({left:0,top:R},"div");return{from:L,to:r.from()}})},delWrappedLineRight:function(e){return Ra(e,function(r){var R=e.charCoords(r.head,"div").top+5,L=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:R},"div");return{from:r.from(),to:L}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(ht(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(ht(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(r){return Ds(e,r.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(r){return Ps(e,r.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(r){return Nl(e,r.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(r){var R=e.cursorCoords(r.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:R},"div")},Se)},goLineLeft:function(e){return e.extendSelectionsBy(function(r){var R=e.cursorCoords(r.head,"div").top+5;return e.coordsChar({left:0,top:R},"div")},Se)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(r){var R=e.cursorCoords(r.head,"div").top+5,L=e.coordsChar({left:0,top:R},"div");return L.ch<e.getLine(L.line).search(/\S/)?Ps(e,r.head):L},Se)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var r=[],R=e.listSelections(),L=e.options.tabSize,M=0;M<R.length;M++){var G=R[M].from(),ue=X(e.getLine(G.line),G.ch,L);r.push(_e(L-ue%L))}e.replaceSelections(r)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Ri(e,function(){for(var r=e.listSelections(),R=[],L=0;L<r.length;L++){if(!r[L].empty())continue;var M=r[L].head,G=Z(e.doc,M.line).text;if(G){if(M.ch==G.length&&(M=new ht(M.line,M.ch-1)),M.ch>0)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;L<r.length;L++)e.indentLine(r[L].from().line,null,!0);Mr(e)})},openLine:function(e){return e.replaceSelection(`
|
|
|
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Ds(e,r){var R=Z(e.doc,r),L=Ur(R);return L!=R&&(r=Je(L)),Po(!0,e,L,r,1)}function Nl(e,r){var R=Z(e.doc,r),L=yi(R);return L!=R&&(r=Je(L)),Po(!0,e,R,r,-1)}function Ps(e,r){var R=Ds(e,r.line),L=Z(e.doc,R.line),M=dt(L,e.doc.direction);if(!M||M[0].level==0){var G=Math.max(R.ch,L.text.search(/\S/)),ue=r.line==R.line&&r.ch<=G&&r.ch;return ht(R.line,ue?0:G,R.sticky)}return R}function po(e,r,R){if(typeof r=="string"&&(r=Qa[r],!r))return!1;e.display.input.ensurePolled();var L=e.display.shift,M=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),R&&(e.display.shift=!1),M=r(e)!=ce}finally{e.display.shift=L,e.state.suppressEdits=!1}return M}function Ul(e,r,R){for(var L=0;L<e.state.keyMaps.length;L++){var M=La(r,e.state.keyMaps[L],R,e);if(M)return M}return e.options.extraKeys&&La(r,e.options.extraKeys,R,e)||La(r,e.options.keyMap,R,e)}var jl=new ne;function qa(e,r,R,L){var M=e.state.keySeq;if(M){if(Os(r))return"handled";if(/\'$/.test(r)?e.state.keySeq=null:jl.set(50,function(){e.state.keySeq==M&&(e.state.keySeq=null,e.display.input.reset())}),ks(e,M+" "+r,R,L))return!0}return ks(e,r,R,L)}function ks(e,r,R,L){var M=Ul(e,r,L);return M=="multi"&&(e.state.keySeq=r),M=="handled"&&It(e,"keyHandled",e,r,R),(M=="handled"||M=="multi")&&(Ee(R),Kr(e)),!!M}function Ms(e,r){var R=Rs(r,!0);return R?r.shiftKey&&!e.state.keySeq?qa(e,"Shift-"+R,r,function(L){return po(e,L,!0)})||qa(e,R,r,function(L){if(typeof L=="string"?/^go[A-Z]/.test(L):L.motion)return po(e,L)}):qa(e,R,r,function(L){return po(e,L)}):!1}function Bl(e,r,R){return qa(e,"'"+R+"'",r,function(L){return po(e,L,!0)})}var ko=null;function Is(e){var r=this;if(e.target&&e.target!=r.display.input.getField())return;if(r.curOp.focus=I(),Xe(r,e))return;T&&C<11&&e.keyCode==27&&(e.returnValue=!1);var R=e.keyCode;r.display.shift=R==16||e.shiftKey;var L=Ms(r,e);o&&(ko=L?R:null,!L&&R==88&&!st&&(t?e.metaKey:e.ctrlKey)&&r.replaceSelection("",null,"cut")),j&&!t&&!L&&R==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),R==18&&!/\bCodeMirror-crosshair\b/.test(r.display.lineDiv.className)&&Fl(r)}function Fl(e){var r=e.display.lineDiv;B(r,"CodeMirror-crosshair");function R(L){(L.keyCode==18||!L.altKey)&&(y(r,"CodeMirror-crosshair"),mt(document,"keyup",R),mt(document,"mouseover",R))}je(document,"keyup",R),je(document,"mouseover",R)}function Ns(e){e.keyCode==16&&(this.doc.sel.shift=!1),Xe(this,e)}function Us(e){var r=this;if(e.target&&e.target!=r.display.input.getField())return;if(Pn(r.display,e)||Xe(r,e)||e.ctrlKey&&!e.altKey||t&&e.metaKey)return;var R=e.keyCode,L=e.charCode;if(o&&R==ko){ko=null,Ee(e);return}if(o&&(!e.which||e.which<10)&&Ms(r,e))return;var M=String.fromCharCode(L==null?R:L);if(M=="\b")return;if(Bl(r,e,M))return;r.display.input.onKeyPress(e)}var Wl=400,Mo=function(e,r,R){this.time=e,this.pos=r,this.button=R};Mo.prototype.compare=function(e,r,R){return this.time+Wl>e&&Mt(r,this.pos)==0&&R==this.button};var Za,eo;function Hl(e,r){var R=+new Date;return eo&&eo.compare(R,e,r)?(Za=eo=null,"triple"):Za&&Za.compare(R,e,r)?(eo=new Mo(R,e,r),Za=null,"double"):(Za=new Mo(R,e,r),eo=null,"single")}function js(e){var r=this,R=r.display;if(Xe(r,e)||R.activeTouch&&R.input.supportsTouch())return;if(R.input.ensurePolled(),R.shift=e.shiftKey,Pn(R,e)){c||(R.scroller.draggable=!1,setTimeout(function(){return R.scroller.draggable=!0},100));return}if(Io(r,e))return;var L=Nn(r,e),M=ut(e),G=L?Hl(L,M):"single";if(window.focus(),M==1&&r.state.selectingText&&r.state.selectingText(e),L&&zl(r,M,L,G,e))return;M==1?L?Gl(r,L,G,e):Ze(e)==R.scroller&&Ee(e):M==2?(L&&so(r.doc,L),setTimeout(function(){return R.input.focus()},20)):M==3&&(_?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||(Ee(we),L.addNew||so(e.doc,R,null,null,L.extend),c&&!a||T&&C==9?setTimeout(function(){M.wrapper.ownerDocument.body.focus({preventScroll:!0}),M.input.focus()},20):M.input.focus())}),fe=function(we){G=G||Math.abs(r.clientX-we.clientX)+Math.abs(r.clientY-we.clientY)>=10},ge=function(){return G=!0};c&&(M.scroller.draggable=!0),e.state.draggingText=ue,ue.copy=!L.moveOnDrag,M.scroller.dragDrop&&M.scroller.dragDrop(),je(M.wrapper.ownerDocument,"mouseup",ue),je(M.wrapper.ownerDocument,"mousemove",fe),je(M.scroller,"dragstart",ge),je(M.scroller,"drop",ue),ga(e),setTimeout(function(){return M.input.focus()},20)}function Bs(e,r,R){if(R=="char")return new yr(r,r);if(R=="word")return e.findWordAt(r);if(R=="line")return new yr(ht(r.line,0),N(e.doc,ht(r.line+1,0)));var L=R(e,r);return new yr(L.from,L.to)}function Xl(e,r,R,L){var M=e.display,G=e.doc;Ee(r);var ue,fe,ge=G.sel,we=ge.ranges;if(L.addNew&&!L.extend?(fe=G.sel.contains(R),fe>-1?ue=we[fe]:ue=new yr(R,R)):(ue=G.sel.primary(),fe=G.sel.primIndex),L.unit=="rectangle")L.addNew||(ue=new yr(R,R)),R=Nn(e,r,!0,!0),fe=-1;else{var Ye=Bs(e,R,L.unit);L.extend?ue=Oo(ue,Ye.anchor,Ye.head,L.extend):ue=Ye}L.addNew?fe==-1?(fe=we.length,fi(G,Xi(e,we.concat([ue]),fe),{scroll:!1,origin:"*mouse"})):we.length>1&&we[fe].empty()&&L.unit=="char"&&!L.extend?(fi(G,Xi(e,we.slice(0,fe).concat(we.slice(fe+1)),0),{scroll:!1,origin:"*mouse"}),ge=G.sel):Lo(G,fe,ue,Ce):(fe=0,fi(G,new Ni([ue],0),Ce),ge=G.sel);var qe=R;function vt(Jt){if(Mt(qe,Jt)==0)return;if(qe=Jt,L.unit=="rectangle"){for(var un=[],An=e.options.tabSize,_n=X(Z(G,R.line).text,R.ch,An),Qn=X(Z(G,Jt.line).text,Jt.ch,An),Or=Math.min(_n,Qn),ai=Math.max(_n,Qn),Br=Math.min(R.line,Jt.line),Di=Math.min(e.lastLine(),Math.max(R.line,Jt.line));Br<=Di;Br++){var Ti=Z(G,Br).text,Qr=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 _n=Fi(M,G);(An.line>=_n.to||An.line<_n.from)&&setTimeout(ri(e,function(){Ot==un&&Ut(Jt)}),150)}else{var Qn=Jt.clientY<ft.top?-20:Jt.clientY>ft.bottom?20:0;Qn&&setTimeout(ri(e,function(){if(Ot!=un)return;M.scroller.scrollTop+=Qn,Ut(Jt)}),50)}}function Wt(Jt){e.state.selectingText=!1,Ot=Infinity,Jt&&(Ee(Jt),M.input.focus()),mt(M.wrapper.ownerDocument,"mousemove",$t),mt(M.wrapper.ownerDocument,"mouseup",rn),G.history.lastSelOrigin=null}var $t=ri(e,function(Jt){Jt.buttons===0||!ut(Jt)?Wt(Jt):Ut(Jt)}),rn=ri(e,Wt);e.state.selectingText=rn,je(M.wrapper.ownerDocument,"mousemove",$t),je(M.wrapper.ownerDocument,"mouseup",rn)}function Yl(e,r){var R=r.anchor,L=r.head,M=Z(e.doc,R.line);if(Mt(R,L)==0&&R.sticky==L.sticky)return r;var G=dt(M);if(!G)return r;var ue=xe(G,R.ch,R.sticky),fe=G[ue];if(fe.from!=R.ch&&fe.to!=R.ch)return r;var ge=ue+(fe.from==R.ch==(fe.level!=1)?0:1);if(ge==0||ge==G.length)return r;var we;if(L.line!=R.line)we=(L.line-R.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var Ye=xe(G,L.ch,L.sticky),qe=Ye-ue||(L.ch-R.ch)*(fe.level==1?-1:1);Ye==ge-1||Ye==ge?we=qe<0:we=qe>0}var vt=G[ge+(we?-1:0)],ft=we==(vt.level==1),Ot=ft?vt.from:vt.to,Ut=ft?"after":"before";return R.ch==Ot&&R.sticky==Ut?r:new yr(new ht(R.line,Ot,Ut),L)}function Fs(e,r,R,L){var M,G;if(r.touches)M=r.touches[0].clientX,G=r.touches[0].clientY;else try{M=r.clientX,G=r.clientY}catch(vt){return!1}if(M>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;L&&Ee(r);var ue=e.display,fe=ue.lineDiv.getBoundingClientRect();if(G>fe.bottom||!Ie(e,R))return Le(r);G-=fe.top-ue.viewOffset;for(var ge=0;ge<e.display.gutterSpecs.length;++ge){var we=ue.gutters.childNodes[ge];if(we&&we.getBoundingClientRect().right>=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.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;fe<No.length;++fe)No[fe](this);_a(this),c&&r.lineWrapping&&getComputedStyle(G.lineDiv).textRendering=="optimizelegibility"&&(G.lineDiv.style.textRendering="auto")}Ir.defaults=zs,Ir.optionHandlers=mo;function Zl(e){var r=e.display;je(r.scroller,"mousedown",ri(e,js)),T&&C<11?je(r.scroller,"dblclick",ri(e,function(ge){if(Xe(e,ge))return;var we=Nn(e,ge);if(!we||Io(e,ge)||Pn(e.display,ge))return;Ee(ge);var Ye=e.findWordAt(we);so(e.doc,Ye.anchor,Ye.head)})):je(r.scroller,"dblclick",function(ge){return Xe(e,ge)||Ee(ge)}),je(r.scroller,"contextmenu",function(ge){return Ws(e,ge)}),je(r.input.getField(),"contextmenu",function(ge){r.scroller.contains(ge.target)||Ws(e,ge)});var R,L={end:0};function M(){r.activeTouch&&(R=setTimeout(function(){return r.activeTouch=null},1e3),L=r.activeTouch,L.end=+new Date)}function G(ge){if(ge.touches.length!=1)return!1;var we=ge.touches[0];return we.radiusX<=1&&we.radiusY<=1}function ue(ge,we){if(we.left==null)return!0;var Ye=we.left-ge.left,qe=we.top-ge.top;return Ye*Ye+qe*qe>20*20}je(r.scroller,"touchstart",function(ge){if(!Xe(e,ge)&&!G(ge)&&!Io(e,ge)){r.input.ensurePolled(),clearTimeout(R);var we=+new Date;r.activeTouch={start:we,moved:!1,prev:we-L.end<=300?L:null},ge.touches.length==1&&(r.activeTouch.left=ge.touches[0].pageX,r.activeTouch.top=ge.touches[0].pageY)}}),je(r.scroller,"touchmove",function(){r.activeTouch&&(r.activeTouch.moved=!0)}),je(r.scroller,"touchend",function(ge){var we=r.activeTouch;if(we&&!Pn(r,ge)&&we.left!=null&&!we.moved&&new Date-we.start<300){var Ye=e.coordsChar(r.activeTouch,"page"),qe;!we.prev||ue(we,we.prev)?qe=new yr(Ye,Ye):!we.prev.prev||ue(we,we.prev.prev)?qe=e.findWordAt(Ye):qe=new yr(ht(Ye.line,0),N(e.doc,ht(Ye.line+1,0))),e.setSelection(qe.anchor,qe.head),e.focus(),Ee(ge)}M()}),je(r.scroller,"touchcancel",M),je(r.scroller,"scroll",function(){r.scroller.clientHeight&&(Ua(e,r.scroller.scrollTop),va(e,r.scroller.scrollLeft,!0),Qe(e,"scroll",e))}),je(r.scroller,"mousewheel",function(ge){return Qo(e,ge)}),je(r.scroller,"DOMMouseScroll",function(ge){return Qo(e,ge)}),je(r.wrapper,"scroll",function(){return r.wrapper.scrollTop=r.wrapper.scrollLeft=0}),r.dragFunctions={enter:function(ge){Xe(e,ge)||Te(ge)},over:function(ge){Xe(e,ge)||(Ll(e,ge),Te(ge))},start:function(ge){return Ol(e,ge)},drop:ri(e,Al),leave:function(ge){Xe(e,ge)||Cs(e)}};var fe=r.input.getField();je(fe,"keyup",function(ge){return Ns.call(e,ge)}),je(fe,"keydown",ri(e,Is)),je(fe,"keypress",ri(e,Us)),je(fe,"focus",function(ge){return mn(e,ge)}),je(fe,"blur",function(ge){return Bi(e,ge)})}var No=[];Ir.defineInitHook=function(e){return No.push(e)};function to(e,r,R,L){var M=e.doc,G;R==null&&(R="add"),R=="smart"&&(M.mode.indent?G=it(e,r).state:R="prev");var ue=e.options.tabSize,fe=Z(M,r),ge=X(fe.text,null,ue);fe.stateAfter&&(fe.stateAfter=null);var we=fe.text.match(/^\s*/)[0],Ye;if(!L&&!/\S/.test(fe.text))Ye=0,R="not";else if(R=="smart"&&(Ye=M.mode.indent(G,fe.text.slice(we.length),fe.text),Ye==ce||Ye>150)){if(!L)return;R="prev"}R=="prev"?r>M.first?Ye=X(Z(M,r-1).text,null,ue):Ye=0:R=="add"?Ye=ge+e.options.indentUnit:R=="subtract"?Ye=ge-e.options.indentUnit:typeof R=="number"&&(Ye=ge+R),Ye=Math.max(0,Ye);var qe="",vt=0;if(e.options.indentWithTabs)for(var ft=Math.floor(Ye/ue);ft;--ft)vt+=ue,qe+=" ";if(vt<Ye&&(qe+=_e(Ye-vt)),qe!=we)return Aa(M,qe,ht(r,0),ht(r,we.length),"+input"),fe.stateAfter=null,!0;for(var Ot=0;Ot<M.sel.ranges.length;Ot++){var Ut=M.sel.ranges[Ot];if(Ut.head.line==r&&Ut.head.ch<we.length){var Wt=ht(r,we.length);Lo(M,Ot,new yr(Wt,Wt));break}}}var Yi=null;function go(e){Yi=e}function Uo(e,r,R,L,M){var G=e.doc;e.display.shift=!1,L||(L=G.sel);var ue=+new Date-200,fe=M=="paste"||e.state.pasteIncoming>ue,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<Yi.text.length;Ye++)we.push(G.splitLines(Yi.text[Ye]))}}else ge.length==L.ranges.length&&e.options.pasteLinesPerSelection&&(we=Ue(ge,function($t){return[$t]}));for(var qe=e.curOp.updateInput,vt=L.ranges.length-1;vt>=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<G.electricChars.length;fe++)if(r.indexOf(G.electricChars.charAt(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;L<e.doc.sel.ranges.length;L++){var M=e.doc.sel.ranges[L].head.line,G={anchor:ht(M,0),head:ht(M+1,0)};R.push(G),r.push(e.getRange(G.anchor,G.head))}return{text:r,ranges:R}}function Xs(e,r,R,L){e.setAttribute("autocorrect",R?"":"off"),e.setAttribute("autocapitalize",L?"":"off"),e.setAttribute("spellcheck",!!r)}function Ys(){var e=S("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),r=S("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return c?e.style.width="1000px":e.setAttribute("wrap","off"),h&&(e.style.border="1px solid black"),Xs(e),r}function eu(e){var r=e.optionHandlers,R=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(L,M){var G=this.options,ue=G[L];if(G[L]==M&&L!="mode")return;G[L]=M,r.hasOwnProperty(L)&&ri(this,r[L])(this,M,ue),Qe(this,"optionChange",this,L)},getOption:function(L){return this.options[L]},getDoc:function(){return this.doc},addKeyMap:function(L,M){this.state.keyMaps[M?"push":"unshift"](fo(L))},removeKeyMap:function(L){for(var M=this.state.keyMaps,G=0;G<M.length;++G)if(M[G]==L||M[G].name==L)return M.splice(G,1),!0},addOverlay:bi(function(L,M){var G=L.token?L:e.getMode(this.options,L);if(G.startState)throw new Error("Overlays may not be stateful.");Fe(this.state.overlays,{mode:G,modeSpec:L,opaque:M&&M.opaque,priority:M&&M.priority||0},function(ue){return ue.priority}),this.state.modeGen++,jr(this)}),removeOverlay:bi(function(L){for(var M=this.state.overlays,G=0;G<M.length;++G){var ue=M[G].modeSpec;if(ue==L||typeof L=="string"&&ue.name==L){M.splice(G,1),this.state.modeGen++,jr(this);return}}}),indentLine:bi(function(L,M,G){typeof M!="string"&&typeof M!="number"&&(M==null?M=this.options.smartIndent?"smart":"prev":M=M?"add":"subtract"),Pt(this.doc,L)&&to(this,L,M,G)}),indentSelection:bi(function(L){for(var M=this.doc.sel.ranges,G=-1,ue=0;ue<M.length;ue++){var fe=M[ue];if(fe.empty())fe.head.line>G&&(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;qe<G;++qe)to(this,qe,L);var vt=this.doc.sel.ranges;ge.ch==0&&M.length==vt.length&&vt[ue].from().ch>0&&Lo(this.doc,ue,new yr(ge,vt[ue].to()),de)}}}),getTokenAt:function(L,M){return In(this,L,M)},getLineTokens:function(L,M){return In(this,ht(L),M,!0)},getTokenTypeAt:function(L){L=N(this.doc,L);var M=Et(this,Z(this.doc,L.line)),G=0,ue=(M.length-1)/2,fe=L.ch,ge;if(fe==0)ge=M[2];else for(;;){var we=G+ue>>1;if((we?M[we*2-1]:0)>=fe)ue=we;else if(M[we*2+1]<fe)G=we+1;else{ge=M[we*2+2];break}}var Ye=ge?ge.indexOf("overlay "):-1;return Ye<0?ge:Ye==0?null:ge.slice(0,Ye-1)},getModeAt:function(L){var M=this.doc.mode;return M.innerMode?e.innerMode(M,this.getTokenAt(L).state).mode:M},getHelper:function(L,M){return this.getHelpers(L,M)[0]},getHelpers:function(L,M){var G=[];if(!R.hasOwnProperty(M))return G;var ue=R[M],fe=this.getModeAt(L);if(typeof fe[M]=="string")ue[fe[M]]&&G.push(ue[fe[M]]);else if(fe[M])for(var ge=0;ge<fe[M].length;ge++){var we=ue[fe[M][ge]];we&&G.push(we)}else fe.helperType&&ue[fe.helperType]?G.push(ue[fe.helperType]):ue[fe.name]&&G.push(ue[fe.name]);for(var Ye=0;Ye<ue._global.length;Ye++){var qe=ue._global[Ye];qe.pred(fe,this)&&Y(G,qe.val)==-1&&G.push(qe.val)}return G},getStateAfter:function(L,M){var G=this.doc;return L=ie(G,L==null?G.first+G.size-1:L),it(this,L+1,M).state},cursorCoords:function(L,M){var G,ue=this.doc.sel.primary();return L==null?G=ue.head:typeof L=="object"?G=N(this.doc,L):G=L?ue.from():ue.to(),Gn(this,G,M||"page")},charCoords:function(L,M){return Cn(this,N(this.doc,L),M||"page")},coordsChar:function(L,M){return L=Mn(this,L,M||"page"),Rr(this,L.left,L.top)},lineAtHeight:function(L,M){return L=Mn(this,{top:L,left:0},M||"page").top,lt(this.doc,L+this.display.viewOffset)},heightAtLine:function(L,M,G){var ue=!1,fe;if(typeof L=="number"){var ge=this.doc.first+this.doc.size-1;L<this.doc.first?L=this.doc.first:L>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;we<M&&!(ge=jo(this.doc,ge,fe,G,ue),ge.hitSide);++we);return ge},moveH:bi(function(L,M){var G=this;this.extendSelectionsBy(function(ue){return G.display.shift||G.doc.extend||ue.empty()?jo(G.doc,ue.head,L,M,G.options.rtlMoveVisually):L<0?ue.from():ue.to()},Se)}),deleteH:bi(function(L,M){var G=this.doc.sel,ue=this.doc;G.somethingSelected()?ue.replaceSelection("",null,"+delete"):Ra(this,function(fe){var ge=jo(ue,fe.head,L,M,!1);return L<0?{from:ge,to:fe.head}:{from:fe.head,to:ge}})}),findPosV:function(L,M,G,ue){var fe=1,ge=ue;M<0&&(fe=-1,M=-M);for(var we=N(this.doc,L),Ye=0;Ye<M;++Ye){var qe=Gn(this,we,"div");if(ge==null?ge=qe.left:qe.left=ge,we=$s(this,qe,fe,G),we.hitSide)break}return we},moveV:bi(function(L,M){var G=this,ue=this.doc,fe=[],ge=!this.display.shift&&!ue.extend&&ue.sel.somethingSelected();if(ue.extendSelectionsBy(function(Ye){if(ge)return L<0?Ye.from():Ye.to();var qe=Gn(G,Ye.head,"div");Ye.goalColumn!=null&&(qe.left=Ye.goalColumn),fe.push(qe.left);var vt=$s(G,qe,L,M);return M=="page"&&Ye==ue.sel.primary()&&Ia(G,Cn(G,vt,"div").top-qe.top),vt},Se),fe.length)for(var we=0;we<ue.sel.ranges.length;we++)ue.sel.ranges[we].goalColumn=fe[we]}),findWordAt:function(L){var M=this.doc,G=Z(M,L.line).text,ue=L.ch,fe=L.ch;if(G){var ge=this.getHelper(L,"wordChars");(L.sticky=="before"||fe==G.length)&&ue?--ue:++fe;for(var we=G.charAt(ue),Ye=ze(we,ge)?function(qe){return ze(qe,ge)}:/\s/.test(we)?function(qe){return/\s/.test(qe)}:function(qe){return!/\s/.test(qe)&&!ze(qe)};ue>0&&Ye(G.charAt(ue-1));)--ue;for(;fe<G.length&&Ye(G.charAt(fe));)++fe}return new yr(ht(L.line,ue),ht(L.line,fe))},toggleOverwrite:function(L){if(L!=null&&L==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?B(this.display.cursorDiv,"CodeMirror-overwrite"):y(this.display.cursorDiv,"CodeMirror-overwrite"),Qe(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==I()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:bi(function(L,M){Na(this,L,M)}),getScrollInfo:function(){var L=this.display.scroller;return{left:L.scrollLeft,top:L.scrollTop,height:L.scrollHeight-lr(this)-this.display.barHeight,width:L.scrollWidth-lr(this)-this.display.barWidth,clientHeight:Er(this),clientWidth:pr(this)}},scrollIntoView:bi(function(L,M){L==null?(L={from:this.doc.sel.primary().head,to:null},M==null&&(M=this.options.cursorScrollMargin)):typeof L=="number"?L={from:ht(L,0),to:null}:L.from==null&&(L={from:L,to:null}),L.to||(L.to=L.from),L.margin=M||0,L.from.line!=null?Qs(this,L):Wo(this,L.from,L.to,L.margin)}),setSize:bi(function(L,M){var G=this,ue=function(ge){return typeof ge=="number"||/^\d+$/.test(String(ge))?ge+"px":ge};L!=null&&(this.display.wrapper.style.width=ue(L)),M!=null&&(this.display.wrapper.style.height=ue(M)),this.options.lineWrapping&&Xt(this);var fe=this.display.viewFrom;this.doc.iter(fe,this.display.viewTo,function(ge){if(ge.widgets){for(var we=0;we<ge.widgets.length;we++)if(ge.widgets[we].noHScroll){Jr(G,fe,"widget");break}}++fe}),this.curOp.forceUpdate=!0,Qe(this,"refresh",this)}),operation:function(L){return Ri(this,L)},startOperation:function(){return ba(this)},endOperation:function(){return _a(this)},refresh:bi(function(){var L=this.display.cachedTextHeight;jr(this),this.curOp.forceUpdate=!0,en(this),Na(this,this.doc.scrollLeft,this.doc.scrollTop),Eo(this.display),(L==null||Math.abs(L-zi(this.display))>.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||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){e.removeAllRanges();return}var G=vo(r,e.anchorNode,e.anchorOffset),ue=vo(r,e.focusNode,e.focusOffset);if(G&&!G.bad&&ue&&!ue.bad&&Mt(an(G,ue),L)==0&&Mt(cn(G,ue),M)==0)return;var fe=r.display.view,ge=L.line>=r.display.viewFrom&&Js(r,L)||{node:fe[0].measure.map[2],offset:0},we=M.line<r.display.viewTo&&Js(r,M);if(!we){var Ye=fe[fe.length-1].measure,qe=Ye.maps?Ye.maps[Ye.maps.length-1]:Ye.map;we={node:qe[qe.length-1],offset:qe[qe.length-2]-qe[qe.length-3]}}if(!ge||!we){e.removeAllRanges();return}var vt=e.rangeCount&&e.getRangeAt(0),ft;try{ft=A(ge.node,ge.offset,we.offset,we.node)}catch(Ot){}ft&&(!j&&r.state.focused?(e.collapse(ge.node,ge.offset),ft.collapsed||(e.removeAllRanges(),e.addRange(ft))):(e.removeAllRanges(),e.addRange(ft)),vt&&e.anchorNode==null?e.addRange(vt):j&&this.startGracePeriod()),this.rememberSelection()},xr.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},xr.prototype.showMultipleSelections=function(e){l(this.cm.display.cursorDiv,e.cursors),l(this.cm.display.selectionDiv,e.selection)},xr.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},xr.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var r=e.getRangeAt(0).commonAncestorContainer;return D(this.div,r)},xr.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},xr.prototype.blur=function(){this.div.blur()},xr.prototype.getField=function(){return this.div},xr.prototype.supportsTouch=function(){return!0},xr.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Ri(this.cm,function(){return e.cm.curOp.selectionChanged=!0});function r(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,r))}this.polling.set(this.cm.options.pollInterval,r)},xr.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},xr.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),r=this.cm;if(i&&d&&this.cm.display.gutterSpecs.length&&tu(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(this.composing)return;this.rememberSelection();var R=vo(r,e.anchorNode,e.anchorOffset),L=vo(r,e.focusNode,e.focusOffset);R&&L&&Ri(r,function(){fi(r.doc,la(R,L),de),(R.bad||L.bad)&&(r.curOp.selectionChanged=!0)})},xr.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,r=e.display,R=e.doc.sel.primary(),L=R.from(),M=R.to();if(L.ch==0&&L.line>e.firstLine()&&(L=ht(L.line-1,Z(e.doc,L.line-1).length)),M.ch==Z(e.doc,M.line).text.length&&M.line<e.lastLine()&&(M=ht(M.line+1,0)),L.line<r.viewFrom||M.line>r.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));Ot<un&&rn.charCodeAt(rn.length-Ot-1)==Jt.charCodeAt(Jt.length-Ot-1);)++Ot;if(qe.length==1&&vt.length==1&&ue==L.line)for(;ft&&ft>L.ch&&rn.charCodeAt(rn.length-Ot-1)==Jt.charCodeAt(Jt.length-Ot-1);)ft--,Ot++;qe[qe.length-1]=rn.slice(0,rn.length-Ot).replace(/^\u200b+/,""),qe[0]=qe[0].slice(ft).replace(/\u200b+$/,"");var An=ht(ue,ft),_n=ht(we,vt.length?Ge(vt).length-Ot:0);if(qe.length>1||qe[0]||Mt(An,_n))return Aa(e.doc,qe,An,_n,"+input"),!0},xr.prototype.ensurePolled=function(){this.forceCompositionEnd()},xr.prototype.reset=function(){this.forceCompositionEnd()},xr.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},xr.prototype.readFromDOMSoon=function(){var e=this;if(this.readDOMTimeout!=null)return;this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing)if(e.composing.done)e.composing=null;else return;e.updateFromDOM()},80)},xr.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Ri(this.cm,function(){return jr(e.cm)})},xr.prototype.setUneditable=function(e){e.contentEditable="false"},xr.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||ri(this.cm,Uo)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},xr.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},xr.prototype.onContextMenu=function(){},xr.prototype.resetPosition=function(){},xr.prototype.needsContentAttribute=!0;function Js(e,r){var R=vn(e,r.line);if(!R||R.hidden)return null;var L=Z(e.doc,r.line),M=dr(R,L,r.line),G=dt(L,e.doc.direction),ue="left";if(G){var fe=xe(G,r.ch);ue=fe%2?"right":"left"}var ge=$n(M.map,r.ch,ue);return ge.offset=ge.collapse=="right"?ge.end:ge.start,ge}function tu(e){for(var r=e;r;r=r.parentNode)if(/CodeMirror-gutter-wrapper/.test(r.className))return!0;return!1}function Pa(e,r){return r&&(e.bad=!0),e}function nu(e,r,R,L,M){var G="",ue=!1,fe=e.doc.lineSeparator(),ge=!1;function we(ft){return function(Ot){return Ot.id==ft}}function Ye(){ue&&(G+=fe,ge&&(G+=fe),ue=ge=!1)}function qe(ft){ft&&(Ye(),G+=ft)}function vt(ft){if(ft.nodeType==1){var Ot=ft.getAttribute("cm-text");if(Ot){qe(Ot);return}var Ut=ft.getAttribute("cm-marker"),Wt;if(Ut){var $t=e.findMarks(ht(L,0),ht(M+1,0),we(+Ut));$t.length&&(Wt=$t[0].find(0))&&qe(oe(e.doc,Wt.from,Wt.to).join(fe));return}if(ft.getAttribute("contenteditable")=="false")return;var rn=/^(pre|div|p|li|table|br)$/i.test(ft.nodeName);if(!/^br$/i.test(ft.nodeName)&&ft.textContent.length==0)return;rn&&Ye();for(var Jt=0;Jt<ft.childNodes.length;Jt++)vt(ft.childNodes[Jt]);/^(pre|p)$/i.test(ft.nodeName)&&(ge=!0),rn&&(ue=!0)}else ft.nodeType==3&&qe(ft.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(vt(r),r==R);)r=r.nextSibling,ge=!1;return G}function vo(e,r,R){var L;if(r==e.display.lineDiv){if(L=e.display.lineDiv.childNodes[R],!L)return Pa(e.clipPos(ht(e.display.viewTo-1)),!0);r=null,R=0}else for(L=r;;L=L.parentNode){if(!L||L==e.display.lineDiv)return null;if(L.parentNode&&L.parentNode==e.display.lineDiv)break}for(var M=0;M<e.display.view.length;M++){var G=e.display.view[M];if(G.node==L)return ru(G,r,R)}}function ru(e,r,R){var L=e.text.firstChild,M=!1;if(!r||!D(L,r))return Pa(ht(Je(e.line),0),!0);if(r==L&&(M=!0,r=L.childNodes[R],R=0,!r)){var G=e.rest?Ge(e.rest):e.line;return Pa(ht(Je(G),G.text.length),M)}var ue=r.nodeType==3?r:null,fe=r;for(!ue&&r.childNodes.length==1&&r.firstChild.nodeType==3&&(ue=r.firstChild,R&&(R=ue.nodeValue.length));fe.parentNode!=L;)fe=fe.parentNode;var ge=e.measure,we=ge.maps;function Ye(Wt,$t,rn){for(var Jt=-1;Jt<(we?we.length:0);Jt++)for(var un=Jt<0?ge.map:we[Jt],An=0;An<un.length;An+=3){var _n=un[An+2];if(_n==Wt||_n==$t){var Qn=Je(Jt<0?e.line:e.rest[Jt]),Or=un[An]+rn;return(rn<0||_n!=Wt)&&(Or=un[An+(rn?1:0)]),ht(Qn,Or)}}}var qe=Ye(ue,fe,R);if(qe)return Pa(qe,M);for(var vt=fe.nextSibling,ft=ue?ue.nodeValue.length-R:0;vt;vt=vt.nextSibling){if(qe=Ye(vt,vt.firstChild,0),qe)return Pa(ht(qe.line,qe.ch-ft),M);ft+=vt.textContent.length}for(var Ot=fe.previousSibling,Ut=R;Ot;Ot=Ot.previousSibling){if(qe=Ye(Ot,Ot.firstChild,-1),qe)return Pa(ht(qe.line,qe.ch+Ut),M);Ut+=Ot.textContent.length}}var Vr=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new ne,this.hasSelection=!1,this.composing=null};Vr.prototype.init=function(e){var r=this,R=this,L=this.cm;this.createField(e);var M=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),h&&(M.style.width="0px"),je(M,"input",function(){T&&C>=9&&r.hasSelection&&(r.hasSelection=null),R.poll()}),je(M,"paste",function(ue){if(Xe(L,ue)||Ks(ue,L))return;L.state.pasteIncoming=+new Date,R.fastPoll()});function G(ue){if(Xe(L,ue))return;if(L.somethingSelected())go({lineWise:!1,text:L.getSelections()});else if(L.options.lineWiseCopyCut){var fe=Vs(L);go({lineWise:!0,text:fe.text}),ue.type=="cut"?L.setSelections(fe.ranges,null,de):(R.prevInput="",M.value=fe.text.join(`
|
|
|
`),te(M))}else return;ue.type=="cut"&&(L.state.cutIncoming=+new Date)}je(M,"cut",G),je(M,"copy",G),je(e.scroller,"paste",function(ue){if(Pn(e,ue)||Xe(L,ue))return;if(!M.dispatchEvent){L.state.pasteIncoming=+new Date,R.focus();return}var fe=new Event("paste");fe.clipboardData=ue.clipboardData,M.dispatchEvent(fe)}),je(e.lineSpace,"selectstart",function(ue){Pn(e,ue)||Ee(ue)}),je(M,"compositionstart",function(){var ue=L.getCursor("from");R.composing&&R.composing.range.clear(),R.composing={start:ue,range:L.markText(ue,L.getCursor("to"),{className:"CodeMirror-composing"})}}),je(M,"compositionend",function(){R.composing&&(R.poll(),R.composing.range.clear(),R.composing=null)})},Vr.prototype.createField=function(e){this.wrapper=Ys(),this.textarea=this.wrapper.firstChild},Vr.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Vr.prototype.prepareSelection=function(){var e=this.cm,r=e.display,R=e.doc,L=Xn(e);if(e.options.moveInputWithCursor){var M=Gn(e,R.sel.primary().head,"div"),G=r.wrapper.getBoundingClientRect(),ue=r.lineDiv.getBoundingClientRect();L.teTop=Math.max(0,Math.min(r.wrapper.clientHeight-10,M.top+ue.top-G.top)),L.teLeft=Math.max(0,Math.min(r.wrapper.clientWidth-10,M.left+ue.left-G.left))}return L},Vr.prototype.showSelection=function(e){var r=this.cm,R=r.display;l(R.cursorDiv,e.cursors),l(R.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Vr.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var r=this.cm;if(r.somethingSelected()){this.prevInput="";var R=r.getSelection();this.textarea.value=R,r.state.focused&&te(this.textarea),T&&C>=9&&(this.hasSelection=R)}else e||(this.prevInput=this.textarea.value="",T&&C>=9&&(this.hasSelection=null))},Vr.prototype.getField=function(){return this.textarea},Vr.prototype.supportsTouch=function(){return!1},Vr.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!n||I()!=this.textarea))try{this.textarea.focus()}catch(e){}},Vr.prototype.blur=function(){this.textarea.blur()},Vr.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Vr.prototype.receivedFocus=function(){this.slowPoll()},Vr.prototype.slowPoll=function(){var e=this;if(this.pollingFast)return;this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},Vr.prototype.fastPoll=function(){var e=!1,r=this;r.pollingFast=!0;function R(){var L=r.poll();!L&&!e?(e=!0,r.polling.set(60,R)):(r.pollingFast=!1,r.slowPoll())}r.polling.set(20,R)},Vr.prototype.poll=function(){var e=this,r=this.cm,R=this.textarea,L=this.prevInput;if(this.contextMenuPending||!r.state.focused||pt(R)&&!L&&!this.composing||r.isReadOnly()||r.options.disableInput||r.state.keySeq)return!1;var M=R.value;if(M==L&&!r.somethingSelected())return!1;if(T&&C>=9&&this.hasSelection===M||t&&/[\uf700-\uf7ff]/.test(M))return r.display.input.reset(),!1;if(r.doc.sel==r.display.selForContextMenu){var G=M.charCodeAt(0);if(G==8203&&!L&&(L="\u200B"),G==8666)return this.reset(),this.cm.execCommand("undo")}for(var ue=0,fe=Math.min(L.length,M.length);ue<fe&&L.charCodeAt(ue)==M.charCodeAt(ue);)++ue;return Ri(r,function(){Uo(r,M.slice(ue),L.length-ue,null,e.composing?"*compose":null),M.length>1e3||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(),_){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=Ee,e.e_stopPropagation=Ae,e.e_stop=Te,e.addClass=B,e.contains=D,e.rmClass=y,e.keyNames=ha}Jl(Ir),eu(Ir);var ou="iter insert remove copy getEditor constructor".split(" ");for(var yo in Ci.prototype)Ci.prototype.hasOwnProperty(yo)&&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"),E=z("9kvl"),_=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"),_e=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=_e.a.Column,re=function(gt){var ct=gt.submitResult,xt=gt.submitting,It=gt.submitRecords,sn=gt.page,fn=gt.onPageChange,St=gt.topicId,_t=ct||{},Yt=_t.status,wt=_t.id,ln=_t.input,jt=_t.output,pn=_t.expected_output,Yn=_t.is_file,Dn=_t.input_file_url,En=_t.output_file_url,er=_t.expected_output_file_url,Rn=_t.error_msg,Pn=It||{},Kn=Pn.records,Cr=Pn.records_count,rr=Object(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(_.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)(En,jt)}},jt):O.Base64.decode(jt))),t.a.createElement("p",{className:"c-red"},"\u9884\u671F\u8F93\u51FA\uFF1A"),t.a.createElement("pre",null,!Yn&&O.Base64.decode(pn),Yn&&t.a.createElement("a",{style:{fontSize:"16px"},onClick:function(){return Object(me.w)(er,pn)}},pn))):null):null,(Kn==null?void 0:Kn.length)>0?t.a.createElement(_e.a,{dataSource:Kn,rowKey:"id",pagination:!1},t.a.createElement(nt,{title:"\u63D0\u4EA4\u65F6\u95F4",dataIndex:"created_at",key:"created_at",render:function(Er,ir){return t.a.createElement("span",null," ",ze()(Er).format("YYYY-MM-DD HH:mm:ss"))}}),t.a.createElement(nt,{title:"\u63D0\u4EA4\u7ED3\u679C",dataIndex:"status",key:"status",render:function(Er,ir){var dr;return t.a.createElement(_.a,{className:Er===0?"c-green":"c-red",to:"/problems/".concat(St,"/record-detail/").concat(ir.id,"?backId=").concat(rr==null?void 0:rr.save_identifier)},(dr=B.a[Er])===null||dr===void 0?void 0:dr.replace("\u8C03\u8BD5","\u8BC4\u6D4B"))}}),t.a.createElement(nt,{title:"\u6267\u884C\u7528\u65F6 (S)",dataIndex:"execute_time",key:"execute_time"}),t.a.createElement(nt,{title:"\u5185\u5B58\u6D88\u8017\uFF08MB\uFF09",dataIndex:"execute_memory",key:"execute_memory"}),t.a.createElement(nt,{title:"\u8BED\u8A00",dataIndex:"language",key:"language"})):null,Cr>15?t.a.createElement(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,_t=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,En=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 Ee(gt){return Object(Me.c)("comments.json",gt)}function Ae(gt){return Object(Me.f)("/discusses/".concat(gt,"/plus.json"),{container_type:"Discuss",type:1})}function Le(gt){return Object(Me.f)("comments/reply.json",gt)}function Te(gt){return Object(Me.f)("comments.json",gt)}function Ze(gt){return Object(Me.f)("comments/".concat(gt==null?void 0:gt.id,"/hidden.json"),gt)}function ut(gt){return Object(Me.b)("comments/".concat(gt==null?void 0:gt.id,".json"))}var 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,_t=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||_t||St.user_id===sn.user_id;return t.a.createElement("div",{className:"discuss-item-container second-discuss "},t.a.createElement(bt,{author:St}),t.a.createElement("section",null,t.a.createElement("div",{className:"discuss-info"},t.a.createElement("a",{href:"/users/".concat(St.login),target:"_blank"},St.name),t.a.createElement("span",{className:"grey"},ln),t.a.createElement("div",{className:"btn-group",style:{marginBottom:0}},pn?t.a.createElement("a",{onClick:jt,title:"\u5220\u9664"},t.a.createElement("i",{className:"iconfont icon-shanchu"})):null)),t.a.createElement(dt.a,{className:"discuss-content",value:Yt})))}var at=function(gt){var ct=gt.user,xt=gt.data,It=gt.index,sn=gt.onPlusDiscuss,fn=gt.onSetActionType,St=gt.activeDiscussIndex,_t=gt.onReplyDiscuss,Yt=gt.onSetActiveDiscussIndex,wt=xt.content,ln=xt.children,jt=xt.hidden,pn=xt.id,Yn=xt.praise_count,Dn=xt.time,En=xt.user_praise,er=xt.can_delete,Rn=xt.author;console.log(er&&(!ln||ln.length==0),"children22");function Pn(){Yt(pn)}function Kn(){sn(pn,!En,It)}function Cr(){fn({id:pn,index:It,type:"delete-discuss",message:"\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417"})}function rr(){fn({id:pn,index:It,params:{hidden:jt?"0":"1"},type:"hidden-discuss",message:jt?"\u786E\u5B9A\u8981\u53D6\u6D88\u9690\u85CF\u8BE5\u6761\u56DE\u590D\u5417":"\u786E\u5B9A\u8981\u9690\u85CF\u8BE5\u6761\u56DE\u590D\u5417"})}var lr=ct.admin||ct.user_id===Rn.user_id;return t.a.createElement("div",{className:"discuss-item-container",key:pn},t.a.createElement(bt,{author:Rn}),t.a.createElement("section",null,t.a.createElement("div",{className:"discuss-info"},t.a.createElement("a",{href:"/users/".concat(Rn.login),target:"_blank"}," ",Rn.name," "),t.a.createElement("span",{className:"grey"},Dn)),t.a.createElement(dt.a,{className:"discuss-content",value:wt}),ln&&ln.length>0?t.a.createElement("div",{className:"reply-discuss-container"},ln.map(function(pr,Er){return t.a.createElement(Lt,{key:pr.id,data:pr,index:Er,user:ct,onSetActionType:fn,parentDiscussIndex:It})})):null,t.a.createElement("div",{className:"btn-group"},Object(Qt.w)()?t.a.createElement("a",{onClick:rr,title:jt?"\u53D6\u6D88\u9690\u85CF":"\u9690\u85CF\u8BC4\u8BBA"},t.a.createElement("i",{className:jt?"iconfont icon-yincangbiyan":"fa fa-eye"})):null,er&&(!ln||ln.length==0)?t.a.createElement("a",{onClick:Cr,title:"\u5220\u9664"},t.a.createElement("i",{className:"iconfont icon-shanchu"})):null,t.a.createElement("a",{onClick:Pn,title:"\u56DE\u590D"}," ",t.a.createElement("i",{className:"iconfont icon-huifu1"})," "),t.a.createElement("a",{onClick:Kn,className:En?"c-orange":""},t.a.createElement("i",{className:En?"iconfont icon-dianzan mr3":"iconfont icon-dianzan-xian mr3 "}),t.a.createElement("span",null,Yn||""))),t.a.createElement(Ht.a,{id:pn,activeDiscussIndex:St,onReplyDiscuss:_t})))},pt=z("kaH+"),st=z("Wx9E"),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),_t=Object(o.a)(St,2),Yt=_t[0],wt=_t[1],ln=Object(n.useState)(""),jt=Object(o.a)(ln,2),pn=jt[0],Yn=jt[1];function Dn(Kn){Yn(Kn)}function En(){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:En}),t.a.createElement("a",{style:{alignItems:"center"}}," ",t.a.createElement("i",{className:"iconfont icon-huifu1"})," \xA0 \xA0",fn," "),t.a.createElement("a",{className:"c-light-black",onClick:It,style:{alignItems:"center"},title:ct?"\u53D6\u6D88\u70B9\u8D5E":"\u70B9\u8D5E"},t.a.createElement("i",{className:"mr3 ".concat(ct?"iconfont icon-dianzan c-orange":"iconfont icon-dianzan-xian"," ")}),xt?t.a.createElement("span",null,xt):"")),Yt?t.a.createElement("div",{className:"input-mask",onClick:er}):null,t.a.createElement("div",{className:Yt?"md-container":"md-container hide"},t.a.createElement(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),_t=Object(o.a)(St,2),Yt=_t[0],wt=_t[1],ln=Yt.loading,jt=Yt.page,pn=Yt.data,Yn=Yt.count,Dn=Yt.actionType,En=Yt.activeDiscussIndex,er=Object(n.useCallback)(Object(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,Ee({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){En===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 Er(){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:En})}),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:Er},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,_t=ct.data,Yt=ct.active,wt=ct.showLine;return t.a.createElement(t.a.Fragment,null,t.a.createElement("div",{className:Yt===(_t==null?void 0:_t.id)?"".concat(zt.a.list," ").concat(zt.a.active):zt.a.list,style:It,onClick:function(){return sn(_t)}},(_t==null?void 0:_t.video)&&t.a.createElement("div",{className:zt.a.left},t.a.createElement("img",{src:_t==null?void 0:_t.video_cover}),t.a.createElement("div",null,t.a.createElement("img",{src:Re.a}),t.a.createElement("span",null,_t==null?void 0:_t.video_duration)),t.a.createElement("div",{className:zt.a.mask})),t.a.createElement("div",{className:zt.a.right},t.a.createElement("div",{className:zt.a.name},t.a.createElement("img",{src:x.a.IMG_SERVER+"/images/"+(_t==null?void 0:_t.image_url),width:30,height:30}),t.a.createElement("div",{title:_t==null?void 0:_t.name,className:zt.a.title},_t==null?void 0:_t.name),(_t==null?void 0:_t.is_authority)&&t.a.createElement("div",{className:zt.a.b},"\u5B98\u65B9"),(_t==null?void 0:_t.is_excellent)&&t.a.createElement("div",{className:zt.a.a},"\u7CBE\u9009")),t.a.createElement("div",{className:zt.a.des},t.a.createElement(dt.a,{showLines:2,showTextOnly:!0,value:(_t==null?void 0:_t.content)||"\u6682\u65E0\u5185\u5BB9"})),t.a.createElement("div",{className:zt.a.tag},t.a.createElement("span",{className:"current",onClick:function(jt){jt.stopPropagation(),fn(_t)}},t.a.createElement("img",{src:_t!=null&&_t.user_liker?oe.a:K.a}),t.a.createElement("span",{style:{color:_t!=null&&_t.user_liker?"#0152d9":"#656f87"}},_t==null?void 0:_t.praises_count)),t.a.createElement("span",null,t.a.createElement("img",{src:Oe.a}),t.a.createElement("span",null,_t==null?void 0:_t.discusses_count)),t.a.createElement("span",null,t.a.createElement("img",{src:lt.a}),t.a.createElement("span",null,_t==null?void 0:_t.viewed_count)),Object(Qt.w)()&&t.a.createElement("span",{className:"current",style:{color:"#0152d9",marginRight:0,userSelect:"none"},onClick:function(jt){jt.stopPropagation(),St(_t)}},_t!=null&&_t.is_hidden?"\u53D6\u6D88\u9690\u85CF":"\u9690\u85CF")))),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,_t=St===void 0?{}:St;switch(xt.type){case"addVideo":return{videoList:[].concat(Object(Xe.a)(ct.videoList),[{name:_t.file.name,size:_t.file.size,type:_t.file.type,fileHash:_t.fileHash,state:_t.state,video_id:_t.videoId,attachment_id:"",article_id:-1,loaded:0,title:""}])};case"removeVideo":return{videoList:ct.videoList.filter(function(Yt){return Yt.name!==xt.payload.name})};case"replaceVideo":return{videoList:xt.payload};case"removeAll":return[];case"updateProgress":return{videoList:ct.videoList.map(function(Yt){return Yt.name===xt.payload.uploadInfo.file.name?Object(a.a)(Object(a.a)({},Yt),{loaded:xt.payload.progressPercent,video_id:_t.videoId,fileHash:_t.fileHash}):Yt})};case"updateTitle":return{videoList:(It=ct.videoList)===null||It===void 0?void 0:It.map(function(Yt){return Yt.name===xt.payload.item.name?Object(a.a)(Object(a.a)({},Yt),{title:xt.payload.title}):Yt})};case"updateImg":return{videoList:(sn=ct.videoList)===null||sn===void 0?void 0:sn.map(function(Yt){return Yt.name===xt.payload.item.name?Object(a.a)(Object(a.a)({},Yt),{attachment_id:xt.payload.attachment_id}):Yt})};case"updateImg":return{videoList:(fn=ct.videoList)===null||fn===void 0?void 0:fn.map(function(Yt){return Yt.name===xt.payload.item.name?Object(a.a)(Object(a.a)({},Yt),{attachment_id:xt.payload.attachment_id}):Yt})};default:return[]}},$e=function(ct){var xt,It,sn=ct.onClose,fn=ct.onOk,St=ct.identifier,_t=ct.active,Yt=V.a.useForm(),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],En=Object(n.useState)(!1),er=Object(o.a)(En,2),Rn=er[0],Pn=er[1],Kn=Object(n.useState)(!1),Cr=Object(o.a)(Kn,2),rr=Cr[0],lr=Cr[1],pr=Object(n.useReducer)(se,{videoList:[]}),Er=Object(o.a)(pr,2),ir=Er[0],dr=Er[1],jn=Object(Qt.y)(),Gt=Object(m.i)(),vn=Object(n.useRef)();Object(n.useEffect)(function(){_t&&tr()},[_t]);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:_t});case 2:Cn=Vn.sent,(Cn==null?void 0:Cn.status)===0&&(ei={name:Cn==null||((Gn=Cn.data)===null||Gn===void 0)?void 0:Gn.name,content:Cn==null||((or=Cn.data)===null||or===void 0)?void 0:or.content},ln.setFieldsValue(ei),Dn(ei),Cn!=null&&(vr=Cn.data)!==null&&vr!==void 0&&(Rr=vr.videos)!==null&&Rr!==void 0&&Rr[0]&&dr({type:"replaceVideo",payload:[{video_id:Cn==null||((ki=Cn.data)===null||ki===void 0||(($r=ki.videos)===null||$r===void 0||((ji=$r[0])===null||ji===void 0)))?void 0:ji.video_id,name:Cn==null||((na=Cn.data)===null||na===void 0||((Hi=na.videos)===null||Hi===void 0||((ui=Hi[0])===null||ui===void 0)))?void 0:ui.title,loaded:100}]}));case 4:case"end":return Vn.stop()}},Mn)}));return function(){return bn.apply(this,arguments)}}(),ar=function(Mn,Cn){Dn(Object(a.a)({},Cn))},mr=function(){var bn=Object(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),!_t){$r.next=9;break}return or.active=_t,$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(_t||((Rr=vr)===null||Rr===void 0?void 0:Rr.id),44),fn(_t||((ei=vr)===null||ei===void 0?void 0:ei.id))),lr(!1);case 14:case"end":return $r.stop()}},Mn)}));return function(Cn){return bn.apply(this,arguments)}}(),$n=function(){var Mn=document.getElementById("fileUpload");Mn.value=""},Jn=function(Mn){var Cn='{"Vod":{}}';if(Pn(!0),vn.current){vn.current.addFile(Mn,null,null,null,Cn);return}Object(cn.a)(jn==null?void 0:jn.login,"",{create:!vn,addFileSuccess:function(or){dr({type:"addVideo",payload:{uploadInfo:or}})},onUploadProgress:function(or,vr,Rr){var ei=Math.ceil(Rr*100);dr({type:"updateProgress",payload:{uploadInfo:or,progressPercent:ei}}),$n()},onUploadFailed:function(or){C.b.info("\u89C6\u9891\u4E91\u670D\u52A1\u51FA\u73B0\u5F02\u5E38\uFF0C\u8BF7\u91CD\u65B0\u4E0A\u4F20\u3002")},onUploadEnd:function(or){Pn(!1)},onUploadSucceed:function(or){Pn(!1)},onUploadError:function(or){Pn(!1)},gotUploader:function(or){or.addFile(Mn,null,null,null,Cn),vn.current=or}})},yn=function(Mn){var Cn,Gn=1024,or=Mn.target.files[0];if(!or){$n();return}var vr=or.name.toLowerCase();if(vr&&vr.indexOf(".avi")==-1&&vr.indexOf(".flv")==-1&&vr.indexOf(".f4v")==-1&&vr.indexOf(".m4v")==-1&&vr.indexOf(".mov")==-1&&vr.indexOf(".mp4")==-1&&vr.indexOf(".rmvb")==-1&&vr.indexOf(".swf")==-1&&vr.indexOf(".webm")==-1&&vr.indexOf(".wmv")==-1){C.b.info("\u4E0D\u652F\u6301\u7684\u89C6\u9891\u683C\u5F0F"),$n();return}if(or.size>Gn*1024*1024){C.b.info("\u89C6\u9891\u5927\u5C0F\u8D85\u8FC7".concat(Gn,"M")),$n();return}if((Cn=ir.videoList)!==null&&Cn!==void 0&&Cn.find(function(Rr){return Rr.name===or.name})){C.b.info("\u4F60\u4E0D\u80FD\u4E0A\u4F20\u540C\u4E00\u4E2A\u89C6\u9891\u6587\u4EF6\u540D\u79F0\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9\u3002"),$n();return}Jn(or)},Ln=function(Mn,Cn){p.a.confirm({title:"\u63D0\u793A",centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:t.a.createElement("div",{className:"tc"},"\u60A8\u786E\u8BA4\u8981",Cn?"\u5220\u9664":"\u53D6\u6D88\u4E0A\u4F20","\u8BE5\u89C6\u9891\u5417\uFF1F"),onOk:function(){$n(),dr({type:"removeVideo",payload:{name:Mn}})}})},Kt=function(){return t.a.createElement("label",{htmlFor:"fileUpload",className:Rt.a.main},t.a.createElement("img",{src:ie.a,alt:""}),t.a.createElement("span",null,"\u4E0A\u4F20\u89C6\u9891"))},Xt=function(Mn){return t.a.createElement("div",{className:Rt.a.mainLoading},t.a.createElement("div",{className:Rt.a.proWarp},t.a.createElement("div",{className:Rt.a.pro},t.a.createElement("div",{style:{width:Mn}})),t.a.createElement("span",null,Mn||0,"%")),t.a.createElement("aside",null,"\u4E0A\u4F20\u4E2D"),t.a.createElement("div",{className:Rt.a.tip},t.a.createElement(Mt.a,{getPopupContainer:function(Gn){return Gn.parentNode},title:t.a.createElement("div",null,t.a.createElement("div",null,"1\u3001\u4E0A\u4F20\u89C6\u9891\uFF0C\u5373\u8868\u793A\u60A8\u5DF2\u540C\u610F",t.a.createElement("a",{className:"current c-light-primary",target:"_blank",href:"/users/innov/videos/protocol"},"\u4E0A\u4F20\u5185\u5BB9\u534F\u8BAE"),"\uFF0C\u4E0D\u5F97\u4E0A\u4F20\u672A\u7ECF\u4ED6\u4EBA\u6388\u6743\u7684\u4F5C\u54C1\uFF1B"),t.a.createElement("div",null,"2\u3001\u4E0D\u652F\u6301\u65AD\u70B9\u7EED\u4F20\uFF0C\u6587\u4EF6\u5927\u5C0F\u8BF7\u52FF\u8D85\u8FC71G\uFF1B"),t.a.createElement("div",null,"3\u3001\u652F\u6301\u6587\u4EF6\u683C\u5F0F\uFF1Aavi\u3001flv\u3001f4v\u3001m4v\u3001mov\u3001mp4\u3001rmvb\u3001swf\u3001webm\u3001wmv\uFF1B"))},t.a.createElement("img",{src: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,_t?"\u7F16\u8F91":"\u53D1\u5E03","\u9898\u89E3"),t.a.createElement("section",{className:Rt.a.scroll,id:"sss"},t.a.createElement("div",{className:Rt.a.formWrap}," ",t.a.createElement(V.a,{form:ln,scrollToFirstError:!0,layout:"vertical",onValuesChange:ar,onFinish:mr},t.a.createElement(V.a.Item,{name:"name",label:"\u6807\u9898:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u540D\u79F0"},{max:60,message:"\u8BF7\u8F93\u5165\u540D\u79F0\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26"},{whitespace:!0,message:"\u8BF7\u52FF\u8F93\u5165\u7A7A\u683C"}]},t.a.createElement(ne.a,{bordered:!1,placeholder:"\u8BF7\u8F93\u5165\u540D\u79F0\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26",suffix:"".concat(((It=Yn.name)===null||It===void 0?void 0:It.length)||0,"/60")})),t.a.createElement(V.a.Item,{name:"content",label:"\u5185\u5BB9:"},t.a.createElement(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")))},Et=$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],_t=fn[1];return t.a.createElement("aside",{className:"mt10"},t.a.createElement(De.a,{defaultValue:St,id:"writeForumsReviewId",onChange:function(wt){_t(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,_t=ct.onReplyDiscuss,Yt=ct.thirdlyReply,wt=ct.setThirdlyReply,ln=Object(Qt.y)();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:_t}),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,_t=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),En=Dn[0],er=Dn[1];return console.log(St,"data"),t.a.createElement("div",{className:gr.a.discussItem},t.a.createElement("div",{className:gr.a.list},t.a.createElement("img",{src:x.a.IMG_SERVER+"/images/"+(St==null||((xt=St.author)===null||xt===void 0)?void 0:xt.image_url)}),t.a.createElement("div",{className:gr.a.wrap},t.a.createElement("div",{className:"font14",style:{marginBottom:6}},t.a.createElement("span",{className:"c-grey-333 mr30"},St==null||((It=St.author)===null||It===void 0)?void 0:It.name),t.a.createElement("span",{className:"c-grey-999"},St==null?void 0:St.time)),t.a.createElement(dt.a,{value:St==null?void 0:St.content}),t.a.createElement("div",{className:gr.a.btns},t.a.createElement("div",{onClick:function(){return pn(St==null?void 0:St.id)},className:St!=null&&St.user_praise?"c-light-primary":"c-grey-999"},t.a.createElement("i",{className:"iconfont icon-xiaodianzan2 mr3"}),t.a.createElement("span",null,St==null?void 0:St.praise_count)),t.a.createElement("div",{onClick:function(){var Pn;if((St==null||((Pn=St.children)===null||Pn===void 0)?void 0:Pn.length)===0)return;wt(null),er(!En)},style:{color:En?"#0152d9":"#999999"}},t.a.createElement("i",{className:"iconfont icon-xiaopinglun2 mr3"}),t.a.createElement("span",null,En?"\u6536\u8D77\u8BC4\u8BBA":St==null||((sn=St.children)===null||sn===void 0)?void 0:sn.length)),t.a.createElement("div",{onClick:function(){er(!1),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){_t(Pn,Kn),er(!0)}}),En&&t.a.createElement("div",{className:gr.a.secondLevelDiscuss},St==null||((fn=St.children)===null||fn===void 0)?void 0:fn.map(function(Rn){return t.a.createElement(Pr,{thirdlyReply:ln,setThirdlyReply:jt,key:Rn.id,data:Rn,onReplyDiscuss:_t})})))))},Ei=Fr,vi=function(ct){var xt=ct.identifier,It=ct.active,sn=ct.onOk,fn=Object(n.useState)(""),St=Object(o.a)(fn,2),_t=St[0],Yt=St[1],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),En=Dn[0],er=Dn[1],Rn=Object(n.useState)(0),Pn=Object(o.a)(Rn,2),Kn=Pn[0],Cr=Pn[1],rr=Object(n.useState)(null),lr=Object(o.a)(rr,2),pr=lr[0],Er=lr[1],ir=Object(n.useState)(null),dr=Object(o.a)(ir,2),jn=dr[0],Gt=dr[1];Object(n.useEffect)(function(){vn(1),pn(1)},[It]);var vn=function(){var Jn=Object(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,Ee({container_type:"QuestionSolutionArticle",container_identifier:It,limit:5,page:Ln});case 2:Kt=en.sent,Kt!=null&&Kt.comments&&(er((Kt==null?void 0:Kt.comments)||[]),pn(Ln),Cr(Kt==null?void 0:Kt.disscuss_count));case 4:case"end":return en.stop()}},yn)}));return function(Ln){return Jn.apply(this,arguments)}}(),tr=function(){var Jn=Object(d.a)(i.a.mark(function yn(){var Ln;return i.a.wrap(function(Xt){for(;;)switch(Xt.prev=Xt.next){case 0:if(!(_t==="")){Xt.next=3;break}return C.b.error("\u8BF7\u8F93\u5165\u5185\u5BB9"),Xt.abrupt("return");case 3:return Xt.next=5,Te({comments:{content:_t},container_type:"QuestionSolutionArticle",container_identifier:It});case 5:Ln=Xt.sent,Ln!=null&&Ln.discuss&&(Yt(""),vn(jt),sn());case 7:case"end":return Xt.stop()}},yn)}));return function(){return Jn.apply(this,arguments)}}(),ar=function(){var Jn=Object(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,Er(null),Gt(null),vn(jt);case 6:case"end":return hn.stop()}},yn)}));return function(Ln,Kt,Xt){return Jn.apply(this,arguments)}}(),mr=function(){var Jn=Object(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:_t,id:"writeForumsReviewId",onChange:function(yn){Yt(yn)},placeholder:"\u6211\u8981\u56DE\u590D...",height:240}),t.a.createElement(Ar.a,null,t.a.createElement(br.a,{flex:"1"}),t.a.createElement(br.a,null,t.a.createElement(te.a,{type:"primary",size:"large",onClick:function(){return tr()}},"\u53D1\u9001")))),En==null?void 0:En.map(function(Jn){return t.a.createElement(Ei,{secondReply:pr,setSecondReply:Er,thirdlyReply:jn,setThirdlyReply:Gt,key:Jn.id,data:Jn,onReplyDiscuss:ar,onPlusDiscuss:mr})}),t.a.createElement(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,_t,Yt,wt,ln,jt,pn=ct.active,Yn=ct.identifier,Dn=ct.onAssist,En=ct.onEdit,er=ct.onArticlesSkip,Rn=ct.onClose,Pn=ct.onOk,Kn=ct.onDelete,Cr=ct.detailsIndex,rr=ct.btnShowStatus,lr=Object(n.useState)(!0),pr=Object(o.a)(lr,2),Er=pr[0],ir=pr[1],dr=Object(n.useState)({}),jn=Object(o.a)(dr,2),Gt=jn[0],vn=jn[1];Object(n.useEffect)(function(){pn&&tr()},[pn,Cr]);var tr=function(){var yn=Object(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:Er,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.w)()||(Gt==null?void 0:Gt.is_self))&&t.a.createElement(t.a.Fragment,null,t.a.createElement(te.a,{onClick:function(){return $n(Gt)},type:"primary",ghost:!0},"\u5220\u9664"),t.a.createElement(te.a,{onClick:function(){return En(Gt)},type:"primary",ghost:!0},"\u7F16\u8F91")),Object(Qt.w)()&&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.w)()&&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||((_t=St[0])===null||_t===void 0))?void 0:_t.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"))))},_r=wn,qn=z("3tLw"),kr=z.n(qn),hr=z("ek7X"),Ui=z("0NbB"),Nr=function(ct){var xt=ct.identifier,It=ct.tabStatus,sn=ct.setFilterListTotal,fn=ct.setListStatus,St={page:1,limit:10,total:0,search:"",save_search:"",sort_by:"updated_at",sort_direction:null},_t=Object(n.useState)(Object(a.a)({},St)),Yt=Object(o.a)(_t,2),wt=Yt[0],ln=Yt[1],jt=Object(n.useState)(!1),pn=Object(o.a)(jt,2),Yn=pn[0],Dn=pn[1],En=Object(n.useState)(0),er=Object(o.a)(En,2),Rn=er[0],Pn=er[1],Kn=Object(n.useState)(1),Cr=Object(o.a)(Kn,2),rr=Cr[0],lr=Cr[1],pr=Object(n.useState)(null),Er=Object(o.a)(pr,2),ir=Er[0],dr=Er[1],jn=Object(n.useState)([]),Gt=Object(o.a)(jn,2),vn=Gt[0],tr=Gt[1],ar=Object(n.useState)([!0,!0]),mr=Object(o.a)(ar,2),$n=mr[0],Jn=mr[1],yn=Object(n.useState)(0),Ln=Object(o.a)(yn,2),Kt=Ln[0],Xt=Ln[1],en=Object(n.useRef)(null);Object(n.useEffect)(function(){Rr()},[It]),Object(n.useEffect)(function(){xn()},[ir]),Object(n.useEffect)(function(){Bn(Object(a.a)({},St)),Rr()},[xt]),Object(n.useEffect)(function(){return window.addEventListener("resize",hn),fn(Kt),function(){window.removeEventListener("resize",hn)}},[Kt]);var xn=function(){var Vn=Object(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(Et,{identifier:xt,onClose:Rr,onOk:ei}),Kt===2&&t.a.createElement(Et,{active:ir,identifier:xt,onClose:Rr,onOk:ki}),Kt===3&&t.a.createElement(_r,{btnShowStatus:$n,onArticlesSkip:zi,detailsIndex:rr,active:ir,identifier:xt,onClose:Rr,onOk:$r,onEdit:vr,onAssist:ji,onDelete:Hi})))},Ur=Nr,yi=z("VEzc"),Zr=z.n(yi),Li=function(ct){var xt,It=ct.visible,sn=ct.onVisible,fn=ct.value,St=ct.onChange,_t=ct.setIndex,Yt={page:1,per_page:30,total:0,tag_discipline_id:[],search:"",save_search:"",difficulty:null},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),En=Dn[0],er=Dn[1],Rn=Object(n.useState)([]),Pn=Object(o.a)(Rn,2),Kn=Pn[0],Cr=Pn[1],rr=Object(n.useState)(!1),lr=Object(o.a)(rr,2),pr=lr[0],Er=lr[1],ir=Object(n.useRef)([]),dr=Object(n.useRef)(null),jn=Object(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:_t("0"),setTimeout(function(){en.target.style.pointerEvents="auto",en.target.style.cursor="pointer"},400);case 14:if(!(en.target.id==="oj-next"||en.target.id==="oj-modal-next")){Mn.next=24;break}if(!(!Bn||xn===-1)){Mn.next=18;break}return C.b.warn("\u4E0B\u4E00\u9898\u4E0D\u5B58\u5728"),Mn.abrupt("return");case 18:return en.target.style.pointerEvents="none",en.target.style.cursor="not-allowed",Mn.next=22,yn(Bn==null?void 0:Bn.identifier);case 22:_t("0"),setTimeout(function(){en.target.style.pointerEvents="auto",en.target.style.cursor="pointer"},400);case 24:case"end":return Mn.stop()}},Xt)}));return function(en){return Kt.apply(this,arguments)}}();Object(n.useEffect)(function(){St(jn==null?void 0:jn.save_identifier);var Kt=Kn.findIndex(function(Xt){return Xt.some(function(en){return en.identifier===(jn==null?void 0:jn.save_identifier)})});Kt===-1?pn(Object(a.a)(Object(a.a)({},jt),{},{page:1})):pn(Object(a.a)(Object(a.a)({},jt),{},{page:Kt+1}))},[jn==null?void 0:jn.save_identifier,Kn]);var ar=function(Xt){jt.page=1,jt.tag_discipline_id=Xt,pn(Object(a.a)({},jt)),Jn(jt)},mr=function(){var Kt=Object(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 Er(!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<Bn;Mn+=jt==null?void 0:jt.per_page)bn.push(xn==null||((Cn=xn.practices_list)===null||Cn===void 0)?void 0:Cn.slice(Mn,Mn+(jt==null?void 0:jt.per_page)));pn(Object(a.a)(Object(a.a)({},jt),{},{total:xn==null?void 0:xn.practices_count})),ir.current=(xn==null?void 0:xn.practices_list)||[],Cr(bn)}Er(!1);case 6:case"end":return or.stop()}},Xt)}));return function(en){return Kt.apply(this,arguments)}}(),yn=function(){var Kt=Object(d.a)(i.a.mark(function Xt(en,xn){var hn;return i.a.wrap(function(bn){for(;;)switch(bn.prev=bn.next){case 0:return bn.next=2,Object(Me.a)("/api/practices/".concat(en,"/start"),{method:"get"});case 2:hn=bn.sent,(hn==null?void 0:hn.status)===0&&E.d.push("/problems/".concat(hn==null?void 0:hn.identifier,"/oj/").concat(en));case 4:case"end":return bn.stop()}},Xt)}));return function(en,xn){return Kt.apply(this,arguments)}}(),Ln=function(Xt){jt.page=Xt,pn(Object(a.a)({},jt))};return t.a.createElement("div",{className:Zr.a.wrap,id:"oj-drawer",style:{left:It?0:-700}},t.a.createElement("div",{className:Zr.a.head},t.a.createElement("div",{className:Zr.a.title},"\u9898\u76EE\u5217\u8868"),t.a.createElement(ne.a.Search,{value:jt==null?void 0:jt.save_search,placeholder:"\u8BF7\u8F93\u5165\u9898\u76EE\u540D\u79F0\u641C\u7D22",style:{width:178,marginLeft:"auto",marginRight:10},onChange:function(Xt){jt.save_search=Xt.target.value,pn(Object(a.a)({},jt))},onSearch:function(){jt.page=1,jt.search=jt.save_search,pn(Object(a.a)({},jt)),Jn(jt)}}),t.a.createElement(w.a,{value:jt==null?void 0:jt.tag_discipline_id,style:{width:210},mode:"multiple",placeholder:"\u9009\u62E9\u77E5\u8BC6\u70B9",showSearch:!1,showArrow:!0,getPopupContainer:function(Xt){return Xt.parentNode},maxTagTextLength:2,maxTagCount:2,onChange:ar},En.map(function(Kt){return t.a.createElement(w.a.Option,{key:Kt.id,value:Kt.id},Kt.name)})),t.a.createElement(w.a,{style:{width:70,marginLeft:10},allowClear:!0,placeholder:"\u96BE\u5EA6",getPopupContainer:function(Xt){return Xt.parentNode},value:jt==null?void 0:jt.difficulty,onChange:$n},t.a.createElement(w.a.Option,{value:1},"\u7B80\u5355"),t.a.createElement(w.a.Option,{value:2},"\u9002\u4E2D"),t.a.createElement(w.a.Option,{value:3},"\u56F0\u96BE"))),t.a.createElement("div",{className:Zr.a.content},t.a.createElement(b.a,{spinning:pr},Kn==null||((xt=Kn[jt.page-1])===null||xt===void 0)?void 0:xt.map(function(Kt){return t.a.createElement("div",{key:Kt.identifier,className:Zr.a.list,onClick:function(en){return yn(Kt.identifier,en)}},t.a.createElement("i",{style:{visibility:fn===Kt.identifier?"visible":"hidden"},className:"iconfont icon-wancheng1 c-green-29b"}),t.a.createElement("span",{style:{fontWeight:fn===Kt.identifier?"bold":400,color:fn===Kt.identifier?"#ffffff":"#bac4cd"},title:Kt==null?void 0:Kt.name},Kt.name),(Kt==null?void 0:Kt.difficulty)===1&&t.a.createElement("b",{style:{color:"#2FA34F"}},"\u7B80\u5355"),(Kt==null?void 0:Kt.difficulty)===2&&t.a.createElement("b",{style:{color:"#0152d9"}},"\u9002\u4E2D"),(Kt==null?void 0:Kt.difficulty)===3&&t.a.createElement("b",{style:{color:"#FA6400"}},"\u56F0\u96BE"))}))),t.a.createElement("div",{className:Zr.a.footer},t.a.createElement(Pe.a,{showTotal:function(Xt){return t.a.createElement("span",{style:{color:"#656F87"}},"\u5171",t.a.createElement("span",{className:"c-light-primary"},Xt),"\u6761\u6570\u636E")},total:jt.total,pageSize:jt==null?void 0:jt.per_page,current:jt==null?void 0:jt.page,showSizeChanger:!1,onChange:Ln,showQuickJumper:!0,hideOnSinglePage:!0})))},qi=Li,xi=function(gt){var ct,xt=gt.hack,It=gt.onTriggerPraise,sn=gt.topicId,fn=gt.page,St=gt.onPageChange,_t=gt.user,Yt=gt.submitRecords,wt=gt.submitting,ln=gt.submitResult,jt=Object(m.h)(),pn=Object(n.useState)((jt==null||((ct=jt.query)===null||ct===void 0)?void 0:ct.tab)||"0"),Yn=Object(o.a)(pn,2),Dn=Yn[0],En=Yn[1],er=Object(n.useState)(0),Rn=Object(o.a)(er,2),Pn=Rn[0],Kn=Rn[1],Cr=Object(n.useState)(0),rr=Object(o.a)(Cr,2),lr=rr[0],pr=rr[1],Er=Object(n.useState)(0),ir=Object(o.a)(Er,2),dr=ir[0],jn=ir[1],Gt=Object(n.useState)(),vn=Object(o.a)(Gt,2),tr=vn[0],ar=vn[1],mr=Object(n.useState)(!1),$n=Object(o.a)(mr,2),Jn=$n[0],yn=$n[1];function Ln(Xt){var en=Xt.target.id;if(Dn==="3"&&en!==Dn&&(lr===1||lr===2)){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:function(){En(en)}});return}En(en)}Object(n.useEffect)(function(){var Xt=tt.a.subscribe("to-commit-info",function(){En("1")});return Xt},[]);function Kt(){En("2")}return t.a.createElement("div",{className:Ce.a["left-panel"]},t.a.createElement("ul",{className:"".concat(Ce.a["s-navs"]," ").concat(Ce.a["bg-white"]," ").concat(Ce.a.b1)},t.a.createElement("li",{className:"mr40 current"},t.a.createElement("img",{onClick:function(){return yn(!0)},src:Qe.a})),t.a.createElement("li",{className:Ce.a["oj-mr"]},t.a.createElement("a",{className:Dn==="0"?Ce.a.active:"",id:"0",onClick:Ln},"\u4EFB\u52A1\u63CF\u8FF0")),t.a.createElement("li",{className:Ce.a["oj-mr"]},t.a.createElement("a",{className:Dn==="3"?Ce.a.active:"",id:"3",onClick:Ln},"\u9898\u89E3",dr?"(".concat(dr,")"):"")),t.a.createElement("li",{className:Ce.a["oj-mr"]},t.a.createElement("a",{className:Dn==="2"?Ce.a.active:"",id:"2",onClick:Ln},"\u8BC4\u8BBA",Pn?"(".concat(Pn,")"):"")),t.a.createElement("li",null,t.a.createElement("a",{className:Dn==="1"?Ce.a.active:"",id:"1",onClick:Ln},"\u63D0\u4EA4\u8BB0\u5F55"))),t.a.createElement("div",{className:"".concat(Ce.a["tab-panel-body"]," ").concat(Dn==="0"?"":"hide"),style:{padding:"0 0 0 16px"}},t.a.createElement(je,{hack:xt,onTriggerPraise:It,toDiscuss:Kt})),t.a.createElement("div",{className:"".concat(Ce.a["tab-panel-body"]," ").concat(Dn==="1"?"":"hide")},Yt!=null&&Yt.records_count?t.a.createElement(re,{page:fn,onPageChange:St,topicId:sn,submitting:wt,submitRecords:Yt,submitResult:ln}):t.a.createElement(k.a,null)),t.a.createElement("div",{className:"".concat(Ce.a["tab-panel-body"]," ").concat(Dn==="2"?"":"hide"),style:{padding:0}},t.a.createElement(Dt,{setDiscussTotal:Kn,user:_t,identifier:xt.identifier,hack:xt,onTriggerPraise:It})),t.a.createElement("div",{className:"".concat(Ce.a["tab-panel-body"]," ").concat(Dn==="3"?"":"hide"),style:{padding:0}},t.a.createElement(Ur,{setListStatus:pr,setFilterListTotal:jn,tabStatus:Dn,identifier:xt.identifier})),t.a.createElement(qi,{visible:Jn,setIndex:En,onVisible:function(en){return yn(en)},value:tr,onChange:function(en){return ar(en)}}))},Pi=function(ct){return String(ct).length===1?"0".concat(ct):ct},li=function(ct){var xt=ct.className,It=xt===void 0?"":xt,sn=ct.onChange,fn=Object(n.useState)(0),St=Object(o.a)(fn,2),_t=St[0],Yt=St[1];Object(n.useEffect)(function(){var pn=setTimeout(function(){Yt(_t+1e3)},1e3);return sn(_t+1e3),function(){clearInterval(pn)}},[_t]);var wt=parseInt(_t/(60*6e4))||"00",ln=parseInt(_t%(60*6e4)/6e4)||"00",jt=parseInt(_t%6e4/1e3)||"00";return t.a.createElement("div",{className:It},Pi(wt),":",Pi(ln),":",Pi(jt))},Wi=li,Si=z("oFv4"),hi=z.n(Si),Zi=z("S/kP"),pa=z.n(Zi),ma=z("t/PP"),ea=z.n(ma),ta=z("LvDl"),$i=z.n(ta),dn=z("P5Jw"),On=s.a.Countdown,gn={Java:"java",C:"c",Python:"py","C++":"c"},qt;(function(gt){gt[gt.SET_LOADING=0]="SET_LOADING",gt[gt.GET_DATA=1]="GET_DATA",gt[gt.GET_SUBMIT_RECORDS=2]="GET_SUBMIT_RECORDS",gt[gt.SET_DATA=3]="SET_DATA",gt[gt.SET_DEBUGING=4]="SET_DEBUGING",gt[gt.SET_SUBMITING=5]="SET_SUBMITING",gt[gt.SET_EXECUTE_MESSAGE=6]="SET_EXECUTE_MESSAGE",gt[gt.SET_EXECUTE_RESULT=7]="SET_EXECUTE_RESULT",gt[gt.SET_SUBMIT_RESULT=8]="SET_SUBMIT_RESULT",gt[gt.SET_SHOW_NOTE=9]="SET_SHOW_NOTE",gt[gt.SET_PAGE=10]="SET_PAGE",gt[gt.GET_LANGUAGE=11]="GET_LANGUAGE",gt[gt.GET_DRAWER=12]="GET_DRAWER"})(qt||(qt={}));function Hn(){return new Date().getTime()}var cr={loading:!0,data:void 0,showNote:!1,debugResult:void 0,submitResult:void 0,debuging:!1,submitting:!1,submitRecords:void 0,submitRecordPage:1,executingMessage:"",languageValue:"",languageList:[],drawerData:[]};function Zn(gt,ct){switch(ct.type){case qt.GET_DATA:return Object(a.a)(Object(a.a)({},gt),ct.payload);case qt.SET_DATA:return Object(a.a)(Object(a.a)({},gt),{},{data:ct.payload});case qt.SET_LOADING:return Object(a.a)(Object(a.a)({},gt),{},{loading:ct.payload});case qt.GET_LANGUAGE:return Object(a.a)(Object(a.a)({},gt),{},{languageList:ct.payload});case qt.GET_DRAWER:return Object(a.a)(Object(a.a)({},gt),{},{drawerData:ct.payload});case qt.SET_SHOW_NOTE:return Object(a.a)(Object(a.a)({},gt),{},{showNote:ct.payload});case qt.SET_DEBUGING:return Object(a.a)(Object(a.a)({},gt),{},{debuging:ct.payload});case qt.SET_SUBMITING:return Object(a.a)(Object(a.a)({},gt),{},{submitting:ct.payload});case qt.GET_SUBMIT_RECORDS:return Object(a.a)(Object(a.a)({},gt),{},{submitRecords:ct.payload});case qt.SET_PAGE:return Object(a.a)(Object(a.a)({},gt),{},{submitRecordPage:ct.payload});case qt.SET_EXECUTE_MESSAGE:return Object(a.a)(Object(a.a)({},gt),{},{executingMessage:ct.payload});case qt.SET_EXECUTE_RESULT:return Object(a.a)(Object(a.a)({},gt),ct.payload);case qt.SET_SUBMIT_RESULT:return Object(a.a)(Object(a.a)({},gt),ct.payload);default:throw new Error}}var wr=Ve.default=function(gt){var ct,xt,It=gt.children,sn=Object(n.useReducer)(Zn,cr),fn=Object(o.a)(sn,2),St=fn[0],_t=fn[1],Yt=Object(m.i)(),wt=Yt.id,ln=Object(m.g)(),jt=Object(m.h)(),pn=St.languageValue,Yn=St.languageList,Dn=St.loading,En=St.data,er=St.debugResult,Rn=St.submitResult,Pn=St.submitRecords,Kn=St.submitRecordPage,Cr=St.showNote,rr=St.debuging,lr=St.submitting,pr=St.executingMessage,Er=Object(n.useState)("#FFF"),ir=Object(o.a)(Er,2),dr=ir[0],jn=ir[1],Gt=Object(n.useState)(null),vn=Object(o.a)(Gt,2),tr=vn[0],ar=vn[1],mr=Object(n.useState)({}),$n=Object(o.a)(mr,2),Jn=$n[0],yn=$n[1],Ln=Object(n.useState)(!1),Kt=Object(o.a)(Ln,2),Xt=Kt[0],en=Kt[1],xn=Object(n.useRef)(null),hn=Object(n.useRef)(null),Bn=En==null?void 0:En.user,bn=En==null?void 0:En.hack;Object(n.useEffect)(function(){return Object(E.c)()._store.dispatch({type:"globalSetting/headerFooterToggle",payload:!1}),Object(E.c)()._store.dispatch({type:"globalSetting/onlyShowBackTopToggle",payload:!0}),function(){Object(E.c)()._store.dispatch({type:"globalSetting/headerFooterToggle",payload:!0}),Object(E.c)()._store.dispatch({type:"globalSetting/onlyShowBackTopToggle",payload:!1})}},[]),Object(n.useEffect)(function(){setTimeout(function(){document.title="\u5728\u7EBF\u5237\u9898"},400)}),Object(n.useEffect)(function(){if(Xt){var Wn,Sn=document.getElementById("oj-next"),Xn=document.getElementById("oj-modal-next");(Sn==null||((Wn=Sn.style)===null||Wn===void 0)?void 0:Wn.display)==="none"?Xn.style.display="none":Xn.style.display="block"}},[Xt]),Object(n.useEffect)(function(){function Wn(){return Sn.apply(this,arguments)}function Sn(){return Sn=Object(d.a)(i.a.mark(function Xn(){var tn,kn,Tr,Kr,Gr;return i.a.wrap(function(mn){for(;;)switch(mn.prev=mn.next){case 0:return mn.next=2,Object(g.m)(wt);case 2:tn=mn.sent,tn.status===401?document.location.href="/user/login":(tn.hack=tn.practice,tn.hack.code=O.Base64.decode(tn==null||((kn=tn.hack)===null||kn===void 0)?void 0:kn.code),Gr="".concat(Bn==null?void 0:Bn.login,"-language"),localStorage.getItem(Gr)&&(tn.hack.language=localStorage.getItem(Gr)),hn.current=$i.a.cloneDeep(tn),hn.current.language=tn==null||((Tr=tn.hack)===null||Tr===void 0)?void 0:Tr.language,_t({type:qt.GET_DATA,payload:{loading:!1,data:tn}}),_t({type:qt.SET_SUBMIT_RESULT,payload:{languageValue:tn==null||((Kr=tn.hack)===null||Kr===void 0)?void 0:Kr.language}}));case 4:case"end":return mn.stop()}},Xn)})),Sn.apply(this,arguments)}wt&&Wn()},[wt]),Object(n.useEffect)(function(){_t({type:qt.SET_SUBMIT_RESULT,payload:{debugResult:void 0}}),or(),en(!1)},[wt]),Object(n.useEffect)(function(){clearTimeout(xn.current)},[wt]),Object(n.useEffect)(function(){Cn()},[wt,Kn]);var Mn=function(){window.parent.postMessage("backExercise","*")};function Cn(){return Gn.apply(this,arguments)}function Gn(){return Gn=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.o)(wt,{limit:15,page:Kn});case 3:Sn=tn.sent,_t({type:qt.GET_SUBMIT_RECORDS,payload:Sn}),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]])})),Gn.apply(this,arguments)}function or(){return vr.apply(this,arguments)}function vr(){return vr=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.w)(wt);case 3:Sn=tn.sent,_t({type:qt.GET_LANGUAGE,payload:Sn==null?void 0:Sn.data}),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]])})),vr.apply(this,arguments)}function Rr(Wn){_t({type:qt.SET_PAGE,payload:Wn})}function ei(Wn){return ki.apply(this,arguments)}function ki(){return ki=Object(d.a)(i.a.mark(function Wn(Sn){var Xn,tn,kn,Tr,Kr,Gr;return i.a.wrap(function(mn){for(;;)switch(mn.prev=mn.next){case 0:return Kr=((Xn=window)===null||Xn===void 0||((tn=Xn.location)===null||tn===void 0||((kn=tn.pathname)===null||kn===void 0||((Tr=kn.split("/"))===null||Tr===void 0)))?void 0:Tr[2])||wt,mn.next=3,Object(g.v)(Kr,Sn||{code:O.Base64.encode(bn.code),language:pn});case 3:return Gr=mn.sent,mn.abrupt("return",Gr);case 5:case"end":return mn.stop()}},Wn)})),ki.apply(this,arguments)}function $r(){return ji.apply(this,arguments)}function ji(){return ji=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:if(!lr){mn.next=2;break}return mn.abrupt("return");case 2:return _t({type:qt.SET_SUBMITING,payload:!0}),mn.prev=3,tt.a.publish("to-commit-info"),mn.next=7,ei();case 7: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,"submit");case 2:if(Gi=Mr.sent,Fi=Gi.status,Vi=Gi.data,oa=Hn(),sa=oa-Tr>(kn+3)*1e3,Fi!==0&&!sa&&setTimeout(Kr,1e3),!sa){Mr.next=12;break}return p.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8BC4\u6D4B\u4EE3\u7801\u8D85\u65F6"}),_t({type:qt.SET_SUBMITING,payload:!1}),Mr.abrupt("return");case 12:if(!(Fi===0)){Mr.next=19;break}return Vi.status===2&&p.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8BC4\u6D4B\u4EE3\u7801\u8D85\u65F6"}),Mr.next=16,Object(g.o)(wt,{limit:15,page:Kn});case 16:Ji=Mr.sent,_t({type:qt.SET_SUBMIT_RESULT,payload:Object(a.a)(Object(a.a)({},St),{},{submitResult:Vi,submitting:!1,submitRecords:Ji})}),(Vi==null?void 0:Vi.status)===0&&en(!0);case 19:case"end":return Mr.stop()}},aa)})),Gr.apply(this,arguments)},Kr=function(){return Gr.apply(this,arguments)},Xn={},mn.next=14,Object(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),_t({type:qt.SET_SUBMITING,payload:!1});case 26:case"end":return mn.stop()}},Wn,null,[[3,23]])})),ji.apply(this,arguments)}function na(){return Hi.apply(this,arguments)}function Hi(){return Hi=Object(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,_t({type:qt.SET_DEBUGING,payload:!0}),mn.prev=2,mn.next=5,ei();case 5:if(Sn=mn.sent,!(Sn.status===0)){mn.next=21;break}return Gr=function(){return Gr=Object(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&&(_t({type:qt.SET_EXECUTE_MESSAGE,payload:Vi}),setTimeout(Kr,1e3)),!Ji){Mr.next=13;break}return p.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8C03\u8BD5\u4EE3\u7801\u8D85\u65F6"}),_t({type:qt.SET_DEBUGING,payload:!1}),Mr.abrupt("return");case 13:Fi===0&&(_t({type:qt.SET_DEBUGING,payload:!1}),oa.status===2&&p.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8C03\u8BD5\u4EE3\u7801\u8D85\u65F6"}),_t({type:qt.SET_EXECUTE_RESULT,payload:Object(a.a)(Object(a.a)({},St),{},{debugResult:oa,debuging:!1})}));case 14:case"end":return Mr.stop()}},aa)})),Gr.apply(this,arguments)},Kr=function(){return Gr.apply(this,arguments)},Xn=bn.time_limit,tn={input:encodeURIComponent(En.test_case.input)},mn.next=13,Object(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:_t({type:qt.SET_DEBUGING,payload:!1});case 22:mn.next=27;break;case 24:mn.prev=24,mn.t0=mn.catch(2),console.log(mn.t0);case 27:return mn.prev=27,mn.finish(27);case 29:case"end":return mn.stop()}},Wn,null,[[2,24,27,29]])})),Hi.apply(this,arguments)}function ui(Wn){var Sn;clearTimeout(xn.current),xn.current=setTimeout(function(){var Xn;ei({code:O.Base64.encode(Wn),language:hn==null||((Xn=hn.current)===null||Xn===void 0)?void 0:Xn.language})},2e3),_t({type:qt.SET_DATA,payload:Object(a.a)(Object(a.a)({},hn==null?void 0:hn.current),{},{hack:Object(a.a)(Object(a.a)({},hn==null||((Sn=hn.current)===null||Sn===void 0)?void 0:Sn.hack),{},{code:Wn})})})}function zi(Wn){var Sn=Wn.target.value;_t({type:qt.SET_DATA,payload:Object(a.a)(Object(a.a)({},En),{},{test_case:{input:Sn}})})}var Vn=function(){var Wn=Object(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 _t({type:qt.SET_LOADING,payload:!0}),mn.next=3,ei();case 3:if(tn=mn.sent,!(tn.status===0)){mn.next=14;break}return _t({type:qt.SET_SUBMIT_RESULT,payload:{languageValue:Xn}}),hn.current.language=Xn,kn="".concat(Bn==null?void 0:Bn.login,"-language"),localStorage.setItem(kn,Xn),mn.next=11,Object(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(){_t({type:qt.SET_LOADING,payload:!1})},300);case 14:case"end":return mn.stop()}},Sn)}));return function(Xn){return Wn.apply(this,arguments)}}();function Tn(){return nr.apply(this,arguments)}function nr(){return nr=Object(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(){_t({type:qt.SET_SHOW_NOTE,payload:!0})}function Nn(){_t({type:qt.SET_SHOW_NOTE,payload:!1})}function ni(Wn){return jr.apply(this,arguments)}function jr(){return jr=Object(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:_t({type:qt.GET_DATA,payload:{showNote:!1,data:Object(a.a)(Object(a.a)({},En),{},{hack:Object(a.a)(Object(a.a)({},bn),{},{notes:Sn.notes})})}});case 3:case"end":return tn.stop()}},Wn)})),jr.apply(this,arguments)}var Jr={input:En==null||((ct=En.test_case)===null||ct===void 0)?void 0:ct.input,language:bn==null?void 0:bn.language,code:bn==null?void 0:bn.code,title:"main."+gn[bn==null?void 0:bn.language],modify_code:bn==null?void 0:bn.modify_code,notes:bn==null?void 0:bn.notes,debugResult:er,debuging:rr,submitting:lr,executingMessage:pr,id: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)({},En),{},{hack:Object(a.a)(Object(a.a)({},bn),{},{praises_count:Xn,user_praise:!bn.user_praise})}),_t({type:qt.SET_DATA,payload:tn});case 6:case"end":return Tr.stop()}},Wn)})),Mi.apply(this,arguments)}var Ki={topicId:wt,submitResult:Rn,submitRecords:Pn,submitting:lr,page:Kn,onPageChange:Rr,hack:bn,user:En==null?void 0:En.user,onTriggerPraise:wi};return console.log(En,hn==null?void 0:hn.current,"data--------"),t.a.createElement(t.a.Fragment,null,t.a.createElement(b.a,{className:"oj-custom-large-spin",size:"large",spinning:Dn},En?t.a.createElement("div",{className:"oj-custom-warp"},t.a.createElement("header",{className:D.a.header,style:{minWidth:1200}},t.a.createElement("div",null,t.a.createElement("img",{src:"".concat(x.a.IMG_SERVER,"/images/").concat(Bn.image_url),alt:"user",width:30}),t.a.createElement("span",null,Bn.name)),t.a.createElement("h2",{className:"flex-wrp flex_box_column flex_box_center"},t.a.createElement("div",null,bn.name),t.a.createElement(Wi,{onChange:function(Sn){},className:"font12 c-grey-999"})),t.a.createElement(dn.CopyToClipboard,{text:"".concat((xt=window.location)===null||xt===void 0?void 0:xt.origin,"/problems/").concat(bn.identifier,"/share"),onCopy:function(){return C.b.success("\u590D\u5236\u9898\u76EE\u94FE\u63A5\u6210\u529F")}},t.a.createElement("span",{className:D.a.btn_back,style:{marginRight:10,cursor:"pointer"}}," ",t.a.createElement("i",{className:"iconfont icon-fenxiang1 font14 mr5"}),"\u5206\u4EAB\u9898\u76EE")),bn.edit_privilege?t.a.createElement(_.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(_.a,{className:D.a.btn_back,to:"/problems"}," ",t.a.createElement(v.a,null),"\u9000\u51FA")),t.a.createElement(y.a,{hideResize:!0,className:"my-problems oj-problems",leftChild:t.a.createElement(xi,Ki),rightChild:t.a.createElement(zn,Jr)})):null),t.a.createElement(p.a,{centered:!0,closable:!1,width:680,footer:null,visible:Xt,className:"oj-modal"},t.a.createElement("section",{className:"oj-modal-content"},t.a.createElement("div",{className:"oj-modal-head"},t.a.createElement("img",{src:hi.a,alt:""}),t.a.createElement("i",{onClick:function(){return en(!1)},className:"iconfont icon-guanbi1"})),t.a.createElement("aside",null,t.a.createElement("img",{className:"mr30",src:ea.a}),"\u8FD0\u884C\u65F6\u95F4:\xA0",t.a.createElement("span",{style:{color:"#75d6ba",marginRight:100}},Rn==null?void 0:Rn.execute_time,"s"),"\u4F18\u4E8E",t.a.createElement("span",{style:{color:"#f3b087",margin:"0 5px"}},(Rn==null?void 0:Rn.time_better_than)||100,"%"),"\u7684\u7528\u6237"),t.a.createElement("aside",{className:"mb50"},t.a.createElement("img",{src:pa.a,className:"mr30"}),t.a.createElement("span",{className:"oj-modal-tt"},t.a.createElement("span",null,t.a.createElement("span",null,"\u5360\u7528\u5185\u5B58:\xA0"),t.a.createElement("span",{className:"c-light-primary"},Rn==null?void 0:Rn.execute_memory,"kb")),t.a.createElement("span",null,t.a.createElement("span",null))),"\u4F18\u4E8E",t.a.createElement("span",{style:{color:"#f3b087",margin:"0 5px"}},(Rn==null?void 0:Rn.memory_better_than)||100,"%"),"\u7684\u7528\u6237"),t.a.createElement("div",{id:"oj-modal-next",className:"oj-modal-btn"},"\u8FDB\u5165\u4E0B\u4E00\u9898"))))};function Wr(gt){var ct=gt.languageValue,xt=gt.languageList,It=gt.onChangeLanguage,sn=gt.title,fn=gt.modify_code,St=gt.onSyncCode,_t=gt.onShowCodeSetting,Yt=gt.onResetCode,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:_t},t.a.createElement("i",{className:"iconfont icon-shezhi"})))}function zn(gt){var ct=gt.id,xt=gt.input,It=gt.showNote,sn=gt.onShowNote,fn=gt.notes,St=gt.onCancelNote,_t=gt.onAddNote,Yt=gt.debugResult,wt=gt.language,ln=gt.debuging,jt=gt.submitting,pn=gt.executingMessage,Yn=gt.code,Dn=gt.onSubmitCode,En=gt.onDebugCode,er=gt.onChangeCode,Rn=gt.onChangeInput,Pn=gt.onUpdateCode,Kn=Object(Q.a)(gt,["id","input","showNote","onShowNote","notes","onCancelNote","onAddNote","debugResult","language","debuging","submitting","executingMessage","code","onSubmitCode","onDebugCode","onChangeCode","onChangeInput","onUpdateCode"]);function Cr(lr){return t.a.createElement(Wr,Object(le.a)({},Kn,{onShowCodeSetting:lr}))}var rr={id:ct,input:xt,debugResult:Yt,debuging:ln,submitting:jt,executingMessage:pn,onDebugCode:En,onChangeCode:er,onSubmitCode:Dn,onChangeInput:Rn};return t.a.createElement("div",{className:"right-panel"},t.a.createElement(S.a,{language: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:_t})),t.a.createElement(B.b,rr))}},WaYH:function(et,Ve,z){"use strict";var le=z("rePB"),Q=z("Ff2n"),j=z("VTBJ"),w=z("1OyB"),P=z("vuIU"),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(_){var g=_.prefixCls,y=_.level,x=_.isStart,l=_.isEnd;if(!y)return null;for(var S="".concat(g,"-indent-unit"),O=[],A=0;A<y;A+=1){var D;O.push(c.createElement("span",{key:A,className:d()(S,(D={},Object(le.a)(D,"".concat(S,"-start"),x[A+1]),Object(le.a)(D,"".concat(S,"-end"),l[A+1]),Object(le.a)(D,"".concat(S,"-end-first-level"),!A&&l[0]),D))}))}return c.createElement("span",{"aria-hidden":"true",className:"".concat(g,"-indent")},O)},s=u,h=z("815F"),i="open",n="close",t="---",f=function(E){Object(T.a)(g,E);var _=Object(C.a)(g);function g(){var y;return Object(w.a)(this,g),y=_.apply(this,arguments),y.state={dragNodeHighlight:!1},y.onSelectorClick=function(x){var l=y.props.context.onNodeClick;l(x,Object(h.b)(y.props)),y.isSelectable()?y.onSelect(x):y.onCheck(x)},y.onSelectorDoubleClick=function(x){var l=y.props.context.onNodeDoubleClick;l(x,Object(h.b)(y.props))},y.onSelect=function(x){if(y.isDisabled())return;var l=y.props.context.onNodeSelect;x.preventDefault(),l(x,Object(h.b)(y.props))},y.onCheck=function(x){if(y.isDisabled())return;var l=y.props,S=l.disableCheckbox,O=l.checked,A=y.props.context.onNodeCheck;if(!y.isCheckable()||S)return;x.preventDefault();var D=!O;A(x,Object(h.b)(y.props),D)},y.onMouseEnter=function(x){var l=y.props.context.onNodeMouseEnter;l(x,Object(h.b)(y.props))},y.onMouseLeave=function(x){var l=y.props.context.onNodeMouseLeave;l(x,Object(h.b)(y.props))},y.onContextMenu=function(x){var l=y.props.context.onNodeContextMenu;l(x,Object(h.b)(y.props))},y.onDragStart=function(x){var l=y.props.context.onNodeDragStart;x.stopPropagation(),y.setState({dragNodeHighlight:!0}),l(x,Object(b.a)(y));try{x.dataTransfer.setData("text/plain","")}catch(S){}},y.onDragEnter=function(x){var l=y.props.context.onNodeDragEnter;x.preventDefault(),x.stopPropagation(),l(x,Object(b.a)(y))},y.onDragOver=function(x){var l=y.props.context.onNodeDragOver;x.preventDefault(),x.stopPropagation(),l(x,Object(b.a)(y))},y.onDragLeave=function(x){var l=y.props.context.onNodeDragLeave;x.stopPropagation(),l(x,Object(b.a)(y))},y.onDragEnd=function(x){var l=y.props.context.onNodeDragEnd;x.stopPropagation(),y.setState({dragNodeHighlight:!1}),l(x,Object(b.a)(y))},y.onDrop=function(x){var l=y.props.context.onNodeDrop;x.preventDefault(),x.stopPropagation(),y.setState({dragNodeHighlight:!1}),l(x,Object(b.a)(y))},y.onExpand=function(x){var l=y.props.context.onNodeExpand;l(x,Object(h.b)(y.props))},y.setSelectHandle=function(x){y.selectHandle=x},y.getNodeState=function(){var x=y.props.expanded;return y.isLeaf()?null:x?i:n},y.hasChildren=function(){var x=y.props.eventKey,l=y.props.context.keyEntities,S=l[x]||{},O=S.children;return!!(O||[]).length},y.isLeaf=function(){var x=y.props,l=x.isLeaf,S=x.loaded,O=y.props.context.loadData,A=y.hasChildren();return l===!1?!1:l||!O&&!A||O&&S&&!A},y.isDisabled=function(){var x=y.props.disabled,l=y.props.context.disabled;return!!(l||x)},y.isCheckable=function(){var x=y.props.checkable,l=y.props.context.checkable;return!l||x===!1?!1:l},y.syncLoadData=function(x){var l=x.expanded,S=x.loading,O=x.loaded,A=y.props.context,D=A.loadData,I=A.onNodeLoad;if(S)return;D&&l&&!y.isLeaf()&&(!y.hasChildren()&&!O&&I(Object(h.b)(y.props)))},y.renderSwitcher=function(){var x=y.props,l=x.expanded,S=x.switcherIcon,O=y.props.context,A=O.prefixCls,D=O.switcherIcon,I=S||D;if(y.isLeaf())return c.createElement("span",{className:d()("".concat(A,"-switcher"),"".concat(A,"-switcher-noop"))},typeof I=="function"?I(Object(j.a)(Object(j.a)({},y.props),{},{isLeaf:!0})):I);var B=d()("".concat(A,"-switcher"),"".concat(A,"-switcher_").concat(l?i:n));return c.createElement("span",{onClick:y.onExpand,className:B},typeof I=="function"?I(Object(j.a)(Object(j.a)({},y.props),{},{isLeaf:!1})):I)},y.renderCheckbox=function(){var x=y.props,l=x.checked,S=x.halfChecked,O=x.disableCheckbox,A=y.props.context.prefixCls,D=y.isDisabled(),I=y.isCheckable();if(!I)return null;var B=typeof I!="boolean"?I:null;return c.createElement("span",{className:d()("".concat(A,"-checkbox"),l&&"".concat(A,"-checkbox-checked"),!l&&S&&"".concat(A,"-checkbox-indeterminate"),(D||O)&&"".concat(A,"-checkbox-disabled")),onClick:y.onCheck},B)},y.renderIcon=function(){var x=y.props.loading,l=y.props.context.prefixCls;return c.createElement("span",{className:d()("".concat(l,"-iconEle"),"".concat(l,"-icon__").concat(y.getNodeState()||"docu"),x&&"".concat(l,"-icon_loading"))})},y.renderSelector=function(){var x=y.state.dragNodeHighlight,l=y.props,S=l.title,O=l.selected,A=l.icon,D=l.loading,I=l.data,B=y.props.context,H=B.prefixCls,te=B.showIcon,W=B.icon,V=B.draggable,X=B.loadData,ne=B.titleRender,Y=y.isDisabled(),ee="".concat(H,"-node-content-wrapper"),ce;if(te){var de=A||W;ce=de?c.createElement("span",{className:d()("".concat(H,"-iconEle"),"".concat(H,"-icon__customize"))},typeof de=="function"?de(y.props):de):y.renderIcon()}else X&&D&&(ce=y.renderIcon());var Ce;typeof S=="function"?Ce=S(I):ne?Ce=ne(I):Ce=S;var Se=c.createElement("span",{className:"".concat(H,"-title")},Ce);return c.createElement("span",{ref:y.setSelectHandle,title:typeof S=="string"?S:"",className:d()("".concat(ee),"".concat(ee,"-").concat(y.getNodeState()||"normal"),!Y&&(O||x)&&"".concat(H,"-node-selected"),!Y&&V&&"draggable"),draggable:!Y&&V||void 0,"aria-grabbed":!Y&&V||void 0,onMouseEnter:y.onMouseEnter,onMouseLeave:y.onMouseLeave,onContextMenu:y.onContextMenu,onClick:y.onSelectorClick,onDoubleClick:y.onSelectorDoubleClick,onDragStart:V?y.onDragStart:void 0},ce,Se)},y}return Object(P.a)(g,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var x=this.props.selectable,l=this.props.context.selectable;return typeof x=="boolean"?x:l}},{key:"render",value:function(){var x,l=this.props,S=l.eventKey,O=l.className,A=l.style,D=l.dragOver,I=l.dragOverGapTop,B=l.dragOverGapBottom,H=l.isLeaf,te=l.isStart,W=l.isEnd,V=l.expanded,X=l.selected,ne=l.checked,Y=l.halfChecked,ee=l.loading,ce=l.domRef,de=l.active,Ce=l.onMouseMove,Se=Object(Q.a)(l,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),Pe=this.props.context,ye=Pe.prefixCls,_e=Pe.filterTreeNode,Ge=Pe.draggable,Ue=Pe.keyEntities,Fe=this.isDisabled(),He=Object(a.f)(Se),be=Ue[S]||{},me=be.level,We=W[W.length-1];return c.createElement("div",Object.assign({ref:ce,className:d()(O,"".concat(ye,"-treenode"),(x={},Object(le.a)(x,"".concat(ye,"-treenode-disabled"),Fe),Object(le.a)(x,"".concat(ye,"-treenode-switcher-").concat(V?"open":"close"),!H),Object(le.a)(x,"".concat(ye,"-treenode-checkbox-checked"),ne),Object(le.a)(x,"".concat(ye,"-treenode-checkbox-indeterminate"),Y),Object(le.a)(x,"".concat(ye,"-treenode-selected"),X),Object(le.a)(x,"".concat(ye,"-treenode-loading"),ee),Object(le.a)(x,"".concat(ye,"-treenode-active"),de),Object(le.a)(x,"".concat(ye,"-treenode-leaf-last"),We),Object(le.a)(x,"drag-over",!Fe&&D),Object(le.a)(x,"drag-over-gap-top",!Fe&&I),Object(le.a)(x,"drag-over-gap-bottom",!Fe&&B),Object(le.a)(x,"filter-node",_e&&_e(Object(h.b)(this.props))),x)),style:A,onDragEnter:Ge?this.onDragEnter:void 0,onDragOver:Ge?this.onDragOver:void 0,onDragLeave:Ge?this.onDragLeave:void 0,onDrop:Ge?this.onDrop:void 0,onDragEnd:Ge?this.onDragEnd:void 0,onMouseMove:Ce},He),c.createElement(s,{prefixCls:ye,level:me,isStart:te,isEnd:W}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),g}(c.Component),v=function(_){return c.createElement(o.a.Consumer,null,function(g){return c.createElement(f,Object.assign({},_,{context:g}))})};v.displayName="TreeNode",v.defaultProps={title:t},v.isTreeNode=1;var m=Ve.a=v},Wtmd:function(et,Ve,z){et.exports=z.p+"static/c.03ba6fd6.svg"},Wx9E:function(et,Ve,z){},XIdC:function(et,Ve,z){"use strict";var le=z("rePB"),Q=z("ODXe"),j=z("Ff2n"),w=z("q1tI"),P=z.n(w),b=z("TSYQ"),T=z.n(b),C=z("6cGi"),c=z("4IlW"),p=w.forwardRef(function(d,o){var a,u=d.prefixCls,s=u===void 0?"rc-switch":u,h=d.className,i=d.checked,n=d.defaultChecked,t=d.disabled,f=d.loadingIcon,v=d.checkedChildren,m=d.unCheckedChildren,E=d.onClick,_=d.onChange,g=d.onKeyDown,y=Object(j.a)(d,["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"]),x=Object(C.a)(!1,{value:i,defaultValue:n}),l=Object(Q.a)(x,2),S=l[0],O=l[1];function A(H,te){var W=S;return t||(W=H,O(W),_==null||_(W,te)),W}function D(H){H.which===c.a.LEFT?A(!1,H):H.which===c.a.RIGHT&&A(!0,H),g==null||g(H)}function I(H){var te=A(!S,H);E==null||E(te,H)}var B=T()(s,h,(a={},Object(le.a)(a,"".concat(s,"-checked"),S),Object(le.a)(a,"".concat(s,"-disabled"),t),a));return w.createElement("button",Object.assign({},y,{type:"button",role:"switch","aria-checked":S,disabled:t,className:B,ref:o,onKeyDown:D,onClick:I}),f,w.createElement("span",{className:"".concat(s,"-inner")},S?v:m))});p.displayName="Switch",Ve.a=p},Y1PL:function(et,Ve,z){"use strict";z.r(Ve),z.d(Ve,"ResizableTextArea",function(){return Y});var le=z("wx14"),Q=z("1OyB"),j=z("vuIU"),w=z("Ji7U"),P=z("LK+K"),b=z("q1tI"),T=z("VTBJ"),C=z("rePB"),c=z("Zm9Q"),p=z("Kwbf"),d=z("c+Xe"),o=z("m+aA"),a=z("bdgK"),u=new Map;function s(de){de.forEach(function(Ce){var Se,Pe=Ce.target;(Se=u.get(Pe))===null||Se===void 0||Se.forEach(function(ye){return ye(Pe)})})}var h=new a.default(s),i=null,n=null;function t(de,Ce){u.has(de)||(u.set(de,new Set),h.observe(de)),u.get(de).add(Ce)}function f(de,Ce){u.has(de)&&(u.get(de).delete(Ce),u.get(de).size||(h.unobserve(de),u.delete(de)))}var v=function(de){Object(w.a)(Se,de);var Ce=Object(P.a)(Se);function Se(){return Object(Q.a)(this,Se),Ce.apply(this,arguments)}return Object(j.a)(Se,[{key:"render",value:function(){return this.props.children}}]),Se}(b.Component),m=b.createContext(null);function E(de){var Ce=de.children,Se=de.onBatchResize,Pe=b.useRef(0),ye=b.useRef([]),_e=b.useContext(m),Ge=b.useCallback(function(Ue,Fe,He){Pe.current+=1;var be=Pe.current;ye.current.push({size:Ue,element:Fe,data:He}),Promise.resolve().then(function(){be===Pe.current&&(Se==null||Se(ye.current),ye.current=[])}),_e==null||_e(Ue,Fe,He)},[Se,_e]);return b.createElement(m.Provider,{value:Ge},Ce)}function _(de){var Ce=de.children,Se=de.disabled,Pe=b.useRef(null),ye=b.useRef(null),_e=b.useContext(m),Ge=b.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),Ue=b.isValidElement(Ce)&&Object(d.c)(Ce),Fe=Ue?Ce.ref:null,He=b.useMemo(function(){return Object(d.a)(Fe,Pe)},[Fe,Pe]),be=b.useRef(de);be.current=de;var me=b.useCallback(function(We){var ze=be.current,nt=ze.onResize,re=ze.data,k=We.getBoundingClientRect(),U=k.width,q=k.height,$=We.offsetWidth,J=We.offsetHeight,xe=Math.floor(U),ke=Math.floor(q);if(Ge.current.width!==xe||Ge.current.height!==ke||Ge.current.offsetWidth!==$||Ge.current.offsetHeight!==J){var dt={width:xe,height:ke,offsetWidth:$,offsetHeight:J};Ge.current=dt;var Ne=$===Math.round(U)?U:$,je=J===Math.round(q)?q:J,tt=Object(T.a)(Object(T.a)({},dt),{},{offsetWidth:Ne,offsetHeight:je});_e==null||_e(tt,We,re),nt&&Promise.resolve().then(function(){nt(tt,We)})}},[]);return b.useEffect(function(){var We=Object(o.a)(Pe.current)||Object(o.a)(ye.current);return We&&!Se&&t(We,me),function(){return f(We,me)}},[Pe.current,Se]),b.createElement(v,{ref:ye},Ue?b.cloneElement(Ce,{ref:He}):Ce)}var g="rc-observer-key";function y(de){var Ce=de.children,Se=Object(c.a)(Ce);return Se.map(function(Pe,ye){var _e=(Pe==null?void 0:Pe.key)||"".concat(g,"-").concat(ye);return b.createElement(_,Object(le.a)({},de,{key:_e}),Pe)})}y.Collection=E;var x=y,l=z("bT9E"),S=z("TSYQ"),O=z.n(S),A=`
|
|
|
min-height:0 !important;
|
|
|
max-height:none !important;
|
|
|
height:0 !important;
|
|
|
visibility:hidden !important;
|
|
|
overflow:hidden !important;
|
|
|
position:absolute !important;
|
|
|
z-index:-1000 !important;
|
|
|
top:0 !important;
|
|
|
right:0 !important
|
|
|
`,D=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],I={},B;function H(de){var Ce=arguments.length>1&&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"),_e=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:_e,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),_e=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-=_e),Se!==null||Pe!==null){B.value=" ";var ze=B.scrollHeight-_e;Se!==null&&(He=ze*Se,Ue==="border-box"&&(He=He+_e+Ge),me=Math.max(He,me)),Pe!==null&&(be=ze*Pe,Ue==="border-box"&&(be=be+_e+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(_e){ye.textArea=_e},ye.handleResize=function(_e){var Ge=ye.state.resizeStatus,Ue=ye.props,Fe=Ue.autoSize,He=Ue.onResize;if(Ge!==X.NONE)return;typeof He=="function"&&He(_e),Fe&&ye.resizeOnNextFrame()},ye.resizeOnNextFrame=function(){cancelAnimationFrame(ye.nextFrameActionId),ye.nextFrameActionId=requestAnimationFrame(ye.resizeTextarea)},ye.resizeTextarea=function(){var _e=ye.props.autoSize;if(!_e||!ye.textArea)return;var Ge=_e.minRows,Ue=_e.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 _e=ye.props,Ge=_e.prefixCls,Ue=Ge===void 0?"rc-textarea":Ge,Fe=_e.autoSize,He=_e.onResize,be=_e.className,me=_e.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,_e=this.textArea.selectionEnd;this.textArea.setSelectionRange(ye,_e)}}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 _e=typeof Pe.value=="undefined"||Pe.value===null?Pe.defaultValue:Pe.value;return ye.state={value:_e},ye}return Object(j.a)(Se,[{key:"setValue",value:function(ye,_e){"value"in this.props||this.setState({value:ye},_e)}},{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=E.getWordUntilPosition(_),l={startLineNumber:_.lineNumber,endLineNumber:_.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 E={label:"ifelse",kind:m.languages.CompletionItemKind.Method,insertText:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
|
|
|
`),insertTextRules:m.languages.CompletionItemInsertTextRule.InsertAsSnippet},_=["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=[E,{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]:[],E=m;if(Array.isArray(m)){for(var _=0;_<m.length;_++){var g=i[m[_]];if(g)return g}return E[0]}return i[E]||E}var t=null,f=Ve.b=function(m){var E=m.width,_=E===void 0?"100%":E,g=m.height,y=g===void 0?"100%":g,x=m.value,l=m.language,S=l===void 0?"javascript":l,O=m.style,A=O===void 0?{}:O,D=m.options,I=D===void 0?{}:D,B=m.overrideServices,H=B===void 0?{}:B,te=m.theme,W=te===void 0?"vs-dark":te,V=m.onEditBlur,X=m.onSave,ne=m.autoHeight,Y=ne===void 0?!1:ne,ee=m.forbidCopy,ce=ee===void 0?!1:ee,de=m.onChange,Ce=de===void 0?s:de,Se=m.editorDidMount,Pe=Se===void 0?s:Se,ye=m.onFocus,_e=ye===void 0?s:ye,Ge=m.filename,Ue=Ge===void 0?"educoder.txt":Ge,Fe=Object(b.a)(m,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename"]),He=Object(T.useRef)(),be=Object(T.useRef)({}),me=Object(T.useRef)(),We=Object(T.useRef)(!1),ze=Object(T.useRef)(),nt=Object(T.useState)(!1),re=Object(P.a)(nt,2),k=re[0],U=re[1];function q(){var Le;return He.current&&(Le=new c.default(function(Te){var Ze=Object(w.a)(Te),ut;try{for(Ze.s();!(ut=Ze.n()).done;){var Ct=ut.value;(Ct.target.offsetHeight>0||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();Ee(Te<y?y:Te)}else Ee(y)};function Ne(Le){var Te=document.createEvent("MouseEvents");Te.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),Le.dispatchEvent(Te)}function je(Le,Te){var Ze=window.URL||window.webkitURL||window,ut=new Blob([Te]),Ct=document.createElementNS("http://www.w3.org/1999/xhtml","a");Ct.href=Ze.createObjectURL(ut),Ct.download=Le,Ne(Ct)}Object(T.useEffect)(function(){dt()},[dt]),Object(T.useEffect)(function(){He.current&&!k&&z.e(27).then(z.t.bind(null,"M/lh",7)).then(function(Le){try{t=Le,be.current.instance=t.editor.create(He.current,{value:x,language:n(S),theme:W,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0},H);var Te=be.current.instance;if(Pe(Te,t),setTimeout(function(){dt(),be.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){je(Ue||"educoder.txt",Te.getValue())}})},500),be.current.subscription=Te.onDidChangeModelContent(function(ut){We.current?clearTimeout(ze.current):(dt(),Ce(Te.getValue(),ut)),ze.current=setTimeout(function(){We.current=!1},500)}),window.Monaco||d(t),ce&&(Te.addCommand(t.KeyMod.CtrlCmd|t.KeyMod.Shift|t.KeyCode.KEY_V,function(){return $(),null}),Te.addCommand(t.KeyMod.CtrlCmd|t.KeyCode.KEY_C,function(){return $(),null})),window.Monaco=t,V&&Te.onDidBlurEditorWidget(function(){V(Te.getValue())}),_e&&Te.onDidFocusEditorText(function(){_e(Te.getValue())}),ce){Te.addCommand(t.KeyMod.CtrlCmd|t.KeyCode.KEY_V,function(){return $(),null}),Te.onDidPaste(function(ut){be.current.pastePos=ut});try{window.addEventListener("paste",xe)}catch(ut){}}var Ze=q();return U(!0),function(){var ut=be.current.instance;ut.dispose();var Ct=ut.getModel();Ct&&Ct.dispose(),be.current.subscription&&be.current.subscription.dispose(),ce&&window.removeEventListener("paste",xe),Ze.unobserve(He.current)}}catch(ut){}})},[]),Object(T.useEffect)(function(){var Le=be.current.instance;if(Le&&k)return document.addEventListener("keydown",ke,!1),function(){document.removeEventListener("keydown",ke)}},[X,k]),Object(T.useEffect)(function(){var Le=be.current.instance;if(Le&&k){var Te=n(S);t.editor.setModelLanguage(Le.getModel(),Te),console.log("language:",S,Le.getModel(),Te)}},[S,k]),Object(T.useEffect)(function(){var Le=be.current.instance;Le&&k&&t.editor.setTheme(W)},[W,k]),Object(T.useEffect)(function(){var Le=be.current.instance;Le&&k&&(Le.updateOptions(Object(le.a)({},I)),setTimeout(function(){Le.getModel().updateOptions(Object(le.a)({},I))},200))},[JSON.stringify(I),k]),Object(T.useEffect)(function(){var Le=be.current.instance;Le&&k&&Le.layout()},[_,y,k]);var tt=Object(T.useState)(u(_)),mt=Object(P.a)(tt,2),Qe=mt[0],Xe=mt[1],Be=Object(T.useState)(u(y)),Ie=Object(P.a)(Be,2),Me=Ie[0],Ee=Ie[1],Ae=Object(le.a)(Object(le.a)({},A),{},{width:Qe,height:Me});return C.a.createElement("div",{className:"my-monaco-editor",ref:He,style:Ae})};function v(m){var E=m.width,_=E===void 0?"100%":E,g=m.height,y=g===void 0?"100%":g,x=m.original,l=m.modified,S=m.language,O=m.options,A=O===void 0?{}:O,D=Object(T.useRef)(),I=Object(T.useState)(null),B=Object(P.a)(I,2),H=B[0],te=B[1];function W(Y){var ee;return D.current&&(ee=new c.default(function(ce){var de=Object(w.a)(ce),Ce;try{for(de.s();!(Ce=de.n()).done;){var Se=Ce.value;(Se.target.offsetHeight>0||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(_),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.clientHeight<d.scrollHeight||d.clientWidth<d.scrollWidth){var a=getComputedStyle(d,null);return Q(a.overflowY,o)||Q(a.overflowX,o)||function(u){var s=function(h){if(!h.ownerDocument||!h.ownerDocument.defaultView)return null;try{return h.ownerDocument.defaultView.frameElement}catch(i){return null}}(u);return!!s&&(s.clientHeight<u.scrollHeight||s.clientWidth<u.scrollWidth)}(d)}return!1}function w(d,o,a,u,s,h,i,n){return h<d&&i>o||h>d&&i<o?0:h<=d&&n<=a||i>=o&&n>=a?h-d-u:i>o&&n<a||h<d&&n>a?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 E=a.visualViewport?a.visualViewport.width:innerWidth,_=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<v.length;W++){var V=v[W],X=V.getBoundingClientRect(),ne=X.height,Y=X.width,ee=X.top,ce=X.right,de=X.bottom,Ce=X.left;if(u==="if-needed"&&O>=0&&I>=0&&D<=_&&A<=E&&O>=ee&&D<=de&&I>=Ce&&A<=ce)return te;var Se=getComputedStyle(V),Pe=parseInt(Se.borderLeftWidth,10),ye=parseInt(Se.borderTopWidth,10),_e=parseInt(Se.borderRightWidth,10),Ge=parseInt(Se.borderBottomWidth,10),Ue=0,Fe=0,He="offsetWidth"in V?V.offsetWidth-V.clientWidth-Pe-_e:0,be="offsetHeight"in V?V.offsetHeight-V.clientHeight-ye-Ge:0;if(f===V)Ue=s==="start"?B:s==="end"?B-_:s==="nearest"?w(y,y+_,_,ye,Ge,y+B,y+B+l,l):B-_/2,Fe=h==="start"?H:h==="center"?H-E/2:h==="end"?H-E:w(g,g+E,E,Pe,_e,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+_e+He:w(Ce,ce,Y,Pe,_e+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(_){n.current&&i(_.pageX)}function E(){n.current=!1}return window.addEventListener("mousemove",m),window.addEventListener("mouseup",E),function(){window.removeEventListener("mousemove",m),window.removeEventListener("mouseup",E)}},[]);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<<le;for(var le=8;le<256;le++)z.EXP_TABLE[le]=z.EXP_TABLE[le-4]^z.EXP_TABLE[le-5]^z.EXP_TABLE[le-6]^z.EXP_TABLE[le-8];for(var le=0;le<255;le++)z.LOG_TABLE[z.EXP_TABLE[le]]=le;et.exports=z},dWSS:function(et,Ve,z){var le=z("dQei");function Q(j,w){if(j.length==null)throw new Error(j.length+"/"+w);for(var P=0;P<j.length&&j[P]==0;)P++;this.num=new Array(j.length-P+w);for(var b=0;b<j.length-P;b++)this.num[b]=j[b+P]}Q.prototype={get:function(j){return this.num[j]},getLength:function(){return this.num.length},multiply:function(j){for(var w=new Array(this.getLength()+j.getLength()-1),P=0;P<this.getLength();P++)for(var b=0;b<j.getLength();b++)w[P+b]^=le.gexp(le.glog(this.get(P))+le.glog(j.get(b)));return new Q(w,0)},mod:function(j){if(this.getLength()-j.getLength()<0)return this;for(var w=le.glog(this.get(0))-le.glog(j.get(0)),P=new Array(this.getLength()),b=0;b<this.getLength();b++)P[b]=this.get(b);for(var b=0;b<j.getLength();b++)P[b]^=le.gexp(le.glog(j.get(b))+w);return new Q(P,0).mod(j)}},et.exports=Q},dejd:function(et,Ve,z){},dmUQ:function(et,Ve,z){"use strict";var le=z("Ff2n"),Q=z("rePB"),j=z("1OyB"),w=z("vuIU"),P=z("Ji7U"),b=z("md7G"),T=z("foSv"),C=z("q1tI"),c=z.n(C),p=z("TSYQ"),d=z.n(p),o=z("4IlW");function a(l,S){var O=Object.keys(l);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(l);S&&(A=A.filter(function(D){return Object.getOwnPropertyDescriptor(l,D).enumerable})),O.push.apply(O,A)}return O}function u(l){for(var S=1;S<arguments.length;S++){var O=arguments[S]!=null?arguments[S]:{};S%2?a(Object(O),!0).forEach(function(A){Object(Q.a)(l,A,O[A])}):Object.getOwnPropertyDescriptors?Object.defineProperties(l,Object.getOwnPropertyDescriptors(O)):a(Object(O)).forEach(function(A){Object.defineProperty(l,A,Object.getOwnPropertyDescriptor(O,A))})}return l}function s(l){var S=h();return function(){var A=Object(T.a)(l),D;if(S){var I=Object(T.a)(this).constructor;D=Reflect.construct(A,arguments,I)}else D=A.apply(this,arguments);return Object(b.a)(this,D)}}function h(){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(l){return!1}}function i(){}function n(l){l.preventDefault()}var t=function(S){return S.replace(/[^\w.-]+/g,"")},f=200,v=600,m=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,E=function(S){return S!=null},_=function(S,O){return O===S||typeof O=="number"&&typeof S=="number"&&isNaN(O)&&isNaN(S)},g=function(l){Object(P.a)(O,l);var S=s(O);function O(A){var D;Object(j.a)(this,O),D=S.call(this,A),D.onKeyDown=function(H){var te=D.props,W=te.onKeyDown,V=te.onPressEnter;if(H.keyCode===o.a.UP){var X=D.getRatio(H);D.up(H,X,null),D.stop()}else if(H.keyCode===o.a.DOWN){var ne=D.getRatio(H);D.down(H,ne,null),D.stop()}else H.keyCode===o.a.ENTER&&V&&V(H);if(D.recordCursorPosition(),D.lastKeyCode=H.keyCode,W){for(var Y=arguments.length,ee=new Array(Y>1?Y-1:0),ce=1;ce<Y;ce++)ee[ce-1]=arguments[ce];W.apply(void 0,[H].concat(ee))}},D.onKeyUp=function(H){var te=D.props.onKeyUp;if(D.stop(),D.recordCursorPosition(),te){for(var W=arguments.length,V=new Array(W>1?W-1:0),X=1;X<W;X++)V[X-1]=arguments[X];te.apply(void 0,[H].concat(V))}},D.onChange=function(H){var te=D.props.onChange;D.state.focused&&(D.inputting=!0),D.rawInput=D.props.parser(D.getValueFromEvent(H)),D.setState({inputValue:D.rawInput}),te(D.toNumber(D.rawInput))},D.onMouseUp=function(){var H=D.props.onMouseUp;D.recordCursorPosition(),H&&H.apply(void 0,arguments)},D.onFocus=function(){var H;D.setState({focused:!0}),(H=D.props).onFocus.apply(H,arguments)},D.onBlur=function(){var H=D.props.onBlur;D.inputting=!1,D.setState({focused:!1});var te=D.getCurrentValidValue(D.state.inputValue),W=D.setValue(te,i);if(H){var V=D.input.value,X=D.getInputDisplayValue({focus:!1,value:W});D.input.value=X&&Number(X),H.apply(void 0,arguments),D.input.value=V}},D.getRatio=function(H){var te=1;return H.metaKey||H.ctrlKey?te=.1:H.shiftKey&&(te=10),te},D.getFullNum=function(H){return isNaN(H)?H:/e/i.test(String(H))?Number(H).toFixed(18).replace(/\.?0+$/,""):H},D.getPrecision=function(H){if(E(D.props.precision))return D.props.precision;var te=String(H);if(te.indexOf("e-")>=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 E(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(!_(D.value,B)||!_(D.max,te)||!_(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"&&Y<W&&H&&H(W)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var ee=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===o.a.BACKSPACE?ee=this.cursorStart-1:this.lastKeyCode===o.a.DELETE&&(ee=this.cursorStart):ee=this.input.value.length,this.fixCaret(ee,ee)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case o.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case o.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(ce){}if(this.lastKeyCode=null,!this.pressingUpOrDown)return;this.props.focusOnUpDown&&this.state.focused&&(document.activeElement!==this.input&&this.focus())}},{key:"componentWillUnmount",value:function(){this.stop()}},{key:"getCurrentValidValue",value:function(D){var I=D;return I===""?I="":this.isNotCompleteNumber(parseFloat(I))?I=this.state.value:I=this.getValidValue(I),this.toNumber(I)}},{key:"getValueFromEvent",value:function(D){var I=D.target.value.trim().replace(/。/g,".");return E(this.props.decimalSeparator)&&(I=I.replace(this.props.decimalSeparator,".")),I}},{key:"getValidValue",value:function(D){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,B=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,H=parseFloat(D);return isNaN(H)?D:(H<I&&(H=I),H>B&&(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(E(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:E(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||X<W.min;if(X>W.max?X=W.max:X<W.min&&(X=W.min),this.setValue(X,null),this.setState({focused:!0},function(){B.pressingUpOrDown=!1}),ne)return;this.autoStepTimer=setTimeout(function(){B[D](I,H,!0)},te?f:v)}},{key:"fixCaret",value:function(D,I){if(D===void 0||I===void 0||!this.input||!this.input.value)return;try{var B=this.input.selectionStart,H=this.input.selectionEnd;(D!==B||I!==H)&&this.input.setSelectionRange(D,I)}catch(te){}}},{key:"render",value:function(){var D,I=this.props,B=I.prefixCls,H=I.disabled,te=I.readOnly,W=I.useTouch,V=I.autoComplete,X=I.upHandler,ne=I.downHandler,Y=I.className,ee=I.max,ce=I.min,de=I.style,Ce=I.title,Se=I.onMouseEnter,Pe=I.onMouseLeave,ye=I.onMouseOver,_e=I.onMouseOut,Ge=I.required,Ue=I.onClick,Fe=I.tabIndex,He=I.type,be=I.placeholder,me=I.id,We=I.inputMode,ze=I.pattern,nt=I.step,re=I.maxLength,k=I.autoFocus,U=I.name,q=I.onPaste,$=I.onInput,J=Object(le.a)(I,["prefixCls","disabled","readOnly","useTouch","autoComplete","upHandler","downHandler","className","max","min","style","title","onMouseEnter","onMouseLeave","onMouseOver","onMouseOut","required","onClick","tabIndex","type","placeholder","id","inputMode","pattern","step","maxLength","autoFocus","name","onPaste","onInput"]),xe=this.state,ke=xe.value,dt=xe.focused,Ne=d()(B,(D={},Object(Q.a)(D,Y,!!Y),Object(Q.a)(D,"".concat(B,"-disabled"),H),Object(Q.a)(D,"".concat(B,"-focused"),dt),D)),je={};Object.keys(J).forEach(function(Te){(Te.substr(0,5)==="data-"||Te.substr(0,5)==="aria-"||Te==="role")&&(je[Te]=J[Te])});var tt=!te&&!H,mt=this.getInputDisplayValue(null),Qe=(ke||ke===0)&&(isNaN(ke)||Number(ke)>=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)),Ee=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:_e,onFocus:function(){return null},onBlur:function(){return null}},c.a.createElement("div",{className:"".concat(B,"-handler-wrap")},c.a.createElement("span",Object.assign({unselectable:"on"},Ae,{role:"button","aria-label":"Increase Value","aria-disabled":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:Ee}),ne||c.a.createElement("span",{unselectable:"on",className:"".concat(B,"-handler-down-inner"),onClick:n}))),c.a.createElement("div",{className:"".concat(B,"-input-wrap")},c.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":ce,"aria-valuemax":ee,"aria-valuenow":ke,required: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<this.data.length;w++)j.put(this.data.charCodeAt(w),8)}},et.exports=Q},fcSX:function(et,Ve,z){"use strict";var le=z("Ff2n"),Q=z("1OyB"),j=z("vuIU"),w=z("Ji7U"),P=z("md7G"),b=z("foSv"),T=z("1W/9"),C=z("q1tI"),c=z("rePB"),p=z("JX7q"),d=z("TSYQ"),o=z.n(d),a=z("qx4F"),u=z("4IlW");function s(H){return Array.isArray(H)?H:[H]}var h={transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend"},i=Object.keys(h).filter(function(H){if(typeof document=="undefined")return!1;var te=document.getElementsByTagName("html")[0];return H in(te?te.style:{})})[0],n=h[i];function t(H,te,W,V){H.addEventListener?H.addEventListener(te,W,V):H.attachEvent&&H.attachEvent("on".concat(te),W)}function f(H,te,W,V){H.removeEventListener?H.removeEventListener(te,W,V):H.attachEvent&&H.detachEvent("on".concat(te),W)}function v(H,te){var W=typeof H=="function"?H(te):H;return Array.isArray(W)?W.length===2?W:[W[0],W[1]]:[W]}var m=function(te){return!isNaN(parseFloat(te))&&isFinite(te)},E=!(typeof window!="undefined"&&window.document&&window.document.createElement),_=function H(te,W,V,X){if(!W||W===document||W instanceof Document)return!1;if(W===te.parentNode)return!0;var ne=Math.max(Math.abs(V),Math.abs(X))===Math.abs(X),Y=Math.max(Math.abs(V),Math.abs(X))===Math.abs(V),ee=W.scrollHeight-W.clientHeight,ce=W.scrollWidth-W.clientWidth,de=document.defaultView.getComputedStyle(W),Ce=de.overflowY==="auto"||de.overflowY==="scroll",Se=de.overflowX==="auto"||de.overflowX==="scroll",Pe=ee&&Ce,ye=ce&&Se;return ne&&(!Pe||Pe&&(W.scrollTop>=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&&_(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,_e=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=_e&&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(!E){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"],_e=[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",_e.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),_e.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),_e="transform ".concat(ce," ").concat(de);X.dom.style.transition="none";switch(ee){case"right":X.dom.style.transform="translateX(-".concat(ne,"px)");break;case"top":case"bottom":X.dom.style.width="calc(100% - ".concat(ne,"px)"),X.dom.style.transform="translateZ(0)";break;default:break}clearTimeout(X.timeout),X.timeout=setTimeout(function(){X.dom&&(X.dom.style.transition="".concat(_e,",").concat(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,_e="width ".concat(ce," ").concat(de),Ge="transform ".concat(ce," ").concat(de);switch(ee){case"left":{X.dom.style.width="100%",_e="width 0s ".concat(de," ").concat(ce);break}case"right":{X.dom.style.transform="translateX(".concat(ne,"px)"),X.dom.style.width="100%",_e="width 0s ".concat(de," ").concat(ce),X.maskDom&&(X.maskDom.style.left="-".concat(ne,"px"),X.maskDom.style.width="calc(100% + ".concat(ne,"px)"));break}case"top":case"bottom":{X.dom.style.width="calc(100% + ".concat(ne,"px)"),X.dom.style.height="100%",X.dom.style.transform="translateZ(0)",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(_e),X.dom.style.transform="",X.dom.style.width="",X.dom.style.height="")})},X.getCurrentDrawerSome=function(){return!Object.keys(x).some(function(ne){return x[ne]})},X.getLevelDom=function(ne){var Y=ne.level,ee=ne.getContainer;if(E)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(!E){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,_e=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()(_e,(X={},Object(c.a)(X,"".concat(_e,"-").concat(Ge),!0),Object(c.a)(X,"".concat(_e,"-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(_e,"-mask"),onClick:k?q:void 0,style:U,ref:function(Me){ne.maskDom=Me}}),C.createElement("div",{className:"".concat(_e,"-content-wrapper"),style:{transform:Xe,msTransform:Xe,width:m(Ce)?"".concat(Ce,"px"):Ce,height:m(Se)?"".concat(Se,"px"):Se},ref:function(Me){ne.contentWrapper=Me}},C.createElement("div",{className:"".concat(_e,"-content"),ref:function(Me){ne.contentDom=Me},onTouchStart: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(_e){var Ge=_e.visible,Ue=_e.afterClose,Fe=Object(le.a)(_e,["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,E=h.dataIndex,_=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,E);if(Ce=Se,_){var Pe=_(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||{},_e=ye.colSpan,Ge=ye.rowSpan,Ue=ye.style,Fe=ye.className,He=Object(j.a)(ye,["colSpan","rowSpan","style","className"]),be=_e!==void 0?_e: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;z<j;z+=1)P[z]=str(z,b)||"null";return Q=P.length===0?"[]":gap?`[
|
|
|
`+gap+P.join(`,
|
|
|
`+gap)+`
|
|
|
`+w+"]":"["+P.join(",")+"]",gap=w,Q}if(rep&&typeof rep=="object")for(j=rep.length,z=0;z<j;z+=1)typeof rep[z]=="string"&&(le=rep[z],Q=str(le,b),Q&&P.push(quote(le)+(gap?": ":":")+Q));else for(le in b)Object.prototype.hasOwnProperty.call(b,le)&&(Q=str(le,b),Q&&P.push(quote(le)+(gap?": ":":")+Q));return Q=P.length===0?"{}":gap?`{
|
|
|
`+gap+P.join(`,
|
|
|
`+gap)+`
|
|
|
`+w+"}":"{"+P.join(",")+"}",gap=w,Q}}typeof JSON.stringify!="function"&&(meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},JSON.stringify=function(et,Ve,z){var le;if(gap="",indent="",typeof z=="number")for(le=0;le<z;le+=1)indent+=" ";else typeof z=="string"&&(indent=z);if(rep=Ve,Ve&&typeof Ve!="function"&&(typeof Ve!="object"||typeof Ve.length!="number"))throw new Error("JSON.stringify");return str("",{"":et})}),typeof JSON.parse!="function"&&(JSON.parse=function(text,reviver){var j;function walk(et,Ve){var z,le,Q=et[Ve];if(Q&&typeof Q=="object")for(z in Q)Object.prototype.hasOwnProperty.call(Q,z)&&(le=walk(Q,z),le!==void 0?Q[z]=le:delete Q[z]);return reviver.call(et,Ve,Q)}if(text=String(text),rx_dangerous.lastIndex=0,rx_dangerous.test(text)&&(text=text.replace(rx_dangerous,function(et){return"\\u"+("0000"+et.charCodeAt(0).toString(16)).slice(-4)})),rx_one.test(text.replace(rx_two,"@").replace(rx_three,"]").replace(rx_four,"")))return j=eval("("+text+")"),typeof reviver=="function"?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})}()},gqXR:function(et,Ve,z){et.exports=z.p+"static/g.a5bcde87.svg"},hW8S:function(et,Ve,z){"use strict";z.d(Ve,"a",function(){return w}),z.d(Ve,"c",function(){return P}),z.d(Ve,"b",function(){return b});var le=z("VTBJ"),Q=z("Ff2n"),j=z("Kwbf"),w="RC_TABLE_INTERNAL_COL_DEFINE";function P(T){var C=T.expandable,c=Object(Q.a)(T,["expandable"]);return"expandable"in T?Object(le.a)(Object(le.a)({},c),C):c}function b(T){return Object.keys(T).reduce(function(C,c){return(c.substr(0,5)==="data-"||c.substr(0,5)==="aria-")&&(C[c]=T[c]),C},{})}},hgre:function(et,Ve,z){"use strict";var le=z("miYZ"),Q=z("tsqr"),j=z("9og8"),w=z("WmNS"),P=z.n(w),b=z("q1tI"),T=z.n(b),C=z("GUcZ"),c=z("ulZh"),p=z.n(c),d=z("xKgJ"),o=z("bntm"),a=z("4xil"),u=z.n(a);function s(t){if(isNaN(t))return{minutes:"00",seconds:"00"};var f=new Date(t*1e3).toISOString().substr(11,8);return{minutes:f.substr(3,2),seconds:f.substr(6,2)}}Object.defineProperty(HTMLMediaElement.prototype,"playing",{get:function(){return this.currentTime>0&&!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;v<t.length-1;v++){var m=Math.abs(t[v+1]-t[v]);m<21&&(f+=m)}return f}var n=/(android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini)/i;Ve.a=Object(b.forwardRef)(function(t,f){var v,m=t.src,E=t.toLog,_=t.videoId,g=t.logWatchHistory,y=t.courseId,x=y===void 0?null:y,l=t.startTime,S=t.handlePause,O=S===void 0?function(){}:S,A=t.handlePlay,D=A===void 0?function(){}:A,I=t.handlePlayEnded,B=I===void 0?function(){}:I,H=t.videoSpeed,te=H===void 0?1:H,W=m==null||((v=m.split("."))===null||v===void 0)?void 0:v.pop(),V=W==="flv",X=Object(b.useRef)(),ne=Object(b.useRef)(),Y=Object(b.useRef)(),ee=Object(b.useRef)(),ce=Object(b.useRef)(),de=Object(b.useRef)(),Ce=Object(b.useRef)(),Se=Object(b.useRef)(),Pe=Object(b.useRef)(),ye=Object(b.useRef)(),_e=Object(b.useRef)(),Ge=Object(b.useRef)(),Ue=Object(b.useRef)(),Fe=Object(b.useRef)(),He=navigator.userAgent.toLowerCase().match(n),be=He?He[0]:"pc",me=Object(b.useRef)(!1),We=Object(d.y)(),ze=0,nt=0,re=0,k=null,U=!1,q=20,$=1,J=!1,xe=!1,ke=[];Object(b.useImperativeHandle)(f,function(){return{getLastUpdatedTime:function(){return X.current.currentTime},getDuration:function(){return X.current.duration}}});var dt=Object(b.useCallback)(function(Qe){var Xe=arguments.length>1&&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(_,10),Be.course_id=x):Be.video_id=_,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 Ee(){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()}},Ee)})),Me.apply(this,arguments)}Ie()},[_,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(){_e.current.style.display="none",Ue.current.style.display="none",Ge.current.style.display="none",X.current.muted||X.current.volume===0?_e.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,E&&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),E&&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 Ee(){de.current.value=Math.floor(X.current.currentTime),Ce.current.value=Math.floor(X.current.currentTime)}function Ae(){var at=s(Math.round(X.current.currentTime));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")),Ee(),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),E&&dt())):(re=kt,E&&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),E&&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:_e,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 _=C.a.subscribe("preview-image",function(g){s(g),document.body.style.overflow="hidden"});return _},[]),Object(w.useEffect)(function(){return document.addEventListener("keydown",v),function(){document.removeEventListener("keydown",v)}},[]),Object(w.useEffect)(function(){f.current=u},[u]);function v(_){_.keyCode==27&&f.current&&m()}function m(){document.body.style.overflow="auto",s("")}function E(){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:E},"\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==_){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=E,W.htmlState=null)}return W.trailingSpace=0,W.trailingSpaceNewLine=!1,W.prevLine=W.thisLine,W.thisLine={stream:null},null}function E(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<V.listStack[V.listStack.length-1];)V.listStack.pop(),V.listStack.length?V.indentation=V.listStack[V.listStack.length-1]:V.list=!1;V.list!==!1&&(V.indentationDiff=Ce-V.listStack[V.listStack.length-1])}var Se=!ne&&!ee&&!V.prevLine.header&&(!ce||!Y)&&!V.prevLine.fencedCodeEnd,Pe=(V.list===!1||ee||ne)&&V.indentation<=de&&W.match(c),ye=null;if(V.indentationDiff>=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 _e=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-"+_e]),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 _(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=E,V.htmlState=null)}return X}function g(W,V){var X=V.listStack[V.listStack.length-1]||0,ne=V.indentation<X,Y=X+3;if(V.fencedEndRE&&V.indentation<=Y&&(ne||W.match(V.fencedEndRE))){j.highlightFormatting&&(V.formatting="code-block");var ee;return ne||(ee=y(V)),V.localMode=V.localState=null,V.block=E,V.f=l,V.fencedEndRE=null,V.code=0,V.thisLine.fencedCodeEnd=!0,ne?f(W,V,V.block):ee}else return V.localMode?V.localMode.token(W,V.localState):(W.skipToEnd(),T.code)}function y(W){var V=[];if(W.formatting){V.push(T.formatting),typeof W.formatting=="string"&&(W.formatting=[W.formatting]);for(var X=0;X<W.formatting.length;X++)V.push(T.formatting+"-"+W.formatting[X]),W.formatting[X]==="header"&&V.push(T.formatting+"-"+W.formatting[X]+"-"+W.header),W.formatting[X]==="quote"&&(!j.maxBlockquoteDepth||j.maxBlockquoteDepth>=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 _e=W.string.indexOf(">",W.pos);if(_e!=-1){var Ge=W.string.substring(W.start,_e);/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,_)}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:E,prevLine:{stream:null},thisLine:{stream:null},block:E,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!=_)){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==_?{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==_&&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:"<!--",blockCommentEnd:"-->",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,E=i.ch-(f?f[0].length:0);if(!f||!(v=d(i)))return;if(v=="selfClose")continue;if(f[1]){for(var _=t.length-1;_>=0;--_)if(t[_]==f[2]){t.length=_;break}if(_<0&&(!n||n==f[2]))return{tag:f[2],from:Q(m,E),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,E=o(i);if(!E)return;if(E[1])t.push(E[2]);else{for(var _=t.length-1;_>=0;--_)if(t[_]==E[2]){t.length=_;break}if(_<0&&(!n||n==E[2]))return{tag:E[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),E=s(t,f[2]);return E&&j(E.from,m)>0?{from:m,to:E.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),E=v&&o(f);if(!v||!E||j(f,n)>0)return;var _={from:Q(f.line,f.ch),to:m,tag:E[2]};return v=="selfClose"?{open:_,close:null,at:"open"}:E[1]?{open:h(f,E[2]),close:_,at:"close"}:(f=new T(i,m.line,m.ch,t),{open:_,close:s(f,E[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 E=new T(i,n.line,n.ch,t),_=s(E,m.tag);if(_)return{open:m,close:_}}},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,E=u.close,_=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")},E&&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:_},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;p<T.length;p++)C(T[p]);return C}return w}()({1:[function(w,P,b){"use strict";var T=w("./browser/client");T.Buffer=w("buffer").Buffer,T.co=w("co"),T.urllib=w("../shims/xhr"),T.version=w("./browser/version").version,P.exports=T},{"../shims/xhr":244,"./browser/client":2,"./browser/version":5,buffer:38,co:41}],2:[function(w,P,b){(function(T,C){"use strict";function c(ne){return ne&&ne.__esModule?ne:{default:ne}}function p(ne,Y){return ne[Y]||ne[Y.toLowerCase()]}function d(ne,Y){var ee=l.parse(ne);if(!ee.protocol){var ce=Y?"https://":"http://";ee=l.parse(ce+ne)}if(ee.protocol!=="http:"&&ee.protocol!=="https:")throw new Error("Endpoint protocol must be http or https.");return ee}function o(ne,Y,ee){var ce=ee?"https://":"http://",de=Y?"-internal.aliyuncs.com":".aliyuncs.com";return ne.substr(0,"vpc100-oss-cn-".length)==="vpc100-oss-cn-"&&(de=".aliyuncs.com"),l.parse(ce+ne+de)}function a(){return document&&document.location&&document.location.protocol==="https:"}function u(ne,Y){if(!(this instanceof u))return new u(ne,Y);ne&&ne.inited?this.options=ne:this.options=u.initOptions(ne),this.options.cancelFlag=!1,this.options.urllib?this.urllib=this.options.urllib:(this.urllib=D,this.agent=this.options.agent||V),this.ctx=Y,this.userAgent=this._getUserAgent(),this.options.amendTimeSkewed=0}var s=w("babel-runtime/regenerator"),h=c(s),i=w("babel-runtime/core-js/object/keys"),n=c(i),t=w("debug")("ali-oss"),f=w("./../../shims/crypto/crypto.js"),v=w("path"),m=w("copy-to"),E=w("mime"),_=w("xml2js"),g=w("humanize-ms"),y=w("agentkeepalive"),x=w("merge-descriptors"),l=w("url"),S=w("is-type-of"),O=w("platform"),A=w("utility"),D=w("urllib"),I=w("./version"),B=w("dateformat"),H=w("bowser"),te=w("../common/signUtils"),W=w("../common/utils"),V=new y;P.exports=u,u.initOptions=function(ne){if(!ne||!ne.accessKeyId||!ne.accessKeySecret)throw new Error("require accessKeyId, accessKeySecret");var Y=a(),ee={region:"oss-cn-hangzhou",internal:!1,secure:Y,bucket:null,endpoint:null,cname:!1};if((0,n.default)(ne).forEach(function(ce){ne[ce]!==void 0&&(ee[ce]=ne[ce])}),ee.accessKeyId=ee.accessKeyId.trim(),ee.accessKeySecret=ee.accessKeySecret.trim(),ee.timeout&&(ee.timeout=g(ee.timeout)),ee.endpoint)ee.endpoint=d(ee.endpoint,ee.secure);else{if(!ee.region)throw new Error("require options.endpoint or options.region");ee.endpoint=o(ee.region,ee.internal,ee.secure)}return ee.inited=!0,ee};var X=u.prototype;x(X,w("./object")),x(X,w("./managed_upload")),x(X,w("../common/multipart")),x(X,w("../common/thunkpool.js")),u.Wrapper=w("./wrapper"),X.signature=function(ne){return t("authorization stringToSign: %s",ne),te.computeSignature(this.options.accessKeySecret,ne)},X.authorization=function(ne,Y,ee,ce){var de=te.buildCanonicalString(ne.toUpperCase(),Y,{headers:ce,parameters:ee});return te.authorization(this.options.accessKeyId,this.options.accessKeySecret,de)},X.createRequest=function(ne){var Y={"x-oss-date":B(+new Date+this.options.amendTimeSkewed,"UTC:ddd, dd mmm yyyy HH:MM:ss 'GMT'"),"x-oss-user-agent":this.userAgent};this.options.stsToken&&(Y["x-oss-security-token"]=this.options.stsToken),m(ne.headers).to(Y),p(Y,"Content-Type")||(ne.mime===E.default_type&&(ne.mime=""),ne.mime&&ne.mime.indexOf("/")>0?Y["Content-Type"]=ne.mime:Y["Content-Type"]=E.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()),_.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,E){if(!(this instanceof c))return new c(m,E);v.call(this,E),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(_)?g.mime=i.getType(h.extname(_.name)):u.blob(_)?g.mime=_.type:g.mime=i.getType(h.extname(_))),g.headers=g.headers||{},this._convertMetaToHeaders(g.meta,g.headers),H.next=12,this._getFileSize(_);case 12:if(!((x=H.sent)<y)){H.next=25;break}return l=this._createStream(_,0,x),g.contentLength=x,H.next=18,this.putStream(E,l,g);case 18:if(S=H.sent,!g||!g.progress){H.next=22;break}return H.next=22,g.progress(1);case 22:return O={res:S.res,bucket:this.options.bucket,name:E,etag:S.res.headers.etag},(g.headers&&g.headers["x-oss-callback"]||g.callback)&&(O.data=S.data),H.abrupt("return",O);case 25:if(!(g.partSize&&g.partSize<y)){H.next=27;break}throw new Error("partSize must not be smaller than "+y);case 27:return H.next=29,this.initMultipartUpload(E,g);case 29:if(A=H.sent,D=A.uploadId,I=this._getPartSize(x,g.partSize),B={file:_,name:E,fileSize:x,partSize:I,uploadId:D,doneParts:[]},!g||!g.progress){H.next=36;break}return H.next=36,g.progress(0,B,A.res);case 36:return H.next=38,this._resumeMultipart(B,g);case 38:return H.abrupt("return",H.sent);case 39:case"end":return H.stop()}},m,this)}),t._resumeMultipart=a.default.mark(function m(E,_){var g,y,x,l,S,O,A,D,I,B,H,te,W,V,X,ne,Y,ee,ce,de,Ce;return a.default.wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:if(!this.isCancel()){Se.next=2;break}throw this._makeCancelEvent();case 2:if(g=E.file,y=E.fileSize,x=E.partSize,l=E.uploadId,S=E.doneParts,O=E.name,A=[],S.length>0&&n(S).to(A),D=this._divideParts(y,x),I=D.length,B=!1,H=a.default.mark(function Pe(ye,_e){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[_e-1],Ue={stream:ye._createStream(g,Ge.start,Ge.end),size:Ge.end-Ge.start},He.next=6,ye._uploadPart(O,l,_e,Ue);case 6:if(Fe=He.sent,ye.isCancel()||B){He.next=13;break}if(E.doneParts.push({number:_e,etag:Fe.res.headers.etag}),A.push({number:_e,etag:Fe.res.headers.etag}),!_||!_.progress){He.next=13;break}return He.next=13,_.progress(S.length/I,E,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=_e,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=_.parallel||X,!this.checkBrowserAndVersion("Internet Explorer","10")&&ne!==1){Se.next=26;break}Y=0;case 16:if(!(Y<V.length)){Se.next=24;break}if(!this.isCancel()){Se.next=19;break}throw this._makeCancelEvent();case 19:return Se.next=21,H(this,V[Y]);case 21:Y++,Se.next=16;break;case 24:Se.next=40;break;case 26:for(ee=[],ce=0;ce<V.length;ce++)ee.push(H(this,V[ce]));return Se.next=30,this._thunkPool(ee,ne);case 30:if(de=Se.sent,B=!0,!(de&&de.length>0)){Se.next=37;break}throw this.resetCancelFlag(),Ce=de[0],Ce.message="Failed to upload some parts with error: "+Ce.toString()+" part_num: "+Ce.partNum,Ce;case 37:if(!this.isCancel()){Se.next=40;break}throw ee=null,this._makeCancelEvent();case 40:return Se.next=42,this.completeMultipartUpload(O,l,A,_);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(E){var _;return a.default.wrap(function(g){for(;;)switch(g.prev=g.next){case 0:if(!u.buffer(E)){g.next=4;break}return g.abrupt("return",E.length);case 4:if(!u.blob(E)&&!u.file(E)){g.next=6;break}return g.abrupt("return",E.size);case 6:if(!u.string(E)){g.next=11;break}return g.next=9,this._statFile(E);case 9:return _=g.sent,g.abrupt("return",_.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 E=!0;E&&this.fileBuffer&&this.start<this.fileBuffer.length;){var _=this.start,g=_+m;g=g>this.fileBuffer.length?this.fileBuffer.length:g,this.start=g,E=this.push(this.fileBuffer.slice(_,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 E=this;this.reader.onload=function(_){E.fileBuffer=new T(new Uint8Array(_.target.result)),E.file=null,E.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,E){return E?Math.max(Math.ceil(m/1e4),E):1048576},t._divideParts=function(m,E){for(var _=Math.ceil(m/E),g=[],y=0;y<_;y++){var x=E*y,l=Math.min(x+E,m);g.push({start:x,end:l})}return g},t._makeCancelEvent=function(){return{status:0,name:"cancel"}}}).call(this,w("buffer").Buffer)},{"babel-runtime/core-js/array/from":16,"babel-runtime/regenerator":33,buffer:38,"copy-to":43,"is-type-of":165,mime:242,path:170,stream:195,util:207}],4:[function(w,P,b){"use strict";function T(E){return E&&E.__esModule?E:{default:E}}var C=w("babel-runtime/core-js/object/keys"),c=T(C),p=w("babel-runtime/regenerator"),d=T(p),o=w("debug")("ali-oss:object"),a=w("utility"),u=w("fs"),s=w("is-type-of"),h=w("url"),i=w("copy-to"),n=w("path"),t=w("mime"),f=w("../common/callback"),v=w("../common/signUtils"),m=b;m.append=d.default.mark(function E(_,g,y){var x;return d.default.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return y=y||{},y.position===void 0&&(y.position="0"),y.subres={append:"",position:y.position},y.method="POST",l.next=6,this.put(_,g,y);case 6:return x=l.sent,x.nextAppendPosition=x.res.headers["x-oss-next-append-position"],l.abrupt("return",x);case 9:case"end":return l.stop()}},E,this)}),m.put=d.default.mark(function E(_,g,y){var x,l,S,O,A,D;return d.default.wrap(function(I){for(;;)switch(I.prev=I.next){case 0:if(x=void 0,y=y||{},!s.buffer(g)){I.next=6;break}x=g,I.next=18;break;case 6:if(!s.blob(g)&&!s.file(g)){I.next=17;break}return y.mime||(s.file(g)?y.mime=t.getType(n.extname(g.name)):y.mime=g.type),l=this._createStream(g,0,g.size),I.next=11,this._getFileSize(g);case 11:return y.contentLength=I.sent,I.next=14,this.putStream(_,l,y);case 14:return I.abrupt("return",I.sent);case 17:throw new TypeError("Must provide Buffer/Blob for put.");case 18:return y.headers=y.headers||{},this._convertMetaToHeaders(y.meta,y.headers),S=y.method||"PUT",O=this._objectRequestParams(S,_,y),f.encodeCallback(O,y),O.mime=y.mime,O.content=x,O.successStatuses=[200],I.next=28,this.request(O);case 28:return A=I.sent,D={name:_,url:this._objectUrl(_),res:A.res},O.headers&&O.headers["x-oss-callback"]&&(D.data=JSON.parse(A.data.toString())),I.abrupt("return",D);case 32:case"end":return I.stop()}},E,this)}),m.putStream=d.default.mark(function E(_,g,y){var x,l,S,O;return d.default.wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return y=y||{},y.headers=y.headers||{},y.contentLength?y.headers["Content-Length"]=y.contentLength:y.headers["Transfer-Encoding"]="chunked",this._convertMetaToHeaders(y.meta,y.headers),x=y.method||"PUT",l=this._objectRequestParams(x,_,y),f.encodeCallback(l,y),l.mime=y.mime,l.stream=g,l.successStatuses=[200],A.next=12,this.request(l);case 12:return S=A.sent,O={name:_,url:this._objectUrl(_),res:S.res},l.headers&&l.headers["x-oss-callback"]&&(O.data=JSON.parse(S.data.toString())),A.abrupt("return",O);case 16:case"end":return A.stop()}},E,this)}),m.head=d.default.mark(function E(_,g){var y,x,l;return d.default.wrap(function(S){for(;;)switch(S.prev=S.next){case 0:return y=this._objectRequestParams("HEAD",_,g),y.successStatuses=[200,304],S.next=4,this.request(y);case 4:return x=S.sent,l={meta:null,res:x.res,status:x.status},x.status===200&&(0,c.default)(x.headers).forEach(function(O){O.indexOf("x-oss-meta-")===0&&(l.meta||(l.meta={}),l.meta[O.substring(11)]=x.headers[O])}),S.abrupt("return",l);case 8:case"end":return S.stop()}},E,this)}),m.get=d.default.mark(function E(_,g,y){var x,l,S,O;return d.default.wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return x=null,l=!1,s.writableStream(g)?x=g:s.string(g)?(x=u.createWriteStream(g),l=!0):y=g,y=y||{},y.process&&(y.subres=y.subres||{},y.subres["x-oss-process"]=y.process),S=void 0,A.prev=6,O=this._objectRequestParams("GET",_,y),O.writeStream=x,O.successStatuses=[200,206,304],A.next=12,this.request(O);case 12:S=A.sent,l&&x.destroy(),A.next=24;break;case 16:if(A.prev=16,A.t0=A.catch(6),!l){A.next=23;break}return x.destroy(),o("get error: %s, delete the exists file %s",A.t0,g),A.next=23,this._deleteFileSafe(g);case 23:throw A.t0;case 24:return A.abrupt("return",{res:S.res,content:S.data});case 25:case"end":return A.stop()}},E,this,[[6,16]])}),m.getStream=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||{},y=this._objectRequestParams("GET",_,g),y.customResponse=!0,y.successStatuses=[200,206,304],l.next=6,this.request(y);case 6:return x=l.sent,l.abrupt("return",{stream:x.res,res:{status:x.status,headers:x.headers}});case 8:case"end":return l.stop()}},E,this)}),m.delete=d.default.mark(function E(_,g){var y,x;return d.default.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return y=this._objectRequestParams("DELETE",_,g),y.successStatuses=[204],l.next=4,this.request(y);case 4:return x=l.sent,l.abrupt("return",{res:x.res});case 6:case"end":return l.stop()}},E,this)}),m.deleteMulti=d.default.mark(function E(_,g){var y,x,l,S,O,A;return d.default.wrap(function(D){for(;;)switch(D.prev=D.next){case 0:for(g=g||{},y=`<?xml version="1.0" encoding="UTF-8"?>
|
|
|
<Delete>
|
|
|
`,g.quiet?y+=` <Quiet>true</Quiet>
|
|
|
`:y+=` <Quiet>false</Quiet>
|
|
|
`,x=0;x<_.length;x++)y+=" <Object><Key>"+a.escape(this._objectName(_[x]))+`</Key></Object>
|
|
|
`;return y+="</Delete>",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()}},E,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",_,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()}},E,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(_,_,{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()}},E,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=_,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()}},E,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,_=this._objectName(_),x=this._objectRequestParams("PUT",_,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()}},E,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",_=this._objectName(_),y=this._objectRequestParams("GET",_,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()}},E,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",_,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()}},E,this)}),m.signatureUrl=function(E,_){_=_||{},E=this._objectName(E),_.method=_.method||"GET";var g=a.timestamp()+(_.expires||1800),y={bucket:this.options.bucket,object:E},x=this._getResource(y);this.options.stsToken&&(_["security-token"]=this.options.stsToken);var l=v._signatureForURL(this.options.accessKeySecret,_,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 _?_[_.length-1]!=="/"&&(_+="/"):_=this.options.endpoint.format(),_+this._escape(this._objectName(E))},m._objectUrl=function(E){return this._getReqUrl({bucket:this.options.bucket,object:E})},m.generateObjectUrl=function(E,_){if(_)_[_.length-1]!=="/"&&(_+="/");else{_=this.options.endpoint.format();var g=h.parse(_),y=this.options.bucket;g.hostname=y+"."+g.hostname,g.host=y+"."+g.host,_=g.format()}return _+this._escape(this._objectName(E))},m._objectRequestParams=function(E,_,g){if(!this.options.bucket)throw new Error("Please create a bucket first");g=g||{},_=this._objectName(_);var y={object:_,bucket:this.options.bucket,method:E,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(E){return E.replace(/^\/+/,"")},m._statFile=function(E){return function(_){u.stat(E,_)}},m._convertMetaToHeaders=function(E,_){E&&(0,c.default)(E).forEach(function(g){_["x-oss-meta-"+g]=E[g]})},m._deleteFileSafe=function(E){return function(_){u.exists(E,function(g){g?u.unlink(E,function(y){y&&o("unlink %j error: %s",E,y),_()}):_()})}}},{"../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(E){c(f[E])?this[E]=h.wrap(f[E]).bind(f):this[E]=f[E]},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=`<?xml version="1.0" encoding="UTF-8"?>
|
|
|
<CompleteMultipartUpload>
|
|
|
`,t=0;t<i.length;t++)f=i[t],n+=`<Part>
|
|
|
`,n+="<PartNumber>"+f.number+`</PartNumber>
|
|
|
`,n+="<ETag>"+f.etag+`</ETag>
|
|
|
`,n+=`</Part>
|
|
|
`;return n+="</CompleteMultipartUpload>",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 E=g.sent,_={res:E.res,bucket:m.bucket,name:a,etag:E.res.headers.etag},m.headers&&m.headers["x-oss-callback"]&&(_.data=JSON.parse(E.data.toString())),g.abrupt("return",_);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]<m[0]?-1:0},f=function(v){i+=n+v,h[v]&&(i+="="+h[v]),n="&"};(0,o.default)(h).sort(t).forEach(f)}return i},b.buildCanonicalString=function(s,h,i,n){i=i||{};var t=i.headers||{},f=[],v={},m=[s.toUpperCase(),t["Content-Md5"]||"",t["Content-Type"]||t["Content-Type".toLowerCase()],n||t["x-oss-date"]];return(0,o.default)(t).forEach(function(E){var _=E.toLowerCase();_.indexOf("x-oss-")===0&&(v[_]=String(t[E]).trim())}),(0,o.default)(v).sort().forEach(function(E){f.push(E+":"+v[E])}),m=m.concat(f),m.push(this.buildCanonicalizedResource(h,i.parameters)),m.join(`
|
|
|
`)},b.computeSignature=function(s,h){return a.createHmac("sha1",s).update(new T(h,"utf8")).digest("base64")},b.authorization=function(s,h,i){return"OSS "+s+":"+this.computeSignature(h,i)},b._signatureForURL=function(s,h,i,n){var t={},f={};if(h.process&&(f["x-oss-process"]=h.process),h.response&&(0,o.default)(h.response).forEach(function(_){var g="response-"+_.toLowerCase();f[g]=h.response[_]}),(0,o.default)(h).forEach(function(_){var g=_.toLowerCase(),y=h[_];g.indexOf("x-oss-")===0?t[g]=y:g.indexOf("content-md5")===0||g.indexOf("content-type")===0?t[_]=y:g!=="expires"&&g!=="response"&&g!=="process"&&g!=="method"&&(f[g]=y)}),Object.prototype.hasOwnProperty.call(h,"security-token")&&(f["security-token"]=h["security-token"]),Object.prototype.hasOwnProperty.call(h,"callback")){var v={callbackUrl:encodeURI(h.callback.url),callbackBody:h.callback.body};if(h.callback.host&&(v.callbackHost=h.callback.host),h.callback.contentType&&(v.callbackBodyType=h.callback.contentType),f.callback=new T((0,p.default)(v)).toString("base64"),h.callback.customValue){var m={};(0,o.default)(h.callback.customValue).forEach(function(_){m["x:"+_]=h.callback.customValue[_]}),f["callback-var"]=new T((0,p.default)(m)).toString("base64")}}var E=this.buildCanonicalString(h.method,i,{headers:t,parameters:f},n.toString());return{Signature:this.computeSignature(s,E),subResource:f}}}).call(this,w("buffer").Buffer)},{"./../../shims/crypto/crypto.js":237,"babel-runtime/core-js/json/stringify":17,"babel-runtime/core-js/object/keys":23,buffer:38,"is-type-of":165}],10:[function(w,P,b){"use strict";var T=w("babel-runtime/regenerator"),C=function(a){return a&&a.__esModule?a:{default:a}}(T),c=w("co"),p=w("co-priority-queue"),d=w("any-promise"),o=b;o._thunkPool=function(a,u){function s(f,v){++n===f.length&&v(t)}function h(f,v){function m(){var l;return C.default.wrap(function(S){for(;;)switch(S.prev=S.next){case 0:l=void 0;case 1:if(i.isCancel()){S.next=9;break}return S.next=4,g.next();case 4:return l=S.sent,S.next=7,l();case 7:S.next=1;break;case 9:y+=1,y===f&&(g.fns=[],g.buffer=[],v(t));case 11:case"end":return S.stop()}},_,this)}function E(l){console.error(l.stack)}for(var _=C.default.mark(m),g=new p,y=0,x=0;x<f;x++)c(m).catch(E);return function(l,S){return function(O){g.push(C.default.mark(function A(){return C.default.wrap(function(D){for(;;)switch(D.prev=D.next){case 0:return D.prev=0,D.t0=O,D.next=4,l;case 4:D.t1=D.sent,(0,D.t0)(null,D.t1),D.next=11;break;case 8:D.prev=8,D.t2=D.catch(0),O(D.t2);case 11:case"end":return D.stop()}},A,this,[[0,8]])}),S)}}}var i=this,n=0,t=[];return new d(function(f){function v(y){return C.default.wrap(function(x){for(;;)switch(x.prev=x.next){case 0:return x.next=2,_(a[y]);case 2:s(a,f);case 3:case"end":return x.stop()}},E,this)}function m(y){t.push(y),s(a,f)}for(var E=C.default.mark(v),_=new h(u,f),g=0;g<a.length;g++)c(v(g)).catch(m)})},o.cancel=function(){this.options.cancelFlag=!0},o.isCancel=function(){return this.options.cancelFlag},o.resetCancelFlag=function(){this.options.cancelFlag=!1}},{"any-promise":13,"babel-runtime/regenerator":33,co:41,"co-priority-queue":40}],11:[function(w,P,b){"use strict";b._isIP=function(T){var C=/^(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}$/,c=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/;return C.test(T)||c.test(T)}},{}],12:[function(w,P,b){function T(){}P.exports=T,P.exports.HttpsAgent=T},{}],13:[function(w,P,b){P.exports=w("./register")().Promise},{"./register":15}],14:[function(w,P,b){"use strict";var T=null;P.exports=function(C,c){return function(p,d){p=p||null,d=d||{};var o=d.global!==!1;if(T===null&&o&&(T=C["@@any-promise/REGISTRATION"]||null),T!==null&&p!==null&&T.implementation!==p)throw new Error('any-promise already defined as "'+T.implementation+'". You can only register an implementation before the first call to require("any-promise") and an implementation cannot be changed');return T===null&&(T=p!==null&&d.Promise!==void 0?{Promise:d.Promise,implementation:p}:c(p),o&&(C["@@any-promise/REGISTRATION"]=T)),T}}},{}],15:[function(w,P,b){"use strict";function T(){if(window.Promise===void 0)throw new Error("any-promise browser requires a polyfill or explicit registration e.g: require('any-promise/register/bluebird')");return{Promise:window.Promise,implementation:"window.Promise"}}P.exports=w("./loader")(window,T)},{"./loader":14}],16:[function(w,P,b){P.exports={default:w("core-js/library/fn/array/from"),__esModule:!0}},{"core-js/library/fn/array/from":44}],17:[function(w,P,b){P.exports={default:w("core-js/library/fn/json/stringify"),__esModule:!0}},{"core-js/library/fn/json/stringify":45}],18:[function(w,P,b){P.exports={default:w("core-js/library/fn/object/assign"),__esModule:!0}},{"core-js/library/fn/object/assign":46}],19:[function(w,P,b){P.exports={default:w("core-js/library/fn/object/create"),__esModule:!0}},{"core-js/library/fn/object/create":47}],20:[function(w,P,b){P.exports={default:w("core-js/library/fn/object/define-property"),__esModule:!0}},{"core-js/library/fn/object/define-property":48}],21:[function(w,P,b){P.exports={default:w("core-js/library/fn/object/get-own-property-names"),__esModule:!0}},{"core-js/library/fn/object/get-own-property-names":49}],22:[function(w,P,b){P.exports={default:w("core-js/library/fn/object/get-prototype-of"),__esModule:!0}},{"core-js/library/fn/object/get-prototype-of":50}],23:[function(w,P,b){P.exports={default:w("core-js/library/fn/object/keys"),__esModule:!0}},{"core-js/library/fn/object/keys":51}],24:[function(w,P,b){P.exports={default:w("core-js/library/fn/promise"),__esModule:!0}},{"core-js/library/fn/promise":52}],25:[function(w,P,b){P.exports={default:w("core-js/library/fn/set-immediate"),__esModule:!0}},{"core-js/library/fn/set-immediate":53}],26:[function(w,P,b){P.exports={default:w("core-js/library/fn/string/from-code-point"),__esModule:!0}},{"core-js/library/fn/string/from-code-point":54}],27:[function(w,P,b){P.exports={default:w("core-js/library/fn/symbol"),__esModule:!0}},{"core-js/library/fn/symbol":56}],28:[function(w,P,b){P.exports={default:w("core-js/library/fn/symbol/has-instance"),__esModule:!0}},{"core-js/library/fn/symbol/has-instance":55}],29:[function(w,P,b){P.exports={default:w("core-js/library/fn/symbol/iterator"),__esModule:!0}},{"core-js/library/fn/symbol/iterator":57}],30:[function(w,P,b){"use strict";b.__esModule=!0,b.default=function(T,C){if(!(T instanceof C))throw new TypeError("Cannot call a class as a function")}},{}],31:[function(w,P,b){"use strict";b.__esModule=!0;var T=w("../core-js/object/define-property"),C=function(c){return c&&c.__esModule?c:{default:c}}(T);b.default=function(){function c(p,d){for(var o=0;o<d.length;o++){var a=d[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),(0,C.default)(p,a.key,a)}}return function(p,d,o){return d&&c(p.prototype,d),o&&c(p,o),p}}()},{"../core-js/object/define-property":20}],32:[function(w,P,b){"use strict";function T(a){return a&&a.__esModule?a:{default:a}}b.__esModule=!0;var C=w("../core-js/symbol/iterator"),c=T(C),p=w("../core-js/symbol"),d=T(p),o=typeof d.default=="function"&&typeof c.default=="symbol"?function(a){return typeof a}:function(a){return a&&typeof d.default=="function"&&a.constructor===d.default&&a!==d.default.prototype?"symbol":typeof a};b.default=typeof d.default=="function"&&o(c.default)==="symbol"?function(a){return a===void 0?"undefined":o(a)}:function(a){return a&&typeof d.default=="function"&&a.constructor===d.default&&a!==d.default.prototype?"symbol":a===void 0?"undefined":o(a)}},{"../core-js/symbol":27,"../core-js/symbol/iterator":29}],33:[function(w,P,b){P.exports=w("regenerator-runtime")},{"regenerator-runtime":191}],34:[function(w,P,b){"use strict";function T(f){var v=f.length;if(v%4>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],E=v[1];return 3*(m+E)/4-E}function c(f,v,m){return 3*(v+m)/4-m}function p(f){for(var v,m=T(f),E=m[0],_=m[1],g=new h(c(f,E,_)),y=0,x=_>0?E-4:E,l=0;l<x;l+=4)v=s[f.charCodeAt(l)]<<18|s[f.charCodeAt(l+1)]<<12|s[f.charCodeAt(l+2)]<<6|s[f.charCodeAt(l+3)],g[y++]=v>>16&255,g[y++]=v>>8&255,g[y++]=255&v;return _===2&&(v=s[f.charCodeAt(l)]<<2|s[f.charCodeAt(l+1)]>>4,g[y++]=255&v),_===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;g<m;g+=3)E=(f[g]<<16&16711680)+(f[g+1]<<8&65280)+(255&f[g+2]),_.push(d(E));return _.join("")}function a(f){for(var v,m=f.length,E=m%3,_=[],g=0,y=m-E;g<y;g+=16383)_.push(o(f,g,g+16383>y?y:g+16383));return E===1?(v=f[m-1],_.push(u[v>>2]+u[v<<4&63]+"==")):E===2&&(v=(f[m-2]<<8)+f[m-1],_.push(u[v>>10]+u[v>>4&63]+u[v<<2&63]+"=")),_.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;n<t;++n)u[n]=i[n],s[i.charCodeAt(n)]=n;s["-".charCodeAt(0)]=62,s["_".charCodeAt(0)]=63},{}],35:[function(w,P,b){!function(T,C,c){P!==void 0&&P.exports?P.exports=c():typeof j=="function"&&j.amd?j("bowser",c):T.bowser=c()}(this,0,function(){function T(s){function h(ne){var Y=s.match(ne);return Y&&Y.length>1&&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),E=!m&&/nexus\s*[0-9]+/i.test(s),_=/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)}:_?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||E||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<s.length;i++)n.push(h(s[i]));return n}function p(s){for(var h=Math.max(C(s[0]),C(s[1])),i=c(s,function(n){var t=h-C(n);return n+=new Array(t+1).join(".0"),c(n.split("."),function(f){return new Array(20-f.length).join("0")+f}).reverse()});--h>=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<s.length;++h){var i=s[h];if(typeof i=="string"&&i in u)return!0}return!1},u.isUnsupportedBrowser=d,u.compareVersions=p,u.check=o,u._detect=T,u.detect=T,u})},{}],36:[function(w,P,b){},{}],37:[function(w,P,b){function T(u){if(u&&!o(u))throw new Error("Unknown encoding: "+u)}function C(u){return u.toString(this.encoding)}function c(u){this.charReceived=u.length%2,this.charLength=this.charReceived?2:0}function p(u){this.charReceived=u.length%3,this.charLength=this.charReceived?3:0}var d=w("buffer").Buffer,o=d.isEncoding||function(u){switch(u&&u.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}},a=b.StringDecoder=function(u){switch(this.encoding=(u||"utf8").toLowerCase().replace(/[-_]/,""),T(u),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=c;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=p;break;default:return void(this.write=C)}this.charBuffer=new d(6),this.charReceived=0,this.charLength=0};a.prototype.write=function(u){for(var s="";this.charLength;){var h=u.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:u.length;if(u.copy(this.charBuffer,this.charReceived,0,h),this.charReceived+=h,this.charReceived<this.charLength)return"";u=u.slice(h,u.length),s=this.charBuffer.slice(0,this.charLength).toString(this.encoding);var n=s.charCodeAt(s.length-1);if(!(n>=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()<U)throw new RangeError("Invalid typed array length");return p.TYPED_ARRAY_SUPPORT?(k=new Uint8Array(U),k.__proto__=p.prototype):(k===null&&(k=new p(U)),k.length=U),k}function p(k,U,q){if(!(p.TYPED_ARRAY_SUPPORT||this instanceof p))return new p(k,U,q);if(typeof k=="number"){if(typeof U=="string")throw new Error("If encoding is specified then the first argument must be a string");return u(this,k)}return d(this,k,U,q)}function d(k,U,q,$){if(typeof U=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer!="undefined"&&U instanceof ArrayBuffer?i(k,U,q,$):typeof U=="string"?s(k,U,q):n(k,U)}function o(k){if(typeof k!="number")throw new TypeError('"size" argument must be a number');if(k<0)throw new RangeError('"size" argument must not be negative')}function a(k,U,q,$){return o(U),U<=0?c(k,U):q!==void 0?typeof $=="string"?c(k,U).fill(q,$):c(k,U).fill(q):c(k,U)}function u(k,U){if(o(U),k=c(k,U<0?0:0|t(U)),!p.TYPED_ARRAY_SUPPORT)for(var q=0;q<U;++q)k[q]=0;return k}function s(k,U,q){if(typeof q=="string"&&q!==""||(q="utf8"),!p.isEncoding(q))throw new TypeError('"encoding" must be a valid string encoding');var $=0|v(U,q);k=c(k,$);var J=k.write(U,q);return J!==$&&(k=k.slice(0,J)),k}function h(k,U){var q=U.length<0?0:0|t(U.length);k=c(k,q);for(var $=0;$<q;$+=1)k[$]=255&U[$];return k}function i(k,U,q,$){if(U.byteLength,q<0||U.byteLength<q)throw new RangeError("'offset' is out of bounds");if(U.byteLength<q+($||0))throw new RangeError("'length' is out of bounds");return U=q===void 0&&$===void 0?new Uint8Array(U):$===void 0?new Uint8Array(U,q):new Uint8Array(U,q,$),p.TYPED_ARRAY_SUPPORT?(k=U,k.__proto__=p.prototype):k=h(k,U),k}function n(k,U){if(p.isBuffer(U)){var q=0|t(U.length);return k=c(k,q),k.length===0||U.copy(k,0,0,q),k}if(U){if(typeof ArrayBuffer!="undefined"&&U.buffer instanceof ArrayBuffer||"length"in U)return typeof U.length!="number"||be(U.length)?c(k,0):h(k,U);if(U.type==="Buffer"&&ze(U.data))return h(k,U.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function t(k){if(k>=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 _e(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 _e(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 E(k,U,q){var $=k[U];k[U]=k[q],k[q]=$}function _(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;je<dt;je++)if(xe(k,je)===xe(U,tt===-1?0:je-tt)){if(tt===-1&&(tt=je),je-tt+1===Ne)return tt*ke}else tt!==-1&&(je-=je-tt),tt=-1}else for(q+Ne>dt&&(q=dt-Ne),je=q;je>=0;je--){for(var mt=!0,Qe=0;Qe<Ne;Qe++)if(xe(k,je+Qe)!==xe(U,Qe)){mt=!1;break}if(mt)return je}return-1}function y(k,U,q,$){q=Number(q)||0;var J=k.length-q;$?($=Number($))>J&&($=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(_e(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;J<q;){var xe=k[J],ke=null,dt=xe>239?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;$<U;)q+=String.fromCharCode.apply(String,k.slice($,$+=nt));return q}function H(k,U,q){var $="";q=Math.min(k.length,q);for(var J=U;J<q;++J)$+=String.fromCharCode(127&k[J]);return $}function te(k,U,q){var $="";q=Math.min(k.length,q);for(var J=U;J<q;++J)$+=String.fromCharCode(k[J]);return $}function W(k,U,q){var $=k.length;(!U||U<0)&&(U=0),(!q||q<0||q>$)&&(q=$);for(var J="",xe=U;xe<q;++xe)J+=ye(k[xe]);return J}function V(k,U,q){for(var $=k.slice(U,q),J="",xe=0;xe<$.length;xe+=2)J+=String.fromCharCode($[xe]+256*$[xe+1]);return J}function X(k,U,q){if(k%1!=0||k<0)throw new RangeError("offset is not uint");if(k+U>q)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||U<xe)throw new RangeError('"value" argument is out of bounds');if(q+$>k.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<xe;++J)k[q+J]=(U&255<<8*($?J:1-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<xe;++J)k[q+J]=U>>>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 _e(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<k.length;++q)U.push(255&k.charCodeAt(q));return U}function Ue(k,U){for(var q,$,J,xe=[],ke=0;ke<k.length&&!((U-=2)<0);++ke)q=k.charCodeAt(ke),$=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,$);J<xe;++J)if(k[J]!==U[J]){q=k[J],$=U[J];break}return q<$?-1:$<q?1:0},p.isEncoding=function(k){switch(String(k).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},p.concat=function(k,U){if(!ze(k))throw new TypeError('"list" argument must be an Array of Buffers');if(k.length===0)return p.alloc(0);var q;if(U===void 0)for(U=0,q=0;q<k.length;++q)U+=k[q].length;var $=p.allocUnsafe(U),J=0;for(q=0;q<k.length;++q){var xe=k[q];if(!p.isBuffer(xe))throw new TypeError('"list" argument must be an Array of Buffers');xe.copy($,J),J+=xe.length}return $},p.byteLength=v,p.prototype._isBuffer=!0,p.prototype.swap16=function(){var k=this.length;if(k%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var U=0;U<k;U+=2)E(this,U,U+1);return this},p.prototype.swap32=function(){var k=this.length;if(k%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var U=0;U<k;U+=4)E(this,U,U+3),E(this,U+1,U+2);return this},p.prototype.swap64=function(){var k=this.length;if(k%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var U=0;U<k;U+=8)E(this,U,U+7),E(this,U+1,U+6),E(this,U+2,U+5),E(this,U+3,U+4);return this},p.prototype.toString=function(){var k=0|this.length;return k===0?"":arguments.length===0?I(this,0,k):m.apply(this,arguments)},p.prototype.equals=function(k){if(!p.isBuffer(k))throw new TypeError("Argument must be a Buffer");return this===k||p.compare(this,k)===0},p.prototype.inspect=function(){var k="",U=b.INSPECT_MAX_BYTES;return this.length>0&&(k=this.toString("hex",0,U).match(/.{2}/g).join(" "),this.length>U&&(k+=" ... ")),"<Buffer "+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;tt<dt;++tt)if(Ne[tt]!==je[tt]){xe=Ne[tt],ke=je[tt];break}return xe<ke?-1:ke<xe?1:0},p.prototype.includes=function(k,U,q){return this.indexOf(k,U,q)!==-1},p.prototype.indexOf=function(k,U,q){return _(this,k,U,q,!0)},p.prototype.lastIndexOf=function(k,U,q){return _(this,k,U,q,!1)},p.prototype.write=function(k,U,q,$){if(U===void 0)$="utf8",q=this.length,U=0;else if(q===void 0&&typeof U=="string")$=U,q=this.length,U=0;else{if(!isFinite(U))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");U|=0,isFinite(q)?(q|=0,$===void 0&&($="utf8")):($=q,q=void 0)}var J=this.length-U;if((q===void 0||q>J)&&(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),U<k&&(U=k);var $;if(p.TYPED_ARRAY_SUPPORT)$=this.subarray(k,U),$.__proto__=p.prototype;else{var J=U-k;$=new p(J,void 0);for(var xe=0;xe<J;++xe)$[xe]=this[xe+k]}return $},p.prototype.readUIntLE=function(k,U,q){k|=0,U|=0,q||X(k,U,this.length);for(var $=this[k],J=1,xe=0;++xe<U&&(J*=256);)$+=this[k+xe]*J;return $},p.prototype.readUIntBE=function(k,U,q){k|=0,U|=0,q||X(k,U,this.length);for(var $=this[k+--U],J=1;U>0&&(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<U&&(J*=256);)$+=this[k+xe]*J;return J*=128,$>=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<q&&(J*=256);)this[U+xe]=k/J&255;return U+q},p.prototype.writeUIntBE=function(k,U,q,$){(k=+k,U|=0,q|=0,!$)&&ne(this,k,U,q,Math.pow(2,8*q)-1,0);var J=q-1,xe=1;for(this[U+J]=255&k;--J>=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<q&&(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.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&&$<q&&($=q),$===q)return 0;if(k.length===0||this.length===0)return 0;if(U<0)throw new RangeError("targetStart out of bounds");if(q<0||q>=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<U&&U<$)for(J=xe-1;J>=0;--J)k[J+U]=this[J+q];else if(xe<1e3||!p.TYPED_ARRAY_SUPPORT)for(J=0;J<xe;++J)k[J+U]=this[J+q];else Uint8Array.prototype.set.call(k,this.subarray(q,q+xe),U);return xe},p.prototype.fill=function(k,U,q,$){if(typeof k=="string"){if(typeof U=="string"?($=U,U=0,q=this.length):typeof q=="string"&&($=q,q=this.length),k.length===1){var J=k.charCodeAt(0);J<256&&(k=J)}if($!==void 0&&typeof $!="string")throw new TypeError("encoding must be a string");if(typeof $=="string"&&!p.isEncoding($))throw new TypeError("Unknown encoding: "+$)}else typeof k=="number"&&(k&=255);if(U<0||this.length<U||this.length<q)throw new RangeError("Out of range index");if(q<=U)return this;U>>>=0,q=q===void 0?this.length:q>>>0,k||(k=0);var xe;if(typeof k=="number")for(xe=U;xe<q;++xe)this[xe]=k;else{var ke=p.isBuffer(k)?k:_e(new p(k,$).toString()),dt=ke.length;for(xe=0;xe<q-U;++xe)this[xe+U]=ke[xe%dt]}return this};var re=/[^+\/0-9A-Za-z-_]/g}).call(this,typeof le!="undefined"?le:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"base64-js":34,ieee754:161,isarray:166}],39:[function(w,P,b){P.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},{}],40:[function(w,P,b){"use strict";var T=function(){this.buffer=[],this.fns=[]};T.prototype.push=function(c,p){if(this.fns.length)return this.fns.shift()(null,c);var d={data:c,priority:p},o=C(this.buffer,d,function(a){return a.priority});this.buffer.splice(o,0,d)},T.prototype.next=function(){var c=this;return function(p){if(c.buffer.length)return p(null,c.buffer.pop().data);c.fns.push(p)}};var C=function(c,p,d){p=d(p);for(var o=0,a=c?c.length:o;o<a;){var u=o+a>>>1;d(c[u])<p?o=u+1:a=u}return o};P.exports=T},{}],41:[function(w,P,b){function T(i){var n=this,t=h.call(arguments,1);return new Promise(function(f,v){function m(g){var y;try{y=i.next(g)}catch(x){return v(x)}_(y)}function E(g){var y;try{y=i.throw(g)}catch(x){return v(x)}_(y)}function _(g){if(g.done)return f(g.value);var y=C.call(n,g.value);return y&&o(y)?y.then(m,E):E(new TypeError('You may only yield a function, promise, generator, array, or object, but the following object was passed: "'+String(g.value)+'"'))}if(typeof i=="function"&&(i=i.apply(n,t)),!i||typeof i.next!="function")return f(i);m()})}function C(i){return i&&(o(i)?i:u(i)||a(i)?T.call(this,i):typeof i=="function"?c.call(this,i):Array.isArray(i)?p.call(this,i):s(i)?d.call(this,i):i)}function c(i){var n=this;return new Promise(function(t,f){i.call(n,function(v,m){if(v)return f(v);arguments.length>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;v<t.length;v++){var m=t[v],E=C.call(this,i[m]);E&&o(E)?function(_,g){n[g]=void 0,f.push(_.then(function(y){n[g]=y}))}(E,m):n[m]=i[m]}return Promise.all(f).then(function(){return n})}function o(i){return typeof i.then=="function"}function a(i){return typeof i.next=="function"&&typeof i.throw=="function"}function u(i){var n=i.constructor;return!!n&&(n.name==="GeneratorFunction"||n.displayName==="GeneratorFunction"||a(n.prototype))}function s(i){return Object==i.constructor}var h=Array.prototype.slice;P.exports=T.default=T.co=T,T.wrap=function(i){function n(){return T.call(this,i.apply(this,arguments))}return n.__generatorFunction__=i,n}},{}],42:[function(w,P,b){P.exports={O_RDONLY:0,O_WRONLY:1,O_RDWR:2,S_IFMT:61440,S_IFREG:32768,S_IFDIR:16384,S_IFCHR:8192,S_IFBLK:24576,S_IFIFO:4096,S_IFLNK:40960,S_IFSOCK:49152,O_CREAT:512,O_EXCL:2048,O_NOCTTY:131072,O_TRUNC:1024,O_APPEND:8,O_DIRECTORY:1048576,O_NOFOLLOW:256,O_SYNC:128,O_SYMLINK:2097152,O_NONBLOCK:4,S_IRWXU:448,S_IRUSR:256,S_IWUSR:128,S_IXUSR:64,S_IRWXG:56,S_IRGRP:32,S_IWGRP:16,S_IXGRP:8,S_IRWXO:7,S_IROTH:4,S_IWOTH:2,S_IXOTH:1,E2BIG:7,EACCES:13,EADDRINUSE:48,EADDRNOTAVAIL:49,EAFNOSUPPORT:47,EAGAIN:35,EALREADY:37,EBADF:9,EBADMSG:94,EBUSY:16,ECANCELED:89,ECHILD:10,ECONNABORTED:53,ECONNREFUSED:61,ECONNRESET:54,EDEADLK:11,EDESTADDRREQ:39,EDOM:33,EDQUOT:69,EEXIST:17,EFAULT:14,EFBIG:27,EHOSTUNREACH:65,EIDRM:90,EILSEQ:92,EINPROGRESS:36,EINTR:4,EINVAL:22,EIO:5,EISCONN:56,EISDIR:21,ELOOP:62,EMFILE:24,EMLINK:31,EMSGSIZE:40,EMULTIHOP:95,ENAMETOOLONG:63,ENETDOWN:50,ENETRESET:52,ENETUNREACH:51,ENFILE:23,ENOBUFS:55,ENODATA:96,ENODEV:19,ENOENT:2,ENOEXEC:8,ENOLCK:77,ENOLINK:97,ENOMEM:12,ENOMSG:91,ENOPROTOOPT:42,ENOSPC:28,ENOSR:98,ENOSTR:99,ENOSYS:78,ENOTCONN:57,ENOTDIR:20,ENOTEMPTY:66,ENOTSOCK:38,ENOTSUP:45,ENOTTY:25,ENXIO:6,EOPNOTSUPP:102,EOVERFLOW:84,EPERM:1,EPIPE:32,EPROTO:100,EPROTONOSUPPORT:43,EPROTOTYPE:41,ERANGE:34,EROFS:30,ESPIPE:29,ESRCH:3,ESTALE:70,ETIME:101,ETIMEDOUT:60,ETXTBSY:26,EWOULDBLOCK:35,EXDEV:18,SIGHUP:1,SIGINT:2,SIGQUIT:3,SIGILL:4,SIGTRAP:5,SIGABRT:6,SIGIOT:6,SIGBUS:10,SIGFPE:8,SIGKILL:9,SIGUSR1:30,SIGSEGV:11,SIGUSR2:31,SIGPIPE:13,SIGALRM:14,SIGTERM:15,SIGCHLD:20,SIGCONT:19,SIGSTOP:17,SIGTSTP:18,SIGTTIN:21,SIGTTOU:22,SIGURG:16,SIGXCPU:24,SIGXFSZ:25,SIGVTALRM:26,SIGPROF:27,SIGWINCH:28,SIGIO:23,SIGSYS:12,SSL_OP_ALL:2147486719,SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION:262144,SSL_OP_CIPHER_SERVER_PREFERENCE:4194304,SSL_OP_CISCO_ANYCONNECT:32768,SSL_OP_COOKIE_EXCHANGE:8192,SSL_OP_CRYPTOPRO_TLSEXT_BUG:2147483648,SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS:2048,SSL_OP_EPHEMERAL_RSA:0,SSL_OP_LEGACY_SERVER_CONNECT:4,SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER:32,SSL_OP_MICROSOFT_SESS_ID_BUG:1,SSL_OP_MSIE_SSLV2_RSA_PADDING:0,SSL_OP_NETSCAPE_CA_DN_BUG:536870912,SSL_OP_NETSCAPE_CHALLENGE_BUG:2,SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG:1073741824,SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG:8,SSL_OP_NO_COMPRESSION:131072,SSL_OP_NO_QUERY_MTU:4096,SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION:65536,SSL_OP_NO_SSLv2:16777216,SSL_OP_NO_SSLv3:33554432,SSL_OP_NO_TICKET:16384,SSL_OP_NO_TLSv1:67108864,SSL_OP_NO_TLSv1_1:268435456,SSL_OP_NO_TLSv1_2:134217728,SSL_OP_PKCS1_CHECK_1:0,SSL_OP_PKCS1_CHECK_2:0,SSL_OP_SINGLE_DH_USE:1048576,SSL_OP_SINGLE_ECDH_USE:524288,SSL_OP_SSLEAY_080_CLIENT_DH_BUG:128,SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG:0,SSL_OP_TLS_BLOCK_PADDING_BUG:512,SSL_OP_TLS_D5_BUG:256,SSL_OP_TLS_ROLLBACK_BUG:8388608,ENGINE_METHOD_DSA:2,ENGINE_METHOD_DH:4,ENGINE_METHOD_RAND:8,ENGINE_METHOD_ECDH:16,ENGINE_METHOD_ECDSA:32,ENGINE_METHOD_CIPHERS:64,ENGINE_METHOD_DIGESTS:128,ENGINE_METHOD_STORE:256,ENGINE_METHOD_PKEY_METHS:512,ENGINE_METHOD_PKEY_ASN1_METHS:1024,ENGINE_METHOD_ALL:65535,ENGINE_METHOD_NONE:0,DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6,F_OK:0,R_OK:4,W_OK:2,X_OK:1,UV_UDP_REUSEADDR:4}},{}],43:[function(w,P,b){"use strict";function T(p,d){if(!(this instanceof T))return new T(p,d);this.src=p,this._withAccess=d}function C(p,d){return p[d]===void 0&&p.__lookupGetter__(d)===void 0&&p.__lookupSetter__(d)===void 0}var c=Array.prototype.slice;P.exports=T,T.prototype.withAccess=function(p){return this._withAccess=p!==!1,this},T.prototype.pick=function(p){return Array.isArray(p)||(p=c.call(arguments)),p.length&&(this.keys=p),this},T.prototype.to=function(p){if(p=p||{},!this.src)return p;var d=this.keys||Object.keys(this.src);if(!this._withAccess){for(var o=0;o<d.length;o++)a=d[o],p[a]===void 0&&(p[a]=this.src[a]);return p}for(var o=0;o<d.length;o++){var a=d[o];if(C(p,a)){var u=this.src.__lookupGetter__(a),s=this.src.__lookupSetter__(a);u&&p.__defineGetter__(a,u),s&&p.__defineSetter__(a,s),u||s||(p[a]=this.src[a])}}return p},T.prototype.toCover=function(p){for(var d=this.keys||Object.keys(this.src),o=0;o<d.length;o++){var a=d[o];delete p[a];var u=this.src.__lookupGetter__(a),s=this.src.__lookupSetter__(a);u&&p.__defineGetter__(a,u),s&&p.__defineSetter__(a,s),u||s||(p[a]=this.src[a])}},T.prototype.override=T.prototype.toCover,T.prototype.and=function(p){var d={};return this.to(d),this.src=p,this.to(d),this.src=d,this}},{}],44:[function(w,P,b){w("../../modules/es6.string.iterator"),w("../../modules/es6.array.from"),P.exports=w("../../modules/_core").Array.from},{"../../modules/_core":65,"../../modules/es6.array.from":133,"../../modules/es6.string.iterator":145}],45:[function(w,P,b){var T=w("../../modules/_core"),C=T.JSON||(T.JSON={stringify:JSON.stringify});P.exports=function(c){return C.stringify.apply(C,arguments)}},{"../../modules/_core":65}],46:[function(w,P,b){w("../../modules/es6.object.assign"),P.exports=w("../../modules/_core").Object.assign},{"../../modules/_core":65,"../../modules/es6.object.assign":136}],47:[function(w,P,b){w("../../modules/es6.object.create");var T=w("../../modules/_core").Object;P.exports=function(C,c){return T.create(C,c)}},{"../../modules/_core":65,"../../modules/es6.object.create":137}],48:[function(w,P,b){w("../../modules/es6.object.define-property");var T=w("../../modules/_core").Object;P.exports=function(C,c,p){return T.defineProperty(C,c,p)}},{"../../modules/_core":65,"../../modules/es6.object.define-property":138}],49:[function(w,P,b){w("../../modules/es6.object.get-own-property-names");var T=w("../../modules/_core").Object;P.exports=function(C){return T.getOwnPropertyNames(C)}},{"../../modules/_core":65,"../../modules/es6.object.get-own-property-names":139}],50:[function(w,P,b){w("../../modules/es6.object.get-prototype-of"),P.exports=w("../../modules/_core").Object.getPrototypeOf},{"../../modules/_core":65,"../../modules/es6.object.get-prototype-of":140}],51:[function(w,P,b){w("../../modules/es6.object.keys"),P.exports=w("../../modules/_core").Object.keys},{"../../modules/_core":65,"../../modules/es6.object.keys":141}],52:[function(w,P,b){w("../modules/es6.object.to-string"),w("../modules/es6.string.iterator"),w("../modules/web.dom.iterable"),w("../modules/es6.promise"),w("../modules/es7.promise.finally"),w("../modules/es7.promise.try"),P.exports=w("../modules/_core").Promise},{"../modules/_core":65,"../modules/es6.object.to-string":142,"../modules/es6.promise":143,"../modules/es6.string.iterator":145,"../modules/es7.promise.finally":147,"../modules/es7.promise.try":148,"../modules/web.dom.iterable":151}],53:[function(w,P,b){w("../modules/web.immediate"),P.exports=w("../modules/_core").setImmediate},{"../modules/_core":65,"../modules/web.immediate":152}],54:[function(w,P,b){w("../../modules/es6.string.from-code-point"),P.exports=w("../../modules/_core").String.fromCodePoint},{"../../modules/_core":65,"../../modules/es6.string.from-code-point":144}],55:[function(w,P,b){w("../../modules/es6.function.has-instance"),P.exports=w("../../modules/_wks-ext").f("hasInstance")},{"../../modules/_wks-ext":130,"../../modules/es6.function.has-instance":135}],56:[function(w,P,b){w("../../modules/es6.symbol"),w("../../modules/es6.object.to-string"),w("../../modules/es7.symbol.async-iterator"),w("../../modules/es7.symbol.observable"),P.exports=w("../../modules/_core").Symbol},{"../../modules/_core":65,"../../modules/es6.object.to-string":142,"../../modules/es6.symbol":146,"../../modules/es7.symbol.async-iterator":149,"../../modules/es7.symbol.observable":150}],57:[function(w,P,b){w("../../modules/es6.string.iterator"),w("../../modules/web.dom.iterable"),P.exports=w("../../modules/_wks-ext").f("iterator")},{"../../modules/_wks-ext":130,"../../modules/es6.string.iterator":145,"../../modules/web.dom.iterable":151}],58:[function(w,P,b){P.exports=function(T){if(typeof T!="function")throw TypeError(T+" is not a function!");return T}},{}],59:[function(w,P,b){P.exports=function(){}},{}],60:[function(w,P,b){P.exports=function(T,C,c,p){if(!(T instanceof C)||p!==void 0&&p in T)throw TypeError(c+": incorrect invocation!");return T}},{}],61:[function(w,P,b){var T=w("./_is-object");P.exports=function(C){if(!T(C))throw TypeError(C+" is not an object!");return C}},{"./_is-object":85}],62:[function(w,P,b){var T=w("./_to-iobject"),C=w("./_to-length"),c=w("./_to-absolute-index");P.exports=function(p){return function(d,o,a){var u,s=T(d),h=C(s.length),i=c(a,h);if(p&&o!=o){for(;h>i;)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,E=a&o.B,_=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]:E&&i?c(n,T):_&&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 _!="function")throw TypeError(s+" is not iterable!");if(c(_)){for(f=d(s.length);f>y;y++)if((E=h?g(p(v=s[y])[0],v[1]):g(s[y]))===a||E===u)return E}else for(m=_.call(s);!(v=m.next()).done;)if((E=C(m,g,v.value,h))===a||E===u)return E};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&&!_||!h&&!A&&D[s]||p(D,s,B),d[t]=B,d[S]=i,m)if(g={values:O?B:l("values"),keys:E?B:l("keys"),entries:H},_)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),E=m.length,_=0;E>_;)t.call(v,f=m[_++])&&(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("<script>document.F=Object</script>"),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 _=+this;if(v.hasOwnProperty(_)){var g=v[_];delete v[_],g()}},E=function(_){m.call(_.data)};h&&i||(h=function(_){for(var g=[],y=1;arguments.length>y;)g.push(arguments[y++]);return v[++f]=function(){d(typeof _=="function"?_:Function(_),g)},T(f),f},i=function(_){delete v[_]},w("./_cof")(s)=="process"?T=function(_){s.nextTick(p(m,_,1))}:t&&t.now?T=function(_){t.now(p(m,_,1))}:n?(C=new n,c=C.port2,C.port1.onmessage=E,T=p(c.postMessage,c,1)):u.addEventListener&&typeof postMessage=="function"&&!u.importScripts?(T=function(_){u.postMessage(_+"","*")},u.addEventListener("message",E,!1)):T="onreadystatechange"in a("script")?function(_){o.appendChild(a("script")).onreadystatechange=function(){o.removeChild(this),m.call(_)}}:function(_){setTimeout(p(m,_,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,E=m>1?arguments[1]:void 0,_=E!==void 0,g=0,y=u(f);if(_&&(E=T(E,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,_?p(t,E,[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")(),E=w("./_new-promise-capability"),_=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=E.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(_e){var Ge,Ue,Fe,He=Pe?_e.ok:_e.fail,be=_e.resolve,me=_e.reject,We=_e.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===_e.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=_(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)},E.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=_(function(){var _e=[],Ge=0,Ue=1;t(ce,!1,function(Fe){var He=Ge++,be=!1;_e.push(void 0),Ue++,de.resolve(Fe).then(function(me){be||(be=!0,_e[He]=me,--Ue||Se(_e))},Pe)}),--Ue||Se(_e)});return ye.e&&Pe(ye.v),Ce.promise},race:function(ce){var de=this,Ce=B(de),Se=Ce.reject,Pe=_(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"),E=w("./_is-object"),_=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,_e=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($=_($)),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=_(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(_(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:_(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:$}),_e(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 _e(i(q))}),p(p.G+p.W+p.F*!Ce,{Symbol:H});for(var nt="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),re=0;nt.length>re;)i(nt[re++]);for(var k=A(i.store),U=0;k.length>U;)t(k[U++]);p(p.S+p.F*!Ce,"Symbol",{for:function(q){return C(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],(E($)||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;o<d.length;o++){var a=d[o],u=T[a],s=u&&u.prototype;s&&!s[p]&&C(s,p,a),c[a]=c.Array}},{"./_global":76,"./_hide":78,"./_iterators":91,"./_wks":131,"./es6.array.iterator":134}],152:[function(w,P,b){var T=w("./_export"),C=w("./_task");T(T.G+T.B,{setImmediate:C.set,clearImmediate:C.clear})},{"./_export":73,"./_task":120}],153:[function(w,P,b){(function(T){"use strict";function C(g){return Array.isArray?Array.isArray(g):m(g)==="[object Array]"}function c(g){return typeof g=="boolean"}function p(g){return g===null}function d(g){return g==null}function o(g){return typeof g=="number"}function a(g){return typeof g=="string"}function u(g){return(g===void 0?"undefined":(0,_.default)(g))==="symbol"}function s(g){return g===void 0}function h(g){return m(g)==="[object RegExp]"}function i(g){return(g===void 0?"undefined":(0,_.default)(g))==="object"&&g!==null}function n(g){return m(g)==="[object Date]"}function t(g){return m(g)==="[object Error]"||g instanceof Error}function f(g){return typeof g=="function"}function v(g){return g===null||typeof g=="boolean"||typeof g=="number"||typeof g=="string"||(g===void 0?"undefined":(0,_.default)(g))==="symbol"||g===void 0}function m(g){return Object.prototype.toString.call(g)}var E=w("babel-runtime/helpers/typeof"),_=function(g){return g&&g.__esModule?g:{default:g}}(E);b.isArray=C,b.isBoolean=c,b.isNull=p,b.isNullOrUndefined=d,b.isNumber=o,b.isString=a,b.isSymbol=u,b.isUndefined=s,b.isRegExp=h,b.isObject=i,b.isDate=n,b.isError=t,b.isFunction=f,b.isPrimitive=v,b.isBuffer=T.isBuffer}).call(this,{isBuffer:w("../../is-buffer/index.js")})},{"../../is-buffer/index.js":163,"babel-runtime/helpers/typeof":32}],154:[function(w,P,b){"use strict";var T=w("babel-runtime/helpers/typeof"),C=function(c){return c&&c.__esModule?c:{default:c}}(T);!function(c){function p(s,h){for(s=String(s),h=h||2;s.length<h;)s="0"+s;return s}function d(s){var h=new Date(s.getFullYear(),s.getMonth(),s.getDate());h.setDate(h.getDate()-(h.getDay()+6)%7+3);var i=new Date(h.getFullYear(),0,4);i.setDate(i.getDate()-(i.getDay()+6)%7+3);var n=h.getTimezoneOffset()-i.getTimezoneOffset();h.setHours(h.getHours()-n);var t=(h-i)/6048e5;return 1+Math.floor(t)}function o(s){var h=s.getDay();return h===0&&(h=7),h}function a(s){return s===null?"null":s===void 0?"undefined":(s===void 0?"undefined":(0,C.default)(s))!=="object"?s===void 0?"undefined":(0,C.default)(s):Array.isArray(s)?"array":{}.toString.call(s).slice(8,-1).toLowerCase()}var u=function(){var s=/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZWN]|'[^']*'|'[^']*'/g,h=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,i=/[^-+\dA-Z]/g;return function(n,t,f,v){if(arguments.length!==1||a(n)!=="string"||/\d/.test(n)||(t=n,n=void 0),n=n||new Date,n instanceof Date||(n=new Date(n)),isNaN(n))throw TypeError("Invalid date");t=String(u.masks[t]||t||u.masks.default);var m=t.slice(0,4);m!=="UTC:"&&m!=="GMT:"||(t=t.slice(4),f=!0,m==="GMT:"&&(v=!0));var E=f?"getUTC":"get",_=n[E+"Date"](),g=n[E+"Day"](),y=n[E+"Month"](),x=n[E+"FullYear"](),l=n[E+"Hours"](),S=n[E+"Minutes"](),O=n[E+"Seconds"](),A=n[E+"Milliseconds"](),D=f?0:n.getTimezoneOffset(),I=d(n),B=o(n),H={d:_,dd:p(_),ddd:u.i18n.dayNames[g],dddd:u.i18n.dayNames[g+7],m:y+1,mm:p(y+1),mmm:u.i18n.monthNames[y],mmmm:u.i18n.monthNames[y+12],yy:String(x).slice(2),yyyy:x,h:l%12||12,hh:p(l%12||12),H:l,HH:p(l),M:S,MM:p(S),s:O,ss:p(O),l:p(A,3),L:p(Math.round(A/10)),t:l<12?"a":"p",tt:l<12?"am":"pm",T:l<12?"A":"P",TT:l<12?"AM":"PM",Z:v?"GMT":f?"UTC":(String(n).match(h)||[""]).pop().replace(i,""),o:(D>0?"-":"+")+p(100*Math.floor(Math.abs(D)/60)+Math.abs(D)%60,4),S:["th","st","nd","rd"][_%10>3?0:(_%100-_%10!=10)*_%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<t.length;f++)t[f]=arguments[f];t[0]=b.coerce(t[0]),typeof t[0]!="string"&&t.unshift("%O");var v=0;t[0]=t[0].replace(/%([a-zA-Z%])/g,function(m,E){if(m==="%%")return m;v++;var _=b.formatters[E];if(typeof _=="function"){var g=t[v];m=_.call(h,g),t.splice(v,1),v--}return m}),b.formatArgs.call(h,t),(s.log||b.log||console.log.bind(console)).apply(h,t)}}return s.namespace=u,s.enabled=b.enabled(u),s.useColors=b.useColors(),s.color=T(u),typeof b.init=="function"&&b.init(s),s}function c(u){b.save(u),b.names=[],b.skips=[];for(var s=(typeof u=="string"?u:"").split(/[\s,]+/),h=s.length,i=0;i<h;i++)s[i]&&(u=s[i].replace(/\*/g,".*?"),u[0]==="-"?b.skips.push(new RegExp("^"+u.substr(1)+"$")):b.names.push(new RegExp("^"+u+"$")))}function p(){b.enable("")}function d(u){var s,h;for(s=0,h=b.skips.length;s<h;s++)if(b.skips[s].test(u))return!1;for(s=0,h=b.names.length;s<h;s++)if(b.names[s].test(u))return!0;return!1}function o(u){return u instanceof Error?u.stack||u.message:u}b=P.exports=C.debug=C.default=C,b.coerce=o,b.disable=p,b.enable=c,b.enabled=d,b.humanize=w("ms"),b.names=[],b.skips=[],b.formatters={};var a},{ms:169}],157:[function(w,P,b){"use strict";function T(c){var p=""+c,d=C.exec(p);if(!d)return p;var o,a="",u=0,s=0;for(u=d.index;u<p.length;u++){switch(p.charCodeAt(u)){case 34:o=""";break;case 38:o="&";break;case 39:o="'";break;case 60:o="<";break;case 62:o=">";break;default:continue}s!==u&&(a+=p.substring(s,u)),s=u+1,a+=o}return s!==u?a+p.substring(s,u):a}var C=/["'&<>]/;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;i<s;i++)n[i].apply(this,h);return!0},T.prototype.addListener=function(o,a){var u;if(!C(a))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",o,C(a.listener)?a.listener:a),this._events[o]?p(this._events[o])?this._events[o].push(a):this._events[o]=[this._events[o],a]:this._events[o]=a,p(this._events[o])&&!this._events[o].warned&&(u=d(this._maxListeners)?T.defaultMaxListeners:this._maxListeners)&&u>0&&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<<u)-1,h=s>>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<<h)-1,n=i>>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<<d|u,h+=d;h>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&&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(!(h<i))return h<1.5*i?Math.floor(h/i)+" "+n:Math.ceil(h/i)+" "+n+"s"}var d=1e3,o=60*d,a=60*o,u=24*a,s=365.25*u;P.exports=function(h,i){i=i||{};var n=typeof h;if(n==="string"&&h.length>0)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<o.length;s++)a(o[s],s,o)&&u.push(o[s]);return u}b.resolve=function(){for(var o="",a=!1,u=arguments.length-1;u>=-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<v.length&&v[m]==="";m++);for(var E=v.length-1;E>=0&&v[E]==="";E--);return m>E?[]:v.slice(m,E-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<i;t++)if(s[t]!==h[t]){n=t;break}for(var f=[],t=n;t<s.length;t++)f.push("..");return f=f.concat(h.slice(n)),f.join("/")},b.sep="/",b.delimiter=":",b.dirname=function(o){if(typeof o!="string"&&(o+=""),o.length===0)return".";for(var a=o.charCodeAt(0),u=a===47,s=-1,h=!0,i=o.length-1;i>=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<=_)for(;++D<I;)A(O[D],D,O);else o(O,A)}function d(O){return O=i(O),/^(?:webOS|i(?:OS|P))/.test(O)?O:C(O)}function o(O,A){for(var D in O)x.call(O,D)&&A(O[D],D,O)}function a(O){return O==null?C(O):l.call(O).slice(8,-1)}function u(O,A){var D=O!=null?typeof O[A]:"number";return!(/^(?:boolean|number|string|undefined)$/.test(D)||D=="object"&&!O[A])}function s(O){return String(O).replace(/([ -])(?!$)/g,"$1?")}function h(O,A){var D=null;return p(O,function(I,B){D=A(D,I,B,O)}),D}function i(O){return String(O).replace(/^ +| +$/g,"")}function n(O){function A(q){return h(q,function($,J){var xe=J.pattern||s(J);return!$&&($=RegExp("\\b"+xe+" *\\d+[.\\w_]*","i").exec(O)||RegExp("\\b"+xe+" *\\w+-[\\w]*","i").exec(O)||RegExp("\\b"+xe+"(?:; *(?:[a-z]+[_-])?[a-z]+\\d+|[^ ();-]*)","i").exec(O))&&(($=String(J.label&&!RegExp(xe,"i").test(J.label)?J.label:$).split("/"))[1]&&!/[\d.]+/.test($[0])&&($[0]+=" "+$[1]),J=J.label||J,$=d($[0].replace(RegExp(xe,"i"),J).replace(RegExp("; *(?:"+J+"[_-])?","i")," ").replace(RegExp("("+J+")[-_.]?(\\w)","i"),"$1 $2"))),$})}function D(){return this.description||""}var I=f,B=O&&typeof O=="object"&&a(O)!="String";B&&(I=O,O=null);var H=I.navigator||{},te=H.userAgent||"";O||(O=te);var W,V,X=B?!!H.likeChrome:/\bChrome\b/.test(O)&&!/internal|\n/i.test(l.toString()),ne=B?"Object":"ScriptBridgingProxyObject",Y=B?"Object":"Environment",ee=B&&I.java?"JavaPackage":a(I.java),ce=B?"Object":"RuntimeObject",de=/\bJava/.test(ee)&&I.java,Ce=de&&a(I.environment)==Y,Se=de?"a":"\u4F2A",Pe=de?"b":"\u5C3E",ye=I.document||{},_e=I.operamini||I.opera,Ge=g.test(Ge=B&&_e?_e["[[Class]]"]:a(_e))?Ge:_e=null,Ue=O,Fe=[],He=null,be=O==te,me=be&&_e&&typeof _e.version=="function"&&_e.version(),We=function(q){return h(q,function($,J){return $||RegExp("\\b"+(J.pattern||s(J))+"\\b","i").exec(O)&&(J.label||J)})}([{label:"EdgeHTML",pattern:"Edge"},"Trident",{label:"WebKit",pattern:"AppleWebKit"},"iCab","Presto","NetFront","Tasman","KHTML","Gecko"]),ze=function(q){return h(q,function($,J){return $||RegExp("\\b"+(J.pattern||s(J))+"\\b","i").exec(O)&&(J.label||J)})}(["Adobe AIR","Arora","Avant Browser","Breach","Camino","Electron","Epiphany","Fennec","Flock","Galeon","GreenBrowser","iCab","Iceweasel","K-Meleon","Konqueror","Lunascape","Maxthon",{label:"Microsoft Edge",pattern:"Edge"},"Midori","Nook Browser","PaleMoon","PhantomJS","Raven","Rekonq","RockMelt",{label:"Samsung Internet",pattern:"SamsungBrowser"},"SeaMonkey",{label:"Silk",pattern:"(?:Cloud9|Silk-Accelerated)"},"Sleipnir","SlimBrowser",{label:"SRWare Iron",pattern:"Iron"},"Sunrise","Swiftfox","Waterfox","WebPositive","Opera Mini",{label:"Opera Mini",pattern:"OPiOS"},"Opera",{label:"Opera",pattern:"OPR"},"Chrome",{label:"Chrome Mobile",pattern:"(?:CriOS|CrMo)"},{label:"Firefox",pattern:"(?:Firefox|Minefield)"},{label:"Firefox for iOS",pattern:"FxiOS"},{label:"IE",pattern:"IEMobile"},{label:"IE",pattern:"MSIE"},"Safari"]),nt=A([{label:"BlackBerry",pattern:"BB10"},"BlackBerry",{label:"Galaxy S",pattern:"GT-I9000"},{label:"Galaxy S2",pattern:"GT-I9100"},{label:"Galaxy S3",pattern:"GT-I9300"},{label:"Galaxy S4",pattern:"GT-I9500"},{label:"Galaxy S5",pattern:"SM-G900"},{label:"Galaxy S6",pattern:"SM-G920"},{label:"Galaxy S6 Edge",pattern:"SM-G925"},{label:"Galaxy S7",pattern:"SM-G930"},{label:"Galaxy S7 Edge",pattern:"SM-G935"},"Google TV","Lumia","iPad","iPod","iPhone","Kindle",{label:"Kindle Fire",pattern:"(?:Cloud9|Silk-Accelerated)"},"Nexus","Nook","PlayBook","PlayStation Vita","PlayStation","TouchPad","Transformer",{label:"Wii U",pattern:"WiiU"},"Wii","Xbox One",{label:"Xbox 360",pattern:"Xbox"},"Xoom"]),re=function(q){return h(q,function($,J,xe){return $||(J[nt]||J[/^[a-z]+(?: +[a-z]+\b)*/i.exec(nt)]||RegExp("\\b"+s(xe)+"(?:\\b|\\w*\\d)","i").exec(O))&&xe})}({Apple:{iPad:1,iPhone:1,iPod:1},Archos:{},Amazon:{Kindle:1,"Kindle Fire":1},Asus:{Transformer:1},"Barnes & Noble":{Nook:1},BlackBerry:{PlayBook:1},Google:{"Google TV":1,Nexus:1},HP:{TouchPad:1},HTC:{},LG:{},Microsoft:{Xbox:1,"Xbox One":1},Motorola:{Xoom:1},Nintendo:{"Wii U":1,Wii:1},Nokia:{Lumia:1},Samsung:{"Galaxy S":1,"Galaxy S2":1,"Galaxy S3":1,"Galaxy S4":1},Sony:{PlayStation:1,"PlayStation Vita":1}}),k=function(q){return h(q,function($,J){var xe=J.pattern||s(J);return!$&&($=RegExp("\\b"+xe+"(?:/[\\d.]+|[ \\w.]*)","i").exec(O))&&($=c($,xe,J.label||J)),$})}(["Windows Phone","Android","CentOS",{label:"Chrome OS",pattern:"CrOS"},"Debian","Fedora","FreeBSD","Gentoo","Haiku","Kubuntu","Linux Mint","OpenBSD","Red Hat","SuSE","Ubuntu","Xubuntu","Cygwin","Symbian OS","hpwOS","webOS ","webOS","Tablet OS","Tizen","Linux","Mac OS X","Macintosh","Mac","Windows 98;","Windows "]);if(We&&(We=[We]),re&&!nt&&(nt=A([re])),(W=/\bGoogle TV\b/.exec(nt))&&(nt=W[0]),/\bSimulator\b/i.test(O)&&(nt=(nt?nt+" ":"")+"Simulator"),ze=="Opera Mini"&&/\bOPiOS\b/.test(O)&&Fe.push("running in Turbo/Uncompressed mode"),ze=="IE"&&/\blike iPhone OS\b/.test(O)?(W=n(O.replace(/like iPhone OS/,"")),re=W.manufacturer,nt=W.product):/^iP/.test(nt)?(ze||(ze="Safari"),k="iOS"+((W=/ OS ([\d_]+)/i.exec(O))?" "+W[1].replace(/_/g,"."):"")):ze!="Konqueror"||/buntu/i.test(k)?re&&re!="Google"&&(/Chrome/.test(ze)&&!/\bMobile Safari\b/i.test(O)||/\bVita\b/.test(nt))||/\bAndroid\b/.test(k)&&/^Chrome/.test(ze)&&/\bVersion\//i.test(O)?(ze="Android Browser",k=/\bAndroid\b/.test(k)?k:"Android"):ze=="Silk"?(/\bMobi/i.test(O)||(k="Android",Fe.unshift("desktop mode")),/Accelerated *= *true/i.test(O)&&Fe.unshift("accelerated")):ze=="PaleMoon"&&(W=/\bFirefox\/([\d.]+)\b/.exec(O))?Fe.push("identifying as Firefox "+W[1]):ze=="Firefox"&&(W=/\b(Mobile|Tablet|TV)\b/i.exec(O))?(k||(k="Firefox OS"),nt||(nt=W[1])):!ze||(W=!/\bMinefield\b/i.test(O)&&/\b(?:Firefox|Safari)\b/.exec(ze))?(ze&&!nt&&/[\/,]|^[^(]+?\)/.test(O.slice(O.indexOf(W+"/")+8))&&(ze=null),(W=nt||re||k)&&(nt||re||/\b(?:Android|Symbian OS|Tablet OS|webOS)\b/.test(k))&&(ze=/[a-z]+(?: Hat)?/i.exec(/\bAndroid\b/.test(k)?k:W)+" Browser")):ze=="Electron"&&(W=(/\bChrome\/([\d.]+)\b/.exec(O)||0)[1])&&Fe.push("Chromium "+W):k="Kubuntu",me||(me=function(q){return h(q,function($,J){return $||(RegExp(J+"(?:-[\\d.]+/|(?: for [\\w-]+)?[ /-])([\\d.]+[^ ();/_-]*)","i").exec(O)||0)[1]||null})}(["(?:Cloud9|CriOS|CrMo|Edge|FxiOS|IEMobile|Iron|Opera ?Mini|OPiOS|OPR|Raven|SamsungBrowser|Silk(?!/[\\d.]+$))","Version",s(ze),"(?:Firefox|Minefield|NetFront)"])),(W=We=="iCab"&&parseFloat(me)>3&&"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&&_e||/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,E=v&&m&&typeof T=="object"&&T;!E||E.global!==E&&E.window!==E&&E.self!==E||(f=E);var _=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;u<a.length;)a[u++]=arguments[u];return T.nextTick(function(){c.apply(null,a)})}}!T.version||T.version.indexOf("v0.")===0||T.version.indexOf("v1.")===0&&T.version.indexOf("v1.8.")!==0?P.exports={nextTick:C}:P.exports=T}).call(this,w("_process"))},{_process:173}],173:[function(w,P,b){function T(){throw new Error("setTimeout has not been defined")}function C(){throw new Error("clearTimeout has not been defined")}function c(m){if(s===setTimeout)return setTimeout(m,0);if((s===T||!s)&&setTimeout)return s=setTimeout,setTimeout(m,0);try{return s(m,0)}catch(E){try{return s.call(null,m,0)}catch(_){return s.call(this,m,0)}}}function p(m){if(h===clearTimeout)return clearTimeout(m);if((h===C||!h)&&clearTimeout)return h=clearTimeout,clearTimeout(m);try{return h(m)}catch(E){try{return h.call(null,m)}catch(_){return h.call(this,m)}}}function d(){f&&n&&(f=!1,n.length?t=n.concat(t):v=-1,t.length&&o())}function o(){if(!f){var m=c(d);f=!0;for(var E=t.length;E;){for(n=t,t=[];++v<E;)n&&n[v].run();v=-1,E=t.length}n=null,f=!1,p(m)}}function a(m,E){this.fun=m,this.array=E}function u(){}var s,h,i=P.exports={};!function(){try{s=typeof setTimeout=="function"?setTimeout:T}catch(m){s=T}try{h=typeof clearTimeout=="function"?clearTimeout:C}catch(m){h=C}}();var n,t=[],f=!1,v=-1;i.nextTick=function(m){var E=new Array(arguments.length-1);if(arguments.length>1)for(var _=1;_<arguments.length;_++)E[_-1]=arguments[_];t.push(new a(m,E)),t.length!==1||f||c(o)},a.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=u,i.addListener=u,i.once=u,i.off=u,i.removeListener=u,i.removeAllListeners=u,i.emit=u,i.prependListener=u,i.prependOnceListener=u,i.listeners=function(m){return[]},i.binding=function(m){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(m){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],174:[function(w,P,b){(function(T){!function(C){function c(ee){throw new RangeError(V[ee])}function p(ee,ce){for(var de=ee.length,Ce=[];de--;)Ce[de]=ce(ee[de]);return Ce}function d(ee,ce){var de=ee.split("@"),Ce="";return de.length>1&&(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<Pe;)ce=ee.charCodeAt(Se++),ce>=55296&&ce<=56319&&Se<Pe?(de=ee.charCodeAt(Se++),(64512&de)==56320?Ce.push(((1023&ce)<<10)+(1023&de)+65536):(Ce.push(ce),Se--)):Ce.push(ce);return Ce}function a(ee){return p(ee,function(ce){var de="";return ce>65535&&(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,_e,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<de;++Ce)ee.charCodeAt(Ce)>=128&&c("not-basic"),He.push(ee.charCodeAt(Ce));for(Se=de>0?de+1:0;Se<be;){for(Pe=me,ye=1,_e=x;Se>=be&&c("invalid-input"),Ge=u(ee.charCodeAt(Se++)),(Ge>=x||Ge>ne((y-me)/ye))&&c("overflow"),me+=Ge*ye,Ue=_e<=ze?l:_e>=ze+S?S:_e-ze,!(Ge<Ue);_e+=x)Fe=x-Ue,ye>ne(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,_e,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<be;++ye)(He=ee[ye])<128&&nt.push(Y(He));for(Ce=Se=nt.length,Se&&nt.push(B);Ce<be;){for(_e=y,ye=0;ye<be;++ye)(He=ee[ye])>=ce&&He<_e&&(_e=He);for(me=Ce+1,_e-ce>ne((y-de)/me)&&c("overflow"),de+=(_e-ce)*me,ce=_e,ye=0;ye<be;++ye)if(He=ee[ye],He<ce&&++de>y&&c("overflow"),He==ce){for(Ge=de,Ue=x;Fe=Ue<=Pe?l:Ue>=Pe+S?S:Ue-Pe,!(Ge<Fe);Ue+=x)ze=Ge-Fe,We=x-Fe,nt.push(Y(s(Fe+ze%We,0))),Ge=ne(ze/We);nt.push(Y(s(Ge,0))),Pe=h(de,me,Ce==Se),de=0,++Ce}++de,++ce}return nt.join("")}function t(ee){return d(ee,function(ce){return H.test(ce)?i(ce.slice(4).toLowerCase()):ce})}function f(ee){return d(ee,function(ce){return te.test(ce)?"xn--"+n(ce):ce})}var v=typeof b=="object"&&b&&!b.nodeType&&b,m=typeof P=="object"&&P&&!P.nodeType&&P,E=typeof T=="object"&&T;E.global!==E&&E.window!==E&&E.self!==E||(C=E);var _,g,y=2147483647,x=36,l=1,S=26,O=38,A=700,D=72,I=128,B="-",H=/^xn--/,te=/[^\x20-\x7E]/,W=/[\x2E\u3002\uFF0E\uFF61]/g,V={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},X=x-l,ne=Math.floor,Y=String.fromCharCode;if(_={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 _});else if(v&&m)if(P.exports==v)m.exports=_;else for(g in _)_.hasOwnProperty(g)&&(v[g]=_[g]);else C.punycode=_}(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<h;++i){var n,t,f,v,m=c[i].replace(u,"%20"),E=m.indexOf(d);E>=0?(n=m.substr(0,E),t=m.substr(E+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;u<d.length;u++)a.push(o(d[u],u));return a}var C=function(d){switch(typeof d){case"string":return d;case"boolean":return d?"true":"false";case"number":return isFinite(d)?d:"";default:return""}};P.exports=function(d,o,a,u){return o=o||"&",a=a||"=",d===null&&(d=void 0),typeof d=="object"?T(p(d),function(s){var h=encodeURIComponent(C(s))+a;return c(d[s])?T(d[s],function(i){return h+encodeURIComponent(C(i))}).join(o):h+encodeURIComponent(C(d[s]))}).join(o):u?encodeURIComponent(C(u))+a+encodeURIComponent(C(d)):""};var c=Array.isArray||function(d){return Object.prototype.toString.call(d)==="[object Array]"},p=Object.keys||function(d){var o=[];for(var a in d)Object.prototype.hasOwnProperty.call(d,a)&&o.push(a);return o}},{}],177:[function(w,P,b){"use strict";b.decode=b.parse=w("./decode"),b.encode=b.stringify=w("./encode")},{"./decode":175,"./encode":176}],178:[function(w,P,b){P.exports=w("./lib/_stream_duplex.js")},{"./lib/_stream_duplex.js":179}],179:[function(w,P,b){"use strict";function T(f){if(!(this instanceof T))return new T(f);s.call(this,f),h.call(this,f),f&&f.readable===!1&&(this.readable=!1),f&&f.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,f&&f.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",C)}function C(){this.allowHalfOpen||this._writableState.ended||o.nextTick(c,this)}function c(f){f.end()}var p=w("babel-runtime/core-js/object/keys"),d=function(f){return f&&f.__esModule?f:{default:f}}(p),o=w("process-nextick-args"),a=d.default||function(f){var v=[];for(var m in f)v.push(m);return v};P.exports=T;var u=w("core-util-is");u.inherits=w("inherits");var s=w("./_stream_readable"),h=w("./_stream_writable");u.inherits(T,s);for(var i=a(h.prototype),n=0;n<i.length;n++){var t=i[n];T.prototype[t]||(T.prototype[t]=h.prototype[t])}Object.defineProperty(T.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(T.prototype,"destroyed",{get:function(){return this._readableState!==void 0&&this._writableState!==void 0&&this._readableState.destroyed&&this._writableState.destroyed},set:function(f){this._readableState!==void 0&&this._writableState!==void 0&&(this._readableState.destroyed=f,this._writableState.destroyed=f)}}),T.prototype._destroy=function(f,v){this.push(null),this.end(),o.nextTick(v,f)}},{"./_stream_readable":181,"./_stream_writable":183,"babel-runtime/core-js/object/keys":23,"core-util-is":153,inherits:162,"process-nextick-args":172}],180:[function(w,P,b){"use strict";function T(p){if(!(this instanceof T))return new T(p);C.call(this,p)}P.exports=T;var C=w("./_stream_transform"),c=w("core-util-is");c.inherits=w("inherits"),c.inherits(T,C),T.prototype._transform=function(p,d,o){o(null,p)}},{"./_stream_transform":182,"core-util-is":153,inherits:162}],181:[function(w,P,b){(function(T,C){"use strict";function c(be){return de.from(be)}function p(be){return de.isBuffer(be)||be instanceof Ce}function d(be,me,We){if(typeof be.prependListener=="function")return be.prependListener(me,We);be._events&&be._events[me]?Y(be._events[me])?be._events[me].unshift(We):be._events[me]=[We,be._events[me]]:be.on(me,We)}function o(be,me){ne=ne||w("./_stream_duplex"),be=be||{};var We=me instanceof ne;this.objectMode=!!be.objectMode,We&&(this.objectMode=this.objectMode||!!be.readableObjectMode);var ze=be.highWaterMark,nt=be.readableHighWaterMark,re=this.objectMode?16:16384;this.highWaterMark=ze||ze===0?ze:We&&(nt||nt===0)?nt:re,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new Ge,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=be.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,be.encoding&&(_e||(_e=w("string_decoder/").StringDecoder),this.decoder=new _e(be.encoding),this.encoding=be.encoding)}function a(be){if(ne=ne||w("./_stream_duplex"),!(this instanceof a))return new a(be);this._readableState=new o(be,this),this.readable=!0,be&&(typeof be.read=="function"&&(this._read=be.read),typeof be.destroy=="function"&&(this._destroy=be.destroy)),ce.call(this)}function u(be,me,We,ze,nt){var re=be._readableState;if(me===null)re.reading=!1,f(be,re);else{var k;nt||(k=h(re,me)),k?be.emit("error",k):re.objectMode||me&&me.length>0?(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):E(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)),E(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<be.highWaterMark||be.length===0)}function n(be){return be>=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 E(be,me){me.readingMore||(me.readingMore=!0,X.nextTick(_,be,me))}function _(be,me){for(var We=me.length;!me.reading&&!me.flowing&&!me.ended&&me.length<me.highWaterMark&&(ye("maybeReadMore read 0"),be.read(0),We!==me.length);)We=me.length;me.readingMore=!1}function g(be){return function(){var me=be._readableState;ye("pipeOnDrain",me.awaitDrain),me.awaitDrain&&me.awaitDrain--,me.awaitDrain===0&&ee(be,"data")&&(me.flowing=!0,S(be))}}function y(be){ye("readable nexttick read 0"),be.read(0)}function x(be,me){me.resumeScheduled||(me.resumeScheduled=!0,X.nextTick(l,be,me))}function l(be,me){me.reading||(ye("resume read 0"),be.read(0)),me.resumeScheduled=!1,me.awaitDrain=0,be.emit("resume"),S(be),me.flowing&&!me.reading&&be.read(0)}function S(be){var me=be._readableState;for(ye("flow",me.flowing);me.flowing&&be.read()!==null;);}function O(be,me){if(me.length===0)return null;var We;return me.objectMode?We=me.buffer.shift():!be||be>=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 be<me.head.data.length?(ze=me.head.data.slice(0,be),me.head.data=me.head.data.slice(be)):ze=be===me.head.data.length?me.shift():We?D(be,me):I(be,me),ze}function D(be,me){var We=me.head,ze=1,nt=We.data;for(be-=nt.length;We=We.next;){var re=We.data,k=be>re.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<ze;We++)if(be[We]===me)return We;return-1}var W=w("babel-runtime/core-js/object/get-prototype-of"),V=function(be){return be&&be.__esModule?be:{default:be}}(W),X=w("process-nextick-args");P.exports=a;var ne,Y=w("isarray");a.ReadableState=o;var ee=(w("events").EventEmitter,function(be,me){return be.listeners(me).length}),ce=w("./internal/streams/stream"),de=w("safe-buffer").Buffer,Ce=C.Uint8Array||function(){},Se=w("core-util-is");Se.inherits=w("inherits");var Pe=w("util"),ye=void 0;ye=Pe&&Pe.debuglog?Pe.debuglog("stream"):function(){};var _e,Ge=w("./internal/streams/BufferList"),Ue=w("./internal/streams/destroy");Se.inherits(a,ce);var Fe=["error","close","destroy","pause","resume"];Object.defineProperty(a.prototype,"destroyed",{get:function(){return this._readableState!==void 0&&this._readableState.destroyed},set:function(be){this._readableState&&(this._readableState.destroyed=be)}}),a.prototype.destroy=Ue.destroy,a.prototype._undestroy=Ue.undestroy,a.prototype._destroy=function(be,me){this.push(null),me(be)},a.prototype.push=function(be,me){var We,ze=this._readableState;return ze.objectMode?We=!0:typeof be=="string"&&(me=me||ze.defaultEncoding,me!==ze.encoding&&(be=de.from(be,me),me=""),We=!0),u(this,be,me,!1,We)},a.prototype.unshift=function(be){return u(this,be,null,!0,!1)},a.prototype.isPaused=function(){return this._readableState.flowing===!1},a.prototype.setEncoding=function(be){return _e||(_e=w("string_decoder/").StringDecoder),this._readableState.decoder=new _e(be),this._readableState.encoding=be,this};var He=8388608;a.prototype.read=function(be){ye("read",be),be=parseInt(be,10);var me=this._readableState,We=be;if(be!==0&&(me.emittedReadable=!1),be===0&&me.needReadable&&(me.length>=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-be<me.highWaterMark)&&(ze=!0,ye("length less than watermark",ze)),me.ended||me.reading?(ze=!1,ye("reading or ended",ze)):ze&&(ye("do read"),me.reading=!0,me.sync=!0,me.length===0&&(me.needReadable=!0),this._read(me.highWaterMark),me.sync=!1,me.reading||(be=t(We,me)));var nt;return nt=be>0?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<nt;re++)ze[re].emit("unpipe",this,We);return this}var k=te(me.pipes,be);return k===-1?this:(me.pipes.splice(k,1),me.pipesCount-=1,me.pipesCount===1&&(me.pipes=me.pipes[0]),be.emit("unpipe",this,We),this)},a.prototype.on=function(be,me){var We=ce.prototype.on.call(this,be,me);if(be==="data")this._readableState.flowing!==!1&&this.resume();else if(be==="readable"){var ze=this._readableState;ze.endEmitted||ze.readableListening||(ze.readableListening=ze.needReadable=!0,ze.emittedReadable=!1,ze.reading?ze.length&&v(this):X.nextTick(y,this))}return We},a.prototype.addListener=a.prototype.on,a.prototype.resume=function(){var be=this._readableState;return be.flowing||(ye("resume"),be.flowing=!0,x(this,be)),this},a.prototype.pause=function(){return ye("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(ye("pause"),this._readableState.flowing=!1,this.emit("pause")),this},a.prototype.wrap=function(be){var me=this,We=this._readableState,ze=!1;be.on("end",function(){if(ye("wrapped end"),We.decoder&&!We.ended){var k=We.decoder.end();k&&k.length&&me.push(k)}me.push(null)}),be.on("data",function(k){(ye("wrapped data"),We.decoder&&(k=We.decoder.write(k)),(!We.objectMode||k!=null)&&(We.objectMode||k&&k.length))&&(me.push(k)||(ze=!0,be.pause()))});for(var nt in be)this[nt]===void 0&&typeof be[nt]=="function"&&(this[nt]=function(k){return function(){return be[k].apply(be,arguments)}}(nt));for(var re=0;re<Fe.length;re++)be.on(Fe[re],this.emit.bind(this,Fe[re]));return this._read=function(k){ye("wrapped _read",k),ze&&(ze=!1,be.resume())},this},Object.defineProperty(a.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),a._fromList=O}).call(this,w("_process"),typeof le!="undefined"?le:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"./_stream_duplex":179,"./internal/streams/BufferList":184,"./internal/streams/destroy":185,"./internal/streams/stream":186,_process:173,"babel-runtime/core-js/object/get-prototype-of":22,"core-util-is":153,events:158,inherits:162,isarray:166,"process-nextick-args":172,"safe-buffer":193,"string_decoder/":200,util:36}],182:[function(w,P,b){"use strict";function T(a,u){var s=this._transformState;s.transforming=!1;var h=s.writecb;if(!h)return this.emit("error",new Error("write callback called multiple times"));s.writechunk=null,s.writecb=null,u!=null&&this.push(u),h(a);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function C(a){if(!(this instanceof C))return new C(a);d.call(this,a),this._transformState={afterTransform:T.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,a&&(typeof a.transform=="function"&&(this._transform=a.transform),typeof a.flush=="function"&&(this._flush=a.flush)),this.on("prefinish",c)}function c(){var a=this;typeof this._flush=="function"?this._flush(function(u,s){p(a,u,s)}):p(this,null,null)}function p(a,u,s){if(u)return a.emit("error",u);if(s!=null&&a.push(s),a._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(a._transformState.transforming)throw new Error("Calling transform done when still transforming");return a.push(null)}P.exports=C;var d=w("./_stream_duplex"),o=w("core-util-is");o.inherits=w("inherits"),o.inherits(C,d),C.prototype.push=function(a,u){return this._transformState.needTransform=!1,d.prototype.push.call(this,a,u)},C.prototype._transform=function(a,u,s){throw new Error("_transform() is not implemented")},C.prototype._write=function(a,u,s){var h=this._transformState;if(h.writecb=s,h.writechunk=a,h.writeencoding=u,!h.transforming){var i=this._readableState;(h.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},C.prototype._read=function(a){var u=this._transformState;u.writechunk!==null&&u.writecb&&!u.transforming?(u.transforming=!0,this._transform(u.writechunk,u.writeencoding,u.afterTransform)):u.needTransform=!0},C.prototype._destroy=function(a,u){var s=this;d.prototype._destroy.call(this,a,function(h){u(h),s.emit("close")})}},{"./_stream_duplex":179,"core-util-is":153,inherits:162}],183:[function(w,P,b){(function(T,C){"use strict";function c(Ue){return Ue&&Ue.__esModule?Ue:{default:Ue}}function p(Ue){var Fe=this;this.next=null,this.entry=null,this.finish=function(){D(Fe,Ue)}}function d(Ue){return Pe.from(Ue)}function o(Ue){return Pe.isBuffer(Ue)||Ue instanceof ye}function a(){}function u(Ue,Fe){ee=ee||w("./_stream_duplex"),Ue=Ue||{};var He=Fe instanceof ee;this.objectMode=!!Ue.objectMode,He&&(this.objectMode=this.objectMode||!!Ue.writableObjectMode);var be=Ue.highWaterMark,me=Ue.writableHighWaterMark,We=this.objectMode?16:16384;this.highWaterMark=be||be===0?be:He&&(me||me===0)?me:We,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var ze=Ue.decodeStrings===!1;this.decodeStrings=!ze,this.defaultEncoding=Ue.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(nt){E(Fe,nt)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new p(this)}function s(Ue){if(ee=ee||w("./_stream_duplex"),!(Ge.call(s,this)||this instanceof ee))return new s(Ue);this._writableState=new u(Ue,this),this.writable=!0,Ue&&(typeof Ue.write=="function"&&(this._write=Ue.write),typeof Ue.writev=="function"&&(this._writev=Ue.writev),typeof Ue.destroy=="function"&&(this._destroy=Ue.destroy),typeof Ue.final=="function"&&(this._final=Ue.final)),Se.call(this)}function h(Ue,Fe){var He=new Error("write after end");Ue.emit("error",He),Y.nextTick(Fe,He)}function i(Ue,Fe,He,be){var me=!0,We=!1;return He===null?We=new TypeError("May not write null values to stream"):typeof He=="string"||He===void 0||Fe.objectMode||(We=new TypeError("Invalid non-string/buffer chunk")),We&&(Ue.emit("error",We),Y.nextTick(be,We),me=!1),me}function n(Ue,Fe,He){return Ue.objectMode||Ue.decodeStrings===!1||typeof Fe!="string"||(Fe=Pe.from(Fe,He)),Fe}function t(Ue,Fe,He,be,me,We){if(!He){var ze=n(Fe,be,me);be!==ze&&(He=!0,me="buffer",be=ze)}var nt=Fe.objectMode?1:be.length;Fe.length+=nt;var re=Fe.length<Fe.highWaterMark;if(re||(Fe.needDrain=!0),Fe.writing||Fe.corked){var k=Fe.lastBufferedRequest;Fe.lastBufferedRequest={chunk:be,encoding:me,isBuf:He,callback:We,next:null},k?k.next=Fe.lastBufferedRequest:Fe.bufferedRequest=Fe.lastBufferedRequest,Fe.bufferedRequestCount+=1}else f(Ue,Fe,!1,nt,be,me,We);return re}function f(Ue,Fe,He,be,me,We,ze){Fe.writelen=be,Fe.writecb=ze,Fe.writing=!0,Fe.sync=!0,He?Ue._writev(me,Fe.onwrite):Ue._write(me,We,Fe.onwrite),Fe.sync=!1}function v(Ue,Fe,He,be,me){--Fe.pendingcb,He?(Y.nextTick(me,be),Y.nextTick(O,Ue,Fe),Ue._writableState.errorEmitted=!0,Ue.emit("error",be)):(me(be),Ue._writableState.errorEmitted=!0,Ue.emit("error",be),O(Ue,Fe))}function m(Ue){Ue.writing=!1,Ue.writecb=null,Ue.length-=Ue.writelen,Ue.writelen=0}function E(Ue,Fe){var He=Ue._writableState,be=He.sync,me=He.writecb;if(m(He),Fe)v(Ue,He,be,Fe,me);else{var We=x(He);We||He.corked||He.bufferProcessing||!He.bufferedRequest||y(Ue,He),be?ce(_,Ue,He,We,me):_(Ue,He,We,me)}}function _(Ue,Fe,He,be){He||g(Ue,Fe),Fe.pendingcb--,be(),O(Ue,Fe)}function g(Ue,Fe){Fe.length===0&&Fe.needDrain&&(Fe.needDrain=!1,Ue.emit("drain"))}function y(Ue,Fe){Fe.bufferProcessing=!0;var He=Fe.bufferedRequest;if(Ue._writev&&He&&He.next){var be=Fe.bufferedRequestCount,me=new Array(be),We=Fe.corkedRequestsFree;We.entry=He;for(var ze=0,nt=!0;He;)me[ze]=He,He.isBuf||(nt=!1),He=He.next,ze+=1;me.allBuffers=nt,f(Ue,Fe,!0,Fe.length,me,"",We.finish),Fe.pendingcb++,Fe.lastBufferedRequest=null,We.next?(Fe.corkedRequestsFree=We.next,We.next=null):Fe.corkedRequestsFree=new p(Fe),Fe.bufferedRequestCount=0}else{for(;He;){var re=He.chunk,k=He.encoding,U=He.callback;if(f(Ue,Fe,!1,Fe.objectMode?1:re.length,re,k,U),He=He.next,Fe.bufferedRequestCount--,Fe.writing)break}He===null&&(Fe.lastBufferedRequest=null)}Fe.bufferedRequest=He,Fe.bufferProcessing=!1}function x(Ue){return Ue.ending&&Ue.length===0&&Ue.bufferedRequest===null&&!Ue.finished&&!Ue.writing}function l(Ue,Fe){Ue._final(function(He){Fe.pendingcb--,He&&Ue.emit("error",He),Fe.prefinished=!0,Ue.emit("prefinish"),O(Ue,Fe)})}function S(Ue,Fe){Fe.prefinished||Fe.finalCalled||(typeof Ue._final=="function"?(Fe.pendingcb++,Fe.finalCalled=!0,Y.nextTick(l,Ue,Fe)):(Fe.prefinished=!0,Ue.emit("prefinish")))}function O(Ue,Fe){var He=x(Fe);return He&&(S(Ue,Fe),Fe.pendingcb===0&&(Fe.finished=!0,Ue.emit("finish"))),He}function A(Ue,Fe,He){Fe.ending=!0,O(Ue,Fe),He&&(Fe.finished?Y.nextTick(He):Ue.once("finish",He)),Fe.ended=!0,Ue.writable=!1}function D(Ue,Fe,He){var be=Ue.entry;for(Ue.entry=null;be;){var me=be.callback;Fe.pendingcb--,me(He),be=be.next}Fe.corkedRequestsFree?Fe.corkedRequestsFree.next=Ue:Fe.corkedRequestsFree=Ue}var I=w("babel-runtime/core-js/object/define-property"),B=c(I),H=w("babel-runtime/core-js/symbol/has-instance"),te=c(H),W=w("babel-runtime/core-js/symbol"),V=c(W),X=w("babel-runtime/core-js/set-immediate"),ne=c(X),Y=w("process-nextick-args");P.exports=s;var ee,ce=!T.browser&&["v0.10","v0.9."].indexOf(T.version.slice(0,5))>-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(){},_e=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=_e.destroy,s.prototype._undestroy=_e.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 _e=ye.arg,Ge=_e.value;return Ge&&typeof Ge=="object"&&_.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){_e.value=Ue,Se(_e)},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<ne.length;)if(_.call(ne,ee))return de.value=ne[ee],de.done=!1,de;return de.value=m,de.done=!0,de};return ce.next=ce}}return{next:v}}function v(){return{value:m,done:!0}}var m,E=Object.prototype,_=E.hasOwnProperty,g=typeof Symbol=="function"?Symbol:{},y=g.iterator||"@@iterator",x=g.asyncIterator||"@@asyncIterator",l=g.toStringTag||"@@toStringTag",S=typeof P=="object",O=T.regeneratorRuntime;if(O)return void(S&&(P.exports=O));O=T.regeneratorRuntime=S?P.exports:{},O.wrap=C;var A="suspendedStart",D="suspendedYield",I="executing",B="completed",H={},te={};te[y]=function(){return this};var W=Object.getPrototypeOf,V=W&&W(W(f([])));V&&V!==E&&_.call(V,y)&&(te=V);var X=o.prototype=p.prototype=Object.create(te);d.prototype=X.constructor=o,o.constructor=d,o[l]=d.displayName="GeneratorFunction",O.isGeneratorFunction=function(ne){var Y=typeof ne=="function"&&ne.constructor;return!!Y&&(Y===d||(Y.displayName||Y.name)==="GeneratorFunction")},O.mark=function(ne){return Object.setPrototypeOf?Object.setPrototypeOf(ne,o):(ne.__proto__=o,l in ne||(ne[l]="GeneratorFunction")),ne.prototype=Object.create(X),ne},O.awrap=function(ne){return{__await:ne}},a(u.prototype),u.prototype[x]=function(){return this},O.AsyncIterator=u,O.async=function(ne,Y,ee,ce){var de=new u(C(ne,Y,ee,ce));return O.isGeneratorFunction(Y)?de:de.next().then(function(Ce){return Ce.done?Ce.value:de.next()})},a(X),X[l]="Generator",X[y]=function(){return this},X.toString=function(){return"[object Generator]"},O.keys=function(ne){var Y=[];for(var ee in ne)Y.push(ee);return Y.reverse(),function ce(){for(;Y.length;){var de=Y.pop();if(de in ne)return ce.value=de,ce.done=!1,ce}return ce.done=!0,ce}},O.values=f,t.prototype={constructor:t,reset:function(ne){if(this.prev=0,this.next=0,this.sent=this._sent=m,this.done=!1,this.delegate=null,this.method="next",this.arg=m,this.tryEntries.forEach(n),!ne)for(var Y in this)Y.charAt(0)==="t"&&_.call(this,Y)&&!isNaN(+Y.slice(1))&&(this[Y]=m)},stop:function(){this.done=!0;var ne=this.tryEntries[0],Y=ne.completion;if(Y.type==="throw")throw Y.arg;return this.rval},dispatchException:function(ne){function Y(ye,_e){return Ce.type="throw",Ce.arg=ne,ee.next=ye,_e&&(ee.method="next",ee.arg=m),!!_e}if(this.done)throw ne;for(var ee=this,ce=this.tryEntries.length-1;ce>=0;--ce){var de=this.tryEntries[ce],Ce=de.completion;if(de.tryLoc==="root")return Y("end");if(de.tryLoc<=this.prev){var Se=_.call(de,"catchLoc"),Pe=_.call(de,"finallyLoc");if(Se&&Pe){if(this.prev<de.catchLoc)return Y(de.catchLoc,!0);if(this.prev<de.finallyLoc)return Y(de.finallyLoc)}else if(Se){if(this.prev<de.catchLoc)return Y(de.catchLoc,!0)}else{if(!Pe)throw new Error("try statement without catch or finally");if(this.prev<de.finallyLoc)return Y(de.finallyLoc)}}}},abrupt:function(ne,Y){for(var ee=this.tryEntries.length-1;ee>=0;--ee){var ce=this.tryEntries[ee];if(ce.tryLoc<=this.prev&&_.call(ce,"finallyLoc")&&this.prev<ce.finallyLoc){var de=ce;break}}de&&(ne==="break"||ne==="continue")&&de.tryLoc<=Y&&Y<=de.finallyLoc&&(de=null);var Ce=de?de.completion:{};return Ce.type=ne,Ce.arg=Y,de?(this.method="next",this.next=de.finallyLoc,H):this.complete(Ce)},complete:function(ne,Y){if(ne.type==="throw")throw ne.arg;return ne.type==="break"||ne.type==="continue"?this.next=ne.arg:ne.type==="return"?(this.rval=this.arg=ne.arg,this.method="return",this.next="end"):ne.type==="normal"&&Y&&(this.next=Y),H},finish:function(ne){for(var Y=this.tryEntries.length-1;Y>=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;_(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 E($){for(var J=Math.max(v.MAX_BUFFER_LENGTH,10),xe=0,ke=0,dt=_e.length;ke<dt;ke++){var Ne=$[_e[ke]].length;if(Ne>J)switch(_e[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: "+_e[ke])}xe=Math.max(xe,Ne)}var je=v.MAX_BUFFER_LENGTH-xe;$.bufferCheckPosition=je+$.position}function _($){for(var J=0,xe=_e.length;J<xe;J++)$[_e[J]]=""}function g($){H($),$.cdata!==""&&(B($,"oncdata",$.cdata),$.cdata=""),$.script!==""&&(B($,"onscript",$.script),$.script="")}function y($,J){return new x($,J)}function x($,J){if(!(this instanceof x))return new x($,J);Ge.apply(this),this._parser=new m($,J),this.writable=!0,this.readable=!0;var xe=this;this._parser.onend=function(){xe.emit("end")},this._parser.onerror=function(ke){xe.emit("error",ke),xe._parser.error=null},this._decoder=null,Ue.forEach(function(ke){(0,h.default)(xe,"on"+ke,{get:function(){return xe._parser["on"+ke]},set:function(dt){if(!dt)return xe.removeAllListeners(ke),xe._parser["on"+ke]=dt,dt;xe.on(ke,dt)},enumerable:!0,configurable:!1})})}function l($){return $===" "||$===`
|
|
|
`||$==="\r"||$===" "}function S($){return $==='"'||$==="'"}function O($){return $===">"||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<je;Ne++){var tt=$.attribList[Ne],mt=tt[0],Qe=tt[1],Xe=Y(mt,!0),Be=Xe.prefix,Ie=Xe.local,Me=Be===""?"":xe.ns[Be]||"",Ee={name:mt,value:Qe,prefix:Be,local:Ie,uri:Me};Be&&Be!=="xmlns"&&!Me&&(X($,"Unbound namespace prefix: "+(0,o.default)(Be)),Ee.uri=Be),$.tag.attributes[mt]=Ee,B($,"onattribute",Ee)}$.attribList.length=0}$.tag.isSelfClosing=!!J,$.sawRoot=!0,$.tags.push($.tag),B($,"onopentag",$.tag),J||($.noscript||$.tagName.toLowerCase()!=="script"?$.state=U.TEXT:$.state=U.SCRIPT,$.tag=null,$.tagName=""),$.attribName=$.attribValue="",$.attribList.length=0}function de($){if(!$.tagName)return X($,"Weird empty close tag."),$.textNode+="</>",void($.state=U.TEXT);if($.script){if($.tagName!=="script")return $.script+="</"+$.tagName+">",$.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+="</"+$.tagName+">",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<J.position){var Ne=J.position-J.startTagPosition;ke=new Array(Ne).join(" ")+ke}J.textNode+="<"+ke,J.state=U.TEXT}continue;case U.SGML_DECL:(J.sgmlDecl+ke).toUpperCase()===Fe?(B(J,"onopencdata"),J.state=U.CDATA,J.sgmlDecl="",J.cdata=""):J.sgmlDecl+ke==="--"?(J.state=U.COMMENT,J.comment="",J.sgmlDecl=""):(J.sgmlDecl+ke).toUpperCase()===He?(J.state=U.DOCTYPE,(J.doctype||J.sawRoot)&&X(J,"Inappropriately located doctype declaration"),J.doctype="",J.sgmlDecl=""):ke===">"?(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+="</"+J.tagName,J.tagName="",J.state=U.SCRIPT):(l(ke)||X(J,"Invalid tagname in closing tag"),J.state=U.CLOSE_TAG_SAW_WHITE);else{if(l(ke))continue;D(ze,ke)?J.script?(J.script+="</"+ke,J.state=U.SCRIPT):X(J,"Invalid tagname in closing tag."):J.tagName=ke}continue;case U.CLOSE_TAG_SAW_WHITE:if(l(ke))continue;ke===">"?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&&E(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 _e=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];v.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"],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="";++je<tt;){var Qe=Number(arguments[je]);if(!isFinite(Qe)||Qe<0||Qe>1114111||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&&_?"fetch":u.mozchunkedarraybuffer?"moz-chunked-arraybuffer":u.msstream?"ms-stream":u.arraybuffer&&E?"arraybuffer":u.vbArray&&E?"text:vbarray":"text"}function d(E){try{var _=E.status;return _!==null&&_!==0}catch(g){return!1}}var o=w("babel-runtime/core-js/object/keys"),a=function(E){return E&&E.__esModule?E:{default:E}}(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(E){var _=this;i.Writable.call(_),_._opts=E,_._body=[],_._headers={},E.auth&&_.setHeader("Authorization","Basic "+new c(E.auth).toString("base64")),(0,a.default)(E.headers).forEach(function(x){_.setHeader(x,E.headers[x])});var g,y=!0;if(E.mode==="disable-fetch"||"requestTimeout"in E&&!u.abortController)y=!1,g=!0;else if(E.mode==="prefer-streaming")g=!1;else if(E.mode==="allow-wrong-content-type")g=!u.overrideMimeType;else{if(E.mode&&E.mode!=="default"&&E.mode!=="prefer-fast")throw new Error("Invalid value for opts.mode");g=!0}_._mode=p(g,y),_._fetchTimer=null,_.on("finish",function(){_._onFinish()})};s(v,i.Writable),v.prototype.setHeader=function(E,_){var g=this,y=E.toLowerCase();m.indexOf(y)===-1&&(g._headers[y]={name:E,value:_})},v.prototype.getHeader=function(E){var _=this._headers[E.toLowerCase()];return _?_.value:null},v.prototype.removeHeader=function(E){delete this._headers[E.toLowerCase()]},v.prototype._onFinish=function(){var E=this;if(!E._destroyed){var _=E._opts,g=E._headers,y=null;_.method!=="GET"&&_.method!=="HEAD"&&(y=u.arraybuffer?n(c.concat(E._body)):u.blobConstructor?new C.Blob(E._body.map(function(A){return n(A)}),{type:(g["content-type"]||{}).value||""}):c.concat(E._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])}),E._mode==="fetch"){var l=null;if(u.abortController){var S=new AbortController;l=S.signal,E._fetchAbortController=S,"requestTimeout"in _&&_.requestTimeout!==0&&(E._fetchTimer=C.setTimeout(function(){E.emit("requestTimeout"),E._fetchAbortController&&E._fetchAbortController.abort()},_.requestTimeout))}C.fetch(E._opts.url,{method:E._opts.method,headers:x,body:y||void 0,mode:"cors",credentials:_.withCredentials?"include":"same-origin",signal:l}).then(function(A){E._fetchResponse=A,E._connect()},function(A){C.clearTimeout(E._fetchTimer),E._destroyed||E.emit("error",A)})}else{var O=E._xhr=new C.XMLHttpRequest;try{O.open(E._opts.method,E._opts.url,!0)}catch(A){return void T.nextTick(function(){E.emit("error",A)})}"responseType"in O&&(O.responseType=E._mode.split(":")[0]),"withCredentials"in O&&(O.withCredentials=!!_.withCredentials),E._mode==="text"&&"overrideMimeType"in O&&O.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in _&&(O.timeout=_.requestTimeout,O.ontimeout=function(){E.emit("requestTimeout")}),x.forEach(function(A){O.setRequestHeader(A[0],A[1])}),E._response=null,O.onreadystatechange=function(){switch(O.readyState){case f.LOADING:case f.DONE:E._onXHRProgress()}},E._mode==="moz-chunked-arraybuffer"&&(O.onprogress=function(){E._onXHRProgress()}),O.onerror=function(){E._destroyed||E.emit("error",new Error("XHR error"))};try{O.send(y)}catch(A){return void T.nextTick(function(){E.emit("error",A)})}}}},v.prototype._onXHRProgress=function(){var E=this;d(E._xhr)&&!E._destroyed&&(E._response||E._connect(),E._response._onXHRProgress())},v.prototype._connect=function(){var E=this;E._destroyed||(E._response=new t(E._xhr,E._fetchResponse,E._mode,E._fetchTimer),E._response.on("error",function(_){E.emit("error",_)}),E.emit("response",E._response))},v.prototype._write=function(E,_,g){this._body.push(E),g()},v.prototype.abort=v.prototype.destroy=function(){var E=this;E._destroyed=!0,C.clearTimeout(E._fetchTimer),E._response&&(E._response._destroyed=!0),E._xhr?E._xhr.abort():E._fetchAbortController&&E._fetchAbortController.abort()},v.prototype.end=function(E,_,g){var y=this;typeof E=="function"&&(g=E,E=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 E=n.body.getReader();!function y(){E.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 _=v.rawHeaders["mime-type"];if(_){var g=_.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(_){}if(t!==null){i.push(new c(t));break}case"text":try{t=n.responseText}catch(_){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;m<f.length;m++)v[m]=255&f.charCodeAt(m);i.push(v)}else i.push(f,i._charset);i._pos=t.length}break;case"arraybuffer":if(n.readyState!==s.DONE||!n.response)break;t=n.response,i.push(new c(new Uint8Array(t)));break;case"moz-chunked-arraybuffer":if(t=n.response,n.readyState!==s.LOADING||!t)break;i.push(new c(new Uint8Array(t)));break;case"ms-stream":if(t=n.response,n.readyState!==s.LOADING)break;var E=new C.MSStreamReader;E.onprogress=function(){E.result.byteLength>i._pos&&(i.push(new c(new Uint8Array(E.result.slice(i._pos)))),i._pos=E.result.byteLength)},E.onload=function(){i.push(null)},E.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(_){if(!_)return"utf8";for(var g;;)switch(_){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 _;default:if(g)return;_=(""+_).toLowerCase(),g=!0}}function C(_){var g=T(_);if(typeof g!="string"&&(m.isEncoding===E||!E(_)))throw new Error("Unknown encoding: "+_);return g||_}function c(_){this.encoding=C(_);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(_){return _<=127?0:_>>5==6?2:_>>4==14?3:_>>3==30?4:_>>6==2?-1:-2}function d(_,g,y){var x=g.length-1;if(x<y)return 0;var l=p(g[x]);return l>=0?(l>0&&(_.lastNeed=l-1),l):--x<y||l===-2?0:(l=p(g[x]))>=0?(l>0&&(_.lastNeed=l-2),l):--x<y||l===-2?0:(l=p(g[x]),l>=0?(l>0&&(l===2?l=0:_.lastNeed=l-3),l):0)}function o(_,g,y){if((192&g[0])!=128)return _.lastNeed=0,"\u951F\uFFFD";if(_.lastNeed>1&&g.length>1){if((192&g[1])!=128)return _.lastNeed=1,"\u951F\uFFFD";if(_.lastNeed>2&&g.length>2&&(192&g[2])!=128)return _.lastNeed=2,"\u951F\uFFFD"}}function a(_){var g=this.lastTotal-this.lastNeed,y=o(this,_,g);return y!==void 0?y:this.lastNeed<=_.length?(_.copy(this.lastChar,g,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(_.copy(this.lastChar,g,0,_.length),void(this.lastNeed-=_.length))}function u(_,g){var y=d(this,_,g);if(!this.lastNeed)return _.toString("utf8",g);this.lastTotal=y;var x=_.length-(y-this.lastNeed);return _.copy(this.lastChar,0,x),_.toString("utf8",g,x)}function s(_){var g=_&&_.length?this.write(_):"";return this.lastNeed?g+"\u951F\uFFFD":g}function h(_,g){if((_.length-g)%2==0){var y=_.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]=_[_.length-2],this.lastChar[1]=_[_.length-1],y.slice(0,-1)}return y}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=_[_.length-1],_.toString("utf16le",g,_.length-1)}function i(_){var g=_&&_.length?this.write(_):"";if(this.lastNeed){var y=this.lastTotal-this.lastNeed;return g+this.lastChar.toString("utf16le",0,y)}return g}function n(_,g){var y=(_.length-g)%3;return y===0?_.toString("base64",g):(this.lastNeed=3-y,this.lastTotal=3,y===1?this.lastChar[0]=_[_.length-1]:(this.lastChar[0]=_[_.length-2],this.lastChar[1]=_[_.length-1]),_.toString("base64",g,_.length-y))}function t(_){var g=_&&_.length?this.write(_):"";return this.lastNeed?g+this.lastChar.toString("base64",0,3-this.lastNeed):g}function f(_){return _.toString(this.encoding)}function v(_){return _&&_.length?this.write(_):""}var m=w("safe-buffer").Buffer,E=m.isEncoding||function(_){switch((_=""+_)&&_.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(_){if(_.length===0)return"";var g,y;if(this.lastNeed){if((g=this.fillLast(_))===void 0)return"";y=this.lastNeed,this.lastNeed=0}else y=0;return y<_.length?g?g+this.text(_,y):this.text(_,y):g||""},c.prototype.end=s,c.prototype.text=u,c.prototype.fillLast=function(_){if(this.lastNeed<=_.length)return _.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);_.copy(this.lastChar,this.lastTotal-this.lastNeed,0,_.length),this.lastNeed-=_.length}},{"safe-buffer":193}],201:[function(w,P,b){(function(T,C){function c(s,h){this._id=s,this._clearFn=h}var p=w("process/browser.js").nextTick,d=Function.prototype.apply,o=Array.prototype.slice,a={},u=0;b.setTimeout=function(){return new c(d.call(setTimeout,window,arguments),clearTimeout)},b.setInterval=function(){return new c(d.call(setInterval,window,arguments),clearInterval)},b.clearTimeout=b.clearInterval=function(s){s.close()},c.prototype.unref=c.prototype.ref=function(){},c.prototype.close=function(){this._clearFn.call(window,this._id)},b.enroll=function(s,h){clearTimeout(s._idleTimeoutId),s._idleTimeout=h},b.unenroll=function(s){clearTimeout(s._idleTimeoutId),s._idleTimeout=-1},b._unrefActive=b.active=function(s){clearTimeout(s._idleTimeoutId);var h=s._idleTimeout;h>=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<p;d++)c[d]=C[d];return c.buffer}throw new Error("Argument must be a Buffer")}},{buffer:38}],203:[function(w,P,b){"use strict";function T(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function C(l,S,O){if(l&&a.isObject(l)&&l instanceof T)return l;var A=new T;return A.parse(l,S,O),A}function c(l){return a.isString(l)&&(l=C(l)),l instanceof T?l.format():T.prototype.format.call(l)}function p(l,S){return C(l,!1,!0).resolve(S)}function d(l,S){return l?C(l,!1,!0).resolveObject(S):S}var o=w("punycode"),a=w("./util");b.parse=C,b.resolve=p,b.resolveObject=d,b.format=c,b.Url=T;var u=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,h=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,i=["<",">",'"',"`"," ","\r",`
|
|
|
`," "],n=["{","}","|","\\","^","`"].concat(i),t=["'"].concat(n),f=["%","/","?",";","#"].concat(t),v=["/","?","#"],m=/^[+a-z0-9A-Z_-]{0,63}$/,E=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,_={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&&A<l.indexOf("#")?"?":"#",I=l.split(D),B=/\\/g;I[0]=I[0].replace(B,"/"),l=I.join(D);var H=l;if(H=H.trim(),!O&&l.split("#").length===1){var te=h.exec(H);if(te)return this.path=H,this.href=H,this.pathname=te[1],te[2]?(this.search=te[2],this.query=S?x.parse(this.search.substr(1)):this.search.substr(1)):S&&(this.search="",this.query={}),this}var W=u.exec(H);if(W){W=W[0];var V=W.toLowerCase();this.protocol=V,H=H.substr(W.length)}if(O||W||H.match(/^\/\/[^@\/]+@[^@\/]+/)){var X=H.substr(0,2)==="//";!X||W&&g[W]||(H=H.substr(2),this.slashes=!0)}if(!g[W]&&(X||W&&!y[W])){for(var ne=-1,Y=0;Y<v.length;Y++){var ee=H.indexOf(v[Y]);ee!==-1&&(ne===-1||ee<ne)&&(ne=ee)}var ce,de;de=ne===-1?H.lastIndexOf("@"):H.lastIndexOf("@",ne),de!==-1&&(ce=H.slice(0,de),H=H.slice(de+1),this.auth=decodeURIComponent(ce)),ne=-1;for(var Y=0;Y<f.length;Y++){var ee=H.indexOf(f[Y]);ee!==-1&&(ne===-1||ee<ne)&&(ne=ee)}ne===-1&&(ne=H.length),this.host=H.slice(0,ne),H=H.slice(ne),this.parseHost(),this.hostname=this.hostname||"";var Ce=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!Ce)for(var Se=this.hostname.split(/\./),Y=0,Pe=Se.length;Y<Pe;Y++){var ye=Se[Y];if(ye&&!ye.match(m)){for(var _e="",Ge=0,Ue=ye.length;Ge<Ue;Ge++)ye.charCodeAt(Ge)>127?_e+="x":_e+=ye[Ge];if(!_e.match(m)){var Fe=Se.slice(0,Y),He=Se.slice(Y+1),be=ye.match(E);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(!_[V])for(var Y=0,Pe=t.length;Y<Pe;Y++){var ze=t[Y];if(H.indexOf(ze)!==-1){var nt=encodeURIComponent(ze);nt===ze&&(nt=escape(ze)),H=H.split(ze).join(nt)}}var re=H.indexOf("#");re!==-1&&(this.hash=H.substr(re),H=H.slice(0,re));var k=H.indexOf("?");if(k!==-1?(this.search=H.substr(k),this.query=H.substr(k+1),S&&(this.query=x.parse(this.query)),H=H.slice(0,k)):S&&(this.search="",this.query={}),H&&(this.pathname=H),y[V]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var me=this.pathname||"",U=this.search||"";this.path=me+U}return this.href=this.format(),this},T.prototype.format=function(){var l=this.auth||"";l&&(l=encodeURIComponent(l),l=l.replace(/%3A/i,":"),l+="@");var S=this.protocol||"",O=this.pathname||"",A=this.hash||"",D=!1,I="";this.host?D=l+this.host:this.hostname&&(D=l+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(D+=":"+this.port)),this.query&&a.isObject(this.query)&&Object.keys(this.query).length&&(I=x.stringify(this.query));var B=this.search||I&&"?"+I||"";return S&&S.substr(-1)!==":"&&(S+=":"),this.slashes||(!S||y[S])&&D!==!1?(D="//"+(D||""),O&&O.charAt(0)!=="/"&&(O="/"+O)):D||(D=""),A&&A.charAt(0)!=="#"&&(A="#"+A),B&&B.charAt(0)!=="?"&&(B="?"+B),O=O.replace(/[?#]/g,function(H){return encodeURIComponent(H)}),B=B.replace("#","%23"),S+D+O+B+A},T.prototype.resolve=function(l){return this.resolveObject(C(l,!1,!0)).format()},T.prototype.resolveObject=function(l){if(a.isString(l)){var S=new T;S.parse(l,!1,!0),l=S}for(var O=new T,A=Object.keys(this),D=0;D<A.length;D++){var I=A[D];O[I]=this[I]}if(O.hash=l.hash,l.href==="")return O.href=O.format(),O;if(l.slashes&&!l.protocol){for(var B=Object.keys(l),H=0;H<B.length;H++){var te=B[H];te!=="protocol"&&(O[te]=l[te])}return y[O.protocol]&&O.hostname&&!O.pathname&&(O.path=O.pathname="/"),O.href=O.format(),O}if(l.protocol&&l.protocol!==O.protocol){if(!y[l.protocol]){for(var W=Object.keys(l),V=0;V<W.length;V++){var X=W[V];O[X]=l[X]}return O.href=O.format(),O}if(O.protocol=l.protocol,l.host||g[l.protocol])O.pathname=l.pathname;else{for(var Pe=(l.pathname||"").split("/");Pe.length&&!(l.host=Pe.shift()););l.host||(l.host=""),l.hostname||(l.hostname=""),Pe[0]!==""&&Pe.unshift(""),Pe.length<2&&Pe.unshift(""),O.pathname=Pe.join("/")}if(O.search=l.search,O.query=l.query,O.host=l.host||"",O.auth=l.auth,O.hostname=l.hostname||l.host,O.port=l.port,O.pathname||O.search){var ne=O.pathname||"",Y=O.search||"";O.path=ne+Y}return O.slashes=O.slashes||l.slashes,O.href=O.format(),O}var ee=O.pathname&&O.pathname.charAt(0)==="/",ce=l.host||l.pathname&&l.pathname.charAt(0)==="/",de=ce||ee||O.host&&l.pathname,Ce=de,Se=O.pathname&&O.pathname.split("/")||[],Pe=l.pathname&&l.pathname.split("/")||[],ye=O.protocol&&!y[O.protocol];if(ye&&(O.hostname="",O.port=null,O.host&&(Se[0]===""?Se[0]=O.host:Se.unshift(O.host)),O.host="",l.protocol&&(l.hostname=null,l.port=null,l.host&&(Pe[0]===""?Pe[0]=l.host:Pe.unshift(l.host)),l.host=null),de=de&&(Pe[0]===""||Se[0]==="")),ce)O.host=l.host||l.host===""?l.host:O.host,O.hostname=l.hostname||l.hostname===""?l.hostname:O.hostname,O.search=l.search,O.query=l.query,Se=Pe;else if(Pe.length)Se||(Se=[]),Se.pop(),Se=Se.concat(Pe),O.search=l.search,O.query=l.query;else if(!a.isNullOrUndefined(l.search)){if(ye){O.hostname=O.host=Se.shift();var _e=!!(O.host&&O.host.indexOf("@")>0)&&O.host.split("@");_e&&(O.auth=_e.shift(),O.host=O.hostname=_e.shift())}return 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 _e=!!(O.host&&O.host.indexOf("@")>0)&&O.host.split("@");_e&&(O.auth=_e.shift(),O.host=O.hostname=_e.shift())}return de=de||O.host&&Se.length,de&&!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 _(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 _e="",Ge=!1,Ue=["{","}"];if((t(ee)&&(Ge=!0,Ue=["[","]"]),A(ee))&&(_e=" [Function"+(ee.name?": "+ee.name:"")+"]"),x(ee)&&(_e=" "+RegExp.prototype.toString.call(ee)),S(ee)&&(_e=" "+Date.prototype.toUTCString.call(ee)),O(ee)&&(_e=" "+s(ee)),Se.length===0&&(!Ge||ee.length==0))return Ue[0]+_e+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,_e,Ue)}function u(Y,ee){if(y(ee))return Y.stylize("undefined","undefined");if(_(ee)){var ce="'"+JSON.stringify(ee).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return Y.stylize(ce,"string")}return E(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<ye;++Pe)te(ee,String(Pe))?Se.push(i(Y,ee,ce,de,String(Pe),!0)):Se.push("");return Ce.forEach(function(_e){_e.match(/^\d+$/)||Se.push(i(Y,ee,ce,de,_e,!0))}),Se}function i(Y,ee,ce,de,Ce,Se){var Pe,ye,_e;if(_e=Object.getOwnPropertyDescriptor(ee,Ce)||{value:ee[Ce]},_e.get?ye=_e.set?Y.stylize("[Getter/Setter]","special"):Y.stylize("[Getter]","special"):_e.set&&(ye=Y.stylize("[Setter]","special")),te(de,Ce)||(Pe="["+Ce+"]"),ye||(Y.seen.indexOf(_e.value)<0?(ye=v(ce)?a(Y,_e.value,null):a(Y,_e.value,ce-1),ye.indexOf(`
|
|
|
`)>-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 E(Y){return typeof Y=="number"}function _(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(!_(Y)){for(var ee=[],ce=0;ce<arguments.length;ce++)ee.push(c(arguments[ce]));return ee.join(" ")}for(var ce=1,de=arguments,Ce=de.length,Se=String(Y).replace(W,function(_e){if(_e==="%%")return"%";if(ce>=Ce)return _e;switch(_e){case"%s":return String(de[ce++]);case"%d":return Number(de[ce++]);case"%j":try{return JSON.stringify(de[ce++])}catch(Ge){return"[Circular]"}default:return _e}}),Pe=de[ce];ce<Ce;Pe=de[++ce])v(Pe)||!l(Pe)?Se+=" "+Pe:Se+=" "+c(Pe);return Se},b.deprecate=function(Y,ee){function ce(){if(!de){if(T.throwDeprecation)throw new Error(ee);T.traceDeprecation?console.trace(ee):console.error(ee),de=!0}return Y.apply(this,arguments)}if(y(C.process))return function(){return b.deprecate(Y,ee).apply(this,arguments)};if(T.noDeprecation===!0)return Y;var de=!1;return ce};var V,X={};b.debuglog=function(Y){if(y(V)&&(V=T.env.NODE_DEBUG||""),Y=Y.toUpperCase(),!X[Y])if(new RegExp("\\b"+Y+"\\b","i").test(V)){var ee=T.pid;X[Y]=function(){var ce=b.format.apply(b,arguments);console.error("%s %d: %s",Y,ee,ce)}}else X[Y]=function(){};return X[Y]},b.inspect=c,c.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},c.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},b.isArray=t,b.isBoolean=f,b.isNull=v,b.isNullOrUndefined=m,b.isNumber=E,b.isString=_,b.isSymbol=g,b.isUndefined=y,b.isRegExp=x,b.isObject=l,b.isDate=S,b.isError=O,b.isFunction=A,b.isPrimitive=D,b.isBuffer=w("./support/isBuffer");var ne=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];b.log=function(){console.log("%s - %s",H(),b.format.apply(b,arguments))},b.inherits=w("inherits"),b._extend=function(Y,ee){if(!ee||!l(ee))return Y;for(var ce=Object.keys(ee),de=ce.length;de--;)Y[ce[de]]=ee[ce[de]];return Y}}).call(this,w("_process"),typeof le!="undefined"?le:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"./support/isBuffer":206,_process:173,inherits:162}],208:[function(w,P,b){"use strict";(function(){b.stripBOM=function(T){return T[0]==="\uFEFF"?T.substring(1):T}}).call(void 0)},{}],209:[function(w,P,b){"use strict";function T(o){return o&&o.__esModule?o:{default:o}}var C=w("babel-runtime/helpers/typeof"),c=T(C),p=w("babel-runtime/core-js/object/keys"),d=T(p);(function(){var o,a,u,s,h,i={}.hasOwnProperty;o=w("xmlbuilder"),a=w("./defaults").defaults,s=function(n){return typeof n=="string"&&(n.indexOf("&")>=0||n.indexOf(">")>=0||n.indexOf("<")>=0)},h=function(n){return"<![CDATA["+u(n)+"]]>"},u=function(n){return n.replace("]]>","]]]]><![CDATA[>")},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?(_=(0,d.default)(t)[0],t=t[_]):_=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),E=o.create(_,this.options.xmldec,this.options.doctype,{headless:this.options.headless,allowSurrogateChars:this.options.allowSurrogateChars}),m(E,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)}},E=function(g,y){function x(){this.constructor=g}for(var l in y)_.call(y,l)&&(g[l]=y[l]);return x.prototype=y.prototype,g.prototype=new x,g.__super__=y.prototype,g},_={}.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;l<S;l++)O=g[l],y=O(y,x);return y},b.Parser=function(g){function y(x){this.parseString=m(this.parseString,this),this.reset=m(this.reset,this),this.assignOrPush=m(this.assignOrPush,this),this.processAsync=m(this.processAsync,this);var l,S,O;if(!(this instanceof b.Parser))return new b.Parser(x);this.options={},S=s[.2];for(l in S)_.call(S,l)&&(O=S[l],this.options[l]=O);for(l in x)_.call(x,l)&&(O=x[l],this.options[l]=O);this.options.xmlns&&(this.options.xmlnskey=this.options.attrkey+"ns"),this.options.normalizeTags&&(this.options.tagNameProcessors||(this.options.tagNameProcessors=[]),this.options.tagNameProcessors.unshift(t.normalize)),this.reset()}return E(y,g),y.prototype.processAsync=function(){var x,l;try{return this.remaining.length<=this.options.chunkSize?(x=this.remaining,this.remaining="",this.saxParser=this.saxParser.write(x),this.saxParser.close()):(x=this.remaining.substr(0,this.options.chunkSize),this.remaining=this.remaining.substr(this.options.chunkSize,this.remaining.length),this.saxParser=this.saxParser.write(x),v(this.processAsync))}catch(S){if(l=S,!this.saxParser.errThrown)return this.saxParser.errThrown=!0,this.emit(l)}},y.prototype.assignOrPush=function(x,l,S){return l in x?(x[l]instanceof Array||(x[l]=[x[l]]),x[l].push(S)):this.options.explicitArray?x[l]=[S]:x[l]=S},y.prototype.reset=function(){var x,l,S,O;return this.removeAllListeners(),this.saxParser=f.parser(this.options.strict,{trim:!1,normalize:!1,xmlns:this.options.xmlns}),this.saxParser.errThrown=!1,this.saxParser.onerror=function(A){return function(D){if(A.saxParser.resume(),!A.saxParser.errThrown)return A.saxParser.errThrown=!0,A.emit("error",D)}}(this),this.saxParser.onend=function(A){return function(){if(!A.saxParser.ended)return A.saxParser.ended=!0,A.emit("end",A.resultObject)}}(this),this.saxParser.ended=!1,this.EXPLICIT_CHARKEY=this.options.explicitCharkey,this.resultObject=null,O=[],x=this.options.attrkey,l=this.options.charkey,this.saxParser.onopentag=function(A){return function(D){var I,B,H,te,W;if(H={},H[l]="",!A.options.ignoreAttrs){W=D.attributes;for(I in W)_.call(W,I)&&(x in H||A.options.mergeAttrs||(H[x]={}),B=A.options.attrValueProcessors?n(A.options.attrValueProcessors,D.attributes[I],I):D.attributes[I],te=A.options.attrNameProcessors?n(A.options.attrNameProcessors,I):I,A.options.mergeAttrs?A.assignOrPush(H,te,B):H[x][te]=B)}return H["#name"]=A.options.tagNameProcessors?n(A.options.tagNameProcessors,D.name):D.name,A.options.xmlns&&(H[A.options.xmlnskey]={uri:D.uri,local:D.local}),O.push(H)}}(this),this.saxParser.onclosetag=function(A){return function(){var D,I,B,H,te,W,V,X,ne,Y;if(W=O.pop(),te=W["#name"],A.options.explicitChildren&&A.options.preserveChildrenOrder||delete W["#name"],W.cdata===!0&&(D=W.cdata,delete W.cdata),ne=O[O.length-1],W[l].match(/^\s*$/)&&!D?(I=W[l],delete W[l]):(A.options.trim&&(W[l]=W[l].trim()),A.options.normalize&&(W[l]=W[l].replace(/\s{2,}/g," ").trim()),W[l]=A.options.valueProcessors?n(A.options.valueProcessors,W[l],te):W[l],(0,d.default)(W).length===1&&l in W&&!A.EXPLICIT_CHARKEY&&(W=W[l])),i(W)&&(W=A.options.emptyTag!==""?A.options.emptyTag:I),A.options.validator!=null&&(Y="/"+function(){var ee,ce,de;for(de=[],ee=0,ce=O.length;ee<ce;ee++)H=O[ee],de.push(H["#name"]);return de}().concat(te).join("/"),function(){var ee;try{W=A.options.validator(Y,ne&&ne[te],W)}catch(ce){return ee=ce,A.emit("error",ee)}}()),A.options.explicitChildren&&!A.options.mergeAttrs&&(W===void 0?"undefined":(0,a.default)(W))==="object")if(A.options.preserveChildrenOrder){if(ne){ne[A.options.childkey]=ne[A.options.childkey]||[],V={};for(B in W)_.call(W,B)&&(V[B]=W[B]);ne[A.options.childkey].push(V),delete W["#name"],(0,d.default)(W).length===1&&l in W&&!A.EXPLICIT_CHARKEY&&(W=W[l])}}else H={},A.options.attrkey in W&&(H[A.options.attrkey]=W[A.options.attrkey],delete W[A.options.attrkey]),!A.options.charsAsChildren&&A.options.charkey in W&&(H[A.options.charkey]=W[A.options.charkey],delete W[A.options.charkey]),(0,c.default)(W).length>0&&(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,_=y.length;m<_;m++)if((g=y[m])!=null)for(E in g)v.call(g,E)&&(x[E]=g[E]);return x},i=function(m){return!!m&&Object.prototype.toString.call(m)==="[object Function]"},n=function(m){var E;return!!m&&((E=m===void 0?"undefined":(0,d.default)(m))==="function"||E==="object")},s=function(m){return i(Array.isArray)?Array.isArray(m):Object.prototype.toString.call(m)==="[object Array]"},h=function(m){var E;if(s(m))return!m.length;for(E in m)if(v.call(m,E))return!1;return!0},t=function(m){var E,_;return n(m)&&(_=(0,c.default)(m))&&(E=_.constructor)&&typeof E=="function"&&E instanceof E&&Function.prototype.toString.call(E)===Function.prototype.toString.call(Object)},P.exports.assign=u,P.exports.isFunction=i,P.exports.isObject=n,P.exports.isArray=s,P.exports.isEmpty=h,P.exports.isPlainObject=t}).call(void 0)},{"babel-runtime/core-js/object/assign":18,"babel-runtime/core-js/object/get-prototype-of":22,"babel-runtime/helpers/typeof":32}],215:[function(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(){P.exports=function(){function c(p,d,o){if(this.options=p.options,this.stringify=p.stringify,d==null)throw new Error("Missing attribute name of element "+p.name);if(o==null)throw new Error("Missing attribute value for attribute "+d+" of element "+p.name);this.name=this.stringify.attName(d),this.value=this.stringify.attValue(o)}return c.prototype.clone=function(){return(0,C.default)(this)},c.prototype.toString=function(p){return this.options.writer.set(p).attribute(this)},c}()}).call(void 0)},{"babel-runtime/core-js/object/create":19}],216:[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=function(o,a){function u(){this.constructor=o}for(var s in a)d.call(a,s)&&(o[s]=a[s]);return u.prototype=a.prototype,o.prototype=new u,o.__super__=a.prototype,o},d={}.hasOwnProperty;c=w("./XMLNode"),P.exports=function(o){function a(u,s){if(a.__super__.constructor.call(this,u),s==null)throw new Error("Missing CDATA text");this.text=this.stringify.cdata(s)}return p(a,o),a.prototype.clone=function(){return(0,C.default)(this)},a.prototype.toString=function(u){return this.options.writer.set(u).cdata(this)},a}(c)}).call(void 0)},{"./XMLNode":227,"babel-runtime/core-js/object/create":19}],217:[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=function(o,a){function u(){this.constructor=o}for(var s in a)d.call(a,s)&&(o[s]=a[s]);return u.prototype=a.prototype,o.prototype=new u,o.__super__=a.prototype,o},d={}.hasOwnProperty;c=w("./XMLNode"),P.exports=function(o){function a(u,s){if(a.__super__.constructor.call(this,u),s==null)throw new Error("Missing comment text");this.text=this.stringify.comment(s)}return p(a,o),a.prototype.clone=function(){return(0,C.default)(this)},a.prototype.toString=function(u){return this.options.writer.set(u).comment(this)},a}(c)}).call(void 0)},{"./XMLNode":227,"babel-runtime/core-js/object/create":19}],218:[function(w,P,b){"use strict";(function(){var T,C=function(p,d){function o(){this.constructor=p}for(var a in d)c.call(d,a)&&(p[a]=d[a]);return o.prototype=d.prototype,p.prototype=new o,p.__super__=d.prototype,p},c={}.hasOwnProperty;T=w("./XMLNode"),P.exports=function(p){function d(o,a,u,s,h,i){if(d.__super__.constructor.call(this,o),a==null)throw new Error("Missing DTD element name");if(u==null)throw new Error("Missing DTD attribute name");if(!s)throw new Error("Missing DTD attribute type");if(!h)throw new Error("Missing DTD attribute default");if(h.indexOf("#")!==0&&(h="#"+h),!h.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/))throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT");if(i&&!h.match(/^(#FIXED|#DEFAULT)$/))throw new Error("Default value only applies to #FIXED or #DEFAULT");this.elementName=this.stringify.eleName(a),this.attributeName=this.stringify.attName(u),this.attributeType=this.stringify.dtdAttType(s),this.defaultValue=this.stringify.dtdAttDefault(i),this.defaultValueType=h}return C(d,p),d.prototype.toString=function(o){return this.options.writer.set(o).dtdAttList(this)},d}(T)}).call(void 0)},{"./XMLNode":227}],219:[function(w,P,b){"use strict";(function(){var T,C=function(p,d){function o(){this.constructor=p}for(var a in d)c.call(d,a)&&(p[a]=d[a]);return o.prototype=d.prototype,p.prototype=new o,p.__super__=d.prototype,p},c={}.hasOwnProperty;T=w("./XMLNode"),P.exports=function(p){function d(o,a,u){if(d.__super__.constructor.call(this,o),a==null)throw new Error("Missing DTD element name");u||(u="(#PCDATA)"),Array.isArray(u)&&(u="("+u.join(",")+")"),this.name=this.stringify.eleName(a),this.value=this.stringify.dtdElementValue(u)}return C(d,p),d.prototype.toString=function(o){return this.options.writer.set(o).dtdElement(this)},d}(T)}).call(void 0)},{"./XMLNode":227}],220:[function(w,P,b){"use strict";(function(){var T,C,c=function(d,o){function a(){this.constructor=d}for(var u in o)p.call(o,u)&&(d[u]=o[u]);return a.prototype=o.prototype,d.prototype=new a,d.__super__=o.prototype,d},p={}.hasOwnProperty;C=w("./Utility").isObject,T=w("./XMLNode"),P.exports=function(d){function o(a,u,s,h){if(o.__super__.constructor.call(this,a),s==null)throw new Error("Missing entity name");if(h==null)throw new Error("Missing entity value");if(this.pe=!!u,this.name=this.stringify.eleName(s),C(h)){if(!h.pubID&&!h.sysID)throw new Error("Public and/or system identifiers are required for an external entity");if(h.pubID&&!h.sysID)throw new Error("System identifier is required for a public external entity");if(h.pubID!=null&&(this.pubID=this.stringify.dtdPubID(h.pubID)),h.sysID!=null&&(this.sysID=this.stringify.dtdSysID(h.sysID)),h.nData!=null&&(this.nData=this.stringify.dtdNData(h.nData)),this.pe&&this.nData)throw new Error("Notation declaration is not allowed in a parameter entity")}else this.value=this.stringify.dtdEntityValue(h)}return c(o,d),o.prototype.toString=function(a){return this.options.writer.set(a).dtdEntity(this)},o}(T)}).call(void 0)},{"./Utility":214,"./XMLNode":227}],221:[function(w,P,b){"use strict";(function(){var T,C=function(p,d){function o(){this.constructor=p}for(var a in d)c.call(d,a)&&(p[a]=d[a]);return o.prototype=d.prototype,p.prototype=new o,p.__super__=d.prototype,p},c={}.hasOwnProperty;T=w("./XMLNode"),P.exports=function(p){function d(o,a,u){if(d.__super__.constructor.call(this,o),a==null)throw new Error("Missing notation name");if(!u.pubID&&!u.sysID)throw new Error("Public or system identifiers are required for an external entity");this.name=this.stringify.eleName(a),u.pubID!=null&&(this.pubID=this.stringify.dtdPubID(u.pubID)),u.sysID!=null&&(this.sysID=this.stringify.dtdSysID(u.sysID))}return C(d,p),d.prototype.toString=function(o){return this.options.writer.set(o).dtdNotation(this)},d}(T)}).call(void 0)},{"./XMLNode":227}],222:[function(w,P,b){"use strict";(function(){var T,C,c=function(d,o){function a(){this.constructor=d}for(var u in o)p.call(o,u)&&(d[u]=o[u]);return a.prototype=o.prototype,d.prototype=new a,d.__super__=o.prototype,d},p={}.hasOwnProperty;C=w("./Utility").isObject,T=w("./XMLNode"),P.exports=function(d){function o(a,u,s,h){var i;o.__super__.constructor.call(this,a),C(u)&&(i=u,u=i.version,s=i.encoding,h=i.standalone),u||(u="1.0"),this.version=this.stringify.xmlVersion(u),s!=null&&(this.encoding=this.stringify.xmlEncoding(s)),h!=null&&(this.standalone=this.stringify.xmlStandalone(h))}return c(o,d),o.prototype.toString=function(a){return this.options.writer.set(a).declaration(this)},o}(T)}).call(void 0)},{"./Utility":214,"./XMLNode":227}],223:[function(w,P,b){"use strict";(function(){var T,C,c,p,d,o,a=function(s,h){function i(){this.constructor=s}for(var n in h)u.call(h,n)&&(s[n]=h[n]);return i.prototype=h.prototype,s.prototype=new i,s.__super__=h.prototype,s},u={}.hasOwnProperty;o=w("./Utility").isObject,d=w("./XMLNode"),T=w("./XMLDTDAttList"),c=w("./XMLDTDEntity"),C=w("./XMLDTDElement"),p=w("./XMLDTDNotation"),P.exports=function(s){function h(i,n,t){var f,v;h.__super__.constructor.call(this,i),this.documentObject=i,o(n)&&(f=n,n=f.pubID,t=f.sysID),t==null&&(v=[n,t],t=v[0],n=v[1]),n!=null&&(this.pubID=this.stringify.dtdPubID(n)),t!=null&&(this.sysID=this.stringify.dtdSysID(t))}return a(h,s),h.prototype.element=function(i,n){var t;return t=new C(this,i,n),this.children.push(t),this},h.prototype.attList=function(i,n,t,f,v){var m;return m=new T(this,i,n,t,f,v),this.children.push(m),this},h.prototype.entity=function(i,n){var t;return t=new c(this,!1,i,n),this.children.push(t),this},h.prototype.pEntity=function(i,n){var t;return t=new c(this,!0,i,n),this.children.push(t),this},h.prototype.notation=function(i,n){var t;return t=new p(this,i,n),this.children.push(t),this},h.prototype.toString=function(i){return this.options.writer.set(i).docType(this)},h.prototype.ele=function(i,n){return this.element(i,n)},h.prototype.att=function(i,n,t,f,v){return this.attList(i,n,t,f,v)},h.prototype.ent=function(i,n){return this.entity(i,n)},h.prototype.pent=function(i,n){return this.pEntity(i,n)},h.prototype.not=function(i,n){return this.notation(i,n)},h.prototype.up=function(){return this.root()||this.documentObject},h}(d)}).call(void 0)},{"./Utility":214,"./XMLDTDAttList":218,"./XMLDTDElement":219,"./XMLDTDEntity":220,"./XMLDTDNotation":221,"./XMLNode":227}],224:[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;p=w("./Utility").isPlainObject,T=w("./XMLNode"),c=w("./XMLStringifier"),C=w("./XMLStringWriter"),P.exports=function(a){function u(s){u.__super__.constructor.call(this,null),s||(s={}),s.writer||(s.writer=new C),this.options=s,this.stringify=new c(s),this.isDocument=!0}return d(u,a),u.prototype.end=function(s){var h;return s?p(s)&&(h=s,s=this.options.writer.set(h)):s=this.options.writer,s.document(this)},u.prototype.toString=function(s){return this.options.writer.set(s).document(this)},u}(T)}).call(void 0)},{"./Utility":214,"./XMLNode":227,"./XMLStringWriter":231,"./XMLStringifier":232}],225:[function(w,P,b){"use strict";(function(){var T,C,c,p,d,o,a,u,s,h,i,n,t,f,v,m,E,_,g,y={}.hasOwnProperty;g=w("./Utility"),E=g.isObject,m=g.isFunction,_=g.isPlainObject,h=w("./XMLElement"),C=w("./XMLCData"),c=w("./XMLComment"),n=w("./XMLRaw"),v=w("./XMLText"),i=w("./XMLProcessingInstruction"),u=w("./XMLDeclaration"),s=w("./XMLDocType"),p=w("./XMLDTDAttList"),o=w("./XMLDTDEntity"),d=w("./XMLDTDElement"),a=w("./XMLDTDNotation"),T=w("./XMLAttribute"),f=w("./XMLStringifier"),t=w("./XMLStringWriter"),P.exports=function(){function x(l,S,O){var A;l||(l={}),l.writer?_(l.writer)&&(A=l.writer,l.writer=new t(A)):l.writer=new t(l),this.options=l,this.writer=l.writer,this.stringify=new f(l),this.onDataCallback=S||function(){},this.onEndCallback=O||function(){},this.currentNode=null,this.currentLevel=-1,this.openTags={},this.documentStarted=!1,this.documentCompleted=!1,this.root=null}return x.prototype.node=function(l,S,O){var A;if(l==null)throw new Error("Missing node name");if(this.root&&this.currentLevel===-1)throw new Error("Document can only have one root node");return this.openCurrent(),l=l.valueOf(),S==null&&(S={}),S=S.valueOf(),E(S)||(A=[S,O],O=A[0],S=A[1]),this.currentNode=new h(this,l,S),this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,O!=null&&this.text(O),this},x.prototype.element=function(l,S,O){return this.currentNode&&this.currentNode instanceof s?this.dtdElement.apply(this,arguments):this.node(l,S,O)},x.prototype.attribute=function(l,S){var O,A;if(!this.currentNode||this.currentNode.children)throw new Error("att() can only be used immediately after an ele() call in callback mode");if(l!=null&&(l=l.valueOf()),E(l))for(O in l)y.call(l,O)&&(A=l[O],this.attribute(O,A));else m(S)&&(S=S.apply()),this.options.skipNullAttributes&&S==null||(this.currentNode.attributes[l]=new T(this,l,S));return this},x.prototype.text=function(l){var S;return this.openCurrent(),S=new v(this,l),this.onData(this.writer.text(S,this.currentLevel+1)),this},x.prototype.cdata=function(l){var S;return this.openCurrent(),S=new C(this,l),this.onData(this.writer.cdata(S,this.currentLevel+1)),this},x.prototype.comment=function(l){var S;return this.openCurrent(),S=new c(this,l),this.onData(this.writer.comment(S,this.currentLevel+1)),this},x.prototype.raw=function(l){var S;return this.openCurrent(),S=new n(this,l),this.onData(this.writer.raw(S,this.currentLevel+1)),this},x.prototype.instruction=function(l,S){var O,A,D,I,B;if(this.openCurrent(),l!=null&&(l=l.valueOf()),S!=null&&(S=S.valueOf()),Array.isArray(l))for(O=0,I=l.length;O<I;O++)A=l[O],this.instruction(A);else if(E(l))for(A in l)y.call(l,A)&&(D=l[A],this.instruction(A,D));else m(S)&&(S=S.apply()),B=new i(this,l,S),this.onData(this.writer.processingInstruction(B,this.currentLevel+1));return this},x.prototype.declaration=function(l,S,O){var A;if(this.openCurrent(),this.documentStarted)throw new Error("declaration() must be the first node");return A=new u(this,l,S,O),this.onData(this.writer.declaration(A,this.currentLevel+1)),this},x.prototype.doctype=function(l,S,O){if(this.openCurrent(),l==null)throw new Error("Missing root node name");if(this.root)throw new Error("dtd() must come before the root node");return this.currentNode=new s(this,S,O),this.currentNode.rootNodeName=l,this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,this},x.prototype.dtdElement=function(l,S){var O;return this.openCurrent(),O=new d(this,l,S),this.onData(this.writer.dtdElement(O,this.currentLevel+1)),this},x.prototype.attList=function(l,S,O,A,D){var I;return this.openCurrent(),I=new p(this,l,S,O,A,D),this.onData(this.writer.dtdAttList(I,this.currentLevel+1)),this},x.prototype.entity=function(l,S){var O;return this.openCurrent(),O=new o(this,!1,l,S),this.onData(this.writer.dtdEntity(O,this.currentLevel+1)),this},x.prototype.pEntity=function(l,S){var O;return this.openCurrent(),O=new o(this,!0,l,S),this.onData(this.writer.dtdEntity(O,this.currentLevel+1)),this},x.prototype.notation=function(l,S){var O;return this.openCurrent(),O=new a(this,l,S),this.onData(this.writer.dtdNotation(O,this.currentLevel+1)),this},x.prototype.up=function(){if(this.currentLevel<0)throw new Error("The document node has no parent");return this.currentNode?(this.currentNode.children?this.closeNode(this.currentNode):this.openNode(this.currentNode),this.currentNode=null):this.closeNode(this.openTags[this.currentLevel]),delete this.openTags[this.currentLevel],this.currentLevel--,this},x.prototype.end=function(){for(;this.currentLevel>=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 E;return E=m.clone(),E.parent=f,f.children.push(E)}),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<v;f++)t=n[f],delete this.attributes[t];else delete this.attributes[n];return this},i.prototype.toString=function(n){return this.options.writer.set(n).element(this)},i.prototype.att=function(n,t){return this.attribute(n,t)},i.prototype.a=function(n,t){return this.attribute(n,t)},i}(p)}).call(void 0)},{"./Utility":214,"./XMLAttribute":215,"./XMLNode":227,"babel-runtime/core-js/object/create":19}],227:[function(w,P,b){"use strict";(function(){var T,C,c,p,d,o,a,u,s,h,i,n,t={}.hasOwnProperty;n=w("./Utility"),i=n.isObject,h=n.isFunction,s=n.isEmpty,d=null,T=null,C=null,c=null,p=null,a=null,u=null,o=null,P.exports=function(){function f(v){this.parent=v,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),this.children=[],d||(d=w("./XMLElement"),T=w("./XMLCData"),C=w("./XMLComment"),c=w("./XMLDeclaration"),p=w("./XMLDocType"),a=w("./XMLRaw"),u=w("./XMLText"),o=w("./XMLProcessingInstruction"))}return f.prototype.element=function(v,m,E){var _,g,y,x,l,S,O,A,D,I;if(S=null,m==null&&(m={}),m=m.valueOf(),i(m)||(D=[m,E],E=D[0],m=D[1]),v!=null&&(v=v.valueOf()),Array.isArray(v))for(y=0,O=v.length;y<O;y++)g=v[y],S=this.element(g);else if(h(v))S=this.element(v.apply());else if(i(v)){for(l in v)if(t.call(v,l))if(I=v[l],h(I)&&(I=I.apply()),i(I)&&s(I)&&(I=null),!this.options.ignoreDecorators&&this.stringify.convertAttKey&&l.indexOf(this.stringify.convertAttKey)===0)S=this.attribute(l.substr(this.stringify.convertAttKey.length),I);else if(!this.options.separateArrayItems&&Array.isArray(I))for(x=0,A=I.length;x<A;x++)g=I[x],_={},_[l]=g,S=this.element(_);else i(I)?(S=this.element(l),S.element(I)):S=this.element(l,I)}else S=!this.options.ignoreDecorators&&this.stringify.convertTextKey&&v.indexOf(this.stringify.convertTextKey)===0?this.text(E):!this.options.ignoreDecorators&&this.stringify.convertCDataKey&&v.indexOf(this.stringify.convertCDataKey)===0?this.cdata(E):!this.options.ignoreDecorators&&this.stringify.convertCommentKey&&v.indexOf(this.stringify.convertCommentKey)===0?this.comment(E):!this.options.ignoreDecorators&&this.stringify.convertRawKey&&v.indexOf(this.stringify.convertRawKey)===0?this.raw(E):!this.options.ignoreDecorators&&this.stringify.convertPIKey&&v.indexOf(this.stringify.convertPIKey)===0?this.instruction(v.substr(this.stringify.convertPIKey.length),E):this.node(v,m,E);if(S==null)throw new Error("Could not create any elements with: "+v);return S},f.prototype.insertBefore=function(v,m,E){var _,g,y;if(this.isRoot)throw new Error("Cannot insert elements at root level");return g=this.parent.children.indexOf(this),y=this.parent.children.splice(g),_=this.parent.element(v,m,E),Array.prototype.push.apply(this.parent.children,y),_},f.prototype.insertAfter=function(v,m,E){var _,g,y;if(this.isRoot)throw new Error("Cannot insert elements at root level");return g=this.parent.children.indexOf(this),y=this.parent.children.splice(g+1),_=this.parent.element(v,m,E),Array.prototype.push.apply(this.parent.children,y),_},f.prototype.remove=function(){var v;if(this.isRoot)throw new Error("Cannot remove the root element");return v=this.parent.children.indexOf(this),[].splice.apply(this.parent.children,[v,v-v+1].concat([])),this.parent},f.prototype.node=function(v,m,E){var _,g;return v!=null&&(v=v.valueOf()),m||(m={}),m=m.valueOf(),i(m)||(g=[m,E],E=g[0],m=g[1]),_=new d(this,v,m),E!=null&&_.text(E),this.children.push(_),_},f.prototype.text=function(v){var m;return m=new u(this,v),this.children.push(m),this},f.prototype.cdata=function(v){var m;return m=new T(this,v),this.children.push(m),this},f.prototype.comment=function(v){var m;return m=new C(this,v),this.children.push(m),this},f.prototype.commentBefore=function(v){var m,E;return m=this.parent.children.indexOf(this),E=this.parent.children.splice(m),this.parent.comment(v),Array.prototype.push.apply(this.parent.children,E),this},f.prototype.commentAfter=function(v){var m,E;return m=this.parent.children.indexOf(this),E=this.parent.children.splice(m+1),this.parent.comment(v),Array.prototype.push.apply(this.parent.children,E),this},f.prototype.raw=function(v){var m;return m=new a(this,v),this.children.push(m),this},f.prototype.instruction=function(v,m){var E,_,g,y,x;if(v!=null&&(v=v.valueOf()),m!=null&&(m=m.valueOf()),Array.isArray(v))for(y=0,x=v.length;y<x;y++)E=v[y],this.instruction(E);else if(i(v))for(E in v)t.call(v,E)&&(_=v[E],this.instruction(E,_));else h(m)&&(m=m.apply()),g=new o(this,v,m),this.children.push(g);return this},f.prototype.instructionBefore=function(v,m){var E,_;return E=this.parent.children.indexOf(this),_=this.parent.children.splice(E),this.parent.instruction(v,m),Array.prototype.push.apply(this.parent.children,_),this},f.prototype.instructionAfter=function(v,m){var E,_;return E=this.parent.children.indexOf(this),_=this.parent.children.splice(E+1),this.parent.instruction(v,m),Array.prototype.push.apply(this.parent.children,_),this},f.prototype.declaration=function(v,m,E){var _,g;return _=this.document(),g=new c(_,v,m,E),_.children[0]instanceof c?_.children[0]=g:_.children.unshift(g),_.root()||_},f.prototype.doctype=function(v,m){var E,_,g,y,x,l,S,O,A,D;for(_=this.document(),g=new p(_,v,m),A=_.children,y=x=0,S=A.length;x<S;y=++x)if((E=A[y])instanceof p)return _.children[y]=g,g;for(D=_.children,y=l=0,O=D.length;l<O;y=++l)if(E=D[y],E.isRoot)return _.children.splice(y,0,g),g;return _.children.push(g),g},f.prototype.up=function(){if(this.isRoot)throw new Error("The root node has no parent. Use doc() if you need to get the document object.");return this.parent},f.prototype.root=function(){var v;for(v=this;v;){if(v.isDocument)return v.rootObject;if(v.isRoot)return v;v=v.parent}},f.prototype.document=function(){var v;for(v=this;v;){if(v.isDocument)return v;v=v.parent}},f.prototype.end=function(v){return this.document().end(v)},f.prototype.prev=function(){var v;if((v=this.parent.children.indexOf(this))<1)throw new Error("Already at the first node");return this.parent.children[v-1]},f.prototype.next=function(){var v;if((v=this.parent.children.indexOf(this))===-1||v===this.parent.children.length-1)throw new Error("Already at the last node");return this.parent.children[v+1]},f.prototype.importDocument=function(v){var m;return m=v.root().clone(),m.parent=this,m.isRoot=!1,this.children.push(m),this},f.prototype.ele=function(v,m,E){return this.element(v,m,E)},f.prototype.nod=function(v,m,E){return this.node(v,m,E)},f.prototype.txt=function(v){return this.text(v)},f.prototype.dat=function(v){return this.cdata(v)},f.prototype.com=function(v){return this.comment(v)},f.prototype.ins=function(v,m){return this.instruction(v,m)},f.prototype.doc=function(){return this.document()},f.prototype.dec=function(v,m,E){return this.declaration(v,m,E)},f.prototype.dtd=function(v,m){return this.doctype(v,m)},f.prototype.e=function(v,m,E){return this.element(v,m,E)},f.prototype.n=function(v,m,E){return this.node(v,m,E)},f.prototype.t=function(v){return this.text(v)},f.prototype.d=function(v){return this.cdata(v)},f.prototype.c=function(v){return this.comment(v)},f.prototype.r=function(v){return this.raw(v)},f.prototype.i=function(v,m){return this.instruction(v,m)},f.prototype.u=function(){return this.up()},f.prototype.importXMLBuilder=function(v){return this.importDocument(v)},f}()}).call(void 0)},{"./Utility":214,"./XMLCData":216,"./XMLComment":217,"./XMLDeclaration":222,"./XMLDocType":223,"./XMLElement":226,"./XMLProcessingInstruction":228,"./XMLRaw":229,"./XMLText":233}],228:[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=function(o,a){function u(){this.constructor=o}for(var s in a)d.call(a,s)&&(o[s]=a[s]);return u.prototype=a.prototype,o.prototype=new u,o.__super__=a.prototype,o},d={}.hasOwnProperty;c=w("./XMLNode"),P.exports=function(o){function a(u,s,h){if(a.__super__.constructor.call(this,u),s==null)throw new Error("Missing instruction target");this.target=this.stringify.insTarget(s),h&&(this.value=this.stringify.insValue(h))}return p(a,o),a.prototype.clone=function(){return(0,C.default)(this)},a.prototype.toString=function(u){return this.options.writer.set(u).processingInstruction(this)},a}(c)}).call(void 0)},{"./XMLNode":227,"babel-runtime/core-js/object/create":19}],229:[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=function(o,a){function u(){this.constructor=o}for(var s in a)d.call(a,s)&&(o[s]=a[s]);return u.prototype=a.prototype,o.prototype=new u,o.__super__=a.prototype,o},d={}.hasOwnProperty;c=w("./XMLNode"),P.exports=function(o){function a(u,s){if(a.__super__.constructor.call(this,u),s==null)throw new Error("Missing raw text");this.value=this.stringify.raw(s)}return p(a,o),a.prototype.clone=function(){return(0,C.default)(this)},a.prototype.toString=function(u){return this.options.writer.set(u).raw(this)},a}(c)}).call(void 0)},{"./XMLNode":227,"babel-runtime/core-js/object/create":19}],230:[function(w,P,b){"use strict";(function(){var T,C,c,p,d,o,a,u,s,h,i,n,t,f=function(m,E){function _(){this.constructor=m}for(var g in E)v.call(E,g)&&(m[g]=E[g]);return _.prototype=E.prototype,m.prototype=new _,m.__super__=E.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(_,g){E.__super__.constructor.call(this,g),this.stream=_}return f(E,m),E.prototype.document=function(_){var g,y,x,l,S,O,A,D;for(O=_.children,y=0,l=O.length;y<l;y++)g=O[y],g.isLastRootNode=!1;for(_.children[_.children.length-1].isLastRootNode=!0,A=_.children,D=[],x=0,S=A.length;x<S;x++)switch(g=A[x],!1){case!(g instanceof a):D.push(this.declaration(g));break;case!(g instanceof u):D.push(this.docType(g));break;case!(g instanceof C):D.push(this.comment(g));break;case!(g instanceof h):D.push(this.processingInstruction(g));break;default:D.push(this.element(g))}return D},E.prototype.attribute=function(_){return this.stream.write(" "+_.name+'="'+_.value+'"')},E.prototype.cdata=function(_,g){return this.stream.write(this.space(g)+"<![CDATA["+_.text+"]]>"+this.endline(_))},E.prototype.comment=function(_,g){return this.stream.write(this.space(g)+"<!-- "+_.text+" -->"+this.endline(_))},E.prototype.declaration=function(_,g){return this.stream.write(this.space(g)),this.stream.write('<?xml version="'+_.version+'"'),_.encoding!=null&&this.stream.write(' encoding="'+_.encoding+'"'),_.standalone!=null&&this.stream.write(' standalone="'+_.standalone+'"'),this.stream.write(this.spacebeforeslash+"?>"),this.stream.write(this.endline(_))},E.prototype.docType=function(_,g){var y,x,l,S;if(g||(g=0),this.stream.write(this.space(g)),this.stream.write("<!DOCTYPE "+_.root().name),_.pubID&&_.sysID?this.stream.write(' PUBLIC "'+_.pubID+'" "'+_.sysID+'"'):_.sysID&&this.stream.write(' SYSTEM "'+_.sysID+'"'),_.children.length>0){for(this.stream.write(" ["),this.stream.write(this.endline(_)),S=_.children,x=0,l=S.length;x<l;x++)switch(y=S[x],!1){case!(y instanceof c):this.dtdAttList(y,g+1);break;case!(y instanceof p):this.dtdElement(y,g+1);break;case!(y instanceof d):this.dtdEntity(y,g+1);break;case!(y instanceof o):this.dtdNotation(y,g+1);break;case!(y instanceof T):this.cdata(y,g+1);break;case!(y instanceof C):this.comment(y,g+1);break;case!(y instanceof h):this.processingInstruction(y,g+1);break;default:throw new Error("Unknown DTD node type: "+y.constructor.name)}this.stream.write("]")}return this.stream.write(this.spacebeforeslash+">"),this.stream.write(this.endline(_))},E.prototype.element=function(_,g){var y,x,l,S,O,A,D,I;g||(g=0),I=this.space(g),this.stream.write(I+"<"+_.name),A=_.attributes;for(O in A)v.call(A,O)&&(y=A[O],this.attribute(y));if(_.children.length===0||_.children.every(function(B){return B.value===""}))this.allowEmpty?this.stream.write("></"+_.name+">"):this.stream.write(this.spacebeforeslash+"/>");else if(this.pretty&&_.children.length===1&&_.children[0].value!=null)this.stream.write(">"),this.stream.write(_.children[0].value),this.stream.write("</"+_.name+">");else{for(this.stream.write(">"+this.newline),D=_.children,l=0,S=D.length;l<S;l++)switch(x=D[l],!1){case!(x instanceof T):this.cdata(x,g+1);break;case!(x instanceof C):this.comment(x,g+1);break;case!(x instanceof s):this.element(x,g+1);break;case!(x instanceof i):this.raw(x,g+1);break;case!(x instanceof n):this.text(x,g+1);break;case!(x instanceof h):this.processingInstruction(x,g+1);break;default:throw new Error("Unknown XML node type: "+x.constructor.name)}this.stream.write(I+"</"+_.name+">")}return this.stream.write(this.endline(_))},E.prototype.processingInstruction=function(_,g){return this.stream.write(this.space(g)+"<?"+_.target),_.value&&this.stream.write(" "+_.value),this.stream.write(this.spacebeforeslash+"?>"+this.endline(_))},E.prototype.raw=function(_,g){return this.stream.write(this.space(g)+_.value+this.endline(_))},E.prototype.text=function(_,g){return this.stream.write(this.space(g)+_.value+this.endline(_))},E.prototype.dtdAttList=function(_,g){return this.stream.write(this.space(g)+"<!ATTLIST "+_.elementName+" "+_.attributeName+" "+_.attributeType),_.defaultValueType!=="#DEFAULT"&&this.stream.write(" "+_.defaultValueType),_.defaultValue&&this.stream.write(' "'+_.defaultValue+'"'),this.stream.write(this.spacebeforeslash+">"+this.endline(_))},E.prototype.dtdElement=function(_,g){return this.stream.write(this.space(g)+"<!ELEMENT "+_.name+" "+_.value),this.stream.write(this.spacebeforeslash+">"+this.endline(_))},E.prototype.dtdEntity=function(_,g){return this.stream.write(this.space(g)+"<!ENTITY"),_.pe&&this.stream.write(" %"),this.stream.write(" "+_.name),_.value?this.stream.write(' "'+_.value+'"'):(_.pubID&&_.sysID?this.stream.write(' PUBLIC "'+_.pubID+'" "'+_.sysID+'"'):_.sysID&&this.stream.write(' SYSTEM "'+_.sysID+'"'),_.nData&&this.stream.write(" NDATA "+_.nData)),this.stream.write(this.spacebeforeslash+">"+this.endline(_))},E.prototype.dtdNotation=function(_,g){return this.stream.write(this.space(g)+"<!NOTATION "+_.name),_.pubID&&_.sysID?this.stream.write(' PUBLIC "'+_.pubID+'" "'+_.sysID+'"'):_.pubID?this.stream.write(' PUBLIC "'+_.pubID+'"'):_.sysID&&this.stream.write(' SYSTEM "'+_.sysID+'"'),this.stream.write(this.spacebeforeslash+">"+this.endline(_))},E.prototype.endline=function(_){return _.isLastRootNode?"":this.newline},E}(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,E){function _(){this.constructor=m}for(var g in E)v.call(E,g)&&(m[g]=E[g]);return _.prototype=E.prototype,m.prototype=new _,m.__super__=E.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(_){E.__super__.constructor.call(this,_)}return f(E,m),E.prototype.document=function(_){var g,y,x,l,S;for(this.textispresent=!1,l="",S=_.children,y=0,x=S.length;y<x;y++)g=S[y],l+=function(){switch(!1){case!(g instanceof a):return this.declaration(g);case!(g instanceof u):return this.docType(g);case!(g instanceof C):return this.comment(g);case!(g instanceof h):return this.processingInstruction(g);default:return this.element(g,0)}}.call(this);return this.pretty&&l.slice(-this.newline.length)===this.newline&&(l=l.slice(0,-this.newline.length)),l},E.prototype.attribute=function(_){return" "+_.name+'="'+_.value+'"'},E.prototype.cdata=function(_,g){return this.space(g)+"<![CDATA["+_.text+"]]>"+this.newline},E.prototype.comment=function(_,g){return this.space(g)+"<!-- "+_.text+" -->"+this.newline},E.prototype.declaration=function(_,g){var y;return y=this.space(g),y+='<?xml version="'+_.version+'"',_.encoding!=null&&(y+=' encoding="'+_.encoding+'"'),_.standalone!=null&&(y+=' standalone="'+_.standalone+'"'),y+=this.spacebeforeslash+"?>",y+=this.newline},E.prototype.docType=function(_,g){var y,x,l,S,O;if(g||(g=0),S=this.space(g),S+="<!DOCTYPE "+_.root().name,_.pubID&&_.sysID?S+=' PUBLIC "'+_.pubID+'" "'+_.sysID+'"':_.sysID&&(S+=' SYSTEM "'+_.sysID+'"'),_.children.length>0){for(S+=" [",S+=this.newline,O=_.children,x=0,l=O.length;x<l;x++)y=O[x],S+=function(){switch(!1){case!(y instanceof c):return this.dtdAttList(y,g+1);case!(y instanceof p):return this.dtdElement(y,g+1);case!(y instanceof d):return this.dtdEntity(y,g+1);case!(y instanceof o):return this.dtdNotation(y,g+1);case!(y instanceof T):return this.cdata(y,g+1);case!(y instanceof C):return this.comment(y,g+1);case!(y instanceof h):return this.processingInstruction(y,g+1);default:throw new Error("Unknown DTD node type: "+y.constructor.name)}}.call(this);S+="]"}return S+=this.spacebeforeslash+">",S+=this.newline},E.prototype.element=function(_,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+"<"+_.name,B=_.attributes;for(D in B)v.call(B,D)&&(y=B[D],I+=this.attribute(y));if(_.children.length===0||_.children.every(function(X){return X.value===""}))this.allowEmpty?I+="></"+_.name+">"+this.newline:I+=this.spacebeforeslash+"/>"+this.newline;else if(this.pretty&&_.children.length===1&&_.children[0].value!=null)I+=">",I+=_.children[0].value,I+="</"+_.name+">"+this.newline;else{if(this.dontprettytextnodes){for(H=_.children,l=0,O=H.length;l<O;l++)if(x=H[l],x.value!=null){this.textispresent++,V=!0;break}}for(this.textispresent&&(this.newline="",this.pretty=!1,W=this.space(g)),I+=">"+this.newline,te=_.children,S=0,A=te.length;S<A;S++)x=te[S],I+=function(){switch(!1){case!(x instanceof T):return this.cdata(x,g+1);case!(x instanceof C):return this.comment(x,g+1);case!(x instanceof s):return this.element(x,g+1);case!(x instanceof i):return this.raw(x,g+1);case!(x instanceof n):return this.text(x,g+1);case!(x instanceof h):return this.processingInstruction(x,g+1);default:throw new Error("Unknown XML node type: "+x.constructor.name)}}.call(this);V&&this.textispresent--,this.textispresent||(this.newline=this.newlinedefault,this.pretty=this.prettydefault),I+=W+"</"+_.name+">"+this.newline}return I},E.prototype.processingInstruction=function(_,g){var y;return y=this.space(g)+"<?"+_.target,_.value&&(y+=" "+_.value),y+=this.spacebeforeslash+"?>"+this.newline},E.prototype.raw=function(_,g){return this.space(g)+_.value+this.newline},E.prototype.text=function(_,g){return this.space(g)+_.value+this.newline},E.prototype.dtdAttList=function(_,g){var y;return y=this.space(g)+"<!ATTLIST "+_.elementName+" "+_.attributeName+" "+_.attributeType,_.defaultValueType!=="#DEFAULT"&&(y+=" "+_.defaultValueType),_.defaultValue&&(y+=' "'+_.defaultValue+'"'),y+=this.spacebeforeslash+">"+this.newline},E.prototype.dtdElement=function(_,g){return this.space(g)+"<!ELEMENT "+_.name+" "+_.value+this.spacebeforeslash+">"+this.newline},E.prototype.dtdEntity=function(_,g){var y;return y=this.space(g)+"<!ENTITY",_.pe&&(y+=" %"),y+=" "+_.name,_.value?y+=' "'+_.value+'"':(_.pubID&&_.sysID?y+=' PUBLIC "'+_.pubID+'" "'+_.sysID+'"':_.sysID&&(y+=' SYSTEM "'+_.sysID+'"'),_.nData&&(y+=" NDATA "+_.nData)),y+=this.spacebeforeslash+">"+this.newline},E.prototype.dtdNotation=function(_,g){var y;return y=this.space(g)+"<!NOTATION "+_.name,_.pubID&&_.sysID?y+=' PUBLIC "'+_.pubID+'" "'+_.sysID+'"':_.pubID?y+=' PUBLIC "'+_.pubID+'"':_.sysID&&(y+=' SYSTEM "'+_.sysID+'"'),y+=this.spacebeforeslash+">"+this.newline},E.prototype.openNode=function(_,g){var y,x,l,S;if(g||(g=0),_ instanceof s){l=this.space(g)+"<"+_.name,S=_.attributes;for(x in S)v.call(S,x)&&(y=S[x],l+=this.attribute(y));return l+=(_.children?">":"/>")+this.newline}return l=this.space(g)+"<!DOCTYPE "+_.rootNodeName,_.pubID&&_.sysID?l+=' PUBLIC "'+_.pubID+'" "'+_.sysID+'"':_.sysID&&(l+=' SYSTEM "'+_.sysID+'"'),l+=(_.children?" [":">")+this.newline},E.prototype.closeNode=function(_,g){switch(g||(g=0),!1){case!(_ instanceof s):return this.space(g)+"</"+_.name+">"+this.newline;case!(_ instanceof u):return this.space(g)+"]>"+this.newline}},E}(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("]]>","]]]]><![CDATA[>"),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(/>/g,">").replace(/\r/g,"
")},c.prototype.attEscape=function(p){var d;return d=this.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,p.replace(d,"&").replace(/</g,"<").replace(/"/g,""").replace(/\t/g,"	").replace(/\n/g,"
").replace(/\r/g,"
")},c}()}).call(void 0)},{}],233:[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=function(o,a){function u(){this.constructor=o}for(var s in a)d.call(a,s)&&(o[s]=a[s]);return u.prototype=a.prototype,o.prototype=new u,o.__super__=a.prototype,o},d={}.hasOwnProperty;c=w("./XMLNode"),P.exports=function(o){function a(u,s){if(a.__super__.constructor.call(this,u),s==null)throw new Error("Missing element text");this.value=this.stringify.eleText(s)}return p(a,o),a.prototype.clone=function(){return(0,C.default)(this)},a.prototype.toString=function(u){return this.options.writer.set(u).text(this)},a}(c)}).call(void 0)},{"./XMLNode":227,"babel-runtime/core-js/object/create":19}],234:[function(w,P,b){"use strict";(function(){var T={}.hasOwnProperty;P.exports=function(){function C(c){var p,d,o,a,u,s,h,i,n;c||(c={}),this.pretty=c.pretty||!1,this.allowEmpty=(d=c.allowEmpty)!=null&&d,this.pretty?(this.indent=(o=c.indent)!=null?o:" ",this.newline=(a=c.newline)!=null?a:`
|
|
|
`,this.offset=(u=c.offset)!=null?u:0,this.dontprettytextnodes=(s=c.dontprettytextnodes)!=null?s:0):(this.indent="",this.newline="",this.offset=0,this.dontprettytextnodes=0),this.spacebeforeslash=(h=c.spacebeforeslash)!=null?h:"",this.spacebeforeslash===!0&&(this.spacebeforeslash=" "),this.newlinedefault=this.newline,this.prettydefault=this.pretty,i=c.writer||{};for(p in i)T.call(i,p)&&(n=i[p],this[p]=n)}return C.prototype.set=function(c){var p,d,o;c||(c={}),"pretty"in c&&(this.pretty=c.pretty),"allowEmpty"in c&&(this.allowEmpty=c.allowEmpty),this.pretty?(this.indent="indent"in c?c.indent:" ",this.newline="newline"in c?c.newline:`
|
|
|
`,this.offset="offset"in c?c.offset:0,this.dontprettytextnodes="dontprettytextnodes"in c?c.dontprettytextnodes:0):(this.indent="",this.newline="",this.offset=0,this.dontprettytextnodes=0),this.spacebeforeslash="spacebeforeslash"in c?c.spacebeforeslash:"",this.spacebeforeslash===!0&&(this.spacebeforeslash=" "),this.newlinedefault=this.newline,this.prettydefault=this.pretty,d=c.writer||{};for(p in d)T.call(d,p)&&(o=d[p],this[p]=o);return this},C.prototype.space=function(c){var p;return this.pretty?(p=(c||0)+this.offset+1,p>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;p<arguments.length;p++){var d=arguments[p];for(var o in d)C.call(d,o)&&(c[o]=d[o])}return c}P.exports=T;var C=Object.prototype.hasOwnProperty},{}],237:[function(w,P,b){"use strict";function T(i,n,t){p.isBuffer(n)||(n=new p(n)),p.isBuffer(t)||(t=new p(t)),n.length>s?n=i(n):n.length<s&&(n=p.concat([n,h],s));for(var f=new p(s),v=new p(s),m=0;m<s;m++)f[m]=54^n[m],v[m]=92^n[m];var E=i(p.concat([f,t]));return i(p.concat([v,E]))}function C(i,n){i=i||"sha1";var t=u[i],f=[],v=0;return t||c("algorithm:",i,"is not yet supported"),{update:function(m){return p.isBuffer(m)||(m=new p(m)),f.push(m),v+=m.length,this},digest:function(m){var E=p.concat(f),_=n?T(t,n,E):t(E);return f=null,m?_.toString(m):_}}}function c(){var i=[].slice.call(arguments).join(" ");throw new Error([i,"we accept pull requests","http://github.com/dominictarr/crypto-browserify"].join(`
|
|
|
`))}var p=w("buffer").Buffer,d=w("./sha"),o=w("./sha256"),a=w("./md5"),u={sha1:d,sha256:o,md5:a},s=64,h=new p(s);h.fill(0),b.createHash=function(i){return C(i)},b.createHmac=function(i,n){return C(i,n)},function(i,n){for(var t in i)n(i[t],t)}(["createCredentials","createCipher","createCipheriv","createDecipher","createDecipheriv","createSign","createVerify","createDiffieHellman","pbkdf2"],function(i){b[i]=function(){c("sorry,",i,"is not implemented yet")}})},{"./md5":239,"./sha":240,"./sha256":241,buffer:38}],238:[function(w,P,b){"use strict";function T(u,s){if(u.length%d!=0){var h=u.length+(d-u.length%d);u=p.concat([u,o],h)}for(var i=[],n=s?u.readInt32BE:u.readInt32LE,t=0;t<u.length;t+=d)i.push(n.call(u,t));return i}function C(u,s,h){for(var i=new p(s),n=h?i.writeInt32BE:i.writeInt32LE,t=0;t<u.length;t++)n.call(i,u[t],4*t,!0);return i}function c(u,s,h,i){return p.isBuffer(u)||(u=new p(u)),C(s(T(u,i),u.length*a),h,i)}var p=w("buffer").Buffer,d=4,o=new p(d);o.fill(0);var a=8;P.exports={hash:c}},{buffer:38}],239:[function(w,P,b){"use strict";function T(h,i){h[i>>5]|=128<<i%32,h[14+(i+64>>>9<<4)]=i;for(var n=1732584193,t=-271733879,f=-1732584194,v=271733878,m=0;m<h.length;m+=16){var E=n,_=t,g=f,y=v;n=c(n,t,f,v,h[m+0],7,-680876936),v=c(v,n,t,f,h[m+1],12,-389564586),f=c(f,v,n,t,h[m+2],17,606105819),t=c(t,f,v,n,h[m+3],22,-1044525330),n=c(n,t,f,v,h[m+4],7,-176418897),v=c(v,n,t,f,h[m+5],12,1200080426),f=c(f,v,n,t,h[m+6],17,-1473231341),t=c(t,f,v,n,h[m+7],22,-45705983),n=c(n,t,f,v,h[m+8],7,1770035416),v=c(v,n,t,f,h[m+9],12,-1958414417),f=c(f,v,n,t,h[m+10],17,-42063),t=c(t,f,v,n,h[m+11],22,-1990404162),n=c(n,t,f,v,h[m+12],7,1804603682),v=c(v,n,t,f,h[m+13],12,-40341101),f=c(f,v,n,t,h[m+14],17,-1502002290),t=c(t,f,v,n,h[m+15],22,1236535329),n=p(n,t,f,v,h[m+1],5,-165796510),v=p(v,n,t,f,h[m+6],9,-1069501632),f=p(f,v,n,t,h[m+11],14,643717713),t=p(t,f,v,n,h[m+0],20,-373897302),n=p(n,t,f,v,h[m+5],5,-701558691),v=p(v,n,t,f,h[m+10],9,38016083),f=p(f,v,n,t,h[m+15],14,-660478335),t=p(t,f,v,n,h[m+4],20,-405537848),n=p(n,t,f,v,h[m+9],5,568446438),v=p(v,n,t,f,h[m+14],9,-1019803690),f=p(f,v,n,t,h[m+3],14,-187363961),t=p(t,f,v,n,h[m+8],20,1163531501),n=p(n,t,f,v,h[m+13],5,-1444681467),v=p(v,n,t,f,h[m+2],9,-51403784),f=p(f,v,n,t,h[m+7],14,1735328473),t=p(t,f,v,n,h[m+12],20,-1926607734),n=d(n,t,f,v,h[m+5],4,-378558),v=d(v,n,t,f,h[m+8],11,-2022574463),f=d(f,v,n,t,h[m+11],16,1839030562),t=d(t,f,v,n,h[m+14],23,-35309556),n=d(n,t,f,v,h[m+1],4,-1530992060),v=d(v,n,t,f,h[m+4],11,1272893353),f=d(f,v,n,t,h[m+7],16,-155497632),t=d(t,f,v,n,h[m+10],23,-1094730640),n=d(n,t,f,v,h[m+13],4,681279174),v=d(v,n,t,f,h[m+0],11,-358537222),f=d(f,v,n,t,h[m+3],16,-722521979),t=d(t,f,v,n,h[m+6],23,76029189),n=d(n,t,f,v,h[m+9],4,-640364487),v=d(v,n,t,f,h[m+12],11,-421815835),f=d(f,v,n,t,h[m+15],16,530742520),t=d(t,f,v,n,h[m+2],23,-995338651),n=o(n,t,f,v,h[m+0],6,-198630844),v=o(v,n,t,f,h[m+7],10,1126891415),f=o(f,v,n,t,h[m+14],15,-1416354905),t=o(t,f,v,n,h[m+5],21,-57434055),n=o(n,t,f,v,h[m+12],6,1700485571),v=o(v,n,t,f,h[m+3],10,-1894986606),f=o(f,v,n,t,h[m+10],15,-1051523),t=o(t,f,v,n,h[m+1],21,-2054922799),n=o(n,t,f,v,h[m+8],6,1873313359),v=o(v,n,t,f,h[m+15],10,-30611744),f=o(f,v,n,t,h[m+6],15,-1560198380),t=o(t,f,v,n,h[m+13],21,1309151649),n=o(n,t,f,v,h[m+4],6,-145523070),v=o(v,n,t,f,h[m+11],10,-1120210379),f=o(f,v,n,t,h[m+2],15,718787259),t=o(t,f,v,n,h[m+9],21,-343485551),n=a(n,E),t=a(t,_),f=a(f,g),v=a(v,y)}return Array(n,t,f,v)}function C(h,i,n,t,f,v){return a(u(a(a(i,h),a(t,v)),f),n)}function c(h,i,n,t,f,v,m){return C(i&n|~i&t,h,i,f,v,m)}function p(h,i,n,t,f,v,m){return C(i&t|n&~t,h,i,f,v,m)}function d(h,i,n,t,f,v,m){return C(i^n^t,h,i,f,v,m)}function o(h,i,n,t,f,v,m){return C(n^(i|~t),h,i,f,v,m)}function a(h,i){var n=(65535&h)+(65535&i);return(h>>16)+(i>>16)+(n>>16)<<16|65535&n}function u(h,i){return h<<i|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<a.length;v+=16){for(var m=h,E=i,_=n,g=t,y=f,x=0;x<80;x++){s[x]=x<16?a[v+x]:d(s[x-3]^s[x-8]^s[x-14]^s[x-16],1);var l=p(p(d(h,5),C(x,i,n,t)),p(p(f,s[x]),c(x)));f=t,t=n,n=d(i,30),i=h,h=l}h=p(h,m),i=p(i,E),n=p(n,_),t=p(t,g),f=p(f,y)}return Array(h,i,n,t,f)}function C(a,u,s,h){return a<20?u&s|~u&h:a<40?u^s^h:a<60?u&s|u&h|s&h:u^s^h}function c(a){return a<20?1518500249:a<40?1859775393:a<60?-1894007588:-899497514}function p(a,u){var s=(65535&a)+(65535&u);return(a>>16)+(u>>16)+(s>>16)<<16|65535&s}function d(a,u){return a<<u|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<n.length;l+=16){f=I[0],v=I[1],m=I[2],E=I[3],_=I[4],g=I[5],y=I[6],x=I[7];for(var S=0;S<64;S++)B[S]=S<16?n[S+l]:C(C(C(h(B[S-2]),B[S-7]),s(B[S-15])),B[S-16]),O=C(C(C(C(x,u(_)),d(_,g,y)),D[S]),B[S]),A=C(a(f),o(f,v,m)),x=y,y=g,g=_,_=C(E,O),E=m,m=v,v=f,f=C(O,A);I[0]=C(f,I[0]),I[1]=C(v,I[1]),I[2]=C(m,I[2]),I[3]=C(E,I[3]),I[4]=C(_,I[4]),I[5]=C(g,I[5]),I[6]=C(y,I[6]),I[7]=C(x,I[7])}return I};P.exports=function(n){return T.hash(n,i,32,!0)}},{"./helpers":238}],242:[function(w,P,b){(function(T){"use strict";function C(i){return i&&i.__esModule?i:{default:i}}var c=w("babel-runtime/core-js/object/create"),p=C(c),d=w("babel-runtime/helpers/classCallCheck"),o=C(d),a=w("babel-runtime/helpers/createClass"),u=C(a),s=w("babel-runtime/helpers/typeof"),h=C(s);!function(i){if((b===void 0?"undefined":(0,h.default)(b))==="object"&&P!==void 0)P.exports=i();else if(typeof j=="function"&&j.amd)j([],i);else{var n;n=typeof window!="undefined"?window:T!==void 0?T:typeof self!="undefined"?self:this,n.mime=i()}}(function(){return function i(n,t,f){function v(_,g){if(!t[_]){if(!n[_]){var y=typeof w=="function"&&w;if(!g&&y)return y(_,!0);if(m)return m(_,!0);var x=new Error("Cannot find module '"+_+"'");throw x.code="MODULE_NOT_FOUND",x}var l=t[_]={exports:{}};n[_][0].call(l.exports,function(S){var O=n[_][1][S];return v(O||S)},l,l.exports,i,n,t,f)}return t[_].exports}for(var m=typeof w=="function"&&w,E=0;E<f.length;E++)v(f[E]);return v}({1:[function(i,n,t){var f=function(){function v(){(0,o.default)(this,v),this._types=(0,p.default)(null),this._extensions=(0,p.default)(null);for(var m=0;m<arguments.length;m++)this.define(arguments[m])}return(0,u.default)(v,[{key:"define",value:function(m,E){for(var _ in m){for(var g=m[_],y=0;y<g.length;y++){var x=g[y];if(!E&&x in this._types)throw new Error('Attempt to change mapping for "'+x+'" extension from "'+this._types[x]+'" to "'+_+'". Pass `force=true` to allow this, otherwise remove "'+x+'" from the list of extensions for "'+_+'".');this._types[x]=_}!E&&this._extensions[_]||(this._extensions[_]=g[0])}}},{key:"getType",value:function(m){m=String(m);var E=m.replace(/^.*[\/\\]/,"").toLowerCase(),_=E.replace(/^.*\./,"").toLowerCase(),g=E.length<m.length;return(_.length<E.length-1||!g)&&this._types[_]||null}},{key:"getExtension",value:function(m){return(m=/^\s*([^;\s]*)/.test(m)&&RegExp.$1)&&this._extensions[m.toLowerCase()]||null}}]),v}();n.exports=f},{}],2:[function(i,n,t){var f=i("./Mime");n.exports=new f(i("./types/standard"),i("./types/other"))},{"./Mime":1,"./types/other":3,"./types/standard":4}],3:[function(i,n,t){n.exports={"application/prs.cww":["cww"],"application/vnd.3gpp.pic-bw-large":["plb"],"application/vnd.3gpp.pic-bw-small":["psb"],"application/vnd.3gpp.pic-bw-var":["pvb"],"application/vnd.3gpp2.tcap":["tcap"],"application/vnd.3m.post-it-notes":["pwn"],"application/vnd.accpac.simply.aso":["aso"],"application/vnd.accpac.simply.imp":["imp"],"application/vnd.acucobol":["acu"],"application/vnd.acucorp":["atc","acutc"],"application/vnd.adobe.air-application-installer-package+zip":["air"],"application/vnd.adobe.formscentral.fcdt":["fcdt"],"application/vnd.adobe.fxp":["fxp","fxpl"],"application/vnd.adobe.xdp+xml":["xdp"],"application/vnd.adobe.xfdf":["xfdf"],"application/vnd.ahead.space":["ahead"],"application/vnd.airzip.filesecure.azf":["azf"],"application/vnd.airzip.filesecure.azs":["azs"],"application/vnd.amazon.ebook":["azw"],"application/vnd.americandynamics.acc":["acc"],"application/vnd.amiga.ami":["ami"],"application/vnd.android.package-archive":["apk"],"application/vnd.anser-web-certificate-issue-initiation":["cii"],"application/vnd.anser-web-funds-transfer-initiation":["fti"],"application/vnd.antix.game-component":["atx"],"application/vnd.apple.installer+xml":["mpkg"],"application/vnd.apple.mpegurl":["m3u8"],"application/vnd.apple.pkpass":["pkpass"],"application/vnd.aristanetworks.swi":["swi"],"application/vnd.astraea-software.iota":["iota"],"application/vnd.audiograph":["aep"],"application/vnd.blueice.multipass":["mpm"],"application/vnd.bmi":["bmi"],"application/vnd.businessobjects":["rep"],"application/vnd.chemdraw+xml":["cdxml"],"application/vnd.chipnuts.karaoke-mmd":["mmd"],"application/vnd.cinderella":["cdy"],"application/vnd.claymore":["cla"],"application/vnd.cloanto.rp9":["rp9"],"application/vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"application/vnd.cluetrust.cartomobile-config":["c11amc"],"application/vnd.cluetrust.cartomobile-config-pkg":["c11amz"],"application/vnd.commonspace":["csp"],"application/vnd.contact.cmsg":["cdbcmsg"],"application/vnd.cosmocaller":["cmc"],"application/vnd.crick.clicker":["clkx"],"application/vnd.crick.clicker.keyboard":["clkk"],"application/vnd.crick.clicker.palette":["clkp"],"application/vnd.crick.clicker.template":["clkt"],"application/vnd.crick.clicker.wordbank":["clkw"],"application/vnd.criticaltools.wbs+xml":["wbs"],"application/vnd.ctc-posml":["pml"],"application/vnd.cups-ppd":["ppd"],"application/vnd.curl.car":["car"],"application/vnd.curl.pcurl":["pcurl"],"application/vnd.dart":["dart"],"application/vnd.data-vision.rdz":["rdz"],"application/vnd.dece.data":["uvf","uvvf","uvd","uvvd"],"application/vnd.dece.ttml+xml":["uvt","uvvt"],"application/vnd.dece.unspecified":["uvx","uvvx"],"application/vnd.dece.zip":["uvz","uvvz"],"application/vnd.denovo.fcselayout-link":["fe_launch"],"application/vnd.dna":["dna"],"application/vnd.dolby.mlp":["mlp"],"application/vnd.dpgraph":["dpg"],"application/vnd.dreamfactory":["dfac"],"application/vnd.ds-keypoint":["kpxx"],"application/vnd.dvb.ait":["ait"],"application/vnd.dvb.service":["svc"],"application/vnd.dynageo":["geo"],"application/vnd.ecowin.chart":["mag"],"application/vnd.enliven":["nml"],"application/vnd.epson.esf":["esf"],"application/vnd.epson.msf":["msf"],"application/vnd.epson.quickanime":["qam"],"application/vnd.epson.salt":["slt"],"application/vnd.epson.ssf":["ssf"],"application/vnd.eszigno3+xml":["es3","et3"],"application/vnd.ezpix-album":["ez2"],"application/vnd.ezpix-package":["ez3"],"application/vnd.fdf":["fdf"],"application/vnd.fdsn.mseed":["mseed"],"application/vnd.fdsn.seed":["seed","dataless"],"application/vnd.flographit":["gph"],"application/vnd.fluxtime.clip":["ftc"],"application/vnd.framemaker":["fm","frame","maker","book"],"application/vnd.frogans.fnc":["fnc"],"application/vnd.frogans.ltf":["ltf"],"application/vnd.fsc.weblaunch":["fsc"],"application/vnd.fujitsu.oasys":["oas"],"application/vnd.fujitsu.oasys2":["oa2"],"application/vnd.fujitsu.oasys3":["oa3"],"application/vnd.fujitsu.oasysgp":["fg5"],"application/vnd.fujitsu.oasysprs":["bh2"],"application/vnd.fujixerox.ddd":["ddd"],"application/vnd.fujixerox.docuworks":["xdw"],"application/vnd.fujixerox.docuworks.binder":["xbd"],"application/vnd.fuzzysheet":["fzs"],"application/vnd.genomatix.tuxedo":["txd"],"application/vnd.geogebra.file":["ggb"],"application/vnd.geogebra.tool":["ggt"],"application/vnd.geometry-explorer":["gex","gre"],"application/vnd.geonext":["gxt"],"application/vnd.geoplan":["g2w"],"application/vnd.geospace":["g3w"],"application/vnd.gmx":["gmx"],"application/vnd.google-apps.document":["gdoc"],"application/vnd.google-apps.presentation":["gslides"],"application/vnd.google-apps.spreadsheet":["gsheet"],"application/vnd.google-earth.kml+xml":["kml"],"application/vnd.google-earth.kmz":["kmz"],"application/vnd.grafeq":["gqf","gqs"],"application/vnd.groove-account":["gac"],"application/vnd.groove-help":["ghf"],"application/vnd.groove-identity-message":["gim"],"application/vnd.groove-injector":["grv"],"application/vnd.groove-tool-message":["gtm"],"application/vnd.groove-tool-template":["tpl"],"application/vnd.groove-vcard":["vcg"],"application/vnd.hal+xml":["hal"],"application/vnd.handheld-entertainment+xml":["zmm"],"application/vnd.hbci":["hbci"],"application/vnd.hhe.lesson-player":["les"],"application/vnd.hp-hpgl":["hpgl"],"application/vnd.hp-hpid":["hpid"],"application/vnd.hp-hps":["hps"],"application/vnd.hp-jlyt":["jlt"],"application/vnd.hp-pcl":["pcl"],"application/vnd.hp-pclxl":["pclxl"],"application/vnd.hydrostatix.sof-data":["sfd-hdstx"],"application/vnd.ibm.minipay":["mpy"],"application/vnd.ibm.modcap":["afp","listafp","list3820"],"application/vnd.ibm.rights-management":["irm"],"application/vnd.ibm.secure-container":["sc"],"application/vnd.iccprofile":["icc","icm"],"application/vnd.igloader":["igl"],"application/vnd.immervision-ivp":["ivp"],"application/vnd.immervision-ivu":["ivu"],"application/vnd.insors.igm":["igm"],"application/vnd.intercon.formnet":["xpw","xpx"],"application/vnd.intergeo":["i2g"],"application/vnd.intu.qbo":["qbo"],"application/vnd.intu.qfx":["qfx"],"application/vnd.ipunplugged.rcprofile":["rcprofile"],"application/vnd.irepository.package+xml":["irp"],"application/vnd.is-xpr":["xpr"],"application/vnd.isac.fcs":["fcs"],"application/vnd.jam":["jam"],"application/vnd.jcp.javame.midlet-rms":["rms"],"application/vnd.jisp":["jisp"],"application/vnd.joost.joda-archive":["joda"],"application/vnd.kahootz":["ktz","ktr"],"application/vnd.kde.karbon":["karbon"],"application/vnd.kde.kchart":["chrt"],"application/vnd.kde.kformula":["kfo"],"application/vnd.kde.kivio":["flw"],"application/vnd.kde.kontour":["kon"],"application/vnd.kde.kpresenter":["kpr","kpt"],"application/vnd.kde.kspread":["ksp"],"application/vnd.kde.kword":["kwd","kwt"],"application/vnd.kenameaapp":["htke"],"application/vnd.kidspiration":["kia"],"application/vnd.kinar":["kne","knp"],"application/vnd.koan":["skp","skd","skt","skm"],"application/vnd.kodak-descriptor":["sse"],"application/vnd.las.las+xml":["lasxml"],"application/vnd.llamagraphics.life-balance.desktop":["lbd"],"application/vnd.llamagraphics.life-balance.exchange+xml":["lbe"],"application/vnd.lotus-1-2-3":["123"],"application/vnd.lotus-approach":["apr"],"application/vnd.lotus-freelance":["pre"],"application/vnd.lotus-notes":["nsf"],"application/vnd.lotus-organizer":["org"],"application/vnd.lotus-screencam":["scm"],"application/vnd.lotus-wordpro":["lwp"],"application/vnd.macports.portpkg":["portpkg"],"application/vnd.mcd":["mcd"],"application/vnd.medcalcdata":["mc1"],"application/vnd.mediastation.cdkey":["cdkey"],"application/vnd.mfer":["mwf"],"application/vnd.mfmp":["mfm"],"application/vnd.micrografx.flo":["flo"],"application/vnd.micrografx.igx":["igx"],"application/vnd.mif":["mif"],"application/vnd.mobius.daf":["daf"],"application/vnd.mobius.dis":["dis"],"application/vnd.mobius.mbk":["mbk"],"application/vnd.mobius.mqy":["mqy"],"application/vnd.mobius.msl":["msl"],"application/vnd.mobius.plc":["plc"],"application/vnd.mobius.txf":["txf"],"application/vnd.mophun.application":["mpn"],"application/vnd.mophun.certificate":["mpc"],"application/vnd.mozilla.xul+xml":["xul"],"application/vnd.ms-artgalry":["cil"],"application/vnd.ms-cab-compressed":["cab"],"application/vnd.ms-excel":["xls","xlm","xla","xlc","xlt","xlw"],"application/vnd.ms-excel.addin.macroenabled.12":["xlam"],"application/vnd.ms-excel.sheet.binary.macroenabled.12":["xlsb"],"application/vnd.ms-excel.sheet.macroenabled.12":["xlsm"],"application/vnd.ms-excel.template.macroenabled.12":["xltm"],"application/vnd.ms-fontobject":["eot"],"application/vnd.ms-htmlhelp":["chm"],"application/vnd.ms-ims":["ims"],"application/vnd.ms-lrm":["lrm"],"application/vnd.ms-officetheme":["thmx"],"application/vnd.ms-outlook":["msg"],"application/vnd.ms-pki.seccat":["cat"],"application/vnd.ms-pki.stl":["stl"],"application/vnd.ms-powerpoint":["ppt","pps","pot"],"application/vnd.ms-powerpoint.addin.macroenabled.12":["ppam"],"application/vnd.ms-powerpoint.presentation.macroenabled.12":["pptm"],"application/vnd.ms-powerpoint.slide.macroenabled.12":["sldm"],"application/vnd.ms-powerpoint.slideshow.macroenabled.12":["ppsm"],"application/vnd.ms-powerpoint.template.macroenabled.12":["potm"],"application/vnd.ms-project":["mpp","mpt"],"application/vnd.ms-word.document.macroenabled.12":["docm"],"application/vnd.ms-word.template.macroenabled.12":["dotm"],"application/vnd.ms-works":["wps","wks","wcm","wdb"],"application/vnd.ms-wpl":["wpl"],"application/vnd.ms-xpsdocument":["xps"],"application/vnd.mseq":["mseq"],"application/vnd.musician":["mus"],"application/vnd.muvee.style":["msty"],"application/vnd.mynfc":["taglet"],"application/vnd.neurolanguage.nlu":["nlu"],"application/vnd.nitf":["ntf","nitf"],"application/vnd.noblenet-directory":["nnd"],"application/vnd.noblenet-sealer":["nns"],"application/vnd.noblenet-web":["nnw"],"application/vnd.nokia.n-gage.data":["ngdat"],"application/vnd.nokia.n-gage.symbian.install":["n-gage"],"application/vnd.nokia.radio-preset":["rpst"],"application/vnd.nokia.radio-presets":["rpss"],"application/vnd.novadigm.edm":["edm"],"application/vnd.novadigm.edx":["edx"],"application/vnd.novadigm.ext":["ext"],"application/vnd.oasis.opendocument.chart":["odc"],"application/vnd.oasis.opendocument.chart-template":["otc"],"application/vnd.oasis.opendocument.database":["odb"],"application/vnd.oasis.opendocument.formula":["odf"],"application/vnd.oasis.opendocument.formula-template":["odft"],"application/vnd.oasis.opendocument.graphics":["odg"],"application/vnd.oasis.opendocument.graphics-template":["otg"],"application/vnd.oasis.opendocument.image":["odi"],"application/vnd.oasis.opendocument.image-template":["oti"],"application/vnd.oasis.opendocument.presentation":["odp"],"application/vnd.oasis.opendocument.presentation-template":["otp"],"application/vnd.oasis.opendocument.spreadsheet":["ods"],"application/vnd.oasis.opendocument.spreadsheet-template":["ots"],"application/vnd.oasis.opendocument.text":["odt"],"application/vnd.oasis.opendocument.text-master":["odm"],"application/vnd.oasis.opendocument.text-template":["ott"],"application/vnd.oasis.opendocument.text-web":["oth"],"application/vnd.olpc-sugar":["xo"],"application/vnd.oma.dd2+xml":["dd2"],"application/vnd.openofficeorg.extension":["oxt"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":["pptx"],"application/vnd.openxmlformats-officedocument.presentationml.slide":["sldx"],"application/vnd.openxmlformats-officedocument.presentationml.slideshow":["ppsx"],"application/vnd.openxmlformats-officedocument.presentationml.template":["potx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":["xlsx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.template":["xltx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":["docx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.template":["dotx"],"application/vnd.osgeo.mapguide.package":["mgp"],"application/vnd.osgi.dp":["dp"],"application/vnd.osgi.subsystem":["esa"],"application/vnd.palm":["pdb","pqa","oprc"],"application/vnd.pawaafile":["paw"],"application/vnd.pg.format":["str"],"application/vnd.pg.osasli":["ei6"],"application/vnd.picsel":["efif"],"application/vnd.pmi.widget":["wg"],"application/vnd.pocketlearn":["plf"],"application/vnd.powerbuilder6":["pbd"],"application/vnd.previewsystems.box":["box"],"application/vnd.proteus.magazine":["mgz"],"application/vnd.publishare-delta-tree":["qps"],"application/vnd.pvi.ptid1":["ptid"],"application/vnd.quark.quarkxpress":["qxd","qxt","qwd","qwt","qxl","qxb"],"application/vnd.realvnc.bed":["bed"],"application/vnd.recordare.musicxml":["mxl"],"application/vnd.recordare.musicxml+xml":["musicxml"],"application/vnd.rig.cryptonote":["cryptonote"],"application/vnd.rim.cod":["cod"],"application/vnd.rn-realmedia":["rm"],"application/vnd.rn-realmedia-vbr":["rmvb"],"application/vnd.route66.link66+xml":["link66"],"application/vnd.sailingtracker.track":["st"],"application/vnd.seemail":["see"],"application/vnd.sema":["sema"],"application/vnd.semd":["semd"],"application/vnd.semf":["semf"],"application/vnd.shana.informed.formdata":["ifm"],"application/vnd.shana.informed.formtemplate":["itp"],"application/vnd.shana.informed.interchange":["iif"],"application/vnd.shana.informed.package":["ipk"],"application/vnd.simtech-mindmapper":["twd","twds"],"application/vnd.smaf":["mmf"],"application/vnd.smart.teacher":["teacher"],"application/vnd.solent.sdkm+xml":["sdkm","sdkd"],"application/vnd.spotfire.dxp":["dxp"],"application/vnd.spotfire.sfs":["sfs"],"application/vnd.stardivision.calc":["sdc"],"application/vnd.stardivision.draw":["sda"],"application/vnd.stardivision.impress":["sdd"],"application/vnd.stardivision.math":["smf"],"application/vnd.stardivision.writer":["sdw","vor"],"application/vnd.stardivision.writer-global":["sgl"],"application/vnd.stepmania.package":["smzip"],"application/vnd.stepmania.stepchart":["sm"],"application/vnd.sun.wadl+xml":["wadl"],"application/vnd.sun.xml.calc":["sxc"],"application/vnd.sun.xml.calc.template":["stc"],"application/vnd.sun.xml.draw":["sxd"],"application/vnd.sun.xml.draw.template":["std"],"application/vnd.sun.xml.impress":["sxi"],"application/vnd.sun.xml.impress.template":["sti"],"application/vnd.sun.xml.math":["sxm"],"application/vnd.sun.xml.writer":["sxw"],"application/vnd.sun.xml.writer.global":["sxg"],"application/vnd.sun.xml.writer.template":["stw"],"application/vnd.sus-calendar":["sus","susp"],"application/vnd.svd":["svd"],"application/vnd.symbian.install":["sis","sisx"],"application/vnd.syncml+xml":["xsm"],"application/vnd.syncml.dm+wbxml":["bdm"],"application/vnd.syncml.dm+xml":["xdm"],"application/vnd.tao.intent-module-archive":["tao"],"application/vnd.tcpdump.pcap":["pcap","cap","dmp"],"application/vnd.tmobile-livetv":["tmo"],"application/vnd.trid.tpt":["tpt"],"application/vnd.triscape.mxs":["mxs"],"application/vnd.trueapp":["tra"],"application/vnd.ufdl":["ufd","ufdl"],"application/vnd.uiq.theme":["utz"],"application/vnd.umajin":["umj"],"application/vnd.unity":["unityweb"],"application/vnd.uoml+xml":["uoml"],"application/vnd.vcx":["vcx"],"application/vnd.visio":["vsd","vst","vss","vsw"],"application/vnd.visionary":["vis"],"application/vnd.vsf":["vsf"],"application/vnd.wap.wbxml":["wbxml"],"application/vnd.wap.wmlc":["wmlc"],"application/vnd.wap.wmlscriptc":["wmlsc"],"application/vnd.webturbo":["wtb"],"application/vnd.wolfram.player":["nbp"],"application/vnd.wordperfect":["wpd"],"application/vnd.wqd":["wqd"],"application/vnd.wt.stf":["stf"],"application/vnd.xara":["xar"],"application/vnd.xfdl":["xfdl"],"application/vnd.yamaha.hv-dic":["hvd"],"application/vnd.yamaha.hv-script":["hvs"],"application/vnd.yamaha.hv-voice":["hvp"],"application/vnd.yamaha.openscoreformat":["osf"],"application/vnd.yamaha.openscoreformat.osfpvg+xml":["osfpvg"],"application/vnd.yamaha.smaf-audio":["saf"],"application/vnd.yamaha.smaf-phrase":["spf"],"application/vnd.yellowriver-custom-menu":["cmp"],"application/vnd.zul":["zir","zirz"],"application/vnd.zzazz.deck+xml":["zaz"],"application/x-7z-compressed":["7z"],"application/x-abiword":["abw"],"application/x-ace-compressed":["ace"],"application/x-apple-diskimage":[],"application/x-arj":["arj"],"application/x-authorware-bin":["aab","x32","u32","vox"],"application/x-authorware-map":["aam"],"application/x-authorware-seg":["aas"],"application/x-bcpio":["bcpio"],"application/x-bdoc":[],"application/x-bittorrent":["torrent"],"application/x-blorb":["blb","blorb"],"application/x-bzip":["bz"],"application/x-bzip2":["bz2","boz"],"application/x-cbr":["cbr","cba","cbt","cbz","cb7"],"application/x-cdlink":["vcd"],"application/x-cfs-compressed":["cfs"],"application/x-chat":["chat"],"application/x-chess-pgn":["pgn"],"application/x-chrome-extension":["crx"],"application/x-cocoa":["cco"],"application/x-conference":["nsc"],"application/x-cpio":["cpio"],"application/x-csh":["csh"],"application/x-debian-package":["udeb"],"application/x-dgc-compressed":["dgc"],"application/x-director":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"],"application/x-doom":["wad"],"application/x-dtbncx+xml":["ncx"],"application/x-dtbook+xml":["dtb"],"application/x-dtbresource+xml":["res"],"application/x-dvi":["dvi"],"application/x-envoy":["evy"],"application/x-eva":["eva"],"application/x-font-bdf":["bdf"],"application/x-font-ghostscript":["gsf"],"application/x-font-linux-psf":["psf"],"application/x-font-otf":[],"application/x-font-pcf":["pcf"],"application/x-font-snf":["snf"],"application/x-font-ttf":["ttf","ttc"],"application/x-font-type1":["pfa","pfb","pfm","afm"],"application/x-freearc":["arc"],"application/x-futuresplash":["spl"],"application/x-gca-compressed":["gca"],"application/x-glulx":["ulx"],"application/x-gnumeric":["gnumeric"],"application/x-gramps-xml":["gramps"],"application/x-gtar":["gtar"],"application/x-hdf":["hdf"],"application/x-httpd-php":["php"],"application/x-install-instructions":["install"],"application/x-iso9660-image":[],"application/x-java-archive-diff":["jardiff"],"application/x-java-jnlp-file":["jnlp"],"application/x-latex":["latex"],"application/x-lua-bytecode":["luac"],"application/x-lzh-compressed":["lzh","lha"],"application/x-makeself":["run"],"application/x-mie":["mie"],"application/x-mobipocket-ebook":["prc","mobi"],"application/x-ms-application":["application"],"application/x-ms-shortcut":["lnk"],"application/x-ms-wmd":["wmd"],"application/x-ms-wmz":["wmz"],"application/x-ms-xbap":["xbap"],"application/x-msaccess":["mdb"],"application/x-msbinder":["obd"],"application/x-mscardfile":["crd"],"application/x-msclip":["clp"],"application/x-msdos-program":[],"application/x-msdownload":["com","bat"],"application/x-msmediaview":["mvb","m13","m14"],"application/x-msmetafile":["wmf","emf","emz"],"application/x-msmoney":["mny"],"application/x-mspublisher":["pub"],"application/x-msschedule":["scd"],"application/x-msterminal":["trm"],"application/x-mswrite":["wri"],"application/x-netcdf":["nc","cdf"],"application/x-ns-proxy-autoconfig":["pac"],"application/x-nzb":["nzb"],"application/x-perl":["pl","pm"],"application/x-pilot":[],"application/x-pkcs12":["p12","pfx"],"application/x-pkcs7-certificates":["p7b","spc"],"application/x-pkcs7-certreqresp":["p7r"],"application/x-rar-compressed":["rar"],"application/x-redhat-package-manager":["rpm"],"application/x-research-info-systems":["ris"],"application/x-sea":["sea"],"application/x-sh":["sh"],"application/x-shar":["shar"],"application/x-shockwave-flash":["swf"],"application/x-silverlight-app":["xap"],"application/x-sql":["sql"],"application/x-stuffit":["sit"],"application/x-stuffitx":["sitx"],"application/x-subrip":["srt"],"application/x-sv4cpio":["sv4cpio"],"application/x-sv4crc":["sv4crc"],"application/x-t3vm-image":["t3"],"application/x-tads":["gam"],"application/x-tar":["tar"],"application/x-tcl":["tcl","tk"],"application/x-tex":["tex"],"application/x-tex-tfm":["tfm"],"application/x-texinfo":["texinfo","texi"],"application/x-tgif":["obj"],"application/x-ustar":["ustar"],"application/x-virtualbox-hdd":["hdd"],"application/x-virtualbox-ova":["ova"],"application/x-virtualbox-ovf":["ovf"],"application/x-virtualbox-vbox":["vbox"],"application/x-virtualbox-vbox-extpack":["vbox-extpack"],"application/x-virtualbox-vdi":["vdi"],"application/x-virtualbox-vhd":["vhd"],"application/x-virtualbox-vmdk":["vmdk"],"application/x-wais-source":["src"],"application/x-web-app-manifest+json":["webapp"],"application/x-x509-ca-cert":["der","crt","pem"],"application/x-xfig":["fig"],"application/x-xliff+xml":["xlf"],"application/x-xpinstall":["xpi"],"application/x-xz":["xz"],"application/x-zmachine":["z1","z2","z3","z4","z5","z6","z7","z8"],"audio/vnd.dece.audio":["uva","uvva"],"audio/vnd.digital-winds":["eol"],"audio/vnd.dra":["dra"],"audio/vnd.dts":["dts"],"audio/vnd.dts.hd":["dtshd"],"audio/vnd.lucent.voice":["lvp"],"audio/vnd.ms-playready.media.pya":["pya"],"audio/vnd.nuera.ecelp4800":["ecelp4800"],"audio/vnd.nuera.ecelp7470":["ecelp7470"],"audio/vnd.nuera.ecelp9600":["ecelp9600"],"audio/vnd.rip":["rip"],"audio/x-aac":["aac"],"audio/x-aiff":["aif","aiff","aifc"],"audio/x-caf":["caf"],"audio/x-flac":["flac"],"audio/x-m4a":[],"audio/x-matroska":["mka"],"audio/x-mpegurl":["m3u"],"audio/x-ms-wax":["wax"],"audio/x-ms-wma":["wma"],"audio/x-pn-realaudio":["ram","ra"],"audio/x-pn-realaudio-plugin":["rmp"],"audio/x-realaudio":[],"audio/x-wav":[],"chemical/x-cdx":["cdx"],"chemical/x-cif":["cif"],"chemical/x-cmdf":["cmdf"],"chemical/x-cml":["cml"],"chemical/x-csml":["csml"],"chemical/x-xyz":["xyz"],"image/prs.btif":["btif"],"image/vnd.adobe.photoshop":["psd"],"image/vnd.dece.graphic":["uvi","uvvi","uvg","uvvg"],"image/vnd.djvu":["djvu","djv"],"image/vnd.dvb.subtitle":[],"image/vnd.dwg":["dwg"],"image/vnd.dxf":["dxf"],"image/vnd.fastbidsheet":["fbs"],"image/vnd.fpx":["fpx"],"image/vnd.fst":["fst"],"image/vnd.fujixerox.edmics-mmr":["mmr"],"image/vnd.fujixerox.edmics-rlc":["rlc"],"image/vnd.ms-modi":["mdi"],"image/vnd.ms-photo":["wdp"],"image/vnd.net-fpx":["npx"],"image/vnd.wap.wbmp":["wbmp"],"image/vnd.xiff":["xif"],"image/x-3ds":["3ds"],"image/x-cmu-raster":["ras"],"image/x-cmx":["cmx"],"image/x-freehand":["fh","fhc","fh4","fh5","fh7"],"image/x-icon":["ico"],"image/x-jng":["jng"],"image/x-mrsid-image":["sid"],"image/x-ms-bmp":[],"image/x-pcx":["pcx"],"image/x-pict":["pic","pct"],"image/x-portable-anymap":["pnm"],"image/x-portable-bitmap":["pbm"],"image/x-portable-graymap":["pgm"],"image/x-portable-pixmap":["ppm"],"image/x-rgb":["rgb"],"image/x-tga":["tga"],"image/x-xbitmap":["xbm"],"image/x-xpixmap":["xpm"],"image/x-xwindowdump":["xwd"],"model/vnd.collada+xml":["dae"],"model/vnd.dwf":["dwf"],"model/vnd.gdl":["gdl"],"model/vnd.gtw":["gtw"],"model/vnd.mts":["mts"],"model/vnd.vtu":["vtu"],"text/prs.lines.tag":["dsc"],"text/vnd.curl":["curl"],"text/vnd.curl.dcurl":["dcurl"],"text/vnd.curl.mcurl":["mcurl"],"text/vnd.curl.scurl":["scurl"],"text/vnd.dvb.subtitle":["sub"],"text/vnd.fly":["fly"],"text/vnd.fmi.flexstor":["flx"],"text/vnd.graphviz":["gv"],"text/vnd.in3d.3dml":["3dml"],"text/vnd.in3d.spot":["spot"],"text/vnd.sun.j2me.app-descriptor":["jad"],"text/vnd.wap.wml":["wml"],"text/vnd.wap.wmlscript":["wmls"],"text/x-asm":["s","asm"],"text/x-c":["c","cc","cxx","cpp","h","hh","dic"],"text/x-component":["htc"],"text/x-fortran":["f","for","f77","f90"],"text/x-handlebars-template":["hbs"],"text/x-java-source":["java"],"text/x-lua":["lua"],"text/x-markdown":["mkd"],"text/x-nfo":["nfo"],"text/x-opml":["opml"],"text/x-org":[],"text/x-pascal":["p","pas"],"text/x-processing":["pde"],"text/x-sass":["sass"],"text/x-scss":["scss"],"text/x-setext":["etx"],"text/x-sfv":["sfv"],"text/x-suse-ymp":["ymp"],"text/x-uuencode":["uu"],"text/x-vcalendar":["vcs"],"text/x-vcard":["vcf"],"video/vnd.dece.hd":["uvh","uvvh"],"video/vnd.dece.mobile":["uvm","uvvm"],"video/vnd.dece.pd":["uvp","uvvp"],"video/vnd.dece.sd":["uvs","uvvs"],"video/vnd.dece.video":["uvv","uvvv"],"video/vnd.dvb.file":["dvb"],"video/vnd.fvt":["fvt"],"video/vnd.mpegurl":["mxu","m4u"],"video/vnd.ms-playready.media.pyv":["pyv"],"video/vnd.uvvu.mp4":["uvu","uvvu"],"video/vnd.vivo":["viv"],"video/x-f4v":["f4v"],"video/x-fli":["fli"],"video/x-flv":["flv"],"video/x-m4v":["m4v"],"video/x-matroska":["mkv","mk3d","mks"],"video/x-mng":["mng"],"video/x-ms-asf":["asf","asx"],"video/x-ms-vob":["vob"],"video/x-ms-wm":["wm"],"video/x-ms-wmv":["wmv"],"video/x-ms-wmx":["wmx"],"video/x-ms-wvx":["wvx"],"video/x-msvideo":["avi"],"video/x-sgi-movie":["movie"],"video/x-smv":["smv"],"x-conference/x-cooltalk":["ice"]}},{}],4:[function(i,n,t){n.exports={"application/andrew-inset":["ez"],"application/applixware":["aw"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomsvc+xml":["atomsvc"],"application/bdoc":["bdoc"],"application/ccxml+xml":["ccxml"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cu-seeme":["cu"],"application/dash+xml":["mpd"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["ecma"],"application/emma+xml":["emma"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/font-tdpfr":["pfr"],"application/font-woff":["woff"],"application/font-woff2":["woff2"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["js","mjs"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["mp4s","m4p"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-signature":["asc","sig"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/pskc+xml":["pskcxml"],"application/rdf+xml":["rdf"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/voicexml+xml":["vxml"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/xaml+xml":["xaml"],"application/xcap-diff+xml":["xdf"],"application/xenc+xml":["xenc"],"application/xhtml+xml":["xhtml","xht"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":[],"audio/adpcm":["adp"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mp3":[],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/wav":["wav"],"audio/wave":[],"audio/webm":["weba"],"audio/xm":["xm"],"font/otf":["otf"],"image/apng":["apng"],"image/bmp":["bmp"],"image/cgm":["cgm"],"image/g3fax":["g3"],"image/gif":["gif"],"image/ief":["ief"],"image/jpeg":["jpeg","jpg","jpe"],"image/ktx":["ktx"],"image/png":["png"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/tiff":["tiff","tif"],"image/webp":["webp"],"message/rfc822":["eml","mime"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/mesh":["msh","mesh","silo"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["x3db","x3dbz"],"model/x3d+vrml":["x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/hjson":["hjson"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["markdown","md"],"text/mathml":["mml"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/richtext":["rtx"],"text/rtf":[],"text/sgml":["sgml","sgm"],"text/slim":["slim","slm"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vtt":["vtt"],"text/xml":[],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/jpeg":["jpgv"],"video/jpm":["jpm","jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/webm":["webm"]}},{}]},{},[2])(2)})}).call(this,typeof le!="undefined"?le:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"babel-runtime/core-js/object/create":19,"babel-runtime/helpers/classCallCheck":30,"babel-runtime/helpers/createClass":31,"babel-runtime/helpers/typeof":32}],243:[function(w,P,b){"use strict";b.encodeURIComponent=function(T){try{return encodeURIComponent(T)}catch(C){return T}},b.escape=w("escape-html"),b.timestamp=function(T){if(T){var C=T;return typeof C=="string"&&(C=Number(C)),String(T).length===10&&(C*=1e3),new Date(C)}return Math.round(Date.now()/1e3)}},{"escape-html":157}],244:[function(w,P,b){(function(T,C){"use strict";function c(x){return x&&x.__esModule?x:{default:x}}function p(x,l){return x===void 0?l:x}function d(x,l){return function(S,O,A){if(S)return l(S);x({data:O,status:A.statusCode,headers:A.headers,res:A})}}var o,a=w("babel-runtime/core-js/json/stringify"),u=c(a),s=w("babel-runtime/helpers/typeof"),h=c(s),i=w("util"),n=w("url"),t=w("http"),f=w("https"),v=w("debug")("urllib"),m=w("humanize-ms"),E=0,_=Math.pow(2,31)-10,g=/^https?:\/\//i;b.TIMEOUTS=[m("300s"),m("300s")];var y=["json","text"];b.request=function(x,l,S){return arguments.length===2&&typeof l=="function"&&(S=l,l=null),typeof S=="function"?b.requestWithCallback(x,l,S):(o||(o=w("any-promise")),new o(function(O,A){b.requestWithCallback(x,l,d(O,A))}))},b.requestWithCallback=function(x,l,S){function O(){nt&&(clearTimeout(nt),nt=null)}function A(){re&&(clearTimeout(re),re=null)}function D(Xe,Be,Ie){if(A(),!S)return console.warn("[urllib:warn] [%s] [%s] [worker:%s] %s %s callback twice!!!",Date(),X,T.pid,ye.method,x),void(Xe&&console.warn(`[urllib:warn] [%s] [%s] [worker:%s] %s: %s
|
|
|
stack: %s`,Date(),X,T.pid,Xe.name,Xe.message,Xe.stack));var Me=S;S=null;var Ee={};if(Ie&&(J=Ie.statusCode,Ee=Ie.headers),J===401&&Ee["www-authenticate"]&&(!l.headers||!l.headers.Authorization)&&l.digestAuth){var Ae=Ee["www-authenticate"];if(Ae.indexOf("Digest ")>=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:Ee,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)(Ee),Xe.data=Be,Xe.path=ye.path,Xe.status=J,Xe.headers=Ee,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 Ee=S;return S=null,b.requestWithCallback(Me,l,Ee),{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(Ee,Ae,Le){v("Request#%d %s: writeStream or res %s event emitted",X,x,Le),D(k||null,null,Xe)}):je.on("close",function(){v("Request#%d %s: writeStream close event emitted",X,x),D(k||null,null,Xe)}),Xe.pipe(je))}var Ie=[];Xe.on("data",function(Me){v("Request#%d %s: `res data` event emit, size %d",X,x,Me.length),$+=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 Ee=I(Xe);if(Ee.error)return D(Ee.error,Me,Xe);Ee.redirect||B(Xe,Me,function(Ae,Le,Te){if(Ae)return D(Ae,Me,Xe);if(!Te&&y.indexOf(l.dataType)>=0){try{Le=decodeBodyByCharset(Le,Xe)}catch(ut){return v("decodeBodyByCharset error: %s",ut),D(null,Le,Xe)}if(l.dataType==="json")if($===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>=_&&(E=0);var X=++E;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 _e=["pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","secureProtocol","secureOptions"],Ge=0;Ge<_e.length;Ge++){var Ue=_e[Ge];l.hasOwnProperty(Ue)&&(ye[Ue]=l[Ue])}ye.rejectUnauthorized!==!1||ye.hasOwnProperty("secureOptions")||(ye.secureOptions=w("constants").SSL_OP_NO_TLSv1_2);var Fe=l.auth||Y.auth;Fe&&(ye.auth=Fe);var He=l.content||l.data,be=ce==="GET"||ce==="HEAD"||l.dataAsQueryString;if(!l.content&&He&&typeof He!="string"&&!C.isBuffer(He))if(be)He=l.nestedQuerystring?qs.stringify(He):querystring.stringify(He);else{var me=ye.headers["Content-Type"]||ye.headers["content-type"];me||(me=l.contentType==="json"?"application/json":"application/x-www-form-urlencoded",ye.headers["Content-Type"]=me),He=parseContentType(me).type==="application/json"?(0,u.default)(He):l.nestedQuerystring?qs.stringify(He):querystring.stringify(He)}be&&He&&(ye.path+=(Y.query?"&":"?")+He,He=null);var We=0;if(He){var ze=He.length;C.isBuffer(He)||(ze=C.byteLength(He)),We=ye.headers["Content-Length"]=ze}l.dataType==="json"&&(ye.headers.Accept="application/json"),typeof l.beforeRequest=="function"&&l.beforeRequest(ye);var nt=null,re=null,k=null,U=!1,q=!1,$=0,J=-1,xe=!1,ke="",dt="",Ne=null;l.timing&&(Ne={queuing:0,dnslookup:0,connected:0,requestSent:0,waiting:0,contentDownload:0}),ye.headers["User-Agent"]||ye.headers["user-agent"]||(ye.headers["User-Agent"]=navigator.userAgent),l.gzip&&(ye.headers["Accept-Encoding"]||ye.headers["accept-encoding"]||(ye.headers["Accept-Encoding"]="gzip"));var je=l.writeStream;v("Request#%d %s %s with headers %j, options.path: %s",X,ce,x,ye.headers,ye.path),l.requestUrls.push(x);var tt,mt;Array.isArray(l.timeout)?(tt=m(l.timeout[0]),mt=m(l.timeout[1])):tt=mt=m(l.timeout),v("ConnectTimeout: %d, ResponseTimeout: %d",tt,mt);var Qe;try{Qe=Ce.request(ye,H)}catch(Xe){return D(Xe)}return typeof window=="undefined"?function(){v("Connect timer ticking, timeout: %d",tt),nt=setTimeout(function(){nt=null,J===-1&&(J=-2);var Xe="Connect timeout for "+tt+"ms",Be="ConnectionTimeoutError";Qe.socket||(Be="SocketAssignTimeoutError",Xe+=", working sockets is full"),k=new Error(Xe),k.name=Be,k.requestId=X,v("ConnectTimeout: Request#%d %s %s: %s, connected: %s",X,x,k.name,Xe,U),W()},tt)}():Qe.on("requestTimeout",function(){J===-1&&(J=-2);var Xe="Connect timeout for "+tt+"ms";k=new Error(Xe),k.name="ConnectionTimeoutError",k.requestId=X,W()}),Ne&&Qe.on("finish",function(){Ne.requestSent=Date.now()-ee}),Qe.once("socket",function(Xe){Ne&&(Ne.queuing=Date.now()-ee),isNode010&&Xe.socket&&(Xe=Xe.socket);var Be=Xe.readyState;if(Be==="opening")return Xe.once("lookup",function(Ie,Me,Ee){v("Request#%d %s lookup: %s, %s, %s",X,x,Ie,Me,Ee),Ne&&(Ne.dnslookup=Date.now()-ee),Me&&(ke=Me)}),void Xe.once("connect",function(){Ne&&(Ne.connected=Date.now()-ee),O(),te(),v("Request#%d %s new socket connected",X,x),U=!0,ke||(ke=Xe.remoteAddress),dt=Xe.remotePort});v("Request#%d %s reuse socket connected, readyState: %s",X,x,Be),U=!0,q=!0,ke||(ke=Xe.remoteAddress),dt=Xe.remotePort,O(),te()}),Qe.on("error",function(Xe){Xe.name!=="Error"&&Xe.name!=="TypeError"||(Xe.name=U?"ResponseError":"RequestError"),Xe.message+=' (req "error")',v("Request#%d %s `req error` event emit, %s: %s",X,x,Xe.name,Xe.message),D(k||Xe)}),je&&je.once("error",function(Xe){Xe.message+=' (writeStream "error")',k=Xe,v("Request#%d %s `writeStream error` event emit, %s: %s",X,x,Xe.name,Xe.message),W()}),l.stream?(l.stream.pipe(Qe),l.stream.once("error",function(Xe){Xe.message+=' (stream "error")',k=Xe,v("Request#%d %s `readStream error` event emit, %s: %s",X,x,Xe.name,Xe.message),W()})):Qe.end(He),Qe.requestId=X,Qe}}).call(this,w("_process"),w("buffer").Buffer)},{_process:173,"any-promise":13,"babel-runtime/core-js/json/stringify":17,"babel-runtime/helpers/typeof":32,buffer:38,constants:42,debug:155,http:196,https:159,"humanize-ms":160,url:203,util:207}]},{},[1])(1)}),!function(j){function w(b){if(P[b])return P[b].exports;var T=P[b]={i:b,l:!1,exports:{}};return j[b].call(T.exports,T,T.exports,w),T.l=!0,T.exports}var P={};w.m=j,w.c=P,w.d=function(b,T,C){w.o(b,T)||Object.defineProperty(b,T,{configurable:!1,enumerable:!0,get:C})},w.n=function(b){var T=b&&b.__esModule?function(){return b.default}:function(){return b};return w.d(T,"a",T),T},w.o=function(b,T){return Object.prototype.hasOwnProperty.call(b,T)},w.p="",w(w.s=12)}([function(j,w,P){!function(b,T){j.exports=w=T()}(0,function(){var b=b||function(T,C){var c=Object.create||function(){function f(){}return function(v){var m;return f.prototype=v,m=new f,f.prototype=null,m}}(),p={},d=p.lib={},o=d.Base=function(){return{extend:function(f){var v=c(this);return f&&v.mixIn(f),v.hasOwnProperty("init")&&this.init!==v.init||(v.init=function(){v.$super.init.apply(this,arguments)}),v.init.prototype=v,v.$super=this,v},create:function(){var f=this.extend();return f.init.apply(f,arguments),f},init:function(){},mixIn:function(f){for(var v in f)f.hasOwnProperty(v)&&(this[v]=f[v]);f.hasOwnProperty("toString")&&(this.toString=f.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),a=d.WordArray=o.extend({init:function(f,v){f=this.words=f||[],this.sigBytes=v!=null?v:4*f.length},toString:function(f){return(f||s).stringify(this)},concat:function(f){var v=this.words,m=f.words,E=this.sigBytes,_=f.sigBytes;if(this.clamp(),E%4)for(var g=0;g<_;g++){var y=m[g>>>2]>>>24-g%4*8&255;v[E+g>>>2]|=y<<24-(E+g)%4*8}else for(var g=0;g<_;g+=4)v[E+g>>>2]=m[g>>>2];return this.sigBytes+=_,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=[],E=0;E<f;E+=4){var _=function(g){var g=g,y=987654321,x=4294967295;return function(){y=36969*(65535&y)+(y>>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*_(),m.push(4294967296*_()|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;_<m;_++){var g=v[_>>>2]>>>24-_%4*8&255;E.push((g>>>4).toString(16)),E.push((15&g).toString(16))}return E.join("")},parse:function(f){for(var v=f.length,m=[],E=0;E<v;E+=2)m[E>>>3]|=parseInt(f.substr(E,2),16)<<24-E%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;_<m;_++){var g=v[_>>>2]>>>24-_%4*8&255;E.push(String.fromCharCode(g))}return E.join("")},parse:function(f){for(var v=f.length,m=[],E=0;E<v;E++)m[E>>>2]|=(255&f.charCodeAt(E))<<24-E%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,E=v.sigBytes,_=this.blockSize,g=4*_,y=E/g;y=f?T.ceil(y):T.max((0|y)-this._minBufferSize,0);var x=y*_,l=T.min(4*x,E);if(x){for(var S=0;S<x;S+=_)this._doProcessBlock(m,S);var O=m.splice(0,x);v.sigBytes-=l}return new a.init(O,l)},clone:function(){var f=o.clone.call(this);return f._data=this._data.clone(),f},_minBufferSize:0}),t=(d.Hasher=n.extend({cfg:o.extend(),init:function(f){this.cfg=this.cfg.extend(f),this.reset()},reset:function(){n.reset.call(this),this._doReset()},update:function(f){return this._append(f),this._process(),this},finalize:function(f){return f&&this._append(f),this._doFinalize()},blockSize:16,_createHelper:function(f){return function(v,m){return new f.init(m).finalize(v)}},_createHmacHelper:function(f){return function(v,m){return new t.HMAC.init(f,m).finalize(v)}}}),p.algo={});return p}(Math);return b})},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<d.length;o++){var a=d[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(p,a.key,a)}}return function(p,d,o){return d&&c(p.prototype,d),o&&c(p,o),p}}(),C=function(){function c(){b(this,c)}return T(c,null,[{key:"detectIEVersion",value:function(){for(var p=4,d=document.createElement("div"),o=d.getElementsByTagName("i");d.innerHTML="<!--[if gt IE "+p+"]><i></i><![endif]-->",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)+E+g;return(y<<_|y>>>32-_)+f}function c(t,f,v,m,E,_,g){var y=t+(f&m|v&~m)+E+g;return(y<<_|y>>>32-_)+f}function p(t,f,v,m,E,_,g){var y=t+(f^v^m)+E+g;return(y<<_|y>>>32-_)+f}function d(t,f,v,m,E,_,g){var y=t+(v^(f|~m))+E+g;return(y<<_|y>>>32-_)+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,E=t[m];t[m]=16711935&(E<<8|E>>>24)|4278255360&(E<<24|E>>>8)}var _=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=_[0],ee=_[1],ce=_[2],de=_[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]),_[0]=_[0]+Y|0,_[1]=_[1]+ee|0,_[2]=_[2]+ce|0,_[3]=_[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 E=T.floor(v/4294967296),_=v;f[15+(m+64>>>9<<4)]=16711935&(E<<8|E>>>24)|4278255360&(E<<24|E>>>8),f[14+(m+64>>>9<<4)]=16711935&(_<<8|_>>>24)|4278255360&(_<<24|_>>>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<f.length;v++){var m=f[v];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(t,m.key,m)}}return function(t,f,v){return f&&n(t.prototype,f),v&&n(t,v),t}}(),c=P(5),p=b(c),d=P(25),o=b(d),a=P(6),u=b(a),s=P(7),h=b(s),i=function(){function n(t){T(this,n);var f=h.default.os.name,v=h.default.os.version||"",m=h.default.browser.name,E=h.default.browser.version||"",_=window.location.href,g="";_&&(g=h.default.getHost(_));var y="pc";h.default.os.ipad?y="pad":(h.default.os.iphone||h.default.os.android)&&(y="phone"),this._ri=p.default.create(),this.initParam={APIVersion:"0.6.0",lv:"1",av:u.default.version,pd:"upload",sm:"upload",md:"uploader",uuid:n.getUuid(),os:f,ov:v,et:m,ev:E,uat:navigator.userAgent,app_n:g,tt:y,dm:"h5",ut:""}}return C(n,[{key:"log",value:function(t,f){f&&f.ri?(this._ri=f.ri,delete f.ri):this._ri=p.default.create(),f&&f.ut&&(this.initParam.ut=f.ut,delete f.ut),this.initParam.t=new Date().getTime(),this.initParam.ll=t=="20006"?"error":"info",this.initParam.ri=this._ri,this.initParam.e=t;var v=[];if(f)for(var m in f)v.push(m+"="+f[m]);var E=v.join("&");this.initParam.args=encodeURIComponent(E==""?"0":E);var _=[];for(var m in this.initParam)_.push(m+"="+this.initParam[m]);var g=_.join("&");AliyunUpload&&AliyunUpload.__logTestCallback__?AliyunUpload.__logTestCallback__(g):new Image(0,0).src="https://videocloud.cn-hangzhou.log.aliyuncs.com/logstores/upload/track?"+g}}],[{key:"getUuid",value:function(){var t=o.default.get("p_h5_upload_u");return t||(t=p.default.create(),o.default.set("p_h5_upload_u",t,730)),t}},{key:"getClientId",value:function(){return o.default.get("p_h5_upload_clientId")}},{key:"setClientId",value:function(t){return t||(t=p.default.create()),o.default.set("p_h5_upload_clientId",t,730),t}}]),n}();w.default=i},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<d.length;o++){var a=d[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(p,a.key,a)}}return function(p,d,o){return d&&c(p.prototype,d),o&&c(p,o),p}}(),C=function(){function c(){b(this,c)}return T(c,null,[{key:"create",value:function(p,d){var o,a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),u=[];if(d=d||a.length,p)for(o=0;o<p;o++)u[o]=a[0|Math.random()*d];else{var s;for(u[8]=u[13]=u[18]=u[23]="-",u[14]="4",o=0;o<36;o++)u[o]||(s=0|16*Math.random(),u[o]=a[o==19?3&s|8:s])}return u.join("")}}]),c}();w.default=C},function(j,w,P){"use strict";Object.defineProperty(w,"__esModule",{value:!0});var b={version:"1.5.0"};w.default=b},function(j,w,P){"use strict";function b(a,u){if(!(a instanceof u))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(w,"__esModule",{value:!0});var T=function(){function a(u,s){for(var h=0;h<s.length;h++){var i=s[h];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(u,i.key,i)}}return function(u,s,h){return s&&a(u.prototype,s),h&&a(u,h),u}}(),C=function(a){var u=navigator.userAgent,s="other";if(a.ios)return"iOS";if(a.android)return"android";if(u.indexOf("Baiduspider")>-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_]+)/),E=s.match(/(webOS|hpwOS)[\s\/]([\d.]+)/),_=/Win\d{2}|Windows/.test(h),g=s.match(/Windows Phone ([\d.]+)/),y=E&&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]),E&&(a.webos=!0,a.version=E[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||_||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||E||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":_?(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;o<d.length;o++){var a=d[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(p,a.key,a)}}return function(p,d,o){return d&&c(p.prototype,d),o&&c(p,o),p}}(),C=function(){function c(){b(this,c)}return T(c,null,[{key:"get",value:function(p,d,o,a,u){var s;o=o||function(){},typeof XMLHttpRequest=="undefined"&&(window.XMLHttpRequest=function(){try{return new window.ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(h){}try{return new window.ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(h){}try{return new window.ActiveXObject("Msxml2.XMLHTTP")}catch(h){}throw new Error("This browser does not support XMLHttpRequest.")}),s=new XMLHttpRequest,s.onreadystatechange=function(){s.readyState===4&&(s.status===200?d(s.responseText):o(s.responseText))};try{a===void 0&&(a=!0),s.open("GET",p,a),u&&(s.withCredentials=!0)}catch(h){return void o(h)}try{s.send()}catch(h){o(h)}}}]),c}();w.default=C},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<a.length;u++){var s=a[u];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(o,s.key,s)}}return function(o,a,u){return a&&d(o.prototype,a),u&&d(o,u),o}}(),C=P(27),c=P(30),p=(P(10),function(){function d(){b(this,d)}return T(d,null,[{key:"randomUUID",value:function(){for(var o=[],a="0123456789abcdef",u=0;u<36;u++)o[u]=a.substr(Math.floor(16*Math.random()),1);return o[14]="4",o[19]=a.substr(3&o[19]|8,1),o[8]=o[13]=o[18]=o[23]="-",o.join("")}},{key:"aliyunEncodeURI",value:function(o){var a=encodeURIComponent(o);return a=a.replace(/\+/g,"%20").replace(/\*/g,"%2A").replace(/%7E/g,"~").replace(/!/g,"%21").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/'/g,"%27")}},{key:"makeUTF8sort",value:function(o,a,u){if(!o)throw new Error("PrismPlayer Error: vid should not be null!");var s=[];for(var h in o)s.push(h);for(var i=s.sort(),n="",t=i.length,h=0;h<t;h++){var f=d.aliyunEncodeURI(i[h]),v=d.aliyunEncodeURI(o[i[h]]);n==""?n=f+a+v:n+=u+f+a+v}return n}},{key:"makeChangeSiga",value:function(o,a){if(!o)throw new Error("PrismPlayer Error: vid should not be null!");return c.stringify(C("GET&"+d.aliyunEncodeURI("/")+"&"+d.aliyunEncodeURI(d.makeUTF8sort(o,"=","&")),a+"&"))}}]),d}());w.default=p},function(j,w,P){!function(b,T){j.exports=w=T(P(0))}(0,function(b){return b.enc.Utf8})},function(j,w,P){!function(b,T){j.exports=w=T(P(0))}(0,function(b){return b.enc.Hex})},function(j,w,P){j.exports=P(13)},function(j,w,P){"use strict";var b,T,C=(typeof Symbol=="function"&&Symbol.iterator,P(14)),c=function(d){return d&&d.__esModule?d:{default:d}}(C),p={Vod:c.default};b=[],(T=function(){return p}.apply(w,b))!==void 0&&(j.exports=T),window.AliyunUpload=p,et.exports=AliyunUpload},function(j,w,P){"use strict";function b(O){return O&&O.__esModule?O:{default:O}}function T(O,A){if(!(O instanceof A))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(w,"__esModule",{value:!0});var C=function(){function O(A,D){for(var I=0;I<D.length;I++){var B=D[I];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}return function(A,D,I){return D&&O(A.prototype,D),I&&O(A,I),A}}(),c=P(15),p=P(3),d=P(16),o=b(d),a=P(18),u=b(a),s=P(24),h=b(s),i=P(4),n=b(i),t=P(1),f=b(t),v=P(5),m=b(v),E=P(26),_=b(E),g=P(31),y=b(g),x=P(32),l=b(x),S=(P(2),function(){function O(A){T(this,O),this.options=A,this.options.partSize=this.options.partSize||p.UPLOADDEFAULT.PARTSIZE,this.options.parallel=this.options.parallel||p.UPLOADDEFAULT.PARALLEL,this.options.region=this.options.region||"cn-shanghai",this.options.cname=this.options.cname||!1,this.options.localCheckpoint=this.options.localCheckpoint||!1,this.options.enableUploadProgress===void 0&&(this.options.enableUploadProgress=!0),this._ossCreditor=new Object,this._state=c.VODSTATE.INIT,this._uploadList=[],this._curIndex=-1,this._ossUpload=null,this._log=new n.default,this._retryCount=0,this._retryTotal=this.options.retryCount||3,this._retryDuration=this.options.retryDuration||2,this._state=c.VODSTATE.INIT,this._uploadWay="vod",this._onbeforeunload=!1,this._invalidUserId=!1,this._initEvent()}return C(O,[{key:"init",value:function(A,D,I,B){return this._retryCount=0,!(I&&!B||!I&&B)&&!(A&&!D||!A&&D)&&(this._ossCreditor.accessKeyId=A,this._ossCreditor.accessKeySecret=D,this._ossCreditor.securityToken=I,this._ossCreditor.expireTime=B,!0)}},{key:"addFile",value:function(A,D,I,B,H,te){if(!A)return!1;if(A.size==0)try{this.options.onUploadFailed({file:A},"EmptyFile","\u6587\u4EF6\u5927\u5C0F\u4E3A0\uFF0C\u4E0D\u80FD\u4E0A\u4F20")}catch(ne){console.log(ne)}for(var W=(this.options,0);W<this._uploadList.length;W++)if(this._uploadList[W].file==A)return!1;var V=new Object;if(V.file=A,V._endpoint=D,V._bucket=I,V._object=B,V.state=c.UPLOADSTATE.INIT,V.isImage=f.default.isImage(A.name),!V.isImage&&this.options.enableUploadProgress){var X=this;l.default.getMd5(A,function(ne){V.fileHash=ne;var Y=X._getCheckoutpoint(V);X.options.localCheckpoint||Y||X._getCheckoutpointFromCloud(V,function(ee){if(ee.UploadPoint){var ce=JSON.parse(ee.UploadPoint);ce.loaded!=1&&(V.checkpoint=ce.checkpoint,V.loaded=ce.loaded,V.videoId=ee.VideoId,X._saveCheckoutpoint(V,ce.checkpoint))}},function(ee){try{if((ee=JSON.parse(ee))&&ee.Code=="InvalidParameter"&&ee.Message.indexOf("UserId")>0){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;B<this._uploadList.length;B++)D.uploadList[B].state==c.UPLOADSTATE.SUCCESS&&I++,this._uploadList[B].state==A&&(D.uploadList.splice(B,1),B--);D.onClear&&D.onClear(D.uploadList.length,I)}},{key:"stopUpload",value:function(){if((this._state==c.VODSTATE.START||this._state==c.VODSTATE.FAILURE||this._curIndex==-1)&&this._curIndex!=-1){var A=this._uploadList[this._curIndex];this._state=c.VODSTATE.STOP,A.state=c.UPLOADSTATE.STOPED,this._changeState(A,c.UPLOADSTATE.STOPED),this._ossUpload.cancel()}}},{key:"resumeUploadWithAuth",value:function(A){var D=this;if(!A)return!1;var I=JSON.parse(u.default.decode(A));return!!(I.AccessKeyId&&I.AccessKeySecret&&I.SecurityToken&&I.Expiration)&&D.resumeUploadWithToken(I.AccessKeyId,I.AccessKeySecret,I.SecurityToken,I.Expiration)}},{key:"resumeUploadWithToken",value:function(A,D,I,B){if(this.options,!(A&&D&&I&&B))return!1;if(this._state!=c.VODSTATE.EXPIRE)return!1;if(this._curIndex==-1)return!1;var H="";return this._uploadList.length>this._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"),_.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"),_.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;D<this._uploadList.length;D++)if(this._uploadList[D].state==c.UPLOADSTATE.INIT){A=D;break}return A}},{key:"_error",value:function(A,D){if(D.name=="cancel")try{this.options.onUploadCanceled(A,D)}catch(B){console.log(B)}else{if(D.message.indexOf("InvalidAccessKeyIdError")>0||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;A<this._uploadList.length;A++){var D=this._uploadList[A];D.state!=c.UPLOADSTATE.FAIlURE&&D.state!=c.UPLOADSTATE.STOPED||(D.state=c.UPLOADSTATE.INIT)}this._state=c.VODSTATE.INIT}},{key:"_adjustPartSize",value:function(A){return A.file.size/this.options.partSize>1e4?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<s.length;h++){var i=s[h];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(u,i.key,i)}}return function(u,s,h){return s&&a(u.prototype,s),h&&a(u,h),u}}(),c=P(3),p=P(17),d=(b(p),P(1)),o=(b(d),function(){function a(u,s){if(T(this,a),u){this._config=u,this.create(this._config),this._uploadInfo=null,this._callback={};var h=function(){};this._callback.onerror=s.onerror||h,this._callback.oncomplete=s.oncomplete||h,this._callback.onprogress=s.onprogress||h}}return C(a,[{key:"create",value:function(u){if(u.endpoint=u.endpoint||this._config.endpoint,u.bucket=u.bucket||this._config.bucket,!(u.AccessKeyId&&u.AccessKeySecret&&u.endpoint&&u.SecurityToken))throw new Error("AccessKeyId\u3001AccessKeySecret\u3001endpoint should not be null");var s={accessKeyId:u.AccessKeyId,accessKeySecret:u.AccessKeySecret,stsToken:u.SecurityToken,endpoint:u.endpoint||this._config.endpoint,bucket:u.bucket||this._config.bucket,secure:!0,cname:u.cname};u.timeout&&(s.timeout=u.timeout),this.oss=new OSS.Wrapper(s)}},{key:"abort",value:function(u){if(u.checkpoint){var s=u.checkpoint.uploadId;this.oss.abortMultipartUpload(u.object,s)}}},{key:"getVersion",value:function(){}},{key:"cancel",value:function(){this.oss.cancel&&this.oss.cancel()}},{key:"upload",value:function(u,s){this._uploadInfo=u;var h=this,i=function(t,f,v){return function(m){h._progress(t,f,v),m()}},n={parallel:s.parallel||this._config.parallel||c.UPLOADDEFAULT.PARALLEL,partSize:s.partSize||this._config.partSize||c.UPLOADDEFAULT.PARTSIZE,progress:i};s.headers&&(n.headers=s.headers),u.checkpoint&&(n.checkpoint=u.checkpoint),u.bucket||(this.oss.options.bucket=u.bucket),u.endpoint||(this.oss.options.endpoint=u.endpoint),this.oss.multipartUpload(u.object,u.file,n).then(function(t,f){h._complete(t)}).catch(function(t){h.oss.cancel&&(h.oss&&h.oss.isCancel()?console.log("oss is cancel as error"):h.oss.cancel()),h._error(t)})}},{key:"header",value:function(u,s,h){this.oss.get(u.object).then(function(i){s(i)}).catch(function(i){h(i)})}},{key:"_progress",value:function(u,s,h){this._callback.onprogress(this._uploadInfo,{loaded:u,total:this._uploadInfo.file.size,checkpoint:s},h)}},{key:"_error",value:function(u){this._callback.onerror(this._uploadInfo,u)}},{key:"_complete",value:function(u){this._callback.oncomplete(this._uploadInfo,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;o<d.length;o++){var a=d[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(p,a.key,a)}}return function(p,d,o){return d&&c(p.prototype,d),o&&c(p,o),p}}(),C=function(){function c(){b(this,c)}return T(c,null,[{key:"format",value:function(p){if(arguments.length<2)return null;for(var d=arguments[1],o=1;o<arguments.length;o++){var a=new RegExp("\\{"+(o-1)+"\\}","gm");d=d.replace(a,arguments[o+1])}return{code:p,message:d}}},{key:"CODE",get:function(){return{SUCCESS:"Successful",EmptyValue:"InvalidParameter.EmptyValue",STSInvalid:"InvalidParameter.TokenInvalid",ReadFileError:"ReadFileError",FILEDUPLICATION:"FileDuplication",UploadALEADRYSTARTED:"UploadAlearyStarted"}}},{key:"MESSAGE",get:function(){return{SUCCESS:"Successful",EmptyValue:"\u53C2\u6570 {0} \u4E0D\u80FD\u4E3A\u7A7A\u3002",STSInvalid:"STS\u53C2\u6570\u975E\u6CD5\uFF0C accessKeyId\u3001accessKeySecret\u3001secretToken\u3001expireTime\u90FD\u4E0D\u80FD\u4E3A\u7A7A\u3002",ReadFileError:"\u8BFB\u53D6\u6587\u4EF6{0}{1}\u5931\u8D25.",FILEDUPLICATION:"\u6587\u4EF6\u91CD\u590D\u6DFB\u52A0 {0}",UploadALEADRYSTARTED:"\u91CD\u590D\u5F00\u59CB."}}}]),c}();w.default=C},function(j,w,P){"use strict";(function(b){function T(p,d){if(!(p instanceof d))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(w,"__esModule",{value:!0});var C=function(){function p(d,o){for(var a=0;a<o.length;a++){var u=o[a];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(d,u.key,u)}}return function(d,o,a){return o&&p(d.prototype,o),a&&p(d,a),d}}(),c=function(){function p(){T(this,p)}return C(p,null,[{key:"encode",value:function(d){return new b(d).toString("base64")}},{key:"decode",value:function(d){return new b(d,"base64").toString()}}]),p}();w.default=c}).call(w,P(19).Buffer)},function(j,w,P){"use strict";(function(b){function T(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function C(re,k){if(T()<k)throw new RangeError("Invalid typed array length");return c.TYPED_ARRAY_SUPPORT?(re=new Uint8Array(k),re.__proto__=c.prototype):(re===null&&(re=new c(k)),re.length=k),re}function c(re,k,U){if(!(c.TYPED_ARRAY_SUPPORT||this instanceof c))return new c(re,k,U);if(typeof re=="number"){if(typeof k=="string")throw new Error("If encoding is specified then the first argument must be a string");return a(this,re)}return p(this,re,k,U)}function p(re,k,U,q){if(typeof k=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer!="undefined"&&k instanceof ArrayBuffer?h(re,k,U,q):typeof k=="string"?u(re,k,U):i(re,k)}function d(re){if(typeof re!="number")throw new TypeError('"size" argument must be a number');if(re<0)throw new RangeError('"size" argument must not be negative')}function o(re,k,U,q){return d(k),k<=0?C(re,k):U!==void 0?typeof q=="string"?C(re,k).fill(U,q):C(re,k).fill(U):C(re,k)}function a(re,k){if(d(k),re=C(re,k<0?0:0|n(k)),!c.TYPED_ARRAY_SUPPORT)for(var U=0;U<k;++U)re[U]=0;return re}function u(re,k,U){if(typeof U=="string"&&U!==""||(U="utf8"),!c.isEncoding(U))throw new TypeError('"encoding" must be a valid string encoding');var q=0|f(k,U);re=C(re,q);var $=re.write(k,U);return $!==q&&(re=re.slice(0,$)),re}function s(re,k){var U=k.length<0?0:0|n(k.length);re=C(re,U);for(var q=0;q<U;q+=1)re[q]=255&k[q];return re}function h(re,k,U,q){if(k.byteLength,U<0||k.byteLength<U)throw new RangeError("'offset' is out of bounds");if(k.byteLength<U+(q||0))throw new RangeError("'length' is out of bounds");return k=U===void 0&&q===void 0?new Uint8Array(k):q===void 0?new Uint8Array(k,U):new Uint8Array(k,U,q),c.TYPED_ARRAY_SUPPORT?(re=k,re.__proto__=c.prototype):re=s(re,k),re}function i(re,k){if(c.isBuffer(k)){var U=0|n(k.length);return re=C(re,U),re.length===0||k.copy(re,0,0,U),re}if(k){if(typeof ArrayBuffer!="undefined"&&k.buffer instanceof ArrayBuffer||"length"in k)return typeof k.length!="number"||He(k.length)?C(re,0):s(re,k);if(k.type==="Buffer"&&We(k.data))return s(re,k.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function n(re){if(re>=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 E(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:_(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):_(re,[k],U,q,$);throw new TypeError("val must be string, number or Buffer")}function _(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;Ne<ke;Ne++)if(J(re,Ne)===J(k,je===-1?0:Ne-je)){if(je===-1&&(je=Ne),Ne-je+1===dt)return je*xe}else je!==-1&&(Ne-=Ne-je),je=-1}else for(U+dt>ke&&(U=ke-dt),Ne=U;Ne>=0;Ne--){for(var tt=!0,mt=0;mt<dt;mt++)if(J(re,Ne+mt)!==J(k,mt)){tt=!1;break}if(tt)return Ne}return-1}function g(re,k,U,q){U=Number(U)||0;var $=re.length-U;q?(q=Number(q))>$&&(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;xe<q;++xe){var ke=parseInt(k.substr(2*xe,2),16);if(isNaN(ke))return xe;re[U+xe]=ke}return xe}function y(re,k,U,q){return Fe(ye(k,re.length-U),re,U,q)}function x(re,k,U,q){return Fe(_e(k),re,U,q)}function l(re,k,U,q){return x(re,k,U,q)}function S(re,k,U,q){return Fe(Ue(k),re,U,q)}function O(re,k,U,q){return Fe(Ge(k,re.length-U),re,U,q)}function A(re,k,U){return k===0&&U===re.length?be.fromByteArray(re):be.fromByteArray(re.slice(k,U))}function D(re,k,U){U=Math.min(re.length,U);for(var q=[],$=k;$<U;){var J=re[$],xe=null,ke=J>239?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;q<k;)U+=String.fromCharCode.apply(String,re.slice(q,q+=ze));return U}function B(re,k,U){var q="";U=Math.min(re.length,U);for(var $=k;$<U;++$)q+=String.fromCharCode(127&re[$]);return q}function H(re,k,U){var q="";U=Math.min(re.length,U);for(var $=k;$<U;++$)q+=String.fromCharCode(re[$]);return q}function te(re,k,U){var q=re.length;(!k||k<0)&&(k=0),(!U||U<0||U>q)&&(U=q);for(var $="",J=k;J<U;++J)$+=Pe(re[J]);return $}function W(re,k,U){for(var q=re.slice(k,U),$="",J=0;J<q.length;J+=2)$+=String.fromCharCode(q[J]+256*q[J+1]);return $}function V(re,k,U){if(re%1!=0||re<0)throw new RangeError("offset is not uint");if(re+k>U)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>$||k<J)throw new RangeError('"value" argument is out of bounds');if(U+q>re.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);$<J;++$)re[U+$]=(k&255<<8*(q?$:1-$))>>>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);$<J;++$)re[U+$]=k>>>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;xe<q;++xe){if((U=re.charCodeAt(xe))>55295&&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 _e(re){for(var k=[],U=0;U<re.length;++U)k.push(255&re.charCodeAt(U));return k}function Ge(re,k){for(var U,q,$,J=[],xe=0;xe<re.length&&!((k-=2)<0);++xe)U=re.charCodeAt(xe),q=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;$<q&&!($+U>=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 <feross@feross.org> <http://feross.org>
|
|
|
* @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);$<J;++$)if(re[$]!==k[$]){U=re[$],q=k[$];break}return U<q?-1:q<U?1:0},c.isEncoding=function(re){switch(String(re).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(re,k){if(!We(re))throw new TypeError('"list" argument must be an Array of Buffers');if(re.length===0)return c.alloc(0);var U;if(k===void 0)for(k=0,U=0;U<re.length;++U)k+=re[U].length;var q=c.allocUnsafe(k),$=0;for(U=0;U<re.length;++U){var J=re[U];if(!c.isBuffer(J))throw new TypeError('"list" argument must be an Array of Buffers');J.copy(q,$),$+=J.length}return q},c.byteLength=f,c.prototype._isBuffer=!0,c.prototype.swap16=function(){var re=this.length;if(re%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var k=0;k<re;k+=2)m(this,k,k+1);return this},c.prototype.swap32=function(){var re=this.length;if(re%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var k=0;k<re;k+=4)m(this,k,k+3),m(this,k+1,k+2);return this},c.prototype.swap64=function(){var re=this.length;if(re%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var k=0;k<re;k+=8)m(this,k,k+7),m(this,k+1,k+6),m(this,k+2,k+5),m(this,k+3,k+4);return this},c.prototype.toString=function(){var re=0|this.length;return re===0?"":arguments.length===0?D(this,0,re):v.apply(this,arguments)},c.prototype.equals=function(re){if(!c.isBuffer(re))throw new TypeError("Argument must be a Buffer");return this===re||c.compare(this,re)===0},c.prototype.inspect=function(){var re="",k=w.INSPECT_MAX_BYTES;return this.length>0&&(re=this.toString("hex",0,k).match(/.{2}/g).join(" "),this.length>k&&(re+=" ... ")),"<Buffer "+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<ke;++je)if(dt[je]!==Ne[je]){J=dt[je],xe=Ne[je];break}return J<xe?-1:xe<J?1:0},c.prototype.includes=function(re,k,U){return this.indexOf(re,k,U)!==-1},c.prototype.indexOf=function(re,k,U){return E(this,re,k,U,!0)},c.prototype.lastIndexOf=function(re,k,U){return E(this,re,k,U,!1)},c.prototype.write=function(re,k,U,q){if(k===void 0)q="utf8",U=this.length,k=0;else if(U===void 0&&typeof k=="string")q=k,U=this.length,k=0;else{if(!isFinite(k))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");k|=0,isFinite(U)?(U|=0,q===void 0&&(q="utf8")):(q=U,U=void 0)}var $=this.length-k;if((U===void 0||U>$)&&(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),k<re&&(k=re);var q;if(c.TYPED_ARRAY_SUPPORT)q=this.subarray(re,k),q.__proto__=c.prototype;else{var $=k-re;q=new c($,void 0);for(var J=0;J<$;++J)q[J]=this[J+re]}return q},c.prototype.readUIntLE=function(re,k,U){re|=0,k|=0,U||V(re,k,this.length);for(var q=this[re],$=1,J=0;++J<k&&($*=256);)q+=this[re+J]*$;return q},c.prototype.readUIntBE=function(re,k,U){re|=0,k|=0,U||V(re,k,this.length);for(var q=this[re+--k],$=1;k>0&&($*=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<k&&($*=256);)q+=this[re+J]*$;return $*=128,q>=$&&(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<U&&($*=256);)this[k+J]=re/$&255;return k+U},c.prototype.writeUIntBE=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 $=U-1,J=1;for(this[k+$]=255&re;--$>=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<U&&(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.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<U&&(q=U),q===U)return 0;if(re.length===0||this.length===0)return 0;if(k<0)throw new RangeError("targetStart out of bounds");if(U<0||U>=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<q-U&&(q=re.length-k+U);var $,J=q-U;if(this===re&&U<k&&k<q)for($=J-1;$>=0;--$)re[$+k]=this[$+U];else if(J<1e3||!c.TYPED_ARRAY_SUPPORT)for($=0;$<J;++$)re[$+k]=this[$+U];else Uint8Array.prototype.set.call(re,this.subarray(U,U+J),k);return J},c.prototype.fill=function(re,k,U,q){if(typeof re=="string"){if(typeof k=="string"?(q=k,k=0,U=this.length):typeof U=="string"&&(q=U,U=this.length),re.length===1){var $=re.charCodeAt(0);$<256&&(re=$)}if(q!==void 0&&typeof q!="string")throw new TypeError("encoding must be a string");if(typeof q=="string"&&!c.isEncoding(q))throw new TypeError("Unknown encoding: "+q)}else typeof re=="number"&&(re&=255);if(k<0||this.length<k||this.length<U)throw new RangeError("Out of range index");if(U<=k)return this;k>>>=0,U=U===void 0?this.length:U>>>0,re||(re=0);var J;if(typeof re=="number")for(J=k;J<U;++J)this[J]=re;else{var xe=c.isBuffer(re)?re:ye(new c(re,q).toString()),ke=xe.length;for(J=0;J<U-k;++J)this[J+k]=xe[J%ke]}return this};var nt=/[^+\/0-9A-Za-z-_]/g}).call(w,P(20))},function(j,w){var P;P=function(){return this}();try{P=P||Function("return this")()||(0,eval)("this")}catch(b){typeof window=="object"&&(P=window)}j.exports=P},function(j,w,P){"use strict";function b(n){var t=n.length;if(t%4>0)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),E=new u(3*_/4-m),f=m>0?_-4:_;var g=0;for(t=0;t<f;t+=4)v=a[n.charCodeAt(t)]<<18|a[n.charCodeAt(t+1)]<<12|a[n.charCodeAt(t+2)]<<6|a[n.charCodeAt(t+3)],E[g++]=v>>16&255,E[g++]=v>>8&255,E[g++]=255&v;return m===2?(v=a[n.charCodeAt(t)]<<2|a[n.charCodeAt(t+1)]>>4,E[g++]=255&v):m===1&&(v=a[n.charCodeAt(t)]<<10|a[n.charCodeAt(t+1)]<<4|a[n.charCodeAt(t+2)]>>2,E[g++]=v>>8&255,E[g++]=255&v),E}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=[],E=t;E<f;E+=3)v=(n[E]<<16)+(n[E+1]<<8)+n[E+2],m.push(c(v));return m.join("")}function d(n){for(var t,f=n.length,v=f%3,m="",E=[],_=0,g=f-v;_<g;_+=16383)E.push(p(n,_,_+16383>g?g:_+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+="="),E.push(m),E.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<i;++h)o[h]=s[h],a[s.charCodeAt(h)]=h;a["-".charCodeAt(0)]=62,a["_".charCodeAt(0)]=63},function(j,w){w.read=function(P,b,T,C,c){var p,d,o=8*c-C-1,a=(1<<o)-1,u=a>>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<<u)-1,h=s>>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<<c|o,u+=c;u>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<d.length;o++){var a=d[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(p,a.key,a)}}return function(p,d,o){return d&&c(p.prototype,d),o&&c(p,o),p}}(),C=function(){function c(){b(this,c)}return T(c,null,[{key:"set",value:function(p,d){try{window.localStorage&&localStorage.setItem(p,d)}catch(o){window[p+"_localStorage"]=d}}},{key:"get",value:function(p){try{if(window.localStorage)return localStorage.getItem(p)}catch(d){return window[p+"_localStorage"]}return""}},{key:"remove",value:function(p){try{window.localStorage&&localStorage.removeItem(p)}catch(d){delete window[p+"_localStorage"]}}}]),c}();w.default=C},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<d.length;o++){var a=d[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(p,a.key,a)}}return function(p,d,o){return d&&c(p.prototype,d),o&&c(p,o),p}}(),C=function(){function c(){b(this,c)}return T(c,null,[{key:"get",value:function(p){for(var d=p+"",o=document.cookie.split(";"),a=0;a<o.length;a++){var u=o[a].trim();if(u.indexOf(d)==0)return unescape(u.substring(d.length+1,u.length))}return""}},{key:"set",value:function(p,d,o){var a=new Date;a.setTime(a.getTime()+24*o*60*60*1e3);var u="expires="+a.toGMTString();document.cookie=p+"="+escape(d)+"; "+u}}]),c}();w.default=C},function(j,w,P){"use strict";function b(u){return u&&u.__esModule?u:{default:u}}function T(u,s){if(!(u instanceof s))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(w,"__esModule",{value:!0});var C=function(){function u(s,h){for(var i=0;i<h.length;i++){var n=h[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(s,n.key,n)}}return function(s,h,i){return h&&u(s.prototype,h),i&&u(s,i),s}}(),c=P(8),p=b(c),d=P(9),o=b(d),a=function(){function u(){T(this,u)}return C(u,null,[{key:"refreshUploadAuth",value:function(s,h,i){var n=(o.default.randomUUID(),o.default.randomUUID()),t={AccessKeyId:s.accessKeyId,SecurityToken:s.securityToken,Action:"RefreshUploadVideo",VideoId:s.videoId,Version:"2017-03-21",Format:"JSON",SignatureMethod:"HMAC-SHA1",SignatureVersion:"1.0",SignatureNonce:n,RequestId:s.requestId},f=o.default.makeUTF8sort(t,"=","&")+"&Signature="+o.default.aliyunEncodeURI(o.default.makeChangeSiga(t,s.accessKeySecret)),v="https://vod."+s.region+".aliyuncs.com/?"+f;p.default.get(v,function(m){var m=JSON.parse(m);h&&h(m)},function(m){if(i){var E=JSON.parse(m);i(E)}})}},{key:"getUploadAuth",value:function(s,h,i){var n=(o.default.randomUUID(),o.default.randomUUID()),t={AccessKeyId:s.accessKeyId,SecurityToken:s.securityToken,Action:"CreateUploadVideo",Title:s.title,FileName:s.fileName,Version:"2017-03-21",Format:"JSON",SignatureMethod:"HMAC-SHA1",SignatureVersion:"1.0",SignatureNonce:n,RequestId:s.requestId};s.fileSize&&(t.FileSize=s.fileSize),s.description&&(t.Description=s.description),s.cateId&&(t.CateId=s.cateId),s.tags&&(t.Tags=s.tags),s.templateGroupId&&(t.TemplateGroupId=s.templateGroupId),s.storageLocation&&(t.StorageLocation=s.storageLocation),s.coverUrl&&(t.CoverURL=s.coverUrl),s.transCodeMode&&(t.TransCodeMode=s.transCodeMode),s.userData&&(t.UserData=JSON.stringify(s.userData));var f=o.default.makeUTF8sort(t,"=","&")+"&Signature="+o.default.aliyunEncodeURI(o.default.makeChangeSiga(t,s.accessKeySecret)),v="https://vod."+s.region+".aliyuncs.com/?"+f;p.default.get(v,function(m){try{m=JSON.parse(m)}catch(E){if(i)return void i({Code:"GetUploadAuthFailed",Message:"\u83B7\u53D6uploadauth\u5931\u8D25"})}h&&h(m)},function(m){if(i){var E={Code:"GetUploadAuthFailed",Message:"\u83B7\u53D6uploadauth\u5931\u8D25"};try{E=JSON.parse(m)}catch(_){}i(E)}})}},{key:"getImageUploadAuth",value:function(s,h,i){var n=(o.default.randomUUID(),o.default.randomUUID()),t={AccessKeyId:s.accessKeyId,SecurityToken:s.securityToken,Action:"CreateUploadImage",ImageType:s.imageType?s.imageType:"default",Version:"2017-03-21",Format:"JSON",SignatureMethod:"HMAC-SHA1",SignatureVersion:"1.0",SignatureNonce:n,RequestId:s.requestId};s.title&&(t.Title=s.title),s.imageExt&&(t.ImageExt=s.imageExt),s.tags&&(t.Tags=s.tags),s.storageLocation&&(t.StorageLocation=s.storageLocation);var f=o.default.makeUTF8sort(t,"=","&")+"&Signature="+o.default.aliyunEncodeURI(o.default.makeChangeSiga(t,s.accessKeySecret)),v="https://vod."+s.region+".aliyuncs.com/?"+f;p.default.get(v,function(m){m=JSON.parse(m),h&&h(m)},function(m){if(i){var E=JSON.parse(m);i(E)}})}}]),u}();w.default=a},function(j,w,P){!function(b,T,C){j.exports=w=T(P(0),P(28),P(29))}(0,function(b){return b.HmacSHA1})},function(j,w,P){!function(b,T){j.exports=w=T(P(0))}(0,function(b){return function(){var T=b,C=T.lib,c=C.WordArray,p=C.Hasher,d=T.algo,o=[],a=d.SHA1=p.extend({_doReset:function(){this._hash=new c.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(u,s){for(var h=this._hash.words,i=h[0],n=h[1],t=h[2],f=h[3],v=h[4],m=0;m<80;m++){if(m<16)o[m]=0|u[s+m];else{var E=o[m-3]^o[m-8]^o[m-14]^o[m-16];o[m]=E<<1|E>>>31}var _=(i<<5|i>>>27)+v+o[m];_+=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=_}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<s;v++)t[v]^=1549556828,f[v]^=909522486;i.sigBytes=n.sigBytes=h,this.reset()},reset:function(){var a=this._hasher;a.reset(),a.update(this._iKey)},update:function(a){return this._hasher.update(a),this},finalize:function(a){var u=this._hasher,s=u.finalize(a);return u.reset(),u.finalize(this._oKey.clone().concat(s))}})}()})},function(j,w,P){!function(b,T){j.exports=w=T(P(0))}(0,function(b){return function(){function T(o,a,u){for(var s=[],h=0,i=0;i<a;i++)if(i%4){var n=u[o.charCodeAt(i-1)]<<i%4*2,t=u[o.charCodeAt(i)]>>>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<u;i+=3)for(var n=a[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<u;m++)h.push(s.charAt(v>>>6*(3-m)&63));var E=s.charAt(64);if(E)for(;h.length%4;)h.push(E);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;h<u.length;h++)s[u.charCodeAt(h)]=h}var i=u.charAt(64);if(i){var n=o.indexOf(i);n!==-1&&(a=n)}return T(o,a,s)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),b.enc.Base64})},function(j,w,P){"use strict";function b(g){return g&&g.__esModule?g:{default:g}}function T(g,y){if(!(g instanceof y))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(w,"__esModule",{value:!0});var C=function(){function g(y,x){for(var l=0;l<x.length;l++){var S=x[l];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(y,S.key,S)}}return function(y,x,l){return x&&g(y.prototype,x),l&&g(y,l),y}}(),c=P(8),p=b(c),d=P(7),o=b(d),a=P(4),u=b(a),s=P(6),h=b(s),i=P(1),n=b(i),t=P(9),f=b(t),v=P(2),m=P(11),E=P(10),_=function(){function g(){T(this,g)}return C(g,null,[{key:"getAuthInfo",value:function(y,x,l){var S=y+"|f#Ylm&^1TppeRhLg|"+l;return x&&(S=y+"|"+x+"|f#Ylm&^1TppeRhLg|"+l),v(E.parse(S)).toString(m)}},{key:"upload",value:function(y,x,l){var S=n.default.ISODateString(new Date),O=Math.floor(new Date().valueOf()/1e3),A=u.default.getClientId();A=u.default.setClientId(A);var D=g.getAuthInfo(y.userId,A,O),I=f.default.randomUUID(),B={Source:"WebSDK",BusinessType:"UploadVideo",Action:"ReportUploadProgress",TerminalType:"H5",DeviceModel:o.default.browser.name+(o.default.browser.version||""),AppVersion:h.default.version,AuthTimestamp:O,Timestamp:S,AuthInfo:D,FileName:y.file.name,FileSize:y.file.size,FileCreateTime:y.file.lastModified,FileHash:y.fileHash,UploadId:y.checkpoint.checkpoint.uploadId,PartSize:y.checkpoint.checkpoint.partSize,DonePartsCount:y.checkpoint.checkpoint.doneParts.length,UploadPoint:JSON.stringify(y.checkpoint),UploadRatio:y.checkpoint.loaded,UserId:y.userId,VideoId:y.videoId,Version:"2017-03-21",Format:"JSON",SignatureMethod:"HMAC-SHA1",SignatureVersion:"1.0",SignatureNonce:I};A&&(B.ClientId=A);var H=f.default.makeUTF8sort(B,"=","&")+"&Signature="+f.default.aliyunEncodeURI(f.default.makeChangeSiga(B,y.accessKeySecret)),te="https://vod."+y.region+".aliyuncs.com/?"+H;p.default.get(te,function(W){x&&x()},function(W){W&&(l(W),console.log(W))})}},{key:"get",value:function(y,x,l){var S=n.default.ISODateString(new Date),O=Math.floor(new Date().valueOf()/1e3),A=u.default.getClientId(),D=g.getAuthInfo(y.userId,A,O),I=f.default.randomUUID(),B={Source:"WebSDK",BusinessType:"UploadVideo",Action:"GetUploadProgress",TerminalType:"H5",DeviceModel:o.default.browser.name+(o.default.browser.version||""),AppVersion:h.default.version,AuthTimestamp:O,Timestamp:S,AuthInfo:D,UserId:y.userId,UploadInfoList:JSON.stringify(y.uploadInfoList),Version:"2017-03-21",Format:"JSON",SignatureMethod:"HMAC-SHA1",SignatureVersion:"1.0",SignatureNonce:I};A&&(B.ClientId=A);var H=f.default.makeUTF8sort(B,"=","&")+"&Signature="+f.default.aliyunEncodeURI(f.default.makeChangeSiga(B,y.accessKeySecret)),te="https://vod."+y.region+".aliyuncs.com/?"+H;p.default.get(te,function(W){var V={},X=A;W=W?JSON.parse(W):{},W.UploadProgress&&W.UploadProgress.UploadProgressList&&W.UploadProgress.UploadProgressList.length>0&&(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=_},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<a.length;u++){var s=a[u];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(o,s.key,s)}}return function(o,a,u){return a&&d(o.prototype,a),u&&d(o,u),o}}(),C=P(2),c=P(33),p=(P(11),function(){function d(){b(this,d)}return T(d,null,[{key:"getMd5",value:function(o,a,u){var s=new FileReader;s.onload=function(n){try{if(n&&n.target){var t=C(c.parse(n.target.result)),f=t.toString();a(f)}}catch(v){console.log(v)}},s.onerror=function(n){console.log(n),errorCallback(n)};var h=File.prototype.slice||File.prototype.mozSlice||File.prototype.webkitSlice,i=h.call(o,0,1024);s.readAsBinaryString(i)}}]),d}());w.default=p},function(j,w,P){!function(b,T){j.exports=w=T(P(0))}(0,function(b){return b.enc.Latin1})}])}).call(this,z("IyRk"))},ps8w:function(et,Ve,z){et.exports=z.p+"static/show.6268a056.svg"},"rAM+":function(et,Ve,z){"use strict";z.d(Ve,"a",function(){return Q});var le=z("Qw5x");function Q(j,w){var P;if(typeof Symbol=="undefined"||j[Symbol.iterator]==null){if(Array.isArray(j)||(P=Object(le.a)(j))||w&&j&&typeof j.length=="number"){P&&(j=P);var b=0,T=function(){};return{s:T,n:function(){return b>=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(E){return Object.getOwnPropertyDescriptor(t,E).enumerable})),v.push.apply(v,m)}return v}function b(t){for(var f=1;f<arguments.length;f++){var v=arguments[f]!=null?arguments[f]:{};f%2?P(v,!0).forEach(function(m){i(t,m,v[m])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(v)):P(v).forEach(function(m){Object.defineProperty(t,m,Object.getOwnPropertyDescriptor(v,m))})}return t}function T(t,f){if(t==null)return{};var v=C(t,f),m,E;if(Object.getOwnPropertySymbols){var _=Object.getOwnPropertySymbols(t);for(E=0;E<_.length;E++){if(m=_[E],f.indexOf(m)>=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(_=0;_<m.length;_++){if(E=m[_],f.indexOf(E)>=0)continue;v[E]=t[E]}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<f.length;v++){var m=f[v];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(t,m.key,m)}}function d(t,f,v){return f&&p(t.prototype,f),v&&p(t,v),t}function o(t,f){return f&&(w(f)==="object"||typeof f=="function")?f:u(t)}function a(t){return a=Object.setPrototypeOf?Object.getPrototypeOf:function(v){return v.__proto__||Object.getPrototypeOf(v)},a(t)}function u(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function s(t,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(f&&f.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),f&&h(t,f)}function h(t,f){return h=Object.setPrototypeOf||function(m,E){return m.__proto__=E,m},h(t,f)}function i(t,f,v){return f in t?Object.defineProperty(t,f,{value:v,enumerable:!0,configurable:!0,writable:!0}):t[f]=v,t}var n=function(t){s(f,t);function f(){var v,m;c(this,f);for(var E=arguments.length,_=new Array(E),g=0;g<E;g++)_[g]=arguments[g];return m=o(this,(v=a(f)).call.apply(v,[this].concat(_))),i(u(m),"onClick",function(y){var x=m.props,l=x.text,S=x.onCopy,O=x.children,A=x.options,D=le.default.Children.only(O),I=(0,Q.default)(l,A);S&&S(l,I),D&&D.props&&typeof D.props.onClick=="function"&&D.props.onClick(y)}),m}return d(f,[{key:"render",value:function(){var m=this.props,E=m.text,_=m.onCopy,g=m.options,y=m.children,x=T(m,["text","onCopy","options","children"]),l=le.default.Children.only(y);return le.default.cloneElement(l,b({},x,{onClick:this.onClick}))}}]),f}(le.default.PureComponent);Ve.CopyToClipboard=n,i(n,"defaultProps",{onCopy:void 0,options:void 0})},rUJ1:function(et,Ve){const z=/[&<>"']/,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<arguments.length;y++){x=arguments[y];for(l in x)Object.prototype.hasOwnProperty.call(x,l)&&(g[l]=x[l])}return g}function v(g,y){const x=g.replace(/\|/g,(O,A,D)=>{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<y;)l.push("");for(;S<l.length;S++)l[S]=l[S].trim().replace(/\\\|/g,"|");return l}function m(g,y,x){const l=g.length;if(l===0)return"";let S=0;for(;S<l;){const O=g.charAt(l-S-1);if(O===y&&!x)S++;else if(O!==y&&x)S++;else break}return g.substr(0,l-S)}function E(g,y){if(g.indexOf(y[1])===-1)return-1;const x=g.length;let l=0,S=0;for(;S<x;S++)if(g[S]==="\\")S++;else if(g[S]===y[0])l++;else if(g[S]===y[1]&&(l--,l<0))return S;return-1}function _(g){g&&g.sanitize&&!g.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}et.exports={escape:b,unescape:C,edit:p,cleanUrl:a,resolveUrl:n,noopTest:t,merge:f,splitCells:v,rtrim:m,findClosingBracket:E,checkSanitizeDeprecation:_}},rcnY:function(et,Ve,z){var le=z("aRTE");function Q(j,w){this.totalCount=j,this.dataCount=w}Q.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],Q.getRSBlocks=function(j,w){var P=Q.getRsBlockTable(j,w);if(P==null)throw new Error("bad rs block @ typeNumber:"+j+"/errorCorrectLevel:"+w);for(var b=P.length/3,T=new Array,C=0;C<b;C++)for(var c=P[C*3+0],p=P[C*3+1],d=P[C*3+2],o=0;o<c;o++)T.push(new Q(p,d));return T},Q.getRsBlockTable=function(j,w){switch(w){case le.L:return Q.RS_BLOCK_TABLE[(j-1)*4+0];case le.M:return Q.RS_BLOCK_TABLE[(j-1)*4+1];case le.Q:return Q.RS_BLOCK_TABLE[(j-1)*4+2];case le.H:return Q.RS_BLOCK_TABLE[(j-1)*4+3];default:return}},et.exports=Q},rdUC:function(et,Ve,z){var le=z("MFOe"),Q=le.Global;et.exports={name:"localStorage",read:w,write:P,each:b,remove:T,clearAll:C};function j(){return Q.localStorage}function w(c){return j().getItem(c)}function P(c,p){return j().setItem(c,p)}function b(c){for(var p=j().length-1;p>=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;o<p.length;o+=1){if(!d)return null;var a=p[o];d=d[a]}return d}function P(C){var c=[],p={};return C.forEach(function(d){for(var o=d||{},a=o.key,u=o.dataIndex,s=a||j(u).join("-")||Q;p[s];)s="".concat(s,"_next");p[s]=!0,c.push(s)}),c}function b(){var C={};function c(a,u){u&&Object.keys(u).forEach(function(s){var h=u[s];h&&Object(le.a)(h)==="object"?(a[s]=a[s]||{},c(a[s],h)):a[s]=h})}for(var p=arguments.length,d=new Array(p),o=0;o<p;o++)d[o]=arguments[o];return d.forEach(function(a){c(C,a)}),C}function T(C){return C!=null}},sboe:function(et,Ve,z){"use strict";z.d(Ve,"a",function(){return j});var le=z("q1tI"),Q=z.n(le),j=le.createContext(null)},"t/PP":function(et,Ve,z){et.exports=z.p+"static/title.dd3b799f.svg"},t23M:function(et,Ve,z){"use strict";var le=z("VTBJ"),Q=z("1OyB"),j=z("vuIU"),w=z("Ji7U"),P=z("LK+K"),b=z("q1tI"),T=z.n(b),C=z("m+aA"),c=z("Zm9Q"),p=z("Kwbf"),d=z("c+Xe"),o=z("bdgK"),a="rc-observer-key",u=function(s){Object(w.a)(i,s);var h=Object(P.a)(i);function i(){var n;return Object(Q.a)(this,i),n=h.apply(this,arguments),n.resizeObserver=null,n.childNode=null,n.currentElement=null,n.state={width:0,height:0,offsetHeight:0,offsetWidth:0},n.onResize=function(t){var f=n.props.onResize,v=t[0].target,m=v.getBoundingClientRect(),E=m.width,_=m.height,g=v.offsetWidth,y=v.offsetHeight,x=Math.floor(E),l=Math.floor(_);if(n.state.width!==x||n.state.height!==l||n.state.offsetWidth!==g||n.state.offsetHeight!==y){var S={width:x,height:l,offsetWidth:g,offsetHeight:y};n.setState(S),f&&Promise.resolve().then(function(){f(Object(le.a)(Object(le.a)({},S),{},{offsetWidth:g,offsetHeight:y}))})}},n.setChildNode=function(t){n.childNode=t},n}return Object(j.a)(i,[{key:"componentDidMount",value:function(){this.onComponentUpdated()}},{key:"componentDidUpdate",value:function(){this.onComponentUpdated()}},{key:"componentWillUnmount",value:function(){this.destroyObserver()}},{key:"onComponentUpdated",value:function(){var t=this.props.disabled;if(t){this.destroyObserver();return}var f=Object(C.a)(this.childNode||this),v=f!==this.currentElement;v&&(this.destroyObserver(),this.currentElement=f),!this.resizeObserver&&f&&(this.resizeObserver=new o.default(this.onResize),this.resizeObserver.observe(f))}},{key:"destroyObserver",value:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"render",value:function(){var t=this.props.children,f=Object(c.a)(t);if(f.length>1)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(E)||"key"in E&&E.key!==null?E:b.cloneElement(E,{key:"".concat(a,"-").concat(_)})})}}]),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);s<h;s++)i[s]=u[s].fn;return i},p.prototype.listenerCount=function(o){var a=P?P+o:o,u=this._events[a];return u?u.fn?1:u.length:0},p.prototype.emit=function(o,a,u,s,h,i){var n=P?P+o:o;if(!this._events[n])return!1;var t=this._events[n],f=arguments.length,v,m;if(t.fn){t.once&&this.removeListener(o,t.fn,void 0,!0);switch(f){case 1:return t.fn.call(t.context),!0;case 2:return t.fn.call(t.context,a),!0;case 3:return t.fn.call(t.context,a,u),!0;case 4:return t.fn.call(t.context,a,u,s),!0;case 5:return t.fn.call(t.context,a,u,s,h),!0;case 6:return t.fn.call(t.context,a,u,s,h,i),!0}for(m=1,v=new Array(f-1);m<f;m++)v[m-1]=arguments[m];t.fn.apply(t.context,v)}else{var E=t.length,_;for(m=0;m<E;m++){t[m].once&&this.removeListener(o,t[m].fn,void 0,!0);switch(f){case 1:t[m].fn.call(t[m].context);break;case 2:t[m].fn.call(t[m].context,a);break;case 3:t[m].fn.call(t[m].context,a,u);break;case 4:t[m].fn.call(t[m].context,a,u,s);break;default:if(!v)for(_=1,v=new Array(f-1);_<f;_++)v[_-1]=arguments[_];t[m].fn.apply(t[m].context,v)}}}return!0},p.prototype.on=function(o,a,u){return C(this,o,a,u,!1)},p.prototype.once=function(o,a,u){return C(this,o,a,u,!0)},p.prototype.removeListener=function(o,a,u,s){var h=P?P+o:o;if(!this._events[h])return this;if(!a)return c(this,h),this;var i=this._events[h];if(i.fn)i.fn===a&&(!s||i.once)&&(!u||i.context===u)&&c(this,h);else{for(var n=0,t=[],f=i.length;n<f;n++)(i[n].fn!==a||s&&!i[n].once||u&&i[n].context!==u)&&t.push(i[n]);t.length?this._events[h]=t.length===1?t[0]:t:c(this,h)}return this},p.prototype.removeAllListeners=function(o){var a;return o?(a=P?P+o:o,this._events[a]&&c(this,a)):(this._events=new b,this._eventsCount=0),this},p.prototype.off=p.prototype.removeListener,p.prototype.addListener=p.prototype.on,p.prefixed=P,p.EventEmitter=p,le.exports=p},"./node_modules/url-toolkit/src/url-toolkit.js":function(le,Q,j){(function(w){var P=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,b=/^([^\/?#]*)([^]*)$/,T=/(?:\/|^)\.(?=\/)/g,C=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,c={buildAbsoluteURL:function(p,d,o){if(o=o||{},p=p.trim(),d=d.trim(),!d){if(!o.alwaysNormalize)return p;var a=c.parseURL(p);if(!a)throw new Error("Error trying to parse base URL.");return a.path=c.normalizePath(a.path),c.buildURLFromParts(a)}var u=c.parseURL(d);if(!u)throw new Error("Error trying to parse relative URL.");if(u.scheme)return o.alwaysNormalize?(u.path=c.normalizePath(u.path),c.buildURLFromParts(u)):d;var s=c.parseURL(p);if(!s)throw new Error("Error trying to parse base URL.");if(!s.netLoc&&s.path&&s.path[0]!=="/"){var h=b.exec(s.path);s.netLoc=h[1],s.path=h[2]}s.netLoc&&!s.path&&(s.path="/");var i={scheme:s.scheme,netLoc:u.netLoc,path:null,params:u.params,query:u.query,fragment:u.fragment};if(!u.netLoc&&(i.netLoc=s.netLoc,u.path[0]!=="/"))if(!u.path)i.path=s.path,u.params||(i.params=s.params,u.query||(i.query=s.query));else{var n=s.path,t=n.substring(0,n.lastIndexOf("/")+1)+u.path;i.path=c.normalizePath(t)}return i.path===null&&(i.path=o.alwaysNormalize?c.normalizePath(u.path):u.path),c.buildURLFromParts(i)},parseURL:function(p){var d=P.exec(p);return d?{scheme:d[1]||"",netLoc:d[2]||"",path:d[3]||"",params:d[4]||"",query:d[5]||"",fragment:d[6]||""}:null},normalizePath:function(p){for(p=p.split("").reverse().join("").replace(T,"");p.length!==(p=p.replace(C,"")).length;);return p.split("").reverse().join("")},buildURLFromParts:function(p){return p.scheme+p.netLoc+p.path+p.params+p.query+p.fragment}};le.exports=c})(this)},"./node_modules/webworkify-webpack/index.js":function(le,Q,j){function w(o){var a={};function u(h){if(a[h])return a[h].exports;var i=a[h]={i:h,l:!1,exports:{}};return o[h].call(i.exports,i,i.exports,u),i.l=!0,i.exports}u.m=o,u.c=a,u.i=function(h){return h},u.d=function(h,i,n){u.o(h,i)||Object.defineProperty(h,i,{configurable:!1,enumerable:!0,get:n})},u.r=function(h){Object.defineProperty(h,"__esModule",{value:!0})},u.n=function(h){var i=h&&h.__esModule?function(){return h.default}:function(){return h};return u.d(i,"a",i),i},u.o=function(h,i){return Object.prototype.hasOwnProperty.call(h,i)},u.p="/",u.oe=function(h){throw console.error(h),h};var s=u(u.s=ENTRY_MODULE);return s.default||s}var P="[\\.|\\-|\\+|\\w|/|@]+",b="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+P+").*?\\)";function T(o){return(o+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function C(o){return!isNaN(1*o)}function c(o,a,u){var s={};s[u]=[];var h=a.toString(),i=h.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!i)return s;for(var n=i[1],t=new RegExp("(\\\\n|\\W)"+T(n)+b,"g"),f;f=t.exec(h);){if(f[3]==="dll-reference")continue;s[u].push(f[3])}for(t=new RegExp("\\("+T(n)+'\\("(dll-reference\\s('+P+'))"\\)\\)'+b,"g");f=t.exec(h);)o[f[2]]||(s[u].push(f[1]),o[f[2]]=j(f[1]).m),s[f[2]]=s[f[2]]||[],s[f[2]].push(f[4]);for(var v=Object.keys(s),m=0;m<v.length;m++)for(var E=0;E<s[v[m]].length;E++)C(s[v[m]][E])&&(s[v[m]][E]=1*s[v[m]][E]);return s}function p(o){var a=Object.keys(o);return a.reduce(function(u,s){return u||o[s].length>0},!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<i.length;n++){var t=i[n],f=u[t],v=f.pop();if(h[t]=h[t]||{},h[t][v]||!o[t][v])continue;h[t][v]=!0,s[t]=s[t]||[],s[t].push(v);for(var m=c(o,o[t][v],t),E=Object.keys(m),_=0;_<E.length;_++)u[E[_]]=u[E[_]]||[],u[E[_]]=u[E[_]].concat(m[E[_]])}return s}le.exports=function(o,a){a=a||{};var u={main:j.m},s=a.all?{main:Object.keys(u.main)}:d(u,o),h="";Object.keys(s).filter(function(v){return v!=="main"}).forEach(function(v){for(var m=0;s[v][m];)m++;s[v].push(m),u[v][m]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",h=h+"var "+v+" = ("+w.toString().replace("ENTRY_MODULE",JSON.stringify(m))+")({"+s[v].map(function(E){return""+JSON.stringify(E)+": "+u[v][E].toString()}).join(",")+`});
|
|
|
`}),h=h+"new (("+w.toString().replace("ENTRY_MODULE",JSON.stringify(o))+")({"+s.main.map(function(v){return""+JSON.stringify(v)+": "+u.main[v].toString()}).join(",")+"}))(self);";var i=new window.Blob([h],{type:"text/javascript"});if(a.bare)return i;var n=window.URL||window.webkitURL||window.mozURL||window.msURL,t=n.createObjectURL(i),f=new window.Worker(t);return f.objectURL=t,f}},"./src/config.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"hlsDefaultConfig",function(){return _}),j.d(Q,"mergeConfig",function(){return y}),j.d(Q,"enableStreamingMode",function(){return x});var w=j("./src/controller/abr-controller.ts"),P=j("./src/controller/audio-stream-controller.ts"),b=j("./src/controller/audio-track-controller.ts"),T=j("./src/controller/subtitle-stream-controller.ts"),C=j("./src/controller/subtitle-track-controller.ts"),c=j("./src/controller/buffer-controller.ts"),p=j("./src/controller/timeline-controller.ts"),d=j("./src/controller/cap-level-controller.ts"),o=j("./src/controller/fps-controller.ts"),a=j("./src/controller/eme-controller.ts"),u=j("./src/controller/cmcd-controller.ts"),s=j("./src/utils/xhr-loader.ts"),h=j("./src/utils/fetch-loader.ts"),i=j("./src/utils/cues.ts"),n=j("./src/utils/mediakeys-helper.ts"),t=j("./src/utils/logger.ts");function f(){return f=Object.assign||function(l){for(var S=1;S<arguments.length;S++){var O=arguments[S];for(var A in O)Object.prototype.hasOwnProperty.call(O,A)&&(l[A]=O[A])}return l},f.apply(this,arguments)}function v(l,S){var O=Object.keys(l);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(l);S&&(A=A.filter(function(D){return Object.getOwnPropertyDescriptor(l,D).enumerable})),O.push.apply(O,A)}return O}function m(l){for(var S=1;S<arguments.length;S++){var O=arguments[S]!=null?arguments[S]:{};S%2?v(Object(O),!0).forEach(function(A){E(l,A,O[A])}):Object.getOwnPropertyDescriptors?Object.defineProperties(l,Object.getOwnPropertyDescriptors(O)):v(Object(O)).forEach(function(A){Object.defineProperty(l,A,Object.getOwnPropertyDescriptor(O,A))})}return l}function E(l,S,O){return S in l?Object.defineProperty(l,S,{value:O,enumerable:!0,configurable:!0,writable:!0}):l[S]=O,l}var _=m(m({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:Infinity,maxBufferSize:60*1e3*1e3,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:Infinity,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,enableSoftwareAES:!0,manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,startLevel:void 0,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:s.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:w.default,bufferController:c.default,capLevelController:d.default,fpsController:o.default,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystemOptions:{},requestMediaKeySystemAccessFunc:n.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},g()),{},{subtitleStreamController:T.SubtitleStreamController,subtitleTrackController:C.default,timelineController:p.TimelineController,audioStreamController:P.default,audioTrackController:b.default,emeController:a.default,cmcdController:u.default});function g(){return{cueHandler:i.default,enableCEA708Captions:!0,enableWebVTT:!0,enableIMSC1:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function y(l,S){if((S.liveSyncDurationCount||S.liveMaxLatencyDurationCount)&&(S.liveSyncDuration||S.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(S.liveMaxLatencyDurationCount!==void 0&&(S.liveSyncDurationCount===void 0||S.liveMaxLatencyDurationCount<=S.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(S.liveMaxLatencyDuration!==void 0&&(S.liveSyncDuration===void 0||S.liveMaxLatencyDuration<=S.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return f({},l,S)}function x(l){var S=l.loader;if(S!==h.default&&S!==s.default)t.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),l.progressive=!1;else{var O=Object(h.fetchSupported)();O&&(l.loader=h.default,l.progressive=!0,l.enableSoftwareAES=!0,t.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(le,Q,j){"use strict";j.r(Q);var w=j("./src/polyfills/number.ts"),P=j("./src/utils/ewma-bandwidth-estimator.ts"),b=j("./src/events.ts"),T=j("./src/utils/buffer-helper.ts"),C=j("./src/errors.ts"),c=j("./src/types/loader.ts"),p=j("./src/utils/logger.ts");function d(u,s){for(var h=0;h<s.length;h++){var i=s[h];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(u,i.key,i)}}function o(u,s,h){return s&&d(u.prototype,s),h&&d(u,h),u}var a=function(){function u(h){this.hls=void 0,this.lastLoadedFragLevel=0,this._nextAutoLevel=-1,this.timer=void 0,this.onCheck=this._abandonRulesCheck.bind(this),this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.bwEstimator=void 0,this.hls=h;var i=h.config;this.bwEstimator=new P.default(i.abrEwmaSlowVoD,i.abrEwmaFastVoD,i.abrEwmaDefaultEstimate),this.registerListeners()}var s=u.prototype;return s.registerListeners=function(){var i=this.hls;i.on(b.Events.FRAG_LOADING,this.onFragLoading,this),i.on(b.Events.FRAG_LOADED,this.onFragLoaded,this),i.on(b.Events.FRAG_BUFFERED,this.onFragBuffered,this),i.on(b.Events.LEVEL_LOADED,this.onLevelLoaded,this),i.on(b.Events.ERROR,this.onError,this)},s.unregisterListeners=function(){var i=this.hls;i.off(b.Events.FRAG_LOADING,this.onFragLoading,this),i.off(b.Events.FRAG_LOADED,this.onFragLoaded,this),i.off(b.Events.FRAG_BUFFERED,this.onFragBuffered,this),i.off(b.Events.LEVEL_LOADED,this.onLevelLoaded,this),i.off(b.Events.ERROR,this.onError,this)},s.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},s.onFragLoading=function(i,n){var t=n.frag;if(t.type===c.PlaylistLevelType.MAIN&&!this.timer){var f;this.fragCurrent=t,this.partCurrent=(f=n.part)!=null?f:null,this.timer=self.setInterval(this.onCheck,100)}},s.onLevelLoaded=function(i,n){var t=this.hls.config;n.details.live?this.bwEstimator.update(t.abrEwmaSlowLive,t.abrEwmaFastLive):this.bwEstimator.update(t.abrEwmaSlowVoD,t.abrEwmaFastVoD)},s._abandonRulesCheck=function(){var i=this.fragCurrent,n=this.partCurrent,t=this.hls,f=t.autoLevelEnabled,v=t.config,m=t.media;if(!i||!m)return;var E=n?n.stats:i.stats,_=n?n.duration:i.duration;if(E.aborted){p.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!f||m.paused||!m.playbackRate||!m.readyState)return;var g=performance.now()-E.loading.start,y=Math.abs(m.playbackRate);if(g<=500*_/y)return;var x=t.levels,l=t.minAutoLevel,S=x[i.level],O=E.total||Math.max(E.loaded,Math.round(_*S.maxBitrate/8)),A=Math.max(1,E.bwEstimate?E.bwEstimate/8:E.loaded*1e3/g),D=(O-E.loaded)/A,I=m.currentTime,B=(T.BufferHelper.bufferInfo(m,I,v.maxBufferHole).end-I)/y;if(B>=2*_/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=_*W/(8*.8*A),H<B)break}if(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,E.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:E})},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 E=this.hls.levels[t.level],_=(E.loaded?E.loaded.bytes:0)+v.loaded,g=(E.loaded?E.loaded.duration:0)+m;E.loaded={bytes:_,duration:g},E.realBitrate=Math.round(8*_/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,E=t.media,_=n?n.duration:i?i.duration:0,g=E?E.currentTime:0,y=E&&E.playbackRate!==0?Math.abs(E.playbackRate):1,x=this.bwEstimator?this.bwEstimator.getEstimate():v.abrEwmaDefaultEstimate,l=(T.BufferHelper.bufferInfo(E,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=_?Math.min(_,v.maxStarvationDelay):v.maxStarvationDelay,A=v.abrBandWidthFactor,D=v.abrBandWidthUpFactor;if(!l){var I=this.bitrateTestDelay;if(I){var B=_?Math.min(_,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&&(E=l.details)!==null&&E!==void 0&&E.live),O=l==null?void 0:l.codecSet,A=g?g.duration:_?_.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||V<f))return D}return-1},o(u,[{key:"nextAutoLevel",get:function(){var i=this._nextAutoLevel,n=this.bwEstimator;if(i!==-1&&(!n||!n.canEstimate()))return i;var t=this.getNextABRAutoLevel();return i!==-1&&(t=Math.min(i,t)),t},set:function(i){this._nextAutoLevel=i}}]),u}();Q.default=a},"./src/controller/audio-stream-controller.ts":function(le,Q,j){"use strict";j.r(Q);var w=j("./src/polyfills/number.ts"),P=j("./src/controller/base-stream-controller.ts"),b=j("./src/events.ts"),T=j("./src/utils/buffer-helper.ts"),C=j("./src/controller/fragment-tracker.ts"),c=j("./src/types/level.ts"),p=j("./src/types/loader.ts"),d=j("./src/loader/fragment.ts"),o=j("./src/demux/chunk-cache.ts"),a=j("./src/demux/transmuxer-interface.ts"),u=j("./src/types/transmuxer.ts"),s=j("./src/controller/fragment-finders.ts"),h=j("./src/utils/discontinuities.ts"),i=j("./src/errors.ts"),n=j("./src/utils/logger.ts");function t(){return t=Object.assign||function(_){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var x in y)Object.prototype.hasOwnProperty.call(y,x)&&(_[x]=y[x])}return _},t.apply(this,arguments)}function f(_,g){_.prototype=Object.create(g.prototype),_.prototype.constructor=_,v(_,g)}function v(_,g){return v=Object.setPrototypeOf||function(x,l){return x.__proto__=l,x},v(_,g)}var m=100,E=function(_){f(g,_);function g(x,l){var S;return S=_.call(this,x,l,"[audio-stream-controller]")||this,S.videoBuffer=null,S.videoTrackCC=-1,S.waitingVideoCC=-1,S.audioSwitch=!1,S.trackId=-1,S.waitingData=null,S.mainDetails=null,S.bufferFlushed=!1,S._registerListeners(),S}var y=g.prototype;return y.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},y._registerListeners=function(){var l=this.hls;l.on(b.Events.MEDIA_ATTACHED,this.onMediaAttached,this),l.on(b.Events.MEDIA_DETACHING,this.onMediaDetaching,this),l.on(b.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.on(b.Events.LEVEL_LOADED,this.onLevelLoaded,this),l.on(b.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),l.on(b.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),l.on(b.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),l.on(b.Events.ERROR,this.onError,this),l.on(b.Events.BUFFER_RESET,this.onBufferReset,this),l.on(b.Events.BUFFER_CREATED,this.onBufferCreated,this),l.on(b.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),l.on(b.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),l.on(b.Events.FRAG_BUFFERED,this.onFragBuffered,this)},y._unregisterListeners=function(){var l=this.hls;l.off(b.Events.MEDIA_ATTACHED,this.onMediaAttached,this),l.off(b.Events.MEDIA_DETACHING,this.onMediaDetaching,this),l.off(b.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.off(b.Events.LEVEL_LOADED,this.onLevelLoaded,this),l.off(b.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),l.off(b.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),l.off(b.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),l.off(b.Events.ERROR,this.onError,this),l.off(b.Events.BUFFER_RESET,this.onBufferReset,this),l.off(b.Events.BUFFER_CREATED,this.onBufferCreated,this),l.off(b.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),l.off(b.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),l.off(b.Events.FRAG_BUFFERED,this.onFragBuffered,this)},y.onInitPtsFound=function(l,S){var O=S.frag,A=S.id,D=S.initPTS;if(A==="main"){var I=O.cc;this.initPTS[O.cc]=D,this.log("InitPTS for cc: "+I+" found from main: "+D),this.videoTrackCC=I,this.state===P.State.WAITING_INIT_PTS&&this.tick()}},y.startLoad=function(l){if(!this.levels){this.startPosition=l,this.state=P.State.STOPPED;return}var S=this.lastCurrentTime;this.stopLoad(),this.setInterval(m),this.fragLoadError=0,S>0&&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&&_.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&&de<ee&&((W.end>ee||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=_.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,_.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}_.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,_.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,_.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"),_.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=E},"./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<u.length;s++){var h=u[s];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(a,h.key,h)}}function c(a,u,s){return u&&C(a.prototype,u),s&&C(a,s),a}function p(a,u){a.prototype=Object.create(u.prototype),a.prototype.constructor=a,d(a,u)}function d(a,u){return d=Object.setPrototypeOf||function(h,i){return h.__proto__=i,h},d(a,u)}var o=function(a){p(u,a);function u(h){var i;return i=a.call(this,h,"[audio-track-controller]")||this,i.tracks=[],i.groupId=null,i.tracksInGroup=[],i.trackId=-1,i.trackName="",i.selectDefaultTrack=!0,i.registerListeners(),i}var s=u.prototype;return s.registerListeners=function(){var i=this.hls;i.on(w.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.on(w.Events.MANIFEST_PARSED,this.onManifestParsed,this),i.on(w.Events.LEVEL_LOADING,this.onLevelLoading,this),i.on(w.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),i.on(w.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),i.on(w.Events.ERROR,this.onError,this)},s.unregisterListeners=function(){var i=this.hls;i.off(w.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.off(w.Events.MANIFEST_PARSED,this.onManifestParsed,this),i.off(w.Events.LEVEL_LOADING,this.onLevelLoading,this),i.off(w.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),i.off(w.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),i.off(w.Events.ERROR,this.onError,this)},s.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,a.prototype.destroy.call(this)},s.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},s.onManifestParsed=function(i,n){this.tracks=n.audioTracks||[]},s.onAudioTrackLoaded=function(i,n){var t=n.id,f=n.details,v=this.tracksInGroup[t];if(!v){this.warn("Invalid audio track id "+t);return}var m=v.details;v.details=n.details,this.log("audioTrack "+t+" loaded ["+f.startSN+"-"+f.endSN+"]"),t===this.trackId&&(this.retryCount=0,this.playlistLoaded(t,n,m))},s.onLevelLoading=function(i,n){this.switchLevel(n.level)},s.onLevelSwitching=function(i,n){this.switchLevel(n.level)},s.switchLevel=function(i){var n=this.hls.levels[i];if(!(n!=null&&n.audioGroupIds))return;var t=n.audioGroupIds[n.urlId];if(this.groupId!==t){this.groupId=t;var f=this.tracks.filter(function(m){return!t||m.groupId===t});this.selectDefaultTrack&&!f.some(function(m){return m.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=f;var v={audioTracks:f};this.log("Updating audio tracks, "+f.length+' track(s) found in "'+t+'" group-id'),this.hls.trigger(w.Events.AUDIO_TRACKS_UPDATED,v),this.selectInitialTrack()}},s.onError=function(i,n){if(a.prototype.onError.call(this,i,n),n.fatal||!n.context)return;n.context.type===T.PlaylistContextType.AUDIO_TRACK&&n.context.id===this.trackId&&n.context.groupId===this.groupId&&this.retryLoadingOrFail(n)},s.setAudioTrack=function(i){var n=this.tracksInGroup;if(i<0||i>=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,E=m===void 0?"":m,_=f.name,g=f.type,y=f.url;if(this.trackId=i,this.trackName=_,this.selectDefaultTrack=!1,this.hls.trigger(w.Events.AUDIO_TRACK_SWITCHING,{id:v,groupId:E,name:_,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;t<n.length;t++){var f=n[t];if((!this.selectDefaultTrack||f.default)&&(!i||i===f.name))return f.id}return-1},s.loadPlaylist=function(i){var n=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(n)){var t=n.id,f=n.groupId,v=n.url;if(i)try{v=i.addDirectives(v)}catch(m){this.warn("Could not construct new URL with HLS Delivery Directives: "+m)}this.log("loading audio-track playlist for id: "+t),this.clearTimer(),this.hls.trigger(w.Events.AUDIO_TRACK_LOADING,{url:v,id:t,groupId:f,deliveryDirectives:i||null})}},c(u,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(i){this.selectDefaultTrack=!1,this.setAudioTrack(i)}}]),u}(b.default);Q.default=o},"./src/controller/base-playlist-controller.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"default",function(){return c});var w=j("./src/polyfills/number.ts"),P=j("./src/types/level.ts"),b=j("./src/controller/level-helper.ts"),T=j("./src/utils/logger.ts"),C=j("./src/errors.ts"),c=function(){function p(o,a){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=T.logger.log.bind(T.logger,a+":"),this.warn=T.logger.warn.bind(T.logger,a+":"),this.hls=o}var d=p.prototype;return d.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},d.onError=function(a,u){u.fatal&&u.type===C.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},d.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},d.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},d.stopLoad=function(){this.canLoad=!1,this.clearTimer()},d.switchParams=function(a,u){var s=u==null?void 0:u.renditionReports;if(s)for(var h=0;h<s.length;h++){var i=s[h],n=""+i.URI;if(n===a.substr(-n.length)){var t=parseInt(i["LAST-MSN"]),f=parseInt(i["LAST-PART"]);if(u&&this.hls.config.lowLatencyMode){var v=Math.min(u.age-u.partTarget,u.targetduration);f!==void 0&&v>u.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 E=this.hls.config.lowLatencyMode,_=i.lastPartSn,g=i.endSN,y=i.lastPartIndex,x=y!==-1,l=_===g,S=E?0:y;x?(v=l?g+1:_,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),E||!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<s.levelLoadingMaxRetry;if(h){var i;if(this.retryCount++,a.details.indexOf("LoadTimeOut")>-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;S<l.length;S++){var O=l[S];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(x,O.key,O)}}function v(x,l,S){return l&&f(x.prototype,l),S&&f(x,S),x}function m(x){if(x===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x}function E(x,l){x.prototype=Object.create(l.prototype),x.prototype.constructor=x,_(x,l)}function _(x,l){return _=Object.setPrototypeOf||function(O,A){return O.__proto__=A,O},_(x,l)}var g={STOPPED:"STOPPED",IDLE:"IDLE",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",BACKTRACKING:"BACKTRACKING",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"},y=function(x){E(l,x);function l(O,A,D){var I;return I=x.call(this)||this,I.hls=void 0,I.fragPrevious=null,I.fragCurrent=null,I.fragmentTracker=void 0,I.transmuxer=null,I._state=g.STOPPED,I.media=void 0,I.mediaBuffer=void 0,I.config=void 0,I.bitrateTest=!1,I.lastCurrentTime=0,I.nextLoadPosition=0,I.startPosition=0,I.loadedmetadata=!1,I.fragLoadError=0,I.retryDate=0,I.levels=null,I.fragmentLoader=void 0,I.levelLastLoaded=null,I.startFragRequested=!1,I.decrypter=void 0,I.initPTS=[],I.onvseeking=null,I.onvended=null,I.logPrefix="",I.log=void 0,I.warn=void 0,I.logPrefix=D,I.log=C.logger.log.bind(C.logger,D+":"),I.warn=C.logger.warn.bind(C.logger,D+":"),I.hls=O,I.fragmentLoader=new h.default(O.config),I.fragmentTracker=A,I.config=O.config,I.decrypter=new i.default(O,O.config),O.on(c.Events.KEY_LOADED,I.onKeyLoaded,m(I)),I}var S=l.prototype;return S.doTick=function(){this.onTickEnd()},S.onTickEnd=function(){},S.startLoad=function(A){},S.stopLoad=function(){this.fragmentLoader.abort();var A=this.fragCurrent;A&&this.fragmentTracker.removeFragment(A),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=g.STOPPED},S._streamEnded=function(A,D){var I=this.fragCurrent,B=this.fragmentTracker;if(!D.live&&I&&I.sn===D.endSN&&!A.nextStart){var H=B.getState(I);return H===b.FragmentState.PARTIAL||H===b.FragmentState.OK}return!1},S.onMediaAttached=function(A,D){var I=this.media=this.mediaBuffer=D.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),I.addEventListener("seeking",this.onvseeking),I.addEventListener("ended",this.onvended);var B=this.config;this.levels&&B.autoStartLoad&&this.state===g.STOPPED&&this.startLoad(B.startPosition)},S.onMediaDetaching=function(){var A=this.media;A!=null&&A.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),A&&(A.removeEventListener("seeking",this.onvseeking),A.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},S.onMediaSeeking=function(){var A=this.config,D=this.fragCurrent,I=this.media,B=this.mediaBuffer,H=this.state,te=I?I.currentTime:0,W=T.BufferHelper.bufferInfo(B||I,te,A.maxBufferHole);if(this.log("media seeking to "+(Object(w.isFiniteNumber)(te)?te.toFixed(3):te)+", state: "+H),H===g.ENDED)this.resetLoadingState();else if(D&&!W.len){var V=A.maxFragLookUpTolerance,X=D.start-V,ne=D.start+D.duration+V,Y=te>ne;(te<X||Y)&&(Y&&D.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),D.loader.abort()),this.resetLoadingState())}I&&(this.lastCurrentTime=te),!this.loadedmetadata&&!W.len&&(this.nextLoadPosition=this.startPosition=te),this.tickImmediate()},S.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},S.onKeyLoaded=function(A,D){if(this.state!==g.KEY_LOADING||D.frag!==this.fragCurrent||!this.levels)return;this.state=g.IDLE;var I=this.levels[D.frag.level].details;I&&this.loadFragment(D.frag,I,D.frag.start)},S.onHandlerDestroying=function(){this.stopLoad(),x.prototype.onHandlerDestroying.call(this)},S.onHandlerDestroyed=function(){this.state=g.STOPPED,this.hls.off(c.Events.KEY_LOADED,this.onKeyLoaded,this),this.fragmentLoader&&this.fragmentLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.fragmentLoader=this.fragmentTracker=null,x.prototype.onHandlerDestroyed.call(this)},S.loadKey=function(A,D){this.log("Loading key for "+A.sn+" of ["+D.startSN+"-"+D.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+A.level),this.state=g.KEY_LOADING,this.fragCurrent=A,this.hls.trigger(c.Events.KEY_LOADING,{frag:A})},S.loadFragment=function(A,D,I){this._loadFragForPlayback(A,D,I)},S._loadFragForPlayback=function(A,D,I){var B=this,H=function(W){if(B.fragContextChanged(A)){B.warn("Fragment "+A.sn+(W.part?" p: "+W.part.index:"")+" of level "+A.level+" was dropped during download."),B.fragmentTracker.removeFragment(A);return}A.stats.chunkCount++,B._handleFragmentLoadProgress(W)};this._doFragLoad(A,D,I,H).then(function(te){if(!te)return;B.fragLoadError=0;var W=B.state;if(B.fragContextChanged(A)){(W===g.FRAG_LOADING||W===g.BACKTRACKING||!B.fragCurrent&&W===g.PARSING)&&(B.fragmentTracker.removeFragment(A),B.state=g.IDLE);return}if("payload"in te&&(B.log("Loaded fragment "+A.sn+" of level "+A.level),B.hls.trigger(c.Events.FRAG_LOADED,te),B.state===g.BACKTRACKING)){B.fragmentTracker.backtrack(A,te),B.resetFragmentLoading(A);return}B._handleFragmentLoadComplete(te)}).catch(function(te){B.warn(te),B.resetFragmentLoading(A)})},S.flushMainBuffer=function(A,D,I){if(I===void 0&&(I=null),!(A-D))return;var B={startOffset:A,endOffset:D,type:I};this.fragLoadError=0,this.hls.trigger(c.Events.BUFFER_FLUSHING,B)},S._loadInitSegment=function(A){var D=this;this._doFragLoad(A).then(function(I){if(!I||D.fragContextChanged(A)||!D.levels)throw new Error("init load aborted");return I}).then(function(I){var B=D.hls,H=I.payload,te=A.decryptdata;if(H&&H.byteLength>0&&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<te.end)return T.BufferHelper.bufferInfo(A,B,Math.max(H.nextStart,I.maxBufferHole))}return H},S.getMaxBufferLength=function(A){var D=this.config,I;return A?I=Math.max(8*D.maxBufferSize/A,D.maxBufferLength):I=D.maxBufferLength,Math.min(I,D.maxMaxBufferLength)},S.reduceMaxBufferLength=function(A){var D=this.config,I=A||D.maxBufferLength;return D.maxMaxBufferLength>=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<ne)return this.warn("Not enough fragments to start playback (have: "+te+", need: "+ne+")"),null;!D.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(X=this.getInitialLiveFragment(D,H),this.startPosition=X?this.hls.liveSyncPosition||X.start:A)}else A<=V&&(X=H[0]);if(!X){var Y=W.lowLatencyMode?D.partEnd:D.fragmentEnd;X=this.getFragmentAtPosition(A,Y,D)}return(I=X)!==null&&I!==void 0&&I.initSegment&&!((B=X)!==null&&B!==void 0&&B.initSegment.data)&&!this.bitrateTest&&(X=X.initSegment),X},S.getNextPart=function(A,D,I){for(var B=-1,H=!1,te=!0,W=0,V=A.length;W<V;W++){var X=A[W];if(te=te&&!X.independent,B>-1&&I<X.start)break;var ne=X.loaded;!ne&&(H||X.independent||te)&&X.fragment===D&&(B=W),H=ne}return B},S.loadedEndOfParts=function(A,D){var I=A[A.length-1];return I&&D>I.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(A<D){var ee=A>D-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<W&&this.fragmentTracker.getState(Ce)!==b.FragmentState.OK?(this.log("SN "+Y.sn+" just loaded, load next one: "+Ce.sn),Y=Ce):Y=null))}return Y},S.synchronizeToLiveEdge=function(A){var D=this.config,I=this.media;if(!I)return;var B=this.hls.liveSyncPosition,H=I.currentTime,te=A.fragments[0].start,W=A.edge,V=H>=te-D.maxFragLookUpTolerance&&H<=W;if(B!==null&&I.duration>B&&(H<B||!V)){var X=D.liveMaxLatencyDuration!==void 0?D.liveMaxLatencyDuration:D.liveMaxLatencyDurationCount*A.targetduration;(!V&&I.readyState<4||H<W-X)&&(this.loadedmetadata||(this.nextLoadPosition=B),I.readyState&&(this.warn("Playback: "+H.toFixed(3)+" is located too far from the end of live sliding playlist: "+W+", reset currentTime to : "+B.toFixed(3)),I.currentTime=B))}},S.alignPlaylists=function(A,D){var I=this.levels,B=this.levelLastLoaded,H=this.fragPrevious,te=B!==null?I[B]:null,W=A.fragments.length;if(!W)return this.warn("No fragments in live playlist"),0;var V=A.fragments[0].start,X=!D,ne=A.alignedSliding&&Object(w.isFiniteNumber)(V);if(X||!ne&&!V){Object(a.alignStream)(H,te,A);var Y=A.fragments[0].start;return this.log("Live playlist sliding: "+Y.toFixed(2)+" start-sn: "+(D?D.startSN:"na")+"->"+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<D&&(I=-1),I===-1||this.lastCurrentTime===-1){var B=A.startTimeOffset;Object(w.isFiniteNumber)(B)?(I=D+B,B<0&&(I+=A.totalduration),I=Math.min(Math.max(D,I),D+A.totalduration),this.log("Start time offset "+B+" found in playlist, adjust startPosition to "+I),this.startPosition=I):A.live?I=this.hls.liveSyncPosition||D:this.startPosition=I=0,this.lastCurrentTime=I}this.nextLoadPosition=I},S.getLoadPosition=function(){var A=this.media,D=0;return this.loadedmetadata&&A?D=A.currentTime:this.nextLoadPosition&&(D=this.nextLoadPosition),D},S.handleFragLoadAborted=function(A,D){this.transmuxer&&A.sn!=="initSegment"&&A.stats.aborted&&(this.warn("Fragment "+A.sn+(D?" part"+D.index:"")+" of level "+A.level+" was aborted"),this.resetFragmentLoading(A))},S.resetFragmentLoading=function(A){(!this.fragCurrent||!this.fragContextChanged(A))&&(this.state=g.IDLE)},S.onFragmentOrKeyLoadError=function(A,D){if(D.fatal)return;var I=D.frag;if(!I||I.type!==A)return;var B=this.fragCurrent;console.assert(B&&I.sn===B.sn&&I.level===B.level&&I.urlId===B.urlId,"Frag load error must match current frag to retry");var H=this.config;if(this.fragLoadError+1<=H.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(I.level))return;var te=Math.min(Math.pow(2,this.fragLoadError)*H.fragLoadingRetryDelay,H.fragLoadingMaxRetryTimeout);this.warn("Fragment "+I.sn+" of "+A+" "+I.level+" failed to load, retrying in "+te+"ms"),this.retryDate=self.performance.now()+te,this.fragLoadError++,this.state=g.FRAG_LOADING_WAITING_RETRY}else D.levelRetry?(A===t.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=g.IDLE):(C.logger.error(D.details+" reaches max retry, redispatch as fatal ..."),D.fatal=!0,this.hls.stopLoad(),this.state=g.ERROR)},S.afterBufferFlushed=function(A,D,I){if(!A)return;var B=T.BufferHelper.getBuffered(A);this.fragmentTracker.detectEvictedFragments(D,B,I),this.state===g.ENDED&&this.resetLoadingState()},S.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=g.IDLE},S.resetLiveStartWhenNotLoaded=function(A){if(!this.loadedmetadata){this.startFragRequested=!1;var D=this.levels?this.levels[A].details:null;if(D!=null&&D.live)return this.startPosition=-1,this.setStartPosition(D,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},S.updateLevelTiming=function(A,D,I,B){var H=this,te=I.details;console.assert(!!te,"level.details must be defined");var W=Object.keys(A.elementaryStreams).reduce(function(V,X){var ne=A.elementaryStreams[X];if(ne){var Y=ne.endPTS-ne.startPTS;if(Y<=0)return H.warn("Could not parse fragment "+A.sn+" "+X+" duration reliably ("+Y+") resetting transmuxer to fallback to playlist timing"),H.resetTransmuxer(),V||!1;var ee=B?0:Object(s.updateFragPTSDTS)(te,A,ne.startPTS,ne.endPTS,ne.startDTS,ne.endDTS);return H.hls.trigger(c.Events.LEVEL_PTS_UPDATED,{details:te,level:I,drift:ee,type:X,frag:A,start:ne.startPTS,end:ne.endPTS}),!0}return V},!1);W?(this.state=g.PARSED,this.hls.trigger(c.Events.FRAG_PARSED,{frag:A,part:D})):this.resetLoadingState()},S.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},v(l,[{key:"state",get:function(){return this._state},set:function(A){var D=this._state;D!==A&&(this._state=A,this.log(D+"->"+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 E=f.tracks[m];if(E&&typeof E.buffer.changeType=="function"){var _=t[m],g=_.codec,y=_.levelCodec,x=_.container,l=(E.levelCodec||E.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 _=f.sourceBuffer[n];_&&(b.logger.log("[buffer-controller]: changing "+n+" sourceBuffer type to "+t),_.changeType(t)),v.shiftAndExecuteNext(n)},onStart:function(){},onComplete:function(){},onError:function(_){b.logger.warn("[buffer-controller]: Failed to change "+n+" SourceBuffer type",_)}};v.append(m,n)},h.onBufferAppending=function(n,t){var f=this,v=this.hls,m=this.operationQueue,E=this.tracks,_=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=E.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(_,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(_){return{execute:f.removeExecutor.bind(f,_,t.startOffset,t.endOffset),onStart:function(){},onComplete:function(){f.hls.trigger(P.Events.BUFFER_FLUSHED,{type:_})},onError:function(y){b.logger.warn("[buffer-controller]: Failed to remove from "+_+" SourceBuffer",y)}}};t.type?v.append(m(t.type),t.type):this.getSourceBufferTypes().forEach(function(E){v.append(m(E),E)})},h.onFragParsed=function(n,t){var f=this,v=t.frag,m=t.part,E=[],_=m?m.elementaryStreams:v.elementaryStreams;_[p.ElementaryStreamTypes.AUDIOVIDEO]?E.push("audiovideo"):(_[p.ElementaryStreamTypes.AUDIO]&&E.push("audio"),_[p.ElementaryStreamTypes.VIDEO]&&E.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})};E.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,E)},h.onFragChanged=function(n,t){this.flushBackBuffer()},h.onBufferEos=function(n,t){var f=this,v=this.getSourceBufferTypes().reduce(function(m,E){var _=f.sourceBuffer[E];return(!t.type||t.type===E)&&(_&&!_.ended&&(_.ended=!0,b.logger.log("[buffer-controller]: "+E+" sourceBuffer now EOS"))),m&&!!(!_||_.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 E=t.live&&n.config.liveBackBufferLength!==null?n.config.liveBackBufferLength:n.config.backBufferLength;if(!Object(w.isFiniteNumber)(E)||E<0)return;var _=f.currentTime,g=t.levelTargetDuration,y=Math.max(E,g),x=Math.floor(_/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,E=f.duration,_=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>_&&m>E||!Object(w.isFiniteNumber)(E))&&(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),E=Math.max(m,m+n.totalduration);t.setLiveSeekableRange(m,E)}},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(E){t.executeNext(E)})}},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 E=n[m];if(!E)throw Error("source buffer exists for track "+m+", however track does not");var _=E.levelCodec||E.codec,g=E.container+";codecs="+_;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:_,container:E.container,levelCodec:E.levelCodec,id:E.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,E=this.operationQueue,_=this.sourceBuffer,g=_[n];if(!v||!m||!g){b.logger.warn("[buffer-controller]: Attempting to remove from the "+n+" SourceBuffer, but it does not exist"),E.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)):E.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(E){return v.appendBlocker(E)});Promise.all(m).then(function(){n(),t.forEach(function(E){var _=f.sourceBuffer[E];(!_||!_.updating)&&v.shiftAndExecuteNext(E)})})},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;p<c.length;p++){var d=c[p];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(C,d.key,d)}}function b(C,c,p){return c&&P(C.prototype,c),p&&P(C,p),C}var T=function(){function C(p){this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.hls=void 0,this.streamController=void 0,this.clientRect=void 0,this.hls=p,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var c=C.prototype;return c.setStreamController=function(d){this.streamController=d},c.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},c.registerListeners=function(){var d=this.hls;d.on(w.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),d.on(w.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),d.on(w.Events.MANIFEST_PARSED,this.onManifestParsed,this),d.on(w.Events.BUFFER_CODECS,this.onBufferCodecs,this),d.on(w.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},c.unregisterListener=function(){var d=this.hls;d.off(w.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),d.off(w.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),d.off(w.Events.MANIFEST_PARSED,this.onManifestParsed,this),d.off(w.Events.BUFFER_CODECS,this.onBufferCodecs,this),d.off(w.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},c.onFpsDropLevelCapping=function(d,o){C.isLevelAllowed(o.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(o.droppedLevel)},c.onMediaAttaching=function(d,o){this.media=o.media instanceof HTMLVideoElement?o.media:null},c.onManifestParsed=function(d,o){var a=this.hls;this.restrictedLevels=[],this.firstLevel=o.firstLevel,a.config.capLevelToPlayerSize&&o.video&&this.startCapping()},c.onBufferCodecs=function(d,o){var a=this.hls;a.config.capLevelToPlayerSize&&o.video&&this.startCapping()},c.onMediaDetaching=function(){this.stopCapping()},c.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&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<d.length;h+=1){var i=d[h];if((i.width>=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<h.length;i++){var n=h[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(s,n.key,n)}}function c(s,h,i){return h&&C(s.prototype,h),i&&C(s,i),s}function p(s,h){var i=typeof Symbol!="undefined"&&s[Symbol.iterator]||s["@@iterator"];if(i)return(i=i.call(s)).next.bind(i);if(Array.isArray(s)||(i=d(s))||h&&s&&typeof s.length=="number"){i&&(s=i);var n=0;return function(){return n>=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);i<h;i++)n[i]=s[i];return n}function a(){return a=Object.assign||function(s){for(var h=1;h<arguments.length;h++){var i=arguments[h];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(s[n]=i[n])}return s},a.apply(this,arguments)}var u=function(){function s(i){var n=this;this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=function(){n.initialized&&(n.starved=!0),n.buffering=!0},this.onPlaying=function(){n.initialized||(n.initialized=!0),n.buffering=!1},this.applyPlaylistData=function(v){try{n.apply(v,{ot:P.CMCDObjectType.MANIFEST,su:!n.initialized})}catch(m){T.logger.warn("Could not generate manifest CMCD data.",m)}},this.applyFragmentData=function(v){try{var m=v.frag,E=n.hls.levels[m.level],_=n.getObjectType(m),g={d:m.duration*1e3,ot:_};(_===P.CMCDObjectType.VIDEO||_===P.CMCDObjectType.AUDIO||_==P.CMCDObjectType.MUXED)&&(g.br=E.bitrate/1e3,g.tb=n.getTopBandwidth(_),g.bl=n.getBufferLength(_)),n.apply(v,g)}catch(y){T.logger.warn("Could not generate segment CMCD data.",y)}},this.hls=i;var t=this.config=i.config,f=t.cmcd;f!=null&&(t.pLoader=this.createPlaylistLoader(),t.fLoader=this.createFragmentLoader(),this.sid=f.sessionId||s.uuid(),this.cid=f.contentId,this.useHeaders=f.useHeaders===!0,this.registerListeners())}var h=s.prototype;return h.registerListeners=function(){var n=this.hls;n.on(w.Events.MEDIA_ATTACHED,this.onMediaAttached,this),n.on(w.Events.MEDIA_DETACHED,this.onMediaDetached,this),n.on(w.Events.BUFFER_CREATED,this.onBufferCreated,this)},h.unregisterListeners=function(){var n=this.hls;n.off(w.Events.MEDIA_ATTACHED,this.onMediaAttached,this),n.off(w.Events.MEDIA_DETACHED,this.onMediaDetached,this),n.off(w.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},h.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},h.onMediaAttached=function(n,t){this.media=t.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},h.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},h.onBufferCreated=function(n,t){var f,v;this.audioBuffer=(f=t.tracks.audio)===null||f===void 0?void 0:f.buffer,this.videoBuffer=(v=t.tracks.video)===null||v===void 0?void 0:v.buffer},h.createData=function(){var n;return{v:P.CMCDVersion,sf:P.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(n=this.media)===null||n===void 0?void 0:n.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},h.apply=function(n,t){t===void 0&&(t={}),a(t,this.createData());var f=t.ot===P.CMCDObjectType.INIT||t.ot===P.CMCDObjectType.VIDEO||t.ot===P.CMCDObjectType.MUXED;if(this.starved&&f&&(t.bs=!0,t.su=!0,this.starved=!1),t.su==null&&(t.su=this.buffering),this.useHeaders){var v=s.toHeaders(t);if(!Object.keys(v).length)return;n.headers||(n.headers={}),a(n.headers,v)}else{var m=s.toQuery(t);if(!m)return;n.url=s.appendQueryToUri(n.url,m)}},h.getObjectType=function(n){var t=n.type;return t==="subtitle"?P.CMCDObjectType.TIMED_TEXT:n.sn==="initSegment"?P.CMCDObjectType.INIT:t==="audio"?P.CMCDObjectType.AUDIO:t==="main"?this.hls.audioTracks.length?P.CMCDObjectType.VIDEO:P.CMCDObjectType.MUXED:void 0},h.getTopBandwidth=function(n){for(var t=0,f=n===P.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,v=p(f),m;!(m=v()).done;){var E=m.value;E.bitrate>t&&(t=E.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(E){this.loader=void 0,this.loader=new f(E)}var m=v.prototype;return m.destroy=function(){this.loader.destroy()},m.abort=function(){this.loader.abort()},m.load=function(_,g,y){t(_),this.loader.load(_,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(E){this.loader=void 0,this.loader=new f(E)}var m=v.prototype;return m.destroy=function(){this.loader.destroy()},m.abort=function(){this.loader.abort()},m.load=function(_,g,y){t(_),this.loader.load(_,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},E=function(B){return encodeURIComponent(B)},_={br:v,d:v,bl:m,dl:m,mtp:m,nor:E,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=_[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=[{},{},{},{}],E={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},_=0,g=t;_<g.length;_++){var y=g[_],x=E[y]!=null?E[y]:1;m[x][y]=n[y]}for(var l=0;l<m.length;l++){var S=s.serialize(m[l]);S&&(f["CMCD-"+v[l]]=S)}return f},s.toQuery=function(n){return"CMCD="+encodeURIComponent(s.serialize(n))},s.appendQueryToUri=function(n,t){if(!t)return n;var f=n.includes("?")?"&":"?";return""+n+f+t},s}()},"./src/controller/eme-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/utils/logger.ts"),T=j("./src/utils/mediakeys-helper.ts");function C(u,s){for(var h=0;h<s.length;h++){var i=s[h];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(u,i.key,i)}}function c(u,s,h){return s&&C(u.prototype,s),h&&C(u,h),u}var p=3,d=function(s,h,i){var n={audioCapabilities:[],videoCapabilities:[]};return s.forEach(function(t){n.audioCapabilities.push({contentType:'audio/mp4; codecs="'+t+'"',robustness:i.audioRobustness||""})}),h.forEach(function(t){n.videoCapabilities.push({contentType:'video/mp4; codecs="'+t+'"',robustness:i.videoRobustness||""})}),[n]},o=function(s,h,i,n){switch(s){case T.KeySystems.WIDEVINE:return d(h,i,n);default:throw new Error("Unknown key-system: "+s)}},a=function(){function u(h){this.hls=void 0,this._widevineLicenseUrl=void 0,this._licenseXhrSetup=void 0,this._licenseResponseCallback=void 0,this._emeEnabled=void 0,this._requestMediaKeySystemAccess=void 0,this._drmSystemOptions=void 0,this._config=void 0,this._mediaKeysList=[],this._media=null,this._hasSetMediaKeys=!1,this._requestLicenseFailureCount=0,this.mediaKeysPromise=null,this._onMediaEncrypted=this.onMediaEncrypted.bind(this),this.hls=h,this._config=h.config,this._widevineLicenseUrl=this._config.widevineLicenseUrl,this._licenseXhrSetup=this._config.licenseXhrSetup,this._licenseResponseCallback=this._config.licenseResponseCallback,this._emeEnabled=this._config.emeEnabled,this._requestMediaKeySystemAccess=this._config.requestMediaKeySystemAccessFunc,this._drmSystemOptions=this._config.drmSystemOptions,this._registerListeners()}var s=u.prototype;return s.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},s._registerListeners=function(){this.hls.on(w.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(w.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(w.Events.MANIFEST_PARSED,this.onManifestParsed,this)},s._unregisterListeners=function(){this.hls.off(w.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(w.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(w.Events.MANIFEST_PARSED,this.onManifestParsed,this)},s.getLicenseServerUrl=function(i){switch(i){case T.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+i+'"')},s._attemptKeySystemAccess=function(i,n,t){var f=this,v=o(i,n,t,this._drmSystemOptions);b.logger.log("Requesting encrypted media key-system access");var m=this.requestMediaKeySystemAccess(i,v);this.mediaKeysPromise=m.then(function(E){return f._onMediaKeySystemAccessObtained(i,E)}),m.catch(function(E){b.logger.error('Failed to obtain key-system "'+i+'" access:',E)})},s._onMediaKeySystemAccessObtained=function(i,n){var t=this;b.logger.log('Access for key-system "'+i+'" obtained');var f={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:n,mediaKeySystemDomain:i};this._mediaKeysList.push(f);var v=Promise.resolve().then(function(){return n.createMediaKeys()}).then(function(m){return f.mediaKeys=m,b.logger.log('Media-keys created for key-system "'+i+'"'),t._onMediaKeysCreated(),m});return v.catch(function(m){b.logger.error("Failed to create media-keys:",m)}),v},s._onMediaKeysCreated=function(){var i=this;this._mediaKeysList.forEach(function(n){n.mediaKeysSession||(n.mediaKeysSession=n.mediaKeys.createSession(),i._onNewMediaKeySession(n.mediaKeysSession))})},s._onNewMediaKeySession=function(i){var n=this;b.logger.log("New key-system session "+i.sessionId),i.addEventListener("message",function(t){n._onKeySessionMessage(i,t.message)},!1)},s._onKeySessionMessage=function(i,n){b.logger.log("Got EME message event, creating license request"),this._requestLicense(n,function(t){b.logger.log("Received license data (length: "+(t&&t.byteLength)+"), updating key-session"),i.update(t)})},s.onMediaEncrypted=function(i){var n=this;if(b.logger.log('Media is encrypted using "'+i.initDataType+'" init data type'),!this.mediaKeysPromise){b.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(w.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var t=function(v){if(!n._media)return;n._attemptSetMediaKeys(v),n._generateRequestWithPreferredKeySession(i.initDataType,i.initData)};this.mediaKeysPromise.then(t).catch(t)},s._attemptSetMediaKeys=function(i){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var n=this._mediaKeysList[0];if(!n||!n.mediaKeys){b.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(w.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}b.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(n.mediaKeys),this._hasSetMediaKeys=!0}},s._generateRequestWithPreferredKeySession=function(i,n){var t=this,f=this._mediaKeysList[0];if(!f){b.logger.error("Fatal: Media is encrypted but not any 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}if(f.mediaKeysSessionInitialized){b.logger.warn("Key-Session already initialized but requested again");return}var v=f.mediaKeysSession;if(!v){b.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(w.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!n){b.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(w.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}b.logger.log('Generating key-session request for "'+i+'" init data type'),f.mediaKeysSessionInitialized=!0,v.generateRequest(i,n).then(function(){b.logger.debug("Key-session generation succeeded")}).catch(function(m){b.logger.error("Error generating key-session request:",m),t.hls.trigger(w.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},s._createLicenseXhr=function(i,n,t){var f=new XMLHttpRequest;f.responseType="arraybuffer",f.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,f,i,n,t);var v=this._licenseXhrSetup;if(v)try{v.call(this.hls,f,i),v=void 0}catch(m){b.logger.error(m)}try{f.readyState||f.open("POST",i,!0),v&&v.call(this.hls,f,i)}catch(m){throw new Error("issue setting up KeySystem license XHR "+m)}return f},s._onLicenseRequestReadyStageChange=function(i,n,t,f){switch(i.readyState){case 4:if(i.status===200){this._requestLicenseFailureCount=0,b.logger.log("License request succeeded");var v=i.response,m=this._licenseResponseCallback;if(m)try{v=m.call(this.hls,i,n)}catch(_){b.logger.error(_)}f(v)}else{if(b.logger.error("License Request XHR failed ("+n+"). Status: "+i.status+" ("+i.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>p){this.hls.trigger(w.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var E=p-this._requestLicenseFailureCount+1;b.logger.warn("Retrying license request, "+E+" 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(E){b.logger.error("Failure requesting DRM license: "+E),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;h<d.length;++h){var i=d[h];if(c(o,a,i))return i}return null}function T(d,o,a,u){a===void 0&&(a=0),u===void 0&&(u=0);var s=null;if(d?s=o[d.sn-o[0].sn+1]||null:a===0&&o[0].start===0&&(s=o[0]),s&&C(a,u,s)===0)return s;var h=P.default.search(o,C.bind(null,a,u));return h||s}function C(d,o,a){d===void 0&&(d=0),o===void 0&&(o=0);var u=Math.min(o,a.duration+(a.deltaPTS?a.deltaPTS:0));return a.start+a.duration-u<=d?1:a.start-u>d&&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.cc<o?1:a.cc>o?-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],E=i!==null||v.partial===!0;t.range[f]=u.getBufferedTimes(h,i,E,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<h.length;m++){var E=h.start(m)-this.bufferPadding,_=h.end(m)+this.bufferPadding;if(v>=E&&f<=_){i.time.push({startPTS:Math.max(n,h.start(m)),endPTS:Math.min(t,h.end(m))});break}else if(n<_&&t>E)i.partial=!0,i.time.push({startPTS:Math.max(n,h.start(m)),endPTS:Math.min(t,h.end(m))});else if(t<=E)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<s.length;n++){if(h=s.start(n)-this.bufferPadding,i=s.end(n)+this.bufferPadding,a>=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;m<v.length;m++)h.appendedPTS=Math.max(v.end(m),h.appendedPTS||0)})},d.onFragBuffered=function(a,u){this.detectPartialFragments(u)},d.hasFragment=function(a){var u=c(a);return!!this.fragments[u]},d.removeFragmentsInRange=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){var t=n.body;t.type===s&&t.start<u&&t.end>a&&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,E=!this.seeking&&v;if(this.seeking=v,f!==h){if(this.moved=!0,t!==null){if(this.stallReported){var _=self.performance.now()-t;T.logger.warn("playback not stuck anymore @"+f+", after "+Math.round(_)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((E||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 E=this._trySkipBufferHole(m);if(E)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),E=0;E<m.length;E++){var _=m.start(E);if(f+i.maxBufferHole>=v&&f<_){var g=Math.max(_+d,t.currentTime+p);return T.logger.warn("skipping hole, adjusting currentTime from "+f+" to "+g),this.moved=!0,this.stalled=null,t.currentTime=g,h&&n.trigger(b.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+f+" to "+g,frag:h}),g}v=m.end(E)}return 0},u._tryNudgeBuffer=function(){var h=this.config,i=this.hls,n=this.media,t=n.currentTime,f=(this.nudgeRetry||0)+1;if(this.nudgeRetry=f,f<h.nudgeMaxRetry){var v=t+f*h.nudgeOffset;T.logger.warn("Nudging 'currentTime' from "+t+" to "+v),n.currentTime=v,i.trigger(b.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else T.logger.error("Playhead still not moving while enough data buffered @"+t+" after "+h.nudgeMaxRetry+" nudges"),i.trigger(b.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},a}()},"./src/controller/id3-track-controller.ts":function(le,Q,j){"use strict";j.r(Q);var w=j("./src/events.ts"),P=j("./src/utils/texttrack-utils.ts"),b=j("./src/demux/id3.ts"),T=.25,C=function(){function c(d){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=d,this._registerListeners()}var p=c.prototype;return p.destroy=function(){this._unregisterListeners()},p._registerListeners=function(){var o=this.hls;o.on(w.Events.MEDIA_ATTACHED,this.onMediaAttached,this),o.on(w.Events.MEDIA_DETACHING,this.onMediaDetaching,this),o.on(w.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),o.on(w.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},p._unregisterListeners=function(){var o=this.hls;o.off(w.Events.MEDIA_ATTACHED,this.onMediaAttached,this),o.off(w.Events.MEDIA_DETACHING,this.onMediaDetaching,this),o.off(w.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),o.off(w.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},p.onMediaAttached=function(o,a){this.media=a.media},p.onMediaDetaching=function(){if(!this.id3Track)return;Object(P.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},p.getID3Track=function(o){if(!this.media)return;for(var a=0;a<o.length;a++){var u=o[a];if(u.kind==="metadata"&&u.label==="id3")return Object(P.sendAddTrackEvent)(u,this.media),u}return this.media.addTextTrack("metadata","id3")},p.onFragParsingMetadata=function(o,a){if(!this.media)return;var u=a.frag,s=a.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var h=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,i=0;i<s.length;i++){var n=b.getID3Frames(s[i].data);if(n){var t=s[i].pts,f=i<s.length-1?s[i+1].pts:u.end,v=f-t;v<=0&&(f=t+T);for(var m=0;m<n.length;m++){var E=n[m];if(!b.isTimeStampFrame(E)){var _=new h(t,f,"");_.value=E,this.id3Track.addCue(_)}}}}},p.onBufferFlushing=function(o,a){var u=a.startOffset,s=a.endOffset,h=a.type;if(!h||h==="audio"){var i=this.id3Track;i&&Object(P.removeCuesInRange)(i,u,s)}},c}();Q.default=C},"./src/controller/latency-controller.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"default",function(){return c});var w=j("./src/errors.ts"),P=j("./src/events.ts"),b=j("./src/utils/logger.ts");function T(p,d){for(var o=0;o<d.length;o++){var a=d[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(p,a.key,a)}}function C(p,d,o){return d&&T(p.prototype,d),o&&T(p,o),p}var c=function(){function p(o){var a=this;this.hls=void 0,this.config=void 0,this.media=null,this.levelDetails=null,this.currentTime=0,this.stallCount=0,this._latency=null,this.timeupdateHandler=function(){return a.timeupdate()},this.hls=o,this.config=o.config,this.registerListeners()}var d=p.prototype;return d.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},d.registerListeners=function(){this.hls.on(P.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(P.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(P.Events.ERROR,this.onError,this)},d.unregisterListeners=function(){this.hls.off(P.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(P.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(P.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(P.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(P.Events.ERROR,this.onError)},d.onMediaAttached=function(a,u){this.media=u.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},d.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},d.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},d.onLevelUpdated=function(a,u){var s=u.details;this.levelDetails=s,s.advanced&&this.timeupdate(),!s.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},d.onError=function(a,u){if(u.details!==w.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,b.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},d.timeupdate=function(){var a=this.media,u=this.levelDetails;if(!a||!u)return;this.currentTime=a.currentTime;var s=this.computeLatency();if(s===null)return;this._latency=s;var h=this.config,i=h.lowLatencyMode,n=h.maxLiveSyncPlaybackRate;if(!i||n===1)return;var t=this.targetLatency;if(t===null)return;var f=s-t,v=Math.min(this.maxLatency,t+u.targetduration),m=f<v;if(u.live&&m&&f>.05&&this.forwardBufferLength>1){var E=Math.min(2,Math.max(1,n)),_=Math.round(2/(1+Math.exp(-.75*f-this.edgeStalled))*20)/20;a.playbackRate=Math.min(E,Math.max(1,_))}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 E=h,_=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;t<arguments.length;t++){var f=arguments[t];for(var v in f)Object.prototype.hasOwnProperty.call(f,v)&&(n[v]=f[v])}return n},d.apply(this,arguments)}function o(n,t){for(var f=0;f<t.length;f++){var v=t[f];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(n,v.key,v)}}function a(n,t,f){return t&&o(n.prototype,t),f&&o(n,f),n}function u(n,t){n.prototype=Object.create(t.prototype),n.prototype.constructor=n,s(n,t)}function s(n,t){return s=Object.setPrototypeOf||function(v,m){return v.__proto__=m,v},s(n,t)}var h=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),i=function(n){u(t,n);function t(v){var m;return m=n.call(this,v,"[level-controller]")||this,m._levels=[],m._firstLevel=-1,m._startLevel=void 0,m.currentLevelIndex=-1,m.manualLevelIndex=-1,m.onParsedComplete=void 0,m._registerListeners(),m}var f=t.prototype;return f._registerListeners=function(){var m=this.hls;m.on(P.Events.MANIFEST_LOADED,this.onManifestLoaded,this),m.on(P.Events.LEVEL_LOADED,this.onLevelLoaded,this),m.on(P.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),m.on(P.Events.FRAG_LOADED,this.onFragLoaded,this),m.on(P.Events.ERROR,this.onError,this)},f._unregisterListeners=function(){var m=this.hls;m.off(P.Events.MANIFEST_LOADED,this.onManifestLoaded,this),m.off(P.Events.LEVEL_LOADED,this.onLevelLoaded,this),m.off(P.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),m.off(P.Events.FRAG_LOADED,this.onFragLoaded,this),m.off(P.Events.ERROR,this.onError,this)},f.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,n.prototype.destroy.call(this)},f.startLoad=function(){var m=this._levels;m.forEach(function(E){E.loadError=0}),n.prototype.startLoad.call(this)},f.onManifestLoaded=function(m,E){var _=[],g=[],y=[],x,l={},S,O=!1,A=!1,D=!1;if(E.levels.forEach(function(te){var W=te.attrs;O=O||!!(te.width&&te.height),A=A||!!te.videoCodec,D=D||!!te.audioCodec,h&&te.audioCodec&&te.audioCodec.indexOf("mp4a.40.34")!==-1&&(te.audioCodec=void 0);var V=te.bitrate+"-"+te.attrs.RESOLUTION+"-"+te.attrs.CODECS;S=l[V],S?S.url.push(te.url):(S=new w.Level(te),l[V]=S,_.push(S)),W&&(W.AUDIO&&Object(C.addGroupId)(S,"audio",W.AUDIO),W.SUBTITLES&&Object(C.addGroupId)(S,"text",W.SUBTITLES))}),(O||A)&&D&&(_=_.filter(function(te){var W=te.videoCodec,V=te.width,X=te.height;return!!W||!!(V&&X)})),_=_.filter(function(te){var W=te.audioCodec,V=te.videoCodec;return(!W||Object(T.isCodecSupportedInMp4)(W,"audio"))&&(!V||Object(T.isCodecSupportedInMp4)(V,"video"))}),E.audioTracks&&(g=E.audioTracks.filter(function(te){return!te.audioCodec||Object(T.isCodecSupportedInMp4)(te.audioCodec,"audio")}),Object(C.assignTrackIdsByGroup)(g)),E.subtitles&&(y=E.subtitles,Object(C.assignTrackIdsByGroup)(y)),_.length>0){x=_[0].bitrate,_.sort(function(te,W){return te.bitrate-W.bitrate}),this._levels=_;for(var I=0;I<_.length;I++)if(_[I].bitrate===x){this._firstLevel=I,this.log("manifest loaded, "+_.length+" level(s) found, first bitrate: "+x);break}var B=D&&!A,H={levels:_,audioTracks:g,subtitleTracks:y,firstLevel:this._firstLevel,stats:E.stats,audio:D,video:A,altAudio:!B&&g.some(function(te){return!!te.url})};this.hls.trigger(P.Events.MANIFEST_PARSED,H),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(P.Events.ERROR,{type:b.ErrorTypes.MEDIA_ERROR,details:b.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:E.url,reason:"no level with compatible codecs found in manifest"})},f.onError=function(m,E){if(n.prototype.onError.call(this,m,E),E.fatal)return;var _=E.context,g=this._levels[this.currentLevelIndex];if(_&&(_.type===p.PlaylistContextType.AUDIO_TRACK&&g.audioGroupIds&&_.groupId===g.audioGroupIds[g.urlId]||_.type===p.PlaylistContextType.SUBTITLE_TRACK&&g.textGroupIds&&_.groupId===g.textGroupIds[g.urlId])){this.redundantFailover(this.currentLevelIndex);return}var y=!1,x=!0,l;switch(E.details){case b.ErrorDetails.FRAG_LOAD_ERROR:case b.ErrorDetails.FRAG_LOAD_TIMEOUT:case b.ErrorDetails.KEY_LOAD_ERROR:case b.ErrorDetails.KEY_LOAD_TIMEOUT:if(E.frag){var S=this._levels[E.frag.level];S?(S.fragmentError++,S.fragmentError>this.hls.config.fragLoadingMaxRetry&&(l=E.frag.level)):l=E.frag.level}break;case b.ErrorDetails.LEVEL_LOAD_ERROR:case b.ErrorDetails.LEVEL_LOAD_TIMEOUT:_&&(_.deliveryDirectives&&(x=!1),l=_.level),y=!0;break;case b.ErrorDetails.REMUX_ALLOC_ERROR:l=E.level,y=!0;break}l!==void 0&&this.recoverLevel(E,l,y,x)},f.recoverLevel=function(m,E,_,g){var y=m.details,x=this._levels[E];if(x.loadError++,_){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.loadError<S)m.levelRetry=!0,this.redundantFailover(E);else if(this.manualLevelIndex===-1){var O=E===0?this._levels.length-1:E-1;this.currentLevelIndex!==O&&this._levels[O].loadError===0&&(this.warn(y+": switch to "+O),m.levelRetry=!0,this.hls.nextAutoLevel=O)}}},f.redundantFailover=function(m){var E=this._levels[m],_=E.url.length;if(_>1){var g=(E.urlId+1)%_;this.warn("Switching to redundant URL-id "+g),this._levels.forEach(function(y){y.urlId=g}),this.level=m}},f.onFragLoaded=function(m,E){var _=E.frag;if(_!==void 0&&_.type===p.PlaylistLevelType.MAIN){var g=this._levels[_.level];g!==void 0&&(g.fragmentError=0,g.loadError=0)}},f.onLevelLoaded=function(m,E){var _,g=E.level,y=E.details,x=this._levels[g];if(!x){var l;this.warn("Invalid level index "+g),(l=E.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,E,x.details)):(_=E.deliveryDirectives)!==null&&_!==void 0&&_.skip&&(y.deltaUpdateFailed=!0)},f.onAudioTrackSwitched=function(m,E){var _=this.hls.levels[this.currentLevelIndex];if(!_)return;if(_.audioGroupIds){for(var g=-1,y=this.hls.audioTracks[E.id].groupId,x=0;x<_.audioGroupIds.length;x++)if(_.audioGroupIds[x]===y){g=x;break}g!==_.urlId&&(_.urlId=g,this.startLoad())}},f.loadPlaylist=function(m){var E=this.currentLevelIndex,_=this._levels[E];if(this.canLoad&&_&&_.url.length>0){var g=_.urlId,y=_.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 "+E+(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:E,id:g,deliveryDirectives:m||null})}},f.removeLevel=function(m,E){var _=function(x,l){return l!==E},g=this._levels.filter(function(y,x){return x!==m?!0:y.url.length>1&&E!==void 0?(y.url=y.url.filter(_),y.audioGroupIds&&(y.audioGroupIds=y.audioGroupIds.filter(_)),y.textGroupIds&&(y.textGroupIds=y.textGroupIds.filter(_)),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(_.length===0)return;if(this.currentLevelIndex===m&&(E=_[m])!==null&&E!==void 0&&E.details)return;if(m<0||m>=_.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,_.length-1)}this.clearTimer();var y=this.currentLevelIndex,x=_[y],l=_[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],E=t[v];c(m,E)}function c(t,f){var v=f.startPTS;if(Object(w.isFiniteNumber)(v)){var m=0,E;f.sn>t.sn?(m=v-t.start,E=t):(m=t.start-v,E=f),E.duration!==m&&(E.duration=m)}else if(f.sn>t.sn){var _=t.cc===f.cc;_&&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),E=Math.min(E,f.startDTS),x=Math.min(m,S),m=Math.max(m,S),_=Math.max(_,f.endDTS)}f.duration=m-v;var A=v-f.start;f.appendedPTS=m,f.start=f.startPTS=v,f.maxStartPTS=y,f.startDTS=E,f.endPTS=m,f.minEndPTS=x,f.endDTS=_;var D=f.sn;if(!t||D<t.startSN||D>t.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<H.length-1;I++)c(H[I],H[I+1]);return t.fragmentHint&&c(H[H.length-1],t.fragmentHint),t.PTSKnown=t.alignedSliding=!0,A}function d(t,f){for(var v=null,m=t.fragments,E=m.length-1;E>=0;E--){var _=m[E].initSegment;if(_){v=_;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<S.length;O++)S[O].cc+=g}f.skippedSegments&&(f.startCC=f.fragments[0].cc),o(t.partList,f.partList,function(I,B){B.elementaryStreams=I.elementaryStreams,B.stats=I.stats}),y?p(f,y,y.startPTS,y.endPTS,y.startDTS,y.endDTS):u(t,f),S.length&&(f.totalduration=f.edge-S[0].start),f.driftStartTime=t.driftStartTime,f.driftStart=t.driftStart;var A=f.advancedDateTime;if(f.advanced&&A){var D=f.edge;f.driftStart||(f.driftStartTime=A,f.driftStart=D),f.driftEndTime=A,f.driftEnd=D}else f.driftEndTime=t.driftEndTime,f.driftEnd=t.driftEnd,f.advancedDateTime=t.advancedDateTime}function o(t,f,v){if(t&&f)for(var m=0,E=0,_=t.length;E<=_;E++){var g=t[E],y=f[E+m];g&&y&&g.index===y.index&&g.fragment.sn===y.fragment.sn?v(g,y):m--}}function a(t,f,v){for(var m=f.skippedSegments,E=Math.max(t.startSN,f.startSN)-f.startSN,_=(t.fragmentHint?1:0)+(m?f.endSN:Math.min(t.endSN,f.endSN))-f.startSN,g=f.startSN-t.startSN,y=f.fragmentHint?f.fragments.concat(f.fragmentHint):f.fragments,x=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments,l=E;l<=_;l++){var S=x[g+l],O=y[l];m&&!O&&l<m&&(O=f.fragments[l]=S),S&&O&&v(S,O)}}function u(t,f){var v=f.startSN+f.skippedSegments-t.startSN,m=t.fragments;if(v<0||v>=m.length)return;s(f,m[v].start)}function s(t,f){if(f){for(var v=t.fragments,m=t.skippedSegments;m<v.length;m++)v[m].start+=f;t.fragmentHint&&(t.fragmentHint.start+=f)}}function h(t,f){var v=1e3*t.levelTargetDuration,m=v/2,E=t.age,_=E>0&&E<v*3,g=f.loading.end-f.loading.start,y,x=t.availabilityDelay;if(t.updated===!1)if(_){var l=333*t.misses;y=Math.max(Math.min(m,g*2),l),t.availabilityDelay=(t.availabilityDelay||0)+y}else y=m;else _?(x=Math.min(x||v/2,E),t.availabilityDelay=x,y=x+v-E):y=v-g;return Math.round(y)}function i(t,f,v){if(!t||!t.details)return null;var m=t.details,E=m.fragments[f-m.startSN];return E||(E=m.fragmentHint,E&&E.sn===f?E:f<m.startSN&&v&&v.sn===f?v:null)}function n(t,f,v){if(!t||!t.details)return null;var m=t.details.partList;if(m)for(var E=m.length;E--;){var _=m[E];if(_.index===v&&_.fragment.sn===f)return _}return null}},"./src/controller/stream-controller.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"default",function(){return m});var w=j("./src/polyfills/number.ts"),P=j("./src/controller/base-stream-controller.ts"),b=j("./src/is-supported.ts"),T=j("./src/events.ts"),C=j("./src/utils/buffer-helper.ts"),c=j("./src/controller/fragment-tracker.ts"),p=j("./src/types/loader.ts"),d=j("./src/loader/fragment.ts"),o=j("./src/demux/transmuxer-interface.ts"),a=j("./src/types/transmuxer.ts"),u=j("./src/controller/gap-controller.ts"),s=j("./src/errors.ts"),h=j("./src/utils/logger.ts");function i(E,_){for(var g=0;g<_.length;g++){var y=_[g];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(E,y.key,y)}}function n(E,_,g){return _&&i(E.prototype,_),g&&i(E,g),E}function t(E,_){E.prototype=Object.create(_.prototype),E.prototype.constructor=E,f(E,_)}function f(E,_){return f=Object.setPrototypeOf||function(y,x){return y.__proto__=x,y},f(E,_)}var v=100,m=function(E){t(_,E);function _(y,x){var l;return l=E.call(this,y,x,"[stream-controller]")||this,l.audioCodecSwap=!1,l.gapController=null,l.level=-1,l._forceStartLoad=!1,l.altAudio=!1,l.audioOnly=!1,l.fragPlaying=null,l.onvplaying=null,l.onvseeked=null,l.fragLastKbps=0,l.stalled=!1,l.couldBacktrack=!1,l.audioCodecSwitch=!1,l.videoBuffer=null,l._registerListeners(),l}var g=_.prototype;return g._registerListeners=function(){var x=this.hls;x.on(T.Events.MEDIA_ATTACHED,this.onMediaAttached,this),x.on(T.Events.MEDIA_DETACHING,this.onMediaDetaching,this),x.on(T.Events.MANIFEST_LOADING,this.onManifestLoading,this),x.on(T.Events.MANIFEST_PARSED,this.onManifestParsed,this),x.on(T.Events.LEVEL_LOADING,this.onLevelLoading,this),x.on(T.Events.LEVEL_LOADED,this.onLevelLoaded,this),x.on(T.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),x.on(T.Events.ERROR,this.onError,this),x.on(T.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),x.on(T.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),x.on(T.Events.BUFFER_CREATED,this.onBufferCreated,this),x.on(T.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),x.on(T.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),x.on(T.Events.FRAG_BUFFERED,this.onFragBuffered,this)},g._unregisterListeners=function(){var x=this.hls;x.off(T.Events.MEDIA_ATTACHED,this.onMediaAttached,this),x.off(T.Events.MEDIA_DETACHING,this.onMediaDetaching,this),x.off(T.Events.MANIFEST_LOADING,this.onManifestLoading,this),x.off(T.Events.MANIFEST_PARSED,this.onManifestParsed,this),x.off(T.Events.LEVEL_LOADED,this.onLevelLoaded,this),x.off(T.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),x.off(T.Events.ERROR,this.onError,this),x.off(T.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),x.off(T.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),x.off(T.Events.BUFFER_CREATED,this.onBufferCreated,this),x.off(T.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),x.off(T.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),x.off(T.Events.FRAG_BUFFERED,this.onFragBuffered,this)},g.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},g.startLoad=function(x){if(this.levels){var l=this.lastCurrentTime,S=this.hls;if(this.stopLoad(),this.setInterval(v),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var O=S.startLevel;O===-1&&(S.config.testBandwidth?(O=0,this.bitrateTest=!0):O=S.nextAutoLevel),this.level=S.nextLoadLevel=O,this.loadedmetadata=!1}l>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,E.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(){E.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,E.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){E.prototype.flushMainBuffer.call(this,x,l,this.altAudio?"video":null)},g.onMediaAttached=function(x,l){E.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),E.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&&l<S){if(x.seeking){h.logger.log("could not seek to "+S+", already seeking at "+l);return}var O=C.BufferHelper.getBuffered(x),A=O.length?O.start(0):0,D=A-S;D>0&&(D<this.config.maxBufferHole||D<this.config.maxFragLookUpTolerance)&&(h.logger.log("adjusting start position by "+D+" to match buffer start"),S+=D,this.startPosition=S),this.log("seek to target start position "+S+" from current time "+l),x.currentTime=S}},g._getAudioCodec=function(x){var l=this.config.defaultAudioCodec||x.audioCodec;return this.audioCodecSwap&&l&&(this.log("Swapping audio codec"),l.indexOf("mp4a.40.5")!==-1?l="mp4a.40.2":l="mp4a.40.5"),l},g._loadBitrateTestFrag=function(x){var l=this;this._doFragLoad(x).then(function(S){var O=l.hls;if(!S||O.nextLoadLevel||l.fragContextChanged(x))return;l.fragLoadError=0,l.state=P.State.IDLE,l.startFragRequested=!1,l.bitrateTest=!1;var A=x.stats;A.parsing.start=A.parsing.end=A.buffering.start=A.buffering.end=self.performance.now(),O.trigger(T.Events.FRAG_LOADED,S)})},g._handleTransmuxComplete=function(x){var l,S="main",O=this.hls,A=x.remuxResult,D=x.chunkMeta,I=this.getCurrentContext(D);if(!I){this.warn("The loading context changed while buffering fragment "+D.sn+" of level "+D.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(D.level);return}var B=I.frag,H=I.part,te=I.level,W=A.video,V=A.text,X=A.id3,ne=A.initSegment,Y=this.altAudio?void 0:A.audio;if(this.fragContextChanged(B))return;if(this.state=P.State.PARSING,ne){ne.tracks&&(this._bufferInitSegment(te,ne.tracks,B,D),O.trigger(T.Events.FRAG_PARSING_INIT_SEGMENT,{frag:B,id:S,tracks:ne.tracks}));var ee=ne.initPTS,ce=ne.timescale;Object(w.isFiniteNumber)(ee)&&(this.initPTS[B.cc]=ee,O.trigger(T.Events.INIT_PTS_FOUND,{frag:B,id:S,initPTS:ee,timescale:ce}))}if(W&&A.independent!==!1){if(te.details){var de=W.startPTS,Ce=W.endPTS,Se=W.startDTS,Pe=W.endDTS;if(H)H.elementaryStreams[W.type]={startPTS:de,endPTS:Ce,startDTS:Se,endDTS:Pe};else if(W.firstKeyFrame&&W.independent&&(this.couldBacktrack=!0),W.dropped&&W.independent){var ye=this.getLoadPosition()+this.config.maxBufferHole;if(ye<de){this.backtrack(B);return}B.setElementaryStreamInfo(W.type,B.start,Ce,B.start,Pe,!0)}B.setElementaryStreamInfo(W.type,de,Ce,Se,Pe),this.bufferFragmentData(W,B,H,D)}}else if(A.independent===!1){this.backtrack(B);return}if(Y){var _e=Y.startPTS,Ge=Y.endPTS,Ue=Y.startDTS,Fe=Y.endDTS;H&&(H.elementaryStreams[d.ElementaryStreamTypes.AUDIO]={startPTS:_e,endPTS:Ge,startDTS:Ue,endDTS:Fe}),B.setElementaryStreamInfo(d.ElementaryStreamTypes.AUDIO,_e,Ge,Ue,Fe),this.bufferFragmentData(Y,B,H,D)}if(X!=null&&(l=X.samples)!==null&&l!==void 0&&l.length){var He={frag:B,id:S,samples:X.samples};O.trigger(T.Events.FRAG_PARSING_METADATA,He)}if(V){var be={frag:B,id:S,samples:V.samples};O.trigger(T.Events.FRAG_PARSING_USERDATA,be)}},g._bufferInitSegment=function(x,l,S,O){var A=this;if(this.state!==P.State.PARSING)return;this.audioOnly=!!l.audio&&!l.video,this.altAudio&&!this.audioOnly&&delete l.audio;var D=l.audio,I=l.video,B=l.audiovideo;if(D){var H=x.audioCodec,te=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(H&&(H.indexOf("mp4a.40.5")!==-1?H="mp4a.40.2":H="mp4a.40.5"),D.metadata.channelCount!==1&&te.indexOf("firefox")===-1&&(H="mp4a.40.5")),te.indexOf("android")!==-1&&D.container!=="audio/mpeg"&&(H="mp4a.40.2",this.log("Android: force audio codec to "+H)),x.audioCodec&&x.audioCodec!==H&&this.log('Swapping manifest audio codec "'+x.audioCodec+'" for "'+H+'"'),D.levelCodec=H,D.id="main",this.log("Init audio buffer, container:"+D.container+", codecs[selected/level/parsed]=["+(H||"")+"/"+(x.audioCodec||"")+"/"+D.codec+"]")}I&&(I.levelCodec=x.videoCodec,I.id="main",this.log("Init video buffer, container:"+I.container+", codecs[level/parsed]=["+(x.videoCodec||"")+"/"+I.codec+"]")),B&&this.log("Init audiovideo buffer, container:"+B.container+", codecs[level/parsed]=["+(x.attrs.CODECS||"")+"/"+B.codec+"]"),this.hls.trigger(T.Events.BUFFER_CODECS,l),Object.keys(l).forEach(function(W){var V=l[W],X=V.initSegment;X!=null&&X.byteLength&&A.hls.trigger(T.Events.BUFFER_APPENDING,{type:W,data:X,frag:S,part:null,chunkMeta:O,parent:S.type})}),this.tick()},g.backtrack=function(x){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(x);var l=this.fragmentTracker.backtrack(x);this.fragPrevious=null,this.nextLoadPosition=x.start,l?this.resetFragmentLoading(x):this.state=P.State.BACKTRACKING},g.checkFragmentChanged=function(){var x=this.media,l=null;if(x&&x.readyState>1&&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(_,[{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}}]),_}(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<v.length;m++){var E=v[m];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(f,E.key,E)}}function s(f,v,m){return v&&u(f.prototype,v),m&&u(f,m),f}function h(f,v){f.prototype=Object.create(v.prototype),f.prototype.constructor=f,i(f,v)}function i(f,v){return i=Object.setPrototypeOf||function(E,_){return E.__proto__=_,E},i(f,v)}var n=500,t=function(f){h(v,f);function v(E,_){var g;return g=f.call(this,E,_,"[subtitle-stream-controller]")||this,g.levels=[],g.currentTrackId=-1,g.tracksBuffered=[],g.mainDetails=null,g._registerListeners(),g}var m=v.prototype;return m.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},m._registerListeners=function(){var _=this.hls;_.on(w.Events.MEDIA_ATTACHED,this.onMediaAttached,this),_.on(w.Events.MEDIA_DETACHING,this.onMediaDetaching,this),_.on(w.Events.MANIFEST_LOADING,this.onManifestLoading,this),_.on(w.Events.LEVEL_LOADED,this.onLevelLoaded,this),_.on(w.Events.ERROR,this.onError,this),_.on(w.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),_.on(w.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),_.on(w.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),_.on(w.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),_.on(w.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},m._unregisterListeners=function(){var _=this.hls;_.off(w.Events.MEDIA_ATTACHED,this.onMediaAttached,this),_.off(w.Events.MEDIA_DETACHING,this.onMediaDetaching,this),_.off(w.Events.MANIFEST_LOADING,this.onManifestLoading,this),_.off(w.Events.LEVEL_LOADED,this.onLevelLoaded,this),_.off(w.Events.ERROR,this.onError,this),_.off(w.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),_.off(w.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),_.off(w.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),_.off(w.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),_.off(w.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},m.startLoad=function(){this.stopLoad(),this.state=d.State.IDLE,this.setInterval(n),this.tick()},m.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},m.onLevelLoaded=function(_,g){this.mainDetails=g.details},m.onSubtitleFragProcessed=function(_,g){var y=g.frag,x=g.success;if(this.fragPrevious=y,this.state=d.State.IDLE,!x)return;var l=this.tracksBuffered[this.currentTrackId];if(!l)return;for(var S,O=y.start,A=0;A<l.length;A++)if(O>=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(_,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<I.length;){if(I[B].end<=D){I.shift();continue}else if(I[B].start<D)I[B].start=D;else break;B++}}),this.fragmentTracker.removeFragmentsInRange(y,D,o.PlaylistLevelType.SUBTITLE)}},m.onError=function(_,g){var y,x=g.frag;if(!x||x.type!==o.PlaylistLevelType.SUBTITLE)return;(y=this.fragCurrent)!==null&&y!==void 0&&y.loader&&this.fragCurrent.loader.abort(),this.state=d.State.IDLE},m.onSubtitleTracksUpdated=function(_,g){var y=this,x=g.subtitleTracks;this.tracksBuffered=[],this.levels=x.map(function(l){return new a.Level(l)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(l){y.tracksBuffered[l.id]=[]}),this.mediaBuffer=null},m.onSubtitleTrackSwitch=function(_,g){if(this.currentTrackId=g.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var y=this.levels[this.currentTrackId];y!=null&&y.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,y&&this.setInterval(n)},m.onSubtitleTrackLoaded=function(_,g){var y,x=g.details,l=g.id,S=this.currentTrackId,O=this.levels;if(!O.length)return;var A=O[S];if(l>=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(_){var g=_.frag,y=_.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 _,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<W){var ne=S.maxFragLookUpTolerance;X&&x.hasProgramDateTime&&(V=Object(T.findFragmentByPDT)(H,X.endProgramDateTime,ne)),V||(V=Object(T.findFragmentByPTS)(X,H,D,ne),!V&&X&&X.start<H[0].start&&(V=H[0]))}else V=H[te-1];(_=V)!==null&&_!==void 0&&_.encrypted?(P.logger.log("Loading key for "+V.sn),this.state=d.State.KEY_LOADING,this.hls.trigger(w.Events.KEY_LOADING,{frag:V})):V&&this.fragmentTracker.getState(V)===p.FragmentState.NOT_LOADED&&this.loadFragment(V,x,D)}},m.loadFragment=function(_,g,y){this.fragCurrent=_,f.prototype.loadFragment.call(this,_,g,y)},s(v,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),v}(d.default)},"./src/controller/subtitle-track-controller.ts":function(le,Q,j){"use strict";j.r(Q);var w=j("./src/events.ts"),P=j("./src/utils/texttrack-utils.ts"),b=j("./src/controller/base-playlist-controller.ts"),T=j("./src/types/loader.ts");function C(u,s){for(var h=0;h<s.length;h++){var i=s[h];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(u,i.key,i)}}function c(u,s,h){return s&&C(u.prototype,s),h&&C(u,h),u}function p(u,s){u.prototype=Object.create(s.prototype),u.prototype.constructor=u,d(u,s)}function d(u,s){return d=Object.setPrototypeOf||function(i,n){return i.__proto__=n,i},d(u,s)}var o=function(u){p(s,u);function s(i){var n;return n=u.call(this,i,"[subtitle-track-controller]")||this,n.media=null,n.tracks=[],n.groupId=null,n.tracksInGroup=[],n.trackId=-1,n.selectDefaultTrack=!0,n.queuedDefaultTrack=-1,n.trackChangeListener=function(){return n.onTextTracksChanged()},n.asyncPollTrackChange=function(){return n.pollTrackChange(0)},n.useTextTrackPolling=!1,n.subtitlePollingInterval=-1,n.subtitleDisplay=!0,n.registerListeners(),n}var h=s.prototype;return h.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,u.prototype.destroy.call(this)},h.registerListeners=function(){var n=this.hls;n.on(w.Events.MEDIA_ATTACHED,this.onMediaAttached,this),n.on(w.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.on(w.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.on(w.Events.MANIFEST_PARSED,this.onManifestParsed,this),n.on(w.Events.LEVEL_LOADING,this.onLevelLoading,this),n.on(w.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),n.on(w.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),n.on(w.Events.ERROR,this.onError,this)},h.unregisterListeners=function(){var n=this.hls;n.off(w.Events.MEDIA_ATTACHED,this.onMediaAttached,this),n.off(w.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.off(w.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.off(w.Events.MANIFEST_PARSED,this.onManifestParsed,this),n.off(w.Events.LEVEL_LOADING,this.onLevelLoading,this),n.off(w.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),n.off(w.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),n.off(w.Events.ERROR,this.onError,this)},h.onMediaAttached=function(n,t){if(this.media=t.media,!this.media)return;this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange)},h.pollTrackChange=function(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,E=this.tracksInGroup[m];if(!E){this.warn("Invalid subtitle track id "+f);return}var _=E.details;E.details=t.details,this.log("subtitle track "+f+" loaded ["+v.startSN+"-"+v.endSN+"]"),f===this.trackId&&(this.retryCount=0,this.playlistLoaded(f,t,_))},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 E=this.findTrackId(v==null?void 0:v.name)||this.findTrackId();this.groupId=f;var _={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(E,v)}},h.findTrackId=function(n){for(var t=this.tracksInGroup,f=0;f<t.length;f++){var v=t[f];if((!this.selectDefaultTrack||v.default)&&(!n||n===v.name))return v.id}return-1},h.onError=function(n,t){if(u.prototype.onError.call(this,n,t),t.fatal||!t.context)return;t.context.type===T.PlaylistContextType.SUBTITLE_TRACK&&t.context.id===this.trackId&&t.context.groupId===this.groupId&&this.retryLoadingOrFail(t)},h.loadPlaylist=function(n){var t=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(t)){var f=t.id,v=t.groupId,m=t.url;if(n)try{m=n.addDirectives(m)}catch(E){this.warn("Could not construct new URL with HLS Delivery Directives: "+E)}this.log("Loading subtitle playlist for id "+f),this.hls.trigger(w.Events.SUBTITLE_TRACK_LOADING,{url:m,id:f,groupId:v,deliveryDirectives:n||null})}},h.toggleTrackModes=function(n){var t=this,f=this.media,v=this.subtitleDisplay,m=this.trackId;if(!f)return;var E=a(f.textTracks),_=E.filter(function(x){return x.groupId===t.groupId});if(n===-1)[].slice.call(E).forEach(function(x){x.mode="disabled"});else{var g=_[m];g&&(g.mode="disabled")}var y=_[n];y&&(y.mode=v?"showing":"hidden")},h.setSubtitleTrack=function(n,t){var f,v=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=n;return}if(this.trackId!==n&&this.toggleTrackModes(n),this.trackId===n&&(n===-1||(f=v[n])!==null&&f!==void 0&&f.details)||n<-1||n>=v.length)return;this.clearTimer();var m=v[n];if(this.log("Switching to subtitle track "+n),this.trackId=n,m){var E=m.id,_=m.groupId,g=_===void 0?"":_,y=m.name,x=m.type,l=m.url;this.hls.trigger(w.Events.SUBTITLE_TRACK_SWITCH,{id:E,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<t.length;f++)if(t[f].mode==="hidden")n=f;else if(t[f].mode==="showing"){n=f;break}this.subtitleTrack!==n&&(this.subtitleTrack=n)},c(s,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(n){this.selectDefaultTrack=!1;var t=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(n,t)}}]),s}(b.default);function a(u){for(var s=[],h=0;h<u.length;h++){var i=u[h];i.kind==="subtitles"&&i.label&&s.push(u[h])}return s}Q.default=o},"./src/controller/timeline-controller.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"TimelineController",function(){return a});var w=j("./src/polyfills/number.ts"),P=j("./src/events.ts"),b=j("./src/utils/cea-608-parser.ts"),T=j("./src/utils/output-filter.ts"),C=j("./src/utils/webvtt-parser.ts"),c=j("./src/utils/texttrack-utils.ts"),p=j("./src/utils/imsc1-ttml-parser.ts"),d=j("./src/types/loader.ts"),o=j("./src/utils/logger.ts"),a=function(){function i(t){if(this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.timescale=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=h(),this.captionsProperties=void 0,this.hls=t,this.config=t.config,this.Cues=t.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},this.config.enableCEA708Captions){var f=new T.default(this,"textTrack1"),v=new T.default(this,"textTrack2"),m=new T.default(this,"textTrack3"),E=new T.default(this,"textTrack4");this.cea608Parser1=new b.default(1,f,v),this.cea608Parser2=new b.default(3,m,E)}t.on(P.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.on(P.Events.MANIFEST_LOADED,this.onManifestLoaded,this),t.on(P.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.on(P.Events.FRAG_LOADING,this.onFragLoading,this),t.on(P.Events.FRAG_LOADED,this.onFragLoaded,this),t.on(P.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),t.on(P.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),t.on(P.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),t.on(P.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),t.on(P.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var n=i.prototype;return n.destroy=function(){var f=this.hls;f.off(P.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),f.off(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),f.off(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),f.off(P.Events.MANIFEST_LOADED,this.onManifestLoaded,this),f.off(P.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),f.off(P.Events.FRAG_LOADING,this.onFragLoading,this),f.off(P.Events.FRAG_LOADED,this.onFragLoaded,this),f.off(P.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),f.off(P.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),f.off(P.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),f.off(P.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),f.off(P.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},n.addCues=function(f,v,m,E,_){for(var g=!1,y=_.length;y--;){var x=_[y],l=s(x[0],x[1],v,m);if(l>=0&&(x[0]=Math.min(x[0],v),x[1]=Math.max(x[1],m),g=!0,l/(m-v)>.5))return}if(g||_.push([v,m]),this.config.renderTextTracksNatively){var S=this.captionsTracks[f];this.Cues.newCue(S,v,m,E)}else{var O=this.Cues.newCue(null,v,m,E);this.hls.trigger(P.Events.CUES_PARSED,{type:"captions",cues:O,track:f})}},n.onInitPtsFound=function(f,v){var m=this,E=v.frag,_=v.id,g=v.initPTS,y=v.timescale,x=this.unparsedVttFrags;_==="main"&&(this.initPTS[E.cc]=g,this.timescale[E.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<v.textTracks.length;m++){var E=v.textTracks[m];if(E[f])return E}return null},n.createCaptionsTrack=function(f){this.config.renderTextTracksNatively?this.createNativeTrack(f):this.createNonNativeTrack(f)},n.createNativeTrack=function(f){if(this.captionsTracks[f])return;var v=this.captionsProperties,m=this.captionsTracks,E=this.media,_=v[f],g=_.label,y=_.languageCode,x=this.getExistingTrack(f);if(x)m[f]=x,Object(c.clearCurrentCues)(m[f]),Object(c.sendAddTrackEvent)(m[f],E);else{var l=this.createTextTrack("captions",g,y);l&&(l[f]=!0,m[f]=l)}},n.createNonNativeTrack=function(f){if(this.nonNativeCaptionsTracks[f])return;var v=this.captionsProperties[f];if(!v)return;var m=v.label,E={_id:f,label:m,kind:"captions",default:v.media?!!v.media.default:!1,closedCaptions:v.media};this.nonNativeCaptionsTracks[f]=E,this.hls.trigger(P.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[E]})},n.createTextTrack=function(f,v,m){var E=this.media;return E?E.addTextTrack(f,v,m):void 0},n.onMediaAttaching=function(f,v){this.media=v.media,this._cleanTracks()},n.onMediaDetaching=function(){var f=this.captionsTracks;Object.keys(f).forEach(function(v){Object(c.clearCurrentCues)(f[v]),delete f[v]}),this.nonNativeCaptionsTracks={}},n.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=h(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=this.unparsedVttFrags||[],this.initPTS=[],this.timescale=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())},n._cleanTracks=function(){var f=this.media;if(!f)return;var v=f.textTracks;if(v)for(var m=0;m<v.length;m++)Object(c.clearCurrentCues)(v[m])},n.onSubtitleTracksUpdated=function(f,v){var m=this;this.textTracks=[];var E=v.subtitleTracks||[],_=E.some(function(l){return l.textCodec===p.IMSC1_CODEC});if(this.config.enableWebVTT||_&&this.config.enableIMSC1){var g=this.tracks&&E&&this.tracks.length===E.length;if(this.tracks=E||[],this.config.renderTextTracksNatively){var y=this.media?this.media.textTracks:[];this.tracks.forEach(function(l,S){var O;if(S<y.length){for(var A=null,D=0;D<y.length;D++)if(u(y[D],l)){A=y[D];break}A&&(O=A)}O?Object(c.clearCurrentCues)(O):(O=m.createTextTrack("subtitles",l.name,l.lang),O&&(O.mode="disabled")),O&&(O.groupId=l.groupId,m.textTracks.push(O))})}else if(!g&&this.tracks&&this.tracks.length){var x=this.tracks.map(function(l){return{label:l.name,kind:l.type.toLowerCase(),default:l.default,subtitleTrack:l}});this.hls.trigger(P.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:x})}}},n.onManifestLoaded=function(f,v){var m=this;this.config.enableCEA708Captions&&v.captions&&v.captions.forEach(function(E){var _=/(?:CC|SERVICE)([1-4])/.exec(E.instreamId);if(!_)return;var g="textTrack"+_[1],y=m.captionsProperties[g];if(!y)return;y.label=E.name,E.lang&&(y.languageCode=E.lang),y.media=E})},n.onFragLoading=function(f,v){var m=this.cea608Parser1,E=this.cea608Parser2,_=this.lastSn,g=this.lastPartIndex;if(!this.enabled||!(m&&E))return;if(v.frag.type===d.PlaylistLevelType.MAIN){var y,x,l=v.frag.sn,S=(y=v==null||((x=v.part)===null||x===void 0)?void 0:x.index)!=null?y:-1;l===_+1||l===_&&S===g+1||(m.reset(),E.reset()),this.lastSn=l,this.lastPartIndex=S}},n.onFragLoaded=function(f,v){var m=v.frag,E=v.payload,_=this.initPTS,g=this.unparsedVttFrags;if(m.type===d.PlaylistLevelType.SUBTITLE)if(E.byteLength){if(!Object(w.isFiniteNumber)(_[m.cc])){g.push(v),_.length&&this.hls.trigger(P.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:m,error:new Error("Missing initial subtitle PTS")});return}var y=m.decryptdata;if(y==null||y.key==null||y.method!=="AES-128"){var x=this.tracks[m.level],l=this.vttCCs;l[m.cc]||(l[m.cc]={start:m.start,prevCC:this.prevCC,new:!0},this.prevCC=m.cc),x&&x.textCodec===p.IMSC1_CODEC?this._parseIMSC1(m,E):this._parseVTTs(m,E,l)}}else this.hls.trigger(P.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:m,error:new Error("Empty subtitle payload")})},n._parseIMSC1=function(f,v){var m=this,E=this.hls;Object(p.parseIMSC1)(v,this.initPTS[f.cc],this.timescale[f.cc],function(_){m._appendCues(_,f.level),E.trigger(P.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:f})},function(_){o.logger.log("Failed to parse IMSC1: "+_),E.trigger(P.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:f,error:_})})},n._parseVTTs=function(f,v,m){var E=this,_=this.hls;Object(C.parseWebVTT)(v,this.initPTS[f.cc],this.timescale[f.cc],m,f.cc,f.start,function(g){E._appendCues(g,f.level),_.trigger(P.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:f})},function(g){E._fallbackToIMSC1(f,v),o.logger.log("Failed to parse VTT cue: "+g),_.trigger(P.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:f,error:g})})},n._fallbackToIMSC1=function(f,v){var m=this,E=this.tracks[f.level];E.textCodec||Object(p.parseIMSC1)(v,this.initPTS[f.cc],this.timescale[f.cc],function(){E.textCodec=p.IMSC1_CODEC,m._parseIMSC1(f,v)},function(){E.textCodec="wvtt"})},n._appendCues=function(f,v){var m=this.hls;if(this.config.renderTextTracksNatively){var E=this.textTracks[v];if(E.mode==="disabled")return;f.forEach(function(y){return Object(c.addCueToTrack)(E,y)})}else{var _=this.tracks[v],g=_.default?"default":"subtitles"+v;m.trigger(P.Events.CUES_PARSED,{type:"subtitles",cues:f,track:g})}},n.onFragDecrypted=function(f,v){var m=v.frag;if(m.type===d.PlaylistLevelType.SUBTITLE){if(!Object(w.isFiniteNumber)(this.initPTS[m.cc])){this.unparsedVttFrags.push(v);return}this.onFragLoaded(P.Events.FRAG_LOADED,v)}},n.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},n.onFragParsingUserdata=function(f,v){var m=this.cea608Parser1,E=this.cea608Parser2;if(!this.enabled||!(m&&E))return;for(var _=0;_<v.samples.length;_++){var g=v.samples[_].bytes;if(g){var y=this.extractCea608Data(g);m.addData(v.samples[_].pts,y[0]),E.addData(v.samples[_].pts,y[1])}}},n.onBufferFlushing=function(f,v){var m=v.startOffset,E=v.endOffset,_=v.endOffsetSubtitles,g=v.type,y=this.media;if(!y||y.currentTime<E)return;if(!g||g==="video"){var x=this.captionsTracks;Object.keys(x).forEach(function(S){return Object(c.removeCuesInRange)(x[S],m,E)})}if(this.config.renderTextTracksNatively&&(m===0&&_!==void 0)){var l=this.textTracks;Object.keys(l).forEach(function(S){return Object(c.removeCuesInRange)(l[S],m,_)})}},n.extractCea608Data=function(f){for(var v=f[0]&31,m=2,E=[[],[]],_=0;_<v;_++){var g=f[m++],y=127&f[m++],x=127&f[m++],l=(4&g)!==0,S=3&g;if(y===0&&x===0)continue;l&&((S===0||S===1)&&(E[S].push(y),E[S].push(x)))}return E},i}();function u(i,n){return i&&i.label===n.name&&!(i.textTrack1||i.textTrack2)}function s(i,n,t,f){return Math.min(n,f)-Math.max(i,t)}function h(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"default",function(){return w});var w=function(){function P(T,C){this.subtle=void 0,this.aesIV=void 0,this.subtle=T,this.aesIV=C}var b=P.prototype;return b.decrypt=function(C,c){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},c,C)},P}()},"./src/crypt/aes-decryptor.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"removePadding",function(){return P}),j.d(Q,"default",function(){return b});var w=j("./src/utils/typed-array.ts");function P(T){var C=T.byteLength,c=C&&new DataView(T.buffer).getUint8(C-1);return c?Object(w.sliceUint8)(T,0,C-c):T}var b=function(){function T(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}var C=T.prototype;return C.uint8ArrayToUint32Array_=function(p){for(var d=new DataView(p),o=new Uint32Array(4),a=0;a<4;a++)o[a]=d.getUint32(a*4);return o},C.initTable=function(){var p=this.sBox,d=this.invSBox,o=this.subMix,a=o[0],u=o[1],s=o[2],h=o[3],i=this.invSubMix,n=i[0],t=i[1],f=i[2],v=i[3],m=new Uint32Array(256),E=0,_=0,g=0;for(g=0;g<256;g++)g<128?m[g]=g<<1:m[g]=g<<1^283;for(g=0;g<256;g++){var y=_^_<<1^_<<2^_<<3^_<<4;y=y>>>8^y&255^99,p[E]=y,d[y]=E;var x=m[E],l=m[x],S=m[l],O=m[y]*257^y*16843008;a[E]=O<<24|O>>>8,u[E]=O<<16|O>>>16,s[E]=O<<8|O>>>24,h[E]=O,O=S*16843009^l*65537^x*257^E*16843008,n[y]=O<<24|O>>>8,t[y]=O<<16|O>>>16,f[y]=O<<8|O>>>24,v[y]=O,E?(E=x^m[m[m[S^x]]],_^=m[m[_]]):E=_=1}},C.expandKey=function(p){for(var d=this.uint8ArrayToUint32Array_(p),o=!0,a=0;a<d.length&&o;)o=d[a]===this.key[a],a++;if(o)return;this.key=d;var u=this.keySize=d.length;if(u!==4&&u!==6&&u!==8)throw new Error("Invalid aes key size="+u);var s=this.ksRows=(u+6+1)*4,h,i,n=this.keySchedule=new Uint32Array(s),t=this.invKeySchedule=new Uint32Array(s),f=this.sBox,v=this.rcon,m=this.invSubMix,E=m[0],_=m[1],g=m[2],y=m[3],x,l;for(h=0;h<s;h++){if(h<u){x=n[h]=d[h];continue}l=x,h%u===0?(l=l<<8|l>>>24,l=f[l>>>24]<<24|f[l>>>16&255]<<16|f[l>>>8&255]<<8|f[l&255],l^=v[h/u|0]<<24):u>6&&h%u===4&&(l=f[l>>>24]<<24|f[l>>>16&255]<<16|f[l>>>8&255]<<8|f[l&255]),n[h]=x=(n[h-u]^l)>>>0}for(i=0;i<s;i++)h=s-i,i&3?l=n[h]:l=n[h-4],i<4||h<=4?t[i]=l:t[i]=E[f[l>>>24]]^_[f[l>>>16&255]]^g[f[l>>>8&255]]^y[f[l&255]],t[i]=t[i]>>>0},C.networkToHostOrderSwap=function(p){return p<<24|(p&65280)<<8|(p&16711680)>>8|p>>>24},C.decrypt=function(p,d,o){for(var a=this.keySize+6,u=this.invKeySchedule,s=this.invSBox,h=this.invSubMix,i=h[0],n=h[1],t=h[2],f=h[3],v=this.uint8ArrayToUint32Array_(o),m=v[0],E=v[1],_=v[2],g=v[3],y=new Int32Array(p),x=new Int32Array(y.length),l,S,O,A,D,I,B,H,te,W,V,X,ne,Y,ee=this.networkToHostOrderSwap;d<y.length;){for(te=ee(y[d]),W=ee(y[d+1]),V=ee(y[d+2]),X=ee(y[d+3]),D=te^u[0],I=X^u[1],B=V^u[2],H=W^u[3],ne=4,Y=1;Y<a;Y++)l=i[D>>>24]^n[I>>16&255]^t[B>>8&255]^f[H&255]^u[ne],S=i[I>>>24]^n[B>>16&255]^t[H>>8&255]^f[D&255]^u[ne+1],O=i[B>>>24]^n[H>>16&255]^t[D>>8&255]^f[I&255]^u[ne+2],A=i[H>>>24]^n[D>>16&255]^t[I>>8&255]^f[B&255]^u[ne+3],D=l,I=S,B=O,H=A,ne=ne+4;l=s[D>>>24]<<24^s[I>>16&255]<<16^s[B>>8&255]<<8^s[H&255]^u[ne],S=s[I>>>24]<<24^s[B>>16&255]<<16^s[H>>8&255]<<8^s[D&255]^u[ne+1],O=s[B>>>24]<<24^s[H>>16&255]<<16^s[D>>8&255]<<8^s[I&255]^u[ne+2],A=s[H>>>24]<<24^s[D>>16&255]<<16^s[I>>8&255]<<8^s[B&255]^u[ne+3],x[d]=ee(l^m),x[d+1]=ee(A^E),x[d+2]=ee(O^_),x[d+3]=ee(S^g),m=te,E=W,_=V,g=X,d=d+4}return x.buffer},T}()},"./src/crypt/decrypter.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"default",function(){return d});var w=j("./src/crypt/aes-crypto.ts"),P=j("./src/crypt/fast-aes-key.ts"),b=j("./src/crypt/aes-decryptor.ts"),T=j("./src/utils/logger.ts"),C=j("./src/utils/mp4-tools.ts"),c=j("./src/utils/typed-array.ts"),p=16,d=function(){function o(u,s,h){var i=h===void 0?{}:h,n=i.removePKCS7Padding,t=n===void 0?!0:n;if(this.logEnabled=!0,this.observer=void 0,this.config=void 0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.observer=u,this.config=s,this.removePKCS7Padding=t,t)try{var f=self.crypto;f&&(this.subtle=f.subtle||f.webkitSubtle)}catch(v){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var a=o.prototype;return a.destroy=function(){this.observer=null},a.isSync=function(){return this.config.enableSoftwareAES},a.flush=function(){var s=this.currentResult;if(!s){this.reset();return}var h=new Uint8Array(s);return this.reset(),this.removePKCS7Padding?Object(b.removePadding)(h):h},a.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},a.decrypt=function(s,h,i,n){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(s),h,i);var t=this.flush();t&&n(t.buffer)}else this.webCryptoDecrypt(new Uint8Array(s),h,i).then(n)},a.softwareDecrypt=function(s,h,i){var n=this.currentIV,t=this.currentResult,f=this.remainderData;this.logOnce("JS AES decrypt"),f&&(s=Object(C.appendUint8Array)(f,s),this.remainderData=null);var v=this.getValidChunk(s);if(!v.length)return null;n&&(i=n);var m=this.softwareDecrypter;m||(m=this.softwareDecrypter=new b.default),m.expandKey(h);var E=t;return this.currentResult=m.decrypt(v.buffer,0,i),this.currentIV=Object(c.sliceUint8)(v,-16).buffer,E||null},a.webCryptoDecrypt=function(s,h,i){var n=this,t=this.subtle;return(this.key!==h||!this.fastAesKey)&&(this.key=h,this.fastAesKey=new P.default(t,h)),this.fastAesKey.expandKey().then(function(f){if(!t)return Promise.reject(new Error("web crypto not initialized"));var v=new w.default(t,i);return v.decrypt(s.buffer,f)}).catch(function(f){return n.onWebCryptoError(f,s,h,i)})},a.onWebCryptoError=function(s,h,i,n){return T.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",s),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(h,i,n)},a.getValidChunk=function(s){var h=s,i=s.length-s.length%p;return i!==s.length&&(h=Object(c.sliceUint8)(s,0,i),this.remainderData=Object(c.sliceUint8)(s,i)),h},a.logOnce=function(s){if(!this.logEnabled)return;T.logger.log("[decrypter.ts]: "+s),this.logEnabled=!1},o}()},"./src/crypt/fast-aes-key.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"default",function(){return w});var w=function(){function P(T,C){this.subtle=void 0,this.key=void 0,this.subtle=T,this.key=C}var b=P.prototype;return b.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},P}()},"./src/demux/aacdemuxer.ts":function(le,Q,j){"use strict";j.r(Q);var w=j("./src/demux/base-audio-demuxer.ts"),P=j("./src/demux/adts.ts"),b=j("./src/utils/logger.ts"),T=j("./src/demux/id3.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(u,s){var h;return h=d.call(this)||this,h.observer=void 0,h.config=void 0,h.observer=u,h.config=s,h}var a=o.prototype;return a.resetInitSegment=function(s,h,i){d.prototype.resetInitSegment.call(this,s,h,i),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:s,duration:i,inputTimeScale:9e4,dropped:0}},o.probe=function(s){if(!s)return!1;for(var h=T.getID3Data(s,0)||[],i=h.length,n=s.length;i<n;i++)if(P.probe(s,i))return b.logger.log("ADTS sync word found !"),!0;return!1},a.canParse=function(s,h){return P.canParse(s,h)},a.appendFrame=function(s,h,i){P.initTrackConfig(s,this.observer,h,i,s.manifestCodec);var n=P.appendFrame(s,h,i,this.initPTS,this.frameIndex);if(n&&n.missing===0)return n},o}(w.default);p.minProbeByteLength=9,Q.default=p},"./src/demux/adts.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"getAudioConfig",function(){return T}),j.d(Q,"isHeaderPattern",function(){return C}),j.d(Q,"getHeaderLength",function(){return c}),j.d(Q,"getFullFrameLength",function(){return p}),j.d(Q,"canGetFrameLength",function(){return d}),j.d(Q,"isHeader",function(){return o}),j.d(Q,"canParse",function(){return a}),j.d(Q,"probe",function(){return u}),j.d(Q,"initTrackConfig",function(){return s}),j.d(Q,"getFrameDuration",function(){return h}),j.d(Q,"parseFrameHeader",function(){return i}),j.d(Q,"appendFrame",function(){return n});var w=j("./src/utils/logger.ts"),P=j("./src/errors.ts"),b=j("./src/events.ts");function T(t,f,v,m){var E,_,g,y,x=navigator.userAgent.toLowerCase(),l=m,S=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];E=((f[v+2]&192)>>>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:"+E+", samplingIndex:"+O),/firefox/i.test(x)?O>=6?(E=5,y=new Array(4),_=O-3):(E=2,y=new Array(2),_=O):x.indexOf("android")!==-1?(E=2,y=new Array(2),_=O):(E=5,y=new Array(4),m&&(m.indexOf("mp4a.40.29")!==-1||m.indexOf("mp4a.40.5")!==-1)||!m&&O>=6?_=O-3:((m&&m.indexOf("mp4a.40.2")!==-1&&(O>=6&&g===1||/vivaldi/i.test(x))||!m&&g===1)&&(E=2,y=new Array(2)),_=O)),y[0]=E<<3,y[0]|=(O&14)>>1,y[1]|=(O&1)<<7,y[1]|=g<<3,E===5&&(y[1]|=(_&14)>>1,y[2]=(_&1)<<7,y[2]|=2<<2,y[3]=0),{config:y,samplerate:S[O],channelCount:g,codec:"mp4a.40."+E,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}function o(t,f){return f+1<t.length&&C(t,f)}function a(t,f){return d(t,f)&&C(t,f)&&p(t,f)<=t.length-f}function u(t,f){if(o(t,f)){var v=c(t,f);if(f+v>=t.length)return!1;var m=p(t,f);if(m<=v)return!1;var E=f+m;return E===t.length||o(t,E)}return!1}function s(t,f,v,m,E){if(!t.samplerate){var _=T(f,v,m,E);if(!_)return;t.config=_.config,t.samplerate=_.samplerate,t.channelCount=_.channelCount,t.codec=_.codec,t.manifestCodec=_.manifestCodec,w.logger.log("parsed codec:"+t.codec+", rate:"+_.samplerate+", channels:"+_.channelCount)}}function h(t){return 1024*9e4/t}function i(t,f,v,m,E){var _=c(t,f),g=p(t,f);if(g-=_,g>0){var y=v+m*E;return{headerLength:_,frameLength:g,stamp:y}}}function n(t,f,v,m,E){var _=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,E=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<E;){if(this.canParse(u,i)){var _=this.appendFrame(f,u,i);_?(this.frameIndex++,t=_.sample.pts,i+=_.length,n=i):i=E}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===E&&n!==E){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;p<b.length;p++){var d=b[p];C.set(d,c),c+=d.length}return C}},"./src/demux/dummy-demuxed-track.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"dummyTrack",function(){return w});function w(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(le,Q,j){"use strict";j.r(Q);var w=j("./src/utils/logger.ts"),P=function(){function b(C){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=C,this.bytesAvailable=C.byteLength,this.word=0,this.bitsAvailable=0}var T=b.prototype;return T.loadWord=function(){var c=this.data,p=this.bytesAvailable,d=c.byteLength-p,o=new Uint8Array(4),a=Math.min(4,p);if(a===0)throw new Error("no bytes available");o.set(c.subarray(d,d+a)),this.word=new DataView(o.buffer).getUint32(0),this.bitsAvailable=a*8,this.bytesAvailable-=a},T.skipBits=function(c){var p;this.bitsAvailable>c?(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<<p|this.readBits(p):d},T.skipLZ=function(){var c;for(c=0;c<this.bitsAvailable;++c)if((this.word&2147483648>>>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;a<c;a++)d!==0&&(o=this.readEG(),d=(p+o+256)%256),p=d===0?p:d},T.readSPS=function(){var c=0,p=0,d=0,o=0,a,u,s,h=this.readUByte.bind(this),i=this.readBits.bind(this),n=this.readUEG.bind(this),t=this.readBoolean.bind(this),f=this.skipBits.bind(this),v=this.skipEG.bind(this),m=this.skipUEG.bind(this),E=this.skipScalingList.bind(this);h();var _=h();if(i(5),f(3),h(),m(),_===100||_===110||_===122||_===244||_===44||_===83||_===86||_===118||_===128){var g=n();if(g===3&&f(1),m(),m(),f(1),t())for(u=g!==3?8:12,s=0;s<u;s++)t()&&(s<6?E(16):E(64))}m();var y=n();if(y===0)n();else if(y===1)for(f(1),v(),v(),a=n(),s=0;s<a;s++)v();m(),f(1);var x=n(),l=n(),S=i(1);S===0&&f(1),f(1),t()&&(c=n(),p=n(),d=n(),o=n());var O=[1,1];if(t()&&t()){var A=h();switch(A){case 1:O=[1,1];break;case 2:O=[12,11];break;case 3:O=[10,11];break;case 4:O=[16,11];break;case 5:O=[40,33];break;case 6:O=[24,11];break;case 7:O=[20,11];break;case 8:O=[32,11];break;case 9:O=[80,33];break;case 10:O=[18,11];break;case 11:O=[15,11];break;case 12:O=[64,33];break;case 13:O=[160,99];break;case 14:O=[4,3];break;case 15:O=[3,2];break;case 16:O=[2,1];break;case 255:{O=[h()<<8|h(),h()<<8|h()];break}}}return{width:Math.ceil((x+1)*16-c*2-p*2),height:(2-S)*(l+1)*16-(S?2:4)*(d+o),pixelRatio:O}},T.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},b}();Q.default=P},"./src/demux/id3.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"isHeader",function(){return w}),j.d(Q,"isFooter",function(){return P}),j.d(Q,"getID3Data",function(){return b}),j.d(Q,"canParse",function(){return C}),j.d(Q,"getTimeStamp",function(){return c}),j.d(Q,"isTimeStampFrame",function(){return p}),j.d(Q,"getID3Frames",function(){return o}),j.d(Q,"decodeFrame",function(){return a}),j.d(Q,"utf8ArrayToStr",function(){return n}),j.d(Q,"testables",function(){return t});var w=function(E,_){return _+10<=E.length&&(E[_]===73&&E[_+1]===68&&E[_+2]===51&&(E[_+3]<255&&E[_+4]<255&&(E[_+6]<128&&E[_+7]<128&&E[_+8]<128&&E[_+9]<128)))},P=function(E,_){return _+10<=E.length&&(E[_]===51&&E[_+1]===68&&E[_+2]===73&&(E[_+3]<255&&E[_+4]<255&&(E[_+6]<128&&E[_+7]<128&&E[_+8]<128&&E[_+9]<128)))},b=function(E,_){for(var g=_,y=0;w(E,_);){y+=10;var x=T(E,_+6);y+=x,P(E,_+10)&&(y+=10),_+=y}return y>0?E.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<=E.length-_},c=function(E){for(var _=o(E),g=0;g<_.length;g++){var y=_[g];if(p(y))return i(y)}return},p=function(E){return E&&E.key==="PRIV"&&E.info==="com.apple.streaming.transportStreamTimestamp"},d=function(E){var _=String.fromCharCode(E[0],E[1],E[2],E[3]),g=T(E,4),y=10;return{type:_,size:g,data:E.subarray(y,y+g)}},o=function(E){for(var _=0,g=[];w(E,_);){var y=T(E,_+6);_+=10;for(var x=_+y;_+8<x;){var l=d(E.subarray(_)),S=a(l);S&&g.push(S),_+=l.size+10}P(E,_)&&(_+=10)}return g},a=function(E){return E.type==="PRIV"?u(E):E.type[0]==="W"?h(E):s(E)},u=function(E){if(E.size<2)return;var _=n(E.data,!0),g=new Uint8Array(E.data.subarray(_.length+1));return{key:E.type,info:_,data:g.buffer}},s=function(E){if(E.size<2)return;if(E.type==="TXXX"){var _=1,g=n(E.data.subarray(_),!0);_+=g.length+1;var y=n(E.data.subarray(_));return{key:E.type,info:g,data:y}}var x=n(E.data.subarray(1));return{key:E.type,data:x}},h=function(E){if(E.type==="WXXX"){if(E.size<2)return;var _=1,g=n(E.data.subarray(_),!0);_+=g.length+1;var y=n(E.data.subarray(_));return{key:E.type,info:g,data:y}}var x=n(E.data);return{key:E.type,data:x}},i=function(E){if(E.data.byteLength===8){var _=new Uint8Array(E.data),g=_[3]&1,y=(_[4]<<23)+(_[5]<<15)+(_[6]<<7)+_[7];return y/=45,g&&(y+=4772185884e-2),Math.round(y)}return},n=function(E,_){_===void 0&&(_=!1);var g=v();if(g){var y=g.decode(E);if(_){var x=y.indexOf("\0");return x!==-1?y.substring(0,x):y}return y.replace(/\0/g,"")}for(var l=E.length,S,O,A,D="",I=0;I<l;){if(S=E[I++],S===0&&_)return D;if(S===0||S===3)continue;switch(S>>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=E[I++],D+=String.fromCharCode((S&31)<<6|O&63);break;case 14:O=E[I++],A=E[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;i<n;i++)if(T.probe(s,i))return b.logger.log("MPEG Audio sync word found !"),!0;return!1},a.canParse=function(s,h){return T.canParse(s,h)},a.appendFrame=function(s,h,i){return this.initPTS===null?void 0:T.appendFrame(s,h,i,this.initPTS,this.frameIndex)},o}(w.default);p.minProbeByteLength=4,Q.default=p},"./src/demux/mp4demuxer.ts":function(le,Q,j){"use strict";j.r(Q);var w=j("./src/utils/mp4-tools.ts"),P=j("./src/demux/dummy-demuxed-track.ts"),b=function(){function T(c,p){this.remainderData=null,this.config=void 0,this.config=p}var C=T.prototype;return C.resetTimeStamp=function(){},C.resetInitSegment=function(){},C.resetContiguity=function(){},T.probe=function(p){return Object(w.findBox)({data:p,start:0,end:Math.min(p.length,16384)},["moof"]).length>0},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,E={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(E),{sample:E,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,E=i===3?3-n:n===3?3:4,_=P[E*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*_/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&&_>=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<s.length&&d(s,h)}function a(s,h){var i=4;return d(s,h)&&i<=s.length-h}function u(s,h){if(h+1<s.length&&d(s,h)){var i=4,n=p(s,h),t=i;n!=null&&n.frameLength&&(t=n.frameLength);var f=h+t;return f===s.length||o(s,f)}return!1}},"./src/demux/sample-aes.ts":function(le,Q,j){"use strict";j.r(Q);var w=j("./src/crypt/decrypter.ts"),P=j("./src/demux/tsdemuxer.ts"),b=function(){function T(c,p,d){this.keyData=void 0,this.decrypter=void 0,this.keyData=d,this.decrypter=new w.default(c,p,{removePKCS7Padding:!1})}var C=T.prototype;return C.decryptBuffer=function(p,d){this.decrypter.decrypt(p,this.keyData.key.buffer,this.keyData.iv.buffer,d)},C.decryptAacSample=function(p,d,o,a){var u=p[d].unit,s=u.subarray(16,u.length-u.length%16),h=s.buffer.slice(s.byteOffset,s.byteOffset+s.length),i=this;this.decryptBuffer(h,function(n){var t=new Uint8Array(n);u.set(t,16),a||i.decryptAacSamples(p,d+1,o)})},C.decryptAacSamples=function(p,d,o){for(;;d++){if(d>=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,E=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,E),this.observer.on(b.Events.ERROR,E);var _={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:_,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,_,m,g,n),this.worker=null}}else this.transmuxer=new T.default(this.observer,_,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=E?E.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),E&&(W||!V)&&(E.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,_,x);this.configureTransmuxer(Y)}if(this.frag=m,this.part=E,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(E){t.handleFlushResult(E,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(E){p(u,E)}):p(u,f);break}case"flush":{var v=n.chunkMeta,m=u.transmuxer.flush(v);Object(w.isPromise)(m)?m.then(function(E){o(u,E,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 E}),j.d(Q,"TransmuxState",function(){return _});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,_e=V.videoCodec,Ge=V.defaultInitPts,Ue=V.duration,Fe=V.initSegmentData;if((de||Ce)&&this.resetInitSegment(Fe,ye,_e,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;ne<Y;ne++)if(i[ne].demux.probe(l)){X=i[ne];break}X||(s.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),X={demux:C.default,remux:o.default});var ee=this.demuxer,ce=this.remuxer,de=X.remux,Ce=X.demux;(!ce||!(ce instanceof de))&&(this.remuxer=new de(A,O,D,I)),(!ee||!(ee instanceof Ce))&&(this.demuxer=new Ce(A,O,D),this.probe=Ce.probe),this.resetInitSegment(W,B,V,te),this.resetInitialTimestamp(H)},y.needsProbing=function(l,S,O){return!this.demuxer||!this.remuxer||S||O},y.getDecrypter=function(){var l=this.decrypter;return l||(l=this.decrypter=new b.default(this.observer,this.config)),l},g}();function f(g,y){var x=null;return g.byteLength>0&&y!=null&&y.key!=null&&y.iv!==null&&y.method!=null&&(x=y),x}var v=function(y){return{remuxResult:{},chunkMeta:y}};function m(g){return"then"in g&&g.then instanceof Function}var E=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},_=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(_,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=_,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<y;){if(g[x]===71&&g[x+188]===71&&g[x+2*188]===71)return x;x++}return-1},m.createTrack=function(g,y){return{container:g==="video"||g==="audio"?"video/mp2t":void 0,type:g,id:a[g],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:g==="audio"?y:void 0}};var E=m.prototype;return E.resetInitSegment=function(g,y,x){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=m.createTrack("video",x),this._audioTrack=m.createTrack("audio",x),this._id3Track=m.createTrack("id3",x),this._txtTrack=m.createTrack("text",x),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=g,this.videoCodec=y,this._duration=x},E.resetTimeStamp=function(){},E.resetContiguity=function(){var g=this._audioTrack,y=this._avcTrack,x=this._id3Track;g&&(g.pesData=null),y&&(y.pesData=null),x&&(x.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},E.demux=function(g,y,x,l){x===void 0&&(x=!1),l===void 0&&(l=!1),x||(this.sampleAes=null);var S,O=this._avcTrack,A=this._audioTrack,D=this._id3Track,I=O.pid,B=O.pesData,H=A.pid,te=D.pid,W=A.pesData,V=D.pesData,X=!1,ne=this.pmtParsed,Y=this._pmtId,ee=g.length;if(this.remainderData&&(g=Object(p.appendUint8Array)(this.remainderData,g),ee=g.length,this.remainderData=null),ee<188&&!l)return this.remainderData=g,{audioTrack:A,avcTrack:O,id3Track:D,textTrack:this._txtTrack};var ce=Math.max(0,m.syncOffset(g));ee-=(ee+ce)%188,ee<g.byteLength&&!l&&(this.remainderData=new Uint8Array(g.buffer,ee,g.buffer.byteLength-ee));for(var de=ce;de<ee;de+=188)if(g[de]===71){var Ce=!!(g[de+1]&64),Se=((g[de+1]&31)<<8)+g[de+2],Pe=(g[de+3]&48)>>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 _e=i(g,ye,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,x);I=_e.avc,I>0&&(O.pid=I),H=_e.audio,H>0&&(A.pid=H,A.isAAC=_e.isAAC),te=_e.id3,te>0&&(D.pid=te),X&&!ne&&(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},E.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},E.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},E.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)},E.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)})})},E.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},E.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,_e=[Se,Pe],Ge=0;Ge<ye;Ge++)_e.push(W.readUByte()),_e.push(W.readUByte()),_e.push(W.readUByte());f(x._txtTrack.samples,{type:3,pts:g.pts,bytes:_e})}}}}}else if(V===5&&W.bytesAvailable!==0){if(ne=!0,X>16){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<He;me++)be[me]=W.readUByte();f(x._txtTrack.samples,{pts:g.pts,payloadType:V,uuid:Ue.join(""),userData:Object(T.utf8ArrayToStr)(be),userDataBytes:be})}}else if(X<W.bytesAvailable)for(var We=0;We<X;We++)W.readUByte()}break}case 7:if(D=!0,I=!0,O&&A&&(A.debug+="SPS "),!l.sps){var ze=new b.default(B.data),nt=ze.readSPS();l.width=nt.width,l.height=nt.height,l.pixelRatio=nt.pixelRatio,l.sps=[B.data],l.duration=x._duration;for(var re=B.data.subarray(1,4),k="avc1.",U=0;U<3;U++){var q=re[U].toString(16);q.length<2&&(q="0"+q),k+=q}l.codec=k}break;case 8:D=!0,O&&A&&(A.debug+="PPS "),l.pps||(l.pps=[B.data]);break;case 9:D=!1,l.audFound=!0,A&&t(A,l),A=x.avcSample=s(!1,g.pts,g.dts,O?"AUD ":"");break;case 12:D=!1;break;default:D=!1,A&&(A.debug+="unknown NAL "+B.type+" ");break}if(A&&D){var $=A.units;$.push(B)}}),y&&A&&(t(A,l),this.avcSample=null)},E.getLastNalUnit=function(){var g,y=this.avcSample,x;if(!y||y.units.length===0){var l=this._avcTrack.samples;y=l[l.length-1]}if((g=y)!==null&&g!==void 0&&g.units){var S=y.units;x=S[S.length-1]}return x},E.parseAVCNALu=function(g){var y=g.byteLength,x=this._avcTrack,l=x.naluState||0,S=l,O=[],A=0,D,I,B,H=-1,te=0;for(l===-1&&(H=0,te=g[0]&31,l=0,A=1);A<y;){if(D=g[A++],!l){l=D?0:1;continue}if(l===1){l=D?0:2;continue}if(!D)l=3;else if(D===1){if(H>=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<y?(B=g[A]&31,H=A,te=B,l=0):l=-1}else l=0}if(H>=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},E.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;I<B-1&&!w.isHeader(S,I);I++);if(I!==y){var H,te;if(I<B-1?(H="AAC PES did not start with ADTS header,offset:"+I,te=!1):(H="no ADTS header found in AAC PES",te=!0),d.logger.warn("parsing error:"+H),this.observer.emit(c.Events.ERROR,c.Events.ERROR,{type:o.ErrorTypes.MEDIA_ERROR,details:o.ErrorDetails.FRAG_PARSING_ERROR,fatal:te,reason:H}),te)return}w.initTrackConfig(x,this.observer,S,I,this.audioCodec);var W;if(g.pts!==void 0)W=g.pts;else if(l){var V=w.getFrameDuration(x.samplerate);W=l.sample.pts+V}else{d.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var X=0;I<B;)if(w.isHeader(S,I)){if(I+5<B){var ne=w.appendFrame(x,S,I,W,X);if(ne)if(ne.missing)this.aacOverFlow=ne;else{I+=ne.length,X++;continue}}break}else I++},E.parseMPEGPES=function(g){var y=g.data,x=y.length,l=0,S=0,O=g.pts;if(O===void 0){d.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;S<x;)if(P.isHeader(y,S)){var A=P.appendFrame(this._audioTrack,y,S,O,l);if(A)S+=A.length,l++;else break}else S++},E.parseID3PES=function(g){if(g.pts===void 0){d.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(g)},m}();u.minProbeByteLength=188;function s(m,E,_,g){return{key:m,frame:!1,pts:E,dts:_,units:[],debug:g,length:0}}function h(m,E){return(m[E+10]&31)<<8|m[E+11]}function i(m,E,_,g){var y={audio:-1,avc:-1,id3:-1,isAAC:!0},x=(m[E+1]&15)<<8|m[E+2],l=E+3+x-4,S=(m[E+10]&15)<<8|m[E+11];for(E+=12+S;E<l;){var O=(m[E+1]&31)<<8|m[E+2];switch(m[E]){case 207:if(!g){d.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:y.audio===-1&&(y.audio=O);break;case 21:y.id3===-1&&(y.id3=O);break;case 219:if(!g){d.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:y.avc===-1&&(y.avc=O);break;case 3:case 4:_?y.audio===-1&&(y.audio=O,y.isAAC=!1):d.logger.log("MPEG audio found, not supported in this browser");break;case 36:d.logger.warn("Unsupported HEVC stream type found");break;default:break}E+=((m[E+3]&15)<<8|m[E+4])+5}return y}function n(m){var E=0,_,g,y,x,l,S=m.data;if(!m||m.size===0)return null;for(;S[0].length<19&&S.length>1;){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)}_=S[0];var A=(_[0]<<16)+(_[1]<<8)+_[2];if(A===1){if(g=(_[4]<<8)+_[5],g&&g>m.size-6)return null;var D=_[7];D&192&&(x=(_[9]&14)*536870912+(_[10]&255)*4194304+(_[11]&254)*16384+(_[12]&255)*128+(_[13]&254)/2,D&64?(l=(_[14]&14)*536870912+(_[15]&255)*4194304+(_[16]&254)*16384+(_[17]&255)*128+(_[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=_[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;H<te;H++){_=S[H];var W=_.byteLength;if(I)if(I>W){I-=W;continue}else _=_.subarray(I),W-=I,I=0;B.set(_,E),E+=W}return g&&(g-=y+3),{data:B,pts:x,dts:l,len:g}}return null}function t(m,E){if(m.units.length&&m.frame){if(m.pts===void 0){var _=E.samples,g=_.length;if(g){var y=_[g-1];m.pts=y.pts,m.dts=y.dts}else{E.dropped++;return}}E.samples.push(m)}m.debug.length&&d.logger.log(m.pts+"/"+m.dts+":"+m.debug)}function f(m,E){var _=m.length;if(_>0){if(E.pts>=m[_-1].pts)m.push(E);else for(var g=_-1;g>=0;g--)if(E.pts<m[g].pts){m.splice(g,0,E);break}}else m.push(E)}function v(m){for(var E=m.byteLength,_=[],g=1;g<E-2;)m[g]===0&&m[g+1]===0&&m[g+2]===3?(_.push(g+2),g+=2):g++;if(_.length===0)return m;var y=E-_.length,x=new Uint8Array(y),l=0;for(g=0;g<y;l++,g++)l===_[0]&&(l++,_.shift()),x[g]=m[l];return x}Q.default=u},"./src/errors.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"ErrorTypes",function(){return w}),j.d(Q,"ErrorDetails",function(){return P});var w;(function(b){b.NETWORK_ERROR="networkError",b.MEDIA_ERROR="mediaError",b.KEY_SYSTEM_ERROR="keySystemError",b.MUX_ERROR="muxError",b.OTHER_ERROR="otherError"})(w||(w={}));var P;(function(b){b.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",b.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",b.KEY_SYSTEM_NO_SESSION="keySystemNoSession",b.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",b.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",b.MANIFEST_LOAD_ERROR="manifestLoadError",b.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",b.MANIFEST_PARSING_ERROR="manifestParsingError",b.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",b.LEVEL_EMPTY_ERROR="levelEmptyError",b.LEVEL_LOAD_ERROR="levelLoadError",b.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",b.LEVEL_SWITCH_ERROR="levelSwitchError",b.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",b.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",b.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",b.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",b.FRAG_LOAD_ERROR="fragLoadError",b.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",b.FRAG_DECRYPT_ERROR="fragDecryptError",b.FRAG_PARSING_ERROR="fragParsingError",b.REMUX_ALLOC_ERROR="remuxAllocError",b.KEY_LOAD_ERROR="keyLoadError",b.KEY_LOAD_TIMEOUT="keyLoadTimeOut",b.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",b.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",b.BUFFER_APPEND_ERROR="bufferAppendError",b.BUFFER_APPENDING_ERROR="bufferAppendingError",b.BUFFER_STALLED_ERROR="bufferStalledError",b.BUFFER_FULL_ERROR="bufferFullError",b.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",b.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",b.INTERNAL_EXCEPTION="internalException",b.INTERNAL_ABORTED="aborted",b.UNKNOWN="unknown"})(P||(P={}))},"./src/events.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"Events",function(){return w});var w;(function(P){P.MEDIA_ATTACHING="hlsMediaAttaching",P.MEDIA_ATTACHED="hlsMediaAttached",P.MEDIA_DETACHING="hlsMediaDetaching",P.MEDIA_DETACHED="hlsMediaDetached",P.BUFFER_RESET="hlsBufferReset",P.BUFFER_CODECS="hlsBufferCodecs",P.BUFFER_CREATED="hlsBufferCreated",P.BUFFER_APPENDING="hlsBufferAppending",P.BUFFER_APPENDED="hlsBufferAppended",P.BUFFER_EOS="hlsBufferEos",P.BUFFER_FLUSHING="hlsBufferFlushing",P.BUFFER_FLUSHED="hlsBufferFlushed",P.MANIFEST_LOADING="hlsManifestLoading",P.MANIFEST_LOADED="hlsManifestLoaded",P.MANIFEST_PARSED="hlsManifestParsed",P.LEVEL_SWITCHING="hlsLevelSwitching",P.LEVEL_SWITCHED="hlsLevelSwitched",P.LEVEL_LOADING="hlsLevelLoading",P.LEVEL_LOADED="hlsLevelLoaded",P.LEVEL_UPDATED="hlsLevelUpdated",P.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",P.LEVELS_UPDATED="hlsLevelsUpdated",P.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",P.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",P.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",P.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",P.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",P.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",P.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",P.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",P.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",P.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",P.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",P.CUES_PARSED="hlsCuesParsed",P.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",P.INIT_PTS_FOUND="hlsInitPtsFound",P.FRAG_LOADING="hlsFragLoading",P.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",P.FRAG_LOADED="hlsFragLoaded",P.FRAG_DECRYPTED="hlsFragDecrypted",P.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",P.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",P.FRAG_PARSING_METADATA="hlsFragParsingMetadata",P.FRAG_PARSED="hlsFragParsed",P.FRAG_BUFFERED="hlsFragBuffered",P.FRAG_CHANGED="hlsFragChanged",P.FPS_DROP="hlsFpsDrop",P.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",P.ERROR="hlsError",P.DESTROYING="hlsDestroying",P.KEY_LOADING="hlsKeyLoading",P.KEY_LOADED="hlsKeyLoaded",P.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",P.BACK_BUFFER_REACHED="hlsBackBufferReached"})(w||(w={}))},"./src/hls.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"default",function(){return m});var w=j("./node_modules/url-toolkit/src/url-toolkit.js"),P=j.n(w),b=j("./src/loader/playlist-loader.ts"),T=j("./src/loader/key-loader.ts"),C=j("./src/controller/id3-track-controller.ts"),c=j("./src/controller/latency-controller.ts"),p=j("./src/controller/level-controller.ts"),d=j("./src/controller/fragment-tracker.ts"),o=j("./src/controller/stream-controller.ts"),a=j("./src/is-supported.ts"),u=j("./src/utils/logger.ts"),s=j("./src/config.ts"),h=j("./node_modules/eventemitter3/index.js"),i=j.n(h),n=j("./src/events.ts"),t=j("./src/errors.ts");function f(E,_){for(var g=0;g<_.length;g++){var y=_[g];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(E,y.key,y)}}function v(E,_,g){return _&&f(E.prototype,_),g&&f(E,g),E}var m=function(){E.isSupported=function(){return Object(a.isSupported)()};function E(g){g===void 0&&(g={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new h.EventEmitter,this._autoLevelCapping=void 0,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null;var y=this.config=Object(s.mergeConfig)(E.DefaultConfig,g);this.userConfig=g,Object(u.enableLogs)(y.debug),this._autoLevelCapping=-1,y.progressive&&Object(s.enableStreamingMode)(y);var x=y.abrController,l=y.bufferController,S=y.capLevelController,O=y.fpsController,A=this.abrController=new x(this),D=this.bufferController=new l(this),I=this.capLevelController=new S(this),B=new O(this),H=new b.default(this),te=new T.default(this),W=new C.default(this),V=this.levelController=new p.default(this),X=new d.FragmentTracker(this),ne=this.streamController=new o.default(this,X);I.setStreamController(ne),B.setStreamController(ne);var Y=[V,ne];this.networkControllers=Y;var ee=[H,te,A,D,I,B,W,X];this.audioTrackController=this.createController(y.audioTrackController,null,Y),this.createController(y.audioStreamController,X,Y),this.subtitleTrackController=this.createController(y.subtitleTrackController,null,Y),this.createController(y.subtitleStreamController,X,Y),this.createController(y.timelineController,null,ee),this.emeController=this.createController(y.emeController,null,ee),this.cmcdController=this.createController(y.cmcdController,null,ee),this.latencyController=this.createController(c.default,null,ee),this.coreComponents=ee}var _=E.prototype;return _.createController=function(y,x,l){if(y){var S=x?new y(this,x):new y(this);return l&&l.push(S),S}return null},_.on=function(y,x,l){l===void 0&&(l=this),this._emitter.on(y,x,l)},_.once=function(y,x,l){l===void 0&&(l=this),this._emitter.once(y,x,l)},_.removeAllListeners=function(y){this._emitter.removeAllListeners(y)},_.off=function(y,x,l,S){l===void 0&&(l=this),this._emitter.off(y,x,l,S)},_.listeners=function(y){return this._emitter.listeners(y)},_.emit=function(y,x,l){return this._emitter.emit(y,x,l)},_.trigger=function(y,x){if(this.config.debug)return this.emit(y,y,x);try{return this.emit(y,y,x)}catch(l){u.logger.error("An internal error happened while handling event "+y+'. Error message: "'+l.message+'". Here is a stacktrace:',l),this.trigger(n.Events.ERROR,{type:t.ErrorTypes.OTHER_ERROR,details:t.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:y,error:l})}return!1},_.listenerCount=function(y){return this._emitter.listenerCount(y)},_.destroy=function(){u.logger.log("destroy"),this.trigger(n.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(y){return y.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(y){return y.destroy()}),this.coreComponents.length=0},_.attachMedia=function(y){u.logger.log("attachMedia"),this._media=y,this.trigger(n.Events.MEDIA_ATTACHING,{media:y})},_.detachMedia=function(){u.logger.log("detachMedia"),this.trigger(n.Events.MEDIA_DETACHING,void 0),this._media=null},_.loadSource=function(y){this.stopLoad();var x=this.media,l=this.url,S=this.url=w.buildAbsoluteURL(self.location.href,y,{alwaysNormalize:!0});u.logger.log("loadSource:"+S),x&&l&&l!==S&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(x)),this.trigger(n.Events.MANIFEST_LOADING,{url:y})},_.startLoad=function(y){y===void 0&&(y=-1),u.logger.log("startLoad("+y+")"),this.networkControllers.forEach(function(x){x.startLoad(y)})},_.stopLoad=function(){u.logger.log("stopLoad"),this.networkControllers.forEach(function(y){y.stopLoad()})},_.swapAudioCodec=function(){u.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},_.recoverMediaError=function(){u.logger.log("recoverMediaError");var y=this._media;this.detachMedia(),y&&this.attachMedia(y)},_.removeLevel=function(y,x){x===void 0&&(x=0),this.levelController.removeLevel(y,x)},v(E,[{key:"levels",get:function(){var y=this.levelController.levels;return y||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(y){u.logger.log("set currentLevel:"+y),this.loadLevel=y,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(y){u.logger.log("set nextLevel:"+y),this.levelController.manualLevel=y,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(y){u.logger.log("set loadLevel:"+y),this.levelController.manualLevel=y}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(y){this.levelController.nextLoadLevel=y}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(y){u.logger.log("set firstLevel:"+y),this.levelController.firstLevel=y}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(y){u.logger.log("set startLevel:"+y),y!==-1&&(y=Math.max(y,this.minAutoLevel)),this.levelController.startLevel=y}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(y){var x=!!y;x!==this.config.capLevelToPlayerSize&&(x?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=x)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(y){this._autoLevelCapping!==y&&(u.logger.log("set autoLevelCapping:"+y),this._autoLevelCapping=y)}},{key:"bandwidthEstimate",get:function(){var y=this.abrController.bwEstimator;return y?y.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var y=this.levels,x=this.config.minAutoBitrate;if(!y)return 0;for(var l=y.length,S=0;S<l;S++)if(y[S].maxBitrate>x)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 E.defaultConfig?E.defaultConfig:s.hlsDefaultConfig},set:function(y){E.defaultConfig=y}}]),E}();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,E){var _=[null];_.push.apply(_,m);var g=Function.bind.apply(v,_),y=new g;return E&&d(y,E.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,E=f.url;if(!E)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 "+(E?"part list":"url")));this.abort();var _=this.config,g=_.fLoader,y=_.loader;return new Promise(function(x,l){m.loader&&m.loader.destroy();var S=m.loader=f.loader=g?new g(_):new y(_),O=s(f),A={timeout:_.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:_.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 E=this;this.abort();var _=this.config,g=_.fLoader,y=_.loader;return new Promise(function(x,l){E.loader&&E.loader.destroy();var S=E.loader=f.loader=g?new g(_):new y(_),O=s(f,v),A={timeout:_.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:_.fragLoadingMaxRetryTimeout,highWaterMark:a};v.stats=S.stats,S.load(O,A,{onSuccess:function(I,B,H,te){E.resetLoader(f,S),E.updateStatsFromPart(f,v);var W={frag:f,part:v,payload:I.data,networkDetails:te};m(W),x(W)},onError:function(I,B,H){E.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,E.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){E.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,E=v.stats,_=E.total;if(m.loaded+=E.loaded,_){var g=Math.round(f.duration/v.duration),y=Math.min(Math.round(m.loaded/_),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=E.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),E=1;E<v;E++)m[E-1]=arguments[E];return f=i.call.apply(i,[this].concat(m))||this,f.data=void 0,f.data=t,f}return n}(T(Error))},"./src/loader/fragment.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"ElementaryStreamTypes",function(){return u}),j.d(Q,"BaseSegment",function(){return s}),j.d(Q,"Fragment",function(){return h}),j.d(Q,"Part",function(){return i});var w=j("./src/polyfills/number.ts"),P=j("./node_modules/url-toolkit/src/url-toolkit.js"),b=j.n(P),T=j("./src/utils/logger.ts"),C=j("./src/loader/level-key.ts"),c=j("./src/loader/load-stats.ts");function p(n,t){n.prototype=Object.create(t.prototype),n.prototype.constructor=n,d(n,t)}function d(n,t){return d=Object.setPrototypeOf||function(v,m){return v.__proto__=m,v},d(n,t)}function o(n,t){for(var f=0;f<t.length;f++){var v=t[f];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(n,v.key,v)}}function a(n,t,f){return t&&o(n.prototype,t),f&&o(n,f),n}var u;(function(n){n.AUDIO="audio",n.VIDEO="video",n.AUDIOVIDEO="audiovideo"})(u||(u={}));var s=function(){function n(f){var v;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(v={},v[u.AUDIO]=null,v[u.VIDEO]=null,v[u.AUDIOVIDEO]=null,v),this.baseurl=f}var t=n.prototype;return t.setByteRange=function(v,m){var E=v.split("@",2),_=[];E.length===1?_[0]=m?m.byteRangeEndOffset:0:_[0]=parseInt(E[1]),_[1]=parseInt(E[0])+_[0],this._byteRange=_},a(n,[{key:"byteRange",get:function(){return this._byteRange?this._byteRange:[]}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"url",get:function(){return!this._url&&this.baseurl&&this.relurl&&(this._url=Object(P.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(v){this._url=v}}]),n}(),h=function(n){p(t,n);function t(v,m){var E;return E=n.call(this,m)||this,E._decryptdata=null,E.rawProgramDateTime=null,E.programDateTime=null,E.tagList=[],E.duration=0,E.sn=0,E.levelkey=void 0,E.type=void 0,E.loader=null,E.level=-1,E.cc=0,E.startPTS=void 0,E.endPTS=void 0,E.appendedPTS=void 0,E.startDTS=void 0,E.endDTS=void 0,E.start=0,E.deltaPTS=void 0,E.maxStartPTS=void 0,E.minEndPTS=void 0,E.stats=new c.LoadStats,E.urlId=0,E.data=void 0,E.bitrateTest=!1,E.title=null,E.initSegment=null,E.type=v,E}var f=t.prototype;return f.createInitializationVector=function(m){for(var E=new Uint8Array(16),_=12;_<16;_++)E[_]=m>>8*(15-_)&255;return E},f.setDecryptDataFromLevelKey=function(m,E){var _=m;return(m==null?void 0:m.method)==="AES-128"&&m.uri&&!m.iv&&(_=C.LevelKey.fromURI(m.uri),_.method=m.method,_.iv=this.createInitializationVector(E),_.keyFormat="identity"),_},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:E,endPTS:_,startDTS:g,endDTS:y,partial:x};return}S.startPTS=Math.min(S.startPTS,E),S.endPTS=Math.max(S.endPTS,_),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=E;var y=f.enumeratedString("BYTERANGE");return y&&g.setByteRange(y,_),_&&(g.fragOffset=_.fragOffset+_.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;d<p.length;d++){var o=p[d];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(c,o.key,o)}}function b(c,p,d){return p&&P(c.prototype,p),d&&P(c,d),c}var T=10,C=function(){function c(d){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.needSidxRanges=!1,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.fragments=[],this.url=d}var p=c.prototype;return p.reloaded=function(o){if(!o){this.advanced=!0,this.updated=!0;return}var a=this.lastPartSn-o.lastPartSn,u=this.lastPartIndex-o.lastPartIndex;this.updated=this.endSN!==o.endSN||!!u||!!a,this.advanced=this.endSN>o.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;d<p.length;d++){var o=p[d];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(c,o.key,o)}}function T(c,p,d){return p&&b(c.prototype,p),d&&b(c,d),c}var C=function(){c.fromURL=function(d,o){return new c(d,o)},c.fromURI=function(d){return new c(d)};function c(p,d){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,d?this._uri=Object(w.buildAbsoluteURL)(p,d,{alwaysNormalize:!0}):this._uri=p}return T(c,[{key:"uri",get:function(){return this._uri}}]),c}()},"./src/loader/load-stats.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"LoadStats",function(){return w});var w=function(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}},"./src/loader/m3u8-parser.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"default",function(){return t});var w=j("./src/polyfills/number.ts"),P=j("./node_modules/url-toolkit/src/url-toolkit.js"),b=j.n(P),T=j("./src/loader/fragment.ts"),C=j("./src/loader/level-details.ts"),c=j("./src/loader/level-key.ts"),p=j("./src/utils/attr-list.ts"),d=j("./src/utils/logger.ts"),o=j("./src/utils/codecs.ts"),a=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,u=/#EXT-X-MEDIA:(.*)/g,s=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),h=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(PLAYLIST-TYPE):(.+)/.source,/#EXT-X-(MEDIA-SEQUENCE): *(\d+)/.source,/#EXT-X-(SKIP):(.+)/.source,/#EXT-X-(TARGETDURATION): *(\d+)/.source,/#EXT-X-(KEY):(.+)/.source,/#EXT-X-(START):(.+)/.source,/#EXT-X-(ENDLIST)/.source,/#EXT-X-(DISCONTINUITY-SEQ)UENCE: *(\d+)/.source,/#EXT-X-(DIS)CONTINUITY/.source,/#EXT-X-(VERSION):(\d+)/.source,/#EXT-X-(MAP):(.+)/.source,/#EXT-X-(SERVER-CONTROL):(.+)/.source,/#EXT-X-(PART-INF):(.+)/.source,/#EXT-X-(GAP)/.source,/#EXT-X-(BITRATE):\s*(\d+)/.source,/#EXT-X-(PART):(.+)/.source,/#EXT-X-(PRELOAD-HINT):(.+)/.source,/#EXT-X-(RENDITION-REPORT):(.+)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),i=/\.(mp4|m4s|m4v|m4a)$/i;function n(_){var g,y;return i.test((g=(y=P.parseURL(_))===null||y===void 0?void 0:y.path)!=null?g:"")}var t=function(){function _(){}return _.findGroup=function(y,x){for(var l=0;l<y.length;l++){var S=y[l];if(S.id===x)return S}},_.convertAVC1ToAVCOTI=function(y){var x=y.split(".");if(x.length>2){var l=x.shift()+".";return l+=parseInt(x.shift()).toString(16),l+=("000"+parseInt(x.shift()).toString(16)).substr(-4),l}return y},_.resolve=function(y,x){return P.buildAbsoluteURL(x,y,{alwaysNormalize:!0})},_.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:_.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=_.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}},_.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?_.resolve(I.URI,x):""};if(S.length){var H=_.findGroup(S,B.groupId)||S[0];v(B,H,"audioCodec"),v(B,H,"textCodec")}A.push(B)}}return A},_.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),E(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<ne.length&&!(typeof ne[Y]!="undefined");Y++);var ye=(" "+ne[Y]).slice(1),_e=(" "+ne[Y+1]).slice(1),Ge=ne[Y+2]?(" "+ne[Y+2]).slice(1):"";switch(ye){case"PLAYLIST-TYPE":A.type=_e.toUpperCase();break;case"MEDIA-SEQUENCE":B=A.startSN=parseInt(_e);break;case"SKIP":{var Ue=new p.AttrList(_e),Fe=Ue.decimalInteger("SKIPPED-SEGMENTS");if(Object(w.isFiniteNumber)(Fe)){A.skippedSegments=Fe;for(var He=Fe;He--;)D.unshift(null);B+=Fe}var be=Ue.enumeratedString("RECENTLY-REMOVED-DATERANGES");be&&(A.recentlyRemovedDateranges=be.split(" "));break}case"TARGETDURATION":A.targetduration=parseFloat(_e);break;case"VERSION":A.version=parseInt(_e);break;case"EXTM3U":break;case"ENDLIST":A.live=!1;break;case"#":(_e||Ge)&&X.tagList.push(Ge?[_e,Ge]:[_e]);break;case"DIS":W++;case"GAP":X.tagList.push([ye]);break;case"BITRATE":X.tagList.push([ye,_e]);break;case"DISCONTINUITY-SEQ":W=parseInt(_e);break;case"KEY":{var me,We=new p.AttrList(_e),ze=We.enumeratedString("METHOD"),nt=We.URI,re=We.hexadecimalInteger("IV"),k=We.enumeratedString("KEYFORMATVERSIONS"),U=We.enumeratedString("KEYID"),q=(me=We.enumeratedString("KEYFORMAT"))!=null?me:"identity",$=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if($.indexOf(q)>-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(_e),xe=J.decimalFloatingPoint("TIME-OFFSET");Object(w.isFiniteNumber)(xe)&&(A.startTimeOffset=xe);break}case"MAP":{var ke=new p.AttrList(_e);X.relurl=ke.URI,ke.BYTERANGE&&X.setByteRange(ke.BYTERANGE),X.level=l,X.sn="initSegment",ee&&(X.levelkey=ee),X.initSegment=null,I=X,de=!0;break}case"SERVER-CONTROL":{var dt=new p.AttrList(_e);A.canBlockReload=dt.bool("CAN-BLOCK-RELOAD"),A.canSkipUntil=dt.optionalFloat("CAN-SKIP-UNTIL",0),A.canSkipDateRanges=A.canSkipUntil>0&&dt.bool("CAN-SKIP-DATERANGES"),A.partHoldBack=dt.optionalFloat("PART-HOLD-BACK",0),A.holdBack=dt.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Ne=new p.AttrList(_e);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(_e),X,x,mt,tt);je.push(Qe),X.duration+=Qe.duration;break}case"PRELOAD-HINT":{var Xe=new p.AttrList(_e);A.preloadHint=Xe;break}case"RENDITION-REPORT":{var Be=new p.AttrList(_e);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&&(E(X,V),X.cc=W,A.fragmentHint=X);var Ie=D.length,Me=D[0],Ee=D[Ie-1];if(te+=A.skippedSegments*A.targetduration,te>0&&Ie&&Ee){A.averagetargetduration=te/Ie;var Ae=Ee.sn;A.endSN=Ae!=="initSegment"?Ae:0,Me&&(A.startCC=Me.cc,Me.initSegment||A.fragments.every(function(Le){return Le.relurl&&n(Le.relurl)})&&(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=Ee.relurl,X.level=l,X.sn="initSegment",Me.initSegment=X,A.needSidxRanges=!0))}else A.endSN=0,A.startCC=0;return A.fragmentHint&&(te+=A.fragmentHint.duration),A.totalduration=te,A.endCC=W,ce>0&&m(D,ce),A},_}();function f(_,g){["video","audio","text"].forEach(function(y){var x=_.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],_=_.filter(function(S){return x.indexOf(S)===-1})}}),g.unknownCodecs=_}function v(_,g,y){var x=g[y];x&&(_[y]=x)}function m(_,g){for(var y=_[g],x=g;x--;){var l=_[x];if(!l)return;l.programDateTime=y.programDateTime-l.duration*1e3,y=l}}function E(_,g){_.rawProgramDateTime?_.programDateTime=Date.parse(_.rawProgramDateTime):g!=null&&g.programDateTime&&(_.programDateTime=g.endProgramDateTime),Object(w.isFiniteNumber)(_.programDateTime)||(_.programDateTime=null,_.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,E=new m(t);return n.loader=E,this.loaders[n.type]=E,E},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,E=t.deliveryDirectives;this.load({id:f,groupId:null,level:v,responseType:"text",type:p.PlaylistContextType.LEVEL,url:m,deliveryDirectives:E})},h.onAudioTrackLoading=function(n,t){var f=t.id,v=t.groupId,m=t.url,E=t.deliveryDirectives;this.load({id:f,groupId:v,level:null,responseType:"text",type:p.PlaylistContextType.AUDIO_TRACK,url:m,deliveryDirectives:E})},h.onSubtitleTrackLoading=function(n,t){var f=t.id,v=t.groupId,m=t.url,E=t.deliveryDirectives;this.load({id:f,groupId:v,level:null,responseType:"text",type:p.PlaylistContextType.SUBTITLE_TRACK,url:m,deliveryDirectives:E})},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:E=f.manifestLoadingMaxRetry,_=f.manifestLoadingTimeOut,g=f.manifestLoadingRetryDelay,y=f.manifestLoadingMaxRetryTimeout;break;case p.PlaylistContextType.LEVEL:case p.PlaylistContextType.AUDIO_TRACK:case p.PlaylistContextType.SUBTITLE_TRACK:E=0,_=f.levelLoadingTimeOut;break;default:E=f.levelLoadingMaxRetry,_=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&&(_=Math.min(Math.max(l*3,S*.8)*1e3,_))}}var O={timeout:_,maxRetry:E,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,E=n.data,_=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:_,stats:t,networkDetails:v,sessionData:x})},h.handleTrackOrLevelPlaylist=function(n,t,f,v){var m=this.hls,E=f.id,_=f.level,g=f.type,y=a(n,f),x=Object(w.isFiniteNumber)(E)?E:0,l=Object(w.isFiniteNumber)(_)?_: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:_,levelDetails:O,id:E,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=E.info,y=m.fragments[_];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,E=!1,_=this.getInternalLoader(n);switch(n.type){case p.PlaylistContextType.MANIFEST:m=f?b.ErrorDetails.MANIFEST_LOAD_TIMEOUT:b.ErrorDetails.MANIFEST_LOAD_ERROR,E=!0;break;case p.PlaylistContextType.LEVEL:m=f?b.ErrorDetails.LEVEL_LOAD_TIMEOUT:b.ErrorDetails.LEVEL_LOAD_ERROR,E=!1;break;case p.PlaylistContextType.AUDIO_TRACK:m=f?b.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:b.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,E=!1;break;case p.PlaylistContextType.SUBTITLE_TRACK:m=f?b.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:b.ErrorDetails.SUBTITLE_LOAD_ERROR,E=!1;break}_&&this.resetInternalLoader(n.type);var g={type:b.ErrorTypes.NETWORK_ERROR,details:m,fatal:E,url:n.url,loader:_,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,E=f.level,_=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:E||0,id:_||0,stats:t,networkDetails:v,deliveryDirectives:l});break;case p.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(P.Events.AUDIO_TRACK_LOADED,{details:x,id:_||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:_||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<p;o++)d[o-1]=arguments[o];for(var a=d.length,u=a;a--;)c+=d[a].byteLength;var s=new Uint8Array(c);for(s[0]=c>>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<u;a++)s.set(d[a],c),c+=d[a].byteLength;return s},b.hdlr=function(C){return b.box(b.types.hdlr,b.HDLR_TYPES[C])},b.mdat=function(C){return b.box(b.types.mdat,C)},b.mdhd=function(C,c){c*=C;var p=Math.floor(c/(w+1)),d=Math.floor(c%(w+1));return b.box(b.types.mdhd,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,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<c.length;d++)o=c[d].flags,p[d+4]=o.dependsOn<<4|o.isDependedOn<<2|o.hasRedundancy;return b.box(b.types.sdtp,p)},b.stbl=function(C){return b.box(b.types.stbl,b.stsd(C),b.box(b.types.stts,b.STTS),b.box(b.types.stsc,b.STSC),b.box(b.types.stsz,b.STSZ),b.box(b.types.stco,b.STCO))},b.avc1=function(C){var c=[],p=[],d,o,a;for(d=0;d<C.sps.length;d++)o=C.sps[d],a=o.byteLength,c.push(a>>>8&255),c.push(a&255),c=c.concat(Array.prototype.slice.call(o));for(d=0;d<C.pps.length;d++)o=C.pps[d],a=o.byteLength,p.push(a>>>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<d;u++)s=p[u],h=s.duration,i=s.size,n=s.flags,t=s.cts,a.set([h>>>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(_){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var x in y)Object.prototype.hasOwnProperty.call(y,x)&&(_[x]=y[x])}return _},o.apply(this,arguments)}var a=10*1e3,u=1024,s=1152,h=null,i=null,n=!1,t=function(){function _(y,x,l,S){if(S===void 0&&(S=""),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=void 0,this._initDTS=void 0,this.nextAvcDts=null,this.nextAudioPts=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.observer=y,this.config=x,this.typeSupported=l,this.ISGenerated=!1,h===null){var O=navigator.userAgent||"",A=O.match(/Chrome\/(\d+)/i);h=A?parseInt(A[1]):0}if(i===null){var D=navigator.userAgent.match(/Safari\/(\d+)/i);i=D?parseInt(D[1]):0}n=!!h&&h<75||!!i&&i<600}var g=_.prototype;return g.destroy=function(){},g.resetTimeStamp=function(x){c.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=x},g.resetNextTimestamp=function(){c.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},g.resetInitSegment=function(){c.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},g.getVideoStartPts=function(x){var l=!1,S=x.reduce(function(O,A){var D=A.pts-O;return D<-4294967296?(l=!0,f(O,A.pts)):D>0?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 _e=this.isVideoContiguous,Ge=-1;if(Pe&&(Ge=v(l.samples),!_e&&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,_e,me)}}else Pe&&(H=this.remuxVideo(l,ee,_e,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;Pe<B;Pe++){var ye=D[Pe];if(ye.pts=f(ye.pts-H,te),ye.dts=f(ye.dts-H,te),ye.dts>ye.pts){var _e=9e4*.2;ce=Math.max(Math.min(ce,ye.pts-ye.dts),-1*_e)}ye.dts<D[Pe>0?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(ce<Ge*-2){c.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(d.toMsFromMpegTsClock)(-Ge,!0)+" ms");for(var Ue=ce,Fe=0;Fe<B;Fe++)D[Fe].dts=Ue=Math.max(Ue,D[Fe].pts-Ge),D[Fe].pts=Math.max(Ue,D[Fe].pts)}else{c.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(d.toMsFromMpegTsClock)(ce,!0)+" ms to overcome this issue");for(var He=0;He<B;He++)D[He].dts=D[He].dts+ce}X=D[0].dts}if(S){var be=X-te,me=be>Ge,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;k<B;k++){for(var U=D[k],q=U.units,$=q.length,J=0,xe=0;xe<$;xe++)J+=q[xe].data.length;re+=J,nt+=$,U.length=J,U.dts=Math.max(U.dts,X),U.pts=Math.max(U.pts,U.dts,0),Y=Math.min(U.pts,Y),ee=Math.max(U.pts,ee)}ne=D[B-1].dts;var ke=re+4*nt+8,dt;try{dt=new Uint8Array(ke)}catch(Lt){this.observer.emit(T.Events.ERROR,T.Events.ERROR,{type:C.ErrorTypes.MUX_ERROR,details:C.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:ke,reason:"fail allocating video mdat "+ke});return}var Ne=new DataView(dt.buffer);Ne.setUint32(0,ke),dt.set(b.default.types.mdat,4);for(var je=0;je<B;je++){for(var tt=D[je],mt=tt.units,Qe=0,Xe=0,Be=mt.length;Xe<Be;Xe++){var Ie=mt[Xe],Me=Ie.data,Ee=Ie.data.byteLength;Ne.setUint32(W,Ee),W+=4,dt.set(Me,W),W+=Ee,Qe+=4+Ee}if(je<B-1)V=D[je+1].dts-tt.dts;else{var Ae=this.config,Le=tt.dts-D[je>0?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<ne.length;Se++){var ye=ne[Se],_e=ye.pts,Ge=_e-Pe,Ue=Math.abs(1e3*Ge/D);if(Ge<=-Ce*te&&de)Se===0&&(c.logger.warn("Audio frame @ "+(_e/D).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*Ge/D)+" ms."),this.nextAudioPts=ee=Pe=_e);else if(Ge>=Ce*te&&Ue<a&&de){var Fe=Math.round(Ge/te);Pe=_e-Fe*te,Pe<0&&(Fe--,Pe+=te),Se===0&&(this.nextAudioPts=ee=Pe),c.logger.warn("[mp4-remuxer]: Injecting "+Fe+" audio frame @ "+(Pe/D).toFixed(3)+"s due to "+Math.round(1e3*Ge/D)+" ms gap.");for(var He=0;He<Fe;He++){var be=Math.max(Pe,0),me=P.default.getSilentFrame(x.manifestCodec||x.codec,x.channelCount);me||(c.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),me=ye.unit.subarray()),ne.splice(Se,0,{unit:me,pts:be}),Pe+=te,Se++}}ye.pts=Pe,Pe+=te}for(var We=null,ze=null,nt,re=0,k=ne.length;k--;)re+=ne[k].unit.byteLength;for(var U=0,q=ne.length;U<q;U++){var $=ne[U],J=$.unit,xe=$.pts;if(ze!==null){var ke=X[U-1];ke.duration=Math.round((xe-ze)/B)}else if(S&&x.isAAC&&(xe=ee),We=xe,re>0){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;Y<V;Y++){var ee=H+Y*W;ne.push({unit:X,pts:ee,dts:ee})}return x.samples=ne,this.remuxAudio(x,l,S,!1)},g.remuxID3=function(x,l){var S=x.samples.length;if(!S)return;for(var O=x.inputTimeScale,A=this._initPTS,D=this._initDTS,I=0;I<S;I++){var B=x.samples[I];B.pts=f(B.pts-A,l*O)/O,B.dts=f(B.dts-D,l*O)/O}var H=x.samples;return x.samples=[],{samples:H}},g.remuxText=function(x,l){var S=x.samples.length;if(!S)return;for(var O=x.inputTimeScale,A=this._initPTS,D=0;D<S;D++){var I=x.samples[D];I.pts=f(I.pts-A,l*O)/O}x.samples.sort(function(H,te){return H.pts-te.pts});var B=x.samples;return x.samples=[],{samples:B}},_}();function f(_,g){var y;if(g===null)return _;for(g<_?y=-8589934592:y=8589934592;Math.abs(_-g)>4294967296;)_+=y;return _}function v(_){for(var g=0;g<_.length;g++)if(_[g].key)return g;return-1}var m=function(g,y,x,l){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=y,this.size=x,this.cts=l,this.flags=new E(g)},E=function(g){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=g?2:1,this.isNonSync=g?0:1}},"./src/remux/passthrough-remuxer.ts":function(le,Q,j){"use strict";j.r(Q);var w=j("./src/polyfills/number.ts"),P=j("./src/utils/mp4-tools.ts"),b=j("./src/loader/fragment.ts"),T=j("./src/utils/logger.ts"),C=function(){function d(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=void 0,this.initTracks=void 0,this.lastEndDTS=null}var o=d.prototype;return o.destroy=function(){},o.resetTimeStamp=function(u){this.initPTS=u,this.lastEndDTS=null},o.resetNextTimestamp=function(){this.lastEndDTS=null},o.resetInitSegment=function(u,s,h){this.audioCodec=s,this.videoCodec=h,this.generateInitSegment(u),this.emitInitSegment=!0},o.generateInitSegment=function(u){var s=this.audioCodec,h=this.videoCodec;if(!u||!u.byteLength){this.initTracks=void 0,this.initData=void 0;return}var i=this.initData=Object(P.parseInitSegment)(u);s||(s=p(i.audio,b.ElementaryStreamTypes.AUDIO)),h||(h=p(i.video,b.ElementaryStreamTypes.VIDEO));var n={};i.audio&&i.video?n.audiovideo={container:"video/mp4",codec:s+","+h,initSegment:u,id:"main"}:i.audio?n.audio={container:"audio/mp4",codec:s,initSegment:u,id:"audio"}:i.video?n.video={container:"video/mp4",codec:h,initSegment:u,id:"main"}:T.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=n},o.remux=function(u,s,h,i,n){var t=this.initPTS,f=this.lastEndDTS,v={audio:void 0,video:void 0,text:i,id3:h,initSegment:void 0};Object(w.isFiniteNumber)(f)||(f=this.lastEndDTS=n||0);var m=s.samples;if(!m||!m.length)return v;var E={initPTS:void 0,timescale:1},_=this.initData;if((!_||!_.length)&&(this.generateInitSegment(m),_=this.initData),!_||!_.length)return T.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),v;this.emitInitSegment&&(E.tracks=this.initTracks,this.emitInitSegment=!1),Object(w.isFiniteNumber)(t)||(this.initPTS=E.initPTS=t=c(_,m,f));var g=Object(P.getDuration)(m,_),y=f,x=g+y;Object(P.offsetStartDTS)(_,m,t),g>0?this.lastEndDTS=x:(T.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var l=!!_.audio,S=!!_.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=E,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;o<d.length;o++){var a=d[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(p,a.key,a)}}function P(p,d,o){return d&&w(p.prototype,d),o&&w(p,o),p}var b;(function(p){p.No="",p.Yes="YES",p.v2="v2"})(b||(b={}));function T(p,d){var o=p.canSkipUntil,a=p.canSkipDateRanges,u=p.endSN,s=d!==void 0?d-u:0;return o&&s<o?a?b.v2:b.Yes:b.No}var C=function(){function p(o,a,u){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=o,this.part=a,this.skip=u}var d=p.prototype;return d.addDirectives=function(a){var u=new self.URL(a);return this.msn!==void 0&&u.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&u.searchParams.set("_HLS_part",this.part.toString()),this.skip&&u.searchParams.set("_HLS_skip",this.skip),u.toString()},p}(),c=function(){function p(d){this.attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.unknownCodecs=void 0,this.audioGroupIds=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.textGroupIds=void 0,this.url=void 0,this._urlId=0,this.url=[d.url],this.attrs=d.attrs,this.bitrate=d.bitrate,d.details&&(this.details=d.details),this.id=d.id||0,this.name=d.name,this.width=d.width||0,this.height=d.height||0,this.audioCodec=d.audioCodec,this.videoCodec=d.videoCodec,this.unknownCodecs=d.unknownCodecs,this.codecSet=[d.videoCodec,d.audioCodec].filter(function(o){return o}).join(",").replace(/\.[^.,]+/g,"")}return P(p,[{key:"maxBitrate",get:function(){return Math.max(this.realBitrate,this.bitrate)}},{key:"uri",get:function(){return this.url[this._urlId]||""}},{key:"urlId",get:function(){return this._urlId},set:function(o){var a=o%this.url.length;this._urlId!==a&&(this.details=void 0,this._urlId=a)}}]),p}()},"./src/types/loader.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"PlaylistContextType",function(){return w}),j.d(Q,"PlaylistLevelType",function(){return P});var w;(function(b){b.MANIFEST="manifest",b.LEVEL="level",b.AUDIO_TRACK="audioTrack",b.SUBTITLE_TRACK="subtitleTrack"})(w||(w={}));var P;(function(b){b.MAIN="main",b.AUDIO="audio",b.SUBTITLE="subtitle"})(P||(P={}))},"./src/types/transmuxer.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"ChunkMetadata",function(){return w});var w=function(T,C,c,p,d,o){p===void 0&&(p=0),d===void 0&&(d=-1),o===void 0&&(o=!1),this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing=P(),this.buffering={audio:P(),video:P(),audiovideo:P()},this.level=T,this.sn=C,this.id=c,this.size=p,this.part=d,this.partial=o};function P(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"AttrList",function(){return b});var w=/^(\d+)x(\d+)$/,P=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,b=function(){function T(c){typeof c=="string"&&(c=T.parseAttrList(c));for(var p in c)c.hasOwnProperty(p)&&(this[p]=c[p])}var C=T.prototype;return C.decimalInteger=function(p){var d=parseInt(this[p],10);return d>Number.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;a<d.length/2;a++)o[a]=parseInt(d.slice(a*2,a*2+2),16);return o}else return null},C.hexadecimalIntegerAsNumber=function(p){var d=parseInt(this[p],16);return d>Number.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.length;o++)if(p>=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;u<o.length;u++)a.push({start:o.start(u),end:o.end(u)});return this.bufferedInfo(a,p,d)}}catch(s){}return{len:0,start:p,end:p,nextStart:void 0}},T.bufferedInfo=function(c,p,d){p=Math.max(0,p),c.sort(function(E,_){var g=E.start-_.start;return g||_.end-E.end});var o=[];if(d)for(var a=0;a<c.length;a++){var u=o.length;if(u){var s=o[u-1].end;c[a].start-s<d?c[a].end>s&&(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<o.length;f++){var v=o[f].start,m=o[f].end;if(p+d>=v&&p<m)n=v,t=m,h=t-p;else if(p+d<v){i=v;break}}return{len:h,start:n||0,end:t||0,nextStart:i}},T.getBuffered=function(c){try{return c.buffered}catch(p){return w.logger.log("failed to get media.buffered",p),P}},T}()},"./src/utils/cea-608-parser.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"Row",function(){return t}),j.d(Q,"CaptionScreen",function(){return f});var w=j("./src/utils/logger.ts"),P={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},b=function(x){var l=x;return P.hasOwnProperty(x)&&(l=P[x]),String.fromCharCode(l)},T=15,C=100,c={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},p={17:2,18:4,21:6,22:8,23:10,19:13,20:15},d={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},o={25:2,26:4,29:6,30:8,31:10,27:13,28:15},a=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],u;(function(y){y[y.ERROR=0]="ERROR",y[y.TEXT=1]="TEXT",y[y.WARNING=2]="WARNING",y[y.INFO=2]="INFO",y[y.DEBUG=3]="DEBUG",y[y.DATA=3]="DATA"})(u||(u={}));var s=function(){function y(){this.time=null,this.verboseLevel=u.ERROR}var x=y.prototype;return x.log=function(S,O){this.verboseLevel>=S&&w.logger.log(this.time+" ["+S+"] "+O)},y}(),h=function(x){for(var l=[],S=0;S<x.length;S++)l.push(x[S].toString(16));return l},i=function(){function y(l,S,O,A,D){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=l||"white",this.underline=S||!1,this.italics=O||!1,this.background=A||"black",this.flash=D||!1}var x=y.prototype;return x.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},x.setStyles=function(S){for(var O=["foreground","underline","italics","background","flash"],A=0;A<O.length;A++){var D=O[A];S.hasOwnProperty(D)&&(this[D]=S[D])}},x.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},x.equals=function(S){return this.foreground===S.foreground&&this.underline===S.underline&&this.italics===S.italics&&this.background===S.background&&this.flash===S.flash},x.copy=function(S){this.foreground=S.foreground,this.underline=S.underline,this.italics=S.italics,this.background=S.background,this.flash=S.flash},x.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},y}(),n=function(){function y(l,S,O,A,D,I){this.uchar=void 0,this.penState=void 0,this.uchar=l||" ",this.penState=new i(S,O,A,D,I)}var x=y.prototype;return x.reset=function(){this.uchar=" ",this.penState.reset()},x.setChar=function(S,O){this.uchar=S,this.penState.copy(O)},x.setPenState=function(S){this.penState.copy(S)},x.equals=function(S){return this.uchar===S.uchar&&this.penState.equals(S.penState)},x.copy=function(S){this.uchar=S.uchar,this.penState.copy(S.penState)},x.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},y}(),t=function(){function y(l){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var S=0;S<C;S++)this.chars.push(new n);this.logger=l,this.pos=0,this.currPenState=new i}var x=y.prototype;return x.equals=function(S){for(var O=!0,A=0;A<C;A++)if(!this.chars[A].equals(S.chars[A])){O=!1;break}return O},x.copy=function(S){for(var O=0;O<C;O++)this.chars[O].copy(S.chars[O])},x.isEmpty=function(){for(var S=!0,O=0;O<C;O++)if(!this.chars[O].isEmpty()){S=!1;break}return S},x.setCursor=function(S){this.pos!==S&&(this.pos=S),this.pos<0?(this.logger.log(u.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>C&&(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<O+1;A++)this.chars[A].setPenState(this.currPenState);this.setCursor(O)},x.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},x.insertChar=function(S){S>=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;O<C;O++)this.chars[O].reset()},x.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},x.clearToEndOfRow=function(){this.clearFromPos(this.pos)},x.getTextString=function(){for(var S=[],O=!0,A=0;A<C;A++){var D=this.chars[A].uchar;D!==" "&&(O=!1),S.push(D)}return O?"":S.join("")},x.setPenStyles=function(S){this.currPenState.setStyles(S);var O=this.chars[this.pos];O.setPenState(this.currPenState)},y}(),f=function(){function y(l){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var S=0;S<T;S++)this.rows.push(new t(l));this.logger=l,this.currRow=T-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var x=y.prototype;return x.reset=function(){for(var S=0;S<T;S++)this.rows[S].clear();this.currRow=T-1},x.equals=function(S){for(var O=!0,A=0;A<T;A++)if(!this.rows[A].equals(S.rows[A])){O=!1;break}return O},x.copy=function(S){for(var O=0;O<T;O++)this.rows[O].copy(S.rows[O])},x.isEmpty=function(){for(var S=!0,O=0;O<T;O++)if(!this.rows[O].isEmpty()){S=!1;break}return S},x.backSpace=function(){var S=this.rows[this.currRow];S.backSpace()},x.clearToEndOfRow=function(){var S=this.rows[this.currRow];S.clearToEndOfRow()},x.insertChar=function(S){var O=this.rows[this.currRow];O.insertChar(S)},x.setPen=function(S){var O=this.rows[this.currRow];O.setPenStyles(S)},x.moveCursor=function(S){var O=this.rows[this.currRow];O.moveCursor(S)},x.setCursor=function(S){this.logger.log(u.INFO,"setCursor: "+S);var O=this.rows[this.currRow];O.setCursor(S)},x.setPAC=function(S){this.logger.log(u.INFO,"pacData = "+JSON.stringify(S));var O=S.row-1;if(this.nrRollUpRows&&O<this.nrRollUpRows-1&&(O=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==O){for(var A=0;A<T;A++)this.rows[A].clear();var D=this.currRow+1-this.nrRollUpRows,I=this.lastOutputScreen;if(I){var B=I.rows[D].cueStartTime,H=this.logger.time;if(B&&H!==null&&B<H)for(var te=0;te<this.nrRollUpRows;te++)this.rows[O-this.nrRollUpRows+te+1].copy(I.rows[D+te])}}this.currRow=O;var W=this.rows[this.currRow];if(S.indent!==null){var V=S.indent,X=Math.max(V-1,0);W.setCursor(S.indent),S.color=W.chars[X].penState.foreground}var ne={foreground:S.color,underline:S.underline,italics:S.italics,background:"black",flash:!1};this.setPen(ne)},x.setBkgData=function(S){this.logger.log(u.INFO,"bkgData = "+JSON.stringify(S)),this.backSpace(),this.setPen(S),this.insertChar(32)},x.setRollUpRows=function(S){this.nrRollUpRows=S},x.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(u.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(u.TEXT,this.getDisplayText());var S=this.currRow+1-this.nrRollUpRows,O=this.rows.splice(S,1)[0];O.clear(),this.rows.splice(this.currRow,0,O),this.logger.log(u.INFO,"Rolling up")},x.getDisplayText=function(S){S=S||!1;for(var O=[],A="",D=-1,I=0;I<T;I++){var B=this.rows[I].getTextString();B&&(D=I+1,S?O.push("Row "+D+": '"+B+"'"):O.push(B.trim()))}return O.length>0&&(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<S.length;O++)this.writeScreen.insertChar(S[O]);var A=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(u.INFO,A+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(u.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},x.ccRCL=function(){this.logger.log(u.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},x.ccBS=function(){if(this.logger.log(u.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},x.ccAOF=function(){},x.ccAON=function(){},x.ccDER=function(){this.logger.log(u.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},x.ccRU=function(S){this.logger.log(u.INFO,"RU("+S+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(S)},x.ccFON=function(){this.logger.log(u.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},x.ccRDC=function(){this.logger.log(u.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},x.ccTR=function(){this.logger.log(u.INFO,"TR"),this.setMode("MODE_TEXT")},x.ccRTD=function(){this.logger.log(u.INFO,"RTD"),this.setMode("MODE_TEXT")},x.ccEDM=function(){this.logger.log(u.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},x.ccCR=function(){this.logger.log(u.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},x.ccENM=function(){this.logger.log(u.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},x.ccEOC=function(){if(this.logger.log(u.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var S=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=S,this.writeScreen=this.nonDisplayedMemory,this.logger.log(u.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},x.ccTO=function(S){this.logger.log(u.INFO,"TO("+S+") - Tab Offset"),this.writeScreen.moveCursor(S)},x.ccMIDROW=function(S){var O={flash:!1};if(O.underline=S%2===1,O.italics=S>=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<O.length;H+=2){if(D=O[H]&127,I=O[H+1]&127,D===0&&I===0)continue;if(this.logger.log(u.DATA,"["+h([O[H],O[H+1]])+"] -> ("+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(_(S,O,A))return E(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),E(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(_(S,O,D))return E(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)),E(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(",")),E(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),E(S,O,this.cmdHistory),!0},x.reset=function(){for(var S=0;S<Object.keys(this.channels).length;S++){var O=this.channels[S];O&&O.reset()}this.cmdHistory=g()},x.cueSplitAtTime=function(S){for(var O=0;O<this.channels.length;O++){var A=this.channels[O];A&&A.cueSplitAtTime(S)}},y}();function E(y,x,l){l.a=y,l.b=x}function _(y,x,l){return l.a===y&&l.b===x}function g(){return{a:null,b:null}}Q.default=m},"./src/utils/codecs.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"isCodecType",function(){return P}),j.d(Q,"isCodecSupportedInMp4",function(){return b});var w={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,av01:!0,drac:!0,dvav:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0},text:{stpp:!0,wvtt:!0}};function P(T,C){var c=w[C];return!!c&&c[T.slice(0,4)]===!0}function b(T,C){return MediaSource.isTypeSupported((C||"video")+'/mp4;codecs="'+T+'"')}},"./src/utils/cues.ts":function(le,Q,j){"use strict";j.r(Q);var w=j("./src/utils/vttparser.ts"),P=j("./src/utils/webvtt-parser.ts"),b=j("./src/utils/texttrack-utils.ts"),T=/\s/,C={newCue:function(p,d,o,a){for(var u=[],s,h,i,n,t,f=self.VTTCue||self.TextTrackCue,v=0;v<a.rows.length;v++)if(s=a.rows[v],i=!0,n=0,t="",!s.isEmpty()){for(var m=0;m<s.chars.length;m++)T.test(s.chars[m].uchar)&&i?n++:(t+=s.chars[m].uchar,i=!1);s.cueStartTime=d,d===o&&(o+=1e-4),n>=16?n--:n++;var E=Object(w.fixLineBreaks)(t.trim()),_=Object(P.generateCueId)(d,o,E);(!p||!p.cues||!p.cues.getCueById(_))&&(h=new f(d,o,E),h.id=_,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;f<v;f++){var m=i[f];if(m&&m.cc===n){t=m;break}}return t}function C(i,n,t){return!!(n.details&&(t.endCC>t.startCC||i&&i.cc<t.startCC))}function c(i,n){var t=i.fragments,f=n.fragments;if(!f.length||!t.length){P.logger.log("No fragments to align");return}var v=T(t,f[0].cc);if(!v||v&&!v.startPTS){P.logger.log("No frag in previous level to align on");return}return v}function p(i,n){if(i){var t=i.start+n;i.start=i.startPTS=t,i.endPTS=t+i.duration}}function d(i,n){for(var t=n.fragments,f=0,v=t.length;f<v;f++)p(t[f],i);n.fragmentHint&&p(n.fragmentHint,i),n.alignedSliding=!0}function o(i,n,t){if(!n)return;a(i,t,n),!t.alignedSliding&&n.details&&u(t,n.details),!t.alignedSliding&&n.details&&!t.skippedSegments&&Object(b.adjustSliding)(n.details,t)}function a(i,n,t){if(C(i,t,n)){var f=c(t.details,n);f&&Object(w.isFiniteNumber)(f.start)&&(P.logger.log("Adjusting PTS using last level due to CC increase within current level "+n.url),d(f.start,n))}}function u(i,n){if(!n.fragments.length||!i.hasProgramDateTime||!n.hasProgramDateTime)return;var t=n.fragments[0].programDateTime,f=i.fragments[0].programDateTime,v=(f-t)/1e3+n.fragments[0].start;v&&Object(w.isFiniteNumber)(v)&&(P.logger.log("Adjusting PTS using programDateTime delta "+(f-t)+"ms, sliding:"+v.toFixed(3)+" "+i.url+" "),d(v,i))}function s(i,n){var t=i.programDateTime;if(!t)return;var f=(t-n)/1e3;i.start=i.startPTS=f,i.endPTS=f+i.duration}function h(i,n){if(!n.fragments.length||!i.hasProgramDateTime||!n.hasProgramDateTime)return;var t=n.fragments[0].programDateTime,f=n.fragments[0].start,v=t-f*1e3;i.fragments.forEach(function(m){s(m,v)}),i.fragmentHint&&s(i.fragmentHint,v),i.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(le,Q,j){"use strict";j.r(Q);var w=j("./src/utils/ewma.ts"),P=function(){function b(C,c,p){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=p,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new w.default(C),this.fast_=new w.default(c)}var T=b.prototype;return T.update=function(c,p){var d=this.slow_,o=this.fast_;this.slow_.halfLife!==c&&(this.slow_=new w.default(c,d.getEstimate(),d.getTotalWeight())),this.fast_.halfLife!==p&&(this.fast_=new w.default(p,o.getEstimate(),o.getTotalWeight()))},T.sample=function(c,p){c=Math.max(c,this.minDelayMs_);var d=8*p,o=c/1e3,a=d/o;this.fast_.sample(o,a),this.slow_.sample(o,a)},T.canEstimate=function(){var c=this.fast_;return c&&c.getTotalWeight()>=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(E){if(E===null||!d(E))return E;if(typeof E!="function")throw new TypeError("Super expression must either be null or a function");if(typeof v!="undefined"){if(v.has(E))return v.get(E);v.set(E,_)}function _(){return c(E,arguments,a(this).constructor)}return _.prototype=Object.create(E.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),o(_,E)},C(f)}function c(f,v,m){return p()?c=Reflect.construct:c=function(_,g,y){var x=[null];x.push.apply(x,g);var l=Function.bind.apply(_,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 E.__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<arguments.length;v++){var m=arguments[v];for(var E in m)Object.prototype.hasOwnProperty.call(m,E)&&(f[E]=m[E])}return f},u.apply(this,arguments)}function s(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(f){}return!1}var h=function(){function f(m){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=void 0,this.response=void 0,this.controller=void 0,this.context=void 0,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=m.fetchSetup||n,this.controller=new self.AbortController,this.stats=new P.LoadStats}var v=f.prototype;return v.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},v.abortInternal=function(){var E=this.response;(!E||!E.ok)&&(this.stats.aborted=!0,this.controller.abort())},v.abort=function(){var E;this.abortInternal(),(E=this.callbacks)!==null&&E!==void 0&&E.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},v.load=function(E,_,g){var y=this,x=this.stats;if(x.loading.start)throw new Error("Loader can only be used once.");x.loading.start=self.performance.now();var l=i(E,this.controller.signal),S=g.onProgress,O=E.responseType==="arraybuffer",A=O?"byteLength":"length";this.context=E,this.config=_,this.callbacks=g,this.request=this.fetchSetup(E,l),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){y.abortInternal(),g.onTimeout(x,E,y.response)},_.timeout),self.fetch(this.request).then(function(D){if(y.response=y.loader=D,!D.ok){var I=D.status,B=D.statusText;throw new t(B||"fetch, bad network response",I,D)}return x.loading.first=Math.max(self.performance.now(),x.loading.start),x.total=parseInt(D.headers.get("Content-Length")||"0"),S&&Object(w.isFiniteNumber)(_.highWaterMark)?y.loadProgressively(D,x,E,_.highWaterMark,S):O?D.arrayBuffer():D.text()}).then(function(D){var I=y.response;self.clearTimeout(y.requestTimeout),x.loading.end=Math.max(self.performance.now(),x.loading.first),x.loaded=x.total=D[A];var B={url:I.url,data:D};S&&!Object(w.isFiniteNumber)(_.highWaterMark)&&S(x,E,D,I),g.onSuccess(B,x,E,I)}).catch(function(D){if(self.clearTimeout(y.requestTimeout),x.aborted)return;var I=D.code||0;g.onError({code:I,text:D.message},E,D.details)})},v.getCacheAge=function(){var E=null;if(this.response){var _=this.response.headers.get("age");E=_?parseFloat(_):null}return E},v.loadProgressively=function(E,_,g,y,x){y===void 0&&(y=0);var l=new b.default,S=E.body.getReader(),O=function A(){return S.read().then(function(D){if(D.done)return l.dataLength&&x(_,g,l.flush(),E),Promise.resolve(new ArrayBuffer(0));var I=D.value,B=I.length;return _.loaded+=B,B<y||l.dataLength?(l.push(I),l.dataLength>=y&&x(_,g,l.flush(),E)):x(_,g,I,E),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=E,g.details=_,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<arguments.length;x++){var l=arguments[x];for(var S in l)Object.prototype.hasOwnProperty.call(l,S)&&(y[S]=l[S])}return y},p.apply(this,arguments)}var d="stpp.ttml.im1t",o=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,a=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,u={left:"start",center:"center",right:"end",start:"start",end:"end"};function s(y,x,l,S,O){var A=Object(w.findBox)(new Uint8Array(y),["mdat"]);if(A.length===0){O(new Error("Could not parse IMSC1 mdat"));return}var D=A[0],I=Object(T.utf8ArrayToStr)(new Uint8Array(y,D.start,D.end-D.start)),B=Object(C.toTimescaleFromScale)(x,1,l);try{S(h(I,B))}catch(H){O(H)}}function h(y,x){var l=new DOMParser,S=l.parseFromString(y,"text/xml"),O=S.getElementsByTagName("tt")[0];if(!O)throw new Error("Invalid ttml");var A={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},D=Object.keys(A).reduce(function(W,V){return W[V]=O.getAttribute("ttp:"+V)||A[V],W},{}),I=O.getAttribute("xml:space")!=="preserve",B=n(i(O,"styling","style")),H=n(i(O,"layout","region")),te=i(O,"body","[begin]");return[].map.call(te,function(W){var V=t(W,I);if(!V||!W.hasAttribute("begin"))return null;var X=E(W.getAttribute("begin"),D),ne=E(W.getAttribute("dur"),D),Y=E(W.getAttribute("end"),D);if(X===null)throw m(W);if(Y===null){if(ne===null)throw m(W);Y=X+ne}var ee=new b.default(X-x,Y-x,V);ee.id=Object(c.generateCueId)(ee.startTime,ee.endTime,ee.text);var ce=H[W.getAttribute("region")],de=B[W.getAttribute("style")];ee.position=10,ee.size=80;var Ce=f(ce,de),Se=Ce.textAlign;if(Se){var Pe=u[Se];Pe&&(ee.lineAlign=Pe),ee.align=Se}return p(ee,Ce),ee}).filter(function(W){return W!==null})}function i(y,x,l){var S=y.getElementsByTagName(x)[0];return S?[].slice.call(S.querySelectorAll(l)):[]}function n(y){return y.reduce(function(x,l){var S=l.getAttribute("xml:id");return S&&(x[S]=l),x},{})}function t(y,x){return[].slice.call(y.childNodes).reduce(function(l,S,O){var A;return S.nodeName==="br"&&O?l+`
|
|
|
`:(A=S.childNodes)!==null&&A!==void 0&&A.length?t(S,x):x?l+S.textContent.trim().replace(/\s+/g," "):l+S.textContent},"")}function f(y,x){var l="http://www.w3.org/ns/ttml#styling",S=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return S.reduce(function(O,A){var D=v(x,l,A)||v(y,l,A);return D&&(O[A]=D),O},{})}function v(y,x,l){return y.hasAttributeNS(x,l)?y.getAttributeNS(x,l):null}function m(y){return new Error("Could not parse ttml timestamp "+y)}function E(y,x){if(!y)return null;var l=Object(P.parseTimeStamp)(y);return l===null&&(o.test(y)?l=_(y,x):a.test(y)&&(l=g(y,x))),l}function _(y,x){var l=o.exec(y),S=(l[4]|0)+(l[5]|0)/x.subFrameRate;return(l[1]|0)*3600+(l[2]|0)*60+(l[3]|0)+S/x.frameRate}function g(y,x){var l=a.exec(y),S=Number(l[1]),O=l[2];switch(O){case"h":return S*3600;case"m":return S*60;case"ms":return S*1e3;case"f":return S/x.frameRate;case"t":return S/x.tickRate}return S}},"./src/utils/logger.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"enableLogs",function(){return c}),j.d(Q,"logger",function(){return p});var w=function(){},P={trace:w,debug:w,log:w,warn:w,info:w,error:w},b=P;function T(d){var o=self.console[d];return o?o.bind(self.console,"["+d+"] >"):w}function C(d){for(var o=arguments.length,a=new Array(o>1?o-1:0),u=1;u<o;u++)a[u-1]=arguments[u];a.forEach(function(s){b[s]=d[s]?d[s].bind(d):T(s)})}function c(d){if(self.console&&d===!0||typeof d=="object"){C(d,"debug","log","info","warn","error");try{b.log()}catch(o){b=P}}else b=P}var p=b},"./src/utils/mediakeys-helper.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"KeySystems",function(){return w}),j.d(Q,"requestMediaKeySystemAccess",function(){return P});var w;(function(b){b.WIDEVINE="com.widevine.alpha",b.PLAYREADY="com.microsoft.playready"})(w||(w={}));var P=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"getMediaSource",function(){return w});function w(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"bin2str",function(){return C}),j.d(Q,"readUint16",function(){return c}),j.d(Q,"readUint32",function(){return p}),j.d(Q,"writeUint32",function(){return d}),j.d(Q,"findBox",function(){return o}),j.d(Q,"parseSegmentIndex",function(){return a}),j.d(Q,"parseInitSegment",function(){return u}),j.d(Q,"getStartDTS",function(){return s}),j.d(Q,"getDuration",function(){return h}),j.d(Q,"computeRawDurationFromSamples",function(){return i}),j.d(Q,"offsetStartDTS",function(){return n}),j.d(Q,"segmentValidRange",function(){return t}),j.d(Q,"appendUint8Array",function(){return f});var w=j("./src/utils/typed-array.ts"),P=j("./src/loader/fragment.ts"),b=Math.pow(2,32)-1,T=[].push;function C(v){return String.fromCharCode.apply(null,v)}function c(v,m){"data"in v&&(m+=v.start,v=v.data);var E=v[m]<<8|v[m+1];return E<0?65536+E:E}function p(v,m){"data"in v&&(m+=v.start,v=v.data);var E=v[m]<<24|v[m+1]<<16|v[m+2]<<8|v[m+3];return E<0?4294967296+E:E}function d(v,m,E){"data"in v&&(m+=v.start,v=v.data),v[m]=E>>24,v[m+1]=E>>16&255,v[m+2]=E>>8&255,v[m+3]=E&255}function o(v,m){var E=[];if(!m.length)return E;var _,g,y;"data"in v?(_=v.data,g=v.start,y=v.end):(_=v,g=0,y=_.byteLength);for(var x=g;x<y;){var l=p(_,x),S=C(_.subarray(x+4,x+8)),O=l>1?x+l:y;if(S===m[0])if(m.length===1)E.push({data:_,start:x+8,end:O});else{var A=o({data:_,start:x+8,end:O},m.slice(1));A.length&&T.apply(E,A)}x=O}return E}function a(v){var m=o(v,["moov"]),E=m[0],_=E?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<B;H++){var te=S,W=p(x,te);te+=4;var V=W&2147483647,X=(W&2147483648)>>>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:_}}function u(v){for(var m=[],E=o(v,["moov","trak"]),_=0;_<E.length;_++){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(_,["tfdt"])[0],y=g.data[g.start],x=o(_,["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||B<l))return B}return l},null);return x!==null&&isFinite(x)&&(E===null||x<E)?x:E},null)||0}function h(v,m){for(var E=0,_=0,g=0,y=o(v,["moof","traf"]),x=0;x<y.length;x++){var l=y[x],S=o(l,["tfhd"])[0],O=p(S,4),A=m[O];if(!A)continue;var D=A.default,I=p(S,0)|(D==null?void 0:D.flags),B=D==null?void 0:D.duration;I&8&&(I&2?B=p(S,12):B=p(S,8));for(var H=A.timescale||9e4,te=o(l,["trun"]),W=0;W<te.length;W++){if(B){var V=p(te[W],4);E=B*V}else E=i(te[W]);A.type===P.ElementaryStreamTypes.VIDEO?_+=E/H:A.type===P.ElementaryStreamTypes.AUDIO&&(g+=E/H)}}if(_===0&&g===0){var X=a(v);if(X!=null&&X.references)return X.references.reduce(function(ne,Y){return ne+Y.info.duration||0},0)}return _||g}function i(v){var m=p(v,0),E=8;m&1&&(E+=4),m&4&&(E+=4);for(var _=0,g=p(v,4),y=0;y<g;y++){if(m&256){var x=p(v,E);_+=x,E+=4}m&512&&(E+=4),m&1024&&(E+=4),m&2048&&(E+=4)}return _}function n(v,m,E){o(m,["moof","traf"]).forEach(function(_){o(_,["tfhd"]).forEach(function(g){var y=p(g,4),x=v[y];if(!x)return;var l=x.timescale||9e4;o(_,["tfdt"]).forEach(function(S){var O=S.data[S.start],A=p(S,4);if(O===0)d(S,4,A-E*l);else{A*=Math.pow(2,32),A+=p(S,8),A-=E*l,A=Math.max(A,0);var D=Math.floor(A/(b+1)),I=Math.floor(A%(b+1));d(S,4,D),d(S,8,I)}})})})}function t(v){var m={valid:null,remainder:null},E=o(v,["moof"]);if(E){if(E.length<2)return m.remainder=v,m}else return m;var _=E[E.length-1];return m.valid=Object(w.sliceUint8)(v,0,_.start-8),m.remainder=Object(w.sliceUint8)(v,_.start-8),m}function f(v,m){var E=new Uint8Array(v.length+m.length);return E.set(v),E.set(m,v.length),E}},"./src/utils/output-filter.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"default",function(){return w});var w=function(){function P(T,C){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=T,this.trackName=C}var b=P.prototype;return b.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},b.newCue=function(C,c,p){(this.startTime===null||this.startTime>C)&&(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;h<s.length;h++)d.removeCue(s[h]);u==="disabled"&&(d.mode=u)}function c(d,o){if(o<d[0].startTime)return 0;var a=d.length-1;if(o>d[a].endTime)return-1;for(var u=0,s=a;u<=s;){var h=Math.floor((s+u)/2);if(o<d[h].startTime)s=h-1;else if(o>d[h].startTime&&u<a)u=h+1;else return h}return d[u].startTime-o<o-d[s].startTime?u:s}function p(d,o,a){var u=[],s=c(d,o);if(s>-1)for(var h=s,i=d.length;h<i;h++){var n=d[h];if(n.startTime>=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;c<C;c++)T+="["+b.start(c).toFixed(3)+","+b.end(c).toFixed(3)+"]";return T}};Q.default=w},"./src/utils/timescale-conversion.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"toTimescaleFromBase",function(){return P}),j.d(Q,"toTimescaleFromScale",function(){return b}),j.d(Q,"toMsFromMpegTsClock",function(){return T}),j.d(Q,"toMpegTsClockFromTimescale",function(){return C});var w=9e4;function P(c,p,d,o){d===void 0&&(d=1),o===void 0&&(o=!1);var a=c*p*d;return o?Math.round(a):a}function b(c,p,d,o){return d===void 0&&(d=1),o===void 0&&(o=!1),P(c,p,1/d,o)}function T(c,p){return p===void 0&&(p=!1),P(c,1e3,1/w,p)}function C(c,p){return p===void 0&&(p=1),P(c,w,1/p)}},"./src/utils/typed-array.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"sliceUint8",function(){return w});function w(P,b,T){return Uint8Array.prototype.slice?P.slice(b,T):new Uint8Array(Array.prototype.slice.call(P,b,T))}},"./src/utils/vttcue.ts":function(le,Q,j){"use strict";j.r(Q),Q.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var w=["","lr","rl"],P=["start","middle","end","left","right"];function b(d,o){if(typeof o!="string")return!1;if(!Array.isArray(d))return!1;var a=o.toLowerCase();return~d.indexOf(a)?a:!1}function T(d){return b(w,d)}function C(d){return b(P,d)}function c(d){for(var o=arguments.length,a=new Array(o>1?o-1:0),u=1;u<o;u++)a[u-1]=arguments[u];for(var s=1;s<arguments.length;s++){var h=arguments[s];for(var i in h)d[i]=h[i]}return d}function p(d,o,a){var u=this,s={enumerable:!0};u.hasBeenReset=!1;var h="",i=!1,n=d,t=o,f=a,v=null,m="",E=!0,_="auto",g="start",y=50,x="middle",l=50,S="middle";Object.defineProperty(u,"id",c({},s,{get:function(){return h},set:function(A){h=""+A}})),Object.defineProperty(u,"pauseOnExit",c({},s,{get:function(){return i},set:function(A){i=!!A}})),Object.defineProperty(u,"startTime",c({},s,{get:function(){return n},set:function(A){if(typeof A!="number")throw new TypeError("Start time must be set to a number.");n=A,this.hasBeenReset=!0}})),Object.defineProperty(u,"endTime",c({},s,{get:function(){return t},set:function(A){if(typeof A!="number")throw new TypeError("End time must be set to a number.");t=A,this.hasBeenReset=!0}})),Object.defineProperty(u,"text",c({},s,{get:function(){return f},set:function(A){f=""+A,this.hasBeenReset=!0}})),Object.defineProperty(u,"region",c({},s,{get:function(){return v},set:function(A){v=A,this.hasBeenReset=!0}})),Object.defineProperty(u,"vertical",c({},s,{get:function(){return m},set:function(A){var D=T(A);if(D===!1)throw new SyntaxError("An invalid or illegal string was specified.");m=D,this.hasBeenReset=!0}})),Object.defineProperty(u,"snapToLines",c({},s,{get:function(){return E},set:function(A){E=!!A,this.hasBeenReset=!0}})),Object.defineProperty(u,"line",c({},s,{get:function(){return _},set:function(A){if(typeof A!="number"&&A!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");_=A,this.hasBeenReset=!0}})),Object.defineProperty(u,"lineAlign",c({},s,{get:function(){return g},set:function(A){var D=C(A);if(!D)throw new SyntaxError("An invalid or illegal string was specified.");g=D,this.hasBeenReset=!0}})),Object.defineProperty(u,"position",c({},s,{get:function(){return y},set:function(A){if(A<0||A>100)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<t.length;++f)if(n===t[f]){this.set(i,n);break}},s.integer=function(i,n){/^-?\d+$/.test(n)&&this.set(i,parseInt(n,10))},s.percent=function(i,n){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(n)){var t=parseFloat(n);if(t>=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 E=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){E.set(y,h[S].region);break}break;case"vertical":E.alt(y,x,["rl","lr"]);break;case"line":l=x.split(","),E.integer(y,l[0]),E.percent(y,l[0])&&E.set("snapToLines",!1),E.alt(y,l[0],["auto"]),l.length===2&&E.alt("lineAlign",l[1],["start",p,"end"]);break;case"position":l=x.split(","),E.percent(y,l[0]),l.length===2&&E.alt("positionAlign",l[1],["start",p,"end","line-left","line-right","auto"]);break;case"size":E.percent(y,x);break;case"align":E.alt(y,x,["start",p,"end","left","right"]);break}},/:/,/\s/),m.region=E.get("region",null),m.vertical=E.get("vertical","");var _=E.get("line","auto");_==="auto"&&c.line===-1&&(_=-1),m.line=_,m.lineAlign=E.get("lineAlign","start"),m.snapToLines=E.get("snapToLines",!0),m.size=E.get("size",100),m.align=E.get("align",p);var g=E.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(/<br(?: \/)?>/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<g.length&&g[y]!=="\r"&&g[y]!==`
|
|
|
`;)++y;var x=g.substr(0,y);return g[y]==="\r"&&++y,g[y]===`
|
|
|
`&&++y,n.buffer=g.substr(y),x}function f(g){C(g,function(y,x){},/:/)}try{var v="";if(n.state==="INITIAL"){if(!/\r\n|\n/.test(n.buffer))return this;v=t();var m=v.match(/^()?WEBVTT([ \t].*)?$/);if(!m||!m[0])throw new Error("Malformed WebVTT signature.");n.state="HEADER"}for(var E=!1;n.buffer;){if(!/\r\n|\n/.test(n.buffer))return this;E?E=!1:v=t();switch(n.state){case"HEADER":/:/.test(v)?f(v):v||(n.state="ID");continue;case"NOTE":v||(n.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(v)){n.state="NOTE";break}if(!v)continue;if(n.cue=new w.default(0,0,""),n.state="CUE",v.indexOf("-->")===-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 _=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,E){var _=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;_.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)},_.onparsingerror=function(B){A=B},_.onflush=function(){if(A){E(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);_.parse(B+`
|
|
|
`)}),_.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 Ee=!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";Ee=!Qt}else if(Me!==void 0){var bt=ut&&ut.fixed==="right";Ae=!bt}return{fixLeft:Ie,fixRight:Me,lastFixLeft:Ee,firstFixRight:Ae,lastFixRight:Le,firstFixLeft:Te,isSticky:mt.isSticky}}var v=z("sR1s");function 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),Ee=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:Ee,key:Te[ut]},Ht,{additionalProps:Qt,rowType:"header"}))}))}m.displayName="HeaderRow";var E=m;function _(Ne){var je=[];function tt(Be,Ie){var Me=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;je[Me]=je[Me]||[];var Ee=Ie,Ae=Be.filter(Boolean).map(function(Le){var Te={key:Le.key,className:Le.className||"",children:Le.title,column:Le,colStart:Ee},Ze=1,ut=Le.children;return ut&&ut.length>0&&(Ze=tt(ut,Ee,Me+1).reduce(function(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),Ee+=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<mt;Xe+=1)Qe(Xe);return je}function g(Ne){var je=Ne.stickyOffsets,tt=Ne.columns,mt=Ne.flattenColumns,Qe=Ne.onHeaderRow,Xe=b.useContext(t.a),Be=Xe.prefixCls,Ie=Xe.getComponent,Me=b.useMemo(function(){return _(tt)},[tt]),Ee=Ie(["header","wrapper"],"thead"),Ae=Ie(["header","row"],"tr"),Le=Ie(["header","cell"],"th");return b.createElement(Ee,{className:"".concat(Be,"-thead")},Me.map(function(Te,Ze){var ut=b.createElement(E,{key:Ze,flattenColumns:mt,cells:Te,stickyOffsets:je,rowComponent:Ae,cellComponent:Le,onHeaderRow:Qe,index:Ze});return ut}))}var y=g,x=z("hW8S");function l(Ne){for(var je=Ne.colWidths,tt=Ne.columns,mt=Ne.columCount,Qe=[],Xe=mt||tt.length,Be=!1,Ie=Xe-1;Ie>=0;Ie-=1){var Me=je[Ie],Ee=tt&&tt[Ie],Ae=Ee&&Ee[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;mt<je;mt+=1){var Qe=Ne[mt];if(Qe!==void 0)tt[mt]=Qe;else return null}return tt},[Ne.join("_"),je])}var A=b.forwardRef(function(Ne,je){var tt=Ne.noData,mt=Ne.columns,Qe=Ne.flattenColumns,Xe=Ne.colWidths,Be=Ne.columCount,Ie=Ne.stickyOffsets,Me=Ne.direction,Ee=Ne.fixHeader,Ae=Ne.offsetHeader,Le=Ne.stickyClassName,Te=Ne.onScroll,Ze=Object(h.a)(Ne,["noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","offsetHeader","stickyClassName","onScroll"]),ut=b.useContext(t.a),Ct=ut.prefixCls,Ht=ut.scrollbarSize,Qt=ut.isSticky,bt=Qt&&!Ee?0:Ht,Lt=b.useRef(null),at=b.useCallback(function(kt){Object(i.b)(je,kt),Object(i.b)(Lt,kt)},[]);b.useEffect(function(){var kt;function Dt(rt){var Tt=rt.currentTarget,Ft=rt.deltaX;Ft&&(Te({currentTarget:Tt,scrollLeft:Tt.scrollLeft+Ft}),rt.preventDefault())}return(kt=Lt.current)===null||kt===void 0||kt.addEventListener("wheel",Dt),function(){var rt;(rt=Lt.current)===null||rt===void 0||rt.removeEventListener("wheel",Dt)}},[]);var pt=Qe[Qe.length-1],st={fixed:pt?pt.fixed:null,onHeaderCell:function(){return{className:"".concat(Ct,"-cell-scrollbar")}}},De=Object(b.useMemo)(function(){return bt?[].concat(Object(j.a)(mt),[st]):mt},[bt,mt]),Ke=Object(b.useMemo)(function(){return bt?[].concat(Object(j.a)(Qe),[st]):Qe},[bt,Qe]),yt=Object(b.useMemo)(function(){var kt=Ie.right,Dt=Ie.left;return Object(Q.a)(Object(Q.a)({},Ie),{},{left:Me==="rtl"?[].concat(Object(j.a)(Dt.map(function(rt){return rt+bt})),[0]):Dt,right:Me==="rtl"?kt:[].concat(Object(j.a)(kt.map(function(rt){return rt+bt})),[0]),isSticky:Qt})},[bt,Ie,Qt]),ot=O(Xe,Be);return b.createElement("div",{style:Object(Q.a)({overflow:"hidden"},Qt?{top:Ae}:{}),ref:at,className:C()("".concat(Ct,"-header"),Object(le.a)({},Le,!!Le))},b.createElement("table",{style:{tableLayout:"fixed",visibility:tt||ot?null:"hidden"}},b.createElement(S,{colWidths:ot?[].concat(Object(j.a)(ot),[bt]):[],columCount:Be+1,columns:Ke}),b.createElement(y,Object.assign({},Ze,{stickyOffsets:yt,columns:De,flattenColumns:Ke}))))});A.displayName="FixedHeader";var D=A,I=b.createContext(null),B=I;function H(Ne){var je=Ne.prefixCls,tt=Ne.children,mt=Ne.component,Qe=Ne.cellComponent,Xe=Ne.fixHeader,Be=Ne.fixColumn,Ie=Ne.horizonScroll,Me=Ne.className,Ee=Ne.expanded,Ae=Ne.componentWidth,Le=Ne.colSpan,Te=b.useContext(t.a),Ze=Te.scrollbarSize;return b.useMemo(function(){var ut=tt;return Be&&(ut=b.createElement("div",{style:{width:Ae-(Xe?Ze:0),position:"sticky",left:0,overflow:"hidden"},className:"".concat(je,"-expanded-row-fixed")},ut)),b.createElement(mt,{className:Me,style:{display:Ee?null:"none"}},b.createElement(n.a,{component:Qe,prefixCls:je,colSpan:Le},ut))},[tt,mt,Xe,Ie,Me,Ee,Ae,Le,Ze])}var te=H;function W(Ne){var je=Ne.className,tt=Ne.style,mt=Ne.record,Qe=Ne.index,Xe=Ne.rowKey,Be=Ne.getRowKey,Ie=Ne.rowExpandable,Me=Ne.expandedKeys,Ee=Ne.onRow,Ae=Ne.indent,Le=Ae===void 0?0:Ae,Te=Ne.rowComponent,Ze=Ne.cellComponent,ut=Ne.childrenColumnName,Ct=b.useContext(t.a),Ht=Ct.prefixCls,Qt=Ct.fixedInfoList,bt=b.useContext(B),Lt=bt.fixHeader,at=bt.fixColumn,pt=bt.horizonScroll,st=bt.componentWidth,De=bt.flattenColumns,Ke=bt.expandableType,yt=bt.expandRowByClick,ot=bt.onTriggerExpand,kt=bt.rowClassName,Dt=bt.expandedRowClassName,rt=bt.indentSize,Tt=bt.expandIcon,Ft=bt.expandedRowRender,zt=bt.expandIconColumnIndex,Zt=b.useState(!1),Re=Object(P.a)(Zt,2),ve=Re[0],K=Re[1],Z=Me&&Me.has(Ne.recordKey);b.useEffect(function(){Z&&K(!0)},[Z]);var oe=Ke==="row"&&(!Ie||Ie(mt)),he=Ke==="nest",Oe=ut&&mt&&mt[ut],Je=oe||he,lt;Ee&&(lt=Ee(mt,Qe));var Pt=function(N){if(yt&&Je&&ot(mt,N),lt&<.onClick){for(var F,ae=arguments.length,pe=new Array(ae>1?ae-1:0),se=1;se<ae;se++)pe[se-1]=arguments[se];(F=lt).onClick.apply(F,[N].concat(pe))}},Nt;typeof kt=="string"?Nt=kt:typeof kt=="function"&&(Nt=kt(mt,Qe,Le));var ht=Object(v.a)(De),Mt=b.createElement(Te,Object.assign({},lt,{"data-row-key":Xe,className:C()(je,"".concat(Ht,"-row"),"".concat(Ht,"-row-level-").concat(Le),Nt,lt&<.className),style:Object(Q.a)(Object(Q.a)({},tt),lt?lt.style:null),onClick:Pt}),De.map(function(ie,N){var F=ie.render,ae=ie.dataIndex,pe=ie.className,se=ht[N],$e=Qt[N],Et;N===(zt||0)&&he&&(Et=b.createElement(b.Fragment,null,b.createElement("span",{style:{paddingLeft:"".concat(rt*Le,"px")},className:"".concat(Ht,"-row-indent indent-level-").concat(Le)}),Tt({prefixCls:Ht,expanded:Z,expandable:Oe,record:mt,onExpand:ot})));var it;return ie.onCell&&(it=ie.onCell(mt,Qe)),b.createElement(n.a,Object.assign({className:pe,ellipsis:ie.ellipsis,align:ie.align,component:Ze,prefixCls:Ht,key:se,record:mt,index:Qe,dataIndex:ae,render:F,shouldCellUpdate:ie.shouldCellUpdate},$e,{appendNode:Et,additionalProps:it}))})),nn;if(oe&&(ve||Z)){var Rt=Ft(mt,Qe,Le+1,Z),cn=Dt&&Dt(mt,Qe,Le);nn=b.createElement(te,{expanded:Z,className:C()("".concat(Ht,"-expanded-row"),"".concat(Ht,"-expanded-row-level-").concat(Le+1),cn),prefixCls:Ht,fixHeader:Lt,fixColumn:at,horizonScroll:pt,component:Te,componentWidth:st,cellComponent:Ze,colSpan:De.length},Rt)}var an;return Oe&&Z&&(an=(mt[ut]||[]).map(function(ie,N){var F=Be(ie,N);return b.createElement(W,Object.assign({},Ne,{key:F,rowKey:F,record:ie,recordKey:F,index:N,indent:Le+1}))})),b.createElement(b.Fragment,null,Mt,nn,an)}W.displayName="BodyRow";var V=W,X=b.createContext(null),ne=X;function Y(Ne){var je=Ne.columnKey,tt=Ne.onColumnResize,mt=b.useRef();return b.useEffect(function(){mt.current&&tt(je,mt.current.offsetWidth)},[]),b.createElement(o.a,{onResize:function(Xe){var Be=Xe.offsetWidth;tt(je,Be)}},b.createElement("td",{ref:mt,style:{padding:0,border:0,height:0}},b.createElement("div",{style:{height:0,overflow:"hidden"}},"\xA0")))}function ee(Ne){var je=Ne.data,tt=Ne.getRowKey,mt=Ne.measureColumnWidth,Qe=Ne.expandedKeys,Xe=Ne.onRow,Be=Ne.rowExpandable,Ie=Ne.emptyNode,Me=Ne.childrenColumnName,Ee=b.useContext(ne),Ae=Ee.onColumnResize,Le=b.useContext(t.a),Te=Le.prefixCls,Ze=Le.getComponent,ut=b.useContext(B),Ct=ut.fixHeader,Ht=ut.horizonScroll,Qt=ut.flattenColumns,bt=ut.componentWidth;return b.useMemo(function(){var Lt=Ze(["body","wrapper"],"tbody"),at=Ze(["body","row"],"tr"),pt=Ze(["body","cell"],"td"),st;je.length?st=je.map(function(Ke,yt){var ot=tt(Ke,yt);return b.createElement(V,{key:ot,rowKey:ot,record:Ke,recordKey:ot,index:yt,rowComponent:at,cellComponent:pt,expandedKeys:Qe,onRow:Xe,getRowKey:tt,rowExpandable:Be,childrenColumnName:Me})}):st=b.createElement(te,{expanded:!0,className:"".concat(Te,"-placeholder"),prefixCls:Te,fixHeader:Ct,fixColumn:Ht,horizonScroll:Ht,component:at,componentWidth:bt,cellComponent:pt,colSpan:Qt.length},Ie);var De=Object(v.a)(Qt);return b.createElement(Lt,{className:"".concat(Te,"-tbody")},mt&&b.createElement("tr",{"aria-hidden":"true",className:"".concat(Te,"-measure-row"),style:{height:0}},De.map(function(Ke){return b.createElement(Y,{key:Ke,columnKey:Ke,onColumnResize:Ae})})),st)},[je,Te,Xe,mt,Qe,tt,Ze,bt,Ie,Qt])}var ce=b.memo(ee);ce.displayName="Body";var de=ce,Ce=z("wRmb"),Se=z("xEkU"),Pe=z.n(Se);function ye(Ne){var je=Object(b.useRef)(Ne),tt=Object(b.useState)({}),mt=Object(P.a)(tt,2),Qe=mt[1],Xe=Object(b.useRef)(null),Be=Object(b.useRef)([]);function Ie(Me){Xe.current===null&&(Be.current=[],Xe.current=Pe()(function(){Be.current.forEach(function(Ee){je.current=Ee(je.current)}),Xe.current=null,Qe({})})),Be.current.push(Me)}return Object(b.useEffect)(function(){return function(){Pe.a.cancel(Xe.current)}},[]),[je.current,Ie]}function _e(Ne){var je=Object(b.useRef)(Ne),tt=Object(b.useRef)(null);function mt(){window.clearTimeout(tt.current)}function Qe(Be){je.current=Be,mt(),tt.current=window.setTimeout(function(){je.current=null,tt.current=null},100)}function Xe(){return je.current}return Object(b.useEffect)(function(){return mt},[]),[Qe,Xe]}function Ge(Ne,je,tt){var mt=Object(b.useMemo)(function(){for(var Qe=[],Xe=[],Be=0,Ie=0,Me=0;Me<je;Me+=1)if(tt==="rtl"){Xe[Me]=Ie,Ie+=Ne[Me]||0;var Ee=je-Me-1;Qe[Ee]=Be,Be+=Ne[Ee]||0}else{Qe[Me]=Be,Be+=Ne[Me]||0;var Ae=je-Me-1;Xe[Ae]=Ie,Ie+=Ne[Ae]||0}return{left:Qe,right:Xe}},[Ne,je,tt]);return mt}var Ue=Ge;function Fe(Ne){var je=Ne.className,tt=Ne.children;return b.createElement("div",{className:je},tt)}var He=Fe,be=z("n6Qo");function me(Ne){var je,tt=Ne.prefixCls,mt=Ne.record,Qe=Ne.onExpand,Xe=Ne.expanded,Be=Ne.expandable,Ie="".concat(tt,"-row-expand-icon");if(!Be)return b.createElement("span",{className:C()(Ie,"".concat(tt,"-row-spaced"))});var Me=function(Ae){Qe(mt,Ae),Ae.stopPropagation()};return b.createElement("span",{className:C()(Ie,(je={},Object(le.a)(je,"".concat(tt,"-row-expanded"),Xe),Object(le.a)(je,"".concat(tt,"-row-collapsed"),!Xe),je)),onClick:Me})}function We(Ne,je,tt){var mt=[];function Qe(Xe){(Xe||[]).forEach(function(Be,Ie){mt.push(je(Be,Ie)),Qe(Be[tt])})}return Qe(Ne),mt}var ze=z("zT1h"),nt=z("y0+3"),re=function(je,tt){var mt,Qe,Xe=je.scrollBodyRef,Be=je.onScroll,Ie=je.offsetScroll,Me=b.useContext(t.a),Ee=Me.prefixCls,Ae=((mt=Xe.current)===null||mt===void 0?void 0:mt.scrollWidth)||0,Le=((Qe=Xe.current)===null||Qe===void 0?void 0:Qe.clientWidth)||0,Te=Ae&&Le*(Le/Ae),Ze=b.useRef(),ut=ye({scrollLeft:0,isHiddenScrollBar:!1}),Ct=Object(P.a)(ut,2),Ht=Ct[0],Qt=Ct[1],bt=b.useRef({delta:0,x:0}),Lt=b.useState(!1),at=Object(P.a)(Lt,2),pt=at[0],st=at[1],De=function(){st(!1)},Ke=function(rt){rt.persist(),bt.current.delta=rt.pageX-Ht.scrollLeft,bt.current.x=0,st(!0),rt.preventDefault()},yt=function(rt){var Tt,Ft=rt||((Tt=window)===null||Tt===void 0?void 0:Tt.event),zt=Ft.buttons;if(!pt||zt===0){pt&&st(!1);return}var Zt=bt.current.x+rt.pageX-bt.current.x-bt.current.delta;Zt<=0&&(Zt=0),Zt+Te>=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(Ee,"-sticky-scroll")},b.createElement("div",{onMouseDown:Ke,ref:Ze,className:C()("".concat(Ee,"-sticky-scroll-bar"),Object(le.a)({},"".concat(Ee,"-sticky-scroll-bar-active"),pt)),style:{width:"".concat(Te,"px"),transform:"translate3d(".concat(Ht.scrollLeft,"px, 0, 0)")}}))},k=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,Ee=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),Et=$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),Ei=Fr.map(function(ct){return si.get(ct)}),vi=b.useMemo(function(){return Ei},[Ei.join("_")]),di=Ue(vi,on.length,Ae),Fn=Me&&Object(v.d)(Me.y),wn=Me&&Object(v.d)(Me.x),_r=wn&&on.some(function(ct){var xt=ct.fixed;return xt}),qn=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=_e(null),Pi=Object(P.a)(xi,2),li=Pi[0],Wi=Pi[1];function Si(ct,xt){if(!xt)return;typeof xt=="function"?xt(ct):xt.scrollLeft!==ct&&(xt.scrollLeft=ct)}var hi=function(xt){var It=xt.currentTarget,sn=xt.scrollLeft,fn=typeof sn=="number"?sn:It.scrollLeft,St=It||$;if(!Wi()||Wi()===St){var _t;li(St),Si(fn,Sr.current),Si(fn,Un.current),Si(fn,(_t=qn.current)===null||_t===void 0?void 0:_t.setScrollLeft)}if(It){var Yt=It.scrollWidth,wt=It.clientWidth;fr(fn>0),Yr(fn<Yt-wt)}},Zi=function(){Un.current&&hi({currentTarget:Un.current})},pa=function(xt){var It=xt.width;Zi(),it(Lr.current?Lr.current.offsetWidth:It)};b.useEffect(function(){return Zi},[]),b.useEffect(function(){wn&&Zi()},[wn]),b.useEffect(function(){at===J&&st&&(st.body.current=Un.current)});var ma=Ft(["table"],"table"),ea=b.useMemo(function(){return Ee||(_r?Me.x==="max-content"?"auto":"fixed":Fn||on.some(function(ct){var xt=ct.ellipsis;return xt})?"fixed":"auto")},[Fn,_r,on,Ee]),ta,$i={colWidths:vi,columCount:on.length,stickyOffsets:di,onHeaderRow:Lt,fixHeader:Fn},dn=b.useMemo(function(){return yt?null:typeof Qt=="function"?Qt():Qt},[yt,Qt]),On=b.createElement(de,{data:Ke,measureColumnWidth:Fn||wn||hr,expandedKeys:ae,rowExpandable:lt,getRowKey:zt,onRow:bt,emptyNode:dn,childrenColumnName:Rt}),gn=b.createElement(S,{colWidths:on.map(function(ct){var xt=ct.width;return xt}),columns:on}),qt=Ze&&b.createElement(be.b,null,Ze(Ke)),Hn=Ft(["body"]);if(Fn||hr){var cr;typeof Hn=="function"?(cr=Hn(Ke,{scrollbarSize:Dt,ref:Un,onScroll:hi}),$i.colWidths=on.map(function(ct,xt){var It=ct.width,sn=xt===Bt.length-1?It-Dt:It;return typeof sn=="number"&&!Number.isNaN(sn)?sn:(Object(d.a)(!1,"When use `components.body` with render props. Each column should have a fixed value."),0)})):cr=b.createElement("div",{style:Object(Q.a)(Object(Q.a)({},yi),Zr),onScroll:hi,ref:Un,className:C()("".concat(tt,"-body"))},b.createElement(ma,{style:Object(Q.a)(Object(Q.a)({},Li),{},{tableLayout:ea})},gn,On,qt),hr&&b.createElement(k,{ref:qn,offsetScroll:Nr,scrollBodyRef:Un,onScroll:hi})),ta=b.createElement(b.Fragment,null,Ct!==!1&&b.createElement(D,Object.assign({noData:!Ke.length},$i,In,{direction:Ae,offsetHeader:Ui,stickyClassName:Ur,ref:Sr,onScroll:hi})),cr)}else ta=b.createElement("div",{style:Object(Q.a)(Object(Q.a)({},yi),Zr),className:C()("".concat(tt,"-content")),onScroll:hi,ref:Un},b.createElement(ma,{style:Object(Q.a)(Object(Q.a)({},Li),{},{tableLayout:ea})},gn,Ct!==!1&&b.createElement(y,Object.assign({},$i,In)),On,qt));var Zn=Object(x.b)(Ne),wr=b.createElement("div",Object.assign({className:C()(tt,mt,(je={},Object(le.a)(je,"".concat(tt,"-rtl"),Ae==="rtl"),Object(le.a)(je,"".concat(tt,"-ping-left"),Ar),Object(le.a)(je,"".concat(tt,"-ping-right"),Dr),Object(le.a)(je,"".concat(tt,"-layout-fixed"),Ee==="fixed"),Object(le.a)(je,"".concat(tt,"-fixed-header"),Fn),Object(le.a)(je,"".concat(tt,"-fixed-column"),_r),Object(le.a)(je,"".concat(tt,"-scroll-horizontal"),wn),Object(le.a)(je,"".concat(tt,"-has-fix-left"),on[0]&&on[0].fixed),Object(le.a)(je,"".concat(tt,"-has-fix-right"),on[on.length-1]&&on[on.length-1].fixed==="right"),je)),style:Xe,id:ut,ref:Lr},Zn),b.createElement(xe,{pingLeft:Ar,pingRight:Dr,props:Object(Q.a)(Object(Q.a)({},Ne),{},{stickyOffsets:di,mergedExpandedKeys:ae})},Le&&b.createElement(He,{className:"".concat(tt,"-title")},Le(Ke)),b.createElement("div",{className:"".concat(tt,"-container")},ta),Te&&b.createElement(He,{className:"".concat(tt,"-footer")},Te(Ke))));wn&&(wr=b.createElement(o.a,{onResize:pa},wr));var Wr=b.useMemo(function(){return{prefixCls:tt,getComponent:Ft,scrollbarSize:Dt,direction:Ae,fixedInfoList:on.map(function(ct,xt){return f(xt,xt,on,di,Ae)}),isSticky:hr}},[tt,Ft,Dt,Ae,on,di,Ae,hr]),zn=b.useMemo(function(){return Object(Q.a)(Object(Q.a)({},In),{},{tableLayout:ea,rowClassName:Qe,expandedRowClassName:Nt,componentWidth:Et,fixHeader:Fn,fixColumn:_r,horizonScroll:wn,expandIcon:nn,expandableType:cn,expandRowByClick:Je,expandedRowRender:oe,onTriggerExpand:pe,expandIconColumnIndex:Pt,indentSize:Mt})},[In,ea,Qe,Nt,Et,Fn,_r,wn,nn,cn,Je,oe,pe,Pt,Mt]),gt=b.useMemo(function(){return{onColumnResize:qi}},[qi]);return b.createElement(t.a.Provider,{value:Wr},b.createElement(B.Provider,{value:zn},b.createElement(ne.Provider,{value:gt},wr)))}ke.Column=s.a,ke.ColumnGroup=u.a,ke.Summary=be.a,ke.defaultProps={rowKey:"key",prefixCls:"rc-table",emptyText:function(){return"No Data"}};var dt=Ve.b=ke},wRmb:function(et,Ve,z){"use strict";z.d(Ve,"a",function(){return p});var le=z("rePB"),Q=z("KQm4"),j=z("VTBJ"),w=z("Ff2n"),P=z("q1tI"),b=z.n(P),T=z("Kwbf"),C=z("Zm9Q"),c=z("hW8S");function p(s){return Object(C.a)(s).filter(function(h){return P.isValidElement(h)}).map(function(h){var i=h.key,n=h.props,t=n.children,f=Object(w.a)(n,["children"]),v=Object(j.a)({key:i},f);return t&&(v.children=p(t)),v})}function d(s){return s.reduce(function(h,i){var n=i.fixed,t=n===!0?"left":n,f=i.children;return f&&f.length>0?[].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<s.length;i+=1){var n=s[i];if(h&&n.fixed!=="left")h=!1;else if(!h&&n.fixed==="left"){Object(T.a)(!1,"Index ".concat(i-1," of `columns` missing `fixed='left'` prop."));break}}for(var t=!0,f=s.length-1;f>=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,E=s.onTriggerExpand,_=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=_({prefixCls:i,expanded:ce,expandable:de,record:ne,onExpand:E});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,_,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++)this.putBit((le>>>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]})}}}]);
|