You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
NewEduCoderBuild/p__Problems__OjForm__index....

457 lines
1.5 MiB

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

(window.webpackJsonp=window.webpackJsonp||[]).push([[233,6,7,9,12,21],{"+NIl":function(M,ne,N){(function(I){I(N("VrN/"))})(function(I){"use strict";I.defineMode("stex",function(h,S){"use strict";function L(m,E){m.cmdState.push(E)}function T(m){return m.cmdState.length>0?m.cmdState[m.cmdState.length-1]:null}function c(m){var E=m.cmdState.pop();E&&E.closeBracket()}function C(m){for(var E=m.cmdState,y=E.length-1;y>=0;y--){var u=E[y];if(u.name=="DEFAULT")continue;return u}return{styleIdentifier:function(){return null}}}function g(m,E,y){return function(){this.name=m,this.bracketNo=0,this.style=E,this.styles=y,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var s={};s.importmodule=g("importmodule","tag",["string","builtin"]),s.documentclass=g("documentclass","tag",["","atom"]),s.usepackage=g("usepackage","tag",["atom"]),s.begin=g("begin","tag",["atom"]),s.end=g("end","tag",["atom"]),s.label=g("label","tag",["atom"]),s.ref=g("ref","tag",["atom"]),s.eqref=g("eqref","tag",["atom"]),s.cite=g("cite","tag",["atom"]),s.bibitem=g("bibitem","tag",["atom"]),s.Bibitem=g("Bibitem","tag",["atom"]),s.RBibitem=g("RBibitem","tag",["atom"]),s.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function a(m,E){m.f=E}function r(m,E){var y;if(m.match(/^\\[a-zA-Z@]+/)){var u=m.current().slice(1);return y=s.hasOwnProperty(u)?s[u]:s.DEFAULT,y=new y,L(E,y),a(E,p),y.style}if(m.match(/^\\[$&%#{}_]/))return"tag";if(m.match(/^\\[,;!\/\\]/))return"tag";if(m.match("\\["))return a(E,function(o,l){return f(o,l,"\\]")}),"keyword";if(m.match("\\("))return a(E,function(o,l){return f(o,l,"\\)")}),"keyword";if(m.match("$$"))return a(E,function(o,l){return f(o,l,"$$")}),"keyword";if(m.match("$"))return a(E,function(o,l){return f(o,l,"$")}),"keyword";var n=m.next();if(n=="%")return m.skipToEnd(),"comment";if(n=="}"||n=="]"){if(y=T(E),y)y.closeBracket(n),a(E,p);else return"error";return"bracket"}else return n=="{"||n=="["?(y=s.DEFAULT,y=new y,L(E,y),"bracket"):/\d/.test(n)?(m.eatWhile(/[\w.%]/),"atom"):(m.eatWhile(/[\w\-_]/),y=C(E),y.name=="begin"&&(y.argument=m.current()),y.styleIdentifier())}function f(m,E,y){if(m.eatSpace())return null;if(y&&m.match(y))return a(E,r),"keyword";if(m.match(/^\\[a-zA-Z@]+/))return"tag";if(m.match(/^[a-zA-Z]+/))return"variable-2";if(m.match(/^\\[$&%#{}_]/))return"tag";if(m.match(/^\\[,;!\/]/))return"tag";if(m.match(/^[\^_&]/))return"tag";if(m.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(m.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var u=m.next();return u=="{"||u=="}"||u=="["||u=="]"||u=="("||u==")"?"bracket":u=="%"?(m.skipToEnd(),"comment"):"error"}function p(m,E){var y=m.peek(),u;return y=="{"||y=="["?(u=T(E),u.openBracket(y),m.eat(y),a(E,r),"bracket"):/[ \t\r]/.test(y)?(m.eat(y),null):(a(E,r),c(E),r(m,E))}return{startState:function(){var m=S.inMathMode?function(E,y){return f(E,y)}:r;return{cmdState:[],f:m}},copyState:function(m){return{cmdState:m.cmdState.slice(),f:m.f}},token:function(m,E){return E.f(m,E)},blankLine:function(m){m.f=r,m.cmdState.length=0},lineComment:"%"}}),I.defineMIME("text/x-stex","stex"),I.defineMIME("text/x-latex","stex")})},"19Vz":function(M,ne,N){(function(I){I(N("VrN/"))})(function(I){I.defineOption("placeholder","",function(g,s,a){var r=a&&a!=I.Init;if(s&&!r)g.on("blur",T),g.on("change",c),g.on("swapDoc",c),I.on(g.getInputField(),"compositionupdate",g.state.placeholderCompose=function(){L(g)}),c(g);else if(!s&&r){g.off("blur",T),g.off("change",c),g.off("swapDoc",c),I.off(g.getInputField(),"compositionupdate",g.state.placeholderCompose),h(g);var f=g.getWrapperElement();f.className=f.className.replace(" CodeMirror-empty","")}s&&!g.hasFocus()&&T(g)});function h(g){g.state.placeholder&&(g.state.placeholder.parentNode.removeChild(g.state.placeholder),g.state.placeholder=null)}function S(g){h(g);var s=g.state.placeholder=document.createElement("pre");s.style.cssText="height: 0; overflow: visible",s.style.direction=g.getOption("direction"),s.className="CodeMirror-placeholder CodeMirror-line-like";var a=g.getOption("placeholder");typeof a=="string"&&(a=document.createTextNode(a)),s.appendChild(a),g.display.lineSpace.insertBefore(s,g.display.lineSpace.firstChild)}function L(g){setTimeout(function(){var s=!1,a=g.getInputField();a.nodeName=="TEXTAREA"?s=!a.value:g.lineCount()==1&&(s=!/[^\u200b]/.test(a.querySelector(".CodeMirror-line").textContent)),s?S(g):h(g)},20)}function T(g){C(g)&&S(g)}function c(g){var s=g.getWrapperElement(),a=C(g);s.className=s.className.replace(" CodeMirror-empty","")+(a?" CodeMirror-empty":""),a?S(g):h(g)}function C(g){return g.lineCount()===1&&g.getLine(0)===""}})},"1eCo":function(M,ne,N){(function(I){I(N("VrN/"))})(function(I){"use strict";var h={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},S={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};I.defineMode("xml",function(L,T){var c=L.indentUnit,C={},g=T.htmlMode?h:S;for(var s in g)C[s]=g[s];for(var s in T)C[s]=T[s];var a,r;function f(_,B){function U($){return B.tokenize=$,$(_,B)}var P=_.next();if(P=="<")return _.eat("!")?_.eat("[")?_.match("CDATA[")?U(E("atom","]]>")):null:_.match("--")?U(E("comment","-->")):_.match("DOCTYPE",!0,!0)?(_.eatWhile(/[\w\._\-]/),U(y(1))):null:_.eat("?")?(_.eatWhile(/[\w\._\-]/),B.tokenize=E("meta","?>"),"meta"):(a=_.eat("/")?"closeTag":"openTag",B.tokenize=p,"tag bracket");if(P=="&"){var J;return _.eat("#")?_.eat("x")?J=_.eatWhile(/[a-fA-F\d]/)&&_.eat(";"):J=_.eatWhile(/[\d]/)&&_.eat(";"):J=_.eatWhile(/[\w\.\-:]/)&&_.eat(";"),J?"atom":"error"}else return _.eatWhile(/[^&<]/),null}f.isInText=!0;function p(_,B){var U=_.next();if(U==">"||U=="/"&&_.eat(">"))return B.tokenize=f,a=U==">"?"endTag":"selfcloseTag","tag bracket";if(U=="=")return a="equals",null;if(U=="<"){B.tokenize=f,B.state=l,B.tagName=B.tagStart=null;var P=B.tokenize(_,B);return P?P+" tag error":"tag error"}else return/[\'\"]/.test(U)?(B.tokenize=m(U),B.stringStartCol=_.column(),B.tokenize(_,B)):(_.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function m(_){var B=function(U,P){for(;!U.eol();)if(U.next()==_){P.tokenize=p;break}return"string"};return B.isInAttribute=!0,B}function E(_,B){return function(U,P){for(;!U.eol();){if(U.match(B)){P.tokenize=f;break}U.next()}return _}}function y(_){return function(B,U){for(var P;(P=B.next())!=null;){if(P=="<")return U.tokenize=y(_+1),U.tokenize(B,U);if(P==">")if(_==1){U.tokenize=f;break}else return U.tokenize=y(_-1),U.tokenize(B,U)}return"meta"}}function u(_,B,U){this.prev=_.context,this.tagName=B,this.indent=_.indented,this.startOfLine=U,(C.doNotIndent.hasOwnProperty(B)||_.context&&_.context.noIndent)&&(this.noIndent=!0)}function n(_){_.context&&(_.context=_.context.prev)}function o(_,B){for(var U;;){if(!_.context)return;if(U=_.context.tagName,!C.contextGrabbers.hasOwnProperty(U)||!C.contextGrabbers[U].hasOwnProperty(B))return;n(_)}}function l(_,B,U){return _=="openTag"?(U.tagStart=B.column(),w):_=="closeTag"?v:l}function w(_,B,U){return _=="word"?(U.tagName=B.current(),r="tag",k):C.allowMissingTagName&&_=="endTag"?(r="tag bracket",k(_,B,U)):(r="error",w)}function v(_,B,U){if(_=="word"){var P=B.current();return U.context&&U.context.tagName!=P&&C.implicitlyClosed.hasOwnProperty(U.context.tagName)&&n(U),U.context&&U.context.tagName==P||C.matchClosing===!1?(r="tag",i):(r="tag error",R)}else return C.allowMissingTagName&&_=="endTag"?(r="tag bracket",i(_,B,U)):(r="error",R)}function i(_,B,U){return _!="endTag"?(r="error",i):(n(U),l)}function R(_,B,U){return r="error",i(_,B,U)}function k(_,B,U){if(_=="word")return r="attribute",d;if(_=="endTag"||_=="selfcloseTag"){var P=U.tagName,J=U.tagStart;return U.tagName=U.tagStart=null,_=="selfcloseTag"||C.autoSelfClosers.hasOwnProperty(P)?o(U,P):(o(U,P),U.context=new u(U,P,J==U.indented)),l}return r="error",k}function d(_,B,U){return _=="equals"?b:(C.allowMissing||(r="error"),k(_,B,U))}function b(_,B,U){return _=="string"?x:_=="word"&&C.allowUnquoted?(r="string",k):(r="error",k(_,B,U))}function x(_,B,U){return _=="string"?x:k(_,B,U)}return{startState:function(_){var B={tokenize:f,state:l,indented:_||0,tagName:null,tagStart:null,context:null};return _!=null&&(B.baseIndent=_),B},token:function(_,B){if(!B.tagName&&_.sol()&&(B.indented=_.indentation()),_.eatSpace())return null;a=null;var U=B.tokenize(_,B);return(U||a)&&U!="comment"&&(r=null,B.state=B.state(a||U,_,B),r&&(U=r=="error"?U+" error":r)),U},indent:function(_,B,U){var P=_.context;if(_.tokenize.isInAttribute)return _.tagStart==_.indented?_.stringStartCol+1:_.indented+c;if(P&&P.noIndent)return I.Pass;if(_.tokenize!=p&&_.tokenize!=f)return U?U.match(/^(\s*)/)[0].length:0;if(_.tagName)return C.multilineTagIndentPastTag!==!1?_.tagStart+_.tagName.length+2:_.tagStart+c*(C.multilineTagIndentFactor||1);if(C.alignCDATA&&/<!\[CDATA\[/.test(B))return 0;var J=B&&/^<(\/)?([\w_:\.-]*)/.exec(B);if(J&&J[1])for(;P;)if(P.tagName==J[2]){P=P.prev;break}else if(C.implicitlyClosed.hasOwnProperty(P.tagName))P=P.prev;else break;else if(J)for(;P;){var $=C.contextGrabbers[P.tagName];if($&&$.hasOwnProperty(J[2]))P=P.prev;else break}for(;P&&P.prev&&!P.startOfLine;)P=P.prev;return P?P.indent+c:_.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:C.htmlMode?"html":"xml",helperType:C.htmlMode?"html":"xml",skipAttribute:function(_){_.state==b&&(_.state=k)},xmlCurrentTag:function(_){return _.tagName?{name:_.tagName,close:_.type=="closeTag"}:null},xmlCurrentContext:function(_){for(var B=[],U=_.context;U;U=U.prev)U.tagName&&B.push(U.tagName);return B.reverse()}}}),I.defineMIME("text/xml","xml"),I.defineMIME("application/xml","xml"),I.mimeModes.hasOwnProperty("text/html")||I.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"1uat":function(M,ne,N){(function(I,h,S){M.exports=ne=h(N("Ib8C"),N("MlIO"))})(this,function(I){return function(){var h=I,S=h.lib,L=S.Hasher,T=h.x64,c=T.Word,C=T.WordArray,g=h.algo;function s(){return c.create.apply(c,arguments)}var a=[s(1116352408,3609767458),s(1899447441,602891725),s(3049323471,3964484399),s(3921009573,2173295548),s(961987163,4081628472),s(1508970993,3053834265),s(2453635748,2937671579),s(2870763221,3664609560),s(3624381080,2734883394),s(310598401,1164996542),s(607225278,1323610764),s(1426881987,3590304994),s(1925078388,4068182383),s(2162078206,991336113),s(2614888103,633803317),s(3248222580,3479774868),s(3835390401,2666613458),s(4022224774,944711139),s(264347078,2341262773),s(604807628,2007800933),s(770255983,1495990901),s(1249150122,1856431235),s(1555081692,3175218132),s(1996064986,2198950837),s(2554220882,3999719339),s(2821834349,766784016),s(2952996808,2566594879),s(3210313671,3203337956),s(3336571891,1034457026),s(3584528711,2466948901),s(113926993,3758326383),s(338241895,168717936),s(666307205,1188179964),s(773529912,1546045734),s(1294757372,1522805485),s(1396182291,2643833823),s(1695183700,2343527390),s(1986661051,1014477480),s(2177026350,1206759142),s(2456956037,344077627),s(2730485921,1290863460),s(2820302411,3158454273),s(3259730800,3505952657),s(3345764771,106217008),s(3516065817,3606008344),s(3600352804,1432725776),s(4094571909,1467031594),s(275423344,851169720),s(430227734,3100823752),s(506948616,1363258195),s(659060556,3750685593),s(883997877,3785050280),s(958139571,3318307427),s(1322822218,3812723403),s(1537002063,2003034995),s(1747873779,3602036899),s(1955562222,1575990012),s(2024104815,1125592928),s(2227730452,2716904306),s(2361852424,442776044),s(2428436474,593698344),s(2756734187,3733110249),s(3204031479,2999351573),s(3329325298,3815920427),s(3391569614,3928383900),s(3515267271,566280711),s(3940187606,3454069534),s(4118630271,4000239992),s(116418474,1914138554),s(174292421,2731055270),s(289380356,3203993006),s(460393269,320620315),s(685471733,587496836),s(852142971,1086792851),s(1017036298,365543100),s(1126000580,2618297676),s(1288033470,3409855158),s(1501505948,4234509866),s(1607167915,987167468),s(1816402316,1246189591)],r=[];(function(){for(var p=0;p<80;p++)r[p]=s()})();var f=g.SHA512=L.extend({_doReset:function(){this._hash=new C.init([new c.init(1779033703,4089235720),new c.init(3144134277,2227873595),new c.init(1013904242,4271175723),new c.init(2773480762,1595750129),new c.init(1359893119,2917565137),new c.init(2600822924,725511199),new c.init(528734635,4215389547),new c.init(1541459225,327033209)])},_doProcessBlock:function(p,m){for(var E=this._hash.words,y=E[0],u=E[1],n=E[2],o=E[3],l=E[4],w=E[5],v=E[6],i=E[7],R=y.high,k=y.low,d=u.high,b=u.low,x=n.high,_=n.low,B=o.high,U=o.low,P=l.high,J=l.low,$=w.high,z=w.low,V=v.high,K=v.low,H=i.high,G=i.low,ie=R,le=k,ue=d,be=b,Ce=x,se=_,ce=B,he=U,ae=P,Q=J,D=$,F=z,W=V,Y=K,Z=H,te=G,q=0;q<80;q++){var X,re,me=r[q];if(q<16)re=me.high=p[m+q*2]|0,X=me.low=p[m+q*2+1]|0;else{var ve=r[q-15],Te=ve.high,Re=ve.low,Ie=(Te>>>1|Re<<31)^(Te>>>8|Re<<24)^Te>>>7,je=(Re>>>1|Te<<31)^(Re>>>8|Te<<24)^(Re>>>7|Te<<25),Ne=r[q-2],We=Ne.high,Be=Ne.low,He=(We>>>19|Be<<13)^(We<<3|Be>>>29)^We>>>6,De=(Be>>>19|We<<13)^(Be<<3|We>>>29)^(Be>>>6|We<<26),Xe=r[q-7],$e=Xe.high,we=Xe.low,fe=r[q-16],pe=fe.high,ye=fe.low;X=je+we,re=Ie+$e+(X>>>0<je>>>0?1:0),X=X+De,re=re+He+(X>>>0<De>>>0?1:0),X=X+ye,re=re+pe+(X>>>0<ye>>>0?1:0),me.high=re,me.low=X}var _e=ae&D^~ae&W,xe=Q&F^~Q&Y,Se=ie&ue^ie&Ce^ue&Ce,Ae=le&be^le&se^be&se,Oe=(ie>>>28|le<<4)^(ie<<30|le>>>2)^(ie<<25|le>>>7),Le=(le>>>28|ie<<4)^(le<<30|ie>>>2)^(le<<25|ie>>>7),Me=(ae>>>14|Q<<18)^(ae>>>18|Q<<14)^(ae<<23|Q>>>9),Ke=(Q>>>14|ae<<18)^(Q>>>18|ae<<14)^(Q<<23|ae>>>9),Qe=a[q],Ye=Qe.high,nt=Qe.low,pt=te+Ke,st=Z+Me+(pt>>>0<te>>>0?1:0),pt=pt+xe,st=st+_e+(pt>>>0<xe>>>0?1:0),pt=pt+nt,st=st+Ye+(pt>>>0<nt>>>0?1:0),pt=pt+X,st=st+re+(pt>>>0<X>>>0?1:0),tt=Le+Ae,Pt=Oe+Se+(tt>>>0<Le>>>0?1:0);Z=W,te=Y,W=D,Y=F,D=ae,F=Q,Q=he+pt|0,ae=ce+st+(Q>>>0<he>>>0?1:0)|0,ce=Ce,he=se,Ce=ue,se=be,ue=ie,be=le,le=pt+tt|0,ie=st+Pt+(le>>>0<pt>>>0?1:0)|0}k=y.low=k+le,y.high=R+ie+(k>>>0<le>>>0?1:0),b=u.low=b+be,u.high=d+ue+(b>>>0<be>>>0?1:0),_=n.low=_+se,n.high=x+Ce+(_>>>0<se>>>0?1:0),U=o.low=U+he,o.high=B+ce+(U>>>0<he>>>0?1:0),J=l.low=J+Q,l.high=P+ae+(J>>>0<Q>>>0?1:0),z=w.low=z+F,w.high=$+D+(z>>>0<F>>>0?1:0),K=v.low=K+Y,v.high=V+W+(K>>>0<Y>>>0?1:0),G=i.low=G+te,i.high=H+Z+(G>>>0<te>>>0?1:0)},_doFinalize:function(){var p=this._data,m=p.words,E=this._nDataBytes*8,y=p.sigBytes*8;m[y>>>5]|=128<<24-y%32,m[(y+128>>>10<<5)+30]=Math.floor(E/4294967296),m[(y+128>>>10<<5)+31]=E,p.sigBytes=m.length*4,this._process();var u=this._hash.toX32();return u},clone:function(){var p=L.clone.call(this);return p._hash=this._hash.clone(),p},blockSize:1024/32});h.SHA512=L._createHelper(f),h.HmacSHA512=L._createHmacHelper(f)}(),I.SHA512})},"3y9D":function(M,ne,N){(function(I,h){M.exports=ne=h(N("Ib8C"))})(this,function(I){return function(){var h=I,S=h.lib,L=S.WordArray,T=S.Hasher,c=h.algo,C=[],g=c.SHA1=T.extend({_doReset:function(){this._hash=new L.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(s,a){for(var r=this._hash.words,f=r[0],p=r[1],m=r[2],E=r[3],y=r[4],u=0;u<80;u++){if(u<16)C[u]=s[a+u]|0;else{var n=C[u-3]^C[u-8]^C[u-14]^C[u-16];C[u]=n<<1|n>>>31}var o=(f<<5|f>>>27)+y+C[u];u<20?o+=(p&m|~p&E)+1518500249:u<40?o+=(p^m^E)+1859775393:u<60?o+=(p&m|p&E|m&E)-1894007588:o+=(p^m^E)-899497514,y=E,E=m,m=p<<30|p>>>2,p=f,f=o}r[0]=r[0]+f|0,r[1]=r[1]+p|0,r[2]=r[2]+m|0,r[3]=r[3]+E|0,r[4]=r[4]+y|0},_doFinalize:function(){var s=this._data,a=s.words,r=this._nDataBytes*8,f=s.sigBytes*8;return a[f>>>5]|=128<<24-f%32,a[(f+64>>>9<<4)+14]=Math.floor(r/4294967296),a[(f+64>>>9<<4)+15]=r,s.sigBytes=a.length*4,this._process(),this._hash},clone:function(){var s=T.clone.call(this);return s._hash=this._hash.clone(),s}});h.SHA1=T._createHelper(g),h.HmacSHA1=T._createHmacHelper(g)}(),I.SHA1})},4:function(M,ne){},"5hvy":function(M,ne,N){(function(I,h,S){M.exports=ne=h(N("Ib8C"),N("MlIO"))})(this,function(I){return function(h){var S=I,L=S.lib,T=L.WordArray,c=L.Hasher,C=S.x64,g=C.Word,s=S.algo,a=[],r=[],f=[];(function(){for(var E=1,y=0,u=0;u<24;u++){a[E+5*y]=(u+1)*(u+2)/2%64;var n=y%5,o=(2*E+3*y)%5;E=n,y=o}for(var E=0;E<5;E++)for(var y=0;y<5;y++)r[E+5*y]=y+(2*E+3*y)%5*5;for(var l=1,w=0;w<24;w++){for(var v=0,i=0,R=0;R<7;R++){if(l&1){var k=(1<<R)-1;k<32?i^=1<<k:v^=1<<k-32}l&128?l=l<<1^113:l<<=1}f[w]=g.create(v,i)}})();var p=[];(function(){for(var E=0;E<25;E++)p[E]=g.create()})();var m=s.SHA3=c.extend({cfg:c.cfg.extend({outputLength:512}),_doReset:function(){for(var E=this._state=[],y=0;y<25;y++)E[y]=new g.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(E,y){for(var u=this._state,n=this.blockSize/2,o=0;o<n;o++){var l=E[y+2*o],w=E[y+2*o+1];l=(l<<8|l>>>24)&16711935|(l<<24|l>>>8)&4278255360,w=(w<<8|w>>>24)&16711935|(w<<24|w>>>8)&4278255360;var v=u[o];v.high^=w,v.low^=l}for(var i=0;i<24;i++){for(var R=0;R<5;R++){for(var k=0,d=0,b=0;b<5;b++){var v=u[R+5*b];k^=v.high,d^=v.low}var x=p[R];x.high=k,x.low=d}for(var R=0;R<5;R++)for(var _=p[(R+4)%5],B=p[(R+1)%5],U=B.high,P=B.low,k=_.high^(U<<1|P>>>31),d=_.low^(P<<1|U>>>31),b=0;b<5;b++){var v=u[R+5*b];v.high^=k,v.low^=d}for(var J=1;J<25;J++){var k,d,v=u[J],$=v.high,z=v.low,V=a[J];V<32?(k=$<<V|z>>>32-V,d=z<<V|$>>>32-V):(k=z<<V-32|$>>>64-V,d=$<<V-32|z>>>64-V);var K=p[r[J]];K.high=k,K.low=d}var H=p[0],G=u[0];H.high=G.high,H.low=G.low;for(var R=0;R<5;R++)for(var b=0;b<5;b++){var J=R+5*b,v=u[J],ie=p[J],le=p[(R+1)%5+5*b],ue=p[(R+2)%5+5*b];v.high=ie.high^~le.high&ue.high,v.low=ie.low^~le.low&ue.low}var v=u[0],be=f[i];v.high^=be.high,v.low^=be.low}},_doFinalize:function(){var E=this._data,y=E.words,u=this._nDataBytes*8,n=E.sigBytes*8,o=this.blockSize*32;y[n>>>5]|=1<<24-n%32,y[(h.ceil((n+1)/o)*o>>>5)-1]|=128,E.sigBytes=y.length*4,this._process();for(var l=this._state,w=this.cfg.outputLength/8,v=w/8,i=[],R=0;R<v;R++){var k=l[R],d=k.high,b=k.low;d=(d<<8|d>>>24)&16711935|(d<<24|d>>>8)&4278255360,b=(b<<8|b>>>24)&16711935|(b<<24|b>>>8)&4278255360,i.push(b),i.push(d)}return new T.init(i,w)},clone:function(){for(var E=c.clone.call(this),y=E._state=this._state.slice(0),u=0;u<25;u++)y[u]=y[u].clone();return E}});S.SHA3=c._createHelper(m),S.HmacSHA3=c._createHmacHelper(m)}(Math),I.SHA3})},"5nXd":function(M,ne,N){var I=N("MFOe"),h=I.slice,S=I.pluck,L=I.each,T=I.bind,c=I.create,C=I.isList,g=I.isFunction,s=I.isObject;M.exports={createStore:f};var a={version:"2.0.12",enabled:!1,get:function(p,m){var E=this.storage.read(this._namespacePrefix+p);return this._deserialize(E,m)},set:function(p,m){return m===void 0?this.remove(p):(this.storage.write(this._namespacePrefix+p,this._serialize(m)),m)},remove:function(p){this.storage.remove(this._namespacePrefix+p)},each:function(p){var m=this;this.storage.each(function(E,y){p.call(m,m._deserialize(E),(y||"").replace(m._namespaceRegexp,""))})},clearAll:function(){this.storage.clearAll()},hasNamespace:function(p){return this._namespacePrefix=="__storejs_"+p+"_"},createStore:function(){return f.apply(this,arguments)},addPlugin:function(p){this._addPlugin(p)},namespace:function(p){return f(this.storage,this.plugins,p)}};function r(){var p=typeof console=="undefined"?null:console;if(!p)return;var m=p.warn?p.warn:p.log;m.apply(p,arguments)}function f(p,m,E){E||(E=""),p&&!C(p)&&(p=[p]),m&&!C(m)&&(m=[m]);var y=E?"__storejs_"+E+"_":"",u=E?new RegExp("^"+y):null,n=/^[a-zA-Z0-9_\-]*$/;if(!n.test(E))throw new Error("store.js namespaces can only have alphanumerics + underscores and dashes");var o={_namespacePrefix:y,_namespaceRegexp:u,_testStorage:function(w){try{var v="__storejs__test__";w.write(v,v);var i=w.read(v)===v;return w.remove(v),i}catch(R){return!1}},_assignPluginFnProp:function(w,v){var i=this[v];this[v]=function(){var k=h(arguments,0),d=this;function b(){return i?(L(arguments,function(_,B){k[B]=_}),i.apply(d,k)):void 0}var x=[b].concat(k);return w.apply(d,x)}},_serialize:function(w){return JSON.stringify(w)},_deserialize:function(w,v){if(!w)return v;var i="";try{i=JSON.parse(w)}catch(R){i=w}return i!==void 0?i:v},_addStorage:function(w){if(this.enabled)return;this._testStorage(w)&&(this.storage=w,this.enabled=!0)},_addPlugin:function(w){var v=this;if(C(w)){L(w,function(k){v._addPlugin(k)});return}var i=S(this.plugins,function(k){return w===k});if(i)return;if(this.plugins.push(w),!g(w))throw new Error("Plugins must be function values that return objects");var R=w.call(this);if(!s(R))throw new Error("Plugins must return an object of function properties");L(R,function(k,d){if(!g(k))throw new Error("Bad plugin property: "+d+" from plugin "+w.name+". Plugins should only return functions.");v._assignPluginFnProp(k,d)})},addStorage:function(w){r("store.addStorage(storage) is deprecated. Use createStore([storages])"),this._addStorage(w)}},l=c(o,a,{plugins:[]});return l.raw={},L(l,function(w,v){g(w)&&(l.raw[v]=T(l,w))}),L(p,function(w){l._addStorage(w)}),L(m,function(w){l._addPlugin(w)}),l}},"7Cbv":function(M,ne,N){"use strict";var I=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),h=new Uint8Array(16);function S(){if(!I)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return I(h)}var L=/^(?:[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 T(p){return typeof p=="string"&&L.test(p)}for(var c=T,C=[],g=0;g<256;++g)C.push((g+256).toString(16).substr(1));function s(p){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,E=(C[p[m+0]]+C[p[m+1]]+C[p[m+2]]+C[p[m+3]]+"-"+C[p[m+4]]+C[p[m+5]]+"-"+C[p[m+6]]+C[p[m+7]]+"-"+C[p[m+8]]+C[p[m+9]]+"-"+C[p[m+10]]+C[p[m+11]]+C[p[m+12]]+C[p[m+13]]+C[p[m+14]]+C[p[m+15]]).toLowerCase();if(!c(E))throw TypeError("Stringified UUID is invalid");return E}var a=s;function r(p,m,E){p=p||{};var y=p.random||(p.rng||S)();if(y[6]=y[6]&15|64,y[8]=y[8]&63|128,m){E=E||0;for(var u=0;u<16;++u)m[E+u]=y[u];return m}return a(y)}var f=ne.a=r},"7ahc":function(M,ne,N){"use strict";N.d(ne,"a",function(){return w});var I=N("k1fw"),h=N("0Owb"),S=N("+L6B"),L=N("2/Rp"),T=N("y8nQ"),c=N("Vl3Y"),C=N("tJVT"),g=N("OaEy"),s=N("2fM7"),a=N("q1tI"),r=N.n(a),f=N("VrN/"),p=N.n(f),m=N("p77/"),E=N.n(m),y=N("c5Ni"),u=N.n(y),n=s.a.Option,o={labelCol:{span:4},wrapperCol:{span:20}},l={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"]};ne.b=function(v){var i=v.callback,R=v.onCancel,k=Object(a.useState)("python"),d=Object(C.a)(k,2),b=d[0],x=d[1];function _(U){x(l[U][1])}function B(U){i(U)}return r.a.createElement(c.a,Object(h.a)({},o,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:B}),r.a.createElement(c.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},r.a.createElement(s.a,{onChange:_},Object.keys(l).map(function(U){return r.a.createElement(n,{key:U,value:U},l[U][0])}))),r.a.createElement(c.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},r.a.createElement(w,{mode:b})),r.a.createElement("div",{className:"flex-container flex-end"},r.a.createElement(L.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),r.a.createElement(L.a,{type:"ghost",onClick:R},"\u53D6\u6D88")))};function w(v){var i=v.value,R=v.onChange,k=v.mode,d=v.options,b=d===void 0?{}:d,x=Object(a.useRef)(),_=Object(a.useState)(),B=Object(C.a)(_,2),U=B[0],P=B[1];return Object(a.useEffect)(function(){if(U){function J($){var z=$.getValue();R&&R(z)}return U.on("change",J),function(){U.off("change",J)}}},[U,R]),Object(a.useEffect)(function(){U&&U.setOption("mode",k)},[U,k]),Object(a.useEffect)(function(){U&&((i!==U.getValue()||i==="")&&setTimeout(function(){U.setValue(i||" ")},300))},[U,i]),Object(a.useEffect)(function(){if(x.current&&!U){var J=p.a.fromTextArea(x.current,Object(I.a)({mode:k,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},b));P(J)}},[x.current,U]),r.a.createElement("div",{className:"my-codemirror-container"},r.a.createElement("textarea",{ref:x}))}},"7ixt":function(M,ne,N){"use strict";N.d(ne,"a",function(){return S});var I={adjustX:1,adjustY:1},h=[0,0],S={left:{points:["cr","cl"],overflow:I,offset:[-4,0],targetOffset:h},right:{points:["cl","cr"],overflow:I,offset:[4,0],targetOffset:h},top:{points:["bc","tc"],overflow:I,offset:[0,-4],targetOffset:h},bottom:{points:["tc","bc"],overflow:I,offset:[0,4],targetOffset:h},topLeft:{points:["bl","tl"],overflow:I,offset:[0,-4],targetOffset:h},leftTop:{points:["tr","tl"],overflow:I,offset:[-4,0],targetOffset:h},topRight:{points:["br","tr"],overflow:I,offset:[0,-4],targetOffset:h},rightTop:{points:["tl","tr"],overflow:I,offset:[4,0],targetOffset:h},bottomRight:{points:["tr","br"],overflow:I,offset:[0,4],targetOffset:h},rightBottom:{points:["bl","br"],overflow:I,offset:[4,0],targetOffset:h},bottomLeft:{points:["tl","bl"],overflow:I,offset:[0,4],targetOffset:h},leftBottom:{points:["br","bl"],overflow:I,offset:[-4,0],targetOffset:h}},L=S},"815F":function(M,ne,N){"use strict";N.d(ne,"e",function(){return C}),N.d(ne,"c",function(){return s}),N.d(ne,"d",function(){return a}),N.d(ne,"a",function(){return f}),N.d(ne,"f",function(){return p}),N.d(ne,"b",function(){return m});var I=N("KQm4"),h=N("VTBJ"),S=N("Ff2n"),L=N("Zm9Q"),T=N("Kwbf"),c=N("OZM5");function C(E,y){return E!=null?E:y}function g(){var E=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],y=new Map;function u(n){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(n||[]).forEach(function(l){var w=l.key,v=l.children;Object(T.a)(w!=null,"Tree node must have a certain key: [".concat(o).concat(w,"]"));var i=String(w);Object(T.a)(!y.has(i)||w===null||w===void 0,"Same 'key' exist in the Tree: ".concat(i)),y.set(i,!0),u(v,"".concat(o).concat(i," > "))})}u(E)}function s(E){function y(u){var n=Object(L.a)(u);return n.map(function(o){if(!Object(c.i)(o))return Object(T.a)(!o,"Tree/TreeNode can only accept TreeNode as children."),null;var l=o.key,w=o.props,v=w.children,i=Object(S.a)(w,["children"]),R=Object(h.a)({key:l},i),k=y(v);return k.length&&(R.children=k),R}).filter(function(o){return o})}return y(E)}function a(){var E=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],u=new Set(y===!0?[]:y),n=[];function o(l){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return l.map(function(v,i){var R=Object(c.h)(w?w.pos:"0",i),k=C(v.key,R),d=Object(h.a)(Object(h.a)({},v),{},{parent:w,pos:R,children:null,data:v,isStart:[].concat(Object(I.a)(w?w.isStart:[]),[i===0]),isEnd:[].concat(Object(I.a)(w?w.isEnd:[]),[i===l.length-1])});return n.push(d),y===!0||u.has(k)?d.children=o(v.children||[],d):d.children=[],d})}return o(E),n}function r(E,y,u){var n;u?typeof u=="string"?n=function(w){return w[u]}:typeof u=="function"&&(n=function(w){return u(w)}):n=function(w,v){return C(w.key,v)};function o(l,w,v){var i=l?l.children:E,R=l?Object(c.h)(v.pos,w):"0";if(l){var k=n(l,R),d={node:l,index:w,pos:R,key:k,parentPos:v.node?v.pos:null,level:v.level+1};y(d)}i&&i.forEach(function(b,x){o(b,x,{node:l,pos:R,level:v?v.level+1:-1})})}o(null)}function f(E){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},u=y.initWrapper,n=y.processEntity,o=y.onProcessFinished,l=arguments.length>2?arguments[2]:void 0,w={},v={},i={posEntities:w,keyEntities:v};return u&&(i=u(i)||i),r(E,function(R){var k=R.node,d=R.index,b=R.pos,x=R.key,_=R.parentPos,B=R.level,U={node:k,index:d,key:x,pos:b,level:B},P=C(x,b);w[b]=U,v[P]=U,U.parent=w[_],U.parent&&(U.parent.children=U.parent.children||[],U.parent.children.push(U)),n&&n(U,i)},l),o&&o(i),i}function p(E,y){var u=y.expandedKeys,n=y.selectedKeys,o=y.loadedKeys,l=y.loadingKeys,w=y.checkedKeys,v=y.halfCheckedKeys,i=y.dragOverNodeKey,R=y.dropPosition,k=y.keyEntities,d=k[E],b={eventKey:E,expanded:u.indexOf(E)!==-1,selected:n.indexOf(E)!==-1,loaded:o.indexOf(E)!==-1,loading:l.indexOf(E)!==-1,checked:w.indexOf(E)!==-1,halfChecked:v.indexOf(E)!==-1,pos:String(d?d.pos:""),dragOver:i===E&&R===0,dragOverGapTop:i===E&&R===-1,dragOverGapBottom:i===E&&R===1};return b}function m(E){var y=E.data,u=E.expanded,n=E.selected,o=E.checked,l=E.loaded,w=E.loading,v=E.halfChecked,i=E.dragOver,R=E.dragOverGapTop,k=E.dragOverGapBottom,d=E.pos,b=E.active,x=Object(h.a)(Object(h.a)({},y),{},{expanded:u,selected:n,checked:o,loaded:l,loading:w,halfChecked:v,dragOver:i,dragOverGapTop:R,dragOverGapBottom:k,pos:d,active:b});return"props"in x||Object.defineProperty(x,"props",{get:function(){return Object(T.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),E}}),x}},"8EBN":function(M,ne,N){(function(I){I(N("VrN/"))})(function(I){"use strict";I.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 h=0;h<I.modeInfo.length;h++){var S=I.modeInfo[h];S.mimes&&(S.mime=S.mimes[0])}I.findModeByMIME=function(L){L=L.toLowerCase();for(var T=0;T<I.modeInfo.length;T++){var c=I.modeInfo[T];if(c.mime==L)return c;if(c.mimes){for(var C=0;C<c.mimes.length;C++)if(c.mimes[C]==L)return c}}if(/\+xml$/.test(L))return I.findModeByMIME("application/xml");if(/\+json$/.test(L))return I.findModeByMIME("application/json")},I.findModeByExtension=function(L){L=L.toLowerCase();for(var T=0;T<I.modeInfo.length;T++){var c=I.modeInfo[T];if(c.ext){for(var C=0;C<c.ext.length;C++)if(c.ext[C]==L)return c}}},I.findModeByFileName=function(L){for(var T=0;T<I.modeInfo.length;T++){var c=I.modeInfo[T];if(c.file&&c.file.test(L))return c}var C=L.lastIndexOf("."),g=C>-1&&L.substring(C+1,L.length);if(g)return I.findModeByExtension(g)},I.findModeByName=function(L){L=L.toLowerCase();for(var T=0;T<I.modeInfo.length;T++){var c=I.modeInfo[T];if(c.name.toLowerCase()==L)return c;if(c.alias){for(var C=0;C<c.alias.length;C++)if(c.alias[C].toLowerCase()==L)return c}}}})},"8hTe":function(M,ne,N){M.exports={button:"button___1wy9m"}},"9Bee":function(M,ne,N){"use strict";var I=N("DYRE"),h=N("zeV3"),S=N("+L6B"),L=N("2/Rp"),T=N("k1fw"),c=N("9og8"),C=N("tJVT"),g=N("WmNS"),s=N.n(g),a=N("q1tI"),r=N.n(a),f=N("vg9a"),p=N("DlQD"),m=N.n(p),E=N("rUJ1");function y(we,fe){var pe=we.match(/^(\s+)(?:```)/);if(pe===null)return fe;var ye=pe[1];return fe.split(`
`).map(function(_e){var xe=_e.match(/^\s+/);if(xe===null)return _e;var Se=Object(C.a)(xe,1),Ae=Se[0];return Ae.length>=ye.length?_e.slice(ye.length):_e}).join(`
`)}var u=[],n=["<ul>"],o=new m.a.Renderer,l=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function w(){u.length=0,n=["<ul>"]}var v={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function i(we,fe,pe,ye){if(fe>=we.length||we[fe].level<=pe)return fe;var _e=we[fe];ye.push("<li><a href='#"+_e.anchor+"'>"+_e.text+"</a>"),fe++;var xe=[];return fe=i(we,fe,_e.level,xe),xe.length>0&&(ye.push("<ul>"),xe.forEach(function(Se){ye.push(Se)}),ye.push("</ul>")),ye.push("</li>"),fe=i(we,fe,pe,ye),fe}function R(){return i(u,0,0,n),n.push("</ul>"),n.join("")}var k={heading:function(fe){var pe=l.exec(fe);if(pe)return{type:"heading",raw:pe[0],depth:pe[1].length,text:pe[2]}},fences:function(fe){var pe=this.rules.block.fences.exec(fe);if(pe){var ye=pe[0],_e=y(ye,pe[3]||""),xe=pe[2]?pe[2].trim():pe[2];if(["latex","katex","math"].indexOf(xe)>=0){var Se=x(),Ae=_e;_e=Se,_[Se]={type:"block",expression:Ae}}return{type:"code",raw:ye,lang:xe,text:_e}}}},d=/(?:\${2})([^\n`]+?)(?:\${2})/gi,b=0,x=function(){return"__special_katext_id_".concat(b++,"__")},_={};function B(){return _}function U(){b=0,_={}}function P(we){return we=we.replace(d,function(fe,pe){var ye=x();return _[ye]={type:"inline",expression:pe},ye}),we}var J=o.listitem;o.listitem=function(we){return J(P(we))};var $=o.paragraph;o.paragraph=function(we){return $(P(we))};var z=o.tablecell;o.tablecell=function(we,fe){return z(P(we),fe)},o.code=function(we,fe,pe){var ye=(fe||"").match(/\S*/)[0];return ye?["latex","katex","math"].indexOf(ye)>=0?"<p class='editormd-tex'>".concat(we,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(fe,'">').concat(pe?we:Object(E.escape)(we,!0),`</code></pre>
`):'<pre class="prettyprint linenums"><code>'+(pe?we:Object(E.escape)(we,!0))+"</code></pre>"},o.heading=function(we,fe,pe){var ye=this.options.headerPrefix+pe.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return u.push({anchor:ye,level:fe,text:we}),"<h"+fe+' id="'+ye+'">'+we+"</h"+fe+">"},m.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),m.a.use({tokenizer:k,renderer:o});var V=m.a,K=N("SJMd"),H=N("ulZh"),G=N.n(H),ie=N("m3rI"),le=N("Oy/b"),ue=N("p5ED"),be=N("ErOA"),Ce=N("STEk");/* **********************************
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 se=function(we,fe){return(se=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(pe,ye){pe.__proto__=ye}||function(pe,ye){for(var _e in ye)Object.prototype.hasOwnProperty.call(ye,_e)&&(pe[_e]=ye[_e])})(we,fe)};function ce(we,fe){if(typeof fe!="function"&&fe!==null)throw new TypeError("Class extends value "+String(fe)+" is not a constructor or null");function pe(){this.constructor=we}se(we,fe),we.prototype=fe===null?Object.create(fe):(pe.prototype=fe.prototype,new pe)}function he(we,fe,pe,ye){return new(pe||(pe=Promise))(function(_e,xe){function Se(Le){try{Oe(ye.next(Le))}catch(Me){xe(Me)}}function Ae(Le){try{Oe(ye.throw(Le))}catch(Me){xe(Me)}}function Oe(Le){var Me;Le.done?_e(Le.value):(Me=Le.value,Me instanceof pe?Me:new pe(function(Ke){Ke(Me)})).then(Se,Ae)}Oe((ye=ye.apply(we,fe||[])).next())})}function ae(we,fe){var pe,ye,_e,xe,Se={label:0,sent:function(){if(1&_e[0])throw _e[1];return _e[1]},trys:[],ops:[]};return xe={next:Ae(0),throw:Ae(1),return:Ae(2)},typeof Symbol=="function"&&(xe[Symbol.iterator]=function(){return this}),xe;function Ae(Oe){return function(Le){return function(Me){if(pe)throw new TypeError("Generator is already executing.");for(;Se;)try{if(pe=1,ye&&(_e=2&Me[0]?ye.return:Me[0]?ye.throw||((_e=ye.return)&&_e.call(ye),0):ye.next)&&!(_e=_e.call(ye,Me[1])).done)return _e;switch(ye=0,_e&&(Me=[2&Me[0],_e.value]),Me[0]){case 0:case 1:_e=Me;break;case 4:return Se.label++,{value:Me[1],done:!1};case 5:Se.label++,ye=Me[1],Me=[0];continue;case 7:Me=Se.ops.pop(),Se.trys.pop();continue;default:if(!(_e=Se.trys,(_e=_e.length>0&&_e[_e.length-1])||Me[0]!==6&&Me[0]!==2)){Se=0;continue}if(Me[0]===3&&(!_e||Me[1]>_e[0]&&Me[1]<_e[3])){Se.label=Me[1];break}if(Me[0]===6&&Se.label<_e[1]){Se.label=_e[1],_e=Me;break}if(_e&&Se.label<_e[2]){Se.label=_e[2],Se.ops.push(Me);break}_e[2]&&Se.ops.pop(),Se.trys.pop();continue}Me=fe.call(we,Se)}catch(Ke){Me=[6,Ke],ye=0}finally{pe=_e=0}if(5&Me[0])throw Me[1];return{value:Me[0]?Me[1]:void 0,done:!0}}([Oe,Le])}}}var Q=function(){function we(){}return we.addKey=function(fe){we.key=fe},Object.defineProperty(we,"isLicensed",{get:function(){return!!we.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(we.key)},enumerable:!1,configurable:!0}),we}(),D=function(){function we(){}return we.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},we.setAttributes=function(fe,pe){for(var ye=0,_e=pe;ye<_e.length;ye++){var xe=_e[ye],Se=xe[0],Ae=xe[1];fe.setAttribute(Se,Ae)}},we.createRect=function(fe,pe,ye){var _e=document.createElementNS("http://www.w3.org/2000/svg","rect");return _e.setAttribute("width",fe.toString()),_e.setAttribute("height",pe.toString()),ye&&we.setAttributes(_e,ye),_e},we.createLine=function(fe,pe,ye,_e,xe){var Se=document.createElementNS("http://www.w3.org/2000/svg","line");return Se.setAttribute("x1",fe.toString()),Se.setAttribute("y1",pe.toString()),Se.setAttribute("x2",ye.toString()),Se.setAttribute("y2",_e.toString()),xe&&we.setAttributes(Se,xe),Se},we.createPolygon=function(fe,pe){var ye=document.createElementNS("http://www.w3.org/2000/svg","polygon");return ye.setAttribute("points",fe),pe&&we.setAttributes(ye,pe),ye},we.createCircle=function(fe,pe){var ye=document.createElementNS("http://www.w3.org/2000/svg","circle");return ye.setAttribute("cx",(fe/2).toString()),ye.setAttribute("cy",(fe/2).toString()),ye.setAttribute("r",fe.toString()),pe&&we.setAttributes(ye,pe),ye},we.createEllipse=function(fe,pe,ye){var _e=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return _e.setAttribute("cx",(fe/2).toString()),_e.setAttribute("cy",(pe/2).toString()),_e.setAttribute("rx",(fe/2).toString()),_e.setAttribute("ry",(pe/2).toString()),ye&&we.setAttributes(_e,ye),_e},we.createGroup=function(fe){var pe=document.createElementNS("http://www.w3.org/2000/svg","g");return fe&&we.setAttributes(pe,fe),pe},we.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},we.createMarker=function(fe,pe,ye,_e,xe,Se,Ae){var Oe=document.createElementNS("http://www.w3.org/2000/svg","marker");return we.setAttributes(Oe,[["id",fe],["orient",pe],["markerWidth",ye.toString()],["markerHeight",_e.toString()],["refX",xe.toString()],["refY",Se.toString()]]),Oe.appendChild(Ae),Oe},we.createText=function(fe){var pe=document.createElementNS("http://www.w3.org/2000/svg","text");return pe.setAttribute("x","0"),pe.setAttribute("y","0"),fe&&we.setAttributes(pe,fe),pe},we.createTSpan=function(fe,pe){var ye=document.createElementNS("http://www.w3.org/2000/svg","tspan");return ye.textContent=fe,pe&&we.setAttributes(ye,pe),ye},we.createImage=function(fe){var pe=document.createElementNS("http://www.w3.org/2000/svg","image");return fe&&we.setAttributes(pe,fe),pe},we.createPoint=function(fe,pe){var ye=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return ye.x=fe,ye.y=pe,ye},we.createPath=function(fe,pe){var ye=document.createElementNS("http://www.w3.org/2000/svg","path");return ye.setAttribute("d",fe),pe&&we.setAttributes(ye,pe),ye},we.createElement=function(fe,pe){var ye=document.createElementNS("http://www.w3.org/2000/svg",fe);return pe&&we.setAttributes(ye,pe),ye},we.getHollowRectanglePath=function(fe,pe,ye,_e,xe,Se,Ae,Oe){return"M"+fe+","+pe+"V"+(pe+_e)+"H"+(fe+ye)+"V"+pe+"H"+xe+"V"+Se+"H"+(xe+Ae)+"V"+(Se+Oe)+"H"+xe+"V"+pe+"Z"},we}(),F=function(){function we(fe){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+fe+"_"}return Object.defineProperty(we.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(we.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(we.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(we.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(we.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),we.prototype.addClass=function(fe){return this.styleSheet===void 0&&this.addStyleSheet(),fe.name=""+this.classNamePrefix+fe.localName,this.classes.push(fe),this.styleSheet.sheet.insertRule("."+fe.name+" {"+fe.style+"}",this.styleSheet.sheet.cssRules.length),fe},we.prototype.addRule=function(fe){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(fe),this.styleSheet.sheet.insertRule(fe.selector+" {"+fe.style+"}",this.styleSheet.sheet.cssRules.length)},we.prototype.addStyleSheet=function(){var fe;this.styleSheet=document.createElement("style"),((fe=this.styleSheetRoot)!==null&&fe!==void 0?fe:document.head).appendChild(this.styleSheet),this.addRule(new W("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new W("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new W("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new Y("_fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new Y("_fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},we.prototype.removeStyleSheet=function(){var fe;this.styleSheet&&(((fe=this.styleSheetRoot)!==null&&fe!==void 0?fe:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},we}(),W=function(we,fe){this.selector=we,this.style=fe},Y=function(we,fe){this.localName=we,this.style=fe},Z=function(){function we(){this.blocks=[],this.display=""}return we.prototype.addButtonBlock=function(fe){fe.className=this.blockClassName,fe.buttonClassName=this.buttonClassName,fe.buttonColorsClassName=this.buttonColorsClassName,fe.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(fe)},we.prototype.addElementBlock=function(fe){fe.className===void 0&&(fe.className=this.blockClassName),this.blocks.push(fe)},we.prototype.getUI=function(){var fe=document.createElement("div");return fe.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,fe.style.display=this.display,this.blocks.forEach(function(pe){return fe.appendChild(pe.getUI())}),fe},we}(),te=function(){function we(){}return we.prototype.getUI=function(){var fe=document.createElement("div");if(fe.className=this.className,this.minWidth!==void 0&&(fe.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":fe.style.justifyContent="flex-start";break;case"center":fe.style.justifyContent="center";break;case"end":fe.style.justifyContent="flex-end"}return fe.style.whiteSpace="nowrap",fe},we}(),q=function(we){function fe(){var pe=we!==null&&we.apply(this,arguments)||this;return pe.buttons=[],pe}return ce(fe,we),fe.prototype.addButton=function(pe){pe.className=this.buttonClassName,pe.colorsClassName=this.buttonColorsClassName,pe.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(pe)},fe.prototype.getUI=function(){var pe=we.prototype.getUI.call(this);return this.buttons.forEach(function(ye){return pe.appendChild(ye.getUI())}),pe},fe}(te),X=function(){function we(fe,pe){this._isActive=!1,this._isHidden=!1,this._icon=fe,this.title=pe,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(we.prototype,"icon",{get:function(){return this._icon},set:function(fe){this._icon=fe,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(we.prototype,"isActive",{get:function(){return this._isActive},set:function(fe){this._isActive=fe,this.adjustClassName()},enumerable:!1,configurable:!0}),we.prototype.getUI=function(){var fe=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 fe.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},we.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,"")))},we.prototype.hide=function(){this._isHidden=!0},we}(),re=function(we){function fe(){var pe=we!==null&&we.apply(this,arguments)||this;return pe.elements=[],pe}return ce(fe,we),fe.prototype.addElement=function(pe){this.elements.push(pe)},fe.prototype.getUI=function(){var pe=we.prototype.getUI.call(this);return this.elements.forEach(function(ye){return pe.appendChild(ye)}),pe},fe}(te),me=function(){function we(fe,pe){this.horizontal=fe,this.vertical=pe}return Object.defineProperty(we.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),we.prototype.getVerticalLength=function(fe){return fe/this.ratio},we.prototype.getHorizontalLength=function(fe){return fe*this.ratio},we}(),ve=function(){function we(){}return we.getIcon=function(fe,pe){if(fe>0&&pe>0){var ye=new me(fe,pe),_e=ye.ratio>=1?20:ye.getHorizontalLength(20),xe=ye.ratio<1?20:ye.getVerticalLength(20),Se=document.createElementNS("http://www.w3.org/2000/svg","svg");Se.setAttribute("xmlns","http://www.w3.org/2000/svg"),Se.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(Se);var Ae=D.createDefs();Se.appendChild(Ae);var Oe=D.createElement("clipPath",[["id","text-bg-clip"]]);Ae.appendChild(Oe);var Le=D.createPath(D.getHollowRectanglePath((24-_e)/2,(24-xe)/2,_e,xe,(24-_e)/2+2,(24-xe)/2+2,_e-4,xe-4));Se.appendChild(Le);var Me=D.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Me.appendChild(D.createTSpan(fe+":"+pe)),Se.appendChild(Me);var Ke=Me.getBBox();D.setAttributes(Me,[["x",((24-Ke.width)/2).toString()],["y",((24-Ke.height)/2-Ke.y).toString()]]);var Qe=D.createPath(D.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Ke.width))/2,(24-Math.ceil(Ke.height))/2,Math.ceil(Ke.width),Math.ceil(Ke.height)));return Oe.appendChild(Qe),D.setAttributes(Le,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(Se),Se.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>'},we}(),Te=function(we){function fe(pe,ye,_e){var xe=we.call(this,pe,ye)||this;return xe.isDropdownOpen=!1,xe.onClick=xe.dropdownButtonClicked,xe.dropdownButtons=_e,xe}return ce(fe,we),fe.prototype.setupDropdown=function(){var pe=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(ye){ye.className=pe.className,ye.colorsClassName=pe.colorsClassName,pe.dropdownBlock.appendChild(ye.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},fe.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},fe.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},fe.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},fe.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},fe.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},fe}(X),Re=function(){function we(fe,pe){this.GRIP_SIZE=10,this.color=fe,this.fillColor=pe,this.visual=D.createGroup(),this.visual.appendChild(D.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(D.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return we.prototype.ownsTarget=function(fe){return fe===this.visual||fe===this.visual.childNodes[0]||fe===this.visual.childNodes[1]},we.prototype.setCenter=function(fe,pe){this.visual.childNodes.forEach(function(ye){return D.setAttributes(ye,[["cx",fe.toString()],["cy",pe.toString()]])})},we}(),Ie=function(){function we(fe,pe,ye,_e){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=fe,this.canvasHeight=pe,this.margin=ye,this.container=_e,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(we.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(fe){this._aspectRatio=fe,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(we.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(fe){this._isGridVisible=fe,this.gridContainer&&D.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(we.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(fe){this._zoomFactor=fe,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),we.prototype.open=function(){var fe=this;this.cropShadeElement=D.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=D.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var pe=0;pe<this.numberOfGridLines;pe++)this.horizontalGridLines.push(D.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(D.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(ye){return fe.gridContainer.appendChild(ye)}),this.verticalGridLines.forEach(function(ye){return fe.gridContainer.appendChild(ye)}),this.cropRectElement=D.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new Re(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new Re(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new Re(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new Re(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},we.prototype.setCropRectangle=function(fe){this.cropRect=fe;var pe=Object.assign({},this.cropRect);this.zoomFactor!==1&&(pe.width=this.cropRect.width*this.zoomFactor,pe.height=this.cropRect.height*this.zoomFactor,pe.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-pe.width/2,pe.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-pe.height/2),D.setAttributes(this.cropRectElement,[["x",pe.x.toString()],["y",pe.y.toString()],["width",pe.width.toString()],["height",pe.height.toString()]]);var ye=pe.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(xe,Se){var Ae=pe.y+ye*(Se+1);D.setAttributes(xe,[["x1",""+pe.x],["y1",""+Ae],["x2",""+(pe.x+pe.width)],["y2",""+Ae]])});var _e=pe.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(xe,Se){var Ae=pe.x+_e*(Se+1);D.setAttributes(xe,[["x1",""+Ae],["y1",""+pe.y],["x2",""+Ae],["y2",""+(pe.y+pe.height)]])}),D.setAttributes(this.cropShadeElement,[["d",D.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,pe.x,pe.y,pe.width,pe.height)]]),this.topLeftGrip.setCenter(pe.x,pe.y),this.topRightGrip.setCenter(pe.x+pe.width,pe.y),this.bottomLeftGrip.setCenter(pe.x,pe.y+pe.height),this.bottomRightGrip.setCenter(pe.x+pe.width,pe.y+pe.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},we.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)},we.prototype.clientToLocalCoordinates=function(fe,pe){var ye=this.container.getBoundingClientRect();return{x:fe-ye.left+this.margin,y:pe-ye.top+this.margin}},we.prototype.onPointerDown=function(fe){this.container.setPointerCapture(fe.pointerId),this.previousPoint=this.clientToLocalCoordinates(fe.clientX,fe.clientY),this.cropRectElement===fe.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(fe.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(fe.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(fe.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(fe.target)&&(this.activeGrip=this.bottomRightGrip)},we.prototype.onPointerMove=function(fe){if(this.isMoving)this.move(this.clientToLocalCoordinates(fe.clientX,fe.clientY));else if(this.activeGrip){var pe=this.clientToLocalCoordinates(fe.clientX,fe.clientY);this.resize(pe)}fe.preventDefault()},we.prototype.onPointerUp=function(fe){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(fe.pointerId)},we.prototype.move=function(fe){var pe=fe.x-this.previousPoint.x,ye=fe.y-this.previousPoint.y;this.zoomFactor!==1&&(pe=-pe/this.zoomFactor,ye=-ye/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+pe),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+ye),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=fe},we.prototype.resize=function(fe){var pe=Object.assign({},this.cropRect),ye=fe.x-this.previousPoint.x,_e=fe.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:pe.x+ye<this.margin&&(ye=this.margin-pe.x),pe.x+=ye,pe.width=this.cropRect.x+this.cropRect.width-pe.x;break;case this.bottomRightGrip:case this.topRightGrip:pe.width+ye>this.canvasWidth*this.zoomFactor&&(ye=this.canvasWidth*this.zoomFactor-pe.width),pe.width+=ye}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(pe.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(ye),pe.height=this.aspectRatio.getVerticalLength(pe.width)):(pe.y+=_e,pe.height=this.cropRect.y+this.cropRect.height-pe.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?pe.height=this.aspectRatio.getVerticalLength(pe.width):pe.height+=_e}pe.width<10&&(pe.x=this.cropRect.x,pe.width=10),pe.height<10&&(pe.y=this.cropRect.y,pe.height=10),this.previousPoint=fe,pe.x>=this.margin&&pe.y>=this.margin&&pe.x-this.margin+pe.width<=this.canvasWidth&&pe.y-this.margin+pe.height<=this.canvasHeight&&(this.cropRect=pe,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},we.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var fe=this.cropRect.x+this.cropRect.width/2,pe=this.cropRect.y+this.cropRect.height/2,ye=this.aspectRatio.getHorizontalLength(this.cropRect.height),_e=this.aspectRatio.getVerticalLength(this.cropRect.width);ye/this.canvasWidth<_e/this.canvasHeight?this.cropRect.width=ye:this.cropRect.height=_e,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=fe-this.cropRect.width/2,this.cropRect.y=pe-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)}},we.prototype.getRescaledRect=function(fe,pe,ye,_e,xe,Se){var Ae=ye/fe,Oe=_e/pe;return{x:(xe.x-Se)*Ae+Se,y:(xe.y-Se)*Oe+Se,width:xe.width*Ae,height:xe.height*Oe}},we.prototype.scaleCanvas=function(fe,pe){var ye=this.getRescaledRect(this.canvasWidth,this.canvasHeight,fe,pe,this.cropRect,this.margin);this.canvasWidth=fe,this.canvasHeight=pe,this.onCropChange&&this.onCropChange(ye),this.setCropRectangle(ye)},we}(),je=function(){function we(fe){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=fe,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(we.prototype,"angle",{get:function(){return this._angle},set:function(fe){this._angle=fe,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),we.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},we.prototype.onPointerDown=function(fe){this.controlContainer.setPointerCapture(fe.pointerId),this.isDragging=!0,this.previousPoint={x:fe.clientX,y:fe.clientY}},we.prototype.onPointerMove=function(fe){this.isDragging&&(this.onAngleChange&&this.onAngleChange((fe.clientX-this.previousPoint.x)/5),this.previousPoint.x=fe.clientX)},we.prototype.onPointerUp=function(fe){this.isDragging&&this.onAngleChange&&this.onAngleChange((fe.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(fe.pointerId)},we.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var fe=this.angleLabelText.getBBox();D.setAttributes(this.angleLabelElement,[["x",((this.width-fe.width)/2).toString()],["y",(this.height/2).toString()]])}},we.prototype.positionScaleShape=function(){if(this.scaleShape){var fe=this.scaleShape.transform.baseVal.getItem(0);fe.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(fe,0)}},we.prototype.getVisual=function(){var fe=document.createElementNS("http://www.w3.org/2000/svg","svg");fe.setAttribute("xmlns","http://www.w3.org/2000/svg"),fe.setAttribute("width",this.width+"px"),fe.setAttribute("height",this.height+"px"),fe.setAttribute("viewBox","0 0 "+this.width+" "+this.height),fe.style.flexShrink="0",document.body.appendChild(fe);for(var pe="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,ye=1;ye<=this.width/5+10;ye++){var _e=ye%5==0?this.height/3:this.height/6;pe+="h4v"+-_e+"h1v"+_e}pe+="v1H0Z",this.scaleShape=D.createPath(pe);var xe=D.createTransform();this.scaleShape.transform.baseVal.appendItem(xe),fe.appendChild(this.scaleShape),this.angleLabelElement=D.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=D.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var Se=D.createTSpan("");return Se.innerHTML="&deg;",this.angleLabelElement.appendChild(Se),fe.appendChild(this.angleLabelElement),document.body.removeChild(fe),fe},we}(),Ne=function(){function we(){this.naturalSize=!1,this.imageType="image/png"}return we.prototype.rasterize=function(fe,pe,ye,_e,xe,Se,Ae){var Oe=this;return new Promise(function(Le){var Me=document.createElement("canvas");Me.width=fe.width.baseVal.value-2*_e,Me.height=fe.height.baseVal.value-2*_e;var Ke=1,Qe=1;Oe.naturalSize===!0?(Ke=pe.naturalWidth/(fe.width.baseVal.value-2*_e)/Se,Qe=pe.naturalHeight/(fe.height.baseVal.value-2*_e)/Ae,Me.width=pe.naturalWidth/Se,Me.height=pe.naturalHeight/Ae):Oe.width!==void 0&&Oe.height!==void 0&&(Ke=Oe.width/ye.width,Qe=Oe.height/ye.height,Me.width*=Ke,Me.height*=Qe);var Ye=Me.getContext("2d");Ye.translate(Me.width/2,Me.height/2),Ye.rotate(xe*Math.PI/180),Ye.scale(Se,Ae),Ye.translate(-Me.width/2,-Me.height/2),Ye.drawImage(pe,0,0,Me.width,Me.height);var nt=document.createElement("canvas");nt.width=ye.width*Ke,nt.height=ye.height*Qe,nt.getContext("2d").putImageData(Ye.getImageData((ye.x-_e)*Ke,(ye.y-_e)*Qe,ye.width*Ke,ye.height*Qe),0,0),Le(nt.toDataURL(Oe.imageType,Oe.imageQuality))})},we}(),We=function(){function we(fe){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=we.instanceCounter++,this.styles=new F(this.instanceNo),this.target=fe,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(we.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(we.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(fe){this._zoomToCropEnabled=fe,fe?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(we.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(fe){this._isGridVisible=fe,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(we.prototype,"gridLines",{get:function(){return this._gridLines},set:function(fe){this._gridLines=fe,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(we.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(fe){this._rotationAngle=fe,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(we.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(we.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(we.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(we.prototype,"aspectRatio",{get:function(){var fe;return(fe=this._aspectRatio)!==null&&fe!==void 0?fe:this.aspectRatios[0]},set:function(fe){this._aspectRatio=fe},enumerable:!1,configurable:!0}),we.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},we.prototype.show=function(){this.showUI(),this.open()},we.prototype.close=function(fe){fe===void 0&&(fe=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),fe||this.closeEventListeners.forEach(function(pe){return pe()}),this._isOpen=!1)},we.prototype.addRenderEventListener=function(fe){this.renderEventListeners.push(fe)},we.prototype.removeRenderEventListener=function(fe){this.renderEventListeners.indexOf(fe)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(fe),1)},we.prototype.addCloseEventListener=function(fe){this.closeEventListeners.push(fe)},we.prototype.removeCloseEventListener=function(fe){this.closeEventListeners.indexOf(fe)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(fe),1)},we.prototype.setupResizeObserver=function(){var fe=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){fe.resize(fe.target.clientWidth,fe.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))},we.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var fe=1*this.target.clientWidth/this.target.clientHeight,pe=this.contentDiv.clientWidth/fe>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*fe:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,ye=pe+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/fe;this.resize(pe,ye)}},we.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},we.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",D.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},we.prototype.resize=function(fe,pe){this.imageWidth=Math.round(fe),this.imageHeight=Math.round(pe),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()},we.prototype.setEditingTarget=function(){var fe=document.createElement("canvas");fe.width=this.target.naturalWidth,fe.height=this.target.naturalHeight,fe.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var pe=fe.toDataURL();D.setAttributes(this.editingTarget,[["href",pe]]),this.setEditingTargetSize()},we.prototype.setTopLeft=function(){var fe=this.target.getBoundingClientRect(),pe=this.editorCanvas.getBoundingClientRect();this.left=fe.left-pe.left-this.CANVAS_MARGIN,this.top=fe.top-pe.top-this.CANVAS_MARGIN},we.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=D.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=D.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=D.createGroup(),this.editingTargetRotationScaleContainer=D.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var fe=D.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(fe);var pe=D.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(pe),this.editingTargetContainer=D.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)},we.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},we.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=D.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new Ie(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()},we.prototype.zoomToCrop=function(){if(this.cropRect){var fe=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,pe=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=fe+"px "+pe+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-fe+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-pe+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},we.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)},we.prototype.cropRectChanged=function(fe){this.cropRect=fe,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},we.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},we.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"},we.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},we.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 fe=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,pe=this.target.offsetTop>fe+this.CANVAS_MARGIN?this.target.offsetTop-(fe+this.CANVAS_MARGIN):0;this.coverDiv.style.top=pe+"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},we.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},we.prototype.addTopToolbar=function(){var fe=this;this.topToolbar=new Z,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 pe=new q;pe.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(pe);var ye=[];this.aspectRatios.forEach(function(Qe){var Ye=new X(ve.getIcon(Qe.horizontal,Qe.vertical),Qe.horizontal===0&&Qe.vertical===0?"FREE":Qe.horizontal+":"+Qe.vertical);Ye.onClick=function(){return fe.ratioButtonClicked(Qe)},ye.push(Ye)}),this.aspectRatioButton=new Te(ve.getIcon(0,0),"Aspect ratio",ye),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,pe.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var _e=new X('<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");_e.isActive=this.isGridVisible,_e.onClick=function(){fe.isGridVisible=!fe.isGridVisible,_e.isActive=fe.isGridVisible},pe.addButton(_e);var xe=new X('<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(xe.isActive=this.zoomToCropEnabled,xe.onClick=function(){fe.zoomToCropEnabled=!fe.zoomToCropEnabled,xe.isActive=fe.zoomToCropEnabled},pe.addButton(xe),!Q.isLicensed){var Se=new re;this.topToolbar.addElementBlock(Se);var Ae=document.createElement("div");Ae.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var Oe=document.createElement("a");Oe.style.color="currentColor",Oe.href="https://markerjs.com/products/cropro",Oe.target="_blank",Oe.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>',Ae.appendChild(Oe),Se.addElement(Ae)}var Le=new q;Le.minWidth=3*this.toolbarHeight+"px",Le.contentAlign="end",this.topToolbar.addButtonBlock(Le);var Me=new X('<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");Me.onClick=this.startRenderAndClose,Le.addButton(Me),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Me.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Ke=new X('<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");Ke.onClick=this.close,Le.addButton(Ke),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Ke.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},we.prototype.addBottomToolbar=function(){var fe=this;this.bottomToolbar=new Z,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 pe=new q;pe.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(pe);var ye=new X('<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");ye.onClick=this.rotateLeftButtonClicked,pe.addButton(ye);var _e=new X('<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");_e.onClick=this.rotateRightButtonClicked,pe.addButton(_e);var xe=new re;xe.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(xe),this.straightener=new je("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(Le){fe.rotateBy(Le),fe.straightener.angle=fe.rotationAngle},xe.addElement(this.straightener.getUI());var Se=new q;Se.minWidth=2*this.toolbarHeight+"px",Se.contentAlign="end",this.bottomToolbar.addButtonBlock(Se);var Ae=new X('<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");Ae.onClick=this.flipHorizontallyButtonClicked,Se.addButton(Ae);var Oe=new X('<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");Oe.onClick=this.flipVerticallyButtonClicked,Se.addButton(Oe)},we.prototype.ratioButtonClicked=function(fe){this.aspectRatio=fe,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},we.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=ve.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},we.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new me(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},we.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},we.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},we.prototype.restoreState=function(fe){if(fe){var pe=this.cropLayer.getRescaledRect(fe.width,fe.height,this.imageWidth,this.imageHeight,fe.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(pe),this.cropRectChanged(pe),this.flippedHorizontally=fe.flippedHorizontally,this.flippedVertically=fe.flippedVertically,this.applyFlip(),this.rotationAngle=fe.rotationAngle,this.applyRotation()}},we.prototype.clientToLocalCoordinates=function(fe,pe){var ye=this.cropImage.getBoundingClientRect();return{x:fe-ye.left,y:pe-ye.top}},we.prototype.onWindowResize=function(){this.positionUI()},we.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var fe=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=fe+"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()},we.prototype.rotateLeftButtonClicked=function(){var fe=this.rotationAngle-90;this.rotationAngle%90!=0&&(fe+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(fe)},we.prototype.rotateRightButtonClicked=function(){var fe=this.rotationAngle+90;this.rotationAngle%90!=0&&(fe-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(fe)},we.prototype.rotateTo=function(fe){fe=(fe=fe>180?fe-360:fe)<=-180?fe+360:fe,this.rotationAngle=fe,this.applyRotation()},we.prototype.rotateBy=function(fe){this.rotateTo((this.rotationAngle+fe)%360)},we.prototype.applyRotation=function(){var fe=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var pe=this.editingTargetRotationContainer.transform.baseVal.getItem(0);pe.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(pe,0);var ye=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/ye.width,this.imageHeight/ye.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=fe},we.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},we.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},we.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},we.prototype.startRenderAndClose=function(){return he(this,void 0,void 0,function(){var fe,pe;return ae(this,function(ye){switch(ye.label){case 0:return[4,this.render()];case 1:return fe=ye.sent(),pe=this.getState(),this.renderEventListeners.forEach(function(_e){return _e(fe,pe)}),this.close(!0),[2]}})})},we.prototype.render=function(){return he(this,void 0,void 0,function(){var fe;return ae(this,function(pe){switch(pe.label){case 0:return(fe=new Ne).naturalSize=this.renderAtNaturalSize,fe.imageType=this.renderImageType,fe.imageQuality=this.renderImageQuality,fe.width=this.renderWidth,fe.height=this.renderHeight,this.unzoomFromCrop(),D.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,fe.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 pe.sent(),[4,fe.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,pe.sent()]}})})},we.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Y("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 Y("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Y("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var fe=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Y("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*fe)+`px;
height: `+(this.toolbarHeight-2*fe)+`px;
padding: `+fe+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Y("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Y("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new W("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new W("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new Y("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 Y("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new Y("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 Y("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*fe)+`px;
padding: `+fe+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new Y("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},we.instanceCounter=0,we}(),Be=N("8hTe"),He=N.n(Be),De=/<pre[^>]*>/g;function Xe(we){var fe=document.createElement("div");return fe.innerHTML=we,fe.childNodes.length===0?"":fe.childNodes[0].nodeValue}var $e=ne.a=function(we){var fe=we.value,pe=fe===void 0?"":fe,ye=we.edit,_e=ye===void 0?!1:ye,xe=we.className,Se=we.showTextOnly,Ae=we.showLines,Oe=we.replaces,Le=we.zoomImg,Me=we.hasMask,Ke=we.style,Qe=Ke===void 0?{}:Ke,Ye=we.stylesPrev,nt=Ye===void 0?{}:Ye,pt=String(pe),st=Object(a.useRef)(),tt=Object(a.useRef)(),Pt=Object(a.useState)(""),wt=Object(C.a)(Pt,2),Vt=wt[0],Bt=wt[1],gt=Object(a.useState)("office"),xt=Object(C.a)(gt,2),rr=xt[0],Gt=xt[1],Ge=function(){var ft=new We(tt.current);ft.displayMode="popup",ft.addRenderEventListener(function(){var zt=Object(c.a)(s.a.mark(function St(kt){var Ut;return s.a.wrap(function(Xt){for(;;)switch(Xt.prev=Xt.next){case 0:return st.current.style.display="none",Xt.next=3,Object(be.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:kt}});case 3:Ut=Xt.sent,Ut!=null&&Ut.id&&Oe(tt.current.getAttribute("src").replace(ie.a.API_SERVER,""),"/api/attachments/".concat(Ut==null?void 0:Ut.id,"?type=").concat(Ut.content_type));case 5:case"end":return Xt.stop()}},St)}));return function(St){return zt.apply(this,arguments)}}()),ft.show()},lt=function(){var ft=new Ce.a(tt.current);ft.settings.displayMode="popup",ft.addEventListener("render",function(){var zt=Object(c.a)(s.a.mark(function St(kt){var Ut;return s.a.wrap(function(Xt){for(;;)switch(Xt.prev=Xt.next){case 0:if(st.current.style.display="none",!tt.current){Xt.next=6;break}return Xt.next=4,Object(be.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:kt.dataUrl}});case 4:Ut=Xt.sent,Ut!=null&&Ut.id&&Oe(tt.current.getAttribute("src").replace(ie.a.API_SERVER,""),"/api/attachments/".concat(Ut==null?void 0:Ut.id,"?type=").concat(Ut.content_type));case 6:case"end":return Xt.stop()}},St)}));return function(St){return zt.apply(this,arguments)}}()),ft.show(),window.markerArea=ft},yt=Object(a.useMemo)(function(){st.current&&(st.current.style.zIndex=-1);try{var at=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,ft=/\"\/api\/attachments\/|\"\/attachments\/download\//g,zt=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;pt=pt.replace(at,"("+ie.a.API_SERVER+"/api/attachments/").replace(ft,'"'+ie.a.API_SERVER+"/api/attachments/").replace(zt,'"'+ie.a.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
`)}catch(Nt){}var St=V(pt),kt=B();if(pt.match(/\[TOC\]/)&&(St=St.replace("<p>[TOC]</p>",R()),w()),St=St.replace(/(__special_katext_id_\d+__)/g,function(Nt,Xt){var Je=kt[Xt],bt=Je.type,kr=Je.expression;return Object(le.renderToString)(Xe(kr)||"",{displayMode:bt==="block",throwOnError:!1,output:"html"})}),St=St.replace(/▁/g,"\u2581\u2581\u2581"),U(),Se){var Ut=document.createElement("div");return Ut.innerHTML=St,Ut.innerText}return setTimeout(function(){return Ot()},500),St},[pt]),It=Object(a.useRef)();v.WebkitLineClamp=Ae,Ae&&(Qe=Object(T.a)(Object(T.a)({},Qe),v));function Wt(at){var ft=at.target;if(ft.tagName.toUpperCase()==="IMG"){if(Le){var zt=ft.getAttribute("src");Bt(zt),Gt("image")}}else if(ft.tagName.toUpperCase()==="A"){var St=ft.getAttribute("href");if(St.indexOf("office")>-1)at.preventDefault(),Bt(St),Gt("office");else if(St.indexOf("application/pdf")>-1)at.preventDefault(),Bt(St),Gt("pdf");else if(St.indexOf("text/html")>-1)at.preventDefault(),Bt(St),Gt("html");else if(St.startsWith("#")){at.preventDefault();var kt=document.getElementById(St.replace("#",""));kt&&kt.scrollIntoView(!0)}}}var Ot=function(){var ft,zt=(ft=It.current)===null||ft===void 0?void 0:ft.querySelectorAll("video");zt==null||zt.forEach(function(St){if(St.oncontextmenu=function(){return!1},St.src.indexOf(".m3u8")>-1&&!St.canPlayType("application/vnd.apple.mpegurl")){if(G.a.isSupported()){var kt=new G.a;kt.loadSource(St.src),kt.attachMedia(St)}}})};Object(a.useEffect)(function(){if(It.current&&yt&&(yt.match(De)&&window.PR.prettyPrint()),It.current)return It.current.addEventListener("click",Wt),function(){It.current.removeEventListener("click",Wt),U(),w()}},[yt,It.current,Wt]);var Rt=function(ft){if(!_e)return;ft.target.nodeName==="IMG"?(st.current.style.zIndex=1,st.current.style.display="flex",st.current.style.width=ft.target.clientWidth+"px",st.current.style.height=ft.target.clientHeight+"px",st.current.style.top=ft.target.offsetTop+"px",st.current.style.left=ft.target.offsetLeft+"px",tt.current.src=ft.target.getAttribute("src")):st.current.style.display="none"};return r.a.createElement("div",{style:{position:"relative"}},r.a.createElement("div",{ref:It,style:Object(T.a)({},Qe),className:"".concat(xe||""," markdown-body ").concat(He.a.mdBody),onMouseOver:Rt,dangerouslySetInnerHTML:{__html:yt}}),r.a.createElement("div",{ref:st,className:He.a.button},r.a.createElement(h.a,null,r.a.createElement(L.a,{onClick:function(){return Ge()}},"\u88C1\u526A"),r.a.createElement(L.a,{onClick:function(){return lt()}},"\u7F16\u8F91"))),r.a.createElement("img",{ref:tt,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),r.a.createElement(ue.a,{close:!0,data:Vt,type:Vt!=null&&Vt.length?rr:"",style:Object(T.a)({},nt),onClose:function(){return Bt("")}}))}},"9OqN":function(M,ne,N){(function(I,h,S){M.exports=ne=h(N("Ib8C"),N("OLod"))})(this,function(I){return I.mode.CTR=function(){var h=I.lib.BlockCipherMode.extend(),S=h.Encryptor=h.extend({processBlock:function(L,T){var c=this._cipher,C=c.blockSize,g=this._iv,s=this._counter;g&&(s=this._counter=g.slice(0),this._iv=void 0);var a=s.slice(0);c.encryptBlock(a,0),s[C-1]=s[C-1]+1|0;for(var r=0;r<C;r++)L[T+r]^=a[r]}});return h.Decryptor=S,h}(),I.mode.CTR})},"9VGf":function(M,ne,N){"use strict";N.d(ne,"a",function(){return S});var I=N("q1tI"),h=N.n(I);function S(L,T){var c=Object(I.useRef)();Object(I.useEffect)(function(){c.current=L}),Object(I.useEffect)(function(){function C(){c.current()}if(T!==null){var g=setInterval(C,T);return function(){return clearInterval(g)}}},[T])}},ALsQ:function(M,ne,N){(function(I,h,S){M.exports=ne=h(N("Ib8C"),N("OLod"))})(this,function(I){return I.mode.CFB=function(){var h=I.lib.BlockCipherMode.extend();h.Encryptor=h.extend({processBlock:function(L,T){var c=this._cipher,C=c.blockSize;S.call(this,L,T,C,c),this._prevBlock=L.slice(T,T+C)}}),h.Decryptor=h.extend({processBlock:function(L,T){var c=this._cipher,C=c.blockSize,g=L.slice(T,T+C);S.call(this,L,T,C,c),this._prevBlock=g}});function S(L,T,c,C){var g,s=this._iv;s?(g=s.slice(0),this._iv=void 0):g=this._prevBlock,C.encryptBlock(g,0);for(var a=0;a<c;a++)L[T+a]^=g[a]}return h}(),I.mode.CFB})},B7Ph:function(M,ne,N){"use strict";N.d(ne,"a",function(){return le});var I=N("5NDa"),h=N("5rEg"),S=N("sRBo"),L=N("kaz8"),T=N("5Dmo"),c=N("3S7+"),C=N("14J3"),g=N("BMrR"),s=N("7Kak"),a=N("9yH6"),r=N("+L6B"),f=N("2/Rp"),p=N("2qtc"),m=N("kLXV"),E=N("miYZ"),y=N("tsqr"),u=N("k1fw"),n=N("9og8"),o=N("tJVT"),l=N("oBTY"),w=N("DZo9"),v=N("8z0m"),i=N("WmNS"),R=N.n(i),k=N("q1tI"),d=N.n(k),b=N("Bvq2"),x=N.n(b),_=N("nj2k"),B=N.n(_),U=N("mxV5"),P=N.n(U),J=N("KhGG"),$=N("ErOA"),z=N("7Cbv"),V=N("1vsH"),K=N("p5ED"),H=v.a.Dragger,G=function(be){for(var Ce=function(Z){return Z&&Z.substring(0,Z.lastIndexOf("."))},se=Object(l.a)(be),ce=0,he=[],ae=0;ae<se.length;ae++){for(var Q="",D=0;D<he.length;D++)if(Ce(he[D][0].name)==Ce(se[ae].name)){ce=1,Q=D;break}if(ce==1)he[Q].push(se[ae]),ce=0;else if(ce==0){var F=new Array;F.push(se[ae]),he.push(F)}}var W=he.map(function(Y){if(Y[0].name.includes(".in"))return Y.length===2?Y:[Y[0],{}];if(Y[0].name.includes(".out"))return Y.length===2?Y.reverse():[{},Y[0]]});return W},ie=function(be){var Ce=be.onClose,se=be.onOK,ce=be.visible,he=be.wrapClassName,ae=be.rootIdentifier,Q=be.multiple,D=Q===void 0?!1:Q,F=be.defaultMultipleValue,W=F===void 0?!0:F,Y=Object(k.useState)([]),Z=Object(o.a)(Y,2),te=Z[0],q=Z[1],X=Object(k.useState)({}),re=Object(o.a)(X,2),me=re[0],ve=re[1],Te=Object(k.useState)(!1),Re=Object(o.a)(Te,2),Ie=Re[0],je=Re[1],Ne=Object(k.useState)(!0),We=Object(o.a)(Ne,2),Be=We[0],He=We[1],De=Object(k.useState)(null),Xe=Object(o.a)(De,2),$e=Xe[0],we=Xe[1],fe=Object(k.useRef)([]),pe=Object(k.useRef)(0),ye=function(){Ce()};Object(k.useEffect)(function(){_e()},[]),Object(k.useEffect)(function(){ce&&(fe.current=[],pe.current=0,q([]),He(W))},[ce]);var _e=function(){var Qe=Object(n.a)(R.a.mark(function Ye(){var nt,pt;return R.a.wrap(function(tt){for(;;)switch(tt.prev=tt.next){case 0:return tt.prev=0,tt.next=3,Object($.a)("/api/buckets/get_upload_token_for_big_files",{method:"get"});case 3:nt=tt.sent,(nt==null?void 0:nt.status)===0&&(nt!=null&&nt.is_oss?(pt=JSON.parse(Object(J.a)(nt.data)),ve(pt),we(!1)):we(!0)),tt.next=9;break;case 7:tt.prev=7,tt.t0=tt.catch(0);case 9:case"end":return tt.stop()}},Ye,null,[[0,7]])}));return function(){return Qe.apply(this,arguments)}}(),xe=function(Ye){return Ye&&Ye.substring(0,Ye.lastIndexOf("."))},Se=function(Ye){var nt,pt,st=xe((nt=Ye[0])===null||nt===void 0?void 0:nt.name)||xe((pt=Ye[1])===null||pt===void 0?void 0:pt.name),tt=te.filter(function(Pt){return xe(Pt.name)!==st});fe.current=Object(l.a)(tt),q(Object(l.a)(tt))},Ae=function(Ye){if(!Be){var nt=new FormData;nt.append("file",Ye.file);var pt=Object($.a)("/api/attachments/get_file_content.json",{method:"post",body:nt},!0);pt.then(function(xt){if(xt.status===0){pe.current=pe.current+1;var rr=fe.current.map(function(Ge){if(Ge.name===Ye.name){var lt,yt=Object(u.a)({},Ge);return Ye!=null&&(lt=Ye.name)!==null&&lt!==void 0&&lt.includes(".in")?yt.input=xt==null?void 0:xt.content:yt.output=xt==null?void 0:xt.content,yt}return Ge});if(fe.current=Object(l.a)(rr),q(Object(l.a)(rr)),pe.current>0&&pe.current===te.length){je(!1);var Gt=G(rr);Gt=Gt.filter(function(Ge){var lt,yt;return!!((lt=Ge[0])!==null&&lt!==void 0&&lt.name&&(yt=Ge[1])!==null&&yt!==void 0&&yt.name)}),Gt=Gt.map(function(Ge){return Object(u.a)(Object(u.a)(Object(u.a)({},Ge[0]),Ge[1]),{},{is_file:!1})}),se(Gt),Ce()}}else je(!1),Ce()});return}if($e){var st=new FormData;st.append("file",Ye.file),st.append("identifier",ae);var tt=Object($.a)("/api/attachments.json",{method:"post",body:st},!0);tt.then(function(xt){if(xt.filename){pe.current=pe.current+1;var rr=fe.current.map(function(Ge){if(Ge.name===(xt==null?void 0:xt.filename)){var lt,yt=Object(u.a)(Object(u.a)({},Ge),{},{is_oss:!$e});return xt!=null&&(lt=xt.filename)!==null&&lt!==void 0&&lt.includes(".in")?(yt.in_object_key=xt==null?void 0:xt.object,yt.in_object_size=xt==null?void 0:xt.size,yt.input=xt==null?void 0:xt.filename,yt.in_file=Ye):(yt.out_object_key=xt==null?void 0:xt.object,yt.out_object_size=xt==null?void 0:xt.size,yt.output=xt==null?void 0:xt.filename,yt.out_file=Ye),yt}return Ge});if(fe.current=Object(l.a)(rr),q(Object(l.a)(rr)),pe.current>0&&pe.current===te.length){je(!1);var Gt=G(rr);Gt=Gt.filter(function(Ge){var lt,yt;return!!((lt=Ge[0])!==null&&lt!==void 0&&lt.name&&(yt=Ge[1])!==null&&yt!==void 0&&yt.name)}),Gt=Gt.map(function(Ge){return Object(u.a)(Object(u.a)(Object(u.a)({},Ge[0]),Ge[1]),{},{is_file:!0})}),se(Gt),Ce()}}else je(!1),Ce()});return}var Pt=new P.a({endpoint:me.end_point,region:me.region,accessKeyId:me.access_key_id,accessKeySecret:me.access_key_secret,bucket:me.bucket,stsToken:me.security_token}),wt=Ye.name,Vt={container_type:"TestSet",file_name:wt},Bt=Object(z.a)(),gt="testsets/".concat(ae,"/").concat(Bt).concat(wt.indexOf(".")>-1?"."+wt.split(".").pop():"");ae===null&&(gt="testsets/".concat(Bt).concat(wt.indexOf(".")>-1?"."+wt.split(".").pop():"")),Pt.multipartUpload(gt,new Blob([Ye.file],{type:Ye.file.type}),{timeout:3600*1e3,partSize:1002400,callback:{customValue:{id:wt+""},url:me==null?void 0:me.callback_url,host:me==null?void 0:me.bucket_host,body:"bucket=${bucket}&object=${object}&etag=${etag}&size=${size}&mimeType=${mimeType}&my_var=${x:my_var}&"+Object($.e)(Vt)}}).then(function(xt){if(xt.data.status===0){pe.current=pe.current+1;var rr=fe.current.map(function(Ge){var lt,yt;if(Ge.name===((lt=xt.data)===null||lt===void 0||((yt=lt.data)===null||yt===void 0)?void 0:yt.file_name)){var It,Wt,Ot,Rt=Object(u.a)(Object(u.a)({},Ge),{},{is_oss:!$e});if((It=xt.data)!==null&&It!==void 0&&(Wt=It.data)!==null&&Wt!==void 0&&(Ot=Wt.file_name)!==null&&Ot!==void 0&&Ot.includes(".in")){var at,ft,zt,St,kt,Ut;Rt.in_object_key=(at=xt.data)===null||at===void 0||((ft=at.data)===null||ft===void 0)?void 0:ft.object,Rt.in_object_size=(zt=xt.data)===null||zt===void 0||((St=zt.data)===null||St===void 0)?void 0:St.size,Rt.input=(kt=xt.data)===null||kt===void 0||((Ut=kt.data)===null||Ut===void 0)?void 0:Ut.file_name,Rt.in_file=Ye}else{var Nt,Xt,Je,bt,kr,wr;Rt.out_object_key=(Nt=xt.data)===null||Nt===void 0||((Xt=Nt.data)===null||Xt===void 0)?void 0:Xt.object,Rt.out_object_size=(Je=xt.data)===null||Je===void 0||((bt=Je.data)===null||bt===void 0)?void 0:bt.size,Rt.output=(kr=xt.data)===null||kr===void 0||((wr=kr.data)===null||wr===void 0)?void 0:wr.file_name,Rt.out_file=Ye}return Rt}return Ge});if(fe.current=Object(l.a)(rr),q(Object(l.a)(rr)),pe.current>0&&pe.current===te.length){je(!1);var Gt=G(rr);Gt=Gt.filter(function(Ge){var lt,yt;return!!((lt=Ge[0])!==null&&lt!==void 0&&lt.name&&(yt=Ge[1])!==null&&yt!==void 0&&yt.name)}),Gt=Gt.map(function(Ge){return Object(u.a)(Object(u.a)(Object(u.a)({},Ge[0]),Ge[1]),{},{is_file:!0})}),se(Gt),Ce()}}})},Oe=function(Ye){return new Promise(function(nt,pt){for(var st=0,tt=[],Pt=function(Bt){Ye[Bt].file.slice(0,1).arrayBuffer().then(function(){st++,st===Ye.length&&(tt.length?(y.b.warn("".concat(tt.join("\uFF0C"),"\u6587\u4EF6\u5DF2\u635F\u574F\u6216\u5DF2\u88AB\u4FEE\u6539\uFF0C\u8BF7\u5220\u9664\u540E\u91CD\u65B0\u4E0A\u4F20\uFF01")),pt()):nt(Ye))}).catch(function(gt){console.log("\u9519\u8BEF\u4FE1\u606F\uFF1A",gt),st++,tt.push(Ye[Bt].name),st===Ye.length&&(tt.length?(y.b.warn("".concat(tt.join("\uFF0C"),"\u6587\u4EF6\u5DF2\u635F\u574F\u6216\u5DF2\u88AB\u4FEE\u6539\uFF0C\u8BF7\u5220\u9664\u540E\u91CD\u65B0\u4E0A\u4F20\uFF01")),pt()):nt(Ye))})},wt=0;wt<Ye.length;wt++)Pt(wt)})},Le=function(){var Qe=Object(n.a)(R.a.mark(function Ye(){var nt;return R.a.wrap(function(st){for(;;)switch(st.prev=st.next){case 0:if(!(te.length===0)){st.next=3;break}return y.b.warn("\u8BF7\u9009\u62E9\u4E0A\u4F20\u6587\u4EF6"),st.abrupt("return");case 3:return st.next=5,Oe(te);case 5:if(je(!0),nt=G(te),!nt.some(function(tt){var Pt,wt;return!((Pt=tt[0])!==null&&Pt!==void 0&&Pt.name&&(wt=tt[1])!==null&&wt!==void 0&&wt.name)})){st.next=10;break}return m.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:"\u4E0A\u4F20\u7684\u6D4B\u8BD5\u7528\u4F8B\u4E2D\u5B58\u5728\u672A\u914D\u5BF9\u7684\u6587\u4EF6\uFF0C\u8BF7\u786E\u8BA4\u662F\u5426\u4EC5\u4FDD\u5B58\u5DF2\u914D\u5BF9\u7684\u6D4B\u8BD5\u7528\u4F8B\uFF1F",onOk:function(){var tt=Object(n.a)(R.a.mark(function wt(){return R.a.wrap(function(Bt){for(;;)switch(Bt.prev=Bt.next){case 0:te.map(function(){var gt=Object(n.a)(R.a.mark(function xt(rr){return R.a.wrap(function(Ge){for(;;)switch(Ge.prev=Ge.next){case 0:Ae(rr);case 1:case"end":return Ge.stop()}},xt)}));return function(xt){return gt.apply(this,arguments)}}());case 1:case"end":return Bt.stop()}},wt)}));function Pt(){return tt.apply(this,arguments)}return Pt}(),onCancel:function(){je(!1)}}),st.abrupt("return");case 10:te.map(function(){var tt=Object(n.a)(R.a.mark(function Pt(wt){return R.a.wrap(function(Bt){for(;;)switch(Bt.prev=Bt.next){case 0:Ae(wt);case 1:case"end":return Bt.stop()}},Pt)}));return function(Pt){return tt.apply(this,arguments)}}());case 11:case"end":return st.stop()}},Ye)}));return function(){return Qe.apply(this,arguments)}}(),Me={name:"file",fileList:te,multiple:!0,accept:".in, .out",showUploadList:!1,beforeUpload:function(Ye){if(te!=null&&te.some(function(pt){return pt.name===Ye.name}))return y.b.info("".concat(Ye.name,"\u6587\u4EF6\u5DF2\u5B58\u5728")),!1;if(Ye.size/1024/1024>100)return y.b.info("\u6587\u4EF6\u8D85\u8FC7100M\uFF0C\u4E0D\u7B26\u5408\u4E0A\u4F20\u8981\u6C42"),!1;if(!/\.(in|out|IN|OUT)$/.test(Ye.name))return y.b.warn("\u8F93\u5165\u6587\u4EF6\u53EA\u80FD\u4E0A\u4F20.in\u548C.out\u7C7B\u578B\u7684\u6587\u672C\u6587\u4EF6"),!1;var nt={name:Ye.name,uid:Ye.uid,file:Ye,percent:0};return te.push(nt),fe.current=Object(l.a)(te),q(Object(l.a)(te)),!1}},Ke=G(te);return console.log(te,Ke,"fileList"),d.a.createElement(m.a,{visible:ce,wrapClassName:he,onOk:Le,centered:!0,okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",okButtonProps:{loading:Ie},onCancel:ye,width:"1000px",title:"\u6279\u91CF\u4E0A\u4F20\u6D4B\u8BD5\u7528\u4F8B"},d.a.createElement("div",{className:x.a.wrap},te.length?d.a.createElement("div",null,d.a.createElement(g.a,{justify:"space-between",align:"middle",className:"mb20"},d.a.createElement("div",{style:{visibility:D?"visible":"hidden"}},"\u6D4B\u8BD5\u7528\u4F8B\u7C7B\u578B\uFF1A",d.a.createElement(a.a.Group,{className:"ml10",value:Be,onChange:function(Ye){return He(Ye.target.value)}},d.a.createElement(a.a,{value:!1},"\u6587\u672C"),d.a.createElement(a.a,{value:!0},"\u6587\u4EF6"))),d.a.createElement(v.a,Me,d.a.createElement(f.a,{className:x.a.btnS},"\u4E0A\u4F20\u6587\u4EF6"))),d.a.createElement(le,{data:Ke,onRemove:Se})):d.a.createElement("div",{className:x.a.noData},d.a.createElement("img",{src:B.a,alt:""}),d.a.createElement(v.a,Me,d.a.createElement(f.a,{className:x.a.btn},"\u4E0A\u4F20\u6587\u4EF6"))),d.a.createElement("div",{className:x.a.text},"\u4E0A\u4F20\u9650\u5236\uFF1A",d.a.createElement("br",null),"1\u3001\u6587\u4EF6\u5FC5\u987B\u4E0A\u4F20.in\u548C.out\u7C7B\u578B\u7684\u6587\u672C\u6587\u4EF6\u3002",d.a.createElement("br",null),"2\u3001\u4E0A\u4F20\u7684\u6587\u4EF6\u7F16\u7801\u4EC5\u652F\u6301UTF-8\uFF0C\u5426\u5219\u53EF\u80FD\u4F1A\u51FA\u73B0\u6587\u672C\u4E71\u7801\u3002",d.a.createElement("br",null),"3\u3001\u8F93\u5165\u8F93\u51FA\u6587\u4EF6\u9700\u6587\u4EF6\u540D\u79F0\u4E00\u4E00\u5BF9\u5E94\uFF0C\u672A\u5BF9\u5E94\u65F6\uFF0C\u5C06\u65E0\u6CD5\u4E0A\u4F20\u3002",d.a.createElement("br",null),"4\u3001\u5355\u4E2A\u4E0A\u4F20\u6587\u4EF6\u4E0D\u80FD\u8D85\u8FC7100MB\uFF0C\u8D85\u8FC7\u65F6\u53EF\u4EE5\u5206\u6279\u6B21\u4E0A\u4F20\u3002",d.a.createElement("br",null))))},le=function(be){var Ce=be.data,se=Ce===void 0?[]:Ce,ce=be.onRemove,he=be.width,ae=he===void 0?"auto":he,Q=be.showScore,D=Q===void 0?!1:Q,F=be.disabled,W=F===void 0?!1:F,Y=be.inputChange,Z=be.onEvaluatingChange,te=be.showEvaluatingSetting,q=te===void 0?!1:te,X={value:"",filename:"",dataUrl:""},re=Object(k.useState)(Object(u.a)({},X)),me=Object(o.a)(re,2),ve=me[0],Te=me[1],Re=function(We){var Be=document.createElement("a");document.body.appendChild(Be);var He=URL.createObjectURL(We.file);Be.href=He,Be.download=We.name,Be.click(),URL.revokeObjectURL(He),document.body.removeChild(Be)},Ie=function(We,Be){Object(V.y)(We,Be)},je=function(We,Be){m.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:d.a.createElement("div",{className:"tc font16"},"\u8BF7\u786E\u8BA4\u662F\u5426\u5220\u9664\u8BE5\u6D4B\u8BD5\u7528\u4F8B?"),onOk:function(){ce(We,Be)},onCancel:function(){}})};return se.length?d.a.createElement("div",{style:{width:ae}},d.a.createElement("div",{className:x.a.head},q&&d.a.createElement("div",{style:{width:"10%"}},"\u9690\u85CF",d.a.createElement(c.a,{title:'\u9690\u85CF\u6D4B\u8BD5\u96C6\u53EF\u4EE5\u9632\u6B62\u5B66\u751F\u901A\u8FC7"print"\u7B49\u624B\u6BB5\u76F4\u63A5\u901A\u5173'},d.a.createElement("i",{className:"ml5 font14 iconfont icon-xiaowenhao1"}))),d.a.createElement("div",{style:{width:"20%"}},"\u7528\u4F8B"),d.a.createElement("div",{style:{width:D?"25%":"35%",padding:"0 12px"}},"\u8F93\u5165"),d.a.createElement("div",{style:{width:D?"25%":"35%",padding:"0 12px"}},"\u8F93\u51FA"),D&&d.a.createElement("div",{style:{width:"20%"}},"\u5F97\u5206\u6BD4\u4F8B"),q&&d.a.createElement("div",{style:{width:"20%"}},"\u9884\u671F\u8F93\u51FA",d.a.createElement(c.a,{title:"\u52FE\u9009\u540E\uFF0C\u9884\u671F\u8F93\u51FA\u5BF9\u5B66\u5458\u59CB\u7EC8\u4E0D\u53EF\u89C1"},d.a.createElement("i",{className:"ml5 font14 iconfont icon-xiaowenhao1"}))),q&&d.a.createElement("div",{style:{width:"20%"}},"\u7279\u6B8A\u5224\u5B9A",d.a.createElement(c.a,{title:"\u52FE\u9009\u540E\uFF0C\u5B9E\u9645\u8F93\u51FA\u4E0E\u9884\u671F\u8F93\u51FA\u6700\u540E\u4E00\u884C\u76F8\u540C\u5373\u53EF\u901A\u5173"},d.a.createElement("i",{className:"ml5 font14 iconfont icon-xiaowenhao1"}))),d.a.createElement("div",{style:{width:"10%"}},"\u64CD\u4F5C")),se.map(function(Ne,We){var Be,He,De,Xe;return d.a.createElement("div",{key:We,className:x.a.list},q&&d.a.createElement("div",{style:{width:"10%"}},d.a.createElement(L.a,{checked:!!Ne.hidden,onChange:function(we){Z(we.target.checked?1:0,We,"hidden")}})),d.a.createElement("div",{style:{width:"20%"}},"\u6D4B\u8BD5\u7528\u4F8B",We+1),d.a.createElement("div",{className:x.a.info,style:{width:D?"25%":"35%"}},d.a.createElement("span",{title:Ne.input||((Be=Ne[0])===null||Be===void 0?void 0:Be.name),onClick:Object(n.a)(R.a.mark(function $e(){var we,fe;return R.a.wrap(function(ye){for(;;)switch(ye.prev=ye.next){case 0:if(Ne.input?Ne.input_file_url?we=Ne.input_file_url:we=Ne.in_file:we=Ne[0],!(typeof we=="string")){ye.next=14;break}return ye.next=4,fetch(we,{method:"Get",headers:{"Content-Type":"application/octet-stream",Accept:"*/*"}});case 4:return fe=ye.sent,ye.t0=Te,ye.next=8,fe.text();case 8:ye.t1=ye.sent,ye.t2=we,ye.t3={value:ye.t1,filename:"",dataUrl:ye.t2},(0,ye.t0)(ye.t3),ye.next=18;break;case 14:return ye.next=16,Object(V.G)(we.file);case 16:fe=ye.sent,Te({value:fe.text,filename:we.name,dataUrl:fe.link});case 18:case"end":return ye.stop()}},$e)}))},Ne.input||((He=Ne[0])===null||He===void 0?void 0:He.name))),d.a.createElement("div",{className:x.a.info,style:{width:D?"25%":"35%"}},d.a.createElement("span",{title:Ne.output||((De=Ne[1])===null||De===void 0?void 0:De.name),onClick:Object(n.a)(R.a.mark(function $e(){var we,fe;return R.a.wrap(function(ye){for(;;)switch(ye.prev=ye.next){case 0:if(Ne.input?Ne.output_file_url?we=Ne.output_file_url:we=Ne.out_file:we=Ne[1],!(typeof we=="string")){ye.next=14;break}return ye.next=4,fetch(we,{method:"Get",headers:{"Content-Type":"application/octet-stream",Accept:"*/*"}});case 4:return fe=ye.sent,ye.t0=Te,ye.next=8,fe.text();case 8:ye.t1=ye.sent,ye.t2=we,ye.t3={value:ye.t1,filename:"",dataUrl:ye.t2},(0,ye.t0)(ye.t3),ye.next=18;break;case 14:return ye.next=16,Object(V.G)(we.file);case 16:fe=ye.sent,Te({value:fe.text,filename:we.name,dataUrl:fe.link});case 18:case"end":return ye.stop()}},$e)}))},Ne.output||((Xe=Ne[1])===null||Xe===void 0?void 0:Xe.name))),D&&d.a.createElement("div",{style:{width:"20%"}},d.a.createElement(h.a,{disabled:W,style:{width:"70%"},onChange:function(we){return Y(we,We)},value:Ne.score}),d.a.createElement("span",null,"\xA0%")),q&&d.a.createElement("div",{style:{width:"20%"}},d.a.createElement(L.a,{checked:Ne.is_invisible||!1,onChange:function(we){Z(we.target.checked,We,"is_invisible")},className:"font14"},"\u5BF9\u5B66\u5458\u4E0D\u53EF\u89C1")),q&&d.a.createElement("div",{style:{width:"20%"}},d.a.createElement(L.a,{checked:Ne.last_match_rule||!1,onChange:function(we){Z(we.target.checked,We,"last_match_rule")},className:"font14"},"\u672B\u5C3E\u5339\u914D")),d.a.createElement("div",{onClick:function(){return je(Ne,We)},style:{width:"10%"}},d.a.createElement("span",{className:x.a.del},"\u5220\u9664")))}),d.a.createElement(K.a,{close:!0,data:ve.dataUrl,filename:ve.filename,type:ve.dataUrl.length?"txt":"",onClose:function(){return Te(Object(u.a)({},X))},monacoEditor:{value:ve.value,language:"txt",onChange:function(){},options:{fontSize:14,readOnly:!0,minimap:{enabled:!1}}}})):d.a.createElement(d.a.Fragment,null)};ne.b=ie},Bd2K:function(M,ne,N){(function(I){I(N("VrN/"),N("osHv"))})(function(I){I.defineOption("autoCloseTags",!1,function(s,a,r){if(r!=I.Init&&r&&s.removeKeyMap("autoCloseTags"),!a)return;var f={name:"autoCloseTags"};(typeof a!="object"||a.whenClosing!==!1)&&(f["'/'"]=function(p){return c(p)}),(typeof a!="object"||a.whenOpening!==!1)&&(f["'>'"]=function(p){return L(p)}),s.addKeyMap(f)});var h=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],S=["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 L(s){if(s.getOption("disableInput"))return I.Pass;for(var a=s.listSelections(),r=[],f=s.getOption("autoCloseTags"),p=0;p<a.length;p++){if(!a[p].empty())return I.Pass;var m=a[p].head,E=s.getTokenAt(m),y=I.innerMode(s.getMode(),E.state),u=y.state,n=y.mode.xmlCurrentTag&&y.mode.xmlCurrentTag(u),o=n&&n.name;if(!o)return I.Pass;var l=y.mode.configuration=="html",w=typeof f=="object"&&f.dontCloseTags||l&&h,v=typeof f=="object"&&f.indentTags||l&&S;E.end>m.ch&&(o=o.slice(0,o.length-E.end+m.ch));var i=o.toLowerCase();if(!o||E.type=="string"&&(E.end!=m.ch||!/[\"\']/.test(E.string.charAt(E.string.length-1))||E.string.length==1)||E.type=="tag"&&n.close||E.string.indexOf("/")==m.ch-E.start-1||w&&C(w,i)>-1||g(s,y.mode.xmlCurrentContext&&y.mode.xmlCurrentContext(u)||[],o,m,!0))return I.Pass;var R=typeof f=="object"&&f.emptyTags;if(R&&C(R,o)>-1){r[p]={text:"/>",newPos:I.Pos(m.line,m.ch+2)};continue}var k=v&&C(v,i)>-1;r[p]={indent:k,text:">"+(k?`
`:"")+"</"+o+">",newPos:k?I.Pos(m.line+1,0):I.Pos(m.line,m.ch+1)}}for(var d=typeof f=="object"&&f.dontIndentOnAutoClose,p=a.length-1;p>=0;p--){var b=r[p];s.replaceRange(b.text,a[p].head,a[p].anchor,"+insert");var x=s.listSelections().slice(0);x[p]={head:b.newPos,anchor:b.newPos},s.setSelections(x),!d&&b.indent&&(s.indentLine(b.newPos.line,null,!0),s.indentLine(b.newPos.line+1,null,!0))}}function T(s,a){for(var r=s.listSelections(),f=[],p=a?"/":"</",m=s.getOption("autoCloseTags"),E=typeof m=="object"&&m.dontIndentOnSlash,y=0;y<r.length;y++){if(!r[y].empty())return I.Pass;var u=r[y].head,n=s.getTokenAt(u),o=I.innerMode(s.getMode(),n.state),l=o.state;if(a&&(n.type=="string"||n.string.charAt(0)!="<"||n.start!=u.ch-1))return I.Pass;var w,v=o.mode.name!="xml"&&s.getMode().name=="htmlmixed";if(v&&o.mode.name=="javascript")w=p+"script";else if(v&&o.mode.name=="css")w=p+"style";else{var i=o.mode.xmlCurrentContext&&o.mode.xmlCurrentContext(l);if(!i||i.length&&g(s,i,i[i.length-1],u))return I.Pass;w=p+i[i.length-1]}s.getLine(u.line).charAt(n.end)!=">"&&(w+=">"),f[y]=w}if(s.replaceSelections(f),r=s.listSelections(),!E)for(var y=0;y<r.length;y++)(y==r.length-1||r[y].head.line<r[y+1].head.line)&&s.indentLine(r[y].head.line)}function c(s){return s.getOption("disableInput")?I.Pass:T(s,!0)}I.commands.closeTag=function(s){return T(s)};function C(s,a){if(s.indexOf)return s.indexOf(a);for(var r=0,f=s.length;r<f;++r)if(s[r]==a)return r;return-1}function g(s,a,r,f,p){if(!I.scanForClosingTag)return!1;var m=Math.min(s.lastLine()+1,f.line+500),E=I.scanForClosingTag(s,f,null,m);if(!E||E.tag!=r)return!1;for(var y=p?1:0,u=a.length-1;u>=0&&a[u]==r;u--)++y;f=E.to;for(var u=1;u<y;u++){var n=I.scanForClosingTag(s,f,null,m);if(!n||n.tag!=r)return!1;f=n.to}return!0}})},BjJ7:function(M,ne,N){"use strict";N.d(ne,"d",function(){return h}),N.d(ne,"c",function(){return S}),N.d(ne,"e",function(){return L}),N.d(ne,"b",function(){return T}),N.d(ne,"a",function(){return C});var I=N("m3rI");function h(g){var s=!0;if(g.length>0){for(var a=0;a<g.length;a++)if(g[a].compile_success==0||!g[a].compile_success){s=!1;break}}else s=!1;return s}function S(g){for(var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",a=[],r=0;r<g.length;r++){var f=g[r],p=s?"".concat(s,"/").concat(f.name):"".concat(f.name);a.push({title:f.name,isLeaf:!(f.type==="tree"),key:p})}return a}function L(g,s,a){for(var r=0;r<g.length;r++){var f=g[r];if(f.key===s){f.children=a;break}f.children&&L(f.children,s,a)}return g}function T(g,s,a){var r;return function(){var f=this,p=arguments,m=function(){r=null,a||g.apply(f,p)},E=a&&!r;clearTimeout(r),r=setTimeout(m,s),E&&g.apply(f,p)}}var c=!0,C=I.a.API_SERVER},Bvq2:function(M,ne,N){M.exports={wrap:"wrap___2zRY4",colorBlue:"colorBlue___XalpT",repeatedName:"repeatedName___2Tfh4",text:"text___1sYHg",noData:"noData___3pdB4",btn:"btn___3WWjB",btnS:"btnS___2M_9t",head:"head____NWmz",list:"list___2fE4M",del:"del___2BO6Y",info:"info___3GJ70"}},"C+DQ":function(M,ne,N){},CrYA:function(M,ne,N){var I=N("MFOe"),h=I.Global;M.exports={name:"sessionStorage",read:L,write:T,each:c,remove:C,clearAll:g};function S(){return h.sessionStorage}function L(s){return S().getItem(s)}function T(s,a){return S().setItem(s,a)}function c(s){for(var a=S().length-1;a>=0;a--){var r=S().key(a);s(L(r),r)}}function C(s){return S().removeItem(s)}function g(){return S().clear()}},DlQD:function(M,ne,N){(function(I,h){M.exports=h()})(this,function(){"use strict";function I(pe,ye){for(var _e=0;_e<ye.length;_e++){var xe=ye[_e];xe.enumerable=xe.enumerable||!1,xe.configurable=!0,"value"in xe&&(xe.writable=!0),Object.defineProperty(pe,xe.key,xe)}}function h(pe,ye,_e){return ye&&I(pe.prototype,ye),_e&&I(pe,_e),pe}function S(pe,ye){if(!pe)return;if(typeof pe=="string")return L(pe,ye);var _e=Object.prototype.toString.call(pe).slice(8,-1);if(_e==="Object"&&pe.constructor&&(_e=pe.constructor.name),_e==="Map"||_e==="Set")return Array.from(pe);if(_e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(_e))return L(pe,ye)}function L(pe,ye){(ye==null||ye>pe.length)&&(ye=pe.length);for(var _e=0,xe=new Array(ye);_e<ye;_e++)xe[_e]=pe[_e];return xe}function T(pe,ye){var _e;if(typeof Symbol=="undefined"||pe[Symbol.iterator]==null){if(Array.isArray(pe)||(_e=S(pe))||ye&&pe&&typeof pe.length=="number"){_e&&(pe=_e);var xe=0;return function(){return xe>=pe.length?{done:!0}:{done:!1,value:pe[xe++]}}}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 _e=pe[Symbol.iterator](),_e.next.bind(_e)}function c(pe,ye){return ye={exports:{}},pe(ye,ye.exports),ye.exports}var C=c(function(pe){function ye(){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 _e(xe){pe.exports.defaults=xe}pe.exports={defaults:ye(),getDefaults:ye,changeDefaults:_e}}),g=C.defaults,s=C.getDefaults,a=C.changeDefaults,r=/[&<>"']/,f=/[&<>"']/g,p=/[<>"']|&(?!#?\w+;)/,m=/[<>"']|&(?!#?\w+;)/g,E={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},y=function(ye){return E[ye]};function u(pe,ye){if(ye){if(r.test(pe))return pe.replace(f,y)}else if(p.test(pe))return pe.replace(m,y);return pe}var n=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function o(pe){return pe.replace(n,function(ye,_e){return _e=_e.toLowerCase(),_e==="colon"?":":_e.charAt(0)==="#"?_e.charAt(1)==="x"?String.fromCharCode(parseInt(_e.substring(2),16)):String.fromCharCode(+_e.substring(1)):""})}var l=/(^|[^\[])\^/g;function w(pe,ye){pe=pe.source||pe,ye=ye||"";var _e={replace:function(Se,Ae){return Ae=Ae.source||Ae,Ae=Ae.replace(l,"$1"),pe=pe.replace(Se,Ae),_e},getRegex:function(){return new RegExp(pe,ye)}};return _e}var v=/[^\w:]/g,i=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function R(pe,ye,_e){if(pe){var xe;try{xe=decodeURIComponent(o(_e)).replace(v,"").toLowerCase()}catch(Se){return null}if(xe.indexOf("javascript:")===0||xe.indexOf("vbscript:")===0||xe.indexOf("data:")===0)return null}ye&&!i.test(_e)&&(_e=_(ye,_e));try{_e=encodeURI(_e).replace(/%25/g,"%")}catch(Se){return null}return _e}var k={},d=/^[^:]+:\/*[^/]*$/,b=/^([^:]+:)[\s\S]*$/,x=/^([^:]+:\/*[^/]*)[\s\S]*$/;function _(pe,ye){k[" "+pe]||(d.test(pe)?k[" "+pe]=pe+"/":k[" "+pe]=J(pe,"/",!0)),pe=k[" "+pe];var _e=pe.indexOf(":")===-1;return ye.substring(0,2)==="//"?_e?ye:pe.replace(b,"$1")+ye:ye.charAt(0)==="/"?_e?ye:pe.replace(x,"$1")+ye:pe+ye}var B={exec:function(){}};function U(pe){for(var ye=1,_e,xe;ye<arguments.length;ye++){_e=arguments[ye];for(xe in _e)Object.prototype.hasOwnProperty.call(_e,xe)&&(pe[xe]=_e[xe])}return pe}function P(pe,ye){var _e=pe.replace(/\|/g,function(Ae,Oe,Le){for(var Me=!1,Ke=Oe;--Ke>=0&&Le[Ke]==="\\";)Me=!Me;return Me?"|":" |"}),xe=_e.split(/ \|/),Se=0;if(xe.length>ye)xe.splice(ye);else for(;xe.length<ye;)xe.push("");for(;Se<xe.length;Se++)xe[Se]=xe[Se].trim().replace(/\\\|/g,"|");return xe}function J(pe,ye,_e){var xe=pe.length;if(xe===0)return"";for(var Se=0;Se<xe;){var Ae=pe.charAt(xe-Se-1);if(Ae===ye&&!_e)Se++;else if(Ae!==ye&&_e)Se++;else break}return pe.substr(0,xe-Se)}function $(pe,ye){if(pe.indexOf(ye[1])===-1)return-1;for(var _e=pe.length,xe=0,Se=0;Se<_e;Se++)if(pe[Se]==="\\")Se++;else if(pe[Se]===ye[0])xe++;else if(pe[Se]===ye[1]&&(xe--,xe<0))return Se;return-1}function z(pe){pe&&pe.sanitize&&!pe.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 V={escape:u,unescape:o,edit:w,cleanUrl:R,resolveUrl:_,noopTest:B,merge:U,splitCells:P,rtrim:J,findClosingBracket:$,checkSanitizeDeprecation:z},K=C.defaults,H=V.rtrim,G=V.splitCells,ie=V.escape,le=V.findClosingBracket;function ue(pe,ye,_e){var xe=ye.href,Se=ye.title?ie(ye.title):null,Ae=pe[1].replace(/\\([\[\]])/g,"$1");return pe[0].charAt(0)!=="!"?{type:"link",raw:_e,href:xe,title:Se,text:Ae}:{type:"image",raw:_e,href:xe,title:Se,text:ie(Ae)}}function be(pe,ye){var _e=pe.match(/^(\s+)(?:```)/);if(_e===null)return ye;var xe=_e[1];return ye.split(`
`).map(function(Se){var Ae=Se.match(/^\s+/);if(Ae===null)return Se;var Oe=Ae[0];return Oe.length>=xe.length?Se.slice(xe.length):Se}).join(`
`)}var Ce=function(){function pe(_e){this.options=_e||K}var ye=pe.prototype;return ye.space=function(xe){var Se=this.rules.block.newline.exec(xe);if(Se)return Se[0].length>1?{type:"space",raw:Se[0]}:{raw:`
`}},ye.code=function(xe,Se){var Ae=this.rules.block.code.exec(xe);if(Ae){var Oe=Se[Se.length-1];if(Oe&&Oe.type==="paragraph")return{raw:Ae[0],text:Ae[0].trimRight()};var Le=Ae[0].replace(/^ {4}/gm,"");return{type:"code",raw:Ae[0],codeBlockStyle:"indented",text:this.options.pedantic?Le:H(Le,`
`)}}},ye.fences=function(xe){var Se=this.rules.block.fences.exec(xe);if(Se){var Ae=Se[0],Oe=be(Ae,Se[3]||"");return{type:"code",raw:Ae,lang:Se[2]?Se[2].trim():Se[2],text:Oe}}},ye.heading=function(xe){var Se=this.rules.block.heading.exec(xe);if(Se)return{type:"heading",raw:Se[0],depth:Se[1].length,text:Se[2]}},ye.nptable=function(xe){var Se=this.rules.block.nptable.exec(xe);if(Se){var Ae={type:"table",header:G(Se[1].replace(/^ *| *\| *$/g,"")),align:Se[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Se[3]?Se[3].replace(/\n$/,"").split(`
`):[],raw:Se[0]};if(Ae.header.length===Ae.align.length){var Oe=Ae.align.length,Le;for(Le=0;Le<Oe;Le++)/^ *-+: *$/.test(Ae.align[Le])?Ae.align[Le]="right":/^ *:-+: *$/.test(Ae.align[Le])?Ae.align[Le]="center":/^ *:-+ *$/.test(Ae.align[Le])?Ae.align[Le]="left":Ae.align[Le]=null;for(Oe=Ae.cells.length,Le=0;Le<Oe;Le++)Ae.cells[Le]=G(Ae.cells[Le],Ae.header.length);return Ae}}},ye.hr=function(xe){var Se=this.rules.block.hr.exec(xe);if(Se)return{type:"hr",raw:Se[0]}},ye.blockquote=function(xe){var Se=this.rules.block.blockquote.exec(xe);if(Se){var Ae=Se[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:Se[0],text:Ae}}},ye.list=function(xe){var Se=this.rules.block.list.exec(xe);if(Se){for(var Ae=Se[0],Oe=Se[2],Le=Oe.length>1,Me=Oe[Oe.length-1]===")",Ke={type:"list",raw:Ae,ordered:Le,start:Le?+Oe.slice(0,-1):"",loose:!1,items:[]},Qe=Se[0].match(this.rules.block.item),Ye=!1,nt,pt,st,tt,Pt,wt,Vt,Bt=Qe.length,gt=0;gt<Bt;gt++)nt=Qe[gt],Ae=nt,pt=nt.length,nt=nt.replace(/^ *([*+-]|\d+[.)]) */,""),~nt.indexOf(`
`)&&(pt-=nt.length,nt=this.options.pedantic?nt.replace(/^ {1,4}/gm,""):nt.replace(new RegExp("^ {1,"+pt+"}","gm"),"")),gt!==Bt-1&&(st=this.rules.block.bullet.exec(Qe[gt+1])[0],(Le?st.length===1||!Me&&st[st.length-1]===")":st.length>1||this.options.smartLists&&st!==Oe)&&(tt=Qe.slice(gt+1).join(`
`),Ke.raw=Ke.raw.substring(0,Ke.raw.length-tt.length),gt=Bt-1)),Pt=Ye||/\n\n(?!\s*$)/.test(nt),gt!==Bt-1&&(Ye=nt.charAt(nt.length-1)===`
`,Pt||(Pt=Ye)),Pt&&(Ke.loose=!0),wt=/^\[[ xX]\] /.test(nt),Vt=void 0,wt&&(Vt=nt[1]!==" ",nt=nt.replace(/^\[[ xX]\] +/,"")),Ke.items.push({type:"list_item",raw:Ae,task:wt,checked:Vt,loose:Pt,text:nt});return Ke}},ye.html=function(xe){var Se=this.rules.block.html.exec(xe);if(Se)return{type:this.options.sanitize?"paragraph":"html",raw:Se[0],pre:!this.options.sanitizer&&(Se[1]==="pre"||Se[1]==="script"||Se[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Se[0]):ie(Se[0]):Se[0]}},ye.def=function(xe){var Se=this.rules.block.def.exec(xe);if(Se){Se[3]&&(Se[3]=Se[3].substring(1,Se[3].length-1));var Ae=Se[1].toLowerCase().replace(/\s+/g," ");return{tag:Ae,raw:Se[0],href:Se[2],title:Se[3]}}},ye.table=function(xe){var Se=this.rules.block.table.exec(xe);if(Se){var Ae={type:"table",header:G(Se[1].replace(/^ *| *\| *$/g,"")),align:Se[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Se[3]?Se[3].replace(/\n$/,"").split(`
`):[]};if(Ae.header.length===Ae.align.length){Ae.raw=Se[0];var Oe=Ae.align.length,Le;for(Le=0;Le<Oe;Le++)/^ *-+: *$/.test(Ae.align[Le])?Ae.align[Le]="right":/^ *:-+: *$/.test(Ae.align[Le])?Ae.align[Le]="center":/^ *:-+ *$/.test(Ae.align[Le])?Ae.align[Le]="left":Ae.align[Le]=null;for(Oe=Ae.cells.length,Le=0;Le<Oe;Le++)Ae.cells[Le]=G(Ae.cells[Le].replace(/^ *\| *| *\| *$/g,""),Ae.header.length);return Ae}}},ye.lheading=function(xe){var Se=this.rules.block.lheading.exec(xe);if(Se)return{type:"heading",raw:Se[0],depth:Se[2].charAt(0)==="="?1:2,text:Se[1]}},ye.paragraph=function(xe){var Se=this.rules.block.paragraph.exec(xe);if(Se)return{type:"paragraph",raw:Se[0],text:Se[1].charAt(Se[1].length-1)===`
`?Se[1].slice(0,-1):Se[1]}},ye.text=function(xe,Se){var Ae=this.rules.block.text.exec(xe);if(Ae){var Oe=Se[Se.length-1];return Oe&&Oe.type==="text"?{raw:Ae[0],text:Ae[0]}:{type:"text",raw:Ae[0],text:Ae[0]}}},ye.escape=function(xe){var Se=this.rules.inline.escape.exec(xe);if(Se)return{type:"escape",raw:Se[0],text:ie(Se[1])}},ye.tag=function(xe,Se,Ae){var Oe=this.rules.inline.tag.exec(xe);if(Oe)return!Se&&/^<a /i.test(Oe[0])?Se=!0:Se&&/^<\/a>/i.test(Oe[0])&&(Se=!1),!Ae&&/^<(pre|code|kbd|script)(\s|>)/i.test(Oe[0])?Ae=!0:Ae&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(Oe[0])&&(Ae=!1),{type:this.options.sanitize?"text":"html",raw:Oe[0],inLink:Se,inRawBlock:Ae,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Oe[0]):ie(Oe[0]):Oe[0]}},ye.link=function(xe){var Se=this.rules.inline.link.exec(xe);if(Se){var Ae=le(Se[2],"()");if(Ae>-1){var Oe=Se[0].indexOf("!")===0?5:4,Le=Oe+Se[1].length+Ae;Se[2]=Se[2].substring(0,Ae),Se[0]=Se[0].substring(0,Le).trim(),Se[3]=""}var Me=Se[2],Ke="";if(this.options.pedantic){var Qe=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Me);Qe?(Me=Qe[1],Ke=Qe[3]):Ke=""}else Ke=Se[3]?Se[3].slice(1,-1):"";Me=Me.trim().replace(/^<([\s\S]*)>$/,"$1");var Ye=ue(Se,{href:Me&&Me.replace(this.rules.inline._escapes,"$1"),title:Ke&&Ke.replace(this.rules.inline._escapes,"$1")},Se[0]);return Ye}},ye.reflink=function(xe,Se){var Ae;if((Ae=this.rules.inline.reflink.exec(xe))||(Ae=this.rules.inline.nolink.exec(xe))){var Oe=(Ae[2]||Ae[1]).replace(/\s+/g," ");if(Oe=Se[Oe.toLowerCase()],!Oe||!Oe.href){var Le=Ae[0].charAt(0);return{type:"text",raw:Le,text:Le}}var Me=ue(Ae,Oe,Ae[0]);return Me}},ye.strong=function(xe,Se,Ae){Ae===void 0&&(Ae="");var Oe=this.rules.inline.strong.start.exec(xe);if(Oe&&(!Oe[1]||Oe[1]&&(Ae===""||this.rules.inline.punctuation.exec(Ae)))){Se=Se.slice(-1*xe.length);var Le=Oe[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Le.lastIndex=0;for(var Me;(Oe=Le.exec(Se))!=null;)if(Me=this.rules.inline.strong.middle.exec(Se.slice(0,Oe.index+3)),Me)return{type:"strong",raw:xe.slice(0,Me[0].length),text:xe.slice(2,Me[0].length-2)}}},ye.em=function(xe,Se,Ae){Ae===void 0&&(Ae="");var Oe=this.rules.inline.em.start.exec(xe);if(Oe&&(!Oe[1]||Oe[1]&&(Ae===""||this.rules.inline.punctuation.exec(Ae)))){Se=Se.slice(-1*xe.length);var Le=Oe[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Le.lastIndex=0;for(var Me;(Oe=Le.exec(Se))!=null;)if(Me=this.rules.inline.em.middle.exec(Se.slice(0,Oe.index+2)),Me)return{type:"em",raw:xe.slice(0,Me[0].length),text:xe.slice(1,Me[0].length-1)}}},ye.codespan=function(xe){var Se=this.rules.inline.code.exec(xe);if(Se){var Ae=Se[2].replace(/\n/g," "),Oe=/[^ ]/.test(Ae),Le=Ae.startsWith(" ")&&Ae.endsWith(" ");return Oe&&Le&&(Ae=Ae.substring(1,Ae.length-1)),Ae=ie(Ae,!0),{type:"codespan",raw:Se[0],text:Ae}}},ye.br=function(xe){var Se=this.rules.inline.br.exec(xe);if(Se)return{type:"br",raw:Se[0]}},ye.del=function(xe){var Se=this.rules.inline.del.exec(xe);if(Se)return{type:"del",raw:Se[0],text:Se[1]}},ye.autolink=function(xe,Se){var Ae=this.rules.inline.autolink.exec(xe);if(Ae){var Oe,Le;return Ae[2]==="@"?(Oe=ie(this.options.mangle?Se(Ae[1]):Ae[1]),Le="mailto:"+Oe):(Oe=ie(Ae[1]),Le=Oe),{type:"link",raw:Ae[0],text:Oe,href:Le,tokens:[{type:"text",raw:Oe,text:Oe}]}}},ye.url=function(xe,Se){var Ae;if(Ae=this.rules.inline.url.exec(xe)){var Oe,Le;if(Ae[2]==="@")Oe=ie(this.options.mangle?Se(Ae[0]):Ae[0]),Le="mailto:"+Oe;else{var Me;do Me=Ae[0],Ae[0]=this.rules.inline._backpedal.exec(Ae[0])[0];while(Me!==Ae[0]);Oe=ie(Ae[0]),Ae[1]==="www."?Le="http://"+Oe:Le=Oe}return{type:"link",raw:Ae[0],text:Oe,href:Le,tokens:[{type:"text",raw:Oe,text:Oe}]}}},ye.inlineText=function(xe,Se,Ae){var Oe=this.rules.inline.text.exec(xe);if(Oe){var Le;return Se?Le=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Oe[0]):ie(Oe[0]):Oe[0]:Le=ie(this.options.smartypants?Ae(Oe[0]):Oe[0]),{type:"text",raw:Oe[0],text:Le}}},pe}(),se=V.noopTest,ce=V.edit,he=V.merge,ae={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:se,table:se,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};ae._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,ae._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,ae.def=ce(ae.def).replace("label",ae._label).replace("title",ae._title).getRegex(),ae.bullet=/(?:[*+-]|\d{1,9}[.)])/,ae.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,ae.item=ce(ae.item,"gm").replace(/bull/g,ae.bullet).getRegex(),ae.list=ce(ae.list).replace(/bull/g,ae.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ae.def.source+")").getRegex(),ae._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",ae._comment=/<!--(?!-?>)[\s\S]*?-->/,ae.html=ce(ae.html,"i").replace("comment",ae._comment).replace("tag",ae._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ae.paragraph=ce(ae._paragraph).replace("hr",ae.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",ae._tag).getRegex(),ae.blockquote=ce(ae.blockquote).replace("paragraph",ae.paragraph).getRegex(),ae.normal=he({},ae),ae.gfm=he({},ae.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*|$)"}),ae.gfm.nptable=ce(ae.gfm.nptable).replace("hr",ae.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",ae._tag).getRegex(),ae.gfm.table=ce(ae.gfm.table).replace("hr",ae.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",ae._tag).getRegex(),ae.pedantic=he({},ae.normal,{html:ce(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ae._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:se,paragraph:ce(ae.normal._paragraph).replace("hr",ae.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",ae.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var Q={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:se,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:se,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};Q._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",Q.punctuation=ce(Q.punctuation).replace(/punctuation/g,Q._punctuation).getRegex(),Q._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",Q._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",Q.em.start=ce(Q.em.start).replace(/punctuation/g,Q._punctuation).getRegex(),Q.em.middle=ce(Q.em.middle).replace(/punctuation/g,Q._punctuation).replace(/overlapSkip/g,Q._overlapSkip).getRegex(),Q.em.endAst=ce(Q.em.endAst,"g").replace(/punctuation/g,Q._punctuation).getRegex(),Q.em.endUnd=ce(Q.em.endUnd,"g").replace(/punctuation/g,Q._punctuation).getRegex(),Q.strong.start=ce(Q.strong.start).replace(/punctuation/g,Q._punctuation).getRegex(),Q.strong.middle=ce(Q.strong.middle).replace(/punctuation/g,Q._punctuation).replace(/blockSkip/g,Q._blockSkip).getRegex(),Q.strong.endAst=ce(Q.strong.endAst,"g").replace(/punctuation/g,Q._punctuation).getRegex(),Q.strong.endUnd=ce(Q.strong.endUnd,"g").replace(/punctuation/g,Q._punctuation).getRegex(),Q.blockSkip=ce(Q._blockSkip,"g").getRegex(),Q.overlapSkip=ce(Q._overlapSkip,"g").getRegex(),Q._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,Q._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Q._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])?)+(?![-_])/,Q.autolink=ce(Q.autolink).replace("scheme",Q._scheme).replace("email",Q._email).getRegex(),Q._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Q.tag=ce(Q.tag).replace("comment",ae._comment).replace("attribute",Q._attribute).getRegex(),Q._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Q._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,Q._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Q.link=ce(Q.link).replace("label",Q._label).replace("href",Q._href).replace("title",Q._title).getRegex(),Q.reflink=ce(Q.reflink).replace("label",Q._label).getRegex(),Q.reflinkSearch=ce(Q.reflinkSearch,"g").replace("reflink",Q.reflink).replace("nolink",Q.nolink).getRegex(),Q.normal=he({},Q),Q.pedantic=he({},Q.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:ce(/^!?\[(label)\]\((.*?)\)/).replace("label",Q._label).getRegex(),reflink:ce(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Q._label).getRegex()}),Q.gfm=he({},Q.normal,{escape:ce(Q.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),Q.gfm.url=ce(Q.gfm.url,"i").replace("email",Q.gfm._extended_email).getRegex(),Q.breaks=he({},Q.gfm,{br:ce(Q.br).replace("{2,}","*").getRegex(),text:ce(Q.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var D={block:ae,inline:Q},F=C.defaults,W=D.block,Y=D.inline;function Z(pe){return pe.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 te(pe){var ye="",_e,xe,Se=pe.length;for(_e=0;_e<Se;_e++)xe=pe.charCodeAt(_e),Math.random()>.5&&(xe="x"+xe.toString(16)),ye+="&#"+xe+";";return ye}var q=function(){function pe(_e){this.tokens=[],this.tokens.links=Object.create(null),this.options=_e||F,this.options.tokenizer=this.options.tokenizer||new Ce,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var xe={block:W.normal,inline:Y.normal};this.options.pedantic?(xe.block=W.pedantic,xe.inline=Y.pedantic):this.options.gfm&&(xe.block=W.gfm,this.options.breaks?xe.inline=Y.breaks:xe.inline=Y.gfm),this.tokenizer.rules=xe}pe.lex=function(xe,Se){var Ae=new pe(Se);return Ae.lex(xe)};var ye=pe.prototype;return ye.lex=function(xe){return xe=xe.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(xe,this.tokens,!0),this.inline(this.tokens),this.tokens},ye.blockTokens=function(xe,Se,Ae){Se===void 0&&(Se=[]),Ae===void 0&&(Ae=!0),xe=xe.replace(/^ +$/gm,"");for(var Oe,Le,Me,Ke;xe;){if(Oe=this.tokenizer.space(xe)){xe=xe.substring(Oe.raw.length),Oe.type&&Se.push(Oe);continue}if(Oe=this.tokenizer.code(xe,Se)){xe=xe.substring(Oe.raw.length),Oe.type?Se.push(Oe):(Ke=Se[Se.length-1],Ke.raw+=`
`+Oe.raw,Ke.text+=`
`+Oe.text);continue}if(Oe=this.tokenizer.fences(xe)){xe=xe.substring(Oe.raw.length),Se.push(Oe);continue}if(Oe=this.tokenizer.heading(xe)){xe=xe.substring(Oe.raw.length),Se.push(Oe);continue}if(Oe=this.tokenizer.nptable(xe)){xe=xe.substring(Oe.raw.length),Se.push(Oe);continue}if(Oe=this.tokenizer.hr(xe)){xe=xe.substring(Oe.raw.length),Se.push(Oe);continue}if(Oe=this.tokenizer.blockquote(xe)){xe=xe.substring(Oe.raw.length),Oe.tokens=this.blockTokens(Oe.text,[],Ae),Se.push(Oe);continue}if(Oe=this.tokenizer.list(xe)){for(xe=xe.substring(Oe.raw.length),Me=Oe.items.length,Le=0;Le<Me;Le++)Oe.items[Le].tokens=this.blockTokens(Oe.items[Le].text,[],!1);Se.push(Oe);continue}if(Oe=this.tokenizer.html(xe)){xe=xe.substring(Oe.raw.length),Se.push(Oe);continue}if(Ae&&(Oe=this.tokenizer.def(xe))){xe=xe.substring(Oe.raw.length),this.tokens.links[Oe.tag]||(this.tokens.links[Oe.tag]={href:Oe.href,title:Oe.title});continue}if(Oe=this.tokenizer.table(xe)){xe=xe.substring(Oe.raw.length),Se.push(Oe);continue}if(Oe=this.tokenizer.lheading(xe)){xe=xe.substring(Oe.raw.length),Se.push(Oe);continue}if(Ae&&(Oe=this.tokenizer.paragraph(xe))){xe=xe.substring(Oe.raw.length),Se.push(Oe);continue}if(Oe=this.tokenizer.text(xe,Se)){xe=xe.substring(Oe.raw.length),Oe.type?Se.push(Oe):(Ke=Se[Se.length-1],Ke.raw+=`
`+Oe.raw,Ke.text+=`
`+Oe.text);continue}if(xe){var Qe="Infinite loop on byte: "+xe.charCodeAt(0);if(this.options.silent){console.error(Qe);break}else throw new Error(Qe)}}return Se},ye.inline=function(xe){var Se,Ae,Oe,Le,Me,Ke,Qe=xe.length;for(Se=0;Se<Qe;Se++){Ke=xe[Se];switch(Ke.type){case"paragraph":case"text":case"heading":{Ke.tokens=[],this.inlineTokens(Ke.text,Ke.tokens);break}case"table":{for(Ke.tokens={header:[],cells:[]},Le=Ke.header.length,Ae=0;Ae<Le;Ae++)Ke.tokens.header[Ae]=[],this.inlineTokens(Ke.header[Ae],Ke.tokens.header[Ae]);for(Le=Ke.cells.length,Ae=0;Ae<Le;Ae++)for(Me=Ke.cells[Ae],Ke.tokens.cells[Ae]=[],Oe=0;Oe<Me.length;Oe++)Ke.tokens.cells[Ae][Oe]=[],this.inlineTokens(Me[Oe],Ke.tokens.cells[Ae][Oe]);break}case"blockquote":{this.inline(Ke.tokens);break}case"list":{for(Le=Ke.items.length,Ae=0;Ae<Le;Ae++)this.inline(Ke.items[Ae].tokens);break}}}return xe},ye.inlineTokens=function(xe,Se,Ae,Oe,Le){Se===void 0&&(Se=[]),Ae===void 0&&(Ae=!1),Oe===void 0&&(Oe=!1),Le===void 0&&(Le="");var Me,Ke=xe,Qe;if(this.tokens.links){var Ye=Object.keys(this.tokens.links);if(Ye.length>0)for(;(Qe=this.tokenizer.rules.inline.reflinkSearch.exec(Ke))!=null;)Ye.includes(Qe[0].slice(Qe[0].lastIndexOf("[")+1,-1))&&(Ke=Ke.slice(0,Qe.index)+"["+"a".repeat(Qe[0].length-2)+"]"+Ke.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Qe=this.tokenizer.rules.inline.blockSkip.exec(Ke))!=null;)Ke=Ke.slice(0,Qe.index)+"["+"a".repeat(Qe[0].length-2)+"]"+Ke.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;xe;){if(Me=this.tokenizer.escape(xe)){xe=xe.substring(Me.raw.length),Se.push(Me);continue}if(Me=this.tokenizer.tag(xe,Ae,Oe)){xe=xe.substring(Me.raw.length),Ae=Me.inLink,Oe=Me.inRawBlock,Se.push(Me);continue}if(Me=this.tokenizer.link(xe)){xe=xe.substring(Me.raw.length),Me.type==="link"&&(Me.tokens=this.inlineTokens(Me.text,[],!0,Oe)),Se.push(Me);continue}if(Me=this.tokenizer.reflink(xe,this.tokens.links)){xe=xe.substring(Me.raw.length),Me.type==="link"&&(Me.tokens=this.inlineTokens(Me.text,[],!0,Oe)),Se.push(Me);continue}if(Me=this.tokenizer.strong(xe,Ke,Le)){xe=xe.substring(Me.raw.length),Me.tokens=this.inlineTokens(Me.text,[],Ae,Oe),Se.push(Me);continue}if(Me=this.tokenizer.em(xe,Ke,Le)){xe=xe.substring(Me.raw.length),Me.tokens=this.inlineTokens(Me.text,[],Ae,Oe),Se.push(Me);continue}if(Me=this.tokenizer.codespan(xe)){xe=xe.substring(Me.raw.length),Se.push(Me);continue}if(Me=this.tokenizer.br(xe)){xe=xe.substring(Me.raw.length),Se.push(Me);continue}if(Me=this.tokenizer.del(xe)){xe=xe.substring(Me.raw.length),Me.tokens=this.inlineTokens(Me.text,[],Ae,Oe),Se.push(Me);continue}if(Me=this.tokenizer.autolink(xe,te)){xe=xe.substring(Me.raw.length),Se.push(Me);continue}if(!Ae&&(Me=this.tokenizer.url(xe,te))){xe=xe.substring(Me.raw.length),Se.push(Me);continue}if(Me=this.tokenizer.inlineText(xe,Oe,Z)){xe=xe.substring(Me.raw.length),Le=Me.raw.slice(-1),Se.push(Me);continue}if(xe){var nt="Infinite loop on byte: "+xe.charCodeAt(0);if(this.options.silent){console.error(nt);break}else throw new Error(nt)}}return Se},h(pe,null,[{key:"rules",get:function(){return{block:W,inline:Y}}}]),pe}(),X=C.defaults,re=V.cleanUrl,me=V.escape,ve=function(){function pe(_e){this.options=_e||X}var ye=pe.prototype;return ye.code=function(xe,Se,Ae){var Oe=(Se||"").match(/\S*/)[0];if(this.options.highlight){var Le=this.options.highlight(xe,Oe);Le!=null&&Le!==xe&&(Ae=!0,xe=Le)}return Oe?'<pre><code class="'+this.options.langPrefix+me(Oe,!0)+'">'+(Ae?xe:me(xe,!0))+`</code></pre>
`:"<pre><code>"+(Ae?xe:me(xe,!0))+`</code></pre>
`},ye.blockquote=function(xe){return`<blockquote>
`+xe+`</blockquote>
`},ye.html=function(xe){return xe},ye.heading=function(xe,Se,Ae,Oe){return this.options.headerIds?"<h"+Se+' id="'+this.options.headerPrefix+Oe.slug(Ae)+'">'+xe+"</h"+Se+`>
`:"<h"+Se+">"+xe+"</h"+Se+`>
`},ye.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},ye.list=function(xe,Se,Ae){var Oe=Se?"ol":"ul",Le=Se&&Ae!==1?' start="'+Ae+'"':"";return"<"+Oe+Le+`>
`+xe+"</"+Oe+`>
`},ye.listitem=function(xe){return"<li>"+xe+`</li>
`},ye.checkbox=function(xe){return"<input "+(xe?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},ye.paragraph=function(xe){return"<p>"+xe+`</p>
`},ye.table=function(xe,Se){return Se&&(Se="<tbody>"+Se+"</tbody>"),`<table>
<thead>
`+xe+`</thead>
`+Se+`</table>
`},ye.tablerow=function(xe){return`<tr>
`+xe+`</tr>
`},ye.tablecell=function(xe,Se){var Ae=Se.header?"th":"td",Oe=Se.align?"<"+Ae+' align="'+Se.align+'">':"<"+Ae+">";return Oe+xe+"</"+Ae+`>
`},ye.strong=function(xe){return"<strong>"+xe+"</strong>"},ye.em=function(xe){return"<em>"+xe+"</em>"},ye.codespan=function(xe){return"<code>"+xe+"</code>"},ye.br=function(){return this.options.xhtml?"<br/>":"<br>"},ye.del=function(xe){return"<del>"+xe+"</del>"},ye.link=function(xe,Se,Ae){if(xe=re(this.options.sanitize,this.options.baseUrl,xe),xe===null)return Ae;var Oe='<a href="'+me(xe)+'"';return Se&&(Oe+=' title="'+Se+'"'),Oe+=">"+Ae+"</a>",Oe},ye.image=function(xe,Se,Ae){if(xe=re(this.options.sanitize,this.options.baseUrl,xe),xe===null)return Ae;var Oe='<img src="'+xe+'" alt="'+Ae+'"';return Se&&(Oe+=' title="'+Se+'"'),Oe+=this.options.xhtml?"/>":">",Oe},ye.text=function(xe){return xe},pe}(),Te=function(){function pe(){}var ye=pe.prototype;return ye.strong=function(xe){return xe},ye.em=function(xe){return xe},ye.codespan=function(xe){return xe},ye.del=function(xe){return xe},ye.html=function(xe){return xe},ye.text=function(xe){return xe},ye.link=function(xe,Se,Ae){return""+Ae},ye.image=function(xe,Se,Ae){return""+Ae},ye.br=function(){return""},pe}(),Re=function(){function pe(){this.seen={}}var ye=pe.prototype;return ye.slug=function(xe){var Se=xe.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(Se)){var Ae=Se;do this.seen[Ae]++,Se=Ae+"-"+this.seen[Ae];while(this.seen.hasOwnProperty(Se))}return this.seen[Se]=0,Se},pe}(),Ie=C.defaults,je=V.unescape,Ne=function(){function pe(_e){this.options=_e||Ie,this.options.renderer=this.options.renderer||new ve,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Te,this.slugger=new Re}pe.parse=function(xe,Se){var Ae=new pe(Se);return Ae.parse(xe)};var ye=pe.prototype;return ye.parse=function(xe,Se){Se===void 0&&(Se=!0);var Ae="",Oe,Le,Me,Ke,Qe,Ye,nt,pt,st,tt,Pt,wt,Vt,Bt,gt,xt,rr,Gt,Ge=xe.length;for(Oe=0;Oe<Ge;Oe++){tt=xe[Oe];switch(tt.type){case"space":continue;case"hr":{Ae+=this.renderer.hr();continue}case"heading":{Ae+=this.renderer.heading(this.parseInline(tt.tokens),tt.depth,je(this.parseInline(tt.tokens,this.textRenderer)),this.slugger);continue}case"code":{Ae+=this.renderer.code(tt.text,tt.lang,tt.escaped);continue}case"table":{for(pt="",nt="",Ke=tt.header.length,Le=0;Le<Ke;Le++)nt+=this.renderer.tablecell(this.parseInline(tt.tokens.header[Le]),{header:!0,align:tt.align[Le]});for(pt+=this.renderer.tablerow(nt),st="",Ke=tt.cells.length,Le=0;Le<Ke;Le++){for(Ye=tt.tokens.cells[Le],nt="",Qe=Ye.length,Me=0;Me<Qe;Me++)nt+=this.renderer.tablecell(this.parseInline(Ye[Me]),{header:!1,align:tt.align[Me]});st+=this.renderer.tablerow(nt)}Ae+=this.renderer.table(pt,st);continue}case"blockquote":{st=this.parse(tt.tokens),Ae+=this.renderer.blockquote(st);continue}case"list":{for(Pt=tt.ordered,wt=tt.start,Vt=tt.loose,Ke=tt.items.length,st="",Le=0;Le<Ke;Le++)gt=tt.items[Le],xt=gt.checked,rr=gt.task,Bt="",gt.task&&(Gt=this.renderer.checkbox(xt),Vt?gt.tokens.length>0&&gt.tokens[0].type==="text"?(gt.tokens[0].text=Gt+" "+gt.tokens[0].text,gt.tokens[0].tokens&&gt.tokens[0].tokens.length>0&&gt.tokens[0].tokens[0].type==="text"&&(gt.tokens[0].tokens[0].text=Gt+" "+gt.tokens[0].tokens[0].text)):gt.tokens.unshift({type:"text",text:Gt}):Bt+=Gt),Bt+=this.parse(gt.tokens,Vt),st+=this.renderer.listitem(Bt,rr,xt);Ae+=this.renderer.list(st,Pt,wt);continue}case"html":{Ae+=this.renderer.html(tt.text);continue}case"paragraph":{Ae+=this.renderer.paragraph(this.parseInline(tt.tokens));continue}case"text":{for(st=tt.tokens?this.parseInline(tt.tokens):tt.text;Oe+1<Ge&&xe[Oe+1].type==="text";)tt=xe[++Oe],st+=`
`+(tt.tokens?this.parseInline(tt.tokens):tt.text);Ae+=Se?this.renderer.paragraph(st):st;continue}default:{var lt='Token with "'+tt.type+'" type was not found.';if(this.options.silent){console.error(lt);return}else throw new Error(lt)}}}return Ae},ye.parseInline=function(xe,Se){Se=Se||this.renderer;var Ae="",Oe,Le,Me=xe.length;for(Oe=0;Oe<Me;Oe++){Le=xe[Oe];switch(Le.type){case"escape":{Ae+=Se.text(Le.text);break}case"html":{Ae+=Se.html(Le.text);break}case"link":{Ae+=Se.link(Le.href,Le.title,this.parseInline(Le.tokens,Se));break}case"image":{Ae+=Se.image(Le.href,Le.title,Le.text);break}case"strong":{Ae+=Se.strong(this.parseInline(Le.tokens,Se));break}case"em":{Ae+=Se.em(this.parseInline(Le.tokens,Se));break}case"codespan":{Ae+=Se.codespan(Le.text);break}case"br":{Ae+=Se.br();break}case"del":{Ae+=Se.del(this.parseInline(Le.tokens,Se));break}case"text":{Ae+=Se.text(Le.text);break}default:{var Ke='Token with "'+Le.type+'" type was not found.';if(this.options.silent){console.error(Ke);return}else throw new Error(Ke)}}}return Ae},pe}(),We=V.merge,Be=V.checkSanitizeDeprecation,He=V.escape,De=C.getDefaults,Xe=C.changeDefaults,$e=C.defaults;function we(pe,ye,_e){if(typeof pe=="undefined"||pe===null)throw new Error("marked(): input parameter is undefined or null");if(typeof pe!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(pe)+", string expected");if(typeof ye=="function"&&(_e=ye,ye=null),ye=We({},we.defaults,ye||{}),Be(ye),_e){var xe=ye.highlight,Se;try{Se=q.lex(pe,ye)}catch(Me){return _e(Me)}var Ae=function(Ke){var Qe;if(!Ke)try{Qe=Ne.parse(Se,ye)}catch(Ye){Ke=Ye}return ye.highlight=xe,Ke?_e(Ke):_e(null,Qe)};if(!xe||xe.length<3)return Ae();if(delete ye.highlight,!Se.length)return Ae();var Oe=0;we.walkTokens(Se,function(Me){Me.type==="code"&&(Oe++,setTimeout(function(){xe(Me.text,Me.lang,function(Ke,Qe){if(Ke)return Ae(Ke);Qe!=null&&Qe!==Me.text&&(Me.text=Qe,Me.escaped=!0),Oe--,Oe===0&&Ae()})},0))}),Oe===0&&Ae();return}try{var Le=q.lex(pe,ye);return ye.walkTokens&&we.walkTokens(Le,ye.walkTokens),Ne.parse(Le,ye)}catch(Me){if(Me.message+=`
Please report this to https://github.com/markedjs/marked.`,ye.silent)return"<p>An error occurred:</p><pre>"+He(Me.message+"",!0)+"</pre>";throw Me}}we.options=we.setOptions=function(pe){return We(we.defaults,pe),Xe(we.defaults),we},we.getDefaults=De,we.defaults=$e,we.use=function(pe){var ye=We({},pe);if(pe.renderer&&function(){var xe=we.defaults.renderer||new ve,Se=function(Le){var Me=xe[Le];xe[Le]=function(){for(var Ke=arguments.length,Qe=new Array(Ke),Ye=0;Ye<Ke;Ye++)Qe[Ye]=arguments[Ye];var nt=pe.renderer[Le].apply(xe,Qe);return nt===!1&&(nt=Me.apply(xe,Qe)),nt}};for(var Ae in pe.renderer)Se(Ae);ye.renderer=xe}(),pe.tokenizer&&function(){var xe=we.defaults.tokenizer||new Ce,Se=function(Le){var Me=xe[Le];xe[Le]=function(){for(var Ke=arguments.length,Qe=new Array(Ke),Ye=0;Ye<Ke;Ye++)Qe[Ye]=arguments[Ye];var nt=pe.tokenizer[Le].apply(xe,Qe);return nt===!1&&(nt=Me.apply(xe,Qe)),nt}};for(var Ae in pe.tokenizer)Se(Ae);ye.tokenizer=xe}(),pe.walkTokens){var _e=we.defaults.walkTokens;ye.walkTokens=function(xe){pe.walkTokens(xe),_e&&_e(xe)}}we.setOptions(ye)},we.walkTokens=function(pe,ye){for(var _e=T(pe),xe;!(xe=_e()).done;){var Se=xe.value;ye(Se);switch(Se.type){case"table":{for(var Ae=T(Se.tokens.header),Oe;!(Oe=Ae()).done;){var Le=Oe.value;we.walkTokens(Le,ye)}for(var Me=T(Se.tokens.cells),Ke;!(Ke=Me()).done;)for(var Qe=Ke.value,Ye=T(Qe),nt;!(nt=Ye()).done;){var pt=nt.value;we.walkTokens(pt,ye)}break}case"list":{we.walkTokens(Se.items,ye);break}default:Se.tokens&&we.walkTokens(Se.tokens,ye)}}},we.Parser=Ne,we.parser=Ne.parse,we.Renderer=ve,we.TextRenderer=Te,we.Lexer=q,we.lexer=q.lex,we.Tokenizer=Ce,we.Slugger=Re,we.parse=we;var fe=we;return fe})},"DlR+":function(M,ne,N){var I=N("MFOe"),h=I.Global,S=I.trim;M.exports={name:"cookieStorage",read:T,write:C,each:c,remove:g,clearAll:s};var L=h.document;function T(r){if(!r||!a(r))return null;var f="(?:^|.*;\\s*)"+escape(r).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*((?:[^;](?!;))*[^;]?).*";return unescape(L.cookie.replace(new RegExp(f),"$1"))}function c(r){for(var f=L.cookie.split(/; ?/g),p=f.length-1;p>=0;p--){if(!S(f[p]))continue;var m=f[p].split("="),E=unescape(m[0]),y=unescape(m[1]);r(y,E)}}function C(r,f){if(!r)return;L.cookie=escape(r)+"="+escape(f)+"; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/"}function g(r){if(!r||!a(r))return;L.cookie=escape(r)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/"}function s(){c(function(r,f){g(f)})}function a(r){return new RegExp("(?:^|;\\s*)"+escape(r).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(L.cookie)}},E4JC:function(M,ne,N){(function(I,h,S){M.exports=ne=h(N("Ib8C"),N("ETIr"),N("cv67"),N("K3mO"),N("OLod"))})(this,function(I){return function(){var h=I,S=h.lib,L=S.StreamCipher,T=h.algo,c=[],C=[],g=[],s=T.Rabbit=L.extend({_doReset:function(){for(var r=this._key.words,f=this.cfg.iv,p=0;p<4;p++)r[p]=(r[p]<<8|r[p]>>>24)&16711935|(r[p]<<24|r[p]>>>8)&4278255360;var m=this._X=[r[0],r[3]<<16|r[2]>>>16,r[1],r[0]<<16|r[3]>>>16,r[2],r[1]<<16|r[0]>>>16,r[3],r[2]<<16|r[1]>>>16],E=this._C=[r[2]<<16|r[2]>>>16,r[0]&4294901760|r[1]&65535,r[3]<<16|r[3]>>>16,r[1]&4294901760|r[2]&65535,r[0]<<16|r[0]>>>16,r[2]&4294901760|r[3]&65535,r[1]<<16|r[1]>>>16,r[3]&4294901760|r[0]&65535];this._b=0;for(var p=0;p<4;p++)a.call(this);for(var p=0;p<8;p++)E[p]^=m[p+4&7];if(f){var y=f.words,u=y[0],n=y[1],o=(u<<8|u>>>24)&16711935|(u<<24|u>>>8)&4278255360,l=(n<<8|n>>>24)&16711935|(n<<24|n>>>8)&4278255360,w=o>>>16|l&4294901760,v=l<<16|o&65535;E[0]^=o,E[1]^=w,E[2]^=l,E[3]^=v,E[4]^=o,E[5]^=w,E[6]^=l,E[7]^=v;for(var p=0;p<4;p++)a.call(this)}},_doProcessBlock:function(r,f){var p=this._X;a.call(this),c[0]=p[0]^p[5]>>>16^p[3]<<16,c[1]=p[2]^p[7]>>>16^p[5]<<16,c[2]=p[4]^p[1]>>>16^p[7]<<16,c[3]=p[6]^p[3]>>>16^p[1]<<16;for(var m=0;m<4;m++)c[m]=(c[m]<<8|c[m]>>>24)&16711935|(c[m]<<24|c[m]>>>8)&4278255360,r[f+m]^=c[m]},blockSize:128/32,ivSize:64/32});function a(){for(var r=this._X,f=this._C,p=0;p<8;p++)C[p]=f[p];f[0]=f[0]+1295307597+this._b|0,f[1]=f[1]+3545052371+(f[0]>>>0<C[0]>>>0?1:0)|0,f[2]=f[2]+886263092+(f[1]>>>0<C[1]>>>0?1:0)|0,f[3]=f[3]+1295307597+(f[2]>>>0<C[2]>>>0?1:0)|0,f[4]=f[4]+3545052371+(f[3]>>>0<C[3]>>>0?1:0)|0,f[5]=f[5]+886263092+(f[4]>>>0<C[4]>>>0?1:0)|0,f[6]=f[6]+1295307597+(f[5]>>>0<C[5]>>>0?1:0)|0,f[7]=f[7]+3545052371+(f[6]>>>0<C[6]>>>0?1:0)|0,this._b=f[7]>>>0<C[7]>>>0?1:0;for(var p=0;p<8;p++){var m=r[p]+f[p],E=m&65535,y=m>>>16,u=((E*E>>>17)+E*y>>>15)+y*y,n=((m&4294901760)*m|0)+((m&65535)*m|0);g[p]=u^n}r[0]=g[0]+(g[7]<<16|g[7]>>>16)+(g[6]<<16|g[6]>>>16)|0,r[1]=g[1]+(g[0]<<8|g[0]>>>24)+g[7]|0,r[2]=g[2]+(g[1]<<16|g[1]>>>16)+(g[0]<<16|g[0]>>>16)|0,r[3]=g[3]+(g[2]<<8|g[2]>>>24)+g[1]|0,r[4]=g[4]+(g[3]<<16|g[3]>>>16)+(g[2]<<16|g[2]>>>16)|0,r[5]=g[5]+(g[4]<<8|g[4]>>>24)+g[3]|0,r[6]=g[6]+(g[5]<<16|g[5]>>>16)+(g[4]<<16|g[4]>>>16)|0,r[7]=g[7]+(g[6]<<8|g[6]>>>24)+g[5]|0}h.Rabbit=L._createHelper(s)}(),I.Rabbit})},EHPI:function(M,ne,N){"use strict";var I=N("bbsP"),h=N("/wGt"),S=N("tJVT"),L=N("k1fw"),T=N("q1tI"),c=N.n(T),C=N("ZW9T"),g=N("ZD9Y"),s=N("M8RZ"),a=N("bCnd"),r=N("fcyK"),f=N.n(r),p={theme:Object(a.a)("cmCodeMode","vs-dark"),fontSize:Object(a.a)("cmFontSize",14),showEditorSetting:!1,tabToSpace:Object(a.a)("cmTabToSpace",!0)},m;(function(u){u[u.set_font_size=0]="set_font_size",u[u.set_theme=1]="set_theme",u[u.on_tab_to_space=2]="on_tab_to_space",u[u.set_show_editor_setting=3]="set_show_editor_setting"})(m||(m={}));function E(u,n){switch(n.type){case m.set_show_editor_setting:return Object(L.a)(Object(L.a)({},u),{},{showEditorSetting:n.payload});case m.set_theme:return Object(L.a)(Object(L.a)({},u),{},{theme:n.payload});case m.set_font_size:return Object(L.a)(Object(L.a)({},u),{},{fontSize:n.payload});case m.on_tab_to_space:return Object(L.a)(Object(L.a)({},u),{},{tabToSpace:n.payload});default:throw new Error}}ne.a=function(u){var n=u.isLoading,o=u.value,l=u.onChange,w=u.language,v=u.ActionBarRender,i=v===void 0?function(V){return c.a.createElement(y,{onShowCodeSetting:V})}:v,R=Object(T.useReducer)(E,p),k=Object(S.a)(R,2),d=k[0],b=k[1],x=d.theme,_=d.fontSize,B=d.showEditorSetting,U=d.tabToSpace,P={onFontSizeChange:function(K){b({type:m.set_font_size,payload:K}),Object(a.b)("cmFontSize",K)},tabToSpace:U,cmFontSize:_,className:"oj",cmCodeMode:x,onTabToSpace:function(K){b({type:m.on_tab_to_space,payload:K}),Object(a.b)("cmTabToSpace",K)},onCodeModeChange:function(K){b({type:m.set_theme,payload:K}),Object(a.b)("cmCodeMode",K)}};function J(){b({type:m.set_show_editor_setting,payload:!1})}function $(){b({type:m.set_show_editor_setting,payload:!0})}var z={value:o,language:w,onChange:l,theme:x,height:"calc(100% - 56px)",options:{fontSize:_,insertSpaces:U}};return c.a.createElement(T.Fragment,null,c.a.createElement("div",{className:"code-panel-container"},i($),!n&&c.a.createElement(C.b,z)),c.a.createElement(s.a,null,c.a.createElement(h.a,{className:"oj",title:null,placement:"right",closable:!1,visible:B,onClose:J},c.a.createElement(g.a,P))))};function y(u){var n=u.onShowCodeSetting;return c.a.createElement("div",{className:"action-bar"},c.a.createElement("span",null,"\u5B66\u5458\u521D\u59CB\u4EE3\u7801\u6587\u4EF6"),c.a.createElement("a",{onClick:n},c.a.createElement("i",{className:"iconfont icon-shezhi"})))}},ELLl:function(M,ne,N){(function(I){I(N("VrN/"))})(function(I){var h={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},S=I.Pos;I.defineOption("autoCloseBrackets",!1,function(E,y,u){u&&u!=I.Init&&(E.removeKeyMap(T),E.state.closeBrackets=null),y&&(c(L(y,"pairs")),E.state.closeBrackets=y,E.addKeyMap(T))});function L(E,y){return y=="pairs"&&typeof E=="string"?E:typeof E=="object"&&E[y]!=null?E[y]:h[y]}var T={Backspace:s,Enter:a};function c(E){for(var y=0;y<E.length;y++){var u=E.charAt(y),n="'"+u+"'";T[n]||(T[n]=C(u))}}c(h.pairs+"`");function C(E){return function(y){return f(y,E)}}function g(E){var y=E.state.closeBrackets;if(!y||y.override)return y;var u=E.getModeAt(E.getCursor());return u.closeBrackets||y}function s(E){var y=g(E);if(!y||E.getOption("disableInput"))return I.Pass;for(var u=L(y,"pairs"),n=E.listSelections(),o=0;o<n.length;o++){if(!n[o].empty())return I.Pass;var l=p(E,n[o].head);if(!l||u.indexOf(l)%2!=0)return I.Pass}for(var o=n.length-1;o>=0;o--){var w=n[o].head;E.replaceRange("",S(w.line,w.ch-1),S(w.line,w.ch+1),"+delete")}}function a(E){var y=g(E),u=y&&L(y,"explode");if(!u||E.getOption("disableInput"))return I.Pass;for(var n=E.listSelections(),o=0;o<n.length;o++){if(!n[o].empty())return I.Pass;var l=p(E,n[o].head);if(!l||u.indexOf(l)%2!=0)return I.Pass}E.operation(function(){var w=E.lineSeparator()||`
`;E.replaceSelection(w+w,null),E.execCommand("goCharLeft"),n=E.listSelections();for(var v=0;v<n.length;v++){var i=n[v].head.line;E.indentLine(i,null,!0),E.indentLine(i+1,null,!0)}})}function r(E){var y=I.cmpPos(E.anchor,E.head)>0;return{anchor:new S(E.anchor.line,E.anchor.ch+(y?-1:1)),head:new S(E.head.line,E.head.ch+(y?1:-1))}}function f(E,y){var u=g(E);if(!u||E.getOption("disableInput"))return I.Pass;var n=L(u,"pairs"),o=n.indexOf(y);if(o==-1)return I.Pass;for(var l=L(u,"closeBefore"),w=L(u,"triples"),v=n.charAt(o+1)==y,i=E.listSelections(),R=o%2==0,k,d=0;d<i.length;d++){var b=i[d],x=b.head,_,B=E.getRange(x,S(x.line,x.ch+1));if(R&&!b.empty())_="surround";else if((v||!R)&&B==y)v&&m(E,x)?_="both":w.indexOf(y)>=0&&E.getRange(x,S(x.line,x.ch+3))==y+y+y?_="skipThree":_="skip";else if(v&&x.ch>1&&w.indexOf(y)>=0&&E.getRange(S(x.line,x.ch-2),x)==y+y){if(x.ch>2&&/\bstring/.test(E.getTokenTypeAt(S(x.line,x.ch-2))))return I.Pass;_="addFour"}else if(v){var U=x.ch==0?" ":E.getRange(S(x.line,x.ch-1),x);if(!I.isWordChar(B)&&U!=y&&!I.isWordChar(U))_="both";else return I.Pass}else if(R&&(B.length===0||/\s/.test(B)||l.indexOf(B)>-1))_="both";else return I.Pass;if(!k)k=_;else if(k!=_)return I.Pass}var P=o%2?n.charAt(o-1):y,J=o%2?y:n.charAt(o+1);E.operation(function(){if(k=="skip")E.execCommand("goCharRight");else if(k=="skipThree")for(var $=0;$<3;$++)E.execCommand("goCharRight");else if(k=="surround"){for(var z=E.getSelections(),$=0;$<z.length;$++)z[$]=P+z[$]+J;E.replaceSelections(z,"around"),z=E.listSelections().slice();for(var $=0;$<z.length;$++)z[$]=r(z[$]);E.setSelections(z)}else k=="both"?(E.replaceSelection(P+J,null),E.triggerElectric(P+J),E.execCommand("goCharLeft")):k=="addFour"&&(E.replaceSelection(P+P+P+P,"before"),E.execCommand("goCharRight"))})}function p(E,y){var u=E.getRange(S(y.line,y.ch-1),S(y.line,y.ch+1));return u.length==2?u:null}function m(E,y){var u=E.getTokenAt(S(y.line,y.ch+1));return/\bstring/.test(u.type)&&u.start==y.ch&&(y.ch==0||!/\bstring/.test(E.getTokenTypeAt(y)))}})},ELcG:function(M,ne,N){(function(I,h){M.exports=ne=h(N("Ib8C"))})(this,function(I){/** @preserve
(c) 2012 by Cédric Mesnil. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/return function(h){var S=I,L=S.lib,T=L.WordArray,c=L.Hasher,C=S.algo,g=T.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),s=T.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),a=T.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),r=T.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),f=T.create([0,1518500249,1859775393,2400959708,2840853838]),p=T.create([1352829926,1548603684,1836072691,2053994217,0]),m=C.RIPEMD160=c.extend({_doReset:function(){this._hash=T.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(w,v){for(var i=0;i<16;i++){var R=v+i,k=w[R];w[R]=(k<<8|k>>>24)&16711935|(k<<24|k>>>8)&4278255360}var d=this._hash.words,b=f.words,x=p.words,_=g.words,B=s.words,U=a.words,P=r.words,J,$,z,V,K,H,G,ie,le,ue;H=J=d[0],G=$=d[1],ie=z=d[2],le=V=d[3],ue=K=d[4];for(var be,i=0;i<80;i+=1)be=J+w[v+_[i]]|0,i<16?be+=E($,z,V)+b[0]:i<32?be+=y($,z,V)+b[1]:i<48?be+=u($,z,V)+b[2]:i<64?be+=n($,z,V)+b[3]:be+=o($,z,V)+b[4],be=be|0,be=l(be,U[i]),be=be+K|0,J=K,K=V,V=l(z,10),z=$,$=be,be=H+w[v+B[i]]|0,i<16?be+=o(G,ie,le)+x[0]:i<32?be+=n(G,ie,le)+x[1]:i<48?be+=u(G,ie,le)+x[2]:i<64?be+=y(G,ie,le)+x[3]:be+=E(G,ie,le)+x[4],be=be|0,be=l(be,P[i]),be=be+ue|0,H=ue,ue=le,le=l(ie,10),ie=G,G=be;be=d[1]+z+le|0,d[1]=d[2]+V+ue|0,d[2]=d[3]+K+H|0,d[3]=d[4]+J+G|0,d[4]=d[0]+$+ie|0,d[0]=be},_doFinalize:function(){var w=this._data,v=w.words,i=this._nDataBytes*8,R=w.sigBytes*8;v[R>>>5]|=128<<24-R%32,v[(R+64>>>9<<4)+14]=(i<<8|i>>>24)&16711935|(i<<24|i>>>8)&4278255360,w.sigBytes=(v.length+1)*4,this._process();for(var k=this._hash,d=k.words,b=0;b<5;b++){var x=d[b];d[b]=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360}return k},clone:function(){var w=c.clone.call(this);return w._hash=this._hash.clone(),w}});function E(w,v,i){return w^v^i}function y(w,v,i){return w&v|~w&i}function u(w,v,i){return(w|~v)^i}function n(w,v,i){return w&i|v&~i}function o(w,v,i){return w^(v|~i)}function l(w,v){return w<<v|w>>>32-v}S.RIPEMD160=c._createHelper(m),S.HmacRIPEMD160=c._createHmacHelper(m)}(Math),I.RIPEMD160})},ETIr:function(M,ne,N){(function(I,h){M.exports=ne=h(N("Ib8C"))})(this,function(I){return function(){var h=I,S=h.lib,L=S.WordArray,T=h.enc,c=T.Base64={stringify:function(g){var s=g.words,a=g.sigBytes,r=this._map;g.clamp();for(var f=[],p=0;p<a;p+=3)for(var m=s[p>>>2]>>>24-p%4*8&255,E=s[p+1>>>2]>>>24-(p+1)%4*8&255,y=s[p+2>>>2]>>>24-(p+2)%4*8&255,u=m<<16|E<<8|y,n=0;n<4&&p+n*.75<a;n++)f.push(r.charAt(u>>>6*(3-n)&63));var o=r.charAt(64);if(o)for(;f.length%4;)f.push(o);return f.join("")},parse:function(g){var s=g.length,a=this._map,r=this._reverseMap;if(!r){r=this._reverseMap=[];for(var f=0;f<a.length;f++)r[a.charCodeAt(f)]=f}var p=a.charAt(64);if(p){var m=g.indexOf(p);m!==-1&&(s=m)}return C(g,s,r)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function C(g,s,a){for(var r=[],f=0,p=0;p<s;p++)if(p%4){var m=a[g.charCodeAt(p-1)]<<p%4*2,E=a[g.charCodeAt(p)]>>>6-p%4*2,y=m|E;r[f>>>2]|=y<<24-f%4*8,f++}return L.create(r,f)}}(),I.enc.Base64})},"F+F2":function(M,ne,N){(function(I,h){M.exports=ne=h(N("Ib8C"))})(this,function(I){return function(){if(typeof ArrayBuffer!="function")return;var h=I,S=h.lib,L=S.WordArray,T=L.init,c=L.init=function(C){if(C instanceof ArrayBuffer&&(C=new Uint8Array(C)),(C instanceof Int8Array||typeof Uint8ClampedArray!="undefined"&&C instanceof Uint8ClampedArray||C instanceof Int16Array||C instanceof Uint16Array||C instanceof Int32Array||C instanceof Uint32Array||C instanceof Float32Array||C instanceof Float64Array)&&(C=new Uint8Array(C.buffer,C.byteOffset,C.byteLength)),C instanceof Uint8Array){for(var g=C.byteLength,s=[],a=0;a<g;a++)s[a>>>2]|=C[a]<<24-a%4*8;T.call(this,s,g)}else T.apply(this,arguments)};c.prototype=L}(),I.lib.WordArray})},GRuw:function(M,ne,N){(function(I,h,S){M.exports=ne=h(N("Ib8C"),N("lPiR"))})(this,function(I){return function(){var h=I,S=h.lib,L=S.WordArray,T=h.algo,c=T.SHA256,C=T.SHA224=c.extend({_doReset:function(){this._hash=new L.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var g=c._doFinalize.call(this);return g.sigBytes-=4,g}});h.SHA224=c._createHelper(C),h.HmacSHA224=c._createHmacHelper(C)}(),I.SHA224})},GfqC:function(M,ne,N){"use strict";var I=N("q1tI"),h=N.n(I),S=N("TSYQ"),L=N.n(S);function T(V,K){var H="cannot "+V.method+" "+V.action+" "+K.status+"'",G=new Error(H);return G.status=K.status,G.method=V.method,G.url=V.action,G}function c(V){var K=V.responseText||V.response;if(!K)return K;try{return JSON.parse(K)}catch(H){return K}}function C(V){var K=new XMLHttpRequest;V.onProgress&&K.upload&&(K.upload.onprogress=function(le){le.total>0&&(le.percent=le.loaded/le.total*100),V.onProgress(le)});var H=new FormData;V.data&&Object.keys(V.data).forEach(function(ie){var le=V.data[ie];if(Array.isArray(le)){le.forEach(function(ue){H.append(ie+"[]",ue)});return}H.append(ie,V.data[ie])}),V.file instanceof Blob?H.append(V.filename,V.file,V.file.name):H.append(V.filename,V.file),K.onerror=function(le){V.onError(le)},K.onload=function(){return K.status<200||K.status>=300?V.onError(T(V,K),c(K)):V.onSuccess(c(K),K)},K.open(V.method,V.action,!0),V.withCredentials&&"withCredentials"in K&&(K.withCredentials=!0);var G=V.headers||{};return G["X-Requested-With"]!==null&&K.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(G).forEach(function(ie){G[ie]!==null&&K.setRequestHeader(ie,G[ie])}),K.send(H),{abort:function(){K.abort()}}}var g=+new Date,s=0;function a(){return"rc-upload-"+g+"-"+ ++s}function r(V,K){return V.indexOf(K,V.length-K.length)!==-1}var f=function(V,K){if(V&&K){var H=Array.isArray(K)?K:K.split(","),G=V.name||"",ie=V.type||"",le=ie.replace(/\/.*$/,"");return H.some(function(ue){var be=ue.trim();return be.charAt(0)==="."?r(G.toLowerCase(),be.toLowerCase()):/\/\*$/.test(be)?le===be.replace(/\/.*$/,""):ie===be})}return!0};function p(V,K){var H=V.createReader(),G=[];function ie(){H.readEntries(function(le){var ue=Array.prototype.slice.apply(le);G=G.concat(ue);var be=!ue.length;be?K(G):ie()})}ie()}var m=function(K,H,G){var ie=function le(ue,be){be=be||"",ue.isFile?ue.file(function(Ce){G(Ce)&&(ue.fullPath&&!Ce.webkitRelativePath&&(Object.defineProperties(Ce,{webkitRelativePath:{writable:!0}}),Ce.webkitRelativePath=ue.fullPath.replace(/^\//,""),Object.defineProperties(Ce,{webkitRelativePath:{writable:!1}})),H([Ce]))}):ue.isDirectory&&p(ue,function(Ce){Ce.forEach(function(se){le(se,""+be+ue.name+"/")})})};K.forEach(function(le){ie(le.webkitGetAsEntry())})},E=m,y=Object.assign||function(V){for(var K=1;K<arguments.length;K++){var H=arguments[K];for(var G in H)Object.prototype.hasOwnProperty.call(H,G)&&(V[G]=H[G])}return V},u=function(){function V(K,H){var G=[],ie=!0,le=!1,ue=void 0;try{for(var be=K[Symbol.iterator](),Ce;!(ie=(Ce=be.next()).done)&&!(G.push(Ce.value),H&&G.length===H);ie=!0);}catch(se){le=!0,ue=se}finally{try{!ie&&be.return&&be.return()}finally{if(le)throw ue}}return G}return function(K,H){if(Array.isArray(K))return K;if(Symbol.iterator in Object(K))return V(K,H);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),n=function(){function V(K,H){for(var G=0;G<H.length;G++){var ie=H[G];ie.enumerable=ie.enumerable||!1,ie.configurable=!0,"value"in ie&&(ie.writable=!0),Object.defineProperty(K,ie.key,ie)}}return function(K,H,G){return H&&V(K.prototype,H),G&&V(K,G),K}}();function o(V,K,H){return K in V?Object.defineProperty(V,K,{value:H,enumerable:!0,configurable:!0,writable:!0}):V[K]=H,V}function l(V,K){var H={};for(var G in V){if(K.indexOf(G)>=0)continue;if(!Object.prototype.hasOwnProperty.call(V,G))continue;H[G]=V[G]}return H}function w(V,K){if(!(V instanceof K))throw new TypeError("Cannot call a class as a function")}function v(V,K){if(!V)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return K&&(typeof K=="object"||typeof K=="function")?K:V}function i(V,K){if(typeof K!="function"&&K!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof K);V.prototype=Object.create(K&&K.prototype,{constructor:{value:V,enumerable:!1,writable:!0,configurable:!0}}),K&&(Object.setPrototypeOf?Object.setPrototypeOf(V,K):V.__proto__=K)}var R=function(K){return Object.keys(K).reduce(function(H,G){return(G.substr(0,5)==="data-"||G.substr(0,5)==="aria-"||G==="role")&&(H[G]=K[G]),H},{})},k=function(V){i(K,V);function K(){var H,G,ie,le;w(this,K);for(var ue=arguments.length,be=Array(ue),Ce=0;Ce<ue;Ce++)be[Ce]=arguments[Ce];return le=(G=(ie=v(this,(H=K.__proto__||Object.getPrototypeOf(K)).call.apply(H,[this].concat(be))),ie),ie.state={uid:a()},ie.reqs={},ie.onChange=function(se){var ce=se.target.files;ie.uploadFiles(ce),ie.reset()},ie.onClick=function(se){var ce=ie.fileInput;if(!ce)return;var he=ie.props,ae=he.children,Q=he.onClick;ae&&ae.type==="button"&&(ce.parentNode.focus(),ce.parentNode.querySelector("button").blur()),ce.click(),Q&&Q(se)},ie.onKeyDown=function(se){se.key==="Enter"&&ie.onClick()},ie.onFileDrop=function(se){var ce=ie.props.multiple;if(se.preventDefault(),se.type==="dragover")return;if(ie.props.directory)E(Array.prototype.slice.call(se.dataTransfer.items),ie.uploadFiles,function(ae){return f(ae,ie.props.accept)});else{var he=Array.prototype.slice.call(se.dataTransfer.files).filter(function(ae){return f(ae,ie.props.accept)});ce===!1&&(he=he.slice(0,1)),ie.uploadFiles(he)}},ie.uploadFiles=function(se){var ce=Array.prototype.slice.call(se);ce.map(function(he){return he.uid=a(),he}).forEach(function(he){ie.upload(he,ce)})},ie.saveFileInput=function(se){ie.fileInput=se},G),v(ie,le)}return n(K,[{key:"componentDidMount",value:function(){this._isMounted=!0}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.abort()}},{key:"upload",value:function(G,ie){var le=this,ue=this.props;if(!ue.beforeUpload)return setTimeout(function(){return le.post(G)},0);var be=ue.beforeUpload(G,ie);be&&be.then?be.then(function(Ce){var se=Object.prototype.toString.call(Ce);return se==="[object File]"||se==="[object Blob]"?le.post(Ce):le.post(G)}).catch(function(Ce){console.log(Ce)}):be!==!1&&setTimeout(function(){return le.post(G)},0);return}},{key:"post",value:function(G){var ie=this;if(!this._isMounted)return;var le=this.props,ue=le.onStart,be=le.onProgress,Ce=le.transformFile,se=Ce===void 0?function(ce){return ce}:Ce;new Promise(function(ce){var he=le.action;return typeof he=="function"&&(he=he(G)),ce(he)}).then(function(ce){var he=G.uid,ae=le.customRequest||C,Q=Promise.resolve(se(G)).then(function(D){var F=le.data;return typeof F=="function"&&(F=F(D)),Promise.all([D,F])}).catch(function(D){console.error(D)});Q.then(function(D){var F=u(D,2),W=F[0],Y=F[1],Z={action:ce,filename:le.name,data:Y,file:W,headers:le.headers,withCredentials:le.withCredentials,method:le.method||"post",onProgress:be?function(te){be(te,G)}:null,onSuccess:function(q,X){delete ie.reqs[he],le.onSuccess(q,G,X)},onError:function(q,X){delete ie.reqs[he],le.onError(q,X,G)}};ue(G),ie.reqs[he]=ae(Z)})})}},{key:"reset",value:function(){this.setState({uid:a()})}},{key:"abort",value:function(G){var ie=this.reqs;if(G){var le=G;G&&G.uid&&(le=G.uid),ie[le]&&ie[le].abort&&ie[le].abort(),delete ie[le]}else Object.keys(ie).forEach(function(ue){ie[ue]&&ie[ue].abort&&ie[ue].abort(),delete ie[ue]})}},{key:"render",value:function(){var G,ie=this.props,le=ie.component,ue=ie.prefixCls,be=ie.className,Ce=ie.disabled,se=ie.id,ce=ie.style,he=ie.multiple,ae=ie.accept,Q=ie.children,D=ie.directory,F=ie.openFileDialogOnClick,W=ie.onMouseEnter,Y=ie.onMouseLeave,Z=l(ie,["component","prefixCls","className","disabled","id","style","multiple","accept","children","directory","openFileDialogOnClick","onMouseEnter","onMouseLeave"]),te=L()((G={},o(G,ue,!0),o(G,ue+"-disabled",Ce),o(G,be,be),G)),q=Ce?{}:{onClick:F?this.onClick:function(){},onKeyDown:F?this.onKeyDown:function(){},onMouseEnter:W,onMouseLeave:Y,onDrop:this.onFileDrop,onDragOver:this.onFileDrop,tabIndex:"0"};return h.a.createElement(le,y({},q,{className:te,role:"button",style:ce}),h.a.createElement("input",y({},R(Z),{id:se,type:"file",ref:this.saveFileInput,onClick:function(re){return re.stopPropagation()},key:this.state.uid,style:{display:"none"},accept:ae,directory:D?"directory":null,webkitdirectory:D?"webkitdirectory":null,multiple:he,onChange:this.onChange})),Q)}}]),K}(I.Component),d=k,b=Object.assign||function(V){for(var K=1;K<arguments.length;K++){var H=arguments[K];for(var G in H)Object.prototype.hasOwnProperty.call(H,G)&&(V[G]=H[G])}return V},x=function(){function V(K,H){for(var G=0;G<H.length;G++){var ie=H[G];ie.enumerable=ie.enumerable||!1,ie.configurable=!0,"value"in ie&&(ie.writable=!0),Object.defineProperty(K,ie.key,ie)}}return function(K,H,G){return H&&V(K.prototype,H),G&&V(K,G),K}}();function _(V,K){if(!(V instanceof K))throw new TypeError("Cannot call a class as a function")}function B(V,K){if(!V)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return K&&(typeof K=="object"||typeof K=="function")?K:V}function U(V,K){if(typeof K!="function"&&K!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof K);V.prototype=Object.create(K&&K.prototype,{constructor:{value:V,enumerable:!1,writable:!0,configurable:!0}}),K&&(Object.setPrototypeOf?Object.setPrototypeOf(V,K):V.__proto__=K)}function P(){}var J=function(V){U(K,V);function K(){var H,G,ie,le;_(this,K);for(var ue=arguments.length,be=Array(ue),Ce=0;Ce<ue;Ce++)be[Ce]=arguments[Ce];return le=(G=(ie=B(this,(H=K.__proto__||Object.getPrototypeOf(K)).call.apply(H,[this].concat(be))),ie),ie.saveUploader=function(se){ie.uploader=se},G),B(ie,le)}return x(K,[{key:"abort",value:function(G){this.uploader.abort(G)}},{key:"render",value:function(){return h.a.createElement(d,b({},this.props,{ref:this.saveUploader}))}}]),K}(I.Component);J.defaultProps={component:"span",prefixCls:"rc-upload",data:{},headers:{},name:"file",multipart:!1,onStart:P,onError:P,onSuccess:P,multiple:!1,beforeUpload:null,customRequest:null,withCredentials:!1,openFileDialogOnClick:!0};var $=J,z=ne.a=$},Gytx:function(M,ne){M.exports=function(I,h,S,L){var T=S?S.call(L,I,h):void 0;if(T!==void 0)return!!T;if(I===h)return!0;if(typeof I!="object"||!I||typeof h!="object"||!h)return!1;var c=Object.keys(I),C=Object.keys(h);if(c.length!==C.length)return!1;for(var g=Object.prototype.hasOwnProperty.bind(h),s=0;s<c.length;s++){var a=c[s];if(!g(a))return!1;var r=I[a],f=h[a];if(T=S?S.call(L,r,f,a):void 0,T===!1||T===void 0&&r!==f)return!1}return!0}},HmJG:function(M,ne,N){},Ib8C:function(M,ne,N){(function(I){(function(h,S){M.exports=ne=S()})(this,function(){var h=h||function(S,L){var T;if(typeof window!="undefined"&&window.crypto&&(T=window.crypto),typeof self!="undefined"&&self.crypto&&(T=self.crypto),typeof globalThis!="undefined"&&globalThis.crypto&&(T=globalThis.crypto),!T&&typeof window!="undefined"&&window.msCrypto&&(T=window.msCrypto),!T&&typeof I!="undefined"&&I.crypto&&(T=I.crypto),!T&&!0)try{T=N(4)}catch(o){}var c=function(){if(T){if(typeof T.getRandomValues=="function")try{return T.getRandomValues(new Uint32Array(1))[0]}catch(o){}if(typeof T.randomBytes=="function")try{return T.randomBytes(4).readInt32LE()}catch(o){}}throw new Error("Native crypto module could not be used to get secure random number.")},C=Object.create||function(){function o(){}return function(l){var w;return o.prototype=l,w=new o,o.prototype=null,w}}(),g={},s=g.lib={},a=s.Base=function(){return{extend:function(o){var l=C(this);return o&&l.mixIn(o),(!l.hasOwnProperty("init")||this.init===l.init)&&(l.init=function(){l.$super.init.apply(this,arguments)}),l.init.prototype=l,l.$super=this,l},create:function(){var o=this.extend();return o.init.apply(o,arguments),o},init:function(){},mixIn:function(o){for(var l in o)o.hasOwnProperty(l)&&(this[l]=o[l]);o.hasOwnProperty("toString")&&(this.toString=o.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),r=s.WordArray=a.extend({init:function(o,l){o=this.words=o||[],l!=L?this.sigBytes=l:this.sigBytes=o.length*4},toString:function(o){return(o||p).stringify(this)},concat:function(o){var l=this.words,w=o.words,v=this.sigBytes,i=o.sigBytes;if(this.clamp(),v%4)for(var R=0;R<i;R++){var k=w[R>>>2]>>>24-R%4*8&255;l[v+R>>>2]|=k<<24-(v+R)%4*8}else for(var d=0;d<i;d+=4)l[v+d>>>2]=w[d>>>2];return this.sigBytes+=i,this},clamp:function(){var o=this.words,l=this.sigBytes;o[l>>>2]&=4294967295<<32-l%4*8,o.length=S.ceil(l/4)},clone:function(){var o=a.clone.call(this);return o.words=this.words.slice(0),o},random:function(o){for(var l=[],w=0;w<o;w+=4)l.push(c());return new r.init(l,o)}}),f=g.enc={},p=f.Hex={stringify:function(o){for(var l=o.words,w=o.sigBytes,v=[],i=0;i<w;i++){var R=l[i>>>2]>>>24-i%4*8&255;v.push((R>>>4).toString(16)),v.push((R&15).toString(16))}return v.join("")},parse:function(o){for(var l=o.length,w=[],v=0;v<l;v+=2)w[v>>>3]|=parseInt(o.substr(v,2),16)<<24-v%8*4;return new r.init(w,l/2)}},m=f.Latin1={stringify:function(o){for(var l=o.words,w=o.sigBytes,v=[],i=0;i<w;i++){var R=l[i>>>2]>>>24-i%4*8&255;v.push(String.fromCharCode(R))}return v.join("")},parse:function(o){for(var l=o.length,w=[],v=0;v<l;v++)w[v>>>2]|=(o.charCodeAt(v)&255)<<24-v%4*8;return new r.init(w,l)}},E=f.Utf8={stringify:function(o){try{return decodeURIComponent(escape(m.stringify(o)))}catch(l){throw new Error("Malformed UTF-8 data")}},parse:function(o){return m.parse(unescape(encodeURIComponent(o)))}},y=s.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new r.init,this._nDataBytes=0},_append:function(o){typeof o=="string"&&(o=E.parse(o)),this._data.concat(o),this._nDataBytes+=o.sigBytes},_process:function(o){var l,w=this._data,v=w.words,i=w.sigBytes,R=this.blockSize,k=R*4,d=i/k;o?d=S.ceil(d):d=S.max((d|0)-this._minBufferSize,0);var b=d*R,x=S.min(b*4,i);if(b){for(var _=0;_<b;_+=R)this._doProcessBlock(v,_);l=v.splice(0,b),w.sigBytes-=x}return new r.init(l,x)},clone:function(){var o=a.clone.call(this);return o._data=this._data.clone(),o},_minBufferSize:0}),u=s.Hasher=y.extend({cfg:a.extend(),init:function(o){this.cfg=this.cfg.extend(o),this.reset()},reset:function(){y.reset.call(this),this._doReset()},update:function(o){return this._append(o),this._process(),this},finalize:function(o){o&&this._append(o);var l=this._doFinalize();return l},blockSize:512/32,_createHelper:function(o){return function(l,w){return new o.init(w).finalize(l)}},_createHmacHelper:function(o){return function(l,w){return new n.HMAC.init(o,w).finalize(l)}}}),n=g.algo={};return g}(Math);return h})}).call(this,N("IyRk"))},J66h:function(M,ne,N){(function(I){var h,S;(function(L,T){M.exports=T(L)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof I!="undefined"?I:this,function(L){"use strict";L=L||{};var T=L.Base64,c="2.6.4",C="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",g=function(P){for(var J={},$=0,z=P.length;$<z;$++)J[P.charAt($)]=$;return J}(C),s=String.fromCharCode,a=function(P){if(P.length<2){var J=P.charCodeAt(0);return J<128?P:J<2048?s(192|J>>>6)+s(128|J&63):s(224|J>>>12&15)+s(128|J>>>6&63)+s(128|J&63)}else{var J=65536+(P.charCodeAt(0)-55296)*1024+(P.charCodeAt(1)-56320);return s(240|J>>>18&7)+s(128|J>>>12&63)+s(128|J>>>6&63)+s(128|J&63)}},r=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,f=function(P){return P.replace(r,a)},p=function(P){var J=[0,2,1][P.length%3],$=P.charCodeAt(0)<<16|(P.length>1?P.charCodeAt(1):0)<<8|(P.length>2?P.charCodeAt(2):0),z=[C.charAt($>>>18),C.charAt($>>>12&63),J>=2?"=":C.charAt($>>>6&63),J>=1?"=":C.charAt($&63)];return z.join("")},m=L.btoa&&typeof L.btoa=="function"?function(P){return L.btoa(P)}:function(P){if(P.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return P.replace(/[\s\S]{1,3}/g,p)},E=function(P){return m(f(String(P)))},y=function(P){return P.replace(/[+\/]/g,function(J){return J=="+"?"-":"_"}).replace(/=/g,"")},u=function(P,J){return J?y(E(P)):E(P)},n=function(P){return u(P,!0)},o;L.Uint8Array&&(o=function(P,J){for(var $="",z=0,V=P.length;z<V;z+=3){var K=P[z],H=P[z+1],G=P[z+2],ie=K<<16|H<<8|G;$+=C.charAt(ie>>>18)+C.charAt(ie>>>12&63)+(typeof H!="undefined"?C.charAt(ie>>>6&63):"=")+(typeof G!="undefined"?C.charAt(ie&63):"=")}return J?y($):$});var l=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,w=function(P){switch(P.length){case 4:var J=(7&P.charCodeAt(0))<<18|(63&P.charCodeAt(1))<<12|(63&P.charCodeAt(2))<<6|63&P.charCodeAt(3),$=J-65536;return s(($>>>10)+55296)+s(($&1023)+56320);case 3:return s((15&P.charCodeAt(0))<<12|(63&P.charCodeAt(1))<<6|63&P.charCodeAt(2));default:return s((31&P.charCodeAt(0))<<6|63&P.charCodeAt(1))}},v=function(P){return P.replace(l,w)},i=function(P){var J=P.length,$=J%4,z=(J>0?g[P.charAt(0)]<<18:0)|(J>1?g[P.charAt(1)]<<12:0)|(J>2?g[P.charAt(2)]<<6:0)|(J>3?g[P.charAt(3)]:0),V=[s(z>>>16),s(z>>>8&255),s(z&255)];return V.length-=[0,0,2,1][$],V.join("")},R=L.atob&&typeof L.atob=="function"?function(P){return L.atob(P)}:function(P){return P.replace(/\S{1,4}/g,i)},k=function(P){return R(String(P).replace(/[^A-Za-z0-9\+\/]/g,""))},d=function(P){return v(R(P))},b=function(P){return String(P).replace(/[-_]/g,function(J){return J=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},x=function(P){return d(b(P))},_;L.Uint8Array&&(_=function(P){return Uint8Array.from(k(b(P)),function(J){return J.charCodeAt(0)})});var B=function(){var P=L.Base64;return L.Base64=T,P};if(L.Base64={VERSION:c,atob:k,btoa:m,fromBase64:x,toBase64:u,utob:f,encode:u,encodeURI:n,btou:v,decode:x,noConflict:B,fromUint8Array:o,toUint8Array:_},typeof Object.defineProperty=="function"){var U=function(P){return{value:P,enumerable:!1,writable:!0,configurable:!0}};L.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",U(function(){return x(this)})),Object.defineProperty(String.prototype,"toBase64",U(function(P){return u(this,P)})),Object.defineProperty(String.prototype,"toBase64URI",U(function(){return u(this,!0)}))}}return L.Meteor&&(Base64=L.Base64),M.exports?M.exports.Base64=L.Base64:!(h=[],S=function(){return L.Base64}.apply(ne,h),S!==void 0&&(M.exports=S)),{Base64:L.Base64}})}).call(this,N("IyRk"))},K3mO:function(M,ne,N){(function(I,h,S){M.exports=ne=h(N("Ib8C"),N("3y9D"),N("WYAk"))})(this,function(I){return function(){var h=I,S=h.lib,L=S.Base,T=S.WordArray,c=h.algo,C=c.MD5,g=c.EvpKDF=L.extend({cfg:L.extend({keySize:128/32,hasher:C,iterations:1}),init:function(s){this.cfg=this.cfg.extend(s)},compute:function(s,a){for(var r,f=this.cfg,p=f.hasher.create(),m=T.create(),E=m.words,y=f.keySize,u=f.iterations;E.length<y;){r&&p.update(r),r=p.update(s).finalize(a),p.reset();for(var n=1;n<u;n++)r=p.finalize(r),p.reset();m.concat(r)}return m.sigBytes=y*4,m}});h.EvpKDF=function(s,a,r){return g.create(r).compute(s,a)}}(),I.EvpKDF})},KhGG:function(M,ne,N){"use strict";N.d(ne,"a",function(){return i}),N.d(ne,"c",function(){return d});var I=N("0Owb"),h=N("miYZ"),S=N("tsqr"),L=N("oBTY"),T=N("tJVT"),c=N("PpiC"),C=N("k1fw"),g=N("9og8"),s=N("DZo9"),a=N("8z0m"),r=N("WmNS"),f=N.n(r),p=N("q1tI"),m=N.n(p),E=N("ErOA"),y=N("NFKh"),u=N.n(y),n=N("7Cbv"),o=N("9kvl"),l=N("mxV5"),w=N.n(l),v=a.a.Dragger,i=function(_){var B="bf3c199c2470cb477d907b1e0917c17b",U="5183666c72eec9e4",P=u.a.enc.Utf8.parse(B),J=u.a.enc.Utf8.parse(U),$=u.a.AES.decrypt(_,P,{iv:J,mode:u.a.mode.CBC});return $.toString(u.a.enc.Utf8)},R,k=function(){var x=Object(g.a)(f.a.mark(function _(B){var U,P,J,$,z,V,K,H,G,ie,le;return f.a.wrap(function(be){for(;;)switch(be.prev=be.next){case 0:return K=B.identifier,H=B.oldFilename,G=B.newFilename,be.next=3,Object(E.a)("/api/buckets/get_upload_token_for_big_files.json",{method:"get"});case 3:return ie=be.sent,ie.data=JSON.parse(i(ie.data)),le=new w.a({endpoint:ie==null||((U=ie.data)===null||U===void 0)?void 0:U.end_point,region:ie==null||((P=ie.data)===null||P===void 0)?void 0:P.region,accessKeyId:ie==null||((J=ie.data)===null||J===void 0)?void 0:J.access_key_id,accessKeySecret:ie==null||(($=ie.data)===null||$===void 0)?void 0:$.access_key_secret,bucket:ie==null||((z=ie.data)===null||z===void 0)?void 0:z.bucket,stsToken:ie==null||((V=ie.data)===null||V===void 0)?void 0:V.security_token}),be.abrupt("return",new Promise(function(Ce,se){console.log(11111,"".concat(K,"/").concat(H),"".concat(K,"/").concat(G),ie.data),le.copy("/".concat(K,"/").concat(H),"/".concat(K,"/").concat(G)).then(function(ce){console.log("\u62F7\u8D1D\u6210\u529F",ce)}).catch(function(ce){console.log(ce)})}));case 7:case"end":return be.stop()}},_)}));return function(B){return x.apply(this,arguments)}}(),d=function(){var x=Object(g.a)(f.a.mark(function _(B,U,P){var J,$,z,V,K,H,G,ie,le,ue;return f.a.wrap(function(Ce){for(;;)switch(Ce.prev=Ce.next){case 0:return U.file_name=B.name,Ce.next=3,Object(E.a)("/api/buckets/get_upload_token.json",{method:"get"});case 3:return G=Ce.sent,console.log("decrypt(res.data):",i(G.data)),G.data=JSON.parse(i(G.data)),ie=B.name.split("."),ie.pop(),le=U.realFileName?ie:Object(n.a)(),ue=new w.a({endpoint:G==null||((J=G.data)===null||J===void 0)?void 0:J.end_point,region:G==null||(($=G.data)===null||$===void 0)?void 0:$.region,accessKeyId:G==null||((z=G.data)===null||z===void 0)?void 0:z.access_key_id,accessKeySecret:G==null||((V=G.data)===null||V===void 0)?void 0:V.access_key_secret,bucket:G==null||((K=G.data)===null||K===void 0)?void 0:K.bucket,stsToken:G==null||((H=G.data)===null||H===void 0)?void 0:H.security_token}),Ce.abrupt("return",new Promise(function(se,ce){var he;ue.multipartUpload("".concat(le),new Blob([B],{type:B.type}),Object(C.a)(Object(C.a)({timeout:200*1e3,partSize:102400},P),{},{callback:{url:G==null||((he=G.data)===null||he===void 0)?void 0:he.callback_url,host:G==null?void 0:G.data.bucket_host,body:"bucket=${bucket}&object=${object}&etag=${etag}&size=${size}&mimeType=${mimeType}&my_var=${x:my_var}&"+Object(E.e)(U)}})).then(function(ae){var Q;B.response=(Q=ae.data)===null||Q===void 0?void 0:Q.data,se(ae==null?void 0:ae.data)}).catch(function(ae){ce(ae),console.log("err:",ae)})}));case 11:case"end":return Ce.stop()}},_)}));return function(B,U,P){return x.apply(this,arguments)}}(),b=function(_){var B=_.user,U=_.cancelUpload,P=Object(c.a)(_,["user","cancelUpload"]),J=Object(p.useState)([]),$=Object(T.a)(J,2),z=$[0],V=$[1],K=Object(p.useState)(),H=Object(T.a)(K,2),G=H[0],ie=H[1],le={onRemove:function(Ce){V(Object(L.a)(z.filter(function(se){return se.name!==Ce.name}))),P.onChange(z.filter(function(se){return se.name!==Ce.name}))},disabled:P.disabled,multiple:!0,fileList:z==null?void 0:z.map(function(be){return be.file}),customRequest:function(){},beforeUpload:function(){var be=Object(g.a)(f.a.mark(function se(ce){var he;return f.a.wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:if(he=P.maxSize||1024*1024*1024*1,!z.filter(function(D){return D.name===ce.name}).length){Q.next=4;break}return S.b.info("".concat(ce.name,"\u5DF2\u5B58\u5728\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9")),Q.abrupt("return");case 4:if(!((ce==null?void 0:ce.size)>he)){Q.next=7;break}return S.b.info("\u6587\u4EF6\u8D85\u8FC7".concat(he/1024/1024/1024,"GB\uFF0C\u4E0D\u7B26\u5408\u4E0A\u4F20\u8981\u6C42")),Q.abrupt("return",!1);case 7:return z.push({name:ce.name,file:ce}),V(Object(L.a)(z)),P.onChange(z),Q.abrupt("return",!1);case 11:case"end":return Q.stop()}},se)}));function Ce(se){return be.apply(this,arguments)}return Ce}()},ue=function(){var be=Object(g.a)(f.a.mark(function Ce(se,ce){var he,ae,Q,D,F,W,Y,Z,te,q;return f.a.wrap(function(re){for(;;)switch(re.prev=re.next){case 0:return ce.file_name=se.name,Y=se.name,re.next=4,Object(E.a)("/api/buckets/get_upload_token_for_big_files.json",{method:"get"});case 4:if(Z=re.sent,Z.data=JSON.parse(i(Z.data)),!((Z==null?void 0:Z.status)!==0)){re.next=12;break}return z[z.findIndex(function(me){return me.name===Y})].status="error",z[z.findIndex(function(me){return me.name===Y})].file.status="error",P.onChange(z),S.b.warn("\u4E0A\u4F20\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u5C1D\u8BD5"),re.abrupt("return");case 12:return G=new w.a({endpoint:Z==null||((he=Z.data)===null||he===void 0)?void 0:he.end_point,region:Z==null||((ae=Z.data)===null||ae===void 0)?void 0:ae.region,accessKeyId:Z==null||((Q=Z.data)===null||Q===void 0)?void 0:Q.access_key_id,accessKeySecret:Z==null||((D=Z.data)===null||D===void 0)?void 0:D.access_key_secret,bucket:Z==null||((F=Z.data)===null||F===void 0)?void 0:F.bucket,stsToken:Z==null||((W=Z.data)===null||W===void 0)?void 0:W.security_token}),console.log(se,"file"),ie(G),te=se.name.split("."),te.pop(),q=ce.realFileName?te:Object(n.a)(),re.abrupt("return",new Promise(function(me,ve){try{var Te;G.multipartUpload("".concat(P.identifier,"/").concat(q).concat(Y.indexOf(".")>-1?"."+Y.split(".").pop():""),new Blob([se.file],{type:se.file.type}),{timeout:3600*1e3,partSize:1002400,progress:function(Ie,je,Ne){try{console.log("\u8FDB\u5EA6",Ie,je,Ne);var We=z.findIndex(function(Be){return Be.name===Y});z[We].file.percent=Ie*100,z[We].tempCheckpoint=je,V(Object(L.a)(z))}catch(Be){}},checkpoint:z[z.findIndex(function(Re){return Re.name===Y})].tempCheckpoint,callback:{customValue:{id:Y+""},url:Z==null||((Te=Z.data)===null||Te===void 0)?void 0:Te.callback_url,host:Z==null?void 0:Z.data.bucket_host,body:"bucket=${bucket}&object=${object}&etag=${etag}&size=${size}&mimeType=${mimeType}&my_var=${x:my_var}&"+Object(E.e)(ce)}}).then(function(Re){var Ie,je=z.findIndex(function(De){return De.name===Y}),Ne="done";if(((Ie=Re.data)===null||Ie===void 0?void 0:Ie.status)===0){var We;se.response=(We=Re.data)===null||We===void 0?void 0:We.data;var Be=z.findIndex(function(De){return De.name===Y});z[Be].status="done",z[Be].file.status="done"}else{var He;S.b.warn((He=Re.data)===null||He===void 0?void 0:He.message),Ne="error"}z[je].status=Ne,z[je].file.status=Ne,P.onChange(z),me(Re==null?void 0:Re.data)}).catch(function(Re){z[z.findIndex(function(Ie){return Ie.name===Y})].status="error",z[z.findIndex(function(Ie){return Ie.name===Y})].file.status="error",S.b.warn("\u4E0A\u4F20\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u5C1D\u8BD5"),V(Object(L.a)(z)),P.onChange(z),ve(Re),console.log("err:",Re)})}catch(Re){}}));case 19:case"end":return re.stop()}},Ce)}));return function(se,ce){return be.apply(this,arguments)}}();return Object(p.useEffect)(function(){z.every(function(be){return be==="done"||be==="error"})&&P.onComplete(z)},[z]),Object(p.useEffect)(function(){if(U){var be;(be=G)===null||be===void 0||be.cancel()}},[U]),Object(p.useEffect)(function(){P.uploading&&z.map(function(){var be=Object(g.a)(f.a.mark(function Ce(se){var ce,he;return f.a.wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:if(!((!se.status||se.status==="error")&&!U)){Q.next=6;break}return se.status="uploading",se.file.status="uploading",Q.next=5,ue(se,{login:B==null||((ce=B.userInfo)===null||ce===void 0)?void 0:ce.login,container_type:P.container_type,container_id:P.container_id,description:P.description,realFileName:P.realFileName});case 5:he=Q.sent;case 6:case"end":return Q.stop()}},Ce)}));return function(Ce){return be.apply(this,arguments)}}())},[P.uploading]),m.a.createElement(v,Object(I.a)({},le,{height:P.height,className:P.className}),m.a.createElement("p",{className:"ant-upload-hint"},P.text||"\u62D6\u62FD\u6587\u4EF6\u6216\u8005\u70B9\u51FB\u4E0A\u4F20"))};ne.b=Object(o.a)(function(x){var _=x.loading,B=x.globalSetting,U=x.user;return{globalSetting:B,loading:_.models.competitions,user:U}})(b)},KmYQ:function(M,ne,N){(function(I,h,S){M.exports=ne=h(N("Ib8C"),N("OLod"))})(this,function(I){return I.pad.ZeroPadding={pad:function(h,S){var L=S*4;h.clamp(),h.sigBytes+=L-(h.sigBytes%L||L)},unpad:function(h){for(var S=h.words,L=h.sigBytes-1,L=h.sigBytes-1;L>=0;L--)if(S[L>>>2]>>>24-L%4*8&255){h.sigBytes=L+1;break}}},I.pad.ZeroPadding})},LdHM:function(M,ne,N){"use strict";N.d(ne,"b",function(){return l}),N.d(ne,"a",function(){return v});var I=N("1OyB"),h=N("vuIU"),S=N("Ji7U"),L=N("LK+K"),T=N("q1tI"),c=N("rePB"),C=N("Ff2n"),g=N("ODXe"),s=N("4IlW"),a=N("bX4T"),r=N("YrtM"),f=N("TSYQ"),p=N.n(f),m=N("+nKL"),E=N("8OUc"),y=function(G,ie){var le=G.prefixCls,ue=G.id,be=G.flattenOptions,Ce=G.childrenAsData,se=G.values,ce=G.searchValue,he=G.multiple,ae=G.defaultActiveFirstOption,Q=G.height,D=G.itemHeight,F=G.notFoundContent,W=G.open,Y=G.menuItemSelectedIcon,Z=G.virtual,te=G.onSelect,q=G.onToggleOpen,X=G.onActiveValue,re=G.onScroll,me=G.onMouseEnter,ve="".concat(le,"-item"),Te=Object(r.a)(function(){return be},[W,be],function(fe,pe){return pe[0]&&fe[1]!==pe[1]}),Re=T.useRef(null),Ie=function(pe){pe.preventDefault()},je=function(pe){Re.current&&Re.current.scrollTo({index:pe})},Ne=function(pe){for(var ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,_e=Te.length,xe=0;xe<_e;xe+=1){var Se=(pe+xe*ye+_e)%_e,Ae=Te[Se],Oe=Ae.group,Le=Ae.data;if(!Oe&&!Le.disabled)return Se}return-1},We=T.useState(function(){return Ne(0)}),Be=Object(g.a)(We,2),He=Be[0],De=Be[1],Xe=function(pe){De(pe);var ye=Te[pe];if(!ye){X(null,-1);return}X(ye.data.value,pe)};T.useEffect(function(){Xe(ae!==!1?Ne(0):-1)},[Te.length,ce]),T.useEffect(function(){var fe=setTimeout(function(){if(!he&&W&&se.size===1){var pe=Array.from(se)[0],ye=Te.findIndex(function(_e){var xe=_e.data;return xe.value===pe});Xe(ye),je(ye)}});return function(){return clearTimeout(fe)}},[W]);var $e=function(pe){pe!==void 0&&te(pe,{selected:!se.has(pe)}),he||q(!1)};if(T.useImperativeHandle(ie,function(){return{onKeyDown:function(pe){var ye=pe.which;switch(ye){case s.a.UP:case s.a.DOWN:{var _e=0;if(ye===s.a.UP?_e=-1:ye===s.a.DOWN&&(_e=1),_e!==0){var xe=Ne(He+_e,_e);je(xe),Xe(xe)}break}case s.a.ENTER:{var Se=Te[He];Se&&!Se.data.disabled?$e(Se.data.value):$e(void 0),W&&pe.preventDefault();break}case s.a.ESC:q(!1)}},onKeyUp:function(){},scrollTo:function(pe){je(pe)}}}),Te.length===0)return T.createElement("div",{role:"listbox",id:"".concat(ue,"_list"),className:"".concat(ve,"-empty"),onMouseDown:Ie},F);function we(fe){var pe=Te[fe];if(!pe)return null;var ye=pe.data||{},_e=ye.value,xe=ye.label,Se=ye.children,Ae=Object(a.a)(ye,!0),Oe=Ce?Se:xe;return pe?T.createElement("div",Object.assign({"aria-label":typeof Oe=="string"?Oe:null},Ae,{key:fe,role:"option",id:"".concat(ue,"_list_").concat(fe),"aria-selected":se.has(_e)}),_e):null}return T.createElement(T.Fragment,null,T.createElement("div",{role:"listbox",id:"".concat(ue,"_list"),style:{height:0,width:0,overflow:"hidden"}},we(He-1),we(He),we(He+1)),T.createElement(m.a,{itemKey:"key",ref:Re,data:Te,height:Q,itemHeight:D,fullHeight:!1,onMouseDown:Ie,onScroll:re,virtual:Z,onMouseEnter:me},function(fe,pe){var ye,_e=fe.group,xe=fe.groupOption,Se=fe.data,Ae=Se.label,Oe=Se.key;if(_e)return T.createElement("div",{className:p()(ve,"".concat(ve,"-group"))},Ae!==void 0?Ae:Oe);var Le=Se.disabled,Me=Se.value,Ke=Se.title,Qe=Se.children,Ye=Se.style,nt=Se.className,pt=Object(C.a)(Se,["disabled","value","title","children","style","className"]),st=se.has(Me),tt="".concat(ve,"-option"),Pt=p()(ve,tt,nt,(ye={},Object(c.a)(ye,"".concat(tt,"-grouped"),xe),Object(c.a)(ye,"".concat(tt,"-active"),He===pe&&!Le),Object(c.a)(ye,"".concat(tt,"-disabled"),Le),Object(c.a)(ye,"".concat(tt,"-selected"),st),ye)),wt=Ce?Qe:Ae,Vt=!Y||typeof Y=="function"||st;return T.createElement("div",Object.assign({},pt,{"aria-selected":st,className:Pt,title:Ke,onMouseMove:function(){if(He===pe||Le)return;Xe(pe)},onClick:function(){Le||$e(Me)},style:Ye}),T.createElement("div",{className:"".concat(tt,"-content")},wt||Me),T.isValidElement(Y)||st,Vt&&T.createElement(E.a,{className:"".concat(ve,"-option-state"),customizeIcon:Y,customizeIconProps:{isSelected:st}},st?"\u2713":null))}))},u=T.forwardRef(y);u.displayName="OptionList";var n=u,o=function(){return null};o.isSelectOption=!0;var l=o,w=function(){return null};w.isSelectOptGroup=!0;var v=w,i=N("VTBJ"),R=N("Zm9Q");function k(H){var G=H.key,ie=H.props,le=ie.children,ue=ie.value,be=Object(C.a)(ie,["children","value"]);return Object(i.a)({key:G,value:ue!==void 0?ue:G,children:le},be)}function d(H){var G=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(R.a)(H).map(function(ie,le){if(!T.isValidElement(ie)||!ie.type)return null;var ue=ie.type.isSelectOptGroup,be=ie.key,Ce=ie.props,se=Ce.children,ce=Object(C.a)(Ce,["children"]);return G||!ue?k(ie):Object(i.a)(Object(i.a)({key:"__RC_SELECT_GRP__".concat(be===null?le:be,"__"),label:be},ce),{},{options:d(se)})}).filter(function(ie){return ie})}var b=N("2Qr1"),x=N("qNPg"),_=N("U8pU"),B=N("Kwbf"),U=N("WKfj");function P(H){var G=H.mode,ie=H.options,le=H.children,ue=H.backfill,be=H.allowClear,Ce=H.placeholder,se=H.getInputElement,ce=H.showSearch,he=H.onSearch,ae=H.defaultOpen,Q=H.autoFocus,D=H.labelInValue,F=H.value,W=H.inputValue,Y=H.optionLabelProp,Z=G==="multiple"||G==="tags",te=ce!==void 0?ce:Z||G==="combobox",q=ie||d(le);if(Object(B.a)(G!=="tags"||q.every(function(ve){return!ve.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),G==="tags"||G==="combobox"){var X=q.some(function(ve){return ve.options?ve.options.some(function(Te){return typeof("value"in Te?Te.value:Te.key)=="number"}):typeof("value"in ve?ve.value:ve.key)=="number"});Object(B.a)(!X,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(B.a)(G!=="combobox"||!Y,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(B.a)(G==="combobox"||!ue,"`backfill` only works with `combobox` mode."),Object(B.a)(G==="combobox"||!se,"`getInputElement` only work with `combobox` mode."),Object(B.b)(G!=="combobox"||!se||!be||!Ce,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),he&&!te&&G!=="combobox"&&G!=="tags"&&Object(B.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(B.b)(!ae||Q,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),F!=null){var re=Object(U.d)(F);Object(B.a)(!D||re.every(function(ve){return Object(_.a)(ve)==="object"&&("key"in ve||"value"in ve)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(B.a)(!Z||Array.isArray(F),"`value` should be array when `mode` is `multiple` or `tags`")}if(le){var me=null;Object(R.a)(le).some(function(ve){if(!T.isValidElement(ve)||!ve.type)return!1;var Te=ve.type;if(Te.isSelectOption)return!1;if(Te.isSelectOptGroup){var Re=Object(R.a)(ve.props.children).every(function(Ie){return!T.isValidElement(Ie)||!ve.type||Ie.type.isSelectOption?!0:(me=Ie.type,!1)});return!Re}return me=Te,!0}),me&&Object(B.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(me.displayName||me.name||me,"`.")),Object(B.a)(W===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var J=P,$=Object(x.a)({prefixCls:"rc-select",components:{optionList:n},convertChildrenToData:d,flattenOptions:b.d,getLabeledValue:b.e,filterOptions:b.b,isValueDisabled:b.g,findValueOption:b.c,warningProps:J,fillOptionsWithMissingValue:b.a}),z=function(H){Object(S.a)(ie,H);var G=Object(L.a)(ie);function ie(){var le;return Object(I.a)(this,ie),le=G.apply(this,arguments),le.selectRef=T.createRef(),le.focus=function(){le.selectRef.current.focus()},le.blur=function(){le.selectRef.current.blur()},le}return Object(h.a)(ie,[{key:"render",value:function(){return T.createElement($,Object.assign({ref:this.selectRef},this.props))}}]),ie}(T.Component);z.Option=l,z.OptGroup=v;var V=z,K=ne.c=V},M8RZ:function(M,ne,N){"use strict";N.d(ne,"a",function(){return s});var I=N("fWQN"),h=N("mtLc"),S=N("yKVA"),L=N("879j"),T=N("q1tI"),c=N.n(T),C=N("i8i4"),g=N.n(C),s=function(a){Object(S.a)(f,a);var r=Object(L.a)(f);function f(p){var m;Object(I.a)(this,f),m=r.call(this,p);var E=window.document;return m.node=E.createElement("div"),E.body.appendChild(m.node),m}return Object(h.a)(f,[{key:"render",value:function(){var m=this.props.children;return Object(C.createPortal)(m,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),f}(c.a.Component)},MFOe:function(M,ne,N){(function(I){var h=c(),S=C(),L=g(),T=typeof window!="undefined"?window:I;M.exports={assign:h,create:S,trim:L,bind:s,slice:a,each:r,map:f,pluck:p,isList:m,isFunction:E,isObject:y,Global:T};function c(){return Object.assign?Object.assign:function(n,o,l,w){for(var v=1;v<arguments.length;v++)r(Object(arguments[v]),function(i,R){n[R]=i});return n}}function C(){if(Object.create)return function(o,l,w,v){var i=a(arguments,1);return h.apply(this,[Object.create(o)].concat(i))};{function u(){}return function(o,l,w,v){var i=a(arguments,1);return u.prototype=o,h.apply(this,[new u].concat(i))}}}function g(){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 s(u,n){return function(){return n.apply(u,Array.prototype.slice.call(arguments,0))}}function a(u,n){return Array.prototype.slice.call(u,n||0)}function r(u,n){p(u,function(o,l){return n(o,l),!1})}function f(u,n){var o=m(u)?[]:{};return p(u,function(l,w){return o[w]=n(l,w),!1}),o}function p(u,n){if(m(u)){for(var o=0;o<u.length;o++)if(n(u[o],o))return u[o]}else for(var l in u)if(u.hasOwnProperty(l)&&n(u[l],l))return u[l]}function m(u){return u!=null&&typeof u!="function"&&typeof u.length=="number"}function E(u){return u&&{}.toString.call(u)==="[object Function]"}function y(u){return u&&{}.toString.call(u)==="[object Object]"}}).call(this,N("IyRk"))},MlIO:function(M,ne,N){(function(I,h){M.exports=ne=h(N("Ib8C"))})(this,function(I){return function(h){var S=I,L=S.lib,T=L.Base,c=L.WordArray,C=S.x64={},g=C.Word=T.extend({init:function(a,r){this.high=a,this.low=r}}),s=C.WordArray=T.extend({init:function(a,r){a=this.words=a||[],r!=h?this.sigBytes=r:this.sigBytes=a.length*8},toX32:function(){for(var a=this.words,r=a.length,f=[],p=0;p<r;p++){var m=a[p];f.push(m.high),f.push(m.low)}return c.create(f,this.sigBytes)},clone:function(){for(var a=T.clone.call(this),r=a.words=this.words.slice(0),f=r.length,p=0;p<f;p++)r[p]=r[p].clone();return a}})}(),I})},NFKh:function(M,ne,N){(function(I,h,S){M.exports=ne=h(N("Ib8C"),N("MlIO"),N("F+F2"),N("qM6L"),N("ETIr"),N("wbyO"),N("cv67"),N("3y9D"),N("lPiR"),N("GRuw"),N("1uat"),N("uGsb"),N("5hvy"),N("ELcG"),N("WYAk"),N("e7zE"),N("K3mO"),N("OLod"),N("ALsQ"),N("9OqN"),N("qu8F"),N("S6kV"),N("gb/T"),N("qBft"),N("oRuE"),N("jO9C"),N("KmYQ"),N("uGxW"),N("bQjk"),N("wZgz"),N("pA7S"),N("w7YG"),N("E4JC"),N("PVpz"))})(this,function(I){return I})},NvD2:function(M,ne,N){"use strict";N.d(ne,"a",function(){return c});var I=N("Kwbf");function h(C,g){var s=new Set;return C.forEach(function(a){g.has(a)||s.add(a)}),s}function S(C){var g=C||{},s=g.disabled,a=g.disableCheckbox,r=g.checkable;return!!(s||a)||r===!1}function L(C,g,s,a){for(var r=new Set(C),f=new Set,p=0;p<=s;p+=1){var m=g.get(p)||new Set;m.forEach(function(n){var o=n.key,l=n.node,w=n.children,v=w===void 0?[]:w;r.has(o)&&!a(l)&&v.filter(function(i){return!a(i.node)}).forEach(function(i){r.add(i.key)})})}for(var E=new Set,y=s;y>=0;y-=1){var u=g.get(y)||new Set;u.forEach(function(n){var o=n.parent,l=n.node;if(a(l)||!n.parent||E.has(n.parent.key))return;if(a(n.parent.node)){E.add(o.key);return}var w=!0,v=!1;(o.children||[]).filter(function(i){return!a(i.node)}).forEach(function(i){var R=i.key,k=r.has(R);w&&!k&&(w=!1),!v&&(k||f.has(R))&&(v=!0)}),w&&r.add(o.key),v&&f.add(o.key),E.add(o.key)})}return{checkedKeys:Array.from(r),halfCheckedKeys:Array.from(h(f,r))}}function T(C,g,s,a,r){for(var f=new Set(C),p=new Set(g),m=0;m<=a;m+=1){var E=s.get(m)||new Set;E.forEach(function(o){var l=o.key,w=o.node,v=o.children,i=v===void 0?[]:v;!f.has(l)&&!p.has(l)&&!r(w)&&i.filter(function(R){return!r(R.node)}).forEach(function(R){f.delete(R.key)})})}p=new Set;for(var y=new Set,u=a;u>=0;u-=1){var n=s.get(u)||new Set;n.forEach(function(o){var l=o.parent,w=o.node;if(r(w)||!o.parent||y.has(o.parent.key))return;if(r(o.parent.node)){y.add(l.key);return}var v=!0,i=!1;(l.children||[]).filter(function(R){return!r(R.node)}).forEach(function(R){var k=R.key,d=f.has(k);v&&!d&&(v=!1),!i&&(d||p.has(k))&&(i=!0)}),v||f.delete(l.key),i&&p.add(l.key),y.add(l.key)})}return{checkedKeys:Array.from(f),halfCheckedKeys:Array.from(h(p,f))}}function c(C,g,s,a){var r=[],f;a?f=a:f=S;var p=new Set(C.filter(function(u){var n=!!s[u];return n||r.push(u),n})),m=new Map,E=0;Object.keys(s).forEach(function(u){var n=s[u],o=n.level,l=m.get(o);l||(l=new Set,m.set(o,l)),l.add(n),E=Math.max(E,o)}),Object(I.a)(!r.length,"Tree missing follow keys: ".concat(r.slice(0,100).map(function(u){return"'".concat(u,"'")}).join(", ")));var y;return g===!0?y=L(p,m,E,f):y=T(p,g.halfCheckedKeys,m,E,f),y}},OLES:function(M,ne,N){"use strict";var I=N("U8pU"),h=N("VTBJ"),S=N("Ff2n"),L=N("q1tI"),T=N("uciX"),c=N("7ixt"),C=function(p){var m=p.overlay,E=p.prefixCls,y=p.id,u=p.overlayInnerStyle;return L.createElement("div",{className:"".concat(E,"-inner"),id:y,role:"tooltip",style:u},typeof m=="function"?m():m)},g=C,s=function(p,m){var E=p.overlayClassName,y=p.trigger,u=y===void 0?["hover"]:y,n=p.mouseEnterDelay,o=n===void 0?0:n,l=p.mouseLeaveDelay,w=l===void 0?.1:l,v=p.overlayStyle,i=p.prefixCls,R=i===void 0?"rc-tooltip":i,k=p.children,d=p.onVisibleChange,b=p.afterVisibleChange,x=p.transitionName,_=p.animation,B=p.placement,U=B===void 0?"right":B,P=p.align,J=P===void 0?{}:P,$=p.destroyTooltipOnHide,z=$===void 0?!1:$,V=p.defaultVisible,K=p.getTooltipContainer,H=p.overlayInnerStyle,G=Object(S.a)(p,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),ie=Object(L.useRef)(null);Object(L.useImperativeHandle)(m,function(){return ie.current});var le=Object(h.a)({},G);"visible"in p&&(le.popupVisible=p.visible);var ue=function(){var he=p.arrowContent,ae=he===void 0?null:he,Q=p.overlay,D=p.id;return[L.createElement("div",{className:"".concat(R,"-arrow"),key:"arrow"},ae),L.createElement(g,{key:"content",prefixCls:R,id:D,overlay:Q,overlayInnerStyle:H})]},be=!1,Ce=!1;if(typeof z=="boolean")be=z;else if(z&&Object(I.a)(z)==="object"){var se=z.keepParent;be=se===!0,Ce=se===!1}return L.createElement(T.a,Object.assign({popupClassName:E,prefixCls:R,popup:ue,action:u,builtinPlacements:c.a,popupPlacement:U,ref:ie,popupAlign:J,getPopupContainer:K,onPopupVisibleChange:d,afterPopupVisibleChange:b,popupTransitionName:x,popupAnimation:_,defaultPopupVisible:V,destroyPopupOnHide:be,autoDestroy:Ce,mouseLeaveDelay:w,popupStyle:v,mouseEnterDelay:o},le),k)},a=Object(L.forwardRef)(s),r=ne.a=a},OLod:function(M,ne,N){(function(I,h,S){M.exports=ne=h(N("Ib8C"),N("K3mO"))})(this,function(I){I.lib.Cipher||function(h){var S=I,L=S.lib,T=L.Base,c=L.WordArray,C=L.BufferedBlockAlgorithm,g=S.enc,s=g.Utf8,a=g.Base64,r=S.algo,f=r.EvpKDF,p=L.Cipher=C.extend({cfg:T.extend(),createEncryptor:function(x,_){return this.create(this._ENC_XFORM_MODE,x,_)},createDecryptor:function(x,_){return this.create(this._DEC_XFORM_MODE,x,_)},init:function(x,_,B){this.cfg=this.cfg.extend(B),this._xformMode=x,this._key=_,this.reset()},reset:function(){C.reset.call(this),this._doReset()},process:function(x){return this._append(x),this._process()},finalize:function(x){x&&this._append(x);var _=this._doFinalize();return _},keySize:128/32,ivSize:128/32,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function x(_){return typeof _=="string"?b:R}return function(_){return{encrypt:function(B,U,P){return x(U).encrypt(_,B,U,P)},decrypt:function(B,U,P){return x(U).decrypt(_,B,U,P)}}}}()}),m=L.StreamCipher=p.extend({_doFinalize:function(){var x=this._process(!0);return x},blockSize:1}),E=S.mode={},y=L.BlockCipherMode=T.extend({createEncryptor:function(x,_){return this.Encryptor.create(x,_)},createDecryptor:function(x,_){return this.Decryptor.create(x,_)},init:function(x,_){this._cipher=x,this._iv=_}}),u=E.CBC=function(){var x=y.extend();x.Encryptor=x.extend({processBlock:function(B,U){var P=this._cipher,J=P.blockSize;_.call(this,B,U,J),P.encryptBlock(B,U),this._prevBlock=B.slice(U,U+J)}}),x.Decryptor=x.extend({processBlock:function(B,U){var P=this._cipher,J=P.blockSize,$=B.slice(U,U+J);P.decryptBlock(B,U),_.call(this,B,U,J),this._prevBlock=$}});function _(B,U,P){var J,$=this._iv;$?(J=$,this._iv=h):J=this._prevBlock;for(var z=0;z<P;z++)B[U+z]^=J[z]}return x}(),n=S.pad={},o=n.Pkcs7={pad:function(x,_){for(var B=_*4,U=B-x.sigBytes%B,P=U<<24|U<<16|U<<8|U,J=[],$=0;$<U;$+=4)J.push(P);var z=c.create(J,U);x.concat(z)},unpad:function(x){var _=x.words[x.sigBytes-1>>>2]&255;x.sigBytes-=_}},l=L.BlockCipher=p.extend({cfg:p.cfg.extend({mode:u,padding:o}),reset:function(){var x;p.reset.call(this);var _=this.cfg,B=_.iv,U=_.mode;this._xformMode==this._ENC_XFORM_MODE?x=U.createEncryptor:(x=U.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==x?this._mode.init(this,B&&B.words):(this._mode=x.call(U,this,B&&B.words),this._mode.__creator=x)},_doProcessBlock:function(x,_){this._mode.processBlock(x,_)},_doFinalize:function(){var x,_=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(_.pad(this._data,this.blockSize),x=this._process(!0)):(x=this._process(!0),_.unpad(x)),x},blockSize:128/32}),w=L.CipherParams=T.extend({init:function(x){this.mixIn(x)},toString:function(x){return(x||this.formatter).stringify(this)}}),v=S.format={},i=v.OpenSSL={stringify:function(x){var _,B=x.ciphertext,U=x.salt;return U?_=c.create([1398893684,1701076831]).concat(U).concat(B):_=B,_.toString(a)},parse:function(x){var _,B=a.parse(x),U=B.words;return U[0]==1398893684&&U[1]==1701076831&&(_=c.create(U.slice(2,4)),U.splice(0,4),B.sigBytes-=16),w.create({ciphertext:B,salt:_})}},R=L.SerializableCipher=T.extend({cfg:T.extend({format:i}),encrypt:function(x,_,B,U){U=this.cfg.extend(U);var P=x.createEncryptor(B,U),J=P.finalize(_),$=P.cfg;return w.create({ciphertext:J,key:B,iv:$.iv,algorithm:x,mode:$.mode,padding:$.padding,blockSize:x.blockSize,formatter:U.format})},decrypt:function(x,_,B,U){U=this.cfg.extend(U),_=this._parse(_,U.format);var P=x.createDecryptor(B,U).finalize(_.ciphertext);return P},_parse:function(x,_){return typeof x=="string"?_.parse(x,this):x}}),k=S.kdf={},d=k.OpenSSL={execute:function(x,_,B,U){U||(U=c.random(64/8));var P=f.create({keySize:_+B}).compute(x,U),J=c.create(P.words.slice(_),B*4);return P.sigBytes=_*4,w.create({key:P,iv:J,salt:U})}},b=L.PasswordBasedCipher=R.extend({cfg:R.cfg.extend({kdf:d}),encrypt:function(x,_,B,U){U=this.cfg.extend(U);var P=U.kdf.execute(B,x.keySize,x.ivSize);U.iv=P.iv;var J=R.encrypt.call(this,x,_,P.key,U);return J.mixIn(P),J},decrypt:function(x,_,B,U){U=this.cfg.extend(U),_=this._parse(_,U.format);var P=U.kdf.execute(B,x.keySize,x.ivSize,_.salt);U.iv=P.iv;var J=R.decrypt.call(this,x,_,P.key,U);return J}})}()})},OZM5:function(M,ne,N){"use strict";N.d(ne,"b",function(){return a}),N.d(ne,"a",function(){return r}),N.d(ne,"k",function(){return f}),N.d(ne,"h",function(){return p}),N.d(ne,"i",function(){return m}),N.d(ne,"g",function(){return E}),N.d(ne,"c",function(){return y}),N.d(ne,"d",function(){return u}),N.d(ne,"j",function(){return l}),N.d(ne,"e",function(){return w}),N.d(ne,"f",function(){return v});var I=N("KQm4"),h=N("U8pU"),S=N("Ff2n"),L=N("q1tI"),T=N.n(L),c=N("Kwbf"),C=N("WaYH"),g=.25,s=2;function a(i,R){var k=i.slice(),d=k.indexOf(R);return d>=0&&k.splice(d,1),k}function r(i,R){var k=i.slice();return k.indexOf(R)===-1&&k.push(R),k}function f(i){return i.split("-")}function p(i,R){return"".concat(i,"-").concat(R)}function m(i){return i&&i.type&&i.type.isTreeNode}function E(i,R){var k=[i],d=R[i];function b(){var x=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];x.forEach(function(_){var B=_.key,U=_.children;k.push(B),b(U)})}return b(d.children),k}function y(i,R){var k=i.clientY,d=R.selectHandle.getBoundingClientRect(),b=d.top,x=d.bottom,_=d.height,B=Math.max(_*g,s);return k<=b+B?-1:k>=x-B?1:0}function u(i,R){if(!i)return;var k=R.multiple;return k?i.slice():i.length?[i[0]]:i}var n=function(R){return R};function o(i,R){if(!i)return[];var k=R||{},d=k.processProps,b=d===void 0?n:d,x=Array.isArray(i)?i:[i];return x.map(function(_){var B=_.children,U=Object(S.a)(_,["children"]),P=o(B,R);return T.a.createElement(C.a,Object.assign({},b(U)),P)})}function l(i){if(!i)return null;var R;if(Array.isArray(i))R={checkedKeys:i,halfCheckedKeys:void 0};else if(Object(h.a)(i)==="object")R={checkedKeys:i.checked||void 0,halfCheckedKeys:i.halfChecked||void 0};else return Object(c.a)(!1,"`checkedKeys` is not an array or an object"),null;return R}function w(i,R){var k=new Set;function d(b){if(k.has(b))return;var x=R[b];if(!x)return;k.add(b);var _=x.parent,B=x.node;if(B.disabled)return;_&&d(_.key)}return(i||[]).forEach(function(b){d(b)}),Object(I.a)(k)}function v(i){var R={};return Object.keys(i).forEach(function(k){(k.startsWith("data-")||k.startsWith("aria-"))&&(R[k]=i[k])}),R}},Ot1p:function(M,ne,N){"use strict";var I=N("2qtc"),h=N("kLXV"),S=N("rAM+"),L=N("miYZ"),T=N("tsqr"),c=N("9og8"),C=N("tJVT"),g=N("jrin"),s=N("WmNS"),a=N.n(s),r=N("q1tI"),f=N.n(r),p=N("VrN/"),m=N.n(p),E=N("bdgK"),y=N("p77/"),u=N("Bd2K"),n=N("ELLl"),o=N("19Vz"),l=N("lZu9"),w=N("+NIl"),v=N("kSUc"),i=N("9Bee"),R=function(Le){var Me=Le.value,Ke=Me===void 0?"":Me,Qe=Le.className,Ye=Le.showTextOnly,nt=Le.showLines,pt=Le.style,st=pt===void 0?{}:pt,tt=Object(r.useMemo)(function(){return""},[Ke]);return f.a.createElement(f.a.Fragment,null,f.a.createElement("div",{dangerouslySetInnerHTML:{__html:tt}}))},k=N("0Owb"),d=N("dejd"),b=N("C+DQ"),x=N("1vsH"),_=N("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 U(Le){var Me=Le.onActionCallback,Ke=Le.title,Qe=Le.icon,Ye=Le.actionName,nt=Le.className,pt=nt===void 0?"":nt,st=Le.children;function tt(){Me(Ye)}return f.a.createElement("a",{title:Ke,className:pt,onClick:tt},f.a.createElement("i",{className:"md-iconfont ".concat(Qe)}),st)}var P=function(Le){var Me=Le.watch,Ke=Le.showNullButton,Qe=Le.onActionCallback,Ye=Le.fullScreen,nt=Le.insertTemp,pt=Le.hidetoolBar,st=Le.uuid,tt=Le.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(x.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(x.F)("_educoder_session"),"&key=").concat(st,"&api=").concat(encodeURIComponent(_.a.PROXY_SERVER)));var Pt=[].concat(B,[{title:"".concat(Me?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Me?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return f.a.createElement("ul",{className:"markdown-toolbar-container"},!pt&&Pt.map(function(wt,Vt){return f.a.createElement("li",{key:Vt},wt.actionName?f.a.createElement(U,Object(k.a)({},wt,{onActionCallback:Qe})):f.a.createElement("span",{className:"v-line"}))}),Ke?f.a.createElement("li",null,f.a.createElement(U,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:Qe},f.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,nt&&f.a.createElement("li",null,f.a.createElement(U,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(nt),onActionCallback:Qe},f.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),f.a.createElement("li",{className:"btn-full-screen"},f.a.createElement(U,{icon:"".concat(Ye?"icon-shrink":"icon-enlarge"),title:Ye?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:Qe})))},J=N("M8RZ"),$=N("+L6B"),z=N("2/Rp"),V=N("y8nQ"),K=N("Vl3Y"),H=N("5NDa"),G=N("5rEg"),ie={labelCol:{span:4},wrapperCol:{span:20}},le=function(Le){var Me=Le.callback,Ke=Le.onCancel;function Qe(Ye){Me(Ye)}return f.a.createElement(K.a,Object(k.a)({},ie,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:Qe}),f.a.createElement(K.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},f.a.createElement(G.a,null)),f.a.createElement(K.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},f.a.createElement(G.a,null)),f.a.createElement("div",{className:"flex-container flex-end"},f.a.createElement(z.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),f.a.createElement(z.a,{type:"ghost",onClick:Ke},"\u53D6\u6D88")))},ue=N("7ahc"),be=N("HmJG"),Ce=N("BjJ7"),se=K.a.useForm,ce={width:280,marginRight:10},he={labelCol:{span:5},wrapperCol:{span:19}},ae=function(Le){var Me=Le.callback,Ke=Le.onCancel,Qe=se(),Ye=Object(C.a)(Qe,1),nt=Ye[0];function pt(Pt){Me(Pt)}function st(Pt,wt){if(Pt.status===-1){T.b.error(Pt.message);return}nt.setFieldsValue({src:"/api/attachments/".concat(Pt.id),type:wt.type})}function tt(Pt){var wt=Pt.target.files[0];D(wt,st)}return f.a.createElement(K.a,Object(k.a)({form:nt},he,{className:"upload-image-panel",onFinish:pt}),f.a.createElement(K.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},f.a.createElement("div",{className:"flex-container"},f.a.createElement(K.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},f.a.createElement(G.a,{style:ce})),f.a.createElement(Q,{onFileChange:tt}))),f.a.createElement(K.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},f.a.createElement(G.a,{style:{width:264}})),f.a.createElement(K.a.Item,{style:{textAlign:"right"}},f.a.createElement(z.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),f.a.createElement(z.a,{type:"ghost",onClick:Ke},"\u53D6\u6D88")))};function Q(Le){var Me=Le.onFileChange;return f.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",f.a.createElement("input",{type:"file",onChange:Me}))}function D(Le,Me){if(!Le)throw new String("\u6CA1\u6709\u6587\u4EF6");var Ke=new FormData;Ke.append("editormd-image-file",Le),Ke.append("file_param_name","editormd-image-file"),Ke.append("byxhr","true");var Qe=new window.XMLHttpRequest;Qe.withCredentials=!0,Qe.addEventListener("load",function(Ye){Me(JSON.parse(Ye.target.responseText),Le)},!1),Qe.addEventListener("error",function(Ye){console.error(Ye)},!1),Qe.open("POST","".concat(Ce.a,"/api/attachments.json")),Qe.send(Ke)}var F=N("giR+"),W=N("fyUT"),Y=N("7Kak"),Z=N("9yH6"),te=Z.a.Group,q={margin:"0 8px"},X=function(Le){var Me=Le.callback,Ke=Le.onCancel;function Qe(Ye){Me(Ye)}return f.a.createElement(K.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:Qe},f.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},f.a.createElement("span",{style:q},"\u5355\u5143\u683C\u6570\uFF1A"),f.a.createElement("span",{style:q},"\u884C\u6570"),f.a.createElement(K.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},f.a.createElement(W.a,null)),f.a.createElement("span",{style:q},"\u5217\u6570"),f.a.createElement(K.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},f.a.createElement(W.a,null))),f.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},f.a.createElement("span",{style:q},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),f.a.createElement(K.a.Item,{name:"align"},f.a.createElement(te,null,f.a.createElement(Z.a,{value:"default"},f.a.createElement("i",{className:"fa fa-align-justify"})),f.a.createElement(Z.a,{value:"left"},f.a.createElement("i",{className:"fa fa-align-left"})),f.a.createElement(Z.a,{value:"center"},f.a.createElement("i",{className:"fa fa-align-center"})),f.a.createElement(Z.a,{value:"right"},f.a.createElement("i",{className:"fa fa-align-right"}))))),f.a.createElement("div",{className:"flex-container flex-end"},f.a.createElement(z.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),f.a.createElement(z.a,{type:"ghost",onClick:Ke},"\u53D6\u6D88")))},re=N("ErOA"),me=N("7Cbv"),ve="link",Te="upload-image",Re="code-block",Ie="add-table",je="------------",Ne={default:je,left:":".concat(je),center:":".concat(je,":"),right:"".concat(je,":")},We=N("9VGf"),Be,He;function De(){}var Xe=0,$e=1e4,we="\u2581",fe=`
**\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 pe(Le){return/^\d+$/.test(Le)?"".concat(Le,"px"):Le}var ye=navigator.platform.toUpperCase().indexOf("MAC")>=0,_e=ye?"Cmd":"Ctrl",xe=["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"],Se=(Be={},Object(g.a)(Be,_e+"-B","bold"),Object(g.a)(Be,_e+"-I","italic"),Be),Ae=(He={},Object(g.a)(He,ve,"\u6DFB\u52A0\u94FE\u63A5"),Object(g.a)(He,Re,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(g.a)(He,Te,"\u6DFB\u52A0\u6587\u4EF6"),Object(g.a)(He,Ie,"\u6DFB\u52A0\u8868\u683C"),He),Oe=ne.a=function(Le){var Me=Le.defaultValue,Ke=Me===void 0?"":Me,Qe=Le.onChange,Ye=Le.width,nt=Ye===void 0?"100%":Ye,pt=Le.height,st=pt===void 0?400:pt,tt=Le.miniToolbar,Pt=tt===void 0?!1:tt,wt=Le.isFocus,Vt=wt===void 0?!1:wt,Bt=Le.watch,gt=Le.insertTemp,xt=Le.mode,rr=xt===void 0?"markdown":xt,Gt=Le.id,Ge=Gt===void 0?"markdown-editor-id":Gt,lt=Le.showResizeBar,yt=lt===void 0?!1:lt,It=Le.noStorage,Wt=It===void 0?!1:It,Ot=Le.showNullButton,Rt=Ot===void 0?!1:Ot,at=Le.hidetoolBar,ft=at===void 0?!1:at,zt=Le.fullScreen,St=zt===void 0?!1:zt,kt=Le.onBlur,Ut=Le.onCMBeforeChange,Nt=Le.onFullScreen,Xt=Le.className,Je=Xt===void 0?"":Xt,bt=Le.disablePaste,kr=bt===void 0?!1:bt,wr=Le.placeholder,Wr=wr===void 0?"":wr,Mr=Le.values,un=Mr===void 0?"":Mr,Dt=Object(r.useState)(null),vr=Object(C.a)(Dt,2),Ve=vr[0],qt=vr[1],At=Object(r.useState)(Ke),Sr=Object(C.a)(At,2),yr=Sr[0],Hr=Sr[1],Nr=Object(r.useState)(Bt),jr=Object(C.a)(Nr,2),lr=jr[0],Yr=jr[1],ur=Object(r.useState)(St),qr=Object(C.a)(ur,2),Fr=qr[0],In=qr[1],Kn=Object(r.useState)(""),Mn=Object(C.a)(Kn,2),cr=Mn[0],cn=Mn[1],oi=Object(r.useState)(0),bn=Object(C.a)(oi,2),Dr=bn[0],br=bn[1],Zt=Object(r.useState)(st),dr=Object(C.a)(Zt,2),xr=dr[0],dn=dr[1],Gn=Object(r.useState)(!1),hn=Object(C.a)(Gn,2),Vi=hn[0],Nn=hn[1],On=Object(r.useRef)(Object(me.a)()),fn=Object(r.useRef)(!1),kn=Object(r.useRef)(),xn=Object(r.useRef)(),En=Object(r.useRef)(),en=Object(r.useRef)(),zn=Object(r.useRef)(),Si=function(){var Et=Object(c.a)(a.a.mark(function Mt(){var _t,Ht;return a.a.wrap(function(qe){for(;;)switch(qe.prev=qe.next){case 0:return qe.next=2,Object(re.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:On.current}});case 2:Ht=qe.sent,Ht!=null&&(_t=Ht.attachments)!==null&&_t!==void 0&&_t.length&&(console.log("cm:",Ve,xn),Ht.attachments.map(function(rt){rt.content_type.indexOf("image")>-1?Ve.replaceSelection("![,](/api/attachments/".concat(rt.id,"?type=").concat(rt.content_type,")")):rt.content_type.indexOf("video")>-1?Ve.replaceSelection('<video width="100%" controls src="'.concat(_.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):rt.content_type.indexOf("pdf")>-1?Ve.replaceSelection('<a href="'.concat(_.a.API_SERVER,"/api/attachments/").concat(rt.id,"?type=").concat(rt.content_type,'&disposition=inline" target="_blank">').concat(rt.name,"</a>")):Ve.replaceSelection("[".concat(rt.name,"](").concat(_.a.API_SERVER,"/api/attachments/").concat(rt.id,"?type=").concat(rt.content_type,")"))}));case 4:case"end":return qe.stop()}},Mt)}));return function(){return Et.apply(this,arguments)}}();Object(r.useEffect)(function(){Hr(un),Ve==null||Ve.setValue(un)},[un]),Object(r.useEffect)(function(){Nt==null||Nt(Fr)},[Fr]),Object(r.useEffect)(function(){if(xn.current){var Et=m.a.fromTextArea(xn.current,{mode:rr,lineNumbers:!Pt,lineWrapping:!0,value:Ke,autoCloseTags:!0,autoCloseBrackets:!0});Vt&&Et.focus();function Mt(_t,Ht){if(kr){Ht.preventDefault();return}var it=Ht.clipboardData;if(it){var qe=it.types.toString(),rt=it.items;if(qe==="Files"||it.types.indexOf("Files")>-1){if(Ht.preventDefault(),rr=="stex")return;try{var ht,Ct=rt[1];((ht=rt[0])===null||ht===void 0?void 0:ht.kind)==="file"&&(Ct=rt[0]);var et=Ct.getAsFile(),jt=et.name.split(".").pop();D(et,function(ut){if(ut.id){var Yt,Qt,ar;(et==null||((Yt=et.type)===null||Yt===void 0)?void 0:Yt.indexOf("image"))>-1?Et.replaceSelection("![,](/api/attachments/".concat(ut.id,"?type=").concat(ut.content_type,")")):(et==null||((Qt=et.type)===null||Qt===void 0)?void 0:Qt.indexOf("video"))>-1?Et.replaceSelection('<video width="100%" controls src="'.concat(_.a.API_SERVER,"/api/attachments/").concat(ut.id,'"></video>')):(et==null||((ar=et.type)===null||ar===void 0)?void 0:ar.indexOf("pdf"))>-1?Et.replaceSelection('<a href="'.concat(_.a.API_SERVER,"/api/attachments/").concat(ut.id,"?type=").concat(et.type,'&disposition=inline" target="_blank">').concat(et.name,"</a>")):xe.includes(jt)?Et.replaceSelection('<a href="'.concat(_.a.API_SERVER,"/api/attachments/").concat(ut.id,'?type=office&disposition=inline" target="_blank">').concat(et.name,"</a>")):Et.replaceSelection("[".concat(et.name,"](").concat(_.a.API_SERVER,"/api/attachments/").concat(ut.id,"?type=").concat(ut.content_type,")"))}else(ut==null?void 0:ut.status)===401&&(document.location.href="/user/login")})}catch(ut){T.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return Et.on("paste",Mt),Et.on("dragleave",function(_t,Ht){En.current.classList.remove("mouse-hover-md")}),Et.on("dragover",function(_t,Ht){En.current.classList.add("mouse-hover-md")}),Et.on("drop",function(_t,Ht){En.current.classList.add("mouse-hover-md");var it;if(it=Ht.dataTransfer.files,it.length>0){Ht.preventDefault(),Ht.stopPropagation();for(var qe=function(Ct){var et=it[Ct],jt=et.name.split(".").pop();D(et,function(ut){if(ut.id){var Yt,Qt,ar;(et==null||((Yt=et.type)===null||Yt===void 0)?void 0:Yt.indexOf("image"))>-1?Et.replaceSelection("![,](/api/attachments/".concat(ut.id,"?type=").concat(ut.content_type,")")):(et==null||((Qt=et.type)===null||Qt===void 0)?void 0:Qt.indexOf("video"))>-1?Et.replaceSelection('<video width="100%" controls src="'.concat(_.a.API_SERVER,"/api/attachments/").concat(ut.id,'"></video>')):(et==null||((ar=et.type)===null||ar===void 0)?void 0:ar.indexOf("pdf"))>-1?Et.replaceSelection('<a href="'.concat(_.a.API_SERVER,"/api/attachments/").concat(ut.id,"?type=").concat(et.type,'&disposition=inline" target="_blank">').concat(et.name,"</a>")):xe.includes(jt)?Et.replaceSelection('<a href="'.concat(_.a.API_SERVER,"/api/attachments/").concat(ut.id,'?type=office&disposition=inline" target="_blank">').concat(et.name,"</a>")):Et.replaceSelection("[".concat(et.name,"](").concat(_.a.API_SERVER,"/api/attachments/").concat(ut.id,"?type=").concat(ut.content_type,")"))}else(ut==null?void 0:ut.status)===401&&(document.location.href="/user/login")})},rt=0;rt<it.length;rt++)qe(rt)}}),qt(Et),function(){Et.off("paste",Mt)}}},[]);var Rr=Object(r.useCallback)(function(){if(En.current)try{}catch(Et){console.log(Et,"---- to set md editor body height")}},[xr,En,Fr]);Object(r.useEffect)(function(){function Et(){var _t=new E.default(function(Ht){var it=Object(S.a)(Ht),qe;try{for(it.s();!(qe=it.n()).done;){var rt=qe.value;(rt.target.offsetHeight>0||rt.target.offsetWidth>0)&&(Rr(),Ve.setSize("100%","100%"),Ve.refresh())}}catch(ht){it.e(ht)}finally{it.f()}});return _t.observe(xn.current.parentElement),_t}if(Ve){var Mt=Et();return function(){Mt.unobserve(xn.current.parentElement)}}},[Ve,Rr]),Object(r.useEffect)(function(){if(Ve){for(var Et=[],Mt=function(){var rt=Ht[_t];it=Object(C.a)(rt,2);var ht=it[0],Ct=it[1],et=Object(g.a)({},ht,function(){Vn(Ct)});Et.push(et),Ve.addKeyMap(et)},_t=0,Ht=Object.entries(Se);_t<Ht.length;_t++){var it;Mt()}return kn.current=setInterval(function(){fn.current&&Si()},4e3),function(){clearInterval(kn.current);var qe=Object(S.a)(Et),rt;try{for(qe.s();!(rt=qe.n()).done;){var ht=rt.value;Ve.removeKeyMap(ht)}}catch(Ct){qe.e(Ct)}finally{qe.f()}}}},[Ve]),Object(r.useEffect)(function(){St!==Fr&&In(St)},[St]),Object(We.a)(function(){if(!Wt&&Dr>0){var Et=new Date().getTime(),Mt=window.sessionStorage.getItem(Ge);Et>=Dr+$e&&(!Mt||Mt!==yr)&&(window.sessionStorage.setItem(Ge,yr),Nn(!0))}},$e),Object(r.useEffect)(function(){Yr(Bt)},[Ve,Bt]),Object(r.useEffect)(function(){Ve&&(Vt&&Ve.focus())},[Ve,Vt]),Object(r.useEffect)(function(){if(lr&&Ve){var Et=Ve.getScrollerElement();function Mt(_t){var Ht=_t.target;if(zn.current){var it=Ht.scrollTop/Ht.scrollHeight;zn.current.scrollTop=zn.current.scrollHeight*it}}return Et.addEventListener("scroll",Mt),function(){Et.removeEventListener("scroll",Mt)}}},[Ve,lr]),Object(r.useEffect)(function(){if(Ve&&Ut){function Et(Mt,_t){Ut(Mt,_t)}return Ve.on("beforeChange",Et),function(){Ve.off("beforeChange",Et)}}},[Ve,Ut]),Object(r.useEffect)(function(){if(Ve&&kt){function Et(){kt(Ve.getValue())}return Ve.on("blur",Et),function(){Ve.off("blur",Et)}}},[Ve,kt]),Object(r.useEffect)(function(){if(Ve){function Et(Mt){var _t=Mt.getValue();Hr(_t),br(new Date().getTime()),Mt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),Qe&&Qe(_t)}return Ve.on("change",Et),function(){Ve.off("change",Et)}}},[Ve,Qe]),Object(r.useEffect)(function(){Ve&&(Ke==null?(Ve.setValue(""),Hr("")):Ke!==Ve.getValue()&&(Ve.setValue(Ke),Hr(Ke),Ve.setCursor(Ve.lineCount(),0)))},[Ve,Ke]);var Vn=Object(r.useCallback)(function(Et){var Mt=Ve.getCursor(),_t=Ve.getSelection(),Ht=_t.split(`
`);switch(Et){case"bold":return Ve.replaceSelection("**"+_t+"**"),_t===""&&Ve.setCursor(Mt.line,Mt.ch+2),Ve.focus();case"italic":return Ve.replaceSelection("*"+_t+"*"),_t===""&&Ve.setCursor(Mt.line,Mt.ch+1),Ve.focus();case"code":return Ve.replaceSelection("`"+_t+"`"),_t===""&&Ve.setCursor(Mt.line,Mt.ch+1),Ve.focus();case"inline-latex":return Ve.replaceSelection("`$$"+_t+"$$`"),_t===""&&Ve.setCursor(Mt.line,Mt.ch+3),Ve.focus();case"latex":return Ve.replaceSelection("```latex\n"+_t+"\n```"),Ve.setCursor(Mt.line+1,_t.length+1),Ve.focus();case"line-break":return Ve.replaceSelection(`<br/>
`),Ve.focus();case"list-ul":return _t===""?Ve.replaceSelection("- "+_t):Ve.replaceSelection(Ht.map(function(it){return it===""?"":"- ".concat(it)}).join(`
`)),Ve.focus();case"list-ol":return _t===""?Ve.replaceSelection("1. "+_t):Ve.replaceSelection(Ht.map(function(it,qe){return it===""?"":"".concat(qe+1,". ").concat(it)}).join(`
`)),Ve.focus();case"add-null-ch":return _t===""&&Ve.setCursor(Mt.line,Mt.ch+1),Ve.replaceSelection(we),Ve.focus();case"inster-template-1":return _t===""&&Ve.setCursor(Mt.line,Mt.ch),Ve.replaceSelection(fe),Ve.focus();case"eraser":return Ve.setValue(""),Ve.focus();case"trigger-watch":return Yr(!lr),Ve.focus();case"trigger-full-screen":return In(!Fr),Ve.focus();case ve:cn(ve);return;case Re:cn(Re);return;case Te:cn(Te);return;case Ie:cn(Ie);return;default:throw new Error}},[Ve,lr,Fr]),Dn=Object(r.useCallback)(function(Et){cn("");switch(cr){case ve:var Mt=Et.title,_t=Et.link;return Ve.replaceSelection("[".concat(Mt,"](").concat(_t,")")),Ve.focus();case Re:var Ht=Et.language,it=Et.content;return Ve.replaceSelection(["```"+Ht,it,"```"].join(`
`)),Ve.focus();case Te:var qe=Et.src,rt=Et.alt;return rt?Ve.replaceSelection("![ ".concat(rt," ]( ").concat(qe,' "').concat(rt,'" )')):Ve.replaceSelection("![,](".concat(qe,")")),Ve.focus();case Ie:for(var ht=Et.row,Ct=Et.col,et=Et.align,jt=`
`,ut=0;ut<ht;ut++){for(var Yt=[],Qt=[],ar=0;ar<Ct;ar++)ut===1&&Qt.push(Ne[et]),Yt.push(" ");ut===1&&(jt+="| ".concat(Qt.join(" | "),` |
`)),jt+="| ".concat(Yt.join(Ct===1?"":" | "),` |
`)}return Ve.replaceSelection(jt+`
`),Ve.focus();default:throw new Error}},[Ve,cr]),si=Object(r.useMemo)(function(){switch(cr){case ve:return f.a.createElement(le,{callback:Dn,onCancel:Rn});case Re:return f.a.createElement(ue.b,{callback:Dn,onCancel:Rn});case Te:return f.a.createElement(ae,{callback:Dn,onCancel:Rn});case Ie:return f.a.createElement(X,{callback:Dn,onCancel:Rn});default:return null}},[cr]);function Rn(){cn("")}Object(r.useEffect)(function(){if(en.current){var Et=en.current,Mt=!1,_t=0;function Ht(rt){Mt=!0,_t=rt.pageY}function it(){Mt=!1}function qe(rt){if(Mt){var ht=rt.pageY-_t;ht<0&&(ht=0),ht>300&&(ht=300);var Ct=st+ht+"px";dn(Ct)}}return Et.addEventListener("mousedown",Ht),document.addEventListener("mousemove",qe),document.addEventListener("mouseup",it),function(){Et.removeEventListener("mousedown",Ht),document.removeEventListener("mousemove",qe),document.removeEventListener("mouseup",it)}}},[Ve,en]),Object(r.useEffect)(function(){dn(st)},[st]);var pn=pe(nt),li=pe(xr),tn={width:pn,height:li},ui=Object(r.useMemo)(function(){if(Dr){var Et=new Date(Dr),Mt=Et.getHours(),_t=Et.getMinutes(),Ht=Et.getSeconds();return Mt=Mt<10?"0"+Mt:Mt,_t=_t<10?"0"+_t:_t,Ht=Ht<10?"0"+Ht:Ht,"".concat(Mt,":").concat(_t,":").concat(Ht)}return 0},[Dr]);function Ci(){window.sessionStorage.removeItem(Ge),Nn(!1),br(0)}function jn(){Nn(!1),br(0),Ve.setValue(window.sessionStorage.getItem(Ge))}function Xi(Et,Mt){var _t=Ve.getValue();_t=_t.replace(Et,Mt),Hr(_t),Ve==null||Ve.setValue(_t)}return f.a.createElement(r.Fragment,null,f.a.createElement("div",{className:"markdown-editor-wrapper",ref:En},f.a.createElement("div",{className:"markdown-editor-container ".concat(Je," ").concat(lr?"on-preview":""," ").concat(Pt?"mini":""," ").concat(Fr?"full-screen":""),style:tn},f.a.createElement(P,{insertTemp:gt,watch:lr,fullScreen:Fr,showNullButton:Rt,onActionCallback:Vn,hidetoolBar:ft,uuid:On.current,setOpenPhones:function(){fn.current=!0}}),f.a.createElement("div",{className:"markdown-editor-body"},f.a.createElement("div",{className:"codemirror-container"},f.a.createElement("textarea",{ref:xn,placeholder:Wr})),lr?f.a.createElement("div",{ref:zn,className:"preview-container"},rr==="stex"&&f.a.createElement(R,{value:yr}),rr!=="stex"&&f.a.createElement(i.a,{edit:!0,value:yr,replaces:Xi})):null))),yt?f.a.createElement("a",{ref:en,className:"editor-resize"}):null,f.a.createElement(J.a,null,Ae[cr]?f.a.createElement(h.a,{centered:!0,title:Ae[cr],visible:!0,onCancel:Rn,footer:null,className:"markdown-popup-form"},si):null))}},"P/tu":function(M,ne,N){"use strict";var I=N("ozfa"),h=N("MJZm"),S=N("0Owb"),L=N("9og8"),T=N("tJVT"),c=N("PpiC"),C=N("WmNS"),g=N.n(C),s=N("q1tI"),a=N.n(s),r=N("WCUW"),f=N("spXi"),p=N.n(f),m=function(y){var u=y.value,n=y.onChange,o=y.defaultValue,l=y.disabled,w=Object(c.a)(y,["value","onChange","defaultValue","disabled"]),v=Object(s.useState)([]),i=Object(T.a)(v,2),R=i[0],k=i[1],d=Object(s.useState)("1"),b=Object(T.a)(d,2),x=b[0],_=b[1];Object(s.useEffect)(function(){B()},[]);var B=function(){var J=Object(L.a)(g.a.mark(function $(){var z,V;return g.a.wrap(function(H){for(;;)switch(H.prev=H.next){case 0:return H.next=2,Object(r.A)({});case 2:z=H.sent,z!=null&&z.data&&(V=[{title:a.a.createElement("div",{title:"\u6839\u76EE\u5F55",className:p.a.name},"\u6839\u76EE\u5F55"),value:0,key:0,icon:a.a.createElement("i",{className:"iconfont icon-wenjianjia2 c-light-primary mr10",style:{lineHeight:"19px"}}),children:U(z.data||[])}],k(V),_("2"));case 4:case"end":return H.stop()}},$)}));return function(){return J.apply(this,arguments)}}(),U=function($){function z(V){var K=V.children,H=Array.isArray(K)&&K.length>0,G=V==null?void 0:V.group_id;return{title:a.a.createElement("div",{title:V==null?void 0:V.name,className:p.a.name},V==null?void 0:V.name),value:G,key:G,icon:a.a.createElement("i",{className:"iconfont icon-wenjianjia2 c-light-primary mr10",style:{lineHeight:"19px"}}),children:H?K==null?void 0:K.map(function(ie){return z(ie)}):[]}}return $==null?void 0:$.map(function(V){return z(V)})},P=o?{defaultExpandedKeys:[0]}:{selectedKeys:u,defaultExpandedKeys:u};return a.a.createElement("div",{className:p.a.customTree},a.a.createElement(h.a,Object(S.a)({key:x},P,{showIcon:!0,treeData:R,onSelect:n,disabled:l},w)))};ne.a=m},PD8m:function(M,ne){M.exports={name:"memoryStorage",read:I,write:h,each:S,remove:L,clearAll:T};var N={};function I(c){return N[c]}function h(c,C){N[c]=C}function S(c){for(var C in N)N.hasOwnProperty(C)&&c(N[C],C)}function L(c){delete N[c]}function T(c){N={}}},PHyj:function(M,ne,N){"use strict";N.r(ne),N.d(ne,"Types",function(){return gt});var I=N("P2fV"),h=N("NJEC"),S=N("CiB2"),L=N("DYRE"),T=N("zeV3"),c=N("7Kak"),C=N("9yH6"),g=N("sRBo"),s=N("kaz8"),a=N("giR+"),r=N("fyUT"),f=N("6UJt"),p=N("DFOY"),m=N("OaEy"),E=N("2fM7"),y=N("rAM+"),u=N("T2oS"),n=N("W9HT"),o=N("+L6B"),l=N("2/Rp"),w=N("oBTY"),v=N("miYZ"),i=N("tsqr"),R=N("9og8"),k=N("y8nQ"),d=N("Vl3Y"),b=N("tJVT"),x=N("k1fw"),_=N("fu2T"),B=N("gK9i"),U=N("2qtc"),P=N("kLXV"),J=N("5NDa"),$=N("5rEg"),z=N("WmNS"),V=N.n(z),K=N("q1tI"),H=N.n(K),G=N("uMZB"),ie=N.n(G),le=N("jrin"),ue,be=E.a.Option,Ce;(function(Ge){Ge[Ge.language=0]="language",Ge[Ge.difficult=1]="difficult",Ge[Ge.category=2]="category",Ge[Ge.openOrNot=3]="openOrNot"})(Ce||(Ce={}));var se=(ue={},Object(le.a)(ue,Ce.language,[{title:"C",key:"C"},{title:"C++",key:"C++"},{title:"Python",key:"Python"},{title:"Java",key:"Java"},{title:"JavaScript",key:"JavaScript"},{title:"Ruby",key:"Ruby"}]),Object(le.a)(ue,Ce.difficult,[{title:"\u7B80\u5355",key:1},{title:"\u4E2D\u7B49",key:2},{title:"\u56F0\u96BE",key:3}]),Object(le.a)(ue,Ce.category,[{title:"\u7A0B\u5E8F\u8BBE\u8BA1",key:1},{title:"\u7B97\u6CD5",key:2}]),Object(le.a)(ue,Ce.openOrNot,[{title:"\u516C\u5F00",key:1},{title:"\u79C1\u6709",key:0}]),ue);function ce(Ge){return se[Ge].map(function(lt){return H.a.createElement(be,{key:lt.title,value:lt.key}," ",lt.title," ")})}function he(Ge,lt){Ge.map(function(yt){var It=yt.id,Wt=yt.name,Ot=yt.sub_disciplines,Rt={value:It,label:Wt};lt.push(Rt),Ot&&Ot.length>0&&(Rt.children=[],he(Ot,Rt.children))})}function ae(Ge,lt){for(var yt=[],It=0;It<Ge.length;It++){var Wt,Ot=Ge[It];if(((Wt=Ot.sub_disciplines)===null||Wt===void 0?void 0:Wt.length)>0){yt[0]=Ot.id;for(var Rt=0;Rt<Ot.sub_disciplines.length;Rt++){var at=Ot.sub_disciplines[Rt];if(at.id===lt)return yt[1]=at.id,[yt,at.tag_disciplines||at.sub_disciplines||[]]}}}return[yt,[]]}var Q=N("Ty5D"),D=N("J66h"),F=N("GIiI"),W=N("2BaD"),Y=N("Ot1p"),Z=N("ErOA");function te(){return Object(Z.c)("problems/new.json")}function q(){var Ge=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"question";return Object(Z.c)("disciplines.json",{source:Ge})}function X(Ge){return Object(Z.c)("problems/".concat(Ge,"/edit.json"))}function re(Ge,lt){return Object(Z.g)("problems/".concat(Ge,".json"),lt)}function me(Ge){return Object(Z.f)("problems.json",Ge)}function ve(Ge,lt){return Object(Z.f)("exercises/".concat(Ge,"/exercise_questions.json"),lt)}function Te(Ge,lt){return Object(Z.g)("exercise_questions/".concat(Ge,".json"),lt)}function Re(Ge){return Object(Z.f)("problems/".concat(Ge,"/publish.json"))}function Ie(Ge){return Object(Z.f)("problems/".concat(Ge,"/cancel_publish.json"))}function je(Ge){return Object(Z.c)("problems/".concat(Ge,"/start.json"))}function Ne(Ge,lt){return Object(Z.f)("tag_disciplines.json",{name:lt,sub_discipline_id:Ge})}var We=N("V0Rq"),Be=N("cDPC"),He=N("EHPI"),De=N("bbsP"),Xe=N("/wGt"),$e=N("ZW9T"),we=N("ZD9Y"),fe=N("M8RZ"),pe=N("bCnd"),ye=N("b8wu"),_e=N.n(ye),xe=N("LvDl"),Se={theme:Object(pe.a)("cmCodeMode","vs-dark"),fontSize:Object(pe.a)("cmFontSize",14),showEditorSetting:!1,tabToSpace:Object(pe.a)("cmTabToSpace",!0)},Ae;(function(Ge){Ge[Ge.set_font_size=0]="set_font_size",Ge[Ge.set_theme=1]="set_theme",Ge[Ge.on_tab_to_space=2]="on_tab_to_space",Ge[Ge.set_show_editor_setting=3]="set_show_editor_setting"})(Ae||(Ae={}));function Oe(Ge,lt){switch(lt.type){case Ae.set_show_editor_setting:return Object(x.a)(Object(x.a)({},Ge),{},{showEditorSetting:lt.payload});case Ae.set_theme:return Object(x.a)(Object(x.a)({},Ge),{},{theme:lt.payload});case Ae.set_font_size:return Object(x.a)(Object(x.a)({},Ge),{},{fontSize:lt.payload});case Ae.on_tab_to_space:return Object(x.a)(Object(x.a)({},Ge),{},{tabToSpace:lt.payload});default:throw new Error}}var Le=function(Ge){var lt,yt=Ge.isLoading,It=Ge.value,Wt=It===void 0?[]:It,Ot=Ge.onChange,Rt=Object(K.useReducer)(Oe,Se),at=Object(b.a)(Rt,2),ft=at[0],zt=at[1],St=ft.theme,kt=ft.fontSize,Ut=ft.showEditorSetting,Nt=ft.tabToSpace,Xt=Object(K.useState)("c"),Je=Object(b.a)(Xt,2),bt=Je[0],kr=Je[1],wr=Object(K.useRef)([]);Object(K.useEffect)(function(){Wt!=null&&Wt.length&&(wr.current=Object(xe.cloneDeep)(Wt))},[Wt]);var Wr={onFontSizeChange:function(qt){zt({type:Ae.set_font_size,payload:qt}),Object(pe.b)("cmFontSize",qt)},tabToSpace:Nt,cmFontSize:kt,className:"oj",cmCodeMode:St,onTabToSpace:function(qt){zt({type:Ae.on_tab_to_space,payload:qt}),Object(pe.b)("cmTabToSpace",qt)},onCodeModeChange:function(qt){zt({type:Ae.set_theme,payload:qt}),Object(pe.b)("cmCodeMode",qt)}};function Mr(){zt({type:Ae.set_show_editor_setting,payload:!1})}function un(){zt({type:Ae.set_show_editor_setting,payload:!0})}function Dt(Ve){var qt,At=(qt=wr.current)===null||qt===void 0?void 0:qt.map(function(Sr){return Sr.language===bt&&(Sr.code=Ve),Sr});wr.current=Object(xe.cloneDeep)(At),Ot(At)}var vr={key:bt,value:Wt==null||((lt=Wt.find(function(Ve){return Ve.language===bt}))===null||lt===void 0)?void 0:lt.code,language:bt,onChange:Dt,theme:St,height:"calc(100% - 56px)",options:{fontSize:kt,insertSpaces:Nt}};return H.a.createElement(K.Fragment,null,H.a.createElement("div",{className:_e.a["code-panel-container"]},H.a.createElement(Me,{languageItems:Wt,onLanguage:function(qt){return kr(qt)},language:bt,onShowCodeSetting:un}),!yt&&H.a.createElement($e.b,vr)),H.a.createElement(fe.a,null,H.a.createElement(Xe.a,{className:"oj",title:null,placement:"right",closable:!1,visible:Ut,onClose:Mr},H.a.createElement(we.a,Wr))))};function Me(Ge){var lt=Ge.languageItems,yt=Ge.language,It=Ge.onShowCodeSetting,Wt=Ge.onLanguage;return H.a.createElement("div",{className:_e.a["action-oj-bar"]},H.a.createElement("span",null,"\u5B66\u5458\u521D\u59CB\u4EE3\u7801\u6587\u4EF6"),lt==null?void 0:lt.map(function(Ot){return H.a.createElement("div",{className:yt===(Ot==null?void 0:Ot.language)?_e.a.active:"",onClick:function(){return Wt(Ot==null?void 0:Ot.language)},key:Ot==null?void 0:Ot.language},Ot==null?void 0:Ot.language)}),H.a.createElement("a",{onClick:It},H.a.createElement("i",{className:"iconfont icon-shezhi"})))}var Ke=N("m3rI"),Qe=N("u2Z1"),Ye=N("P/tu"),nt=N("B7Ph"),pt=N("vCeJ"),st=N("hQp1"),tt=$.a.TextArea,Pt=P.a.confirm,wt=B.a.Panel;function Vt(){return new Date().getTime()}var Bt={loading:!0,user:null,disciplines:[],dicts:null,status:0,data:void 0,lastedUpdateTime:0},gt;(function(Ge){Ge[Ge.SET_INITAL_DATA=0]="SET_INITAL_DATA",Ge[Ge.SET_LOADING=1]="SET_LOADING",Ge[Ge.SET_STATUS=2]="SET_STATUS"})(gt||(gt={}));function xt(Ge,lt){switch(lt.type){case gt.SET_INITAL_DATA:return Object(x.a)(Object(x.a)({},Ge),lt.payload);case gt.SET_LOADING:return Object(x.a)(Object(x.a)({},Ge),{},{loading:lt.payload});case gt.SET_STATUS:return Object(x.a)(Object(x.a)({},Ge),{},{status:lt.payload});default:throw new Error}}var rr=ne.default=function(){var Ge,lt,yt=Object(Q.h)(),It=Object(Q.g)(),Wt=Object(Q.i)(),Ot=Wt.id,Rt=d.a.useForm(),at=Object(b.a)(Rt,1),ft=at[0],zt=Object(K.useState)(),St=Object(b.a)(zt,2),kt=St[0],Ut=St[1],Nt=Object(K.useState)([]),Xt=Object(b.a)(Nt,2),Je=Xt[0],bt=Xt[1],kr=Object(K.useState)([]),wr=Object(b.a)(kr,2),Wr=wr[0],Mr=wr[1],un=Object(K.useReducer)(xt,Bt),Dt=Object(b.a)(un,2),vr=Dt[0],Ve=Dt[1],qt=vr.loading,At=vr.data,Sr=vr.user,yr=vr.disciplines,Hr=vr.dicts,Nr=vr.status,jr=At==null?void 0:At.hack_sets,lr=At==null||((Ge=At.hack)===null||Ge===void 0)?void 0:Ge.test_set_average,Yr=yt.query,ur=Yr.callback_url,qr=Yr.express_id,Fr=Yr.score,In=Yr.question_id,Kn=Yr.type,Mn=Object(K.useState)([]),cr=Object(b.a)(Mn,2),cn=cr[0],oi=cr[1],bn=Object(K.useState)(!1),Dr=Object(b.a)(bn,2),br=Dr[0],Zt=Dr[1],dr=Object(K.useState)(!1),xr=Object(b.a)(dr,2),dn=xr[0],Gn=xr[1],hn=Kn==="1",Vi=Object(K.useMemo)(function(){var it=[];return yr&&he(yr,it),it},[yr]),Nn=Object(K.useCallback)(Object(R.a)(V.a.mark(function it(){var qe,rt,ht,Ct,et,jt,ut,Yt,Qt,ar,hr,$r,fr,$t,ci,wn,rn,Xn,Fn,di,mn,gn,Yn,Ln,$n,Bn,Yi,Ft,er,Un,hi,vn,nn,Sn,fi,$i,Ti,Ji,Zi,_i,an,Jr,Qi,Jn,Cn,xa,Ea,Ai,yn,Zn,Oi,ki=arguments;return V.a.wrap(function(Lr){for(;;)switch(Lr.prev=Lr.next){case 0:if(qe=ki.length>0&&ki[0]!==void 0?ki[0]:0,rt=yr,!(rt.length===0)){Lr.next=7;break}return Lr.next=5,q("new_question");case 5:ht=Lr.sent,rt=ht.disciplines;case 7:if(!Ot){Lr.next=15;break}return Ct={disciplines:rt},Lr.next=11,X(Ot);case 11:et=Lr.sent,et.message?et.status==="401"&&(document.location.href="/user/login"):(jt=et.category,ut=et.user,Yt=et.code,Qt=et.language,ar=et.hack_sets,hr=et.description,$r=et.difficult,fr=et.name,$t=et.open_or_not,ci=et.sub_discipline_id,wn=et.tag_discipline_id,rn=et.time_limit,Xn=et.test_set_average,Fn=et.test_set_score,di=et.status,mn=et.tag_discipline_ids,gn=et.item_banks_group_id,Yn=et.is_file,Ln=Yn===void 0?!1:Yn,$n=et.hide_actual_output,Bn=et.code_compile_score,Yi=et.languages,Ft=et.is_my,er=et.codes,Un=ae(rt,ci),hi=Object(b.a)(Un,2),vn=hi[0],nn=hi[1],Zt($n),Sn=Ln?[{input:"",output:"",score:100,position:1}]:ar,Ln?(Mr(ar),ft.setFieldsValue({hack_sets:Sn})):Mr([]),fi=yt.query.lastedUpdateTime,$i=er==null?void 0:er.map(function(on){return Object(x.a)(Object(x.a)({},on),{},{code:D.Base64.decode(on==null?void 0:on.code)})}),Ct=Object(x.a)(Object(x.a)({},Ct),{},{loading:!1,user:ut,dicts:nn,status:di,lastedUpdateTime:qe||(fi||0),data:{hack_codes:{language:Qt,code:D.Base64.decode(Yt)},hack:{category:jt,difficult:$r,name:fr,description:hr,open_or_not:$t,time_limit:rn,test_set_average:Xn,test_set_score:Fn,sub_discipline_id:vn,tag_discipline_ids:mn,languages:Yi,score:Fr||1,item_banks_group_ids:gn,is_file:Ln,is_my:Ft,code_compile_score:Bn},hack_sets:Sn,tags:mn,codes:$i}}),parseInt(Bn)>0&&Gn(!0),Ve({type:gt.SET_INITAL_DATA,payload:Ct}),Ut({hack:{category:jt,difficult:$r,name:fr,description:hr,open_or_not:$t,time_limit:rn,test_set_average:Xn,test_set_score:Fn,sub_discipline_id:vn,tag_discipline_ids:mn,score:Fr||1,item_banks_group_ids:gn,is_file:Ln},codes:$i}),On(vn==null?void 0:vn[0],vn==null?void 0:vn[1],rt)),Lr.next=25;break;case 15:return Lr.next=17,te();case 17:Zi=Lr.sent,_i=Zi.user,an=yt.query,Jr=an.difficult,Qi=an.sub_discipline_id,Jn=an.tag_discipline_id,Cn=an.tagIds,xa=an.banksIds,Ea=ae(rt,parseInt(Qi,10)),Ai=Object(b.a)(Ea,2),yn=Ai[0],Zn=Ai[1],Oi=[Number(xa)],Ve({type:gt.SET_INITAL_DATA,payload:{loading:!1,user:_i,disciplines:rt,status:0,dicts:Zn,data:{hack_codes:{language:"C",code:""},hack:{category:null,difficult:parseInt(Jr,10),time_limit:3,description:"",test_set_score:!0,test_set_average:!0,open_or_not:!0,sub_discipline_id:yn,tag_discipline_id:Cn&&(Cn==null||((Ti=Cn.split(","))===null||Ti===void 0)?void 0:Ti.map(function(on){return Number(on)})),name:"",item_banks_group_ids:Oi,is_file:!1},tags:Jn?Jn==null?void 0:Jn.split(",").map(function(on){return parseInt(on,10)}):[],hack_sets:[{input:"",output:"",score:100,position:1}]}}}),Ut({hack:{category:null,difficult:parseInt(Jr,10),time_limit:3,description:"",test_set_average:!0,open_or_not:!0,sub_discipline_id:yn,tag_discipline_id:Cn&&(Cn==null||((Ji=Cn.split(","))===null||Ji===void 0)?void 0:Ji.map(function(on){return Number(on)})),name:"",item_banks_group_id:Oi,is_file:!1}}),On(yn==null?void 0:yn[0],yn==null?void 0:yn[1],rt);case 25:case"end":return Lr.stop()}},it)})),[Ot,yr]);Object(K.useEffect)(function(){try{Nn()}catch(it){console.log(it,"----")}},[]),Object(K.useEffect)(function(){function it(){return qe.apply(this,arguments)}function qe(){return qe=Object(R.a)(V.a.mark(function rt(){var ht;return V.a.wrap(function(et){for(;;)switch(et.prev=et.next){case 0:return et.next=2,Object(Z.c)("item_banks_groups/mine.json");case 2:ht=et.sent,oi(ht);case 4:case"end":return et.stop()}},rt)})),qe.apply(this,arguments)}it()},[]);var On=function(qe,rt,ht){var Ct,et,jt,ut=ht==null||((Ct=ht.find(function(Yt){return Yt.id===qe}))===null||Ct===void 0||((et=Ct.sub_disciplines)===null||et===void 0||((jt=et.find(function(Yt){return Yt.id===rt}))===null||jt===void 0)))?void 0:jt.tag_disciplines};function fn(it,qe,rt){return kn.apply(this,arguments)}function kn(){return kn=Object(R.a)(V.a.mark(function it(qe,rt,ht){var Ct,et,jt,ut,Yt,Qt,ar,hr,$r,fr,$t,ci,wn,rn,Xn,Fn,di,mn,gn,Yn,Ln,$n,Bn;return V.a.wrap(function(Ft){for(;;)switch(Ft.prev=Ft.next){case 0:Ct=Object(x.a)({},qe),et=Ct.hack_sets,jt=Ct.hack_codes,ut=Ct.hack,Yt=Ct.tags,Qt=Ct.codes,ut.hide_actual_output=br,ar=[],hr=[],$r=0,fr=ut!=null&&ut.is_file?Wr.map(function(er,Un){return Object(x.a)(Object(x.a)({},er),{},{position:Un+1})}):et.map(function(er){return Object(x.a)(Object(x.a)({},er),{},{is_file:!1})}),$t=Object(y.a)(fr);try{for($t.s();!(ci=$t.n()).done;)wn=ci.value,$r+=wn.score,wn.id&&wn.id>=0?ar.push(wn):hr.push(wn)}catch(er){$t.e(er)}finally{$t.f()}if(fr!=null&&fr.length){Ft.next=11;break}return i.b.error("\u6D4B\u8BD5\u96C6\u4E0D\u80FD\u4E3A\u7A7A"),Ft.abrupt("return");case 11:if($r+=parseInt(ut.code_compile_score||0),!($r!==100&&!ut.test_set_score)){Ft.next=15;break}return i.b.error("\u6D4B\u8BD5\u96C6\u7684\u8BC4\u5206\u5360\u6BD4\u4E4B\u548C\u5FC5\u987B\u7B49\u4E8E100"),Ft.abrupt("return");case 15:if(!(fr!=null&&fr.some(function(er){return!er.output}))){Ft.next=18;break}return i.b.error("\u6D4B\u8BD5\u96C6\u8F93\u51FA\u4E0D\u80FD\u4E3A\u7A7A"),Ft.abrupt("return");case 18:if(rn={},hn?Qt==null||Qt.forEach(function(er){rn[er.language]=er!=null&&er.code?D.Base64.encode(er==null?void 0:er.code):""}):jt.code=D.Base64.encode(jt==null?void 0:jt.code),ut.sub_discipline_id=ut.sub_discipline_id[1],Ve({type:gt.SET_LOADING,payload:!0}),ur||(ut.score=ut.difficult*100),!Ot){Ft.next=49;break}return Ft.next=26,re(Ot,{hack:ut,hack_codes:jt,hack_sets:hr,update_hack_sets:ar,tags:Yt,is_cover:ht,languages:ut.languages,codes:rn});case 26:if(!ur){Ft.next=45;break}return Ft.next=29,Re(Ot);case 29:if(!ur.includes("paperlibrary")){Ft.next=35;break}return Ft.next=32,Object(pt.f)({id:qr,question_id:In,item_type:st.a.Program,name:ut.name,question_score:ut.score,difficulty:ut.difficult,sub_discipline_id:ut.sub_discipline_id,tag_discipline_ids:ut.tag_discipline_ids,item_banks_group_ids:ut.item_banks_group_ids});case 32:return Xn=Ft.sent,Xn.status===0&&It.replace(ur),Ft.abrupt("return");case 35:return Ft.next=37,Te(In,{question_type:6,question_score:ut.score,question_title:ut.name,description:ut.description,sub_discipline_id:ut.sub_discipline_id,tag_discipline_ids:ut.tag_discipline_ids,item_banks_group_ids:ut.item_banks_group_ids,identifier:Ot});case 37:if(Fn=Ft.sent,di=Fn.status,!(di===0)){Ft.next=43;break}if(!(rt==="start")){Ft.next=42;break}return Ft.abrupt("return");case 42:It.replace(ur);case 43:Ft.next=46;break;case 45:Nn(Vt());case 46:Ve({type:gt.SET_LOADING,payload:!1}),Ft.next=79;break;case 49:return Ft.next=51,me({hack:ut,hack_codes:jt,hack_sets:fr,tags:Yt,examination_bank_id:qr||null});case 51:if(mn=Ft.sent,gn=mn.identifier,Yn=mn.exam_identifier,Ve({type:gt.SET_LOADING,payload:!1}),!(rt==="start")){Ft.next=57;break}return Ft.abrupt("return");case 57:if(!gn){Ft.next=79;break}if(ur){Ft.next=62;break}It.replace("/problems/".concat(gn,"/edit?lastedUpdateTime=").concat(Vt())),Ft.next=79;break;case 62:return Ft.next=64,Re(gn);case 64:if(Ot){Ft.next=78;break}if(!ur.includes("paperlibrary")){Ft.next=71;break}return Ft.next=68,Object(pt.f)({id:qr,item_type:st.a.Program,name:ut.name,question_score:ut.score,difficulty:ut.difficult,sub_discipline_id:ut.sub_discipline_id,tag_discipline_ids:ut.tag_discipline_ids,identifier:Yn});case 68:return Ln=Ft.sent,Ln.status===0&&It.replace(ur),Ft.abrupt("return");case 71:return Ft.next=73,ve(parseInt(qr,10),{question_type:6,question_score:ut.score,question_title:ut.name,identifier:gn,tag_discipline_ids:ut.tag_discipline_ids});case 73:$n=Ft.sent,Bn=$n.status,Bn===0&&It.replace(ur),Ft.next=79;break;case 78:It.replace(ur);case 79:case"end":return Ft.stop()}},it)})),kn.apply(this,arguments)}function xn(){ft.submit(),setTimeout(Object(R.a)(V.a.mark(function it(){var qe;return V.a.wrap(function(ht){for(;;)switch(ht.prev=ht.next){case 0:return ht.next=2,Re(Ot);case 2:qe=ht.sent,qe.status===0?(i.b.success("\u53D1\u5E03\u6210\u529F"),Ve({type:gt.SET_STATUS,payload:1})):i.b.info(qe.message);case 4:case"end":return ht.stop()}},it)})),400)}function En(){return en.apply(this,arguments)}function en(){return en=Object(R.a)(V.a.mark(function it(){var qe;return V.a.wrap(function(ht){for(;;)switch(ht.prev=ht.next){case 0:return ht.next=2,Ie(Ot);case 2:qe=ht.sent,qe.status===0?(i.b.success("\u64A4\u9500\u53D1\u5E03\u6210\u529F"),Ve({type:gt.SET_STATUS,payload:0})):i.b.info(qe.message);case 4:case"end":return ht.stop()}},it)})),en.apply(this,arguments)}function zn(){Nr===0?Pt({title:"\u63D0\u793A",content:H.a.createElement(K.Fragment,null," ",H.a.createElement("div",null,"\u53D1\u5E03\u540E\u5373\u53EF\u5E94\u7528\u5230\u81EA\u5DF1\u7BA1\u7406\u7684\u8BFE\u5802")," ",H.a.createElement("div",null," \u662F\u5426\u786E\u8BA4\u53D1\u5E03?")," "),okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:function(){xn()}}):Pt({title:"\u63D0\u793A",content:H.a.createElement("p",null,"\u662F\u5426\u786E\u8BA4\u64A4\u9500\u53D1\u5E03\uFF1F"),okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:function(){En()}})}function Si(){return Rr.apply(this,arguments)}function Rr(){return Rr=Object(R.a)(V.a.mark(function it(){return V.a.wrap(function(rt){for(;;)switch(rt.prev=rt.next){case 0:return rt.t0=fn,rt.next=3,ft.getFieldValue();case 3:rt.t1=rt.sent,(0,rt.t0)(rt.t1,"start"),setTimeout(Object(R.a)(V.a.mark(function ht(){var Ct,et;return V.a.wrap(function(ut){for(;;)switch(ut.prev=ut.next){case 0:return ut.next=2,je(Ot);case 2:Ct=ut.sent,et=Ct.identifier,hn?window.location.href="/myproblems/".concat(et,"?type=1"):window.location.href="/myproblems/".concat(et);case 5:case"end":return ut.stop()}},ht)})),400);case 6:case"end":return rt.stop()}},it)})),Rr.apply(this,arguments)}function Vn(){if(ur)It.replace(ur);else if(hn){var it,qe=(it=localStorage.getItem("program_homework"))===null||it===void 0?void 0:it.split(",");It.push("/classrooms/".concat(qe==null?void 0:qe[0],"/program_homework/").concat(qe==null?void 0:qe[1],"/detail"))}else It.replace("/problemset")}var Dn=function(qe){var rt=parseInt(ft.getFieldValue("hack").code_compile_score)||0,ht=Math.floor((100-rt)/qe.length),Ct=ht+(100-rt)%qe.length;qe=qe.map(function(et,jt){return jt===qe.length-1?Object(x.a)(Object(x.a)({},et),{},{score:Ct}):Object(x.a)(Object(x.a)({},et),{},{score:ht})}),Mr(qe)};function si(it){it.target.value||Dn(Wr),Ve({type:gt.SET_INITAL_DATA,payload:{data:Object(x.a)(Object(x.a)({},At),{},{hack:Object(x.a)(Object(x.a)({},At.hack),{},{test_set_score:it.target.value})})}})}function Rn(it){Ve({type:gt.SET_INITAL_DATA,payload:{data:Object(x.a)(Object(x.a)({},At),{},{hack:Object(x.a)(Object(x.a)({},At.hack),{},{is_file:it.target.value})})}})}function pn(it){Zt(it.target.checked)}function li(it){var qe=it.target.value;qe&&Dn(Wr),Ve({type:gt.SET_INITAL_DATA,payload:{data:Object(x.a)(Object(x.a)({},At),{},{hack:Object(x.a)(Object(x.a)({},At.hack),{},{test_set_average:qe})})}})}function tn(){var it=ft.getFieldValue("hack_sets"),qe=parseInt(ft.getFieldValue("hack").code_compile_score)||0,rt=it.length+1,ht=Math.floor((100-qe)/rt),Ct=(100-qe)%rt;it.map(function(et,jt){return lr&&(et.score=ht),et.position=jt+1,et}),it.push({input:"",output:"",position:rt,score:lr?ht+Ct:0}),ft.setFieldsValue({hack_sets:it}),Ve({type:gt.SET_INITAL_DATA,payload:{data:Object(x.a)(Object(x.a)({},At),{},{hack_sets:it})}})}function ui(){var it=ft.getFieldValue("hack_sets"),qe=parseInt(ft.getFieldValue("hack").code_compile_score)||0,rt=it.length,ht=Math.floor((100-qe)/rt),Ct=(100-qe)%rt;it.map(function(et,jt){return lr&&(et.score=ht,jt===it.length-1&&(et.score=ht+Ct)),et.position=jt+1,et}),ft.setFieldsValue({hack_sets:it}),Ve({type:gt.SET_INITAL_DATA,payload:{data:Object(x.a)(Object(x.a)({},At),{},{hack_sets:it})}})}Object(K.useEffect)(function(){if(lr){var it=parseInt(ft.getFieldValue("hack").code_compile_score)||0,qe=jr==null?void 0:jr.length,rt=Math.floor((100-it)/qe),ht=(100-it)%qe;jr==null||jr.map(function(Ct,et){return Ct.score=rt,Ct.position=et+1,et===qe-1&&(Ct.score=rt+ht),Ct}),Ve({type:gt.SET_INITAL_DATA,payload:{data:Object(x.a)(Object(x.a)({},At),{},{hack_sets:jr})}}),ft.setFieldsValue({hack_sets:jr})}},[lr]);function Ci(it){var qe=ft.getFieldValue("hack_sets"),rt=parseInt(ft.getFieldValue("hack").code_compile_score)||0,ht=(qe==null?void 0:qe.length)-1,Ct=Math.floor((100-rt)/ht),et=(100-rt)%ht;qe.splice(it,1),qe==null||qe.map(function(jt,ut){return lr&&(jt.score=Ct,ut===ht-1&&(jt.score=Ct+et)),jt.position=ut+1,jt}),Ve({type:gt.SET_INITAL_DATA,payload:{data:Object(x.a)(Object(x.a)({},At),{},{hack_sets:qe})}}),ft.setFieldsValue({hack_sets:qe})}function jn(it){Ve({type:gt.SET_INITAL_DATA,payload:{data:Object(x.a)(Object(x.a)({},At),{},{hack_codes:Object(x.a)(Object(x.a)({},At.hack_codes),{},{language:it})})}})}var Xi=function(qe){var rt;if(qe!=null&&(rt=qe.hack)!==null&&rt!==void 0&&rt.sub_discipline_id){var ht,Ct,et,jt,ut,Yt=qe==null||((ht=qe.hack)===null||ht===void 0)?void 0:ht.sub_discipline_id,Qt=Object(b.a)(Yt,2),ar=Qt[0],hr=Qt[1],$r=yr==null||((Ct=yr.find(function($t){return $t.id===ar}))===null||Ct===void 0||((et=Ct.sub_disciplines)===null||et===void 0||((jt=et.find(function($t){return $t.id===hr}))===null||jt===void 0)))?void 0:jt.tag_disciplines,fr=Object(x.a)(Object(x.a)({},ft.getFieldsValue()),{},{hack:Object(x.a)(Object(x.a)({},(ut=ft.getFieldsValue())===null||ut===void 0?void 0:ut.hack),{},{tag_discipline_ids:[]})});ft.setFieldsValue(fr),Ut(fr)}else Ut(Object(x.a)({},ft.getFieldsValue()))},Et=function(qe){bt([].concat(Object(w.a)(Je),[Object(x.a)({},qe)]))};Object(K.useEffect)(function(){var it,qe;if(At!=null&&(it=At.hack)!==null&&it!==void 0&&(qe=it.sub_discipline_id)!==null&&qe!==void 0&&qe[1]){var rt,ht;Mt(At==null||((rt=At.hack)===null||rt===void 0||((ht=rt.sub_discipline_id)===null||ht===void 0))?void 0:ht[1])}},[At==null||((lt=At.hack)===null||lt===void 0)?void 0:lt.sub_discipline_id]);var Mt=function(){var it=Object(R.a)(V.a.mark(function qe(rt){var ht;return V.a.wrap(function(et){for(;;)switch(et.prev=et.next){case 0:return et.next=2,Object(We.I)({sub_discipline_id:rt});case 2:ht=et.sent,bt(ht.tag_disciplines);case 4:case"end":return et.stop()}},qe)}));return function(rt){return it.apply(this,arguments)}}();function _t(it){var qe=it[1],rt=ae(yr,qe),ht=Object(b.a)(rt,2),Ct=ht[1];ft.setFieldsValue({tags:[]}),Ve({type:gt.SET_INITAL_DATA,payload:{dicts:Ct,data:Object(x.a)(Object(x.a)({},At),{},{hack:Object(x.a)(Object(x.a)({},At.hack),{},{sub_discipline_id:it}),tags:[]})}})}var Ht=function(qe){var rt,ht,Ct=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(Ct)return function(){Ve({type:gt.SET_INITAL_DATA,payload:{data:Object(x.a)(Object(x.a)({},At),{},{hack:Object(x.a)(Object(x.a)({},At.hack),{},{is_file:!0})})}}),ft.setFieldsValue({hack:{is_file:!0}})};var et=qe==null?void 0:qe.map(function(hr){return{input:hr.input,output:hr.output,score:0,position:1}}),jt=(rt=ft.getFieldValue("hack_sets"))===null||rt===void 0||((ht=rt.filter(function(hr){return hr.input||hr.output}))===null||ht===void 0)?void 0:ht.concat(et),ut=parseInt(ft.getFieldValue("hack").code_compile_score)||0,Yt=jt==null?void 0:jt.length,Qt=Math.floor((100-ut)/Yt),ar=(100-ut)%Yt;jt==null||jt.map(function(hr,$r){return lr&&(hr.score=Qt,$r===Yt-1&&(hr.score=Qt+ar)),hr.position=$r+1,hr}),Ve({type:gt.SET_INITAL_DATA,payload:{data:Object(x.a)(Object(x.a)({},At),{},{hack_sets:jt,hack:Object(x.a)(Object(x.a)({},At.hack),{},{is_file:!1})})}}),ft.setFieldsValue({hack_sets:jt,hack:{is_file:!1}})};return H.a.createElement(n.a,{spinning:qt,delay:500},At?H.a.createElement(K.Fragment,null,H.a.createElement("header",{className:ie.a.header},H.a.createElement("div",null,H.a.createElement("img",{src:"".concat(Ke.a.IMG_SERVER,"/images/").concat(Sr==null?void 0:Sr.image_url),alt:"user",width:30}),H.a.createElement("span",null,Sr==null?void 0:Sr.name)),H.a.createElement("h2",null," ",At==null?void 0:At.hack.name," "),Ot?H.a.createElement("a",{className:ie.a.btn_back,onClick:Vn}," ",H.a.createElement(F.a,null),"\u9000\u51FA"):null),H.a.createElement(d.a,{form:ft,initialValues:At,layout:"vertical",className:ie.a["oj-form-container"],onValuesChange:Xi,onFinish:function(qe,rt){var ht;if(yt!=null&&(ht=yt.query)!==null&&ht!==void 0&&ht.exercise&&!ur.includes("paperlibrary")){P.a.confirm({title:"\u4FDD\u5B58\u63D0\u793A",content:"\u6B64\u9898\u76EE\u5DF2\u5B58\u5728\u8BD5\u9898\u5E93\u4E2D\uFF0C\u662F\u5426\u5C06\u4FEE\u6539\u540E\u7684\u8BD5\u9898\u8986\u76D6\u8BD5\u9898\u5E93\u7684\u539F\u9898\uFF1F",okText:"\u8986\u76D6\u539F\u9898",cancelText:"\u4E0D\u8986\u76D6",onOk:function(){return fn(qe,rt,1)},onCancel:function(){return fn(qe,rt,0)}});return}fn(qe,rt)}},H.a.createElement(Be.a,{leftChild:H.a.createElement(Gt,{onAddTestCases:ui,form:ft,handleAddKnowledgeFinish:Et,MyGroup:cn,formValue:kt,knowledgeOptions:Je,onChangeLanguage:jn,onChangeSubDiscipline:_t,onRemoveTestCase:Ci,onAddTestCase:tn,dicts:Hr,categorys:Vi,callback_url:ur,hack:At.hack,onChangeScore:si,onChangehide:pn,onChangeAverage:li,onChangeFile:Rn,uploadData:Wr,setUploadData:Mr,handleUploadRatio:Dn,ischecked:br,isshows:dn,isProgram:hn,addUploadFnc:Ht,id:Ot}),rightChild:hn?H.a.createElement(d.a.Item,{name:"codes",style:{marginBottom:0}},H.a.createElement(Le,null)):H.a.createElement(d.a.Item,{name:["hack_codes","code"],style:{marginBottom:0}},H.a.createElement(He.a,{language:At.hack_codes.language}))}),H.a.createElement("div",{className:ie.a.footer},Ot?H.a.createElement(K.Fragment,null,hn&&H.a.createElement(l.a,{onClick:Vn,type:"primary",ghost:!0},"\u9000\u51FA\u7F16\u8F91"),ur||hn?null:H.a.createElement(l.a,{type:Nr?"default":"primary",onClick:zn},Nr?"\u64A4\u9500\u53D1\u5E03":"\u7ACB\u5373\u53D1\u5E03"),H.a.createElement(l.a,{loading:qt,type:"primary",htmlType:"submit"},"\u4FDD\u5B58"),H.a.createElement(l.a,{type:"primary",onClick:Si},Nr?"\u5F00\u59CB\u6311\u6218":"\u6A21\u62DF\u6311\u6218")):H.a.createElement(K.Fragment,null,H.a.createElement(l.a,{onClick:Vn},"\u53D6\u6D88"),H.a.createElement(l.a,{loading:qt,type:"primary",htmlType:"submit"},"\u4FDD\u5B58"))))):null)};function Gt(Ge){var lt,yt,It,Wt,Ot=Ge.form,Rt=Ge.onAddTestCases,at=Ge.handleAddKnowledgeFinish,ft=Ge.ischecked,zt=Ge.MyGroup,St=Ge.formValue,kt=Ge.knowledgeOptions,Ut=Ge.categorys,Nt=Ge.hack,Xt=Ge.callback_url,Je=Ge.onChangeAverage,bt=Ge.onChangeScore,kr=Ge.onChangehide,wr=Ge.onChangeFile,Wr=Ge.onAddTestCase,Mr=Ge.onRemoveTestCase,un=Ge.onChangeSubDiscipline,Dt=Ge.onChangeLanguage,vr=Ge.uploadData,Ve=Ge.setUploadData,qt=Ge.handleUploadRatio,At=Ge.isshows,Sr=Ge.isProgram,yr=Ge.addUploadFnc,Hr=Ge.id,Nr=((lt=location)===null||lt===void 0||((yt=lt.search)===null||yt===void 0)?void 0:yt.includes("select"))||!1,jr=Object(K.useState)(At),lr=Object(b.a)(jr,2),Yr=lr[0],ur=lr[1],qr=Nt.test_set_average,Fr=Nt.test_set_score,In=Object(K.useState)(!1),Kn=Object(b.a)(In,2),Mn=Kn[0],cr=Kn[1],cn=function(Zt,dr){var xr=Object(w.a)(vr);xr.splice(dr,1),qr?qt(xr):Ve(xr)},oi=function(Zt,dr){console.log(Zt,dr);var xr=vr.map(function(dn,Gn){return Gn===dr?Object(x.a)(Object(x.a)({},dn),{},{score:Zt.target.value?Number(Zt.target.value):0}):dn});Ve(xr)},bn=function(Zt){if(!(Zt!=null&&Zt.length))return;if(Zt!=null&&Zt[0].is_file){yr(Zt,!0)();var dr=vr.concat(Zt);Nt.test_set_average?qt(dr):Ve(dr)}Zt!=null&&Zt[0].is_file||yr(Zt)};function Dr(br){br.stopPropagation()}return H.a.createElement("div",{className:ie.a["oj-left-panel"]},H.a.createElement("div",{className:ie.a["oj-form-info"]},H.a.createElement("div",{className:ie.a.field},H.a.createElement(d.a.Item,{label:"\u96BE\u6613\u5EA6",name:["hack","difficult"],rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u96BE\u6613\u5EA6"}]},H.a.createElement(E.a,{disabled:Nr},ce(Ce.difficult))),H.a.createElement(d.a.Item,{label:"\u8BFE\u7A0B(\u5408\u7406\u7684\u8BFE\u7A0B\u5206\u7C7B\u6709\u5229\u4E8E\u5FEB\u901F\u68C0\u7D22)",name:["hack","sub_discipline_id"],rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u8BFE\u7A0B"}]},H.a.createElement(p.a,{disabled:Nr,allowClear:!1,options:Ut,placeholder:"\u8BF7\u9009\u62E9",onChange:un}))),H.a.createElement("div",{className:ie.a.field},Xt&&H.a.createElement(d.a.Item,{label:"\u5206\u6570",name:["hack","score"],rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5206\u6570"}],extra:H.a.createElement("span",{style:{position:"absolute",left:100,top:5}},"\u5206")},H.a.createElement(r.a,{disabled:Nr,min:1,max:100})),H.a.createElement(d.a.Item,{label:H.a.createElement("div",null,"\u8BC4\u6D4B\u65F6\u957F\u9650\u5236"," ",H.a.createElement("span",{className:"c-grey-999"},"(\u4EE3\u7801\u6267\u884C\u6240\u5141\u8BB8\u7684\u6700\u5927\u65F6\u957F)")),name:["hack","time_limit"],rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u8BC4\u6D4B\u65F6\u957F\u9650\u5236"},{type:"number",min:3,message:"\u6700\u5C0F\u9650\u5236\u65F6\u95F4\u662F3\u79D2"}],extra:H.a.createElement("span",{style:{position:"absolute",left:100,top:5}},"\u79D2")},H.a.createElement(r.a,{min:3})),Sr?H.a.createElement(d.a.Item,{label:"\u7F16\u7A0B\u8BED\u8A00",name:["hack","languages"],rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u7F16\u7A0B\u8BED\u8A00"}]},H.a.createElement(s.a.Group,null,H.a.createElement(s.a,{value:"c"},"C"),H.a.createElement(s.a,{value:"c++"},"C++"),H.a.createElement(s.a,{value:"java"},"Java"),H.a.createElement(s.a,{value:"python"},"Python"))):H.a.createElement(d.a.Item,{label:"\u7F16\u7A0B\u8BED\u8A00",name:["hack_codes","language"],rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u7F16\u7A0B\u8BED\u8A00"}]},H.a.createElement(E.a,{onChange:Dt},ce(Ce.language)))),H.a.createElement(d.a.Item,{label:H.a.createElement("span",null,"\u77E5\u8BC6\u70B9\uFF1A",H.a.createElement("span",{className:"c-grey-999"},"\uFF08\u6240\u6709\u81EA\u5EFA\u77E5\u8BC6\u70B9\u4EC5\u672C\u4EBA\u53EF\u89C1\uFF0C\u88ABEduCoder\u5E73\u53F0\u5BA1\u6838\u901A\u8FC7\u4E3A\u5B98\u65B9\u77E5\u8BC6\u70B9\u540E\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09")),name:["hack","tag_discipline_ids"]},H.a.createElement(Qe.a,{selectvalues:(Nt==null?void 0:Nt.tag_discipline_id)||(Nt==null?void 0:Nt.tag_discipline_ids),disabled:Nr,subId:St==null||((It=St.hack)===null||It===void 0||((Wt=It.sub_discipline_id)===null||Wt===void 0))?void 0:Wt[1],knowledgeOptions:kt,onAddKnowledgeFinish:at})),H.a.createElement(d.a.Item,{label:"\u52A0\u5165\u6587\u4EF6\u5939\u76EE\u5F55",name:["hack","item_banks_group_ids"],labelCol:{span:24},wrapperCol:{span:24}},H.a.createElement(Ye.a,{disabled:Nr})),H.a.createElement(d.a.Item,{label:"\u4EFB\u52A1\u540D\u79F0",name:["hack","name"],rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EFB\u52A1\u540D\u79F0"}]},H.a.createElement($.a,{maxLength:60,placeholder:"\u8BF7\u8F93\u5165\u4EFB\u52A1\u540D\u79F0",suffix:H.a.createElement("span",null,60-Nt.name.length)})),H.a.createElement(d.a.Item,{name:["hack","description"],valuePropName:"defaultValue",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u63CF\u8FF0\u5185\u5BB9"}]},H.a.createElement(Y.a,{miniToolbar:!0,id:"moop_cases_content",noStorage:!0,height:200})),H.a.createElement("div",{className:"tst-case-info"},H.a.createElement("h3",{className:"flex-container",style:{justifyContent:"space-between"}}," ","\u6D4B\u8BD5\u7528\u4F8B\u4E0E\u7CFB\u7EDF\u8BC4\u5206\u89C4\u5219",!Nt.is_file&&H.a.createElement(l.a,{type:"primary",ghost:!0,onClick:Wr},"\u6DFB\u52A0\u6D4B\u8BD5\u7528\u4F8B")),H.a.createElement(d.a.Item,{name:["hack","test_set_score"]},H.a.createElement(C.a.Group,{onChange:bt},H.a.createElement(C.a,{value:!0},"\u901A\u8FC7\u5168\u90E8\u6D4B\u8BD5\u96C6",H.a.createElement("span",{className:"tip"}," ","\uFF08\u5B66\u5458\u8BC4\u6D4B\uFF0C\u4EC5\u5F53\u6240\u6709\u6D4B\u8BD5\u96C6\u90FD\u6B63\u786E\u65F6\uFF0C\u624D\u83B7\u5F97\u4E00\u6B21\u6027\u5956\u52B1\uFF09")),H.a.createElement(C.a,{value:!1},"\u901A\u8FC7\u90E8\u5206\u6D4B\u8BD5\u96C6",H.a.createElement("span",{className:"tip"}," ","\uFF08\u5B66\u5458\u8BC4\u6D4B\uFF0C\u901A\u8FC7\u6D4B\u8BD5\u96C6\u5373\u53EF\u83B7\u5F97\u5BF9\u5E94\u5956\u52B1\uFF09")))),H.a.createElement(s.a,{style:{marginBottom:"5px"},checked:ft,onChange:kr},"\u9690\u85CF\u5B9E\u9645\u8F93\u51FA \uFF08\u9009\u4E2D\uFF0C\u5219\u5728\u5B66\u751F\u8003\u8BD5\u8FC7\u7A0B\u4E2D\u65E0\u6CD5\u770B\u5230\u5B9E\u9645\u8F93\u51FA\u7ED3\u679C\uFF0C\u4EC5\u5C55\u793A\u662F\u5426\u8BC4\u6D4B\u662F\u5426\u901A\u8FC7\uFF09"),H.a.createElement(d.a.Item,{className:ie.a.testJi,name:["hack","is_file"],label:"\u7528\u4F8B\u7C7B\u578B:"},H.a.createElement(C.a.Group,{onChange:wr},H.a.createElement(T.a,{direction:"horizontal"},H.a.createElement(C.a,{value:!1},"\u6587\u672C"),H.a.createElement(C.a,{value:!0},"\u6587\u4EF6")))),!Nt.test_set_score&&H.a.createElement(d.a.Item,{name:["hack","test_set_average"],label:"\u7CFB\u7EDF\u8BC4\u5206\u5360\u6BD4"},H.a.createElement(C.a.Group,{onChange:Je},H.a.createElement(C.a,{value:!0},"\u5747\u5206\u6BD4\u4F8B"),H.a.createElement(C.a,{value:!1},"\u81EA\u5B9A\u4E49\u6BD4\u4F8B"))),!Nt.test_set_score&&H.a.createElement("div",{style:{marginBottom:"20px",marginTop:"-10px"}},H.a.createElement("div",{style:{display:"flex",height:"30px",marginBottom:"10px"}},H.a.createElement(s.a,{checked:Yr,style:{display:"flex",alignItems:"center"},className:ie.a.checkboxs,onChange:function(Zt){ur(Zt.target.checked),Ot.setFieldsValue({hack:{code_compile_score:0}}),Nt.test_set_average&&(Nt.is_file?qt(vr):Rt())}},"\u542F\u7528\u7F16\u8BD1\u901A\u8FC7\u5373\u53EF\u5F97\u5206"),Yr&&H.a.createElement("span",{style:{display:"flex"}},H.a.createElement(d.a.Item,{rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u7F16\u8BD1\u5F97\u5206"}],name:["hack","code_compile_score"]},H.a.createElement(r.a,{onChange:function(){Nt.test_set_average&&(Nt.is_file?qt(vr):Rt())},parser:function(Zt){return isNaN(parseInt(Zt))?"":parseInt(Zt)},min:0,max:100,style:{width:"90px",margin:"5px 0px"}}))," ",H.a.createElement("span",{style:{display:"flex",alignItems:"center",marginLeft:"5px"}},"%"))),H.a.createElement("span",{style:{color:"#999",fontSize:"12px",marginLeft:"-8px"}},"\uFF08\u8BF7\u6CE8\u610F\u8BE5\u5B9E\u8BAD\u9898\u662F\u5426\u6709\u7F16\u8BD1\u8FC7\u7A0B\uFF0C\u82E5\u6CA1\u6709\u5219\u65E0\u6CD5\u83B7\u5F97\u7F16\u8BD1\u5F97\u5206\uFF09")),H.a.createElement("div",{className:ie.a.upBtn},H.a.createElement(l.a,{ghost:!0,type:"primary",className:"mb20",onClick:function(){return cr(!0)}},"\u6279\u91CF\u4E0A\u4F20\u6D4B\u8BD5\u7528\u4F8B"),(Nt==null?void 0:Nt.is_file)&&H.a.createElement(nt.a,{disabled:Nt==null?void 0:Nt.test_set_average,inputChange:oi,showScore:!Nt.test_set_score,data:vr,onRemove:cn})),!Nt.is_file&&H.a.createElement(d.a.List,{name:"hack_sets"},function(br,Zt){return Object(S.a)(Zt),H.a.createElement(B.a,{accordion:!0},br.map(function(dr,xr){return H.a.createElement(wt,{key:"".concat(dr.key,"--").concat(xr),header:H.a.createElement("a",{className:ie.a["test-case-name"]},H.a.createElement("span",null,"\u6D4B\u8BD5\u7528\u4F8B",xr+1,"\b"),Fr?null:H.a.createElement(H.a.Fragment,null,H.a.createElement(d.a.Item,{name:[dr.name,"score"],fieldKey:[dr.fieldKey,"score"],rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6D4B\u8BD5\u96C6".concat(xr+1,"\u8BC4\u5206")}]},H.a.createElement(r.a,{onClick:Dr,min:0,max:100,disabled:qr})),H.a.createElement("span",null,"%"))),extra:xr>0?H.a.createElement("div",{onClick:Dr},H.a.createElement(h.a,{okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u5B9A\u5220\u9664\u6D4B\u8BD5\u96C6\b"+(xr+1),onConfirm:function(){Mr(xr)}},H.a.createElement(W.a,{className:ie.a["btn-remove-case"]}))):null},H.a.createElement(d.a.Item,{label:"\u8F93\u5165",name:[dr.name,"input"],fieldKey:[dr.fieldKey,"input"]},H.a.createElement(tt,null)),H.a.createElement(d.a.Item,{label:"\u8F93\u51FA",name:[dr.name,"output"],fieldKey:[dr.fieldKey,"output"],rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u8F93\u51FA\u5185\u5BB9"}]},H.a.createElement(tt,null)))}))}))),H.a.createElement(nt.b,{rootIdentifier:Hr,visible:Mn,onClose:function(){return cr(!1)},onOK:bn,multiple:!0,defaultMultipleValue:Nt==null?void 0:Nt.is_file}))}},PVpz:function(M,ne,N){(function(I,h,S){M.exports=ne=h(N("Ib8C"),N("ETIr"),N("cv67"),N("K3mO"),N("OLod"))})(this,function(I){return function(){var h=I,S=h.lib,L=S.StreamCipher,T=h.algo,c=[],C=[],g=[],s=T.RabbitLegacy=L.extend({_doReset:function(){var r=this._key.words,f=this.cfg.iv,p=this._X=[r[0],r[3]<<16|r[2]>>>16,r[1],r[0]<<16|r[3]>>>16,r[2],r[1]<<16|r[0]>>>16,r[3],r[2]<<16|r[1]>>>16],m=this._C=[r[2]<<16|r[2]>>>16,r[0]&4294901760|r[1]&65535,r[3]<<16|r[3]>>>16,r[1]&4294901760|r[2]&65535,r[0]<<16|r[0]>>>16,r[2]&4294901760|r[3]&65535,r[1]<<16|r[1]>>>16,r[3]&4294901760|r[0]&65535];this._b=0;for(var E=0;E<4;E++)a.call(this);for(var E=0;E<8;E++)m[E]^=p[E+4&7];if(f){var y=f.words,u=y[0],n=y[1],o=(u<<8|u>>>24)&16711935|(u<<24|u>>>8)&4278255360,l=(n<<8|n>>>24)&16711935|(n<<24|n>>>8)&4278255360,w=o>>>16|l&4294901760,v=l<<16|o&65535;m[0]^=o,m[1]^=w,m[2]^=l,m[3]^=v,m[4]^=o,m[5]^=w,m[6]^=l,m[7]^=v;for(var E=0;E<4;E++)a.call(this)}},_doProcessBlock:function(r,f){var p=this._X;a.call(this),c[0]=p[0]^p[5]>>>16^p[3]<<16,c[1]=p[2]^p[7]>>>16^p[5]<<16,c[2]=p[4]^p[1]>>>16^p[7]<<16,c[3]=p[6]^p[3]>>>16^p[1]<<16;for(var m=0;m<4;m++)c[m]=(c[m]<<8|c[m]>>>24)&16711935|(c[m]<<24|c[m]>>>8)&4278255360,r[f+m]^=c[m]},blockSize:128/32,ivSize:64/32});function a(){for(var r=this._X,f=this._C,p=0;p<8;p++)C[p]=f[p];f[0]=f[0]+1295307597+this._b|0,f[1]=f[1]+3545052371+(f[0]>>>0<C[0]>>>0?1:0)|0,f[2]=f[2]+886263092+(f[1]>>>0<C[1]>>>0?1:0)|0,f[3]=f[3]+1295307597+(f[2]>>>0<C[2]>>>0?1:0)|0,f[4]=f[4]+3545052371+(f[3]>>>0<C[3]>>>0?1:0)|0,f[5]=f[5]+886263092+(f[4]>>>0<C[4]>>>0?1:0)|0,f[6]=f[6]+1295307597+(f[5]>>>0<C[5]>>>0?1:0)|0,f[7]=f[7]+3545052371+(f[6]>>>0<C[6]>>>0?1:0)|0,this._b=f[7]>>>0<C[7]>>>0?1:0;for(var p=0;p<8;p++){var m=r[p]+f[p],E=m&65535,y=m>>>16,u=((E*E>>>17)+E*y>>>15)+y*y,n=((m&4294901760)*m|0)+((m&65535)*m|0);g[p]=u^n}r[0]=g[0]+(g[7]<<16|g[7]>>>16)+(g[6]<<16|g[6]>>>16)|0,r[1]=g[1]+(g[0]<<8|g[0]>>>24)+g[7]|0,r[2]=g[2]+(g[1]<<16|g[1]>>>16)+(g[0]<<16|g[0]>>>16)|0,r[3]=g[3]+(g[2]<<8|g[2]>>>24)+g[1]|0,r[4]=g[4]+(g[3]<<16|g[3]>>>16)+(g[2]<<16|g[2]>>>16)|0,r[5]=g[5]+(g[4]<<8|g[4]>>>24)+g[3]|0,r[6]=g[6]+(g[5]<<16|g[5]>>>16)+(g[4]<<16|g[4]>>>16)|0,r[7]=g[7]+(g[6]<<8|g[6]>>>24)+g[5]|0}h.RabbitLegacy=L._createHelper(s)}(),I.RabbitLegacy})},RELg:function(M,ne,N){var I=N("MFOe"),h=I.Global;M.exports={name:"oldIE-userDataStorage",write:C,read:g,each:s,remove:a,clearAll:r};var S="storejs",L=h.document,T=m(),c=(h.navigator?h.navigator.userAgent:"").match(/ (MSIE 8|MSIE 9|MSIE 10)\./);function C(E,y){if(c)return;var u=p(E);T(function(n){n.setAttribute(u,y),n.save(S)})}function g(E){if(c)return;var y=p(E),u=null;return T(function(n){u=n.getAttribute(y)}),u}function s(E){T(function(y){for(var u=y.XMLDocument.documentElement.attributes,n=u.length-1;n>=0;n--){var o=u[n];E(y.getAttribute(o.name),o.name)}})}function a(E){var y=p(E);T(function(u){u.removeAttribute(y),u.save(S)})}function r(){T(function(E){var y=E.XMLDocument.documentElement.attributes;E.load(S);for(var u=y.length-1;u>=0;u--)E.removeAttribute(y[u].name);E.save(S)})}var f=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g");function p(E){return E.replace(/^\d/,"___$&").replace(f,"___")}function m(){if(!L||!L.documentElement||!L.documentElement.addBehavior)return null;var E="script",y,u,n;try{u=new ActiveXObject("htmlfile"),u.open(),u.write("<"+E+">document.w=window</"+E+'><iframe src="/favicon.ico"></iframe>'),u.close(),y=u.w.frames[0].document,n=y.createElement("div")}catch(o){n=L.createElement("div"),y=L.body}return function(o){var l=[].slice.call(arguments,0);l.unshift(n),y.appendChild(n),n.addBehavior("#default#userData"),n.load(S),o.apply(this,l),y.removeChild(n);return}}},RxwV:function(M,ne,N){"use strict";var I=N("q1tI"),h=N("uciX"),S=N("2W6z"),L=N.n(S),T=N("4IlW"),c=N("uK0f"),C=N.n(c);function g(ce,he){if(ce===he)return!0;if(!ce||!he)return!1;var ae=ce.length;if(he.length!==ae)return!1;for(var Q=0;Q<ae;Q++)if(ce[Q]!==he[Q])return!1;return!0}function s(ce){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?s=function(ae){return typeof ae}:s=function(ae){return ae&&typeof Symbol=="function"&&ae.constructor===Symbol&&ae!==Symbol.prototype?"symbol":typeof ae},s(ce)}function a(ce,he){if(!(ce instanceof he))throw new TypeError("Cannot call a class as a function")}function r(ce,he){for(var ae=0;ae<he.length;ae++){var Q=he[ae];Q.enumerable=Q.enumerable||!1,Q.configurable=!0,"value"in Q&&(Q.writable=!0),Object.defineProperty(ce,Q.key,Q)}}function f(ce,he,ae){return he&&r(ce.prototype,he),ae&&r(ce,ae),ce}function p(ce,he){if(typeof he!="function"&&he!==null)throw new TypeError("Super expression must either be null or a function");ce.prototype=Object.create(he&&he.prototype,{constructor:{value:ce,writable:!0,configurable:!0}}),he&&m(ce,he)}function m(ce,he){return m=Object.setPrototypeOf||function(Q,D){return Q.__proto__=D,Q},m(ce,he)}function E(ce){var he=n();return function(){var ae=o(ce),Q;if(he){var D=o(this).constructor;Q=Reflect.construct(ae,arguments,D)}else Q=ae.apply(this,arguments);return y(this,Q)}}function y(ce,he){return he&&(s(he)==="object"||typeof he=="function")?he:u(ce)}function u(ce){if(ce===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return ce}function n(){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(ce){return!1}}function o(ce){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(ae){return ae.__proto__||Object.getPrototypeOf(ae)},o(ce)}var l=function(){var ce=function(he){p(Q,he);var ae=E(Q);function Q(){var D;return a(this,Q),D=ae.apply(this,arguments),D.menuItems={},D.saveMenuItem=function(F){return function(W){D.menuItems[F]=W}},D}return f(Q,[{key:"componentDidMount",value:function(){this.scrollActiveItemToView()}},{key:"componentDidUpdate",value:function(F){!F.visible&&this.props.visible&&this.scrollActiveItemToView()}},{key:"getFieldName",value:function(F){var W=this.props,Y=W.fieldNames,Z=W.defaultFieldNames;return Y[F]||Z[F]}},{key:"getOption",value:function(F,W){var Y=this.props,Z=Y.prefixCls,te=Y.expandTrigger,q=Y.expandIcon,X=Y.loadingIcon,re=this.props.onSelect.bind(this,F,W),me=this.props.onItemDoubleClick.bind(this,F,W),ve={onClick:re,onDoubleClick:me},Te="".concat(Z,"-menu-item"),Re=null,Ie=F[this.getFieldName("children")]&&F[this.getFieldName("children")].length>0;(Ie||F.isLeaf===!1)&&(Te+=" ".concat(Z,"-menu-item-expand"),F.loading||(Re=I.createElement("span",{className:"".concat(Z,"-menu-item-expand-icon")},q))),te==="hover"&&(Ie||F.isLeaf===!1)&&(ve={onMouseEnter:this.delayOnSelect.bind(this,re),onMouseLeave:this.delayOnSelect.bind(this),onClick:re}),this.isActiveOption(F,W)&&(Te+=" ".concat(Z,"-menu-item-active"),ve.ref=this.saveMenuItem(W)),F.disabled&&(Te+=" ".concat(Z,"-menu-item-disabled"));var je=null;F.loading&&(Te+=" ".concat(Z,"-menu-item-loading"),je=X||null);var Ne="";return"title"in F?Ne=F.title:typeof F[this.getFieldName("label")]=="string"&&(Ne=F[this.getFieldName("label")]),I.createElement("li",Object.assign({key:F[this.getFieldName("value")],className:Te,title:Ne},ve,{role:"menuitem",onMouseDown:function(Be){return Be.preventDefault()}}),F[this.getFieldName("label")],Re,je)}},{key:"getActiveOptions",value:function(F){var W=this,Y=this.props.options,Z=F||this.props.activeValue;return C()(Y,function(te,q){return te[W.getFieldName("value")]===Z[q]},{childrenKeyName:this.getFieldName("children")})}},{key:"getShowOptions",value:function(){var F=this,W=this.props.options,Y=this.getActiveOptions().map(function(Z){return Z[F.getFieldName("children")]}).filter(function(Z){return!!Z});return Y.unshift(W),Y}},{key:"delayOnSelect",value:function(F){for(var W=this,Y=arguments.length,Z=new Array(Y>1?Y-1:0),te=1;te<Y;te++)Z[te-1]=arguments[te];this.delayTimer&&(clearTimeout(this.delayTimer),this.delayTimer=null),typeof F=="function"&&(this.delayTimer=window.setTimeout(function(){F(Z),W.delayTimer=null},150))}},{key:"scrollActiveItemToView",value:function(){for(var F=this.getShowOptions().length,W=0;W<F;W++){var Y=this.menuItems[W];Y&&Y.parentElement&&(Y.parentElement.scrollTop=Y.offsetTop)}}},{key:"isActiveOption",value:function(F,W){var Y=this.props.activeValue,Z=Y===void 0?[]:Y;return Z[W]===F[this.getFieldName("value")]}},{key:"render",value:function(){var F=this,W=this.props,Y=W.prefixCls,Z=W.dropdownMenuColumnStyle;return I.createElement("div",null,this.getShowOptions().map(function(te,q){return I.createElement("ul",{className:"".concat(Y,"-menu"),key:q,style:Z},te.map(function(X){return F.getOption(X,q)}))}))}}]),Q}(I.Component);return ce.defaultProps={options:[],value:[],activeValue:[],onSelect:function(){},prefixCls:"rc-cascader-menus",visible:!1,expandTrigger:"click"},ce}(),w=l,v={bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:1,adjustY:1}},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:1,adjustY:1}},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:1,adjustY:1}},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:1,adjustY:1}}},i=v;function R(ce){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?R=function(ae){return typeof ae}:R=function(ae){return ae&&typeof Symbol=="function"&&ae.constructor===Symbol&&ae!==Symbol.prototype?"symbol":typeof ae},R(ce)}function k(ce,he){if(ce==null)return{};var ae=d(ce,he),Q,D;if(Object.getOwnPropertySymbols){var F=Object.getOwnPropertySymbols(ce);for(D=0;D<F.length;D++){if(Q=F[D],he.indexOf(Q)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(ce,Q))continue;ae[Q]=ce[Q]}}return ae}function d(ce,he){if(ce==null)return{};var ae={},Q=Object.keys(ce),D,F;for(F=0;F<Q.length;F++){if(D=Q[F],he.indexOf(D)>=0)continue;ae[D]=ce[D]}return ae}function b(ce){return U(ce)||B(ce)||_(ce)||x()}function x(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _(ce,he){if(!ce)return;if(typeof ce=="string")return P(ce,he);var ae=Object.prototype.toString.call(ce).slice(8,-1);if(ae==="Object"&&ce.constructor&&(ae=ce.constructor.name),ae==="Map"||ae==="Set")return Array.from(ce);if(ae==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ae))return P(ce,he)}function B(ce){if(typeof Symbol!="undefined"&&Symbol.iterator in Object(ce))return Array.from(ce)}function U(ce){if(Array.isArray(ce))return P(ce)}function P(ce,he){(he==null||he>ce.length)&&(he=ce.length);for(var ae=0,Q=new Array(he);ae<he;ae++)Q[ae]=ce[ae];return Q}function J(ce,he){if(!(ce instanceof he))throw new TypeError("Cannot call a class as a function")}function $(ce,he){for(var ae=0;ae<he.length;ae++){var Q=he[ae];Q.enumerable=Q.enumerable||!1,Q.configurable=!0,"value"in Q&&(Q.writable=!0),Object.defineProperty(ce,Q.key,Q)}}function z(ce,he,ae){return he&&$(ce.prototype,he),ae&&$(ce,ae),ce}function V(ce,he){if(typeof he!="function"&&he!==null)throw new TypeError("Super expression must either be null or a function");ce.prototype=Object.create(he&&he.prototype,{constructor:{value:ce,writable:!0,configurable:!0}}),he&&K(ce,he)}function K(ce,he){return K=Object.setPrototypeOf||function(Q,D){return Q.__proto__=D,Q},K(ce,he)}function H(ce){var he=le();return function(){var ae=ue(ce),Q;if(he){var D=ue(this).constructor;Q=Reflect.construct(ae,arguments,D)}else Q=ae.apply(this,arguments);return G(this,Q)}}function G(ce,he){return he&&(R(he)==="object"||typeof he=="function")?he:ie(ce)}function ie(ce){if(ce===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return ce}function le(){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(ce){return!1}}function ue(ce){return ue=Object.setPrototypeOf?Object.getPrototypeOf:function(ae){return ae.__proto__||Object.getPrototypeOf(ae)},ue(ce)}var be=function(){var ce=function(he){V(Q,he);var ae=H(Q);function Q(D){var F;J(this,Q),F=ae.call(this,D),F.setPopupVisible=function(Y){var Z=F.state.value;"popupVisible"in F.props||F.setState({popupVisible:Y}),Y&&!F.state.popupVisible&&F.setState({activeValue:Z}),F.props.onPopupVisibleChange(Y)},F.handleChange=function(Y,Z,te){var q=Z.visible;(te.type!=="keydown"||te.keyCode===T.a.ENTER)&&(F.props.onChange(Y.map(function(X){return X[F.getFieldName("value")]}),Y),F.setPopupVisible(q))},F.handlePopupVisibleChange=function(Y){F.setPopupVisible(Y)},F.handleMenuSelect=function(Y,Z,te){var q=F.trigger.getRootDomNode();q&&q.focus&&q.focus();var X=F.props,re=X.changeOnSelect,me=X.loadData,ve=X.expandTrigger;if(!Y||Y.disabled)return;var Te=F.state.activeValue;Te=Te.slice(0,Z+1),Te[Z]=Y[F.getFieldName("value")];var Re=F.getActiveOptions(Te);if(Y.isLeaf===!1&&!Y[F.getFieldName("children")]&&me){re&&F.handleChange(Re,{visible:!0},te),F.setState({activeValue:Te}),me(Re);return}var Ie={};!Y[F.getFieldName("children")]||!Y[F.getFieldName("children")].length?(F.handleChange(Re,{visible:!1},te),Ie.value=Te):re&&(te.type==="click"||te.type==="keydown")&&(ve==="hover"?F.handleChange(Re,{visible:!1},te):F.handleChange(Re,{visible:!0},te),Ie.value=Te),Ie.activeValue=Te,("value"in F.props||te.type==="keydown"&&te.keyCode!==T.a.ENTER)&&delete Ie.value,F.setState(Ie)},F.handleItemDoubleClick=function(){var Y=F.props.changeOnSelect;Y&&F.setPopupVisible(!1)},F.handleKeyDown=function(Y){var Z=F.props.children;if(Z&&Z.props.onKeyDown){Z.props.onKeyDown(Y);return}var te=b(F.state.activeValue),q=te.length-1<0?0:te.length-1,X=F.getCurrentLevelOptions(),re=X.map(function(Re){return Re[F.getFieldName("value")]}).indexOf(te[q]);if(Y.keyCode!==T.a.DOWN&&Y.keyCode!==T.a.UP&&Y.keyCode!==T.a.LEFT&&Y.keyCode!==T.a.RIGHT&&Y.keyCode!==T.a.ENTER&&Y.keyCode!==T.a.SPACE&&Y.keyCode!==T.a.BACKSPACE&&Y.keyCode!==T.a.ESC&&Y.keyCode!==T.a.TAB)return;if(!F.state.popupVisible&&Y.keyCode!==T.a.BACKSPACE&&Y.keyCode!==T.a.LEFT&&Y.keyCode!==T.a.RIGHT&&Y.keyCode!==T.a.ESC&&Y.keyCode!==T.a.TAB){F.setPopupVisible(!0);return}if(Y.keyCode===T.a.DOWN||Y.keyCode===T.a.UP){Y.preventDefault();var me=re;me!==-1?Y.keyCode===T.a.DOWN?(me+=1,me=me>=X.length?0:me):(me-=1,me=me<0?X.length-1:me):me=0,te[q]=X[me][F.getFieldName("value")]}else if(Y.keyCode===T.a.LEFT||Y.keyCode===T.a.BACKSPACE)Y.preventDefault(),te.splice(te.length-1,1);else if(Y.keyCode===T.a.RIGHT)Y.preventDefault(),X[re]&&X[re][F.getFieldName("children")]&&te.push(X[re][F.getFieldName("children")][0][F.getFieldName("value")]);else if(Y.keyCode===T.a.ESC||Y.keyCode===T.a.TAB){F.setPopupVisible(!1);return}(!te||te.length===0)&&F.setPopupVisible(!1);var ve=F.getActiveOptions(te),Te=ve[ve.length-1];F.handleMenuSelect(Te,ve.length-1,Y),F.props.onKeyDown&&F.props.onKeyDown(Y)},F.saveTrigger=function(Y){F.trigger=Y};var W=[];return"value"in D?W=D.value||[]:"defaultValue"in D&&(W=D.defaultValue||[]),L()(!("filedNames"in D),"`filedNames` of Cascader is a typo usage and deprecated, please use `fieldNames` instead."),F.state={popupVisible:D.popupVisible,activeValue:W,value:W,prevProps:D},F.defaultFieldNames={label:"label",value:"value",children:"children"},F}return z(Q,[{key:"getPopupDOMNode",value:function(){return this.trigger.getPopupDomNode()}},{key:"getFieldName",value:function(F){var W=this.defaultFieldNames,Y=this.props,Z=Y.fieldNames,te=Y.filedNames;return"filedNames"in this.props?te[F]||W[F]:Z[F]||W[F]}},{key:"getFieldNames",value:function(){var F=this.props,W=F.fieldNames,Y=F.filedNames;return"filedNames"in this.props?Y:W}},{key:"getCurrentLevelOptions",value:function(){var F=this,W=this.props.options,Y=W===void 0?[]:W,Z=this.state.activeValue,te=Z===void 0?[]:Z,q=C()(Y,function(X,re){return X[F.getFieldName("value")]===te[re]},{childrenKeyName:this.getFieldName("children")});return q[q.length-2]?q[q.length-2][this.getFieldName("children")]:b(Y).filter(function(X){return!X.disabled})}},{key:"getActiveOptions",value:function(F){var W=this;return C()(this.props.options||[],function(Y,Z){return Y[W.getFieldName("value")]===F[Z]},{childrenKeyName:this.getFieldName("children")})}},{key:"render",value:function(){var F=this.props,W=F.prefixCls,Y=F.transitionName,Z=F.popupClassName,te=F.options,q=te===void 0?[]:te,X=F.disabled,re=F.builtinPlacements,me=F.popupPlacement,ve=F.children,Te=F.dropdownRender,Re=k(F,["prefixCls","transitionName","popupClassName","options","disabled","builtinPlacements","popupPlacement","children","dropdownRender"]),Ie=I.createElement("div",null),je="";q&&q.length>0?Ie=I.createElement(w,Object.assign({},this.props,{fieldNames:this.getFieldNames(),defaultFieldNames:this.defaultFieldNames,activeValue:this.state.activeValue,onSelect:this.handleMenuSelect,onItemDoubleClick:this.handleItemDoubleClick,visible:this.state.popupVisible})):je=" ".concat(W,"-menus-empty");var Ne=Ie;return Te&&(Ne=Te(Ie)),I.createElement(h.a,Object.assign({ref:this.saveTrigger},Re,{popupPlacement:me,builtinPlacements:re,popupTransitionName:Y,action:X?[]:["click"],popupVisible:X?!1:this.state.popupVisible,onPopupVisibleChange:this.handlePopupVisibleChange,prefixCls:"".concat(W,"-menus"),popupClassName:Z+je,popup:Ne}),I.cloneElement(ve,{onKeyDown:this.handleKeyDown,tabIndex:X?void 0:0}))}}],[{key:"getDerivedStateFromProps",value:function(F,W){var Y=W.prevProps,Z=Y===void 0?{}:Y,te={prevProps:F};return"value"in F&&!g(Z.value,F.value)&&(te.value=F.value||[],"loadData"in F||(te.activeValue=F.value||[])),"popupVisible"in F&&(te.popupVisible=F.popupVisible),te}}]),Q}(I.Component);return ce.defaultProps={onChange:function(){},onPopupVisibleChange:function(){},disabled:!1,transitionName:"",prefixCls:"rc-cascader",popupClassName:"",popupPlacement:"bottomLeft",builtinPlacements:i,expandTrigger:"click",fieldNames:{label:"label",value:"value",children:"children"},expandIcon:">"},ce}(),Ce=be,se=ne.a=Ce},S6kV:function(M,ne,N){(function(I,h,S){M.exports=ne=h(N("Ib8C"),N("OLod"))})(this,function(I){return I.mode.OFB=function(){var h=I.lib.BlockCipherMode.extend(),S=h.Encryptor=h.extend({processBlock:function(L,T){var c=this._cipher,C=c.blockSize,g=this._iv,s=this._keystream;g&&(s=this._keystream=g.slice(0),this._iv=void 0),c.encryptBlock(s,0);for(var a=0;a<C;a++)L[T+a]^=s[a]}});return h.Decryptor=S,h}(),I.mode.OFB})},SJMd:function(M,ne){/**
* @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 N,I,h,S=!1,L,T;window.PR_SHOULD_USE_CONTINUATION=!0;var c,C;(function(){var g=window,s=["break,continue,do,else,for,if,return,while"],a=[s,"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"],r=[a,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],f=[r,"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"],p=[r,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],m=[r,"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"],E="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",y=[r,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],u="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=[s,"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"],o=[s,"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"],l=[s,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],w=[f,m,p,y,u,n,o,l],v=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,i="str",R="kwd",k="com",d="typ",b="lit",x="pun",_="pln",B="tag",U="dec",P="src",J="atn",$="atv",z="nocode",V="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function K(te){for(var q=0,X=!1,re=!1,me=0,ve=te.length;me<ve;++me){var Te=te[me];if(Te.ignoreCase)re=!0;else if(/[a-z]/i.test(Te.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){X=!0,re=!1;break}}var Re={b:8,t:9,n:10,v:11,f:12,r:13};function Ie(He){var De=He.charCodeAt(0);if(De!==92)return De;var Xe=He.charAt(1);return De=Re[Xe],De||("0"<=Xe&&Xe<="7"?parseInt(He.substring(1),8):Xe==="u"||Xe==="x"?parseInt(He.substring(2),16):He.charCodeAt(1))}function je(He){if(He<32)return(He<16?"\\x0":"\\x")+He.toString(16);var De=String.fromCharCode(He);return De==="\\"||De==="-"||De==="]"||De==="^"?"\\"+De:De}function Ne(He){var De=He.substring(1,He.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")),Xe=[],$e=De[0]==="^",we=["["];$e&&we.push("^");for(var fe=$e?1:0,pe=De.length;fe<pe;++fe){var ye=De[fe];if(/\\[bdsw]/i.test(ye))we.push(ye);else{var _e=Ie(ye),xe;fe+2<pe&&De[fe+1]==="-"?(xe=Ie(De[fe+2]),fe+=2):xe=_e,Xe.push([_e,xe]),xe<65||_e>122||(xe<65||_e>90||Xe.push([Math.max(65,_e)|32,Math.min(xe,90)|32]),xe<97||_e>122||Xe.push([Math.max(97,_e)&~32,Math.min(xe,122)&~32]))}}Xe.sort(function(Le,Me){return Le[0]-Me[0]||Me[1]-Le[1]});for(var Se=[],Ae=[],fe=0;fe<Xe.length;++fe){var Oe=Xe[fe];Oe[0]<=Ae[1]+1?Ae[1]=Math.max(Ae[1],Oe[1]):Se.push(Ae=Oe)}for(var fe=0;fe<Se.length;++fe){var Oe=Se[fe];we.push(je(Oe[0])),Oe[1]>Oe[0]&&(Oe[1]+1>Oe[0]&&we.push("-"),we.push(je(Oe[1])))}return we.push("]"),we.join("")}function We(He){for(var De=He.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")),Xe=De.length,$e=[],we=0,fe=0;we<Xe;++we){var pe=De[we];if(pe==="(")++fe;else if(pe.charAt(0)==="\\"){var ye=+pe.substring(1);ye&&(ye<=fe?$e[ye]=-1:De[we]=je(ye))}}for(var we=1;we<$e.length;++we)$e[we]===-1&&($e[we]=++q);for(var we=0,fe=0;we<Xe;++we){var pe=De[we];if(pe==="(")++fe,$e[fe]||(De[we]="(?:");else if(pe.charAt(0)==="\\"){var ye=+pe.substring(1);ye&&ye<=fe&&(De[we]="\\"+$e[ye])}}for(var we=0;we<Xe;++we)De[we]==="^"&&De[we+1]!=="^"&&(De[we]="");if(He.ignoreCase&&X)for(var we=0;we<Xe;++we){var pe=De[we],_e=pe.charAt(0);pe.length>=2&&_e==="["?De[we]=Ne(pe):_e!=="\\"&&(De[we]=pe.replace(/[a-zA-Z]/g,function(Ae){var Oe=Ae.charCodeAt(0);return"["+String.fromCharCode(Oe&~32,Oe|32)+"]"}))}return De.join("")}for(var Be=[],me=0,ve=te.length;me<ve;++me){var Te=te[me];if(Te.global||Te.multiline)throw new Error(""+Te);Be.push("(?:"+We(Te)+")")}return new RegExp(Be.join("|"),re?"gi":"g")}function H(te,q){var X=/(?:^|\s)nocode(?:\s|$)/,re=[],me=0,ve=[],Te=0;function Re(Ie){var je=Ie.nodeType;if(je==1){if(X.test(Ie.className))return;for(var Ne=Ie.firstChild;Ne;Ne=Ne.nextSibling)Re(Ne);var We=Ie.nodeName.toLowerCase();(We==="br"||We==="li")&&(re[Te]=`
`,ve[Te<<1]=me++,ve[Te++<<1|1]=Ie)}else if(je==3||je==4){var Be=Ie.nodeValue;Be.length&&(q?Be=Be.replace(/\r\n?/g,`
`):Be=Be.replace(/[ \t\r\n]+/g," "),re[Te]=Be,ve[Te<<1]=me,me+=Be.length,ve[Te++<<1|1]=Ie)}}return Re(te),{sourceCode:re.join("").replace(/\n$/,""),spans:ve}}function G(te,q,X,re,me){if(!X)return;var ve={sourceNode:te,pre:1,langExtension:null,numberLines:null,sourceCode:X,spans:null,basePos:q,decorations:null};re(ve),me.push.apply(me,ve.decorations)}var ie=/\S/;function le(te){for(var q=void 0,X=te.firstChild;X;X=X.nextSibling){var re=X.nodeType;q=re===1?q?te:X:re===3&&ie.test(X.nodeValue)?te:q}return q===te?void 0:q}function ue(te,q){var X={},re;(function(){for(var Te=te.concat(q),Re=[],Ie={},je=0,Ne=Te.length;je<Ne;++je){var We=Te[je],Be=We[3];if(Be)for(var He=Be.length;--He>=0;)X[Be.charAt(He)]=We;var De=We[1],Xe=""+De;Ie.hasOwnProperty(Xe)||(Re.push(De),Ie[Xe]=null)}Re.push(/[\0-\uffff]/),re=K(Re)})();var me=q.length,ve=function(Te){for(var Re=Te.sourceCode,Ie=Te.basePos,je=Te.sourceNode,Ne=[Ie,_],We=0,Be=Re.match(re)||[],He={},De=0,Xe=Be.length;De<Xe;++De){var $e=Be[De],we=He[$e],fe=void 0,pe;if(typeof we=="string")pe=!1;else{var ye=X[$e.charAt(0)];if(ye)fe=$e.match(ye[1]),we=ye[0];else{for(var _e=0;_e<me;++_e)if(ye=q[_e],fe=$e.match(ye[1]),fe){we=ye[0];break}fe||(we=_)}pe=we.length>=5&&we.substring(0,5)==="lang-",pe&&!(fe&&typeof fe[1]=="string")&&(pe=!1,we=P),pe||(He[$e]=we)}var xe=We;if(We+=$e.length,!pe)Ne.push(Ie+xe,we);else{var Se=fe[1],Ae=$e.indexOf(Se),Oe=Ae+Se.length;fe[2]&&(Oe=$e.length-fe[2].length,Ae=Oe-Se.length);var Le=we.substring(5);G(je,Ie+xe,$e.substring(0,Ae),ve,Ne),G(je,Ie+xe+Ae,Se,Q(Le,Se),Ne),G(je,Ie+xe+Oe,$e.substring(Oe),ve,Ne)}}Te.decorations=Ne};return ve}function be(te){var q=[],X=[];te.tripleQuotedStrings?q.push([i,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):te.multiLineStrings?q.push([i,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):q.push([i,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),te.verbatimStrings&&X.push([i,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var re=te.hashComments;re&&(te.cStyleComments?(re>1?q.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):q.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),X.push([i,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):q.push([k,/^#[^\r\n]*/,null,"#"])),te.cStyleComments&&(X.push([k,/^\/\/[^\r\n]*/,null]),X.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var me=te.regexLiterals;if(me){var ve=me>1?"":`
\r`,Te=ve?".":"[\\S\\s]",Re="/(?=[^/*"+ve+"])(?:[^/\\x5B\\x5C"+ve+"]|\\x5C"+Te+"|\\x5B(?:[^\\x5C\\x5D"+ve+"]|\\x5C"+Te+")*(?:\\x5D|$))+/";X.push(["lang-regex",RegExp("^"+V+"("+Re+")")])}var Ie=te.types;Ie&&X.push([d,Ie]);var je=(""+te.keywords).replace(/^ | $/g,"");je.length&&X.push([R,new RegExp("^(?:"+je.replace(/[\s,]+/g,"|")+")\\b"),null]),q.push([_,/^\s+/,null,` \r
\xA0`]);var Ne="^.[^\\s\\w.$@'\"`/\\\\]*";return te.regexLiterals&&(Ne+="(?!s*/)"),X.push([b,/^@[a-z_$][a-z_$@0-9]*/i,null],[d,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[_,/^[a-z_$][a-z_$@0-9]*/i,null],[b,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[_,/^\\[\s\S]?/,null],[x,new RegExp(Ne),null]),ue(q,X)}var Ce=be({keywords:w,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function se(te,q,X){for(var re=/(?:^|\s)nocode(?:\s|$)/,me=/\r\n?|\n/,ve=te.ownerDocument,Te=ve.createElement("li");te.firstChild;)Te.appendChild(te.firstChild);var Re=[Te];function Ie(De){var Xe=De.nodeType;if(Xe==1&&!re.test(De.className))if(De.nodeName==="br")je(De),De.parentNode&&De.parentNode.removeChild(De);else for(var $e=De.firstChild;$e;$e=$e.nextSibling)Ie($e);else if((Xe==3||Xe==4)&&X){var we=De.nodeValue,fe=we.match(me);if(fe){var pe=we.substring(0,fe.index);De.nodeValue=pe;var ye=we.substring(fe.index+fe[0].length);if(ye){var _e=De.parentNode;_e.insertBefore(ve.createTextNode(ye),De.nextSibling)}je(De),pe||De.parentNode.removeChild(De)}}}function je(De){for(;!De.nextSibling;)if(De=De.parentNode,!De)return;function Xe(fe,pe){var ye=pe?fe.cloneNode(!1):fe,_e=fe.parentNode;if(_e){var xe=Xe(_e,1),Se=fe.nextSibling;xe.appendChild(ye);for(var Ae=Se;Ae;Ae=Se)Se=Ae.nextSibling,xe.appendChild(Ae)}return ye}for(var $e=Xe(De.nextSibling,0),we;(we=$e.parentNode)&&we.nodeType===1;)$e=we;Re.push($e)}for(var Ne=0;Ne<Re.length;++Ne)Ie(Re[Ne]);q===(q|0)&&Re[0].setAttribute("value",q);var We=ve.createElement("ol");We.className="linenums";for(var Be=Math.max(0,q-1|0)||0,Ne=0,He=Re.length;Ne<He;++Ne)Te=Re[Ne],Te.className="L"+(Ne+Be)%10,Te.firstChild||Te.appendChild(ve.createTextNode("\xA0")),We.appendChild(Te);te.appendChild(We)}function ce(te){var q=/\bMSIE\s(\d+)/.exec(navigator.userAgent);q=q&&+q[1]<=8;var X=/\n/g,re=te.sourceCode,me=re.length,ve=0,Te=te.spans,Re=Te.length,Ie=0,je=te.decorations,Ne=je.length,We=0;je[Ne]=me;var Be,He;for(He=Be=0;He<Ne;)je[He]!==je[He+2]?(je[Be++]=je[He++],je[Be++]=je[He++]):He+=2;for(Ne=Be,He=Be=0;He<Ne;){for(var De=je[He],Xe=je[He+1],$e=He+2;$e+2<=Ne&&je[$e+1]===Xe;)$e+=2;je[Be++]=De,je[Be++]=Xe,He=$e}Ne=je.length=Be;var we=te.sourceNode,fe="";we&&(fe=we.style.display,we.style.display="none");try{for(var pe=null;Ie<Re;){var ye=Te[Ie],_e=Te[Ie+2]||me,xe=je[We+2]||me,$e=Math.min(_e,xe),Se=Te[Ie+1],Ae;if(Se.nodeType!==1&&(Ae=re.substring(ve,$e))){q&&(Ae=Ae.replace(X,"\r")),Se.nodeValue=Ae;var Oe=Se.ownerDocument,Le=Oe.createElement("span");Le.className=je[We+1];var Me=Se.parentNode;Me.replaceChild(Le,Se),Le.appendChild(Se),ve<_e&&(Te[Ie+1]=Se=Oe.createTextNode(re.substring($e,_e)),Me.insertBefore(Se,Le.nextSibling))}ve=$e,ve>=_e&&(Ie+=2),ve>=xe&&(We+=2)}}finally{we&&(we.style.display=fe)}}var he={};function ae(te,q){for(var X=q.length;--X>=0;){var re=q[X];he.hasOwnProperty(re)?g.console&&console.warn("cannot override language handler %s",re):he[re]=te}}function Q(te,q){return te&&he.hasOwnProperty(te)||(te=/^\s*</.test(q)?"default-markup":"default-code"),he[te]}ae(Ce,["default-code"]),ae(ue([],[[_,/^[^<?]+/],[U,/^<!\w[^>]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[x,/^(?:<[%?]|[%?]>)/],["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"]),ae(ue([[_,/^[\s]+/,null,` \r
`],[$,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[B,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[J,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[x,/^[=<>\/]+/],["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"]),ae(ue([],[[$,/^[\s\S]+/]]),["uq.val"]),ae(be({keywords:f,hashComments:!0,cStyleComments:!0,types:v}),["c","cc","cpp","cxx","cyc","m"]),ae(be({keywords:"null,true,false"}),["json"]),ae(be({keywords:m,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:v}),["cs"]),ae(be({keywords:p,cStyleComments:!0}),["java"]),ae(be({keywords:l,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),ae(be({keywords:n,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),ae(be({keywords:u,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),ae(be({keywords:o,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),ae(be({keywords:y,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),ae(be({keywords:E,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),ae(ue([],[[i,/^[\s\S]+/]]),["regex"]);function D(te){var q=te.langExtension;try{var X=H(te.sourceNode,te.pre),re=X.sourceCode;te.sourceCode=re,te.spans=X.spans,te.basePos=0,Q(q,re)(te),ce(te)}catch(me){g.console&&console.log(me&&me.stack||me)}}function F(te,q,X){var re=X||!1,me=q||null,ve=document.createElement("div");ve.innerHTML="<pre>"+te+"</pre>",ve=ve.firstChild,re&&se(ve,re,!0);var Te={langExtension:me,numberLines:re,sourceNode:ve,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return D(Te),ve.innerHTML}function W(te,q){var X=q||document.body,re=X.ownerDocument||document;function me(ye){return X.getElementsByTagName(ye)}for(var ve=[me("pre"),me("code"),me("xmp")],Te=[],Re=0;Re<ve.length;++Re)for(var Ie=0,je=ve[Re].length;Ie<je;++Ie)Te.push(ve[Re][Ie]);ve=null;var Ne=Date;Ne.now||(Ne={now:function(){return+new Date}});var We=0,Be=/\blang(?:uage)?-([\w.]+)(?!\S)/,He=/\bprettyprint\b/,De=/\bprettyprinted\b/,Xe=/pre|xmp/i,$e=/^code$/i,we=/^(?:pre|code|xmp)$/i,fe={};function pe(){for(var ye=g.PR_SHOULD_USE_CONTINUATION?Ne.now()+250:Infinity;We<Te.length&&Ne.now()<ye;We++){for(var _e=Te[We],xe=fe,Se=_e;Se=Se.previousSibling;){var Ae=Se.nodeType,Oe=(Ae===7||Ae===8)&&Se.nodeValue;if(Oe?!/^\??prettify\b/.test(Oe):Ae!==3||/\S/.test(Se.nodeValue))break;if(Oe){xe={},Oe.replace(/\b(\w+)=([\w:.%+-]+)/g,function(Bt,gt,xt){xe[gt]=xt});break}}var Le=_e.className;if((xe!==fe||He.test(Le))&&!De.test(Le)){for(var Me=!1,Ke=_e.parentNode;Ke;Ke=Ke.parentNode){var Qe=Ke.tagName;if(we.test(Qe)&&Ke.className&&He.test(Ke.className)){Me=!0;break}}if(!Me){_e.className+=" prettyprinted";var Ye=xe.lang;if(!Ye){Ye=Le.match(Be);var nt;!Ye&&(nt=le(_e))&&$e.test(nt.tagName)&&(Ye=nt.className.match(Be)),Ye&&(Ye=Ye[1])}var pt;if(Xe.test(_e.tagName))pt=1;else{var st=_e.currentStyle,tt=re.defaultView,Pt=st?st.whiteSpace:tt&&tt.getComputedStyle?tt.getComputedStyle(_e,null).getPropertyValue("white-space"):0;pt=Pt&&Pt.substring(0,3)==="pre"}var wt=xe.linenums;(wt=wt==="true"||+wt)||(wt=Le.match(/\blinenums\b(?::(\d+))?/),wt=wt?wt[1]&&wt[1].length?+wt[1]:!0:!1),wt&&se(_e,wt,pt);var Vt={langExtension:Ye,sourceNode:_e,numberLines:wt,pre:pt,sourceCode:null,basePos:null,spans:null,decorations:null};D(Vt)}}}We<Te.length?g.setTimeout(pe,250):typeof te=="function"&&te()}pe()}var Y=g.PR={createSimpleLexer:ue,registerLangHandler:ae,sourceDecorator:be,PR_ATTRIB_NAME:J,PR_ATTRIB_VALUE:$,PR_COMMENT:k,PR_DECLARATION:U,PR_KEYWORD:R,PR_LITERAL:b,PR_NOCODE:z,PR_PLAIN:_,PR_PUNCTUATION:x,PR_SOURCE:P,PR_STRING:i,PR_TAG:B,PR_TYPE:d,prettyPrintOne:S?g.prettyPrintOne=F:c=F,prettyPrint:C=S?g.prettyPrint=W:C=W},Z=g.define;typeof Z=="function"&&Z.amd&&Z("google-code-prettify",[],function(){return Y})})()},STEk:function(M,ne,N){"use strict";N.d(ne,"a",function(){return ae});/*! *****************************************************************************
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 I=function(Q,D){return(I=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(F,W){F.__proto__=W}||function(F,W){for(var Y in W)Object.prototype.hasOwnProperty.call(W,Y)&&(F[Y]=W[Y])})(Q,D)};function h(Q,D){function F(){this.constructor=Q}I(Q,D),Q.prototype=D===null?Object.create(D):(F.prototype=D.prototype,new F)}function S(Q,D,F,W){return new(F||(F=Promise))(function(Y,Z){function te(re){try{X(W.next(re))}catch(me){Z(me)}}function q(re){try{X(W.throw(re))}catch(me){Z(me)}}function X(re){var me;re.done?Y(re.value):(me=re.value,me instanceof F?me:new F(function(ve){ve(me)})).then(te,q)}X((W=W.apply(Q,D||[])).next())})}function L(Q,D){var F,W,Y,Z,te={label:0,sent:function(){if(1&Y[0])throw Y[1];return Y[1]},trys:[],ops:[]};return Z={next:q(0),throw:q(1),return:q(2)},typeof Symbol=="function"&&(Z[Symbol.iterator]=function(){return this}),Z;function q(X){return function(re){return function(me){if(F)throw new TypeError("Generator is already executing.");for(;te;)try{if(F=1,W&&(Y=2&me[0]?W.return:me[0]?W.throw||((Y=W.return)&&Y.call(W),0):W.next)&&!(Y=Y.call(W,me[1])).done)return Y;switch(W=0,Y&&(me=[2&me[0],Y.value]),me[0]){case 0:case 1:Y=me;break;case 4:return te.label++,{value:me[1],done:!1};case 5:te.label++,W=me[1],me=[0];continue;case 7:me=te.ops.pop(),te.trys.pop();continue;default:if(!(Y=te.trys,(Y=Y.length>0&&Y[Y.length-1])||me[0]!==6&&me[0]!==2)){te=0;continue}if(me[0]===3&&(!Y||me[1]>Y[0]&&me[1]<Y[3])){te.label=me[1];break}if(me[0]===6&&te.label<Y[1]){te.label=Y[1],Y=me;break}if(Y&&te.label<Y[2]){te.label=Y[2],te.ops.push(me);break}Y[2]&&te.ops.pop(),te.trys.pop();continue}me=D.call(Q,te)}catch(ve){me=[6,ve],W=0}finally{F=Y=0}if(5&me[0])throw me[1];return{value:me[0]?me[1]:void 0,done:!0}}([X,re])}}}function T(){for(var Q=0,D=0,F=arguments.length;D<F;D++)Q+=arguments[D].length;var W=Array(Q),Y=0;for(D=0;D<F;D++)for(var Z=arguments[D],te=0,q=Z.length;te<q;te++,Y++)W[Y]=Z[te];return W}var c=function(){function Q(){}return Q.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},Q.setAttributes=function(D,F){for(var W=0,Y=F;W<Y.length;W++){var Z=Y[W],te=Z[0],q=Z[1];D.setAttribute(te,q)}},Q.createRect=function(D,F,W){var Y=document.createElementNS("http://www.w3.org/2000/svg","rect");return Y.setAttribute("width",D.toString()),Y.setAttribute("height",F.toString()),W&&Q.setAttributes(Y,W),Y},Q.createLine=function(D,F,W,Y,Z){var te=document.createElementNS("http://www.w3.org/2000/svg","line");return te.setAttribute("x1",D.toString()),te.setAttribute("y1",F.toString()),te.setAttribute("x2",W.toString()),te.setAttribute("y2",Y.toString()),Z&&Q.setAttributes(te,Z),te},Q.createPolygon=function(D,F){var W=document.createElementNS("http://www.w3.org/2000/svg","polygon");return W.setAttribute("points",D),F&&Q.setAttributes(W,F),W},Q.createCircle=function(D,F){var W=document.createElementNS("http://www.w3.org/2000/svg","circle");return W.setAttribute("cx",(D/2).toString()),W.setAttribute("cy",(D/2).toString()),W.setAttribute("r",D.toString()),F&&Q.setAttributes(W,F),W},Q.createEllipse=function(D,F,W){var Y=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return Y.setAttribute("cx",(D/2).toString()),Y.setAttribute("cy",(F/2).toString()),Y.setAttribute("rx",(D/2).toString()),Y.setAttribute("ry",(F/2).toString()),W&&Q.setAttributes(Y,W),Y},Q.createGroup=function(D){var F=document.createElementNS("http://www.w3.org/2000/svg","g");return D&&Q.setAttributes(F,D),F},Q.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},Q.createMarker=function(D,F,W,Y,Z,te,q){var X=document.createElementNS("http://www.w3.org/2000/svg","marker");return Q.setAttributes(X,[["id",D],["orient",F],["markerWidth",W.toString()],["markerHeight",Y.toString()],["refX",Z.toString()],["refY",te.toString()]]),X.appendChild(q),X},Q.createText=function(D){var F=document.createElementNS("http://www.w3.org/2000/svg","text");return F.setAttribute("x","0"),F.setAttribute("y","0"),D&&Q.setAttributes(F,D),F},Q.createTSpan=function(D,F){var W=document.createElementNS("http://www.w3.org/2000/svg","tspan");return W.textContent=D,F&&Q.setAttributes(W,F),W},Q.createImage=function(D){var F=document.createElementNS("http://www.w3.org/2000/svg","image");return D&&Q.setAttributes(F,D),F},Q.createPoint=function(D,F){var W=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return W.x=D,W.y=F,W},Q.createPath=function(D,F){var W=document.createElementNS("http://www.w3.org/2000/svg","path");return W.setAttribute("d",D),F&&Q.setAttributes(W,F),W},Q}(),C=function(){function Q(){}return Q.addKey=function(D){Q.key=D},Object.defineProperty(Q,"isLicensed",{get:function(){return!!Q.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(Q.key)},enumerable:!1,configurable:!0}),Q}(),g=function(){function Q(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return Q.prototype.rasterize=function(D,F,W){var Y=this;return new Promise(function(Z){var te=W!==void 0?W:document.createElement("canvas");D===null&&(Y.markersOnly=!0,Y.naturalSize=!1);var q=document.createElementNS("http://www.w3.org/2000/svg","svg");q.setAttribute("xmlns","http://www.w3.org/2000/svg"),q.setAttribute("width",F.width.baseVal.valueAsString),q.setAttribute("height",F.height.baseVal.valueAsString),q.setAttribute("viewBox","0 0 "+F.viewBox.baseVal.width.toString()+" "+F.viewBox.baseVal.height.toString()),q.innerHTML=F.innerHTML,Y.naturalSize===!0?(q.width.baseVal.value=D.naturalWidth,q.height.baseVal.value=D.naturalHeight):Y.width!==void 0&&Y.height!==void 0&&(q.width.baseVal.value=Y.width,q.height.baseVal.value=Y.height),te.width=q.width.baseVal.value,te.height=q.height.baseVal.value;var X=q.outerHTML,re=te.getContext("2d");Y.markersOnly!==!0&&re.drawImage(D,0,0,te.width,te.height);var me=window.URL,ve=new Image(te.width,te.height);ve.setAttribute("crossOrigin","anonymous");var Te=new Blob([X],{type:"image/svg+xml"}),Re=me.createObjectURL(Te);ve.onload=function(){re.drawImage(ve,0,0),me.revokeObjectURL(Re);var Ie=te.toDataURL(Y.imageType,Y.imageQuality);Z(Ie)},ve.src=Re})},Q}(),s=function(){},a=function(){function Q(D){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+D+"_"}return Object.defineProperty(Q.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(Q.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(Q.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),Q.prototype.addClass=function(D){return this.styleSheet===void 0&&this.addStyleSheet(),D.name=""+this.classNamePrefix+D.localName,this.classes.push(D),this.styleSheet.sheet.insertRule("."+D.name+" {"+D.style+"}",this.styleSheet.sheet.cssRules.length),D},Q.prototype.addRule=function(D){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(D),this.styleSheet.sheet.insertRule(D.selector+" {"+D.style+"}",this.styleSheet.sheet.cssRules.length)},Q.prototype.addStyleSheet=function(){var D;this.styleSheet=document.createElement("style"),((D=this.styleSheetRoot)!==null&&D!==void 0?D:document.head).appendChild(this.styleSheet),this.addRule(new r("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new r("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new r("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new f("fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new f("fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},Q.prototype.removeStyleSheet=function(){var D;this.styleSheet&&(((D=this.styleSheetRoot)!==null&&D!==void 0?D:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},Q}(),r=function(Q,D){this.selector=Q,this.style=D},f=function(Q,D){this.localName=Q,this.style=D},p=function(){function Q(D,F,W,Y,Z){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=D,this.displayMode=F,this.markerItems=W,this.uiStyleSettings=Y,this.styles=Z,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return Q.prototype.show=function(D){var F=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=D,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var W=document.createElement("div");W.className=this.toolbarBlockStyleClass.name,W.style.whiteSpace="nowrap",this.uiContainer.appendChild(W),this.addActionButton(W,'<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(W,'<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(W,'<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(W,'<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(W,'<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(W,'<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(W,'<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(W,'<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(Z){var te=document.createElement("div");te.className=""+F.toolbarButtonStyleClass.name,te.setAttribute("data-type-name",Z.typeName),te.innerHTML=Z.icon,te.addEventListener("click",function(){F.markerToolbarButtonClicked(te,Z)}),F.buttons.push(te),F.markerButtons.push(te)}),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 Y=document.createElement("div");Y.className=this.toolbarBlockStyleClass.name,Y.style.whiteSpace="nowrap",Y.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(Y),this.addActionButton(Y,'<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(Y,'<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()},Q.prototype.addButtonClickListener=function(D){this.buttonClickListeners.push(D)},Q.prototype.removeButtonClickListener=function(D){this.buttonClickListeners.indexOf(D)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(D),1)},Q.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},Q.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var D=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<D||F===D&&this.markerButtons.length-1===D?this.markerButtonBlock.appendChild(this.markerButtons[F]):(F===D&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[F]))}},Q.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")},Q.prototype.resetButtonStyles=function(){var D=this;this.buttons.forEach(function(F){F.className=F.className.replace(D.uiStyleSettings.toolbarButtonStyleColorsClassName?D.uiStyleSettings.toolbarButtonStyleColorsClassName:D.toolbarButtonStyleColorsClass.name,"").trim(),F.className=F.className.replace(D.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?D.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:D.toolbarActiveButtonStyleColorsClass.name,"").trim(),F.className+=" "+(D.uiStyleSettings.toolbarButtonStyleColorsClassName?D.uiStyleSettings.toolbarButtonStyleColorsClassName:D.toolbarButtonStyleColorsClass.name)})},Q.prototype.addActionButton=function(D,F,W){var Y=this,Z=document.createElement("div");switch(Z.className=""+this.toolbarButtonStyleClass.name,Z.innerHTML=F,Z.setAttribute("data-action",W),Z.addEventListener("click",function(){Y.actionToolbarButtonClicked(Z,W)}),W){case"select":Z.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":Z.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":Z.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":Z.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":Z.style.fill=this.uiStyleSettings.closeButtonColor}D.appendChild(Z),this.buttons.push(Z)},Q.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new f("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 f("toolbar_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
`)),this.toolbarBlockStyleClass=this.styles.addClass(new f("toolbar-block",`
display: inline-block;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new f("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 f("toolbar-overflow-block_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`));var D=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new f("toolbar_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*D)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*D)+`px;
padding: `+D+`px;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new f("toolbar_button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new f("toolbar_active_button",`
fill: `+this.uiStyleSettings.toolbarColor+`;
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new r("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`)),this.styles.addRule(new r("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`))},Q.prototype.markerToolbarButtonClicked=function(D,F){this.setActiveButton(D),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(W){return W("marker",F)}),this.markerButtonOverflowBlock.style.display="none"},Q.prototype.actionToolbarButtonClicked=function(D,F){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(W){return W("action",F)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},Q.prototype.setActiveButton=function(D){this.resetButtonStyles(),D.className=D.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),D.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},Q.prototype.setActiveMarkerButton=function(D){var F=this.markerButtons.find(function(W){return W.getAttribute("data-type-name")===D});F&&this.setActiveButton(F)},Q.prototype.setCurrentMarker=function(D){var F=this;this.currentMarker=D,this.buttons.filter(function(W){return/delete|notes/.test(W.getAttribute("data-action"))}).forEach(function(W){F.currentMarker===void 0?(W.style.fillOpacity="0.4",W.style.pointerEvents="none"):(W.style.fillOpacity="1",W.style.pointerEvents="all")})},Q}(),m=function(){function Q(D,F,W,Y){this.panels=[],this.panelButtons=[],this.markerjsContainer=D,this.displayMode=F,this.uiStyleSettings=W,this.styles=Y,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return Q.prototype.addStyles=function(){var D;this.toolboxStyleClass=this.styles.addClass(new f("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 f("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var F=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new f("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new f("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new f("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 f("toolbox-panel-row_colors",`
background-color: `+((D=this.uiStyleSettings.toolboxBackgroundColor)!==null&&D!==void 0?D:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new f("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 f("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new f("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new r("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new r("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},Q.prototype.show=function(D){var F;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=D,this.uiContainer.className=this.toolboxStyleClass.name+" "+((F=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&F!==void 0?F:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},Q.prototype.setPanelButtons=function(D){var F,W,Y=this;this.panels=D,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+" "+((W=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&W!==void 0?W:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(Z){var te;Z.uiStyleSettings=Y.uiStyleSettings;var q=document.createElement("div");q.className=Y.toolboxButtonStyleClass.name+" "+((te=Y.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&te!==void 0?te:Y.toolboxButtonStyleColorsClass.name),q.innerHTML=Z.icon,q.title=Z.title,q.addEventListener("click",function(){Y.panelButtonClick(Z)}),Y.panelButtons.push(q),Y.buttonRow.appendChild(q)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},Q.prototype.panelButtonClick=function(D){var F=this,W=-1;if(D!==this.activePanel){W=this.panels.indexOf(D),this.panelRow.innerHTML="";var Y=D.getUi();Y.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(Y),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=D}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(Z,te){var q,X;Z.className=F.toolboxButtonStyleClass.name+" "+(te===W?""+((q=F.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&q!==void 0?q:F.toolboxActiveButtonStyleColorsClass.name):""+((X=F.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&X!==void 0?X:F.toolboxButtonStyleColorsClass.name))})},Q}(),E=function(Q,D){this.title=Q,this.icon=D},y=function(Q){function D(F,W,Y,Z){var te=Q.call(this,F,Z||'<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 te.colors=[],te.addTransparent=!1,te.colorBoxes=[],te.colors=W,te.currentColor=Y,te.setCurrentColor=te.setCurrentColor.bind(te),te.getColorBox=te.getColorBox.bind(te),te}return h(D,Q),D.prototype.getUi=function(){var F=this,W=document.createElement("div");return W.style.overflow="hidden",W.style.whiteSpace="nowrap",this.colors.forEach(function(Y){var Z=F.getColorBox(Y);W.appendChild(Z),F.colorBoxes.push(Z)}),W},D.prototype.getColorBox=function(F){var W=this,Y=this.uiStyleSettings.toolbarHeight/4,Z=this.uiStyleSettings.toolbarHeight-Y,te=document.createElement("div");te.style.display="inline-block",te.style.boxSizing="content-box",te.style.width=Z-2+"px",te.style.height=Z-2+"px",te.style.padding="1px",te.style.marginRight="2px",te.style.marginBottom="2px",te.style.borderWidth="2px",te.style.borderStyle="solid",te.style.borderRadius=(Z+2)/2+"px",te.style.borderColor=F===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",te.addEventListener("click",function(){W.setCurrentColor(F,te)});var q=document.createElement("div");return q.style.display="inline-block",q.style.width=Z-2+"px",q.style.height=Z-2+"px",q.style.backgroundColor=F,q.style.borderRadius=Z/2+"px",F==="transparent"&&(q.style.fill=this.uiStyleSettings.toolboxAccentColor,q.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>`),te.appendChild(q),te},D.prototype.setCurrentColor=function(F,W){var Y=this;this.currentColor=F,this.colorBoxes.forEach(function(Z){Z.style.borderColor=Z===W?Y.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(F)},D}(E),u=function(){function Q(D,F,W){this._state="new",this._isSelected=!1,this._container=D,this._overlayContainer=F,this.globalSettings=W,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(Q.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),Q.prototype.ownsTarget=function(D){return!1},Object.defineProperty(Q.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),Q.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},Q.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},Q.prototype.pointerDown=function(D,F){},Q.prototype.dblClick=function(D,F){},Q.prototype.manipulate=function(D){},Q.prototype.pointerUp=function(D){this.stateChanged()},Q.prototype.dispose=function(){},Q.prototype.addMarkerVisualToContainer=function(D){this.container.childNodes.length>0?this.container.insertBefore(D,this.container.childNodes[0]):this.container.appendChild(D)},Q.prototype.getState=function(){return{typeName:Q.typeName,state:this.state,notes:this.notes}},Q.prototype.restoreState=function(D){this._state=D.state,this.notes=D.notes},Q.prototype.scale=function(D,F){},Q.prototype.colorChanged=function(D){this.onColorChanged&&this.onColorChanged(D),this.stateChanged()},Q.prototype.fillColorChanged=function(D){this.onFillColorChanged&&this.onFillColorChanged(D),this.stateChanged()},Q.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var D=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),D.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(D)&&this.onStateChanged(this)}},Q.typeName="MarkerBase",Q}(),n=function(){function Q(){this.findGripByVisual=this.findGripByVisual.bind(this)}return Q.prototype.findGripByVisual=function(D){return this.topLeft.ownsTarget(D)?this.topLeft:this.topCenter.ownsTarget(D)?this.topCenter:this.topRight.ownsTarget(D)?this.topRight:this.centerLeft.ownsTarget(D)?this.centerLeft:this.centerRight.ownsTarget(D)?this.centerRight:this.bottomLeft.ownsTarget(D)?this.bottomLeft:this.bottomCenter.ownsTarget(D)?this.bottomCenter:this.bottomRight.ownsTarget(D)?this.bottomRight:void 0},Q}(),o=function(){function Q(){this.GRIP_SIZE=10,this.visual=c.createGroup(),this.visual.appendChild(c.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(c.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return Q.prototype.ownsTarget=function(D){return D===this.visual||D===this.visual.childNodes[0]||D===this.visual.childNodes[1]},Q}(),l=function(){function Q(){}return Q.toITransformMatrix=function(D){return{a:D.a,b:D.b,c:D.c,d:D.d,e:D.e,f:D.f}},Q.toSVGMatrix=function(D,F){return D.a=F.a,D.b=F.b,D.c=F.c,D.d=F.d,D.e=F.e,D.f=F.f,D},Q}(),w=function(Q){function D(F,W,Y){var Z=Q.call(this,F,W,Y)||this;return Z.left=0,Z.top=0,Z.width=0,Z.height=0,Z.defaultSize={x:50,y:20},Z.offsetX=0,Z.offsetY=0,Z.rotationAngle=0,Z.CB_DISTANCE=10,Z._suppressMarkerCreateEvent=!1,Z.container.transform.baseVal.appendItem(c.createTransform()),Z.setupControlBox(),Z}return h(D,Q),Object.defineProperty(D.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(D.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(D.prototype,"visual",{get:function(){return this._visual},set:function(F){this._visual=F;var W=c.createTransform();this._visual.transform.baseVal.appendItem(W)},enumerable:!1,configurable:!0}),D.prototype.ownsTarget=function(F){return!!Q.prototype.ownsTarget.call(this,F)||!!(this.controlGrips.findGripByVisual(F)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(F))},D.prototype.pointerDown=function(F,W){Q.prototype.pointerDown.call(this,F,W),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 Y=this.unrotatePoint(F);if(this.manipulationStartX=Y.x,this.manipulationStartY=Y.y,this.offsetX=Y.x-this.left,this.offsetY=Y.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(W),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(W)){this.activeGrip=this.rotatorGrip;var Z=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=Z.x-this.width/2,this.top=Z.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var te=this.container.transform.baseVal.getItem(0);te.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(te,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},D.prototype.pointerUp=function(F){var W=this.state;Q.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",W==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},D.prototype.moveVisual=function(F){this.visual.style.transform="translate("+F.x+"px, "+F.y+"px)"},D.prototype.manipulate=function(F){var W=this.unrotatePoint(F);this.state==="creating"?this.resize(F):this.state==="move"?(this.left=this.manipulationStartLeft+(W.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(W.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(W):this.state==="rotate"&&this.rotate(F)},D.prototype.resize=function(F){var W=this.manipulationStartLeft,Y=this.manipulationStartWidth,Z=this.manipulationStartTop,te=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:W=this.manipulationStartLeft+F.x-this.manipulationStartX,Y=this.manipulationStartWidth+this.manipulationStartLeft-W;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:Y=this.manipulationStartWidth+F.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:Z=this.manipulationStartTop+F.y-this.manipulationStartY,te=this.manipulationStartHeight+this.manipulationStartTop-Z;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:te=this.manipulationStartHeight+F.y-this.manipulationStartY}Y>=0?(this.left=W,this.width=Y):(this.left=W+Y,this.width=-Y),te>=0?(this.top=Z,this.height=te):(this.top=Z+te,this.height=-te),this.setSize()},D.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},D.prototype.rotate=function(F){if(Math.abs(F.x-this.centerX)>.1){var W=Math.sign(F.x-this.centerX);this.rotationAngle=180*Math.atan((F.y-this.centerY)/(F.x-this.centerX))/Math.PI+90*W,this.applyRotation()}},D.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)},D.prototype.rotatePoint=function(F){if(this.rotationAngle===0)return F;var W=this.container.getCTM(),Y=c.createPoint(F.x,F.y);return{x:(Y=Y.matrixTransform(W)).x,y:Y.y}},D.prototype.unrotatePoint=function(F){if(this.rotationAngle===0)return F;var W=this.container.getCTM();W=W.inverse();var Y=c.createPoint(F.x,F.y);return{x:(Y=Y.matrixTransform(W)).x,y:Y.y}},D.prototype.select=function(){Q.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},D.prototype.deselect=function(){Q.prototype.deselect.call(this),this.controlBox.style.display="none"},D.prototype.setupControlBox=function(){this.controlBox=c.createGroup();var F=c.createTransform();F.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(F),this.container.appendChild(this.controlBox),this.controlRect=c.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=c.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 n,this.addControlGrips(),this.controlBox.style.display="none"},D.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()},D.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()},D.prototype.createGrip=function(){var F=new o;return F.visual.transform.baseVal.appendItem(c.createTransform()),this.controlBox.appendChild(F.visual),F},D.prototype.positionGrips=function(){var F=this.controlGrips.topLeft.GRIP_SIZE,W=-F/2,Y=W,Z=(this.width+this.CB_DISTANCE)/2-F/2,te=(this.height+this.CB_DISTANCE)/2-F/2,q=this.height+this.CB_DISTANCE-F/2,X=this.width+this.CB_DISTANCE-F/2;this.positionGrip(this.controlGrips.topLeft.visual,W,Y),this.positionGrip(this.controlGrips.topCenter.visual,Z,Y),this.positionGrip(this.controlGrips.topRight.visual,X,Y),this.positionGrip(this.controlGrips.centerLeft.visual,W,te),this.positionGrip(this.controlGrips.centerRight.visual,X,te),this.positionGrip(this.controlGrips.bottomLeft.visual,W,q),this.positionGrip(this.controlGrips.bottomCenter.visual,Z,q),this.positionGrip(this.controlGrips.bottomRight.visual,X,q),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,Z,Y-3*this.CB_DISTANCE)},D.prototype.positionGrip=function(F,W,Y){var Z=F.transform.baseVal.getItem(0);Z.setTranslate(W,Y),F.transform.baseVal.replaceItem(Z,0)},D.prototype.hideControlBox=function(){this.controlBox.style.display="none"},D.prototype.showControlBox=function(){this.controlBox.style.display=""},D.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:l.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:l.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},Q.prototype.getState.call(this))},D.prototype.restoreState=function(F){Q.prototype.restoreState.call(this,F);var W=F;this.left=W.left,this.top=W.top,this.width=W.width,this.height=W.height,this.rotationAngle=W.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(l.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,W.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(l.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,W.containerTransformMatrix))},D.prototype.scale=function(F,W){Q.prototype.scale.call(this,F,W);var Y=this.rotatePoint({x:this.left,y:this.top}),Z=this.unrotatePoint({x:Y.x*F,y:Y.y*W});this.left=Z.x,this.top=Z.y,this.width=this.width*F,this.height=this.height*W,this.adjustControlBox()},D}(u),v=function(Q){function D(F,W,Y){var Z=Q.call(this,F,W,Y)||this;return Z.fillColor="transparent",Z.strokeColor="transparent",Z.strokeWidth=0,Z.strokeDasharray="",Z.opacity=1,Z.setStrokeColor=Z.setStrokeColor.bind(Z),Z.setFillColor=Z.setFillColor.bind(Z),Z.setStrokeWidth=Z.setStrokeWidth.bind(Z),Z.setStrokeDasharray=Z.setStrokeDasharray.bind(Z),Z.createVisual=Z.createVisual.bind(Z),Z}return h(D,Q),D.prototype.ownsTarget=function(F){return!(!Q.prototype.ownsTarget.call(this,F)&&F!==this.visual)},D.prototype.createVisual=function(){this.visual=c.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)},D.prototype.pointerDown=function(F,W){Q.prototype.pointerDown.call(this,F,W),this.state==="new"&&(this.createVisual(),this.moveVisual(F),this._state="creating")},D.prototype.manipulate=function(F){Q.prototype.manipulate.call(this,F)},D.prototype.resize=function(F){Q.prototype.resize.call(this,F),this.setSize()},D.prototype.setSize=function(){Q.prototype.setSize.call(this),c.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},D.prototype.pointerUp=function(F){Q.prototype.pointerUp.call(this,F),this.setSize()},D.prototype.setStrokeColor=function(F){this.strokeColor=F,this.visual&&c.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(F),this.stateChanged()},D.prototype.setFillColor=function(F){this.fillColor=F,this.visual&&c.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},D.prototype.setStrokeWidth=function(F){this.strokeWidth=F,this.visual&&c.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},D.prototype.setStrokeDasharray=function(F){this.strokeDasharray=F,this.visual&&c.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},D.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},Q.prototype.getState.call(this))},D.prototype.restoreState=function(F){var W=F;this.fillColor=W.fillColor,this.strokeColor=W.strokeColor,this.strokeWidth=W.strokeWidth,this.strokeDasharray=W.strokeDasharray,this.opacity=W.opacity,this.createVisual(),Q.prototype.restoreState.call(this,F),this.setSize()},D.prototype.scale=function(F,W){Q.prototype.scale.call(this,F,W),this.setSize()},D.title="Rectangle marker",D}(w),i=function(Q){function D(F,W,Y,Z){var te=Q.call(this,F,Z||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return te.widths=[],te.widthBoxes=[],te.widths=W,te.currentWidth=Y,te.setCurrentWidth=te.setCurrentWidth.bind(te),te}return h(D,Q),D.prototype.getUi=function(){var F=this,W=document.createElement("div");return W.style.display="flex",W.style.overflow="hidden",W.style.flexGrow="2",this.widths.forEach(function(Y){var Z=document.createElement("div");Z.style.display="flex",Z.style.flexGrow="2",Z.style.alignItems="center",Z.style.justifyContent="space-between",Z.style.padding="5px",Z.style.borderWidth="2px",Z.style.borderStyle="solid",Z.style.borderColor=Y===F.currentWidth?F.uiStyleSettings.toolboxAccentColor:"transparent",Z.addEventListener("click",function(){F.setCurrentWidth(Y,Z)}),W.appendChild(Z);var te=document.createElement("div");te.innerText=Y.toString(),te.style.marginRight="5px",Z.appendChild(te);var q=document.createElement("div");q.style.minHeight="20px",q.style.flexGrow="2",q.style.display="flex",q.style.alignItems="center";var X=document.createElement("hr");X.style.minWidth="20px",X.style.border="0px",X.style.borderTop=Y+"px solid "+F.uiStyleSettings.toolboxColor,X.style.flexGrow="2",q.appendChild(X),Z.appendChild(q),F.widthBoxes.push(Z)}),W},D.prototype.setCurrentWidth=function(F,W){var Y=this;this.currentWidth=F,this.widthBoxes.forEach(function(Z){Z.style.borderColor=Z===W?Y.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},D}(E),R=function(Q){function D(F,W,Y,Z){var te=Q.call(this,F,Z||'<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 te.styles=[],te.styleBoxes=[],te.styles=W,te.currentStyle=Y,te.setCurrentStyle=te.setCurrentStyle.bind(te),te}return h(D,Q),D.prototype.getUi=function(){var F=this,W=document.createElement("div");return W.style.display="flex",W.style.overflow="hidden",W.style.flexGrow="2",this.styles.forEach(function(Y){var Z=document.createElement("div");Z.style.display="flex",Z.style.alignItems="center",Z.style.justifyContent="space-between",Z.style.padding="5px",Z.style.borderWidth="2px",Z.style.borderStyle="solid",Z.style.overflow="hidden",Z.style.maxWidth=100/F.styles.length-5+"%",Z.style.borderColor=Y===F.currentStyle?F.uiStyleSettings.toolboxAccentColor:"transparent",Z.addEventListener("click",function(){F.setCurrentStyle(Y,Z)}),W.appendChild(Z);var te=document.createElement("div");te.style.minHeight="20px",te.style.flexGrow="2",te.style.overflow="hidden";var q=`<svg width="100" height="20">
<line x1="0" y1="10" x2="100" y2="10" stroke="`+F.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(Y!==""?'stroke-dasharray="'+Y+'"':"")+` />
</svg>`;te.innerHTML=q,Z.appendChild(te),F.styleBoxes.push(Z)}),W},D.prototype.setCurrentStyle=function(F,W){var Y=this;this.currentStyle=F,this.styleBoxes.forEach(function(Z){Z.style.borderColor=Z===W?Y.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},D}(E),k=function(Q){function D(F,W,Y){var Z=Q.call(this,F,W,Y)||this;return Z.strokeColor=Y.defaultColor,Z.strokeWidth=Y.defaultStrokeWidth,Z.strokeDasharray=Y.defaultStrokeDasharray,Z.strokePanel=new y("Line color",Y.defaultColorSet,Y.defaultColor),Z.strokePanel.onColorChanged=Z.setStrokeColor,Z.strokeWidthPanel=new i("Line width",Y.defaultStrokeWidths,Y.defaultStrokeWidth),Z.strokeWidthPanel.onWidthChanged=Z.setStrokeWidth,Z.strokeStylePanel=new R("Line style",Y.defaultStrokeDasharrays,Y.defaultStrokeDasharray),Z.strokeStylePanel.onStyleChanged=Z.setStrokeDasharray,Z}return h(D,Q),Object.defineProperty(D.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),D.prototype.getState=function(){var F=Q.prototype.getState.call(this);return F.typeName=D.typeName,F},D.typeName="FrameMarker",D.title="Frame marker",D.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',D}(v),d=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},b=function(Q){function D(F,W,Y){var Z=Q.call(this,F,W,Y)||this;return Z.x1=0,Z.y1=0,Z.x2=0,Z.y2=0,Z.defaultLength=50,Z.manipulationStartX=0,Z.manipulationStartY=0,Z.manipulationStartX1=0,Z.manipulationStartY1=0,Z.manipulationStartX2=0,Z.manipulationStartY2=0,Z.setupControlBox(),Z}return h(D,Q),D.prototype.ownsTarget=function(F){return!!Q.prototype.ownsTarget.call(this,F)||!(!this.grip1.ownsTarget(F)&&!this.grip2.ownsTarget(F))},D.prototype.pointerDown=function(F,W){Q.prototype.pointerDown.call(this,F,W),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(W)?this.activeGrip=this.grip1:this.grip2.ownsTarget(W)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},D.prototype.pointerUp=function(F){var W=this.state;Q.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",W==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},D.prototype.adjustVisual=function(){},D.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)},D.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()},D.prototype.select=function(){Q.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},D.prototype.deselect=function(){Q.prototype.deselect.call(this),this.controlBox.style.display="none"},D.prototype.setupControlBox=function(){this.controlBox=c.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},D.prototype.adjustControlBox=function(){this.positionGrips()},D.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},D.prototype.createGrip=function(){var F=new o;return F.visual.transform.baseVal.appendItem(c.createTransform()),this.controlBox.appendChild(F.visual),F},D.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)},D.prototype.positionGrip=function(F,W,Y){var Z=F.transform.baseVal.getItem(0);Z.setTranslate(W,Y),F.transform.baseVal.replaceItem(Z,0)},D.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},Q.prototype.getState.call(this))},D.prototype.restoreState=function(F){Q.prototype.restoreState.call(this,F);var W=F;this.x1=W.x1,this.y1=W.y1,this.x2=W.x2,this.y2=W.y2},D.prototype.scale=function(F,W){Q.prototype.scale.call(this,F,W),this.x1=this.x1*F,this.y1=this.y1*W,this.x2=this.x2*F,this.y2=this.y2*W,this.adjustVisual(),this.adjustControlBox()},D}(u),x=function(Q){function D(F,W,Y){var Z=Q.call(this,F,W,Y)||this;return Z.strokeColor="transparent",Z.strokeWidth=0,Z.strokeDasharray="",Z.setStrokeColor=Z.setStrokeColor.bind(Z),Z.setStrokeWidth=Z.setStrokeWidth.bind(Z),Z.setStrokeDasharray=Z.setStrokeDasharray.bind(Z),Z.strokeColor=Y.defaultColor,Z.strokeWidth=Y.defaultStrokeWidth,Z.strokeDasharray=Y.defaultStrokeDasharray,Z.strokePanel=new y("Line color",Y.defaultColorSet,Y.defaultColor),Z.strokePanel.onColorChanged=Z.setStrokeColor,Z.strokeWidthPanel=new i("Line width",Y.defaultStrokeWidths,Y.defaultStrokeWidth),Z.strokeWidthPanel.onWidthChanged=Z.setStrokeWidth,Z.strokeStylePanel=new R("Line style",Y.defaultStrokeDasharrays,Y.defaultStrokeDasharray),Z.strokeStylePanel.onStyleChanged=Z.setStrokeDasharray,Z}return h(D,Q),D.prototype.ownsTarget=function(F){return!(!Q.prototype.ownsTarget.call(this,F)&&F!==this.visual&&F!==this.selectorLine&&F!==this.visibleLine)},D.prototype.createVisual=function(){this.visual=c.createGroup(),this.selectorLine=c.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=c.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)},D.prototype.pointerDown=function(F,W){Q.prototype.pointerDown.call(this,F,W),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},D.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()),c.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),c.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),c.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},D.prototype.setStrokeColor=function(F){this.strokeColor=F,this.adjustVisual(),this.colorChanged(F)},D.prototype.setStrokeWidth=function(F){this.strokeWidth=F,this.adjustVisual()},D.prototype.setStrokeDasharray=function(F){this.strokeDasharray=F,this.adjustVisual(),this.stateChanged()},Object.defineProperty(D.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),D.prototype.getState=function(){var F=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},Q.prototype.getState.call(this));return F.typeName=D.typeName,F},D.prototype.restoreState=function(F){Q.prototype.restoreState.call(this,F);var W=F;this.strokeColor=W.strokeColor,this.strokeWidth=W.strokeWidth,this.strokeDasharray=W.strokeDasharray,this.createVisual(),this.adjustVisual()},D.typeName="LineMarker",D.title="Line marker",D.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',D}(b),_=function(Q){function D(F,W,Y,Z){var te=Q.call(this,F,Z||'<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 te.fonts=[],te.fontBoxes=[],te.fonts=W,te.currentFont=Y,te.setCurrentFont=te.setCurrentFont.bind(te),te}return h(D,Q),D.prototype.getUi=function(){var F=this,W=document.createElement("div");return W.style.overflow="hidden",W.style.flexGrow="2",this.fonts.forEach(function(Y){var Z=document.createElement("div");Z.style.display="inline-block",Z.style.alignItems="center",Z.style.justifyContent="space-between",Z.style.padding="5px",Z.style.borderWidth="2px",Z.style.borderStyle="solid",Z.style.overflow="hidden",Z.style.maxWidth=100/F.fonts.length-5+"%",Z.style.borderColor=Y===F.currentFont?F.uiStyleSettings.toolboxAccentColor:"transparent",Z.addEventListener("click",function(){F.setCurrentFont(Y,Z)}),W.appendChild(Z);var te=document.createElement("div");te.style.display="flex",te.style.minHeight="20px",te.style.flexGrow="2",te.style.fontFamily=Y,te.style.overflow="hidden";var q=document.createElement("div");q.style.whiteSpace="nowrap",q.style.overflow="hidden",q.style.textOverflow="ellipsis",q.innerHTML="The quick brown fox jumps over the lazy dog",te.appendChild(q),Z.appendChild(te),F.fontBoxes.push(Z)}),W},D.prototype.setCurrentFont=function(F,W){var Y=this;this.currentFont=F,this.fontBoxes.forEach(function(Z){Z.style.borderColor=Z===W?Y.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},D}(E),B=function(Q){function D(F,W,Y){var Z=Q.call(this,F,W,Y)||this;return Z.color="transparent",Z.padding=5,Z.DEFAULT_TEXT="your text here",Z.text=Z.DEFAULT_TEXT,Z.isMoved=!1,Z.color=Y.defaultColor,Z.fontFamily=Y.defaultFontFamily,Z.defaultSize={x:100,y:30},Z.setColor=Z.setColor.bind(Z),Z.setFont=Z.setFont.bind(Z),Z.renderText=Z.renderText.bind(Z),Z.sizeText=Z.sizeText.bind(Z),Z.textEditDivClicked=Z.textEditDivClicked.bind(Z),Z.showTextEditor=Z.showTextEditor.bind(Z),Z.setSize=Z.setSize.bind(Z),Z.positionTextEditor=Z.positionTextEditor.bind(Z),Z.colorPanel=new y("Color",Y.defaultColorSet,Y.defaultColor),Z.colorPanel.onColorChanged=Z.setColor,Z.fontFamilyPanel=new _("Font",Y.defaultFontFamilies,Y.defaultFontFamily),Z.fontFamilyPanel.onFontChanged=Z.setFont,Z}return h(D,Q),D.prototype.ownsTarget=function(F){if(Q.prototype.ownsTarget.call(this,F)||F===this.visual||F===this.textElement||F===this.bgRectangle)return!0;var W=!1;return this.textElement.childNodes.forEach(function(Y){Y===F&&(W=!0)}),W},D.prototype.createVisual=function(){this.visual=c.createGroup(),this.bgRectangle=c.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=c.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(c.createTransform()),this.textElement.transform.baseVal.appendItem(c.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},D.prototype.pointerDown=function(F,W){Q.prototype.pointerDown.call(this,F,W),this.isMoved=!1,this.pointerDownPoint=F,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(F),this._state="creating")},D.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(W){F.textElement.appendChild(c.createTSpan(W.trim()===""?" ":W.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},D.prototype.getTextScale=function(){var F=this.textElement.getBBox(),W=1;if(F.width>0&&F.height>0){var Y=(1*this.width-this.width*this.padding*2/100)/F.width,Z=(1*this.height-this.height*this.padding*2/100)/F.height;W=Math.min(Y,Z)}return W},D.prototype.getTextPosition=function(F){var W=this.textElement.getBBox(),Y=0,Z=0;return W.width>0&&W.height>0&&(Y=(this.width-W.width*F)/2,Z=this.height/2-W.height*F/2),{x:Y,y:Z}},D.prototype.sizeText=function(){var F=this.textElement.getBBox(),W=this.getTextScale(),Y=this.getTextPosition(W);Y.y-=F.y*W,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+Y.x+"px, "+Y.y+"px) scale("+W+", "+W+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(Y.x,Y.y),this.textElement.transform.baseVal.getItem(1).setScale(W,W))},D.prototype.manipulate=function(F){Q.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)},D.prototype.resize=function(F){Q.prototype.resize.call(this,F),this.isMoved=!0,this.setSize(),this.sizeText()},D.prototype.setSize=function(){Q.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(c.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),c.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},D.prototype.pointerUp=function(F){var W=this.state;W==="creating"&&(this._suppressMarkerCreateEvent=!0),Q.prototype.pointerUp.call(this,F),this.setSize(),(W==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},D.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(W){W.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var W=Number.parseFloat(F.textEditor.style.fontSize);F.textEditor.clientWidth>=Number.parseInt(F.textEditor.style.maxWidth)&&W>.9;)W-=.1,F.textEditor.style.fontSize=Math.max(W,.9)+"em"}),this.textEditor.addEventListener("keyup",function(W){W.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(W){if(W.clipboardData){var Y=W.clipboardData.getData("text"),Z=window.getSelection();if(!Z.rangeCount)return!1;Z.deleteFromDocument(),Z.getRangeAt(0).insertNode(document.createTextNode(Y)),W.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")},D.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var F=this.getTextScale(),W=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),Y=this.textElement.getBBox(),Z={x:Y.width*F,y:Y.height*F};W.x-=Z.x/2,W.y-=Z.y/2,this.textEditor.style.top=W.y+"px",this.textEditor.style.left=W.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-W.x+"px",this.textEditor.style.fontSize=Math.max(16*F,12)+"px",this.textElement.style.display="none"}},D.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()},D.prototype.select=function(){Q.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},D.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),Q.prototype.deselect.call(this)},D.prototype.dblClick=function(F,W){Q.prototype.dblClick.call(this,F,W),this.showTextEditor()},D.prototype.setColor=function(F){this.textElement&&c.setAttributes(this.textElement,[["fill",F]]),this.color=F,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(F)},D.prototype.setFont=function(F){this.textElement&&c.setAttributes(this.textElement,[["font-family",F]]),this.fontFamily=F,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},D.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},D.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(D.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),D.prototype.getState=function(){var F=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},Q.prototype.getState.call(this));return F.typeName=D.typeName,F},D.prototype.restoreState=function(F){var W=F;this.color=W.color,this.fontFamily=W.fontFamily,this.padding=W.padding,this.text=W.text,this.createVisual(),Q.prototype.restoreState.call(this,F),this.setSize()},D.prototype.scale=function(F,W){Q.prototype.scale.call(this,F,W),this.setSize(),this.sizeText(),this.positionTextEditor()},D.typeName="TextMarker",D.title="Text marker",D.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>',D}(w),U=function(Q){function D(F,W,Y){var Z=Q.call(this,F,W,Y)||this;return Z.color="transparent",Z.lineWidth=3,Z.drawing=!1,Z.pixelRatio=1,Z.color=Y.defaultColor,Z.lineWidth=Y.defaultStrokeWidth,Z.pixelRatio=Y.freehandPixelRatio,Z.setColor=Z.setColor.bind(Z),Z.addCanvas=Z.addCanvas.bind(Z),Z.finishCreation=Z.finishCreation.bind(Z),Z.setLineWidth=Z.setLineWidth.bind(Z),Z.colorPanel=new y("Color",Y.defaultColorSet,Y.defaultColor),Z.colorPanel.onColorChanged=Z.setColor,Z.lineWidthPanel=new i("Line width",Y.defaultStrokeWidths,Y.defaultStrokeWidth),Z.lineWidthPanel.onWidthChanged=Z.setLineWidth,Z}return h(D,Q),D.prototype.ownsTarget=function(F){return!(!Q.prototype.ownsTarget.call(this,F)&&F!==this.visual&&F!==this.drawingImage)},D.prototype.createVisual=function(){this.visual=c.createGroup(),this.drawingImage=c.createImage(),this.visual.appendChild(this.drawingImage);var F=c.createTransform();this.visual.transform.baseVal.appendItem(F),this.addMarkerVisualToContainer(this.visual)},D.prototype.pointerDown=function(F,W){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):Q.prototype.pointerDown.call(this,F,W)},D.prototype.manipulate=function(F){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(F.x,F.y),this.canvasContext.stroke()):Q.prototype.manipulate.call(this,F)},D.prototype.resize=function(F){Q.prototype.resize.call(this,F),c.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),c.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},D.prototype.pointerUp=function(F){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):Q.prototype.pointerUp.call(this,F)},D.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)},D.prototype.select=function(){this.state==="creating"&&this.finishCreation(),Q.prototype.select.call(this)},D.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),Q.prototype.deselect.call(this)},D.prototype.finishCreation=function(){for(var F=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),W=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],Y=W[0],Z=W[1],te=W[2],q=W[3],X=!1,re=0;re<this.canvasElement.height;re++)for(var me=0;me<this.canvasElement.width;me++)F.data[re*this.canvasElement.width*4+4*me+3]>0&&(X=!0,re<Z&&(Z=re),me<Y&&(Y=me),re>q&&(q=re),me>te&&(te=me));if(X){this.left=Y/this.pixelRatio,this.top=Z/this.pixelRatio,this.width=(te-Y)/this.pixelRatio,this.height=(q-Z)/this.pixelRatio;var ve=document.createElement("canvas");ve.width=te-Y,ve.height=q-Z,ve.getContext("2d").putImageData(this.canvasContext.getImageData(Y,Z,te-Y,q-Z),0,0),this.drawingImgUrl=ve.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},D.prototype.setDrawingImage=function(){c.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),c.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},D.prototype.setColor=function(F){this.color=F,this.colorChanged(F)},D.prototype.setLineWidth=function(F){this.lineWidth=F},Object.defineProperty(D.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),D.prototype.getState=function(){var F=Object.assign({drawingImgUrl:this.drawingImgUrl},Q.prototype.getState.call(this));return F.typeName=D.typeName,F},D.prototype.restoreState=function(F){this.createVisual(),Q.prototype.restoreState.call(this,F),this.drawingImgUrl=F.drawingImgUrl,this.setDrawingImage()},D.prototype.scale=function(F,W){Q.prototype.scale.call(this,F,W),this.setDrawingImage()},D.typeName="FreehandMarker",D.title="Freehand marker",D.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>',D}(w),P=function(Q){function D(F,W,Y){var Z=Q.call(this,F,Y||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return Z.typeBoxes=[],Z.currentType=W,Z.setCurrentType=Z.setCurrentType.bind(Z),Z}return h(D,Q),D.prototype.getUi=function(){var F=this,W=document.createElement("div");W.style.display="flex",W.style.overflow="hidden",W.style.flexGrow="2";for(var Y=function(q){var X="both";switch(q){case 0:X="both";break;case 1:X="start";break;case 2:X="end";break;case 3:X="none"}var re=document.createElement("div");if(re.style.display="flex",re.style.flexGrow="2",re.style.alignItems="center",re.style.justifyContent="space-between",re.style.padding="5px",re.style.borderWidth="2px",re.style.borderStyle="solid",re.style.borderColor=X===Z.currentType?Z.uiStyleSettings.toolboxAccentColor:"transparent",re.addEventListener("click",function(){F.setCurrentType(X,re)}),W.appendChild(re),X==="both"||X==="start"){var me=document.createElement("div");me.style.display="flex",me.style.alignItems="center",me.style.minHeight="20px",me.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="`+(Z.uiStyleSettings!==void 0?Z.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,me.style.marginLeft="5px",re.appendChild(me)}var ve=document.createElement("div");ve.style.display="flex",ve.style.alignItems="center",ve.style.minHeight="20px",ve.style.flexGrow="2";var Te=document.createElement("hr");if(Te.style.minWidth="20px",Te.style.border="0px",Te.style.borderTop="3px solid "+(Z.uiStyleSettings!==void 0?Z.uiStyleSettings.toolboxColor:"#eeeeee"),Te.style.flexGrow="2",ve.appendChild(Te),re.appendChild(ve),X==="both"||X==="end"){var Re=document.createElement("div");Re.style.display="flex",Re.style.alignItems="center",Re.style.minHeight="20px",Re.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="`+(Z.uiStyleSettings!==void 0?Z.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,Re.style.marginRight="5px",re.appendChild(Re)}Z.typeBoxes.push(re)},Z=this,te=0;te<4;te++)Y(te);return W},D.prototype.setCurrentType=function(F,W){var Y=this;this.currentType=F,this.typeBoxes.forEach(function(Z){Z.style.borderColor=Z===W?Y.uiStyleSettings!==void 0?Y.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},D}(E),J=function(Q){function D(F,W,Y){var Z=Q.call(this,F,W,Y)||this;return Z.arrowType="end",Z.arrowBaseHeight=10,Z.arrowBaseWidth=10,Z.getArrowPoints=Z.getArrowPoints.bind(Z),Z.setArrowType=Z.setArrowType.bind(Z),Z.arrowTypePanel=new P("Arrow type","end"),Z.arrowTypePanel.onArrowTypeChanged=Z.setArrowType,Z}return h(D,Q),D.prototype.ownsTarget=function(F){return!(!Q.prototype.ownsTarget.call(this,F)&&F!==this.arrow1&&F!==this.arrow2)},D.prototype.getArrowPoints=function(F,W){var Y=this.arrowBaseWidth+2*this.strokeWidth,Z=this.arrowBaseHeight+2*this.strokeWidth;return F-Y/2+","+(W+Z/2)+" "+F+","+(W-Z/2)+" "+(F+Y/2)+","+(W+Z/2)},D.prototype.createTips=function(){this.arrow1=c.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(c.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=c.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(c.createTransform()),this.visual.appendChild(this.arrow2)},D.prototype.pointerDown=function(F,W){Q.prototype.pointerDown.call(this,F,W),this.state==="creating"&&this.createTips()},D.prototype.adjustVisual=function(){if(Q.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",c.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),c.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),W=this.arrow1.transform.baseVal.getItem(0);W.setRotate(F,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(W,0);var Y=this.arrow2.transform.baseVal.getItem(0);Y.setRotate(F+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(Y,0)}},D.prototype.setArrowType=function(F){this.arrowType=F,this.adjustVisual(),this.stateChanged()},Object.defineProperty(D.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),D.prototype.getState=function(){var F=Object.assign({arrowType:this.arrowType},Q.prototype.getState.call(this));return F.typeName=D.typeName,F},D.prototype.restoreState=function(F){Q.prototype.restoreState.call(this,F);var W=F;this.arrowType=W.arrowType,this.createTips(),this.adjustVisual()},D.typeName="ArrowMarker",D.title="Arrow marker",D.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',D}(x),$=function(Q){function D(F,W,Y){var Z=Q.call(this,F,W,Y)||this;return Z.fillColor=Y.defaultFillColor,Z.strokeWidth=0,Z.fillPanel=new y("Color",Y.defaultColorSet,Y.defaultFillColor),Z.fillPanel.onColorChanged=Z.setFillColor,Z}return h(D,Q),Object.defineProperty(D.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),D.prototype.getState=function(){var F=Q.prototype.getState.call(this);return F.typeName=D.typeName,F},D.typeName="CoverMarker",D.title="Cover marker",D.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',D}(v),z=function(Q){function D(F,W,Y,Z){var te=Q.call(this,F,Z||'<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 te.opacities=[],te.opacityBoxes=[],te.opacities=W,te.currentOpacity=Y,te.setCurrentOpacity=te.setCurrentOpacity.bind(te),te}return h(D,Q),D.prototype.getUi=function(){var F=this,W=document.createElement("div");return W.style.display="flex",W.style.overflow="hidden",W.style.flexGrow="2",W.style.justifyContent="space-between",this.opacities.forEach(function(Y){var Z=document.createElement("div");Z.style.display="flex",Z.style.alignItems="center",Z.style.justifyContent="center",Z.style.padding="5px",Z.style.borderWidth="2px",Z.style.borderStyle="solid",Z.style.borderColor=Y===F.currentOpacity?F.uiStyleSettings.toolboxAccentColor:"transparent",Z.addEventListener("click",function(){F.setCurrentOpacity(Y,Z)}),W.appendChild(Z);var te=document.createElement("div");te.innerText=100*Y+"%",Z.appendChild(te),F.opacityBoxes.push(Z)}),W},D.prototype.setCurrentOpacity=function(F,W){var Y=this;this.currentOpacity=F,this.opacityBoxes.forEach(function(Z){Z.style.borderColor=Z===W?Y.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},D}(E),V=function(Q){function D(F,W,Y){var Z=Q.call(this,F,W,Y)||this;return Z.setOpacity=Z.setOpacity.bind(Z),Z.fillColor=Y.defaultHighlightColor,Z.strokeWidth=0,Z.opacity=Y.defaultHighlightOpacity,Z.fillPanel=new y("Color",Y.defaultColorSet,Z.fillColor),Z.fillPanel.onColorChanged=Z.setFillColor,Z.opacityPanel=new z("Opacity",Y.defaultOpacitySteps,Z.opacity),Z.opacityPanel.onOpacityChanged=Z.setOpacity,Z}return h(D,Q),D.prototype.setOpacity=function(F){this.opacity=F,this.visual&&c.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(D.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),D.prototype.getState=function(){var F=Q.prototype.getState.call(this);return F.typeName=D.typeName,F},D.typeName="HighlightMarker",D.title="Highlight marker",D.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>',D}($),K='<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>',H=function(Q){function D(F,W,Y){var Z=Q.call(this,F,W,Y)||this;return Z.bgColor="transparent",Z.tipPosition={x:0,y:0},Z.tipBase1Position={x:0,y:0},Z.tipBase2Position={x:0,y:0},Z.tipMoving=!1,Z.color=Y.defaultStrokeColor,Z.bgColor=Y.defaultFillColor,Z.fontFamily=Y.defaultFontFamily,Z.defaultSize={x:100,y:30},Z.setBgColor=Z.setBgColor.bind(Z),Z.getTipPoints=Z.getTipPoints.bind(Z),Z.positionTip=Z.positionTip.bind(Z),Z.setTipPoints=Z.setTipPoints.bind(Z),Z.colorPanel=new y("Text color",Y.defaultColorSet,Z.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>'),Z.colorPanel.onColorChanged=Z.setColor,Z.bgColorPanel=new y("Fill color",Y.defaultColorSet,Z.bgColor,K),Z.bgColorPanel.onColorChanged=Z.setBgColor,Z.fontFamilyPanel=new _("Font",Y.defaultFontFamilies,Y.defaultFontFamily),Z.fontFamilyPanel.onFontChanged=Z.setFont,Z.tipGrip=new o,Z.tipGrip.visual.transform.baseVal.appendItem(c.createTransform()),Z.controlBox.appendChild(Z.tipGrip.visual),Z}return h(D,Q),D.prototype.ownsTarget=function(F){return Q.prototype.ownsTarget.call(this,F)||this.tipGrip.ownsTarget(F)||this.tip===F},D.prototype.createTip=function(){c.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=c.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},D.prototype.pointerDown=function(F,W){this.state==="new"&&Q.prototype.pointerDown.call(this,F,W),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(W)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):Q.prototype.pointerDown.call(this,F,W)},D.prototype.pointerUp=function(F){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,Q.prototype.pointerUp.call(this,F);else{var W=this.state==="creating";Q.prototype.pointerUp.call(this,F),this.setTipPoints(W),this.positionTip()}},D.prototype.manipulate=function(F){if(this.tipMoving){var W=this.unrotatePoint(F);this.tipPosition={x:W.x-this.manipulationStartLeft,y:W.y-this.manipulationStartTop},this.positionTip()}else Q.prototype.manipulate.call(this,F)},D.prototype.setBgColor=function(F){this.bgRectangle&&this.tip&&(c.setAttributes(this.bgRectangle,[["fill",F]]),c.setAttributes(this.tip,[["fill",F]])),this.bgColor=F,this.fillColorChanged(F)},D.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},D.prototype.setTipPoints=function(F){F===void 0&&(F=!1);var W=Math.min(this.height/2,15),Y=this.height/5;F&&(this.tipPosition={x:W+Y/2,y:this.height+20});var Z=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?Z<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(Y=this.width/5,W=Math.min(this.width/2,15),this.tipBase1Position={x:W,y:0},this.tipBase2Position={x:W+Y,y:0}):(this.tipBase1Position={x:0,y:W},this.tipBase2Position={x:0,y:W+Y}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?Z<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(Y=this.width/5,W=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-W-Y,y:0},this.tipBase2Position={x:this.width-W,y:0}):(this.tipBase1Position={x:this.width,y:W},this.tipBase2Position={x:this.width,y:W+Y}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?Z<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(Y=this.width/5,W=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-W-Y,y:this.height},this.tipBase2Position={x:this.width-W,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-W-Y},this.tipBase2Position={x:this.width,y:this.height-W}):Z<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(Y=this.width/5,W=Math.min(this.width/2,15),this.tipBase1Position={x:W,y:this.height},this.tipBase2Position={x:W+Y,y:this.height}):(this.tipBase1Position={x:0,y:this.height-W},this.tipBase2Position={x:0,y:this.height-W-Y})},D.prototype.resize=function(F){Q.prototype.resize.call(this,F),this.positionTip()},D.prototype.positionTip=function(){c.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(D.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),D.prototype.select=function(){this.positionTip(),Q.prototype.select.call(this)},D.prototype.getState=function(){var F=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},Q.prototype.getState.call(this));return F.typeName=D.typeName,F},D.prototype.restoreState=function(F){var W=F;this.bgColor=W.bgColor,this.tipPosition=W.tipPosition,Q.prototype.restoreState.call(this,F),this.createTip(),this.setTipPoints()},D.prototype.scale=function(F,W){Q.prototype.scale.call(this,F,W),this.tipPosition={x:this.tipPosition.x*F,y:this.tipPosition.y*W},this.positionTip()},D.typeName="CalloutMarker",D.title="Callout marker",D.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>',D}(B),G=function(Q){function D(F,W,Y){var Z=Q.call(this,F,W,Y)||this;return Z.fillColor="transparent",Z.strokeColor="transparent",Z.strokeWidth=0,Z.strokeDasharray="",Z.opacity=1,Z.strokeColor=Y.defaultColor,Z.strokeWidth=Y.defaultStrokeWidth,Z.strokeDasharray=Y.defaultStrokeDasharray,Z.fillColor=Y.defaultFillColor,Z.setStrokeColor=Z.setStrokeColor.bind(Z),Z.setFillColor=Z.setFillColor.bind(Z),Z.setStrokeWidth=Z.setStrokeWidth.bind(Z),Z.setStrokeDasharray=Z.setStrokeDasharray.bind(Z),Z.setOpacity=Z.setOpacity.bind(Z),Z.createVisual=Z.createVisual.bind(Z),Z.strokePanel=new y("Line color",T(Y.defaultColorSet,["transparent"]),Y.defaultColor),Z.strokePanel.onColorChanged=Z.setStrokeColor,Z.fillPanel=new y("Fill color",T(Y.defaultColorSet,["transparent"]),Z.fillColor,K),Z.fillPanel.onColorChanged=Z.setFillColor,Z.strokeWidthPanel=new i("Line width",Y.defaultStrokeWidths,Y.defaultStrokeWidth),Z.strokeWidthPanel.onWidthChanged=Z.setStrokeWidth,Z.strokeStylePanel=new R("Line style",Y.defaultStrokeDasharrays,Y.defaultStrokeDasharray),Z.strokeStylePanel.onStyleChanged=Z.setStrokeDasharray,Z.opacityPanel=new z("Opacity",Y.defaultOpacitySteps,Z.opacity),Z.opacityPanel.onOpacityChanged=Z.setOpacity,Z}return h(D,Q),D.prototype.ownsTarget=function(F){return!(!Q.prototype.ownsTarget.call(this,F)&&F!==this.visual)},D.prototype.createVisual=function(){this.visual=c.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)},D.prototype.pointerDown=function(F,W){Q.prototype.pointerDown.call(this,F,W),this.state==="new"&&(this.createVisual(),this.moveVisual(F),this._state="creating")},D.prototype.manipulate=function(F){Q.prototype.manipulate.call(this,F)},D.prototype.resize=function(F){Q.prototype.resize.call(this,F),this.setSize()},D.prototype.setSize=function(){Q.prototype.setSize.call(this),c.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},D.prototype.pointerUp=function(F){Q.prototype.pointerUp.call(this,F),this.setSize()},D.prototype.setStrokeColor=function(F){this.strokeColor=F,this.visual&&c.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(F),this.stateChanged()},D.prototype.setFillColor=function(F){this.fillColor=F,this.visual&&c.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(F),this.stateChanged()},D.prototype.setStrokeWidth=function(F){this.strokeWidth=F,this.visual&&c.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},D.prototype.setStrokeDasharray=function(F){this.strokeDasharray=F,this.visual&&c.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},D.prototype.setOpacity=function(F){this.opacity=F,this.visual&&c.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(D.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),D.prototype.getState=function(){var F=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},Q.prototype.getState.call(this));return F.typeName=D.typeName,F},D.prototype.restoreState=function(F){var W=F;this.fillColor=W.fillColor,this.strokeColor=W.strokeColor,this.strokeWidth=W.strokeWidth,this.strokeDasharray=W.strokeDasharray,this.opacity=W.opacity,this.createVisual(),Q.prototype.restoreState.call(this,F),this.setSize()},D.prototype.scale=function(F,W){Q.prototype.scale.call(this,F,W),this.setSize()},D.typeName="EllipseMarker",D.title="Ellipse marker",D.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>',D}(w),ie=function(Q){function D(F,W,Y){return Q.call(this,F,W,Y)||this}return h(D,Q),Object.defineProperty(D.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),D.prototype.ownsTarget=function(F){return!(!Q.prototype.ownsTarget.call(this,F)&&F!==this.tip1&&F!==this.tip2)},D.prototype.createTips=function(){this.tip1=c.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(c.createTransform()),this.visual.appendChild(this.tip1),this.tip2=c.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(c.createTransform()),this.visual.appendChild(this.tip2)},D.prototype.pointerDown=function(F,W){Q.prototype.pointerDown.call(this,F,W),this.state==="creating"&&this.createTips()},D.prototype.adjustVisual=function(){if(Q.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(c.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()]]),c.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),W=this.tip1.transform.baseVal.getItem(0);W.setRotate(F,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(W,0);var Y=this.tip2.transform.baseVal.getItem(0);Y.setRotate(F+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(Y,0)}},Object.defineProperty(D.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),D.prototype.getState=function(){var F=Q.prototype.getState.call(this);return F.typeName=D.typeName,F},D.prototype.restoreState=function(F){Q.prototype.restoreState.call(this,F),this.createTips(),this.adjustVisual()},D.typeName="MeasurementMarker",D.title="Measurement marker",D.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>',D}(x),le=function(Q){function D(F,W,Y){var Z=Q.call(this,F,W,Y)||this;return Z.strokePanel.colors=Y.defaultColorSet,Z.fillColor="transparent",Z}return h(D,Q),Object.defineProperty(D.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),D.prototype.getState=function(){var F=Q.prototype.getState.call(this);return F.typeName=D.typeName,F},D.typeName="EllipseFrameMarker",D.title="Ellipse frame marker",D.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>',D}(G),ue=function(){function Q(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(Q.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),Q.prototype.addUndoStep=function(D){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(D)||(this.undoStack.push(D),JSON.stringify(this.lastRedoStep)!==JSON.stringify(D)&&this.redoStack.splice(0,this.redoStack.length))},Q.prototype.replaceLastUndoStep=function(D){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=D)},Q.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},Q.prototype.undo=function(){if(this.undoStack.length>1){var D=this.undoStack.pop();return D!==void 0&&this.redoStack.push(D),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},Q.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},Q}(),be=function(Q){function D(F,W,Y){var Z=Q.call(this,F,W,Y)||this;return Z.strokeColor="transparent",Z.strokeWidth=0,Z.strokeDasharray="",Z.curveX=0,Z.curveY=0,Z.manipulationStartCurveX=0,Z.manipulationStartCurveY=0,Z.setStrokeColor=Z.setStrokeColor.bind(Z),Z.setStrokeWidth=Z.setStrokeWidth.bind(Z),Z.setStrokeDasharray=Z.setStrokeDasharray.bind(Z),Z.positionGrips=Z.positionGrips.bind(Z),Z.addControlGrips=Z.addControlGrips.bind(Z),Z.adjustVisual=Z.adjustVisual.bind(Z),Z.setupControlBox=Z.setupControlBox.bind(Z),Z.resize=Z.resize.bind(Z),Z.strokeColor=Y.defaultColor,Z.strokeWidth=Y.defaultStrokeWidth,Z.strokeDasharray=Y.defaultStrokeDasharray,Z.strokePanel=new y("Line color",Y.defaultColorSet,Y.defaultColor),Z.strokePanel.onColorChanged=Z.setStrokeColor,Z.strokeWidthPanel=new i("Line width",Y.defaultStrokeWidths,Y.defaultStrokeWidth),Z.strokeWidthPanel.onWidthChanged=Z.setStrokeWidth,Z.strokeStylePanel=new R("Line style",Y.defaultStrokeDasharrays,Y.defaultStrokeDasharray),Z.strokeStylePanel.onStyleChanged=Z.setStrokeDasharray,Z}return h(D,Q),D.prototype.ownsTarget=function(F){return!(!Q.prototype.ownsTarget.call(this,F)&&F!==this.visual&&F!==this.selectorCurve&&F!==this.visibleCurve&&!this.curveGrip.ownsTarget(F))},D.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},D.prototype.createVisual=function(){this.visual=c.createGroup(),this.selectorCurve=c.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=c.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)},D.prototype.pointerDown=function(F,W){Q.prototype.pointerDown.call(this,F,W),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(W)&&(this.activeGrip=this.curveGrip,this._state="resize")},D.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),c.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),c.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),c.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},D.prototype.setupControlBox=function(){Q.prototype.setupControlBox.call(this),this.curveControlLine1=c.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=c.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)},D.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,Q.prototype.addControlGrips.call(this)},D.prototype.positionGrips=function(){Q.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()))},D.prototype.manipulate=function(F){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+F.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+F.y-this.manipulationStartY),Q.prototype.manipulate.call(this,F)},D.prototype.resize=function(F){this.activeGrip===this.curveGrip&&(this.curveX=F.x,this.curveY=F.y),Q.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)},D.prototype.setStrokeColor=function(F){this.strokeColor=F,this.adjustVisual(),this.colorChanged(F)},D.prototype.setStrokeWidth=function(F){this.strokeWidth=F,this.adjustVisual()},D.prototype.setStrokeDasharray=function(F){this.strokeDasharray=F,this.adjustVisual()},D.prototype.scale=function(F,W){this.curveX=this.curveX*F,this.curveY=this.curveY*W,Q.prototype.scale.call(this,F,W)},Object.defineProperty(D.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),D.prototype.getState=function(){var F=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},Q.prototype.getState.call(this));return F.typeName=D.typeName,F},D.prototype.restoreState=function(F){Q.prototype.restoreState.call(this,F);var W=F;this.strokeColor=W.strokeColor,this.strokeWidth=W.strokeWidth,this.strokeDasharray=W.strokeDasharray,this.curveX=W.curveX,this.curveY=W.curveY,this.createVisual(),this.adjustVisual()},D.typeName="CurveMarker",D.title="Curve marker",D.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>',D}(b),Ce=function(){function Q(D,F){F===void 0&&(F=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=D,this.cancelable=F}return Object.defineProperty(Q.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),Q.prototype.preventDefault=function(){this._defaultPrevented=!0},Q}(),se=function(Q){function D(F,W,Y){var Z=Q.call(this,F,!1)||this;return Z.dataUrl=W,Z.state=Y,Z}return h(D,Q),D}(Ce),ce=function(Q){function D(F,W,Y){Y===void 0&&(Y=!1);var Z=Q.call(this,F,Y)||this;return Z.marker=W,Z}return h(D,Q),D}(Ce),he=function(){function Q(){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 Q.prototype.addEventListener=function(D,F){this[D].push(F)},Q.prototype.removeEventListener=function(D,F){var W=this[D].indexOf(F);W>-1&&this[D].splice(W,1)},Q}(),ae=function(){function Q(D){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new d,this._isOpen=!1,this.undoRedoManager=new ue,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 he,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=Q.instanceCounter++,this.styles=new a(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=D,this.targetRoot=document.body,this.width=D.clientWidth,this.height=D.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(Q.prototype,"ALL_MARKER_TYPES",{get:function(){return[k,U,J,B,le,G,V,H,ie,$,x,be]},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[k,U,J,B,G,V,H]},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"BASIC_MARKER_TYPES",{get:function(){return[k,U,J,B,V]},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(D){var F=this;this._availableMarkerTypes.splice(0),D.forEach(function(W){if(typeof W=="string"){var Y=F.ALL_MARKER_TYPES.find(function(Z){return Z.typeName===W});Y!==void 0&&F._availableMarkerTypes.push(Y)}else F._availableMarkerTypes.push(W)})},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(D){this._zoomLevel=D,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(Q.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Q.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),C.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},Q.prototype.show=function(){var D=this;this.styles.styleSheetRoot===void 0&&s.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=s.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(F){return F(new Ce(D))})},Q.prototype.render=function(){return S(this,void 0,void 0,function(){var D;return L(this,function(F){switch(F.label){case 0:return this.setCurrentMarker(),(D=new g).naturalSize=this.renderAtNaturalSize,D.imageType=this.renderImageType,D.imageQuality=this.renderImageQuality,D.markersOnly=this.renderMarkersOnly,D.width=this.renderWidth,D.height=this.renderHeight,[4,D.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return F.sent(),[4,D.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,F.sent()]}})})},Q.prototype.close=function(D){var F=this;if(D===void 0&&(D=!1),this.isOpen){var W=!1;D||this.eventListeners.beforeclose.forEach(function(Y){var Z=new Ce(F,!0);Y(Z),Z.defaultPrevented&&(W=!0)}),W||(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(Y){return Y(new Ce(F))}),this.detachEvents(),this._isOpen=!1)}},Q.prototype.addMarkersToToolbar=function(){for(var D,F=[],W=0;W<arguments.length;W++)F[W]=arguments[W];(D=this._availableMarkerTypes).push.apply(D,F)},Q.prototype.addRenderEventListener=function(D){this.addEventListener("render",function(F){D(F.dataUrl,F.state)})},Q.prototype.removeRenderEventListener=function(D){},Q.prototype.addCloseEventListener=function(D){this.addEventListener("close",function(){D()})},Q.prototype.removeCloseEventListener=function(D){},Q.prototype.setupResizeObserver=function(){var D=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){D.resize(D.target.clientWidth,D.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return D.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},Q.prototype.onPopupTargetResize=function(){var D=1*this.target.clientWidth/this.target.clientHeight,F=this.editorCanvas.clientWidth/D>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*D:this.editorCanvas.clientWidth,W=F<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/D;this.resize(F,W)},Q.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},Q.prototype.resize=function(D,F){this._isResizing=!0;var W=D/this.imageWidth,Y=F/this.imageHeight;this.imageWidth=Math.round(D),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(W,Y),this._isResizing=!1},Q.prototype.scaleMarkers=function(D,F){var W,Y=this;this._currentMarker&&this._currentMarker instanceof B?this._currentMarker.scale(D,F):(W=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(Z){Z!==Y._currentMarker&&Z.scale(D,F)}),W!==void 0&&this.setCurrentMarker(W)},Q.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"},Q.prototype.setTopLeft=function(){var D=this.editingTarget.getBoundingClientRect(),F=this.editorCanvas.getBoundingClientRect();this.left=D.left-F.left,this.top=D.top-F.top},Q.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)},Q.prototype.addDefs=function(){for(var D,F=[],W=0;W<arguments.length;W++)F[W]=arguments[W];this.defs=c.createDefs(),this.addDefsToImage(),(D=this.defs).append.apply(D,F)},Q.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},Q.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)},Q.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},Q.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},Q.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)},Q.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},Q.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)},Q.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 D=document.createElement("a");D.href="https://markerjs.com/",D.target="_blank",D.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>',D.title="Powered by marker.js",D.style.display="grid",D.style.alignItems="center",D.style.justifyItems="center",D.style.padding="3px",D.style.width="20px",D.style.height="20px",this.logoUI.appendChild(D),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},Q.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")},Q.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"},Q.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},Q.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 D=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=D+"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 p(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 m(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},Q.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},Q.prototype.removeMarker=function(D){this.markerImage.removeChild(D.container),this.markers.indexOf(D)>-1&&this.markers.splice(this.markers.indexOf(D),1),D.dispose()},Q.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())},Q.prototype.toolbarButtonClicked=function(D,F){if(D==="marker"&&F!==void 0)this.createNewMarker(F);else if(D==="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()}},Q.prototype.deleteSelectedMarker=function(){var D=this;if(this._currentMarker!==void 0){var F=!1;if(this.eventListeners.markerbeforedelete.forEach(function(Y){var Z=new ce(D,D._currentMarker,!0);Y(Z),Z.defaultPrevented&&(F=!0)}),!F){var W=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(Y){return Y(new ce(D,W))})}}},Q.prototype.clear=function(){var D=this,F=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(te){var q=new ce(D,void 0,!0);te(q),q.defaultPrevented&&(F=!0)}),!F)){this.setCurrentMarker();for(var W=function(te){var q=Y.markers[te];Y.setCurrentMarker(Y.markers[te]),Y._currentMarker.dispose(),Y.markerImage.removeChild(Y._currentMarker.container),Y.markers.splice(Y.markers.indexOf(Y._currentMarker),1),Y.eventListeners.markerdelete.forEach(function(X){return X(new ce(D,q))})},Y=this,Z=this.markers.length-1;Z>=0;Z--)W(Z);this.addUndoStep()}},Object.defineProperty(Q.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),Q.prototype.showNotesEditor=function(){var D;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=(D=this._currentMarker.notes)!==null&&D!==void 0?D:"",this.overlayContainer.appendChild(this.notesArea))},Q.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)},Q.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},Q.prototype.addUndoStep=function(){var D=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var F=this.getState(),W=this.undoRedoManager.getLastUndoStep();if(!W||W.width===F.width&&W.height===F.height){var Y=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(F),Y<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(Z){return Z(new Ce(D))})}else this.undoRedoManager.replaceLastUndoStep(F),this.eventListeners.statechange.forEach(function(Z){return Z(new Ce(D))})}},Q.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},Q.prototype.undoStep=function(){var D=this,F=this.undoRedoManager.undo();F!==void 0&&(this.restoreState(F),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(W){return W(new Ce(D))}))},Q.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},Q.prototype.redoStep=function(){var D=this,F=this.undoRedoManager.redo();F!==void 0&&(this.restoreState(F),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(W){return W(new Ce(D))}))},Q.prototype.stepZoom=function(){var D=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=D<this.zoomSteps.length-1?this.zoomSteps[D+1]:this.zoomSteps[0]},Q.prototype.panTo=function(D){this.contentDiv.scrollBy({left:this.prevPanPoint.x-D.x,top:this.prevPanPoint.y-D.y}),this.prevPanPoint=D},Q.prototype.startRenderAndClose=function(){return S(this,void 0,void 0,function(){var D,F,W=this;return L(this,function(Y){switch(Y.label){case 0:return[4,this.render()];case 1:return D=Y.sent(),F=this.getState(),this.eventListeners.render.forEach(function(Z){return Z(new se(W,D,F))}),this.close(!0),[2]}})})},Q.prototype.getState=function(D){D===!0&&this.setCurrentMarker();var F={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(W){return F.markers.push(W.getState())}),F},Q.prototype.restoreState=function(D){var F=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);D.markers.forEach(function(W){var Y=F._availableMarkerTypes.find(function(te){return te.typeName===W.typeName});if(Y!==void 0){var Z=F.addNewMarker(Y);Z.restoreState(W),F.markers.push(Z)}}),D.width&&D.height&&(D.width!==this.imageWidth||D.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/D.width,this.imageHeight/D.height),this.eventListeners.restorestate.forEach(function(W){return W(new Ce(F))})},Q.prototype.addNewMarker=function(D){var F=c.createGroup();return this.markerImage.appendChild(F),new D(F,this.overlayContainer,this.settings)},Q.prototype.createNewMarker=function(D){var F,W=this;(F=typeof D=="string"?this._availableMarkerTypes.find(function(Y){return Y.typeName===D}):D)&&(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(Y){return Y(new ce(W,W._currentMarker))}))},Q.prototype.markerCreated=function(D){var F=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(D),this.setCurrentMarker(D),D instanceof U&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(U):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(W){return W(new ce(F,F._currentMarker))})},Q.prototype.colorChanged=function(D){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=D,this.settings.defaultStrokeColor=D)},Q.prototype.fillColorChanged=function(D){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=D)},Q.prototype.markerStateChanged=function(D){var F=this;this.eventListeners.markerchange.forEach(function(W){return W(new ce(F,D))})},Q.prototype.setCurrentMarker=function(D){var F=this;this._currentMarker!==D&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(W){return W(new ce(F,F._currentMarker))})),this._currentMarker=D,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(W){return W(new ce(F,F._currentMarker))}))},Q.prototype.onPointerDown=function(D){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||D.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(W){return W.ownsTarget(D.target)});F!==void 0?(this.setCurrentMarker(F),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(D.clientX,D.clientY),D.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:D.clientX,y:D.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(D.clientX,D.clientY))},Q.prototype.onDblClick=function(D){if(this._isFocused||this.focus(),this.mode==="select"){var F=this.markers.find(function(W){return W.ownsTarget(D.target)});F!==void 0&&F!==this._currentMarker&&this.setCurrentMarker(F),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(D.clientX,D.clientY),D.target):this.setCurrentMarker()}},Q.prototype.onPointerMove=function(D){this.touchPoints!==1&&D.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||D.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(D.clientX,D.clientY)):this.zoomLevel>1&&this.panTo({x:D.clientX,y:D.clientY}))},Q.prototype.onPointerUp=function(D){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(D.clientX,D.clientY)),this.isDragging=!1,this.addUndoStep()},Q.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},Q.prototype.onKeyUp=function(D){this._currentMarker===void 0||this.notesArea!==void 0||D.key!=="Delete"&&D.key!=="Backspace"||this.deleteSelectedMarker()},Q.prototype.clientToLocalCoordinates=function(D,F){var W=this.markerImage.getBoundingClientRect();return{x:(D-W.left)/this.zoomLevel,y:(F-W.top)/this.zoomLevel}},Q.prototype.onWindowResize=function(){this.positionUI()},Q.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var D=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=D+"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()},Q.prototype.addLicenseKey=function(D){C.addKey(D)},Q.prototype.addEventListener=function(D,F){this.eventListeners.addEventListener(D,F)},Q.prototype.removeEventListener=function(D,F){this.eventListeners.removeEventListener(D,F)},Q.prototype.renderState=function(D){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(D),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(Q.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),Q.prototype.focus=function(){var D=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 Ce(D))}))},Q.prototype.blur=function(){var D=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(F){return F(new Ce(D))}))},Q.instanceCounter=0,Q}()},T1X5:function(M,ne){M.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGwAAABsCAYAAACPZlfNAAALdklEQVR4Xu2dC2wc1RVAzx1nDXFiO4SEhqxtxS0JHzX94TS0FEKLALX8WkKbqrRVKQrh15Zfq0IqIaSGSOXb8ktANFJbKqUFWigEAUohfFRQDC1KxS8UR/7wDbZ3TRxix3urN951No7Xnt15M7Mbz0hRImXevffds/PmzXv33StU0KWqTlcfh6mwkCHmq8M8B5oUZosyS6EeOCD7x/Rsl/kjkFJhu8AHGWiXDNuoYqsoW5K1vCkimUpxg5SzoW+r1gylOUGErygci9IC1Fi2uR+hVeA5VZ6tquOpuSL9lnVYE1d2wNo+0jnVylLNcKYKx6EcaK23XgQJH4vyjDg8OCDc3zxd3vXSLKx7ygJYW5seOGUmZ6GcJ8IShaqwHDCeHoEhVTYh3LO7mweam+XjqO2KFNjWPp09VblUlQuAmVE7YwL93SKs2SncMr9WPojK1kiAdWzXpCa40oHlCtOi6nwpegV2ZOBuGeSGxlnSVYoMP21CBfZmnx5SneFagXPzZnJ+7I+y7S6FdQMO1xxWK++HZUgowNzpeIoVKqwCDgqrcyHp6RFlZbKetWF8HgQOrD2liwTuAHdKvj9frVVTuHDuNGkNspOBAWtt1cShC1ilcLlqecz6gnSkkS3CkMBN77zBypYWGQxCXyDAuvq1KTPIeuCYIIyuAJnPOwmWJWuk3bat1oF1pfWMjLKuAqbptn05Wl63I5ybrJOHbCqyCqw9ratEucqMDjaNrGBZqsLqpjpZaasPVhyrqlVdKe5Wcafr8TXKA6KsS9azXESG/DrHN7CODp0qdaxXON2vMftze4F/aJpljY2y008/fQFr69EZCYeH3ZX0+JrQA2ZHYDDDac0HSe+ENxe4oWRg2SfriRhWca53t3HSnFTqk1YSMPedleZv8TBYHKzc3WZ4TNbxrVLeaSUB6+zV38cTjNJgjUBT1jXMkB8XK6VoYNmp+9XFKorv39cDKlxX7JS/KGDZj+K/x99Z1n5+6gjfLObj2jOw7HLTv+MVDGuwcoK6nQSf97qM5QmYWcj9xHyensRrg9YpjRL4/HtbOd7LgrEnYF1p/U1G+XnQVk9m+Y5wfbJOfjGRDyYEZvazHOFfk2WLZCKHBfX/Zmsmo3ypqV42j6djXGBmp7gzzQuTYPMxKA7Fym1tqGPxeDvX4wLr7NULVdzd4vgKyQOiXNQwQ+4spK4gMBMwc0CG1/bDGIyQXF+ymp5dDkcUCuwpCKwzpXcqbrxgfIXsAYU1TfVy4VhqxwRm4gZJ8L/9IBQtZFdbU7eLQT41VtzjmMDaU3qzwKXW1MeCivaAwi1N9XLZ6Ib7AHPDpzO0hRmR+/L78Ict8J93IT1QdN+sN6irhs/NgR8uhM8eYl28J4EmwninQ/PosPB9gHWmdZUqoS3u/uUVuPEFKMcDWg5wxWL4zlGefGz9JhGuaxgVD7IXsOwpEhMvHsrBBPNknf9IecLKed9Au+vUyJ607t3dJPNPzewFrCOl3wPutf5TKSDwio3wdF7k3imfhMNnugGZkV2q8Ho3PPbWHhOOb4IbT4zMpHMa6+XPOe17A+vVjQhfC8u0E+/d884ysH69JCzNE+v51aY90Mw7beM5E7cJ5A7ln40zZOTnMgLMnHxMDNEZ5mG6RSbcNHv9tAV+sDCQLpck9I9b4Hd5UfKbIwrgM4cKB6toyJ0EHQHWkdJLgFtL6l2JjfKB/WwRfP/TJQoKoNmf/gu/zVuGjQqY6ZrjcEmyVm43/x4B1pnSxxVOCqDvBUXGwLx5W+CJhno5eQSYe1q/jw/DPgAeA/MGDOHjqloONtkN3CesI6XfAB7x2NzabV6B3fca3LoZ+ndbU+0KmpaAn7TA0iP2lVtOQ2LWulMb62WDC6wzrdfp8CGGUC+vwL56L3wU0ArI9Gp4cowZYLkBE2F1Q51cPfyEpXUTyvGh0gK8ArvgUXgxoGwZX5gDa79eAU+Y8HRjnSyR7K5yXwAZZibk7xXYjkHY2Abmb5uXGRJPnAfTqisAGPQ31FErnWldoMrrNh3hVZZXYF7l2byv3IZEd4YoHC4dfbqUDPfZ7KxXWTEwr57K3udwtnT06i8RVhfZ1MrtMbAi3ahcJe1pXSPKiiKbWrk9BlacG1VYa95hG1QZY55UnLBS7vYK7JXtwxuc/ZYnHTWJ4U3Ko2ZVxKTDvMMelY60bs7mISzF577aeAV25l/h7Y98qSrYeO50ePDblQHMzevYmVITDjAvGHeMLzUGVpzXBbZJR0p7gBnFNbVzt1dgr+aGRMtLUzVThofEI8cYEh9/C1ZuGu7n7BrYsMxOn31K6TXAdkTx0WwM9wrMZydLaj6UgTtegje64UefgaPnlCTGdqN+A8z8biPJAFrOwGx72pK8oRiYJU+GJMYFFg+JIXnbghp3SOyO6sCD1yFxxwBs3BbA4m91dvE3YcGV4YjoqYhp/YpH4aWAtlfMZGJNJMsGxRMentZXwIdzFBuYxbszhBbuh3MFLE25IQKtwSxNmRCBs8cIEQjB/UWrcJem4sXfvf32Qhdc8jjcdjIsThbt00AbuIu/8fZK5QDDbK/EG5gVBMxsYMYhApUDzA0RqIQgnEBfDKOEl/E7bDgIx9hb7mFuMTA3qH44zM04o9wDSWNgbsRUXiBpmYdq2wZmhr1C16sfwu0vwsVHw5EHF74vgin/nlDtcjgMEeb5sPw1zFJ/DKEePxp9GMIdFiM4bhTVCUyvT9gR4zxhx4T4Ub3PcSMDrKtPL85kuK3UX1wp7fyccTaHGE5uBhP5ZPMqx1nimAf6ojgy+/J7cP6G0rMILJ4Lt51iExeUG7CCR2bd6X3Ih9KNTj95OmZOhce+u38Do9ChdBdYyGkfcq4uJRPO9ARc9kU4Y8F+DgwKp30IO7GKXVfbkVZmQ+L4iVWyH9Ghpi6y42Z7UsoJ2ISpi0y3o0gOZs/d/iWVCzDPycFMl+P0e/7B+5XgOf2eO/mIE1z69bff9sUluMw+ZXdKnELWr+NLal90ClmjJU7SXJKvbTQqLUmzO2OM06DbAFCUjJLToBstcaGBonxt42Z/hQay77K4lIcNFBPIsFLKI6cjLpYTBjGub7RRLMeYGpejChyY3XJUxty44Ftg0OwXfMsbGs/IKHFJRXvsgiupmLMxLlpqkVbQRUtzpsZlgf1Dk7DKAme/z+LC2z6YhV54210g7tCpUkdc2r5IcJGUts/Z2NajMxIODyscW6Tdk/J2A2sww2nNB0lvqQ7wXTQj+6StVzi9VCMmQzszDGqaZY2NstNPf30DM8qfVJ0yP8VdKkRUP8GPC4JvayYYyXqWi8iQX21WgI2a8pvs3Fbl+u1khO1VhdVNo0pK+bHHumO70mo+rk1VlVBKWvnpfMBtux3h3GSdPGRTj3VgectY64FjbBpbQbKedxIsS9ZIXrEtO9YHAsyYZhaMD13AKoXLJ0uVdbNFInDTO2+wsqVFLOdPHQYeGLCR91pKFwlu8e4WO7+xspXSqnDRRKXp/VofODBjoNm57kqxQoVVUeW18uuocdr3iLIyWc/a8UrS29IfCrCcsSawpzrDtYI7/T/AVicikrNLYd2AwzWFqpoHYVeowHIdMHGPmuBKB5aHWX7YhgNNRG4G7pZBbhirMLYNHePJiARYziA3LFy5VJULKuAzoFuENTuFW0bXVg4aUr78SIHlDMmemjkL5TwRloRZh3OCX/OQKpsQ7tndzQP55XnDhFR2wPINMidBq5WlmuFMFY4Lu2qgqYYnyjPi8OCAcH+uWGhUgEbrLYsnrJAz3OwGaU5AOQ6HL2cLItRYdl6/m8AfnlPl2ao6njKlCy3rsCaurIGN7qX7edDHYSosZIj56jDPgSaF2aLM0uH8+6YaWG4GugsYEOhVYbvABxlolwzbqGKrKFuStbwZxnTcFrH/A8wNv8JI/KKJAAAAAElFTkSuQmCC"},"VrN/":function(M,ne,N){(function(I,h){M.exports=h()})(this,function(){"use strict";var I=navigator.userAgent,h=navigator.platform,S=/gecko\/\d/i.test(I),L=/MSIE \d/.test(I),T=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(I),c=/Edge\/(\d+)/.exec(I),C=L||T||c,g=C&&(L?document.documentMode||6:+(c||T)[1]),s=!c&&/WebKit\//.test(I),a=s&&/Qt\/\d+\.\d+/.test(I),r=!c&&/Chrome\//.test(I),f=/Opera\//.test(I),p=/Apple Computer/.test(navigator.vendor),m=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(I),E=/PhantomJS/.test(I),y=!c&&/AppleWebKit/.test(I)&&/Mobile\/\w+/.test(I),u=/Android/.test(I),n=y||u||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(I),o=y||/Mac/.test(h),l=/\bCrOS\b/.test(I),w=/win/i.test(h),v=f&&I.match(/Version\/(\d*\.\d*)/);v&&(v=Number(v[1])),v&&v>=15&&(f=!1,s=!0);var i=o&&(a||f&&(v==null||v<12.11)),R=S||C&&g>=9;function k(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var d=function(e,t){var O=e.className,A=k(t).exec(O);if(A){var j=O.slice(A.index+A[0].length);e.className=O.slice(0,A.index)+(j?A[1]+j:"")}};function b(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function x(e,t){return b(e).appendChild(t)}function _(e,t,O,A){var j=document.createElement(e);if(O&&(j.className=O),A&&(j.style.cssText=A),typeof t=="string")j.appendChild(document.createTextNode(t));else if(t)for(var ee=0;ee<t.length;++ee)j.appendChild(t[ee]);return j}function B(e,t,O,A){var j=_(e,t,O,A);return j.setAttribute("role","presentation"),j}var U;document.createRange?U=function(e,t,O,A){var j=document.createRange();return j.setEnd(A||e,O),j.setStart(e,t),j}:U=function(e,t,O){var A=document.body.createTextRange();try{A.moveToElementText(e.parentNode)}catch(j){return A}return A.collapse(!0),A.moveEnd("character",O),A.moveStart("character",t),A};function P(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function J(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function $(e,t){var O=e.className;k(t).test(O)||(e.className+=(O?" ":"")+t)}function z(e,t){for(var O=e.split(" "),A=0;A<O.length;A++)O[A]&&!k(O[A]).test(t)&&(t+=" "+O[A]);return t}var V=function(e){e.select()};y?V=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:C&&(V=function(e){try{e.select()}catch(t){}});function K(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function H(e,t,O){t||(t={});for(var A in e)e.hasOwnProperty(A)&&(O!==!1||!t.hasOwnProperty(A))&&(t[A]=e[A]);return t}function G(e,t,O,A,j){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var ee=A||0,oe=j||0;;){var de=e.indexOf(" ",ee);if(de<0||de>=t)return oe+(t-ee);oe+=de-ee,oe+=O-oe%O,ee=de+1}}var ie=function(){this.id=null,this.f=null,this.time=0,this.handler=K(this.onTimeout,this)};ie.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},ie.prototype.set=function(e,t){this.f=t;var O=+new Date+e;(!this.id||O<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=O)};function le(e,t){for(var O=0;O<e.length;++O)if(e[O]==t)return O;return-1}var ue=50,be={toString:function(){return"CodeMirror.Pass"}},Ce={scroll:!1},se={origin:"*mouse"},ce={origin:"+move"};function he(e,t,O){for(var A=0,j=0;;){var ee=e.indexOf(" ",A);ee==-1&&(ee=e.length);var oe=ee-A;if(ee==e.length||j+oe>=t)return A+Math.min(oe,t-j);if(j+=ee-A,j+=O-j%O,A=ee+1,j>=t)return A}}var ae=[""];function Q(e){for(;ae.length<=e;)ae.push(D(ae)+" ");return ae[e]}function D(e){return e[e.length-1]}function F(e,t){for(var O=[],A=0;A<e.length;A++)O[A]=t(e[A],A);return O}function W(e,t,O){for(var A=0,j=O(t);A<e.length&&O(e[A])<=j;)A++;e.splice(A,0,t)}function Y(){}function Z(e,t){var O;return Object.create?O=Object.create(e):(Y.prototype=e,O=new Y),t&&H(t,O),O}var te=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function q(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||te.test(e))}function X(e,t){return t?t.source.indexOf("\\w")>-1&&q(e)?!0:t.test(e):q(e)}function re(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var me=/[\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 ve(e){return e.charCodeAt(0)>=768&&me.test(e)}function Te(e,t,O){for(;(O<0?t>0:t<e.length)&&ve(e.charAt(t));)t+=O;return t}function Re(e,t,O){for(var A=t>O?-1:1;;){if(t==O)return t;var j=(t+O)/2,ee=A<0?Math.ceil(j):Math.floor(j);if(ee==t)return e(ee)?t:O;e(ee)?O=ee:t=ee+A}}function Ie(e,t,O,A){if(!e)return A(t,O,"ltr",0);for(var j=!1,ee=0;ee<e.length;++ee){var oe=e[ee];(oe.from<O&&oe.to>t||t==O&&oe.to==t)&&(A(Math.max(oe.from,t),Math.min(oe.to,O),oe.level==1?"rtl":"ltr",ee),j=!0)}j||A(t,O,"ltr")}var je=null;function Ne(e,t,O){var A;je=null;for(var j=0;j<e.length;++j){var ee=e[j];if(ee.from<t&&ee.to>t)return j;ee.to==t&&(ee.from!=ee.to&&O=="before"?A=j:je=j),ee.from==t&&(ee.from!=ee.to&&O!="before"?A=j:je=j)}return A!=null?A:je}var We=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function O(Ee){return Ee<=247?e.charAt(Ee):1424<=Ee&&Ee<=1524?"R":1536<=Ee&&Ee<=1785?t.charAt(Ee-1536):1774<=Ee&&Ee<=2220?"r":8192<=Ee&&Ee<=8203?"w":Ee==8204?"b":"L"}var A=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,j=/[stwN]/,ee=/[LRr]/,oe=/[Lb1n]/,de=/[1n]/;function ge(Ee,ke,Pe){this.level=Ee,this.from=ke,this.to=Pe}return function(Ee,ke){var Pe=ke=="ltr"?"L":"R";if(Ee.length==0||ke=="ltr"&&!A.test(Ee))return!1;for(var Ue=Ee.length,Fe=[],ze=0;ze<Ue;++ze)Fe.push(O(Ee.charCodeAt(ze)));for(var Ze=0,ot=Pe;Ze<Ue;++Ze){var ct=Fe[Ze];ct=="m"?Fe[Ze]=ot:ot=ct}for(var mt=0,dt=Pe;mt<Ue;++mt){var vt=Fe[mt];vt=="1"&&dt=="r"?Fe[mt]="n":ee.test(vt)&&(dt=vt,vt=="r"&&(Fe[mt]="R"))}for(var Lt=1,Tt=Fe[0];Lt<Ue-1;++Lt){var Kt=Fe[Lt];Kt=="+"&&Tt=="1"&&Fe[Lt+1]=="1"?Fe[Lt]="1":Kt==","&&Tt==Fe[Lt+1]&&(Tt=="1"||Tt=="n")&&(Fe[Lt]=Tt),Tt=Kt}for(var nr=0;nr<Ue;++nr){var _r=Fe[nr];if(_r==",")Fe[nr]="N";else if(_r=="%"){var or=void 0;for(or=nr+1;or<Ue&&Fe[or]=="%";++or);for(var Qr=nr&&Fe[nr-1]=="!"||or<Ue&&Fe[or]=="1"?"1":"N",zr=nr;zr<or;++zr)Fe[zr]=Qr;nr=or-1}}for(var mr=0,Vr=Pe;mr<Ue;++mr){var Or=Fe[mr];Vr=="L"&&Or=="1"?Fe[mr]="L":ee.test(Or)&&(Vr=Or)}for(var Er=0;Er<Ue;++Er)if(j.test(Fe[Er])){var gr=void 0;for(gr=Er+1;gr<Ue&&j.test(Fe[gr]);++gr);for(var sr=(Er?Fe[Er-1]:Pe)=="L",Xr=(gr<Ue?Fe[gr]:Pe)=="L",Gi=sr==Xr?sr?"L":"R":Pe,ai=Er;ai<gr;++ai)Fe[ai]=Gi;Er=gr-1}for(var Ir=[],Pn,Ar=0;Ar<Ue;)if(oe.test(Fe[Ar])){var Eo=Ar;for(++Ar;Ar<Ue&&oe.test(Fe[Ar]);++Ar);Ir.push(new ge(0,Eo,Ar))}else{var Hn=Ar,Ei=Ir.length,wi=ke=="rtl"?1:0;for(++Ar;Ar<Ue&&Fe[Ar]!="L";++Ar);for(var Ur=Hn;Ur<Ar;)if(de.test(Fe[Ur])){Hn<Ur&&(Ir.splice(Ei,0,new ge(1,Hn,Ur)),Ei+=wi);var zi=Ur;for(++Ur;Ur<Ar&&de.test(Fe[Ur]);++Ur);Ir.splice(Ei,0,new ge(2,zi,Ur)),Ei+=wi,Hn=Ur}else++Ur;Hn<Ar&&Ir.splice(Ei,0,new ge(1,Hn,Ar))}return ke=="ltr"&&(Ir[0].level==1&&(Pn=Ee.match(/^\s+/))&&(Ir[0].from=Pn[0].length,Ir.unshift(new ge(0,0,Pn[0].length))),D(Ir).level==1&&(Pn=Ee.match(/\s+$/))&&(D(Ir).to-=Pn[0].length,Ir.push(new ge(0,Ue-Pn[0].length,Ue)))),ke=="rtl"?Ir.reverse():Ir}}();function Be(e,t){var O=e.order;return O==null&&(O=e.order=We(e.text,t)),O}var He=[],De=function(e,t,O){if(e.addEventListener)e.addEventListener(t,O,!1);else if(e.attachEvent)e.attachEvent("on"+t,O);else{var A=e._handlers||(e._handlers={});A[t]=(A[t]||He).concat(O)}};function Xe(e,t){return e._handlers&&e._handlers[t]||He}function $e(e,t,O){if(e.removeEventListener)e.removeEventListener(t,O,!1);else if(e.detachEvent)e.detachEvent("on"+t,O);else{var A=e._handlers,j=A&&A[t];if(j){var ee=le(j,O);ee>-1&&(A[t]=j.slice(0,ee).concat(j.slice(ee+1)))}}}function we(e,t){var O=Xe(e,t);if(!O.length)return;for(var A=Array.prototype.slice.call(arguments,2),j=0;j<O.length;++j)O[j].apply(null,A)}function fe(e,t,O){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),we(e,O||t.type,e,t),Ae(t)||t.codemirrorIgnore}function pe(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var O=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),A=0;A<t.length;++A)le(O,t[A])==-1&&O.push(t[A])}function ye(e,t){return Xe(e,t).length>0}function _e(e){e.prototype.on=function(t,O){De(this,t,O)},e.prototype.off=function(t,O){$e(this,t,O)}}function xe(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Se(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Ae(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function Oe(e){xe(e),Se(e)}function Le(e){return e.target||e.srcElement}function Me(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),o&&e.ctrlKey&&t==1&&(t=3),t}var Ke=function(){if(C&&g<9)return!1;var e=_("div");return"draggable"in e||"dragDrop"in e}(),Qe;function Ye(e){if(Qe==null){var t=_("span","\u200B");x(e,_("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Qe=t.offsetWidth<=1&&t.offsetHeight>2&&!(C&&g<8))}var O=Qe?_("span","\u200B"):_("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return O.setAttribute("cm-text",""),O}var nt;function pt(e){if(nt!=null)return nt;var t=x(e,document.createTextNode("A\u062EA")),O=U(t,0,1).getBoundingClientRect(),A=U(t,1,2).getBoundingClientRect();return b(e),!O||O.left==O.right?!1:nt=A.right-O.right<3}var st=`
b`.split(/\n/).length!=3?function(e){for(var t=0,O=[],A=e.length;t<=A;){var j=e.indexOf(`
`,t);j==-1&&(j=e.length);var ee=e.slice(t,e.charAt(j-1)=="\r"?j-1:j),oe=ee.indexOf("\r");oe!=-1?(O.push(ee.slice(0,oe)),t+=oe+1):(O.push(ee),t=j+1)}return O}:function(e){return e.split(/\r\n?|\n/)},tt=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(O){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Pt=function(){var e=_("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),wt=null;function Vt(e){if(wt!=null)return wt;var t=x(e,_("span","x")),O=t.getBoundingClientRect(),A=U(t,0,1).getBoundingClientRect();return wt=Math.abs(O.left-A.left)>1}var Bt={},gt={};function xt(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Bt[e]=t}function rr(e,t){gt[e]=t}function Gt(e){if(typeof e=="string"&&gt.hasOwnProperty(e))e=gt[e];else if(e&&typeof e.name=="string"&&gt.hasOwnProperty(e.name)){var t=gt[e.name];typeof t=="string"&&(t={name:t}),e=Z(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Gt("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Gt("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Ge(e,t){t=Gt(t);var O=Bt[t.name];if(!O)return Ge(e,"text/plain");var A=O(e,t);if(lt.hasOwnProperty(t.name)){var j=lt[t.name];for(var ee in j){if(!j.hasOwnProperty(ee))continue;A.hasOwnProperty(ee)&&(A["_"+ee]=A[ee]),A[ee]=j[ee]}}if(A.name=t.name,t.helperType&&(A.helperType=t.helperType),t.modeProps)for(var oe in t.modeProps)A[oe]=t.modeProps[oe];return A}var lt={};function yt(e,t){var O=lt.hasOwnProperty(e)?lt[e]:lt[e]={};H(t,O)}function It(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var O={};for(var A in t){var j=t[A];j instanceof Array&&(j=j.concat([])),O[A]=j}return O}function Wt(e,t){for(var O;e.innerMode&&!(O=e.innerMode(t),!O||O.mode==e);)t=O.state,e=O.mode;return O||{mode:e,state:t}}function Ot(e,t,O){return e.startState?e.startState(t,O):!0}var Rt=function(e,t,O){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=O};Rt.prototype.eol=function(){return this.pos>=this.string.length},Rt.prototype.sol=function(){return this.pos==this.lineStart},Rt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Rt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Rt.prototype.eat=function(e){var t=this.string.charAt(this.pos),O;if(typeof e=="string"?O=t==e:O=t&&(e.test?e.test(t):e(t)),O)return++this.pos,t},Rt.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Rt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Rt.prototype.skipToEnd=function(){this.pos=this.string.length},Rt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Rt.prototype.backUp=function(e){this.pos-=e},Rt.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=G(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?G(this.string,this.lineStart,this.tabSize):0)},Rt.prototype.indentation=function(){return G(this.string,null,this.tabSize)-(this.lineStart?G(this.string,this.lineStart,this.tabSize):0)},Rt.prototype.match=function(e,t,O){if(typeof e=="string"){var A=function(oe){return O?oe.toLowerCase():oe},j=this.string.substr(this.pos,e.length);if(A(j)==A(e))return t!==!1&&(this.pos+=e.length),!0}else{var ee=this.string.slice(this.pos).match(e);return ee&&ee.index>0?null:(ee&&t!==!1&&(this.pos+=ee[0].length),ee)}},Rt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Rt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Rt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Rt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function at(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var O=e;!O.lines;)for(var A=0;;++A){var j=O.children[A],ee=j.chunkSize();if(t<ee){O=j;break}t-=ee}return O.lines[t]}function ft(e,t,O){var A=[],j=t.line;return e.iter(t.line,O.line+1,function(ee){var oe=ee.text;j==O.line&&(oe=oe.slice(0,O.ch)),j==t.line&&(oe=oe.slice(t.ch)),A.push(oe),++j}),A}function zt(e,t,O){var A=[];return e.iter(t,O,function(j){A.push(j.text)}),A}function St(e,t){var O=t-e.height;if(O)for(var A=e;A;A=A.parent)A.height+=O}function kt(e){if(e.parent==null)return null;for(var t=e.parent,O=le(t.lines,e),A=t.parent;A;t=A,A=A.parent)for(var j=0;!(A.children[j]==t);++j)O+=A.children[j].chunkSize();return O+t.first}function Ut(e,t){var O=e.first;e:do{for(var A=0;A<e.children.length;++A){var j=e.children[A],ee=j.height;if(t<ee){e=j;continue e}t-=ee,O+=j.chunkSize()}return O}while(!e.lines);for(var oe=0;oe<e.lines.length;++oe){var de=e.lines[oe],ge=de.height;if(t<ge)break;t-=ge}return O+oe}function Nt(e,t){return t>=e.first&&t<e.first+e.size}function Xt(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function Je(e,t,O){if(O===void 0&&(O=null),!(this instanceof Je))return new Je(e,t,O);this.line=e,this.ch=t,this.sticky=O}function bt(e,t){return e.line-t.line||e.ch-t.ch}function kr(e,t){return e.sticky==t.sticky&&bt(e,t)==0}function wr(e){return Je(e.line,e.ch)}function Wr(e,t){return bt(e,t)<0?t:e}function Mr(e,t){return bt(e,t)<0?e:t}function un(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function Dt(e,t){if(t.line<e.first)return Je(e.first,0);var O=e.first+e.size-1;return t.line>O?Je(O,at(e,O).text.length):vr(t,at(e,t.line).text.length)}function vr(e,t){var O=e.ch;return O==null||O>t?Je(e.line,t):O<0?Je(e.line,0):e}function Ve(e,t){for(var O=[],A=0;A<t.length;A++)O[A]=Dt(e,t[A]);return O}var qt=function(e,t){this.state=e,this.lookAhead=t},At=function(e,t,O,A){this.state=t,this.doc=e,this.line=O,this.maxLookAhead=A||0,this.baseTokens=null,this.baseTokenPos=1};At.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},At.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},At.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},At.fromSaved=function(e,t,O){return t instanceof qt?new At(e,It(e.mode,t.state),O,t.lookAhead):new At(e,It(e.mode,t),O)},At.prototype.save=function(e){var t=e!==!1?It(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new qt(t,this.maxLookAhead):t};function Sr(e,t,O,A){var j=[e.state.modeGen],ee={};Fr(e,t.text,e.doc.mode,O,function(Ee,ke){return j.push(Ee,ke)},ee,A);for(var oe=O.state,de=function(Ee){O.baseTokens=j;var ke=e.state.overlays[Ee],Pe=1,Ue=0;O.state=!0,Fr(e,t.text,ke.mode,O,function(Fe,ze){for(var Ze=Pe;Ue<Fe;){var ot=j[Pe];ot>Fe&&j.splice(Pe,1,Fe,j[Pe+1],ot),Pe+=2,Ue=Math.min(Fe,ot)}if(!ze)return;if(ke.opaque)j.splice(Ze,Pe-Ze,Fe,"overlay "+ze),Pe=Ze+2;else for(;Ze<Pe;Ze+=2){var ct=j[Ze+1];j[Ze+1]=(ct?ct+" ":"")+"overlay "+ze}},ee),O.state=oe,O.baseTokens=null,O.baseTokenPos=1},ge=0;ge<e.state.overlays.length;++ge)de(ge);return{styles:j,classes:ee.bgClass||ee.textClass?ee:null}}function yr(e,t,O){if(!t.styles||t.styles[0]!=e.state.modeGen){var A=Hr(e,kt(t)),j=t.text.length>e.options.maxHighlightLength&&It(e.doc.mode,A.state),ee=Sr(e,t,A);j&&(A.state=j),t.stateAfter=A.save(!j),t.styles=ee.styles,ee.classes?t.styleClasses=ee.classes:t.styleClasses&&(t.styleClasses=null),O===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function Hr(e,t,O){var A=e.doc,j=e.display;if(!A.mode.startState)return new At(A,!0,t);var ee=In(e,t,O),oe=ee>A.first&&at(A,ee-1).stateAfter,de=oe?At.fromSaved(A,oe,ee):new At(A,Ot(A.mode),ee);return A.iter(ee,t,function(ge){Nr(e,ge.text,de);var Ee=de.line;ge.stateAfter=Ee==t-1||Ee%5==0||Ee>=j.viewFrom&&Ee<j.viewTo?de.save():null,de.nextLine()}),O&&(A.modeFrontier=de.line),de}function Nr(e,t,O,A){var j=e.doc.mode,ee=new Rt(t,e.options.tabSize,O);for(ee.start=ee.pos=A||0,t==""&&jr(j,O.state);!ee.eol();)lr(j,ee,O.state),ee.start=ee.pos}function jr(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var O=Wt(e,t);if(O.mode.blankLine)return O.mode.blankLine(O.state)}function lr(e,t,O,A){for(var j=0;j<10;j++){A&&(A[0]=Wt(e,O).mode);var ee=e.token(t,O);if(t.pos>t.start)return ee}throw new Error("Mode "+e.name+" failed to advance stream.")}var Yr=function(e,t,O){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=O};function ur(e,t,O,A){var j=e.doc,ee=j.mode,oe;t=Dt(j,t);var de=at(j,t.line),ge=Hr(e,t.line,O),Ee=new Rt(de.text,e.options.tabSize,ge),ke;for(A&&(ke=[]);(A||Ee.pos<t.ch)&&!Ee.eol();)Ee.start=Ee.pos,oe=lr(ee,Ee,ge.state),A&&ke.push(new Yr(Ee,oe,It(j.mode,ge.state)));return A?ke:new Yr(Ee,oe,ge.state)}function qr(e,t){if(e)for(;;){var O=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!O)break;e=e.slice(0,O.index)+e.slice(O.index+O[0].length);var A=O[1]?"bgClass":"textClass";t[A]==null?t[A]=O[2]:new RegExp("(?:^|\\s)"+O[2]+"(?:$|\\s)").test(t[A])||(t[A]+=" "+O[2])}return e}function Fr(e,t,O,A,j,ee,oe){var de=O.flattenSpans;de==null&&(de=e.options.flattenSpans);var ge=0,Ee=null,ke=new Rt(t,e.options.tabSize,A),Pe,Ue=e.options.addModeClass&&[null];for(t==""&&qr(jr(O,A.state),ee);!ke.eol();){if(ke.pos>e.options.maxHighlightLength?(de=!1,oe&&Nr(e,t,A,ke.pos),ke.pos=t.length,Pe=null):Pe=qr(lr(O,ke,A.state,Ue),ee),Ue){var Fe=Ue[0].name;Fe&&(Pe="m-"+(Pe?Fe+" "+Pe:Fe))}if(!de||Ee!=Pe){for(;ge<ke.start;)ge=Math.min(ke.start,ge+5e3),j(ge,Ee);Ee=Pe}ke.start=ke.pos}for(;ge<ke.pos;){var ze=Math.min(ke.pos,ge+5e3);j(ze,Ee),ge=ze}}function In(e,t,O){for(var A,j,ee=e.doc,oe=O?-1:t-(e.doc.mode.innerMode?1e3:100),de=t;de>oe;--de){if(de<=ee.first)return ee.first;var ge=at(ee,de-1),Ee=ge.stateAfter;if(Ee&&(!O||de+(Ee instanceof qt?Ee.lookAhead:0)<=ee.modeFrontier))return de;var ke=G(ge.text,null,e.options.tabSize);(j==null||A>ke)&&(j=de-1,A=ke)}return j}function Kn(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var O=e.first,A=t-1;A>O;A--){var j=at(e,A).stateAfter;if(j&&(!(j instanceof qt)||A+j.lookAhead<t)){O=A+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,O)}var Mn=!1,cr=!1;function cn(){Mn=!0}function oi(){cr=!0}function bn(e,t,O){this.marker=e,this.from=t,this.to=O}function Dr(e,t){if(e)for(var O=0;O<e.length;++O){var A=e[O];if(A.marker==t)return A}}function br(e,t){for(var O,A=0;A<e.length;++A)e[A]!=t&&(O||(O=[])).push(e[A]);return O}function Zt(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function dr(e,t,O){var A;if(e)for(var j=0;j<e.length;++j){var ee=e[j],oe=ee.marker,de=ee.from==null||(oe.inclusiveLeft?ee.from<=t:ee.from<t);if(de||ee.from==t&&oe.type=="bookmark"&&(!O||!ee.marker.insertLeft)){var ge=ee.to==null||(oe.inclusiveRight?ee.to>=t:ee.to>t);(A||(A=[])).push(new bn(oe,ee.from,ge?null:ee.to))}}return A}function xr(e,t,O){var A;if(e)for(var j=0;j<e.length;++j){var ee=e[j],oe=ee.marker,de=ee.to==null||(oe.inclusiveRight?ee.to>=t:ee.to>t);if(de||ee.from==t&&oe.type=="bookmark"&&(!O||ee.marker.insertLeft)){var ge=ee.from==null||(oe.inclusiveLeft?ee.from<=t:ee.from<t);(A||(A=[])).push(new bn(oe,ge?null:ee.from-t,ee.to==null?null:ee.to-t))}}return A}function dn(e,t){if(t.full)return null;var O=Nt(e,t.from.line)&&at(e,t.from.line).markedSpans,A=Nt(e,t.to.line)&&at(e,t.to.line).markedSpans;if(!O&&!A)return null;var j=t.from.ch,ee=t.to.ch,oe=bt(t.from,t.to)==0,de=dr(O,j,oe),ge=xr(A,ee,oe),Ee=t.text.length==1,ke=D(t.text).length+(Ee?j:0);if(de)for(var Pe=0;Pe<de.length;++Pe){var Ue=de[Pe];if(Ue.to==null){var Fe=Dr(ge,Ue.marker);Fe?Ee&&(Ue.to=Fe.to==null?null:Fe.to+ke):Ue.to=j}}if(ge)for(var ze=0;ze<ge.length;++ze){var Ze=ge[ze];if(Ze.to!=null&&(Ze.to+=ke),Ze.from==null){var ot=Dr(de,Ze.marker);ot||(Ze.from=ke,Ee&&(de||(de=[])).push(Ze))}else Ze.from+=ke,Ee&&(de||(de=[])).push(Ze)}de&&(de=Gn(de)),ge&&ge!=de&&(ge=Gn(ge));var ct=[de];if(!Ee){var mt=t.text.length-2,dt;if(mt>0&&de)for(var vt=0;vt<de.length;++vt)de[vt].to==null&&(dt||(dt=[])).push(new bn(de[vt].marker,null,null));for(var Lt=0;Lt<mt;++Lt)ct.push(dt);ct.push(ge)}return ct}function Gn(e){for(var t=0;t<e.length;++t){var O=e[t];O.from!=null&&O.from==O.to&&O.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function hn(e,t,O){var A=null;if(e.iter(t.line,O.line+1,function(Fe){if(Fe.markedSpans)for(var ze=0;ze<Fe.markedSpans.length;++ze){var Ze=Fe.markedSpans[ze].marker;Ze.readOnly&&(!A||le(A,Ze)==-1)&&(A||(A=[])).push(Ze)}}),!A)return null;for(var j=[{from:t,to:O}],ee=0;ee<A.length;++ee)for(var oe=A[ee],de=oe.find(0),ge=0;ge<j.length;++ge){var Ee=j[ge];if(bt(Ee.to,de.from)<0||bt(Ee.from,de.to)>0)continue;var ke=[ge,1],Pe=bt(Ee.from,de.from),Ue=bt(Ee.to,de.to);(Pe<0||!oe.inclusiveLeft&&!Pe)&&ke.push({from:Ee.from,to:de.from}),(Ue>0||!oe.inclusiveRight&&!Ue)&&ke.push({from:de.to,to:Ee.to}),j.splice.apply(j,ke),ge+=ke.length-3}return j}function Vi(e){var t=e.markedSpans;if(!t)return;for(var O=0;O<t.length;++O)t[O].marker.detachLine(e);e.markedSpans=null}function Nn(e,t){if(!t)return;for(var O=0;O<t.length;++O)t[O].marker.attachLine(e);e.markedSpans=t}function On(e){return e.inclusiveLeft?-1:0}function fn(e){return e.inclusiveRight?1:0}function kn(e,t){var O=e.lines.length-t.lines.length;if(O!=0)return O;var A=e.find(),j=t.find(),ee=bt(A.from,j.from)||On(e)-On(t);if(ee)return-ee;var oe=bt(A.to,j.to)||fn(e)-fn(t);return oe||t.id-e.id}function xn(e,t){var O=cr&&e.markedSpans,A;if(O)for(var j=void 0,ee=0;ee<O.length;++ee)j=O[ee],j.marker.collapsed&&(t?j.from:j.to)==null&&(!A||kn(A,j.marker)<0)&&(A=j.marker);return A}function En(e){return xn(e,!0)}function en(e){return xn(e,!1)}function zn(e,t){var O=cr&&e.markedSpans,A;if(O)for(var j=0;j<O.length;++j){var ee=O[j];ee.marker.collapsed&&(ee.from==null||ee.from<t)&&(ee.to==null||ee.to>t)&&(!A||kn(A,ee.marker)<0)&&(A=ee.marker)}return A}function Si(e,t,O,A,j){var ee=at(e,t),oe=cr&&ee.markedSpans;if(oe)for(var de=0;de<oe.length;++de){var ge=oe[de];if(!ge.marker.collapsed)continue;var Ee=ge.marker.find(0),ke=bt(Ee.from,O)||On(ge.marker)-On(j),Pe=bt(Ee.to,A)||fn(ge.marker)-fn(j);if(ke>=0&&Pe<=0||ke<=0&&Pe>=0)continue;if(ke<=0&&(ge.marker.inclusiveRight&&j.inclusiveLeft?bt(Ee.to,O)>=0:bt(Ee.to,O)>0)||ke>=0&&(ge.marker.inclusiveRight&&j.inclusiveLeft?bt(Ee.from,A)<=0:bt(Ee.from,A)<0))return!0}}function Rr(e){for(var t;t=En(e);)e=t.find(-1,!0).line;return e}function Vn(e){for(var t;t=en(e);)e=t.find(1,!0).line;return e}function Dn(e){for(var t,O;t=en(e);)e=t.find(1,!0).line,(O||(O=[])).push(e);return O}function si(e,t){var O=at(e,t),A=Rr(O);return O==A?t:kt(A)}function Rn(e,t){if(t>e.lastLine())return t;var O=at(e,t),A;if(!pn(e,O))return t;for(;A=en(O);)O=A.find(1,!0).line;return kt(O)+1}function pn(e,t){var O=cr&&t.markedSpans;if(O)for(var A=void 0,j=0;j<O.length;++j){if(A=O[j],!A.marker.collapsed)continue;if(A.from==null)return!0;if(A.marker.widgetNode)continue;if(A.from==0&&A.marker.inclusiveLeft&&li(e,t,A))return!0}}function li(e,t,O){if(O.to==null){var A=O.marker.find(1,!0);return li(e,A.line,Dr(A.line.markedSpans,O.marker))}if(O.marker.inclusiveRight&&O.to==t.text.length)return!0;for(var j=void 0,ee=0;ee<t.markedSpans.length;++ee)if(j=t.markedSpans[ee],j.marker.collapsed&&!j.marker.widgetNode&&j.from==O.to&&(j.to==null||j.to!=O.from)&&(j.marker.inclusiveLeft||O.marker.inclusiveRight)&&li(e,t,j))return!0}function tn(e){e=Rr(e);for(var t=0,O=e.parent,A=0;A<O.lines.length;++A){var j=O.lines[A];if(j==e)break;t+=j.height}for(var ee=O.parent;ee;O=ee,ee=O.parent)for(var oe=0;oe<ee.children.length;++oe){var de=ee.children[oe];if(de==O)break;t+=de.height}return t}function ui(e){if(e.height==0)return 0;for(var t=e.text.length,O,A=e;O=En(A);){var j=O.find(0,!0);A=j.from.line,t+=j.from.ch-j.to.ch}for(A=e;O=en(A);){var ee=O.find(0,!0);t-=A.text.length-ee.from.ch,A=ee.to.line,t+=A.text.length-ee.to.ch}return t}function Ci(e){var t=e.display,O=e.doc;t.maxLine=at(O,O.first),t.maxLineLength=ui(t.maxLine),t.maxLineChanged=!0,O.iter(function(A){var j=ui(A);j>t.maxLineLength&&(t.maxLineLength=j,t.maxLine=A)})}var jn=function(e,t,O){this.text=e,Nn(this,t),this.height=O?O(this):1};jn.prototype.lineNo=function(){return kt(this)},_e(jn);function Xi(e,t,O,A){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Vi(e),Nn(e,O);var j=A?A(e):1;j!=e.height&&St(e,j)}function Et(e){e.parent=null,Vi(e)}var Mt={},_t={};function Ht(e,t){if(!e||/^\s*$/.test(e))return null;var O=t.addModeClass?_t:Mt;return O[e]||(O[e]=e.replace(/\S+/g,"cm-$&"))}function it(e,t){var O=B("span",null,null,s?"padding-right: .1px":null),A={pre:B("pre",[O],"CodeMirror-line"),content:O,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var j=0;j<=(t.rest?t.rest.length:0);j++){var ee=j?t.rest[j-1]:t.line,oe=void 0;A.pos=0,A.addToken=rt,pt(e.display.measure)&&(oe=Be(ee,e.doc.direction))&&(A.addToken=Ct(A.addToken,oe)),A.map=[];var de=t!=e.display.externalMeasured&&kt(ee);jt(ee,A,yr(e,ee,de)),ee.styleClasses&&(ee.styleClasses.bgClass&&(A.bgClass=z(ee.styleClasses.bgClass,A.bgClass||"")),ee.styleClasses.textClass&&(A.textClass=z(ee.styleClasses.textClass,A.textClass||""))),A.map.length==0&&A.map.push(0,0,A.content.appendChild(Ye(e.display.measure))),j==0?(t.measure.map=A.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(A.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(s){var ge=A.content.lastChild;(/\bcm-tab\b/.test(ge.className)||ge.querySelector&&ge.querySelector(".cm-tab"))&&(A.content.className="cm-tab-wrap-hack")}return we(e,"renderLine",e,t.line,A.pre),A.pre.className&&(A.textClass=z(A.pre.className,A.textClass||"")),A}function qe(e){var t=_("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function rt(e,t,O,A,j,ee,oe){if(!t)return;var de=e.splitSpaces?ht(t,e.trailingSpace):t,ge=e.cm.state.specialChars,Ee=!1,ke;if(!ge.test(t))e.col+=t.length,ke=document.createTextNode(de),e.map.push(e.pos,e.pos+t.length,ke),C&&g<9&&(Ee=!0),e.pos+=t.length;else{ke=document.createDocumentFragment();for(var Pe=0;;){ge.lastIndex=Pe;var Ue=ge.exec(t),Fe=Ue?Ue.index-Pe:t.length-Pe;if(Fe){var ze=document.createTextNode(de.slice(Pe,Pe+Fe));C&&g<9?ke.appendChild(_("span",[ze])):ke.appendChild(ze),e.map.push(e.pos,e.pos+Fe,ze),e.col+=Fe,e.pos+=Fe}if(!Ue)break;Pe+=Fe+1;var Ze=void 0;if(Ue[0]==" "){var ot=e.cm.options.tabSize,ct=ot-e.col%ot;Ze=ke.appendChild(_("span",Q(ct),"cm-tab")),Ze.setAttribute("role","presentation"),Ze.setAttribute("cm-text"," "),e.col+=ct}else Ue[0]=="\r"||Ue[0]==`
`?(Ze=ke.appendChild(_("span",Ue[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Ze.setAttribute("cm-text",Ue[0]),e.col+=1):(Ze=e.cm.options.specialCharPlaceholder(Ue[0]),Ze.setAttribute("cm-text",Ue[0]),C&&g<9?ke.appendChild(_("span",[Ze])):ke.appendChild(Ze),e.col+=1);e.map.push(e.pos,e.pos+1,Ze),e.pos++}}if(e.trailingSpace=de.charCodeAt(t.length-1)==32,O||A||j||Ee||ee||oe){var mt=O||"";A&&(mt+=A),j&&(mt+=j);var dt=_("span",[ke],mt,ee);if(oe)for(var vt in oe)oe.hasOwnProperty(vt)&&vt!="style"&&vt!="class"&&dt.setAttribute(vt,oe[vt]);return e.content.appendChild(dt)}e.content.appendChild(ke)}function ht(e,t){if(e.length>1&&!/ /.test(e))return e;for(var O=t,A="",j=0;j<e.length;j++){var ee=e.charAt(j);ee==" "&&O&&(j==e.length-1||e.charCodeAt(j+1)==32)&&(ee="\xA0"),A+=ee,O=ee==" "}return A}function Ct(e,t){return function(O,A,j,ee,oe,de,ge){j=j?j+" cm-force-border":"cm-force-border";for(var Ee=O.pos,ke=Ee+A.length;;){for(var Pe=void 0,Ue=0;Ue<t.length&&!(Pe=t[Ue],Pe.to>Ee&&Pe.from<=Ee);Ue++);if(Pe.to>=ke)return e(O,A,j,ee,oe,de,ge);e(O,A.slice(0,Pe.to-Ee),j,ee,null,de,ge),ee=null,A=A.slice(Pe.to-Ee),Ee=Pe.to}}}function et(e,t,O,A){var j=!A&&O.widgetNode;j&&e.map.push(e.pos,e.pos+t,j),!A&&e.cm.display.input.needsContentAttribute&&(j||(j=e.content.appendChild(document.createElement("span"))),j.setAttribute("cm-marker",O.id)),j&&(e.cm.display.input.setUneditable(j),e.content.appendChild(j)),e.pos+=t,e.trailingSpace=!1}function jt(e,t,O){var A=e.markedSpans,j=e.text,ee=0;if(!A){for(var oe=1;oe<O.length;oe+=2)t.addToken(t,j.slice(ee,ee=O[oe]),Ht(O[oe+1],t.cm.options));return}for(var de=j.length,ge=0,Ee=1,ke="",Pe,Ue,Fe=0,ze,Ze,ot,ct,mt;;){if(Fe==ge){ze=Ze=ot=Ue="",mt=null,ct=null,Fe=Infinity;for(var dt=[],vt=void 0,Lt=0;Lt<A.length;++Lt){var Tt=A[Lt],Kt=Tt.marker;if(Kt.type=="bookmark"&&Tt.from==ge&&Kt.widgetNode)dt.push(Kt);else if(Tt.from<=ge&&(Tt.to==null||Tt.to>ge||Kt.collapsed&&Tt.to==ge&&Tt.from==ge)){if(Tt.to!=null&&Tt.to!=ge&&Fe>Tt.to&&(Fe=Tt.to,Ze=""),Kt.className&&(ze+=" "+Kt.className),Kt.css&&(Ue=(Ue?Ue+";":"")+Kt.css),Kt.startStyle&&Tt.from==ge&&(ot+=" "+Kt.startStyle),Kt.endStyle&&Tt.to==Fe&&(vt||(vt=[])).push(Kt.endStyle,Tt.to),Kt.title&&((mt||(mt={})).title=Kt.title),Kt.attributes)for(var nr in Kt.attributes)(mt||(mt={}))[nr]=Kt.attributes[nr];Kt.collapsed&&(!ct||kn(ct.marker,Kt)<0)&&(ct=Tt)}else Tt.from>ge&&Fe>Tt.from&&(Fe=Tt.from)}if(vt)for(var _r=0;_r<vt.length;_r+=2)vt[_r+1]==Fe&&(Ze+=" "+vt[_r]);if(!ct||ct.from==ge)for(var or=0;or<dt.length;++or)et(t,0,dt[or]);if(ct&&(ct.from||0)==ge){if(et(t,(ct.to==null?de+1:ct.to)-ge,ct.marker,ct.from==null),ct.to==null)return;ct.to==ge&&(ct=!1)}}if(ge>=de)break;for(var Qr=Math.min(de,Fe);;){if(ke){var zr=ge+ke.length;if(!ct){var mr=zr>Qr?ke.slice(0,Qr-ge):ke;t.addToken(t,mr,Pe?Pe+ze:ze,ot,ge+mr.length==Fe?Ze:"",Ue,mt)}if(zr>=Qr){ke=ke.slice(Qr-ge),ge=Qr;break}ge=zr,ot=""}ke=j.slice(ee,ee=O[Ee++]),Pe=Ht(O[Ee++],t.cm.options)}}}function ut(e,t,O){this.line=t,this.rest=Dn(t),this.size=this.rest?kt(D(this.rest))-O+1:1,this.node=this.text=null,this.hidden=pn(e,t)}function Yt(e,t,O){for(var A=[],j,ee=t;ee<O;ee=j){var oe=new ut(e.doc,at(e.doc,ee),ee);j=ee+oe.size,A.push(oe)}return A}var Qt=null;function ar(e){Qt?Qt.ops.push(e):e.ownsGroup=Qt={ops:[e],delayedCallbacks:[]}}function hr(e){var t=e.delayedCallbacks,O=0;do{for(;O<t.length;O++)t[O].call(null);for(var A=0;A<e.ops.length;A++){var j=e.ops[A];if(j.cursorActivityHandlers)for(;j.cursorActivityCalled<j.cursorActivityHandlers.length;)j.cursorActivityHandlers[j.cursorActivityCalled++].call(null,j.cm)}}while(O<t.length)}function $r(e,t){var O=e.ownsGroup;if(!O)return;try{hr(O)}finally{Qt=null,t(O)}}var fr=null;function $t(e,t){var O=Xe(e,t);if(!O.length)return;var A=Array.prototype.slice.call(arguments,2),j;Qt?j=Qt.delayedCallbacks:fr?j=fr:(j=fr=[],setTimeout(ci,0));for(var ee=function(de){j.push(function(){return O[de].apply(null,A)})},oe=0;oe<O.length;++oe)ee(oe)}function ci(){var e=fr;fr=null;for(var t=0;t<e.length;++t)e[t]()}function wn(e,t,O,A){for(var j=0;j<t.changes.length;j++){var ee=t.changes[j];ee=="text"?di(e,t):ee=="gutter"?gn(e,t,O,A):ee=="class"?mn(e,t):ee=="widget"&&Yn(e,t,A)}t.changes=null}function rn(e){return e.node==e.text&&(e.node=_("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),C&&g<8&&(e.node.style.zIndex=2)),e.node}function Xn(e,t){var O=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(O&&(O+=" CodeMirror-linebackground"),t.background)O?t.background.className=O:(t.background.parentNode.removeChild(t.background),t.background=null);else if(O){var A=rn(t);t.background=A.insertBefore(_("div",null,O),A.firstChild),e.display.input.setUneditable(t.background)}}function Fn(e,t){var O=e.display.externalMeasured;return O&&O.line==t.line?(e.display.externalMeasured=null,t.measure=O.measure,O.built):it(e,t)}function di(e,t){var O=t.text.className,A=Fn(e,t);t.text==t.node&&(t.node=A.pre),t.text.parentNode.replaceChild(A.pre,t.text),t.text=A.pre,A.bgClass!=t.bgClass||A.textClass!=t.textClass?(t.bgClass=A.bgClass,t.textClass=A.textClass,mn(e,t)):O&&(t.text.className=O)}function mn(e,t){Xn(e,t),t.line.wrapClass?rn(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var O=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=O||""}function gn(e,t,O,A){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var j=rn(t);t.gutterBackground=_("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?A.fixedPos:-A.gutterTotalWidth)+"px; width: "+A.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),j.insertBefore(t.gutterBackground,t.text)}var ee=t.line.gutterMarkers;if(e.options.lineNumbers||ee){var oe=rn(t),de=t.gutter=_("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?A.fixedPos:-A.gutterTotalWidth)+"px");if(e.display.input.setUneditable(de),oe.insertBefore(de,t.text),t.line.gutterClass&&(de.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!ee||!ee["CodeMirror-linenumbers"])&&(t.lineNumber=de.appendChild(_("div",Xt(e.options,O),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+A.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),ee)for(var ge=0;ge<e.display.gutterSpecs.length;++ge){var Ee=e.display.gutterSpecs[ge].className,ke=ee.hasOwnProperty(Ee)&&ee[Ee];ke&&de.appendChild(_("div",[ke],"CodeMirror-gutter-elt","left: "+A.gutterLeft[Ee]+"px; width: "+A.gutterWidth[Ee]+"px"))}}}function Yn(e,t,O){t.alignable&&(t.alignable=null);for(var A=k("CodeMirror-linewidget"),j=t.node.firstChild,ee=void 0;j;j=ee)ee=j.nextSibling,A.test(j.className)&&t.node.removeChild(j);$n(e,t,O)}function Ln(e,t,O,A){var j=Fn(e,t);return t.text=t.node=j.pre,j.bgClass&&(t.bgClass=j.bgClass),j.textClass&&(t.textClass=j.textClass),mn(e,t),gn(e,t,O,A),$n(e,t,A),t.node}function $n(e,t,O){if(Bn(e,t.line,t,O,!0),t.rest)for(var A=0;A<t.rest.length;A++)Bn(e,t.rest[A],t,O,!1)}function Bn(e,t,O,A,j){if(!t.widgets)return;for(var ee=rn(O),oe=0,de=t.widgets;oe<de.length;++oe){var ge=de[oe],Ee=_("div",[ge.node],"CodeMirror-linewidget"+(ge.className?" "+ge.className:""));ge.handleMouseEvents||Ee.setAttribute("cm-ignore-events","true"),Yi(ge,Ee,O,A),e.display.input.setUneditable(Ee),j&&ge.above?ee.insertBefore(Ee,O.gutter||O.text):ee.appendChild(Ee),$t(ge,"redraw")}}function Yi(e,t,O,A){if(e.noHScroll){(O.alignable||(O.alignable=[])).push(t);var j=A.wrapperWidth;t.style.left=A.fixedPos+"px",e.coverGutter||(j-=A.gutterTotalWidth,t.style.paddingLeft=A.gutterTotalWidth+"px"),t.style.width=j+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-A.gutterTotalWidth+"px"))}function Ft(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!P(document.body,e.node)){var O="position: relative;";e.coverGutter&&(O+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(O+="width: "+t.display.wrapper.clientWidth+"px;"),x(t.display.measure,_("div",[e.node],null,O))}return e.height=e.node.parentNode.offsetHeight}function er(e,t){for(var O=Le(t);O!=e.wrapper;O=O.parentNode)if(!O||O.nodeType==1&&O.getAttribute("cm-ignore-events")=="true"||O.parentNode==e.sizer&&O!=e.mover)return!0}function Un(e){return e.lineSpace.offsetTop}function hi(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function vn(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=x(e.measure,_("pre","x","CodeMirror-line-like")),O=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,A={left:parseInt(O.paddingLeft),right:parseInt(O.paddingRight)};return!isNaN(A.left)&&!isNaN(A.right)&&(e.cachedPaddingH=A),A}function nn(e){return ue-e.display.nativeBarWidth}function Sn(e){return e.display.scroller.clientWidth-nn(e)-e.display.barWidth}function fi(e){return e.display.scroller.clientHeight-nn(e)-e.display.barHeight}function $i(e,t,O){var A=e.options.lineWrapping,j=A&&Sn(e);if(!t.measure.heights||A&&t.measure.width!=j){var ee=t.measure.heights=[];if(A){t.measure.width=j;for(var oe=t.text.firstChild.getClientRects(),de=0;de<oe.length-1;de++){var ge=oe[de],Ee=oe[de+1];Math.abs(ge.bottom-Ee.bottom)>2&&ee.push((ge.bottom+Ee.top)/2-O.top)}}ee.push(O.bottom-O.top)}}function Ti(e,t,O){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var A=0;A<e.rest.length;A++)if(e.rest[A]==t)return{map:e.measure.maps[A],cache:e.measure.caches[A]};for(var j=0;j<e.rest.length;j++)if(kt(e.rest[j])>O)return{map:e.measure.maps[j],cache:e.measure.caches[j],before:!0}}function Ji(e,t){t=Rr(t);var O=kt(t),A=e.display.externalMeasured=new ut(e.doc,t,O);A.lineN=O;var j=A.built=it(e,A);return A.text=j.pre,x(e.display.lineMeasure,j.pre),A}function Zi(e,t,O,A){return Jr(e,an(e,t),O,A)}function _i(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[gi(e,t)];var O=e.display.externalMeasured;if(O&&t>=O.lineN&&t<O.lineN+O.size)return O}function an(e,t){var O=kt(t),A=_i(e,O);A&&!A.text?A=null:A&&A.changes&&(wn(e,A,O,Xa(e)),e.curOp.forceUpdate=!0),A||(A=Ji(e,t));var j=Ti(A,t,O);return{line:t,view:A,rect:null,map:j.map,cache:j.cache,before:j.before,hasHeights:!1}}function Jr(e,t,O,A,j){t.before&&(O=-1);var ee=O+(A||""),oe;return t.cache.hasOwnProperty(ee)?oe=t.cache[ee]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||($i(e,t.view,t.rect),t.hasHeights=!0),oe=xa(e,t,O,A),oe.bogus||(t.cache[ee]=oe)),{left:oe.left,right:oe.right,top:j?oe.rtop:oe.top,bottom:j?oe.rbottom:oe.bottom}}var Qi={left:0,right:0,top:0,bottom:0};function Jn(e,t,O){for(var A,j,ee,oe,de,ge,Ee=0;Ee<e.length;Ee+=3)if(de=e[Ee],ge=e[Ee+1],t<de?(j=0,ee=1,oe="left"):t<ge?(j=t-de,ee=j+1):(Ee==e.length-3||t==ge&&e[Ee+3]>t)&&(ee=ge-de,j=ee-1,t>=ge&&(oe="right")),j!=null){if(A=e[Ee+2],de==ge&&O==(A.insertLeft?"left":"right")&&(oe=O),O=="left"&&j==0)for(;Ee&&e[Ee-2]==e[Ee-3]&&e[Ee-1].insertLeft;)A=e[(Ee-=3)+2],oe="left";if(O=="right"&&j==ge-de)for(;Ee<e.length-3&&e[Ee+3]==e[Ee+4]&&!e[Ee+5].insertLeft;)A=e[(Ee+=3)+2],oe="right";break}return{node:A,start:j,end:ee,collapse:oe,coverStart:de,coverEnd:ge}}function Cn(e,t){var O=Qi;if(t=="left")for(var A=0;A<e.length&&!((O=e[A]).left!=O.right);A++);else for(var j=e.length-1;j>=0&&!((O=e[j]).left!=O.right);j--);return O}function xa(e,t,O,A){var j=Jn(t.map,O,A),ee=j.node,oe=j.start,de=j.end,ge=j.collapse,Ee;if(ee.nodeType==3){for(var ke=0;ke<4;ke++){for(;oe&&ve(t.line.text.charAt(j.coverStart+oe));)--oe;for(;j.coverStart+de<j.coverEnd&&ve(t.line.text.charAt(j.coverStart+de));)++de;if(C&&g<9&&oe==0&&de==j.coverEnd-j.coverStart?Ee=ee.parentNode.getBoundingClientRect():Ee=Cn(U(ee,oe,de).getClientRects(),A),Ee.left||Ee.right||oe==0)break;de=oe,oe=oe-1,ge="right"}C&&g<11&&(Ee=Ea(e.display.measure,Ee))}else{oe>0&&(ge=A="right");var Pe;e.options.lineWrapping&&(Pe=ee.getClientRects()).length>1?Ee=Pe[A=="right"?Pe.length-1:0]:Ee=ee.getBoundingClientRect()}if(C&&g<9&&!oe&&(!Ee||!Ee.left&&!Ee.right)){var Ue=ee.parentNode.getClientRects()[0];Ue?Ee={left:Ue.left,right:Ue.left+Ri(e.display),top:Ue.top,bottom:Ue.bottom}:Ee=Qi}for(var Fe=Ee.top-t.rect.top,ze=Ee.bottom-t.rect.top,Ze=(Fe+ze)/2,ot=t.view.measure.heights,ct=0;ct<ot.length-1&&!(Ze<ot[ct]);ct++);var mt=ct?ot[ct-1]:0,dt=ot[ct],vt={left:(ge=="right"?Ee.right:Ee.left)-t.rect.left,right:(ge=="left"?Ee.left:Ee.right)-t.rect.left,top:mt,bottom:dt};return!Ee.left&&!Ee.right&&(vt.bogus=!0),e.options.singleCursorHeightPerLine||(vt.rtop=Fe,vt.rbottom=ze),vt}function Ea(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Vt(e))return t;var O=screen.logicalXDPI/screen.deviceXDPI,A=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*O,right:t.right*O,top:t.top*A,bottom:t.bottom*A}}function Ai(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function yn(e){e.display.externalMeasure=null,b(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Ai(e.display.view[t])}function Zn(e){yn(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Oi(){return r&&u?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function ki(){return r&&u?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function wa(e){var t=0;if(e.widgets)for(var O=0;O<e.widgets.length;++O)e.widgets[O].above&&(t+=Ft(e.widgets[O]));return t}function Lr(e,t,O,A,j){if(!j){var ee=wa(t);O.top+=ee,O.bottom+=ee}if(A=="line")return O;A||(A="local");var oe=tn(t);if(A=="local"?oe+=Un(e.display):oe-=e.display.viewOffset,A=="page"||A=="window"){var de=e.display.lineSpace.getBoundingClientRect();oe+=de.top+(A=="window"?0:ki());var ge=de.left+(A=="window"?0:Oi());O.left+=ge,O.right+=ge}return O.top+=oe,O.bottom+=oe,O}function on(e,t,O){if(O=="div")return t;var A=t.left,j=t.top;if(O=="page")A-=Oi(),j-=ki();else if(O=="local"||!O){var ee=e.display.sizer.getBoundingClientRect();A+=ee.left,j+=ee.top}var oe=e.display.lineSpace.getBoundingClientRect();return{left:A-oe.left,top:j-oe.top}}function Ka(e,t,O,A,j){return A||(A=at(e.doc,t.line)),Lr(e,A,Zi(e,A,t.ch,j),O)}function Tn(e,t,O,A,j,ee){A=A||at(e.doc,t.line),j||(j=an(e,A));function oe(ze,Ze){var ot=Jr(e,j,ze,Ze?"right":"left",ee);return Ze?ot.left=ot.right:ot.right=ot.left,Lr(e,A,ot,O)}var de=Be(A,e.doc.direction),ge=t.ch,Ee=t.sticky;if(ge>=A.text.length?(ge=A.text.length,Ee="before"):ge<=0&&(ge=0,Ee="after"),!de)return oe(Ee=="before"?ge-1:ge,Ee=="before");function ke(ze,Ze,ot){var ct=de[Ze],mt=ct.level==1;return oe(ot?ze-1:ze,mt!=ot)}var Pe=Ne(de,ge,Ee),Ue=je,Fe=ke(ge,Pe,Ee=="before");return Ue!=null&&(Fe.other=ke(ge,Ue,Ee!="before")),Fe}function So(e,t){var O=0;t=Dt(e.doc,t),e.options.lineWrapping||(O=Ri(e.display)*t.ch);var A=at(e.doc,t.line),j=tn(A)+Un(e.display);return{left:O,right:O,top:j,bottom:j+A.height}}function Ga(e,t,O,A,j){var ee=Je(e,t,O);return ee.xRel=j,A&&(ee.outside=A),ee}function za(e,t,O){var A=e.doc;if(O+=e.display.viewOffset,O<0)return Ga(A.first,0,null,-1,-1);var j=Ut(A,O),ee=A.first+A.size-1;if(j>ee)return Ga(A.first+A.size-1,at(A,ee).text.length,null,1,1);t<0&&(t=0);for(var oe=at(A,j);;){var de=Ks(e,oe,j,t,O),ge=zn(oe,de.ch+(de.xRel>0||de.outside>0?1:0));if(!ge)return de;var Ee=ge.find(1);if(Ee.line==j)return Ee;oe=at(A,j=Ee.line)}}function Co(e,t,O,A){A-=wa(t);var j=t.text.length,ee=Re(function(oe){return Jr(e,O,oe-1).bottom<=A},j,0);return j=Re(function(oe){return Jr(e,O,oe).top>A},ee,j),{begin:ee,end:j}}function To(e,t,O,A){O||(O=an(e,t));var j=Lr(e,t,Jr(e,O,A),"line").top;return Co(e,t,O,j)}function Va(e,t,O,A){return e.bottom<=O?!1:e.top>O?!0:(A?e.left:e.right)>t}function Ks(e,t,O,A,j){j-=tn(t);var ee=an(e,t),oe=wa(t),de=0,ge=t.text.length,Ee=!0,ke=Be(t,e.doc.direction);if(ke){var Pe=(e.options.lineWrapping?zs:Gs)(e,t,O,ee,ke,A,j);Ee=Pe.level!=1,de=Ee?Pe.from:Pe.to-1,ge=Ee?Pe.to:Pe.from-1}var Ue=null,Fe=null,ze=Re(function(Lt){var Tt=Jr(e,ee,Lt);return Tt.top+=oe,Tt.bottom+=oe,Va(Tt,A,j,!1)?(Tt.top<=j&&Tt.left<=A&&(Ue=Lt,Fe=Tt),!0):!1},de,ge),Ze,ot,ct=!1;if(Fe){var mt=A-Fe.left<Fe.right-A,dt=mt==Ee;ze=Ue+(dt?0:1),ot=dt?"after":"before",Ze=mt?Fe.left:Fe.right}else{!Ee&&(ze==ge||ze==de)&&ze++,ot=ze==0?"after":ze==t.text.length?"before":Jr(e,ee,ze-(Ee?1:0)).bottom+oe<=j==Ee?"after":"before";var vt=Tn(e,Je(O,ze,ot),"line",t,ee);Ze=vt.left,ct=j<vt.top?-1:j>=vt.bottom?1:0}return ze=Te(t.text,ze,1),Ga(O,ze,ot,ct,A-Ze)}function Gs(e,t,O,A,j,ee,oe){var de=Re(function(Pe){var Ue=j[Pe],Fe=Ue.level!=1;return Va(Tn(e,Je(O,Fe?Ue.to:Ue.from,Fe?"before":"after"),"line",t,A),ee,oe,!0)},0,j.length-1),ge=j[de];if(de>0){var Ee=ge.level!=1,ke=Tn(e,Je(O,Ee?ge.from:ge.to,Ee?"after":"before"),"line",t,A);Va(ke,ee,oe,!0)&&ke.top>oe&&(ge=j[de-1])}return ge}function zs(e,t,O,A,j,ee,oe){var de=Co(e,t,A,oe),ge=de.begin,Ee=de.end;/\s/.test(t.text.charAt(Ee-1))&&Ee--;for(var ke=null,Pe=null,Ue=0;Ue<j.length;Ue++){var Fe=j[Ue];if(Fe.from>=Ee||Fe.to<=ge)continue;var ze=Fe.level!=1,Ze=Jr(e,A,ze?Math.min(Ee,Fe.to)-1:Math.max(ge,Fe.from)).right,ot=Ze<ee?ee-Ze+1e9:Ze-ee;(!ke||Pe>ot)&&(ke=Fe,Pe=ot)}return ke||(ke=j[j.length-1]),ke.from<ge&&(ke={from:ge,to:ke.to,level:ke.level}),ke.to>Ee&&(ke={from:ke.from,to:Ee,level:ke.level}),ke}var pi;function Di(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(pi==null){pi=_("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)pi.appendChild(document.createTextNode("x")),pi.appendChild(_("br"));pi.appendChild(document.createTextNode("x"))}x(e.measure,pi);var O=pi.offsetHeight/50;return O>3&&(e.cachedTextHeight=O),b(e.measure),O||1}function Ri(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=_("span","xxxxxxxxxx"),O=_("pre",[t],"CodeMirror-line-like");x(e.measure,O);var A=t.getBoundingClientRect(),j=(A.right-A.left)/10;return j>2&&(e.cachedCharWidth=j),j||10}function Xa(e){for(var t=e.display,O={},A={},j=t.gutters.clientLeft,ee=t.gutters.firstChild,oe=0;ee;ee=ee.nextSibling,++oe){var de=e.display.gutterSpecs[oe].className;O[de]=ee.offsetLeft+ee.clientLeft+j,A[de]=ee.clientWidth}return{fixedPos:Ya(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:O,gutterWidth:A,wrapperWidth:t.wrapper.clientWidth}}function Ya(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function _o(e){var t=Di(e.display),O=e.options.lineWrapping,A=O&&Math.max(5,e.display.scroller.clientWidth/Ri(e.display)-3);return function(j){if(pn(e.doc,j))return 0;var ee=0;if(j.widgets)for(var oe=0;oe<j.widgets.length;oe++)j.widgets[oe].height&&(ee+=j.widgets[oe].height);return O?ee+(Math.ceil(j.text.length/A)||1)*t:ee+t}}function $a(e){var t=e.doc,O=_o(e);t.iter(function(A){var j=O(A);j!=A.height&&St(A,j)})}function mi(e,t,O,A){var j=e.display;if(!O&&Le(t).getAttribute("cm-not-content")=="true")return null;var ee,oe,de=j.lineSpace.getBoundingClientRect();try{ee=t.clientX-de.left,oe=t.clientY-de.top}catch(Pe){return null}var ge=za(e,ee,oe),Ee;if(A&&ge.xRel>0&&(Ee=at(e.doc,ge.line).text).length==ge.ch){var ke=G(Ee,Ee.length,e.options.tabSize)-Ee.length;ge=Je(ge.line,Math.max(0,Math.round((ee-vn(e.display).left)/Ri(e.display))-ke))}return ge}function gi(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var O=e.display.view,A=0;A<O.length;A++)if(t-=O[A].size,t<0)return A}function Kr(e,t,O,A){t==null&&(t=e.doc.first),O==null&&(O=e.doc.first+e.doc.size),A||(A=0);var j=e.display;if(A&&O<j.viewTo&&(j.updateLineNumbers==null||j.updateLineNumbers>t)&&(j.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=j.viewTo)cr&&si(e.doc,t)<j.viewTo&&qn(e);else if(O<=j.viewFrom)cr&&Rn(e.doc,O+A)>j.viewFrom?qn(e):(j.viewFrom+=A,j.viewTo+=A);else if(t<=j.viewFrom&&O>=j.viewTo)qn(e);else if(t<=j.viewFrom){var ee=Sa(e,O,O+A,1);ee?(j.view=j.view.slice(ee.index),j.viewFrom=ee.lineN,j.viewTo+=A):qn(e)}else if(O>=j.viewTo){var oe=Sa(e,t,t,-1);oe?(j.view=j.view.slice(0,oe.index),j.viewTo=oe.lineN):qn(e)}else{var de=Sa(e,t,t,-1),ge=Sa(e,O,O+A,1);de&&ge?(j.view=j.view.slice(0,de.index).concat(Yt(e,de.lineN,ge.lineN)).concat(j.view.slice(ge.index)),j.viewTo+=A):qn(e)}var Ee=j.externalMeasured;Ee&&(O<Ee.lineN?Ee.lineN+=A:t<Ee.lineN+Ee.size&&(j.externalMeasured=null))}function Qn(e,t,O){e.curOp.viewChanged=!0;var A=e.display,j=e.display.externalMeasured;if(j&&t>=j.lineN&&t<j.lineN+j.size&&(A.externalMeasured=null),t<A.viewFrom||t>=A.viewTo)return;var ee=A.view[gi(e,t)];if(ee.node==null)return;var oe=ee.changes||(ee.changes=[]);le(oe,O)==-1&&oe.push(O)}function qn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Sa(e,t,O,A){var j=gi(e,t),ee,oe=e.display.view;if(!cr||O==e.doc.first+e.doc.size)return{index:j,lineN:O};for(var de=e.display.viewFrom,ge=0;ge<j;ge++)de+=oe[ge].size;if(de!=t){if(A>0){if(j==oe.length-1)return null;ee=de+oe[j].size-t,j++}else ee=de-t;t+=ee,O+=ee}for(;si(e.doc,O)!=O;){if(j==(A<0?0:oe.length-1))return null;O+=A*oe[j-(A<0?1:0)].size,j+=A}return{index:j,lineN:O}}function Vs(e,t,O){var A=e.display,j=A.view;j.length==0||t>=A.viewTo||O<=A.viewFrom?(A.view=Yt(e,t,O),A.viewFrom=t):(A.viewFrom>t?A.view=Yt(e,t,A.viewFrom).concat(A.view):A.viewFrom<t&&(A.view=A.view.slice(gi(e,t))),A.viewFrom=t,A.viewTo<O?A.view=A.view.concat(Yt(e,A.viewTo,O)):A.viewTo>O&&(A.view=A.view.slice(0,gi(e,O)))),A.viewTo=O}function Ao(e){for(var t=e.display.view,O=0,A=0;A<t.length;A++){var j=t[A];!j.hidden&&(!j.node||j.changes)&&++O}return O}function qi(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Oo(e,t){t===void 0&&(t=!0);for(var O=e.doc,A={},j=A.cursors=document.createDocumentFragment(),ee=A.selection=document.createDocumentFragment(),oe=0;oe<O.sel.ranges.length;oe++){if(!t&&oe==O.sel.primIndex)continue;var de=O.sel.ranges[oe];if(de.from().line>=e.display.viewTo||de.to().line<e.display.viewFrom)continue;var ge=de.empty();(ge||e.options.showCursorWhenSelecting)&&ko(e,de.head,j),ge||Xs(e,de,ee)}return A}function ko(e,t,O){var A=Tn(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),j=O.appendChild(_("div","\xA0","CodeMirror-cursor"));if(j.style.left=A.left+"px",j.style.top=A.top+"px",j.style.height=Math.max(0,A.bottom-A.top)*e.options.cursorHeight+"px",A.other){var ee=O.appendChild(_("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));ee.style.display="",ee.style.left=A.other.left+"px",ee.style.top=A.other.top+"px",ee.style.height=(A.other.bottom-A.other.top)*.85+"px"}}function Ca(e,t){return e.top-t.top||e.left-t.left}function Xs(e,t,O){var A=e.display,j=e.doc,ee=document.createDocumentFragment(),oe=vn(e.display),de=oe.left,ge=Math.max(A.sizerWidth,Sn(e)-A.sizer.offsetLeft)-oe.right,Ee=j.direction=="ltr";function ke(dt,vt,Lt,Tt){vt<0&&(vt=0),vt=Math.round(vt),Tt=Math.round(Tt),ee.appendChild(_("div",null,"CodeMirror-selected","position: absolute; left: "+dt+`px;
top: `+vt+"px; width: "+(Lt==null?ge-dt:Lt)+`px;
height: `+(Tt-vt)+"px"))}function Pe(dt,vt,Lt){var Tt=at(j,dt),Kt=Tt.text.length,nr,_r;function or(mr,Vr){return Ka(e,Je(dt,mr),"div",Tt,Vr)}function Qr(mr,Vr,Or){var Er=To(e,Tt,null,mr),gr=Vr=="ltr"==(Or=="after")?"left":"right",sr=Or=="after"?Er.begin:Er.end-(/\s/.test(Tt.text.charAt(Er.end-1))?2:1);return or(sr,gr)[gr]}var zr=Be(Tt,j.direction);return Ie(zr,vt||0,Lt==null?Kt:Lt,function(mr,Vr,Or,Er){var gr=Or=="ltr",sr=or(mr,gr?"left":"right"),Xr=or(Vr-1,gr?"right":"left"),Gi=vt==null&&mr==0,ai=Lt==null&&Vr==Kt,Ir=Er==0,Pn=!zr||Er==zr.length-1;if(Xr.top-sr.top<=3){var Ar=(Ee?Gi:ai)&&Ir,Eo=(Ee?ai:Gi)&&Pn,Hn=Ar?de:(gr?sr:Xr).left,Ei=Eo?ge:(gr?Xr:sr).right;ke(Hn,sr.top,Ei-Hn,sr.bottom)}else{var wi,Ur,zi,wo;gr?(wi=Ee&&Gi&&Ir?de:sr.left,Ur=Ee?ge:Qr(mr,Or,"before"),zi=Ee?de:Qr(Vr,Or,"after"),wo=Ee&&ai&&Pn?ge:Xr.right):(wi=Ee?Qr(mr,Or,"before"):de,Ur=!Ee&&Gi&&Ir?ge:sr.right,zi=!Ee&&ai&&Pn?de:Xr.left,wo=Ee?Qr(Vr,Or,"after"):ge),ke(wi,sr.top,Ur-wi,sr.bottom),sr.bottom<Xr.top&&ke(de,sr.bottom,null,Xr.top),ke(zi,Xr.top,wo-zi,Xr.bottom)}(!nr||Ca(sr,nr)<0)&&(nr=sr),Ca(Xr,nr)<0&&(nr=Xr),(!_r||Ca(sr,_r)<0)&&(_r=sr),Ca(Xr,_r)<0&&(_r=Xr)}),{start:nr,end:_r}}var Ue=t.from(),Fe=t.to();if(Ue.line==Fe.line)Pe(Ue.line,Ue.ch,Fe.ch);else{var ze=at(j,Ue.line),Ze=at(j,Fe.line),ot=Rr(ze)==Rr(Ze),ct=Pe(Ue.line,Ue.ch,ot?ze.text.length+1:null).end,mt=Pe(Fe.line,ot?0:null,Fe.ch).start;ot&&(ct.top<mt.top-2?(ke(ct.right,ct.top,null,ct.bottom),ke(de,mt.top,mt.left,mt.bottom)):ke(ct.right,ct.top,mt.left-ct.right,ct.bottom)),ct.bottom<mt.top&&ke(de,ct.bottom,null,mt.top)}O.appendChild(ee)}function Ja(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var O=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Li(e),t.cursorDiv.style.visibility=(O=!O)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function Do(e){e.state.focused||(e.display.input.focus(),Za(e))}function Ro(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Li(e))},100)}function Za(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(we(e,"focus",e,t),e.state.focused=!0,$(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),s&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Ja(e)}function Li(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(we(e,"blur",e,t),e.state.focused=!1,d(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function Ta(e){for(var t=e.display,O=t.lineDiv.offsetTop,A=0;A<t.view.length;A++){var j=t.view[A],ee=e.options.lineWrapping,oe=void 0,de=0;if(j.hidden)continue;if(C&&g<8){var ge=j.node.offsetTop+j.node.offsetHeight;oe=ge-O,O=ge}else{var Ee=j.node.getBoundingClientRect();oe=Ee.bottom-Ee.top,!ee&&j.text.firstChild&&(de=j.text.firstChild.getBoundingClientRect().right-Ee.left-1)}var ke=j.line.height-oe;if((ke>.005||ke<-.005)&&(St(j.line,oe),Lo(j.line),j.rest))for(var Pe=0;Pe<j.rest.length;Pe++)Lo(j.rest[Pe]);if(de>e.display.sizerWidth){var Ue=Math.ceil(de/Ri(e.display));Ue>e.display.maxLineLength&&(e.display.maxLineLength=Ue,e.display.maxLine=j.line,e.display.maxLineChanged=!0)}}}function Lo(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var O=e.widgets[t],A=O.node.parentNode;A&&(O.height=A.offsetHeight)}}function _a(e,t,O){var A=O&&O.top!=null?Math.max(0,O.top):e.scroller.scrollTop;A=Math.floor(A-Un(e));var j=O&&O.bottom!=null?O.bottom:A+e.wrapper.clientHeight,ee=Ut(t,A),oe=Ut(t,j);if(O&&O.ensure){var de=O.ensure.from.line,ge=O.ensure.to.line;de<ee?(ee=de,oe=Ut(t,tn(at(t,de))+e.wrapper.clientHeight)):Math.min(ge,t.lastLine())>=oe&&(ee=Ut(t,tn(at(t,ge))-e.wrapper.clientHeight),oe=ge)}return{from:ee,to:Math.max(oe,ee+1)}}function Ys(e,t){if(fe(e,"scrollCursorIntoView"))return;var O=e.display,A=O.sizer.getBoundingClientRect(),j=null;if(t.top+A.top<0?j=!0:t.bottom+A.top>(window.innerHeight||document.documentElement.clientHeight)&&(j=!1),j!=null&&!E){var ee=_("div","\u200B",null,`position: absolute;
top: `+(t.top-O.viewOffset-Un(e.display))+`px;
height: `+(t.bottom-t.top+nn(e)+O.barHeight)+`px;
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(ee),ee.scrollIntoView(j),e.display.lineSpace.removeChild(ee)}}function $s(e,t,O,A){A==null&&(A=0);var j;!e.options.lineWrapping&&t==O&&(t=t.ch?Je(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,O=t.sticky=="before"?Je(t.line,t.ch+1,"before"):t);for(var ee=0;ee<5;ee++){var oe=!1,de=Tn(e,t),ge=!O||O==t?de:Tn(e,O);j={left:Math.min(de.left,ge.left),top:Math.min(de.top,ge.top)-A,right:Math.max(de.left,ge.left),bottom:Math.max(de.bottom,ge.bottom)+A};var Ee=Qa(e,j),ke=e.doc.scrollTop,Pe=e.doc.scrollLeft;if(Ee.scrollTop!=null&&(ta(e,Ee.scrollTop),Math.abs(e.doc.scrollTop-ke)>1&&(oe=!0)),Ee.scrollLeft!=null&&(vi(e,Ee.scrollLeft),Math.abs(e.doc.scrollLeft-Pe)>1&&(oe=!0)),!oe)break}return j}function Js(e,t){var O=Qa(e,t);O.scrollTop!=null&&ta(e,O.scrollTop),O.scrollLeft!=null&&vi(e,O.scrollLeft)}function Qa(e,t){var O=e.display,A=Di(e.display);t.top<0&&(t.top=0);var j=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:O.scroller.scrollTop,ee=fi(e),oe={};t.bottom-t.top>ee&&(t.bottom=t.top+ee);var de=e.doc.height+hi(O),ge=t.top<A,Ee=t.bottom>de-A;if(t.top<j)oe.scrollTop=ge?0:t.top;else if(t.bottom>j+ee){var ke=Math.min(t.top,(Ee?de:t.bottom)-ee);ke!=j&&(oe.scrollTop=ke)}var Pe=e.options.fixedGutter?0:O.gutters.offsetWidth,Ue=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:O.scroller.scrollLeft-Pe,Fe=Sn(e)-O.gutters.offsetWidth,ze=t.right-t.left>Fe;return ze&&(t.right=t.left+Fe),t.left<10?oe.scrollLeft=0:t.left<Ue?oe.scrollLeft=Math.max(0,t.left+Pe-(ze?0:10)):t.right>Fe+Ue-3&&(oe.scrollLeft=t.right+(ze?0:10)-Fe),oe}function qa(e,t){if(t==null)return;Aa(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function Pi(e){Aa(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function ea(e,t,O){(t!=null||O!=null)&&Aa(e),t!=null&&(e.curOp.scrollLeft=t),O!=null&&(e.curOp.scrollTop=O)}function Zs(e,t){Aa(e),e.curOp.scrollToPos=t}function Aa(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var O=So(e,t.from),A=So(e,t.to);Po(e,O,A,t.margin)}}function Po(e,t,O,A){var j=Qa(e,{left:Math.min(t.left,O.left),top:Math.min(t.top,O.top)-A,right:Math.max(t.right,O.right),bottom:Math.max(t.bottom,O.bottom)+A});ea(e,j.scrollLeft,j.scrollTop)}function ta(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;S||to(e,{top:t}),Io(e,t,!0),S&&to(e),ia(e,100)}function Io(e,t,O){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!O)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function vi(e,t,O,A){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(O?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!A)return;e.doc.scrollLeft=t,Bo(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function ra(e){var t=e.display,O=t.gutters.offsetWidth,A=Math.round(e.doc.height+hi(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?O:0,docHeight:A,scrollHeight:A+nn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:O}}var yi=function(e,t,O){this.cm=O;var A=this.vert=_("div",[_("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),j=this.horiz=_("div",[_("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");A.tabIndex=j.tabIndex=-1,e(A),e(j),De(A,"scroll",function(){A.clientHeight&&t(A.scrollTop,"vertical")}),De(j,"scroll",function(){j.clientWidth&&t(j.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,C&&g<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};yi.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,O=e.scrollHeight>e.clientHeight+1,A=e.nativeBarWidth;if(O){this.vert.style.display="block",this.vert.style.bottom=t?A+"px":"0";var j=e.viewHeight-(t?A:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+j)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=O?A+"px":"0",this.horiz.style.left=e.barLeft+"px";var ee=e.viewWidth-e.barLeft-(O?A:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+ee)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(A==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:O?A:0,bottom:t?A:0}},yi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},yi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},yi.prototype.zeroWidthHack=function(){var e=o&&!m?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new ie,this.disableVert=new ie},yi.prototype.enableZeroWidthBar=function(e,t,O){e.style.pointerEvents="auto";function A(){var j=e.getBoundingClientRect(),ee=O=="vert"?document.elementFromPoint(j.right-1,(j.top+j.bottom)/2):document.elementFromPoint((j.right+j.left)/2,j.bottom-1);ee!=e?e.style.pointerEvents="none":t.set(1e3,A)}t.set(1e3,A)},yi.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var na=function(){};na.prototype.update=function(){return{bottom:0,right:0}},na.prototype.setScrollLeft=function(){},na.prototype.setScrollTop=function(){},na.prototype.clear=function(){};function Ii(e,t){t||(t=ra(e));var O=e.display.barWidth,A=e.display.barHeight;Mo(e,t);for(var j=0;j<4&&O!=e.display.barWidth||A!=e.display.barHeight;j++)O!=e.display.barWidth&&e.options.lineWrapping&&Ta(e),Mo(e,ra(e)),O=e.display.barWidth,A=e.display.barHeight}function Mo(e,t){var O=e.display,A=O.scrollbars.update(t);O.sizer.style.paddingRight=(O.barWidth=A.right)+"px",O.sizer.style.paddingBottom=(O.barHeight=A.bottom)+"px",O.heightForcer.style.borderBottom=A.bottom+"px solid transparent",A.right&&A.bottom?(O.scrollbarFiller.style.display="block",O.scrollbarFiller.style.height=A.bottom+"px",O.scrollbarFiller.style.width=A.right+"px"):O.scrollbarFiller.style.display="",A.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(O.gutterFiller.style.display="block",O.gutterFiller.style.height=A.bottom+"px",O.gutterFiller.style.width=t.gutterWidth+"px"):O.gutterFiller.style.display=""}var No={native:yi,null:na};function jo(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&d(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new No[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),De(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,O){O=="horizontal"?vi(e,t):ta(e,t)},e),e.display.scrollbars.addClass&&$(e.display.wrapper,e.display.scrollbars.addClass)}var Qs=0;function bi(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:++Qs},ar(e.curOp)}function xi(e){var t=e.curOp;t&&$r(t,function(O){for(var A=0;A<O.ops.length;A++)O.ops[A].cm.curOp=null;el(O)})}function el(e){for(var t=e.ops,O=0;O<t.length;O++)tl(t[O]);for(var A=0;A<t.length;A++)rl(t[A]);for(var j=0;j<t.length;j++)nl(t[j]);for(var ee=0;ee<t.length;ee++)il(t[ee]);for(var oe=0;oe<t.length;oe++)al(t[oe])}function tl(e){var t=e.cm,O=t.display;sl(t),e.updateMaxLine&&Ci(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<O.viewFrom||e.scrollToPos.to.line>=O.viewTo)||O.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Oa(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function rl(e){e.updatedDisplay=e.mustUpdate&&eo(e.cm,e.update)}function nl(e){var t=e.cm,O=t.display;e.updatedDisplay&&Ta(t),e.barMeasure=ra(t),O.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Zi(t,O.maxLine,O.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(O.scroller.clientWidth,O.sizer.offsetLeft+e.adjustWidthTo+nn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,O.sizer.offsetLeft+e.adjustWidthTo-Sn(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=O.input.prepareSelection())}function il(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&vi(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var O=e.focus&&e.focus==J();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,O),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Ii(t,e.barMeasure),e.updatedDisplay&&no(t,e.barMeasure),e.selectionChanged&&Ja(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),O&&Do(e.cm)}function al(e){var t=e.cm,O=t.display,A=t.doc;if(e.updatedDisplay&&Fo(t,e.update),O.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(O.wheelStartX=O.wheelStartY=null),e.scrollTop!=null&&Io(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&vi(t,e.scrollLeft,!0,!0),e.scrollToPos){var j=$s(t,Dt(A,e.scrollToPos.from),Dt(A,e.scrollToPos.to),e.scrollToPos.margin);Ys(t,j)}var ee=e.maybeHiddenMarkers,oe=e.maybeUnhiddenMarkers;if(ee)for(var de=0;de<ee.length;++de)ee[de].lines.length||we(ee[de],"hide");if(oe)for(var ge=0;ge<oe.length;++ge)oe[ge].lines.length&&we(oe[ge],"unhide");O.wrapper.offsetHeight&&(A.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&we(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Zr(e,t){if(e.curOp)return t();bi(e);try{return t()}finally{xi(e)}}function Cr(e,t){return function(){if(e.curOp)return t.apply(e,arguments);bi(e);try{return t.apply(e,arguments)}finally{xi(e)}}}function Br(e){return function(){if(this.curOp)return e.apply(this,arguments);bi(this);try{return e.apply(this,arguments)}finally{xi(this)}}}function Tr(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);bi(t);try{return e.apply(this,arguments)}finally{xi(t)}}}function ia(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,K(ol,e))}function ol(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var O=+new Date+e.options.workTime,A=Hr(e,t.highlightFrontier),j=[];t.iter(A.line,Math.min(t.first+t.size,e.display.viewTo+500),function(ee){if(A.line>=e.display.viewFrom){var oe=ee.styles,de=ee.text.length>e.options.maxHighlightLength?It(t.mode,A.state):null,ge=Sr(e,ee,A,!0);de&&(A.state=de),ee.styles=ge.styles;var Ee=ee.styleClasses,ke=ge.classes;ke?ee.styleClasses=ke:Ee&&(ee.styleClasses=null);for(var Pe=!oe||oe.length!=ee.styles.length||Ee!=ke&&(!Ee||!ke||Ee.bgClass!=ke.bgClass||Ee.textClass!=ke.textClass),Ue=0;!Pe&&Ue<oe.length;++Ue)Pe=oe[Ue]!=ee.styles[Ue];Pe&&j.push(A.line),ee.stateAfter=A.save(),A.nextLine()}else ee.text.length<=e.options.maxHighlightLength&&Nr(e,ee.text,A),ee.stateAfter=A.line%5==0?A.save():null,A.nextLine();if(+new Date>O)return ia(e,e.options.workDelay),!0}),t.highlightFrontier=A.line,t.modeFrontier=Math.max(t.modeFrontier,A.line),j.length&&Zr(e,function(){for(var ee=0;ee<j.length;ee++)Qn(e,j[ee],"text")})}var Oa=function(e,t,O){var A=e.display;this.viewport=t,this.visible=_a(A,e.doc,t),this.editorIsHidden=!A.wrapper.offsetWidth,this.wrapperHeight=A.wrapper.clientHeight,this.wrapperWidth=A.wrapper.clientWidth,this.oldDisplayWidth=Sn(e),this.force=O,this.dims=Xa(e),this.events=[]};Oa.prototype.signal=function(e,t){ye(e,t)&&this.events.push(arguments)},Oa.prototype.finish=function(){for(var e=0;e<this.events.length;e++)we.apply(null,this.events[e])};function sl(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=nn(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=nn(e)+"px",t.scrollbarsClipped=!0)}function ll(e){if(e.hasFocus())return null;var t=J();if(!t||!P(e.display.lineDiv,t))return null;var O={activeElt:t};if(window.getSelection){var A=window.getSelection();A.anchorNode&&A.extend&&P(e.display.lineDiv,A.anchorNode)&&(O.anchorNode=A.anchorNode,O.anchorOffset=A.anchorOffset,O.focusNode=A.focusNode,O.focusOffset=A.focusOffset)}return O}function ul(e){if(!e||!e.activeElt||e.activeElt==J())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&P(document.body,e.anchorNode)&&P(document.body,e.focusNode)){var t=window.getSelection(),O=document.createRange();O.setEnd(e.anchorNode,e.anchorOffset),O.collapse(!1),t.removeAllRanges(),t.addRange(O),t.extend(e.focusNode,e.focusOffset)}}function eo(e,t){var O=e.display,A=e.doc;if(t.editorIsHidden)return qn(e),!1;if(!t.force&&t.visible.from>=O.viewFrom&&t.visible.to<=O.viewTo&&(O.updateLineNumbers==null||O.updateLineNumbers>=O.viewTo)&&O.renderedView==O.view&&Ao(e)==0)return!1;Uo(e)&&(qn(e),t.dims=Xa(e));var j=A.first+A.size,ee=Math.max(t.visible.from-e.options.viewportMargin,A.first),oe=Math.min(j,t.visible.to+e.options.viewportMargin);O.viewFrom<ee&&ee-O.viewFrom<20&&(ee=Math.max(A.first,O.viewFrom)),O.viewTo>oe&&O.viewTo-oe<20&&(oe=Math.min(j,O.viewTo)),cr&&(ee=si(e.doc,ee),oe=Rn(e.doc,oe));var de=ee!=O.viewFrom||oe!=O.viewTo||O.lastWrapHeight!=t.wrapperHeight||O.lastWrapWidth!=t.wrapperWidth;Vs(e,ee,oe),O.viewOffset=tn(at(e.doc,O.viewFrom)),e.display.mover.style.top=O.viewOffset+"px";var ge=Ao(e);if(!de&&ge==0&&!t.force&&O.renderedView==O.view&&(O.updateLineNumbers==null||O.updateLineNumbers>=O.viewTo))return!1;var Ee=ll(e);return ge>4&&(O.lineDiv.style.display="none"),cl(e,O.updateLineNumbers,t.dims),ge>4&&(O.lineDiv.style.display=""),O.renderedView=O.view,ul(Ee),b(O.cursorDiv),b(O.selectionDiv),O.gutters.style.height=O.sizer.style.minHeight=0,de&&(O.lastWrapHeight=t.wrapperHeight,O.lastWrapWidth=t.wrapperWidth,ia(e,400)),O.updateLineNumbers=null,!0}function Fo(e,t){for(var O=t.viewport,A=!0;;A=!1){if(!A||!e.options.lineWrapping||t.oldDisplayWidth==Sn(e)){if(O&&O.top!=null&&(O={top:Math.min(e.doc.height+hi(e.display)-fi(e),O.top)}),t.visible=_a(e.display,e.doc,O),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else A&&(t.visible=_a(e.display,e.doc,O));if(!eo(e,t))break;Ta(e);var j=ra(e);qi(e),Ii(e,j),no(e,j),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function to(e,t){var O=new Oa(e,t);if(eo(e,O)){Ta(e),Fo(e,O);var A=ra(e);qi(e),Ii(e,A),no(e,A),O.finish()}}function cl(e,t,O){var A=e.display,j=e.options.lineNumbers,ee=A.lineDiv,oe=ee.firstChild;function de(ze){var Ze=ze.nextSibling;return s&&o&&e.display.currentWheelTarget==ze?ze.style.display="none":ze.parentNode.removeChild(ze),Ze}for(var ge=A.view,Ee=A.viewFrom,ke=0;ke<ge.length;ke++){var Pe=ge[ke];if(!Pe.hidden)if(!Pe.node||Pe.node.parentNode!=ee){var Ue=Ln(e,Pe,Ee,O);ee.insertBefore(Ue,oe)}else{for(;oe!=Pe.node;)oe=de(oe);var Fe=j&&t!=null&&t<=Ee&&Pe.lineNumber;Pe.changes&&(le(Pe.changes,"gutter")>-1&&(Fe=!1),wn(e,Pe,Ee,O)),Fe&&(b(Pe.lineNumber),Pe.lineNumber.appendChild(document.createTextNode(Xt(e.options,Ee)))),oe=Pe.node.nextSibling}Ee+=Pe.size}for(;oe;)oe=de(oe)}function ro(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function no(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+nn(e)+"px"}function Bo(e){var t=e.display,O=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var A=Ya(t)-t.scroller.scrollLeft+e.doc.scrollLeft,j=t.gutters.offsetWidth,ee=A+"px",oe=0;oe<O.length;oe++)if(!O[oe].hidden){e.options.fixedGutter&&(O[oe].gutter&&(O[oe].gutter.style.left=ee),O[oe].gutterBackground&&(O[oe].gutterBackground.style.left=ee));var de=O[oe].alignable;if(de)for(var ge=0;ge<de.length;ge++)de[ge].style.left=ee}e.options.fixedGutter&&(t.gutters.style.left=A+j+"px")}function Uo(e){if(!e.options.lineNumbers)return!1;var t=e.doc,O=Xt(e.options,t.first+t.size-1),A=e.display;if(O.length!=A.lineNumChars){var j=A.measure.appendChild(_("div",[_("div",O)],"CodeMirror-linenumber CodeMirror-gutter-elt")),ee=j.firstChild.offsetWidth,oe=j.offsetWidth-ee;return A.lineGutter.style.width="",A.lineNumInnerWidth=Math.max(ee,A.lineGutter.offsetWidth-oe)+1,A.lineNumWidth=A.lineNumInnerWidth+oe,A.lineNumChars=A.lineNumInnerWidth?O.length:-1,A.lineGutter.style.width=A.lineNumWidth+"px",ro(e.display),!0}return!1}function io(e,t){for(var O=[],A=!1,j=0;j<e.length;j++){var ee=e[j],oe=null;if(typeof ee!="string"&&(oe=ee.style,ee=ee.className),ee=="CodeMirror-linenumbers")if(t)A=!0;else continue;O.push({className:ee,style:oe})}return t&&!A&&O.push({className:"CodeMirror-linenumbers",style:null}),O}function Wo(e){var t=e.gutters,O=e.gutterSpecs;b(t),e.lineGutter=null;for(var A=0;A<O.length;++A){var j=O[A],ee=j.className,oe=j.style,de=t.appendChild(_("div",null,"CodeMirror-gutter "+ee));oe&&(de.style.cssText=oe),ee=="CodeMirror-linenumbers"&&(e.lineGutter=de,de.style.width=(e.lineNumWidth||1)+"px")}t.style.display=O.length?"":"none",ro(e)}function aa(e){Wo(e.display),Kr(e),Bo(e)}function dl(e,t,O,A){var j=this;this.input=O,j.scrollbarFiller=_("div",null,"CodeMirror-scrollbar-filler"),j.scrollbarFiller.setAttribute("cm-not-content","true"),j.gutterFiller=_("div",null,"CodeMirror-gutter-filler"),j.gutterFiller.setAttribute("cm-not-content","true"),j.lineDiv=B("div",null,"CodeMirror-code"),j.selectionDiv=_("div",null,null,"position: relative; z-index: 1"),j.cursorDiv=_("div",null,"CodeMirror-cursors"),j.measure=_("div",null,"CodeMirror-measure"),j.lineMeasure=_("div",null,"CodeMirror-measure"),j.lineSpace=B("div",[j.measure,j.lineMeasure,j.selectionDiv,j.cursorDiv,j.lineDiv],null,"position: relative; outline: none");var ee=B("div",[j.lineSpace],"CodeMirror-lines");j.mover=_("div",[ee],null,"position: relative"),j.sizer=_("div",[j.mover],"CodeMirror-sizer"),j.sizerWidth=null,j.heightForcer=_("div",null,null,"position: absolute; height: "+ue+"px; width: 1px;"),j.gutters=_("div",null,"CodeMirror-gutters"),j.lineGutter=null,j.scroller=_("div",[j.sizer,j.heightForcer,j.gutters],"CodeMirror-scroll"),j.scroller.setAttribute("tabIndex","-1"),j.wrapper=_("div",[j.scrollbarFiller,j.gutterFiller,j.scroller],"CodeMirror"),C&&g<8&&(j.gutters.style.zIndex=-1,j.scroller.style.paddingRight=0),!s&&!(S&&n)&&(j.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(j.wrapper):e(j.wrapper)),j.viewFrom=j.viewTo=t.first,j.reportedViewFrom=j.reportedViewTo=t.first,j.view=[],j.renderedView=null,j.externalMeasured=null,j.viewOffset=0,j.lastWrapHeight=j.lastWrapWidth=0,j.updateLineNumbers=null,j.nativeBarWidth=j.barHeight=j.barWidth=0,j.scrollbarsClipped=!1,j.lineNumWidth=j.lineNumInnerWidth=j.lineNumChars=null,j.alignWidgets=!1,j.cachedCharWidth=j.cachedTextHeight=j.cachedPaddingH=null,j.maxLine=null,j.maxLineLength=0,j.maxLineChanged=!1,j.wheelDX=j.wheelDY=j.wheelStartX=j.wheelStartY=null,j.shift=!1,j.selForContextMenu=null,j.activeTouch=null,j.gutterSpecs=io(A.gutters,A.lineNumbers),Wo(j),O.init(j)}var ka=0,sn=null;C?sn=-.53:S?sn=15:r?sn=-.7:p&&(sn=-1/3);function Ho(e){var t=e.wheelDeltaX,O=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),O==null&&e.detail&&e.axis==e.VERTICAL_AXIS?O=e.detail:O==null&&(O=e.wheelDelta),{x:t,y:O}}function hl(e){var t=Ho(e);return t.x*=sn,t.y*=sn,t}function Ko(e,t){var O=Ho(t),A=O.x,j=O.y,ee=e.display,oe=ee.scroller,de=oe.scrollWidth>oe.clientWidth,ge=oe.scrollHeight>oe.clientHeight;if(!(A&&de||j&&ge))return;if(j&&o&&s){e:for(var Ee=t.target,ke=ee.view;Ee!=oe;Ee=Ee.parentNode)for(var Pe=0;Pe<ke.length;Pe++)if(ke[Pe].node==Ee){e.display.currentWheelTarget=Ee;break e}}if(A&&!S&&!f&&sn!=null){j&&ge&&ta(e,Math.max(0,oe.scrollTop+j*sn)),vi(e,Math.max(0,oe.scrollLeft+A*sn)),(!j||j&&ge)&&xe(t),ee.wheelStartX=null;return}if(j&&sn!=null){var Ue=j*sn,Fe=e.doc.scrollTop,ze=Fe+ee.wrapper.clientHeight;Ue<0?Fe=Math.max(0,Fe+Ue-50):ze=Math.min(e.doc.height,ze+Ue+50),to(e,{top:Fe,bottom:ze})}ka<20&&(ee.wheelStartX==null?(ee.wheelStartX=oe.scrollLeft,ee.wheelStartY=oe.scrollTop,ee.wheelDX=A,ee.wheelDY=j,setTimeout(function(){if(ee.wheelStartX==null)return;var Ze=oe.scrollLeft-ee.wheelStartX,ot=oe.scrollTop-ee.wheelStartY,ct=ot&&ee.wheelDY&&ot/ee.wheelDY||Ze&&ee.wheelDX&&Ze/ee.wheelDX;if(ee.wheelStartX=ee.wheelStartY=null,!ct)return;sn=(sn*ka+ct)/(ka+1),++ka},200)):(ee.wheelDX+=A,ee.wheelDY+=j))}var ln=function(e,t){this.ranges=e,this.primIndex=t};ln.prototype.primary=function(){return this.ranges[this.primIndex]},ln.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var O=this.ranges[t],A=e.ranges[t];if(!kr(O.anchor,A.anchor)||!kr(O.head,A.head))return!1}return!0},ln.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Jt(wr(this.ranges[t].anchor),wr(this.ranges[t].head));return new ln(e,this.primIndex)},ln.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},ln.prototype.contains=function(e,t){t||(t=e);for(var O=0;O<this.ranges.length;O++){var A=this.ranges[O];if(bt(t,A.from())>=0&&bt(e,A.to())<=0)return O}return-1};var Jt=function(e,t){this.anchor=e,this.head=t};Jt.prototype.from=function(){return Mr(this.anchor,this.head)},Jt.prototype.to=function(){return Wr(this.anchor,this.head)},Jt.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function _n(e,t,O){var A=e&&e.options.selectionsMayTouch,j=t[O];t.sort(function(Ue,Fe){return bt(Ue.from(),Fe.from())}),O=le(t,j);for(var ee=1;ee<t.length;ee++){var oe=t[ee],de=t[ee-1],ge=bt(de.to(),oe.from());if(A&&!oe.empty()?ge>0:ge>=0){var Ee=Mr(de.from(),oe.from()),ke=Wr(de.to(),oe.to()),Pe=de.empty()?oe.from()==oe.head:de.from()==de.head;ee<=O&&--O,t.splice(--ee,2,new Jt(Pe?ke:Ee,Pe?Ee:ke))}}return new ln(t,O)}function ei(e,t){return new ln([new Jt(e,t||e)],0)}function ti(e){return e.text?Je(e.from.line+e.text.length-1,D(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Go(e,t){if(bt(e,t.from)<0)return e;if(bt(e,t.to)<=0)return ti(t);var O=e.line+t.text.length-(t.to.line-t.from.line)-1,A=e.ch;return e.line==t.to.line&&(A+=ti(t).ch-t.to.ch),Je(O,A)}function ao(e,t){for(var O=[],A=0;A<e.sel.ranges.length;A++){var j=e.sel.ranges[A];O.push(new Jt(Go(j.anchor,t),Go(j.head,t)))}return _n(e.cm,O,e.sel.primIndex)}function zo(e,t,O){return e.line==t.line?Je(O.line,e.ch-t.ch+O.ch):Je(O.line+(e.line-t.line),e.ch)}function fl(e,t,O){for(var A=[],j=Je(e.first,0),ee=j,oe=0;oe<t.length;oe++){var de=t[oe],ge=zo(de.from,j,ee),Ee=zo(ti(de),j,ee);if(j=de.to,ee=Ee,O=="around"){var ke=e.sel.ranges[oe],Pe=bt(ke.head,ke.anchor)<0;A[oe]=new Jt(Pe?Ee:ge,Pe?ge:Ee)}else A[oe]=new Jt(ge,ge)}return new ln(A,e.sel.primIndex)}function oo(e){e.doc.mode=Ge(e.options,e.doc.modeOption),oa(e)}function oa(e){e.doc.iter(function(t){t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,ia(e,100),e.state.modeGen++,e.curOp&&Kr(e)}function Vo(e,t){return t.from.ch==0&&t.to.ch==0&&D(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function so(e,t,O,A){function j(mt){return O?O[mt]:null}function ee(mt,dt,vt){Xi(mt,dt,vt,A),$t(mt,"change",mt,t)}function oe(mt,dt){for(var vt=[],Lt=mt;Lt<dt;++Lt)vt.push(new jn(Ee[Lt],j(Lt),A));return vt}var de=t.from,ge=t.to,Ee=t.text,ke=at(e,de.line),Pe=at(e,ge.line),Ue=D(Ee),Fe=j(Ee.length-1),ze=ge.line-de.line;if(t.full)e.insert(0,oe(0,Ee.length)),e.remove(Ee.length,e.size-Ee.length);else if(Vo(e,t)){var Ze=oe(0,Ee.length-1);ee(Pe,Pe.text,Fe),ze&&e.remove(de.line,ze),Ze.length&&e.insert(de.line,Ze)}else if(ke==Pe)if(Ee.length==1)ee(ke,ke.text.slice(0,de.ch)+Ue+ke.text.slice(ge.ch),Fe);else{var ot=oe(1,Ee.length-1);ot.push(new jn(Ue+ke.text.slice(ge.ch),Fe,A)),ee(ke,ke.text.slice(0,de.ch)+Ee[0],j(0)),e.insert(de.line+1,ot)}else if(Ee.length==1)ee(ke,ke.text.slice(0,de.ch)+Ee[0]+Pe.text.slice(ge.ch),j(0)),e.remove(de.line+1,ze);else{ee(ke,ke.text.slice(0,de.ch)+Ee[0],j(0)),ee(Pe,Ue+Pe.text.slice(ge.ch),Fe);var ct=oe(1,Ee.length-1);ze>1&&e.remove(de.line+1,ze-1),e.insert(de.line+1,ct)}$t(e,"change",e,t)}function ri(e,t,O){function A(j,ee,oe){if(j.linked)for(var de=0;de<j.linked.length;++de){var ge=j.linked[de];if(ge.doc==ee)continue;var Ee=oe&&ge.sharedHist;if(O&&!Ee)continue;t(ge.doc,Ee),A(ge.doc,j,Ee)}}A(e,null,!0)}function Xo(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,$a(e),oo(e),Yo(e),e.options.lineWrapping||Ci(e),e.options.mode=t.modeOption,Kr(e)}function Yo(e){(e.doc.direction=="rtl"?$:d)(e.display.lineDiv,"CodeMirror-rtl")}function pl(e){Zr(e,function(){Yo(e),Kr(e)})}function Da(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 lo(e,t){var O={from:wr(t.from),to:ti(t),text:ft(e,t.from,t.to)};return Zo(e,O,t.from.line,t.to.line+1),ri(e,function(A){return Zo(A,O,t.from.line,t.to.line+1)},!0),O}function $o(e){for(;e.length;){var t=D(e);if(t.ranges)e.pop();else break}}function ml(e,t){if(t)return $o(e.done),D(e.done);if(e.done.length&&!D(e.done).ranges)return D(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),D(e.done)}function Jo(e,t,O,A){var j=e.history;j.undone.length=0;var ee=+new Date,oe,de;if((j.lastOp==A||j.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&j.lastModTime>ee-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(oe=ml(j,j.lastOp==A)))de=D(oe.changes),bt(t.from,t.to)==0&&bt(t.from,de.to)==0?de.to=ti(t):oe.changes.push(lo(e,t));else{var ge=D(j.done);for((!ge||!ge.ranges)&&Ra(e.sel,j.done),oe={changes:[lo(e,t)],generation:j.generation},j.done.push(oe);j.done.length>j.undoDepth;)j.done.shift(),j.done[0].ranges||j.done.shift()}j.done.push(O),j.generation=++j.maxGeneration,j.lastModTime=j.lastSelTime=ee,j.lastOp=j.lastSelOp=A,j.lastOrigin=j.lastSelOrigin=t.origin,de||we(e,"historyAdded")}function gl(e,t,O,A){var j=t.charAt(0);return j=="*"||j=="+"&&O.ranges.length==A.ranges.length&&O.somethingSelected()==A.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function vl(e,t,O,A){var j=e.history,ee=A&&A.origin;O==j.lastSelOp||ee&&j.lastSelOrigin==ee&&(j.lastModTime==j.lastSelTime&&j.lastOrigin==ee||gl(e,ee,D(j.done),t))?j.done[j.done.length-1]=t:Ra(t,j.done),j.lastSelTime=+new Date,j.lastSelOrigin=ee,j.lastSelOp=O,A&&A.clearRedo!==!1&&$o(j.undone)}function Ra(e,t){var O=D(t);O&&O.ranges&&O.equals(e)||t.push(e)}function Zo(e,t,O,A){var j=t["spans_"+e.id],ee=0;e.iter(Math.max(e.first,O),Math.min(e.first+e.size,A),function(oe){oe.markedSpans&&((j||(j=t["spans_"+e.id]={}))[ee]=oe.markedSpans),++ee})}function yl(e){if(!e)return null;for(var t,O=0;O<e.length;++O)e[O].marker.explicitlyCleared?t||(t=e.slice(0,O)):t&&t.push(e[O]);return t?t.length?t:null:e}function bl(e,t){var O=t["spans_"+e.id];if(!O)return null;for(var A=[],j=0;j<t.text.length;++j)A.push(yl(O[j]));return A}function Qo(e,t){var O=bl(e,t),A=dn(e,t);if(!O)return A;if(!A)return O;for(var j=0;j<O.length;++j){var ee=O[j],oe=A[j];if(ee&&oe){e:for(var de=0;de<oe.length;++de){for(var ge=oe[de],Ee=0;Ee<ee.length;++Ee)if(ee[Ee].marker==ge.marker)continue e;ee.push(ge)}}else oe&&(O[j]=oe)}return O}function Mi(e,t,O){for(var A=[],j=0;j<e.length;++j){var ee=e[j];if(ee.ranges){A.push(O?ln.prototype.deepCopy.call(ee):ee);continue}var oe=ee.changes,de=[];A.push({changes:de});for(var ge=0;ge<oe.length;++ge){var Ee=oe[ge],ke=void 0;if(de.push({from:Ee.from,to:Ee.to,text:Ee.text}),t)for(var Pe in Ee)(ke=Pe.match(/^spans_(\d+)$/))&&(le(t,Number(ke[1]))>-1&&(D(de)[Pe]=Ee[Pe],delete Ee[Pe]))}}return A}function uo(e,t,O,A){if(A){var j=e.anchor;if(O){var ee=bt(t,j)<0;ee!=bt(O,j)<0?(j=t,t=O):ee!=bt(t,O)<0&&(t=O)}return new Jt(j,t)}else return new Jt(O||t,t)}function La(e,t,O,A,j){j==null&&(j=e.cm&&(e.cm.display.shift||e.extend)),Pr(e,new ln([uo(e.sel.primary(),t,O,j)],0),A)}function qo(e,t,O){for(var A=[],j=e.cm&&(e.cm.display.shift||e.extend),ee=0;ee<e.sel.ranges.length;ee++)A[ee]=uo(e.sel.ranges[ee],t[ee],null,j);var oe=_n(e.cm,A,e.sel.primIndex);Pr(e,oe,O)}function co(e,t,O,A){var j=e.sel.ranges.slice(0);j[t]=O,Pr(e,_n(e.cm,j,e.sel.primIndex),A)}function es(e,t,O,A){Pr(e,ei(t,O),A)}function xl(e,t,O){var A={ranges:t.ranges,update:function(j){this.ranges=[];for(var ee=0;ee<j.length;ee++)this.ranges[ee]=new Jt(Dt(e,j[ee].anchor),Dt(e,j[ee].head))},origin:O&&O.origin};return we(e,"beforeSelectionChange",e,A),e.cm&&we(e.cm,"beforeSelectionChange",e.cm,A),A.ranges!=t.ranges?_n(e.cm,A.ranges,A.ranges.length-1):t}function ts(e,t,O){var A=e.history.done,j=D(A);j&&j.ranges?(A[A.length-1]=t,Pa(e,t,O)):Pr(e,t,O)}function Pr(e,t,O){Pa(e,t,O),vl(e,e.sel,e.cm?e.cm.curOp.id:NaN,O)}function Pa(e,t,O){(ye(e,"beforeSelectionChange")||e.cm&&ye(e.cm,"beforeSelectionChange"))&&(t=xl(e,t,O));var A=O&&O.bias||(bt(t.primary().head,e.sel.primary().head)<0?-1:1);rs(e,is(e,t,A,!0)),!(O&&O.scroll===!1)&&e.cm&&Pi(e.cm)}function rs(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,pe(e.cm)),$t(e,"cursorActivity",e)}function ns(e){rs(e,is(e,e.sel,null,!1))}function is(e,t,O,A){for(var j,ee=0;ee<t.ranges.length;ee++){var oe=t.ranges[ee],de=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[ee],ge=Ia(e,oe.anchor,de&&de.anchor,O,A),Ee=Ia(e,oe.head,de&&de.head,O,A);(j||ge!=oe.anchor||Ee!=oe.head)&&(j||(j=t.ranges.slice(0,ee)),j[ee]=new Jt(ge,Ee))}return j?_n(e.cm,j,t.primIndex):t}function Ni(e,t,O,A,j){var ee=at(e,t.line);if(ee.markedSpans)for(var oe=0;oe<ee.markedSpans.length;++oe){var de=ee.markedSpans[oe],ge=de.marker,Ee="selectLeft"in ge?!ge.selectLeft:ge.inclusiveLeft,ke="selectRight"in ge?!ge.selectRight:ge.inclusiveRight;if((de.from==null||(Ee?de.from<=t.ch:de.from<t.ch))&&(de.to==null||(ke?de.to>=t.ch:de.to>t.ch))){if(j&&(we(ge,"beforeCursorEnter"),ge.explicitlyCleared))if(ee.markedSpans){--oe;continue}else break;if(!ge.atomic)continue;if(O){var Pe=ge.find(A<0?1:-1),Ue=void 0;if((A<0?ke:Ee)&&(Pe=as(e,Pe,-A,Pe&&Pe.line==t.line?ee:null)),Pe&&Pe.line==t.line&&(Ue=bt(Pe,O))&&(A<0?Ue<0:Ue>0))return Ni(e,Pe,t,A,j)}var Fe=ge.find(A<0?-1:1);return(A<0?Ee:ke)&&(Fe=as(e,Fe,A,Fe.line==t.line?ee:null)),Fe?Ni(e,Fe,t,A,j):null}}return t}function Ia(e,t,O,A,j){var ee=A||1,oe=Ni(e,t,O,ee,j)||!j&&Ni(e,t,O,ee,!0)||Ni(e,t,O,-ee,j)||!j&&Ni(e,t,O,-ee,!0);return oe||(e.cantEdit=!0,Je(e.first,0))}function as(e,t,O,A){return O<0&&t.ch==0?t.line>e.first?Dt(e,Je(t.line-1)):null:O>0&&t.ch==(A||at(e,t.line)).text.length?t.line<e.first+e.size-1?Je(t.line+1,0):null:new Je(t.line,t.ch+O)}function os(e){e.setSelection(Je(e.firstLine(),0),Je(e.lastLine()),Ce)}function ss(e,t,O){var A={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return A.canceled=!0}};return O&&(A.update=function(j,ee,oe,de){j&&(A.from=Dt(e,j)),ee&&(A.to=Dt(e,ee)),oe&&(A.text=oe),de!==void 0&&(A.origin=de)}),we(e,"beforeChange",e,A),e.cm&&we(e.cm,"beforeChange",e.cm,A),A.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:A.from,to:A.to,text:A.text,origin:A.origin}}function ji(e,t,O){if(e.cm){if(!e.cm.curOp)return Cr(e.cm,ji)(e,t,O);if(e.cm.state.suppressEdits)return}if((ye(e,"beforeChange")||e.cm&&ye(e.cm,"beforeChange"))&&(t=ss(e,t,!0),!t))return;var A=Mn&&!O&&hn(e,t.from,t.to);if(A)for(var j=A.length-1;j>=0;--j)ls(e,{from:A[j].from,to:A[j].to,text:j?[""]:t.text,origin:t.origin});else ls(e,t)}function ls(e,t){if(t.text.length==1&&t.text[0]==""&&bt(t.from,t.to)==0)return;var O=ao(e,t);Jo(e,t,O,e.cm?e.cm.curOp.id:NaN),sa(e,t,O,dn(e,t));var A=[];ri(e,function(j,ee){!ee&&le(A,j.history)==-1&&(hs(j.history,t),A.push(j.history)),sa(j,t,null,dn(j,t))})}function Ma(e,t,O){var A=e.cm&&e.cm.state.suppressEdits;if(A&&!O)return;for(var j=e.history,ee,oe=e.sel,de=t=="undo"?j.done:j.undone,ge=t=="undo"?j.undone:j.done,Ee=0;Ee<de.length&&!(ee=de[Ee],O?ee.ranges&&!ee.equals(e.sel):!ee.ranges);Ee++);if(Ee==de.length)return;for(j.lastOrigin=j.lastSelOrigin=null;;)if(ee=de.pop(),ee.ranges){if(Ra(ee,ge),O&&!ee.equals(e.sel)){Pr(e,ee,{clearRedo:!1});return}oe=ee}else if(A){de.push(ee);return}else break;var ke=[];Ra(oe,ge),ge.push({changes:ke,generation:j.generation}),j.generation=ee.generation||++j.maxGeneration;for(var Pe=ye(e,"beforeChange")||e.cm&&ye(e.cm,"beforeChange"),Ue=function(Ze){var ot=ee.changes[Ze];if(ot.origin=t,Pe&&!ss(e,ot,!1))return de.length=0,{};ke.push(lo(e,ot));var ct=Ze?ao(e,ot):D(de);sa(e,ot,ct,Qo(e,ot)),!Ze&&e.cm&&e.cm.scrollIntoView({from:ot.from,to:ti(ot)});var mt=[];ri(e,function(dt,vt){!vt&&le(mt,dt.history)==-1&&(hs(dt.history,ot),mt.push(dt.history)),sa(dt,ot,null,Qo(dt,ot))})},Fe=ee.changes.length-1;Fe>=0;--Fe){var ze=Ue(Fe);if(ze)return ze.v}}function us(e,t){if(t==0)return;if(e.first+=t,e.sel=new ln(F(e.sel.ranges,function(j){return new Jt(Je(j.anchor.line+t,j.anchor.ch),Je(j.head.line+t,j.head.ch))}),e.sel.primIndex),e.cm){Kr(e.cm,e.first,e.first-t,t);for(var O=e.cm.display,A=O.viewFrom;A<O.viewTo;A++)Qn(e.cm,A,"gutter")}}function sa(e,t,O,A){if(e.cm&&!e.cm.curOp)return Cr(e.cm,sa)(e,t,O,A);if(t.to.line<e.first){us(e,t.text.length-1-(t.to.line-t.from.line));return}if(t.from.line>e.lastLine())return;if(t.from.line<e.first){var j=t.text.length-1-(e.first-t.from.line);us(e,j),t={from:Je(e.first,0),to:Je(t.to.line+j,t.to.ch),text:[D(t.text)],origin:t.origin}}var ee=e.lastLine();t.to.line>ee&&(t={from:t.from,to:Je(ee,at(e,ee).text.length),text:[t.text[0]],origin:t.origin}),t.removed=ft(e,t.from,t.to),O||(O=ao(e,t)),e.cm?El(e.cm,t,A):so(e,t,A),Pa(e,O,Ce),e.cantEdit&&Ia(e,Je(e.firstLine(),0))&&(e.cantEdit=!1)}function El(e,t,O){var A=e.doc,j=e.display,ee=t.from,oe=t.to,de=!1,ge=ee.line;e.options.lineWrapping||(ge=kt(Rr(at(A,ee.line))),A.iter(ge,oe.line+1,function(Fe){if(Fe==j.maxLine)return de=!0,!0})),A.sel.contains(t.from,t.to)>-1&&pe(e),so(A,t,O,_o(e)),e.options.lineWrapping||(A.iter(ge,ee.line+t.text.length,function(Fe){var ze=ui(Fe);ze>j.maxLineLength&&(j.maxLine=Fe,j.maxLineLength=ze,j.maxLineChanged=!0,de=!1)}),de&&(e.curOp.updateMaxLine=!0)),Kn(A,ee.line),ia(e,400);var Ee=t.text.length-(oe.line-ee.line)-1;t.full?Kr(e):ee.line==oe.line&&t.text.length==1&&!Vo(e.doc,t)?Qn(e,ee.line,"text"):Kr(e,ee.line,oe.line+1,Ee);var ke=ye(e,"changes"),Pe=ye(e,"change");if(Pe||ke){var Ue={from:ee,to:oe,text:t.text,removed:t.removed,origin:t.origin};Pe&&$t(e,"change",e,Ue),ke&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(Ue)}e.display.selForContextMenu=null}function Fi(e,t,O,A,j){var ee;A||(A=O),bt(A,O)<0&&(ee=[A,O],O=ee[0],A=ee[1]),typeof t=="string"&&(t=e.splitLines(t)),ji(e,{from:O,to:A,text:t,origin:j})}function cs(e,t,O,A){O<e.line?e.line+=A:t<e.line&&(e.line=t,e.ch=0)}function ds(e,t,O,A){for(var j=0;j<e.length;++j){var ee=e[j],oe=!0;if(ee.ranges){ee.copied||(ee=e[j]=ee.deepCopy(),ee.copied=!0);for(var de=0;de<ee.ranges.length;de++)cs(ee.ranges[de].anchor,t,O,A),cs(ee.ranges[de].head,t,O,A);continue}for(var ge=0;ge<ee.changes.length;++ge){var Ee=ee.changes[ge];if(O<Ee.from.line)Ee.from=Je(Ee.from.line+A,Ee.from.ch),Ee.to=Je(Ee.to.line+A,Ee.to.ch);else if(t<=Ee.to.line){oe=!1;break}}oe||(e.splice(0,j+1),j=0)}}function hs(e,t){var O=t.from.line,A=t.to.line,j=t.text.length-(A-O)-1;ds(e.done,O,A,j),ds(e.undone,O,A,j)}function la(e,t,O,A){var j=t,ee=t;return typeof t=="number"?ee=at(e,un(e,t)):j=kt(t),j==null?null:(A(ee,j)&&e.cm&&Qn(e.cm,j,O),ee)}function ua(e){this.lines=e,this.parent=null;for(var t=0,O=0;O<e.length;++O)e[O].parent=this,t+=e[O].height;this.height=t}ua.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var O=e,A=e+t;O<A;++O){var j=this.lines[O];this.height-=j.height,Et(j),$t(j,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,O){this.height+=O,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var A=0;A<t.length;++A)t[A].parent=this},iterN:function(e,t,O){for(var A=e+t;e<A;++e)if(O(this.lines[e]))return!0}};function ca(e){this.children=e;for(var t=0,O=0,A=0;A<e.length;++A){var j=e[A];t+=j.chunkSize(),O+=j.height,j.parent=this}this.size=t,this.height=O,this.parent=null}ca.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var O=0;O<this.children.length;++O){var A=this.children[O],j=A.chunkSize();if(e<j){var ee=Math.min(t,j-e),oe=A.height;if(A.removeInner(e,ee),this.height-=oe-A.height,j==ee&&(this.children.splice(O--,1),A.parent=null),(t-=ee)==0)break;e=0}else e-=j}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof ua))){var de=[];this.collapse(de),this.children=[new ua(de)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,O){this.size+=t.length,this.height+=O;for(var A=0;A<this.children.length;++A){var j=this.children[A],ee=j.chunkSize();if(e<=ee){if(j.insertInner(e,t,O),j.lines&&j.lines.length>50){for(var oe=j.lines.length%25+25,de=oe;de<j.lines.length;){var ge=new ua(j.lines.slice(de,de+=25));j.height-=ge.height,this.children.splice(++A,0,ge),ge.parent=this}j.lines=j.lines.slice(0,oe),this.maybeSpill()}break}e-=ee}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),O=new ca(t);if(e.parent){e.size-=O.size,e.height-=O.height;var j=le(e.parent.children,e);e.parent.children.splice(j+1,0,O)}else{var A=new ca(e.children);A.parent=e,e.children=[A,O],e=A}O.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,O){for(var A=0;A<this.children.length;++A){var j=this.children[A],ee=j.chunkSize();if(e<ee){var oe=Math.min(t,ee-e);if(j.iterN(e,oe,O))return!0;if((t-=oe)==0)break;e=0}else e-=ee}}};var da=function(e,t,O){if(O)for(var A in O)O.hasOwnProperty(A)&&(this[A]=O[A]);this.doc=e,this.node=t};da.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,O=this.line,A=kt(O);if(A==null||!t)return;for(var j=0;j<t.length;++j)t[j]==this&&t.splice(j--,1);t.length||(O.widgets=null);var ee=Ft(this);St(O,Math.max(0,O.height-ee)),e&&(Zr(e,function(){fs(e,O,-ee),Qn(e,A,"widget")}),$t(e,"lineWidgetCleared",e,this,A))},da.prototype.changed=function(){var e=this,t=this.height,O=this.doc.cm,A=this.line;this.height=null;var j=Ft(this)-t;if(!j)return;pn(this.doc,A)||St(A,A.height+j),O&&Zr(O,function(){O.curOp.forceUpdate=!0,fs(O,A,j),$t(O,"lineWidgetChanged",O,e,kt(A))})},_e(da);function fs(e,t,O){tn(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&qa(e,O)}function wl(e,t,O,A){var j=new da(e,O,A),ee=e.cm;return ee&&j.noHScroll&&(ee.display.alignWidgets=!0),la(e,t,"widget",function(oe){var de=oe.widgets||(oe.widgets=[]);if(j.insertAt==null?de.push(j):de.splice(Math.min(de.length-1,Math.max(0,j.insertAt)),0,j),j.line=oe,ee&&!pn(e,oe)){var ge=tn(oe)<e.scrollTop;St(oe,oe.height+Ft(j)),ge&&qa(ee,j.height),ee.curOp.forceUpdate=!0}return!0}),ee&&$t(ee,"lineWidgetAdded",ee,j,typeof t=="number"?t:kt(t)),j}var ps=0,ni=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++ps};ni.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&bi(e),ye(this,"clear")){var O=this.find();O&&$t(this,"clear",O.from,O.to)}for(var A=null,j=null,ee=0;ee<this.lines.length;++ee){var oe=this.lines[ee],de=Dr(oe.markedSpans,this);e&&!this.collapsed?Qn(e,kt(oe),"text"):e&&(de.to!=null&&(j=kt(oe)),de.from!=null&&(A=kt(oe))),oe.markedSpans=br(oe.markedSpans,de),de.from==null&&this.collapsed&&!pn(this.doc,oe)&&e&&St(oe,Di(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var ge=0;ge<this.lines.length;++ge){var Ee=Rr(this.lines[ge]),ke=ui(Ee);ke>e.display.maxLineLength&&(e.display.maxLine=Ee,e.display.maxLineLength=ke,e.display.maxLineChanged=!0)}A!=null&&e&&this.collapsed&&Kr(e,A,j+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&ns(e.doc)),e&&$t(e,"markerCleared",e,this,A,j),t&&xi(e),this.parent&&this.parent.clear()},ni.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var O,A,j=0;j<this.lines.length;++j){var ee=this.lines[j],oe=Dr(ee.markedSpans,this);if(oe.from!=null&&(O=Je(t?ee:kt(ee),oe.from),e==-1))return O;if(oe.to!=null&&(A=Je(t?ee:kt(ee),oe.to),e==1))return A}return O&&{from:O,to:A}},ni.prototype.changed=function(){var e=this,t=this.find(-1,!0),O=this,A=this.doc.cm;if(!t||!A)return;Zr(A,function(){var j=t.line,ee=kt(t.line),oe=_i(A,ee);if(oe&&(Ai(oe),A.curOp.selectionChanged=A.curOp.forceUpdate=!0),A.curOp.updateMaxLine=!0,!pn(O.doc,j)&&O.height!=null){var de=O.height;O.height=null;var ge=Ft(O)-de;ge&&St(j,j.height+ge)}$t(A,"markerChanged",A,e)})},ni.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||le(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},ni.prototype.detachLine=function(e){if(this.lines.splice(le(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},_e(ni);function Bi(e,t,O,A,j){if(A&&A.shared)return Sl(e,t,O,A,j);if(e.cm&&!e.cm.curOp)return Cr(e.cm,Bi)(e,t,O,A,j);var ee=new ni(e,j),oe=bt(t,O);if(A&&H(A,ee,!1),oe>0||oe==0&&ee.clearWhenEmpty!==!1)return ee;if(ee.replacedWith&&(ee.collapsed=!0,ee.widgetNode=B("span",[ee.replacedWith],"CodeMirror-widget"),A.handleMouseEvents||ee.widgetNode.setAttribute("cm-ignore-events","true"),A.insertLeft&&(ee.widgetNode.insertLeft=!0)),ee.collapsed){if(Si(e,t.line,t,O,ee)||t.line!=O.line&&Si(e,O.line,t,O,ee))throw new Error("Inserting collapsed marker partially overlapping an existing one");oi()}ee.addToHistory&&Jo(e,{from:t,to:O,origin:"markText"},e.sel,NaN);var de=t.line,ge=e.cm,Ee;if(e.iter(de,O.line+1,function(Pe){ge&&ee.collapsed&&!ge.options.lineWrapping&&Rr(Pe)==ge.display.maxLine&&(Ee=!0),ee.collapsed&&de!=t.line&&St(Pe,0),Zt(Pe,new bn(ee,de==t.line?t.ch:null,de==O.line?O.ch:null)),++de}),ee.collapsed&&e.iter(t.line,O.line+1,function(Pe){pn(e,Pe)&&St(Pe,0)}),ee.clearOnEnter&&De(ee,"beforeCursorEnter",function(){return ee.clear()}),ee.readOnly&&(cn(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),ee.collapsed&&(ee.id=++ps,ee.atomic=!0),ge){if(Ee&&(ge.curOp.updateMaxLine=!0),ee.collapsed)Kr(ge,t.line,O.line+1);else if(ee.className||ee.startStyle||ee.endStyle||ee.css||ee.attributes||ee.title)for(var ke=t.line;ke<=O.line;ke++)Qn(ge,ke,"text");ee.atomic&&ns(ge.doc),$t(ge,"markerAdded",ge,ee)}return ee}var ha=function(e,t){this.markers=e,this.primary=t;for(var O=0;O<e.length;++O)e[O].parent=this};ha.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();$t(this,"clear")},ha.prototype.find=function(e,t){return this.primary.find(e,t)},_e(ha);function Sl(e,t,O,A,j){A=H(A),A.shared=!1;var ee=[Bi(e,t,O,A,j)],oe=ee[0],de=A.widgetNode;return ri(e,function(ge){de&&(A.widgetNode=de.cloneNode(!0)),ee.push(Bi(ge,Dt(ge,t),Dt(ge,O),A,j));for(var Ee=0;Ee<ge.linked.length;++Ee)if(ge.linked[Ee].isParent)return;oe=D(ee)}),new ha(ee,oe)}function ms(e){return e.findMarks(Je(e.first,0),e.clipPos(Je(e.lastLine())),function(t){return t.parent})}function Cl(e,t){for(var O=0;O<t.length;O++){var A=t[O],j=A.find(),ee=e.clipPos(j.from),oe=e.clipPos(j.to);if(bt(ee,oe)){var de=Bi(e,ee,oe,A.primary,A.primary.type);A.markers.push(de),de.parent=A}}}function Tl(e){for(var t=function(A){var j=e[A],ee=[j.primary.doc];ri(j.primary.doc,function(ge){return ee.push(ge)});for(var oe=0;oe<j.markers.length;oe++){var de=j.markers[oe];le(ee,de.doc)==-1&&(de.parent=null,j.markers.splice(oe--,1))}},O=0;O<e.length;O++)t(O)}var _l=0,Gr=function(e,t,O,A,j){if(!(this instanceof Gr))return new Gr(e,t,O,A,j);O==null&&(O=0),ca.call(this,[new ua([new jn("",null)])]),this.first=O,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=O;var ee=Je(O,0);this.sel=ei(ee),this.history=new Da(null),this.id=++_l,this.modeOption=t,this.lineSep=A,this.direction=j=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),so(this,{from:ee,to:ee,text:e}),Pr(this,ei(ee),Ce)};Gr.prototype=Z(ca.prototype,{constructor:Gr,iter:function(e,t,O){O?this.iterN(e-this.first,t-e,O):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var O=0,A=0;A<t.length;++A)O+=t[A].height;this.insertInner(e-this.first,t,O)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=zt(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:Tr(function(e){var t=Je(this.first,0),O=this.first+this.size-1;ji(this,{from:t,to:Je(O,at(this,O).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&ea(this.cm,0,0),Pr(this,ei(t),Ce)}),replaceRange:function(e,t,O,A){t=Dt(this,t),O=O?Dt(this,O):t,Fi(this,e,t,O,A)},getRange:function(e,t,O){var A=ft(this,Dt(this,e),Dt(this,t));return O===!1?A:A.join(O||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Nt(this,e))return at(this,e)},getLineNumber:function(e){return kt(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=at(this,e)),Rr(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return Dt(this,e)},getCursor:function(e){var t=this.sel.primary(),O;return e==null||e=="head"?O=t.head:e=="anchor"?O=t.anchor:e=="end"||e=="to"||e===!1?O=t.to():O=t.from(),O},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Tr(function(e,t,O){es(this,Dt(this,typeof e=="number"?Je(e,t||0):e),null,O)}),setSelection:Tr(function(e,t,O){es(this,Dt(this,e),Dt(this,t||e),O)}),extendSelection:Tr(function(e,t,O){La(this,Dt(this,e),t&&Dt(this,t),O)}),extendSelections:Tr(function(e,t){qo(this,Ve(this,e),t)}),extendSelectionsBy:Tr(function(e,t){var O=F(this.sel.ranges,e);qo(this,Ve(this,O),t)}),setSelections:Tr(function(e,t,O){if(!e.length)return;for(var A=[],j=0;j<e.length;j++)A[j]=new Jt(Dt(this,e[j].anchor),Dt(this,e[j].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),Pr(this,_n(this.cm,A,t),O)}),addSelection:Tr(function(e,t,O){var A=this.sel.ranges.slice(0);A.push(new Jt(Dt(this,e),Dt(this,t||e))),Pr(this,_n(this.cm,A,A.length-1),O)}),getSelection:function(e){for(var t=this.sel.ranges,O,A=0;A<t.length;A++){var j=ft(this,t[A].from(),t[A].to());O=O?O.concat(j):j}return e===!1?O:O.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],O=this.sel.ranges,A=0;A<O.length;A++){var j=ft(this,O[A].from(),O[A].to());e!==!1&&(j=j.join(e||this.lineSeparator())),t[A]=j}return t},replaceSelection:function(e,t,O){for(var A=[],j=0;j<this.sel.ranges.length;j++)A[j]=e;this.replaceSelections(A,t,O||"+input")},replaceSelections:Tr(function(e,t,O){for(var A=[],j=this.sel,ee=0;ee<j.ranges.length;ee++){var oe=j.ranges[ee];A[ee]={from:oe.from(),to:oe.to(),text:this.splitLines(e[ee]),origin:O}}for(var de=t&&t!="end"&&fl(this,A,t),ge=A.length-1;ge>=0;ge--)ji(this,A[ge]);de?ts(this,de):this.cm&&Pi(this.cm)}),undo:Tr(function(){Ma(this,"undo")}),redo:Tr(function(){Ma(this,"redo")}),undoSelection:Tr(function(){Ma(this,"undo",!0)}),redoSelection:Tr(function(){Ma(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,O=0,A=0;A<e.done.length;A++)e.done[A].ranges||++t;for(var j=0;j<e.undone.length;j++)e.undone[j].ranges||++O;return{undo:t,redo:O}},clearHistory:function(){var e=this;this.history=new Da(this.history.maxGeneration),ri(this,function(t){return t.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:Mi(this.history.done),undone:Mi(this.history.undone)}},setHistory:function(e){var t=this.history=new Da(this.history.maxGeneration);t.done=Mi(e.done.slice(0),null,!0),t.undone=Mi(e.undone.slice(0),null,!0)},setGutterMarker:Tr(function(e,t,O){return la(this,e,"gutter",function(A){var j=A.gutterMarkers||(A.gutterMarkers={});return j[t]=O,!O&&re(j)&&(A.gutterMarkers=null),!0})}),clearGutter:Tr(function(e){var t=this;this.iter(function(O){O.gutterMarkers&&O.gutterMarkers[e]&&la(t,O,"gutter",function(){return O.gutterMarkers[e]=null,re(O.gutterMarkers)&&(O.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!Nt(this,e))return null;if(t=e,e=at(this,e),!e)return null}else if(t=kt(e),t==null)return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:Tr(function(e,t,O){return la(this,e,t=="gutter"?"gutter":"class",function(A){var j=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!A[j])A[j]=O;else{if(k(O).test(A[j]))return!1;A[j]+=" "+O}return!0})}),removeLineClass:Tr(function(e,t,O){return la(this,e,t=="gutter"?"gutter":"class",function(A){var j=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",ee=A[j];if(ee)if(O==null)A[j]=null;else{var oe=ee.match(k(O));if(!oe)return!1;var de=oe.index+oe[0].length;A[j]=ee.slice(0,oe.index)+(!oe.index||de==ee.length?"":" ")+ee.slice(de)||null}else return!1;return!0})}),addLineWidget:Tr(function(e,t,O){return wl(this,e,t,O)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,O){return Bi(this,Dt(this,e),Dt(this,t),O,O&&O.type||"range")},setBookmark:function(e,t){var O={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=Dt(this,e),Bi(this,e,e,O,"bookmark")},findMarksAt:function(e){e=Dt(this,e);var t=[],O=at(this,e.line).markedSpans;if(O)for(var A=0;A<O.length;++A){var j=O[A];(j.from==null||j.from<=e.ch)&&(j.to==null||j.to>=e.ch)&&t.push(j.marker.parent||j.marker)}return t},findMarks:function(e,t,O){e=Dt(this,e),t=Dt(this,t);var A=[],j=e.line;return this.iter(e.line,t.line+1,function(ee){var oe=ee.markedSpans;if(oe)for(var de=0;de<oe.length;de++){var ge=oe[de];!(ge.to!=null&&j==e.line&&e.ch>=ge.to||ge.from==null&&j!=e.line||ge.from!=null&&j==t.line&&ge.from>=t.ch)&&(!O||O(ge.marker))&&A.push(ge.marker.parent||ge.marker)}++j}),A},getAllMarks:function(){var e=[];return this.iter(function(t){var O=t.markedSpans;if(O)for(var A=0;A<O.length;++A)O[A].from!=null&&e.push(O[A].marker)}),e},posFromIndex:function(e){var t,O=this.first,A=this.lineSeparator().length;return this.iter(function(j){var ee=j.text.length+A;if(ee>e)return t=e,!0;e-=ee,++O}),Dt(this,Je(O,t))},indexFromPos:function(e){e=Dt(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var O=this.lineSeparator().length;return this.iter(this.first,e.line,function(A){t+=A.text.length+O}),t},copy:function(e){var t=new Gr(zt(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,O=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<O&&(O=e.to);var A=new Gr(zt(this,t,O),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(A.history=this.history),(this.linked||(this.linked=[])).push({doc:A,sharedHist:e.sharedHist}),A.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Cl(A,ms(this)),A},unlinkDoc:function(e){if(e instanceof ir&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var O=this.linked[t];if(O.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),Tl(ms(this));break}if(e.history==this.history){var A=[e.id];ri(e,function(j){return A.push(j.id)},!0),e.history=new Da(null),e.history.done=Mi(this.history.done,A),e.history.undone=Mi(this.history.undone,A)}},iterLinkedDocs:function(e){ri(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):st(e)},lineSeparator:function(){return this.lineSep||`
`},setDirection:Tr(function(e){if(e!="rtl"&&(e="ltr"),e==this.direction)return;this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&pl(this.cm)})}),Gr.prototype.eachLine=Gr.prototype.iter;var gs=0;function Al(e){var t=this;if(vs(t),fe(t,e)||er(t.display,e))return;xe(e),C&&(gs=+new Date);var O=mi(t,e,!0),A=e.dataTransfer.files;if(!O||t.isReadOnly())return;if(A&&A.length&&window.FileReader&&window.File)for(var j=A.length,ee=Array(j),oe=0,de=function(){++oe==j&&Cr(t,function(){O=Dt(t.doc,O);var Fe={from:O,to:O,text:t.doc.splitLines(ee.filter(function(ze){return ze!=null}).join(t.doc.lineSeparator())),origin:"paste"};ji(t.doc,Fe),ts(t.doc,ei(Dt(t.doc,O),Dt(t.doc,ti(Fe))))})()},ge=function(Fe,ze){if(t.options.allowDropFileTypes&&le(t.options.allowDropFileTypes,Fe.type)==-1){de();return}var Ze=new FileReader;Ze.onerror=function(){return de()},Ze.onload=function(){var ot=Ze.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(ot)){de();return}ee[ze]=ot,de()},Ze.readAsText(Fe)},Ee=0;Ee<A.length;Ee++)ge(A[Ee],Ee);else{if(t.state.draggingText&&t.doc.sel.contains(O)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var ke=e.dataTransfer.getData("Text");if(ke){var Pe;if(t.state.draggingText&&!t.state.draggingText.copy&&(Pe=t.listSelections()),Pa(t.doc,ei(O,O)),Pe)for(var Ue=0;Ue<Pe.length;++Ue)Fi(t.doc,"",Pe[Ue].anchor,Pe[Ue].head,"drag");t.replaceSelection(ke,"around","paste"),t.display.input.focus()}}catch(Fe){}}}function Ol(e,t){if(C&&(!e.state.draggingText||+new Date-gs<100)){Oe(t);return}if(fe(e,t)||er(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!p){var O=_("img",null,null,"position: fixed; left: 0; top: 0;");O.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",f&&(O.width=O.height=1,e.display.wrapper.appendChild(O),O._top=O.offsetTop),t.dataTransfer.setDragImage(O,0,0),f&&O.parentNode.removeChild(O)}}function kl(e,t){var O=mi(e,t);if(!O)return;var A=document.createDocumentFragment();ko(e,O,A),e.display.dragCursor||(e.display.dragCursor=_("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),x(e.display.dragCursor,A)}function vs(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function ys(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),O=[],A=0;A<t.length;A++){var j=t[A].CodeMirror;j&&O.push(j)}O.length&&O[0].operation(function(){for(var ee=0;ee<O.length;ee++)e(O[ee])})}var bs=!1;function Dl(){if(bs)return;Rl(),bs=!0}function Rl(){var e;De(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,ys(Ll)},100))}),De(window,"blur",function(){return ys(Li)})}function Ll(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var ii={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"},fa=0;fa<10;fa++)ii[fa+48]=ii[fa+96]=String(fa);for(var Na=65;Na<=90;Na++)ii[Na]=String.fromCharCode(Na);for(var pa=1;pa<=12;pa++)ii[pa+111]=ii[pa+63235]="F"+pa;var Wn={};Wn.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"},Wn.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"},Wn.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"},Wn.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"]},Wn.default=o?Wn.macDefault:Wn.pcDefault;function Pl(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var O,A,j,ee,oe=0;oe<t.length-1;oe++){var de=t[oe];if(/^(cmd|meta|m)$/i.test(de))ee=!0;else if(/^a(lt)?$/i.test(de))O=!0;else if(/^(c|ctrl|control)$/i.test(de))A=!0;else if(/^s(hift)?$/i.test(de))j=!0;else throw new Error("Unrecognized modifier name: "+de)}return O&&(e="Alt-"+e),A&&(e="Ctrl-"+e),ee&&(e="Cmd-"+e),j&&(e="Shift-"+e),e}function Il(e){var t={};for(var O in e)if(e.hasOwnProperty(O)){var A=e[O];if(/^(name|fallthrough|(de|at)tach)$/.test(O))continue;if(A=="..."){delete e[O];continue}for(var j=F(O.split(" "),Pl),ee=0;ee<j.length;ee++){var oe=void 0,de=void 0;ee==j.length-1?(de=j.join(" "),oe=A):(de=j.slice(0,ee+1).join(" "),oe="...");var ge=t[de];if(!ge)t[de]=oe;else if(ge!=oe)throw new Error("Inconsistent bindings for "+de)}delete e[O]}for(var Ee in t)e[Ee]=t[Ee];return e}function Ui(e,t,O,A){t=ja(t);var j=t.call?t.call(e,A):t[e];if(j===!1)return"nothing";if(j==="...")return"multi";if(j!=null&&O(j))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return Ui(e,t.fallthrough,O,A);for(var ee=0;ee<t.fallthrough.length;ee++){var oe=Ui(e,t.fallthrough[ee],O,A);if(oe)return oe}}}function xs(e){var t=typeof e=="string"?e:ii[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function Es(e,t,O){var A=e;return t.altKey&&A!="Alt"&&(e="Alt-"+e),(i?t.metaKey:t.ctrlKey)&&A!="Ctrl"&&(e="Ctrl-"+e),(i?t.ctrlKey:t.metaKey)&&A!="Mod"&&(e="Cmd-"+e),!O&&t.shiftKey&&A!="Shift"&&(e="Shift-"+e),e}function ws(e,t){if(f&&e.keyCode==34&&e.char)return!1;var O=ii[e.keyCode];return O==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(O=e.code),Es(O,e,t))}function ja(e){return typeof e=="string"?Wn[e]:e}function Wi(e,t){for(var O=e.doc.sel.ranges,A=[],j=0;j<O.length;j++){for(var ee=t(O[j]);A.length&&bt(ee.from,D(A).to)<=0;){var oe=A.pop();if(bt(oe.from,ee.from)<0){ee.from=oe.from;break}}A.push(ee)}Zr(e,function(){for(var de=A.length-1;de>=0;de--)Fi(e.doc,"",A[de].from,A[de].to,"+delete");Pi(e)})}function ho(e,t,O){var A=Te(e.text,t+O,O);return A<0||A>e.text.length?null:A}function fo(e,t,O){var A=ho(e,t.ch,O);return A==null?null:new Je(t.line,A,O<0?"after":"before")}function po(e,t,O,A,j){if(e){t.doc.direction=="rtl"&&(j=-j);var ee=Be(O,t.doc.direction);if(ee){var oe=j<0?D(ee):ee[0],de=j<0==(oe.level==1),ge=de?"after":"before",Ee;if(oe.level>0||t.doc.direction=="rtl"){var ke=an(t,O);Ee=j<0?O.text.length-1:0;var Pe=Jr(t,ke,Ee).top;Ee=Re(function(Ue){return Jr(t,ke,Ue).top==Pe},j<0==(oe.level==1)?oe.from:oe.to-1,Ee),ge=="before"&&(Ee=ho(O,Ee,1))}else Ee=j<0?oe.to:oe.from;return new Je(A,Ee,ge)}}return new Je(A,j<0?O.text.length:0,j<0?"before":"after")}function Ml(e,t,O,A){var j=Be(t,e.doc.direction);if(!j)return fo(t,O,A);O.ch>=t.text.length?(O.ch=t.text.length,O.sticky="before"):O.ch<=0&&(O.ch=0,O.sticky="after");var ee=Ne(j,O.ch,O.sticky),oe=j[ee];if(e.doc.direction=="ltr"&&oe.level%2==0&&(A>0?oe.to>O.ch:oe.from<O.ch))return fo(t,O,A);var de=function(ct,mt){return ho(t,ct instanceof Je?ct.ch:ct,mt)},ge,Ee=function(ct){return e.options.lineWrapping?(ge=ge||an(e,t),To(e,t,ge,ct)):{begin:0,end:t.text.length}},ke=Ee(O.sticky=="before"?de(O,-1):O.ch);if(e.doc.direction=="rtl"||oe.level==1){var Pe=oe.level==1==A<0,Ue=de(O,Pe?1:-1);if(Ue!=null&&(Pe?Ue<=oe.to&&Ue<=ke.end:Ue>=oe.from&&Ue>=ke.begin)){var Fe=Pe?"before":"after";return new Je(O.line,Ue,Fe)}}var ze=function(ct,mt,dt){for(var vt=function(nr,_r){return _r?new Je(O.line,de(nr,1),"before"):new Je(O.line,nr,"after")};ct>=0&&ct<j.length;ct+=mt){var Lt=j[ct],Tt=mt>0==(Lt.level!=1),Kt=Tt?dt.begin:de(dt.end,-1);if(Lt.from<=Kt&&Kt<Lt.to)return vt(Kt,Tt);if(Kt=Tt?Lt.from:de(Lt.to,-1),dt.begin<=Kt&&Kt<dt.end)return vt(Kt,Tt)}},Ze=ze(ee+A,A,ke);if(Ze)return Ze;var ot=A>0?ke.end:de(ke.begin,-1);return ot!=null&&!(A>0&&ot==t.text.length)&&(Ze=ze(A>0?0:j.length-1,A,Ee(ot)),Ze)?Ze:null}var ma={selectAll:os,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Ce)},killLine:function(e){return Wi(e,function(t){if(t.empty()){var O=at(e.doc,t.head.line).text.length;return t.head.ch==O&&t.head.line<e.lastLine()?{from:t.head,to:Je(t.head.line+1,0)}:{from:t.head,to:Je(t.head.line,O)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Wi(e,function(t){return{from:Je(t.from().line,0),to:Dt(e.doc,Je(t.to().line+1,0))}})},delLineLeft:function(e){return Wi(e,function(t){return{from:Je(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return Wi(e,function(t){var O=e.charCoords(t.head,"div").top+5,A=e.coordsChar({left:0,top:O},"div");return{from:A,to:t.from()}})},delWrappedLineRight:function(e){return Wi(e,function(t){var O=e.charCoords(t.head,"div").top+5,A=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:O},"div");return{from:t.from(),to:A}})},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(Je(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(Je(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return Ss(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return Cs(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Nl(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var O=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:O},"div")},ce)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var O=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:O},"div")},ce)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var O=e.cursorCoords(t.head,"div").top+5,A=e.coordsChar({left:0,top:O},"div");return A.ch<e.getLine(A.line).search(/\S/)?Cs(e,t.head):A},ce)},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 t=[],O=e.listSelections(),A=e.options.tabSize,j=0;j<O.length;j++){var ee=O[j].from(),oe=G(e.getLine(ee.line),ee.ch,A);t.push(Q(A-oe%A))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Zr(e,function(){for(var t=e.listSelections(),O=[],A=0;A<t.length;A++){if(!t[A].empty())continue;var j=t[A].head,ee=at(e.doc,j.line).text;if(ee){if(j.ch==ee.length&&(j=new Je(j.line,j.ch-1)),j.ch>0)j=new Je(j.line,j.ch+1),e.replaceRange(ee.charAt(j.ch-1)+ee.charAt(j.ch-2),Je(j.line,j.ch-2),j,"+transpose");else if(j.line>e.doc.first){var oe=at(e.doc,j.line-1).text;oe&&(j=new Je(j.line,1),e.replaceRange(ee.charAt(0)+e.doc.lineSeparator()+oe.charAt(oe.length-1),Je(j.line-1,oe.length-1),j,"+transpose"))}}O.push(new Jt(j,j))}e.setSelections(O)})},newlineAndIndent:function(e){return Zr(e,function(){for(var t=e.listSelections(),O=t.length-1;O>=0;O--)e.replaceRange(e.doc.lineSeparator(),t[O].anchor,t[O].head,"+input");t=e.listSelections();for(var A=0;A<t.length;A++)e.indentLine(t[A].from().line,null,!0);Pi(e)})},openLine:function(e){return e.replaceSelection(`
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Ss(e,t){var O=at(e.doc,t),A=Rr(O);return A!=O&&(t=kt(A)),po(!0,e,A,t,1)}function Nl(e,t){var O=at(e.doc,t),A=Vn(O);return A!=O&&(t=kt(A)),po(!0,e,O,t,-1)}function Cs(e,t){var O=Ss(e,t.line),A=at(e.doc,O.line),j=Be(A,e.doc.direction);if(!j||j[0].level==0){var ee=Math.max(O.ch,A.text.search(/\S/)),oe=t.line==O.line&&t.ch<=ee&&t.ch;return Je(O.line,oe?0:ee,O.sticky)}return O}function Fa(e,t,O){if(typeof t=="string"&&(t=ma[t],!t))return!1;e.display.input.ensurePolled();var A=e.display.shift,j=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),O&&(e.display.shift=!1),j=t(e)!=be}finally{e.display.shift=A,e.state.suppressEdits=!1}return j}function jl(e,t,O){for(var A=0;A<e.state.keyMaps.length;A++){var j=Ui(t,e.state.keyMaps[A],O,e);if(j)return j}return e.options.extraKeys&&Ui(t,e.options.extraKeys,O,e)||Ui(t,e.options.keyMap,O,e)}var Fl=new ie;function ga(e,t,O,A){var j=e.state.keySeq;if(j){if(xs(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Fl.set(50,function(){e.state.keySeq==j&&(e.state.keySeq=null,e.display.input.reset())}),Ts(e,j+" "+t,O,A))return!0}return Ts(e,t,O,A)}function Ts(e,t,O,A){var j=jl(e,t,A);return j=="multi"&&(e.state.keySeq=t),j=="handled"&&$t(e,"keyHandled",e,t,O),(j=="handled"||j=="multi")&&(xe(O),Ja(e)),!!j}function _s(e,t){var O=ws(t,!0);return O?t.shiftKey&&!e.state.keySeq?ga(e,"Shift-"+O,t,function(A){return Fa(e,A,!0)})||ga(e,O,t,function(A){if(typeof A=="string"?/^go[A-Z]/.test(A):A.motion)return Fa(e,A)}):ga(e,O,t,function(A){return Fa(e,A)}):!1}function Bl(e,t,O){return ga(e,"'"+O+"'",t,function(A){return Fa(e,A,!0)})}var mo=null;function As(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=J(),fe(t,e))return;C&&g<11&&e.keyCode==27&&(e.returnValue=!1);var O=e.keyCode;t.display.shift=O==16||e.shiftKey;var A=_s(t,e);f&&(mo=A?O:null,!A&&O==88&&!Pt&&(o?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),S&&!o&&!A&&O==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),O==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Ul(t)}function Ul(e){var t=e.display.lineDiv;$(t,"CodeMirror-crosshair");function O(A){(A.keyCode==18||!A.altKey)&&(d(t,"CodeMirror-crosshair"),$e(document,"keyup",O),$e(document,"mouseover",O))}De(document,"keyup",O),De(document,"mouseover",O)}function Os(e){e.keyCode==16&&(this.doc.sel.shift=!1),fe(this,e)}function ks(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(er(t.display,e)||fe(t,e)||e.ctrlKey&&!e.altKey||o&&e.metaKey)return;var O=e.keyCode,A=e.charCode;if(f&&O==mo){mo=null,xe(e);return}if(f&&(!e.which||e.which<10)&&_s(t,e))return;var j=String.fromCharCode(A==null?O:A);if(j=="\b")return;if(Bl(t,e,j))return;t.display.input.onKeyPress(e)}var Wl=400,go=function(e,t,O){this.time=e,this.pos=t,this.button=O};go.prototype.compare=function(e,t,O){return this.time+Wl>e&&bt(t,this.pos)==0&&O==this.button};var va,ya;function Hl(e,t){var O=+new Date;return ya&&ya.compare(O,e,t)?(va=ya=null,"triple"):va&&va.compare(O,e,t)?(ya=new go(O,e,t),va=null,"double"):(va=new go(O,e,t),ya=null,"single")}function Ds(e){var t=this,O=t.display;if(fe(t,e)||O.activeTouch&&O.input.supportsTouch())return;if(O.input.ensurePolled(),O.shift=e.shiftKey,er(O,e)){s||(O.scroller.draggable=!1,setTimeout(function(){return O.scroller.draggable=!0},100));return}if(vo(t,e))return;var A=mi(t,e),j=Me(e),ee=A?Hl(A,j):"single";if(window.focus(),j==1&&t.state.selectingText&&t.state.selectingText(e),A&&Kl(t,j,A,ee,e))return;j==1?A?zl(t,A,ee,e):Le(e)==O.scroller&&xe(e):j==2?(A&&La(t.doc,A),setTimeout(function(){return O.input.focus()},20)):j==3&&(R?t.display.input.onContextMenu(e):Ro(t))}function Kl(e,t,O,A,j){var ee="Click";return A=="double"?ee="Double"+ee:A=="triple"&&(ee="Triple"+ee),ee=(t==1?"Left":t==2?"Middle":"Right")+ee,ga(e,Es(ee,j),j,function(oe){if(typeof oe=="string"&&(oe=ma[oe]),!oe)return!1;var de=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),de=oe(e,O)!=be}finally{e.state.suppressEdits=!1}return de})}function Gl(e,t,O){var A=e.getOption("configureMouse"),j=A?A(e,t,O):{};if(j.unit==null){var ee=l?O.shiftKey&&O.metaKey:O.altKey;j.unit=ee?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(j.extend==null||e.doc.extend)&&(j.extend=e.doc.extend||O.shiftKey),j.addNew==null&&(j.addNew=o?O.metaKey:O.ctrlKey),j.moveOnDrag==null&&(j.moveOnDrag=!(o?O.altKey:O.ctrlKey)),j}function zl(e,t,O,A){C?setTimeout(K(Do,e),0):e.curOp.focus=J();var j=Gl(e,O,A),ee=e.doc.sel,oe;e.options.dragDrop&&Ke&&!e.isReadOnly()&&O=="single"&&(oe=ee.contains(t))>-1&&(bt((oe=ee.ranges[oe]).from(),t)<0||t.xRel>0)&&(bt(oe.to(),t)>0||t.xRel<0)?Vl(e,A,t,j):Xl(e,A,t,j)}function Vl(e,t,O,A){var j=e.display,ee=!1,oe=Cr(e,function(Ee){s&&(j.scroller.draggable=!1),e.state.draggingText=!1,$e(j.wrapper.ownerDocument,"mouseup",oe),$e(j.wrapper.ownerDocument,"mousemove",de),$e(j.scroller,"dragstart",ge),$e(j.scroller,"drop",oe),ee||(xe(Ee),A.addNew||La(e.doc,O,null,null,A.extend),s&&!p||C&&g==9?setTimeout(function(){j.wrapper.ownerDocument.body.focus({preventScroll:!0}),j.input.focus()},20):j.input.focus())}),de=function(Ee){ee=ee||Math.abs(t.clientX-Ee.clientX)+Math.abs(t.clientY-Ee.clientY)>=10},ge=function(){return ee=!0};s&&(j.scroller.draggable=!0),e.state.draggingText=oe,oe.copy=!A.moveOnDrag,j.scroller.dragDrop&&j.scroller.dragDrop(),De(j.wrapper.ownerDocument,"mouseup",oe),De(j.wrapper.ownerDocument,"mousemove",de),De(j.scroller,"dragstart",ge),De(j.scroller,"drop",oe),Ro(e),setTimeout(function(){return j.input.focus()},20)}function Rs(e,t,O){if(O=="char")return new Jt(t,t);if(O=="word")return e.findWordAt(t);if(O=="line")return new Jt(Je(t.line,0),Dt(e.doc,Je(t.line+1,0)));var A=O(e,t);return new Jt(A.from,A.to)}function Xl(e,t,O,A){var j=e.display,ee=e.doc;xe(t);var oe,de,ge=ee.sel,Ee=ge.ranges;if(A.addNew&&!A.extend?(de=ee.sel.contains(O),de>-1?oe=Ee[de]:oe=new Jt(O,O)):(oe=ee.sel.primary(),de=ee.sel.primIndex),A.unit=="rectangle")A.addNew||(oe=new Jt(O,O)),O=mi(e,t,!0,!0),de=-1;else{var ke=Rs(e,O,A.unit);A.extend?oe=uo(oe,ke.anchor,ke.head,A.extend):oe=ke}A.addNew?de==-1?(de=Ee.length,Pr(ee,_n(e,Ee.concat([oe]),de),{scroll:!1,origin:"*mouse"})):Ee.length>1&&Ee[de].empty()&&A.unit=="char"&&!A.extend?(Pr(ee,_n(e,Ee.slice(0,de).concat(Ee.slice(de+1)),0),{scroll:!1,origin:"*mouse"}),ge=ee.sel):co(ee,de,oe,se):(de=0,Pr(ee,new ln([oe],0),se),ge=ee.sel);var Pe=O;function Ue(dt){if(bt(Pe,dt)==0)return;if(Pe=dt,A.unit=="rectangle"){for(var vt=[],Lt=e.options.tabSize,Tt=G(at(ee,O.line).text,O.ch,Lt),Kt=G(at(ee,dt.line).text,dt.ch,Lt),nr=Math.min(Tt,Kt),_r=Math.max(Tt,Kt),or=Math.min(O.line,dt.line),Qr=Math.min(e.lastLine(),Math.max(O.line,dt.line));or<=Qr;or++){var zr=at(ee,or).text,mr=he(zr,nr,Lt);nr==_r?vt.push(new Jt(Je(or,mr),Je(or,mr))):zr.length>mr&&vt.push(new Jt(Je(or,mr),Je(or,he(zr,_r,Lt))))}vt.length||vt.push(new Jt(O,O)),Pr(ee,_n(e,ge.ranges.slice(0,de).concat(vt),de),{origin:"*mouse",scroll:!1}),e.scrollIntoView(dt)}else{var Vr=oe,Or=Rs(e,dt,A.unit),Er=Vr.anchor,gr;bt(Or.anchor,Er)>0?(gr=Or.head,Er=Mr(Vr.from(),Or.anchor)):(gr=Or.anchor,Er=Wr(Vr.to(),Or.head));var sr=ge.ranges.slice(0);sr[de]=Yl(e,new Jt(Dt(ee,Er),gr)),Pr(ee,_n(e,sr,de),se)}}var Fe=j.wrapper.getBoundingClientRect(),ze=0;function Ze(dt){var vt=++ze,Lt=mi(e,dt,!0,A.unit=="rectangle");if(!Lt)return;if(bt(Lt,Pe)!=0){e.curOp.focus=J(),Ue(Lt);var Tt=_a(j,ee);(Lt.line>=Tt.to||Lt.line<Tt.from)&&setTimeout(Cr(e,function(){ze==vt&&Ze(dt)}),150)}else{var Kt=dt.clientY<Fe.top?-20:dt.clientY>Fe.bottom?20:0;Kt&&setTimeout(Cr(e,function(){if(ze!=vt)return;j.scroller.scrollTop+=Kt,Ze(dt)}),50)}}function ot(dt){e.state.selectingText=!1,ze=Infinity,dt&&(xe(dt),j.input.focus()),$e(j.wrapper.ownerDocument,"mousemove",ct),$e(j.wrapper.ownerDocument,"mouseup",mt),ee.history.lastSelOrigin=null}var ct=Cr(e,function(dt){dt.buttons===0||!Me(dt)?ot(dt):Ze(dt)}),mt=Cr(e,ot);e.state.selectingText=mt,De(j.wrapper.ownerDocument,"mousemove",ct),De(j.wrapper.ownerDocument,"mouseup",mt)}function Yl(e,t){var O=t.anchor,A=t.head,j=at(e.doc,O.line);if(bt(O,A)==0&&O.sticky==A.sticky)return t;var ee=Be(j);if(!ee)return t;var oe=Ne(ee,O.ch,O.sticky),de=ee[oe];if(de.from!=O.ch&&de.to!=O.ch)return t;var ge=oe+(de.from==O.ch==(de.level!=1)?0:1);if(ge==0||ge==ee.length)return t;var Ee;if(A.line!=O.line)Ee=(A.line-O.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var ke=Ne(ee,A.ch,A.sticky),Pe=ke-oe||(A.ch-O.ch)*(de.level==1?-1:1);ke==ge-1||ke==ge?Ee=Pe<0:Ee=Pe>0}var Ue=ee[ge+(Ee?-1:0)],Fe=Ee==(Ue.level==1),ze=Fe?Ue.from:Ue.to,Ze=Fe?"after":"before";return O.ch==ze&&O.sticky==Ze?t:new Jt(new Je(O.line,ze,Ze),A)}function Ls(e,t,O,A){var j,ee;if(t.touches)j=t.touches[0].clientX,ee=t.touches[0].clientY;else try{j=t.clientX,ee=t.clientY}catch(Ue){return!1}if(j>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;A&&xe(t);var oe=e.display,de=oe.lineDiv.getBoundingClientRect();if(ee>de.bottom||!ye(e,O))return Ae(t);ee-=de.top-oe.viewOffset;for(var ge=0;ge<e.display.gutterSpecs.length;++ge){var Ee=oe.gutters.childNodes[ge];if(Ee&&Ee.getBoundingClientRect().right>=j){var ke=Ut(e.doc,ee),Pe=e.display.gutterSpecs[ge];return we(e,O,e,ke,Pe.className,t),Ae(t)}}}function vo(e,t){return Ls(e,t,"gutterClick",!0)}function Ps(e,t){if(er(e.display,t)||$l(e,t))return;if(fe(e,t,"contextmenu"))return;R||e.display.input.onContextMenu(t)}function $l(e,t){return ye(e,"gutterContextMenu")?Ls(e,t,"gutterContextMenu",!1):!1}function Is(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Zn(e)}var Hi={toString:function(){return"CodeMirror.Init"}},Ms={},Ba={};function Jl(e){var t=e.optionHandlers;function O(A,j,ee,oe){e.defaults[A]=j,ee&&(t[A]=oe?function(de,ge,Ee){Ee!=Hi&&ee(de,ge,Ee)}:ee)}e.defineOption=O,e.Init=Hi,O("value","",function(A,j){return A.setValue(j)},!0),O("mode",null,function(A,j){A.doc.modeOption=j,oo(A)},!0),O("indentUnit",2,oo,!0),O("indentWithTabs",!1),O("smartIndent",!0),O("tabSize",4,function(A){oa(A),Zn(A),Kr(A)},!0),O("lineSeparator",null,function(A,j){if(A.doc.lineSep=j,!j)return;var ee=[],oe=A.doc.first;A.doc.iter(function(ge){for(var Ee=0;;){var ke=ge.text.indexOf(j,Ee);if(ke==-1)break;Ee=ke+j.length,ee.push(Je(oe,ke))}oe++});for(var de=ee.length-1;de>=0;de--)Fi(A.doc,j,ee[de],Je(ee[de].line,ee[de].ch+j.length))}),O("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(A,j,ee){A.state.specialChars=new RegExp(j.source+(j.test(" ")?"":"| "),"g"),ee!=Hi&&A.refresh()}),O("specialCharPlaceholder",qe,function(A){return A.refresh()},!0),O("electricChars",!0),O("inputStyle",n?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),O("spellcheck",!1,function(A,j){return A.getInputField().spellcheck=j},!0),O("autocorrect",!1,function(A,j){return A.getInputField().autocorrect=j},!0),O("autocapitalize",!1,function(A,j){return A.getInputField().autocapitalize=j},!0),O("rtlMoveVisually",!w),O("wholeLineUpdateBefore",!0),O("theme","default",function(A){Is(A),aa(A)},!0),O("keyMap","default",function(A,j,ee){var oe=ja(j),de=ee!=Hi&&ja(ee);de&&de.detach&&de.detach(A,oe),oe.attach&&oe.attach(A,de||null)}),O("extraKeys",null),O("configureMouse",null),O("lineWrapping",!1,Ql,!0),O("gutters",[],function(A,j){A.display.gutterSpecs=io(j,A.options.lineNumbers),aa(A)},!0),O("fixedGutter",!0,function(A,j){A.display.gutters.style.left=j?Ya(A.display)+"px":"0",A.refresh()},!0),O("coverGutterNextToScrollbar",!1,function(A){return Ii(A)},!0),O("scrollbarStyle","native",function(A){jo(A),Ii(A),A.display.scrollbars.setScrollTop(A.doc.scrollTop),A.display.scrollbars.setScrollLeft(A.doc.scrollLeft)},!0),O("lineNumbers",!1,function(A,j){A.display.gutterSpecs=io(A.options.gutters,j),aa(A)},!0),O("firstLineNumber",1,aa,!0),O("lineNumberFormatter",function(A){return A},aa,!0),O("showCursorWhenSelecting",!1,qi,!0),O("resetSelectionOnContextMenu",!0),O("lineWiseCopyCut",!0),O("pasteLinesPerSelection",!0),O("selectionsMayTouch",!1),O("readOnly",!1,function(A,j){j=="nocursor"&&(Li(A),A.display.input.blur()),A.display.input.readOnlyChanged(j)}),O("screenReaderLabel",null,function(A,j){j=j===""?null:j,A.display.input.screenReaderLabelChanged(j)}),O("disableInput",!1,function(A,j){j||A.display.input.reset()},!0),O("dragDrop",!0,Zl),O("allowDropFileTypes",null),O("cursorBlinkRate",530),O("cursorScrollMargin",0),O("cursorHeight",1,qi,!0),O("singleCursorHeightPerLine",!0,qi,!0),O("workTime",100),O("workDelay",100),O("flattenSpans",!0,oa,!0),O("addModeClass",!1,oa,!0),O("pollInterval",100),O("undoDepth",200,function(A,j){return A.doc.history.undoDepth=j}),O("historyEventDelay",1250),O("viewportMargin",10,function(A){return A.refresh()},!0),O("maxHighlightLength",1e4,oa,!0),O("moveInputWithCursor",!0,function(A,j){j||A.display.input.resetPosition()}),O("tabindex",null,function(A,j){return A.display.input.getField().tabIndex=j||""}),O("autofocus",null),O("direction","ltr",function(A,j){return A.doc.setDirection(j)},!0),O("phrases",null)}function Zl(e,t,O){var A=O&&O!=Hi;if(!t!=!A){var j=e.display.dragFunctions,ee=t?De:$e;ee(e.display.scroller,"dragstart",j.start),ee(e.display.scroller,"dragenter",j.enter),ee(e.display.scroller,"dragover",j.over),ee(e.display.scroller,"dragleave",j.leave),ee(e.display.scroller,"drop",j.drop)}}function Ql(e){e.options.lineWrapping?($(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(d(e.display.wrapper,"CodeMirror-wrap"),Ci(e)),$a(e),Kr(e),Zn(e),setTimeout(function(){return Ii(e)},100)}function ir(e,t){var O=this;if(!(this instanceof ir))return new ir(e,t);this.options=t=t?H(t):{},H(Ms,t,!1);var A=t.value;typeof A=="string"?A=new Gr(A,t.mode,null,t.lineSeparator,t.direction):t.mode&&(A.modeOption=t.mode),this.doc=A;var j=new ir.inputStyles[t.inputStyle](this),ee=this.display=new dl(e,A,j,t);ee.wrapper.CodeMirror=this,Is(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),jo(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 ie,keySeq:null,specialChars:null},t.autofocus&&!n&&ee.input.focus(),C&&g<11&&setTimeout(function(){return O.display.input.reset(!0)},20),ql(this),Dl(),bi(this),this.curOp.forceUpdate=!0,Xo(this,A),t.autofocus&&!n||this.hasFocus()?setTimeout(function(){O.hasFocus()&&!O.state.focused&&Za(O)},20):Li(this);for(var oe in Ba)Ba.hasOwnProperty(oe)&&Ba[oe](this,t[oe],Hi);Uo(this),t.finishInit&&t.finishInit(this);for(var de=0;de<yo.length;++de)yo[de](this);xi(this),s&&t.lineWrapping&&getComputedStyle(ee.lineDiv).textRendering=="optimizelegibility"&&(ee.lineDiv.style.textRendering="auto")}ir.defaults=Ms,ir.optionHandlers=Ba;function ql(e){var t=e.display;De(t.scroller,"mousedown",Cr(e,Ds)),C&&g<11?De(t.scroller,"dblclick",Cr(e,function(ge){if(fe(e,ge))return;var Ee=mi(e,ge);if(!Ee||vo(e,ge)||er(e.display,ge))return;xe(ge);var ke=e.findWordAt(Ee);La(e.doc,ke.anchor,ke.head)})):De(t.scroller,"dblclick",function(ge){return fe(e,ge)||xe(ge)}),De(t.scroller,"contextmenu",function(ge){return Ps(e,ge)}),De(t.input.getField(),"contextmenu",function(ge){t.scroller.contains(ge.target)||Ps(e,ge)});var O,A={end:0};function j(){t.activeTouch&&(O=setTimeout(function(){return t.activeTouch=null},1e3),A=t.activeTouch,A.end=+new Date)}function ee(ge){if(ge.touches.length!=1)return!1;var Ee=ge.touches[0];return Ee.radiusX<=1&&Ee.radiusY<=1}function oe(ge,Ee){if(Ee.left==null)return!0;var ke=Ee.left-ge.left,Pe=Ee.top-ge.top;return ke*ke+Pe*Pe>20*20}De(t.scroller,"touchstart",function(ge){if(!fe(e,ge)&&!ee(ge)&&!vo(e,ge)){t.input.ensurePolled(),clearTimeout(O);var Ee=+new Date;t.activeTouch={start:Ee,moved:!1,prev:Ee-A.end<=300?A:null},ge.touches.length==1&&(t.activeTouch.left=ge.touches[0].pageX,t.activeTouch.top=ge.touches[0].pageY)}}),De(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),De(t.scroller,"touchend",function(ge){var Ee=t.activeTouch;if(Ee&&!er(t,ge)&&Ee.left!=null&&!Ee.moved&&new Date-Ee.start<300){var ke=e.coordsChar(t.activeTouch,"page"),Pe;!Ee.prev||oe(Ee,Ee.prev)?Pe=new Jt(ke,ke):!Ee.prev.prev||oe(Ee,Ee.prev.prev)?Pe=e.findWordAt(ke):Pe=new Jt(Je(ke.line,0),Dt(e.doc,Je(ke.line+1,0))),e.setSelection(Pe.anchor,Pe.head),e.focus(),xe(ge)}j()}),De(t.scroller,"touchcancel",j),De(t.scroller,"scroll",function(){t.scroller.clientHeight&&(ta(e,t.scroller.scrollTop),vi(e,t.scroller.scrollLeft,!0),we(e,"scroll",e))}),De(t.scroller,"mousewheel",function(ge){return Ko(e,ge)}),De(t.scroller,"DOMMouseScroll",function(ge){return Ko(e,ge)}),De(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(ge){fe(e,ge)||Oe(ge)},over:function(ge){fe(e,ge)||(kl(e,ge),Oe(ge))},start:function(ge){return Ol(e,ge)},drop:Cr(e,Al),leave:function(ge){fe(e,ge)||vs(e)}};var de=t.input.getField();De(de,"keyup",function(ge){return Os.call(e,ge)}),De(de,"keydown",Cr(e,As)),De(de,"keypress",Cr(e,ks)),De(de,"focus",function(ge){return Za(e,ge)}),De(de,"blur",function(ge){return Li(e,ge)})}var yo=[];ir.defineInitHook=function(e){return yo.push(e)};function ba(e,t,O,A){var j=e.doc,ee;O==null&&(O="add"),O=="smart"&&(j.mode.indent?ee=Hr(e,t).state:O="prev");var oe=e.options.tabSize,de=at(j,t),ge=G(de.text,null,oe);de.stateAfter&&(de.stateAfter=null);var Ee=de.text.match(/^\s*/)[0],ke;if(!A&&!/\S/.test(de.text))ke=0,O="not";else if(O=="smart"&&(ke=j.mode.indent(ee,de.text.slice(Ee.length),de.text),ke==be||ke>150)){if(!A)return;O="prev"}O=="prev"?t>j.first?ke=G(at(j,t-1).text,null,oe):ke=0:O=="add"?ke=ge+e.options.indentUnit:O=="subtract"?ke=ge-e.options.indentUnit:typeof O=="number"&&(ke=ge+O),ke=Math.max(0,ke);var Pe="",Ue=0;if(e.options.indentWithTabs)for(var Fe=Math.floor(ke/oe);Fe;--Fe)Ue+=oe,Pe+=" ";if(Ue<ke&&(Pe+=Q(ke-Ue)),Pe!=Ee)return Fi(j,Pe,Je(t,0),Je(t,Ee.length),"+input"),de.stateAfter=null,!0;for(var ze=0;ze<j.sel.ranges.length;ze++){var Ze=j.sel.ranges[ze];if(Ze.head.line==t&&Ze.head.ch<Ee.length){var ot=Je(t,Ee.length);co(j,ze,new Jt(ot,ot));break}}}var An=null;function Ua(e){An=e}function bo(e,t,O,A,j){var ee=e.doc;e.display.shift=!1,A||(A=ee.sel);var oe=+new Date-200,de=j=="paste"||e.state.pasteIncoming>oe,ge=st(t),Ee=null;if(de&&A.ranges.length>1)if(An&&An.text.join(`
`)==t){if(A.ranges.length%An.text.length==0){Ee=[];for(var ke=0;ke<An.text.length;ke++)Ee.push(ee.splitLines(An.text[ke]))}}else ge.length==A.ranges.length&&e.options.pasteLinesPerSelection&&(Ee=F(ge,function(ct){return[ct]}));for(var Pe=e.curOp.updateInput,Ue=A.ranges.length-1;Ue>=0;Ue--){var Fe=A.ranges[Ue],ze=Fe.from(),Ze=Fe.to();Fe.empty()&&(O&&O>0?ze=Je(ze.line,ze.ch-O):e.state.overwrite&&!de?Ze=Je(Ze.line,Math.min(at(ee,Ze.line).text.length,Ze.ch+D(ge).length)):de&&An&&An.lineWise&&An.text.join(`
`)==ge.join(`
`)&&(ze=Ze=Je(ze.line,0)));var ot={from:ze,to:Ze,text:Ee?Ee[Ue%Ee.length]:ge,origin:j||(de?"paste":e.state.cutIncoming>oe?"cut":"+input")};ji(e.doc,ot),$t(e,"inputRead",e,ot)}t&&!de&&js(e,t),Pi(e),e.curOp.updateInput<2&&(e.curOp.updateInput=Pe),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Ns(e,t){var O=e.clipboardData&&e.clipboardData.getData("Text");if(O)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&Zr(t,function(){return bo(t,O,0,null,"paste")}),!0}function js(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var O=e.doc.sel,A=O.ranges.length-1;A>=0;A--){var j=O.ranges[A];if(j.head.ch>100||A&&O.ranges[A-1].head.line==j.head.line)continue;var ee=e.getModeAt(j.head),oe=!1;if(ee.electricChars){for(var de=0;de<ee.electricChars.length;de++)if(t.indexOf(ee.electricChars.charAt(de))>-1){oe=ba(e,j.head.line,"smart");break}}else ee.electricInput&&(ee.electricInput.test(at(e.doc,j.head.line).text.slice(0,j.head.ch))&&(oe=ba(e,j.head.line,"smart")));oe&&$t(e,"electricInput",e,j.head.line)}}function Fs(e){for(var t=[],O=[],A=0;A<e.doc.sel.ranges.length;A++){var j=e.doc.sel.ranges[A].head.line,ee={anchor:Je(j,0),head:Je(j+1,0)};O.push(ee),t.push(e.getRange(ee.anchor,ee.head))}return{text:t,ranges:O}}function Bs(e,t,O,A){e.setAttribute("autocorrect",O?"":"off"),e.setAttribute("autocapitalize",A?"":"off"),e.setAttribute("spellcheck",!!t)}function Us(){var e=_("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=_("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return s?e.style.width="1000px":e.setAttribute("wrap","off"),y&&(e.style.border="1px solid black"),Bs(e),t}function eu(e){var t=e.optionHandlers,O=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(A,j){var ee=this.options,oe=ee[A];if(ee[A]==j&&A!="mode")return;ee[A]=j,t.hasOwnProperty(A)&&Cr(this,t[A])(this,j,oe),we(this,"optionChange",this,A)},getOption:function(A){return this.options[A]},getDoc:function(){return this.doc},addKeyMap:function(A,j){this.state.keyMaps[j?"push":"unshift"](ja(A))},removeKeyMap:function(A){for(var j=this.state.keyMaps,ee=0;ee<j.length;++ee)if(j[ee]==A||j[ee].name==A)return j.splice(ee,1),!0},addOverlay:Br(function(A,j){var ee=A.token?A:e.getMode(this.options,A);if(ee.startState)throw new Error("Overlays may not be stateful.");W(this.state.overlays,{mode:ee,modeSpec:A,opaque:j&&j.opaque,priority:j&&j.priority||0},function(oe){return oe.priority}),this.state.modeGen++,Kr(this)}),removeOverlay:Br(function(A){for(var j=this.state.overlays,ee=0;ee<j.length;++ee){var oe=j[ee].modeSpec;if(oe==A||typeof A=="string"&&oe.name==A){j.splice(ee,1),this.state.modeGen++,Kr(this);return}}}),indentLine:Br(function(A,j,ee){typeof j!="string"&&typeof j!="number"&&(j==null?j=this.options.smartIndent?"smart":"prev":j=j?"add":"subtract"),Nt(this.doc,A)&&ba(this,A,j,ee)}),indentSelection:Br(function(A){for(var j=this.doc.sel.ranges,ee=-1,oe=0;oe<j.length;oe++){var de=j[oe];if(de.empty())de.head.line>ee&&(ba(this,de.head.line,A,!0),ee=de.head.line,oe==this.doc.sel.primIndex&&Pi(this));else{var ge=de.from(),Ee=de.to(),ke=Math.max(ee,ge.line);ee=Math.min(this.lastLine(),Ee.line-(Ee.ch?0:1))+1;for(var Pe=ke;Pe<ee;++Pe)ba(this,Pe,A);var Ue=this.doc.sel.ranges;ge.ch==0&&j.length==Ue.length&&Ue[oe].from().ch>0&&co(this.doc,oe,new Jt(ge,Ue[oe].to()),Ce)}}}),getTokenAt:function(A,j){return ur(this,A,j)},getLineTokens:function(A,j){return ur(this,Je(A),j,!0)},getTokenTypeAt:function(A){A=Dt(this.doc,A);var j=yr(this,at(this.doc,A.line)),ee=0,oe=(j.length-1)/2,de=A.ch,ge;if(de==0)ge=j[2];else for(;;){var Ee=ee+oe>>1;if((Ee?j[Ee*2-1]:0)>=de)oe=Ee;else if(j[Ee*2+1]<de)ee=Ee+1;else{ge=j[Ee*2+2];break}}var ke=ge?ge.indexOf("overlay "):-1;return ke<0?ge:ke==0?null:ge.slice(0,ke-1)},getModeAt:function(A){var j=this.doc.mode;return j.innerMode?e.innerMode(j,this.getTokenAt(A).state).mode:j},getHelper:function(A,j){return this.getHelpers(A,j)[0]},getHelpers:function(A,j){var ee=[];if(!O.hasOwnProperty(j))return ee;var oe=O[j],de=this.getModeAt(A);if(typeof de[j]=="string")oe[de[j]]&&ee.push(oe[de[j]]);else if(de[j])for(var ge=0;ge<de[j].length;ge++){var Ee=oe[de[j][ge]];Ee&&ee.push(Ee)}else de.helperType&&oe[de.helperType]?ee.push(oe[de.helperType]):oe[de.name]&&ee.push(oe[de.name]);for(var ke=0;ke<oe._global.length;ke++){var Pe=oe._global[ke];Pe.pred(de,this)&&le(ee,Pe.val)==-1&&ee.push(Pe.val)}return ee},getStateAfter:function(A,j){var ee=this.doc;return A=un(ee,A==null?ee.first+ee.size-1:A),Hr(this,A+1,j).state},cursorCoords:function(A,j){var ee,oe=this.doc.sel.primary();return A==null?ee=oe.head:typeof A=="object"?ee=Dt(this.doc,A):ee=A?oe.from():oe.to(),Tn(this,ee,j||"page")},charCoords:function(A,j){return Ka(this,Dt(this.doc,A),j||"page")},coordsChar:function(A,j){return A=on(this,A,j||"page"),za(this,A.left,A.top)},lineAtHeight:function(A,j){return A=on(this,{top:A,left:0},j||"page").top,Ut(this.doc,A+this.display.viewOffset)},heightAtLine:function(A,j,ee){var oe=!1,de;if(typeof A=="number"){var ge=this.doc.first+this.doc.size-1;A<this.doc.first?A=this.doc.first:A>ge&&(A=ge,oe=!0),de=at(this.doc,A)}else de=A;return Lr(this,de,{top:0,left:0},j||"page",ee||oe).top+(oe?this.doc.height-tn(de):0)},defaultTextHeight:function(){return Di(this.display)},defaultCharWidth:function(){return Ri(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(A,j,ee,oe,de){var ge=this.display;A=Tn(this,Dt(this.doc,A));var Ee=A.bottom,ke=A.left;if(j.style.position="absolute",j.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(j),ge.sizer.appendChild(j),oe=="over")Ee=A.top;else if(oe=="above"||oe=="near"){var Pe=Math.max(ge.wrapper.clientHeight,this.doc.height),Ue=Math.max(ge.sizer.clientWidth,ge.lineSpace.clientWidth);(oe=="above"||A.bottom+j.offsetHeight>Pe)&&A.top>j.offsetHeight?Ee=A.top-j.offsetHeight:A.bottom+j.offsetHeight<=Pe&&(Ee=A.bottom),ke+j.offsetWidth>Ue&&(ke=Ue-j.offsetWidth)}j.style.top=Ee+"px",j.style.left=j.style.right="",de=="right"?(ke=ge.sizer.clientWidth-j.offsetWidth,j.style.right="0px"):(de=="left"?ke=0:de=="middle"&&(ke=(ge.sizer.clientWidth-j.offsetWidth)/2),j.style.left=ke+"px"),ee&&Js(this,{left:ke,top:Ee,right:ke+j.offsetWidth,bottom:Ee+j.offsetHeight})},triggerOnKeyDown:Br(As),triggerOnKeyPress:Br(ks),triggerOnKeyUp:Os,triggerOnMouseDown:Br(Ds),execCommand:function(A){if(ma.hasOwnProperty(A))return ma[A].call(null,this)},triggerElectric:Br(function(A){js(this,A)}),findPosH:function(A,j,ee,oe){var de=1;j<0&&(de=-1,j=-j);for(var ge=Dt(this.doc,A),Ee=0;Ee<j&&!(ge=xo(this.doc,ge,de,ee,oe),ge.hitSide);++Ee);return ge},moveH:Br(function(A,j){var ee=this;this.extendSelectionsBy(function(oe){return ee.display.shift||ee.doc.extend||oe.empty()?xo(ee.doc,oe.head,A,j,ee.options.rtlMoveVisually):A<0?oe.from():oe.to()},ce)}),deleteH:Br(function(A,j){var ee=this.doc.sel,oe=this.doc;ee.somethingSelected()?oe.replaceSelection("",null,"+delete"):Wi(this,function(de){var ge=xo(oe,de.head,A,j,!1);return A<0?{from:ge,to:de.head}:{from:de.head,to:ge}})}),findPosV:function(A,j,ee,oe){var de=1,ge=oe;j<0&&(de=-1,j=-j);for(var Ee=Dt(this.doc,A),ke=0;ke<j;++ke){var Pe=Tn(this,Ee,"div");if(ge==null?ge=Pe.left:Pe.left=ge,Ee=Ws(this,Pe,de,ee),Ee.hitSide)break}return Ee},moveV:Br(function(A,j){var ee=this,oe=this.doc,de=[],ge=!this.display.shift&&!oe.extend&&oe.sel.somethingSelected();if(oe.extendSelectionsBy(function(ke){if(ge)return A<0?ke.from():ke.to();var Pe=Tn(ee,ke.head,"div");ke.goalColumn!=null&&(Pe.left=ke.goalColumn),de.push(Pe.left);var Ue=Ws(ee,Pe,A,j);return j=="page"&&ke==oe.sel.primary()&&qa(ee,Ka(ee,Ue,"div").top-Pe.top),Ue},ce),de.length)for(var Ee=0;Ee<oe.sel.ranges.length;Ee++)oe.sel.ranges[Ee].goalColumn=de[Ee]}),findWordAt:function(A){var j=this.doc,ee=at(j,A.line).text,oe=A.ch,de=A.ch;if(ee){var ge=this.getHelper(A,"wordChars");(A.sticky=="before"||de==ee.length)&&oe?--oe:++de;for(var Ee=ee.charAt(oe),ke=X(Ee,ge)?function(Pe){return X(Pe,ge)}:/\s/.test(Ee)?function(Pe){return/\s/.test(Pe)}:function(Pe){return!/\s/.test(Pe)&&!X(Pe)};oe>0&&ke(ee.charAt(oe-1));)--oe;for(;de<ee.length&&ke(ee.charAt(de));)++de}return new Jt(Je(A.line,oe),Je(A.line,de))},toggleOverwrite:function(A){if(A!=null&&A==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?$(this.display.cursorDiv,"CodeMirror-overwrite"):d(this.display.cursorDiv,"CodeMirror-overwrite"),we(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==J()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Br(function(A,j){ea(this,A,j)}),getScrollInfo:function(){var A=this.display.scroller;return{left:A.scrollLeft,top:A.scrollTop,height:A.scrollHeight-nn(this)-this.display.barHeight,width:A.scrollWidth-nn(this)-this.display.barWidth,clientHeight:fi(this),clientWidth:Sn(this)}},scrollIntoView:Br(function(A,j){A==null?(A={from:this.doc.sel.primary().head,to:null},j==null&&(j=this.options.cursorScrollMargin)):typeof A=="number"?A={from:Je(A,0),to:null}:A.from==null&&(A={from:A,to:null}),A.to||(A.to=A.from),A.margin=j||0,A.from.line!=null?Zs(this,A):Po(this,A.from,A.to,A.margin)}),setSize:Br(function(A,j){var ee=this,oe=function(ge){return typeof ge=="number"||/^\d+$/.test(String(ge))?ge+"px":ge};A!=null&&(this.display.wrapper.style.width=oe(A)),j!=null&&(this.display.wrapper.style.height=oe(j)),this.options.lineWrapping&&yn(this);var de=this.display.viewFrom;this.doc.iter(de,this.display.viewTo,function(ge){if(ge.widgets){for(var Ee=0;Ee<ge.widgets.length;Ee++)if(ge.widgets[Ee].noHScroll){Qn(ee,de,"widget");break}}++de}),this.curOp.forceUpdate=!0,we(this,"refresh",this)}),operation:function(A){return Zr(this,A)},startOperation:function(){return bi(this)},endOperation:function(){return xi(this)},refresh:Br(function(){var A=this.display.cachedTextHeight;Kr(this),this.curOp.forceUpdate=!0,Zn(this),ea(this,this.doc.scrollLeft,this.doc.scrollTop),ro(this.display),(A==null||Math.abs(A-Di(this.display))>.5||this.options.lineWrapping)&&$a(this),we(this,"refresh",this)}),swapDoc:Br(function(A){var j=this.doc;return j.cm=null,this.state.selectingText&&this.state.selectingText(),Xo(this,A),Zn(this),this.display.input.reset(),ea(this,A.scrollLeft,A.scrollTop),this.curOp.forceScroll=!0,$t(this,"swapDoc",this,j),j}),phrase:function(A){var j=this.options.phrases;return j&&Object.prototype.hasOwnProperty.call(j,A)?j[A]:A},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}},_e(e),e.registerHelper=function(A,j,ee){O.hasOwnProperty(A)||(O[A]=e[A]={_global:[]}),O[A][j]=ee},e.registerGlobalHelper=function(A,j,ee,oe){e.registerHelper(A,j,oe),O[A]._global.push({pred:ee,val:oe})}}function xo(e,t,O,A,j){var ee=t,oe=O,de=at(e,t.line),ge=j&&e.direction=="rtl"?-O:O;function Ee(){var mt=t.line+ge;return mt<e.first||mt>=e.first+e.size?!1:(t=new Je(mt,t.ch,t.sticky),de=at(e,mt))}function ke(mt){var dt;if(A=="codepoint"){var vt=de.text.charCodeAt(t.ch+(A>0?0:-1));isNaN(vt)?dt=null:dt=new Je(t.line,Math.max(0,Math.min(de.text.length,t.ch+O*(vt>=55296&&vt<56320?2:1))),-O)}else j?dt=Ml(e.cm,de,t,O):dt=fo(de,t,O);if(dt==null)if(!mt&&Ee())t=po(j,e.cm,de,t.line,ge);else return!1;else t=dt;return!0}if(A=="char"||A=="codepoint")ke();else if(A=="column")ke(!0);else if(A=="word"||A=="group")for(var Pe=null,Ue=A=="group",Fe=e.cm&&e.cm.getHelper(t,"wordChars"),ze=!0;!(O<0&&!ke(!ze));ze=!1){var Ze=de.text.charAt(t.ch)||`
`,ot=X(Ze,Fe)?"w":Ue&&Ze==`
`?"n":!Ue||/\s/.test(Ze)?null:"p";if(Ue&&!ze&&!ot&&(ot="s"),Pe&&Pe!=ot){O<0&&(O=1,ke(),t.sticky="after");break}if(ot&&(Pe=ot),O>0&&!ke(!ze))break}var ct=Ia(e,t,ee,oe,!0);return kr(ee,ct)&&(ct.hitSide=!0),ct}function Ws(e,t,O,A){var j=e.doc,ee=t.left,oe;if(A=="page"){var de=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),ge=Math.max(de-.5*Di(e.display),3);oe=(O>0?t.bottom:t.top)+O*ge}else A=="line"&&(oe=O>0?t.bottom+3:t.top-3);for(var Ee;!(Ee=za(e,ee,oe),!Ee.outside);){if(O<0?oe<=0:oe>=j.height){Ee.hitSide=!0;break}oe+=O*5}return Ee}var tr=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new ie,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};tr.prototype.init=function(e){var t=this,O=this,A=O.cm,j=O.div=e.lineDiv;Bs(j,A.options.spellcheck,A.options.autocorrect,A.options.autocapitalize);function ee(de){for(var ge=de.target;ge;ge=ge.parentNode){if(ge==j)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(ge.className))break}return!1}De(j,"paste",function(de){if(!ee(de)||fe(A,de)||Ns(de,A))return;g<=11&&setTimeout(Cr(A,function(){return t.updateFromDOM()}),20)}),De(j,"compositionstart",function(de){t.composing={data:de.data,done:!1}}),De(j,"compositionupdate",function(de){t.composing||(t.composing={data:de.data,done:!1})}),De(j,"compositionend",function(de){t.composing&&(de.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),De(j,"touchstart",function(){return O.forceCompositionEnd()}),De(j,"input",function(){t.composing||t.readFromDOMSoon()});function oe(de){if(!ee(de)||fe(A,de))return;if(A.somethingSelected())Ua({lineWise:!1,text:A.getSelections()}),de.type=="cut"&&A.replaceSelection("",null,"cut");else if(A.options.lineWiseCopyCut){var ge=Fs(A);Ua({lineWise:!0,text:ge.text}),de.type=="cut"&&A.operation(function(){A.setSelections(ge.ranges,0,Ce),A.replaceSelection("",null,"cut")})}else return;if(de.clipboardData){de.clipboardData.clearData();var Ee=An.text.join(`
`);if(de.clipboardData.setData("Text",Ee),de.clipboardData.getData("Text")==Ee){de.preventDefault();return}}var ke=Us(),Pe=ke.firstChild;A.display.lineSpace.insertBefore(ke,A.display.lineSpace.firstChild),Pe.value=An.text.join(`
`);var Ue=document.activeElement;V(Pe),setTimeout(function(){A.display.lineSpace.removeChild(ke),Ue.focus(),Ue==j&&O.showPrimarySelection()},50)}De(j,"copy",oe),De(j,"cut",oe)},tr.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},tr.prototype.prepareSelection=function(){var e=Oo(this.cm,!1);return e.focus=document.activeElement==this.div,e},tr.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},tr.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},tr.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,O=t.doc.sel.primary(),A=O.from(),j=O.to();if(t.display.viewTo==t.display.viewFrom||A.line>=t.display.viewTo||j.line<t.display.viewFrom){e.removeAllRanges();return}var ee=Wa(t,e.anchorNode,e.anchorOffset),oe=Wa(t,e.focusNode,e.focusOffset);if(ee&&!ee.bad&&oe&&!oe.bad&&bt(Mr(ee,oe),A)==0&&bt(Wr(ee,oe),j)==0)return;var de=t.display.view,ge=A.line>=t.display.viewFrom&&Hs(t,A)||{node:de[0].measure.map[2],offset:0},Ee=j.line<t.display.viewTo&&Hs(t,j);if(!Ee){var ke=de[de.length-1].measure,Pe=ke.maps?ke.maps[ke.maps.length-1]:ke.map;Ee={node:Pe[Pe.length-1],offset:Pe[Pe.length-2]-Pe[Pe.length-3]}}if(!ge||!Ee){e.removeAllRanges();return}var Ue=e.rangeCount&&e.getRangeAt(0),Fe;try{Fe=U(ge.node,ge.offset,Ee.offset,Ee.node)}catch(ze){}Fe&&(!S&&t.state.focused?(e.collapse(ge.node,ge.offset),Fe.collapsed||(e.removeAllRanges(),e.addRange(Fe))):(e.removeAllRanges(),e.addRange(Fe)),Ue&&e.anchorNode==null?e.addRange(Ue):S&&this.startGracePeriod()),this.rememberSelection()},tr.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)},tr.prototype.showMultipleSelections=function(e){x(this.cm.display.cursorDiv,e.cursors),x(this.cm.display.selectionDiv,e.selection)},tr.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},tr.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return P(this.div,t)},tr.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},tr.prototype.blur=function(){this.div.blur()},tr.prototype.getField=function(){return this.div},tr.prototype.supportsTouch=function(){return!0},tr.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Zr(this.cm,function(){return e.cm.curOp.selectionChanged=!0});function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}this.polling.set(this.cm.options.pollInterval,t)},tr.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},tr.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(u&&r&&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 O=Wa(t,e.anchorNode,e.anchorOffset),A=Wa(t,e.focusNode,e.focusOffset);O&&A&&Zr(t,function(){Pr(t.doc,ei(O,A),Ce),(O.bad||A.bad)&&(t.curOp.selectionChanged=!0)})},tr.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,O=e.doc.sel.primary(),A=O.from(),j=O.to();if(A.ch==0&&A.line>e.firstLine()&&(A=Je(A.line-1,at(e.doc,A.line-1).length)),j.ch==at(e.doc,j.line).text.length&&j.line<e.lastLine()&&(j=Je(j.line+1,0)),A.line<t.viewFrom||j.line>t.viewTo-1)return!1;var ee,oe,de;A.line==t.viewFrom||(ee=gi(e,A.line))==0?(oe=kt(t.view[0].line),de=t.view[0].node):(oe=kt(t.view[ee].line),de=t.view[ee-1].node.nextSibling);var ge=gi(e,j.line),Ee,ke;if(ge==t.view.length-1?(Ee=t.viewTo-1,ke=t.lineDiv.lastChild):(Ee=kt(t.view[ge+1].line)-1,ke=t.view[ge+1].node.previousSibling),!de)return!1;for(var Pe=e.doc.splitLines(ru(e,de,ke,oe,Ee)),Ue=ft(e.doc,Je(oe,0),Je(Ee,at(e.doc,Ee).text.length));Pe.length>1&&Ue.length>1;)if(D(Pe)==D(Ue))Pe.pop(),Ue.pop(),Ee--;else if(Pe[0]==Ue[0])Pe.shift(),Ue.shift(),oe++;else break;for(var Fe=0,ze=0,Ze=Pe[0],ot=Ue[0],ct=Math.min(Ze.length,ot.length);Fe<ct&&Ze.charCodeAt(Fe)==ot.charCodeAt(Fe);)++Fe;for(var mt=D(Pe),dt=D(Ue),vt=Math.min(mt.length-(Pe.length==1?Fe:0),dt.length-(Ue.length==1?Fe:0));ze<vt&&mt.charCodeAt(mt.length-ze-1)==dt.charCodeAt(dt.length-ze-1);)++ze;if(Pe.length==1&&Ue.length==1&&oe==A.line)for(;Fe&&Fe>A.ch&&mt.charCodeAt(mt.length-ze-1)==dt.charCodeAt(dt.length-ze-1);)Fe--,ze++;Pe[Pe.length-1]=mt.slice(0,mt.length-ze).replace(/^\u200b+/,""),Pe[0]=Pe[0].slice(Fe).replace(/\u200b+$/,"");var Lt=Je(oe,Fe),Tt=Je(Ee,Ue.length?D(Ue).length-ze:0);if(Pe.length>1||Pe[0]||bt(Lt,Tt))return Fi(e.doc,Pe,Lt,Tt,"+input"),!0},tr.prototype.ensurePolled=function(){this.forceCompositionEnd()},tr.prototype.reset=function(){this.forceCompositionEnd()},tr.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},tr.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)},tr.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Zr(this.cm,function(){return Kr(e.cm)})},tr.prototype.setUneditable=function(e){e.contentEditable="false"},tr.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||Cr(this.cm,bo)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},tr.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},tr.prototype.onContextMenu=function(){},tr.prototype.resetPosition=function(){},tr.prototype.needsContentAttribute=!0;function Hs(e,t){var O=_i(e,t.line);if(!O||O.hidden)return null;var A=at(e.doc,t.line),j=Ti(O,A,t.line),ee=Be(A,e.doc.direction),oe="left";if(ee){var de=Ne(ee,t.ch);oe=de%2?"right":"left"}var ge=Jn(j.map,t.ch,oe);return ge.offset=ge.collapse=="right"?ge.end:ge.start,ge}function tu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Ki(e,t){return t&&(e.bad=!0),e}function ru(e,t,O,A,j){var ee="",oe=!1,de=e.doc.lineSeparator(),ge=!1;function Ee(Fe){return function(ze){return ze.id==Fe}}function ke(){oe&&(ee+=de,ge&&(ee+=de),oe=ge=!1)}function Pe(Fe){Fe&&(ke(),ee+=Fe)}function Ue(Fe){if(Fe.nodeType==1){var ze=Fe.getAttribute("cm-text");if(ze){Pe(ze);return}var Ze=Fe.getAttribute("cm-marker"),ot;if(Ze){var ct=e.findMarks(Je(A,0),Je(j+1,0),Ee(+Ze));ct.length&&(ot=ct[0].find(0))&&Pe(ft(e.doc,ot.from,ot.to).join(de));return}if(Fe.getAttribute("contenteditable")=="false")return;var mt=/^(pre|div|p|li|table|br)$/i.test(Fe.nodeName);if(!/^br$/i.test(Fe.nodeName)&&Fe.textContent.length==0)return;mt&&ke();for(var dt=0;dt<Fe.childNodes.length;dt++)Ue(Fe.childNodes[dt]);/^(pre|p)$/i.test(Fe.nodeName)&&(ge=!0),mt&&(oe=!0)}else Fe.nodeType==3&&Pe(Fe.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(Ue(t),t==O);)t=t.nextSibling,ge=!1;return ee}function Wa(e,t,O){var A;if(t==e.display.lineDiv){if(A=e.display.lineDiv.childNodes[O],!A)return Ki(e.clipPos(Je(e.display.viewTo-1)),!0);t=null,O=0}else for(A=t;;A=A.parentNode){if(!A||A==e.display.lineDiv)return null;if(A.parentNode&&A.parentNode==e.display.lineDiv)break}for(var j=0;j<e.display.view.length;j++){var ee=e.display.view[j];if(ee.node==A)return nu(ee,t,O)}}function nu(e,t,O){var A=e.text.firstChild,j=!1;if(!t||!P(A,t))return Ki(Je(kt(e.line),0),!0);if(t==A&&(j=!0,t=A.childNodes[O],O=0,!t)){var ee=e.rest?D(e.rest):e.line;return Ki(Je(kt(ee),ee.text.length),j)}var oe=t.nodeType==3?t:null,de=t;for(!oe&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(oe=t.firstChild,O&&(O=oe.nodeValue.length));de.parentNode!=A;)de=de.parentNode;var ge=e.measure,Ee=ge.maps;function ke(ot,ct,mt){for(var dt=-1;dt<(Ee?Ee.length:0);dt++)for(var vt=dt<0?ge.map:Ee[dt],Lt=0;Lt<vt.length;Lt+=3){var Tt=vt[Lt+2];if(Tt==ot||Tt==ct){var Kt=kt(dt<0?e.line:e.rest[dt]),nr=vt[Lt]+mt;return(mt<0||Tt!=ot)&&(nr=vt[Lt+(mt?1:0)]),Je(Kt,nr)}}}var Pe=ke(oe,de,O);if(Pe)return Ki(Pe,j);for(var Ue=de.nextSibling,Fe=oe?oe.nodeValue.length-O:0;Ue;Ue=Ue.nextSibling){if(Pe=ke(Ue,Ue.firstChild,0),Pe)return Ki(Je(Pe.line,Pe.ch-Fe),j);Fe+=Ue.textContent.length}for(var ze=de.previousSibling,Ze=O;ze;ze=ze.previousSibling){if(Pe=ke(ze,ze.firstChild,-1),Pe)return Ki(Je(Pe.line,Pe.ch+Ze),j);Ze+=ze.textContent.length}}var pr=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new ie,this.hasSelection=!1,this.composing=null};pr.prototype.init=function(e){var t=this,O=this,A=this.cm;this.createField(e);var j=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),y&&(j.style.width="0px"),De(j,"input",function(){C&&g>=9&&t.hasSelection&&(t.hasSelection=null),O.poll()}),De(j,"paste",function(oe){if(fe(A,oe)||Ns(oe,A))return;A.state.pasteIncoming=+new Date,O.fastPoll()});function ee(oe){if(fe(A,oe))return;if(A.somethingSelected())Ua({lineWise:!1,text:A.getSelections()});else if(A.options.lineWiseCopyCut){var de=Fs(A);Ua({lineWise:!0,text:de.text}),oe.type=="cut"?A.setSelections(de.ranges,null,Ce):(O.prevInput="",j.value=de.text.join(`
`),V(j))}else return;oe.type=="cut"&&(A.state.cutIncoming=+new Date)}De(j,"cut",ee),De(j,"copy",ee),De(e.scroller,"paste",function(oe){if(er(e,oe)||fe(A,oe))return;if(!j.dispatchEvent){A.state.pasteIncoming=+new Date,O.focus();return}var de=new Event("paste");de.clipboardData=oe.clipboardData,j.dispatchEvent(de)}),De(e.lineSpace,"selectstart",function(oe){er(e,oe)||xe(oe)}),De(j,"compositionstart",function(){var oe=A.getCursor("from");O.composing&&O.composing.range.clear(),O.composing={start:oe,range:A.markText(oe,A.getCursor("to"),{className:"CodeMirror-composing"})}}),De(j,"compositionend",function(){O.composing&&(O.poll(),O.composing.range.clear(),O.composing=null)})},pr.prototype.createField=function(e){this.wrapper=Us(),this.textarea=this.wrapper.firstChild},pr.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},pr.prototype.prepareSelection=function(){var e=this.cm,t=e.display,O=e.doc,A=Oo(e);if(e.options.moveInputWithCursor){var j=Tn(e,O.sel.primary().head,"div"),ee=t.wrapper.getBoundingClientRect(),oe=t.lineDiv.getBoundingClientRect();A.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,j.top+oe.top-ee.top)),A.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,j.left+oe.left-ee.left))}return A},pr.prototype.showSelection=function(e){var t=this.cm,O=t.display;x(O.cursorDiv,e.cursors),x(O.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},pr.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var O=t.getSelection();this.textarea.value=O,t.state.focused&&V(this.textarea),C&&g>=9&&(this.hasSelection=O)}else e||(this.prevInput=this.textarea.value="",C&&g>=9&&(this.hasSelection=null))},pr.prototype.getField=function(){return this.textarea},pr.prototype.supportsTouch=function(){return!1},pr.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!n||J()!=this.textarea))try{this.textarea.focus()}catch(e){}},pr.prototype.blur=function(){this.textarea.blur()},pr.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},pr.prototype.receivedFocus=function(){this.slowPoll()},pr.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()})},pr.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function O(){var A=t.poll();!A&&!e?(e=!0,t.polling.set(60,O)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,O)},pr.prototype.poll=function(){var e=this,t=this.cm,O=this.textarea,A=this.prevInput;if(this.contextMenuPending||!t.state.focused||tt(O)&&!A&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var j=O.value;if(j==A&&!t.somethingSelected())return!1;if(C&&g>=9&&this.hasSelection===j||o&&/[\uf700-\uf7ff]/.test(j))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var ee=j.charCodeAt(0);if(ee==8203&&!A&&(A="\u200B"),ee==8666)return this.reset(),this.cm.execCommand("undo")}for(var oe=0,de=Math.min(A.length,j.length);oe<de&&A.charCodeAt(oe)==j.charCodeAt(oe);)++oe;return Zr(t,function(){bo(t,j.slice(oe),A.length-oe,null,e.composing?"*compose":null),j.length>1e3||j.indexOf(`
`)>-1?O.value=e.prevInput="":e.prevInput=j,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},pr.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},pr.prototype.onKeyPress=function(){C&&g>=9&&(this.hasSelection=null),this.fastPoll()},pr.prototype.onContextMenu=function(e){var t=this,O=t.cm,A=O.display,j=t.textarea;t.contextMenuPending&&t.contextMenuPending();var ee=mi(O,e),oe=A.scroller.scrollTop;if(!ee||f)return;var de=O.options.resetSelectionOnContextMenu;de&&O.doc.sel.contains(ee)==-1&&Cr(O,Pr)(O.doc,ei(ee),Ce);var ge=j.style.cssText,Ee=t.wrapper.style.cssText,ke=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",j.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(e.clientY-ke.top-5)+"px; left: "+(e.clientX-ke.left-5)+`px;
z-index: 1000; background: `+(C?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var Pe;s&&(Pe=window.scrollY),A.input.focus(),s&&window.scrollTo(null,Pe),A.input.reset(),O.somethingSelected()||(j.value=t.prevInput=" "),t.contextMenuPending=Fe,A.selForContextMenu=O.doc.sel,clearTimeout(A.detectingSelectAll);function Ue(){if(j.selectionStart!=null){var Ze=O.somethingSelected(),ot="\u200B"+(Ze?j.value:"");j.value="\u21DA",j.value=ot,t.prevInput=Ze?"":"\u200B",j.selectionStart=1,j.selectionEnd=ot.length,A.selForContextMenu=O.doc.sel}}function Fe(){if(t.contextMenuPending!=Fe)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=Ee,j.style.cssText=ge,C&&g<9&&A.scrollbars.setScrollTop(A.scroller.scrollTop=oe),j.selectionStart!=null){(!C||C&&g<9)&&Ue();var Ze=0,ot=function(){A.selForContextMenu==O.doc.sel&&j.selectionStart==0&&j.selectionEnd>0&&t.prevInput=="\u200B"?Cr(O,os)(O):Ze++<10?A.detectingSelectAll=setTimeout(ot,500):(A.selForContextMenu=null,A.input.reset())};A.detectingSelectAll=setTimeout(ot,200)}}if(C&&g>=9&&Ue(),R){Oe(e);var ze=function(){$e(window,"mouseup",ze),setTimeout(Fe,20)};De(window,"mouseup",ze)}else setTimeout(Fe,50)},pr.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},pr.prototype.setUneditable=function(){},pr.prototype.needsContentAttribute=!1;function iu(e,t){if(t=t?H(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var O=J();t.autofocus=O==e||e.getAttribute("autofocus")!=null&&O==document.body}function A(){e.value=de.getValue()}var j;if(e.form&&(De(e.form,"submit",A),!t.leaveSubmitMethodAlone)){var ee=e.form;j=ee.submit;try{var oe=ee.submit=function(){A(),ee.submit=j,ee.submit(),ee.submit=oe}}catch(ge){}}t.finishInit=function(ge){ge.save=A,ge.getTextArea=function(){return e},ge.toTextArea=function(){ge.toTextArea=isNaN,A(),e.parentNode.removeChild(ge.getWrapperElement()),e.style.display="",e.form&&($e(e.form,"submit",A),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=j))}},e.style.display="none";var de=ir(function(ge){return e.parentNode.insertBefore(ge,e.nextSibling)},t);return de}function au(e){e.off=$e,e.on=De,e.wheelEventPixels=hl,e.Doc=Gr,e.splitLines=st,e.countColumn=G,e.findColumn=he,e.isWordChar=q,e.Pass=be,e.signal=we,e.Line=jn,e.changeEnd=ti,e.scrollbarModel=No,e.Pos=Je,e.cmpPos=bt,e.modes=Bt,e.mimeModes=gt,e.resolveMode=Gt,e.getMode=Ge,e.modeExtensions=lt,e.extendMode=yt,e.copyState=It,e.startState=Ot,e.innerMode=Wt,e.commands=ma,e.keyMap=Wn,e.keyName=ws,e.isModifierKey=xs,e.lookupKey=Ui,e.normalizeKeyMap=Il,e.StringStream=Rt,e.SharedTextMarker=ha,e.TextMarker=ni,e.LineWidget=da,e.e_preventDefault=xe,e.e_stopPropagation=Se,e.e_stop=Oe,e.addClass=$,e.contains=P,e.rmClass=d,e.keyNames=ii}Jl(ir),eu(ir);var ou="iter insert remove copy getEditor constructor".split(" ");for(var Ha in Gr.prototype)Gr.prototype.hasOwnProperty(Ha)&&le(ou,Ha)<0&&(ir.prototype[Ha]=function(e){return function(){return e.apply(this.doc,arguments)}}(Gr.prototype[Ha]));return _e(Gr),ir.inputStyles={textarea:pr,contenteditable:tr},ir.defineMode=function(e){!ir.defaults.mode&&e!="null"&&(ir.defaults.mode=e),xt.apply(this,arguments)},ir.defineMIME=rr,ir.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),ir.defineMIME("text/plain","null"),ir.defineExtension=function(e,t){ir.prototype[e]=t},ir.defineDocExtension=function(e,t){Gr.prototype[e]=t},ir.fromTextArea=iu,au(ir),ir.version="5.58.2",ir})},WYAk:function(M,ne,N){(function(I,h){M.exports=ne=h(N("Ib8C"))})(this,function(I){(function(){var h=I,S=h.lib,L=S.Base,T=h.enc,c=T.Utf8,C=h.algo,g=C.HMAC=L.extend({init:function(s,a){s=this._hasher=new s.init,typeof a=="string"&&(a=c.parse(a));var r=s.blockSize,f=r*4;a.sigBytes>f&&(a=s.finalize(a)),a.clamp();for(var p=this._oKey=a.clone(),m=this._iKey=a.clone(),E=p.words,y=m.words,u=0;u<r;u++)E[u]^=1549556828,y[u]^=909522486;p.sigBytes=m.sigBytes=f,this.reset()},reset:function(){var s=this._hasher;s.reset(),s.update(this._iKey)},update:function(s){return this._hasher.update(s),this},finalize:function(s){var a=this._hasher,r=a.finalize(s);a.reset();var f=a.finalize(this._oKey.clone().concat(r));return f}})})()})},WaYH:function(M,ne,N){"use strict";var I=N("rePB"),h=N("Ff2n"),S=N("VTBJ"),L=N("1OyB"),T=N("vuIU"),c=N("JX7q"),C=N("Ji7U"),g=N("LK+K"),s=N("q1tI"),a=N("TSYQ"),r=N.n(a),f=N("sboe"),p=N("OZM5"),m=function(R){var k=R.prefixCls,d=R.level,b=R.isStart,x=R.isEnd;if(!d)return null;for(var _="".concat(k,"-indent-unit"),B=[],U=0;U<d;U+=1){var P;B.push(s.createElement("span",{key:U,className:r()(_,(P={},Object(I.a)(P,"".concat(_,"-start"),b[U+1]),Object(I.a)(P,"".concat(_,"-end"),x[U+1]),Object(I.a)(P,"".concat(_,"-end-first-level"),!U&&x[0]),P))}))}return s.createElement("span",{"aria-hidden":"true",className:"".concat(k,"-indent")},B)},E=m,y=N("815F"),u="open",n="close",o="---",l=function(i){Object(C.a)(k,i);var R=Object(g.a)(k);function k(){var d;return Object(L.a)(this,k),d=R.apply(this,arguments),d.state={dragNodeHighlight:!1},d.onSelectorClick=function(b){var x=d.props.context.onNodeClick;x(b,Object(y.b)(d.props)),d.isSelectable()?d.onSelect(b):d.onCheck(b)},d.onSelectorDoubleClick=function(b){var x=d.props.context.onNodeDoubleClick;x(b,Object(y.b)(d.props))},d.onSelect=function(b){if(d.isDisabled())return;var x=d.props.context.onNodeSelect;b.preventDefault(),x(b,Object(y.b)(d.props))},d.onCheck=function(b){if(d.isDisabled())return;var x=d.props,_=x.disableCheckbox,B=x.checked,U=d.props.context.onNodeCheck;if(!d.isCheckable()||_)return;b.preventDefault();var P=!B;U(b,Object(y.b)(d.props),P)},d.onMouseEnter=function(b){var x=d.props.context.onNodeMouseEnter;x(b,Object(y.b)(d.props))},d.onMouseLeave=function(b){var x=d.props.context.onNodeMouseLeave;x(b,Object(y.b)(d.props))},d.onContextMenu=function(b){var x=d.props.context.onNodeContextMenu;x(b,Object(y.b)(d.props))},d.onDragStart=function(b){var x=d.props.context.onNodeDragStart;b.stopPropagation(),d.setState({dragNodeHighlight:!0}),x(b,Object(c.a)(d));try{b.dataTransfer.setData("text/plain","")}catch(_){}},d.onDragEnter=function(b){var x=d.props.context.onNodeDragEnter;b.preventDefault(),b.stopPropagation(),x(b,Object(c.a)(d))},d.onDragOver=function(b){var x=d.props.context.onNodeDragOver;b.preventDefault(),b.stopPropagation(),x(b,Object(c.a)(d))},d.onDragLeave=function(b){var x=d.props.context.onNodeDragLeave;b.stopPropagation(),x(b,Object(c.a)(d))},d.onDragEnd=function(b){var x=d.props.context.onNodeDragEnd;b.stopPropagation(),d.setState({dragNodeHighlight:!1}),x(b,Object(c.a)(d))},d.onDrop=function(b){var x=d.props.context.onNodeDrop;b.preventDefault(),b.stopPropagation(),d.setState({dragNodeHighlight:!1}),x(b,Object(c.a)(d))},d.onExpand=function(b){var x=d.props.context.onNodeExpand;x(b,Object(y.b)(d.props))},d.setSelectHandle=function(b){d.selectHandle=b},d.getNodeState=function(){var b=d.props.expanded;return d.isLeaf()?null:b?u:n},d.hasChildren=function(){var b=d.props.eventKey,x=d.props.context.keyEntities,_=x[b]||{},B=_.children;return!!(B||[]).length},d.isLeaf=function(){var b=d.props,x=b.isLeaf,_=b.loaded,B=d.props.context.loadData,U=d.hasChildren();return x===!1?!1:x||!B&&!U||B&&_&&!U},d.isDisabled=function(){var b=d.props.disabled,x=d.props.context.disabled;return!!(x||b)},d.isCheckable=function(){var b=d.props.checkable,x=d.props.context.checkable;return!x||b===!1?!1:x},d.syncLoadData=function(b){var x=b.expanded,_=b.loading,B=b.loaded,U=d.props.context,P=U.loadData,J=U.onNodeLoad;if(_)return;P&&x&&!d.isLeaf()&&(!d.hasChildren()&&!B&&J(Object(y.b)(d.props)))},d.renderSwitcher=function(){var b=d.props,x=b.expanded,_=b.switcherIcon,B=d.props.context,U=B.prefixCls,P=B.switcherIcon,J=_||P;if(d.isLeaf())return s.createElement("span",{className:r()("".concat(U,"-switcher"),"".concat(U,"-switcher-noop"))},typeof J=="function"?J(Object(S.a)(Object(S.a)({},d.props),{},{isLeaf:!0})):J);var $=r()("".concat(U,"-switcher"),"".concat(U,"-switcher_").concat(x?u:n));return s.createElement("span",{onClick:d.onExpand,className:$},typeof J=="function"?J(Object(S.a)(Object(S.a)({},d.props),{},{isLeaf:!1})):J)},d.renderCheckbox=function(){var b=d.props,x=b.checked,_=b.halfChecked,B=b.disableCheckbox,U=d.props.context.prefixCls,P=d.isDisabled(),J=d.isCheckable();if(!J)return null;var $=typeof J!="boolean"?J:null;return s.createElement("span",{className:r()("".concat(U,"-checkbox"),x&&"".concat(U,"-checkbox-checked"),!x&&_&&"".concat(U,"-checkbox-indeterminate"),(P||B)&&"".concat(U,"-checkbox-disabled")),onClick:d.onCheck},$)},d.renderIcon=function(){var b=d.props.loading,x=d.props.context.prefixCls;return s.createElement("span",{className:r()("".concat(x,"-iconEle"),"".concat(x,"-icon__").concat(d.getNodeState()||"docu"),b&&"".concat(x,"-icon_loading"))})},d.renderSelector=function(){var b=d.state.dragNodeHighlight,x=d.props,_=x.title,B=x.selected,U=x.icon,P=x.loading,J=x.data,$=d.props.context,z=$.prefixCls,V=$.showIcon,K=$.icon,H=$.draggable,G=$.loadData,ie=$.titleRender,le=d.isDisabled(),ue="".concat(z,"-node-content-wrapper"),be;if(V){var Ce=U||K;be=Ce?s.createElement("span",{className:r()("".concat(z,"-iconEle"),"".concat(z,"-icon__customize"))},typeof Ce=="function"?Ce(d.props):Ce):d.renderIcon()}else G&&P&&(be=d.renderIcon());var se;typeof _=="function"?se=_(J):ie?se=ie(J):se=_;var ce=s.createElement("span",{className:"".concat(z,"-title")},se);return s.createElement("span",{ref:d.setSelectHandle,title:typeof _=="string"?_:"",className:r()("".concat(ue),"".concat(ue,"-").concat(d.getNodeState()||"normal"),!le&&(B||b)&&"".concat(z,"-node-selected"),!le&&H&&"draggable"),draggable:!le&&H||void 0,"aria-grabbed":!le&&H||void 0,onMouseEnter:d.onMouseEnter,onMouseLeave:d.onMouseLeave,onContextMenu:d.onContextMenu,onClick:d.onSelectorClick,onDoubleClick:d.onSelectorDoubleClick,onDragStart:H?d.onDragStart:void 0},be,ce)},d}return Object(T.a)(k,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var b=this.props.selectable,x=this.props.context.selectable;return typeof b=="boolean"?b:x}},{key:"render",value:function(){var b,x=this.props,_=x.eventKey,B=x.className,U=x.style,P=x.dragOver,J=x.dragOverGapTop,$=x.dragOverGapBottom,z=x.isLeaf,V=x.isStart,K=x.isEnd,H=x.expanded,G=x.selected,ie=x.checked,le=x.halfChecked,ue=x.loading,be=x.domRef,Ce=x.active,se=x.onMouseMove,ce=Object(h.a)(x,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),he=this.props.context,ae=he.prefixCls,Q=he.filterTreeNode,D=he.draggable,F=he.keyEntities,W=this.isDisabled(),Y=Object(p.f)(ce),Z=F[_]||{},te=Z.level,q=K[K.length-1];return s.createElement("div",Object.assign({ref:be,className:r()(B,"".concat(ae,"-treenode"),(b={},Object(I.a)(b,"".concat(ae,"-treenode-disabled"),W),Object(I.a)(b,"".concat(ae,"-treenode-switcher-").concat(H?"open":"close"),!z),Object(I.a)(b,"".concat(ae,"-treenode-checkbox-checked"),ie),Object(I.a)(b,"".concat(ae,"-treenode-checkbox-indeterminate"),le),Object(I.a)(b,"".concat(ae,"-treenode-selected"),G),Object(I.a)(b,"".concat(ae,"-treenode-loading"),ue),Object(I.a)(b,"".concat(ae,"-treenode-active"),Ce),Object(I.a)(b,"".concat(ae,"-treenode-leaf-last"),q),Object(I.a)(b,"drag-over",!W&&P),Object(I.a)(b,"drag-over-gap-top",!W&&J),Object(I.a)(b,"drag-over-gap-bottom",!W&&$),Object(I.a)(b,"filter-node",Q&&Q(Object(y.b)(this.props))),b)),style:U,onDragEnter:D?this.onDragEnter:void 0,onDragOver:D?this.onDragOver:void 0,onDragLeave:D?this.onDragLeave:void 0,onDrop:D?this.onDrop:void 0,onDragEnd:D?this.onDragEnd:void 0,onMouseMove:se},Y),s.createElement(E,{prefixCls:ae,level:te,isStart:V,isEnd:K}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),k}(s.Component),w=function(R){return s.createElement(f.a.Consumer,null,function(k){return s.createElement(l,Object.assign({},R,{context:k}))})};w.displayName="TreeNode",w.defaultProps={title:o},w.isTreeNode=1;var v=ne.a=w},XIdC:function(M,ne,N){"use strict";var I=N("rePB"),h=N("ODXe"),S=N("Ff2n"),L=N("q1tI"),T=N.n(L),c=N("TSYQ"),C=N.n(c),g=N("6cGi"),s=N("4IlW"),a=L.forwardRef(function(r,f){var p,m=r.prefixCls,E=m===void 0?"rc-switch":m,y=r.className,u=r.checked,n=r.defaultChecked,o=r.disabled,l=r.loadingIcon,w=r.checkedChildren,v=r.unCheckedChildren,i=r.onClick,R=r.onChange,k=r.onKeyDown,d=Object(S.a)(r,["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"]),b=Object(g.a)(!1,{value:u,defaultValue:n}),x=Object(h.a)(b,2),_=x[0],B=x[1];function U(z,V){var K=_;return o||(K=z,B(K),R==null||R(K,V)),K}function P(z){z.which===s.a.LEFT?U(!1,z):z.which===s.a.RIGHT&&U(!0,z),k==null||k(z)}function J(z){var V=U(!_,z);i==null||i(V,z)}var $=C()(E,y,(p={},Object(I.a)(p,"".concat(E,"-checked"),_),Object(I.a)(p,"".concat(E,"-disabled"),o),p));return L.createElement("button",Object.assign({},d,{type:"button",role:"switch","aria-checked":_,disabled:o,className:$,ref:f,onKeyDown:P,onClick:J}),l,L.createElement("span",{className:"".concat(E,"-inner")},_?w:v))});a.displayName="Switch",ne.a=a},Y1PL:function(M,ne,N){"use strict";N.r(ne),N.d(ne,"ResizableTextArea",function(){return le});var I=N("wx14"),h=N("1OyB"),S=N("vuIU"),L=N("Ji7U"),T=N("LK+K"),c=N("q1tI"),C=N("VTBJ"),g=N("rePB"),s=N("Zm9Q"),a=N("Kwbf"),r=N("c+Xe"),f=N("m+aA"),p=N("bdgK"),m=new Map;function E(Ce){Ce.forEach(function(se){var ce,he=se.target;(ce=m.get(he))===null||ce===void 0||ce.forEach(function(ae){return ae(he)})})}var y=new p.default(E),u=null,n=null;function o(Ce,se){m.has(Ce)||(m.set(Ce,new Set),y.observe(Ce)),m.get(Ce).add(se)}function l(Ce,se){m.has(Ce)&&(m.get(Ce).delete(se),m.get(Ce).size||(y.unobserve(Ce),m.delete(Ce)))}var w=function(Ce){Object(L.a)(ce,Ce);var se=Object(T.a)(ce);function ce(){return Object(h.a)(this,ce),se.apply(this,arguments)}return Object(S.a)(ce,[{key:"render",value:function(){return this.props.children}}]),ce}(c.Component),v=c.createContext(null);function i(Ce){var se=Ce.children,ce=Ce.onBatchResize,he=c.useRef(0),ae=c.useRef([]),Q=c.useContext(v),D=c.useCallback(function(F,W,Y){he.current+=1;var Z=he.current;ae.current.push({size:F,element:W,data:Y}),Promise.resolve().then(function(){Z===he.current&&(ce==null||ce(ae.current),ae.current=[])}),Q==null||Q(F,W,Y)},[ce,Q]);return c.createElement(v.Provider,{value:D},se)}function R(Ce){var se=Ce.children,ce=Ce.disabled,he=c.useRef(null),ae=c.useRef(null),Q=c.useContext(v),D=c.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),F=c.isValidElement(se)&&Object(r.c)(se),W=F?se.ref:null,Y=c.useMemo(function(){return Object(r.a)(W,he)},[W,he]),Z=c.useRef(Ce);Z.current=Ce;var te=c.useCallback(function(q){var X=Z.current,re=X.onResize,me=X.data,ve=q.getBoundingClientRect(),Te=ve.width,Re=ve.height,Ie=q.offsetWidth,je=q.offsetHeight,Ne=Math.floor(Te),We=Math.floor(Re);if(D.current.width!==Ne||D.current.height!==We||D.current.offsetWidth!==Ie||D.current.offsetHeight!==je){var Be={width:Ne,height:We,offsetWidth:Ie,offsetHeight:je};D.current=Be;var He=Ie===Math.round(Te)?Te:Ie,De=je===Math.round(Re)?Re:je,Xe=Object(C.a)(Object(C.a)({},Be),{},{offsetWidth:He,offsetHeight:De});Q==null||Q(Xe,q,me),re&&Promise.resolve().then(function(){re(Xe,q)})}},[]);return c.useEffect(function(){var q=Object(f.a)(he.current)||Object(f.a)(ae.current);return q&&!ce&&o(q,te),function(){return l(q,te)}},[he.current,ce]),c.createElement(w,{ref:ae},F?c.cloneElement(se,{ref:Y}):se)}var k="rc-observer-key";function d(Ce){var se=Ce.children,ce=Object(s.a)(se);return ce.map(function(he,ae){var Q=(he==null?void 0:he.key)||"".concat(k,"-").concat(ae);return c.createElement(R,Object(I.a)({},Ce,{key:Q}),he)})}d.Collection=i;var b=d,x=N("bT9E"),_=N("TSYQ"),B=N.n(_),U=`
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
`,P=["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"],J={},$;function z(Ce){var se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ce=Ce.getAttribute("id")||Ce.getAttribute("data-reactid")||Ce.getAttribute("name");if(se&&J[ce])return J[ce];var he=window.getComputedStyle(Ce),ae=he.getPropertyValue("box-sizing")||he.getPropertyValue("-moz-box-sizing")||he.getPropertyValue("-webkit-box-sizing"),Q=parseFloat(he.getPropertyValue("padding-bottom"))+parseFloat(he.getPropertyValue("padding-top")),D=parseFloat(he.getPropertyValue("border-bottom-width"))+parseFloat(he.getPropertyValue("border-top-width")),F=P.map(function(Y){return"".concat(Y,":").concat(he.getPropertyValue(Y))}).join(";"),W={sizingStyle:F,paddingSize:Q,borderSize:D,boxSizing:ae};return se&&ce&&(J[ce]=W),W}function V(Ce){var se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ce=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,he=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;$||($=document.createElement("textarea"),$.setAttribute("tab-index","-1"),$.setAttribute("aria-hidden","true"),document.body.appendChild($)),Ce.getAttribute("wrap")?$.setAttribute("wrap",Ce.getAttribute("wrap")):$.removeAttribute("wrap");var ae=z(Ce,se),Q=ae.paddingSize,D=ae.borderSize,F=ae.boxSizing,W=ae.sizingStyle;$.setAttribute("style","".concat(W,";").concat(U)),$.value=Ce.value||Ce.placeholder||"";var Y=Number.MIN_SAFE_INTEGER,Z=Number.MAX_SAFE_INTEGER,te=$.scrollHeight,q;if(F==="border-box"?te+=D:F==="content-box"&&(te-=Q),ce!==null||he!==null){$.value=" ";var X=$.scrollHeight-Q;ce!==null&&(Y=X*ce,F==="border-box"&&(Y=Y+Q+D),te=Math.max(Y,te)),he!==null&&(Z=X*he,F==="border-box"&&(Z=Z+Q+D),q=te>Z?"":"hidden",te=Math.min(Z,te))}return{height:te,minHeight:Y,maxHeight:Z,overflowY:q,resize:"none"}}var K=N("Gytx"),H=N.n(K),G;(function(Ce){Ce[Ce.NONE=0]="NONE",Ce[Ce.RESIZING=1]="RESIZING",Ce[Ce.RESIZED=2]="RESIZED"})(G||(G={}));var ie=function(Ce){Object(L.a)(ce,Ce);var se=Object(T.a)(ce);function ce(he){var ae;return Object(h.a)(this,ce),ae=se.call(this,he),ae.nextFrameActionId=void 0,ae.resizeFrameId=void 0,ae.textArea=void 0,ae.saveTextArea=function(Q){ae.textArea=Q},ae.handleResize=function(Q){var D=ae.state.resizeStatus,F=ae.props,W=F.autoSize,Y=F.onResize;if(D!==G.NONE)return;typeof Y=="function"&&Y(Q),W&&ae.resizeOnNextFrame()},ae.resizeOnNextFrame=function(){cancelAnimationFrame(ae.nextFrameActionId),ae.nextFrameActionId=requestAnimationFrame(ae.resizeTextarea)},ae.resizeTextarea=function(){var Q=ae.props.autoSize;if(!Q||!ae.textArea)return;var D=Q.minRows,F=Q.maxRows,W=V(ae.textArea,!1,D,F);ae.setState({textareaStyles:W,resizeStatus:G.RESIZING},function(){cancelAnimationFrame(ae.resizeFrameId),ae.resizeFrameId=requestAnimationFrame(function(){ae.setState({resizeStatus:G.RESIZED},function(){ae.resizeFrameId=requestAnimationFrame(function(){ae.setState({resizeStatus:G.NONE}),ae.fixFirefoxAutoScroll()})})})})},ae.renderTextArea=function(){var Q=ae.props,D=Q.prefixCls,F=D===void 0?"rc-textarea":D,W=Q.autoSize,Y=Q.onResize,Z=Q.className,te=Q.disabled,q=ae.state,X=q.textareaStyles,re=q.resizeStatus,me=Object(x.a)(ae.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),ve=B()(F,Z,Object(g.a)({},"".concat(F,"-disabled"),te));"value"in me&&(me.value=me.value||"");var Te=Object(C.a)(Object(C.a)(Object(C.a)({},ae.props.style),X),re===G.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return c.createElement(b,{onResize:ae.handleResize,disabled:!(W||Y)},c.createElement("textarea",Object(I.a)({},me,{className:ve,style:Te,ref:ae.saveTextArea})))},ae.state={textareaStyles:{},resizeStatus:G.NONE},ae}return Object(S.a)(ce,[{key:"componentDidUpdate",value:function(ae){(ae.value!==this.props.value||!H()(ae.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 ae=this.textArea.selectionStart,Q=this.textArea.selectionEnd;this.textArea.setSelectionRange(ae,Q)}}catch(D){}}},{key:"render",value:function(){return this.renderTextArea()}}]),ce}(c.Component),le=ie,ue=function(Ce){Object(L.a)(ce,Ce);var se=Object(T.a)(ce);function ce(he){var ae;Object(h.a)(this,ce),ae=se.call(this,he),ae.resizableTextArea=void 0,ae.focus=function(){ae.resizableTextArea.textArea.focus()},ae.saveTextArea=function(D){ae.resizableTextArea=D},ae.handleChange=function(D){var F=ae.props.onChange;ae.setValue(D.target.value,function(){ae.resizableTextArea.resizeTextarea()}),F&&F(D)},ae.handleKeyDown=function(D){var F=ae.props,W=F.onPressEnter,Y=F.onKeyDown;D.keyCode===13&&W&&W(D),Y&&Y(D)};var Q=typeof he.value=="undefined"||he.value===null?he.defaultValue:he.value;return ae.state={value:Q},ae}return Object(S.a)(ce,[{key:"setValue",value:function(ae,Q){"value"in this.props||this.setState({value:ae},Q)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return c.createElement(le,Object(I.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(ae){return"value"in ae?{value:ae.value}:null}}]),ce}(c.Component),be=ne.default=ue},ZD9Y:function(M,ne,N){"use strict";var I=N("BoS7"),h=N("Sdc0"),S=N("OaEy"),L=N("2fM7"),T=N("q1tI"),c=N.n(T),C=N("lOMy"),g=N.n(C),s=L.a.Option;ne.a=function(a){var r=a.onFontSizeChange,f=a.cmFontSize,p=a.cmCodeMode,m=a.onCodeModeChange,E=a.onTabToSpace,y=a.className,u=y===void 0?"":y,n=a.tabToSpace,o=a.children;return c.a.createElement("div",{className:"tpi-code-setting ".concat(u)},c.a.createElement("h3",null,"\u4EE3\u7801\u683C\u5F0F"),c.a.createElement("section",null,c.a.createElement("div",{className:"file-item"},c.a.createElement("b",null,"\u663E\u793A\u6A21\u5F0F"),c.a.createElement(L.a,{bordered:!1,size:"small",value:p,onChange:m},c.a.createElement(s,{value:"vs"},"\u767D\u8272\u80CC\u666F"),c.a.createElement(s,{value:"vs-dark"},"\u9ED1\u8272\u80CC\u666F"))),c.a.createElement("div",{className:"file-item"},c.a.createElement("b",null,"\u5B57\u4F53\u5927\u5C0F"),c.a.createElement(L.a,{bordered:!1,size:"small",value:f,onChange:r},c.a.createElement(s,{value:12},"12px"),c.a.createElement(s,{value:14},"14px"),c.a.createElement(s,{value:16},"16px"),c.a.createElement(s,{value:18},"18px"),c.a.createElement(s,{value:20},"20px"),c.a.createElement(s,{value:22},"22px"))),c.a.createElement("div",{className:"file-item"},c.a.createElement("b",null,"Tab\u8F6C\u6362"),c.a.createElement(h.a,{checked:n,onChange:E}))),c.a.createElement("h3",null,"\u5FEB\u6377\u952E"),c.a.createElement("section",null,c.a.createElement("div",{className:"file-item"},c.a.createElement("b",null,"\u4FDD\u5B58\u4EE3\u7801"),c.a.createElement("span",null,"Ctrl + S")),c.a.createElement("div",{className:"file-item"},c.a.createElement("b",null,"\u5524\u51FA\u5FEB\u6377\u952E\u5217\u8868"),c.a.createElement("span",null,"F1 / Alt + F1")),c.a.createElement("div",{className:"file-item"},c.a.createElement("b",null,"\u5DE6\u53F3\u7F29\u8FDB"),c.a.createElement("span",null,"Ctrl + ]/[")),c.a.createElement("div",{className:"file-item"},c.a.createElement("b",null,"\u8DF3\u5230\u5339\u914D\u7684\u62EC\u53F7"),c.a.createElement("span",null,"Ctrl + Shift + \\")),c.a.createElement("div",{className:"file-item"},c.a.createElement("b",null,"\u8F6C\u5230\u884C\u9996"),c.a.createElement("span",null,"Home")),c.a.createElement("div",{className:"file-item"},c.a.createElement("b",null,"\u8F6C\u5230\u884C\u5C3E"),c.a.createElement("span",null,"End"))),o)}},Zss7:function(M,ne,N){var I;(function(h){var S=/^\s+/,L=/\s+$/,T=0,c=h.round,C=h.min,g=h.max,s=h.random;function a(D,F){if(D=D||"",F=F||{},D instanceof a)return D;if(!(this instanceof a))return new a(D,F);var W=r(D);this._originalInput=D,this._r=W.r,this._g=W.g,this._b=W.b,this._a=W.a,this._roundA=c(100*this._a)/100,this._format=F.format||W.format,this._gradientType=F.gradientType,this._r<1&&(this._r=c(this._r)),this._g<1&&(this._g=c(this._g)),this._b<1&&(this._b=c(this._b)),this._ok=W.ok,this._tc_id=T++}a.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var D=this.toRgb();return(D.r*299+D.g*587+D.b*114)/1e3},getLuminance:function(){var D=this.toRgb(),F,W,Y,Z,te,q;return F=D.r/255,W=D.g/255,Y=D.b/255,F<=.03928?Z=F/12.92:Z=h.pow((F+.055)/1.055,2.4),W<=.03928?te=W/12.92:te=h.pow((W+.055)/1.055,2.4),Y<=.03928?q=Y/12.92:q=h.pow((Y+.055)/1.055,2.4),.2126*Z+.7152*te+.0722*q},setAlpha:function(D){return this._a=V(D),this._roundA=c(100*this._a)/100,this},toHsv:function(){var D=E(this._r,this._g,this._b);return{h:D.h*360,s:D.s,v:D.v,a:this._a}},toHsvString:function(){var D=E(this._r,this._g,this._b),F=c(D.h*360),W=c(D.s*100),Y=c(D.v*100);return this._a==1?"hsv("+F+", "+W+"%, "+Y+"%)":"hsva("+F+", "+W+"%, "+Y+"%, "+this._roundA+")"},toHsl:function(){var D=p(this._r,this._g,this._b);return{h:D.h*360,s:D.s,l:D.l,a:this._a}},toHslString:function(){var D=p(this._r,this._g,this._b),F=c(D.h*360),W=c(D.s*100),Y=c(D.l*100);return this._a==1?"hsl("+F+", "+W+"%, "+Y+"%)":"hsla("+F+", "+W+"%, "+Y+"%, "+this._roundA+")"},toHex:function(D){return u(this._r,this._g,this._b,D)},toHexString:function(D){return"#"+this.toHex(D)},toHex8:function(D){return n(this._r,this._g,this._b,this._a,D)},toHex8String:function(D){return"#"+this.toHex8(D)},toRgb:function(){return{r:c(this._r),g:c(this._g),b:c(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+c(this._r)+", "+c(this._g)+", "+c(this._b)+")":"rgba("+c(this._r)+", "+c(this._g)+", "+c(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:c(K(this._r,255)*100)+"%",g:c(K(this._g,255)*100)+"%",b:c(K(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+c(K(this._r,255)*100)+"%, "+c(K(this._g,255)*100)+"%, "+c(K(this._b,255)*100)+"%)":"rgba("+c(K(this._r,255)*100)+"%, "+c(K(this._g,255)*100)+"%, "+c(K(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:$[u(this._r,this._g,this._b,!0)]||!1},toFilter:function(D){var F="#"+o(this._r,this._g,this._b,this._a),W=F,Y=this._gradientType?"GradientType = 1, ":"";if(D){var Z=a(D);W="#"+o(Z._r,Z._g,Z._b,Z._a)}return"progid:DXImageTransform.Microsoft.gradient("+Y+"startColorstr="+F+",endColorstr="+W+")"},toString:function(D){var F=!!D;D=D||this._format;var W=!1,Y=this._a<1&&this._a>=0,Z=!F&&Y&&(D==="hex"||D==="hex6"||D==="hex3"||D==="hex4"||D==="hex8"||D==="name");return Z?D==="name"&&this._a===0?this.toName():this.toRgbString():(D==="rgb"&&(W=this.toRgbString()),D==="prgb"&&(W=this.toPercentageRgbString()),(D==="hex"||D==="hex6")&&(W=this.toHexString()),D==="hex3"&&(W=this.toHexString(!0)),D==="hex4"&&(W=this.toHex8String(!0)),D==="hex8"&&(W=this.toHex8String()),D==="name"&&(W=this.toName()),D==="hsl"&&(W=this.toHslString()),D==="hsv"&&(W=this.toHsvString()),W||this.toHexString())},clone:function(){return a(this.toString())},_applyModification:function(D,F){var W=D.apply(null,[this].concat([].slice.call(F)));return this._r=W._r,this._g=W._g,this._b=W._b,this.setAlpha(W._a),this},lighten:function(){return this._applyModification(i,arguments)},brighten:function(){return this._applyModification(R,arguments)},darken:function(){return this._applyModification(k,arguments)},desaturate:function(){return this._applyModification(l,arguments)},saturate:function(){return this._applyModification(w,arguments)},greyscale:function(){return this._applyModification(v,arguments)},spin:function(){return this._applyModification(d,arguments)},_applyCombination:function(D,F){return D.apply(null,[this].concat([].slice.call(F)))},analogous:function(){return this._applyCombination(U,arguments)},complement:function(){return this._applyCombination(b,arguments)},monochromatic:function(){return this._applyCombination(P,arguments)},splitcomplement:function(){return this._applyCombination(B,arguments)},triad:function(){return this._applyCombination(x,arguments)},tetrad:function(){return this._applyCombination(_,arguments)}},a.fromRatio=function(D,F){if(typeof D=="object"){var W={};for(var Y in D)D.hasOwnProperty(Y)&&(Y==="a"?W[Y]=D[Y]:W[Y]=be(D[Y]));D=W}return a(D,F)};function r(D){var F={r:0,g:0,b:0},W=1,Y=null,Z=null,te=null,q=!1,X=!1;return typeof D=="string"&&(D=ae(D)),typeof D=="object"&&(he(D.r)&&he(D.g)&&he(D.b)?(F=f(D.r,D.g,D.b),q=!0,X=String(D.r).substr(-1)==="%"?"prgb":"rgb"):he(D.h)&&he(D.s)&&he(D.v)?(Y=be(D.s),Z=be(D.v),F=y(D.h,Y,Z),q=!0,X="hsv"):he(D.h)&&he(D.s)&&he(D.l)&&(Y=be(D.s),te=be(D.l),F=m(D.h,Y,te),q=!0,X="hsl"),D.hasOwnProperty("a")&&(W=D.a)),W=V(W),{ok:q,format:D.format||X,r:C(255,g(F.r,0)),g:C(255,g(F.g,0)),b:C(255,g(F.b,0)),a:W}}function f(D,F,W){return{r:K(D,255)*255,g:K(F,255)*255,b:K(W,255)*255}}function p(D,F,W){D=K(D,255),F=K(F,255),W=K(W,255);var Y=g(D,F,W),Z=C(D,F,W),te,q,X=(Y+Z)/2;if(Y==Z)te=q=0;else{var re=Y-Z;q=X>.5?re/(2-Y-Z):re/(Y+Z);switch(Y){case D:te=(F-W)/re+(F<W?6:0);break;case F:te=(W-D)/re+2;break;case W:te=(D-F)/re+4;break}te/=6}return{h:te,s:q,l:X}}function m(D,F,W){var Y,Z,te;D=K(D,360),F=K(F,100),W=K(W,100);function q(me,ve,Te){return Te<0&&(Te+=1),Te>1&&(Te-=1),Te<1/6?me+(ve-me)*6*Te:Te<1/2?ve:Te<2/3?me+(ve-me)*(2/3-Te)*6:me}if(F===0)Y=Z=te=W;else{var X=W<.5?W*(1+F):W+F-W*F,re=2*W-X;Y=q(re,X,D+1/3),Z=q(re,X,D),te=q(re,X,D-1/3)}return{r:Y*255,g:Z*255,b:te*255}}function E(D,F,W){D=K(D,255),F=K(F,255),W=K(W,255);var Y=g(D,F,W),Z=C(D,F,W),te,q,X=Y,re=Y-Z;if(q=Y===0?0:re/Y,Y==Z)te=0;else{switch(Y){case D:te=(F-W)/re+(F<W?6:0);break;case F:te=(W-D)/re+2;break;case W:te=(D-F)/re+4;break}te/=6}return{h:te,s:q,v:X}}function y(D,F,W){D=K(D,360)*6,F=K(F,100),W=K(W,100);var Y=h.floor(D),Z=D-Y,te=W*(1-F),q=W*(1-Z*F),X=W*(1-(1-Z)*F),re=Y%6,me=[W,q,te,te,X,W][re],ve=[X,W,W,q,te,te][re],Te=[te,te,X,W,W,q][re];return{r:me*255,g:ve*255,b:Te*255}}function u(D,F,W,Y){var Z=[ue(c(D).toString(16)),ue(c(F).toString(16)),ue(c(W).toString(16))];return Y&&Z[0].charAt(0)==Z[0].charAt(1)&&Z[1].charAt(0)==Z[1].charAt(1)&&Z[2].charAt(0)==Z[2].charAt(1)?Z[0].charAt(0)+Z[1].charAt(0)+Z[2].charAt(0):Z.join("")}function n(D,F,W,Y,Z){var te=[ue(c(D).toString(16)),ue(c(F).toString(16)),ue(c(W).toString(16)),ue(Ce(Y))];return Z&&te[0].charAt(0)==te[0].charAt(1)&&te[1].charAt(0)==te[1].charAt(1)&&te[2].charAt(0)==te[2].charAt(1)&&te[3].charAt(0)==te[3].charAt(1)?te[0].charAt(0)+te[1].charAt(0)+te[2].charAt(0)+te[3].charAt(0):te.join("")}function o(D,F,W,Y){var Z=[ue(Ce(Y)),ue(c(D).toString(16)),ue(c(F).toString(16)),ue(c(W).toString(16))];return Z.join("")}a.equals=function(D,F){return!D||!F?!1:a(D).toRgbString()==a(F).toRgbString()},a.random=function(){return a.fromRatio({r:s(),g:s(),b:s()})};function l(D,F){F=F===0?0:F||10;var W=a(D).toHsl();return W.s-=F/100,W.s=H(W.s),a(W)}function w(D,F){F=F===0?0:F||10;var W=a(D).toHsl();return W.s+=F/100,W.s=H(W.s),a(W)}function v(D){return a(D).desaturate(100)}function i(D,F){F=F===0?0:F||10;var W=a(D).toHsl();return W.l+=F/100,W.l=H(W.l),a(W)}function R(D,F){F=F===0?0:F||10;var W=a(D).toRgb();return W.r=g(0,C(255,W.r-c(255*-(F/100)))),W.g=g(0,C(255,W.g-c(255*-(F/100)))),W.b=g(0,C(255,W.b-c(255*-(F/100)))),a(W)}function k(D,F){F=F===0?0:F||10;var W=a(D).toHsl();return W.l-=F/100,W.l=H(W.l),a(W)}function d(D,F){var W=a(D).toHsl(),Y=(W.h+F)%360;return W.h=Y<0?360+Y:Y,a(W)}function b(D){var F=a(D).toHsl();return F.h=(F.h+180)%360,a(F)}function x(D){var F=a(D).toHsl(),W=F.h;return[a(D),a({h:(W+120)%360,s:F.s,l:F.l}),a({h:(W+240)%360,s:F.s,l:F.l})]}function _(D){var F=a(D).toHsl(),W=F.h;return[a(D),a({h:(W+90)%360,s:F.s,l:F.l}),a({h:(W+180)%360,s:F.s,l:F.l}),a({h:(W+270)%360,s:F.s,l:F.l})]}function B(D){var F=a(D).toHsl(),W=F.h;return[a(D),a({h:(W+72)%360,s:F.s,l:F.l}),a({h:(W+216)%360,s:F.s,l:F.l})]}function U(D,F,W){F=F||6,W=W||30;var Y=a(D).toHsl(),Z=360/W,te=[a(D)];for(Y.h=(Y.h-(Z*F>>1)+720)%360;--F;)Y.h=(Y.h+Z)%360,te.push(a(Y));return te}function P(D,F){F=F||6;for(var W=a(D).toHsv(),Y=W.h,Z=W.s,te=W.v,q=[],X=1/F;F--;)q.push(a({h:Y,s:Z,v:te})),te=(te+X)%1;return q}a.mix=function(D,F,W){W=W===0?0:W||50;var Y=a(D).toRgb(),Z=a(F).toRgb(),te=W/100,q={r:(Z.r-Y.r)*te+Y.r,g:(Z.g-Y.g)*te+Y.g,b:(Z.b-Y.b)*te+Y.b,a:(Z.a-Y.a)*te+Y.a};return a(q)},a.readability=function(D,F){var W=a(D),Y=a(F);return(h.max(W.getLuminance(),Y.getLuminance())+.05)/(h.min(W.getLuminance(),Y.getLuminance())+.05)},a.isReadable=function(D,F,W){var Y=a.readability(D,F),Z,te;te=!1,Z=Q(W);switch(Z.level+Z.size){case"AAsmall":case"AAAlarge":te=Y>=4.5;break;case"AAlarge":te=Y>=3;break;case"AAAsmall":te=Y>=7;break}return te},a.mostReadable=function(D,F,W){var Y=null,Z=0,te,q,X,re;W=W||{},q=W.includeFallbackColors,X=W.level,re=W.size;for(var me=0;me<F.length;me++)te=a.readability(D,F[me]),te>Z&&(Z=te,Y=a(F[me]));return a.isReadable(D,Y,{level:X,size:re})||!q?Y:(W.includeFallbackColors=!1,a.mostReadable(D,["#fff","#000"],W))};var J=a.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},$=a.hexNames=z(J);function z(D){var F={};for(var W in D)D.hasOwnProperty(W)&&(F[D[W]]=W);return F}function V(D){return D=parseFloat(D),(isNaN(D)||D<0||D>1)&&(D=1),D}function K(D,F){ie(D)&&(D="100%");var W=le(D);return D=C(F,g(0,parseFloat(D))),W&&(D=parseInt(D*F,10)/100),h.abs(D-F)<1e-6?1:D%F/parseFloat(F)}function H(D){return C(1,g(0,D))}function G(D){return parseInt(D,16)}function ie(D){return typeof D=="string"&&D.indexOf(".")!=-1&&parseFloat(D)===1}function le(D){return typeof D=="string"&&D.indexOf("%")!=-1}function ue(D){return D.length==1?"0"+D:""+D}function be(D){return D<=1&&(D=D*100+"%"),D}function Ce(D){return h.round(parseFloat(D)*255).toString(16)}function se(D){return G(D)/255}var ce=function(){var D="[-\\+]?\\d+%?",F="[-\\+]?\\d*\\.\\d+%?",W="(?:"+F+")|(?:"+D+")",Y="[\\s|\\(]+("+W+")[,|\\s]+("+W+")[,|\\s]+("+W+")\\s*\\)?",Z="[\\s|\\(]+("+W+")[,|\\s]+("+W+")[,|\\s]+("+W+")[,|\\s]+("+W+")\\s*\\)?";return{CSS_UNIT:new RegExp(W),rgb:new RegExp("rgb"+Y),rgba:new RegExp("rgba"+Z),hsl:new RegExp("hsl"+Y),hsla:new RegExp("hsla"+Z),hsv:new RegExp("hsv"+Y),hsva:new RegExp("hsva"+Z),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function he(D){return!!ce.CSS_UNIT.exec(D)}function ae(D){D=D.replace(S,"").replace(L,"").toLowerCase();var F=!1;if(J[D])D=J[D],F=!0;else if(D=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var W;return(W=ce.rgb.exec(D))?{r:W[1],g:W[2],b:W[3]}:(W=ce.rgba.exec(D))?{r:W[1],g:W[2],b:W[3],a:W[4]}:(W=ce.hsl.exec(D))?{h:W[1],s:W[2],l:W[3]}:(W=ce.hsla.exec(D))?{h:W[1],s:W[2],l:W[3],a:W[4]}:(W=ce.hsv.exec(D))?{h:W[1],s:W[2],v:W[3]}:(W=ce.hsva.exec(D))?{h:W[1],s:W[2],v:W[3],a:W[4]}:(W=ce.hex8.exec(D))?{r:G(W[1]),g:G(W[2]),b:G(W[3]),a:se(W[4]),format:F?"name":"hex8"}:(W=ce.hex6.exec(D))?{r:G(W[1]),g:G(W[2]),b:G(W[3]),format:F?"name":"hex"}:(W=ce.hex4.exec(D))?{r:G(W[1]+""+W[1]),g:G(W[2]+""+W[2]),b:G(W[3]+""+W[3]),a:se(W[4]+""+W[4]),format:F?"name":"hex8"}:(W=ce.hex3.exec(D))?{r:G(W[1]+""+W[1]),g:G(W[2]+""+W[2]),b:G(W[3]+""+W[3]),format:F?"name":"hex"}:!1}function Q(D){var F,W;return D=D||{level:"AA",size:"small"},F=(D.level||"AA").toUpperCase(),W=(D.size||"small").toLowerCase(),F!=="AA"&&F!=="AAA"&&(F="AA"),W!=="small"&&W!=="large"&&(W="small"),{level:F,size:W}}M.exports?M.exports=a:!(I=function(){return a}.call(ne,N,ne,M),I!==void 0&&(M.exports=I))})(Math)},b8wu:function(M,ne,N){M.exports={"code-panel-container":"code-panel-container___pVbpU","action-oj-bar":"action-oj-bar___1NMjh",active:"active___2NiTj"}},bCnd:function(M,ne,N){"use strict";N.d(ne,"b",function(){return L}),N.d(ne,"a",function(){return T});var I=N("je13"),h=N.n(I),S=!1;function L(c,C){var g=h.a.get("__ec");g||(g={}),g[c]=C,h.a.set("__ec",g)}function T(c,C){var g=h.a.get("__ec");return g?g[c]===void 0?C:g[c]:C}},bQjk:function(M,ne,N){(function(I,h,S){M.exports=ne=h(N("Ib8C"),N("OLod"))})(this,function(I){return function(h){var S=I,L=S.lib,T=L.CipherParams,c=S.enc,C=c.Hex,g=S.format,s=g.Hex={stringify:function(a){return a.ciphertext.toString(C)},parse:function(a){var r=C.parse(a);return T.create({ciphertext:r})}}}(),I.format.Hex})},bT9E:function(M,ne,N){"use strict";N.d(ne,"a",function(){return h});var I=N("VTBJ");function h(S,L){var T=Object(I.a)({},S);return Array.isArray(L)&&L.forEach(function(c){delete T[c]}),T}},c5Ni:function(M,ne,N){},cDPC:function(M,ne,N){"use strict";var I=N("tJVT"),h=N("q1tI"),S=N.n(h),L=N("i3hx"),T=N.n(L);ne.a=function(c){var C=c.defaultX,g=C===void 0?"40%":C,s=c.leftChild,a=c.rightChild,r=c.className,f=c.hideResize,p=f===void 0?!1:f,m=Object(h.useState)(g),E=Object(I.a)(m,2),y=E[0],u=E[1],n=Object(h.useRef)();function o(){n.current=!0}Object(h.useEffect)(function(){function v(R){n.current&&u(R.pageX)}function i(){n.current=!1}return window.addEventListener("mousemove",v),window.addEventListener("mouseup",i),function(){window.removeEventListener("mousemove",v),window.removeEventListener("mouseup",i)}},[]);var l=typeof y=="number"&&y!==.01?"".concat(y,"px"):g,w="calc(100% - ".concat(p?"0px":"4px"," - ").concat(l,")");return S.a.createElement("div",{className:"split-panel-container ".concat(r)},S.a.createElement("section",{style:{width:l,display:y===.01?"none":""}},s),S.a.createElement("section",{className:"resize-x-bar",onMouseDown:o},S.a.createElement("a",{className:"btn-resize"},S.a.createElement("svg",{width:"16",height:"13",viewBox:"0 0 16 13"},S.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"})))),S.a.createElement("section",{style:{width:w}},a))}},cv67:function(M,ne,N){(function(I,h){M.exports=ne=h(N("Ib8C"))})(this,function(I){return function(h){var S=I,L=S.lib,T=L.WordArray,c=L.Hasher,C=S.algo,g=[];(function(){for(var m=0;m<64;m++)g[m]=h.abs(h.sin(m+1))*4294967296|0})();var s=C.MD5=c.extend({_doReset:function(){this._hash=new T.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(m,E){for(var y=0;y<16;y++){var u=E+y,n=m[u];m[u]=(n<<8|n>>>24)&16711935|(n<<24|n>>>8)&4278255360}var o=this._hash.words,l=m[E+0],w=m[E+1],v=m[E+2],i=m[E+3],R=m[E+4],k=m[E+5],d=m[E+6],b=m[E+7],x=m[E+8],_=m[E+9],B=m[E+10],U=m[E+11],P=m[E+12],J=m[E+13],$=m[E+14],z=m[E+15],V=o[0],K=o[1],H=o[2],G=o[3];V=a(V,K,H,G,l,7,g[0]),G=a(G,V,K,H,w,12,g[1]),H=a(H,G,V,K,v,17,g[2]),K=a(K,H,G,V,i,22,g[3]),V=a(V,K,H,G,R,7,g[4]),G=a(G,V,K,H,k,12,g[5]),H=a(H,G,V,K,d,17,g[6]),K=a(K,H,G,V,b,22,g[7]),V=a(V,K,H,G,x,7,g[8]),G=a(G,V,K,H,_,12,g[9]),H=a(H,G,V,K,B,17,g[10]),K=a(K,H,G,V,U,22,g[11]),V=a(V,K,H,G,P,7,g[12]),G=a(G,V,K,H,J,12,g[13]),H=a(H,G,V,K,$,17,g[14]),K=a(K,H,G,V,z,22,g[15]),V=r(V,K,H,G,w,5,g[16]),G=r(G,V,K,H,d,9,g[17]),H=r(H,G,V,K,U,14,g[18]),K=r(K,H,G,V,l,20,g[19]),V=r(V,K,H,G,k,5,g[20]),G=r(G,V,K,H,B,9,g[21]),H=r(H,G,V,K,z,14,g[22]),K=r(K,H,G,V,R,20,g[23]),V=r(V,K,H,G,_,5,g[24]),G=r(G,V,K,H,$,9,g[25]),H=r(H,G,V,K,i,14,g[26]),K=r(K,H,G,V,x,20,g[27]),V=r(V,K,H,G,J,5,g[28]),G=r(G,V,K,H,v,9,g[29]),H=r(H,G,V,K,b,14,g[30]),K=r(K,H,G,V,P,20,g[31]),V=f(V,K,H,G,k,4,g[32]),G=f(G,V,K,H,x,11,g[33]),H=f(H,G,V,K,U,16,g[34]),K=f(K,H,G,V,$,23,g[35]),V=f(V,K,H,G,w,4,g[36]),G=f(G,V,K,H,R,11,g[37]),H=f(H,G,V,K,b,16,g[38]),K=f(K,H,G,V,B,23,g[39]),V=f(V,K,H,G,J,4,g[40]),G=f(G,V,K,H,l,11,g[41]),H=f(H,G,V,K,i,16,g[42]),K=f(K,H,G,V,d,23,g[43]),V=f(V,K,H,G,_,4,g[44]),G=f(G,V,K,H,P,11,g[45]),H=f(H,G,V,K,z,16,g[46]),K=f(K,H,G,V,v,23,g[47]),V=p(V,K,H,G,l,6,g[48]),G=p(G,V,K,H,b,10,g[49]),H=p(H,G,V,K,$,15,g[50]),K=p(K,H,G,V,k,21,g[51]),V=p(V,K,H,G,P,6,g[52]),G=p(G,V,K,H,i,10,g[53]),H=p(H,G,V,K,B,15,g[54]),K=p(K,H,G,V,w,21,g[55]),V=p(V,K,H,G,x,6,g[56]),G=p(G,V,K,H,z,10,g[57]),H=p(H,G,V,K,d,15,g[58]),K=p(K,H,G,V,J,21,g[59]),V=p(V,K,H,G,R,6,g[60]),G=p(G,V,K,H,U,10,g[61]),H=p(H,G,V,K,v,15,g[62]),K=p(K,H,G,V,_,21,g[63]),o[0]=o[0]+V|0,o[1]=o[1]+K|0,o[2]=o[2]+H|0,o[3]=o[3]+G|0},_doFinalize:function(){var m=this._data,E=m.words,y=this._nDataBytes*8,u=m.sigBytes*8;E[u>>>5]|=128<<24-u%32;var n=h.floor(y/4294967296),o=y;E[(u+64>>>9<<4)+15]=(n<<8|n>>>24)&16711935|(n<<24|n>>>8)&4278255360,E[(u+64>>>9<<4)+14]=(o<<8|o>>>24)&16711935|(o<<24|o>>>8)&4278255360,m.sigBytes=(E.length+1)*4,this._process();for(var l=this._hash,w=l.words,v=0;v<4;v++){var i=w[v];w[v]=(i<<8|i>>>24)&16711935|(i<<24|i>>>8)&4278255360}return l},clone:function(){var m=c.clone.call(this);return m._hash=this._hash.clone(),m}});function a(m,E,y,u,n,o,l){var w=m+(E&y|~E&u)+n+l;return(w<<o|w>>>32-o)+E}function r(m,E,y,u,n,o,l){var w=m+(E&u|y&~u)+n+l;return(w<<o|w>>>32-o)+E}function f(m,E,y,u,n,o,l){var w=m+(E^y^u)+n+l;return(w<<o|w>>>32-o)+E}function p(m,E,y,u,n,o,l){var w=m+(y^(E|~u))+n+l;return(w<<o|w>>>32-o)+E}S.MD5=c._createHelper(s),S.HmacMD5=c._createHmacHelper(s)}(Math),I.MD5})},dejd:function(M,ne,N){},dmUQ:function(M,ne,N){"use strict";var I=N("Ff2n"),h=N("rePB"),S=N("1OyB"),L=N("vuIU"),T=N("Ji7U"),c=N("md7G"),C=N("foSv"),g=N("q1tI"),s=N.n(g),a=N("TSYQ"),r=N.n(a),f=N("4IlW");function p(x,_){var B=Object.keys(x);if(Object.getOwnPropertySymbols){var U=Object.getOwnPropertySymbols(x);_&&(U=U.filter(function(P){return Object.getOwnPropertyDescriptor(x,P).enumerable})),B.push.apply(B,U)}return B}function m(x){for(var _=1;_<arguments.length;_++){var B=arguments[_]!=null?arguments[_]:{};_%2?p(Object(B),!0).forEach(function(U){Object(h.a)(x,U,B[U])}):Object.getOwnPropertyDescriptors?Object.defineProperties(x,Object.getOwnPropertyDescriptors(B)):p(Object(B)).forEach(function(U){Object.defineProperty(x,U,Object.getOwnPropertyDescriptor(B,U))})}return x}function E(x){var _=y();return function(){var U=Object(C.a)(x),P;if(_){var J=Object(C.a)(this).constructor;P=Reflect.construct(U,arguments,J)}else P=U.apply(this,arguments);return Object(c.a)(this,P)}}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(x){return!1}}function u(){}function n(x){x.preventDefault()}var o=function(_){return _.replace(/[^\w.-]+/g,"")},l=200,w=600,v=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,i=function(_){return _!=null},R=function(_,B){return B===_||typeof B=="number"&&typeof _=="number"&&isNaN(B)&&isNaN(_)},k=function(x){Object(T.a)(B,x);var _=E(B);function B(U){var P;Object(S.a)(this,B),P=_.call(this,U),P.onKeyDown=function(z){var V=P.props,K=V.onKeyDown,H=V.onPressEnter;if(z.keyCode===f.a.UP){var G=P.getRatio(z);P.up(z,G,null),P.stop()}else if(z.keyCode===f.a.DOWN){var ie=P.getRatio(z);P.down(z,ie,null),P.stop()}else z.keyCode===f.a.ENTER&&H&&H(z);if(P.recordCursorPosition(),P.lastKeyCode=z.keyCode,K){for(var le=arguments.length,ue=new Array(le>1?le-1:0),be=1;be<le;be++)ue[be-1]=arguments[be];K.apply(void 0,[z].concat(ue))}},P.onKeyUp=function(z){var V=P.props.onKeyUp;if(P.stop(),P.recordCursorPosition(),V){for(var K=arguments.length,H=new Array(K>1?K-1:0),G=1;G<K;G++)H[G-1]=arguments[G];V.apply(void 0,[z].concat(H))}},P.onChange=function(z){var V=P.props.onChange;P.state.focused&&(P.inputting=!0),P.rawInput=P.props.parser(P.getValueFromEvent(z)),P.setState({inputValue:P.rawInput}),V(P.toNumber(P.rawInput))},P.onMouseUp=function(){var z=P.props.onMouseUp;P.recordCursorPosition(),z&&z.apply(void 0,arguments)},P.onFocus=function(){var z;P.setState({focused:!0}),(z=P.props).onFocus.apply(z,arguments)},P.onBlur=function(){var z=P.props.onBlur;P.inputting=!1,P.setState({focused:!1});var V=P.getCurrentValidValue(P.state.inputValue),K=P.setValue(V,u);if(z){var H=P.input.value,G=P.getInputDisplayValue({focus:!1,value:K});P.input.value=G&&Number(G),z.apply(void 0,arguments),P.input.value=H}},P.getRatio=function(z){var V=1;return z.metaKey||z.ctrlKey?V=.1:z.shiftKey&&(V=10),V},P.getFullNum=function(z){return isNaN(z)?z:/e/i.test(String(z))?Number(z).toFixed(18).replace(/\.?0+$/,""):z},P.getPrecision=function(z){if(i(P.props.precision))return P.props.precision;var V=String(z);if(V.indexOf("e-")>=0)return parseInt(V.slice(V.indexOf("e-")+2),10);var K=0;return V.indexOf(".")>=0&&(K=V.length-V.indexOf(".")-1),K},P.getInputDisplayValue=function(z){var V=z||P.state,K=V.focused,H=V.inputValue,G=V.value,ie;K?ie=H:ie=P.toPrecisionAsStep(G),ie==null&&(ie="");var le=P.formatWrapper(ie);return i(P.props.decimalSeparator)&&(le=le.toString().replace(".",P.props.decimalSeparator)),le},P.recordCursorPosition=function(){try{P.cursorStart=P.input.selectionStart,P.cursorEnd=P.input.selectionEnd,P.currentValue=P.input.value,P.cursorBefore=P.input.value.substring(0,P.cursorStart),P.cursorAfter=P.input.value.substring(P.cursorEnd)}catch(z){}},P.restoreByAfter=function(z){if(z===void 0)return!1;var V=P.input.value,K=V.lastIndexOf(z);if(K===-1)return!1;var H=P.cursorBefore.length;return P.lastKeyCode===f.a.DELETE&&P.cursorBefore.charAt(H-1)===z[0]?(P.fixCaret(H,H),!0):K+z.length===V.length?(P.fixCaret(K,K),!0):!1},P.partRestoreByAfter=function(z){return z===void 0?!1:Array.prototype.some.call(z,function(V,K){var H=z.substring(K);return P.restoreByAfter(H)})},P.isNotCompleteNumber=function(z){return isNaN(z)||z===""||z===null||z&&z.toString().indexOf(".")===z.toString().length-1},P.stop=function(){P.autoStepTimer&&clearTimeout(P.autoStepTimer)},P.down=function(z,V,K){P.pressingUpOrDown=!0,P.step("down",z,V,K)},P.up=function(z,V,K){P.pressingUpOrDown=!0,P.step("up",z,V,K)},P.saveInput=function(z){P.input=z};var J=U.value;J===void 0&&(J=U.defaultValue),P.state={focused:U.autoFocus};var $=P.getValidValue(P.toNumber(J));return P.state=m(m({},P.state),{},{inputValue:P.toPrecisionAsStep($),value:$}),P}return Object(L.a)(B,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(P){var J=this.props,$=J.value,z=J.onChange,V=J.max,K=J.min,H=this.state.focused;if(P){if(!R(P.value,$)||!R(P.max,V)||!R(P.min,K)){var G=H?$:this.getValidValue($),ie;this.pressingUpOrDown?ie=G:this.inputting?ie=this.rawInput:ie=this.toPrecisionAsStep(G),this.setState({value:G,inputValue:ie})}var le="value"in this.props?$:this.state.value;"max"in this.props&&P.max!==V&&typeof le=="number"&&le>V&&z&&z(V),"min"in this.props&&P.min!==K&&typeof le=="number"&&le<K&&z&&z(K)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var ue=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===f.a.BACKSPACE?ue=this.cursorStart-1:this.lastKeyCode===f.a.DELETE&&(ue=this.cursorStart):ue=this.input.value.length,this.fixCaret(ue,ue)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case f.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case f.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(be){}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(P){var J=P;return J===""?J="":this.isNotCompleteNumber(parseFloat(J))?J=this.state.value:J=this.getValidValue(J),this.toNumber(J)}},{key:"getValueFromEvent",value:function(P){var J=P.target.value.trim().replace(/。/g,".");return i(this.props.decimalSeparator)&&(J=J.replace(this.props.decimalSeparator,".")),J}},{key:"getValidValue",value:function(P){var J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,$=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,z=parseFloat(P);return isNaN(z)?P:(z<J&&(z=J),z>$&&(z=$),z)}},{key:"setValue",value:function(P,J){var $=this.props.precision,z=this.isNotCompleteNumber(parseFloat(P))?null:parseFloat(P),V=this.state.value,K=V===void 0?null:V,H=this.state.inputValue,G=H===void 0?null:H,ie=typeof z=="number"?z.toFixed($):"".concat(z),le=z!==K||ie!=="".concat(G);return"value"in this.props?(G=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:G},J)):this.setState({value:z,inputValue:this.toPrecisionAsStep(P)},J),le&&this.props.onChange(z),z}},{key:"getMaxPrecision",value:function(P){var J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,$=this.props,z=$.precision,V=$.step;if(i(z))return z;var K=this.getPrecision(J),H=this.getPrecision(V),G=this.getPrecision(P);return P?Math.max(G,K+H):K+H}},{key:"getPrecisionFactor",value:function(P){var J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,$=this.getMaxPrecision(P,J);return Math.pow(10,$)}},{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(P){return this.props.formatter?this.props.formatter(P):P}},{key:"toPrecisionAsStep",value:function(P){if(this.isNotCompleteNumber(P)||P==="")return P;var J=Math.abs(this.getMaxPrecision(P));return isNaN(J)?P.toString():Number(P).toFixed(J)}},{key:"toNumber",value:function(P){var J=this.props.precision,$=this.state.focused,z=P&&P.length>16&&$;return this.isNotCompleteNumber(P)||z?P:i(J)?Math.round(P*Math.pow(10,J))/Math.pow(10,J):Number(P)}},{key:"upStep",value:function(P,J){var $=this.props.step,z=this.getPrecisionFactor(P,J),V=Math.abs(this.getMaxPrecision(P,J)),K=((z*P+z*$*J)/z).toFixed(V);return this.toNumber(K)}},{key:"downStep",value:function(P,J){var $=this.props.step,z=this.getPrecisionFactor(P,J),V=Math.abs(this.getMaxPrecision(P,J)),K=((z*P-z*$*J)/z).toFixed(V);return this.toNumber(K)}},{key:"step",value:function(P,J){var $=this,z=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,V=arguments.length>3?arguments[3]:void 0;this.stop(),J&&(J.persist(),J.preventDefault());var K=this.props;if(K.disabled)return;var H=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(H))return;var G=this["".concat(P,"Step")](H,z),ie=G>K.max||G<K.min;if(G>K.max?G=K.max:G<K.min&&(G=K.min),this.setValue(G,null),this.setState({focused:!0},function(){$.pressingUpOrDown=!1}),ie)return;this.autoStepTimer=setTimeout(function(){$[P](J,z,!0)},V?l:w)}},{key:"fixCaret",value:function(P,J){if(P===void 0||J===void 0||!this.input||!this.input.value)return;try{var $=this.input.selectionStart,z=this.input.selectionEnd;(P!==$||J!==z)&&this.input.setSelectionRange(P,J)}catch(V){}}},{key:"render",value:function(){var P,J=this.props,$=J.prefixCls,z=J.disabled,V=J.readOnly,K=J.useTouch,H=J.autoComplete,G=J.upHandler,ie=J.downHandler,le=J.className,ue=J.max,be=J.min,Ce=J.style,se=J.title,ce=J.onMouseEnter,he=J.onMouseLeave,ae=J.onMouseOver,Q=J.onMouseOut,D=J.required,F=J.onClick,W=J.tabIndex,Y=J.type,Z=J.placeholder,te=J.id,q=J.inputMode,X=J.pattern,re=J.step,me=J.maxLength,ve=J.autoFocus,Te=J.name,Re=J.onPaste,Ie=J.onInput,je=Object(I.a)(J,["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"]),Ne=this.state,We=Ne.value,Be=Ne.focused,He=r()($,(P={},Object(h.a)(P,le,!!le),Object(h.a)(P,"".concat($,"-disabled"),z),Object(h.a)(P,"".concat($,"-focused"),Be),P)),De={};Object.keys(je).forEach(function(Oe){(Oe.substr(0,5)==="data-"||Oe.substr(0,5)==="aria-"||Oe==="role")&&(De[Oe]=je[Oe])});var Xe=!V&&!z,$e=this.getInputDisplayValue(null),we=(We||We===0)&&(isNaN(We)||Number(We)>=ue),fe=(We||We===0)&&(isNaN(We)||Number(We)<=be),pe=we||z||V,ye=fe||z||V,_e=r()("".concat($,"-handler"),"".concat($,"-handler-up"),Object(h.a)({},"".concat($,"-handler-up-disabled"),pe)),xe=r()("".concat($,"-handler"),"".concat($,"-handler-down"),Object(h.a)({},"".concat($,"-handler-down-disabled"),ye)),Se=K?{onTouchStart:pe?u:this.up,onTouchEnd:this.stop}:{onMouseDown:pe?u:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},Ae=K?{onTouchStart:ye?u:this.down,onTouchEnd:this.stop}:{onMouseDown:ye?u:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return s.a.createElement("div",{className:He,style:Ce,title:se,onMouseEnter:ce,onMouseLeave:he,onMouseOver:ae,onMouseOut:Q,onFocus:function(){return null},onBlur:function(){return null}},s.a.createElement("div",{className:"".concat($,"-handler-wrap")},s.a.createElement("span",Object.assign({unselectable:"on"},Se,{role:"button","aria-label":"Increase Value","aria-disabled":pe,className:_e}),G||s.a.createElement("span",{unselectable:"on",className:"".concat($,"-handler-up-inner"),onClick:n})),s.a.createElement("span",Object.assign({unselectable:"on"},Ae,{role:"button","aria-label":"Decrease Value","aria-disabled":ye,className:xe}),ie||s.a.createElement("span",{unselectable:"on",className:"".concat($,"-handler-down-inner"),onClick:n}))),s.a.createElement("div",{className:"".concat($,"-input-wrap")},s.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":be,"aria-valuemax":ue,"aria-valuenow":We,required:D,type:Y,placeholder:Z,onPaste:Re,onClick:F,onMouseUp:this.onMouseUp,className:"".concat($,"-input"),tabIndex:W,autoComplete:H,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:Xe?this.onKeyDown:u,onKeyUp:Xe?this.onKeyUp:u,autoFocus:ve,maxLength:me,readOnly:V,disabled:z,max:ue,min:be,step:re,name:Te,title:se,id:te,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum($e),pattern:X,inputMode:q,onInput:Ie},De))))}}]),B}(s.a.Component);k.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:v,min:-v,step:1,style:{},onChange:u,onKeyDown:u,onPressEnter:u,onFocus:u,onBlur:u,parser:o,required:!1,autoComplete:"off"};var d=k,b=ne.a=d},e7zE:function(M,ne,N){(function(I,h,S){M.exports=ne=h(N("Ib8C"),N("3y9D"),N("WYAk"))})(this,function(I){return function(){var h=I,S=h.lib,L=S.Base,T=S.WordArray,c=h.algo,C=c.SHA1,g=c.HMAC,s=c.PBKDF2=L.extend({cfg:L.extend({keySize:128/32,hasher:C,iterations:1}),init:function(a){this.cfg=this.cfg.extend(a)},compute:function(a,r){for(var f=this.cfg,p=g.create(f.hasher,a),m=T.create(),E=T.create([1]),y=m.words,u=E.words,n=f.keySize,o=f.iterations;y.length<n;){var l=p.update(r).finalize(E);p.reset();for(var w=l.words,v=w.length,i=l,R=1;R<o;R++){i=p.finalize(i),p.reset();for(var k=i.words,d=0;d<v;d++)w[d]^=k[d]}m.concat(l),u[0]++}return m.sigBytes=n*4,m}});h.PBKDF2=function(a,r,f){return s.create(f).compute(a,r)}}(),I.PBKDF2})},fAei:function(M,ne,N){"use strict";N.d(ne,"a",function(){return l.a});var I=N("rePB"),h=N("VTBJ"),S=N("KQm4"),L=N("1OyB"),T=N("vuIU"),c=N("Ji7U"),C=N("LK+K"),g=N("q1tI"),s=N("4IlW"),a=N("Kwbf"),r=N("TSYQ"),f=N.n(r),p=N("sboe"),m=N("OZM5"),E=N("815F"),y=N("ODXe"),u=N("Ff2n"),n=N("+nKL"),o=N("8XRh"),l=N("WaYH"),w=function(be,Ce){var se=be.className,ce=be.style,he=be.motion,ae=be.motionNodes,Q=be.motionType,D=be.onMotionStart,F=be.onMotionEnd,W=be.active,Y=be.treeNodeRequiredProps,Z=Object(u.a)(be,["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"]),te=g.useState(!0),q=Object(y.a)(te,2),X=q[0],re=q[1],me=g.useContext(p.a),ve=me.prefixCls,Te=g.useRef(!1),Re=function(){Te.current||F(),Te.current=!0};return Object(g.useEffect)(function(){ae&&Q==="hide"&&X&&re(!1)},[ae]),Object(g.useEffect)(function(){return ae&&D(),function(){ae&&Re()}},[]),ae?g.createElement(o.default,Object.assign({ref:Ce,visible:X},he,{motionAppear:Q==="show",onAppearEnd:Re,onLeaveEnd:Re}),function(Ie,je){var Ne=Ie.className,We=Ie.style;return g.createElement("div",{ref:je,className:f()("".concat(ve,"-treenode-motion"),Ne),style:We},ae.map(function(Be){var He=Be.data,De=He.key,Xe=Object(u.a)(He,["key"]),$e=Be.isStart,we=Be.isEnd;delete Xe.children;var fe=Object(E.f)(De,Y);return g.createElement(l.a,Object.assign({},Xe,fe,{active:W,data:Be.data,key:De,isStart:$e,isEnd:we}))}))}):g.createElement(l.a,Object.assign({domRef:Ce,className:se,style:ce},Z,{active:W}))};w.displayName="MotionTreeNode";var v=g.forwardRef(w),i=v;function R(){var ue=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],be=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],Ce=ue.length,se=be.length;if(Math.abs(Ce-se)!==1)return{add:!1,key:null};function ce(he,ae){var Q=new Map;he.forEach(function(F){Q.set(F,!0)});var D=ae.filter(function(F){return!Q.has(F)});return D.length===1?D[0]:null}return Ce<se?{add:!0,key:ce(ue,be)}:{add:!1,key:ce(be,ue)}}function k(ue,be,Ce){var se=ue.findIndex(function(Q){var D=Q.data;return D.key===Ce}),ce=ue[se+1],he=be.findIndex(function(Q){var D=Q.data;return D.key===Ce});if(ce){var ae=be.findIndex(function(Q){var D=Q.data;return D.key===ce.data.key});return be.slice(he+1,ae)}return be.slice(he+1)}var d={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},b=function(){},x="RC_TREE_MOTION_".concat(Math.random()),_={key:x},B={key:x,level:0,index:0,pos:"0",node:_},U={parent:null,children:[],pos:B.pos,data:_,isStart:[],isEnd:[]};function P(ue,be,Ce,se){return be===!1||!Ce?ue:ue.slice(0,Math.ceil(Ce/se)+1)}function J(ue){var be=ue.data.key,Ce=ue.pos;return Object(E.e)(be,Ce)}function $(ue){for(var be=String(ue.data.key),Ce=ue;Ce.parent;)Ce=Ce.parent,be="".concat(Ce.data.key," > ").concat(be);return be}var z=function(be,Ce){var se=be.prefixCls,ce=be.data,he=be.selectable,ae=be.checkable,Q=be.expandedKeys,D=be.selectedKeys,F=be.checkedKeys,W=be.loadedKeys,Y=be.loadingKeys,Z=be.halfCheckedKeys,te=be.keyEntities,q=be.disabled,X=be.dragging,re=be.dragOverNodeKey,me=be.dropPosition,ve=be.motion,Te=be.height,Re=be.itemHeight,Ie=be.virtual,je=be.focusable,Ne=be.activeItem,We=be.focused,Be=be.tabIndex,He=be.onKeyDown,De=be.onFocus,Xe=be.onBlur,$e=be.onActiveChange,we=be.onListChangeStart,fe=be.onListChangeEnd,pe=Object(u.a)(be,["prefixCls","data","selectable","checkable","expandedKeys","selectedKeys","checkedKeys","loadedKeys","loadingKeys","halfCheckedKeys","keyEntities","disabled","dragging","dragOverNodeKey","dropPosition","motion","height","itemHeight","virtual","focusable","activeItem","focused","tabIndex","onKeyDown","onFocus","onBlur","onActiveChange","onListChangeStart","onListChangeEnd"]),ye=g.useRef(null);g.useImperativeHandle(Ce,function(){return{scrollTo:function(yt){ye.current.scrollTo(yt)}}});var _e=g.useState(Q),xe=Object(y.a)(_e,2),Se=xe[0],Ae=xe[1],Oe=g.useState(ce),Le=Object(y.a)(Oe,2),Me=Le[0],Ke=Le[1],Qe=g.useState(ce),Ye=Object(y.a)(Qe,2),nt=Ye[0],pt=Ye[1],st=g.useState([]),tt=Object(y.a)(st,2),Pt=tt[0],wt=tt[1],Vt=g.useState(null),Bt=Object(y.a)(Vt,2),gt=Bt[0],xt=Bt[1];function rr(){Ke(ce),pt(ce),wt([]),xt(null),fe()}g.useEffect(function(){Ae(Q);var lt=R(Se,Q);if(lt.key!==null)if(lt.add){var yt=Me.findIndex(function(ft){var zt=ft.data.key;return zt===lt.key}),It=P(k(Me,ce,lt.key),Ie,Te,Re),Wt=Me.slice();Wt.splice(yt+1,0,U),pt(Wt),wt(It),xt("show")}else{var Ot=ce.findIndex(function(ft){var zt=ft.data.key;return zt===lt.key}),Rt=P(k(ce,Me,lt.key),Ie,Te,Re),at=ce.slice();at.splice(Ot+1,0,U),pt(at),wt(Rt),xt("hide")}else Me!==ce&&(Ke(ce),pt(ce))},[Q,ce]),g.useEffect(function(){X||rr()},[X]);var Gt=ve?nt:ce,Ge={expandedKeys:Q,selectedKeys:D,loadedKeys:W,loadingKeys:Y,checkedKeys:F,halfCheckedKeys:Z,dragOverNodeKey:re,dropPosition:me,keyEntities:te};return g.createElement(g.Fragment,null,We&&Ne&&g.createElement("span",{style:d,"aria-live":"assertive"},$(Ne)),g.createElement("div",{role:"tree"},g.createElement("input",{style:d,disabled:je===!1||q,tabIndex:je!==!1?Be:null,onKeyDown:He,onFocus:De,onBlur:Xe,value:"",onChange:b})),g.createElement(n.a,Object.assign({},pe,{data:Gt,itemKey:J,height:Te,fullHeight:!1,virtual:Ie,itemHeight:Re,prefixCls:"".concat(se,"-list"),ref:ye}),function(lt){var yt=lt.pos,It=lt.data,Wt=It.key,Ot=Object(u.a)(It,["key"]),Rt=lt.isStart,at=lt.isEnd,ft=Object(E.e)(Wt,yt);delete Ot.children;var zt=Object(E.f)(ft,Ge);return g.createElement(i,Object.assign({},Ot,zt,{active:Ne&&Wt===Ne.data.key,pos:yt,data:lt.data,isStart:Rt,isEnd:at,motion:ve,motionNodes:Wt===x?Pt:null,motionType:gt,onMotionStart:we,onMotionEnd:rr,treeNodeRequiredProps:Ge,onMouseMove:function(){$e(null)}}))}))},V=g.forwardRef(z);V.displayName="NodeList";var K=V,H=N("NvD2"),G=function(ue){Object(c.a)(Ce,ue);var be=Object(C.a)(Ce);function Ce(){var se;return Object(L.a)(this,Ce),se=be.apply(this,arguments),se.destroyed=!1,se.state={keyEntities:{},selectedKeys:[],checkedKeys:[],halfCheckedKeys:[],loadedKeys:[],loadingKeys:[],expandedKeys:[],dragging:!1,dragNodesKeys:[],dragOverNodeKey:null,dropPosition:null,treeData:[],flattenNodes:[],focused:!1,activeKey:null,listChanging:!1,prevProps:null},se.listRef=g.createRef(),se.onNodeDragStart=function(ce,he){var ae=se.state,Q=ae.expandedKeys,D=ae.keyEntities,F=se.props.onDragStart,W=he.props.eventKey;se.dragNode=he;var Y=Object(m.b)(Q,W);se.setState({dragging:!0,dragNodesKeys:Object(m.g)(W,D)}),se.setExpandedKeys(Y),F&&F({event:ce,node:Object(E.b)(he.props)})},se.onNodeDragEnter=function(ce,he){var ae=se.state,Q=ae.expandedKeys,D=ae.keyEntities,F=ae.dragNodesKeys,W=se.props.onDragEnter,Y=he.props,Z=Y.pos,te=Y.eventKey;if(!se.dragNode||F.indexOf(te)!==-1)return;var q=Object(m.c)(ce,he);if(se.dragNode.props.eventKey===te&&q===0){se.setState({dragOverNodeKey:"",dropPosition:null});return}setTimeout(function(){se.setState({dragOverNodeKey:te,dropPosition:q}),se.delayedDragEnterLogic||(se.delayedDragEnterLogic={}),Object.keys(se.delayedDragEnterLogic).forEach(function(X){clearTimeout(se.delayedDragEnterLogic[X])}),se.delayedDragEnterLogic[Z]=window.setTimeout(function(){if(!se.state.dragging)return;var X=Object(S.a)(Q),re=D[te];re&&(re.children||[]).length&&(X=Object(m.a)(Q,te)),"expandedKeys"in se.props||se.setExpandedKeys(X),W&&W({event:ce,node:Object(E.b)(he.props),expandedKeys:X})},400)},0)},se.onNodeDragOver=function(ce,he){var ae=se.state.dragNodesKeys,Q=se.props.onDragOver,D=he.props.eventKey;if(ae.indexOf(D)!==-1)return;if(se.dragNode&&D===se.state.dragOverNodeKey){var F=Object(m.c)(ce,he);if(F===se.state.dropPosition)return;se.setState({dropPosition:F})}Q&&Q({event:ce,node:Object(E.b)(he.props)})},se.onNodeDragLeave=function(ce,he){var ae=se.props.onDragLeave;se.setState({dragOverNodeKey:""}),ae&&ae({event:ce,node:Object(E.b)(he.props)})},se.onNodeDragEnd=function(ce,he){var ae=se.props.onDragEnd;se.setState({dragOverNodeKey:""}),se.cleanDragState(),ae&&ae({event:ce,node:Object(E.b)(he.props)}),se.dragNode=null},se.onNodeDrop=function(ce,he){var ae=se.state,Q=ae.dragNodesKeys,D=Q===void 0?[]:Q,F=ae.dropPosition,W=se.props.onDrop,Y=he.props,Z=Y.eventKey,te=Y.pos;if(se.setState({dragOverNodeKey:""}),se.cleanDragState(),D.indexOf(Z)!==-1){Object(a.a)(!1,"Can not drop to dragNode(include it's children node)");return}var q=Object(m.k)(te),X={event:ce,node:Object(E.b)(he.props),dragNode:se.dragNode?Object(E.b)(se.dragNode.props):null,dragNodesKeys:D.slice(),dropPosition:F+Number(q[q.length-1]),dropToGap:!1};F!==0&&(X.dropToGap=!0),W&&W(X),se.dragNode=null},se.cleanDragState=function(){var ce=se.state.dragging;ce&&se.setState({dragging:!1})},se.onNodeClick=function(ce,he){var ae=se.props.onClick;ae&&ae(ce,he)},se.onNodeDoubleClick=function(ce,he){var ae=se.props.onDoubleClick;ae&&ae(ce,he)},se.onNodeSelect=function(ce,he){var ae=se.state.selectedKeys,Q=se.state.keyEntities,D=se.props,F=D.onSelect,W=D.multiple,Y=he.selected,Z=he.key,te=!Y;te?W?ae=Object(m.a)(ae,Z):ae=[Z]:ae=Object(m.b)(ae,Z);var q=ae.map(function(X){var re=Q[X];return re?re.node:null}).filter(function(X){return X});se.setUncontrolledState({selectedKeys:ae}),F&&F(ae,{event:"select",selected:te,node:he,selectedNodes:q,nativeEvent:ce.nativeEvent})},se.onNodeCheck=function(ce,he,ae){var Q=se.state,D=Q.keyEntities,F=Q.checkedKeys,W=Q.halfCheckedKeys,Y=se.props,Z=Y.checkStrictly,te=Y.onCheck,q=he.key,X,re={event:"check",node:he,checked:ae,nativeEvent:ce.nativeEvent};if(Z){var me=ae?Object(m.a)(F,q):Object(m.b)(F,q),ve=Object(m.b)(W,q);X={checked:me,halfChecked:ve},re.checkedNodes=me.map(function(We){return D[We]}).filter(function(We){return We}).map(function(We){return We.node}),se.setUncontrolledState({checkedKeys:me})}else{var Te=Object(H.a)([].concat(Object(S.a)(F),[q]),!0,D),Re=Te.checkedKeys,Ie=Te.halfCheckedKeys;if(!ae){var je=new Set(Re);je.delete(q);var Ne=Object(H.a)(Array.from(je),{checked:!1,halfCheckedKeys:Ie},D);Re=Ne.checkedKeys,Ie=Ne.halfCheckedKeys}X=Re,re.checkedNodes=[],re.checkedNodesPositions=[],re.halfCheckedKeys=Ie,Re.forEach(function(We){var Be=D[We];if(!Be)return;var He=Be.node,De=Be.pos;re.checkedNodes.push(He),re.checkedNodesPositions.push({node:He,pos:De})}),se.setUncontrolledState({checkedKeys:Re},!1,{halfCheckedKeys:Ie})}te&&te(X,re)},se.onNodeLoad=function(ce){return new Promise(function(he){se.setState(function(ae){var Q=ae.loadedKeys,D=Q===void 0?[]:Q,F=ae.loadingKeys,W=F===void 0?[]:F,Y=se.props,Z=Y.loadData,te=Y.onLoad,q=ce.key;if(!Z||D.indexOf(q)!==-1||W.indexOf(q)!==-1)return{};var X=Z(ce);return X.then(function(){var re=se.state,me=re.loadedKeys,ve=re.loadingKeys,Te=Object(m.a)(me,q),Re=Object(m.b)(ve,q);te&&te(Te,{event:"load",node:ce}),se.setUncontrolledState({loadedKeys:Te}),se.setState({loadingKeys:Re}),he()}),{loadingKeys:Object(m.a)(W,q)}})})},se.onNodeMouseEnter=function(ce,he){var ae=se.props.onMouseEnter;ae&&ae({event:ce,node:he})},se.onNodeMouseLeave=function(ce,he){var ae=se.props.onMouseLeave;ae&&ae({event:ce,node:he})},se.onNodeContextMenu=function(ce,he){var ae=se.props.onRightClick;ae&&(ce.preventDefault(),ae({event:ce,node:he}))},se.onFocus=function(){var ce=se.props.onFocus;se.setState({focused:!0}),ce&&ce.apply(void 0,arguments)},se.onBlur=function(){var ce=se.props.onBlur;se.setState({focused:!1}),se.onActiveChange(null),ce&&ce.apply(void 0,arguments)},se.getTreeNodeRequiredProps=function(){var ce=se.state,he=ce.expandedKeys,ae=ce.selectedKeys,Q=ce.loadedKeys,D=ce.loadingKeys,F=ce.checkedKeys,W=ce.halfCheckedKeys,Y=ce.dragOverNodeKey,Z=ce.dropPosition,te=ce.keyEntities;return{expandedKeys:he||[],selectedKeys:ae||[],loadedKeys:Q||[],loadingKeys:D||[],checkedKeys:F||[],halfCheckedKeys:W||[],dragOverNodeKey:Y,dropPosition:Z,keyEntities:te}},se.setExpandedKeys=function(ce){var he=se.state.treeData,ae=Object(E.d)(he,ce);se.setUncontrolledState({expandedKeys:ce,flattenNodes:ae},!0)},se.onNodeExpand=function(ce,he){var ae=se.state.expandedKeys,Q=se.state.listChanging,D=se.props,F=D.onExpand,W=D.loadData,Y=he.key,Z=he.expanded;if(Q)return;var te=ae.indexOf(Y),q=!Z;if(Object(a.a)(Z&&te!==-1||!Z&&te===-1,"Expand state not sync with index check"),q?ae=Object(m.a)(ae,Y):ae=Object(m.b)(ae,Y),se.setExpandedKeys(ae),F&&F(ae,{node:he,expanded:q,nativeEvent:ce.nativeEvent}),q&&W){var X=se.onNodeLoad(he);X&&X.then(function(){var re=Object(E.d)(se.state.treeData,ae);se.setUncontrolledState({flattenNodes:re})})}},se.onListChangeStart=function(){se.setUncontrolledState({listChanging:!0})},se.onListChangeEnd=function(){setTimeout(function(){se.setUncontrolledState({listChanging:!1})})},se.onActiveChange=function(ce){var he=se.state.activeKey,ae=se.props.onActiveChange;if(he===ce)return;se.setState({activeKey:ce}),ce!==null&&se.scrollTo({key:ce}),ae&&ae(ce)},se.getActiveItem=function(){var ce=se.state,he=ce.activeKey,ae=ce.flattenNodes;return he===null?null:ae.find(function(Q){var D=Q.data.key;return D===he})||null},se.offsetActiveKey=function(ce){var he=se.state,ae=he.flattenNodes,Q=he.activeKey,D=ae.findIndex(function(Y){var Z=Y.data.key;return Z===Q});D===-1&&ce<0&&(D=ae.length),D=(D+ce+ae.length)%ae.length;var F=ae[D];if(F){var W=F.data.key;se.onActiveChange(W)}else se.onActiveChange(null)},se.onKeyDown=function(ce){var he=se.state,ae=he.activeKey,Q=he.expandedKeys,D=he.checkedKeys,F=se.props,W=F.onKeyDown,Y=F.checkable,Z=F.selectable;switch(ce.which){case s.a.UP:{se.offsetActiveKey(-1),ce.preventDefault();break}case s.a.DOWN:{se.offsetActiveKey(1),ce.preventDefault();break}}var te=se.getActiveItem();if(te&&te.data){var q=se.getTreeNodeRequiredProps(),X=te.data.isLeaf===!1||!!(te.data.children||[]).length,re=Object(E.b)(Object(h.a)(Object(h.a)({},Object(E.f)(ae,q)),{},{data:te.data,active:!0}));switch(ce.which){case s.a.LEFT:{X&&Q.includes(ae)?se.onNodeExpand({},re):te.parent&&se.onActiveChange(te.parent.data.key),ce.preventDefault();break}case s.a.RIGHT:{X&&!Q.includes(ae)?se.onNodeExpand({},re):te.children&&te.children.length&&se.onActiveChange(te.children[0].data.key),ce.preventDefault();break}case s.a.ENTER:case s.a.SPACE:{Y&&!re.disabled&&re.checkable!==!1&&!re.disableCheckbox?se.onNodeCheck({},re,!D.includes(ae)):!Y&&Z&&!re.disabled&&re.selectable!==!1&&se.onNodeSelect({},re);break}}}W&&W(ce)},se.setUncontrolledState=function(ce){var he=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ae=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(se.destroyed)return;var Q=!1,D=!0,F={};Object.keys(ce).forEach(function(W){if(W in se.props){D=!1;return}Q=!0,F[W]=ce[W]}),Q&&(!he||D)&&se.setState(Object(h.a)(Object(h.a)({},F),ae))},se.scrollTo=function(ce){se.listRef.current.scrollTo(ce)},se}return Object(T.a)(Ce,[{key:"componentWillUnmount",value:function(){this.destroyed=!0}},{key:"render",value:function(){var ce,he=this.state,ae=he.focused,Q=he.flattenNodes,D=he.keyEntities,F=he.dragging,W=he.activeKey,Y=this.props,Z=Y.prefixCls,te=Y.className,q=Y.style,X=Y.showLine,re=Y.focusable,me=Y.tabIndex,ve=me===void 0?0:me,Te=Y.selectable,Re=Y.showIcon,Ie=Y.icon,je=Y.switcherIcon,Ne=Y.draggable,We=Y.checkable,Be=Y.checkStrictly,He=Y.disabled,De=Y.motion,Xe=Y.loadData,$e=Y.filterTreeNode,we=Y.height,fe=Y.itemHeight,pe=Y.virtual,ye=Y.titleRender,_e=Y.onContextMenu,xe=Object(m.f)(this.props);return g.createElement(p.a.Provider,{value:{prefixCls:Z,selectable:Te,showIcon:Re,icon:Ie,switcherIcon:je,draggable:Ne,checkable:We,checkStrictly:Be,disabled:He,keyEntities:D,loadData:Xe,filterTreeNode:$e,titleRender:ye,onNodeClick:this.onNodeClick,onNodeDoubleClick:this.onNodeDoubleClick,onNodeExpand:this.onNodeExpand,onNodeSelect:this.onNodeSelect,onNodeCheck:this.onNodeCheck,onNodeLoad:this.onNodeLoad,onNodeMouseEnter:this.onNodeMouseEnter,onNodeMouseLeave:this.onNodeMouseLeave,onNodeContextMenu:this.onNodeContextMenu,onNodeDragStart:this.onNodeDragStart,onNodeDragEnter:this.onNodeDragEnter,onNodeDragOver:this.onNodeDragOver,onNodeDragLeave:this.onNodeDragLeave,onNodeDragEnd:this.onNodeDragEnd,onNodeDrop:this.onNodeDrop}},g.createElement("div",{className:f()(Z,te,(ce={},Object(I.a)(ce,"".concat(Z,"-show-line"),X),Object(I.a)(ce,"".concat(Z,"-focused"),ae),Object(I.a)(ce,"".concat(Z,"-active-focused"),W!==null),ce))},g.createElement(K,Object.assign({ref:this.listRef,prefixCls:Z,style:q,data:Q,disabled:He,selectable:Te,checkable:!!We,motion:De,dragging:F,height:we,itemHeight:fe,virtual:pe,focusable:re,focused:ae,tabIndex:ve,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:_e},this.getTreeNodeRequiredProps(),xe))))}}],[{key:"getDerivedStateFromProps",value:function(ce,he){var ae=he.prevProps,Q={prevProps:ce};function D(Ie){return!ae&&Ie in ce||ae&&ae[Ie]!==ce[Ie]}var F;if(D("treeData")?F=ce.treeData:D("children")&&(Object(a.a)(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),F=Object(E.c)(ce.children)),F){Q.treeData=F;var W=Object(E.a)(F);Q.keyEntities=Object(h.a)(Object(I.a)({},x,B),W.keyEntities)}var Y=Q.keyEntities||he.keyEntities;if(D("expandedKeys")||ae&&D("autoExpandParent"))Q.expandedKeys=ce.autoExpandParent||!ae&&ce.defaultExpandParent?Object(m.e)(ce.expandedKeys,Y):ce.expandedKeys;else if(!ae&&ce.defaultExpandAll){var Z=Object(h.a)({},Y);delete Z[x],Q.expandedKeys=Object.keys(Z).map(function(Ie){return Z[Ie].key})}else!ae&&ce.defaultExpandedKeys&&(Q.expandedKeys=ce.autoExpandParent||ce.defaultExpandParent?Object(m.e)(ce.defaultExpandedKeys,Y):ce.defaultExpandedKeys);if(Q.expandedKeys||delete Q.expandedKeys,F||Q.expandedKeys){var te=Object(E.d)(F||he.treeData,Q.expandedKeys||he.expandedKeys);Q.flattenNodes=te}if(ce.selectable&&(D("selectedKeys")?Q.selectedKeys=Object(m.d)(ce.selectedKeys,ce):!ae&&ce.defaultSelectedKeys&&(Q.selectedKeys=Object(m.d)(ce.defaultSelectedKeys,ce))),ce.checkable){var q;if(D("checkedKeys")?q=Object(m.j)(ce.checkedKeys)||{}:!ae&&ce.defaultCheckedKeys?q=Object(m.j)(ce.defaultCheckedKeys)||{}:F&&(q=Object(m.j)(ce.checkedKeys)||{checkedKeys:he.checkedKeys,halfCheckedKeys:he.halfCheckedKeys}),q){var X=q,re=X.checkedKeys,me=re===void 0?[]:re,ve=X.halfCheckedKeys,Te=ve===void 0?[]:ve;if(!ce.checkStrictly){var Re=Object(H.a)(me,!0,Y);me=Re.checkedKeys,Te=Re.halfCheckedKeys}Q.checkedKeys=me,Q.halfCheckedKeys=Te}}return D("loadedKeys")&&(Q.loadedKeys=ce.loadedKeys),Q}}]),Ce}(g.Component);G.defaultProps={prefixCls:"rc-tree",showLine:!1,showIcon:!0,selectable:!0,multiple:!1,checkable:!1,disabled:!1,checkStrictly:!1,draggable:!1,defaultExpandParent:!0,autoExpandParent:!1,defaultExpandAll:!1,defaultExpandedKeys:[],defaultCheckedKeys:[],defaultSelectedKeys:[]},G.TreeNode=l.a;var ie=G,le=ne.b=ie},fcSX:function(M,ne,N){"use strict";var I=N("Ff2n"),h=N("1OyB"),S=N("vuIU"),L=N("Ji7U"),T=N("md7G"),c=N("foSv"),C=N("1W/9"),g=N("q1tI"),s=N("rePB"),a=N("JX7q"),r=N("TSYQ"),f=N.n(r),p=N("qx4F"),m=N("4IlW");function E(z){return Array.isArray(z)?z:[z]}var y={transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend"},u=Object.keys(y).filter(function(z){if(typeof document=="undefined")return!1;var V=document.getElementsByTagName("html")[0];return z in(V?V.style:{})})[0],n=y[u];function o(z,V,K,H){z.addEventListener?z.addEventListener(V,K,H):z.attachEvent&&z.attachEvent("on".concat(V),K)}function l(z,V,K,H){z.removeEventListener?z.removeEventListener(V,K,H):z.attachEvent&&z.detachEvent("on".concat(V),K)}function w(z,V){var K=typeof z=="function"?z(V):z;return Array.isArray(K)?K.length===2?K:[K[0],K[1]]:[K]}var v=function(V){return!isNaN(parseFloat(V))&&isFinite(V)},i=!(typeof window!="undefined"&&window.document&&window.document.createElement),R=function z(V,K,H,G){if(!K||K===document||K instanceof Document)return!1;if(K===V.parentNode)return!0;var ie=Math.max(Math.abs(H),Math.abs(G))===Math.abs(G),le=Math.max(Math.abs(H),Math.abs(G))===Math.abs(H),ue=K.scrollHeight-K.clientHeight,be=K.scrollWidth-K.clientWidth,Ce=document.defaultView.getComputedStyle(K),se=Ce.overflowY==="auto"||Ce.overflowY==="scroll",ce=Ce.overflowX==="auto"||Ce.overflowX==="scroll",he=ue&&se,ae=be&&ce;return ie&&(!he||he&&(K.scrollTop>=ue&&G<0||K.scrollTop<=0&&G>0))||le&&(!ae||ae&&(K.scrollLeft>=be&&H<0||K.scrollLeft<=0&&H>0))?z(V,K.parentNode,H,G):!1};function k(z){var V=d();return function(){var H=Object(c.a)(z),G;if(V){var ie=Object(c.a)(this).constructor;G=Reflect.construct(H,arguments,ie)}else G=H.apply(this,arguments);return Object(T.a)(this,G)}}function d(){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(z){return!1}}var b={},x=function(z){Object(L.a)(K,z);var V=k(K);function K(H){var G;return Object(h.a)(this,K),G=V.call(this,H),G.domFocus=function(){G.dom&&G.dom.focus()},G.removeStartHandler=function(ie){if(ie.touches.length>1)return;G.startPos={x:ie.touches[0].clientX,y:ie.touches[0].clientY}},G.removeMoveHandler=function(ie){if(ie.changedTouches.length>1)return;var le=ie.currentTarget,ue=ie.changedTouches[0].clientX-G.startPos.x,be=ie.changedTouches[0].clientY-G.startPos.y;(le===G.maskDom||le===G.handlerDom||le===G.contentDom&&R(le,ie.target,ue,be))&&ie.cancelable&&ie.preventDefault()},G.transitionEnd=function(ie){var le=ie.target;l(le,n,G.transitionEnd),le.style.transition=""},G.onKeyDown=function(ie){if(ie.keyCode===m.a.ESC){var le=G.props.onClose;ie.stopPropagation(),le&&le(ie)}},G.onWrapperTransitionEnd=function(ie){var le=G.props,ue=le.open,be=le.afterVisibleChange;ie.target===G.contentWrapper&&ie.propertyName.match(/transform$/)&&(G.dom.style.transition="",!ue&&G.getCurrentDrawerSome()&&(document.body.style.overflowX="",G.maskDom&&(G.maskDom.style.left="",G.maskDom.style.width="")),be&&be(!!ue))},G.openLevelTransition=function(){var ie=G.props,le=ie.open,ue=ie.width,be=ie.height,Ce=G.getHorizontalBoolAndPlacementName(),se=Ce.isHorizontal,ce=Ce.placementName,he=G.contentDom?G.contentDom.getBoundingClientRect()[se?"width":"height"]:0,ae=(se?ue:be)||he;G.setLevelAndScrolling(le,ce,ae)},G.setLevelTransform=function(ie,le,ue,be){var Ce=G.props,se=Ce.placement,ce=Ce.levelMove,he=Ce.duration,ae=Ce.ease,Q=Ce.showMask;G.levelDom.forEach(function(D){D.style.transition="transform ".concat(he," ").concat(ae),o(D,n,G.transitionEnd);var F=ie?ue:0;if(ce){var W=w(ce,{target:D,open:ie});F=ie?W[0]:W[1]||0}var Y=typeof F=="number"?"".concat(F,"px"):F,Z=se==="left"||se==="top"?Y:"-".concat(Y);Z=Q&&se==="right"&&be?"calc(".concat(Z," + ").concat(be,"px)"):Z,D.style.transform=F?"".concat(le,"(").concat(Z,")"):""})},G.setLevelAndScrolling=function(ie,le,ue){var be=G.props.onChange;if(!i){var Ce=document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth?Object(p.a)(!0):0;G.setLevelTransform(ie,le,ue,Ce),G.toggleScrollingToDrawerAndBody(Ce)}be&&be(ie)},G.toggleScrollingToDrawerAndBody=function(ie){var le=G.props,ue=le.getOpenCount,be=le.getContainer,Ce=le.showMask,se=le.open,ce=be&&be(),he=ue&&ue();if(ce&&ce.parentNode===document.body&&Ce){var ae=["touchstart"],Q=[document.body,G.maskDom,G.handlerDom,G.contentDom];se&&document.body.style.overflow!=="hidden"?(ie&&G.addScrollingEffect(ie),he===1&&(document.body.style.overflow="hidden"),document.body.style.touchAction="none",Q.forEach(function(D,F){if(!D)return;o(D,ae[F]||"touchmove",F?G.removeMoveHandler:G.removeStartHandler,G.passive)})):G.getCurrentDrawerSome()&&(he||(document.body.style.overflow=""),document.body.style.touchAction="",ie&&G.remScrollingEffect(ie),Q.forEach(function(D,F){if(!D)return;l(D,ae[F]||"touchmove",F?G.removeMoveHandler:G.removeStartHandler,G.passive)}))}},G.addScrollingEffect=function(ie){var le=G.props,ue=le.placement,be=le.duration,Ce=le.ease,se=le.getOpenCount,ce=le.switchScrollingEffect,he=se&&se();he===1&&ce();var ae="width ".concat(be," ").concat(Ce),Q="transform ".concat(be," ").concat(Ce);G.dom.style.transition="none";switch(ue){case"right":G.dom.style.transform="translateX(-".concat(ie,"px)");break;case"top":case"bottom":G.dom.style.width="calc(100% - ".concat(ie,"px)"),G.dom.style.transform="translateZ(0)";break;default:break}clearTimeout(G.timeout),G.timeout=setTimeout(function(){G.dom&&(G.dom.style.transition="".concat(Q,",").concat(ae),G.dom.style.width="",G.dom.style.transform="")})},G.remScrollingEffect=function(ie){var le=G.props,ue=le.placement,be=le.duration,Ce=le.ease,se=le.getOpenCount,ce=le.switchScrollingEffect,he=se&&se();he||ce(!0),u&&(document.body.style.overflowX="hidden"),G.dom.style.transition="none";var ae,Q="width ".concat(be," ").concat(Ce),D="transform ".concat(be," ").concat(Ce);switch(ue){case"left":{G.dom.style.width="100%",Q="width 0s ".concat(Ce," ").concat(be);break}case"right":{G.dom.style.transform="translateX(".concat(ie,"px)"),G.dom.style.width="100%",Q="width 0s ".concat(Ce," ").concat(be),G.maskDom&&(G.maskDom.style.left="-".concat(ie,"px"),G.maskDom.style.width="calc(100% + ".concat(ie,"px)"));break}case"top":case"bottom":{G.dom.style.width="calc(100% + ".concat(ie,"px)"),G.dom.style.height="100%",G.dom.style.transform="translateZ(0)",ae="height 0s ".concat(Ce," ").concat(be);break}default:break}clearTimeout(G.timeout),G.timeout=setTimeout(function(){G.dom&&(G.dom.style.transition="".concat(D,",").concat(ae?"".concat(ae,","):"").concat(Q),G.dom.style.transform="",G.dom.style.width="",G.dom.style.height="")})},G.getCurrentDrawerSome=function(){return!Object.keys(b).some(function(ie){return b[ie]})},G.getLevelDom=function(ie){var le=ie.level,ue=ie.getContainer;if(i)return;var be=ue&&ue(),Ce=be?be.parentNode:null;if(G.levelDom=[],le==="all"){var se=Ce?Array.prototype.slice.call(Ce.children):[];se.forEach(function(ce){ce.nodeName!=="SCRIPT"&&ce.nodeName!=="STYLE"&&ce.nodeName!=="LINK"&&ce!==be&&G.levelDom.push(ce)})}else le&&E(le).forEach(function(ce){document.querySelectorAll(ce).forEach(function(he){G.levelDom.push(he)})})},G.getHorizontalBoolAndPlacementName=function(){var ie=G.props.placement,le=ie==="left"||ie==="right",ue="translate".concat(le?"X":"Y");return{isHorizontal:le,placementName:ue}},G.state={_self:Object(a.a)(G)},G}return Object(S.a)(K,[{key:"componentDidMount",value:function(){var G=this;if(!i){var ie=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){return ie=!0,null}}))}catch(se){}this.passive=ie?{passive:!1}:!1}var le=this.props,ue=le.open,be=le.getContainer,Ce=be&&be();this.drawerId="drawer_id_".concat(Number((Date.now()+Math.random()).toString().replace(".",Math.round(Math.random()*9).toString())).toString(16)),this.getLevelDom(this.props),ue&&(Ce&&Ce.parentNode===document.body&&(b[this.drawerId]=ue),this.openLevelTransition(),this.forceUpdate(function(){G.domFocus()}))}},{key:"componentDidUpdate",value:function(G){var ie=this.props,le=ie.open,ue=ie.getContainer,be=ue&&ue();le!==G.open&&(le&&this.domFocus(),be&&be.parentNode===document.body&&(b[this.drawerId]=!!le),this.openLevelTransition())}},{key:"componentWillUnmount",value:function(){var G=this.props,ie=G.getOpenCount,le=G.open,ue=G.switchScrollingEffect,be=typeof ie=="function"&&ie();delete b[this.drawerId],le&&(this.setLevelTransform(!1),document.body.style.touchAction=""),be||(document.body.style.overflow="",ue(!0))}},{key:"render",value:function(){var G,ie=this,le=this.props,ue=le.className,be=le.children,Ce=le.style,se=le.width,ce=le.height,he=le.defaultOpen,ae=le.open,Q=le.prefixCls,D=le.placement,F=le.level,W=le.levelMove,Y=le.ease,Z=le.duration,te=le.getContainer,q=le.handler,X=le.onChange,re=le.afterVisibleChange,me=le.showMask,ve=le.maskClosable,Te=le.maskStyle,Re=le.onClose,Ie=le.onHandleClick,je=le.keyboard,Ne=le.getOpenCount,We=le.switchScrollingEffect,Be=Object(I.a)(le,["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"]),He=this.dom?ae:!1,De=f()(Q,(G={},Object(s.a)(G,"".concat(Q,"-").concat(D),!0),Object(s.a)(G,"".concat(Q,"-open"),He),Object(s.a)(G,ue||"",!!ue),Object(s.a)(G,"no-mask",!me),G)),Xe=this.getHorizontalBoolAndPlacementName(),$e=Xe.placementName,we=D==="left"||D==="top"?"-100%":"100%",fe=He?"":"".concat($e,"(").concat(we,")"),pe=q&&g.cloneElement(q,{onClick:function(_e){q.props.onClick&&q.props.onClick(),Ie&&Ie(_e)},ref:function(_e){ie.handlerDom=_e}});return g.createElement("div",Object.assign({},Be,{tabIndex:-1,className:De,style:Ce,ref:function(_e){ie.dom=_e},onKeyDown:He&&je?this.onKeyDown:void 0,onTransitionEnd:this.onWrapperTransitionEnd}),me&&g.createElement("div",{className:"".concat(Q,"-mask"),onClick:ve?Re:void 0,style:Te,ref:function(_e){ie.maskDom=_e}}),g.createElement("div",{className:"".concat(Q,"-content-wrapper"),style:{transform:fe,msTransform:fe,width:v(se)?"".concat(se,"px"):se,height:v(ce)?"".concat(ce,"px"):ce},ref:function(_e){ie.contentWrapper=_e}},g.createElement("div",{className:"".concat(Q,"-content"),ref:function(_e){ie.contentDom=_e},onTouchStart:He&&me?this.removeStartHandler:void 0,onTouchMove:He&&me?this.removeMoveHandler:void 0},be),pe))}}],[{key:"getDerivedStateFromProps",value:function(G,ie){var le=ie.prevProps,ue=ie._self,be={prevProps:G};if(le!==void 0){var Ce=G.placement,se=G.level;Ce!==le.placement&&(ue.contentDom=null),se!==le.level&&ue.getLevelDom(G)}return be}}]),K}(g.Component);x.defaultProps={switchScrollingEffect:function(){}};var _=x;function B(z){var V=U();return function(){var H=Object(c.a)(z),G;if(V){var ie=Object(c.a)(this).constructor;G=Reflect.construct(H,arguments,ie)}else G=H.apply(this,arguments);return Object(T.a)(this,G)}}function U(){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(z){return!1}}var P=function(z){Object(L.a)(K,z);var V=B(K);function K(H){var G;Object(h.a)(this,K),G=V.call(this,H),G.onHandleClick=function(le){var ue=G.props,be=ue.onHandleClick,Ce=ue.open;if(be&&be(le),typeof Ce=="undefined"){var se=G.state.open;G.setState({open:!se})}},G.onClose=function(le){var ue=G.props,be=ue.onClose,Ce=ue.open;be&&be(le),typeof Ce=="undefined"&&G.setState({open:!1})};var ie=typeof H.open!="undefined"?H.open:!!H.defaultOpen;return G.state={open:ie},"onMaskClick"in H&&console.warn("`onMaskClick` are removed, please use `onClose` instead."),G}return Object(S.a)(K,[{key:"render",value:function(){var G=this,ie=this.props,le=ie.defaultOpen,ue=ie.getContainer,be=ie.wrapperClassName,Ce=ie.forceRender,se=ie.handler,ce=Object(I.a)(ie,["defaultOpen","getContainer","wrapperClassName","forceRender","handler"]),he=this.state.open;if(!ue)return g.createElement("div",{className:be,ref:function(D){G.dom=D}},g.createElement(_,Object.assign({},ce,{open:he,handler:se,getContainer:function(){return G.dom},onClose:this.onClose,onHandleClick:this.onHandleClick})));var ae=!!se||Ce;return g.createElement(C.a,{visible:he,forceRender:ae,getContainer:ue,wrapperClassName:be},function(Q){var D=Q.visible,F=Q.afterClose,W=Object(I.a)(Q,["visible","afterClose"]);return g.createElement(_,Object.assign({},ce,W,{open:D!==void 0?D:he,afterVisibleChange:F!==void 0?F:ce.afterVisibleChange,handler:se,onClose:G.onClose,onHandleClick:G.onHandleClick}))})}}],[{key:"getDerivedStateFromProps",value:function(G,ie){var le=ie.prevProps,ue={prevProps:G};return typeof le!="undefined"&&G.open!==le.open&&(ue.open=G.open),ue}}]),K}(g.Component);P.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:g.createElement("div",{className:"drawer-handle"},g.createElement("i",{className:"drawer-handle-icon"})),showMask:!0,maskClosable:!0,maskStyle:{},wrapperClassName:"",className:"",keyboard:!0,forceRender:!1};var J=P,$=ne.a=J},fcyK:function(M,ne,N){},gRFJ:function(M,ne,N){M.exports=[N("rdUC"),N("ynwM"),N("RELg"),N("DlR+"),N("CrYA"),N("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(M){return M<10?"0"+M:M}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(M){return rx_escapable.lastIndex=0,rx_escapable.test(M)?'"'+M.replace(rx_escapable,function(ne){var N=meta[ne];return typeof N=="string"?N:"\\u"+("0000"+ne.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+M+'"'}function str(M,ne){var N,I,h,S,L=gap,T,c=ne[M];c&&typeof c=="object"&&typeof c.toJSON=="function"&&(c=c.toJSON(M)),typeof rep=="function"&&(c=rep.call(ne,M,c));switch(typeof c){case"string":return quote(c);case"number":return isFinite(c)?String(c):"null";case"boolean":case"null":return String(c);case"object":if(!c)return"null";if(gap+=indent,T=[],Object.prototype.toString.apply(c)==="[object Array]"){for(S=c.length,N=0;N<S;N+=1)T[N]=str(N,c)||"null";return h=T.length===0?"[]":gap?`[
`+gap+T.join(`,
`+gap)+`
`+L+"]":"["+T.join(",")+"]",gap=L,h}if(rep&&typeof rep=="object")for(S=rep.length,N=0;N<S;N+=1)typeof rep[N]=="string"&&(I=rep[N],h=str(I,c),h&&T.push(quote(I)+(gap?": ":":")+h));else for(I in c)Object.prototype.hasOwnProperty.call(c,I)&&(h=str(I,c),h&&T.push(quote(I)+(gap?": ":":")+h));return h=T.length===0?"{}":gap?`{
`+gap+T.join(`,
`+gap)+`
`+L+"}":"{"+T.join(",")+"}",gap=L,h}}typeof JSON.stringify!="function"&&(meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},JSON.stringify=function(M,ne,N){var I;if(gap="",indent="",typeof N=="number")for(I=0;I<N;I+=1)indent+=" ";else typeof N=="string"&&(indent=N);if(rep=ne,ne&&typeof ne!="function"&&(typeof ne!="object"||typeof ne.length!="number"))throw new Error("JSON.stringify");return str("",{"":M})}),typeof JSON.parse!="function"&&(JSON.parse=function(text,reviver){var j;function walk(M,ne){var N,I,h=M[ne];if(h&&typeof h=="object")for(N in h)Object.prototype.hasOwnProperty.call(h,N)&&(I=walk(h,N),I!==void 0?h[N]=I:delete h[N]);return reviver.call(M,ne,h)}if(text=String(text),rx_dangerous.lastIndex=0,rx_dangerous.test(text)&&(text=text.replace(rx_dangerous,function(M){return"\\u"+("0000"+M.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")})}()},"gb/T":function(M,ne,N){(function(I,h,S){M.exports=ne=h(N("Ib8C"),N("OLod"))})(this,function(I){return I.mode.ECB=function(){var h=I.lib.BlockCipherMode.extend();return h.Encryptor=h.extend({processBlock:function(S,L){this._cipher.encryptBlock(S,L)}}),h.Decryptor=h.extend({processBlock:function(S,L){this._cipher.decryptBlock(S,L)}}),h}(),I.mode.ECB})},h78n:function(M,ne,N){"use strict";N.d(ne,"a",function(){return P});var I=N("q1tI"),h=N.n(I),S=N("TSYQ"),L=N.n(S),T={className:"",percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,style:{},trailColor:"#D9D9D9",trailWidth:1},c=function(z){var V=z.map(function(){return Object(I.useRef)()}),K=Object(I.useRef)();return Object(I.useEffect)(function(){var H=Date.now(),G=!1;Object.keys(V).forEach(function(ie){var le=V[ie].current;if(!le)return;G=!0;var ue=le.style;ue.transitionDuration=".3s, .3s, .3s, .06s",K.current&&H-K.current<100&&(ue.transitionDuration="0s, 0s")}),G&&(K.current=Date.now())}),[V]};function C(){return C=Object.assign||function($){for(var z=1;z<arguments.length;z++){var V=arguments[z];for(var K in V)Object.prototype.hasOwnProperty.call(V,K)&&($[K]=V[K])}return $},C.apply(this,arguments)}function g($,z){return p($)||f($,z)||a($,z)||s()}function s(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function a($,z){if(!$)return;if(typeof $=="string")return r($,z);var V=Object.prototype.toString.call($).slice(8,-1);if(V==="Object"&&$.constructor&&(V=$.constructor.name),V==="Map"||V==="Set")return Array.from($);if(V==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(V))return r($,z)}function r($,z){(z==null||z>$.length)&&(z=$.length);for(var V=0,K=new Array(z);V<z;V++)K[V]=$[V];return K}function f($,z){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object($)))return;var V=[],K=!0,H=!1,G=void 0;try{for(var ie=$[Symbol.iterator](),le;!(K=(le=ie.next()).done)&&!(V.push(le.value),z&&V.length===z);K=!0);}catch(ue){H=!0,G=ue}finally{try{!K&&ie.return!=null&&ie.return()}finally{if(H)throw G}}return V}function p($){if(Array.isArray($))return $}function m($,z){if($==null)return{};var V=E($,z),K,H;if(Object.getOwnPropertySymbols){var G=Object.getOwnPropertySymbols($);for(H=0;H<G.length;H++){if(K=G[H],z.indexOf(K)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call($,K))continue;V[K]=$[K]}}return V}function E($,z){if($==null)return{};var V={},K=Object.keys($),H,G;for(G=0;G<K.length;G++){if(H=K[G],z.indexOf(H)>=0)continue;V[H]=$[H]}return V}var y=function(z){var V=z.className,K=z.percent,H=z.prefixCls,G=z.strokeColor,ie=z.strokeLinecap,le=z.strokeWidth,ue=z.style,be=z.trailColor,Ce=z.trailWidth,se=z.transition,ce=m(z,["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"]);delete ce.gapPosition;var he=Array.isArray(K)?K:[K],ae=Array.isArray(G)?G:[G],Q=c(he),D=g(Q,1),F=D[0],W=le/2,Y=100-le/2,Z="M ".concat(ie==="round"?W:0,",").concat(W,`
L `).concat(ie==="round"?Y:100,",").concat(W),te="0 0 100 ".concat(le),q=0;return h.a.createElement("svg",C({className:L()("".concat(H,"-line"),V),viewBox:te,preserveAspectRatio:"none",style:ue},ce),h.a.createElement("path",{className:"".concat(H,"-line-trail"),d:Z,strokeLinecap:ie,stroke:be,strokeWidth:Ce||le,fillOpacity:"0"}),he.map(function(X,re){var me={strokeDasharray:"".concat(X,"px, 100px"),strokeDashoffset:"-".concat(q,"px"),transition:se||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},ve=ae[re]||ae[ae.length-1];return q+=X,h.a.createElement("path",{key:re,className:"".concat(H,"-line-path"),d:Z,strokeLinecap:ie,stroke:ve,strokeWidth:le,fillOpacity:"0",ref:F[re],style:me})}))};y.defaultProps=T;var u=y;function n(){return n=Object.assign||function($){for(var z=1;z<arguments.length;z++){var V=arguments[z];for(var K in V)Object.prototype.hasOwnProperty.call(V,K)&&($[K]=V[K])}return $},n.apply(this,arguments)}function o($,z){return R($)||i($,z)||w($,z)||l()}function l(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function w($,z){if(!$)return;if(typeof $=="string")return v($,z);var V=Object.prototype.toString.call($).slice(8,-1);if(V==="Object"&&$.constructor&&(V=$.constructor.name),V==="Map"||V==="Set")return Array.from($);if(V==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(V))return v($,z)}function v($,z){(z==null||z>$.length)&&(z=$.length);for(var V=0,K=new Array(z);V<z;V++)K[V]=$[V];return K}function i($,z){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object($)))return;var V=[],K=!0,H=!1,G=void 0;try{for(var ie=$[Symbol.iterator](),le;!(K=(le=ie.next()).done)&&!(V.push(le.value),z&&V.length===z);K=!0);}catch(ue){H=!0,G=ue}finally{try{!K&&ie.return!=null&&ie.return()}finally{if(H)throw G}}return V}function R($){if(Array.isArray($))return $}function k($,z){if($==null)return{};var V=d($,z),K,H;if(Object.getOwnPropertySymbols){var G=Object.getOwnPropertySymbols($);for(H=0;H<G.length;H++){if(K=G[H],z.indexOf(K)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call($,K))continue;V[K]=$[K]}}return V}function d($,z){if($==null)return{};var V={},K=Object.keys($),H,G;for(G=0;G<K.length;G++){if(H=K[G],z.indexOf(H)>=0)continue;V[H]=$[H]}return V}var b=0;function x($){return+$.replace("%","")}function _($){return Array.isArray($)?$:[$]}function B($,z,V,K){var H=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,G=arguments.length>5?arguments[5]:void 0,ie=50-K/2,le=0,ue=-ie,be=0,Ce=-2*ie;switch(G){case"left":le=-ie,ue=0,be=2*ie,Ce=0;break;case"right":le=ie,ue=0,be=-2*ie,Ce=0;break;case"bottom":ue=ie,Ce=2*ie;break;default:}var se="M 50,50 m ".concat(le,",").concat(ue,`
a `).concat(ie,",").concat(ie," 0 1 1 ").concat(be,",").concat(-Ce,`
a `).concat(ie,",").concat(ie," 0 1 1 ").concat(-be,",").concat(Ce),ce=Math.PI*2*ie,he={stroke:V,strokeDasharray:"".concat(z/100*(ce-H),"px ").concat(ce,"px"),strokeDashoffset:"-".concat(H/2+$/100*(ce-H),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"};return{pathString:se,pathStyle:he}}var U=function(z){var V=z.prefixCls,K=z.strokeWidth,H=z.trailWidth,G=z.gapDegree,ie=z.gapPosition,le=z.trailColor,ue=z.strokeLinecap,be=z.style,Ce=z.className,se=z.strokeColor,ce=z.percent,he=k(z,["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"]),ae=Object(I.useMemo)(function(){return b+=1,b},[]),Q=B(0,100,le,K,G,ie),D=Q.pathString,F=Q.pathStyle,W=_(ce),Y=_(se),Z=Y.find(function(me){return Object.prototype.toString.call(me)==="[object Object]"}),te=c(W),q=o(te,1),X=q[0],re=function(){var ve=0;return W.map(function(Te,Re){var Ie=Y[Re]||Y[Y.length-1],je=Object.prototype.toString.call(Ie)==="[object Object]"?"url(#".concat(V,"-gradient-").concat(ae,")"):"",Ne=B(ve,Te,Ie,K,G,ie);return ve+=Te,h.a.createElement("path",{key:Re,className:"".concat(V,"-circle-path"),d:Ne.pathString,stroke:je,strokeLinecap:ue,strokeWidth:K,opacity:Te===0?0:1,fillOpacity:"0",style:Ne.pathStyle,ref:X[Re]})})};return h.a.createElement("svg",n({className:L()("".concat(V,"-circle"),Ce),viewBox:"0 0 100 100",style:be},he),Z&&h.a.createElement("defs",null,h.a.createElement("linearGradient",{id:"".concat(V,"-gradient-").concat(ae),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(Z).sort(function(me,ve){return x(me)-x(ve)}).map(function(me,ve){return h.a.createElement("stop",{key:ve,offset:me,stopColor:Z[me]})}))),h.a.createElement("path",{className:"".concat(V,"-circle-trail"),d:D,stroke:le,strokeLinecap:ue,strokeWidth:H||K,fillOpacity:"0",style:F}),re().reverse())};U.defaultProps=T;var P=U,J={Line:u,Circle:P}},hQp1:function(M,ne,N){"use strict";N.d(ne,"a",function(){return h});var I;(function(S){S.FirstPage="firstPage",S.PrevPage="prevPage",S.NextPage="nextPage"})(I||(I={}));var h;(function(S){S[S.Single=0]="Single",S[S.Multiple=1]="Multiple",S[S.Judge=2]="Judge",S[S.Fill=3]="Fill",S[S.Subjective=4]="Subjective",S[S.Shixun=5]="Shixun",S[S.Program=6]="Program",S[S.Combine=7]="Combine"})(h||(h={}))},i3hx:function(M,ne,N){},i58Z:function(M,ne,N){M.exports={wrap:"wrap___Yg2Z9",addKnowledge:"addKnowledge___2FlI0",disabled:"disabled___1_wxN"}},jO9C:function(M,ne,N){(function(I,h,S){M.exports=ne=h(N("Ib8C"),N("OLod"))})(this,function(I){return I.pad.Iso97971={pad:function(h,S){h.concat(I.lib.WordArray.create([2147483648],1)),I.pad.ZeroPadding.pad(h,S)},unpad:function(h){I.pad.ZeroPadding.unpad(h),h.sigBytes--}},I.pad.Iso97971})},je13:function(M,ne,N){var I=N("5nXd"),h=N("gRFJ"),S=[N("uQRt")];M.exports=I.createStore(h,S)},kSUc:function(M,ne,N){},lOMy:function(M,ne,N){},lPiR:function(M,ne,N){(function(I,h){M.exports=ne=h(N("Ib8C"))})(this,function(I){return function(h){var S=I,L=S.lib,T=L.WordArray,c=L.Hasher,C=S.algo,g=[],s=[];(function(){function f(y){for(var u=h.sqrt(y),n=2;n<=u;n++)if(!(y%n))return!1;return!0}function p(y){return(y-(y|0))*4294967296|0}for(var m=2,E=0;E<64;)f(m)&&(E<8&&(g[E]=p(h.pow(m,1/2))),s[E]=p(h.pow(m,1/3)),E++),m++})();var a=[],r=C.SHA256=c.extend({_doReset:function(){this._hash=new T.init(g.slice(0))},_doProcessBlock:function(f,p){for(var m=this._hash.words,E=m[0],y=m[1],u=m[2],n=m[3],o=m[4],l=m[5],w=m[6],v=m[7],i=0;i<64;i++){if(i<16)a[i]=f[p+i]|0;else{var R=a[i-15],k=(R<<25|R>>>7)^(R<<14|R>>>18)^R>>>3,d=a[i-2],b=(d<<15|d>>>17)^(d<<13|d>>>19)^d>>>10;a[i]=k+a[i-7]+b+a[i-16]}var x=o&l^~o&w,_=E&y^E&u^y&u,B=(E<<30|E>>>2)^(E<<19|E>>>13)^(E<<10|E>>>22),U=(o<<26|o>>>6)^(o<<21|o>>>11)^(o<<7|o>>>25),P=v+U+x+s[i]+a[i],J=B+_;v=w,w=l,l=o,o=n+P|0,n=u,u=y,y=E,E=P+J|0}m[0]=m[0]+E|0,m[1]=m[1]+y|0,m[2]=m[2]+u|0,m[3]=m[3]+n|0,m[4]=m[4]+o|0,m[5]=m[5]+l|0,m[6]=m[6]+w|0,m[7]=m[7]+v|0},_doFinalize:function(){var f=this._data,p=f.words,m=this._nDataBytes*8,E=f.sigBytes*8;return p[E>>>5]|=128<<24-E%32,p[(E+64>>>9<<4)+14]=h.floor(m/4294967296),p[(E+64>>>9<<4)+15]=m,f.sigBytes=p.length*4,this._process(),this._hash},clone:function(){var f=c.clone.call(this);return f._hash=this._hash.clone(),f}});S.SHA256=c._createHelper(r),S.HmacSHA256=c._createHmacHelper(r)}(Math),I.SHA256})},lZu9:function(M,ne,N){(function(I){I(N("VrN/"),N("1eCo"),N("8EBN"))})(function(I){"use strict";I.defineMode("markdown",function(h,S){var L=I.getMode(h,"text/html"),T=L.name=="null";function c(K){if(I.findModeByName){var H=I.findModeByName(K);H&&(K=H.mime||H.mimes[0])}var G=I.getMode(h,K);return G.name=="null"?null:G}S.highlightFormatting===void 0&&(S.highlightFormatting=!1),S.maxBlockquoteDepth===void 0&&(S.maxBlockquoteDepth=0),S.taskLists===void 0&&(S.taskLists=!1),S.strikethrough===void 0&&(S.strikethrough=!1),S.emoji===void 0&&(S.emoji=!1),S.fencedCodeBlockHighlighting===void 0&&(S.fencedCodeBlockHighlighting=!0),S.fencedCodeBlockDefaultMode===void 0&&(S.fencedCodeBlockDefaultMode="text/plain"),S.xml===void 0&&(S.xml=!0),S.tokenTypeOverrides===void 0&&(S.tokenTypeOverrides={});var C={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 g in C)C.hasOwnProperty(g)&&S.tokenTypeOverrides[g]&&(C[g]=S.tokenTypeOverrides[g]);var s=/^([*\-_])(?:\s*\1){2,}\s*$/,a=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,r=/^\[(x| )\](?=\s)/i,f=S.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,p=/^ {0,3}(?:\={1,}|-{2,})\s*$/,m=/^[^#!\[\]*_\\<>` "'(~:]+/,E=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,y=/^\s*\[[^\]]+?\]:.*$/,u=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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 o(K,H,G){return H.f=H.inline=G,G(K,H)}function l(K,H,G){return H.f=H.block=G,G(K,H)}function w(K){return!K||!/\S/.test(K.string)}function v(K){if(K.linkTitle=!1,K.linkHref=!1,K.linkText=!1,K.em=!1,K.strong=!1,K.strikethrough=!1,K.quote=0,K.indentedCode=!1,K.f==R){var H=T;if(!H){var G=I.innerMode(L,K.htmlState);H=G.mode.name=="xml"&&G.state.tagStart===null&&!G.state.context&&G.state.tokenize.isInText}H&&(K.f=x,K.block=i,K.htmlState=null)}return K.trailingSpace=0,K.trailingSpaceNewLine=!1,K.prevLine=K.thisLine,K.thisLine={stream:null},null}function i(K,H){var G=K.column()===H.indentation,ie=w(H.prevLine.stream),le=H.indentedCode,ue=H.prevLine.hr,be=H.list!==!1,Ce=(H.listStack[H.listStack.length-1]||0)+3;H.indentedCode=!1;var se=H.indentation;if(H.indentationDiff===null&&(H.indentationDiff=H.indentation,be)){for(H.list=null;se<H.listStack[H.listStack.length-1];)H.listStack.pop(),H.listStack.length?H.indentation=H.listStack[H.listStack.length-1]:H.list=!1;H.list!==!1&&(H.indentationDiff=se-H.listStack[H.listStack.length-1])}var ce=!ie&&!ue&&!H.prevLine.header&&(!be||!le)&&!H.prevLine.fencedCodeEnd,he=(H.list===!1||ue||ie)&&H.indentation<=Ce&&K.match(s),ae=null;if(H.indentationDiff>=4&&(le||H.prevLine.fencedCodeEnd||H.prevLine.header||ie))return K.skipToEnd(),H.indentedCode=!0,C.code;if(K.eatSpace())return null;if(G&&H.indentation<=Ce&&(ae=K.match(f))&&ae[1].length<=6)return H.quote=0,H.header=ae[1].length,H.thisLine.header=!0,S.highlightFormatting&&(H.formatting="header"),H.f=H.inline,d(H);if(H.indentation<=Ce&&K.eat(">"))return H.quote=G?1:H.quote+1,S.highlightFormatting&&(H.formatting="quote"),K.eatSpace(),d(H);if(!he&&!H.setext&&G&&H.indentation<=Ce&&(ae=K.match(a))){var Q=ae[1]?"ol":"ul";return H.indentation=se+K.current().length,H.list=!0,H.quote=0,H.listStack.push(H.indentation),H.em=!1,H.strong=!1,H.code=!1,H.strikethrough=!1,S.taskLists&&K.match(r,!1)&&(H.taskList=!0),H.f=H.inline,S.highlightFormatting&&(H.formatting=["list","list-"+Q]),d(H)}else{if(G&&H.indentation<=Ce&&(ae=K.match(E,!0)))return H.quote=0,H.fencedEndRE=new RegExp(ae[1]+"+ *$"),H.localMode=S.fencedCodeBlockHighlighting&&c(ae[2]||S.fencedCodeBlockDefaultMode),H.localMode&&(H.localState=I.startState(H.localMode)),H.f=H.block=k,S.highlightFormatting&&(H.formatting="code-block"),H.code=-1,d(H);if(H.setext||(!ce||!be)&&!H.quote&&H.list===!1&&!H.code&&!he&&!y.test(K.string)&&(ae=K.lookAhead(1))&&(ae=ae.match(p)))return H.setext?(H.header=H.setext,H.setext=0,K.skipToEnd(),S.highlightFormatting&&(H.formatting="header")):(H.header=ae[0].charAt(0)=="="?1:2,H.setext=H.header),H.thisLine.header=!0,H.f=H.inline,d(H);if(he)return K.skipToEnd(),H.hr=!0,H.thisLine.hr=!0,C.hr;if(K.peek()==="[")return o(K,H,J)}return o(K,H,H.inline)}function R(K,H){var G=L.token(K,H.htmlState);if(!T){var ie=I.innerMode(L,H.htmlState);(ie.mode.name=="xml"&&ie.state.tagStart===null&&!ie.state.context&&ie.state.tokenize.isInText||H.md_inside&&K.current().indexOf(">")>-1)&&(H.f=x,H.block=i,H.htmlState=null)}return G}function k(K,H){var G=H.listStack[H.listStack.length-1]||0,ie=H.indentation<G,le=G+3;if(H.fencedEndRE&&H.indentation<=le&&(ie||K.match(H.fencedEndRE))){S.highlightFormatting&&(H.formatting="code-block");var ue;return ie||(ue=d(H)),H.localMode=H.localState=null,H.block=i,H.f=x,H.fencedEndRE=null,H.code=0,H.thisLine.fencedCodeEnd=!0,ie?l(K,H,H.block):ue}else return H.localMode?H.localMode.token(K,H.localState):(K.skipToEnd(),C.code)}function d(K){var H=[];if(K.formatting){H.push(C.formatting),typeof K.formatting=="string"&&(K.formatting=[K.formatting]);for(var G=0;G<K.formatting.length;G++)H.push(C.formatting+"-"+K.formatting[G]),K.formatting[G]==="header"&&H.push(C.formatting+"-"+K.formatting[G]+"-"+K.header),K.formatting[G]==="quote"&&(!S.maxBlockquoteDepth||S.maxBlockquoteDepth>=K.quote?H.push(C.formatting+"-"+K.formatting[G]+"-"+K.quote):H.push("error"))}if(K.taskOpen)return H.push("meta"),H.length?H.join(" "):null;if(K.taskClosed)return H.push("property"),H.length?H.join(" "):null;if(K.linkHref?H.push(C.linkHref,"url"):(K.strong&&H.push(C.strong),K.em&&H.push(C.em),K.strikethrough&&H.push(C.strikethrough),K.emoji&&H.push(C.emoji),K.linkText&&H.push(C.linkText),K.code&&H.push(C.code),K.image&&H.push(C.image),K.imageAltText&&H.push(C.imageAltText,"link"),K.imageMarker&&H.push(C.imageMarker)),K.header&&H.push(C.header,C.header+"-"+K.header),K.quote&&(H.push(C.quote),!S.maxBlockquoteDepth||S.maxBlockquoteDepth>=K.quote?H.push(C.quote+"-"+K.quote):H.push(C.quote+"-"+S.maxBlockquoteDepth)),K.list!==!1){var ie=(K.listStack.length-1)%3;ie?ie===1?H.push(C.list2):H.push(C.list3):H.push(C.list1)}return K.trailingSpaceNewLine?H.push("trailing-space-new-line"):K.trailingSpace&&H.push("trailing-space-"+(K.trailingSpace%2?"a":"b")),H.length?H.join(" "):null}function b(K,H){return K.match(m,!0)?d(H):void 0}function x(K,H){var G=H.text(K,H);if(typeof G!="undefined")return G;if(H.list)return H.list=null,d(H);if(H.taskList){var ie=K.match(r,!0)[1]===" ";return ie?H.taskOpen=!0:H.taskClosed=!0,S.highlightFormatting&&(H.formatting="task"),H.taskList=!1,d(H)}if(H.taskOpen=!1,H.taskClosed=!1,H.header&&K.match(/^#+$/,!0))return S.highlightFormatting&&(H.formatting="header"),d(H);var le=K.next();if(H.linkTitle){H.linkTitle=!1;var ue=le;le==="("&&(ue=")"),ue=(ue+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var be="^\\s*(?:[^"+ue+"\\\\]+|\\\\\\\\|\\\\.)"+ue;if(K.match(new RegExp(be),!0))return C.linkHref}if(le==="`"){var Ce=H.formatting;S.highlightFormatting&&(H.formatting="code"),K.eatWhile("`");var se=K.current().length;if(H.code==0&&(!H.quote||se==1))return H.code=se,d(H);if(se==H.code){var ce=d(H);return H.code=0,ce}else return H.formatting=Ce,d(H)}else if(H.code)return d(H);if(le==="\\"&&(K.next(),S.highlightFormatting)){var he=d(H),ae=C.formatting+"-escape";return he?he+" "+ae:ae}if(le==="!"&&K.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return H.imageMarker=!0,H.image=!0,S.highlightFormatting&&(H.formatting="image"),d(H);if(le==="["&&H.imageMarker&&K.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return H.imageMarker=!1,H.imageAltText=!0,S.highlightFormatting&&(H.formatting="image"),d(H);if(le==="]"&&H.imageAltText){S.highlightFormatting&&(H.formatting="image");var he=d(H);return H.imageAltText=!1,H.image=!1,H.inline=H.f=B,he}if(le==="["&&!H.image)return H.linkText&&K.match(/^.*?\]/)||(H.linkText=!0,S.highlightFormatting&&(H.formatting="link")),d(H);if(le==="]"&&H.linkText){S.highlightFormatting&&(H.formatting="link");var he=d(H);return H.linkText=!1,H.inline=H.f=K.match(/\(.*?\)| ?\[.*?\]/,!1)?B:x,he}if(le==="<"&&K.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){H.f=H.inline=_,S.highlightFormatting&&(H.formatting="link");var he=d(H);return he?he+=" ":he="",he+C.linkInline}if(le==="<"&&K.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){H.f=H.inline=_,S.highlightFormatting&&(H.formatting="link");var he=d(H);return he?he+=" ":he="",he+C.linkEmail}if(S.xml&&le==="<"&&K.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var Q=K.string.indexOf(">",K.pos);if(Q!=-1){var D=K.string.substring(K.start,Q);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(D)&&(H.md_inside=!0)}return K.backUp(1),H.htmlState=I.startState(L),l(K,H,R)}if(S.xml&&le==="<"&&K.match(/^\/\w*?>/))return H.md_inside=!1,"tag";if(le==="*"||le==="_"){for(var F=1,W=K.pos==1?" ":K.string.charAt(K.pos-2);F<3&&K.eat(le);)F++;var Y=K.peek()||" ",Z=!/\s/.test(Y)&&(!u.test(Y)||/\s/.test(W)||u.test(W)),te=!/\s/.test(W)&&(!u.test(W)||/\s/.test(Y)||u.test(Y)),q=null,X=null;if(F%2&&(!H.em&&Z&&(le==="*"||!te||u.test(W))?q=!0:H.em==le&&te&&(le==="*"||!Z||u.test(Y))&&(q=!1)),F>1&&(!H.strong&&Z&&(le==="*"||!te||u.test(W))?X=!0:H.strong==le&&te&&(le==="*"||!Z||u.test(Y))&&(X=!1)),X!=null||q!=null){S.highlightFormatting&&(H.formatting=q==null?"strong":X==null?"em":"strong em"),q===!0&&(H.em=le),X===!0&&(H.strong=le);var ce=d(H);return q===!1&&(H.em=!1),X===!1&&(H.strong=!1),ce}}else if(le===" "&&(K.eat("*")||K.eat("_"))){if(K.peek()===" ")return d(H);K.backUp(1)}if(S.strikethrough){if(le==="~"&&K.eatWhile(le)){if(H.strikethrough){S.highlightFormatting&&(H.formatting="strikethrough");var ce=d(H);return H.strikethrough=!1,ce}else if(K.match(/^[^\s]/,!1))return H.strikethrough=!0,S.highlightFormatting&&(H.formatting="strikethrough"),d(H)}else if(le===" "&&K.match(/^~~/,!0)){if(K.peek()===" ")return d(H);K.backUp(2)}}if(S.emoji&&le===":"&&K.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){H.emoji=!0,S.highlightFormatting&&(H.formatting="emoji");var re=d(H);return H.emoji=!1,re}return le===" "&&(K.match(/^ +$/,!1)?H.trailingSpace++:H.trailingSpace&&(H.trailingSpaceNewLine=!0)),d(H)}function _(K,H){var G=K.next();if(G===">"){H.f=H.inline=x,S.highlightFormatting&&(H.formatting="link");var ie=d(H);return ie?ie+=" ":ie="",ie+C.linkInline}return K.match(/^[^>]+/,!0),C.linkInline}function B(K,H){if(K.eatSpace())return null;var G=K.next();return G==="("||G==="["?(H.f=H.inline=P(G==="("?")":"]"),S.highlightFormatting&&(H.formatting="link-string"),H.linkHref=!0,d(H)):"error"}var U={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function P(K){return function(H,G){var ie=H.next();if(ie===K){G.f=G.inline=x,S.highlightFormatting&&(G.formatting="link-string");var le=d(G);return G.linkHref=!1,le}return H.match(U[K]),G.linkHref=!0,d(G)}}function J(K,H){return K.match(/^([^\]\\]|\\.)*\]:/,!1)?(H.f=$,K.next(),S.highlightFormatting&&(H.formatting="link"),H.linkText=!0,d(H)):o(K,H,x)}function $(K,H){if(K.match(/^\]:/,!0)){H.f=H.inline=z,S.highlightFormatting&&(H.formatting="link");var G=d(H);return H.linkText=!1,G}return K.match(/^([^\]\\]|\\.)+/,!0),C.linkText}function z(K,H){return K.eatSpace()?null:(K.match(/^[^\s]+/,!0),K.peek()===void 0?H.linkTitle=!0:K.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),H.f=H.inline=x,C.linkHref+" url")}var V={startState:function(){return{f:i,prevLine:{stream:null},thisLine:{stream:null},block:i,htmlState:null,indentation:0,inline:x,text:b,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(K){return{f:K.f,prevLine:K.prevLine,thisLine:K.thisLine,block:K.block,htmlState:K.htmlState&&I.copyState(L,K.htmlState),indentation:K.indentation,localMode:K.localMode,localState:K.localMode?I.copyState(K.localMode,K.localState):null,inline:K.inline,text:K.text,formatting:!1,linkText:K.linkText,linkTitle:K.linkTitle,linkHref:K.linkHref,code:K.code,em:K.em,strong:K.strong,strikethrough:K.strikethrough,emoji:K.emoji,header:K.header,setext:K.setext,hr:K.hr,taskList:K.taskList,list:K.list,listStack:K.listStack.slice(0),quote:K.quote,indentedCode:K.indentedCode,trailingSpace:K.trailingSpace,trailingSpaceNewLine:K.trailingSpaceNewLine,md_inside:K.md_inside,fencedEndRE:K.fencedEndRE}},token:function(K,H){if(H.formatting=!1,K!=H.thisLine.stream){if(H.header=0,H.hr=!1,K.match(/^\s*$/,!0))return v(H),null;if(H.prevLine=H.thisLine,H.thisLine={stream:K},H.taskList=!1,H.trailingSpace=0,H.trailingSpaceNewLine=!1,!H.localState&&(H.f=H.block,H.f!=R)){var G=K.match(/^\s*/,!0)[0].replace(/\t/g,n).length;if(H.indentation=G,H.indentationDiff=null,G>0)return null}}return H.f(K,H)},innerMode:function(K){return K.block==R?{state:K.htmlState,mode:L}:K.localState?{state:K.localState,mode:K.localMode}:{state:K,mode:V}},indent:function(K,H,G){return K.block==R&&L.indent?L.indent(K.htmlState,H,G):K.localState&&K.localMode.indent?K.localMode.indent(K.localState,H,G):I.Pass},blankLine:v,getType:d,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return V},"xml"),I.defineMIME("text/markdown","markdown"),I.defineMIME("text/x-markdown","markdown")})},mxV5:function(module,exports,__webpack_require__){(function(global){var require,require;(function(M){if(!0)module.exports=M();else var ne})(function(){var define,module,exports;return function(){function M(ne,N,I){function h(T,c){if(!N[T]){if(!ne[T]){var C=typeof require=="function"&&require;if(!c&&C)return require(T,!0);if(S)return S(T,!0);var g=new Error("Cannot find module '"+T+"'");throw g.code="MODULE_NOT_FOUND",g}var s=N[T]={exports:{}};ne[T][0].call(s.exports,function(a){var r=ne[T][1][a];return h(r||a)},s,s.exports,M,ne,N,I)}return N[T].exports}for(var S=typeof require=="function"&&require,L=0;L<I.length;L++)h(I[L]);return h}return M}()({1:[function(M,ne,N){"use strict";var I=M("./browser/client");I.Buffer=M("buffer").Buffer,I.urllib=M("../shims/xhr"),I.version=M("./browser/version").version,ne.exports=I},{"../shims/xhr":291,"./browser/client":2,"./browser/version":5,buffer:73}],2:[function(M,ne,N){(function(I,h){"use strict";var S=M("babel-runtime/core-js/promise"),L=s(S),T=M("babel-runtime/regenerator"),c=s(T),C=M("babel-runtime/core-js/object/assign"),g=s(C);function s(J){return J&&J.__esModule?J:{default:J}}var a=M("debug")("ali-oss"),r=M("copy-to"),f=M("xml2js"),p=M("agentkeepalive"),m=M("merge-descriptors"),E=M("url"),y=M("is-type-of"),u=M("platform"),n=M("utility"),o=M("urllib"),l=M("./version"),w=M("bowser"),v=M("../common/signUtils"),i=M("../common/utils/isIP"),R=i.isIP,k=M("../common/client/initOptions"),d=M("../common/utils/createRequest"),b=d.createRequest,x=new p;function _(){var J=u.name,$=u.version;J&&J.toLowerCase&&J.toLowerCase()==="ie"&&$.split(".")[0]<10&&console.warn("ali-oss does not support the current browser")}function B(){return location&&location.protocol==="https:"}function U(J,$){if(_(),!(this instanceof U))return new U(J,$);J&&J.inited?this.options=J:this.options=U.initOptions(J),this.options.cancelFlag=!1,this.options.urllib?this.urllib=this.options.urllib:(this.urllib=o,this.agent=this.options.agent||x),this.ctx=$,this.userAgent=this._getUserAgent(),this.options.amendTimeSkewed=0}ne.exports=U,U.initOptions=function($){$.stsToken||console.warn("Please use STS Token for safety, see more details at https://help.aliyun.com/document_detail/32077.html");var z=(0,g.default)({secure:B(),useFetch:!1},$);return k(z)};var P=U.prototype;P.debug=a,m(P,M("./object")),m(P,M("../common/bucket/getBucketWebsite")),m(P,M("../common/bucket/putBucketWebsite")),m(P,M("../common/bucket/deleteBucketWebsite")),m(P,M("../common/bucket/getBucketLifecycle")),m(P,M("../common/bucket/putBucketLifecycle")),m(P,M("../common/bucket/deleteBucketLifecycle")),m(P,M("../common/bucket/putBucketVersioning")),m(P,M("../common/bucket/getBucketVersioning")),m(P,M("./managed-upload")),m(P,M("../common/multipart")),m(P,M("../common/parallel")),P.signature=function($){return this.debug("authorization stringToSign: %s",$,"info"),v.computeSignature(this.options.accessKeySecret,$)},P.authorization=function($,z,V,K){var H=v.buildCanonicalString($.toUpperCase(),z,{headers:K,parameters:V});return v.authorization(this.options.accessKeyId,this.options.accessKeySecret,H)},P.request=function($){var z,V,K,H,G,ie;return c.default.async(function(ue){for(;;)switch(ue.prev=ue.next){case 0:return z=b.call(this,$),this.options.useFetch||(z.params.mode="disable-fetch"),V=void 0,K=void 0,H=!!$.stream,ue.prev=5,ue.next=8,c.default.awrap(this.urllib.request(z.url,z.params));case 8:V=ue.sent,this.debug("response %s %s, got %s, headers: %j",$.method,z.url,V.status,V.headers,"info"),ue.next=15;break;case 12:ue.prev=12,ue.t0=ue.catch(5),K=ue.t0;case 15:if(G=void 0,!(V&&$.successStatuses&&$.successStatuses.indexOf(V.status)===-1)){ue.next=28;break}return ue.next=19,c.default.awrap(this.requestError(V));case 19:if(G=ue.sent,!(G.code==="RequestTimeTooSkewed"&&!H)){ue.next=25;break}return this.options.amendTimeSkewed=+new Date(G.serverTime)-new Date,ue.next=24,c.default.awrap(this.request($));case 24:return ue.abrupt("return",ue.sent);case 25:G.params=$,ue.next=32;break;case 28:if(!K){ue.next=32;break}return ue.next=31,c.default.awrap(this.requestError(K));case 31:G=ue.sent;case 32:if(!G){ue.next=34;break}throw G;case 34:if(!$.xmlResponse){ue.next=39;break}return ue.next=37,c.default.awrap(this.parseXML(V.data));case 37:ie=ue.sent,V.data=ie;case 39:return ue.abrupt("return",V);case 40:case"end":return ue.stop()}},null,this,[[5,12]])},P._getResource=function($){var z="/";return $.bucket&&(z+=$.bucket+"/"),$.object&&(z+=$.object),z},P._isIP=R,P._escape=function($){return n.encodeURIComponent($).replace(/%2F/g,"/")},P._getReqUrl=function($){var z={};r(this.options.endpoint).to(z);var V=this._isIP(z.hostname),K=this.options.cname;$.bucket&&!K&&!V&&(z.host=$.bucket+"."+z.host);var H="/";$.bucket&&V&&(H+=$.bucket+"/"),$.object&&(H+=this._escape($.object).replace(/\+/g,"%2B")),z.pathname=H;var G={};if($.query&&m(G,$.query),$.subres){var ie={};y.string($.subres)?ie[$.subres]="":y.array($.subres)?$.subres.forEach(function(le){ie[le]=""}):ie=$.subres,m(G,ie)}return z.query=G,E.format(z)},P._getUserAgent=function(){var $=h&&h.browser?"js":"nodejs",z="aliyun-sdk-"+$+"/"+l.version,V=u.description;return!V&&h&&(V="Node.js "+h.version.slice(1)+" on "+h.platform+" "+h.arch),this._checkUserAgent(z+" "+V)},P._checkUserAgent=function($){var z=$.replace(/\u03b1/,"alpha").replace(/\u03b2/,"beta");return z},P.checkBrowserAndVersion=function($,z){return w.name===$&&w.version.split(".")[0]===z},P.parseXML=function($){return new L.default(function(z,V){I.isBuffer($)&&($=$.toString()),f.parseString($,{explicitRoot:!1,explicitArray:!1},function(K,H){K?V(K):z(H)})})},P.requestError=function($){var z,V,K,H;return c.default.async(function(ie){for(;;)switch(ie.prev=ie.next){case 0:if(z=null,!(!$.data||!$.data.length)){ie.next=5;break}$.status===-1||$.status===-2?(z=new Error($.message),z.name=$.name,z.status=$.status,z.code=$.name):($.status===404?(z=new Error("Object not exists"),z.name="NoSuchKeyError",z.status=404,z.code="NoSuchKey"):$.status===412?(z=new Error("Pre condition failed"),z.name="PreconditionFailedError",z.status=412,z.code="PreconditionFailed"):(z=new Error("Unknow error, status: "+$.status),z.name="UnknowError",z.status=$.status),z.requestId=$.headers["x-oss-request-id"],z.host=""),ie.next=33;break;case 5:return V=String($.data),this.debug("request response error data: %s",V,"error"),K=void 0,ie.prev=8,ie.next=11,c.default.awrap(this.parseXML(V));case 11:if(ie.t0=ie.sent,ie.t0){ie.next=14;break}ie.t0={};case 14:K=ie.t0,ie.next=24;break;case 17:return ie.prev=17,ie.t1=ie.catch(8),this.debug(V,"error"),ie.t1.message+=`
raw xml: `+V,ie.t1.status=$.status,ie.t1.requestId=$.headers["x-oss-request-id"],ie.abrupt("return",ie.t1);case 24:H=K.Message||"unknow request error, status: "+$.status,K.Condition&&(H+=" (condition: "+K.Condition+")"),z=new Error(H),z.name=K.Code?K.Code+"Error":"UnknowError",z.status=$.status,z.code=K.Code,z.requestId=K.RequestId,z.hostId=K.HostId,z.serverTime=K.ServerTime;case 33:return this.debug("generate error %j",z,"error"),ie.abrupt("return",z);case 35:case"end":return ie.stop()}},null,this,[[8,17]])}}).call(this,{isBuffer:M("../../node_modules/is-buffer/index.js")},M("_process"))},{"../../node_modules/is-buffer/index.js":197,"../common/bucket/deleteBucketLifecycle":6,"../common/bucket/deleteBucketWebsite":7,"../common/bucket/getBucketLifecycle":8,"../common/bucket/getBucketVersioning":9,"../common/bucket/getBucketWebsite":10,"../common/bucket/putBucketLifecycle":11,"../common/bucket/putBucketVersioning":12,"../common/bucket/putBucketWebsite":13,"../common/client/initOptions":15,"../common/multipart":18,"../common/parallel":33,"../common/signUtils":34,"../common/utils/createRequest":38,"../common/utils/isIP":45,"./managed-upload":3,"./object":4,"./version":5,_process:208,agentkeepalive:48,"babel-runtime/core-js/object/assign":54,"babel-runtime/core-js/promise":61,"babel-runtime/regenerator":68,bowser:70,"copy-to":76,debug:288,"is-type-of":289,"merge-descriptors":200,platform:206,url:238,urllib:291,utility:290,xml2js:249}],3:[function(M,ne,N){(function(I){"use strict";var h=M("babel-runtime/core-js/array/from"),S=g(h),L=M("babel-runtime/core-js/promise"),T=g(L),c=M("babel-runtime/regenerator"),C=g(c);function g(v){return v&&v.__esModule?v:{default:v}}var s=M("is-type-of"),a=M("util"),r=M("path"),f=M("mime"),p=M("copy-to"),m=M("../common/utils/isBlob"),E=m.isBlob,y=M("../common/utils/isFile"),u=y.isFile,n=N;n.multipartUpload=function(i,R,k){var d,b,x,_,B,U,P,J,$;return C.default.async(function(V){for(;;)switch(V.prev=V.next){case 0:if(this.resetCancelFlag(),k=k||{},!(k.checkpoint&&k.checkpoint.uploadId)){V.next=6;break}return V.next=5,C.default.awrap(this._resumeMultipart(k.checkpoint,k));case 5:return V.abrupt("return",V.sent);case 6:return d=100*1024,k.mime||(u(R)?k.mime=f.getType(r.extname(R.name)):E(R)?k.mime=R.type:k.mime=f.getType(r.extname(R))),k.headers=k.headers||{},this._convertMetaToHeaders(k.meta,k.headers),V.next=12,C.default.awrap(this._getFileSize(R));case 12:if(b=V.sent,!(b<d)){V.next=25;break}return x=this._createStream(R,0,b),k.contentLength=b,V.next=18,C.default.awrap(this.putStream(i,x,k));case 18:if(_=V.sent,!(k&&k.progress)){V.next=22;break}return V.next=22,C.default.awrap(k.progress(1));case 22:return B={res:_.res,bucket:this.options.bucket,name:i,etag:_.res.headers.etag},(k.headers&&k.headers["x-oss-callback"]||k.callback)&&(B.data=_.data),V.abrupt("return",B);case 25:if(!(k.partSize&&!(parseInt(k.partSize,10)===k.partSize))){V.next=27;break}throw new Error("partSize must be int number");case 27:if(!(k.partSize&&k.partSize<d)){V.next=29;break}throw new Error("partSize must not be smaller than "+d);case 29:return V.next=31,C.default.awrap(this.initMultipartUpload(i,k));case 31:if(U=V.sent,P=U.uploadId,J=this._getPartSize(b,k.partSize),$={file:R,name:i,fileSize:b,partSize:J,uploadId:P,doneParts:[]},!(k&&k.progress)){V.next=38;break}return V.next=38,C.default.awrap(k.progress(0,$,U.res));case 38:return V.next=40,C.default.awrap(this._resumeMultipart($,k));case 40:return V.abrupt("return",V.sent);case 41:case"end":return V.stop()}},null,this)},n._resumeMultipart=function(i,R){var k,d,b,x,_,B,U,P,J,$,z,V,K,H,G,ie,le,ue;return C.default.async(function(Ce){for(;;)switch(Ce.prev=Ce.next){case 0:if(k=this,!this.isCancel()){Ce.next=3;break}throw this._makeCancelEvent();case 3:return d=i.file,b=i.fileSize,x=i.partSize,_=i.uploadId,B=i.doneParts,U=i.name,P=[],B.length>0&&p(B).to(P),J=this._divideParts(b,x),$=J.length,z=!1,V=function(ce,he){var ae=this;return new T.default(function(D,F){var W,Y,Z,te;return C.default.async(function(X){for(;;)switch(X.prev=X.next){case 0:if(X.prev=0,ce.isCancel()){X.next=18;break}return W=J[he-1],Y={stream:ce._createStream(d,W.start,W.end),size:W.end-W.start},X.next=6,C.default.awrap(ce._uploadPart(U,_,he,Y));case 6:if(Z=X.sent,!(!ce.isCancel()&&!z)){X.next=15;break}if(i.doneParts.push({number:he,etag:Z.res.headers.etag}),!R.progress){X.next=12;break}return X.next=12,C.default.awrap(R.progress(B.length/$,i,Z.res));case 12:D({number:he,etag:Z.res.headers.etag}),X.next=16;break;case 15:D();case 16:X.next=19;break;case 18:D();case 19:X.next=30;break;case 21:X.prev=21,X.t0=X.catch(0),te=new Error,te.name=X.t0.name,te.message=X.t0.message,te.stack=X.t0.stack,te.partNum=he,p(X.t0).to(te),F(te);case 30:case"end":return X.stop()}},null,ae,[[0,21]])})},K=(0,S.default)(new Array($),function(se,ce){return ce+1}),H=P.map(function(se){return se.number}),G=K.filter(function(se){return H.indexOf(se)<0}),ie=5,le=R.parallel||ie,Ce.next=17,C.default.awrap(this._parallel(G,le,function(se){return new T.default(function(ce,he){V(k,se).then(function(ae){ae&&P.push(ae),ce()}).catch(function(ae){he(ae)})})}));case 17:if(ue=Ce.sent,z=!0,!this.isCancel()){Ce.next=22;break}throw V=null,this._makeCancelEvent();case 22:if(!(ue&&ue.length>0)){Ce.next=25;break}throw ue[0].message="Failed to upload some parts with error: "+ue[0].toString()+" part_num: "+ue[0].partNum,ue[0];case 25:return Ce.next=27,C.default.awrap(this.completeMultipartUpload(U,_,P,R));case 27:return Ce.abrupt("return",Ce.sent);case 28:case"end":return Ce.stop()}},null,this)},n._getFileSize=function(i){return C.default.async(function(k){for(;;)switch(k.prev=k.next){case 0:if(!s.buffer(i)){k.next=4;break}return k.abrupt("return",i.length);case 4:if(!(E(i)||u(i))){k.next=6;break}return k.abrupt("return",i.size);case 6:throw new Error("_getFileSize requires Buffer/File/Blob.");case 7:case"end":return k.stop()}},null,this)};var o=M("stream"),l=o.Readable;function w(v,i){if(!(this instanceof w))return new w(v,i);l.call(this,i),this.file=v,this.reader=new FileReader,this.start=0,this.finish=!1,this.fileBuffer=null}a.inherits(w,l),w.prototype.readFileAndPush=function(i){if(this.fileBuffer)for(var R=!0;R&&this.fileBuffer&&this.start<this.fileBuffer.length;){var k=this.start,d=k+i;d=d>this.fileBuffer.length?this.fileBuffer.length:d,this.start=d,R=this.push(this.fileBuffer.slice(k,d))}},w.prototype._read=function(i){if(this.file&&this.start>=this.file.size||this.fileBuffer&&this.start>=this.fileBuffer.length||this.finish||this.start===0&&!this.file){this.finish||(this.fileBuffer=null,this.finish=!0),this.push(null);return}var R=16*1024;i=i||R;var k=this;this.reader.onload=function(b){k.fileBuffer=I.from(new Uint8Array(b.target.result)),k.file=null,k.readFileAndPush(i)},this.start===0?this.reader.readAsArrayBuffer(this.file):this.readFileAndPush(i)},n._createStream=function(i,R,k){if(E(i)||u(i))return new w(i.slice(R,k));throw new Error("_createStream requires File/Blob.")},n._getPartSize=function(i,R){var k=10*1e3,d=1024*1024;return R?Math.max(Math.ceil(i/k),R):d},n._divideParts=function(i,R){for(var k=Math.ceil(i/R),d=[],b=0;b<k;b++){var x=R*b,_=Math.min(x+R,i);d.push({start:x,end:_})}return d}}).call(this,M("buffer").Buffer)},{"../common/utils/isBlob":43,"../common/utils/isFile":44,"babel-runtime/core-js/array/from":52,"babel-runtime/core-js/promise":61,"babel-runtime/regenerator":68,buffer:73,"copy-to":76,"is-type-of":289,mime:202,path:205,stream:230,util:243}],4:[function(M,ne,N){"use strict";var I=M("babel-runtime/core-js/promise"),h=s(I),S=M("babel-runtime/core-js/object/keys"),L=s(S),T=M("babel-runtime/core-js/object/assign"),c=s(T),C=M("babel-runtime/regenerator"),g=s(C);function s(k){return k&&k.__esModule?k:{default:k}}var a=M("utility"),r=M("fs"),f=M("is-type-of"),p=M("url"),m=M("copy-to"),E=M("path"),y=M("mime"),u=M("../common/callback"),n=M("../common/signUtils"),o=M("merge-descriptors"),l=M("../common/utils/isBlob"),w=l.isBlob,v=M("../common/utils/isFile"),i=v.isFile,R=N;R.append=function(d,b,x){var _;return g.default.async(function(U){for(;;)switch(U.prev=U.next){case 0:return x=x||{},x.position===void 0&&(x.position="0"),x.subres={append:"",position:x.position},x.method="POST",U.next=6,g.default.awrap(this.put(d,b,x));case 6:return _=U.sent,_.nextAppendPosition=_.res.headers["x-oss-next-append-position"],U.abrupt("return",_);case 9:case"end":return U.stop()}},null,this)},R.put=function(d,b,x){var _,B,U,P,J,$,z;return g.default.async(function(K){for(;;)switch(K.prev=K.next){case 0:if(_=void 0,x=x||{},d=this._objectName(d),!f.buffer(b)){K.next=7;break}_=b,K.next=33;break;case 7:if(!(w(b)||i(b))){K.next=32;break}return x.mime||(i(b)?x.mime=y.getType(E.extname(b.name)):x.mime=b.type),B=this._createStream(b,0,b.size),K.next=12,g.default.awrap(this._getFileSize(b));case 12:return x.contentLength=K.sent,K.prev=13,K.next=16,g.default.awrap(this.putStream(d,B,x));case 16:return U=K.sent,K.abrupt("return",U);case 20:if(K.prev=20,K.t0=K.catch(13),!(K.t0.code==="RequestTimeTooSkewed")){K.next=29;break}return this.options.amendTimeSkewed=+new Date(K.t0.serverTime)-new Date,K.next=26,g.default.awrap(this.put(d,b,x));case 26:return K.abrupt("return",K.sent);case 29:throw K.t0;case 30:K.next=33;break;case 32:throw new TypeError("Must provide Buffer/Blob/File for put.");case 33:return x.headers=x.headers||{},this._convertMetaToHeaders(x.meta,x.headers),P=x.method||"PUT",J=this._objectRequestParams(P,d,x),u.encodeCallback(J,x),J.mime=x.mime,J.content=_,J.successStatuses=[200],K.next=43,g.default.awrap(this.request(J));case 43:return $=K.sent,z={name:d,url:this._objectUrl(d),res:$.res},J.headers&&J.headers["x-oss-callback"]&&(z.data=JSON.parse($.data.toString())),K.abrupt("return",z);case 47:case"end":return K.stop()}},null,this,[[13,20]])},R.putStream=function(d,b,x){var _,B,U,P;return g.default.async(function($){for(;;)switch($.prev=$.next){case 0:return x=x||{},x.headers=x.headers||{},d=this._objectName(d),x.contentLength?x.headers["Content-Length"]=x.contentLength:x.headers["Transfer-Encoding"]="chunked",this._convertMetaToHeaders(x.meta,x.headers),_=x.method||"PUT",B=this._objectRequestParams(_,d,x),u.encodeCallback(B,x),B.mime=x.mime,B.stream=b,B.successStatuses=[200],$.next=13,g.default.awrap(this.request(B));case 13:return U=$.sent,P={name:d,url:this._objectUrl(d),res:U.res},B.headers&&B.headers["x-oss-callback"]&&(P.data=JSON.parse(U.data.toString())),$.abrupt("return",P);case 17:case"end":return $.stop()}},null,this)},o(R,M("../common/object/copyObject")),o(R,M("../common/object/getObjectTagging")),o(R,M("../common/object/putObjectTagging")),o(R,M("../common/object/deleteObjectTagging")),o(R,M("../common/image")),o(R,M("../common/object/getBucketVersions")),o(R,M("../common/object/getACL")),o(R,M("../common/object/putACL")),o(R,M("../common/object/head")),o(R,M("../common/object/delete")),o(R,M("../common/object/get")),o(R,M("../common/object/putSymlink")),o(R,M("../common/object/getSymlink")),o(R,M("../common/object/deleteMulti")),o(R,M("../common/object/getObjectMeta")),R.putMeta=function(d,b,x){var _;return g.default.async(function(U){for(;;)switch(U.prev=U.next){case 0:return U.next=2,g.default.awrap(this.copy(d,d,{meta:b||{},timeout:x&&x.timeout,ctx:x&&x.ctx}));case 2:return _=U.sent,U.abrupt("return",_);case 4:case"end":return U.stop()}},null,this)},R.list=function(d,b){var x,_,B,U,P;return g.default.async(function($){for(;;)switch($.prev=$.next){case 0:return x=this._objectRequestParams("GET","",b),x.query=d,x.xmlResponse=!0,x.successStatuses=[200],$.next=6,g.default.awrap(this.request(x));case 6:return _=$.sent,B=_.data.Contents,U=this,B&&(Array.isArray(B)||(B=[B]),B=B.map(function(z){return{name:z.Key,url:U._objectUrl(z.Key),lastModified:z.LastModified,etag:z.ETag,type:z.Type,size:Number(z.Size),storageClass:z.StorageClass,owner:{id:z.Owner.ID,displayName:z.Owner.DisplayName}}})),P=_.data.CommonPrefixes||null,P&&(Array.isArray(P)||(P=[P]),P=P.map(function(z){return z.Prefix})),$.abrupt("return",{res:_.res,objects:B,prefixes:P,nextMarker:_.data.NextMarker||null,isTruncated:_.data.IsTruncated==="true"});case 13:case"end":return $.stop()}},null,this)},R.restore=function(d,b){var x,_;return g.default.async(function(U){for(;;)switch(U.prev=U.next){case 0:return b=b||{},b.subres=(0,c.default)({restore:""},b.subres),b.versionId&&(b.subres.versionId=b.versionId),x=this._objectRequestParams("POST",d,b),x.successStatuses=[202],U.next=7,g.default.awrap(this.request(x));case 7:return _=U.sent,U.abrupt("return",{res:_.res});case 9:case"end":return U.stop()}},null,this)},R.signatureUrl=function(d,b){b=b||{},d=this._objectName(d),b.method=b.method||"GET";var x=a.timestamp()+(b.expires||1800),_={bucket:this.options.bucket,object:d},B=this._getResource(_);this.options.stsToken&&(b["security-token"]=this.options.stsToken);var U=n._signatureForURL(this.options.accessKeySecret,b,B,x),P=p.parse(this._getReqUrl(_));return P.query={OSSAccessKeyId:this.options.accessKeyId,Expires:x,Signature:U.Signature},m(U.subResource).to(P.query),P.format()},R.getObjectUrl=function(d,b){return b?b[b.length-1]!=="/"&&(b+="/"):b=this.options.endpoint.format(),b+this._escape(this._objectName(d))},R._objectUrl=function(d){return this._getReqUrl({bucket:this.options.bucket,object:d})},R.generateObjectUrl=function(k,d){if(d)d[d.length-1]!=="/"&&(d+="/");else{d=this.options.endpoint.format();var b=p.parse(d),x=this.options.bucket;b.hostname=x+"."+b.hostname,b.host=x+"."+b.host,d=b.format()}return d+this._escape(this._objectName(k))},R._objectRequestParams=function(d,b,x){if(!this.options.bucket)throw new Error("Please create a bucket first");x=x||{},b=this._objectName(b);var _={object:b,bucket:this.options.bucket,method:d,subres:x&&x.subres,timeout:x&&x.timeout,ctx:x&&x.ctx};return x.headers&&(_.headers={},m(x.headers).to(_.headers)),_},R._objectName=function(d){return d.replace(/^\/+/,"")},R._convertMetaToHeaders=function(d,b){if(!d)return;(0,L.default)(d).forEach(function(x){b["x-oss-meta-"+x]=d[x]})},R._deleteFileSafe=function(d){var b=this;return new h.default(function(x){r.exists(d,function(_){_?r.unlink(d,function(B){B&&b.debug("unlink %j error: %s",d,B,"error"),x()}):x()})})}},{"../common/callback":14,"../common/image":16,"../common/object/copyObject":19,"../common/object/delete":20,"../common/object/deleteMulti":21,"../common/object/deleteObjectTagging":22,"../common/object/get":23,"../common/object/getACL":24,"../common/object/getBucketVersions":25,"../common/object/getObjectMeta":26,"../common/object/getObjectTagging":27,"../common/object/getSymlink":28,"../common/object/head":29,"../common/object/putACL":30,"../common/object/putObjectTagging":31,"../common/object/putSymlink":32,"../common/signUtils":34,"../common/utils/isBlob":43,"../common/utils/isFile":44,"babel-runtime/core-js/object/assign":54,"babel-runtime/core-js/object/keys":60,"babel-runtime/core-js/promise":61,"babel-runtime/regenerator":68,"copy-to":76,fs:71,"is-type-of":289,"merge-descriptors":200,mime:202,path:205,url:238,utility:290}],5:[function(M,ne,N){"use strict";N.version="6.10.0"},{}],6:[function(M,ne,N){"use strict";var I=M("babel-runtime/regenerator"),h=S(I);function S(C){return C&&C.__esModule?C:{default:C}}var L=M("../utils/checkBucketName"),T=L.checkBucketName,c=N;c.deleteBucketLifecycle=function(g,s){var a,r;return h.default.async(function(p){for(;;)switch(p.prev=p.next){case 0:return T(g),a=this._bucketRequestParams("DELETE",g,"lifecycle",s),a.successStatuses=[204],p.next=5,h.default.awrap(this.request(a));case 5:return r=p.sent,p.abrupt("return",{res:r.res});case 7:case"end":return p.stop()}},null,this)}},{"../utils/checkBucketName":35,"babel-runtime/regenerator":68}],7:[function(M,ne,N){"use strict";var I=M("babel-runtime/regenerator"),h=S(I);function S(C){return C&&C.__esModule?C:{default:C}}var L=M("../utils/checkBucketName"),T=L.checkBucketName,c=N;c.deleteBucketWebsite=function(g,s){var a,r;return h.default.async(function(p){for(;;)switch(p.prev=p.next){case 0:return T(g),a=this._bucketRequestParams("DELETE",g,"website",s),a.successStatuses=[204],p.next=5,h.default.awrap(this.request(a));case 5:return r=p.sent,p.abrupt("return",{res:r.res});case 7:case"end":return p.stop()}},null,this)}},{"../utils/checkBucketName":35,"babel-runtime/regenerator":68}],8:[function(M,ne,N){"use strict";var I=M("babel-runtime/regenerator"),h=S(I);function S(r){return r&&r.__esModule?r:{default:r}}var L=M("../utils/checkBucketName"),T=L.checkBucketName,c=M("../utils/isArray"),C=c.isArray,g=M("../utils/formatObjKey"),s=g.formatObjKey,a=N;a.getBucketLifecycle=function(f,p){var m,E,y;return h.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return T(f),m=this._bucketRequestParams("GET",f,"lifecycle",p),m.successStatuses=[200],m.xmlResponse=!0,n.next=6,h.default.awrap(this.request(m));case 6:return E=n.sent,y=E.data.Rule||null,y&&(C(y)||(y=[y]),y=y.map(function(o){return o.ID&&(o.id=o.ID,delete o.ID),o.Tag&&!C(o.Tag)&&(o.Tag=[o.Tag]),s(o,"firstLowerCase")})),n.abrupt("return",{rules:y,res:E.res});case 10:case"end":return n.stop()}},null,this)}},{"../utils/checkBucketName":35,"../utils/formatObjKey":40,"../utils/isArray":42,"babel-runtime/regenerator":68}],9:[function(M,ne,N){"use strict";var I=M("babel-runtime/regenerator"),h=S(I);function S(C){return C&&C.__esModule?C:{default:C}}var L=M("../utils/checkBucketName"),T=L.checkBucketName,c=N;c.getBucketVersioning=function(g,s){var a,r,f;return h.default.async(function(m){for(;;)switch(m.prev=m.next){case 0:return T(g),a=this._bucketRequestParams("GET",g,"versioning",s),a.xmlResponse=!0,a.successStatuses=[200],m.next=6,h.default.awrap(this.request(a));case 6:return r=m.sent,f=r.data.Status,m.abrupt("return",{status:r.status,versionStatus:f,res:r.res});case 9:case"end":return m.stop()}},null,this)}},{"../utils/checkBucketName":35,"babel-runtime/regenerator":68}],10:[function(M,ne,N){"use strict";var I=M("babel-runtime/regenerator"),h=S(I);function S(s){return s&&s.__esModule?s:{default:s}}var L=M("../utils/checkBucketName"),T=L.checkBucketName,c=M("../utils/isObject"),C=c.isObject,g=N;g.getBucketWebsite=function(a,r){var f,p,m;return h.default.async(function(y){for(;;)switch(y.prev=y.next){case 0:return T(a),f=this._bucketRequestParams("GET",a,"website",r),f.successStatuses=[200],f.xmlResponse=!0,y.next=6,h.default.awrap(this.request(f));case 6:return p=y.sent,m=[],p.data.RoutingRules&&p.data.RoutingRules.RoutingRule&&(C(p.data.RoutingRules.RoutingRule)?m=[p.data.RoutingRules.RoutingRule]:m=p.data.RoutingRules.RoutingRule),y.abrupt("return",{index:p.data.IndexDocument&&p.data.IndexDocument.Suffix||"",supportSubDir:p.data.IndexDocument&&p.data.IndexDocument.SupportSubDir||"false",type:p.data.IndexDocument&&p.data.IndexDocument.Type,routingRules:m,error:p.data.ErrorDocument&&p.data.ErrorDocument.Key||null,res:p.res});case 10:case"end":return y.stop()}},null,this)}},{"../utils/checkBucketName":35,"../utils/isObject":46,"babel-runtime/regenerator":68}],11:[function(M,ne,N){"use strict";var I=M("babel-runtime/regenerator"),h=S(I);function S(i){return i&&i.__esModule?i:{default:i}}var L=M("../utils/checkBucketName"),T=L.checkBucketName,c=M("../utils/isArray"),C=c.isArray,g=M("../utils/deepCopy"),s=g.deepCopy,a=M("../utils/isObject"),r=a.isObject,f=M("../utils/obj2xml"),p=f.obj2xml,m=M("../utils/checkObjectTag"),E=m.checkObjectTag,y=M("../utils/getStrBytesCount"),u=y.getStrBytesCount,n=N;n.putBucketLifecycle=function(R,k,d){var b,x,_,B,U;return h.default.async(function(J){for(;;)switch(J.prev=J.next){case 0:if(T(R),C(k)){J.next=3;break}throw new Error("rules must be Array");case 3:return b=this._bucketRequestParams("PUT",R,"lifecycle",d),x=[],_={LifecycleConfiguration:{Rule:x}},k.forEach(function($){o($),v($),$.id&&($.ID=$.id,delete $.id),x.push($)}),B=p(_,{headers:!0,firstUpperCase:!0}),b.content=B,b.mime="xml",b.successStatuses=[200],J.next=13,h.default.awrap(this.request(b));case 13:return U=J.sent,J.abrupt("return",{res:U.res});case 15:case"end":return J.stop()}},null,this)};function o(i){i.days&&(i.expiration={days:i.days}),i.date&&(i.expiration={createdBeforeDate:i.date})}function l(i,R){var k=i.days,d=i.createdBeforeDate;if(!k&&!d)throw new Error(R+" must includes days or createdBeforeDate");if(k&&!/^[1-9][0-9]*$/.test(k))throw new Error("days must be a positive integer");if(d&&!/\d{4}-\d{2}-\d{2}T00:00:00.000Z/.test(d))throw new Error("createdBeforeDate must be date and conform to iso8601 format")}function w(i){if(!C(i)&&!r(i))throw new Error("tag must be Object or Array");i=r(i)?[i]:i;var R={},k=s(i);k.forEach(function(d){R[d.key]=d.value}),E(R)}function v(i){if(i.id&&u(i.id)>255)throw new Error("ID is composed of 255 bytes at most");if(i.prefix===""||i.prefix===void 0)throw new Error("Rule must includes prefix");if(!["Enabled","Disabled"].includes(i.status))throw new Error("Status must be Enabled or Disabled");if(i.transition){if(!["IA","Archive"].includes(i.transition.storageClass))throw new Error("StorageClass must be IA or Archive");l(i.transition,"Transition")}if(i.expiration){if(!i.expiration.expiredObjectDeleteMarker)l(i.expiration,"Expiration");else if(i.expiration.days||i.expiration.createdBeforeDate)throw new Error("expiredObjectDeleteMarker cannot be used with days or createdBeforeDate")}if(i.abortMultipartUpload&&l(i.abortMultipartUpload,"AbortMultipartUpload"),!i.expiration&&!i.abortMultipartUpload&&!i.transition&&!i.noncurrentVersionTransition)throw new Error("Rule must includes expiration or abortMultipartUpload or transition or noncurrentVersionTransition");if(i.tag){if(i.abortMultipartUpload)throw new Error("Tag cannot be used with abortMultipartUpload");w(i.tag)}}},{"../utils/checkBucketName":35,"../utils/checkObjectTag":36,"../utils/deepCopy":39,"../utils/getStrBytesCount":41,"../utils/isArray":42,"../utils/isObject":46,"../utils/obj2xml":47,"babel-runtime/regenerator":68}],12:[function(M,ne,N){"use strict";var I=M("babel-runtime/regenerator"),h=S(I);function S(s){return s&&s.__esModule?s:{default:s}}var L=M("../utils/checkBucketName"),T=L.checkBucketName,c=M("../utils/obj2xml"),C=c.obj2xml,g=N;g.putBucketVersioning=function(a,r){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},p,m,E;return h.default.async(function(u){for(;;)switch(u.prev=u.next){case 0:if(T(a),["Enabled","Suspended"].includes(r)){u.next=3;break}throw new Error("status must be Enabled or Suspended");case 3:return p=this._bucketRequestParams("PUT",a,"versioning",f),m={VersioningConfiguration:{Status:r}},p.mime="xml",p.content=C(m,{headers:!0}),u.next=9,h.default.awrap(this.request(p));case 9:return E=u.sent,u.abrupt("return",{res:E.res,status:E.status});case 11:case"end":return u.stop()}},null,this)}},{"../utils/checkBucketName":35,"../utils/obj2xml":47,"babel-runtime/regenerator":68}],13:[function(M,ne,N){"use strict";var I=M("babel-runtime/regenerator"),h=S(I);function S(r){return r&&r.__esModule?r:{default:r}}var L=M("../utils/checkBucketName"),T=L.checkBucketName,c=M("../utils/obj2xml"),C=c.obj2xml,g=M("../utils/isArray"),s=g.isArray,a=N;a.putBucketWebsite=function(f){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},m=arguments[2],E,y,u,n,o;return h.default.async(function(w){for(;;)switch(w.prev=w.next){case 0:if(T(f),E=this._bucketRequestParams("PUT",f,"website",m),y={Suffix:p.index||"index.html"},u={IndexDocument:y},n={WebsiteConfiguration:u},p.supportSubDir&&(y.SupportSubDir=p.supportSubDir),p.type&&(y.Type=p.type),p.error&&(u.ErrorDocument={Key:p.error}),!(p.routingRules!==void 0)){w.next=12;break}if(s(p.routingRules)){w.next=11;break}throw new Error("RoutingRules must be Array");case 11:u.RoutingRules={RoutingRule:p.routingRules};case 12:return n=C(n),E.content=n,E.mime="xml",E.successStatuses=[200],w.next=18,h.default.awrap(this.request(E));case 18:return o=w.sent,w.abrupt("return",{res:o.res});case 20:case"end":return w.stop()}},null,this)}},{"../utils/checkBucketName":35,"../utils/isArray":42,"../utils/obj2xml":47,"babel-runtime/regenerator":68}],14:[function(M,ne,N){(function(I){"use strict";var h=M("babel-runtime/core-js/object/keys"),S=c(h),L=M("babel-runtime/core-js/json/stringify"),T=c(L);function c(C){return C&&C.__esModule?C:{default:C}}N.encodeCallback=function(g,s){if(g.headers=g.headers||{},!Object.prototype.hasOwnProperty.call(g.headers,"x-oss-callback")&&s.callback){var a={callbackUrl:encodeURI(s.callback.url),callbackBody:s.callback.body};s.callback.host&&(a.callbackHost=s.callback.host),s.callback.contentType&&(a.callbackBodyType=s.callback.contentType);var r=I.from((0,T.default)(a)).toString("base64");if(g.headers["x-oss-callback"]=r,s.callback.customValue){var f={};(0,S.default)(s.callback.customValue).forEach(function(p){f["x:"+p]=s.callback.customValue[p]}),g.headers["x-oss-callback-var"]=I.from((0,T.default)(f)).toString("base64")}}}}).call(this,M("buffer").Buffer)},{"babel-runtime/core-js/json/stringify":53,"babel-runtime/core-js/object/keys":60,buffer:73}],15:[function(M,ne,N){"use strict";var I=M("babel-runtime/core-js/object/assign"),h=S(I);function S(a){return a&&a.__esModule?a:{default:a}}var L=M("humanize-ms"),T=M("url"),c=M("../utils/checkBucketName"),C=c.checkBucketName;function g(a,r){var f=T.parse(a);if(f.protocol||(f=T.parse("http"+(r?"s":"")+"://"+a)),f.protocol!=="http:"&&f.protocol!=="https:")throw new Error("Endpoint protocol must be http or https.");return f}function s(a,r,f){var p=f?"https://":"http://",m=r?"-internal.aliyuncs.com":".aliyuncs.com",E="vpc100-oss-cn-";return a.substr(0,E.length)===E&&(m=".aliyuncs.com"),T.parse(p+a+m)}ne.exports=function(a){if(!a||!a.accessKeyId||!a.accessKeySecret)throw new Error("require accessKeyId, accessKeySecret");a.bucket&&C(a.bucket);var r=(0,h.default)({region:"oss-cn-hangzhou",internal:!1,secure:!1,timeout:6e4,bucket:null,endpoint:null,cname:!1,isRequestPay:!1,sldEnable:!1},a);if(r.accessKeyId=r.accessKeyId.trim(),r.accessKeySecret=r.accessKeySecret.trim(),r.timeout&&(r.timeout=L(r.timeout)),r.endpoint)r.endpoint=g(r.endpoint,r.secure);else if(r.region)r.endpoint=s(r.region,r.internal,r.secure);else throw new Error("require options.endpoint or options.region");return r.inited=!0,r}},{"../utils/checkBucketName":35,"babel-runtime/core-js/object/assign":54,"humanize-ms":194,url:238}],16:[function(M,ne,N){"use strict";var I=M("merge-descriptors"),h=N;I(h,M("./processObjectSave"))},{"./processObjectSave":17,"merge-descriptors":200}],17:[function(M,ne,N){"use strict";var I=M("babel-runtime/regenerator"),h=S(I);function S(r){return r&&r.__esModule?r:{default:r}}var L=M("../utils/checkBucketName"),T=L.checkBucketName,c=M("querystring"),C=M("js-base64"),g=C.Base64.encode,s=N;s.processObjectSave=function(f,p,m,E){var y,u,n,o;return h.default.async(function(w){for(;;)switch(w.prev=w.next){case 0:return a(f,"sourceObject"),a(p,"targetObject"),a(m,"process"),p=this._objectName(p),E&&T(E),y=this._objectRequestParams("POST",f,{subres:"x-oss-process"}),u=E?",b_"+g(E):"",p=g(p),n={"x-oss-process":m+"|sys/saveas,o_"+p+u},y.content=c.stringify(n),w.next=12,h.default.awrap(this.request(y));case 12:return o=w.sent,w.abrupt("return",{res:o.res,status:o.res.status});case 14:case"end":return w.stop()}},null,this)};function a(r,f){if(!r)throw new Error(f+" is required");if(typeof r!="string")throw new Error(f+" must be String")}},{"../utils/checkBucketName":35,"babel-runtime/regenerator":68,"js-base64":199,querystring:212}],18:[function(M,ne,N){"use strict";var I=M("babel-runtime/regenerator"),h=S(I);function S(s){return s&&s.__esModule?s:{default:s}}var L=M("copy-to"),T=M("./callback"),c=M("./utils/deepCopy"),C=c.deepCopy,g=N;g.listUploads=function(a,r){var f,p,m,E;return h.default.async(function(u){for(;;)switch(u.prev=u.next){case 0:return r=r||{},f={},L(r).to(f),f.subres="uploads",p=this._objectRequestParams("GET","",f),p.query=a,p.xmlResponse=!0,p.successStatuses=[200],u.next=10,h.default.awrap(this.request(p));case 10:return m=u.sent,E=m.data.Upload||[],Array.isArray(E)||(E=[E]),E=E.map(function(n){return{name:n.Key,uploadId:n.UploadId,initiated:n.Initiated}}),u.abrupt("return",{res:m.res,uploads:E,bucket:m.data.Bucket,nextKeyMarker:m.data.NextKeyMarker,nextUploadIdMarker:m.data.NextUploadIdMarker,isTruncated:m.data.IsTruncated==="true"});case 15:case"end":return u.stop()}},null,this)},g.listParts=function(a,r,f,p){var m,E,y;return h.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return p=p||{},m={},L(p).to(m),m.subres={uploadId:r},E=this._objectRequestParams("GET",a,m),E.query=f,E.xmlResponse=!0,E.successStatuses=[200],n.next=10,h.default.awrap(this.request(E));case 10:return y=n.sent,n.abrupt("return",{res:y.res,uploadId:y.data.UploadId,bucket:y.data.Bucket,name:y.data.Key,partNumberMarker:y.data.PartNumberMarker,nextPartNumberMarker:y.data.NextPartNumberMarker,maxParts:y.data.MaxParts,isTruncated:y.data.IsTruncated,parts:y.data.Part||[]});case 12:case"end":return n.stop()}},null,this)},g.abortMultipartUpload=function(a,r,f){var p,m,E;return h.default.async(function(u){for(;;)switch(u.prev=u.next){case 0:return this._stop(),f=f||{},p={},L(f).to(p),p.subres={uploadId:r},m=this._objectRequestParams("DELETE",a,p),m.successStatuses=[204],u.next=9,h.default.awrap(this.request(m));case 9:return E=u.sent,u.abrupt("return",{res:E.res});case 11:case"end":return u.stop()}},null,this)},g.initMultipartUpload=function(a,r){var f,p,m;return h.default.async(function(y){for(;;)switch(y.prev=y.next){case 0:return r=r||{},f={},L(r).to(f),f.headers=f.headers||{},this._convertMetaToHeaders(r.meta,f.headers),f.subres="uploads",p=this._objectRequestParams("POST",a,f),p.mime=r.mime,p.xmlResponse=!0,p.successStatuses=[200],y.next=12,h.default.awrap(this.request(p));case 12:return m=y.sent,y.abrupt("return",{res:m.res,bucket:m.data.Bucket,name:m.data.Key,uploadId:m.data.UploadId});case 14:case"end":return y.stop()}},null,this)},g.uploadPart=function(a,r,f,p,m,E,y){var u;return h.default.async(function(o){for(;;)switch(o.prev=o.next){case 0:return u={stream:this._createStream(p,m,E),size:E-m},o.next=3,h.default.awrap(this._uploadPart(a,r,f,u,y));case 3:return o.abrupt("return",o.sent);case 4:case"end":return o.stop()}},null,this)},g.completeMultipartUpload=function(a,r,f,p){var m,E,y,u,n,o,l,w;return h.default.async(function(i){for(;;)switch(i.prev=i.next){case 0:for(m=f.concat().sort(function(R,k){return R.number-k.number}).filter(function(R,k,d){return!k||R.number!==d[k-1].number}),E=`<?xml version="1.0" encoding="UTF-8"?>
<CompleteMultipartUpload>
`,y=0;y<m.length;y++)u=m[y],E+=`<Part>
`,E+="<PartNumber>"+u.number+`</PartNumber>
`,E+="<ETag>"+u.etag+`</ETag>
`,E+=`</Part>
`;return E+="</CompleteMultipartUpload>",p=p||{},n={},n=C(p),n.headers&&delete n.headers["x-oss-server-side-encryption"],n.subres={uploadId:r},o=this._objectRequestParams("POST",a,n),T.encodeCallback(o,n),o.mime="xml",o.content=E,o.headers&&o.headers["x-oss-callback"]||(o.xmlResponse=!0),o.successStatuses=[200],i.next=17,h.default.awrap(this.request(o));case 17:return l=i.sent,w={res:l.res,bucket:o.bucket,name:a,etag:l.res.headers.etag},o.headers&&o.headers["x-oss-callback"]&&(w.data=JSON.parse(l.data.toString())),i.abrupt("return",w);case 21:case"end":return i.stop()}},null,this)},g._uploadPart=function(a,r,f,p,m){var E,y,u;return h.default.async(function(o){for(;;)switch(o.prev=o.next){case 0:return m=m||{},E={},L(m).to(E),E.headers={"Content-Length":p.size},E.subres={partNumber:f,uploadId:r},y=this._objectRequestParams("PUT",a,E),y.mime=E.mime,y.stream=p.stream,y.successStatuses=[200],o.next=11,h.default.awrap(this.request(y));case 11:if(u=o.sent,u.res.headers.etag){o.next=14;break}throw new Error(`Please set the etag of expose-headers in OSS
https://help.aliyun.com/document_detail/32069.html`);case 14:return p.stream=null,y.stream=null,o.abrupt("return",{name:a,etag:u.res.headers.etag,res:u.res});case 17:case"end":return o.stop()}},null,this)}},{"./callback":14,"./utils/deepCopy":39,"babel-runtime/regenerator":68,"copy-to":76}],19:[function(M,ne,N){"use strict";var I=M("babel-runtime/regenerator"),h=C(I),S=M("babel-runtime/core-js/object/keys"),L=C(S),T=M("babel-runtime/helpers/typeof"),c=C(T);function C(r){return r&&r.__esModule?r:{default:r}}var g=M("../utils/checkBucketName"),s=g.checkBucketName,a=N;a.copy=function(f,p,m,E){var y,u,n;return h.default.async(function(l){for(;;)switch(l.prev=l.next){case 0:return(typeof m=="undefined"?"undefined":(0,c.default)(m))==="object"&&(E=m),E=E||{},E.headers=E.headers||{},(0,L.default)(E.headers).forEach(function(w){E.headers["x-oss-copy-source-"+w.toLowerCase()]=E.headers[w]}),E.meta&&(E.headers["x-oss-metadata-directive"]="REPLACE"),this._convertMetaToHeaders(E.meta,E.headers),p=this._getSourceName(p,m),E.versionId&&(p=p+"?versionId="+E.versionId),E.headers["x-oss-copy-source"]=p,y=this._objectRequestParams("PUT",f,E),y.xmlResponse=!0,y.successStatuses=[200,304],l.next=14,h.default.awrap(this.request(y));case 14:return u=l.sent,n=u.data,n&&(n={etag:n.ETag,lastModified:n.LastModified}),l.abrupt("return",{data:n,res:u.res});case 18:case"end":return l.stop()}},null,this)},a._getSourceName=function(f,p){return typeof p=="string"?f=this._objectName(f):f[0]!=="/"?p=this.options.bucket:(p=f.replace(/\/(.+?)(\/.*)/,"$1"),f=f.replace(/(\/.+?\/)(.*)/,"$2")),s(p),f=encodeURI(f),f="/"+p+"/"+f,f}},{"../utils/checkBucketName":35,"babel-runtime/core-js/object/keys":60,"babel-runtime/helpers/typeof":67,"babel-runtime/regenerator":68}],20:[function(M,ne,N){"use strict";var I=M("babel-runtime/regenerator"),h=T(I),S=M("babel-runtime/core-js/object/assign"),L=T(S);function T(C){return C&&C.__esModule?C:{default:C}}var c=N;c.delete=function(g){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a,r;return h.default.async(function(p){for(;;)switch(p.prev=p.next){case 0:return s.subres=(0,L.default)({},s.subres),s.versionId&&(s.subres.versionId=s.versionId),a=this._objectRequestParams("DELETE",g,s),a.successStatuses=[204],p.next=6,h.default.awrap(this.request(a));case 6:return r=p.sent,p.abrupt("return",{res:r.res});case 8:case"end":return p.stop()}},null,this)}},{"babel-runtime/core-js/object/assign":54,"babel-runtime/regenerator":68}],21:[function(M,ne,N){"use strict";var I=M("babel-runtime/regenerator"),h=T(I),S=M("babel-runtime/core-js/object/assign"),L=T(S);function T(a){return a&&a.__esModule?a:{default:a}}var c=M("utility"),C=M("../utils/obj2xml"),g=C.obj2xml,s=N;s.deleteMulti=function(r){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},p,m,E,y,u,n,o,l,w,v,i,R;return h.default.async(function(d){for(;;)switch(d.prev=d.next){case 0:if(p=[],!(!r||!r.length)){d.next=3;break}throw new Error("names is required");case 3:for(m=0;m<r.length;m++)E={},typeof r[m]=="string"?E.Key=c.escape(this._objectName(r[m])):(y=r[m],u=y.key,n=y.versionId,E.Key=c.escape(this._objectName(u)),E.VersionId=n),p.push(E);return o={Delete:{Quiet:!!f.quiet,Object:p}},l=g(o,{headers:!0}),f.subres=(0,L.default)({delete:""},f.subres),f.versionId&&(f.subres.versionId=f.versionId),w=this._objectRequestParams("POST","",f),w.mime="xml",w.content=l,w.xmlResponse=!0,w.successStatuses=[200],d.next=15,h.default.awrap(this.request(w));case 15:return v=d.sent,i=v.data,R=i&&i.Deleted||null,R&&(Array.isArray(R)||(R=[R])),d.abrupt("return",{res:v.res,deleted:R||[]});case 20:case"end":return d.stop()}},null,this)}},{"../utils/obj2xml":47,"babel-runtime/core-js/object/assign":54,"babel-runtime/regenerator":68,utility:290}],22:[function(M,ne,N){"use strict";var I=M("babel-runtime/regenerator"),h=T(I),S=M("babel-runtime/core-js/object/assign"),L=T(S);function T(C){return C&&C.__esModule?C:{default:C}}var c=N;c.deleteObjectTagging=function(g){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a,r;return h.default.async(function(p){for(;;)switch(p.prev=p.next){case 0:return s.subres=(0,L.default)({tagging:""},s.subres),s.versionId&&(s.subres.versionId=s.versionId),g=this._objectName(g),a=this._objectRequestParams("DELETE",g,s),a.successStatuses=[204],p.next=7,h.default.awrap(this.request(a));case 7:return r=p.sent,p.abrupt("return",{status:r.status,res:r.res});case 9:case"end":return p.stop()}},null,this)}},{"babel-runtime/core-js/object/assign":54,"babel-runtime/regenerator":68}],23:[function(M,ne,N){"use strict";var I=M("babel-runtime/regenerator"),h=T(I),S=M("babel-runtime/core-js/object/assign"),L=T(S);function T(s){return s&&s.__esModule?s:{default:s}}var c=M("fs"),C=M("is-type-of"),g=N;g.get=function(a,r){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},p,m,E,y;return h.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return p=null,m=!1,C.writableStream(r)?p=r:C.string(r)?(p=c.createWriteStream(r),m=!0):f=r,f=f||{},f.subres=(0,L.default)({},f.subres),f.versionId&&(f.subres.versionId=f.versionId),f.process&&(f.subres["x-oss-process"]=f.process),E=void 0,n.prev=8,y=this._objectRequestParams("GET",a,f),y.writeStream=p,y.successStatuses=[200,206,304],n.next=14,h.default.awrap(this.request(y));case 14:E=n.sent,m&&p.destroy(),n.next=25;break;case 18:if(n.prev=18,n.t0=n.catch(8),!m){n.next=24;break}return p.destroy(),n.next=24,h.default.awrap(this._deleteFileSafe(r));case 24:throw n.t0;case 25:return n.abrupt("return",{res:E.res,content:E.data});case 26:case"end":return n.stop()}},null,this,[[8,18]])}},{"babel-runtime/core-js/object/assign":54,"babel-runtime/regenerator":68,fs:71,"is-type-of":289}],24:[function(M,ne,N){"use strict";var I=M("babel-runtime/regenerator"),h=T(I),S=M("babel-runtime/core-js/object/assign"),L=T(S);function T(C){return C&&C.__esModule?C:{default:C}}var c=N;c.getACL=function(g){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a,r;return h.default.async(function(p){for(;;)switch(p.prev=p.next){case 0:return s.subres=(0,L.default)({acl:""},s.subres),s.versionId&&(s.subres.versionId=s.versionId),g=this._objectName(g),a=this._objectRequestParams("GET",g,s),a.successStatuses=[200],a.xmlResponse=!0,p.next=8,h.default.awrap(this.request(a));case 8:return r=p.sent,p.abrupt("return",{acl:r.data.AccessControlList.Grant,owner:{id:r.data.Owner.ID,displayName:r.data.Owner.DisplayName},res:r.res});case 10:case"end":return p.stop()}},null,this)}},{"babel-runtime/core-js/object/assign":54,"babel-runtime/regenerator":68}],25:[function(M,ne,N){"use strict";var I=M("babel-runtime/core-js/object/keys"),h=C(I),S=M("babel-runtime/regenerator"),L=C(S),T=M("babel-runtime/core-js/object/assign"),c=C(T);function C(y){return y&&y.__esModule?y:{default:y}}var g=N,s=M("../utils/isObject"),a=s.isObject,r=M("../utils/isArray"),f=r.isArray;g.getBucketVersions=p,g.listObjectVersions=p;function p(){var y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n,o,l,w,v,i;return L.default.async(function(k){for(;;)switch(k.prev=k.next){case 0:if(!(y.versionIdMarker&&y.keyMarker===void 0)){k.next=2;break}throw new Error("A version-id marker cannot be specified without a key marker");case 2:return u.subres=(0,c.default)({versions:""},u.subres),u.versionId&&(u.subres.versionId=u.versionId),n=this._objectRequestParams("GET","",u),n.xmlResponse=!0,n.successStatuses=[200],n.query=E(y),k.next=10,L.default.awrap(this.request(n));case 10:return o=k.sent,l=o.data.Version||[],w=o.data.DeleteMarker||[],v=this,l&&(Array.isArray(l)||(l=[l]),l=l.map(function(d){return{name:d.Key,url:v._objectUrl(d.Key),lastModified:d.LastModified,isLatest:d.IsLatest==="true",versionId:d.VersionId,etag:d.ETag,type:d.Type,size:Number(d.Size),storageClass:d.StorageClass,owner:{id:d.Owner.ID,displayName:d.Owner.DisplayName}}})),w&&(f(w)||(w=[w]),w=w.map(function(d){return{name:d.Key,lastModified:d.LastModified,versionId:d.VersionId,owner:{id:d.Owner.ID,displayName:d.Owner.DisplayName}}})),i=o.data.CommonPrefixes||null,i&&(f(i)||(i=[i]),i=i.map(function(d){return d.Prefix})),k.abrupt("return",{res:o.res,objects:l,deleteMarker:w,prefixes:i,nextMarker:o.data.NextMarker||null,NextVersionIdMarker:o.data.NextVersionIdMarker||null,isTruncated:o.data.IsTruncated==="true"});case 19:case"end":return k.stop()}},null,this)}function m(y){return y.replace(/([A-Z])/g,"-$1").toLowerCase()}function E(){var y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},u={};return a(y)&&(0,h.default)(y).forEach(function(n){u[m(n)]=y[n]}),u}},{"../utils/isArray":42,"../utils/isObject":46,"babel-runtime/core-js/object/assign":54,"babel-runtime/core-js/object/keys":60,"babel-runtime/regenerator":68}],26:[function(M,ne,N){"use strict";var I=M("babel-runtime/regenerator"),h=T(I),S=M("babel-runtime/core-js/object/assign"),L=T(S);function T(C){return C&&C.__esModule?C:{default:C}}var c=N;c.getObjectMeta=function(g,s){var a,r;return h.default.async(function(p){for(;;)switch(p.prev=p.next){case 0:return s=s||{},g=this._objectName(g),s.subres=(0,L.default)({objectMeta:""},s.subres),s.versionId&&(s.subres.versionId=s.versionId),a=this._objectRequestParams("HEAD",g,s),a.successStatuses=[200],p.next=8,h.default.awrap(this.request(a));case 8:return r=p.sent,p.abrupt("return",{status:r.status,res:r.res});case 10:case"end":return p.stop()}},null,this)}},{"babel-runtime/core-js/object/assign":54,"babel-runtime/regenerator":68}],27:[function(M,ne,N){"use strict";var I=M("babel-runtime/regenerator"),h=T(I),S=M("babel-runtime/core-js/object/assign"),L=T(S);function T(s){return s&&s.__esModule?s:{default:s}}var c=N,C=M("../utils/isObject"),g=C.isObject;c.getObjectTagging=function(a){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},f,p,m,E,y;return h.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return r.subres=(0,L.default)({tagging:""},r.subres),r.versionId&&(r.subres.versionId=r.versionId),a=this._objectName(a),f=this._objectRequestParams("GET",a,r),f.successStatuses=[200],n.next=7,h.default.awrap(this.request(f));case 7:return p=n.sent,n.next=10,h.default.awrap(this.parseXML(p.data));case 10:return m=n.sent,E=m.TagSet.Tag,E=E&&g(E)?[E]:E||[],y={},E.forEach(function(o){y[o.Key]=o.Value}),n.abrupt("return",{status:p.status,res:p.res,tag:y});case 16:case"end":return n.stop()}},null,this)}},{"../utils/isObject":46,"babel-runtime/core-js/object/assign":54,"babel-runtime/regenerator":68}],28:[function(M,ne,N){"use strict";var I=M("babel-runtime/regenerator"),h=T(I),S=M("babel-runtime/core-js/object/assign"),L=T(S);function T(C){return C&&C.__esModule?C:{default:C}}var c=N;c.getSymlink=function(g){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a,r,f;return h.default.async(function(m){for(;;)switch(m.prev=m.next){case 0:return s.subres=(0,L.default)({symlink:""},s.subres),s.versionId&&(s.subres.versionId=s.versionId),g=this._objectName(g),a=this._objectRequestParams("GET",g,s),a.successStatuses=[200],m.next=7,h.default.awrap(this.request(a));case 7:return r=m.sent,f=r.res.headers["x-oss-symlink-target"],m.abrupt("return",{targetName:decodeURIComponent(f),res:r.res});case 10:case"end":return m.stop()}},null,this)}},{"babel-runtime/core-js/object/assign":54,"babel-runtime/regenerator":68}],29:[function(M,ne,N){"use strict";var I=M("babel-runtime/regenerator"),h=C(I),S=M("babel-runtime/core-js/object/keys"),L=C(S),T=M("babel-runtime/core-js/object/assign"),c=C(T);function C(s){return s&&s.__esModule?s:{default:s}}var g=N;g.head=function(a){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},f,p,m;return h.default.async(function(y){for(;;)switch(y.prev=y.next){case 0:return r.subres=(0,c.default)({},r.subres),r.versionId&&(r.subres.versionId=r.versionId),f=this._objectRequestParams("HEAD",a,r),f.successStatuses=[200,304],y.next=6,h.default.awrap(this.request(f));case 6:return p=y.sent,m={meta:null,res:p.res,status:p.status},p.status===200&&(0,L.default)(p.headers).forEach(function(u){u.indexOf("x-oss-meta-")===0&&(m.meta||(m.meta={}),m.meta[u.substring(11)]=p.headers[u])}),y.abrupt("return",m);case 10:case"end":return y.stop()}},null,this)}},{"babel-runtime/core-js/object/assign":54,"babel-runtime/core-js/object/keys":60,"babel-runtime/regenerator":68}],30:[function(M,ne,N){"use strict";var I=M("babel-runtime/regenerator"),h=T(I),S=M("babel-runtime/core-js/object/assign"),L=T(S);function T(C){return C&&C.__esModule?C:{default:C}}var c=N;c.putACL=function(g,s,a){var r,f;return h.default.async(function(m){for(;;)switch(m.prev=m.next){case 0:return a=a||{},a.subres=(0,L.default)({acl:""},a.subres),a.versionId&&(a.subres.versionId=a.versionId),a.headers=a.headers||{},a.headers["x-oss-object-acl"]=s,g=this._objectName(g),r=this._objectRequestParams("PUT",g,a),r.successStatuses=[200],m.next=10,h.default.awrap(this.request(r));case 10:return f=m.sent,m.abrupt("return",{res:f.res});case 12:case"end":return m.stop()}},null,this)}},{"babel-runtime/core-js/object/assign":54,"babel-runtime/regenerator":68}],31:[function(M,ne,N){"use strict";var I=M("babel-runtime/regenerator"),h=C(I),S=M("babel-runtime/core-js/object/keys"),L=C(S),T=M("babel-runtime/core-js/object/assign"),c=C(T);function C(p){return p&&p.__esModule?p:{default:p}}var g=M("../utils/obj2xml"),s=g.obj2xml,a=M("../utils/checkObjectTag"),r=a.checkObjectTag,f=N;f.putObjectTagging=function(m,E){var y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},u,n,o;return h.default.async(function(w){for(;;)switch(w.prev=w.next){case 0:return r(E),y.subres=(0,c.default)({tagging:""},y.subres),y.versionId&&(y.subres.versionId=y.versionId),m=this._objectName(m),u=this._objectRequestParams("PUT",m,y),u.successStatuses=[200],E=(0,L.default)(E).map(function(v){return{Key:v,Value:E[v]}}),n={Tagging:{TagSet:{Tag:E}}},u.mime="xml",u.content=s(n),w.next=12,h.default.awrap(this.request(u));case 12:return o=w.sent,w.abrupt("return",{res:o.res,status:o.status});case 14:case"end":return w.stop()}},null,this)}},{"../utils/checkObjectTag":36,"../utils/obj2xml":47,"babel-runtime/core-js/object/assign":54,"babel-runtime/core-js/object/keys":60,"babel-runtime/regenerator":68}],32:[function(M,ne,N){"use strict";var I=M("babel-runtime/regenerator"),h=T(I),S=M("babel-runtime/core-js/object/assign"),L=T(S);function T(C){return C&&C.__esModule?C:{default:C}}var c=N;c.putSymlink=function(g,s,a){var r,f;return h.default.async(function(m){for(;;)switch(m.prev=m.next){case 0:return a=a||{},a.headers=a.headers||{},s=this._escape(this._objectName(s)),this._convertMetaToHeaders(a.meta,a.headers),a.headers["x-oss-symlink-target"]=s,a.subres=(0,L.default)({symlink:""},a.subres),a.versionId&&(a.subres.versionId=a.versionId),a.storageClass&&(a.headers["x-oss-storage-class"]=a.storageClass),g=this._objectName(g),r=this._objectRequestParams("PUT",g,a),r.successStatuses=[200],m.next=13,h.default.awrap(this.request(r));case 13:return f=m.sent,m.abrupt("return",{res:f.res});case 15:case"end":return m.stop()}},null,this)}},{"babel-runtime/core-js/object/assign":54,"babel-runtime/regenerator":68}],33:[function(M,ne,N){"use strict";var I=M("babel-runtime/regenerator"),h=T(I),S=M("babel-runtime/core-js/promise"),L=T(S);function T(C){return C&&C.__esModule?C:{default:C}}var c=N;c._parallelNode=function(g,s,a,r){var f,p,m,E,y,u,n,o;return h.default.async(function(w){for(;;)switch(w.prev=w.next){case 0:f=this,p=[],m=[],E=g.length/s,y=g.length%s,u=y===0?E:(g.length-y)/s+1,n=1,o=0;case 8:if(!(o<g.length)){w.next=26;break}if(!f.isCancel()){w.next=11;break}return w.abrupt("break",26);case 11:if(r?m.push(a(f,g[o],r)):m.push(a(f,g[o])),!(m.length===s||n===u&&o===g.length-1)){w.next=23;break}return w.prev=13,n+=1,w.next=17,h.default.awrap(L.default.all(m));case 17:w.next=22;break;case 19:w.prev=19,w.t0=w.catch(13),p.push(w.t0);case 22:m=[];case 23:o++,w.next=8;break;case 26:return w.abrupt("return",p);case 27:case"end":return w.stop()}},null,this,[[13,19]])},c._parallel=function(g,s,a){var r=this;return new L.default(function(f){var p=[];if(s<=0||!g){f(p);return}function m(i){return function(){if(i===null)throw new Error("Callback was already called.");var R=i;i=null;for(var k=arguments.length,d=Array(k),b=0;b<k;b++)d[b]=arguments[b];R.apply(this,d)}}function E(i){var R=-1,k=i.length;return function(){return++R<k&&!r.isCancel()?{value:i[R],key:R}:null}}var y=E(g),u=!1,n=0,o=!1;function l(i,R){n-=1,i?(u=!0,p.push(i),f(p)):R==={}||u&&n<=0?(u=!0,f(p)):o||(r.isCancel()?f(p):v())}function w(i,R){a(i).then(function(k){R(null,k)}).catch(function(k){R(k)})}function v(){for(o=!0;n<s&&!u&&!r.isCancel();){var i=y();if(i===null||p.length>0){u=!0,n<=0&&f(p);return}n+=1,w(i.value,m(l))}o=!1}v()})},c.cancel=function(g){this.options.cancelFlag=!0,g&&this.abortMultipartUpload(g.name,g.uploadId,g.options)},c.isCancel=function(){return this.options.cancelFlag},c.resetCancelFlag=function(){this.options.cancelFlag=!1},c._stop=function(){this.options.cancelFlag=!0},c._makeCancelEvent=function(){var g={status:0,name:"cancel"};return g}},{"babel-runtime/core-js/promise":61,"babel-runtime/regenerator":68}],34:[function(M,ne,N){(function(I){"use strict";var h=M("babel-runtime/core-js/json/stringify"),S=c(h),L=M("babel-runtime/core-js/object/keys"),T=c(L);function c(s){return s&&s.__esModule?s:{default:s}}var C=M("./../../shims/crypto/crypto.js"),g=M("is-type-of");N.buildCanonicalizedResource=function(a,r){var f=""+a,p="?";if(g.string(r)&&r.trim()!=="")f+=p+r;else if(g.array(r))r.sort(),f+=p+r.join("&");else if(r){var m=function(u,n){return u[0]>n[0]?1:u[0]<n[0]?-1:0},E=function(u){f+=p+u,r[u]&&(f+="="+r[u]),p="&"};(0,T.default)(r).sort(m).forEach(E)}return f},N.buildCanonicalString=function(a,r,f,p){f=f||{};var m=f.headers||{},E="x-oss-",y=[],u={},n=[a.toUpperCase(),m["Content-Md5"]||"",m["Content-Type"]||m["Content-Type".toLowerCase()],p||m["x-oss-date"]];return(0,T.default)(m).forEach(function(o){var l=o.toLowerCase();l.indexOf(E)===0&&(u[l]=String(m[o]).trim())}),(0,T.default)(u).sort().forEach(function(o){y.push(o+":"+u[o])}),n=n.concat(y),n.push(this.buildCanonicalizedResource(r,f.parameters)),n.join(`
`)},N.computeSignature=function(a,r){var f=C.createHmac("sha1",a);return f.update(I.from(r,"utf8")).digest("base64")},N.authorization=function(a,r,f){return"OSS "+a+":"+this.computeSignature(r,f)},N._signatureForURL=function(a){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},f=arguments[2],p=arguments[3],m={},E=r.subResource,y=E===void 0?{}:E;if(r.process){var u="x-oss-process";y[u]=r.process}if(r.trafficLimit){var n="x-oss-traffic-limit";y[n]=r.trafficLimit}if(r.response&&(0,T.default)(r.response).forEach(function(v){var i="response-"+v.toLowerCase();y[i]=r.response[v]}),(0,T.default)(r).forEach(function(v){var i=v.toLowerCase(),R=r[v];i.indexOf("x-oss-")===0?m[i]=R:(i.indexOf("content-md5")===0||i.indexOf("content-type")===0)&&(m[v]=R)}),Object.prototype.hasOwnProperty.call(r,"security-token")&&(y["security-token"]=r["security-token"]),Object.prototype.hasOwnProperty.call(r,"callback")){var o={callbackUrl:encodeURI(r.callback.url),callbackBody:r.callback.body};if(r.callback.host&&(o.callbackHost=r.callback.host),r.callback.contentType&&(o.callbackBodyType=r.callback.contentType),y.callback=I.from((0,S.default)(o)).toString("base64"),r.callback.customValue){var l={};(0,T.default)(r.callback.customValue).forEach(function(v){l["x:"+v]=r.callback.customValue[v]}),y["callback-var"]=I.from((0,S.default)(l)).toString("base64")}}var w=this.buildCanonicalString(r.method,f,{headers:m,parameters:y},p.toString());return{Signature:this.computeSignature(a,w),subResource:y}}}).call(this,M("buffer").Buffer)},{"./../../shims/crypto/crypto.js":284,"babel-runtime/core-js/json/stringify":53,"babel-runtime/core-js/object/keys":60,buffer:73,"is-type-of":289}],35:[function(M,ne,N){"use strict";Object.defineProperty(N,"__esModule",{value:!0}),N.checkBucketName=void 0,N.checkBucketName=function(I,h){var S=h?/^[a-z0-9][a-z0-9-]{1,61}[a-z0-9]$/:/^[a-z0-9_][a-z0-9-_]{1,61}[a-z0-9_]$/;if(!S.test(I))throw new Error("The bucket must be conform to the specifications")}},{}],36:[function(M,ne,N){"use strict";var I=M("babel-runtime/core-js/object/entries"),h=S(I);function S(r){return r&&r.__esModule?r:{default:r}}Object.defineProperty(N,"__esModule",{value:!0}),N.checkObjectTag=void 0;var L=M("./checkValid"),T=L.checkValid,c=M("./isObject"),C=c.isObject,g=[{validator:function(f){if(typeof f!="string")throw new Error("the key and value of the tag must be String")}},{pattern:/^[a-zA-Z0-9 +-=._:/]+$/,msg:"tag can contain letters, numbers, spaces, and the following symbols: plus sign (+), hyphen (-), equal sign (=), period (.), underscore (_), colon (:), and forward slash (/)"}],s={key:[].concat(g,[{pattern:/^.{1,128}$/,msg:"tag key can be a maximum of 128 bytes in length"}]),value:[].concat(g,[{pattern:/^.{0,256}$/,msg:"tag value can be a maximum of 256 bytes in length"}])};function a(r){if(!C(r))throw new Error("tag must be Object");var f=(0,h.default)(r);if(f.length>10)throw new Error("maximum of 10 tags for a object");var p=["key","value"];f.forEach(function(m){m.forEach(function(E,y){T(E,s[p[y]])})})}N.checkObjectTag=a},{"./checkValid":37,"./isObject":46,"babel-runtime/core-js/object/entries":57}],37:[function(M,ne,N){"use strict";Object.defineProperty(N,"__esModule",{value:!0}),N.checkValid=void 0;function I(h,S){S.forEach(function(L){if(L.validator)L.validator(h);else if(L.pattern&&!L.pattern.test(h))throw new Error(L.msg)})}N.checkValid=I},{}],38:[function(M,ne,N){(function(I){"use strict";var h=M("babel-runtime/core-js/object/assign"),S=L(h);function L(m){return m&&m.__esModule?m:{default:m}}Object.defineProperty(N,"__esModule",{value:!0}),N.createRequest=void 0;var T=M("./../../../shims/crypto/crypto.js"),c=M("debug")("ali-oss"),C=M("mime"),g=M("dateformat"),s=M("copy-to"),a=M("path");function r(m,E){return m[E]||m[E.toLowerCase()]}function f(m,E){delete m[E],delete m[E.toLowerCase()]}function p(m){var E=new Date;this.options.amendTimeSkewed&&(E=+new Date+this.options.amendTimeSkewed);var y={"x-oss-date":g(E,"UTC:ddd, dd mmm yyyy HH:MM:ss 'GMT'"),"x-oss-user-agent":this.userAgent};this.userAgent.includes("nodejs")&&(y["User-Agent"]=this.userAgent),this.options.isRequestPay&&(0,S.default)(y,{"x-oss-request-payer":"requester"}),this.options.stsToken&&(y["x-oss-security-token"]=this.options.stsToken),s(m.headers).to(y),r(y,"Content-Type")||(m.mime&&m.mime.indexOf("/")>0?y["Content-Type"]=m.mime:y["Content-Type"]=C.getType(m.mime||a.extname(m.object||""))),r(y,"Content-Type")||f(y,"Content-Type"),m.content&&(y["Content-Md5"]=T.createHash("md5").update(I.from(m.content,"utf8")).digest("base64"),y["Content-Length"]||(y["Content-Length"]=m.content.length));var u=this._getResource(m);y.authorization=this.authorization(m.method,u,m.subres,y);var n=this._getReqUrl(m);c("request %s %s, with headers %j, !!stream: %s",m.method,n,y,!!m.stream);var o=m.timeout||this.options.timeout,l={method:m.method,content:m.content,stream:m.stream,headers:y,timeout:o,writeStream:m.writeStream,customResponse:m.customResponse,ctx:m.ctx||this.ctx};return this.agent&&(l.agent=this.agent),this.httpsAgent&&(l.httpsAgent=this.httpsAgent),{url:n,params:l}}N.createRequest=p}).call(this,M("buffer").Buffer)},{"./../../../shims/crypto/crypto.js":284,"babel-runtime/core-js/object/assign":54,buffer:73,"copy-to":76,dateformat:190,debug:288,mime:202,path:205}],39:[function(M,ne,N){"use strict";var I=M("babel-runtime/core-js/object/keys"),h=T(I),S=M("babel-runtime/helpers/typeof"),L=T(S);function T(c){return c&&c.__esModule?c:{default:c}}Object.defineProperty(N,"__esModule",{value:!0}),N.deepCopy=void 0,N.deepCopy=function(c){if(c===null||(typeof c=="undefined"?"undefined":(0,L.default)(c))!=="object")return c;var C=Array.isArray(c)?[]:{};return(0,h.default)(c).forEach(function(g){C[g]=N.deepCopy(c[g])}),C}},{"babel-runtime/core-js/object/keys":60,"babel-runtime/helpers/typeof":67}],40:[function(M,ne,N){"use strict";var I=M("babel-runtime/core-js/object/keys"),h=T(I),S=M("babel-runtime/helpers/typeof"),L=T(S);function T(g){return g&&g.__esModule?g:{default:g}}Object.defineProperty(N,"__esModule",{value:!0}),N.formatObjKey=void 0;function c(g,s){if(g===null||(typeof g=="undefined"?"undefined":(0,L.default)(g))!=="object")return g;var a=void 0;if(Array.isArray(g)){a=[];for(var r=0;r<g.length;r++)a.push(c(g[r],s))}else a={},(0,h.default)(g).forEach(function(f){a[C(f,s)]=c(g[f],s)});return a}N.formatObjKey=c;function C(g,s){return s==="firstUpperCase"?g=g.replace(/^./,function(a){return a.toUpperCase()}):s==="firstLowerCase"&&(g=g.replace(/^./,function(a){return a.toLowerCase()})),g}},{"babel-runtime/core-js/object/keys":60,"babel-runtime/helpers/typeof":67}],41:[function(M,ne,N){"use strict";Object.defineProperty(N,"__esModule",{value:!0}),N.getStrBytesCount=void 0;function I(h){for(var S=0,L=0;L<h.length;L++){var T=h.charAt(L);/^[\u00-\uff]$/.test(T)?S+=1:S+=2}return S}N.getStrBytesCount=I},{}],42:[function(M,ne,N){"use strict";Object.defineProperty(N,"__esModule",{value:!0}),N.isArray=void 0,N.isArray=function(I){return Object.prototype.toString.call(I)==="[object Array]"}},{}],43:[function(M,ne,N){"use strict";Object.defineProperty(N,"__esModule",{value:!0}),N.isBlob=void 0;function I(h){return typeof Blob!="undefined"&&h instanceof Blob}N.isBlob=I},{}],44:[function(M,ne,N){"use strict";Object.defineProperty(N,"__esModule",{value:!0}),N.isFile=void 0,N.isFile=function(I){return typeof File!="undefined"&&I instanceof File}},{}],45:[function(M,ne,N){"use strict";Object.defineProperty(N,"__esModule",{value:!0}),N.isIP=void 0,N.isIP=function(I){var h=/^(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}$/,S=/^\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 h.test(I)||S.test(I)}},{}],46:[function(M,ne,N){"use strict";Object.defineProperty(N,"__esModule",{value:!0}),N.isObject=void 0,N.isObject=function(I){return Object.prototype.toString.call(I)==="[object Object]"}},{}],47:[function(M,ne,N){"use strict";var I=M("babel-runtime/core-js/object/keys"),h=S(I);function S(C){return C&&C.__esModule?C:{default:C}}Object.defineProperty(N,"__esModule",{value:!0}),N.obj2xml=void 0;var L=M("./formatObjKey");function T(C){return Object.prototype.toString.call(C).replace(/(.*? |])/g,"").toLowerCase()}function c(C,g){var s="";return g&&g.headers&&(s=`<?xml version="1.0" encoding="UTF-8"?>
`),g&&g.firstUpperCase&&(C=L.formatObjKey(C,"firstUpperCase")),T(C)==="object"?(0,h.default)(C).forEach(function(a){T(C[a])==="string"||T(C[a])==="number"?s+="<"+a+">"+C[a]+"</"+a+">":T(C[a])==="object"?s+="<"+a+">"+c(C[a])+"</"+a+">":T(C[a])==="array"?s+=C[a].map(function(r){return"<"+a+">"+c(r)+"</"+a+">"}).join(""):s+="<"+a+">"+C[a].toString()+"</"+a+">"}):s+=C.toString(),s}N.obj2xml=c},{"./formatObjKey":40,"babel-runtime/core-js/object/keys":60}],48:[function(M,ne,N){ne.exports=I,ne.exports.HttpsAgent=I;function I(){}},{}],49:[function(M,ne,N){ne.exports=M("./register")().Promise},{"./register":51}],50:[function(M,ne,N){"use strict";var I="@@any-promise/REGISTRATION",h=null;ne.exports=function(S,L){return function(c,C){c=c||null,C=C||{};var g=C.global!==!1;if(h===null&&g&&(h=S[I]||null),h!==null&&c!==null&&h.implementation!==c)throw new Error('any-promise already defined as "'+h.implementation+'". You can only register an implementation before the first call to require("any-promise") and an implementation cannot be changed');return h===null&&(c!==null&&typeof C.Promise!="undefined"?h={Promise:C.Promise,implementation:c}:h=L(c),g&&(S[I]=h)),h}}},{}],51:[function(M,ne,N){"use strict";ne.exports=M("./loader")(window,I);function I(){if(typeof window.Promise=="undefined")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"}}},{"./loader":50}],52:[function(M,ne,N){ne.exports={default:M("core-js/library/fn/array/from"),__esModule:!0}},{"core-js/library/fn/array/from":77}],53:[function(M,ne,N){ne.exports={default:M("core-js/library/fn/json/stringify"),__esModule:!0}},{"core-js/library/fn/json/stringify":78}],54:[function(M,ne,N){ne.exports={default:M("core-js/library/fn/object/assign"),__esModule:!0}},{"core-js/library/fn/object/assign":79}],55:[function(M,ne,N){ne.exports={default:M("core-js/library/fn/object/create"),__esModule:!0}},{"core-js/library/fn/object/create":80}],56:[function(M,ne,N){ne.exports={default:M("core-js/library/fn/object/define-property"),__esModule:!0}},{"core-js/library/fn/object/define-property":81}],57:[function(M,ne,N){ne.exports={default:M("core-js/library/fn/object/entries"),__esModule:!0}},{"core-js/library/fn/object/entries":82}],58:[function(M,ne,N){ne.exports={default:M("core-js/library/fn/object/get-own-property-names"),__esModule:!0}},{"core-js/library/fn/object/get-own-property-names":83}],59:[function(M,ne,N){ne.exports={default:M("core-js/library/fn/object/get-prototype-of"),__esModule:!0}},{"core-js/library/fn/object/get-prototype-of":84}],60:[function(M,ne,N){ne.exports={default:M("core-js/library/fn/object/keys"),__esModule:!0}},{"core-js/library/fn/object/keys":85}],61:[function(M,ne,N){ne.exports={default:M("core-js/library/fn/promise"),__esModule:!0}},{"core-js/library/fn/promise":86}],62:[function(M,ne,N){ne.exports={default:M("core-js/library/fn/set-immediate"),__esModule:!0}},{"core-js/library/fn/set-immediate":87}],63:[function(M,ne,N){ne.exports={default:M("core-js/library/fn/string/from-code-point"),__esModule:!0}},{"core-js/library/fn/string/from-code-point":88}],64:[function(M,ne,N){ne.exports={default:M("core-js/library/fn/symbol"),__esModule:!0}},{"core-js/library/fn/symbol":90}],65:[function(M,ne,N){ne.exports={default:M("core-js/library/fn/symbol/has-instance"),__esModule:!0}},{"core-js/library/fn/symbol/has-instance":89}],66:[function(M,ne,N){ne.exports={default:M("core-js/library/fn/symbol/iterator"),__esModule:!0}},{"core-js/library/fn/symbol/iterator":91}],67:[function(M,ne,N){"use strict";N.__esModule=!0;var I=M("../core-js/symbol/iterator"),h=c(I),S=M("../core-js/symbol"),L=c(S),T=typeof L.default=="function"&&typeof h.default=="symbol"?function(C){return typeof C}:function(C){return C&&typeof L.default=="function"&&C.constructor===L.default&&C!==L.default.prototype?"symbol":typeof C};function c(C){return C&&C.__esModule?C:{default:C}}N.default=typeof L.default=="function"&&T(h.default)==="symbol"?function(C){return typeof C=="undefined"?"undefined":T(C)}:function(C){return C&&typeof L.default=="function"&&C.constructor===L.default&&C!==L.default.prototype?"symbol":typeof C=="undefined"?"undefined":T(C)}},{"../core-js/symbol":64,"../core-js/symbol/iterator":66}],68:[function(M,ne,N){ne.exports=M("regenerator-runtime")},{"regenerator-runtime":226}],69:[function(M,ne,N){"use strict";N.byteLength=g,N.toByteArray=a,N.fromByteArray=p;for(var I=[],h=[],S=typeof Uint8Array!="undefined"?Uint8Array:Array,L="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",T=0,c=L.length;T<c;++T)I[T]=L[T],h[L.charCodeAt(T)]=T;h["-".charCodeAt(0)]=62,h["_".charCodeAt(0)]=63;function C(m){var E=m.length;if(E%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var y=m.indexOf("=");y===-1&&(y=E);var u=y===E?0:4-y%4;return[y,u]}function g(m){var E=C(m),y=E[0],u=E[1];return(y+u)*3/4-u}function s(m,E,y){return(E+y)*3/4-y}function a(m){var E,y=C(m),u=y[0],n=y[1],o=new S(s(m,u,n)),l=0,w=n>0?u-4:u,v;for(v=0;v<w;v+=4)E=h[m.charCodeAt(v)]<<18|h[m.charCodeAt(v+1)]<<12|h[m.charCodeAt(v+2)]<<6|h[m.charCodeAt(v+3)],o[l++]=E>>16&255,o[l++]=E>>8&255,o[l++]=E&255;return n===2&&(E=h[m.charCodeAt(v)]<<2|h[m.charCodeAt(v+1)]>>4,o[l++]=E&255),n===1&&(E=h[m.charCodeAt(v)]<<10|h[m.charCodeAt(v+1)]<<4|h[m.charCodeAt(v+2)]>>2,o[l++]=E>>8&255,o[l++]=E&255),o}function r(m){return I[m>>18&63]+I[m>>12&63]+I[m>>6&63]+I[m&63]}function f(m,E,y){for(var u,n=[],o=E;o<y;o+=3)u=(m[o]<<16&16711680)+(m[o+1]<<8&65280)+(m[o+2]&255),n.push(r(u));return n.join("")}function p(m){for(var E,y=m.length,u=y%3,n=[],o=16383,l=0,w=y-u;l<w;l+=o)n.push(f(m,l,l+o>w?w:l+o));return u===1?(E=m[y-1],n.push(I[E>>2]+I[E<<4&63]+"==")):u===2&&(E=(m[y-2]<<8)+m[y-1],n.push(I[E>>10]+I[E>>4&63]+I[E<<2&63]+"=")),n.join("")}},{}],70:[function(M,ne,N){/*!
* Bowser - a browser detector
* https://github.com/ded/bowser
* MIT License | (c) Dustin Diaz 2015
*/!function(I,h,S){typeof ne!="undefined"&&ne.exports?ne.exports=S():typeof define=="function"&&define.amd?define(h,S):I[h]=S()}(this,"bowser",function(){var I=!0;function h(s){function a(V){var K=s.match(V);return K&&K.length>1&&K[1]||""}function r(V){var K=s.match(V);return K&&K.length>1&&K[2]||""}var f=a(/(ipod|iphone|ipad)/i).toLowerCase(),p=/like android/i.test(s),m=!p&&/android/i.test(s),E=/nexus\s*[0-6]\s*/i.test(s),y=!E&&/nexus\s*[0-9]+/i.test(s),u=/CrOS/.test(s),n=/silk/i.test(s),o=/sailfish/i.test(s),l=/tizen/i.test(s),w=/(web|hpw)(o|0)s/i.test(s),v=/windows phone/i.test(s),i=/SamsungBrowser/i.test(s),R=!v&&/windows/i.test(s),k=!f&&!n&&/macintosh/i.test(s),d=!m&&!o&&!l&&!w&&/linux/i.test(s),b=r(/edg([ea]|ios)\/(\d+(\.\d+)?)/i),x=a(/version\/(\d+(\.\d+)?)/i),_=/tablet/i.test(s)&&!/tablet pc/i.test(s),B=!_&&/[^-]mobi/i.test(s),U=/xbox/i.test(s),P;/opera/i.test(s)?P={name:"Opera",opera:I,version:x||a(/(?:opera|opr|opios)[\s\/](\d+(\.\d+)?)/i)}:/opr\/|opios/i.test(s)?P={name:"Opera",opera:I,version:a(/(?:opr|opios)[\s\/](\d+(\.\d+)?)/i)||x}:/SamsungBrowser/i.test(s)?P={name:"Samsung Internet for Android",samsungBrowser:I,version:x||a(/(?:SamsungBrowser)[\s\/](\d+(\.\d+)?)/i)}:/Whale/i.test(s)?P={name:"NAVER Whale browser",whale:I,version:a(/(?:whale)[\s\/](\d+(?:\.\d+)+)/i)}:/MZBrowser/i.test(s)?P={name:"MZ Browser",mzbrowser:I,version:a(/(?:MZBrowser)[\s\/](\d+(?:\.\d+)+)/i)}:/coast/i.test(s)?P={name:"Opera Coast",coast:I,version:x||a(/(?:coast)[\s\/](\d+(\.\d+)?)/i)}:/focus/i.test(s)?P={name:"Focus",focus:I,version:a(/(?:focus)[\s\/](\d+(?:\.\d+)+)/i)}:/yabrowser/i.test(s)?P={name:"Yandex Browser",yandexbrowser:I,version:x||a(/(?:yabrowser)[\s\/](\d+(\.\d+)?)/i)}:/ucbrowser/i.test(s)?P={name:"UC Browser",ucbrowser:I,version:a(/(?:ucbrowser)[\s\/](\d+(?:\.\d+)+)/i)}:/mxios/i.test(s)?P={name:"Maxthon",maxthon:I,version:a(/(?:mxios)[\s\/](\d+(?:\.\d+)+)/i)}:/epiphany/i.test(s)?P={name:"Epiphany",epiphany:I,version:a(/(?:epiphany)[\s\/](\d+(?:\.\d+)+)/i)}:/puffin/i.test(s)?P={name:"Puffin",puffin:I,version:a(/(?:puffin)[\s\/](\d+(?:\.\d+)?)/i)}:/sleipnir/i.test(s)?P={name:"Sleipnir",sleipnir:I,version:a(/(?:sleipnir)[\s\/](\d+(?:\.\d+)+)/i)}:/k-meleon/i.test(s)?P={name:"K-Meleon",kMeleon:I,version:a(/(?:k-meleon)[\s\/](\d+(?:\.\d+)+)/i)}:v?(P={name:"Windows Phone",osname:"Windows Phone",windowsphone:I},b?(P.msedge=I,P.version=b):(P.msie=I,P.version=a(/iemobile\/(\d+(\.\d+)?)/i))):/msie|trident/i.test(s)?P={name:"Internet Explorer",msie:I,version:a(/(?:msie |rv:)(\d+(\.\d+)?)/i)}:u?P={name:"Chrome",osname:"Chrome OS",chromeos:I,chromeBook:I,chrome:I,version:a(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:/edg([ea]|ios)/i.test(s)?P={name:"Microsoft Edge",msedge:I,version:b}:/vivaldi/i.test(s)?P={name:"Vivaldi",vivaldi:I,version:a(/vivaldi\/(\d+(\.\d+)?)/i)||x}:o?P={name:"Sailfish",osname:"Sailfish OS",sailfish:I,version:a(/sailfish\s?browser\/(\d+(\.\d+)?)/i)}:/seamonkey\//i.test(s)?P={name:"SeaMonkey",seamonkey:I,version:a(/seamonkey\/(\d+(\.\d+)?)/i)}:/firefox|iceweasel|fxios/i.test(s)?(P={name:"Firefox",firefox:I,version:a(/(?:firefox|iceweasel|fxios)[ \/](\d+(\.\d+)?)/i)},/\((mobile|tablet);[^\)]*rv:[\d\.]+\)/i.test(s)&&(P.firefoxos=I,P.osname="Firefox OS")):n?P={name:"Amazon Silk",silk:I,version:a(/silk\/(\d+(\.\d+)?)/i)}:/phantom/i.test(s)?P={name:"PhantomJS",phantom:I,version:a(/phantomjs\/(\d+(\.\d+)?)/i)}:/slimerjs/i.test(s)?P={name:"SlimerJS",slimer:I,version:a(/slimerjs\/(\d+(\.\d+)?)/i)}:/blackberry|\bbb\d+/i.test(s)||/rim\stablet/i.test(s)?P={name:"BlackBerry",osname:"BlackBerry OS",blackberry:I,version:x||a(/blackberry[\d]+\/(\d+(\.\d+)?)/i)}:w?(P={name:"WebOS",osname:"WebOS",webos:I,version:x||a(/w(?:eb)?osbrowser\/(\d+(\.\d+)?)/i)},/touchpad\//i.test(s)&&(P.touchpad=I)):/bada/i.test(s)?P={name:"Bada",osname:"Bada",bada:I,version:a(/dolfin\/(\d+(\.\d+)?)/i)}:l?P={name:"Tizen",osname:"Tizen",tizen:I,version:a(/(?:tizen\s?)?browser\/(\d+(\.\d+)?)/i)||x}:/qupzilla/i.test(s)?P={name:"QupZilla",qupzilla:I,version:a(/(?:qupzilla)[\s\/](\d+(?:\.\d+)+)/i)||x}:/chromium/i.test(s)?P={name:"Chromium",chromium:I,version:a(/(?:chromium)[\s\/](\d+(?:\.\d+)?)/i)||x}:/chrome|crios|crmo/i.test(s)?P={name:"Chrome",chrome:I,version:a(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:m?P={name:"Android",version:x}:/safari|applewebkit/i.test(s)?(P={name:"Safari",safari:I},x&&(P.version=x)):f?(P={name:f=="iphone"?"iPhone":f=="ipad"?"iPad":"iPod"},x&&(P.version=x)):/googlebot/i.test(s)?P={name:"Googlebot",googlebot:I,version:a(/googlebot\/(\d+(\.\d+))/i)||x}:P={name:a(/^(.*)\/(.*) /),version:r(/^(.*)\/(.*) /)},!P.msedge&&/(apple)?webkit/i.test(s)?(/(apple)?webkit\/537\.36/i.test(s)?(P.name=P.name||"Blink",P.blink=I):(P.name=P.name||"Webkit",P.webkit=I),!P.version&&x&&(P.version=x)):!P.opera&&/gecko\//i.test(s)&&(P.name=P.name||"Gecko",P.gecko=I,P.version=P.version||a(/gecko\/(\d+(\.\d+)?)/i)),!P.windowsphone&&(m||P.silk)?(P.android=I,P.osname="Android"):!P.windowsphone&&f?(P[f]=I,P.ios=I,P.osname="iOS"):k?(P.mac=I,P.osname="macOS"):U?(P.xbox=I,P.osname="Xbox"):R?(P.windows=I,P.osname="Windows"):d&&(P.linux=I,P.osname="Linux");function J(V){switch(V){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}}var $="";P.windows?$=J(a(/Windows ((NT|XP)( \d\d?.\d)?)/i)):P.windowsphone?$=a(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i):P.mac?($=a(/Mac OS X (\d+([_\.\s]\d+)*)/i),$=$.replace(/[_\s]/g,".")):f?($=a(/os (\d+([_\s]\d+)*) like mac os x/i),$=$.replace(/[_\s]/g,".")):m?$=a(/android[ \/-](\d+(\.\d+)*)/i):P.webos?$=a(/(?:web|hpw)os\/(\d+(\.\d+)*)/i):P.blackberry?$=a(/rim\stablet\sos\s(\d+(\.\d+)*)/i):P.bada?$=a(/bada\/(\d+(\.\d+)*)/i):P.tizen&&($=a(/tizen[\/\s](\d+(\.\d+)*)/i)),$&&(P.osversion=$);var z=!P.windows&&$.split(".")[0];return _||y||f=="ipad"||m&&(z==3||z>=4&&!B)||P.silk?P.tablet=I:(B||f=="iphone"||f=="ipod"||m||E||P.blackberry||P.webos||P.bada)&&(P.mobile=I),P.msedge||P.msie&&P.version>=10||P.yandexbrowser&&P.version>=15||P.vivaldi&&P.version>=1||P.chrome&&P.version>=20||P.samsungBrowser&&P.version>=4||P.whale&&c([P.version,"1.0"])===1||P.mzbrowser&&c([P.version,"6.0"])===1||P.focus&&c([P.version,"1.0"])===1||P.firefox&&P.version>=20||P.safari&&P.version>=6||P.opera&&P.version>=10||P.ios&&P.osversion&&P.osversion.split(".")[0]>=6||P.blackberry&&P.version>=10.1||P.chromium&&P.version>=20?P.a=I:P.msie&&P.version<10||P.chrome&&P.version<20||P.firefox&&P.version<20||P.safari&&P.version<6||P.opera&&P.version<10||P.ios&&P.osversion&&P.osversion.split(".")[0]<6||P.chromium&&P.version<20?P.c=I:P.x=I,P}var S=h(typeof navigator!="undefined"&&navigator.userAgent||"");S.test=function(s){for(var a=0;a<s.length;++a){var r=s[a];if(typeof r=="string"&&r in S)return!0}return!1};function L(s){return s.split(".").length}function T(s,a){var r=[],f;if(Array.prototype.map)return Array.prototype.map.call(s,a);for(f=0;f<s.length;f++)r.push(a(s[f]));return r}function c(s){for(var a=Math.max(L(s[0]),L(s[1])),r=T(s,function(f){var p=a-L(f);return f=f+new Array(p+1).join(".0"),T(f.split("."),function(m){return new Array(20-m.length).join("0")+m}).reverse()});--a>=0;){if(r[0][a]>r[1][a])return 1;if(r[0][a]===r[1][a]){if(a===0)return 0}else return-1}}function C(s,a,r){var f=S;typeof a=="string"&&(r=a,a=void 0),a===void 0&&(a=!1),r&&(f=h(r));var p=""+f.version;for(var m in s)if(s.hasOwnProperty(m)&&f[m]){if(typeof s[m]!="string")throw new Error("Browser version in the minVersion map should be a string: "+m+": "+String(s));return c([p,s[m]])<0}return a}function g(s,a,r){return!C(s,a,r)}return S.isUnsupportedBrowser=C,S.compareVersions=c,S.check=g,S._detect=h,S.detect=h,S})},{}],71:[function(M,ne,N){},{}],72:[function(M,ne,N){var I=M("buffer").Buffer,h=I.isEncoding||function(g){switch(g&&g.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}};function S(g){if(g&&!h(g))throw new Error("Unknown encoding: "+g)}var L=N.StringDecoder=function(g){this.encoding=(g||"utf8").toLowerCase().replace(/[-_]/,""),S(g);switch(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=C;break;default:this.write=T;return}this.charBuffer=new I(6),this.charReceived=0,this.charLength=0};L.prototype.write=function(g){for(var s="";this.charLength;){var a=g.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:g.length;if(g.copy(this.charBuffer,this.charReceived,0,a),this.charReceived+=a,this.charReceived<this.charLength)return"";g=g.slice(a,g.length),s=this.charBuffer.slice(0,this.charLength).toString(this.encoding);var f=s.charCodeAt(s.length-1);if(f>=55296&&f<=56319){this.charLength+=this.surrogateSize,s="";continue}if(this.charReceived=this.charLength=0,g.length===0)return s;break}this.detectIncompleteChar(g);var r=g.length;this.charLength&&(g.copy(this.charBuffer,0,g.length-this.charReceived,r),r-=this.charReceived),s+=g.toString(this.encoding,0,r);var r=s.length-1,f=s.charCodeAt(r);if(f>=55296&&f<=56319){var p=this.surrogateSize;return this.charLength+=p,this.charReceived+=p,this.charBuffer.copy(this.charBuffer,p,0,p),g.copy(this.charBuffer,0,0,p),s.substring(0,r)}return s},L.prototype.detectIncompleteChar=function(g){for(var s=g.length>=3?3:g.length;s>0;s--){var a=g[g.length-s];if(s==1&&a>>5==6){this.charLength=2;break}if(s<=2&&a>>4==14){this.charLength=3;break}if(s<=3&&a>>3==30){this.charLength=4;break}}this.charReceived=s},L.prototype.end=function(g){var s="";if(g&&g.length&&(s=this.write(g)),this.charReceived){var a=this.charReceived,r=this.charBuffer,f=this.encoding;s+=r.slice(0,a).toString(f)}return s};function T(g){return g.toString(this.encoding)}function c(g){this.charReceived=g.length%2,this.charLength=this.charReceived?2:0}function C(g){this.charReceived=g.length%3,this.charLength=this.charReceived?3:0}},{buffer:73}],73:[function(M,ne,N){(function(I,h){/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <http://feross.org>
* @license MIT
*/"use strict";var S=M("base64-js"),L=M("ieee754"),T=M("isarray");N.Buffer=h,N.SlowBuffer=n,N.INSPECT_MAX_BYTES=50,h.TYPED_ARRAY_SUPPORT=I.TYPED_ARRAY_SUPPORT!==void 0?I.TYPED_ARRAY_SUPPORT:c(),N.kMaxLength=C();function c(){try{var te=new Uint8Array(1);return te.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},te.foo()===42&&typeof te.subarray=="function"&&te.subarray(1,1).byteLength===0}catch(q){return!1}}function C(){return h.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function g(te,q){if(C()<q)throw new RangeError("Invalid typed array length");return h.TYPED_ARRAY_SUPPORT?(te=new Uint8Array(q),te.__proto__=h.prototype):(te===null&&(te=new h(q)),te.length=q),te}function h(te,q,X){if(!h.TYPED_ARRAY_SUPPORT&&!(this instanceof h))return new h(te,q,X);if(typeof te=="number"){if(typeof q=="string")throw new Error("If encoding is specified then the first argument must be a string");return f(this,te)}return s(this,te,q,X)}h.poolSize=8192,h._augment=function(te){return te.__proto__=h.prototype,te};function s(te,q,X,re){if(typeof q=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer!="undefined"&&q instanceof ArrayBuffer?E(te,q,X,re):typeof q=="string"?p(te,q,X):y(te,q)}h.from=function(te,q,X){return s(null,te,q,X)},h.TYPED_ARRAY_SUPPORT&&(h.prototype.__proto__=Uint8Array.prototype,h.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&h[Symbol.species]===h&&Object.defineProperty(h,Symbol.species,{value:null,configurable:!0}));function a(te){if(typeof te!="number")throw new TypeError('"size" argument must be a number');if(te<0)throw new RangeError('"size" argument must not be negative')}function r(te,q,X,re){return a(q),q<=0?g(te,q):X!==void 0?typeof re=="string"?g(te,q).fill(X,re):g(te,q).fill(X):g(te,q)}h.alloc=function(te,q,X){return r(null,te,q,X)};function f(te,q){if(a(q),te=g(te,q<0?0:u(q)|0),!h.TYPED_ARRAY_SUPPORT)for(var X=0;X<q;++X)te[X]=0;return te}h.allocUnsafe=function(te){return f(null,te)},h.allocUnsafeSlow=function(te){return f(null,te)};function p(te,q,X){if((typeof X!="string"||X==="")&&(X="utf8"),!h.isEncoding(X))throw new TypeError('"encoding" must be a valid string encoding');var re=o(q,X)|0;te=g(te,re);var me=te.write(q,X);return me!==re&&(te=te.slice(0,me)),te}function m(te,q){var X=q.length<0?0:u(q.length)|0;te=g(te,X);for(var re=0;re<X;re+=1)te[re]=q[re]&255;return te}function E(te,q,X,re){if(q.byteLength,X<0||q.byteLength<X)throw new RangeError("'offset' is out of bounds");if(q.byteLength<X+(re||0))throw new RangeError("'length' is out of bounds");return X===void 0&&re===void 0?q=new Uint8Array(q):re===void 0?q=new Uint8Array(q,X):q=new Uint8Array(q,X,re),h.TYPED_ARRAY_SUPPORT?(te=q,te.__proto__=h.prototype):te=m(te,q),te}function y(te,q){if(h.isBuffer(q)){var X=u(q.length)|0;return te=g(te,X),te.length===0||q.copy(te,0,0,X),te}if(q){if(typeof ArrayBuffer!="undefined"&&q.buffer instanceof ArrayBuffer||"length"in q)return typeof q.length!="number"||Z(q.length)?g(te,0):m(te,q);if(q.type==="Buffer"&&T(q.data))return m(te,q.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function u(te){if(te>=C())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+C().toString(16)+" bytes");return te|0}function n(te){return+te!=te&&(te=0),h.alloc(+te)}h.isBuffer=function(q){return!!(q!=null&&q._isBuffer)},h.compare=function(q,X){if(!h.isBuffer(q)||!h.isBuffer(X))throw new TypeError("Arguments must be Buffers");if(q===X)return 0;for(var re=q.length,me=X.length,ve=0,Te=Math.min(re,me);ve<Te;++ve)if(q[ve]!==X[ve]){re=q[ve],me=X[ve];break}return re<me?-1:me<re?1:0},h.isEncoding=function(q){switch(String(q).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}},h.concat=function(q,X){if(!T(q))throw new TypeError('"list" argument must be an Array of Buffers');if(q.length===0)return h.alloc(0);var re;if(X===void 0)for(X=0,re=0;re<q.length;++re)X+=q[re].length;var me=h.allocUnsafe(X),ve=0;for(re=0;re<q.length;++re){var Te=q[re];if(!h.isBuffer(Te))throw new TypeError('"list" argument must be an Array of Buffers');Te.copy(me,ve),ve+=Te.length}return me};function o(te,q){if(h.isBuffer(te))return te.length;if(typeof ArrayBuffer!="undefined"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(te)||te instanceof ArrayBuffer))return te.byteLength;typeof te!="string"&&(te=""+te);var X=te.length;if(X===0)return 0;for(var re=!1;;)switch(q){case"ascii":case"latin1":case"binary":return X;case"utf8":case"utf-8":case void 0:return Q(te).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return X*2;case"hex":return X>>>1;case"base64":return W(te).length;default:if(re)return Q(te).length;q=(""+q).toLowerCase(),re=!0}}h.byteLength=o;function l(te,q,X){var re=!1;if((q===void 0||q<0)&&(q=0),q>this.length)return"";if((X===void 0||X>this.length)&&(X=this.length),X<=0)return"";if(X>>>=0,q>>>=0,X<=q)return"";for(te||(te="utf8");;)switch(te){case"hex":return V(this,q,X);case"utf8":case"utf-8":return U(this,q,X);case"ascii":return $(this,q,X);case"latin1":case"binary":return z(this,q,X);case"base64":return B(this,q,X);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return K(this,q,X);default:if(re)throw new TypeError("Unknown encoding: "+te);te=(te+"").toLowerCase(),re=!0}}h.prototype._isBuffer=!0;function w(te,q,X){var re=te[q];te[q]=te[X],te[X]=re}h.prototype.swap16=function(){var q=this.length;if(q%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var X=0;X<q;X+=2)w(this,X,X+1);return this},h.prototype.swap32=function(){var q=this.length;if(q%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var X=0;X<q;X+=4)w(this,X,X+3),w(this,X+1,X+2);return this},h.prototype.swap64=function(){var q=this.length;if(q%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var X=0;X<q;X+=8)w(this,X,X+7),w(this,X+1,X+6),w(this,X+2,X+5),w(this,X+3,X+4);return this},h.prototype.toString=function(){var q=this.length|0;return q===0?"":arguments.length===0?U(this,0,q):l.apply(this,arguments)},h.prototype.equals=function(q){if(!h.isBuffer(q))throw new TypeError("Argument must be a Buffer");return this===q?!0:h.compare(this,q)===0},h.prototype.inspect=function(){var q="",X=N.INSPECT_MAX_BYTES;return this.length>0&&(q=this.toString("hex",0,X).match(/.{2}/g).join(" "),this.length>X&&(q+=" ... ")),"<Buffer "+q+">"},h.prototype.compare=function(q,X,re,me,ve){if(!h.isBuffer(q))throw new TypeError("Argument must be a Buffer");if(X===void 0&&(X=0),re===void 0&&(re=q?q.length:0),me===void 0&&(me=0),ve===void 0&&(ve=this.length),X<0||re>q.length||me<0||ve>this.length)throw new RangeError("out of range index");if(me>=ve&&X>=re)return 0;if(me>=ve)return-1;if(X>=re)return 1;if(X>>>=0,re>>>=0,me>>>=0,ve>>>=0,this===q)return 0;for(var Te=ve-me,Re=re-X,Ie=Math.min(Te,Re),je=this.slice(me,ve),Ne=q.slice(X,re),We=0;We<Ie;++We)if(je[We]!==Ne[We]){Te=je[We],Re=Ne[We];break}return Te<Re?-1:Re<Te?1:0};function v(te,q,X,re,me){if(te.length===0)return-1;if(typeof X=="string"?(re=X,X=0):X>2147483647?X=2147483647:X<-2147483648&&(X=-2147483648),X=+X,isNaN(X)&&(X=me?0:te.length-1),X<0&&(X=te.length+X),X>=te.length){if(me)return-1;X=te.length-1}else if(X<0)if(me)X=0;else return-1;if(typeof q=="string"&&(q=h.from(q,re)),h.isBuffer(q))return q.length===0?-1:i(te,q,X,re,me);if(typeof q=="number")return q=q&255,h.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?me?Uint8Array.prototype.indexOf.call(te,q,X):Uint8Array.prototype.lastIndexOf.call(te,q,X):i(te,[q],X,re,me);throw new TypeError("val must be string, number or Buffer")}function i(te,q,X,re,me){var ve=1,Te=te.length,Re=q.length;if(re!==void 0&&(re=String(re).toLowerCase(),re==="ucs2"||re==="ucs-2"||re==="utf16le"||re==="utf-16le")){if(te.length<2||q.length<2)return-1;ve=2,Te/=2,Re/=2,X/=2}function Ie(He,De){return ve===1?He[De]:He.readUInt16BE(De*ve)}var je;if(me){var Ne=-1;for(je=X;je<Te;je++)if(Ie(te,je)===Ie(q,Ne===-1?0:je-Ne)){if(Ne===-1&&(Ne=je),je-Ne+1===Re)return Ne*ve}else Ne!==-1&&(je-=je-Ne),Ne=-1}else for(X+Re>Te&&(X=Te-Re),je=X;je>=0;je--){for(var We=!0,Be=0;Be<Re;Be++)if(Ie(te,je+Be)!==Ie(q,Be)){We=!1;break}if(We)return je}return-1}h.prototype.includes=function(q,X,re){return this.indexOf(q,X,re)!==-1},h.prototype.indexOf=function(q,X,re){return v(this,q,X,re,!0)},h.prototype.lastIndexOf=function(q,X,re){return v(this,q,X,re,!1)};function R(te,q,X,re){X=Number(X)||0;var me=te.length-X;re?(re=Number(re),re>me&&(re=me)):re=me;var ve=q.length;if(ve%2!==0)throw new TypeError("Invalid hex string");re>ve/2&&(re=ve/2);for(var Te=0;Te<re;++Te){var Re=parseInt(q.substr(Te*2,2),16);if(isNaN(Re))return Te;te[X+Te]=Re}return Te}function k(te,q,X,re){return Y(Q(q,te.length-X),te,X,re)}function d(te,q,X,re){return Y(D(q),te,X,re)}function b(te,q,X,re){return d(te,q,X,re)}function x(te,q,X,re){return Y(W(q),te,X,re)}function _(te,q,X,re){return Y(F(q,te.length-X),te,X,re)}h.prototype.write=function(q,X,re,me){if(X===void 0)me="utf8",re=this.length,X=0;else if(re===void 0&&typeof X=="string")me=X,re=this.length,X=0;else if(isFinite(X))X=X|0,isFinite(re)?(re=re|0,me===void 0&&(me="utf8")):(me=re,re=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var ve=this.length-X;if((re===void 0||re>ve)&&(re=ve),q.length>0&&(re<0||X<0)||X>this.length)throw new RangeError("Attempt to write outside buffer bounds");me||(me="utf8");for(var Te=!1;;)switch(me){case"hex":return R(this,q,X,re);case"utf8":case"utf-8":return k(this,q,X,re);case"ascii":return d(this,q,X,re);case"latin1":case"binary":return b(this,q,X,re);case"base64":return x(this,q,X,re);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,q,X,re);default:if(Te)throw new TypeError("Unknown encoding: "+me);me=(""+me).toLowerCase(),Te=!0}},h.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function B(te,q,X){return q===0&&X===te.length?S.fromByteArray(te):S.fromByteArray(te.slice(q,X))}function U(te,q,X){X=Math.min(te.length,X);for(var re=[],me=q;me<X;){var ve=te[me],Te=null,Re=ve>239?4:ve>223?3:ve>191?2:1;if(me+Re<=X){var Ie,je,Ne,We;switch(Re){case 1:ve<128&&(Te=ve);break;case 2:Ie=te[me+1],(Ie&192)===128&&(We=(ve&31)<<6|Ie&63,We>127&&(Te=We));break;case 3:Ie=te[me+1],je=te[me+2],(Ie&192)===128&&(je&192)===128&&(We=(ve&15)<<12|(Ie&63)<<6|je&63,We>2047&&(We<55296||We>57343)&&(Te=We));break;case 4:Ie=te[me+1],je=te[me+2],Ne=te[me+3],(Ie&192)===128&&(je&192)===128&&(Ne&192)===128&&(We=(ve&15)<<18|(Ie&63)<<12|(je&63)<<6|Ne&63,We>65535&&We<1114112&&(Te=We))}}Te===null?(Te=65533,Re=1):Te>65535&&(Te-=65536,re.push(Te>>>10&1023|55296),Te=56320|Te&1023),re.push(Te),me+=Re}return J(re)}var P=4096;function J(te){var q=te.length;if(q<=P)return String.fromCharCode.apply(String,te);for(var X="",re=0;re<q;)X+=String.fromCharCode.apply(String,te.slice(re,re+=P));return X}function $(te,q,X){var re="";X=Math.min(te.length,X);for(var me=q;me<X;++me)re+=String.fromCharCode(te[me]&127);return re}function z(te,q,X){var re="";X=Math.min(te.length,X);for(var me=q;me<X;++me)re+=String.fromCharCode(te[me]);return re}function V(te,q,X){var re=te.length;(!q||q<0)&&(q=0),(!X||X<0||X>re)&&(X=re);for(var me="",ve=q;ve<X;++ve)me+=ae(te[ve]);return me}function K(te,q,X){for(var re=te.slice(q,X),me="",ve=0;ve<re.length;ve+=2)me+=String.fromCharCode(re[ve]+re[ve+1]*256);return me}h.prototype.slice=function(q,X){var re=this.length;q=~~q,X=X===void 0?re:~~X,q<0?(q+=re,q<0&&(q=0)):q>re&&(q=re),X<0?(X+=re,X<0&&(X=0)):X>re&&(X=re),X<q&&(X=q);var me;if(h.TYPED_ARRAY_SUPPORT)me=this.subarray(q,X),me.__proto__=h.prototype;else{var ve=X-q;me=new h(ve,void 0);for(var Te=0;Te<ve;++Te)me[Te]=this[Te+q]}return me};function H(te,q,X){if(te%1!==0||te<0)throw new RangeError("offset is not uint");if(te+q>X)throw new RangeError("Trying to access beyond buffer length")}h.prototype.readUIntLE=function(q,X,re){q=q|0,X=X|0,re||H(q,X,this.length);for(var me=this[q],ve=1,Te=0;++Te<X&&(ve*=256);)me+=this[q+Te]*ve;return me},h.prototype.readUIntBE=function(q,X,re){q=q|0,X=X|0,re||H(q,X,this.length);for(var me=this[q+--X],ve=1;X>0&&(ve*=256);)me+=this[q+--X]*ve;return me},h.prototype.readUInt8=function(q,X){return X||H(q,1,this.length),this[q]},h.prototype.readUInt16LE=function(q,X){return X||H(q,2,this.length),this[q]|this[q+1]<<8},h.prototype.readUInt16BE=function(q,X){return X||H(q,2,this.length),this[q]<<8|this[q+1]},h.prototype.readUInt32LE=function(q,X){return X||H(q,4,this.length),(this[q]|this[q+1]<<8|this[q+2]<<16)+this[q+3]*16777216},h.prototype.readUInt32BE=function(q,X){return X||H(q,4,this.length),this[q]*16777216+(this[q+1]<<16|this[q+2]<<8|this[q+3])},h.prototype.readIntLE=function(q,X,re){q=q|0,X=X|0,re||H(q,X,this.length);for(var me=this[q],ve=1,Te=0;++Te<X&&(ve*=256);)me+=this[q+Te]*ve;return ve*=128,me>=ve&&(me-=Math.pow(2,8*X)),me},h.prototype.readIntBE=function(q,X,re){q=q|0,X=X|0,re||H(q,X,this.length);for(var me=X,ve=1,Te=this[q+--me];me>0&&(ve*=256);)Te+=this[q+--me]*ve;return ve*=128,Te>=ve&&(Te-=Math.pow(2,8*X)),Te},h.prototype.readInt8=function(q,X){return X||H(q,1,this.length),this[q]&128?(255-this[q]+1)*-1:this[q]},h.prototype.readInt16LE=function(q,X){X||H(q,2,this.length);var re=this[q]|this[q+1]<<8;return re&32768?re|4294901760:re},h.prototype.readInt16BE=function(q,X){X||H(q,2,this.length);var re=this[q+1]|this[q]<<8;return re&32768?re|4294901760:re},h.prototype.readInt32LE=function(q,X){return X||H(q,4,this.length),this[q]|this[q+1]<<8|this[q+2]<<16|this[q+3]<<24},h.prototype.readInt32BE=function(q,X){return X||H(q,4,this.length),this[q]<<24|this[q+1]<<16|this[q+2]<<8|this[q+3]},h.prototype.readFloatLE=function(q,X){return X||H(q,4,this.length),L.read(this,q,!0,23,4)},h.prototype.readFloatBE=function(q,X){return X||H(q,4,this.length),L.read(this,q,!1,23,4)},h.prototype.readDoubleLE=function(q,X){return X||H(q,8,this.length),L.read(this,q,!0,52,8)},h.prototype.readDoubleBE=function(q,X){return X||H(q,8,this.length),L.read(this,q,!1,52,8)};function G(te,q,X,re,me,ve){if(!h.isBuffer(te))throw new TypeError('"buffer" argument must be a Buffer instance');if(q>me||q<ve)throw new RangeError('"value" argument is out of bounds');if(X+re>te.length)throw new RangeError("Index out of range")}h.prototype.writeUIntLE=function(q,X,re,me){if(q=+q,X=X|0,re=re|0,!me){var ve=Math.pow(2,8*re)-1;G(this,q,X,re,ve,0)}var Te=1,Re=0;for(this[X]=q&255;++Re<re&&(Te*=256);)this[X+Re]=q/Te&255;return X+re},h.prototype.writeUIntBE=function(q,X,re,me){if(q=+q,X=X|0,re=re|0,!me){var ve=Math.pow(2,8*re)-1;G(this,q,X,re,ve,0)}var Te=re-1,Re=1;for(this[X+Te]=q&255;--Te>=0&&(Re*=256);)this[X+Te]=q/Re&255;return X+re},h.prototype.writeUInt8=function(q,X,re){return q=+q,X=X|0,re||G(this,q,X,1,255,0),h.TYPED_ARRAY_SUPPORT||(q=Math.floor(q)),this[X]=q&255,X+1};function ie(te,q,X,re){q<0&&(q=65535+q+1);for(var me=0,ve=Math.min(te.length-X,2);me<ve;++me)te[X+me]=(q&255<<8*(re?me:1-me))>>>(re?me:1-me)*8}h.prototype.writeUInt16LE=function(q,X,re){return q=+q,X=X|0,re||G(this,q,X,2,65535,0),h.TYPED_ARRAY_SUPPORT?(this[X]=q&255,this[X+1]=q>>>8):ie(this,q,X,!0),X+2},h.prototype.writeUInt16BE=function(q,X,re){return q=+q,X=X|0,re||G(this,q,X,2,65535,0),h.TYPED_ARRAY_SUPPORT?(this[X]=q>>>8,this[X+1]=q&255):ie(this,q,X,!1),X+2};function le(te,q,X,re){q<0&&(q=4294967295+q+1);for(var me=0,ve=Math.min(te.length-X,4);me<ve;++me)te[X+me]=q>>>(re?me:3-me)*8&255}h.prototype.writeUInt32LE=function(q,X,re){return q=+q,X=X|0,re||G(this,q,X,4,4294967295,0),h.TYPED_ARRAY_SUPPORT?(this[X+3]=q>>>24,this[X+2]=q>>>16,this[X+1]=q>>>8,this[X]=q&255):le(this,q,X,!0),X+4},h.prototype.writeUInt32BE=function(q,X,re){return q=+q,X=X|0,re||G(this,q,X,4,4294967295,0),h.TYPED_ARRAY_SUPPORT?(this[X]=q>>>24,this[X+1]=q>>>16,this[X+2]=q>>>8,this[X+3]=q&255):le(this,q,X,!1),X+4},h.prototype.writeIntLE=function(q,X,re,me){if(q=+q,X=X|0,!me){var ve=Math.pow(2,8*re-1);G(this,q,X,re,ve-1,-ve)}var Te=0,Re=1,Ie=0;for(this[X]=q&255;++Te<re&&(Re*=256);)q<0&&Ie===0&&this[X+Te-1]!==0&&(Ie=1),this[X+Te]=(q/Re>>0)-Ie&255;return X+re},h.prototype.writeIntBE=function(q,X,re,me){if(q=+q,X=X|0,!me){var ve=Math.pow(2,8*re-1);G(this,q,X,re,ve-1,-ve)}var Te=re-1,Re=1,Ie=0;for(this[X+Te]=q&255;--Te>=0&&(Re*=256);)q<0&&Ie===0&&this[X+Te+1]!==0&&(Ie=1),this[X+Te]=(q/Re>>0)-Ie&255;return X+re},h.prototype.writeInt8=function(q,X,re){return q=+q,X=X|0,re||G(this,q,X,1,127,-128),h.TYPED_ARRAY_SUPPORT||(q=Math.floor(q)),q<0&&(q=255+q+1),this[X]=q&255,X+1},h.prototype.writeInt16LE=function(q,X,re){return q=+q,X=X|0,re||G(this,q,X,2,32767,-32768),h.TYPED_ARRAY_SUPPORT?(this[X]=q&255,this[X+1]=q>>>8):ie(this,q,X,!0),X+2},h.prototype.writeInt16BE=function(q,X,re){return q=+q,X=X|0,re||G(this,q,X,2,32767,-32768),h.TYPED_ARRAY_SUPPORT?(this[X]=q>>>8,this[X+1]=q&255):ie(this,q,X,!1),X+2},h.prototype.writeInt32LE=function(q,X,re){return q=+q,X=X|0,re||G(this,q,X,4,2147483647,-2147483648),h.TYPED_ARRAY_SUPPORT?(this[X]=q&255,this[X+1]=q>>>8,this[X+2]=q>>>16,this[X+3]=q>>>24):le(this,q,X,!0),X+4},h.prototype.writeInt32BE=function(q,X,re){return q=+q,X=X|0,re||G(this,q,X,4,2147483647,-2147483648),q<0&&(q=4294967295+q+1),h.TYPED_ARRAY_SUPPORT?(this[X]=q>>>24,this[X+1]=q>>>16,this[X+2]=q>>>8,this[X+3]=q&255):le(this,q,X,!1),X+4};function ue(te,q,X,re,me,ve){if(X+re>te.length)throw new RangeError("Index out of range");if(X<0)throw new RangeError("Index out of range")}function be(te,q,X,re,me){return me||ue(te,q,X,4,34028234663852886e22,-34028234663852886e22),L.write(te,q,X,re,23,4),X+4}h.prototype.writeFloatLE=function(q,X,re){return be(this,q,X,!0,re)},h.prototype.writeFloatBE=function(q,X,re){return be(this,q,X,!1,re)};function Ce(te,q,X,re,me){return me||ue(te,q,X,8,17976931348623157e292,-17976931348623157e292),L.write(te,q,X,re,52,8),X+8}h.prototype.writeDoubleLE=function(q,X,re){return Ce(this,q,X,!0,re)},h.prototype.writeDoubleBE=function(q,X,re){return Ce(this,q,X,!1,re)},h.prototype.copy=function(q,X,re,me){if(re||(re=0),!me&&me!==0&&(me=this.length),X>=q.length&&(X=q.length),X||(X=0),me>0&&me<re&&(me=re),me===re)return 0;if(q.length===0||this.length===0)return 0;if(X<0)throw new RangeError("targetStart out of bounds");if(re<0||re>=this.length)throw new RangeError("sourceStart out of bounds");if(me<0)throw new RangeError("sourceEnd out of bounds");me>this.length&&(me=this.length),q.length-X<me-re&&(me=q.length-X+re);var ve=me-re,Te;if(this===q&&re<X&&X<me)for(Te=ve-1;Te>=0;--Te)q[Te+X]=this[Te+re];else if(ve<1e3||!h.TYPED_ARRAY_SUPPORT)for(Te=0;Te<ve;++Te)q[Te+X]=this[Te+re];else Uint8Array.prototype.set.call(q,this.subarray(re,re+ve),X);return ve},h.prototype.fill=function(q,X,re,me){if(typeof q=="string"){if(typeof X=="string"?(me=X,X=0,re=this.length):typeof re=="string"&&(me=re,re=this.length),q.length===1){var ve=q.charCodeAt(0);ve<256&&(q=ve)}if(me!==void 0&&typeof me!="string")throw new TypeError("encoding must be a string");if(typeof me=="string"&&!h.isEncoding(me))throw new TypeError("Unknown encoding: "+me)}else typeof q=="number"&&(q=q&255);if(X<0||this.length<X||this.length<re)throw new RangeError("Out of range index");if(re<=X)return this;X=X>>>0,re=re===void 0?this.length:re>>>0,q||(q=0);var Te;if(typeof q=="number")for(Te=X;Te<re;++Te)this[Te]=q;else{var Re=h.isBuffer(q)?q:Q(new h(q,me).toString()),Ie=Re.length;for(Te=0;Te<re-X;++Te)this[Te+X]=Re[Te%Ie]}return this};var se=/[^+\/0-9A-Za-z-_]/g;function ce(te){if(te=he(te).replace(se,""),te.length<2)return"";for(;te.length%4!==0;)te=te+"=";return te}function he(te){return te.trim?te.trim():te.replace(/^\s+|\s+$/g,"")}function ae(te){return te<16?"0"+te.toString(16):te.toString(16)}function Q(te,q){q=q||Infinity;for(var X,re=te.length,me=null,ve=[],Te=0;Te<re;++Te){if(X=te.charCodeAt(Te),X>55295&&X<57344){if(!me){if(X>56319){(q-=3)>-1&&ve.push(239,191,189);continue}else if(Te+1===re){(q-=3)>-1&&ve.push(239,191,189);continue}me=X;continue}if(X<56320){(q-=3)>-1&&ve.push(239,191,189),me=X;continue}X=(me-55296<<10|X-56320)+65536}else me&&((q-=3)>-1&&ve.push(239,191,189));if(me=null,X<128){if((q-=1)<0)break;ve.push(X)}else if(X<2048){if((q-=2)<0)break;ve.push(X>>6|192,X&63|128)}else if(X<65536){if((q-=3)<0)break;ve.push(X>>12|224,X>>6&63|128,X&63|128)}else if(X<1114112){if((q-=4)<0)break;ve.push(X>>18|240,X>>12&63|128,X>>6&63|128,X&63|128)}else throw new Error("Invalid code point")}return ve}function D(te){for(var q=[],X=0;X<te.length;++X)q.push(te.charCodeAt(X)&255);return q}function F(te,q){for(var X,re,me,ve=[],Te=0;Te<te.length&&!((q-=2)<0);++Te)X=te.charCodeAt(Te),re=X>>8,me=X%256,ve.push(me),ve.push(re);return ve}function W(te){return S.toByteArray(ce(te))}function Y(te,q,X,re){for(var me=0;me<re&&!(me+X>=q.length||me>=te.length);++me)q[me+X]=te[me];return me}function Z(te){return te!==te}}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{},M("buffer").Buffer)},{"base64-js":69,buffer:73,ieee754:195,isarray:198}],74:[function(M,ne,N){ne.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"}},{}],75:[function(M,ne,N){ne.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}},{}],76:[function(M,ne,N){/*!
* copy-to - index.js
* Copyright(c) 2014 dead_horse <dead_horse@qq.com>
* MIT Licensed
*/"use strict";var I=Array.prototype.slice;ne.exports=h;function h(L,T){if(!(this instanceof h))return new h(L,T);this.src=L,this._withAccess=T}h.prototype.withAccess=function(L){return this._withAccess=L!==!1,this},h.prototype.pick=function(L){return Array.isArray(L)||(L=I.call(arguments)),L.length&&(this.keys=L),this},h.prototype.to=function(L){if(L=L||{},!this.src)return L;var T=this.keys||Object.keys(this.src);if(!this._withAccess){for(var c=0;c<T.length;c++){if(C=T[c],L[C]!==void 0)continue;L[C]=this.src[C]}return L}for(var c=0;c<T.length;c++){var C=T[c];if(!S(L,C))continue;var g=this.src.__lookupGetter__(C),s=this.src.__lookupSetter__(C);g&&L.__defineGetter__(C,g),s&&L.__defineSetter__(C,s),!g&&!s&&(L[C]=this.src[C])}return L},h.prototype.toCover=function(L){for(var T=this.keys||Object.keys(this.src),c=0;c<T.length;c++){var C=T[c];delete L[C];var g=this.src.__lookupGetter__(C),s=this.src.__lookupSetter__(C);g&&L.__defineGetter__(C,g),s&&L.__defineSetter__(C,s),!g&&!s&&(L[C]=this.src[C])}},h.prototype.override=h.prototype.toCover,h.prototype.and=function(L){var T={};return this.to(T),this.src=L,this.to(T),this.src=T,this};function S(L,T){return L[T]===void 0&&L.__lookupGetter__(T)===void 0&&L.__lookupSetter__(T)===void 0}},{}],77:[function(M,ne,N){M("../../modules/es6.string.iterator"),M("../../modules/es6.array.from"),ne.exports=M("../../modules/_core").Array.from},{"../../modules/_core":99,"../../modules/es6.array.from":168,"../../modules/es6.string.iterator":180}],78:[function(M,ne,N){var I=M("../../modules/_core"),h=I.JSON||(I.JSON={stringify:JSON.stringify});ne.exports=function(L){return h.stringify.apply(h,arguments)}},{"../../modules/_core":99}],79:[function(M,ne,N){M("../../modules/es6.object.assign"),ne.exports=M("../../modules/_core").Object.assign},{"../../modules/_core":99,"../../modules/es6.object.assign":171}],80:[function(M,ne,N){M("../../modules/es6.object.create");var I=M("../../modules/_core").Object;ne.exports=function(S,L){return I.create(S,L)}},{"../../modules/_core":99,"../../modules/es6.object.create":172}],81:[function(M,ne,N){M("../../modules/es6.object.define-property");var I=M("../../modules/_core").Object;ne.exports=function(S,L,T){return I.defineProperty(S,L,T)}},{"../../modules/_core":99,"../../modules/es6.object.define-property":173}],82:[function(M,ne,N){M("../../modules/es7.object.entries"),ne.exports=M("../../modules/_core").Object.entries},{"../../modules/_core":99,"../../modules/es7.object.entries":182}],83:[function(M,ne,N){M("../../modules/es6.object.get-own-property-names");var I=M("../../modules/_core").Object;ne.exports=function(S){return I.getOwnPropertyNames(S)}},{"../../modules/_core":99,"../../modules/es6.object.get-own-property-names":174}],84:[function(M,ne,N){M("../../modules/es6.object.get-prototype-of"),ne.exports=M("../../modules/_core").Object.getPrototypeOf},{"../../modules/_core":99,"../../modules/es6.object.get-prototype-of":175}],85:[function(M,ne,N){M("../../modules/es6.object.keys"),ne.exports=M("../../modules/_core").Object.keys},{"../../modules/_core":99,"../../modules/es6.object.keys":176}],86:[function(M,ne,N){M("../modules/es6.object.to-string"),M("../modules/es6.string.iterator"),M("../modules/web.dom.iterable"),M("../modules/es6.promise"),M("../modules/es7.promise.finally"),M("../modules/es7.promise.try"),ne.exports=M("../modules/_core").Promise},{"../modules/_core":99,"../modules/es6.object.to-string":177,"../modules/es6.promise":178,"../modules/es6.string.iterator":180,"../modules/es7.promise.finally":183,"../modules/es7.promise.try":184,"../modules/web.dom.iterable":187}],87:[function(M,ne,N){M("../modules/web.immediate"),ne.exports=M("../modules/_core").setImmediate},{"../modules/_core":99,"../modules/web.immediate":188}],88:[function(M,ne,N){M("../../modules/es6.string.from-code-point"),ne.exports=M("../../modules/_core").String.fromCodePoint},{"../../modules/_core":99,"../../modules/es6.string.from-code-point":179}],89:[function(M,ne,N){M("../../modules/es6.function.has-instance"),ne.exports=M("../../modules/_wks-ext").f("hasInstance")},{"../../modules/_wks-ext":165,"../../modules/es6.function.has-instance":170}],90:[function(M,ne,N){M("../../modules/es6.symbol"),M("../../modules/es6.object.to-string"),M("../../modules/es7.symbol.async-iterator"),M("../../modules/es7.symbol.observable"),ne.exports=M("../../modules/_core").Symbol},{"../../modules/_core":99,"../../modules/es6.object.to-string":177,"../../modules/es6.symbol":181,"../../modules/es7.symbol.async-iterator":185,"../../modules/es7.symbol.observable":186}],91:[function(M,ne,N){M("../../modules/es6.string.iterator"),M("../../modules/web.dom.iterable"),ne.exports=M("../../modules/_wks-ext").f("iterator")},{"../../modules/_wks-ext":165,"../../modules/es6.string.iterator":180,"../../modules/web.dom.iterable":187}],92:[function(M,ne,N){ne.exports=function(I){if(typeof I!="function")throw TypeError(I+" is not a function!");return I}},{}],93:[function(M,ne,N){ne.exports=function(){}},{}],94:[function(M,ne,N){ne.exports=function(I,h,S,L){if(!(I instanceof h)||L!==void 0&&L in I)throw TypeError(S+": incorrect invocation!");return I}},{}],95:[function(M,ne,N){var I=M("./_is-object");ne.exports=function(h){if(!I(h))throw TypeError(h+" is not an object!");return h}},{"./_is-object":119}],96:[function(M,ne,N){var I=M("./_to-iobject"),h=M("./_to-length"),S=M("./_to-absolute-index");ne.exports=function(L){return function(T,c,C){var g=I(T),s=h(g.length),a=S(C,s),r;if(L&&c!=c){for(;s>a;)if(r=g[a++],r!=r)return!0}else for(;s>a;a++)if((L||a in g)&&g[a]===c)return L||a||0;return!L&&-1}}},{"./_to-absolute-index":156,"./_to-iobject":158,"./_to-length":159}],97:[function(M,ne,N){var I=M("./_cof"),h=M("./_wks")("toStringTag"),S=I(function(){return arguments}())=="Arguments",L=function(T,c){try{return T[c]}catch(C){}};ne.exports=function(T){var c,C,g;return T===void 0?"Undefined":T===null?"Null":typeof(C=L(c=Object(T),h))=="string"?C:S?I(c):(g=I(c))=="Object"&&typeof c.callee=="function"?"Arguments":g}},{"./_cof":98,"./_wks":166}],98:[function(M,ne,N){var I={}.toString;ne.exports=function(h){return I.call(h).slice(8,-1)}},{}],99:[function(M,ne,N){var I=ne.exports={version:"2.6.11"};typeof __e=="number"&&(__e=I)},{}],100:[function(M,ne,N){"use strict";var I=M("./_object-dp"),h=M("./_property-desc");ne.exports=function(S,L,T){L in S?I.f(S,L,h(0,T)):S[L]=T}},{"./_object-dp":132,"./_property-desc":146}],101:[function(M,ne,N){var I=M("./_a-function");ne.exports=function(h,S,L){if(I(h),S===void 0)return h;switch(L){case 1:return function(T){return h.call(S,T)};case 2:return function(T,c){return h.call(S,T,c)};case 3:return function(T,c,C){return h.call(S,T,c,C)}}return function(){return h.apply(S,arguments)}}},{"./_a-function":92}],102:[function(M,ne,N){ne.exports=function(I){if(I==null)throw TypeError("Can't call method on "+I);return I}},{}],103:[function(M,ne,N){ne.exports=!M("./_fails")(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7})},{"./_fails":108}],104:[function(M,ne,N){var I=M("./_is-object"),h=M("./_global").document,S=I(h)&&I(h.createElement);ne.exports=function(L){return S?h.createElement(L):{}}},{"./_global":110,"./_is-object":119}],105:[function(M,ne,N){ne.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},{}],106:[function(M,ne,N){var I=M("./_object-keys"),h=M("./_object-gops"),S=M("./_object-pie");ne.exports=function(L){var T=I(L),c=h.f;if(c)for(var C=c(L),g=S.f,s=0,a;C.length>s;)g.call(L,a=C[s++])&&T.push(a);return T}},{"./_object-gops":137,"./_object-keys":140,"./_object-pie":141}],107:[function(M,ne,N){var I=M("./_global"),h=M("./_core"),S=M("./_ctx"),L=M("./_hide"),T=M("./_has"),c="prototype",C=function(g,s,a){var r=g&C.F,f=g&C.G,p=g&C.S,m=g&C.P,E=g&C.B,y=g&C.W,u=f?h:h[s]||(h[s]={}),n=u[c],o=f?I:p?I[s]:(I[s]||{})[c],l,w,v;f&&(a=s);for(l in a){if(w=!r&&o&&o[l]!==void 0,w&&T(u,l))continue;v=w?o[l]:a[l],u[l]=f&&typeof o[l]!="function"?a[l]:E&&w?S(v,I):y&&o[l]==v?function(i){var R=function(k,d,b){if(this instanceof i){switch(arguments.length){case 0:return new i;case 1:return new i(k);case 2:return new i(k,d)}return new i(k,d,b)}return i.apply(this,arguments)};return R[c]=i[c],R}(v):m&&typeof v=="function"?S(Function.call,v):v,m&&((u.virtual||(u.virtual={}))[l]=v,g&C.R&&n&&!n[l]&&L(n,l,v))}};C.F=1,C.G=2,C.S=4,C.P=8,C.B=16,C.W=32,C.U=64,C.R=128,ne.exports=C},{"./_core":99,"./_ctx":101,"./_global":110,"./_has":111,"./_hide":112}],108:[function(M,ne,N){ne.exports=function(I){try{return!!I()}catch(h){return!0}}},{}],109:[function(M,ne,N){var I=M("./_ctx"),h=M("./_iter-call"),S=M("./_is-array-iter"),L=M("./_an-object"),T=M("./_to-length"),c=M("./core.get-iterator-method"),C={},g={},N=ne.exports=function(s,a,r,f,p){var m=p?function(){return s}:c(s),E=I(r,f,a?2:1),y=0,u,n,o,l;if(typeof m!="function")throw TypeError(s+" is not iterable!");if(S(m)){for(u=T(s.length);u>y;y++)if(l=a?E(L(n=s[y])[0],n[1]):E(s[y]),l===C||l===g)return l}else for(o=m.call(s);!(n=o.next()).done;)if(l=h(o,E,n.value,a),l===C||l===g)return l};N.BREAK=C,N.RETURN=g},{"./_an-object":95,"./_ctx":101,"./_is-array-iter":117,"./_iter-call":120,"./_to-length":159,"./core.get-iterator-method":167}],110:[function(M,ne,N){var I=ne.exports=typeof window!="undefined"&&window.Math==Math?window:typeof self!="undefined"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=I)},{}],111:[function(M,ne,N){var I={}.hasOwnProperty;ne.exports=function(h,S){return I.call(h,S)}},{}],112:[function(M,ne,N){var I=M("./_object-dp"),h=M("./_property-desc");ne.exports=M("./_descriptors")?function(S,L,T){return I.f(S,L,h(1,T))}:function(S,L,T){return S[L]=T,S}},{"./_descriptors":103,"./_object-dp":132,"./_property-desc":146}],113:[function(M,ne,N){var I=M("./_global").document;ne.exports=I&&I.documentElement},{"./_global":110}],114:[function(M,ne,N){ne.exports=!M("./_descriptors")&&!M("./_fails")(function(){return Object.defineProperty(M("./_dom-create")("div"),"a",{get:function(){return 7}}).a!=7})},{"./_descriptors":103,"./_dom-create":104,"./_fails":108}],115:[function(M,ne,N){ne.exports=function(I,h,S){var L=S===void 0;switch(h.length){case 0:return L?I():I.call(S);case 1:return L?I(h[0]):I.call(S,h[0]);case 2:return L?I(h[0],h[1]):I.call(S,h[0],h[1]);case 3:return L?I(h[0],h[1],h[2]):I.call(S,h[0],h[1],h[2]);case 4:return L?I(h[0],h[1],h[2],h[3]):I.call(S,h[0],h[1],h[2],h[3])}return I.apply(S,h)}},{}],116:[function(M,ne,N){var I=M("./_cof");ne.exports=Object("z").propertyIsEnumerable(0)?Object:function(h){return I(h)=="String"?h.split(""):Object(h)}},{"./_cof":98}],117:[function(M,ne,N){var I=M("./_iterators"),h=M("./_wks")("iterator"),S=Array.prototype;ne.exports=function(L){return L!==void 0&&(I.Array===L||S[h]===L)}},{"./_iterators":125,"./_wks":166}],118:[function(M,ne,N){var I=M("./_cof");ne.exports=Array.isArray||function(S){return I(S)=="Array"}},{"./_cof":98}],119:[function(M,ne,N){ne.exports=function(I){return typeof I=="object"?I!==null:typeof I=="function"}},{}],120:[function(M,ne,N){var I=M("./_an-object");ne.exports=function(h,S,L,T){try{return T?S(I(L)[0],L[1]):S(L)}catch(C){var c=h.return;throw c!==void 0&&I(c.call(h)),C}}},{"./_an-object":95}],121:[function(M,ne,N){"use strict";var I=M("./_object-create"),h=M("./_property-desc"),S=M("./_set-to-string-tag"),L={};M("./_hide")(L,M("./_wks")("iterator"),function(){return this}),ne.exports=function(T,c,C){T.prototype=I(L,{next:h(1,C)}),S(T,c+" Iterator")}},{"./_hide":112,"./_object-create":131,"./_property-desc":146,"./_set-to-string-tag":150,"./_wks":166}],122:[function(M,ne,N){"use strict";var I=M("./_library"),h=M("./_export"),S=M("./_redefine"),L=M("./_hide"),T=M("./_iterators"),c=M("./_iter-create"),C=M("./_set-to-string-tag"),g=M("./_object-gpo"),s=M("./_wks")("iterator"),a=!([].keys&&"next"in[].keys()),r="@@iterator",f="keys",p="values",m=function(){return this};ne.exports=function(E,y,u,n,o,l,w){c(u,y,n);var v=function($){if(!a&&$ in d)return d[$];switch($){case f:return function(){return new u(this,$)};case p:return function(){return new u(this,$)}}return function(){return new u(this,$)}},i=y+" Iterator",R=o==p,k=!1,d=E.prototype,b=d[s]||d[r]||o&&d[o],x=b||v(o),_=o?R?v("entries"):x:void 0,B=y=="Array"&&d.entries||b,U,P,J;if(B&&(J=g(B.call(new E)),J!==Object.prototype&&J.next&&(C(J,i,!0),!I&&typeof J[s]!="function"&&L(J,s,m))),R&&b&&b.name!==p&&(k=!0,x=function(){return b.call(this)}),(!I||w)&&(a||k||!d[s])&&L(d,s,x),T[y]=x,T[i]=m,o)if(U={values:R?x:v(p),keys:l?x:v(f),entries:_},w)for(P in U)P in d||S(d,P,U[P]);else h(h.P+h.F*(a||k),y,U);return U}},{"./_export":107,"./_hide":112,"./_iter-create":121,"./_iterators":125,"./_library":126,"./_object-gpo":138,"./_redefine":148,"./_set-to-string-tag":150,"./_wks":166}],123:[function(M,ne,N){var I=M("./_wks")("iterator"),h=!1;try{var S=[7][I]();S.return=function(){h=!0},Array.from(S,function(){throw 2})}catch(L){}ne.exports=function(L,T){if(!T&&!h)return!1;var c=!1;try{var C=[7],g=C[I]();g.next=function(){return{done:c=!0}},C[I]=function(){return g},L(C)}catch(s){}return c}},{"./_wks":166}],124:[function(M,ne,N){ne.exports=function(I,h){return{value:h,done:!!I}}},{}],125:[function(M,ne,N){ne.exports={}},{}],126:[function(M,ne,N){ne.exports=!0},{}],127:[function(M,ne,N){var I=M("./_uid")("meta"),h=M("./_is-object"),S=M("./_has"),L=M("./_object-dp").f,T=0,c=Object.isExtensible||function(){return!0},C=!M("./_fails")(function(){return c(Object.preventExtensions({}))}),g=function(p){L(p,I,{value:{i:"O"+ ++T,w:{}}})},s=function(p,m){if(!h(p))return typeof p=="symbol"?p:(typeof p=="string"?"S":"P")+p;if(!S(p,I)){if(!c(p))return"F";if(!m)return"E";g(p)}return p[I].i},a=function(p,m){if(!S(p,I)){if(!c(p))return!0;if(!m)return!1;g(p)}return p[I].w},r=function(p){return C&&f.NEED&&c(p)&&!S(p,I)&&g(p),p},f=ne.exports={KEY:I,NEED:!1,fastKey:s,getWeak:a,onFreeze:r}},{"./_fails":108,"./_has":111,"./_is-object":119,"./_object-dp":132,"./_uid":162}],128:[function(M,ne,N){var I=M("./_global"),h=M("./_task").set,S=I.MutationObserver||I.WebKitMutationObserver,L=I.process,T=I.Promise,c=M("./_cof")(L)=="process";ne.exports=function(){var C,g,s,a=function(){var m,E;for(c&&(m=L.domain)&&m.exit();C;){E=C.fn,C=C.next;try{E()}catch(y){throw C?s():g=void 0,y}}g=void 0,m&&m.enter()};if(c)s=function(){L.nextTick(a)};else if(S&&!(I.navigator&&I.navigator.standalone)){var r=!0,f=document.createTextNode("");new S(a).observe(f,{characterData:!0}),s=function(){f.data=r=!r}}else if(T&&T.resolve){var p=T.resolve(void 0);s=function(){p.then(a)}}else s=function(){h.call(I,a)};return function(m){var E={fn:m,next:void 0};g&&(g.next=E),C||(C=E,s()),g=E}}},{"./_cof":98,"./_global":110,"./_task":155}],129:[function(M,ne,N){"use strict";var I=M("./_a-function");function h(S){var L,T;this.promise=new S(function(c,C){if(L!==void 0||T!==void 0)throw TypeError("Bad Promise constructor");L=c,T=C}),this.resolve=I(L),this.reject=I(T)}ne.exports.f=function(S){return new h(S)}},{"./_a-function":92}],130:[function(M,ne,N){"use strict";var I=M("./_descriptors"),h=M("./_object-keys"),S=M("./_object-gops"),L=M("./_object-pie"),T=M("./_to-object"),c=M("./_iobject"),C=Object.assign;ne.exports=!C||M("./_fails")(function(){var g={},s={},a=Symbol(),r="abcdefghijklmnopqrst";return g[a]=7,r.split("").forEach(function(f){s[f]=f}),C({},g)[a]!=7||Object.keys(C({},s)).join("")!=r})?function(s,a){for(var r=T(s),f=arguments.length,p=1,m=S.f,E=L.f;f>p;)for(var y=c(arguments[p++]),u=m?h(y).concat(m(y)):h(y),n=u.length,o=0,l;n>o;)l=u[o++],(!I||E.call(y,l))&&(r[l]=y[l]);return r}:C},{"./_descriptors":103,"./_fails":108,"./_iobject":116,"./_object-gops":137,"./_object-keys":140,"./_object-pie":141,"./_to-object":160}],131:[function(M,ne,N){var I=M("./_an-object"),h=M("./_object-dps"),S=M("./_enum-bug-keys"),L=M("./_shared-key")("IE_PROTO"),T=function(){},c="prototype",C=function(){var g=M("./_dom-create")("iframe"),s=S.length,a="<",r=">",f;for(g.style.display="none",M("./_html").appendChild(g),g.src="javascript:",f=g.contentWindow.document,f.open(),f.write(a+"script"+r+"document.F=Object"+a+"/script"+r),f.close(),C=f.F;s--;)delete C[c][S[s]];return C()};ne.exports=Object.create||function(s,a){var r;return s!==null?(T[c]=I(s),r=new T,T[c]=null,r[L]=s):r=C(),a===void 0?r:h(r,a)}},{"./_an-object":95,"./_dom-create":104,"./_enum-bug-keys":105,"./_html":113,"./_object-dps":133,"./_shared-key":151}],132:[function(M,ne,N){var I=M("./_an-object"),h=M("./_ie8-dom-define"),S=M("./_to-primitive"),L=Object.defineProperty;N.f=M("./_descriptors")?Object.defineProperty:function(c,C,g){if(I(c),C=S(C,!0),I(g),h)try{return L(c,C,g)}catch(s){}if("get"in g||"set"in g)throw TypeError("Accessors not supported!");return"value"in g&&(c[C]=g.value),c}},{"./_an-object":95,"./_descriptors":103,"./_ie8-dom-define":114,"./_to-primitive":161}],133:[function(M,ne,N){var I=M("./_object-dp"),h=M("./_an-object"),S=M("./_object-keys");ne.exports=M("./_descriptors")?Object.defineProperties:function(T,c){h(T);for(var C=S(c),g=C.length,s=0,a;g>s;)I.f(T,a=C[s++],c[a]);return T}},{"./_an-object":95,"./_descriptors":103,"./_object-dp":132,"./_object-keys":140}],134:[function(M,ne,N){var I=M("./_object-pie"),h=M("./_property-desc"),S=M("./_to-iobject"),L=M("./_to-primitive"),T=M("./_has"),c=M("./_ie8-dom-define"),C=Object.getOwnPropertyDescriptor;N.f=M("./_descriptors")?C:function(s,a){if(s=S(s),a=L(a,!0),c)try{return C(s,a)}catch(r){}if(T(s,a))return h(!I.f.call(s,a),s[a])}},{"./_descriptors":103,"./_has":111,"./_ie8-dom-define":114,"./_object-pie":141,"./_property-desc":146,"./_to-iobject":158,"./_to-primitive":161}],135:[function(M,ne,N){var I=M("./_to-iobject"),h=M("./_object-gopn").f,S={}.toString,L=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],T=function(c){try{return h(c)}catch(C){return L.slice()}};ne.exports.f=function(C){return L&&S.call(C)=="[object Window]"?T(C):h(I(C))}},{"./_object-gopn":136,"./_to-iobject":158}],136:[function(M,ne,N){var I=M("./_object-keys-internal"),h=M("./_enum-bug-keys").concat("length","prototype");N.f=Object.getOwnPropertyNames||function(L){return I(L,h)}},{"./_enum-bug-keys":105,"./_object-keys-internal":139}],137:[function(M,ne,N){N.f=Object.getOwnPropertySymbols},{}],138:[function(M,ne,N){var I=M("./_has"),h=M("./_to-object"),S=M("./_shared-key")("IE_PROTO"),L=Object.prototype;ne.exports=Object.getPrototypeOf||function(T){return T=h(T),I(T,S)?T[S]:typeof T.constructor=="function"&&T instanceof T.constructor?T.constructor.prototype:T instanceof Object?L:null}},{"./_has":111,"./_shared-key":151,"./_to-object":160}],139:[function(M,ne,N){var I=M("./_has"),h=M("./_to-iobject"),S=M("./_array-includes")(!1),L=M("./_shared-key")("IE_PROTO");ne.exports=function(T,c){var C=h(T),g=0,s=[],a;for(a in C)a!=L&&(I(C,a)&&s.push(a));for(;c.length>g;)I(C,a=c[g++])&&(~S(s,a)||s.push(a));return s}},{"./_array-includes":96,"./_has":111,"./_shared-key":151,"./_to-iobject":158}],140:[function(M,ne,N){var I=M("./_object-keys-internal"),h=M("./_enum-bug-keys");ne.exports=Object.keys||function(L){return I(L,h)}},{"./_enum-bug-keys":105,"./_object-keys-internal":139}],141:[function(M,ne,N){N.f={}.propertyIsEnumerable},{}],142:[function(M,ne,N){var I=M("./_export"),h=M("./_core"),S=M("./_fails");ne.exports=function(L,T){var c=(h.Object||{})[L]||Object[L],C={};C[L]=T(c),I(I.S+I.F*S(function(){c(1)}),"Object",C)}},{"./_core":99,"./_export":107,"./_fails":108}],143:[function(M,ne,N){var I=M("./_descriptors"),h=M("./_object-keys"),S=M("./_to-iobject"),L=M("./_object-pie").f;ne.exports=function(T){return function(c){for(var C=S(c),g=h(C),s=g.length,a=0,r=[],f;s>a;)f=g[a++],(!I||L.call(C,f))&&r.push(T?[f,C[f]]:C[f]);return r}}},{"./_descriptors":103,"./_object-keys":140,"./_object-pie":141,"./_to-iobject":158}],144:[function(M,ne,N){ne.exports=function(I){try{return{e:!1,v:I()}}catch(h){return{e:!0,v:h}}}},{}],145:[function(M,ne,N){var I=M("./_an-object"),h=M("./_is-object"),S=M("./_new-promise-capability");ne.exports=function(L,T){if(I(L),h(T)&&T.constructor===L)return T;var c=S.f(L),C=c.resolve;return C(T),c.promise}},{"./_an-object":95,"./_is-object":119,"./_new-promise-capability":129}],146:[function(M,ne,N){ne.exports=function(I,h){return{enumerable:!(I&1),configurable:!(I&2),writable:!(I&4),value:h}}},{}],147:[function(M,ne,N){var I=M("./_hide");ne.exports=function(h,S,L){for(var T in S)L&&h[T]?h[T]=S[T]:I(h,T,S[T]);return h}},{"./_hide":112}],148:[function(M,ne,N){ne.exports=M("./_hide")},{"./_hide":112}],149:[function(M,ne,N){"use strict";var I=M("./_global"),h=M("./_core"),S=M("./_object-dp"),L=M("./_descriptors"),T=M("./_wks")("species");ne.exports=function(c){var C=typeof h[c]=="function"?h[c]:I[c];L&&C&&!C[T]&&S.f(C,T,{configurable:!0,get:function(){return this}})}},{"./_core":99,"./_descriptors":103,"./_global":110,"./_object-dp":132,"./_wks":166}],150:[function(M,ne,N){var I=M("./_object-dp").f,h=M("./_has"),S=M("./_wks")("toStringTag");ne.exports=function(L,T,c){L&&!h(L=c?L:L.prototype,S)&&I(L,S,{configurable:!0,value:T})}},{"./_has":111,"./_object-dp":132,"./_wks":166}],151:[function(M,ne,N){var I=M("./_shared")("keys"),h=M("./_uid");ne.exports=function(S){return I[S]||(I[S]=h(S))}},{"./_shared":152,"./_uid":162}],152:[function(M,ne,N){var I=M("./_core"),h=M("./_global"),S="__core-js_shared__",L=h[S]||(h[S]={});(ne.exports=function(T,c){return L[T]||(L[T]=c!==void 0?c:{})})("versions",[]).push({version:I.version,mode:M("./_library")?"pure":"global",copyright:"\xA9 2019 Denis Pushkarev (zloirock.ru)"})},{"./_core":99,"./_global":110,"./_library":126}],153:[function(M,ne,N){var I=M("./_an-object"),h=M("./_a-function"),S=M("./_wks")("species");ne.exports=function(L,T){var c=I(L).constructor,C;return c===void 0||(C=I(c)[S])==null?T:h(C)}},{"./_a-function":92,"./_an-object":95,"./_wks":166}],154:[function(M,ne,N){var I=M("./_to-integer"),h=M("./_defined");ne.exports=function(S){return function(L,T){var c=String(h(L)),C=I(T),g=c.length,s,a;return C<0||C>=g?S?"":void 0:(s=c.charCodeAt(C),s<55296||s>56319||C+1===g||(a=c.charCodeAt(C+1))<56320||a>57343?S?c.charAt(C):s:S?c.slice(C,C+2):(s-55296<<10)+(a-56320)+65536)}}},{"./_defined":102,"./_to-integer":157}],155:[function(M,ne,N){var I=M("./_ctx"),h=M("./_invoke"),S=M("./_html"),L=M("./_dom-create"),T=M("./_global"),c=T.process,C=T.setImmediate,g=T.clearImmediate,s=T.MessageChannel,a=T.Dispatch,r=0,f={},p="onreadystatechange",m,E,y,u=function(){var o=+this;if(f.hasOwnProperty(o)){var l=f[o];delete f[o],l()}},n=function(o){u.call(o.data)};(!C||!g)&&(C=function(l){for(var w=[],v=1;arguments.length>v;)w.push(arguments[v++]);return f[++r]=function(){h(typeof l=="function"?l:Function(l),w)},m(r),r},g=function(l){delete f[l]},M("./_cof")(c)=="process"?m=function(o){c.nextTick(I(u,o,1))}:a&&a.now?m=function(o){a.now(I(u,o,1))}:s?(E=new s,y=E.port2,E.port1.onmessage=n,m=I(y.postMessage,y,1)):T.addEventListener&&typeof postMessage=="function"&&!T.importScripts?(m=function(o){T.postMessage(o+"","*")},T.addEventListener("message",n,!1)):p in L("script")?m=function(o){S.appendChild(L("script"))[p]=function(){S.removeChild(this),u.call(o)}}:m=function(o){setTimeout(I(u,o,1),0)}),ne.exports={set:C,clear:g}},{"./_cof":98,"./_ctx":101,"./_dom-create":104,"./_global":110,"./_html":113,"./_invoke":115}],156:[function(M,ne,N){var I=M("./_to-integer"),h=Math.max,S=Math.min;ne.exports=function(L,T){return L=I(L),L<0?h(L+T,0):S(L,T)}},{"./_to-integer":157}],157:[function(M,ne,N){var I=Math.ceil,h=Math.floor;ne.exports=function(S){return isNaN(S=+S)?0:(S>0?h:I)(S)}},{}],158:[function(M,ne,N){var I=M("./_iobject"),h=M("./_defined");ne.exports=function(S){return I(h(S))}},{"./_defined":102,"./_iobject":116}],159:[function(M,ne,N){var I=M("./_to-integer"),h=Math.min;ne.exports=function(S){return S>0?h(I(S),9007199254740991):0}},{"./_to-integer":157}],160:[function(M,ne,N){var I=M("./_defined");ne.exports=function(h){return Object(I(h))}},{"./_defined":102}],161:[function(M,ne,N){var I=M("./_is-object");ne.exports=function(h,S){if(!I(h))return h;var L,T;if(S&&typeof(L=h.toString)=="function"&&!I(T=L.call(h)))return T;if(typeof(L=h.valueOf)=="function"&&!I(T=L.call(h)))return T;if(!S&&typeof(L=h.toString)=="function"&&!I(T=L.call(h)))return T;throw TypeError("Can't convert object to primitive value")}},{"./_is-object":119}],162:[function(M,ne,N){var I=0,h=Math.random();ne.exports=function(S){return"Symbol(".concat(S===void 0?"":S,")_",(++I+h).toString(36))}},{}],163:[function(M,ne,N){var I=M("./_global"),h=I.navigator;ne.exports=h&&h.userAgent||""},{"./_global":110}],164:[function(M,ne,N){var I=M("./_global"),h=M("./_core"),S=M("./_library"),L=M("./_wks-ext"),T=M("./_object-dp").f;ne.exports=function(c){var C=h.Symbol||(h.Symbol=S?{}:I.Symbol||{});c.charAt(0)!="_"&&!(c in C)&&T(C,c,{value:L.f(c)})}},{"./_core":99,"./_global":110,"./_library":126,"./_object-dp":132,"./_wks-ext":165}],165:[function(M,ne,N){N.f=M("./_wks")},{"./_wks":166}],166:[function(M,ne,N){var I=M("./_shared")("wks"),h=M("./_uid"),S=M("./_global").Symbol,L=typeof S=="function",T=ne.exports=function(c){return I[c]||(I[c]=L&&S[c]||(L?S:h)("Symbol."+c))};T.store=I},{"./_global":110,"./_shared":152,"./_uid":162}],167:[function(M,ne,N){var I=M("./_classof"),h=M("./_wks")("iterator"),S=M("./_iterators");ne.exports=M("./_core").getIteratorMethod=function(L){if(L!=null)return L[h]||L["@@iterator"]||S[I(L)]}},{"./_classof":97,"./_core":99,"./_iterators":125,"./_wks":166}],168:[function(M,ne,N){"use strict";var I=M("./_ctx"),h=M("./_export"),S=M("./_to-object"),L=M("./_iter-call"),T=M("./_is-array-iter"),c=M("./_to-length"),C=M("./_create-property"),g=M("./core.get-iterator-method");h(h.S+h.F*!M("./_iter-detect")(function(s){Array.from(s)}),"Array",{from:function(a){var r=S(a),f=typeof this=="function"?this:Array,p=arguments.length,m=p>1?arguments[1]:void 0,E=m!==void 0,y=0,u=g(r),n,o,l,w;if(E&&(m=I(m,p>2?arguments[2]:void 0,2)),u!=null&&!(f==Array&&T(u)))for(w=u.call(r),o=new f;!(l=w.next()).done;y++)C(o,y,E?L(w,m,[l.value,y],!0):l.value);else for(n=c(r.length),o=new f(n);n>y;y++)C(o,y,E?m(r[y],y):r[y]);return o.length=y,o}})},{"./_create-property":100,"./_ctx":101,"./_export":107,"./_is-array-iter":117,"./_iter-call":120,"./_iter-detect":123,"./_to-length":159,"./_to-object":160,"./core.get-iterator-method":167}],169:[function(M,ne,N){"use strict";var I=M("./_add-to-unscopables"),h=M("./_iter-step"),S=M("./_iterators"),L=M("./_to-iobject");ne.exports=M("./_iter-define")(Array,"Array",function(T,c){this._t=L(T),this._i=0,this._k=c},function(){var T=this._t,c=this._k,C=this._i++;return!T||C>=T.length?(this._t=void 0,h(1)):c=="keys"?h(0,C):c=="values"?h(0,T[C]):h(0,[C,T[C]])},"values"),S.Arguments=S.Array,I("keys"),I("values"),I("entries")},{"./_add-to-unscopables":93,"./_iter-define":122,"./_iter-step":124,"./_iterators":125,"./_to-iobject":158}],170:[function(M,ne,N){"use strict";var I=M("./_is-object"),h=M("./_object-gpo"),S=M("./_wks")("hasInstance"),L=Function.prototype;S in L||M("./_object-dp").f(L,S,{value:function(T){if(typeof this!="function"||!I(T))return!1;if(!I(this.prototype))return T instanceof this;for(;T=h(T);)if(this.prototype===T)return!0;return!1}})},{"./_is-object":119,"./_object-dp":132,"./_object-gpo":138,"./_wks":166}],171:[function(M,ne,N){var I=M("./_export");I(I.S+I.F,"Object",{assign:M("./_object-assign")})},{"./_export":107,"./_object-assign":130}],172:[function(M,ne,N){var I=M("./_export");I(I.S,"Object",{create:M("./_object-create")})},{"./_export":107,"./_object-create":131}],173:[function(M,ne,N){var I=M("./_export");I(I.S+I.F*!M("./_descriptors"),"Object",{defineProperty:M("./_object-dp").f})},{"./_descriptors":103,"./_export":107,"./_object-dp":132}],174:[function(M,ne,N){M("./_object-sap")("getOwnPropertyNames",function(){return M("./_object-gopn-ext").f})},{"./_object-gopn-ext":135,"./_object-sap":142}],175:[function(M,ne,N){var I=M("./_to-object"),h=M("./_object-gpo");M("./_object-sap")("getPrototypeOf",function(){return function(L){return h(I(L))}})},{"./_object-gpo":138,"./_object-sap":142,"./_to-object":160}],176:[function(M,ne,N){var I=M("./_to-object"),h=M("./_object-keys");M("./_object-sap")("keys",function(){return function(L){return h(I(L))}})},{"./_object-keys":140,"./_object-sap":142,"./_to-object":160}],177:[function(M,ne,N){arguments[4][71][0].apply(N,arguments)},{dup:71}],178:[function(M,ne,N){"use strict";var I=M("./_library"),h=M("./_global"),S=M("./_ctx"),L=M("./_classof"),T=M("./_export"),c=M("./_is-object"),C=M("./_a-function"),g=M("./_an-instance"),s=M("./_for-of"),a=M("./_species-constructor"),r=M("./_task").set,f=M("./_microtask")(),p=M("./_new-promise-capability"),m=M("./_perform"),E=M("./_user-agent"),y=M("./_promise-resolve"),u="Promise",n=h.TypeError,o=h.process,l=o&&o.versions,w=l&&l.v8||"",v=h[u],i=L(o)=="process",R=function(){},k,d,b,x,_=d=p.f,B=!!function(){try{var H=v.resolve(1),G=(H.constructor={})[M("./_wks")("species")]=function(ie){ie(R,R)};return(i||typeof PromiseRejectionEvent=="function")&&H.then(R)instanceof G&&w.indexOf("6.6")!==0&&E.indexOf("Chrome/66")===-1}catch(ie){}}(),U=function(H){var G;return c(H)&&typeof(G=H.then)=="function"?G:!1},P=function(H,G){if(H._n)return;H._n=!0;var ie=H._c;f(function(){for(var le=H._v,ue=H._s==1,be=0,Ce=function(se){var ce=ue?se.ok:se.fail,he=se.resolve,ae=se.reject,Q=se.domain,D,F,W;try{ce?(ue||(H._h==2&&z(H),H._h=1),ce===!0?D=le:(Q&&Q.enter(),D=ce(le),Q&&(Q.exit(),W=!0)),D===se.promise?ae(n("Promise-chain cycle")):(F=U(D))?F.call(D,he,ae):he(D)):ae(le)}catch(Y){Q&&!W&&Q.exit(),ae(Y)}};ie.length>be;)Ce(ie[be++]);H._c=[],H._n=!1,G&&!H._h&&J(H)})},J=function(H){r.call(h,function(){var G=H._v,ie=$(H),le,ue,be;if(ie&&(le=m(function(){i?o.emit("unhandledRejection",G,H):(ue=h.onunhandledrejection)?ue({promise:H,reason:G}):(be=h.console)&&be.error&&be.error("Unhandled promise rejection",G)}),H._h=i||$(H)?2:1),H._a=void 0,ie&&le.e)throw le.v})},$=function(H){return H._h!==1&&(H._a||H._c).length===0},z=function(H){r.call(h,function(){var G;i?o.emit("rejectionHandled",H):(G=h.onrejectionhandled)&&G({promise:H,reason:H._v})})},V=function(H){var G=this;if(G._d)return;G._d=!0,G=G._w||G,G._v=H,G._s=2,G._a||(G._a=G._c.slice()),P(G,!0)},K=function(H){var G=this,ie;if(G._d)return;G._d=!0,G=G._w||G;try{if(G===H)throw n("Promise can't be resolved itself");(ie=U(H))?f(function(){var le={_w:G,_d:!1};try{ie.call(H,S(K,le,1),S(V,le,1))}catch(ue){V.call(le,ue)}}):(G._v=H,G._s=1,P(G,!1))}catch(le){V.call({_w:G,_d:!1},le)}};B||(v=function(G){g(this,v,u,"_h"),C(G),k.call(this);try{G(S(K,this,1),S(V,this,1))}catch(ie){V.call(this,ie)}},k=function(G){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},k.prototype=M("./_redefine-all")(v.prototype,{then:function(G,ie){var le=_(a(this,v));return le.ok=typeof G=="function"?G:!0,le.fail=typeof ie=="function"&&ie,le.domain=i?o.domain:void 0,this._c.push(le),this._a&&this._a.push(le),this._s&&P(this,!1),le.promise},catch:function(H){return this.then(void 0,H)}}),b=function(){var H=new k;this.promise=H,this.resolve=S(K,H,1),this.reject=S(V,H,1)},p.f=_=function(H){return H===v||H===x?new b(H):d(H)}),T(T.G+T.W+T.F*!B,{Promise:v}),M("./_set-to-string-tag")(v,u),M("./_set-species")(u),x=M("./_core")[u],T(T.S+T.F*!B,u,{reject:function(G){var ie=_(this),le=ie.reject;return le(G),ie.promise}}),T(T.S+T.F*(I||!B),u,{resolve:function(G){return y(I&&this===x?v:this,G)}}),T(T.S+T.F*!(B&&M("./_iter-detect")(function(H){v.all(H).catch(R)})),u,{all:function(G){var ie=this,le=_(ie),ue=le.resolve,be=le.reject,Ce=m(function(){var se=[],ce=0,he=1;s(G,!1,function(ae){var Q=ce++,D=!1;se.push(void 0),he++,ie.resolve(ae).then(function(F){if(D)return;D=!0,se[Q]=F,--he||ue(se)},be)}),--he||ue(se)});return Ce.e&&be(Ce.v),le.promise},race:function(G){var ie=this,le=_(ie),ue=le.reject,be=m(function(){s(G,!1,function(Ce){ie.resolve(Ce).then(le.resolve,ue)})});return be.e&&ue(be.v),le.promise}})},{"./_a-function":92,"./_an-instance":94,"./_classof":97,"./_core":99,"./_ctx":101,"./_export":107,"./_for-of":109,"./_global":110,"./_is-object":119,"./_iter-detect":123,"./_library":126,"./_microtask":128,"./_new-promise-capability":129,"./_perform":144,"./_promise-resolve":145,"./_redefine-all":147,"./_set-species":149,"./_set-to-string-tag":150,"./_species-constructor":153,"./_task":155,"./_user-agent":163,"./_wks":166}],179:[function(M,ne,N){var I=M("./_export"),h=M("./_to-absolute-index"),S=String.fromCharCode,L=String.fromCodePoint;I(I.S+I.F*(!!L&&L.length!=1),"String",{fromCodePoint:function(c){for(var C=[],g=arguments.length,s=0,a;g>s;){if(a=+arguments[s++],h(a,1114111)!==a)throw RangeError(a+" is not a valid code point");C.push(a<65536?S(a):S(((a-=65536)>>10)+55296,a%1024+56320))}return C.join("")}})},{"./_export":107,"./_to-absolute-index":156}],180:[function(M,ne,N){"use strict";var I=M("./_string-at")(!0);M("./_iter-define")(String,"String",function(h){this._t=String(h),this._i=0},function(){var h=this._t,S=this._i,L;return S>=h.length?{value:void 0,done:!0}:(L=I(h,S),this._i+=L.length,{value:L,done:!1})})},{"./_iter-define":122,"./_string-at":154}],181:[function(M,ne,N){"use strict";var I=M("./_global"),h=M("./_has"),S=M("./_descriptors"),L=M("./_export"),T=M("./_redefine"),c=M("./_meta").KEY,C=M("./_fails"),g=M("./_shared"),s=M("./_set-to-string-tag"),a=M("./_uid"),r=M("./_wks"),f=M("./_wks-ext"),p=M("./_wks-define"),m=M("./_enum-keys"),E=M("./_is-array"),y=M("./_an-object"),u=M("./_is-object"),n=M("./_to-object"),o=M("./_to-iobject"),l=M("./_to-primitive"),w=M("./_property-desc"),v=M("./_object-create"),i=M("./_object-gopn-ext"),R=M("./_object-gopd"),k=M("./_object-gops"),d=M("./_object-dp"),b=M("./_object-keys"),x=R.f,_=d.f,B=i.f,U=I.Symbol,P=I.JSON,J=P&&P.stringify,$="prototype",z=r("_hidden"),V=r("toPrimitive"),K={}.propertyIsEnumerable,H=g("symbol-registry"),G=g("symbols"),ie=g("op-symbols"),le=Object[$],ue=typeof U=="function"&&!!k.f,be=I.QObject,Ce=!be||!be[$]||!be[$].findChild,se=S&&C(function(){return v(_({},"a",{get:function(){return _(this,"a",{value:7}).a}})).a!=7})?function(ve,Te,Re){var Ie=x(le,Te);Ie&&delete le[Te],_(ve,Te,Re),Ie&&ve!==le&&_(le,Te,Ie)}:_,ce=function(ve){var Te=G[ve]=v(U[$]);return Te._k=ve,Te},he=ue&&typeof U.iterator=="symbol"?function(ve){return typeof ve=="symbol"}:function(ve){return ve instanceof U},ae=function(Te,Re,Ie){return Te===le&&ae(ie,Re,Ie),y(Te),Re=l(Re,!0),y(Ie),h(G,Re)?(Ie.enumerable?(h(Te,z)&&Te[z][Re]&&(Te[z][Re]=!1),Ie=v(Ie,{enumerable:w(0,!1)})):(h(Te,z)||_(Te,z,w(1,{})),Te[z][Re]=!0),se(Te,Re,Ie)):_(Te,Re,Ie)},Q=function(Te,Re){y(Te);for(var Ie=m(Re=o(Re)),je=0,Ne=Ie.length,We;Ne>je;)ae(Te,We=Ie[je++],Re[We]);return Te},D=function(Te,Re){return Re===void 0?v(Te):Q(v(Te),Re)},F=function(Te){var Re=K.call(this,Te=l(Te,!0));return this===le&&h(G,Te)&&!h(ie,Te)?!1:Re||!h(this,Te)||!h(G,Te)||h(this,z)&&this[z][Te]?Re:!0},W=function(Te,Re){if(Te=o(Te),Re=l(Re,!0),Te===le&&h(G,Re)&&!h(ie,Re))return;var Ie=x(Te,Re);return Ie&&h(G,Re)&&!(h(Te,z)&&Te[z][Re])&&(Ie.enumerable=!0),Ie},Y=function(Te){for(var Re=B(o(Te)),Ie=[],je=0,Ne;Re.length>je;)!h(G,Ne=Re[je++])&&Ne!=z&&Ne!=c&&Ie.push(Ne);return Ie},Z=function(Te){for(var Re=Te===le,Ie=B(Re?ie:o(Te)),je=[],Ne=0,We;Ie.length>Ne;)h(G,We=Ie[Ne++])&&(Re?h(le,We):!0)&&je.push(G[We]);return je};ue||(U=function(){if(this instanceof U)throw TypeError("Symbol is not a constructor!");var Te=a(arguments.length>0?arguments[0]:void 0),Re=function(Ie){this===le&&Re.call(ie,Ie),h(this,z)&&h(this[z],Te)&&(this[z][Te]=!1),se(this,Te,w(1,Ie))};return S&&Ce&&se(le,Te,{configurable:!0,set:Re}),ce(Te)},T(U[$],"toString",function(){return this._k}),R.f=W,d.f=ae,M("./_object-gopn").f=i.f=Y,M("./_object-pie").f=F,k.f=Z,S&&!M("./_library")&&T(le,"propertyIsEnumerable",F,!0),f.f=function(ve){return ce(r(ve))}),L(L.G+L.W+L.F*!ue,{Symbol:U});for(var te="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),q=0;te.length>q;)r(te[q++]);for(var X=b(r.store),re=0;X.length>re;)p(X[re++]);L(L.S+L.F*!ue,"Symbol",{for:function(ve){return h(H,ve+="")?H[ve]:H[ve]=U(ve)},keyFor:function(Te){if(!he(Te))throw TypeError(Te+" is not a symbol!");for(var Re in H)if(H[Re]===Te)return Re},useSetter:function(){Ce=!0},useSimple:function(){Ce=!1}}),L(L.S+L.F*!ue,"Object",{create:D,defineProperty:ae,defineProperties:Q,getOwnPropertyDescriptor:W,getOwnPropertyNames:Y,getOwnPropertySymbols:Z});var me=C(function(){k.f(1)});L(L.S+L.F*me,"Object",{getOwnPropertySymbols:function(Te){return k.f(n(Te))}}),P&&L(L.S+L.F*(!ue||C(function(){var ve=U();return J([ve])!="[null]"||J({a:ve})!="{}"||J(Object(ve))!="{}"})),"JSON",{stringify:function(Te){for(var Re=[Te],Ie=1,je,Ne;arguments.length>Ie;)Re.push(arguments[Ie++]);return Ne=je=Re[1],!u(je)&&Te===void 0||he(Te)?void 0:(E(je)||(je=function(We,Be){if(typeof Ne=="function"&&(Be=Ne.call(this,We,Be)),!he(Be))return Be}),Re[1]=je,J.apply(P,Re))}}),U[$][V]||M("./_hide")(U[$],V,U[$].valueOf),s(U,"Symbol"),s(Math,"Math",!0),s(I.JSON,"JSON",!0)},{"./_an-object":95,"./_descriptors":103,"./_enum-keys":106,"./_export":107,"./_fails":108,"./_global":110,"./_has":111,"./_hide":112,"./_is-array":118,"./_is-object":119,"./_library":126,"./_meta":127,"./_object-create":131,"./_object-dp":132,"./_object-gopd":134,"./_object-gopn":136,"./_object-gopn-ext":135,"./_object-gops":137,"./_object-keys":140,"./_object-pie":141,"./_property-desc":146,"./_redefine":148,"./_set-to-string-tag":150,"./_shared":152,"./_to-iobject":158,"./_to-object":160,"./_to-primitive":161,"./_uid":162,"./_wks":166,"./_wks-define":164,"./_wks-ext":165}],182:[function(M,ne,N){var I=M("./_export"),h=M("./_object-to-array")(!0);I(I.S,"Object",{entries:function(L){return h(L)}})},{"./_export":107,"./_object-to-array":143}],183:[function(M,ne,N){"use strict";var I=M("./_export"),h=M("./_core"),S=M("./_global"),L=M("./_species-constructor"),T=M("./_promise-resolve");I(I.P+I.R,"Promise",{finally:function(c){var C=L(this,h.Promise||S.Promise),g=typeof c=="function";return this.then(g?function(s){return T(C,c()).then(function(){return s})}:c,g?function(s){return T(C,c()).then(function(){throw s})}:c)}})},{"./_core":99,"./_export":107,"./_global":110,"./_promise-resolve":145,"./_species-constructor":153}],184:[function(M,ne,N){"use strict";var I=M("./_export"),h=M("./_new-promise-capability"),S=M("./_perform");I(I.S,"Promise",{try:function(L){var T=h.f(this),c=S(L);return(c.e?T.reject:T.resolve)(c.v),T.promise}})},{"./_export":107,"./_new-promise-capability":129,"./_perform":144}],185:[function(M,ne,N){M("./_wks-define")("asyncIterator")},{"./_wks-define":164}],186:[function(M,ne,N){M("./_wks-define")("observable")},{"./_wks-define":164}],187:[function(M,ne,N){M("./es6.array.iterator");for(var I=M("./_global"),h=M("./_hide"),S=M("./_iterators"),L=M("./_wks")("toStringTag"),T="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(","),c=0;c<T.length;c++){var C=T[c],g=I[C],s=g&&g.prototype;s&&!s[L]&&h(s,L,C),S[C]=S.Array}},{"./_global":110,"./_hide":112,"./_iterators":125,"./_wks":166,"./es6.array.iterator":169}],188:[function(M,ne,N){var I=M("./_export"),h=M("./_task");I(I.G+I.B,{setImmediate:h.set,clearImmediate:h.clear})},{"./_export":107,"./_task":155}],189:[function(M,ne,N){(function(I){"use strict";var h=M("babel-runtime/helpers/typeof"),S=L(h);function L(l){return l&&l.__esModule?l:{default:l}}function T(l){return Array.isArray?Array.isArray(l):o(l)==="[object Array]"}N.isArray=T;function c(l){return typeof l=="boolean"}N.isBoolean=c;function C(l){return l===null}N.isNull=C;function g(l){return l==null}N.isNullOrUndefined=g;function s(l){return typeof l=="number"}N.isNumber=s;function a(l){return typeof l=="string"}N.isString=a;function r(l){return(typeof l=="undefined"?"undefined":(0,S.default)(l))==="symbol"}N.isSymbol=r;function f(l){return l===void 0}N.isUndefined=f;function p(l){return o(l)==="[object RegExp]"}N.isRegExp=p;function m(l){return(typeof l=="undefined"?"undefined":(0,S.default)(l))==="object"&&l!==null}N.isObject=m;function E(l){return o(l)==="[object Date]"}N.isDate=E;function y(l){return o(l)==="[object Error]"||l instanceof Error}N.isError=y;function u(l){return typeof l=="function"}N.isFunction=u;function n(l){return l===null||typeof l=="boolean"||typeof l=="number"||typeof l=="string"||(typeof l=="undefined"?"undefined":(0,S.default)(l))==="symbol"||typeof l=="undefined"}N.isPrimitive=n,N.isBuffer=I.isBuffer;function o(l){return Object.prototype.toString.call(l)}}).call(this,{isBuffer:M("../../is-buffer/index.js")})},{"../../is-buffer/index.js":197,"babel-runtime/helpers/typeof":67}],190:[function(M,ne,N){"use strict";var I=M("babel-runtime/helpers/typeof"),h=S(I);function S(L){return L&&L.__esModule?L:{default:L}}(function(L){"use strict";var T=function(){var a=/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZWN]|'[^']*'|'[^']*'/g,r=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,f=/[^-+\dA-Z]/g;return function(p,m,E,y){if(arguments.length===1&&s(p)==="string"&&!/\d/.test(p)&&(m=p,p=void 0),p=p||new Date,p instanceof Date||(p=new Date(p)),isNaN(p))throw TypeError("Invalid date");m=String(T.masks[m]||m||T.masks.default);var u=m.slice(0,4);(u==="UTC:"||u==="GMT:")&&(m=m.slice(4),E=!0,u==="GMT:"&&(y=!0));var n=E?"getUTC":"get",o=p[n+"Date"](),l=p[n+"Day"](),w=p[n+"Month"](),v=p[n+"FullYear"](),i=p[n+"Hours"](),R=p[n+"Minutes"](),k=p[n+"Seconds"](),d=p[n+"Milliseconds"](),b=E?0:p.getTimezoneOffset(),x=C(p),_=g(p),B={d:o,dd:c(o),ddd:T.i18n.dayNames[l],dddd:T.i18n.dayNames[l+7],m:w+1,mm:c(w+1),mmm:T.i18n.monthNames[w],mmmm:T.i18n.monthNames[w+12],yy:String(v).slice(2),yyyy:v,h:i%12||12,hh:c(i%12||12),H:i,HH:c(i),M:R,MM:c(R),s:k,ss:c(k),l:c(d,3),L:c(Math.round(d/10)),t:i<12?"a":"p",tt:i<12?"am":"pm",T:i<12?"A":"P",TT:i<12?"AM":"PM",Z:y?"GMT":E?"UTC":(String(p).match(r)||[""]).pop().replace(f,""),o:(b>0?"-":"+")+c(Math.floor(Math.abs(b)/60)*100+Math.abs(b)%60,4),S:["th","st","nd","rd"][o%10>3?0:(o%100-o%10!=10)*o%10],W:x,N:_};return m.replace(a,function(U){return U in B?B[U]:U.slice(1,U.length-1)})}}();T.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"},T.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"]};function c(a,r){for(a=String(a),r=r||2;a.length<r;)a="0"+a;return a}function C(a){var r=new Date(a.getFullYear(),a.getMonth(),a.getDate());r.setDate(r.getDate()-(r.getDay()+6)%7+3);var f=new Date(r.getFullYear(),0,4);f.setDate(f.getDate()-(f.getDay()+6)%7+3);var p=r.getTimezoneOffset()-f.getTimezoneOffset();r.setHours(r.getHours()-p);var m=(r-f)/(864e5*7);return 1+Math.floor(m)}function g(a){var r=a.getDay();return r===0&&(r=7),r}function s(a){return a===null?"null":a===void 0?"undefined":(typeof a=="undefined"?"undefined":(0,h.default)(a))!=="object"?typeof a=="undefined"?"undefined":(0,h.default)(a):Array.isArray(a)?"array":{}.toString.call(a).slice(8,-1).toLowerCase()}typeof define=="function"&&define.amd?define(function(){return T}):(typeof N=="undefined"?"undefined":(0,h.default)(N))==="object"?ne.exports=T:L.dateFormat=T})(void 0)},{"babel-runtime/helpers/typeof":67}],191:[function(M,ne,N){/*!
* escape-html
* Copyright(c) 2012-2013 TJ Holowaychuk
* Copyright(c) 2015 Andreas Lubbe
* Copyright(c) 2015 Tiancheng "Timothy" Gu
* MIT Licensed
*/"use strict";var I=/["'&<>]/;ne.exports=h;function h(S){var L=""+S,T=I.exec(L);if(!T)return L;var c,C="",g=0,s=0;for(g=T.index;g<L.length;g++){switch(L.charCodeAt(g)){case 34:c="&quot;";break;case 38:c="&amp;";break;case 39:c="&#39;";break;case 60:c="&lt;";break;case 62:c="&gt;";break;default:continue}s!==g&&(C+=L.substring(s,g)),s=g+1,C+=c}return s!==g?C+L.substring(s,g):C}},{}],192:[function(M,ne,N){function I(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}ne.exports=I,I.EventEmitter=I,I.prototype._events=void 0,I.prototype._maxListeners=void 0,I.defaultMaxListeners=10,I.prototype.setMaxListeners=function(c){if(!S(c)||c<0||isNaN(c))throw TypeError("n must be a positive number");return this._maxListeners=c,this},I.prototype.emit=function(c){var C,g,s,a,r,f;if(this._events||(this._events={}),c==="error"&&(!this._events.error||L(this._events.error)&&!this._events.error.length)){if(C=arguments[1],C instanceof Error)throw C;var p=new Error('Uncaught, unspecified "error" event. ('+C+")");throw p.context=C,p}if(g=this._events[c],T(g))return!1;if(h(g))switch(arguments.length){case 1:g.call(this);break;case 2:g.call(this,arguments[1]);break;case 3:g.call(this,arguments[1],arguments[2]);break;default:a=Array.prototype.slice.call(arguments,1),g.apply(this,a)}else if(L(g))for(a=Array.prototype.slice.call(arguments,1),f=g.slice(),s=f.length,r=0;r<s;r++)f[r].apply(this,a);return!0},I.prototype.addListener=function(c,C){var g;if(!h(C))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",c,h(C.listener)?C.listener:C),this._events[c]?L(this._events[c])?this._events[c].push(C):this._events[c]=[this._events[c],C]:this._events[c]=C,L(this._events[c])&&!this._events[c].warned&&(T(this._maxListeners)?g=I.defaultMaxListeners:g=this._maxListeners,g&&g>0&&this._events[c].length>g&&(this._events[c].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[c].length),typeof console.trace=="function"&&console.trace())),this},I.prototype.on=I.prototype.addListener,I.prototype.once=function(c,C){if(!h(C))throw TypeError("listener must be a function");var g=!1;function s(){this.removeListener(c,s),g||(g=!0,C.apply(this,arguments))}return s.listener=C,this.on(c,s),this},I.prototype.removeListener=function(c,C){var g,s,a,r;if(!h(C))throw TypeError("listener must be a function");if(!this._events||!this._events[c])return this;if(g=this._events[c],a=g.length,s=-1,g===C||h(g.listener)&&g.listener===C)delete this._events[c],this._events.removeListener&&this.emit("removeListener",c,C);else if(L(g)){for(r=a;r-- >0;)if(g[r]===C||g[r].listener&&g[r].listener===C){s=r;break}if(s<0)return this;g.length===1?(g.length=0,delete this._events[c]):g.splice(s,1),this._events.removeListener&&this.emit("removeListener",c,C)}return this},I.prototype.removeAllListeners=function(c){var C,g;if(!this._events)return this;if(!this._events.removeListener)return arguments.length===0?this._events={}:this._events[c]&&delete this._events[c],this;if(arguments.length===0){for(C in this._events){if(C==="removeListener")continue;this.removeAllListeners(C)}return this.removeAllListeners("removeListener"),this._events={},this}if(g=this._events[c],h(g))this.removeListener(c,g);else if(g)for(;g.length;)this.removeListener(c,g[g.length-1]);return delete this._events[c],this},I.prototype.listeners=function(c){var C;return!this._events||!this._events[c]?C=[]:h(this._events[c])?C=[this._events[c]]:C=this._events[c].slice(),C},I.prototype.listenerCount=function(c){if(this._events){var C=this._events[c];if(h(C))return 1;if(C)return C.length}return 0},I.listenerCount=function(c,C){return c.listenerCount(C)};function h(c){return typeof c=="function"}function S(c){return typeof c=="number"}function L(c){return typeof c=="object"&&c!==null}function T(c){return c===void 0}},{}],193:[function(M,ne,N){var I=M("http"),h=ne.exports;for(var S in I)I.hasOwnProperty(S)&&(h[S]=I[S]);h.request=function(L,T){return L||(L={}),L.scheme="https",L.protocol="https:",I.request.call(this,L,T)}},{http:231}],194:[function(M,ne,N){/*!
* humanize-ms - index.js
* Copyright(c) 2014 dead_horse <dead_horse@qq.com>
* MIT Licensed
*/"use strict";var I=M("util"),h=M("ms");ne.exports=function(S){if(typeof S=="number")return S;var L=h(S);if(L===void 0){var T=new Error(I.format("humanize-ms(%j) result undefined",S));console.warn(T.stack)}return L}},{ms:204,util:243}],195:[function(M,ne,N){N.read=function(I,h,S,L,T){var c,C,g=T*8-L-1,s=(1<<g)-1,a=s>>1,r=-7,f=S?T-1:0,p=S?-1:1,m=I[h+f];for(f+=p,c=m&(1<<-r)-1,m>>=-r,r+=g;r>0;c=c*256+I[h+f],f+=p,r-=8);for(C=c&(1<<-r)-1,c>>=-r,r+=L;r>0;C=C*256+I[h+f],f+=p,r-=8);if(c===0)c=1-a;else{if(c===s)return C?NaN:(m?-1:1)*Infinity;C=C+Math.pow(2,L),c=c-a}return(m?-1:1)*C*Math.pow(2,c-L)},N.write=function(I,h,S,L,T,c){var C,g,s,a=c*8-T-1,r=(1<<a)-1,f=r>>1,p=T===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=L?0:c-1,E=L?1:-1,y=h<0||h===0&&1/h<0?1:0;for(h=Math.abs(h),isNaN(h)||h===Infinity?(g=isNaN(h)?1:0,C=r):(C=Math.floor(Math.log(h)/Math.LN2),h*(s=Math.pow(2,-C))<1&&(C--,s*=2),C+f>=1?h+=p/s:h+=p*Math.pow(2,1-f),h*s>=2&&(C++,s/=2),C+f>=r?(g=0,C=r):C+f>=1?(g=(h*s-1)*Math.pow(2,T),C=C+f):(g=h*Math.pow(2,f-1)*Math.pow(2,T),C=0));T>=8;I[S+m]=g&255,m+=E,g/=256,T-=8);for(C=C<<T|g,a+=T;a>0;I[S+m]=C&255,m+=E,C/=256,a-=8);I[S+m-E]|=y*128}},{}],196:[function(M,ne,N){typeof Object.create=="function"?ne.exports=function(h,S){S&&(h.super_=S,h.prototype=Object.create(S.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}))}:ne.exports=function(h,S){if(S){h.super_=S;var L=function(){};L.prototype=S.prototype,h.prototype=new L,h.prototype.constructor=h}}},{}],197:[function(M,ne,N){/*!
* Determine if an object is a Buffer
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/ne.exports=function(S){return S!=null&&(I(S)||h(S)||!!S._isBuffer)};function I(S){return!!S.constructor&&typeof S.constructor.isBuffer=="function"&&S.constructor.isBuffer(S)}function h(S){return typeof S.readFloatLE=="function"&&typeof S.slice=="function"&&I(S.slice(0,0))}},{}],198:[function(M,ne,N){var I={}.toString;ne.exports=Array.isArray||function(h){return I.call(h)=="[object Array]"}},{}],199:[function(require,module,exports){(function(global){(function(M,ne){typeof exports=="object"&&typeof module!="undefined"?module.exports=ne(M):typeof define=="function"&&define.amd?define(ne):ne(M)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof global!="undefined"?global:this,function(global){"use strict";global=global||{};var _Base64=global.Base64,version="2.5.2",buffer;if(typeof module!="undefined"&&module.exports)try{buffer=eval("require('buffer').Buffer")}catch(M){buffer=void 0}var b64chars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",b64tab=function(M){for(var ne={},N=0,I=M.length;N<I;N++)ne[M.charAt(N)]=N;return ne}(b64chars),fromCharCode=String.fromCharCode,cb_utob=function(M){if(M.length<2){var ne=M.charCodeAt(0);return ne<128?M:ne<2048?fromCharCode(192|ne>>>6)+fromCharCode(128|ne&63):fromCharCode(224|ne>>>12&15)+fromCharCode(128|ne>>>6&63)+fromCharCode(128|ne&63)}else{var ne=65536+(M.charCodeAt(0)-55296)*1024+(M.charCodeAt(1)-56320);return fromCharCode(240|ne>>>18&7)+fromCharCode(128|ne>>>12&63)+fromCharCode(128|ne>>>6&63)+fromCharCode(128|ne&63)}},re_utob=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,utob=function(M){return M.replace(re_utob,cb_utob)},cb_encode=function(M){var ne=[0,2,1][M.length%3],N=M.charCodeAt(0)<<16|(M.length>1?M.charCodeAt(1):0)<<8|(M.length>2?M.charCodeAt(2):0),I=[b64chars.charAt(N>>>18),b64chars.charAt(N>>>12&63),ne>=2?"=":b64chars.charAt(N>>>6&63),ne>=1?"=":b64chars.charAt(N&63)];return I.join("")},btoa=global.btoa?function(M){return global.btoa(M)}:function(M){return M.replace(/[\s\S]{1,3}/g,cb_encode)},_encode=function(M){var ne=Object.prototype.toString.call(M)==="[object Uint8Array]";return ne?M.toString("base64"):btoa(utob(String(M)))},encode=function(M,ne){return ne?_encode(String(M)).replace(/[+\/]/g,function(N){return N=="+"?"-":"_"}).replace(/=/g,""):_encode(M)},encodeURI=function(M){return encode(M,!0)},re_btou=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,cb_btou=function(M){switch(M.length){case 4:var ne=(7&M.charCodeAt(0))<<18|(63&M.charCodeAt(1))<<12|(63&M.charCodeAt(2))<<6|63&M.charCodeAt(3),N=ne-65536;return fromCharCode((N>>>10)+55296)+fromCharCode((N&1023)+56320);case 3:return fromCharCode((15&M.charCodeAt(0))<<12|(63&M.charCodeAt(1))<<6|63&M.charCodeAt(2));default:return fromCharCode((31&M.charCodeAt(0))<<6|63&M.charCodeAt(1))}},btou=function(M){return M.replace(re_btou,cb_btou)},cb_decode=function(M){var ne=M.length,N=ne%4,I=(ne>0?b64tab[M.charAt(0)]<<18:0)|(ne>1?b64tab[M.charAt(1)]<<12:0)|(ne>2?b64tab[M.charAt(2)]<<6:0)|(ne>3?b64tab[M.charAt(3)]:0),h=[fromCharCode(I>>>16),fromCharCode(I>>>8&255),fromCharCode(I&255)];return h.length-=[0,0,2,1][N],h.join("")},_atob=global.atob?function(M){return global.atob(M)}:function(M){return M.replace(/\S{1,4}/g,cb_decode)},atob=function(M){return _atob(String(M).replace(/[^A-Za-z0-9\+\/]/g,""))},_decode=buffer?buffer.from&&Uint8Array&&buffer.from!==Uint8Array.from?function(M){return(M.constructor===buffer.constructor?M:buffer.from(M,"base64")).toString()}:function(M){return(M.constructor===buffer.constructor?M:new buffer(M,"base64")).toString()}:function(M){return btou(_atob(M))},decode=function(M){return _decode(String(M).replace(/[-_]/g,function(ne){return ne=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,""))},noConflict=function(){var M=global.Base64;return global.Base64=_Base64,M};if(global.Base64={VERSION:version,atob,btoa,fromBase64:decode,toBase64:encode,utob,encode,encodeURI,btou,decode,noConflict,__buffer__:buffer},typeof Object.defineProperty=="function"){var noEnum=function(M){return{value:M,enumerable:!1,writable:!0,configurable:!0}};global.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",noEnum(function(){return decode(this)})),Object.defineProperty(String.prototype,"toBase64",noEnum(function(M){return encode(this,M)})),Object.defineProperty(String.prototype,"toBase64URI",noEnum(function(){return encode(this,!0)}))}}return global.Meteor&&(Base64=global.Base64),typeof module!="undefined"&&module.exports?module.exports.Base64=global.Base64:typeof define=="function"&&define.amd&&define([],function(){return global.Base64}),{Base64:global.Base64}})}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],200:[function(M,ne,N){/*!
* merge-descriptors
* Copyright(c) 2014 Jonathan Ong
* Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed
*/"use strict";ne.exports=h;var I=Object.prototype.hasOwnProperty;function h(S,L,T){if(!S)throw new TypeError("argument dest is required");if(!L)throw new TypeError("argument src is required");return T===void 0&&(T=!0),Object.getOwnPropertyNames(L).forEach(function(C){if(!T&&I.call(S,C))return;var g=Object.getOwnPropertyDescriptor(L,C);Object.defineProperty(S,C,g)}),S}},{}],201:[function(M,ne,N){"use strict";function I(){this._types=Object.create(null),this._extensions=Object.create(null);for(var h=0;h<arguments.length;h++)this.define(arguments[h]);this.define=this.define.bind(this),this.getType=this.getType.bind(this),this.getExtension=this.getExtension.bind(this)}I.prototype.define=function(h,S){for(var L in h){var T=h[L].map(function(g){return g.toLowerCase()});L=L.toLowerCase();for(var c=0;c<T.length;c++){var C=T[c];if(C[0]=="*")continue;if(!S&&C in this._types)throw new Error('Attempt to change mapping for "'+C+'" extension from "'+this._types[C]+'" to "'+L+'". Pass `force=true` to allow this, otherwise remove "'+C+'" from the list of extensions for "'+L+'".');this._types[C]=L}if(S||!this._extensions[L]){var C=T[0];this._extensions[L]=C[0]!="*"?C:C.substr(1)}}},I.prototype.getType=function(h){h=String(h);var S=h.replace(/^.*[/\\]/,"").toLowerCase(),L=S.replace(/^.*\./,"").toLowerCase(),T=S.length<h.length,c=L.length<S.length-1;return(c||!T)&&this._types[L]||null},I.prototype.getExtension=function(h){return h=/^\s*([^;\s]*)/.test(h)&&RegExp.$1,h&&this._extensions[h.toLowerCase()]||null},ne.exports=I},{}],202:[function(M,ne,N){"use strict";var I=M("./Mime");ne.exports=new I(M("./types/standard"))},{"./Mime":201,"./types/standard":203}],203:[function(M,ne,N){ne.exports={"application/andrew-inset":["ez"],"application/applixware":["aw"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomdeleted+xml":["atomdeleted"],"application/atomsvc+xml":["atomsvc"],"application/atsc-dwd+xml":["dwd"],"application/atsc-held+xml":["held"],"application/atsc-rsat+xml":["rsat"],"application/bdoc":["bdoc"],"application/calendar+xml":["xcs"],"application/ccxml+xml":["ccxml"],"application/cdfx+xml":["cdfx"],"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","es"],"application/emma+xml":["emma"],"application/emotionml+xml":["emotionml"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/fdt+xml":["fdt"],"application/font-tdpfr":["pfr"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hjson":["hjson"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/its+xml":["its"],"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/lgr+xml":["lgr"],"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/mmt-aei+xml":["maei"],"application/mmt-usd+xml":["musd"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["mp4s","m4p"],"application/mrb-consumer+xml":["*xdf"],"application/mrb-publish+xml":["*xdf"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/n-quads":["nq"],"application/n-triples":["nt"],"application/node":["cjs"],"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/p2p-overlay+xml":["relo"],"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/provenance+xml":["provx"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf","owl"],"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/route-apd+xml":["rapd"],"application/route-s-tsid+xml":["sls"],"application/route-usd+xml":["rusd"],"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/senml+xml":["senmlx"],"application/sensml+xml":["sensmlx"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/sieve":["siv","sieve"],"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/swid+xml":["swidtag"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/toml":["toml"],"application/ttml+xml":["ttml"],"application/urc-ressheet+xml":["rsheet"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/xaml+xml":["xaml"],"application/xcap-att+xml":["xav"],"application/xcap-caps+xml":["xca"],"application/xcap-diff+xml":["xdf"],"application/xcap-el+xml":["xel"],"application/xcap-error+xml":["xer"],"application/xcap-ns+xml":["xns"],"application/xenc+xml":["xenc"],"application/xhtml+xml":["xhtml","xht"],"application/xliff+xml":["xlf"],"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":["*3gpp"],"audio/adpcm":["adp"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mobile-xmf":["mxmf"],"audio/mp3":["*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":["*wav"],"audio/webm":["weba"],"audio/xm":["xm"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/aces":["exr"],"image/apng":["apng"],"image/bmp":["bmp"],"image/cgm":["cgm"],"image/dicom-rle":["drle"],"image/emf":["emf"],"image/fits":["fits"],"image/g3fax":["g3"],"image/gif":["gif"],"image/heic":["heic"],"image/heic-sequence":["heics"],"image/heif":["heif"],"image/heif-sequence":["heifs"],"image/hej2k":["hej2"],"image/hsj2":["hsj2"],"image/ief":["ief"],"image/jls":["jls"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpeg","jpg","jpe"],"image/jph":["jph"],"image/jphc":["jhc"],"image/jpm":["jpm"],"image/jpx":["jpx","jpf"],"image/jxr":["jxr"],"image/jxra":["jxra"],"image/jxrs":["jxrs"],"image/jxs":["jxs"],"image/jxsc":["jxsc"],"image/jxsi":["jxsi"],"image/jxss":["jxss"],"image/ktx":["ktx"],"image/png":["png"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/t38":["t38"],"image/tiff":["tif","tiff"],"image/tiff-fx":["tfx"],"image/webp":["webp"],"image/wmf":["wmf"],"message/disposition-notification":["disposition-notification"],"message/global":["u8msg"],"message/global-delivery-status":["u8dsn"],"message/global-disposition-notification":["u8mdn"],"message/global-headers":["u8hdr"],"message/rfc822":["eml","mime"],"model/3mf":["3mf"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/mesh":["msh","mesh","silo"],"model/mtl":["mtl"],"model/obj":["obj"],"model/stl":["stl"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["*x3db","x3dbz"],"model/x3d+fastinfoset":["x3db"],"model/x3d+vrml":["*x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"model/x3d-vrml":["x3dv"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["markdown","md"],"text/mathml":["mml"],"text/mdx":["mdx"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/richtext":["rtx"],"text/rtf":["*rtf"],"text/sgml":["sgml","sgm"],"text/shex":["shex"],"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":["*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"]}},{}],204:[function(M,ne,N){var I=1e3,h=I*60,S=h*60,L=S*24,T=L*7,c=L*365.25;ne.exports=function(r,f){f=f||{};var p=typeof r;if(p==="string"&&r.length>0)return C(r);if(p==="number"&&isFinite(r))return f.long?s(r):g(r);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(r))};function C(r){if(r=String(r),r.length>100)return;var f=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(r);if(!f)return;var p=parseFloat(f[1]),m=(f[2]||"ms").toLowerCase();switch(m){case"years":case"year":case"yrs":case"yr":case"y":return p*c;case"weeks":case"week":case"w":return p*T;case"days":case"day":case"d":return p*L;case"hours":case"hour":case"hrs":case"hr":case"h":return p*S;case"minutes":case"minute":case"mins":case"min":case"m":return p*h;case"seconds":case"second":case"secs":case"sec":case"s":return p*I;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return p;default:return}}function g(r){var f=Math.abs(r);return f>=L?Math.round(r/L)+"d":f>=S?Math.round(r/S)+"h":f>=h?Math.round(r/h)+"m":f>=I?Math.round(r/I)+"s":r+"ms"}function s(r){var f=Math.abs(r);return f>=L?a(r,f,L,"day"):f>=S?a(r,f,S,"hour"):f>=h?a(r,f,h,"minute"):f>=I?a(r,f,I,"second"):r+" ms"}function a(r,f,p,m){var E=f>=p*1.5;return Math.round(r/p)+" "+m+(E?"s":"")}},{}],205:[function(M,ne,N){(function(I){function h(c,C){for(var g=0,s=c.length-1;s>=0;s--){var a=c[s];a==="."?c.splice(s,1):a===".."?(c.splice(s,1),g++):g&&(c.splice(s,1),g--)}if(C)for(;g--;g)c.unshift("..");return c}N.resolve=function(){for(var c="",C=!1,g=arguments.length-1;g>=-1&&!C;g--){var s=g>=0?arguments[g]:I.cwd();if(typeof s!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!s)continue;c=s+"/"+c,C=s.charAt(0)==="/"}return c=h(L(c.split("/"),function(a){return!!a}),!C).join("/"),(C?"/":"")+c||"."},N.normalize=function(c){var C=N.isAbsolute(c),g=T(c,-1)==="/";return c=h(L(c.split("/"),function(s){return!!s}),!C).join("/"),!c&&!C&&(c="."),c&&g&&(c+="/"),(C?"/":"")+c},N.isAbsolute=function(c){return c.charAt(0)==="/"},N.join=function(){var c=Array.prototype.slice.call(arguments,0);return N.normalize(L(c,function(C,g){if(typeof C!="string")throw new TypeError("Arguments to path.join must be strings");return C}).join("/"))},N.relative=function(c,C){c=N.resolve(c).substr(1),C=N.resolve(C).substr(1);function g(E){for(var y=0;y<E.length&&!(E[y]!=="");y++);for(var u=E.length-1;u>=0&&!(E[u]!=="");u--);return y>u?[]:E.slice(y,u-y+1)}for(var s=g(c.split("/")),a=g(C.split("/")),r=Math.min(s.length,a.length),f=r,p=0;p<r;p++)if(s[p]!==a[p]){f=p;break}for(var m=[],p=f;p<s.length;p++)m.push("..");return m=m.concat(a.slice(f)),m.join("/")},N.sep="/",N.delimiter=":",N.dirname=function(c){if(typeof c!="string"&&(c=c+""),c.length===0)return".";for(var C=c.charCodeAt(0),g=C===47,s=-1,a=!0,r=c.length-1;r>=1;--r)if(C=c.charCodeAt(r),C===47){if(!a){s=r;break}}else a=!1;return s===-1?g?"/":".":g&&s===1?"/":c.slice(0,s)};function S(c){typeof c!="string"&&(c=c+"");var C=0,g=-1,s=!0,a;for(a=c.length-1;a>=0;--a)if(c.charCodeAt(a)===47){if(!s){C=a+1;break}}else g===-1&&(s=!1,g=a+1);return g===-1?"":c.slice(C,g)}N.basename=function(c,C){var g=S(c);return C&&g.substr(-1*C.length)===C&&(g=g.substr(0,g.length-C.length)),g},N.extname=function(c){typeof c!="string"&&(c=c+"");for(var C=-1,g=0,s=-1,a=!0,r=0,f=c.length-1;f>=0;--f){var p=c.charCodeAt(f);if(p===47){if(!a){g=f+1;break}continue}s===-1&&(a=!1,s=f+1),p===46?C===-1?C=f:r!==1&&(r=1):C!==-1&&(r=-1)}return C===-1||s===-1||r===0||r===1&&C===s-1&&C===g+1?"":c.slice(C,s)};function L(c,C){if(c.filter)return c.filter(C);for(var g=[],s=0;s<c.length;s++)C(c[s],s,c)&&g.push(c[s]);return g}var T="ab".substr(-1)==="b"?function(c,C,g){return c.substr(C,g)}:function(c,C,g){return C<0&&(C=c.length+C),c.substr(C,g)}}).call(this,M("_process"))},{_process:208}],206:[function(M,ne,N){(function(I){/*!
* Platform.js <https://mths.be/platform>
* Copyright 2014-2018 Benjamin Tan <https://bnjmnt4n.now.sh/>
* Copyright 2011-2013 John-David Dalton <http://allyoucanleet.com/>
* Available under MIT license <https://mths.be/mit>
*/(function(){"use strict";var h={function:!0,object:!0},S=h[typeof window]&&window||this,L=S,T=h[typeof N]&&N,c=h[typeof ne]&&ne&&!ne.nodeType&&ne,C=T&&c&&typeof I=="object"&&I;C&&(C.global===C||C.window===C||C.self===C)&&(S=C);var g=Math.pow(2,53)-1,s=/\bOpera/,a=this,r=Object.prototype,f=r.hasOwnProperty,p=r.toString;function m(d){return d=String(d),d.charAt(0).toUpperCase()+d.slice(1)}function E(d,b,x){var _={"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 b&&x&&/^Win/i.test(d)&&!/^Windows Phone /i.test(d)&&(_=_[/[\d.]+$/.exec(d)])&&(d="Windows "+_),d=String(d),b&&x&&(d=d.replace(RegExp(b,"i"),x)),d=u(d.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]),d}function y(d,b){var x=-1,_=d?d.length:0;if(typeof _=="number"&&_>-1&&_<=g)for(;++x<_;)b(d[x],x,d);else n(d,b)}function u(d){return d=i(d),/^(?:webOS|i(?:OS|P))/.test(d)?d:m(d)}function n(d,b){for(var x in d)f.call(d,x)&&b(d[x],x,d)}function o(d){return d==null?m(d):p.call(d).slice(8,-1)}function l(d,b){var x=d!=null?typeof d[b]:"number";return!/^(?:boolean|number|string|undefined)$/.test(x)&&(x=="object"?!!d[b]:!0)}function w(d){return String(d).replace(/([ -])(?!$)/g,"$1?")}function v(d,b){var x=null;return y(d,function(_,B){x=b(x,_,B,d)}),x}function i(d){return String(d).replace(/^ +| +$/g,"")}function R(d){var b=S,x=d&&typeof d=="object"&&o(d)!="String";x&&(b=d,d=null);var _=b.navigator||{},B=_.userAgent||"";d||(d=B);var U=x||a==L,P=x?!!_.likeChrome:/\bChrome\b/.test(d)&&!/internal|\n/i.test(p.toString()),J="Object",$=x?J:"ScriptBridgingProxyObject",z=x?J:"Environment",V=x&&b.java?"JavaPackage":o(b.java),K=x?J:"RuntimeObject",H=/\bJava/.test(V)&&b.java,G=H&&o(b.environment)==z,ie=H?"a":"\u03B1",le=H?"b":"\u03B2",ue=b.document||{},be=b.operamini||b.opera,Ce=s.test(Ce=x&&be?be["[[Class]]"]:o(be))?Ce:be=null,se,ce=d,he=[],ae=null,Q=d==B,D=Q&&be&&typeof be.version=="function"&&be.version(),F,W=X([{label:"EdgeHTML",pattern:"Edge"},"Trident",{label:"WebKit",pattern:"AppleWebKit"},"iCab","Presto","NetFront","Tasman","KHTML","Gecko"]),Y=me(["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"]),Z=Te([{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"]),te=re({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}}),q=ve(["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 "]);function X(Ne){return v(Ne,function(We,Be){return We||RegExp("\\b"+(Be.pattern||w(Be))+"\\b","i").exec(d)&&(Be.label||Be)})}function re(Ne){return v(Ne,function(We,Be,He){return We||(Be[Z]||Be[/^[a-z]+(?: +[a-z]+\b)*/i.exec(Z)]||RegExp("\\b"+w(He)+"(?:\\b|\\w*\\d)","i").exec(d))&&He})}function me(Ne){return v(Ne,function(We,Be){return We||RegExp("\\b"+(Be.pattern||w(Be))+"\\b","i").exec(d)&&(Be.label||Be)})}function ve(Ne){return v(Ne,function(We,Be){var He=Be.pattern||w(Be);return!We&&(We=RegExp("\\b"+He+"(?:/[\\d.]+|[ \\w.]*)","i").exec(d))&&(We=E(We,He,Be.label||Be)),We})}function Te(Ne){return v(Ne,function(We,Be){var He=Be.pattern||w(Be);return!We&&(We=RegExp("\\b"+He+" *\\d+[.\\w_]*","i").exec(d)||RegExp("\\b"+He+" *\\w+-[\\w]*","i").exec(d)||RegExp("\\b"+He+"(?:; *(?:[a-z]+[_-])?[a-z]+\\d+|[^ ();-]*)","i").exec(d))&&((We=String(Be.label&&!RegExp(He,"i").test(Be.label)?Be.label:We).split("/"))[1]&&!/[\d.]+/.test(We[0])&&(We[0]+=" "+We[1]),Be=Be.label||Be,We=u(We[0].replace(RegExp(He,"i"),Be).replace(RegExp("; *(?:"+Be+"[_-])?","i")," ").replace(RegExp("("+Be+")[-_.]?(\\w)","i"),"$1 $2"))),We})}function Re(Ne){return v(Ne,function(We,Be){return We||(RegExp(Be+"(?:-[\\d.]+/|(?: for [\\w-]+)?[ /-])([\\d.]+[^ ();/_-]*)","i").exec(d)||0)[1]||null})}function Ie(){return this.description||""}if(W&&(W=[W]),te&&!Z&&(Z=Te([te])),(se=/\bGoogle TV\b/.exec(Z))&&(Z=se[0]),/\bSimulator\b/i.test(d)&&(Z=(Z?Z+" ":"")+"Simulator"),Y=="Opera Mini"&&/\bOPiOS\b/.test(d)&&he.push("running in Turbo/Uncompressed mode"),Y=="IE"&&/\blike iPhone OS\b/.test(d)?(se=R(d.replace(/like iPhone OS/,"")),te=se.manufacturer,Z=se.product):/^iP/.test(Z)?(Y||(Y="Safari"),q="iOS"+((se=/ OS ([\d_]+)/i.exec(d))?" "+se[1].replace(/_/g,"."):"")):Y=="Konqueror"&&!/buntu/i.test(q)?q="Kubuntu":te&&te!="Google"&&(/Chrome/.test(Y)&&!/\bMobile Safari\b/i.test(d)||/\bVita\b/.test(Z))||/\bAndroid\b/.test(q)&&/^Chrome/.test(Y)&&/\bVersion\//i.test(d)?(Y="Android Browser",q=/\bAndroid\b/.test(q)?q:"Android"):Y=="Silk"?(/\bMobi/i.test(d)||(q="Android",he.unshift("desktop mode")),/Accelerated *= *true/i.test(d)&&he.unshift("accelerated")):Y=="PaleMoon"&&(se=/\bFirefox\/([\d.]+)\b/.exec(d))?he.push("identifying as Firefox "+se[1]):Y=="Firefox"&&(se=/\b(Mobile|Tablet|TV)\b/i.exec(d))?(q||(q="Firefox OS"),Z||(Z=se[1])):!Y||(se=!/\bMinefield\b/i.test(d)&&/\b(?:Firefox|Safari)\b/.exec(Y))?(Y&&!Z&&/[\/,]|^[^(]+?\)/.test(d.slice(d.indexOf(se+"/")+8))&&(Y=null),(se=Z||te||q)&&(Z||te||/\b(?:Android|Symbian OS|Tablet OS|webOS)\b/.test(q))&&(Y=/[a-z]+(?: Hat)?/i.exec(/\bAndroid\b/.test(q)?q:se)+" Browser")):Y=="Electron"&&(se=(/\bChrome\/([\d.]+)\b/.exec(d)||0)[1])&&he.push("Chromium "+se),D||(D=Re(["(?:Cloud9|CriOS|CrMo|Edge|FxiOS|IEMobile|Iron|Opera ?Mini|OPiOS|OPR|Raven|SamsungBrowser|Silk(?!/[\\d.]+$))","Version",w(Y),"(?:Firefox|Minefield|NetFront)"])),(se=W=="iCab"&&parseFloat(D)>3&&"WebKit"||/\bOpera\b/.test(Y)&&(/\bOPR\b/.test(d)?"Blink":"Presto")||/\b(?:Midori|Nook|Safari)\b/i.test(d)&&!/^(?:Trident|EdgeHTML)$/.test(W)&&"WebKit"||!W&&/\bMSIE\b/i.test(d)&&(q=="Mac OS"?"Tasman":"Trident")||W=="WebKit"&&/\bPlayStation\b(?! Vita\b)/i.test(Y)&&"NetFront")&&(W=[se]),Y=="IE"&&(se=(/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(d)||0)[1])?(Y+=" Mobile",q="Windows Phone "+(/\+$/.test(se)?se:se+".x"),he.unshift("desktop mode")):/\bWPDesktop\b/i.test(d)?(Y="IE Mobile",q="Windows Phone 8.x",he.unshift("desktop mode"),D||(D=(/\brv:([\d.]+)/.exec(d)||0)[1])):Y!="IE"&&W=="Trident"&&(se=/\brv:([\d.]+)/.exec(d))&&(Y&&he.push("identifying as "+Y+(D?" "+D:"")),Y="IE",D=se[1]),Q){if(l(b,"global"))if(H&&(se=H.lang.System,ce=se.getProperty("os.arch"),q=q||se.getProperty("os.name")+" "+se.getProperty("os.version")),G){try{D=b.require("ringo/engine").version.join("."),Y="RingoJS"}catch(Ne){(se=b.system)&&se.global.system==b.system&&(Y="Narwhal",q||(q=se[0].os||null))}Y||(Y="Rhino")}else typeof b.process=="object"&&!b.process.browser&&(se=b.process)&&(typeof se.versions=="object"&&(typeof se.versions.electron=="string"?(he.push("Node "+se.versions.node),Y="Electron",D=se.versions.electron):typeof se.versions.nw=="string"&&(he.push("Chromium "+D,"Node "+se.versions.node),Y="NW.js",D=se.versions.nw)),Y||(Y="Node.js",ce=se.arch,q=se.platform,D=/[\d.]+/.exec(se.version),D=D?D[0]:null));else o(se=b.runtime)==$?(Y="Adobe AIR",q=se.flash.system.Capabilities.os):o(se=b.phantom)==K?(Y="PhantomJS",D=(se=se.version||null)&&se.major+"."+se.minor+"."+se.patch):typeof ue.documentMode=="number"&&(se=/\bTrident\/(\d+)/i.exec(d))?(D=[D,ue.documentMode],(se=+se[1]+4)!=D[1]&&(he.push("IE "+D[1]+" mode"),W&&(W[1]=""),D[1]=se),D=Y=="IE"?String(D[1].toFixed(1)):D[0]):typeof ue.documentMode=="number"&&/^(?:Chrome|Firefox)\b/.test(Y)&&(he.push("masking as "+Y+" "+D),Y="IE",D="11.0",W=["Trident"],q="Windows");q=q&&u(q)}if(D&&(se=/(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(D)||/(?:alpha|beta)(?: ?\d)?/i.exec(d+";"+(Q&&_.appMinorVersion))||/\bMinefield\b/i.test(d)&&"a")&&(ae=/b/i.test(se)?"beta":"alpha",D=D.replace(RegExp(se+"\\+?$"),"")+(ae=="beta"?le:ie)+(/\d+\+?/.exec(se)||"")),Y=="Fennec"||Y=="Firefox"&&/\b(?:Android|Firefox OS)\b/.test(q))Y="Firefox Mobile";else if(Y=="Maxthon"&&D)D=D.replace(/\.[\d.]+/,".x");else if(/\bXbox\b/i.test(Z))Z=="Xbox 360"&&(q=null),Z=="Xbox 360"&&/\bIEMobile\b/.test(d)&&he.unshift("mobile mode");else if((/^(?:Chrome|IE|Opera)$/.test(Y)||Y&&!Z&&!/Browser|Mobi/.test(Y))&&(q=="Windows CE"||/Mobi/i.test(d)))Y+=" Mobile";else if(Y=="IE"&&Q)try{b.external===null&&he.unshift("platform preview")}catch(Ne){he.unshift("embedded")}else(/\bBlackBerry\b/.test(Z)||/\bBB10\b/.test(d))&&(se=(RegExp(Z.replace(/ +/g," *")+"/([.\\d]+)","i").exec(d)||0)[1]||D)?(se=[se,/BB10/.test(d)],q=(se[1]?(Z=null,te="BlackBerry"):"Device Software")+" "+se[0],D=null):this!=n&&Z!="Wii"&&(Q&&be||/Opera/.test(Y)&&/\b(?:MSIE|Firefox)\b/i.test(d)||Y=="Firefox"&&/\bOS X (?:\d+\.){2,}/.test(q)||Y=="IE"&&(q&&!/^Win/.test(q)&&D>5.5||/\bWindows XP\b/.test(q)&&D>8||D==8&&!/\bTrident\b/.test(d)))&&!s.test(se=R.call(n,d.replace(s,"")+";"))&&se.name&&(se="ing as "+se.name+((se=se.version)?" "+se:""),s.test(Y)?(/\bIE\b/.test(se)&&q=="Mac OS"&&(q=null),se="identify"+se):(se="mask"+se,Ce?Y=u(Ce.replace(/([a-z])([A-Z])/g,"$1 $2")):Y="Opera",/\bIE\b/.test(se)&&(q=null),Q||(D=null)),W=["Presto"],he.push(se));(se=(/\bAppleWebKit\/([\d.]+\+?)/i.exec(d)||0)[1])&&(se=[parseFloat(se.replace(/\.(\d)$/,".0$1")),se],Y=="Safari"&&se[1].slice(-1)=="+"?(Y="WebKit Nightly",ae="alpha",D=se[1].slice(0,-1)):(D==se[1]||D==(se[2]=(/\bSafari\/([\d.]+\+?)/i.exec(d)||0)[1]))&&(D=null),se[1]=(/\bChrome\/([\d.]+)/i.exec(d)||0)[1],se[0]==537.36&&se[2]==537.36&&parseFloat(se[1])>=28&&W=="WebKit"&&(W=["Blink"]),!Q||!P&&!se[1]?(W&&(W[1]="like Safari"),se=(se=se[0],se<400?1:se<500?2:se<526?3:se<533?4:se<534?"4+":se<535?5:se<537?6:se<538?7:se<601?8:"8")):(W&&(W[1]="like Chrome"),se=se[1]||(se=se[0],se<530?1:se<532?2:se<532.05?3:se<533?4:se<534.03?5:se<534.07?6:se<534.1?7:se<534.13?8:se<534.16?9:se<534.24?10:se<534.3?11:se<535.01?12:se<535.02?"13+":se<535.07?15:se<535.11?16:se<535.19?17:se<536.05?18:se<536.1?19:se<537.01?20:se<537.11?"21+":se<537.13?23:se<537.18?24:se<537.24?25:se<537.36?26:W!="Blink"?"27":"28")),W&&(W[1]+=" "+(se+=typeof se=="number"?".x":/[.+]/.test(se)?"":"+")),Y=="Safari"&&(!D||parseInt(D)>45)&&(D=se)),Y=="Opera"&&(se=/\bzbov|zvav$/.exec(q))?(Y+=" ",he.unshift("desktop mode"),se=="zvav"?(Y+="Mini",D=null):Y+="Mobile",q=q.replace(RegExp(" *"+se+"$"),"")):Y=="Safari"&&/\bChrome\b/.exec(W&&W[1])&&(he.unshift("desktop mode"),Y="Chrome Mobile",D=null,/\bOS X\b/.test(q)?(te="Apple",q="iOS 4.3+"):q=null),D&&D.indexOf(se=/[\d.]+$/.exec(q))==0&&d.indexOf("/"+se+"-")>-1&&(q=i(q.replace(se,""))),W&&!/\b(?:Avant|Nook)\b/.test(Y)&&(/Browser|Lunascape|Maxthon/.test(Y)||Y!="Safari"&&/^iOS/.test(q)&&/\bSafari\b/.test(W[1])||/^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|Web)/.test(Y)&&W[1])&&((se=W[W.length-1])&&he.push(se)),he.length&&(he=["("+he.join("; ")+")"]),te&&Z&&Z.indexOf(te)<0&&he.push("on "+te),Z&&he.push((/^on /.test(he[he.length-1])?"":"on ")+Z),q&&(se=/ ([\d.+]+)$/.exec(q),F=se&&q.charAt(q.length-se[0].length-1)=="/",q={architecture:32,family:se&&!F?q.replace(se[0],""):q,version:se?se[1]:null,toString:function(){var Ne=this.version;return this.family+(Ne&&!F?" "+Ne:"")+(this.architecture==64?" 64-bit":"")}}),(se=/\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(ce))&&!/\bi686\b/i.test(ce)?(q&&(q.architecture=64,q.family=q.family.replace(RegExp(" *"+se),"")),Y&&(/\bWOW64\b/i.test(d)||Q&&/\w(?:86|32)$/.test(_.cpuClass||_.platform)&&!/\bWin64; x64\b/i.test(d))&&he.unshift("32-bit")):q&&/^OS X/.test(q.family)&&Y=="Chrome"&&parseFloat(D)>=39&&(q.architecture=64),d||(d=null);var je={};return je.description=d,je.layout=W&&W[0],je.manufacturer=te,je.name=Y,je.prerelease=ae,je.product=Z,je.ua=d,je.version=Y&&D,je.os=q||{architecture:null,family:null,version:null,toString:function(){return"null"}},je.parse=R,je.toString=Ie,je.version&&he.unshift(D),je.name&&he.unshift(Y),q&&Y&&!(q==String(q).split(" ")[0]&&(q==Y.split(" ")[0]||Z))&&he.push(Z?"("+q+")":"on "+q),he.length&&(je.description=he.join(" ")),je}var k=R();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(S.platform=k,define(function(){return k})):T&&c?n(k,function(d,b){T[b]=d}):S.platform=k}).call(this)}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],207:[function(M,ne,N){(function(I){"use strict";typeof I=="undefined"||!I.version||I.version.indexOf("v0.")===0||I.version.indexOf("v1.")===0&&I.version.indexOf("v1.8.")!==0?ne.exports={nextTick:h}:ne.exports=I;function h(S,L,T,c){if(typeof S!="function")throw new TypeError('"callback" argument must be a function');var C=arguments.length,g,s;switch(C){case 0:case 1:return I.nextTick(S);case 2:return I.nextTick(function(){S.call(null,L)});case 3:return I.nextTick(function(){S.call(null,L,T)});case 4:return I.nextTick(function(){S.call(null,L,T,c)});default:for(g=new Array(C-1),s=0;s<g.length;)g[s++]=arguments[s];return I.nextTick(function(){S.apply(null,g)})}}}).call(this,M("_process"))},{_process:208}],208:[function(M,ne,N){var I=ne.exports={},h,S;function L(){throw new Error("setTimeout has not been defined")}function T(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?h=setTimeout:h=L}catch(y){h=L}try{typeof clearTimeout=="function"?S=clearTimeout:S=T}catch(y){S=T}})();function c(y){if(h===setTimeout)return setTimeout(y,0);if((h===L||!h)&&setTimeout)return h=setTimeout,setTimeout(y,0);try{return h(y,0)}catch(u){try{return h.call(null,y,0)}catch(n){return h.call(this,y,0)}}}function C(y){if(S===clearTimeout)return clearTimeout(y);if((S===T||!S)&&clearTimeout)return S=clearTimeout,clearTimeout(y);try{return S(y)}catch(u){try{return S.call(null,y)}catch(n){return S.call(this,y)}}}var g=[],s=!1,a,r=-1;function f(){if(!s||!a)return;s=!1,a.length?g=a.concat(g):r=-1,g.length&&p()}function p(){if(s)return;var y=c(f);s=!0;for(var u=g.length;u;){for(a=g,g=[];++r<u;)a&&a[r].run();r=-1,u=g.length}a=null,s=!1,C(y)}I.nextTick=function(y){var u=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)u[n-1]=arguments[n];g.push(new m(y,u)),g.length===1&&!s&&c(p)};function m(y,u){this.fun=y,this.array=u}m.prototype.run=function(){this.fun.apply(null,this.array)},I.title="browser",I.browser=!0,I.env={},I.argv=[],I.version="",I.versions={};function E(){}I.on=E,I.addListener=E,I.once=E,I.off=E,I.removeListener=E,I.removeAllListeners=E,I.emit=E,I.prependListener=E,I.prependOnceListener=E,I.listeners=function(y){return[]},I.binding=function(y){throw new Error("process.binding is not supported")},I.cwd=function(){return"/"},I.chdir=function(y){throw new Error("process.chdir is not supported")},I.umask=function(){return 0}},{}],209:[function(M,ne,N){(function(I){/*! https://mths.be/punycode v1.4.1 by @mathias */(function(h){var S=typeof N=="object"&&N&&!N.nodeType&&N,L=typeof ne=="object"&&ne&&!ne.nodeType&&ne,T=typeof I=="object"&&I;(T.global===T||T.window===T||T.self===T)&&(h=T);var c,C=2147483647,g=36,s=1,a=26,r=38,f=700,p=72,m=128,E="-",y=/^xn--/,u=/[^\x20-\x7E]/,n=/[\x2E\u3002\uFF0E\uFF61]/g,o={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},l=g-s,w=Math.floor,v=String.fromCharCode,i;function R(V){throw new RangeError(o[V])}function k(V,K){for(var H=V.length,G=[];H--;)G[H]=K(V[H]);return G}function d(V,K){var H=V.split("@"),G="";H.length>1&&(G=H[0]+"@",V=H[1]),V=V.replace(n,".");var ie=V.split("."),le=k(ie,K).join(".");return G+le}function b(V){for(var K=[],H=0,G=V.length,ie,le;H<G;)ie=V.charCodeAt(H++),ie>=55296&&ie<=56319&&H<G?(le=V.charCodeAt(H++),(le&64512)==56320?K.push(((ie&1023)<<10)+(le&1023)+65536):(K.push(ie),H--)):K.push(ie);return K}function x(V){return k(V,function(K){var H="";return K>65535&&(K-=65536,H+=v(K>>>10&1023|55296),K=56320|K&1023),H+=v(K),H}).join("")}function _(V){return V-48<10?V-22:V-65<26?V-65:V-97<26?V-97:g}function B(V,K){return V+22+75*(V<26)-((K!=0)<<5)}function U(V,K,H){var G=0;for(V=H?w(V/f):V>>1,V+=w(V/K);V>l*a>>1;G+=g)V=w(V/l);return w(G+(l+1)*V/(V+r))}function P(V){var K=[],H=V.length,G,ie=0,le=m,ue=p,be,Ce,se,ce,he,ae,Q,D,F;for(be=V.lastIndexOf(E),be<0&&(be=0),Ce=0;Ce<be;++Ce)V.charCodeAt(Ce)>=128&&R("not-basic"),K.push(V.charCodeAt(Ce));for(se=be>0?be+1:0;se<H;){for(ce=ie,he=1,ae=g;!(se>=H&&R("invalid-input"),Q=_(V.charCodeAt(se++)),(Q>=g||Q>w((C-ie)/he))&&R("overflow"),ie+=Q*he,D=ae<=ue?s:ae>=ue+a?a:ae-ue,Q<D);ae+=g)F=g-D,he>w(C/F)&&R("overflow"),he*=F;G=K.length+1,ue=U(ie-ce,G,ce==0),w(ie/G)>C-le&&R("overflow"),le+=w(ie/G),ie%=G,K.splice(ie++,0,le)}return x(K)}function J(V){var K,H,G,ie,le,ue,be,Ce,se,ce,he,ae=[],Q,D,F,W;for(V=b(V),Q=V.length,K=m,H=0,le=p,ue=0;ue<Q;++ue)he=V[ue],he<128&&ae.push(v(he));for(G=ie=ae.length,ie&&ae.push(E);G<Q;){for(be=C,ue=0;ue<Q;++ue)he=V[ue],he>=K&&he<be&&(be=he);for(D=G+1,be-K>w((C-H)/D)&&R("overflow"),H+=(be-K)*D,K=be,ue=0;ue<Q;++ue)if(he=V[ue],he<K&&++H>C&&R("overflow"),he==K){for(Ce=H,se=g;!(ce=se<=le?s:se>=le+a?a:se-le,Ce<ce);se+=g)W=Ce-ce,F=g-ce,ae.push(v(B(ce+W%F,0))),Ce=w(W/F);ae.push(v(B(Ce,0))),le=U(H,D,G==ie),H=0,++G}++H,++K}return ae.join("")}function $(V){return d(V,function(K){return y.test(K)?P(K.slice(4).toLowerCase()):K})}function z(V){return d(V,function(K){return u.test(K)?"xn--"+J(K):K})}if(c={version:"1.4.1",ucs2:{decode:b,encode:x},decode:P,encode:J,toASCII:z,toUnicode:$},typeof define=="function"&&typeof define.amd=="object"&&define.amd)define("punycode",function(){return c});else if(S&&L)if(ne.exports==S)L.exports=c;else for(i in c)c.hasOwnProperty(i)&&(S[i]=c[i]);else h.punycode=c})(this)}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],210:[function(M,ne,N){"use strict";function I(S,L){return Object.prototype.hasOwnProperty.call(S,L)}ne.exports=function(S,L,T,c){L=L||"&",T=T||"=";var C={};if(typeof S!="string"||S.length===0)return C;var g=/\+/g;S=S.split(L);var s=1e3;c&&typeof c.maxKeys=="number"&&(s=c.maxKeys);var a=S.length;s>0&&a>s&&(a=s);for(var r=0;r<a;++r){var f=S[r].replace(g,"%20"),p=f.indexOf(T),m,E,y,u;p>=0?(m=f.substr(0,p),E=f.substr(p+1)):(m=f,E=""),y=decodeURIComponent(m),u=decodeURIComponent(E),I(C,y)?h(C[y])?C[y].push(u):C[y]=[C[y],u]:C[y]=u}return C};var h=Array.isArray||function(S){return Object.prototype.toString.call(S)==="[object Array]"}},{}],211:[function(M,ne,N){"use strict";var I=function(T){switch(typeof T){case"string":return T;case"boolean":return T?"true":"false";case"number":return isFinite(T)?T:"";default:return""}};ne.exports=function(T,c,C,g){return c=c||"&",C=C||"=",T===null&&(T=void 0),typeof T=="object"?S(L(T),function(s){var a=encodeURIComponent(I(s))+C;return h(T[s])?S(T[s],function(r){return a+encodeURIComponent(I(r))}).join(c):a+encodeURIComponent(I(T[s]))}).join(c):g?encodeURIComponent(I(g))+C+encodeURIComponent(I(T)):""};var h=Array.isArray||function(T){return Object.prototype.toString.call(T)==="[object Array]"};function S(T,c){if(T.map)return T.map(c);for(var C=[],g=0;g<T.length;g++)C.push(c(T[g],g));return C}var L=Object.keys||function(T){var c=[];for(var C in T)Object.prototype.hasOwnProperty.call(T,C)&&c.push(C);return c}},{}],212:[function(M,ne,N){"use strict";N.decode=N.parse=M("./decode"),N.encode=N.stringify=M("./encode")},{"./decode":210,"./encode":211}],213:[function(M,ne,N){ne.exports=M("./lib/_stream_duplex.js")},{"./lib/_stream_duplex.js":214}],214:[function(M,ne,N){"use strict";var I=M("babel-runtime/core-js/object/create"),h=T(I),S=M("babel-runtime/core-js/object/keys"),L=T(S);function T(u){return u&&u.__esModule?u:{default:u}}var c=M("process-nextick-args"),C=L.default||function(u){var n=[];for(var o in u)n.push(o);return n};ne.exports=m;var g=(0,h.default)(M("core-util-is"));g.inherits=M("inherits");var s=M("./_stream_readable"),a=M("./_stream_writable");g.inherits(m,s);for(var r=C(a.prototype),f=0;f<r.length;f++){var p=r[f];m.prototype[p]||(m.prototype[p]=a.prototype[p])}function m(u){if(!(this instanceof m))return new m(u);s.call(this,u),a.call(this,u),u&&u.readable===!1&&(this.readable=!1),u&&u.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,u&&u.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",E)}Object.defineProperty(m.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function E(){if(this.allowHalfOpen||this._writableState.ended)return;c.nextTick(y,this)}function y(u){u.end()}Object.defineProperty(m.prototype,"destroyed",{get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(n){if(this._readableState===void 0||this._writableState===void 0)return;this._readableState.destroyed=n,this._writableState.destroyed=n}}),m.prototype._destroy=function(u,n){this.push(null),this.end(),c.nextTick(n,u)}},{"./_stream_readable":216,"./_stream_writable":218,"babel-runtime/core-js/object/create":55,"babel-runtime/core-js/object/keys":60,"core-util-is":189,inherits:196,"process-nextick-args":207}],215:[function(M,ne,N){"use strict";var I=M("babel-runtime/core-js/object/create"),h=S(I);function S(C){return C&&C.__esModule?C:{default:C}}ne.exports=c;var L=M("./_stream_transform"),T=(0,h.default)(M("core-util-is"));T.inherits=M("inherits"),T.inherits(c,L);function c(C){if(!(this instanceof c))return new c(C);L.call(this,C)}c.prototype._transform=function(C,g,s){s(null,C)}},{"./_stream_transform":217,"babel-runtime/core-js/object/create":55,"core-util-is":189,inherits:196}],216:[function(M,ne,N){(function(I,h){"use strict";var S=M("babel-runtime/core-js/object/get-prototype-of"),L=C(S),T=M("babel-runtime/core-js/object/create"),c=C(T);function C(W){return W&&W.__esModule?W:{default:W}}var g=M("process-nextick-args");ne.exports=b;var s=M("isarray"),a;b.ReadableState=d;var r=M("events").EventEmitter,f=function(Y,Z){return Y.listeners(Z).length},p=M("./internal/streams/stream"),m=M("safe-buffer").Buffer,E=h.Uint8Array||function(){};function y(W){return m.from(W)}function u(W){return m.isBuffer(W)||W instanceof E}var n=(0,c.default)(M("core-util-is"));n.inherits=M("inherits");var o=M("util"),l=void 0;o&&o.debuglog?l=o.debuglog("stream"):l=function(){};var w=M("./internal/streams/BufferList"),v=M("./internal/streams/destroy"),i;n.inherits(b,p);var R=["error","close","destroy","pause","resume"];function k(W,Y,Z){if(typeof W.prependListener=="function")return W.prependListener(Y,Z);!W._events||!W._events[Y]?W.on(Y,Z):s(W._events[Y])?W._events[Y].unshift(Z):W._events[Y]=[Z,W._events[Y]]}function d(W,Y){a=a||M("./_stream_duplex"),W=W||{};var Z=Y instanceof a;this.objectMode=!!W.objectMode,Z&&(this.objectMode=this.objectMode||!!W.readableObjectMode);var te=W.highWaterMark,q=W.readableHighWaterMark,X=this.objectMode?16:16*1024;te||te===0?this.highWaterMark=te:Z&&(q||q===0)?this.highWaterMark=q:this.highWaterMark=X,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new w,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=W.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,W.encoding&&(i||(i=M("string_decoder/").StringDecoder),this.decoder=new i(W.encoding),this.encoding=W.encoding)}function b(W){if(a=a||M("./_stream_duplex"),!(this instanceof b))return new b(W);this._readableState=new d(W,this),this.readable=!0,W&&(typeof W.read=="function"&&(this._read=W.read),typeof W.destroy=="function"&&(this._destroy=W.destroy)),p.call(this)}Object.defineProperty(b.prototype,"destroyed",{get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(Y){if(!this._readableState)return;this._readableState.destroyed=Y}}),b.prototype.destroy=v.destroy,b.prototype._undestroy=v.undestroy,b.prototype._destroy=function(W,Y){this.push(null),Y(W)},b.prototype.push=function(W,Y){var Z=this._readableState,te;return Z.objectMode?te=!0:typeof W=="string"&&(Y=Y||Z.defaultEncoding,Y!==Z.encoding&&(W=m.from(W,Y),Y=""),te=!0),x(this,W,Y,!1,te)},b.prototype.unshift=function(W){return x(this,W,null,!0,!1)};function x(W,Y,Z,te,q){var X=W._readableState;if(Y===null)X.reading=!1,z(W,X);else{var re;q||(re=B(X,Y)),re?W.emit("error",re):X.objectMode||Y&&Y.length>0?(typeof Y!="string"&&!X.objectMode&&(0,L.default)(Y)!==m.prototype&&(Y=y(Y)),te?X.endEmitted?W.emit("error",new Error("stream.unshift() after end event")):_(W,X,Y,!0):X.ended?W.emit("error",new Error("stream.push() after EOF")):(X.reading=!1,X.decoder&&!Z?(Y=X.decoder.write(Y),X.objectMode||Y.length!==0?_(W,X,Y,!1):H(W,X)):_(W,X,Y,!1))):te||(X.reading=!1)}return U(X)}function _(W,Y,Z,te){Y.flowing&&Y.length===0&&!Y.sync?(W.emit("data",Z),W.read(0)):(Y.length+=Y.objectMode?1:Z.length,te?Y.buffer.unshift(Z):Y.buffer.push(Z),Y.needReadable&&V(W)),H(W,Y)}function B(W,Y){var Z;return!u(Y)&&typeof Y!="string"&&Y!==void 0&&!W.objectMode&&(Z=new TypeError("Invalid non-string/buffer chunk")),Z}function U(W){return!W.ended&&(W.needReadable||W.length<W.highWaterMark||W.length===0)}b.prototype.isPaused=function(){return this._readableState.flowing===!1},b.prototype.setEncoding=function(W){return i||(i=M("string_decoder/").StringDecoder),this._readableState.decoder=new i(W),this._readableState.encoding=W,this};var P=8388608;function J(W){return W>=P?W=P:(W--,W|=W>>>1,W|=W>>>2,W|=W>>>4,W|=W>>>8,W|=W>>>16,W++),W}function $(W,Y){return W<=0||Y.length===0&&Y.ended?0:Y.objectMode?1:W!==W?Y.flowing&&Y.length?Y.buffer.head.data.length:Y.length:(W>Y.highWaterMark&&(Y.highWaterMark=J(W)),W<=Y.length?W:Y.ended?Y.length:(Y.needReadable=!0,0))}b.prototype.read=function(W){l("read",W),W=parseInt(W,10);var Y=this._readableState,Z=W;if(W!==0&&(Y.emittedReadable=!1),W===0&&Y.needReadable&&(Y.length>=Y.highWaterMark||Y.ended))return l("read: emitReadable",Y.length,Y.ended),Y.length===0&&Y.ended?Q(this):V(this),null;if(W=$(W,Y),W===0&&Y.ended)return Y.length===0&&Q(this),null;var te=Y.needReadable;l("need readable",te),(Y.length===0||Y.length-W<Y.highWaterMark)&&(te=!0,l("length less than watermark",te)),Y.ended||Y.reading?(te=!1,l("reading or ended",te)):te&&(l("do read"),Y.reading=!0,Y.sync=!0,Y.length===0&&(Y.needReadable=!0),this._read(Y.highWaterMark),Y.sync=!1,Y.reading||(W=$(Z,Y)));var q;return W>0?q=se(W,Y):q=null,q===null?(Y.needReadable=!0,W=0):Y.length-=W,Y.length===0&&(Y.ended||(Y.needReadable=!0),Z!==W&&Y.ended&&Q(this)),q!==null&&this.emit("data",q),q};function z(W,Y){if(Y.ended)return;if(Y.decoder){var Z=Y.decoder.end();Z&&Z.length&&(Y.buffer.push(Z),Y.length+=Y.objectMode?1:Z.length)}Y.ended=!0,V(W)}function V(W){var Y=W._readableState;Y.needReadable=!1,Y.emittedReadable||(l("emitReadable",Y.flowing),Y.emittedReadable=!0,Y.sync?g.nextTick(K,W):K(W))}function K(W){l("emit readable"),W.emit("readable"),Ce(W)}function H(W,Y){Y.readingMore||(Y.readingMore=!0,g.nextTick(G,W,Y))}function G(W,Y){for(var Z=Y.length;!Y.reading&&!Y.flowing&&!Y.ended&&Y.length<Y.highWaterMark&&!(l("maybeReadMore read 0"),W.read(0),Z===Y.length);)Z=Y.length;Y.readingMore=!1}b.prototype._read=function(W){this.emit("error",new Error("_read() is not implemented"))},b.prototype.pipe=function(W,Y){var Z=this,te=this._readableState;switch(te.pipesCount){case 0:te.pipes=W;break;case 1:te.pipes=[te.pipes,W];break;default:te.pipes.push(W);break}te.pipesCount+=1,l("pipe count=%d opts=%j",te.pipesCount,Y);var q=(!Y||Y.end!==!1)&&W!==I.stdout&&W!==I.stderr,X=q?me:He;te.endEmitted?g.nextTick(X):Z.once("end",X),W.on("unpipe",re);function re(De,Xe){l("onunpipe"),De===Z&&(Xe&&Xe.hasUnpiped===!1&&(Xe.hasUnpiped=!0,Re()))}function me(){l("onend"),W.end()}var ve=ie(Z);W.on("drain",ve);var Te=!1;function Re(){l("cleanup"),W.removeListener("close",We),W.removeListener("finish",Be),W.removeListener("drain",ve),W.removeListener("error",Ne),W.removeListener("unpipe",re),Z.removeListener("end",me),Z.removeListener("end",He),Z.removeListener("data",je),Te=!0,te.awaitDrain&&(!W._writableState||W._writableState.needDrain)&&ve()}var Ie=!1;Z.on("data",je);function je(De){l("ondata"),Ie=!1;var Xe=W.write(De);Xe===!1&&!Ie&&((te.pipesCount===1&&te.pipes===W||te.pipesCount>1&&F(te.pipes,W)!==-1)&&!Te&&(l("false write response, pause",Z._readableState.awaitDrain),Z._readableState.awaitDrain++,Ie=!0),Z.pause())}function Ne(De){l("onerror",De),He(),W.removeListener("error",Ne),f(W,"error")===0&&W.emit("error",De)}k(W,"error",Ne);function We(){W.removeListener("finish",Be),He()}W.once("close",We);function Be(){l("onfinish"),W.removeListener("close",We),He()}W.once("finish",Be);function He(){l("unpipe"),Z.unpipe(W)}return W.emit("pipe",Z),te.flowing||(l("pipe resume"),Z.resume()),W};function ie(W){return function(){var Y=W._readableState;l("pipeOnDrain",Y.awaitDrain),Y.awaitDrain&&Y.awaitDrain--,Y.awaitDrain===0&&f(W,"data")&&(Y.flowing=!0,Ce(W))}}b.prototype.unpipe=function(W){var Y=this._readableState,Z={hasUnpiped:!1};if(Y.pipesCount===0)return this;if(Y.pipesCount===1)return W&&W!==Y.pipes?this:(W||(W=Y.pipes),Y.pipes=null,Y.pipesCount=0,Y.flowing=!1,W&&W.emit("unpipe",this,Z),this);if(!W){var te=Y.pipes,q=Y.pipesCount;Y.pipes=null,Y.pipesCount=0,Y.flowing=!1;for(var X=0;X<q;X++)te[X].emit("unpipe",this,Z);return this}var re=F(Y.pipes,W);return re===-1?this:(Y.pipes.splice(re,1),Y.pipesCount-=1,Y.pipesCount===1&&(Y.pipes=Y.pipes[0]),W.emit("unpipe",this,Z),this)},b.prototype.on=function(W,Y){var Z=p.prototype.on.call(this,W,Y);if(W==="data")this._readableState.flowing!==!1&&this.resume();else if(W==="readable"){var te=this._readableState;!te.endEmitted&&!te.readableListening&&(te.readableListening=te.needReadable=!0,te.emittedReadable=!1,te.reading?te.length&&V(this):g.nextTick(le,this))}return Z},b.prototype.addListener=b.prototype.on;function le(W){l("readable nexttick read 0"),W.read(0)}b.prototype.resume=function(){var W=this._readableState;return W.flowing||(l("resume"),W.flowing=!0,ue(this,W)),this};function ue(W,Y){Y.resumeScheduled||(Y.resumeScheduled=!0,g.nextTick(be,W,Y))}function be(W,Y){Y.reading||(l("resume read 0"),W.read(0)),Y.resumeScheduled=!1,Y.awaitDrain=0,W.emit("resume"),Ce(W),Y.flowing&&!Y.reading&&W.read(0)}b.prototype.pause=function(){return l("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(l("pause"),this._readableState.flowing=!1,this.emit("pause")),this};function Ce(W){var Y=W._readableState;for(l("flow",Y.flowing);Y.flowing&&W.read()!==null;);}b.prototype.wrap=function(W){var Y=this,Z=this._readableState,te=!1;W.on("end",function(){if(l("wrapped end"),Z.decoder&&!Z.ended){var re=Z.decoder.end();re&&re.length&&Y.push(re)}Y.push(null)}),W.on("data",function(re){if(l("wrapped data"),Z.decoder&&(re=Z.decoder.write(re)),Z.objectMode&&re==null)return;if(!Z.objectMode&&(!re||!re.length))return;var me=Y.push(re);me||(te=!0,W.pause())});for(var q in W)this[q]===void 0&&typeof W[q]=="function"&&(this[q]=function(re){return function(){return W[re].apply(W,arguments)}}(q));for(var X=0;X<R.length;X++)W.on(R[X],this.emit.bind(this,R[X]));return this._read=function(re){l("wrapped _read",re),te&&(te=!1,W.resume())},this},Object.defineProperty(b.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),b._fromList=se;function se(W,Y){if(Y.length===0)return null;var Z;return Y.objectMode?Z=Y.buffer.shift():!W||W>=Y.length?(Y.decoder?Z=Y.buffer.join(""):Y.buffer.length===1?Z=Y.buffer.head.data:Z=Y.buffer.concat(Y.length),Y.buffer.clear()):Z=ce(W,Y.buffer,Y.decoder),Z}function ce(W,Y,Z){var te;return W<Y.head.data.length?(te=Y.head.data.slice(0,W),Y.head.data=Y.head.data.slice(W)):W===Y.head.data.length?te=Y.shift():te=Z?he(W,Y):ae(W,Y),te}function he(W,Y){var Z=Y.head,te=1,q=Z.data;for(W-=q.length;Z=Z.next;){var X=Z.data,re=W>X.length?X.length:W;if(re===X.length?q+=X:q+=X.slice(0,W),W-=re,W===0){re===X.length?(++te,Z.next?Y.head=Z.next:Y.head=Y.tail=null):(Y.head=Z,Z.data=X.slice(re));break}++te}return Y.length-=te,q}function ae(W,Y){var Z=m.allocUnsafe(W),te=Y.head,q=1;for(te.data.copy(Z),W-=te.data.length;te=te.next;){var X=te.data,re=W>X.length?X.length:W;if(X.copy(Z,Z.length-W,0,re),W-=re,W===0){re===X.length?(++q,te.next?Y.head=te.next:Y.head=Y.tail=null):(Y.head=te,te.data=X.slice(re));break}++q}return Y.length-=q,Z}function Q(W){var Y=W._readableState;if(Y.length>0)throw new Error('"endReadable()" called on non-empty stream');Y.endEmitted||(Y.ended=!0,g.nextTick(D,Y,W))}function D(W,Y){!W.endEmitted&&W.length===0&&(W.endEmitted=!0,Y.readable=!1,Y.emit("end"))}function F(W,Y){for(var Z=0,te=W.length;Z<te;Z++)if(W[Z]===Y)return Z;return-1}}).call(this,M("_process"),typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"./_stream_duplex":214,"./internal/streams/BufferList":219,"./internal/streams/destroy":220,"./internal/streams/stream":221,_process:208,"babel-runtime/core-js/object/create":55,"babel-runtime/core-js/object/get-prototype-of":59,"core-util-is":189,events:192,inherits:196,isarray:198,"process-nextick-args":207,"safe-buffer":228,"string_decoder/":235,util:71}],217:[function(M,ne,N){"use strict";var I=M("babel-runtime/core-js/object/create"),h=S(I);function S(a){return a&&a.__esModule?a:{default:a}}ne.exports=C;var L=M("./_stream_duplex"),T=(0,h.default)(M("core-util-is"));T.inherits=M("inherits"),T.inherits(C,L);function c(a,r){var f=this._transformState;f.transforming=!1;var p=f.writecb;if(!p)return this.emit("error",new Error("write callback called multiple times"));f.writechunk=null,f.writecb=null,r!=null&&this.push(r),p(a);var m=this._readableState;m.reading=!1,(m.needReadable||m.length<m.highWaterMark)&&this._read(m.highWaterMark)}function C(a){if(!(this instanceof C))return new C(a);L.call(this,a),this._transformState={afterTransform:c.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",g)}function g(){var a=this;typeof this._flush=="function"?this._flush(function(r,f){s(a,r,f)}):s(this,null,null)}C.prototype.push=function(a,r){return this._transformState.needTransform=!1,L.prototype.push.call(this,a,r)},C.prototype._transform=function(a,r,f){throw new Error("_transform() is not implemented")},C.prototype._write=function(a,r,f){var p=this._transformState;if(p.writecb=f,p.writechunk=a,p.writeencoding=r,!p.transforming){var m=this._readableState;(p.needTransform||m.needReadable||m.length<m.highWaterMark)&&this._read(m.highWaterMark)}},C.prototype._read=function(a){var r=this._transformState;r.writechunk!==null&&r.writecb&&!r.transforming?(r.transforming=!0,this._transform(r.writechunk,r.writeencoding,r.afterTransform)):r.needTransform=!0},C.prototype._destroy=function(a,r){var f=this;L.prototype._destroy.call(this,a,function(p){r(p),f.emit("close")})};function s(a,r,f){if(r)return a.emit("error",r);if(f!=null&&a.push(f),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)}},{"./_stream_duplex":214,"babel-runtime/core-js/object/create":55,"core-util-is":189,inherits:196}],218:[function(M,ne,N){(function(I,h){"use strict";var S=M("babel-runtime/core-js/object/define-property"),L=p(S),T=M("babel-runtime/core-js/symbol/has-instance"),c=p(T),C=M("babel-runtime/core-js/symbol"),g=p(C),s=M("babel-runtime/core-js/object/create"),a=p(s),r=M("babel-runtime/core-js/set-immediate"),f=p(r);function p(ae){return ae&&ae.__esModule?ae:{default:ae}}var m=M("process-nextick-args");ne.exports=B;function E(ae,Q,D){this.chunk=ae,this.encoding=Q,this.callback=D,this.next=null}function y(ae){var Q=this;this.next=null,this.entry=null,this.finish=function(){he(Q,ae)}}var u=!I.browser&&["v0.10","v0.9."].indexOf(I.version.slice(0,5))>-1?f.default:m.nextTick,n;B.WritableState=x;var o=(0,a.default)(M("core-util-is"));o.inherits=M("inherits");var l={deprecate:M("util-deprecate")},w=M("./internal/streams/stream"),v=M("safe-buffer").Buffer,i=h.Uint8Array||function(){};function R(ae){return v.from(ae)}function k(ae){return v.isBuffer(ae)||ae instanceof i}var d=M("./internal/streams/destroy");o.inherits(B,w);function b(){}function x(ae,Q){n=n||M("./_stream_duplex"),ae=ae||{};var D=Q instanceof n;this.objectMode=!!ae.objectMode,D&&(this.objectMode=this.objectMode||!!ae.writableObjectMode);var F=ae.highWaterMark,W=ae.writableHighWaterMark,Y=this.objectMode?16:16*1024;F||F===0?this.highWaterMark=F:D&&(W||W===0)?this.highWaterMark=W:this.highWaterMark=Y,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 Z=ae.decodeStrings===!1;this.decodeStrings=!Z,this.defaultEncoding=ae.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(te){H(Q,te)},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 y(this)}x.prototype.getBuffer=function(){for(var Q=this.bufferedRequest,D=[];Q;)D.push(Q),Q=Q.next;return D},function(){try{Object.defineProperty(x.prototype,"buffer",{get:l.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(ae){}}();var _;typeof g.default=="function"&&c.default&&typeof Function.prototype[c.default]=="function"?(_=Function.prototype[c.default],(0,L.default)(B,c.default,{value:function(Q){return _.call(this,Q)?!0:this!==B?!1:Q&&Q._writableState instanceof x}})):_=function(Q){return Q instanceof this};function B(ae){if(n=n||M("./_stream_duplex"),!_.call(B,this)&&!(this instanceof n))return new B(ae);this._writableState=new x(ae,this),this.writable=!0,ae&&(typeof ae.write=="function"&&(this._write=ae.write),typeof ae.writev=="function"&&(this._writev=ae.writev),typeof ae.destroy=="function"&&(this._destroy=ae.destroy),typeof ae.final=="function"&&(this._final=ae.final)),w.call(this)}B.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function U(ae,Q){var D=new Error("write after end");ae.emit("error",D),m.nextTick(Q,D)}function P(ae,Q,D,F){var W=!0,Y=!1;return D===null?Y=new TypeError("May not write null values to stream"):typeof D!="string"&&D!==void 0&&!Q.objectMode&&(Y=new TypeError("Invalid non-string/buffer chunk")),Y&&(ae.emit("error",Y),m.nextTick(F,Y),W=!1),W}B.prototype.write=function(ae,Q,D){var F=this._writableState,W=!1,Y=!F.objectMode&&k(ae);return Y&&!v.isBuffer(ae)&&(ae=R(ae)),typeof Q=="function"&&(D=Q,Q=null),Y?Q="buffer":Q||(Q=F.defaultEncoding),typeof D!="function"&&(D=b),F.ended?U(this,D):(Y||P(this,F,ae,D))&&(F.pendingcb++,W=$(this,F,Y,ae,Q,D)),W},B.prototype.cork=function(){var ae=this._writableState;ae.corked++},B.prototype.uncork=function(){var ae=this._writableState;ae.corked&&(ae.corked--,!ae.writing&&!ae.corked&&!ae.finished&&!ae.bufferProcessing&&ae.bufferedRequest&&le(this,ae))},B.prototype.setDefaultEncoding=function(Q){if(typeof Q=="string"&&(Q=Q.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((Q+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+Q);return this._writableState.defaultEncoding=Q,this};function J(ae,Q,D){return!ae.objectMode&&ae.decodeStrings!==!1&&typeof Q=="string"&&(Q=v.from(Q,D)),Q}Object.defineProperty(B.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function $(ae,Q,D,F,W,Y){if(!D){var Z=J(Q,F,W);F!==Z&&(D=!0,W="buffer",F=Z)}var te=Q.objectMode?1:F.length;Q.length+=te;var q=Q.length<Q.highWaterMark;if(q||(Q.needDrain=!0),Q.writing||Q.corked){var X=Q.lastBufferedRequest;Q.lastBufferedRequest={chunk:F,encoding:W,isBuf:D,callback:Y,next:null},X?X.next=Q.lastBufferedRequest:Q.bufferedRequest=Q.lastBufferedRequest,Q.bufferedRequestCount+=1}else z(ae,Q,!1,te,F,W,Y);return q}function z(ae,Q,D,F,W,Y,Z){Q.writelen=F,Q.writecb=Z,Q.writing=!0,Q.sync=!0,D?ae._writev(W,Q.onwrite):ae._write(W,Y,Q.onwrite),Q.sync=!1}function V(ae,Q,D,F,W){--Q.pendingcb,D?(m.nextTick(W,F),m.nextTick(se,ae,Q),ae._writableState.errorEmitted=!0,ae.emit("error",F)):(W(F),ae._writableState.errorEmitted=!0,ae.emit("error",F),se(ae,Q))}function K(ae){ae.writing=!1,ae.writecb=null,ae.length-=ae.writelen,ae.writelen=0}function H(ae,Q){var D=ae._writableState,F=D.sync,W=D.writecb;if(K(D),Q)V(ae,D,F,Q,W);else{var Y=ue(D);!Y&&!D.corked&&!D.bufferProcessing&&D.bufferedRequest&&le(ae,D),F?u(G,ae,D,Y,W):G(ae,D,Y,W)}}function G(ae,Q,D,F){D||ie(ae,Q),Q.pendingcb--,F(),se(ae,Q)}function ie(ae,Q){Q.length===0&&Q.needDrain&&(Q.needDrain=!1,ae.emit("drain"))}function le(ae,Q){Q.bufferProcessing=!0;var D=Q.bufferedRequest;if(ae._writev&&D&&D.next){var F=Q.bufferedRequestCount,W=new Array(F),Y=Q.corkedRequestsFree;Y.entry=D;for(var Z=0,te=!0;D;)W[Z]=D,D.isBuf||(te=!1),D=D.next,Z+=1;W.allBuffers=te,z(ae,Q,!0,Q.length,W,"",Y.finish),Q.pendingcb++,Q.lastBufferedRequest=null,Y.next?(Q.corkedRequestsFree=Y.next,Y.next=null):Q.corkedRequestsFree=new y(Q),Q.bufferedRequestCount=0}else{for(;D;){var q=D.chunk,X=D.encoding,re=D.callback,me=Q.objectMode?1:q.length;if(z(ae,Q,!1,me,q,X,re),D=D.next,Q.bufferedRequestCount--,Q.writing)break}D===null&&(Q.lastBufferedRequest=null)}Q.bufferedRequest=D,Q.bufferProcessing=!1}B.prototype._write=function(ae,Q,D){D(new Error("_write() is not implemented"))},B.prototype._writev=null,B.prototype.end=function(ae,Q,D){var F=this._writableState;typeof ae=="function"?(D=ae,ae=null,Q=null):typeof Q=="function"&&(D=Q,Q=null),ae!=null&&this.write(ae,Q),F.corked&&(F.corked=1,this.uncork()),!F.ending&&!F.finished&&ce(this,F,D)};function ue(ae){return ae.ending&&ae.length===0&&ae.bufferedRequest===null&&!ae.finished&&!ae.writing}function be(ae,Q){ae._final(function(D){Q.pendingcb--,D&&ae.emit("error",D),Q.prefinished=!0,ae.emit("prefinish"),se(ae,Q)})}function Ce(ae,Q){!Q.prefinished&&!Q.finalCalled&&(typeof ae._final=="function"?(Q.pendingcb++,Q.finalCalled=!0,m.nextTick(be,ae,Q)):(Q.prefinished=!0,ae.emit("prefinish")))}function se(ae,Q){var D=ue(Q);return D&&(Ce(ae,Q),Q.pendingcb===0&&(Q.finished=!0,ae.emit("finish"))),D}function ce(ae,Q,D){Q.ending=!0,se(ae,Q),D&&(Q.finished?m.nextTick(D):ae.once("finish",D)),Q.ended=!0,ae.writable=!1}function he(ae,Q,D){var F=ae.entry;for(ae.entry=null;F;){var W=F.callback;Q.pendingcb--,W(D),F=F.next}Q.corkedRequestsFree?Q.corkedRequestsFree.next=ae:Q.corkedRequestsFree=ae}Object.defineProperty(B.prototype,"destroyed",{get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(Q){if(!this._writableState)return;this._writableState.destroyed=Q}}),B.prototype.destroy=d.destroy,B.prototype._undestroy=d.undestroy,B.prototype._destroy=function(ae,Q){this.end(),Q(ae)}}).call(this,M("_process"),typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"./_stream_duplex":214,"./internal/streams/destroy":220,"./internal/streams/stream":221,_process:208,"babel-runtime/core-js/object/create":55,"babel-runtime/core-js/object/define-property":56,"babel-runtime/core-js/set-immediate":62,"babel-runtime/core-js/symbol":64,"babel-runtime/core-js/symbol/has-instance":65,"core-util-is":189,inherits:196,"process-nextick-args":207,"safe-buffer":228,"util-deprecate":240}],219:[function(M,ne,N){"use strict";function I(T,c){if(!(T instanceof c))throw new TypeError("Cannot call a class as a function")}var h=M("safe-buffer").Buffer,S=M("util");function L(T,c,C){T.copy(c,C)}ne.exports=function(){function T(){I(this,T),this.head=null,this.tail=null,this.length=0}return T.prototype.push=function(C){var g={data:C,next:null};this.length>0?this.tail.next=g:this.head=g,this.tail=g,++this.length},T.prototype.unshift=function(C){var g={data:C,next:this.head};this.length===0&&(this.tail=g),this.head=g,++this.length},T.prototype.shift=function(){if(this.length===0)return;var C=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,C},T.prototype.clear=function(){this.head=this.tail=null,this.length=0},T.prototype.join=function(C){if(this.length===0)return"";for(var g=this.head,s=""+g.data;g=g.next;)s+=C+g.data;return s},T.prototype.concat=function(C){if(this.length===0)return h.alloc(0);if(this.length===1)return this.head.data;for(var g=h.allocUnsafe(C>>>0),s=this.head,a=0;s;)L(s.data,g,a),a+=s.data.length,s=s.next;return g},T}(),S&&S.inspect&&S.inspect.custom&&(ne.exports.prototype[S.inspect.custom]=function(){var T=S.inspect({length:this.length});return this.constructor.name+" "+T})},{"safe-buffer":228,util:71}],220:[function(M,ne,N){"use strict";var I=M("process-nextick-args");function h(T,c){var C=this,g=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return g||s?(c?c(T):T&&(!this._writableState||!this._writableState.errorEmitted)&&I.nextTick(L,this,T),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(T||null,function(a){!c&&a?(I.nextTick(L,C,a),C._writableState&&(C._writableState.errorEmitted=!0)):c&&c(a)}),this)}function S(){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 L(T,c){T.emit("error",c)}ne.exports={destroy:h,undestroy:S}},{"process-nextick-args":207}],221:[function(M,ne,N){"use strict";ne.exports=M("events").EventEmitter},{events:192}],222:[function(M,ne,N){ne.exports=M("./readable").PassThrough},{"./readable":223}],223:[function(M,ne,N){N=ne.exports=M("./lib/_stream_readable.js"),N.Stream=N,N.Readable=N,N.Writable=M("./lib/_stream_writable.js"),N.Duplex=M("./lib/_stream_duplex.js"),N.Transform=M("./lib/_stream_transform.js"),N.PassThrough=M("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":214,"./lib/_stream_passthrough.js":215,"./lib/_stream_readable.js":216,"./lib/_stream_transform.js":217,"./lib/_stream_writable.js":218}],224:[function(M,ne,N){ne.exports=M("./readable").Transform},{"./readable":223}],225:[function(M,ne,N){ne.exports=M("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":218}],226:[function(M,ne,N){var I=function(){return this}()||Function("return this")(),h=I.regeneratorRuntime&&Object.getOwnPropertyNames(I).indexOf("regeneratorRuntime")>=0,S=h&&I.regeneratorRuntime;if(I.regeneratorRuntime=void 0,ne.exports=M("./runtime"),h)I.regeneratorRuntime=S;else try{delete I.regeneratorRuntime}catch(L){I.regeneratorRuntime=void 0}},{"./runtime":227}],227:[function(M,ne,N){!function(I){"use strict";var h=Object.prototype,S=h.hasOwnProperty,L,T=typeof Symbol=="function"?Symbol:{},c=T.iterator||"@@iterator",C=T.asyncIterator||"@@asyncIterator",g=T.toStringTag||"@@toStringTag",s=typeof ne=="object",a=I.regeneratorRuntime;if(a){s&&(ne.exports=a);return}a=I.regeneratorRuntime=s?ne.exports:{};function r($,z,V,K){var H=z&&z.prototype instanceof n?z:n,G=Object.create(H.prototype),ie=new U(K||[]);return G._invoke=b($,V,ie),G}a.wrap=r;function f($,z,V){try{return{type:"normal",arg:$.call(z,V)}}catch(K){return{type:"throw",arg:K}}}var p="suspendedStart",m="suspendedYield",E="executing",y="completed",u={};function n(){}function o(){}function l(){}var w={};w[c]=function(){return this};var v=Object.getPrototypeOf,i=v&&v(v(P([])));i&&i!==h&&S.call(i,c)&&(w=i);var R=l.prototype=n.prototype=Object.create(w);o.prototype=R.constructor=l,l.constructor=o,l[g]=o.displayName="GeneratorFunction";function k($){["next","throw","return"].forEach(function(z){$[z]=function(V){return this._invoke(z,V)}})}a.isGeneratorFunction=function($){var z=typeof $=="function"&&$.constructor;return z?z===o||(z.displayName||z.name)==="GeneratorFunction":!1},a.mark=function($){return Object.setPrototypeOf?Object.setPrototypeOf($,l):($.__proto__=l,g in $||($[g]="GeneratorFunction")),$.prototype=Object.create(R),$},a.awrap=function($){return{__await:$}};function d($){function z(H,G,ie,le){var ue=f($[H],$,G);if(ue.type==="throw")le(ue.arg);else{var be=ue.arg,Ce=be.value;return Ce&&typeof Ce=="object"&&S.call(Ce,"__await")?Promise.resolve(Ce.__await).then(function(se){z("next",se,ie,le)},function(se){z("throw",se,ie,le)}):Promise.resolve(Ce).then(function(se){be.value=se,ie(be)},le)}}var V;function K(H,G){function ie(){return new Promise(function(le,ue){z(H,G,le,ue)})}return V=V?V.then(ie,ie):ie()}this._invoke=K}k(d.prototype),d.prototype[C]=function(){return this},a.AsyncIterator=d,a.async=function($,z,V,K){var H=new d(r($,z,V,K));return a.isGeneratorFunction(z)?H:H.next().then(function(G){return G.done?G.value:H.next()})};function b($,z,V){var K=p;return function(G,ie){if(K===E)throw new Error("Generator is already running");if(K===y){if(G==="throw")throw ie;return J()}for(V.method=G,V.arg=ie;;){var le=V.delegate;if(le){var ue=x(le,V);if(ue){if(ue===u)continue;return ue}}if(V.method==="next")V.sent=V._sent=V.arg;else if(V.method==="throw"){if(K===p)throw K=y,V.arg;V.dispatchException(V.arg)}else V.method==="return"&&V.abrupt("return",V.arg);K=E;var be=f($,z,V);if(be.type==="normal"){if(K=V.done?y:m,be.arg===u)continue;return{value:be.arg,done:V.done}}else be.type==="throw"&&(K=y,V.method="throw",V.arg=be.arg)}}}function x($,z){var V=$.iterator[z.method];if(V===L){if(z.delegate=null,z.method==="throw"){if($.iterator.return&&(z.method="return",z.arg=L,x($,z),z.method==="throw"))return u;z.method="throw",z.arg=new TypeError("The iterator does not provide a 'throw' method")}return u}var K=f(V,$.iterator,z.arg);if(K.type==="throw")return z.method="throw",z.arg=K.arg,z.delegate=null,u;var H=K.arg;if(!H)return z.method="throw",z.arg=new TypeError("iterator result is not an object"),z.delegate=null,u;if(H.done)z[$.resultName]=H.value,z.next=$.nextLoc,z.method!=="return"&&(z.method="next",z.arg=L);else return H;return z.delegate=null,u}k(R),R[g]="Generator",R[c]=function(){return this},R.toString=function(){return"[object Generator]"};function _($){var z={tryLoc:$[0]};1 in $&&(z.catchLoc=$[1]),2 in $&&(z.finallyLoc=$[2],z.afterLoc=$[3]),this.tryEntries.push(z)}function B($){var z=$.completion||{};z.type="normal",delete z.arg,$.completion=z}function U($){this.tryEntries=[{tryLoc:"root"}],$.forEach(_,this),this.reset(!0)}a.keys=function($){var z=[];for(var V in $)z.push(V);return z.reverse(),function K(){for(;z.length;){var H=z.pop();if(H in $)return K.value=H,K.done=!1,K}return K.done=!0,K}};function P($){if($){var z=$[c];if(z)return z.call($);if(typeof $.next=="function")return $;if(!isNaN($.length)){var V=-1,K=function H(){for(;++V<$.length;)if(S.call($,V))return H.value=$[V],H.done=!1,H;return H.value=L,H.done=!0,H};return K.next=K}}return{next:J}}a.values=P;function J(){return{value:L,done:!0}}U.prototype={constructor:U,reset:function($){if(this.prev=0,this.next=0,this.sent=this._sent=L,this.done=!1,this.delegate=null,this.method="next",this.arg=L,this.tryEntries.forEach(B),!$)for(var z in this)z.charAt(0)==="t"&&S.call(this,z)&&!isNaN(+z.slice(1))&&(this[z]=L)},stop:function(){this.done=!0;var $=this.tryEntries[0],z=$.completion;if(z.type==="throw")throw z.arg;return this.rval},dispatchException:function($){if(this.done)throw $;var z=this;function V(ue,be){return G.type="throw",G.arg=$,z.next=ue,be&&(z.method="next",z.arg=L),!!be}for(var K=this.tryEntries.length-1;K>=0;--K){var H=this.tryEntries[K],G=H.completion;if(H.tryLoc==="root")return V("end");if(H.tryLoc<=this.prev){var ie=S.call(H,"catchLoc"),le=S.call(H,"finallyLoc");if(ie&&le){if(this.prev<H.catchLoc)return V(H.catchLoc,!0);if(this.prev<H.finallyLoc)return V(H.finallyLoc)}else if(ie){if(this.prev<H.catchLoc)return V(H.catchLoc,!0)}else if(le){if(this.prev<H.finallyLoc)return V(H.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function($,z){for(var V=this.tryEntries.length-1;V>=0;--V){var K=this.tryEntries[V];if(K.tryLoc<=this.prev&&S.call(K,"finallyLoc")&&this.prev<K.finallyLoc){var H=K;break}}H&&($==="break"||$==="continue")&&H.tryLoc<=z&&z<=H.finallyLoc&&(H=null);var G=H?H.completion:{};return G.type=$,G.arg=z,H?(this.method="next",this.next=H.finallyLoc,u):this.complete(G)},complete:function($,z){if($.type==="throw")throw $.arg;return $.type==="break"||$.type==="continue"?this.next=$.arg:$.type==="return"?(this.rval=this.arg=$.arg,this.method="return",this.next="end"):$.type==="normal"&&z&&(this.next=z),u},finish:function($){for(var z=this.tryEntries.length-1;z>=0;--z){var V=this.tryEntries[z];if(V.finallyLoc===$)return this.complete(V.completion,V.afterLoc),B(V),u}},catch:function($){for(var z=this.tryEntries.length-1;z>=0;--z){var V=this.tryEntries[z];if(V.tryLoc===$){var K=V.completion;if(K.type==="throw"){var H=K.arg;B(V)}return H}}throw new Error("illegal catch attempt")},delegateYield:function($,z,V){return this.delegate={iterator:P($),resultName:z,nextLoc:V},this.method==="next"&&(this.arg=L),u}}}(function(){return this}()||Function("return this")())},{}],228:[function(M,ne,N){var I=M("buffer"),h=I.Buffer;function S(T,c){for(var C in T)c[C]=T[C]}h.from&&h.alloc&&h.allocUnsafe&&h.allocUnsafeSlow?ne.exports=I:(S(I,N),N.Buffer=L);function L(T,c,C){return h(T,c,C)}S(h,L),L.from=function(T,c,C){if(typeof T=="number")throw new TypeError("Argument must not be a number");return h(T,c,C)},L.alloc=function(T,c,C){if(typeof T!="number")throw new TypeError("Argument must be a number");var g=h(T);return c!==void 0?typeof C=="string"?g.fill(c,C):g.fill(c):g.fill(0),g},L.allocUnsafe=function(T){if(typeof T!="number")throw new TypeError("Argument must be a number");return h(T)},L.allocUnsafeSlow=function(T){if(typeof T!="number")throw new TypeError("Argument must be a number");return I.SlowBuffer(T)}},{buffer:73}],229:[function(M,ne,N){(function(I){"use strict";var h=M("babel-runtime/core-js/string/from-code-point"),S=m(h),L=M("babel-runtime/core-js/json/stringify"),T=m(L),c=M("babel-runtime/helpers/typeof"),C=m(c),g=M("babel-runtime/core-js/object/define-property"),s=m(g),a=M("babel-runtime/core-js/object/keys"),r=m(a),f=M("babel-runtime/core-js/object/create"),p=m(f);function m(E){return E&&E.__esModule?E:{default:E}}(function(E){E.parser=function(X,re){return new u(X,re)},E.SAXParser=u,E.SAXStream=R,E.createStream=i,E.MAX_BUFFER_LENGTH=64*1024;var y=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];E.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"];function u(X,re){if(!(this instanceof u))return new u(X,re);var me=this;o(me),me.q=me.c="",me.bufferCheckPosition=E.MAX_BUFFER_LENGTH,me.opt=re||{},me.opt.lowercase=me.opt.lowercase||me.opt.lowercasetags,me.looseCase=me.opt.lowercase?"toLowerCase":"toUpperCase",me.tags=[],me.closed=me.closedRoot=me.sawRoot=!1,me.tag=me.error=null,me.strict=!!X,me.noscript=!!(X||me.opt.noscript),me.state=G.BEGIN,me.strictEntities=me.opt.strictEntities,me.ENTITIES=me.strictEntities?(0,p.default)(E.XML_ENTITIES):(0,p.default)(E.ENTITIES),me.attribList=[],me.opt.xmlns&&(me.ns=(0,p.default)(_)),me.trackPosition=me.opt.position!==!1,me.trackPosition&&(me.position=me.line=me.column=0),le(me,"onready")}p.default||(Object.create=function(X){function re(){}re.prototype=X;var me=new re;return me}),r.default||(Object.keys=function(X){var re=[];for(var me in X)X.hasOwnProperty(me)&&re.push(me);return re});function n(X){for(var re=Math.max(E.MAX_BUFFER_LENGTH,10),me=0,ve=0,Te=y.length;ve<Te;ve++){var Re=X[y[ve]].length;if(Re>re)switch(y[ve]){case"textNode":be(X);break;case"cdata":ue(X,"oncdata",X.cdata),X.cdata="";break;case"script":ue(X,"onscript",X.script),X.script="";break;default:se(X,"Max buffer length exceeded: "+y[ve])}me=Math.max(me,Re)}var Ie=E.MAX_BUFFER_LENGTH-me;X.bufferCheckPosition=Ie+X.position}function o(X){for(var re=0,me=y.length;re<me;re++)X[y[re]]=""}function l(X){be(X),X.cdata!==""&&(ue(X,"oncdata",X.cdata),X.cdata=""),X.script!==""&&(ue(X,"onscript",X.script),X.script="")}u.prototype={end:function(){ce(this)},write:q,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){l(this)}};var w;try{w=M("stream").Stream}catch(X){w=function(){}}var v=E.EVENTS.filter(function(X){return X!=="error"&&X!=="end"});function i(X,re){return new R(X,re)}function R(X,re){if(!(this instanceof R))return new R(X,re);w.apply(this),this._parser=new u(X,re),this.writable=!0,this.readable=!0;var me=this;this._parser.onend=function(){me.emit("end")},this._parser.onerror=function(ve){me.emit("error",ve),me._parser.error=null},this._decoder=null,v.forEach(function(ve){(0,s.default)(me,"on"+ve,{get:function(){return me._parser["on"+ve]},set:function(Re){if(!Re)return me.removeAllListeners(ve),me._parser["on"+ve]=Re,Re;me.on(ve,Re)},enumerable:!0,configurable:!1})})}R.prototype=(0,p.default)(w.prototype,{constructor:{value:R}}),R.prototype.write=function(X){if(typeof I=="function"&&typeof I.isBuffer=="function"&&I.isBuffer(X)){if(!this._decoder){var re=M("string_decoder").StringDecoder;this._decoder=new re("utf8")}X=this._decoder.write(X)}return this._parser.write(X.toString()),this.emit("data",X),!0},R.prototype.end=function(X){return X&&X.length&&this.write(X),this._parser.end(),!0},R.prototype.on=function(X,re){var me=this;return!me._parser["on"+X]&&v.indexOf(X)!==-1&&(me._parser["on"+X]=function(){var ve=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);ve.splice(0,0,X),me.emit.apply(me,ve)}),w.prototype.on.call(me,X,re)};var k="[CDATA[",d="DOCTYPE",b="http://www.w3.org/XML/1998/namespace",x="http://www.w3.org/2000/xmlns/",_={xml:b,xmlns:x},B=/[:_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]/,U=/[:_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-]/,P=/[#:_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]/,J=/[#:_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-]/;function $(X){return X===" "||X===`
`||X==="\r"||X===" "}function z(X){return X==='"'||X==="'"}function V(X){return X===">"||$(X)}function K(X,re){return X.test(re)}function H(X,re){return!K(X,re)}var G=0;E.STATE={BEGIN:G++,BEGIN_WHITESPACE:G++,TEXT:G++,TEXT_ENTITY:G++,OPEN_WAKA:G++,SGML_DECL:G++,SGML_DECL_QUOTED:G++,DOCTYPE:G++,DOCTYPE_QUOTED:G++,DOCTYPE_DTD:G++,DOCTYPE_DTD_QUOTED:G++,COMMENT_STARTING:G++,COMMENT:G++,COMMENT_ENDING:G++,COMMENT_ENDED:G++,CDATA:G++,CDATA_ENDING:G++,CDATA_ENDING_2:G++,PROC_INST:G++,PROC_INST_BODY:G++,PROC_INST_ENDING:G++,OPEN_TAG:G++,OPEN_TAG_SLASH:G++,ATTRIB:G++,ATTRIB_NAME:G++,ATTRIB_NAME_SAW_WHITE:G++,ATTRIB_VALUE:G++,ATTRIB_VALUE_QUOTED:G++,ATTRIB_VALUE_CLOSED:G++,ATTRIB_VALUE_UNQUOTED:G++,ATTRIB_VALUE_ENTITY_Q:G++,ATTRIB_VALUE_ENTITY_U:G++,CLOSE_TAG:G++,CLOSE_TAG_SAW_WHITE:G++,SCRIPT:G++,SCRIPT_ENDING:G++},E.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},E.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,r.default)(E.ENTITIES).forEach(function(X){var re=E.ENTITIES[X],me=typeof re=="number"?String.fromCharCode(re):re;E.ENTITIES[X]=me});for(var ie in E.STATE)E.STATE[E.STATE[ie]]=ie;G=E.STATE;function le(X,re,me){X[re]&&X[re](me)}function ue(X,re,me){X.textNode&&be(X),le(X,re,me)}function be(X){X.textNode=Ce(X.opt,X.textNode),X.textNode&&le(X,"ontext",X.textNode),X.textNode=""}function Ce(X,re){return X.trim&&(re=re.trim()),X.normalize&&(re=re.replace(/\s+/g," ")),re}function se(X,re){return be(X),X.trackPosition&&(re+=`
Line: `+X.line+`
Column: `+X.column+`
Char: `+X.c),re=new Error(re),X.error=re,le(X,"onerror",re),X}function ce(X){return X.sawRoot&&!X.closedRoot&&he(X,"Unclosed root tag"),X.state!==G.BEGIN&&X.state!==G.BEGIN_WHITESPACE&&X.state!==G.TEXT&&se(X,"Unexpected end"),be(X),X.c="",X.closed=!0,le(X,"onend"),u.call(X,X.strict,X.opt),X}function he(X,re){if((typeof X=="undefined"?"undefined":(0,C.default)(X))!=="object"||!(X instanceof u))throw new Error("bad call to strictFail");X.strict&&se(X,re)}function ae(X){X.strict||(X.tagName=X.tagName[X.looseCase]());var re=X.tags[X.tags.length-1]||X,me=X.tag={name:X.tagName,attributes:{}};X.opt.xmlns&&(me.ns=re.ns),X.attribList.length=0,ue(X,"onopentagstart",me)}function Q(X,re){var me=X.indexOf(":"),ve=me<0?["",X]:X.split(":"),Te=ve[0],Re=ve[1];return re&&X==="xmlns"&&(Te="xmlns",Re=""),{prefix:Te,local:Re}}function D(X){if(X.strict||(X.attribName=X.attribName[X.looseCase]()),X.attribList.indexOf(X.attribName)!==-1||X.tag.attributes.hasOwnProperty(X.attribName)){X.attribName=X.attribValue="";return}if(X.opt.xmlns){var re=Q(X.attribName,!0),me=re.prefix,ve=re.local;if(me==="xmlns")if(ve==="xml"&&X.attribValue!==b)he(X,"xml: prefix must be bound to "+b+`
Actual: `+X.attribValue);else if(ve==="xmlns"&&X.attribValue!==x)he(X,"xmlns: prefix must be bound to "+x+`
Actual: `+X.attribValue);else{var Te=X.tag,Re=X.tags[X.tags.length-1]||X;Te.ns===Re.ns&&(Te.ns=(0,p.default)(Re.ns)),Te.ns[ve]=X.attribValue}X.attribList.push([X.attribName,X.attribValue])}else X.tag.attributes[X.attribName]=X.attribValue,ue(X,"onattribute",{name:X.attribName,value:X.attribValue});X.attribName=X.attribValue=""}function F(X,re){if(X.opt.xmlns){var me=X.tag,ve=Q(X.tagName);me.prefix=ve.prefix,me.local=ve.local,me.uri=me.ns[ve.prefix]||"",me.prefix&&!me.uri&&(he(X,"Unbound namespace prefix: "+(0,T.default)(X.tagName)),me.uri=ve.prefix);var Te=X.tags[X.tags.length-1]||X;me.ns&&Te.ns!==me.ns&&(0,r.default)(me.ns).forEach(function(we){ue(X,"onopennamespace",{prefix:we,uri:me.ns[we]})});for(var Re=0,Ie=X.attribList.length;Re<Ie;Re++){var je=X.attribList[Re],Ne=je[0],We=je[1],Be=Q(Ne,!0),He=Be.prefix,De=Be.local,Xe=He===""?"":me.ns[He]||"",$e={name:Ne,value:We,prefix:He,local:De,uri:Xe};He&&He!=="xmlns"&&!Xe&&(he(X,"Unbound namespace prefix: "+(0,T.default)(He)),$e.uri=He),X.tag.attributes[Ne]=$e,ue(X,"onattribute",$e)}X.attribList.length=0}X.tag.isSelfClosing=!!re,X.sawRoot=!0,X.tags.push(X.tag),ue(X,"onopentag",X.tag),re||(!X.noscript&&X.tagName.toLowerCase()==="script"?X.state=G.SCRIPT:X.state=G.TEXT,X.tag=null,X.tagName=""),X.attribName=X.attribValue="",X.attribList.length=0}function W(X){if(!X.tagName){he(X,"Weird empty close tag."),X.textNode+="</>",X.state=G.TEXT;return}if(X.script){if(X.tagName!=="script"){X.script+="</"+X.tagName+">",X.tagName="",X.state=G.SCRIPT;return}ue(X,"onscript",X.script),X.script=""}var re=X.tags.length,me=X.tagName;X.strict||(me=me[X.looseCase]());for(var ve=me;re--;){var Te=X.tags[re];if(Te.name!==ve)he(X,"Unexpected close tag");else break}if(re<0){he(X,"Unmatched closing tag: "+X.tagName),X.textNode+="</"+X.tagName+">",X.state=G.TEXT;return}X.tagName=me;for(var Re=X.tags.length;Re-- >re;){var Ie=X.tag=X.tags.pop();X.tagName=X.tag.name,ue(X,"onclosetag",X.tagName);var je={};for(var Ne in Ie.ns)je[Ne]=Ie.ns[Ne];var We=X.tags[X.tags.length-1]||X;X.opt.xmlns&&Ie.ns!==We.ns&&(0,r.default)(Ie.ns).forEach(function(Be){var He=Ie.ns[Be];ue(X,"onclosenamespace",{prefix:Be,uri:He})})}re===0&&(X.closedRoot=!0),X.tagName=X.attribValue=X.attribName="",X.attribList.length=0,X.state=G.TEXT}function Y(X){var re=X.entity,me=re.toLowerCase(),ve,Te="";return X.ENTITIES[re]?X.ENTITIES[re]:X.ENTITIES[me]?X.ENTITIES[me]:(re=me,re.charAt(0)==="#"&&(re.charAt(1)==="x"?(re=re.slice(2),ve=parseInt(re,16),Te=ve.toString(16)):(re=re.slice(1),ve=parseInt(re,10),Te=ve.toString(10))),re=re.replace(/^0+/,""),isNaN(ve)||Te.toLowerCase()!==re?(he(X,"Invalid character entity"),"&"+X.entity+";"):(0,S.default)(ve))}function Z(X,re){re==="<"?(X.state=G.OPEN_WAKA,X.startTagPosition=X.position):$(re)||(he(X,"Non-whitespace before first tag."),X.textNode=re,X.state=G.TEXT)}function te(X,re){var me="";return re<X.length&&(me=X.charAt(re)),me}function q(X){var re=this;if(this.error)throw this.error;if(re.closed)return se(re,"Cannot write after close. Assign an onready handler.");if(X===null)return ce(re);(typeof X=="undefined"?"undefined":(0,C.default)(X))==="object"&&(X=X.toString());for(var me=0,ve="";!(ve=te(X,me++),re.c=ve,!ve);){re.trackPosition&&(re.position++,ve===`
`?(re.line++,re.column=0):re.column++);switch(re.state){case G.BEGIN:if(re.state=G.BEGIN_WHITESPACE,ve==="\uFEFF")continue;Z(re,ve);continue;case G.BEGIN_WHITESPACE:Z(re,ve);continue;case G.TEXT:if(re.sawRoot&&!re.closedRoot){for(var Te=me-1;ve&&ve!=="<"&&ve!=="&";)ve=te(X,me++),ve&&re.trackPosition&&(re.position++,ve===`
`?(re.line++,re.column=0):re.column++);re.textNode+=X.substring(Te,me-1)}ve==="<"&&!(re.sawRoot&&re.closedRoot&&!re.strict)?(re.state=G.OPEN_WAKA,re.startTagPosition=re.position):(!$(ve)&&(!re.sawRoot||re.closedRoot)&&he(re,"Text data outside of root node."),ve==="&"?re.state=G.TEXT_ENTITY:re.textNode+=ve);continue;case G.SCRIPT:ve==="<"?re.state=G.SCRIPT_ENDING:re.script+=ve;continue;case G.SCRIPT_ENDING:ve==="/"?re.state=G.CLOSE_TAG:(re.script+="<"+ve,re.state=G.SCRIPT);continue;case G.OPEN_WAKA:if(ve==="!")re.state=G.SGML_DECL,re.sgmlDecl="";else if(!$(ve))if(K(B,ve))re.state=G.OPEN_TAG,re.tagName=ve;else if(ve==="/")re.state=G.CLOSE_TAG,re.tagName="";else if(ve==="?")re.state=G.PROC_INST,re.procInstName=re.procInstBody="";else{if(he(re,"Unencoded <"),re.startTagPosition+1<re.position){var Re=re.position-re.startTagPosition;ve=new Array(Re).join(" ")+ve}re.textNode+="<"+ve,re.state=G.TEXT}continue;case G.SGML_DECL:(re.sgmlDecl+ve).toUpperCase()===k?(ue(re,"onopencdata"),re.state=G.CDATA,re.sgmlDecl="",re.cdata=""):re.sgmlDecl+ve==="--"?(re.state=G.COMMENT,re.comment="",re.sgmlDecl=""):(re.sgmlDecl+ve).toUpperCase()===d?(re.state=G.DOCTYPE,(re.doctype||re.sawRoot)&&he(re,"Inappropriately located doctype declaration"),re.doctype="",re.sgmlDecl=""):ve===">"?(ue(re,"onsgmldeclaration",re.sgmlDecl),re.sgmlDecl="",re.state=G.TEXT):(z(ve)&&(re.state=G.SGML_DECL_QUOTED),re.sgmlDecl+=ve);continue;case G.SGML_DECL_QUOTED:ve===re.q&&(re.state=G.SGML_DECL,re.q=""),re.sgmlDecl+=ve;continue;case G.DOCTYPE:ve===">"?(re.state=G.TEXT,ue(re,"ondoctype",re.doctype),re.doctype=!0):(re.doctype+=ve,ve==="["?re.state=G.DOCTYPE_DTD:z(ve)&&(re.state=G.DOCTYPE_QUOTED,re.q=ve));continue;case G.DOCTYPE_QUOTED:re.doctype+=ve,ve===re.q&&(re.q="",re.state=G.DOCTYPE);continue;case G.DOCTYPE_DTD:re.doctype+=ve,ve==="]"?re.state=G.DOCTYPE:z(ve)&&(re.state=G.DOCTYPE_DTD_QUOTED,re.q=ve);continue;case G.DOCTYPE_DTD_QUOTED:re.doctype+=ve,ve===re.q&&(re.state=G.DOCTYPE_DTD,re.q="");continue;case G.COMMENT:ve==="-"?re.state=G.COMMENT_ENDING:re.comment+=ve;continue;case G.COMMENT_ENDING:ve==="-"?(re.state=G.COMMENT_ENDED,re.comment=Ce(re.opt,re.comment),re.comment&&ue(re,"oncomment",re.comment),re.comment=""):(re.comment+="-"+ve,re.state=G.COMMENT);continue;case G.COMMENT_ENDED:ve!==">"?(he(re,"Malformed comment"),re.comment+="--"+ve,re.state=G.COMMENT):re.state=G.TEXT;continue;case G.CDATA:ve==="]"?re.state=G.CDATA_ENDING:re.cdata+=ve;continue;case G.CDATA_ENDING:ve==="]"?re.state=G.CDATA_ENDING_2:(re.cdata+="]"+ve,re.state=G.CDATA);continue;case G.CDATA_ENDING_2:ve===">"?(re.cdata&&ue(re,"oncdata",re.cdata),ue(re,"onclosecdata"),re.cdata="",re.state=G.TEXT):ve==="]"?re.cdata+="]":(re.cdata+="]]"+ve,re.state=G.CDATA);continue;case G.PROC_INST:ve==="?"?re.state=G.PROC_INST_ENDING:$(ve)?re.state=G.PROC_INST_BODY:re.procInstName+=ve;continue;case G.PROC_INST_BODY:if(!re.procInstBody&&$(ve))continue;ve==="?"?re.state=G.PROC_INST_ENDING:re.procInstBody+=ve;continue;case G.PROC_INST_ENDING:ve===">"?(ue(re,"onprocessinginstruction",{name:re.procInstName,body:re.procInstBody}),re.procInstName=re.procInstBody="",re.state=G.TEXT):(re.procInstBody+="?"+ve,re.state=G.PROC_INST_BODY);continue;case G.OPEN_TAG:K(U,ve)?re.tagName+=ve:(ae(re),ve===">"?F(re):ve==="/"?re.state=G.OPEN_TAG_SLASH:($(ve)||he(re,"Invalid character in tag name"),re.state=G.ATTRIB));continue;case G.OPEN_TAG_SLASH:ve===">"?(F(re,!0),W(re)):(he(re,"Forward-slash in opening tag not followed by >"),re.state=G.ATTRIB);continue;case G.ATTRIB:if($(ve))continue;ve===">"?F(re):ve==="/"?re.state=G.OPEN_TAG_SLASH:K(B,ve)?(re.attribName=ve,re.attribValue="",re.state=G.ATTRIB_NAME):he(re,"Invalid attribute name");continue;case G.ATTRIB_NAME:ve==="="?re.state=G.ATTRIB_VALUE:ve===">"?(he(re,"Attribute without value"),re.attribValue=re.attribName,D(re),F(re)):$(ve)?re.state=G.ATTRIB_NAME_SAW_WHITE:K(U,ve)?re.attribName+=ve:he(re,"Invalid attribute name");continue;case G.ATTRIB_NAME_SAW_WHITE:if(ve==="=")re.state=G.ATTRIB_VALUE;else{if($(ve))continue;he(re,"Attribute without value"),re.tag.attributes[re.attribName]="",re.attribValue="",ue(re,"onattribute",{name:re.attribName,value:""}),re.attribName="",ve===">"?F(re):K(B,ve)?(re.attribName=ve,re.state=G.ATTRIB_NAME):(he(re,"Invalid attribute name"),re.state=G.ATTRIB)}continue;case G.ATTRIB_VALUE:if($(ve))continue;z(ve)?(re.q=ve,re.state=G.ATTRIB_VALUE_QUOTED):(he(re,"Unquoted attribute value"),re.state=G.ATTRIB_VALUE_UNQUOTED,re.attribValue=ve);continue;case G.ATTRIB_VALUE_QUOTED:if(ve!==re.q){ve==="&"?re.state=G.ATTRIB_VALUE_ENTITY_Q:re.attribValue+=ve;continue}D(re),re.q="",re.state=G.ATTRIB_VALUE_CLOSED;continue;case G.ATTRIB_VALUE_CLOSED:$(ve)?re.state=G.ATTRIB:ve===">"?F(re):ve==="/"?re.state=G.OPEN_TAG_SLASH:K(B,ve)?(he(re,"No whitespace between attributes"),re.attribName=ve,re.attribValue="",re.state=G.ATTRIB_NAME):he(re,"Invalid attribute name");continue;case G.ATTRIB_VALUE_UNQUOTED:if(!V(ve)){ve==="&"?re.state=G.ATTRIB_VALUE_ENTITY_U:re.attribValue+=ve;continue}D(re),ve===">"?F(re):re.state=G.ATTRIB;continue;case G.CLOSE_TAG:if(re.tagName)ve===">"?W(re):K(U,ve)?re.tagName+=ve:re.script?(re.script+="</"+re.tagName,re.tagName="",re.state=G.SCRIPT):($(ve)||he(re,"Invalid tagname in closing tag"),re.state=G.CLOSE_TAG_SAW_WHITE);else{if($(ve))continue;H(B,ve)?re.script?(re.script+="</"+ve,re.state=G.SCRIPT):he(re,"Invalid tagname in closing tag."):re.tagName=ve}continue;case G.CLOSE_TAG_SAW_WHITE:if($(ve))continue;ve===">"?W(re):he(re,"Invalid characters in closing tag");continue;case G.TEXT_ENTITY:case G.ATTRIB_VALUE_ENTITY_Q:case G.ATTRIB_VALUE_ENTITY_U:var Ie,je;switch(re.state){case G.TEXT_ENTITY:Ie=G.TEXT,je="textNode";break;case G.ATTRIB_VALUE_ENTITY_Q:Ie=G.ATTRIB_VALUE_QUOTED,je="attribValue";break;case G.ATTRIB_VALUE_ENTITY_U:Ie=G.ATTRIB_VALUE_UNQUOTED,je="attribValue";break}ve===";"?(re[je]+=Y(re),re.entity="",re.state=Ie):K(re.entity.length?J:P,ve)?re.entity+=ve:(he(re,"Invalid character in entity name"),re[je]+="&"+re.entity+ve,re.entity="",re.state=Ie);continue;default:throw new Error(re,"Unknown state: "+re.state)}}return re.position>=re.bufferCheckPosition&&n(re),re}/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */S.default||function(){var X=String.fromCharCode,re=Math.floor,me=function(){var Te=16384,Re=[],Ie,je,Ne=-1,We=arguments.length;if(!We)return"";for(var Be="";++Ne<We;){var He=Number(arguments[Ne]);if(!isFinite(He)||He<0||He>1114111||re(He)!==He)throw RangeError("Invalid code point: "+He);He<=65535?Re.push(He):(He-=65536,Ie=(He>>10)+55296,je=He%1024+56320,Re.push(Ie,je)),(Ne+1===We||Re.length>Te)&&(Be+=X.apply(null,Re),Re.length=0)}return Be};s.default?Object.defineProperty(String,"fromCodePoint",{value:me,configurable:!0,writable:!0}):String.fromCodePoint=me}()})(typeof N=="undefined"?(void 0).sax={}:N)}).call(this,M("buffer").Buffer)},{"babel-runtime/core-js/json/stringify":53,"babel-runtime/core-js/object/create":55,"babel-runtime/core-js/object/define-property":56,"babel-runtime/core-js/object/keys":60,"babel-runtime/core-js/string/from-code-point":63,"babel-runtime/helpers/typeof":67,buffer:73,stream:230,string_decoder:72}],230:[function(M,ne,N){ne.exports=S;var I=M("events").EventEmitter,h=M("inherits");h(S,I),S.Readable=M("readable-stream/readable.js"),S.Writable=M("readable-stream/writable.js"),S.Duplex=M("readable-stream/duplex.js"),S.Transform=M("readable-stream/transform.js"),S.PassThrough=M("readable-stream/passthrough.js"),S.Stream=S;function S(){I.call(this)}S.prototype.pipe=function(L,T){var c=this;function C(m){L.writable&&(L.write(m)===!1&&c.pause&&c.pause())}c.on("data",C);function g(){c.readable&&c.resume&&c.resume()}L.on("drain",g),!L._isStdio&&(!T||T.end!==!1)&&(c.on("end",a),c.on("close",r));var s=!1;function a(){if(s)return;s=!0,L.end()}function r(){if(s)return;s=!0,typeof L.destroy=="function"&&L.destroy()}function f(m){if(p(),I.listenerCount(this,"error")===0)throw m}c.on("error",f),L.on("error",f);function p(){c.removeListener("data",C),L.removeListener("drain",g),c.removeListener("end",a),c.removeListener("close",r),c.removeListener("error",f),L.removeListener("error",f),c.removeListener("end",p),c.removeListener("close",p),L.removeListener("close",p)}return c.on("end",p),c.on("close",p),L.on("close",p),L.emit("pipe",c),L}},{events:192,inherits:196,"readable-stream/duplex.js":213,"readable-stream/passthrough.js":222,"readable-stream/readable.js":223,"readable-stream/transform.js":224,"readable-stream/writable.js":225}],231:[function(M,ne,N){(function(I){var h=M("./lib/request"),S=M("./lib/response"),L=M("xtend"),T=M("builtin-status-codes"),c=M("url"),C=N;C.request=function(g,s){typeof g=="string"?g=c.parse(g):g=L(g);var a=I.location.protocol.search(/^https?:$/)===-1?"http:":"",r=g.protocol||a,f=g.hostname||g.host,p=g.port,m=g.path||"/";f&&f.indexOf(":")!==-1&&(f="["+f+"]"),g.url=(f?r+"//"+f:"")+(p?":"+p:"")+m,g.method=(g.method||"GET").toUpperCase(),g.headers=g.headers||{};var E=new h(g);return s&&E.on("response",s),E},C.get=function(s,a){var r=C.request(s,a);return r.end(),r},C.ClientRequest=h,C.IncomingMessage=S.IncomingMessage,C.Agent=function(){},C.Agent.defaultMaxSockets=4,C.globalAgent=new C.Agent,C.STATUS_CODES=T,C.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 global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"./lib/request":233,"./lib/response":234,"builtin-status-codes":74,url:238,xtend:283}],232:[function(M,ne,N){(function(I){"use strict";N.fetch=C(I.fetch)&&C(I.ReadableStream),N.writableStream=C(I.WritableStream),N.abortController=C(I.AbortController),N.blobConstructor=!1;try{new Blob([new ArrayBuffer(1)]),N.blobConstructor=!0}catch(g){}var h;function S(){if(h!==void 0)return h;if(I.XMLHttpRequest){h=new I.XMLHttpRequest;try{h.open("GET",I.XDomainRequest?"/":"https://example.com")}catch(g){h=null}}else h=null;return h}function L(g){var s=S();if(!s)return!1;try{return s.responseType=g,s.responseType===g}catch(a){}return!1}var T=typeof I.ArrayBuffer!="undefined",c=T&&C(I.ArrayBuffer.prototype.slice);N.arraybuffer=N.fetch||T&&L("arraybuffer"),N.msstream=!N.fetch&&c&&L("ms-stream"),N.mozchunkedarraybuffer=!N.fetch&&T&&L("moz-chunked-arraybuffer"),N.overrideMimeType=N.fetch||(S()?C(S().overrideMimeType):!1),N.vbArray=C(I.VBArray);function C(g){return typeof g=="function"}h=null}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],233:[function(M,ne,N){(function(I,h,S){"use strict";var L=M("babel-runtime/core-js/object/keys"),T=c(L);function c(n){return n&&n.__esModule?n:{default:n}}var C=M("./capability"),g=M("inherits"),s=M("./response"),a=M("readable-stream"),r=M("to-arraybuffer"),f=s.IncomingMessage,p=s.readyStates;function m(n,o){return C.fetch&&o?"fetch":C.mozchunkedarraybuffer?"moz-chunked-arraybuffer":C.msstream?"ms-stream":C.arraybuffer&&n?"arraybuffer":C.vbArray&&n?"text:vbarray":"text"}var E=ne.exports=function(n){var o=this;a.Writable.call(o),o._opts=n,o._body=[],o._headers={},n.auth&&o.setHeader("Authorization","Basic "+new S(n.auth).toString("base64")),(0,T.default)(n.headers).forEach(function(v){o.setHeader(v,n.headers[v])});var l,w=!0;if(n.mode==="disable-fetch"||"requestTimeout"in n&&!C.abortController)w=!1,l=!0;else if(n.mode==="prefer-streaming")l=!1;else if(n.mode==="allow-wrong-content-type")l=!C.overrideMimeType;else if(!n.mode||n.mode==="default"||n.mode==="prefer-fast")l=!0;else throw new Error("Invalid value for opts.mode");o._mode=m(l,w),o._fetchTimer=null,o.on("finish",function(){o._onFinish()})};g(E,a.Writable),E.prototype.setHeader=function(n,o){var l=this,w=n.toLowerCase();if(u.indexOf(w)!==-1)return;l._headers[w]={name:n,value:o}},E.prototype.getHeader=function(n){var o=this._headers[n.toLowerCase()];return o?o.value:null},E.prototype.removeHeader=function(n){var o=this;delete o._headers[n.toLowerCase()]},E.prototype._onFinish=function(){var n=this;if(n._destroyed)return;var o=n._opts,l=n._headers,w=null;o.method!=="GET"&&o.method!=="HEAD"&&(C.arraybuffer?w=r(S.concat(n._body)):C.blobConstructor?w=new h.Blob(n._body.map(function(b){return r(b)}),{type:(l["content-type"]||{}).value||""}):w=S.concat(n._body).toString());var v=[];if((0,T.default)(l).forEach(function(b){var x=l[b].name,_=l[b].value;Array.isArray(_)?_.forEach(function(B){v.push([x,B])}):v.push([x,_])}),n._mode==="fetch"){var i=null,R=null;if(C.abortController){var k=new AbortController;i=k.signal,n._fetchAbortController=k,"requestTimeout"in o&&o.requestTimeout!==0&&(n._fetchTimer=h.setTimeout(function(){n.emit("requestTimeout"),n._fetchAbortController&&n._fetchAbortController.abort()},o.requestTimeout))}h.fetch(n._opts.url,{method:n._opts.method,headers:v,body:w||void 0,mode:"cors",credentials:o.withCredentials?"include":"same-origin",signal:i}).then(function(b){n._fetchResponse=b,n._connect()},function(b){h.clearTimeout(n._fetchTimer),n._destroyed||n.emit("error",b)})}else{var d=n._xhr=new h.XMLHttpRequest;try{d.open(n._opts.method,n._opts.url,!0)}catch(b){I.nextTick(function(){n.emit("error",b)});return}"responseType"in d&&(d.responseType=n._mode.split(":")[0]),"withCredentials"in d&&(d.withCredentials=!!o.withCredentials),n._mode==="text"&&"overrideMimeType"in d&&d.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in o&&(d.timeout=o.requestTimeout,d.ontimeout=function(){n.emit("requestTimeout")}),v.forEach(function(b){d.setRequestHeader(b[0],b[1])}),n._response=null,d.onreadystatechange=function(){switch(d.readyState){case p.LOADING:case p.DONE:n._onXHRProgress();break}},n._mode==="moz-chunked-arraybuffer"&&(d.onprogress=function(){n._onXHRProgress()}),d.onerror=function(){if(n._destroyed)return;n.emit("error",new Error("XHR error"))};try{d.send(w)}catch(b){I.nextTick(function(){n.emit("error",b)});return}}};function y(n){try{var o=n.status;return o!==null&&o!==0}catch(l){return!1}}E.prototype._onXHRProgress=function(){var n=this;if(!y(n._xhr)||n._destroyed)return;n._response||n._connect(),n._response._onXHRProgress()},E.prototype._connect=function(){var n=this;if(n._destroyed)return;n._response=new f(n._xhr,n._fetchResponse,n._mode,n._fetchTimer),n._response.on("error",function(o){n.emit("error",o)}),n.emit("response",n._response)},E.prototype._write=function(n,o,l){var w=this;w._body.push(n),l()},E.prototype.abort=E.prototype.destroy=function(){var n=this;n._destroyed=!0,h.clearTimeout(n._fetchTimer),n._response&&(n._response._destroyed=!0),n._xhr?n._xhr.abort():n._fetchAbortController&&n._fetchAbortController.abort()},E.prototype.end=function(n,o,l){var w=this;typeof n=="function"&&(l=n,n=void 0),a.Writable.prototype.end.call(w,n,o,l)},E.prototype.flushHeaders=function(){},E.prototype.setTimeout=function(){},E.prototype.setNoDelay=function(){},E.prototype.setSocketKeepAlive=function(){};var u=["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,M("_process"),typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{},M("buffer").Buffer)},{"./capability":232,"./response":234,_process:208,"babel-runtime/core-js/object/keys":60,buffer:73,inherits:196,"readable-stream":223,"to-arraybuffer":237}],234:[function(M,ne,N){(function(I,h,S){"use strict";var L=M("babel-runtime/core-js/promise"),T=c(L);function c(f){return f&&f.__esModule?f:{default:f}}var C=M("./capability"),g=M("inherits"),s=M("readable-stream"),a=N.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},r=N.IncomingMessage=function(f,p,m,E){var y=this;if(s.Readable.call(y),y._mode=m,y.headers={},y.rawHeaders=[],y.trailers={},y.rawTrailers=[],y.on("end",function(){I.nextTick(function(){y.emit("close")})}),m==="fetch"){var u=function i(){o.read().then(function(R){if(y._destroyed)return;if(R.done){h.clearTimeout(E),y.push(null);return}y.push(new S(R.value)),i()}).catch(function(R){h.clearTimeout(E),y._destroyed||y.emit("error",R)})};if(y._fetchResponse=p,y.url=p.url,y.statusCode=p.status,y.statusMessage=p.statusText,p.headers.forEach(function(i,R){y.headers[R.toLowerCase()]=i,y.rawHeaders.push(R,i)}),C.writableStream){var n=new WritableStream({write:function(R){return new T.default(function(k,d){y._destroyed?d():y.push(new S(R))?k():y._resumeFetch=k})},close:function(){h.clearTimeout(E),y._destroyed||y.push(null)},abort:function(R){y._destroyed||y.emit("error",R)}});try{p.body.pipeTo(n).catch(function(i){h.clearTimeout(E),y._destroyed||y.emit("error",i)});return}catch(i){}}var o=p.body.getReader();u()}else{y._xhr=f,y._pos=0,y.url=f.responseURL,y.statusCode=f.status,y.statusMessage=f.statusText;var l=f.getAllResponseHeaders().split(/\r?\n/);if(l.forEach(function(i){var R=i.match(/^([^:]+):\s*(.*)/);if(R){var k=R[1].toLowerCase();k==="set-cookie"?(y.headers[k]===void 0&&(y.headers[k]=[]),y.headers[k].push(R[2])):y.headers[k]!==void 0?y.headers[k]+=", "+R[2]:y.headers[k]=R[2],y.rawHeaders.push(R[1],R[2])}}),y._charset="x-user-defined",!C.overrideMimeType){var w=y.rawHeaders["mime-type"];if(w){var v=w.match(/;\s*charset=([^;])(;|$)/);v&&(y._charset=v[1].toLowerCase())}y._charset||(y._charset="utf-8")}}};g(r,s.Readable),r.prototype._read=function(){var f=this,p=f._resumeFetch;p&&(f._resumeFetch=null,p())},r.prototype._onXHRProgress=function(){var f=this,p=f._xhr,m=null;switch(f._mode){case"text:vbarray":if(p.readyState!==a.DONE)break;try{m=new h.VBArray(p.responseBody).toArray()}catch(o){}if(m!==null){f.push(new S(m));break}case"text":try{m=p.responseText}catch(o){f._mode="text:vbarray";break}if(m.length>f._pos){var E=m.substr(f._pos);if(f._charset==="x-user-defined"){for(var y=new S(E.length),u=0;u<E.length;u++)y[u]=E.charCodeAt(u)&255;f.push(y)}else f.push(E,f._charset);f._pos=m.length}break;case"arraybuffer":if(p.readyState!==a.DONE||!p.response)break;m=p.response,f.push(new S(new Uint8Array(m)));break;case"moz-chunked-arraybuffer":if(m=p.response,p.readyState!==a.LOADING||!m)break;f.push(new S(new Uint8Array(m)));break;case"ms-stream":if(m=p.response,p.readyState!==a.LOADING)break;var n=new h.MSStreamReader;n.onprogress=function(){n.result.byteLength>f._pos&&(f.push(new S(new Uint8Array(n.result.slice(f._pos)))),f._pos=n.result.byteLength)},n.onload=function(){f.push(null)},n.readAsArrayBuffer(m);break}f._xhr.readyState===a.DONE&&f._mode!=="ms-stream"&&f.push(null)}}).call(this,M("_process"),typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{},M("buffer").Buffer)},{"./capability":232,_process:208,"babel-runtime/core-js/promise":61,buffer:73,inherits:196,"readable-stream":223}],235:[function(M,ne,N){"use strict";var I=M("safe-buffer").Buffer,h=I.isEncoding||function(n){n=""+n;switch(n&&n.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}};function S(n){if(!n)return"utf8";for(var o;;)switch(n){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 n;default:if(o)return;n=(""+n).toLowerCase(),o=!0}}function L(n){var o=S(n);if(typeof o!="string"&&(I.isEncoding===h||!h(n)))throw new Error("Unknown encoding: "+n);return o||n}N.StringDecoder=T;function T(n){this.encoding=L(n);var o;switch(this.encoding){case"utf16le":this.text=f,this.end=p,o=4;break;case"utf8":this.fillLast=s,o=4;break;case"base64":this.text=m,this.end=E,o=3;break;default:this.write=y,this.end=u;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=I.allocUnsafe(o)}T.prototype.write=function(n){if(n.length===0)return"";var o,l;if(this.lastNeed){if(o=this.fillLast(n),o===void 0)return"";l=this.lastNeed,this.lastNeed=0}else l=0;return l<n.length?o?o+this.text(n,l):this.text(n,l):o||""},T.prototype.end=r,T.prototype.text=a,T.prototype.fillLast=function(n){if(this.lastNeed<=n.length)return n.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);n.copy(this.lastChar,this.lastTotal-this.lastNeed,0,n.length),this.lastNeed-=n.length};function c(n){return n<=127?0:n>>5===6?2:n>>4===14?3:n>>3===30?4:n>>6===2?-1:-2}function C(n,o,l){var w=o.length-1;if(w<l)return 0;var v=c(o[w]);return v>=0?(v>0&&(n.lastNeed=v-1),v):--w<l||v===-2?0:(v=c(o[w]),v>=0?(v>0&&(n.lastNeed=v-2),v):--w<l||v===-2?0:(v=c(o[w]),v>=0?(v>0&&(v===2?v=0:n.lastNeed=v-3),v):0))}function g(n,o,l){if((o[0]&192)!==128)return n.lastNeed=0,"\uFFFD";if(n.lastNeed>1&&o.length>1){if((o[1]&192)!==128)return n.lastNeed=1,"\uFFFD";if(n.lastNeed>2&&o.length>2&&(o[2]&192)!==128)return n.lastNeed=2,"\uFFFD"}}function s(n){var o=this.lastTotal-this.lastNeed,l=g(this,n,o);if(l!==void 0)return l;if(this.lastNeed<=n.length)return n.copy(this.lastChar,o,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);n.copy(this.lastChar,o,0,n.length),this.lastNeed-=n.length}function a(n,o){var l=C(this,n,o);if(!this.lastNeed)return n.toString("utf8",o);this.lastTotal=l;var w=n.length-(l-this.lastNeed);return n.copy(this.lastChar,0,w),n.toString("utf8",o,w)}function r(n){var o=n&&n.length?this.write(n):"";return this.lastNeed?o+"\uFFFD":o}function f(n,o){if((n.length-o)%2===0){var l=n.toString("utf16le",o);if(l){var w=l.charCodeAt(l.length-1);if(w>=55296&&w<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=n[n.length-2],this.lastChar[1]=n[n.length-1],l.slice(0,-1)}return l}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=n[n.length-1],n.toString("utf16le",o,n.length-1)}function p(n){var o=n&&n.length?this.write(n):"";if(this.lastNeed){var l=this.lastTotal-this.lastNeed;return o+this.lastChar.toString("utf16le",0,l)}return o}function m(n,o){var l=(n.length-o)%3;return l===0?n.toString("base64",o):(this.lastNeed=3-l,this.lastTotal=3,l===1?this.lastChar[0]=n[n.length-1]:(this.lastChar[0]=n[n.length-2],this.lastChar[1]=n[n.length-1]),n.toString("base64",o,n.length-l))}function E(n){var o=n&&n.length?this.write(n):"";return this.lastNeed?o+this.lastChar.toString("base64",0,3-this.lastNeed):o}function y(n){return n.toString(this.encoding)}function u(n){return n&&n.length?this.write(n):""}},{"safe-buffer":228}],236:[function(M,ne,N){(function(I,h){var S=M("process/browser.js").nextTick,L=Function.prototype.apply,T=Array.prototype.slice,c={},C=0;N.setTimeout=function(){return new g(L.call(setTimeout,window,arguments),clearTimeout)},N.setInterval=function(){return new g(L.call(setInterval,window,arguments),clearInterval)},N.clearTimeout=N.clearInterval=function(s){s.close()};function g(s,a){this._id=s,this._clearFn=a}g.prototype.unref=g.prototype.ref=function(){},g.prototype.close=function(){this._clearFn.call(window,this._id)},N.enroll=function(s,a){clearTimeout(s._idleTimeoutId),s._idleTimeout=a},N.unenroll=function(s){clearTimeout(s._idleTimeoutId),s._idleTimeout=-1},N._unrefActive=N.active=function(s){clearTimeout(s._idleTimeoutId);var a=s._idleTimeout;a>=0&&(s._idleTimeoutId=setTimeout(function(){s._onTimeout&&s._onTimeout()},a))},N.setImmediate=typeof I=="function"?I:function(s){var a=C++,r=arguments.length<2?!1:T.call(arguments,1);return c[a]=!0,S(function(){c[a]&&(r?s.apply(null,r):s.call(null),N.clearImmediate(a))}),a},N.clearImmediate=typeof h=="function"?h:function(s){delete c[s]}}).call(this,M("timers").setImmediate,M("timers").clearImmediate)},{"process/browser.js":208,timers:236}],237:[function(M,ne,N){var I=M("buffer").Buffer;ne.exports=function(h){if(h instanceof Uint8Array){if(h.byteOffset===0&&h.byteLength===h.buffer.byteLength)return h.buffer;if(typeof h.buffer.slice=="function")return h.buffer.slice(h.byteOffset,h.byteOffset+h.byteLength)}if(I.isBuffer(h)){for(var S=new Uint8Array(h.length),L=h.length,T=0;T<L;T++)S[T]=h[T];return S.buffer}else throw new Error("Argument must be a Buffer")}},{buffer:73}],238:[function(M,ne,N){"use strict";var I=M("punycode"),h=M("./util");N.parse=o,N.resolve=w,N.resolveObject=v,N.format=l,N.Url=S;function S(){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}var L=/^([a-z0-9.+-]+:)/i,T=/:[0-9]*$/,c=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,C=["<",">",'"',"`"," ","\r",`
`," "],g=["{","}","|","\\","^","`"].concat(C),s=["'"].concat(g),a=["%","/","?",";","#"].concat(s),r=["/","?","#"],f=255,p=/^[+a-z0-9A-Z_-]{0,63}$/,m=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,E={javascript:!0,"javascript:":!0},y={javascript:!0,"javascript:":!0},u={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},n=M("querystring");function o(i,R,k){if(i&&h.isObject(i)&&i instanceof S)return i;var d=new S;return d.parse(i,R,k),d}S.prototype.parse=function(i,R,k){if(!h.isString(i))throw new TypeError("Parameter 'url' must be a string, not "+typeof i);var d=i.indexOf("?"),b=d!==-1&&d<i.indexOf("#")?"?":"#",x=i.split(b),_=/\\/g;x[0]=x[0].replace(_,"/"),i=x.join(b);var B=i;if(B=B.trim(),!k&&i.split("#").length===1){var U=c.exec(B);if(U)return this.path=B,this.href=B,this.pathname=U[1],U[2]?(this.search=U[2],R?this.query=n.parse(this.search.substr(1)):this.query=this.search.substr(1)):R&&(this.search="",this.query={}),this}var P=L.exec(B);if(P){P=P[0];var J=P.toLowerCase();this.protocol=J,B=B.substr(P.length)}if(k||P||B.match(/^\/\/[^@\/]+@[^@\/]+/)){var $=B.substr(0,2)==="//";$&&!(P&&y[P])&&(B=B.substr(2),this.slashes=!0)}if(!y[P]&&($||P&&!u[P])){for(var z=-1,V=0;V<r.length;V++){var K=B.indexOf(r[V]);K!==-1&&(z===-1||K<z)&&(z=K)}var H,G;z===-1?G=B.lastIndexOf("@"):G=B.lastIndexOf("@",z),G!==-1&&(H=B.slice(0,G),B=B.slice(G+1),this.auth=decodeURIComponent(H)),z=-1;for(var V=0;V<a.length;V++){var K=B.indexOf(a[V]);K!==-1&&(z===-1||K<z)&&(z=K)}z===-1&&(z=B.length),this.host=B.slice(0,z),B=B.slice(z),this.parseHost(),this.hostname=this.hostname||"";var ie=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!ie)for(var le=this.hostname.split(/\./),V=0,ue=le.length;V<ue;V++){var be=le[V];if(!be)continue;if(!be.match(p)){for(var Ce="",se=0,ce=be.length;se<ce;se++)be.charCodeAt(se)>127?Ce+="x":Ce+=be[se];if(!Ce.match(p)){var he=le.slice(0,V),ae=le.slice(V+1),Q=be.match(m);Q&&(he.push(Q[1]),ae.unshift(Q[2])),ae.length&&(B="/"+ae.join(".")+B),this.hostname=he.join(".");break}}}this.hostname.length>f?this.hostname="":this.hostname=this.hostname.toLowerCase(),ie||(this.hostname=I.toASCII(this.hostname));var D=this.port?":"+this.port:"",F=this.hostname||"";this.host=F+D,this.href+=this.host,ie&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),B[0]!=="/"&&(B="/"+B))}if(!E[J])for(var V=0,ue=s.length;V<ue;V++){var W=s[V];if(B.indexOf(W)===-1)continue;var Y=encodeURIComponent(W);Y===W&&(Y=escape(W)),B=B.split(W).join(Y)}var Z=B.indexOf("#");Z!==-1&&(this.hash=B.substr(Z),B=B.slice(0,Z));var te=B.indexOf("?");if(te!==-1?(this.search=B.substr(te),this.query=B.substr(te+1),R&&(this.query=n.parse(this.query)),B=B.slice(0,te)):R&&(this.search="",this.query={}),B&&(this.pathname=B),u[J]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var D=this.pathname||"",q=this.search||"";this.path=D+q}return this.href=this.format(),this};function l(i){return h.isString(i)&&(i=o(i)),i instanceof S?i.format():S.prototype.format.call(i)}S.prototype.format=function(){var i=this.auth||"";i&&(i=encodeURIComponent(i),i=i.replace(/%3A/i,":"),i+="@");var R=this.protocol||"",k=this.pathname||"",d=this.hash||"",b=!1,x="";this.host?b=i+this.host:this.hostname&&(b=i+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(b+=":"+this.port)),this.query&&h.isObject(this.query)&&Object.keys(this.query).length&&(x=n.stringify(this.query));var _=this.search||x&&"?"+x||"";return R&&R.substr(-1)!==":"&&(R+=":"),this.slashes||(!R||u[R])&&b!==!1?(b="//"+(b||""),k&&k.charAt(0)!=="/"&&(k="/"+k)):b||(b=""),d&&d.charAt(0)!=="#"&&(d="#"+d),_&&_.charAt(0)!=="?"&&(_="?"+_),k=k.replace(/[?#]/g,function(B){return encodeURIComponent(B)}),_=_.replace("#","%23"),R+b+k+_+d};function w(i,R){return o(i,!1,!0).resolve(R)}S.prototype.resolve=function(i){return this.resolveObject(o(i,!1,!0)).format()};function v(i,R){return i?o(i,!1,!0).resolveObject(R):R}S.prototype.resolveObject=function(i){if(h.isString(i)){var R=new S;R.parse(i,!1,!0),i=R}for(var k=new S,d=Object.keys(this),b=0;b<d.length;b++){var x=d[b];k[x]=this[x]}if(k.hash=i.hash,i.href==="")return k.href=k.format(),k;if(i.slashes&&!i.protocol){for(var _=Object.keys(i),B=0;B<_.length;B++){var U=_[B];U!=="protocol"&&(k[U]=i[U])}return u[k.protocol]&&k.hostname&&!k.pathname&&(k.path=k.pathname="/"),k.href=k.format(),k}if(i.protocol&&i.protocol!==k.protocol){if(!u[i.protocol]){for(var P=Object.keys(i),J=0;J<P.length;J++){var $=P[J];k[$]=i[$]}return k.href=k.format(),k}if(k.protocol=i.protocol,!i.host&&!y[i.protocol]){for(var ue=(i.pathname||"").split("/");ue.length&&!(i.host=ue.shift()););i.host||(i.host=""),i.hostname||(i.hostname=""),ue[0]!==""&&ue.unshift(""),ue.length<2&&ue.unshift(""),k.pathname=ue.join("/")}else k.pathname=i.pathname;if(k.search=i.search,k.query=i.query,k.host=i.host||"",k.auth=i.auth,k.hostname=i.hostname||i.host,k.port=i.port,k.pathname||k.search){var z=k.pathname||"",V=k.search||"";k.path=z+V}return k.slashes=k.slashes||i.slashes,k.href=k.format(),k}var K=k.pathname&&k.pathname.charAt(0)==="/",H=i.host||i.pathname&&i.pathname.charAt(0)==="/",G=H||K||k.host&&i.pathname,ie=G,le=k.pathname&&k.pathname.split("/")||[],ue=i.pathname&&i.pathname.split("/")||[],be=k.protocol&&!u[k.protocol];if(be&&(k.hostname="",k.port=null,k.host&&(le[0]===""?le[0]=k.host:le.unshift(k.host)),k.host="",i.protocol&&(i.hostname=null,i.port=null,i.host&&(ue[0]===""?ue[0]=i.host:ue.unshift(i.host)),i.host=null),G=G&&(ue[0]===""||le[0]==="")),H)k.host=i.host||i.host===""?i.host:k.host,k.hostname=i.hostname||i.hostname===""?i.hostname:k.hostname,k.search=i.search,k.query=i.query,le=ue;else if(ue.length)le||(le=[]),le.pop(),le=le.concat(ue),k.search=i.search,k.query=i.query;else if(!h.isNullOrUndefined(i.search)){if(be){k.hostname=k.host=le.shift();var Ce=k.host&&k.host.indexOf("@")>0?k.host.split("@"):!1;Ce&&(k.auth=Ce.shift(),k.host=k.hostname=Ce.shift())}return k.search=i.search,k.query=i.query,(!h.isNull(k.pathname)||!h.isNull(k.search))&&(k.path=(k.pathname?k.pathname:"")+(k.search?k.search:"")),k.href=k.format(),k}if(!le.length)return k.pathname=null,k.search?k.path="/"+k.search:k.path=null,k.href=k.format(),k;for(var se=le.slice(-1)[0],ce=(k.host||i.host||le.length>1)&&(se==="."||se==="..")||se==="",he=0,ae=le.length;ae>=0;ae--)se=le[ae],se==="."?le.splice(ae,1):se===".."?(le.splice(ae,1),he++):he&&(le.splice(ae,1),he--);if(!G&&!ie)for(;he--;he)le.unshift("..");G&&le[0]!==""&&(!le[0]||le[0].charAt(0)!=="/")&&le.unshift(""),ce&&le.join("/").substr(-1)!=="/"&&le.push("");var Q=le[0]===""||le[0]&&le[0].charAt(0)==="/";if(be){k.hostname=k.host=Q?"":le.length?le.shift():"";var Ce=k.host&&k.host.indexOf("@")>0?k.host.split("@"):!1;Ce&&(k.auth=Ce.shift(),k.host=k.hostname=Ce.shift())}return G=G||k.host&&le.length,G&&!Q&&le.unshift(""),le.length?k.pathname=le.join("/"):(k.pathname=null,k.path=null),(!h.isNull(k.pathname)||!h.isNull(k.search))&&(k.path=(k.pathname?k.pathname:"")+(k.search?k.search:"")),k.auth=i.auth||k.auth,k.slashes=k.slashes||i.slashes,k.href=k.format(),k},S.prototype.parseHost=function(){var i=this.host,R=T.exec(i);R&&(R=R[0],R!==":"&&(this.port=R.substr(1)),i=i.substr(0,i.length-R.length)),i&&(this.hostname=i)}},{"./util":239,punycode:209,querystring:212}],239:[function(M,ne,N){"use strict";ne.exports={isString:function(I){return typeof I=="string"},isObject:function(I){return typeof I=="object"&&I!==null},isNull:function(I){return I===null},isNullOrUndefined:function(I){return I==null}}},{}],240:[function(M,ne,N){(function(I){ne.exports=h;function h(L,T){if(S("noDeprecation"))return L;var c=!1;function C(){if(!c){if(S("throwDeprecation"))throw new Error(T);S("traceDeprecation")?console.trace(T):console.warn(T),c=!0}return L.apply(this,arguments)}return C}function S(L){try{if(!I.localStorage)return!1}catch(c){return!1}var T=I.localStorage[L];return T==null?!1:String(T).toLowerCase()==="true"}}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],241:[function(M,ne,N){typeof Object.create=="function"?ne.exports=function(h,S){h.super_=S,h.prototype=Object.create(S.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}})}:ne.exports=function(h,S){h.super_=S;var L=function(){};L.prototype=S.prototype,h.prototype=new L,h.prototype.constructor=h}},{}],242:[function(M,ne,N){ne.exports=function(h){return h&&typeof h=="object"&&typeof h.copy=="function"&&typeof h.fill=="function"&&typeof h.readUInt8=="function"}},{}],243:[function(M,ne,N){(function(I,h){var S=/%[sdj%]/g;N.format=function(z){if(!w(z)){for(var V=[],K=0;K<arguments.length;K++)V.push(c(arguments[K]));return V.join(" ")}for(var K=1,H=arguments,G=H.length,ie=String(z).replace(S,function(ue){if(ue==="%%")return"%";if(K>=G)return ue;switch(ue){case"%s":return String(H[K++]);case"%d":return Number(H[K++]);case"%j":try{return JSON.stringify(H[K++])}catch(be){return"[Circular]"}default:return ue}}),le=H[K];K<G;le=H[++K])n(le)||!k(le)?ie+=" "+le:ie+=" "+c(le);return ie},N.deprecate=function(z,V){if(i(h.process))return function(){return N.deprecate(z,V).apply(this,arguments)};if(I.noDeprecation===!0)return z;var K=!1;function H(){if(!K){if(I.throwDeprecation)throw new Error(V);I.traceDeprecation?console.trace(V):console.error(V),K=!0}return z.apply(this,arguments)}return H};var L={},T;N.debuglog=function(z){if(i(T)&&(T=I.env.NODE_DEBUG||""),z=z.toUpperCase(),!L[z])if(new RegExp("\\b"+z+"\\b","i").test(T)){var V=I.pid;L[z]=function(){var K=N.format.apply(N,arguments);console.error("%s %d: %s",z,V,K)}}else L[z]=function(){};return L[z]};function c(z,V){var K={seen:[],stylize:g};return arguments.length>=3&&(K.depth=arguments[2]),arguments.length>=4&&(K.colors=arguments[3]),u(V)?K.showHidden=V:V&&N._extend(K,V),i(K.showHidden)&&(K.showHidden=!1),i(K.depth)&&(K.depth=2),i(K.colors)&&(K.colors=!1),i(K.customInspect)&&(K.customInspect=!0),K.colors&&(K.stylize=C),a(K,z,K.depth)}N.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"};function C(z,V){var K=c.styles[V];return K?"["+c.colors[K][0]+"m"+z+"["+c.colors[K][1]+"m":z}function g(z,V){return z}function s(z){var V={};return z.forEach(function(K,H){V[K]=!0}),V}function a(z,V,K){if(z.customInspect&&V&&x(V.inspect)&&V.inspect!==N.inspect&&!(V.constructor&&V.constructor.prototype===V)){var H=V.inspect(K,z);return w(H)||(H=a(z,H,K)),H}var G=r(z,V);if(G)return G;var ie=Object.keys(V),le=s(ie);if(z.showHidden&&(ie=Object.getOwnPropertyNames(V)),b(V)&&(ie.indexOf("message")>=0||ie.indexOf("description")>=0))return f(V);if(ie.length===0){if(x(V)){var ue=V.name?": "+V.name:"";return z.stylize("[Function"+ue+"]","special")}if(R(V))return z.stylize(RegExp.prototype.toString.call(V),"regexp");if(d(V))return z.stylize(Date.prototype.toString.call(V),"date");if(b(V))return f(V)}var be="",Ce=!1,se=["{","}"];if(y(V)&&(Ce=!0,se=["[","]"]),x(V)){var ce=V.name?": "+V.name:"";be=" [Function"+ce+"]"}if(R(V)&&(be=" "+RegExp.prototype.toString.call(V)),d(V)&&(be=" "+Date.prototype.toUTCString.call(V)),b(V)&&(be=" "+f(V)),ie.length===0&&(!Ce||V.length==0))return se[0]+be+se[1];if(K<0)return R(V)?z.stylize(RegExp.prototype.toString.call(V),"regexp"):z.stylize("[Object]","special");z.seen.push(V);var he;return Ce?he=p(z,V,K,le,ie):he=ie.map(function(ae){return m(z,V,K,le,ae,Ce)}),z.seen.pop(),E(he,be,se)}function r(z,V){if(i(V))return z.stylize("undefined","undefined");if(w(V)){var K="'"+JSON.stringify(V).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return z.stylize(K,"string")}if(l(V))return z.stylize(""+V,"number");if(u(V))return z.stylize(""+V,"boolean");if(n(V))return z.stylize("null","null")}function f(z){return"["+Error.prototype.toString.call(z)+"]"}function p(z,V,K,H,G){for(var ie=[],le=0,ue=V.length;le<ue;++le)$(V,String(le))?ie.push(m(z,V,K,H,String(le),!0)):ie.push("");return G.forEach(function(be){be.match(/^\d+$/)||ie.push(m(z,V,K,H,be,!0))}),ie}function m(z,V,K,H,G,ie){var le,ue,be;if(be=Object.getOwnPropertyDescriptor(V,G)||{value:V[G]},be.get?be.set?ue=z.stylize("[Getter/Setter]","special"):ue=z.stylize("[Getter]","special"):be.set&&(ue=z.stylize("[Setter]","special")),$(H,G)||(le="["+G+"]"),ue||(z.seen.indexOf(be.value)<0?(n(K)?ue=a(z,be.value,null):ue=a(z,be.value,K-1),ue.indexOf(`
`)>-1&&(ie?ue=ue.split(`
`).map(function(Ce){return" "+Ce}).join(`
`).substr(2):ue=`
`+ue.split(`
`).map(function(Ce){return" "+Ce}).join(`
`))):ue=z.stylize("[Circular]","special")),i(le)){if(ie&&G.match(/^\d+$/))return ue;le=JSON.stringify(""+G),le.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(le=le.substr(1,le.length-2),le=z.stylize(le,"name")):(le=le.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),le=z.stylize(le,"string"))}return le+": "+ue}function E(z,V,K){var H=0,G=z.reduce(function(ie,le){return H++,le.indexOf(`
`)>=0&&H++,ie+le.replace(/\u001b\[\d\d?m/g,"").length+1},0);return G>60?K[0]+(V===""?"":V+`
`)+" "+z.join(`,
`)+" "+K[1]:K[0]+V+" "+z.join(", ")+" "+K[1]}function y(z){return Array.isArray(z)}N.isArray=y;function u(z){return typeof z=="boolean"}N.isBoolean=u;function n(z){return z===null}N.isNull=n;function o(z){return z==null}N.isNullOrUndefined=o;function l(z){return typeof z=="number"}N.isNumber=l;function w(z){return typeof z=="string"}N.isString=w;function v(z){return typeof z=="symbol"}N.isSymbol=v;function i(z){return z===void 0}N.isUndefined=i;function R(z){return k(z)&&B(z)==="[object RegExp]"}N.isRegExp=R;function k(z){return typeof z=="object"&&z!==null}N.isObject=k;function d(z){return k(z)&&B(z)==="[object Date]"}N.isDate=d;function b(z){return k(z)&&(B(z)==="[object Error]"||z instanceof Error)}N.isError=b;function x(z){return typeof z=="function"}N.isFunction=x;function _(z){return z===null||typeof z=="boolean"||typeof z=="number"||typeof z=="string"||typeof z=="symbol"||typeof z=="undefined"}N.isPrimitive=_,N.isBuffer=M("./support/isBuffer");function B(z){return Object.prototype.toString.call(z)}function U(z){return z<10?"0"+z.toString(10):z.toString(10)}var P=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function J(){var z=new Date,V=[U(z.getHours()),U(z.getMinutes()),U(z.getSeconds())].join(":");return[z.getDate(),P[z.getMonth()],V].join(" ")}N.log=function(){console.log("%s - %s",J(),N.format.apply(N,arguments))},N.inherits=M("inherits"),N._extend=function(z,V){if(!V||!k(V))return z;for(var K=Object.keys(V),H=K.length;H--;)z[K[H]]=V[K[H]];return z};function $(z,V){return Object.prototype.hasOwnProperty.call(z,V)}}).call(this,M("_process"),typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"./support/isBuffer":242,_process:208,inherits:241}],244:[function(M,ne,N){"use strict";(function(){"use strict";N.stripBOM=function(I){return I[0]==="\uFEFF"?I.substring(1):I}}).call(void 0)},{}],245:[function(M,ne,N){"use strict";var I=M("babel-runtime/helpers/typeof"),h=T(I),S=M("babel-runtime/core-js/object/keys"),L=T(S);function T(c){return c&&c.__esModule?c:{default:c}}(function(){"use strict";var c,C,g,s,a,r={}.hasOwnProperty;c=M("xmlbuilder"),C=M("./defaults").defaults,s=function(p){return typeof p=="string"&&(p.indexOf("&")>=0||p.indexOf(">")>=0||p.indexOf("<")>=0)},a=function(p){return"<![CDATA["+g(p)+"]]>"},g=function(p){return p.replace("]]>","]]]]><![CDATA[>")},N.Builder=function(){function f(p){var m,E,y;this.options={},E=C["0.2"];for(m in E){if(!r.call(E,m))continue;y=E[m],this.options[m]=y}for(m in p){if(!r.call(p,m))continue;y=p[m],this.options[m]=y}}return f.prototype.buildObject=function(p){var m,E,y,u,n;return m=this.options.attrkey,E=this.options.charkey,(0,L.default)(p).length===1&&this.options.rootName===C["0.2"].rootName?(n=(0,L.default)(p)[0],p=p[n]):n=this.options.rootName,y=function(o){return function(l,w){var v,i,R,k,d,b;if((typeof w=="undefined"?"undefined":(0,h.default)(w))!=="object")o.options.cdata&&s(w)?l.raw(a(w)):l.txt(w);else if(Array.isArray(w))for(k in w){if(!r.call(w,k))continue;i=w[k];for(d in i)R=i[d],l=y(l.ele(d),R).up()}else for(d in w){if(!r.call(w,d))continue;if(i=w[d],d===m){if((typeof i=="undefined"?"undefined":(0,h.default)(i))==="object")for(v in i)b=i[v],l=l.att(v,b)}else if(d===E)o.options.cdata&&s(i)?l=l.raw(a(i)):l=l.txt(i);else if(Array.isArray(i))for(k in i){if(!r.call(i,k))continue;R=i[k],typeof R=="string"?o.options.cdata&&s(R)?l=l.ele(d).raw(a(R)).up():l=l.ele(d,R).up():l=y(l.ele(d),R).up()}else(typeof i=="undefined"?"undefined":(0,h.default)(i))==="object"?l=y(l.ele(d),i).up():typeof i=="string"&&o.options.cdata&&s(i)?l=l.ele(d).raw(a(i)).up():(i==null&&(i=""),l=l.ele(d,i.toString()).up())}return l}}(this),u=c.create(n,this.options.xmldec,this.options.doctype,{headless:this.options.headless,allowSurrogateChars:this.options.allowSurrogateChars}),y(u,p).end(this.options.renderOpts)},f}()}).call(void 0)},{"./defaults":246,"babel-runtime/core-js/object/keys":60,"babel-runtime/helpers/typeof":67,xmlbuilder:282}],246:[function(M,ne,N){"use strict";(function(){N.defaults={"0.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:""},"0.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)},{}],247:[function(M,ne,N){"use strict";var I=M("babel-runtime/core-js/promise"),h=s(I),S=M("babel-runtime/core-js/object/get-own-property-names"),L=s(S),T=M("babel-runtime/core-js/object/keys"),c=s(T),C=M("babel-runtime/helpers/typeof"),g=s(C);function s(a){return a&&a.__esModule?a:{default:a}}(function(){"use strict";var a,r,f,p,m,E,y,u,n=function(v,i){return function(){return v.apply(i,arguments)}},o=function(v,i){for(var R in i)l.call(i,R)&&(v[R]=i[R]);function k(){this.constructor=v}return k.prototype=i.prototype,v.prototype=new k,v.__super__=i.prototype,v},l={}.hasOwnProperty;y=M("sax"),f=M("events"),a=M("./bom"),E=M("./processors"),u=M("timers").setImmediate,r=M("./defaults").defaults,p=function(v){return(typeof v=="undefined"?"undefined":(0,g.default)(v))==="object"&&v!=null&&(0,c.default)(v).length===0},m=function(v,i,R){var k,d,b;for(k=0,d=v.length;k<d;k++)b=v[k],i=b(i,R);return i},N.Parser=function(w){o(v,w);function v(i){this.parseStringPromise=n(this.parseStringPromise,this),this.parseString=n(this.parseString,this),this.reset=n(this.reset,this),this.assignOrPush=n(this.assignOrPush,this),this.processAsync=n(this.processAsync,this);var R,k,d;if(!(this instanceof N.Parser))return new N.Parser(i);this.options={},k=r["0.2"];for(R in k){if(!l.call(k,R))continue;d=k[R],this.options[R]=d}for(R in i){if(!l.call(i,R))continue;d=i[R],this.options[R]=d}this.options.xmlns&&(this.options.xmlnskey=this.options.attrkey+"ns"),this.options.normalizeTags&&(this.options.tagNameProcessors||(this.options.tagNameProcessors=[]),this.options.tagNameProcessors.unshift(E.normalize)),this.reset()}return v.prototype.processAsync=function(){var i,R;try{return this.remaining.length<=this.options.chunkSize?(i=this.remaining,this.remaining="",this.saxParser=this.saxParser.write(i),this.saxParser.close()):(i=this.remaining.substr(0,this.options.chunkSize),this.remaining=this.remaining.substr(this.options.chunkSize,this.remaining.length),this.saxParser=this.saxParser.write(i),u(this.processAsync))}catch(k){if(R=k,!this.saxParser.errThrown)return this.saxParser.errThrown=!0,this.emit(R)}},v.prototype.assignOrPush=function(i,R,k){return R in i?(i[R]instanceof Array||(i[R]=[i[R]]),i[R].push(k)):this.options.explicitArray?i[R]=[k]:i[R]=k},v.prototype.reset=function(){var i,R,k,d;return this.removeAllListeners(),this.saxParser=y.parser(this.options.strict,{trim:!1,normalize:!1,xmlns:this.options.xmlns}),this.saxParser.errThrown=!1,this.saxParser.onerror=function(b){return function(x){if(b.saxParser.resume(),!b.saxParser.errThrown)return b.saxParser.errThrown=!0,b.emit("error",x)}}(this),this.saxParser.onend=function(b){return function(){if(!b.saxParser.ended)return b.saxParser.ended=!0,b.emit("end",b.resultObject)}}(this),this.saxParser.ended=!1,this.EXPLICIT_CHARKEY=this.options.explicitCharkey,this.resultObject=null,d=[],i=this.options.attrkey,R=this.options.charkey,this.saxParser.onopentag=function(b){return function(x){var _,B,U,P,J;if(U={},U[R]="",!b.options.ignoreAttrs){J=x.attributes;for(_ in J){if(!l.call(J,_))continue;!(i in U)&&!b.options.mergeAttrs&&(U[i]={}),B=b.options.attrValueProcessors?m(b.options.attrValueProcessors,x.attributes[_],_):x.attributes[_],P=b.options.attrNameProcessors?m(b.options.attrNameProcessors,_):_,b.options.mergeAttrs?b.assignOrPush(U,P,B):U[i][P]=B}}return U["#name"]=b.options.tagNameProcessors?m(b.options.tagNameProcessors,x.name):x.name,b.options.xmlns&&(U[b.options.xmlnskey]={uri:x.uri,local:x.local}),d.push(U)}}(this),this.saxParser.onclosetag=function(b){return function(){var x,_,B,U,P,J,$,z,V,K;if(J=d.pop(),P=J["#name"],(!b.options.explicitChildren||!b.options.preserveChildrenOrder)&&delete J["#name"],J.cdata===!0&&(x=J.cdata,delete J.cdata),V=d[d.length-1],J[R].match(/^\s*$/)&&!x?(_=J[R],delete J[R]):(b.options.trim&&(J[R]=J[R].trim()),b.options.normalize&&(J[R]=J[R].replace(/\s{2,}/g," ").trim()),J[R]=b.options.valueProcessors?m(b.options.valueProcessors,J[R],P):J[R],(0,c.default)(J).length===1&&R in J&&!b.EXPLICIT_CHARKEY&&(J=J[R])),p(J)&&(J=b.options.emptyTag!==""?b.options.emptyTag:_),b.options.validator!=null&&(K="/"+function(){var H,G,ie;for(ie=[],H=0,G=d.length;H<G;H++)U=d[H],ie.push(U["#name"]);return ie}().concat(P).join("/"),function(){var H;try{return J=b.options.validator(K,V&&V[P],J)}catch(G){return H=G,b.emit("error",H)}}()),b.options.explicitChildren&&!b.options.mergeAttrs&&(typeof J=="undefined"?"undefined":(0,g.default)(J))==="object"){if(!b.options.preserveChildrenOrder)U={},b.options.attrkey in J&&(U[b.options.attrkey]=J[b.options.attrkey],delete J[b.options.attrkey]),!b.options.charsAsChildren&&b.options.charkey in J&&(U[b.options.charkey]=J[b.options.charkey],delete J[b.options.charkey]),(0,L.default)(J).length>0&&(U[b.options.childkey]=J),J=U;else if(V){V[b.options.childkey]=V[b.options.childkey]||[],$={};for(B in J){if(!l.call(J,B))continue;$[B]=J[B]}V[b.options.childkey].push($),delete J["#name"],(0,c.default)(J).length===1&&R in J&&!b.EXPLICIT_CHARKEY&&(J=J[R])}}return d.length>0?b.assignOrPush(V,P,J):(b.options.explicitRoot&&(z=J,J={},J[P]=z),b.resultObject=J,b.saxParser.ended=!0,b.emit("end",b.resultObject))}}(this),k=function(b){return function(x){var _,B;if(B=d[d.length-1],B)return B[R]+=x,b.options.explicitChildren&&b.options.preserveChildrenOrder&&b.options.charsAsChildren&&(b.options.includeWhiteChars||x.replace(/\\n/g,"").trim()!=="")&&(B[b.options.childkey]=B[b.options.childkey]||[],_={"#name":"__text__"},_[R]=x,b.options.normalize&&(_[R]=_[R].replace(/\s{2,}/g," ").trim()),B[b.options.childkey].push(_)),B}}(this),this.saxParser.ontext=k,this.saxParser.oncdata=function(b){return function(x){var _;if(_=k(x),_)return _.cdata=!0}}(this)},v.prototype.parseString=function(i,R){var k;R!=null&&typeof R=="function"&&(this.on("end",function(d){return this.reset(),R(null,d)}),this.on("error",function(d){return this.reset(),R(d)}));try{return i=i.toString(),i.trim()===""?(this.emit("end",null),!0):(i=a.stripBOM(i),this.options.async?(this.remaining=i,u(this.processAsync),this.saxParser):this.saxParser.write(i).close())}catch(d){if(k=d,this.saxParser.errThrown||this.saxParser.ended){if(this.saxParser.ended)throw k}else return this.emit("error",k),this.saxParser.errThrown=!0}},v.prototype.parseStringPromise=function(i){return new h.default(function(R){return function(k,d){return R.parseString(i,function(b,x){return b?d(b):k(x)})}}(this))},v}(f),N.parseString=function(w,v,i){var R,k,d;return i!=null?(typeof i=="function"&&(R=i),(typeof v=="undefined"?"undefined":(0,g.default)(v))==="object"&&(k=v)):(typeof v=="function"&&(R=v),k={}),d=new N.Parser(k),d.parseString(w,R)},N.parseStringPromise=function(w,v){var i,R;return(typeof v=="undefined"?"undefined":(0,g.default)(v))==="object"&&(i=v),R=new N.Parser(i),R.parseStringPromise(w)}}).call(void 0)},{"./bom":244,"./defaults":246,"./processors":248,"babel-runtime/core-js/object/get-own-property-names":58,"babel-runtime/core-js/object/keys":60,"babel-runtime/core-js/promise":61,"babel-runtime/helpers/typeof":67,events:192,sax:229,timers:236}],248:[function(M,ne,N){"use strict";(function(){"use strict";var I;I=new RegExp(/(?!xmlns)^.*:/),N.normalize=function(h){return h.toLowerCase()},N.firstCharLowerCase=function(h){return h.charAt(0).toLowerCase()+h.slice(1)},N.stripPrefix=function(h){return h.replace(I,"")},N.parseNumbers=function(h){return isNaN(h)||(h=h%1===0?parseInt(h,10):parseFloat(h)),h},N.parseBooleans=function(h){return/^(?:true|false)$/i.test(h)&&(h=h.toLowerCase()==="true"),h}}).call(void 0)},{}],249:[function(M,ne,N){"use strict";(function(){"use strict";var I,h,S,L,T=function(g,s){for(var a in s)c.call(s,a)&&(g[a]=s[a]);function r(){this.constructor=g}return r.prototype=s.prototype,g.prototype=new r,g.__super__=s.prototype,g},c={}.hasOwnProperty;h=M("./defaults"),I=M("./builder"),S=M("./parser"),L=M("./processors"),N.defaults=h.defaults,N.processors=L,N.ValidationError=function(C){T(g,C);function g(s){this.message=s}return g}(Error),N.Builder=I.Builder,N.Parser=S.Parser,N.parseString=S.parseString,N.parseStringPromise=S.parseStringPromise}).call(void 0)},{"./builder":245,"./defaults":246,"./parser":247,"./processors":248}],250:[function(M,ne,N){"use strict";(function(){ne.exports={Disconnected:1,Preceding:2,Following:4,Contains:8,ContainedBy:16,ImplementationSpecific:32}}).call(void 0)},{}],251:[function(M,ne,N){"use strict";(function(){ne.exports={Element:1,Attribute:2,Text:3,CData:4,EntityReference:5,EntityDeclaration:6,ProcessingInstruction:7,Comment:8,Document:9,DocType:10,DocumentFragment:11,NotationDeclaration:12,Declaration:201,Raw:202,AttributeDeclaration:203,ElementDeclaration:204,Dummy:205}}).call(void 0)},{}],252:[function(M,ne,N){"use strict";var I=M("babel-runtime/core-js/object/get-prototype-of"),h=C(I),S=M("babel-runtime/helpers/typeof"),L=C(S),T=M("babel-runtime/core-js/object/assign"),c=C(T);function C(g){return g&&g.__esModule?g:{default:g}}(function(){var g,s,a,r,f,p,m,E=[].slice,y={}.hasOwnProperty;g=function(){var n,o,l,w,v,i;if(i=arguments[0],v=2<=arguments.length?E.call(arguments,1):[],f(c.default))c.default.apply(null,arguments);else for(n=0,l=v.length;n<l;n++)if(w=v[n],w!=null)for(o in w){if(!y.call(w,o))continue;i[o]=w[o]}return i},f=function(n){return!!n&&Object.prototype.toString.call(n)==="[object Function]"},p=function(n){var o;return!!n&&((o=typeof n=="undefined"?"undefined":(0,L.default)(n))==="function"||o==="object")},a=function(n){return f(Array.isArray)?Array.isArray(n):Object.prototype.toString.call(n)==="[object Array]"},r=function(n){var o;if(a(n))return!n.length;for(o in n){if(!y.call(n,o))continue;return!1}return!0},m=function(n){var o,l;return p(n)&&(l=(0,h.default)(n))&&(o=l.constructor)&&typeof o=="function"&&o instanceof o&&Function.prototype.toString.call(o)===Function.prototype.toString.call(Object)},s=function(n){return f(n.valueOf)?n.valueOf():n},ne.exports.assign=g,ne.exports.isFunction=f,ne.exports.isObject=p,ne.exports.isArray=a,ne.exports.isEmpty=r,ne.exports.isPlainObject=m,ne.exports.getValue=s}).call(void 0)},{"babel-runtime/core-js/object/assign":54,"babel-runtime/core-js/object/get-prototype-of":59,"babel-runtime/helpers/typeof":67}],253:[function(M,ne,N){"use strict";(function(){ne.exports={None:0,OpenTag:1,InsideTag:2,CloseTag:3}}).call(void 0)},{}],254:[function(M,ne,N){"use strict";var I=M("babel-runtime/core-js/object/create"),h=S(I);function S(L){return L&&L.__esModule?L:{default:L}}(function(){var L,T,c;L=M("./NodeType"),c=M("./XMLNode"),ne.exports=T=function(){function C(g,s,a){if(this.parent=g,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),s==null)throw new Error("Missing attribute name. "+this.debugInfo(s));this.name=this.stringify.name(s),this.value=this.stringify.attValue(a),this.type=L.Attribute,this.isId=!1,this.schemaTypeInfo=null}return Object.defineProperty(C.prototype,"nodeType",{get:function(){return this.type}}),Object.defineProperty(C.prototype,"ownerElement",{get:function(){return this.parent}}),Object.defineProperty(C.prototype,"textContent",{get:function(){return this.value},set:function(s){return this.value=s||""}}),Object.defineProperty(C.prototype,"namespaceURI",{get:function(){return""}}),Object.defineProperty(C.prototype,"prefix",{get:function(){return""}}),Object.defineProperty(C.prototype,"localName",{get:function(){return this.name}}),Object.defineProperty(C.prototype,"specified",{get:function(){return!0}}),C.prototype.clone=function(){return(0,h.default)(this)},C.prototype.toString=function(g){return this.options.writer.attribute(this,this.options.writer.filterOptions(g))},C.prototype.debugInfo=function(g){return g=g||this.name,g==null?"parent: <"+this.parent.name+">":"attribute: {"+g+"}, parent: <"+this.parent.name+">"},C.prototype.isEqualNode=function(g){return g.namespaceURI!==this.namespaceURI||(g.prefix!==this.prefix||g.localName!==this.localName)?!1:!(g.value!==this.value)},C}()}).call(void 0)},{"./NodeType":251,"./XMLNode":273,"babel-runtime/core-js/object/create":55}],255:[function(M,ne,N){"use strict";var I=M("babel-runtime/core-js/object/create"),h=S(I);function S(L){return L&&L.__esModule?L:{default:L}}(function(){var L,T,c,C=function(a,r){for(var f in r)g.call(r,f)&&(a[f]=r[f]);function p(){this.constructor=a}return p.prototype=r.prototype,a.prototype=new p,a.__super__=r.prototype,a},g={}.hasOwnProperty;L=M("./NodeType"),c=M("./XMLCharacterData"),ne.exports=T=function(s){C(a,s);function a(r,f){if(a.__super__.constructor.call(this,r),f==null)throw new Error("Missing CDATA text. "+this.debugInfo());this.name="#cdata-section",this.type=L.CData,this.value=this.stringify.cdata(f)}return a.prototype.clone=function(){return(0,h.default)(this)},a.prototype.toString=function(r){return this.options.writer.cdata(this,this.options.writer.filterOptions(r))},a}(c)}).call(void 0)},{"./NodeType":251,"./XMLCharacterData":256,"babel-runtime/core-js/object/create":55}],256:[function(M,ne,N){"use strict";var I=M("babel-runtime/core-js/object/create"),h=S(I);function S(L){return L&&L.__esModule?L:{default:L}}(function(){var L,T,c=function(s,a){for(var r in a)C.call(a,r)&&(s[r]=a[r]);function f(){this.constructor=s}return f.prototype=a.prototype,s.prototype=new f,s.__super__=a.prototype,s},C={}.hasOwnProperty;T=M("./XMLNode"),ne.exports=L=function(g){c(s,g);function s(a){s.__super__.constructor.call(this,a),this.value=""}return Object.defineProperty(s.prototype,"data",{get:function(){return this.value},set:function(r){return this.value=r||""}}),Object.defineProperty(s.prototype,"length",{get:function(){return this.value.length}}),Object.defineProperty(s.prototype,"textContent",{get:function(){return this.value},set:function(r){return this.value=r||""}}),s.prototype.clone=function(){return(0,h.default)(this)},s.prototype.substringData=function(a,r){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.appendData=function(a){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.insertData=function(a,r){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.deleteData=function(a,r){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.replaceData=function(a,r,f){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.isEqualNode=function(a){return s.__super__.isEqualNode.apply(this,arguments).isEqualNode(a)?!(a.data!==this.data):!1},s}(T)}).call(void 0)},{"./XMLNode":273,"babel-runtime/core-js/object/create":55}],257:[function(M,ne,N){"use strict";var I=M("babel-runtime/core-js/object/create"),h=S(I);function S(L){return L&&L.__esModule?L:{default:L}}(function(){var L,T,c,C=function(a,r){for(var f in r)g.call(r,f)&&(a[f]=r[f]);function p(){this.constructor=a}return p.prototype=r.prototype,a.prototype=new p,a.__super__=r.prototype,a},g={}.hasOwnProperty;L=M("./NodeType"),T=M("./XMLCharacterData"),ne.exports=c=function(s){C(a,s);function a(r,f){if(a.__super__.constructor.call(this,r),f==null)throw new Error("Missing comment text. "+this.debugInfo());this.name="#comment",this.type=L.Comment,this.value=this.stringify.comment(f)}return a.prototype.clone=function(){return(0,h.default)(this)},a.prototype.toString=function(r){return this.options.writer.comment(this,this.options.writer.filterOptions(r))},a}(T)}).call(void 0)},{"./NodeType":251,"./XMLCharacterData":256,"babel-runtime/core-js/object/create":55}],258:[function(M,ne,N){"use strict";var I=M("babel-runtime/core-js/object/keys"),h=T(I),S=M("babel-runtime/core-js/object/create"),L=T(S);function T(c){return c&&c.__esModule?c:{default:c}}(function(){var c,C,g;C=M("./XMLDOMErrorHandler"),g=M("./XMLDOMStringList"),ne.exports=c=function(){function s(){var a;this.defaultParams={"canonical-form":!1,"cdata-sections":!1,comments:!1,"datatype-normalization":!1,"element-content-whitespace":!0,entities:!0,"error-handler":new C,infoset:!0,"validate-if-schema":!1,namespaces:!0,"namespace-declarations":!0,"normalize-characters":!1,"schema-location":"","schema-type":"","split-cdata-sections":!0,validate:!1,"well-formed":!0},this.params=a=(0,L.default)(this.defaultParams)}return Object.defineProperty(s.prototype,"parameterNames",{get:function(){return new g((0,h.default)(this.defaultParams))}}),s.prototype.getParameter=function(a){return this.params.hasOwnProperty(a)?this.params[a]:null},s.prototype.canSetParameter=function(a,r){return!0},s.prototype.setParameter=function(a,r){return r!=null?this.params[a]=r:delete this.params[a]},s}()}).call(void 0)},{"./XMLDOMErrorHandler":259,"./XMLDOMStringList":261,"babel-runtime/core-js/object/create":55,"babel-runtime/core-js/object/keys":60}],259:[function(M,ne,N){"use strict";(function(){var I;ne.exports=I=function(){function h(){}return h.prototype.handleError=function(S){throw new Error(S)},h}()}).call(void 0)},{}],260:[function(M,ne,N){"use strict";(function(){var I;ne.exports=I=function(){function h(){}return h.prototype.hasFeature=function(S,L){return!0},h.prototype.createDocumentType=function(S,L,T){throw new Error("This DOM method is not implemented.")},h.prototype.createDocument=function(S,L,T){throw new Error("This DOM method is not implemented.")},h.prototype.createHTMLDocument=function(S){throw new Error("This DOM method is not implemented.")},h.prototype.getFeature=function(S,L){throw new Error("This DOM method is not implemented.")},h}()}).call(void 0)},{}],261:[function(M,ne,N){"use strict";(function(){var I;ne.exports=I=function(){function h(S){this.arr=S||[]}return Object.defineProperty(h.prototype,"length",{get:function(){return this.arr.length}}),h.prototype.item=function(S){return this.arr[S]||null},h.prototype.contains=function(S){return this.arr.indexOf(S)!==-1},h}()}).call(void 0)},{}],262:[function(M,ne,N){"use strict";(function(){var I,h,S,L=function(C,g){for(var s in g)T.call(g,s)&&(C[s]=g[s]);function a(){this.constructor=C}return a.prototype=g.prototype,C.prototype=new a,C.__super__=g.prototype,C},T={}.hasOwnProperty;S=M("./XMLNode"),I=M("./NodeType"),ne.exports=h=function(c){L(C,c);function C(g,s,a,r,f,p){if(C.__super__.constructor.call(this,g),s==null)throw new Error("Missing DTD element name. "+this.debugInfo());if(a==null)throw new Error("Missing DTD attribute name. "+this.debugInfo(s));if(!r)throw new Error("Missing DTD attribute type. "+this.debugInfo(s));if(!f)throw new Error("Missing DTD attribute default. "+this.debugInfo(s));if(f.indexOf("#")!==0&&(f="#"+f),!f.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/))throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT. "+this.debugInfo(s));if(p&&!f.match(/^(#FIXED|#DEFAULT)$/))throw new Error("Default value only applies to #FIXED or #DEFAULT. "+this.debugInfo(s));this.elementName=this.stringify.name(s),this.type=I.AttributeDeclaration,this.attributeName=this.stringify.name(a),this.attributeType=this.stringify.dtdAttType(r),p&&(this.defaultValue=this.stringify.dtdAttDefault(p)),this.defaultValueType=f}return C.prototype.toString=function(g){return this.options.writer.dtdAttList(this,this.options.writer.filterOptions(g))},C}(S)}).call(void 0)},{"./NodeType":251,"./XMLNode":273}],263:[function(M,ne,N){"use strict";(function(){var I,h,S,L=function(C,g){for(var s in g)T.call(g,s)&&(C[s]=g[s]);function a(){this.constructor=C}return a.prototype=g.prototype,C.prototype=new a,C.__super__=g.prototype,C},T={}.hasOwnProperty;S=M("./XMLNode"),I=M("./NodeType"),ne.exports=h=function(c){L(C,c);function C(g,s,a){if(C.__super__.constructor.call(this,g),s==null)throw new Error("Missing DTD element name. "+this.debugInfo());a||(a="(#PCDATA)"),Array.isArray(a)&&(a="("+a.join(",")+")"),this.name=this.stringify.name(s),this.type=I.ElementDeclaration,this.value=this.stringify.dtdElementValue(a)}return C.prototype.toString=function(g){return this.options.writer.dtdElement(this,this.options.writer.filterOptions(g))},C}(S)}).call(void 0)},{"./NodeType":251,"./XMLNode":273}],264:[function(M,ne,N){"use strict";(function(){var I,h,S,L,T=function(g,s){for(var a in s)c.call(s,a)&&(g[a]=s[a]);function r(){this.constructor=g}return r.prototype=s.prototype,g.prototype=new r,g.__super__=s.prototype,g},c={}.hasOwnProperty;L=M("./Utility").isObject,S=M("./XMLNode"),I=M("./NodeType"),ne.exports=h=function(C){T(g,C);function g(s,a,r,f){if(g.__super__.constructor.call(this,s),r==null)throw new Error("Missing DTD entity name. "+this.debugInfo(r));if(f==null)throw new Error("Missing DTD entity value. "+this.debugInfo(r));if(this.pe=!!a,this.name=this.stringify.name(r),this.type=I.EntityDeclaration,!L(f))this.value=this.stringify.dtdEntityValue(f),this.internal=!0;else{if(!f.pubID&&!f.sysID)throw new Error("Public and/or system identifiers are required for an external entity. "+this.debugInfo(r));if(f.pubID&&!f.sysID)throw new Error("System identifier is required for a public external entity. "+this.debugInfo(r));if(this.internal=!1,f.pubID!=null&&(this.pubID=this.stringify.dtdPubID(f.pubID)),f.sysID!=null&&(this.sysID=this.stringify.dtdSysID(f.sysID)),f.nData!=null&&(this.nData=this.stringify.dtdNData(f.nData)),this.pe&&this.nData)throw new Error("Notation declaration is not allowed in a parameter entity. "+this.debugInfo(r))}}return Object.defineProperty(g.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(g.prototype,"systemId",{get:function(){return this.sysID}}),Object.defineProperty(g.prototype,"notationName",{get:function(){return this.nData||null}}),Object.defineProperty(g.prototype,"inputEncoding",{get:function(){return null}}),Object.defineProperty(g.prototype,"xmlEncoding",{get:function(){return null}}),Object.defineProperty(g.prototype,"xmlVersion",{get:function(){return null}}),g.prototype.toString=function(s){return this.options.writer.dtdEntity(this,this.options.writer.filterOptions(s))},g}(S)}).call(void 0)},{"./NodeType":251,"./Utility":252,"./XMLNode":273}],265:[function(M,ne,N){"use strict";(function(){var I,h,S,L=function(C,g){for(var s in g)T.call(g,s)&&(C[s]=g[s]);function a(){this.constructor=C}return a.prototype=g.prototype,C.prototype=new a,C.__super__=g.prototype,C},T={}.hasOwnProperty;S=M("./XMLNode"),I=M("./NodeType"),ne.exports=h=function(c){L(C,c);function C(g,s,a){if(C.__super__.constructor.call(this,g),s==null)throw new Error("Missing DTD notation name. "+this.debugInfo(s));if(!a.pubID&&!a.sysID)throw new Error("Public or system identifiers are required for an external entity. "+this.debugInfo(s));this.name=this.stringify.name(s),this.type=I.NotationDeclaration,a.pubID!=null&&(this.pubID=this.stringify.dtdPubID(a.pubID)),a.sysID!=null&&(this.sysID=this.stringify.dtdSysID(a.sysID))}return Object.defineProperty(C.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(C.prototype,"systemId",{get:function(){return this.sysID}}),C.prototype.toString=function(g){return this.options.writer.dtdNotation(this,this.options.writer.filterOptions(g))},C}(S)}).call(void 0)},{"./NodeType":251,"./XMLNode":273}],266:[function(M,ne,N){"use strict";(function(){var I,h,S,L,T=function(g,s){for(var a in s)c.call(s,a)&&(g[a]=s[a]);function r(){this.constructor=g}return r.prototype=s.prototype,g.prototype=new r,g.__super__=s.prototype,g},c={}.hasOwnProperty;L=M("./Utility").isObject,S=M("./XMLNode"),I=M("./NodeType"),ne.exports=h=function(C){T(g,C);function g(s,a,r,f){var p;g.__super__.constructor.call(this,s),L(a)&&(p=a,a=p.version,r=p.encoding,f=p.standalone),a||(a="1.0"),this.type=I.Declaration,this.version=this.stringify.xmlVersion(a),r!=null&&(this.encoding=this.stringify.xmlEncoding(r)),f!=null&&(this.standalone=this.stringify.xmlStandalone(f))}return g.prototype.toString=function(s){return this.options.writer.declaration(this,this.options.writer.filterOptions(s))},g}(S)}).call(void 0)},{"./NodeType":251,"./Utility":252,"./XMLNode":273}],267:[function(M,ne,N){"use strict";(function(){var I,h,S,L,T,c,C,g,s,a=function(p,m){for(var E in m)r.call(m,E)&&(p[E]=m[E]);function y(){this.constructor=p}return y.prototype=m.prototype,p.prototype=new y,p.__super__=m.prototype,p},r={}.hasOwnProperty;s=M("./Utility").isObject,g=M("./XMLNode"),I=M("./NodeType"),h=M("./XMLDTDAttList"),L=M("./XMLDTDEntity"),S=M("./XMLDTDElement"),T=M("./XMLDTDNotation"),C=M("./XMLNamedNodeMap"),ne.exports=c=function(f){a(p,f);function p(m,E,y){var u,n,o,l,w,v;if(p.__super__.constructor.call(this,m),this.type=I.DocType,m.children){for(l=m.children,n=0,o=l.length;n<o;n++)if(u=l[n],u.type===I.Element){this.name=u.name;break}}this.documentObject=m,s(E)&&(w=E,E=w.pubID,y=w.sysID),y==null&&(v=[E,y],y=v[0],E=v[1]),E!=null&&(this.pubID=this.stringify.dtdPubID(E)),y!=null&&(this.sysID=this.stringify.dtdSysID(y))}return Object.defineProperty(p.prototype,"entities",{get:function(){var E,y,u,n,o;for(n={},o=this.children,y=0,u=o.length;y<u;y++)E=o[y],E.type===I.EntityDeclaration&&!E.pe&&(n[E.name]=E);return new C(n)}}),Object.defineProperty(p.prototype,"notations",{get:function(){var E,y,u,n,o;for(n={},o=this.children,y=0,u=o.length;y<u;y++)E=o[y],E.type===I.NotationDeclaration&&(n[E.name]=E);return new C(n)}}),Object.defineProperty(p.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(p.prototype,"systemId",{get:function(){return this.sysID}}),Object.defineProperty(p.prototype,"internalSubset",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),p.prototype.element=function(m,E){var y;return y=new S(this,m,E),this.children.push(y),this},p.prototype.attList=function(m,E,y,u,n){var o;return o=new h(this,m,E,y,u,n),this.children.push(o),this},p.prototype.entity=function(m,E){var y;return y=new L(this,!1,m,E),this.children.push(y),this},p.prototype.pEntity=function(m,E){var y;return y=new L(this,!0,m,E),this.children.push(y),this},p.prototype.notation=function(m,E){var y;return y=new T(this,m,E),this.children.push(y),this},p.prototype.toString=function(m){return this.options.writer.docType(this,this.options.writer.filterOptions(m))},p.prototype.ele=function(m,E){return this.element(m,E)},p.prototype.att=function(m,E,y,u,n){return this.attList(m,E,y,u,n)},p.prototype.ent=function(m,E){return this.entity(m,E)},p.prototype.pent=function(m,E){return this.pEntity(m,E)},p.prototype.not=function(m,E){return this.notation(m,E)},p.prototype.up=function(){return this.root()||this.documentObject},p.prototype.isEqualNode=function(m){return p.__super__.isEqualNode.apply(this,arguments).isEqualNode(m)?m.name!==this.name||m.publicId!==this.publicId?!1:!(m.systemId!==this.systemId):!1},p}(g)}).call(void 0)},{"./NodeType":251,"./Utility":252,"./XMLDTDAttList":262,"./XMLDTDElement":263,"./XMLDTDEntity":264,"./XMLDTDNotation":265,"./XMLNamedNodeMap":272,"./XMLNode":273}],268:[function(M,ne,N){"use strict";(function(){var I,h,S,L,T,c,C,g,s=function(f,p){for(var m in p)a.call(p,m)&&(f[m]=p[m]);function E(){this.constructor=f}return E.prototype=p.prototype,f.prototype=new E,f.__super__=p.prototype,f},a={}.hasOwnProperty;g=M("./Utility").isPlainObject,S=M("./XMLDOMImplementation"),h=M("./XMLDOMConfiguration"),T=M("./XMLNode"),I=M("./NodeType"),C=M("./XMLStringifier"),c=M("./XMLStringWriter"),ne.exports=L=function(r){s(f,r);function f(p){f.__super__.constructor.call(this,null),this.name="#document",this.type=I.Document,this.documentURI=null,this.domConfig=new h,p||(p={}),p.writer||(p.writer=new c),this.options=p,this.stringify=new C(p)}return Object.defineProperty(f.prototype,"implementation",{value:new S}),Object.defineProperty(f.prototype,"doctype",{get:function(){var m,E,y,u;for(u=this.children,E=0,y=u.length;E<y;E++)if(m=u[E],m.type===I.DocType)return m;return null}}),Object.defineProperty(f.prototype,"documentElement",{get:function(){return this.rootObject||null}}),Object.defineProperty(f.prototype,"inputEncoding",{get:function(){return null}}),Object.defineProperty(f.prototype,"strictErrorChecking",{get:function(){return!1}}),Object.defineProperty(f.prototype,"xmlEncoding",{get:function(){return this.children.length!==0&&this.children[0].type===I.Declaration?this.children[0].encoding:null}}),Object.defineProperty(f.prototype,"xmlStandalone",{get:function(){return this.children.length!==0&&this.children[0].type===I.Declaration?this.children[0].standalone==="yes":!1}}),Object.defineProperty(f.prototype,"xmlVersion",{get:function(){return this.children.length!==0&&this.children[0].type===I.Declaration?this.children[0].version:"1.0"}}),Object.defineProperty(f.prototype,"URL",{get:function(){return this.documentURI}}),Object.defineProperty(f.prototype,"origin",{get:function(){return null}}),Object.defineProperty(f.prototype,"compatMode",{get:function(){return null}}),Object.defineProperty(f.prototype,"characterSet",{get:function(){return null}}),Object.defineProperty(f.prototype,"contentType",{get:function(){return null}}),f.prototype.end=function(p){var m;return m={},p?g(p)&&(m=p,p=this.options.writer):p=this.options.writer,p.document(this,p.filterOptions(m))},f.prototype.toString=function(p){return this.options.writer.document(this,this.options.writer.filterOptions(p))},f.prototype.createElement=function(p){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.createDocumentFragment=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.createTextNode=function(p){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.createComment=function(p){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.createCDATASection=function(p){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.createProcessingInstruction=function(p,m){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.createAttribute=function(p){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.createEntityReference=function(p){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.getElementsByTagName=function(p){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.importNode=function(p,m){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.createElementNS=function(p,m){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.createAttributeNS=function(p,m){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.getElementsByTagNameNS=function(p,m){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.getElementById=function(p){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.adoptNode=function(p){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.normalizeDocument=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.renameNode=function(p,m,E){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.getElementsByClassName=function(p){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.createEvent=function(p){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.createRange=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.createNodeIterator=function(p,m,E){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.createTreeWalker=function(p,m,E){throw new Error("This DOM method is not implemented."+this.debugInfo())},f}(T)}).call(void 0)},{"./NodeType":251,"./Utility":252,"./XMLDOMConfiguration":258,"./XMLDOMImplementation":260,"./XMLNode":273,"./XMLStringWriter":278,"./XMLStringifier":279}],269:[function(M,ne,N){"use strict";(function(){var I,h,S,L,T,c,C,g,s,a,r,f,p,m,E,y,u,n,o,l,w,v,i,R,k={}.hasOwnProperty;R=M("./Utility"),v=R.isObject,w=R.isFunction,i=R.isPlainObject,l=R.getValue,I=M("./NodeType"),f=M("./XMLDocument"),m=M("./XMLElement"),L=M("./XMLCData"),T=M("./XMLComment"),y=M("./XMLRaw"),o=M("./XMLText"),E=M("./XMLProcessingInstruction"),a=M("./XMLDeclaration"),r=M("./XMLDocType"),c=M("./XMLDTDAttList"),g=M("./XMLDTDEntity"),C=M("./XMLDTDElement"),s=M("./XMLDTDNotation"),S=M("./XMLAttribute"),n=M("./XMLStringifier"),u=M("./XMLStringWriter"),h=M("./WriterState"),ne.exports=p=function(){function d(b,x,_){var B;this.name="?xml",this.type=I.Document,b||(b={}),B={},b.writer?i(b.writer)&&(B=b.writer,b.writer=new u):b.writer=new u,this.options=b,this.writer=b.writer,this.writerOptions=this.writer.filterOptions(B),this.stringify=new n(b),this.onDataCallback=x||function(){},this.onEndCallback=_||function(){},this.currentNode=null,this.currentLevel=-1,this.openTags={},this.documentStarted=!1,this.documentCompleted=!1,this.root=null}return d.prototype.createChildNode=function(b){var x,_,B,U,P,J,$,z;switch(b.type){case I.CData:this.cdata(b.value);break;case I.Comment:this.comment(b.value);break;case I.Element:B={},$=b.attribs;for(_ in $){if(!k.call($,_))continue;x=$[_],B[_]=x.value}this.node(b.name,B);break;case I.Dummy:this.dummy();break;case I.Raw:this.raw(b.value);break;case I.Text:this.text(b.value);break;case I.ProcessingInstruction:this.instruction(b.target,b.value);break;default:throw new Error("This XML node type is not supported in a JS object: "+b.constructor.name)}for(z=b.children,P=0,J=z.length;P<J;P++)U=z[P],this.createChildNode(U),U.type===I.Element&&this.up();return this},d.prototype.dummy=function(){return this},d.prototype.node=function(b,x,_){var B;if(b==null)throw new Error("Missing node name.");if(this.root&&this.currentLevel===-1)throw new Error("Document can only have one root node. "+this.debugInfo(b));return this.openCurrent(),b=l(b),x==null&&(x={}),x=l(x),v(x)||(B=[x,_],_=B[0],x=B[1]),this.currentNode=new m(this,b,x),this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,_!=null&&this.text(_),this},d.prototype.element=function(b,x,_){var B,U,P,J,$,z;if(this.currentNode&&this.currentNode.type===I.DocType)this.dtdElement.apply(this,arguments);else if(Array.isArray(b)||v(b)||w(b))for(J=this.options.noValidation,this.options.noValidation=!0,z=new f(this.options).element("TEMP_ROOT"),z.element(b),this.options.noValidation=J,$=z.children,U=0,P=$.length;U<P;U++)B=$[U],this.createChildNode(B),B.type===I.Element&&this.up();else this.node(b,x,_);return this},d.prototype.attribute=function(b,x){var _,B;if(!this.currentNode||this.currentNode.children)throw new Error("att() can only be used immediately after an ele() call in callback mode. "+this.debugInfo(b));if(b!=null&&(b=l(b)),v(b))for(_ in b){if(!k.call(b,_))continue;B=b[_],this.attribute(_,B)}else w(x)&&(x=x.apply()),this.options.keepNullAttributes&&x==null?this.currentNode.attribs[b]=new S(this,b,""):x!=null&&(this.currentNode.attribs[b]=new S(this,b,x));return this},d.prototype.text=function(b){var x;return this.openCurrent(),x=new o(this,b),this.onData(this.writer.text(x,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},d.prototype.cdata=function(b){var x;return this.openCurrent(),x=new L(this,b),this.onData(this.writer.cdata(x,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},d.prototype.comment=function(b){var x;return this.openCurrent(),x=new T(this,b),this.onData(this.writer.comment(x,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},d.prototype.raw=function(b){var x;return this.openCurrent(),x=new y(this,b),this.onData(this.writer.raw(x,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},d.prototype.instruction=function(b,x){var _,B,U,P,J;if(this.openCurrent(),b!=null&&(b=l(b)),x!=null&&(x=l(x)),Array.isArray(b))for(_=0,P=b.length;_<P;_++)B=b[_],this.instruction(B);else if(v(b))for(B in b){if(!k.call(b,B))continue;U=b[B],this.instruction(B,U)}else w(x)&&(x=x.apply()),J=new E(this,b,x),this.onData(this.writer.processingInstruction(J,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this},d.prototype.declaration=function(b,x,_){var B;if(this.openCurrent(),this.documentStarted)throw new Error("declaration() must be the first node.");return B=new a(this,b,x,_),this.onData(this.writer.declaration(B,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},d.prototype.doctype=function(b,x,_){if(this.openCurrent(),b==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 r(this,x,_),this.currentNode.rootNodeName=b,this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,this},d.prototype.dtdElement=function(b,x){var _;return this.openCurrent(),_=new C(this,b,x),this.onData(this.writer.dtdElement(_,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},d.prototype.attList=function(b,x,_,B,U){var P;return this.openCurrent(),P=new c(this,b,x,_,B,U),this.onData(this.writer.dtdAttList(P,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},d.prototype.entity=function(b,x){var _;return this.openCurrent(),_=new g(this,!1,b,x),this.onData(this.writer.dtdEntity(_,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},d.prototype.pEntity=function(b,x){var _;return this.openCurrent(),_=new g(this,!0,b,x),this.onData(this.writer.dtdEntity(_,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},d.prototype.notation=function(b,x){var _;return this.openCurrent(),_=new s(this,b,x),this.onData(this.writer.dtdNotation(_,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},d.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},d.prototype.end=function(){for(;this.currentLevel>=0;)this.up();return this.onEnd()},d.prototype.openCurrent=function(){if(this.currentNode)return this.currentNode.children=!0,this.openNode(this.currentNode)},d.prototype.openNode=function(b){var x,_,B,U;if(!b.isOpen){if(!this.root&&this.currentLevel===0&&b.type===I.Element&&(this.root=b),_="",b.type===I.Element){this.writerOptions.state=h.OpenTag,_=this.writer.indent(b,this.writerOptions,this.currentLevel)+"<"+b.name,U=b.attribs;for(B in U){if(!k.call(U,B))continue;x=U[B],_+=this.writer.attribute(x,this.writerOptions,this.currentLevel)}_+=(b.children?">":"/>")+this.writer.endline(b,this.writerOptions,this.currentLevel),this.writerOptions.state=h.InsideTag}else this.writerOptions.state=h.OpenTag,_=this.writer.indent(b,this.writerOptions,this.currentLevel)+"<!DOCTYPE "+b.rootNodeName,b.pubID&&b.sysID?_+=' PUBLIC "'+b.pubID+'" "'+b.sysID+'"':b.sysID&&(_+=' SYSTEM "'+b.sysID+'"'),b.children?(_+=" [",this.writerOptions.state=h.InsideTag):(this.writerOptions.state=h.CloseTag,_+=">"),_+=this.writer.endline(b,this.writerOptions,this.currentLevel);return this.onData(_,this.currentLevel),b.isOpen=!0}},d.prototype.closeNode=function(b){var x;if(!b.isClosed)return x="",this.writerOptions.state=h.CloseTag,b.type===I.Element?x=this.writer.indent(b,this.writerOptions,this.currentLevel)+"</"+b.name+">"+this.writer.endline(b,this.writerOptions,this.currentLevel):x=this.writer.indent(b,this.writerOptions,this.currentLevel)+"]>"+this.writer.endline(b,this.writerOptions,this.currentLevel),this.writerOptions.state=h.None,this.onData(x,this.currentLevel),b.isClosed=!0},d.prototype.onData=function(b,x){return this.documentStarted=!0,this.onDataCallback(b,x+1)},d.prototype.onEnd=function(){return this.documentCompleted=!0,this.onEndCallback()},d.prototype.debugInfo=function(b){return b==null?"":"node: <"+b+">"},d.prototype.ele=function(){return this.element.apply(this,arguments)},d.prototype.nod=function(b,x,_){return this.node(b,x,_)},d.prototype.txt=function(b){return this.text(b)},d.prototype.dat=function(b){return this.cdata(b)},d.prototype.com=function(b){return this.comment(b)},d.prototype.ins=function(b,x){return this.instruction(b,x)},d.prototype.dec=function(b,x,_){return this.declaration(b,x,_)},d.prototype.dtd=function(b,x,_){return this.doctype(b,x,_)},d.prototype.e=function(b,x,_){return this.element(b,x,_)},d.prototype.n=function(b,x,_){return this.node(b,x,_)},d.prototype.t=function(b){return this.text(b)},d.prototype.d=function(b){return this.cdata(b)},d.prototype.c=function(b){return this.comment(b)},d.prototype.r=function(b){return this.raw(b)},d.prototype.i=function(b,x){return this.instruction(b,x)},d.prototype.att=function(){return this.currentNode&&this.currentNode.type===I.DocType?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},d.prototype.a=function(){return this.currentNode&&this.currentNode.type===I.DocType?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},d.prototype.ent=function(b,x){return this.entity(b,x)},d.prototype.pent=function(b,x){return this.pEntity(b,x)},d.prototype.not=function(b,x){return this.notation(b,x)},d}()}).call(void 0)},{"./NodeType":251,"./Utility":252,"./WriterState":253,"./XMLAttribute":254,"./XMLCData":255,"./XMLComment":257,"./XMLDTDAttList":262,"./XMLDTDElement":263,"./XMLDTDEntity":264,"./XMLDTDNotation":265,"./XMLDeclaration":266,"./XMLDocType":267,"./XMLDocument":268,"./XMLElement":271,"./XMLProcessingInstruction":275,"./XMLRaw":276,"./XMLStringWriter":278,"./XMLStringifier":279,"./XMLText":280}],270:[function(M,ne,N){"use strict";var I=M("babel-runtime/core-js/object/create"),h=S(I);function S(L){return L&&L.__esModule?L:{default:L}}(function(){var L,T,c,C=function(a,r){for(var f in r)g.call(r,f)&&(a[f]=r[f]);function p(){this.constructor=a}return p.prototype=r.prototype,a.prototype=new p,a.__super__=r.prototype,a},g={}.hasOwnProperty;c=M("./XMLNode"),L=M("./NodeType"),ne.exports=T=function(s){C(a,s);function a(r){a.__super__.constructor.call(this,r),this.type=L.Dummy}return a.prototype.clone=function(){return(0,h.default)(this)},a.prototype.toString=function(r){return""},a}(c)}).call(void 0)},{"./NodeType":251,"./XMLNode":273,"babel-runtime/core-js/object/create":55}],271:[function(M,ne,N){"use strict";var I=M("babel-runtime/core-js/object/create"),h=S(I);function S(L){return L&&L.__esModule?L:{default:L}}(function(){var L,T,c,C,g,s,a,r,f,p=function(y,u){for(var n in u)m.call(u,n)&&(y[n]=u[n]);function o(){this.constructor=y}return o.prototype=u.prototype,y.prototype=new o,y.__super__=u.prototype,y},m={}.hasOwnProperty;f=M("./Utility"),r=f.isObject,a=f.isFunction,s=f.getValue,g=M("./XMLNode"),L=M("./NodeType"),T=M("./XMLAttribute"),C=M("./XMLNamedNodeMap"),ne.exports=c=function(E){p(y,E);function y(u,n,o){var l,w,v,i;if(y.__super__.constructor.call(this,u),n==null)throw new Error("Missing element name. "+this.debugInfo());if(this.name=this.stringify.name(n),this.type=L.Element,this.attribs={},this.schemaTypeInfo=null,o!=null&&this.attribute(o),u.type===L.Document&&(this.isRoot=!0,this.documentObject=u,u.rootObject=this,u.children)){for(i=u.children,w=0,v=i.length;w<v;w++)if(l=i[w],l.type===L.DocType){l.name=this.name;break}}}return Object.defineProperty(y.prototype,"tagName",{get:function(){return this.name}}),Object.defineProperty(y.prototype,"namespaceURI",{get:function(){return""}}),Object.defineProperty(y.prototype,"prefix",{get:function(){return""}}),Object.defineProperty(y.prototype,"localName",{get:function(){return this.name}}),Object.defineProperty(y.prototype,"id",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(y.prototype,"className",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(y.prototype,"classList",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(y.prototype,"attributes",{get:function(){return(!this.attributeMap||!this.attributeMap.nodes)&&(this.attributeMap=new C(this.attribs)),this.attributeMap}}),y.prototype.clone=function(){var u,n,o,l;o=(0,h.default)(this),o.isRoot&&(o.documentObject=null),o.attribs={},l=this.attribs;for(n in l){if(!m.call(l,n))continue;u=l[n],o.attribs[n]=u.clone()}return o.children=[],this.children.forEach(function(w){var v;return v=w.clone(),v.parent=o,o.children.push(v)}),o},y.prototype.attribute=function(u,n){var o,l;if(u!=null&&(u=s(u)),r(u))for(o in u){if(!m.call(u,o))continue;l=u[o],this.attribute(o,l)}else a(n)&&(n=n.apply()),this.options.keepNullAttributes&&n==null?this.attribs[u]=new T(this,u,""):n!=null&&(this.attribs[u]=new T(this,u,n));return this},y.prototype.removeAttribute=function(u){var n,o,l;if(u==null)throw new Error("Missing attribute name. "+this.debugInfo());if(u=s(u),Array.isArray(u))for(o=0,l=u.length;o<l;o++)n=u[o],delete this.attribs[n];else delete this.attribs[u];return this},y.prototype.toString=function(u){return this.options.writer.element(this,this.options.writer.filterOptions(u))},y.prototype.att=function(u,n){return this.attribute(u,n)},y.prototype.a=function(u,n){return this.attribute(u,n)},y.prototype.getAttribute=function(u){return this.attribs.hasOwnProperty(u)?this.attribs[u].value:null},y.prototype.setAttribute=function(u,n){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.getAttributeNode=function(u){return this.attribs.hasOwnProperty(u)?this.attribs[u]:null},y.prototype.setAttributeNode=function(u){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.removeAttributeNode=function(u){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.getElementsByTagName=function(u){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.getAttributeNS=function(u,n){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.setAttributeNS=function(u,n,o){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.removeAttributeNS=function(u,n){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.getAttributeNodeNS=function(u,n){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.setAttributeNodeNS=function(u){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.getElementsByTagNameNS=function(u,n){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.hasAttribute=function(u){return this.attribs.hasOwnProperty(u)},y.prototype.hasAttributeNS=function(u,n){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.setIdAttribute=function(u,n){return this.attribs.hasOwnProperty(u)?this.attribs[u].isId:n},y.prototype.setIdAttributeNS=function(u,n,o){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.setIdAttributeNode=function(u,n){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.getElementsByTagName=function(u){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.getElementsByTagNameNS=function(u,n){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.getElementsByClassName=function(u){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.isEqualNode=function(u){var n,o,l;if(!y.__super__.isEqualNode.apply(this,arguments).isEqualNode(u))return!1;if(u.namespaceURI!==this.namespaceURI)return!1;if(u.prefix!==this.prefix)return!1;if(u.localName!==this.localName)return!1;if(u.attribs.length!==this.attribs.length)return!1;for(n=o=0,l=this.attribs.length-1;0<=l?o<=l:o>=l;n=0<=l?++o:--o)if(!this.attribs[n].isEqualNode(u.attribs[n]))return!1;return!0},y}(g)}).call(void 0)},{"./NodeType":251,"./Utility":252,"./XMLAttribute":254,"./XMLNamedNodeMap":272,"./XMLNode":273,"babel-runtime/core-js/object/create":55}],272:[function(M,ne,N){"use strict";var I=M("babel-runtime/core-js/object/keys"),h=S(I);function S(L){return L&&L.__esModule?L:{default:L}}(function(){var L;ne.exports=L=function(){function T(c){this.nodes=c}return Object.defineProperty(T.prototype,"length",{get:function(){return(0,h.default)(this.nodes).length||0}}),T.prototype.clone=function(){return this.nodes=null},T.prototype.getNamedItem=function(c){return this.nodes[c]},T.prototype.setNamedItem=function(c){var C;return C=this.nodes[c.nodeName],this.nodes[c.nodeName]=c,C||null},T.prototype.removeNamedItem=function(c){var C;return C=this.nodes[c],delete this.nodes[c],C||null},T.prototype.item=function(c){return this.nodes[(0,h.default)(this.nodes)[c]]||null},T.prototype.getNamedItemNS=function(c,C){throw new Error("This DOM method is not implemented.")},T.prototype.setNamedItemNS=function(c){throw new Error("This DOM method is not implemented.")},T.prototype.removeNamedItemNS=function(c,C){throw new Error("This DOM method is not implemented.")},T}()}).call(void 0)},{"babel-runtime/core-js/object/keys":60}],273:[function(M,ne,N){"use strict";(function(){var I,h,S,L,T,c,C,g,s,a,r,f,p,m,E,y,u,n,o,l={}.hasOwnProperty;o=M("./Utility"),n=o.isObject,u=o.isFunction,y=o.isEmpty,E=o.getValue,g=null,S=null,L=null,T=null,c=null,p=null,m=null,f=null,C=null,h=null,r=null,s=null,I=null,ne.exports=a=function(){function w(v){this.parent=v,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),this.value=null,this.children=[],this.baseURI=null,g||(g=M("./XMLElement"),S=M("./XMLCData"),L=M("./XMLComment"),T=M("./XMLDeclaration"),c=M("./XMLDocType"),p=M("./XMLRaw"),m=M("./XMLText"),f=M("./XMLProcessingInstruction"),C=M("./XMLDummy"),h=M("./NodeType"),r=M("./XMLNodeList"),s=M("./XMLNamedNodeMap"),I=M("./DocumentPosition"))}return Object.defineProperty(w.prototype,"nodeName",{get:function(){return this.name}}),Object.defineProperty(w.prototype,"nodeType",{get:function(){return this.type}}),Object.defineProperty(w.prototype,"nodeValue",{get:function(){return this.value}}),Object.defineProperty(w.prototype,"parentNode",{get:function(){return this.parent}}),Object.defineProperty(w.prototype,"childNodes",{get:function(){return(!this.childNodeList||!this.childNodeList.nodes)&&(this.childNodeList=new r(this.children)),this.childNodeList}}),Object.defineProperty(w.prototype,"firstChild",{get:function(){return this.children[0]||null}}),Object.defineProperty(w.prototype,"lastChild",{get:function(){return this.children[this.children.length-1]||null}}),Object.defineProperty(w.prototype,"previousSibling",{get:function(){var i;return i=this.parent.children.indexOf(this),this.parent.children[i-1]||null}}),Object.defineProperty(w.prototype,"nextSibling",{get:function(){var i;return i=this.parent.children.indexOf(this),this.parent.children[i+1]||null}}),Object.defineProperty(w.prototype,"ownerDocument",{get:function(){return this.document()||null}}),Object.defineProperty(w.prototype,"textContent",{get:function(){var i,R,k,d,b;if(this.nodeType===h.Element||this.nodeType===h.DocumentFragment){for(b="",d=this.children,R=0,k=d.length;R<k;R++)i=d[R],i.textContent&&(b+=i.textContent);return b}else return null},set:function(i){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),w.prototype.setParent=function(v){var i,R,k,d,b;for(this.parent=v,v&&(this.options=v.options,this.stringify=v.stringify),d=this.children,b=[],R=0,k=d.length;R<k;R++)i=d[R],b.push(i.setParent(this));return b},w.prototype.element=function(v,i,R){var k,d,b,x,_,B,U,P,J,$,z;if(B=null,i===null&&R==null&&(J=[{},null],i=J[0],R=J[1]),i==null&&(i={}),i=E(i),n(i)||($=[i,R],R=$[0],i=$[1]),v!=null&&(v=E(v)),Array.isArray(v))for(b=0,U=v.length;b<U;b++)d=v[b],B=this.element(d);else if(u(v))B=this.element(v.apply());else if(n(v))for(_ in v){if(!l.call(v,_))continue;if(z=v[_],u(z)&&(z=z.apply()),!this.options.ignoreDecorators&&this.stringify.convertAttKey&&_.indexOf(this.stringify.convertAttKey)===0)B=this.attribute(_.substr(this.stringify.convertAttKey.length),z);else if(!this.options.separateArrayItems&&Array.isArray(z)&&y(z))B=this.dummy();else if(n(z)&&y(z))B=this.element(_);else if(!this.options.keepNullNodes&&z==null)B=this.dummy();else if(!this.options.separateArrayItems&&Array.isArray(z))for(x=0,P=z.length;x<P;x++)d=z[x],k={},k[_]=d,B=this.element(k);else n(z)?!this.options.ignoreDecorators&&this.stringify.convertTextKey&&_.indexOf(this.stringify.convertTextKey)===0?B=this.element(z):(B=this.element(_),B.element(z)):B=this.element(_,z)}else!this.options.keepNullNodes&&R===null?B=this.dummy():!this.options.ignoreDecorators&&this.stringify.convertTextKey&&v.indexOf(this.stringify.convertTextKey)===0?B=this.text(R):!this.options.ignoreDecorators&&this.stringify.convertCDataKey&&v.indexOf(this.stringify.convertCDataKey)===0?B=this.cdata(R):!this.options.ignoreDecorators&&this.stringify.convertCommentKey&&v.indexOf(this.stringify.convertCommentKey)===0?B=this.comment(R):!this.options.ignoreDecorators&&this.stringify.convertRawKey&&v.indexOf(this.stringify.convertRawKey)===0?B=this.raw(R):!this.options.ignoreDecorators&&this.stringify.convertPIKey&&v.indexOf(this.stringify.convertPIKey)===0?B=this.instruction(v.substr(this.stringify.convertPIKey.length),R):B=this.node(v,i,R);if(B==null)throw new Error("Could not create any elements with: "+v+". "+this.debugInfo());return B},w.prototype.insertBefore=function(v,i,R){var k,d,b,x,_;if(v!=null?v.type:void 0)return b=v,x=i,b.setParent(this),x?(d=children.indexOf(x),_=children.splice(d),children.push(b),Array.prototype.push.apply(children,_)):children.push(b),b;if(this.isRoot)throw new Error("Cannot insert elements at root level. "+this.debugInfo(v));return d=this.parent.children.indexOf(this),_=this.parent.children.splice(d),k=this.parent.element(v,i,R),Array.prototype.push.apply(this.parent.children,_),k},w.prototype.insertAfter=function(v,i,R){var k,d,b;if(this.isRoot)throw new Error("Cannot insert elements at root level. "+this.debugInfo(v));return d=this.parent.children.indexOf(this),b=this.parent.children.splice(d+1),k=this.parent.element(v,i,R),Array.prototype.push.apply(this.parent.children,b),k},w.prototype.remove=function(){var v,i;if(this.isRoot)throw new Error("Cannot remove the root element. "+this.debugInfo());return v=this.parent.children.indexOf(this),[].splice.apply(this.parent.children,[v,v-v+1].concat(i=[])),this.parent},w.prototype.node=function(v,i,R){var k,d;return v!=null&&(v=E(v)),i||(i={}),i=E(i),n(i)||(d=[i,R],R=d[0],i=d[1]),k=new g(this,v,i),R!=null&&k.text(R),this.children.push(k),k},w.prototype.text=function(v){var i;return n(v)&&this.element(v),i=new m(this,v),this.children.push(i),this},w.prototype.cdata=function(v){var i;return i=new S(this,v),this.children.push(i),this},w.prototype.comment=function(v){var i;return i=new L(this,v),this.children.push(i),this},w.prototype.commentBefore=function(v){var i,R,k;return R=this.parent.children.indexOf(this),k=this.parent.children.splice(R),i=this.parent.comment(v),Array.prototype.push.apply(this.parent.children,k),this},w.prototype.commentAfter=function(v){var i,R,k;return R=this.parent.children.indexOf(this),k=this.parent.children.splice(R+1),i=this.parent.comment(v),Array.prototype.push.apply(this.parent.children,k),this},w.prototype.raw=function(v){var i;return i=new p(this,v),this.children.push(i),this},w.prototype.dummy=function(){var v;return v=new C(this),v},w.prototype.instruction=function(v,i){var R,k,d,b,x;if(v!=null&&(v=E(v)),i!=null&&(i=E(i)),Array.isArray(v))for(b=0,x=v.length;b<x;b++)R=v[b],this.instruction(R);else if(n(v))for(R in v){if(!l.call(v,R))continue;k=v[R],this.instruction(R,k)}else u(i)&&(i=i.apply()),d=new f(this,v,i),this.children.push(d);return this},w.prototype.instructionBefore=function(v,i){var R,k,d;return k=this.parent.children.indexOf(this),d=this.parent.children.splice(k),R=this.parent.instruction(v,i),Array.prototype.push.apply(this.parent.children,d),this},w.prototype.instructionAfter=function(v,i){var R,k,d;return k=this.parent.children.indexOf(this),d=this.parent.children.splice(k+1),R=this.parent.instruction(v,i),Array.prototype.push.apply(this.parent.children,d),this},w.prototype.declaration=function(v,i,R){var k,d;return k=this.document(),d=new T(k,v,i,R),k.children.length===0?k.children.unshift(d):k.children[0].type===h.Declaration?k.children[0]=d:k.children.unshift(d),k.root()||k},w.prototype.dtd=function(v,i){var R,k,d,b,x,_,B,U,P,J;for(k=this.document(),d=new c(k,v,i),P=k.children,b=x=0,B=P.length;x<B;b=++x)if(R=P[b],R.type===h.DocType)return k.children[b]=d,d;for(J=k.children,b=_=0,U=J.length;_<U;b=++_)if(R=J[b],R.isRoot)return k.children.splice(b,0,d),d;return k.children.push(d),d},w.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},w.prototype.root=function(){var v;for(v=this;v;){if(v.type===h.Document)return v.rootObject;if(v.isRoot)return v;v=v.parent}},w.prototype.document=function(){var v;for(v=this;v;){if(v.type===h.Document)return v;v=v.parent}},w.prototype.end=function(v){return this.document().end(v)},w.prototype.prev=function(){var v;if(v=this.parent.children.indexOf(this),v<1)throw new Error("Already at the first node. "+this.debugInfo());return this.parent.children[v-1]},w.prototype.next=function(){var v;if(v=this.parent.children.indexOf(this),v===-1||v===this.parent.children.length-1)throw new Error("Already at the last node. "+this.debugInfo());return this.parent.children[v+1]},w.prototype.importDocument=function(v){var i;return i=v.root().clone(),i.parent=this,i.isRoot=!1,this.children.push(i),this},w.prototype.debugInfo=function(v){var i,R;return v=v||this.name,v==null&&!((i=this.parent)!=null?i.name:void 0)?"":v==null?"parent: <"+this.parent.name+">":((R=this.parent)!=null?R.name:void 0)?"node: <"+v+">, parent: <"+this.parent.name+">":"node: <"+v+">"},w.prototype.ele=function(v,i,R){return this.element(v,i,R)},w.prototype.nod=function(v,i,R){return this.node(v,i,R)},w.prototype.txt=function(v){return this.text(v)},w.prototype.dat=function(v){return this.cdata(v)},w.prototype.com=function(v){return this.comment(v)},w.prototype.ins=function(v,i){return this.instruction(v,i)},w.prototype.doc=function(){return this.document()},w.prototype.dec=function(v,i,R){return this.declaration(v,i,R)},w.prototype.e=function(v,i,R){return this.element(v,i,R)},w.prototype.n=function(v,i,R){return this.node(v,i,R)},w.prototype.t=function(v){return this.text(v)},w.prototype.d=function(v){return this.cdata(v)},w.prototype.c=function(v){return this.comment(v)},w.prototype.r=function(v){return this.raw(v)},w.prototype.i=function(v,i){return this.instruction(v,i)},w.prototype.u=function(){return this.up()},w.prototype.importXMLBuilder=function(v){return this.importDocument(v)},w.prototype.replaceChild=function(v,i){throw new Error("This DOM method is not implemented."+this.debugInfo())},w.prototype.removeChild=function(v){throw new Error("This DOM method is not implemented."+this.debugInfo())},w.prototype.appendChild=function(v){throw new Error("This DOM method is not implemented."+this.debugInfo())},w.prototype.hasChildNodes=function(){return this.children.length!==0},w.prototype.cloneNode=function(v){throw new Error("This DOM method is not implemented."+this.debugInfo())},w.prototype.normalize=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},w.prototype.isSupported=function(v,i){return!0},w.prototype.hasAttributes=function(){return this.attribs.length!==0},w.prototype.compareDocumentPosition=function(v){var i,R;return i=this,i===v?0:this.document()!==v.document()?(R=I.Disconnected|I.ImplementationSpecific,Math.random()<.5?R|=I.Preceding:R|=I.Following,R):i.isAncestor(v)?I.Contains|I.Preceding:i.isDescendant(v)?I.Contains|I.Following:i.isPreceding(v)?I.Preceding:I.Following},w.prototype.isSameNode=function(v){throw new Error("This DOM method is not implemented."+this.debugInfo())},w.prototype.lookupPrefix=function(v){throw new Error("This DOM method is not implemented."+this.debugInfo())},w.prototype.isDefaultNamespace=function(v){throw new Error("This DOM method is not implemented."+this.debugInfo())},w.prototype.lookupNamespaceURI=function(v){throw new Error("This DOM method is not implemented."+this.debugInfo())},w.prototype.isEqualNode=function(v){var i,R,k;if(v.nodeType!==this.nodeType)return!1;if(v.children.length!==this.children.length)return!1;for(i=R=0,k=this.children.length-1;0<=k?R<=k:R>=k;i=0<=k?++R:--R)if(!this.children[i].isEqualNode(v.children[i]))return!1;return!0},w.prototype.getFeature=function(v,i){throw new Error("This DOM method is not implemented."+this.debugInfo())},w.prototype.setUserData=function(v,i,R){throw new Error("This DOM method is not implemented."+this.debugInfo())},w.prototype.getUserData=function(v){throw new Error("This DOM method is not implemented."+this.debugInfo())},w.prototype.contains=function(v){return v?v===this||this.isDescendant(v):!1},w.prototype.isDescendant=function(v){var i,R,k,d,b;for(b=this.children,k=0,d=b.length;k<d;k++){if(i=b[k],v===i)return!0;if(R=i.isDescendant(v),R)return!0}return!1},w.prototype.isAncestor=function(v){return v.isDescendant(this)},w.prototype.isPreceding=function(v){var i,R;return i=this.treePosition(v),R=this.treePosition(this),i===-1||R===-1?!1:i<R},w.prototype.isFollowing=function(v){var i,R;return i=this.treePosition(v),R=this.treePosition(this),i===-1||R===-1?!1:i>R},w.prototype.treePosition=function(v){var i,R;return R=0,i=!1,this.foreachTreeNode(this.document(),function(k){if(R++,!i&&k===v)return i=!0}),i?R:-1},w.prototype.foreachTreeNode=function(v,i){var R,k,d,b,x;for(v||(v=this.document()),b=v.children,k=0,d=b.length;k<d;k++){if(R=b[k],x=i(R))return x;if(x=this.foreachTreeNode(R,i),x)return x}},w}()}).call(void 0)},{"./DocumentPosition":250,"./NodeType":251,"./Utility":252,"./XMLCData":255,"./XMLComment":257,"./XMLDeclaration":266,"./XMLDocType":267,"./XMLDummy":270,"./XMLElement":271,"./XMLNamedNodeMap":272,"./XMLNodeList":274,"./XMLProcessingInstruction":275,"./XMLRaw":276,"./XMLText":280}],274:[function(M,ne,N){"use strict";(function(){var I;ne.exports=I=function(){function h(S){this.nodes=S}return Object.defineProperty(h.prototype,"length",{get:function(){return this.nodes.length||0}}),h.prototype.clone=function(){return this.nodes=null},h.prototype.item=function(S){return this.nodes[S]||null},h}()}).call(void 0)},{}],275:[function(M,ne,N){"use strict";var I=M("babel-runtime/core-js/object/create"),h=S(I);function S(L){return L&&L.__esModule?L:{default:L}}(function(){var L,T,c,C=function(a,r){for(var f in r)g.call(r,f)&&(a[f]=r[f]);function p(){this.constructor=a}return p.prototype=r.prototype,a.prototype=new p,a.__super__=r.prototype,a},g={}.hasOwnProperty;L=M("./NodeType"),T=M("./XMLCharacterData"),ne.exports=c=function(s){C(a,s);function a(r,f,p){if(a.__super__.constructor.call(this,r),f==null)throw new Error("Missing instruction target. "+this.debugInfo());this.type=L.ProcessingInstruction,this.target=this.stringify.insTarget(f),this.name=this.target,p&&(this.value=this.stringify.insValue(p))}return a.prototype.clone=function(){return(0,h.default)(this)},a.prototype.toString=function(r){return this.options.writer.processingInstruction(this,this.options.writer.filterOptions(r))},a.prototype.isEqualNode=function(r){return a.__super__.isEqualNode.apply(this,arguments).isEqualNode(r)?!(r.target!==this.target):!1},a}(T)}).call(void 0)},{"./NodeType":251,"./XMLCharacterData":256,"babel-runtime/core-js/object/create":55}],276:[function(M,ne,N){"use strict";var I=M("babel-runtime/core-js/object/create"),h=S(I);function S(L){return L&&L.__esModule?L:{default:L}}(function(){var L,T,c,C=function(a,r){for(var f in r)g.call(r,f)&&(a[f]=r[f]);function p(){this.constructor=a}return p.prototype=r.prototype,a.prototype=new p,a.__super__=r.prototype,a},g={}.hasOwnProperty;L=M("./NodeType"),T=M("./XMLNode"),ne.exports=c=function(s){C(a,s);function a(r,f){if(a.__super__.constructor.call(this,r),f==null)throw new Error("Missing raw text. "+this.debugInfo());this.type=L.Raw,this.value=this.stringify.raw(f)}return a.prototype.clone=function(){return(0,h.default)(this)},a.prototype.toString=function(r){return this.options.writer.raw(this,this.options.writer.filterOptions(r))},a}(T)}).call(void 0)},{"./NodeType":251,"./XMLNode":273,"babel-runtime/core-js/object/create":55}],277:[function(M,ne,N){"use strict";(function(){var I,h,S,L,T=function(g,s){for(var a in s)c.call(s,a)&&(g[a]=s[a]);function r(){this.constructor=g}return r.prototype=s.prototype,g.prototype=new r,g.__super__=s.prototype,g},c={}.hasOwnProperty;I=M("./NodeType"),L=M("./XMLWriterBase"),h=M("./WriterState"),ne.exports=S=function(C){T(g,C);function g(s,a){this.stream=s,g.__super__.constructor.call(this,a)}return g.prototype.endline=function(s,a,r){return s.isLastRootNode&&a.state===h.CloseTag?"":g.__super__.endline.call(this,s,a,r)},g.prototype.document=function(s,a){var r,f,p,m,E,y,u,n,o;for(u=s.children,f=p=0,E=u.length;p<E;f=++p)r=u[f],r.isLastRootNode=f===s.children.length-1;for(a=this.filterOptions(a),n=s.children,o=[],m=0,y=n.length;m<y;m++)r=n[m],o.push(this.writeChildNode(r,a,0));return o},g.prototype.attribute=function(s,a,r){return this.stream.write(g.__super__.attribute.call(this,s,a,r))},g.prototype.cdata=function(s,a,r){return this.stream.write(g.__super__.cdata.call(this,s,a,r))},g.prototype.comment=function(s,a,r){return this.stream.write(g.__super__.comment.call(this,s,a,r))},g.prototype.declaration=function(s,a,r){return this.stream.write(g.__super__.declaration.call(this,s,a,r))},g.prototype.docType=function(s,a,r){var f,p,m,E;if(r||(r=0),this.openNode(s,a,r),a.state=h.OpenTag,this.stream.write(this.indent(s,a,r)),this.stream.write("<!DOCTYPE "+s.root().name),s.pubID&&s.sysID?this.stream.write(' PUBLIC "'+s.pubID+'" "'+s.sysID+'"'):s.sysID&&this.stream.write(' SYSTEM "'+s.sysID+'"'),s.children.length>0){for(this.stream.write(" ["),this.stream.write(this.endline(s,a,r)),a.state=h.InsideTag,E=s.children,p=0,m=E.length;p<m;p++)f=E[p],this.writeChildNode(f,a,r+1);a.state=h.CloseTag,this.stream.write("]")}return a.state=h.CloseTag,this.stream.write(a.spaceBeforeSlash+">"),this.stream.write(this.endline(s,a,r)),a.state=h.None,this.closeNode(s,a,r)},g.prototype.element=function(s,a,r){var f,p,m,E,y,u,n,o,l,w;r||(r=0),this.openNode(s,a,r),a.state=h.OpenTag,this.stream.write(this.indent(s,a,r)+"<"+s.name),l=s.attribs;for(n in l){if(!c.call(l,n))continue;f=l[n],this.attribute(f,a,r)}if(m=s.children.length,E=m===0?null:s.children[0],m===0||s.children.every(function(v){return(v.type===I.Text||v.type===I.Raw)&&v.value===""}))a.allowEmpty?(this.stream.write(">"),a.state=h.CloseTag,this.stream.write("</"+s.name+">")):(a.state=h.CloseTag,this.stream.write(a.spaceBeforeSlash+"/>"));else if(a.pretty&&m===1&&(E.type===I.Text||E.type===I.Raw)&&E.value!=null)this.stream.write(">"),a.state=h.InsideTag,a.suppressPrettyCount++,o=!0,this.writeChildNode(E,a,r+1),a.suppressPrettyCount--,o=!1,a.state=h.CloseTag,this.stream.write("</"+s.name+">");else{for(this.stream.write(">"+this.endline(s,a,r)),a.state=h.InsideTag,w=s.children,y=0,u=w.length;y<u;y++)p=w[y],this.writeChildNode(p,a,r+1);a.state=h.CloseTag,this.stream.write(this.indent(s,a,r)+"</"+s.name+">")}return this.stream.write(this.endline(s,a,r)),a.state=h.None,this.closeNode(s,a,r)},g.prototype.processingInstruction=function(s,a,r){return this.stream.write(g.__super__.processingInstruction.call(this,s,a,r))},g.prototype.raw=function(s,a,r){return this.stream.write(g.__super__.raw.call(this,s,a,r))},g.prototype.text=function(s,a,r){return this.stream.write(g.__super__.text.call(this,s,a,r))},g.prototype.dtdAttList=function(s,a,r){return this.stream.write(g.__super__.dtdAttList.call(this,s,a,r))},g.prototype.dtdElement=function(s,a,r){return this.stream.write(g.__super__.dtdElement.call(this,s,a,r))},g.prototype.dtdEntity=function(s,a,r){return this.stream.write(g.__super__.dtdEntity.call(this,s,a,r))},g.prototype.dtdNotation=function(s,a,r){return this.stream.write(g.__super__.dtdNotation.call(this,s,a,r))},g}(L)}).call(void 0)},{"./NodeType":251,"./WriterState":253,"./XMLWriterBase":281}],278:[function(M,ne,N){"use strict";(function(){var I,h,S=function(c,C){for(var g in C)L.call(C,g)&&(c[g]=C[g]);function s(){this.constructor=c}return s.prototype=C.prototype,c.prototype=new s,c.__super__=C.prototype,c},L={}.hasOwnProperty;h=M("./XMLWriterBase"),ne.exports=I=function(T){S(c,T);function c(C){c.__super__.constructor.call(this,C)}return c.prototype.document=function(C,g){var s,a,r,f,p;for(g=this.filterOptions(g),f="",p=C.children,a=0,r=p.length;a<r;a++)s=p[a],f+=this.writeChildNode(s,g,0);return g.pretty&&f.slice(-g.newline.length)===g.newline&&(f=f.slice(0,-g.newline.length)),f},c}(h)}).call(void 0)},{"./XMLWriterBase":281}],279:[function(M,ne,N){"use strict";(function(){var I,h=function(T,c){return function(){return T.apply(c,arguments)}},S={}.hasOwnProperty;ne.exports=I=function(){function L(T){this.assertLegalName=h(this.assertLegalName,this),this.assertLegalChar=h(this.assertLegalChar,this);var c,C,g;T||(T={}),this.options=T,this.options.version||(this.options.version="1.0"),C=T.stringify||{};for(c in C){if(!S.call(C,c))continue;g=C[c],this[c]=g}}return L.prototype.name=function(T){return this.options.noValidation?T:this.assertLegalName(""+T||"")},L.prototype.text=function(T){return this.options.noValidation?T:this.assertLegalChar(this.textEscape(""+T||""))},L.prototype.cdata=function(T){return this.options.noValidation?T:(T=""+T||"",T=T.replace("]]>","]]]]><![CDATA[>"),this.assertLegalChar(T))},L.prototype.comment=function(T){if(this.options.noValidation)return T;if(T=""+T||"",T.match(/--/))throw new Error("Comment text cannot contain double-hypen: "+T);return this.assertLegalChar(T)},L.prototype.raw=function(T){return this.options.noValidation?T:""+T||""},L.prototype.attValue=function(T){return this.options.noValidation?T:this.assertLegalChar(this.attEscape(T=""+T||""))},L.prototype.insTarget=function(T){return this.options.noValidation?T:this.assertLegalChar(""+T||"")},L.prototype.insValue=function(T){if(this.options.noValidation)return T;if(T=""+T||"",T.match(/\?>/))throw new Error("Invalid processing instruction value: "+T);return this.assertLegalChar(T)},L.prototype.xmlVersion=function(T){if(this.options.noValidation)return T;if(T=""+T||"",!T.match(/1\.[0-9]+/))throw new Error("Invalid version number: "+T);return T},L.prototype.xmlEncoding=function(T){if(this.options.noValidation)return T;if(T=""+T||"",!T.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/))throw new Error("Invalid encoding: "+T);return this.assertLegalChar(T)},L.prototype.xmlStandalone=function(T){return this.options.noValidation?T:T?"yes":"no"},L.prototype.dtdPubID=function(T){return this.options.noValidation?T:this.assertLegalChar(""+T||"")},L.prototype.dtdSysID=function(T){return this.options.noValidation?T:this.assertLegalChar(""+T||"")},L.prototype.dtdElementValue=function(T){return this.options.noValidation?T:this.assertLegalChar(""+T||"")},L.prototype.dtdAttType=function(T){return this.options.noValidation?T:this.assertLegalChar(""+T||"")},L.prototype.dtdAttDefault=function(T){return this.options.noValidation?T:this.assertLegalChar(""+T||"")},L.prototype.dtdEntityValue=function(T){return this.options.noValidation?T:this.assertLegalChar(""+T||"")},L.prototype.dtdNData=function(T){return this.options.noValidation?T:this.assertLegalChar(""+T||"")},L.prototype.convertAttKey="@",L.prototype.convertPIKey="?",L.prototype.convertTextKey="#text",L.prototype.convertCDataKey="#cdata",L.prototype.convertCommentKey="#comment",L.prototype.convertRawKey="#raw",L.prototype.assertLegalChar=function(T){var c,C;if(this.options.noValidation)return T;if(c="",this.options.version==="1.0"){if(c=/[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,C=T.match(c))throw new Error("Invalid character in string: "+T+" at index "+C.index)}else if(this.options.version==="1.1"&&(c=/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,C=T.match(c)))throw new Error("Invalid character in string: "+T+" at index "+C.index);return T},L.prototype.assertLegalName=function(T){var c;if(this.options.noValidation)return T;if(this.assertLegalChar(T),c=/^([:A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])([\x2D\.0-:A-Z_a-z\xB7\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C\u200D\u203F\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])*$/,!T.match(c))throw new Error("Invalid character in name");return T},L.prototype.textEscape=function(T){var c;return this.options.noValidation?T:(c=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,T.replace(c,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\r/g,"&#xD;"))},L.prototype.attEscape=function(T){var c;return this.options.noValidation?T:(c=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,T.replace(c,"&amp;").replace(/</g,"&lt;").replace(/"/g,"&quot;").replace(/\t/g,"&#x9;").replace(/\n/g,"&#xA;").replace(/\r/g,"&#xD;"))},L}()}).call(void 0)},{}],280:[function(M,ne,N){"use strict";var I=M("babel-runtime/core-js/object/create"),h=S(I);function S(L){return L&&L.__esModule?L:{default:L}}(function(){var L,T,c,C=function(a,r){for(var f in r)g.call(r,f)&&(a[f]=r[f]);function p(){this.constructor=a}return p.prototype=r.prototype,a.prototype=new p,a.__super__=r.prototype,a},g={}.hasOwnProperty;L=M("./NodeType"),T=M("./XMLCharacterData"),ne.exports=c=function(s){C(a,s);function a(r,f){if(a.__super__.constructor.call(this,r),f==null)throw new Error("Missing element text. "+this.debugInfo());this.name="#text",this.type=L.Text,this.value=this.stringify.text(f)}return Object.defineProperty(a.prototype,"isElementContentWhitespace",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(a.prototype,"wholeText",{get:function(){var f,p,m;for(m="",p=this.previousSibling;p;)m=p.data+m,p=p.previousSibling;for(m+=this.data,f=this.nextSibling;f;)m=m+f.data,f=f.nextSibling;return m}}),a.prototype.clone=function(){return(0,h.default)(this)},a.prototype.toString=function(r){return this.options.writer.text(this,this.options.writer.filterOptions(r))},a.prototype.splitText=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())},a.prototype.replaceWholeText=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())},a}(T)}).call(void 0)},{"./NodeType":251,"./XMLCharacterData":256,"babel-runtime/core-js/object/create":55}],281:[function(M,ne,N){"use strict";(function(){var I,h,S,L,T,c,C,g,s,a,r,f,p,m,E,y,u,n={}.hasOwnProperty;u=M("./Utility").assign,I=M("./NodeType"),s=M("./XMLDeclaration"),a=M("./XMLDocType"),S=M("./XMLCData"),L=M("./XMLComment"),f=M("./XMLElement"),m=M("./XMLRaw"),E=M("./XMLText"),p=M("./XMLProcessingInstruction"),r=M("./XMLDummy"),T=M("./XMLDTDAttList"),c=M("./XMLDTDElement"),C=M("./XMLDTDEntity"),g=M("./XMLDTDNotation"),h=M("./WriterState"),ne.exports=y=function(){function o(l){var w,v,i;l||(l={}),this.options=l,v=l.writer||{};for(w in v){if(!n.call(v,w))continue;i=v[w],this["_"+w]=this[w],this[w]=i}}return o.prototype.filterOptions=function(l){var w,v,i,R,k,d,b,x;return l||(l={}),l=u({},this.options,l),w={writer:this},w.pretty=l.pretty||!1,w.allowEmpty=l.allowEmpty||!1,w.indent=(v=l.indent)!=null?v:" ",w.newline=(i=l.newline)!=null?i:`
`,w.offset=(R=l.offset)!=null?R:0,w.dontPrettyTextNodes=(k=(d=l.dontPrettyTextNodes)!=null?d:l.dontprettytextnodes)!=null?k:0,w.spaceBeforeSlash=(b=(x=l.spaceBeforeSlash)!=null?x:l.spacebeforeslash)!=null?b:"",w.spaceBeforeSlash===!0&&(w.spaceBeforeSlash=" "),w.suppressPrettyCount=0,w.user={},w.state=h.None,w},o.prototype.indent=function(l,w,v){var i;return!w.pretty||w.suppressPrettyCount?"":w.pretty&&(i=(v||0)+w.offset+1,i>0)?new Array(i).join(w.indent):""},o.prototype.endline=function(l,w,v){return!w.pretty||w.suppressPrettyCount?"":w.newline},o.prototype.attribute=function(l,w,v){var i;return this.openAttribute(l,w,v),i=" "+l.name+'="'+l.value+'"',this.closeAttribute(l,w,v),i},o.prototype.cdata=function(l,w,v){var i;return this.openNode(l,w,v),w.state=h.OpenTag,i=this.indent(l,w,v)+"<![CDATA[",w.state=h.InsideTag,i+=l.value,w.state=h.CloseTag,i+="]]>"+this.endline(l,w,v),w.state=h.None,this.closeNode(l,w,v),i},o.prototype.comment=function(l,w,v){var i;return this.openNode(l,w,v),w.state=h.OpenTag,i=this.indent(l,w,v)+"<!-- ",w.state=h.InsideTag,i+=l.value,w.state=h.CloseTag,i+=" -->"+this.endline(l,w,v),w.state=h.None,this.closeNode(l,w,v),i},o.prototype.declaration=function(l,w,v){var i;return this.openNode(l,w,v),w.state=h.OpenTag,i=this.indent(l,w,v)+"<?xml",w.state=h.InsideTag,i+=' version="'+l.version+'"',l.encoding!=null&&(i+=' encoding="'+l.encoding+'"'),l.standalone!=null&&(i+=' standalone="'+l.standalone+'"'),w.state=h.CloseTag,i+=w.spaceBeforeSlash+"?>",i+=this.endline(l,w,v),w.state=h.None,this.closeNode(l,w,v),i},o.prototype.docType=function(l,w,v){var i,R,k,d,b;if(v||(v=0),this.openNode(l,w,v),w.state=h.OpenTag,d=this.indent(l,w,v),d+="<!DOCTYPE "+l.root().name,l.pubID&&l.sysID?d+=' PUBLIC "'+l.pubID+'" "'+l.sysID+'"':l.sysID&&(d+=' SYSTEM "'+l.sysID+'"'),l.children.length>0){for(d+=" [",d+=this.endline(l,w,v),w.state=h.InsideTag,b=l.children,R=0,k=b.length;R<k;R++)i=b[R],d+=this.writeChildNode(i,w,v+1);w.state=h.CloseTag,d+="]"}return w.state=h.CloseTag,d+=w.spaceBeforeSlash+">",d+=this.endline(l,w,v),w.state=h.None,this.closeNode(l,w,v),d},o.prototype.element=function(l,w,v){var i,R,k,d,b,x,_,B,U,P,J,$,z,V;v||(v=0),P=!1,J="",this.openNode(l,w,v),w.state=h.OpenTag,J+=this.indent(l,w,v)+"<"+l.name,$=l.attribs;for(U in $){if(!n.call($,U))continue;i=$[U],J+=this.attribute(i,w,v)}if(k=l.children.length,d=k===0?null:l.children[0],k===0||l.children.every(function(K){return(K.type===I.Text||K.type===I.Raw)&&K.value===""}))w.allowEmpty?(J+=">",w.state=h.CloseTag,J+="</"+l.name+">"+this.endline(l,w,v)):(w.state=h.CloseTag,J+=w.spaceBeforeSlash+"/>"+this.endline(l,w,v));else if(w.pretty&&k===1&&(d.type===I.Text||d.type===I.Raw)&&d.value!=null)J+=">",w.state=h.InsideTag,w.suppressPrettyCount++,P=!0,J+=this.writeChildNode(d,w,v+1),w.suppressPrettyCount--,P=!1,w.state=h.CloseTag,J+="</"+l.name+">"+this.endline(l,w,v);else{if(w.dontPrettyTextNodes){for(z=l.children,b=0,_=z.length;b<_;b++)if(R=z[b],(R.type===I.Text||R.type===I.Raw)&&R.value!=null){w.suppressPrettyCount++,P=!0;break}}for(J+=">"+this.endline(l,w,v),w.state=h.InsideTag,V=l.children,x=0,B=V.length;x<B;x++)R=V[x],J+=this.writeChildNode(R,w,v+1);w.state=h.CloseTag,J+=this.indent(l,w,v)+"</"+l.name+">",P&&w.suppressPrettyCount--,J+=this.endline(l,w,v),w.state=h.None}return this.closeNode(l,w,v),J},o.prototype.writeChildNode=function(l,w,v){switch(l.type){case I.CData:return this.cdata(l,w,v);case I.Comment:return this.comment(l,w,v);case I.Element:return this.element(l,w,v);case I.Raw:return this.raw(l,w,v);case I.Text:return this.text(l,w,v);case I.ProcessingInstruction:return this.processingInstruction(l,w,v);case I.Dummy:return"";case I.Declaration:return this.declaration(l,w,v);case I.DocType:return this.docType(l,w,v);case I.AttributeDeclaration:return this.dtdAttList(l,w,v);case I.ElementDeclaration:return this.dtdElement(l,w,v);case I.EntityDeclaration:return this.dtdEntity(l,w,v);case I.NotationDeclaration:return this.dtdNotation(l,w,v);default:throw new Error("Unknown XML node type: "+l.constructor.name)}},o.prototype.processingInstruction=function(l,w,v){var i;return this.openNode(l,w,v),w.state=h.OpenTag,i=this.indent(l,w,v)+"<?",w.state=h.InsideTag,i+=l.target,l.value&&(i+=" "+l.value),w.state=h.CloseTag,i+=w.spaceBeforeSlash+"?>",i+=this.endline(l,w,v),w.state=h.None,this.closeNode(l,w,v),i},o.prototype.raw=function(l,w,v){var i;return this.openNode(l,w,v),w.state=h.OpenTag,i=this.indent(l,w,v),w.state=h.InsideTag,i+=l.value,w.state=h.CloseTag,i+=this.endline(l,w,v),w.state=h.None,this.closeNode(l,w,v),i},o.prototype.text=function(l,w,v){var i;return this.openNode(l,w,v),w.state=h.OpenTag,i=this.indent(l,w,v),w.state=h.InsideTag,i+=l.value,w.state=h.CloseTag,i+=this.endline(l,w,v),w.state=h.None,this.closeNode(l,w,v),i},o.prototype.dtdAttList=function(l,w,v){var i;return this.openNode(l,w,v),w.state=h.OpenTag,i=this.indent(l,w,v)+"<!ATTLIST",w.state=h.InsideTag,i+=" "+l.elementName+" "+l.attributeName+" "+l.attributeType,l.defaultValueType!=="#DEFAULT"&&(i+=" "+l.defaultValueType),l.defaultValue&&(i+=' "'+l.defaultValue+'"'),w.state=h.CloseTag,i+=w.spaceBeforeSlash+">"+this.endline(l,w,v),w.state=h.None,this.closeNode(l,w,v),i},o.prototype.dtdElement=function(l,w,v){var i;return this.openNode(l,w,v),w.state=h.OpenTag,i=this.indent(l,w,v)+"<!ELEMENT",w.state=h.InsideTag,i+=" "+l.name+" "+l.value,w.state=h.CloseTag,i+=w.spaceBeforeSlash+">"+this.endline(l,w,v),w.state=h.None,this.closeNode(l,w,v),i},o.prototype.dtdEntity=function(l,w,v){var i;return this.openNode(l,w,v),w.state=h.OpenTag,i=this.indent(l,w,v)+"<!ENTITY",w.state=h.InsideTag,l.pe&&(i+=" %"),i+=" "+l.name,l.value?i+=' "'+l.value+'"':(l.pubID&&l.sysID?i+=' PUBLIC "'+l.pubID+'" "'+l.sysID+'"':l.sysID&&(i+=' SYSTEM "'+l.sysID+'"'),l.nData&&(i+=" NDATA "+l.nData)),w.state=h.CloseTag,i+=w.spaceBeforeSlash+">"+this.endline(l,w,v),w.state=h.None,this.closeNode(l,w,v),i},o.prototype.dtdNotation=function(l,w,v){var i;return this.openNode(l,w,v),w.state=h.OpenTag,i=this.indent(l,w,v)+"<!NOTATION",w.state=h.InsideTag,i+=" "+l.name,l.pubID&&l.sysID?i+=' PUBLIC "'+l.pubID+'" "'+l.sysID+'"':l.pubID?i+=' PUBLIC "'+l.pubID+'"':l.sysID&&(i+=' SYSTEM "'+l.sysID+'"'),w.state=h.CloseTag,i+=w.spaceBeforeSlash+">"+this.endline(l,w,v),w.state=h.None,this.closeNode(l,w,v),i},o.prototype.openNode=function(l,w,v){},o.prototype.closeNode=function(l,w,v){},o.prototype.openAttribute=function(l,w,v){},o.prototype.closeAttribute=function(l,w,v){},o}()}).call(void 0)},{"./NodeType":251,"./Utility":252,"./WriterState":253,"./XMLCData":255,"./XMLComment":257,"./XMLDTDAttList":262,"./XMLDTDElement":263,"./XMLDTDEntity":264,"./XMLDTDNotation":265,"./XMLDeclaration":266,"./XMLDocType":267,"./XMLDummy":270,"./XMLElement":271,"./XMLProcessingInstruction":275,"./XMLRaw":276,"./XMLText":280}],282:[function(M,ne,N){"use strict";(function(){var I,h,S,L,T,c,C,g,s,a;a=M("./Utility"),g=a.assign,s=a.isFunction,S=M("./XMLDOMImplementation"),L=M("./XMLDocument"),T=M("./XMLDocumentCB"),C=M("./XMLStringWriter"),c=M("./XMLStreamWriter"),I=M("./NodeType"),h=M("./WriterState"),ne.exports.create=function(r,f,p,m){var E,y;if(r==null)throw new Error("Root element needs a name.");return m=g({},f,p,m),E=new L(m),y=E.element(r),m.headless||(E.declaration(m),(m.pubID!=null||m.sysID!=null)&&E.dtd(m)),y},ne.exports.begin=function(r,f,p){var m;return s(r)&&(m=[r,f],f=m[0],p=m[1],r={}),f?new T(r,f,p):new L(r)},ne.exports.stringWriter=function(r){return new C(r)},ne.exports.streamWriter=function(r,f){return new c(r,f)},ne.exports.implementation=new S,ne.exports.nodeType=I,ne.exports.writerState=h}).call(void 0)},{"./NodeType":251,"./Utility":252,"./WriterState":253,"./XMLDOMImplementation":260,"./XMLDocument":268,"./XMLDocumentCB":269,"./XMLStreamWriter":277,"./XMLStringWriter":278}],283:[function(M,ne,N){ne.exports=h;var I=Object.prototype.hasOwnProperty;function h(){for(var S={},L=0;L<arguments.length;L++){var T=arguments[L];for(var c in T)I.call(T,c)&&(S[c]=T[c])}return S}},{}],284:[function(M,ne,N){"use strict";var I=M("buffer").Buffer,h=M("./sha"),S=M("./md5"),L={sha1:h,md5:S},T=64,c=I.alloc(T);c.fill(0);function C(a,r,f){I.isBuffer(r)||(r=I.from(r)),I.isBuffer(f)||(f=I.from(f)),r.length>T?r=a(r):r.length<T&&(r=I.concat([r,c],T));for(var p=I.alloc(T),m=I.alloc(T),E=0;E<T;E++)p[E]=r[E]^54,m[E]=r[E]^92;var y=a(I.concat([p,f]));return a(I.concat([m,y]))}function g(a,r){a=a||"sha1";var f=L[a],p=[],m=0;return f||s("algorithm:",a,"is not yet supported"),{update:function(y){return I.isBuffer(y)||(y=I.from(y)),p.push(y),m+=y.length,this},digest:function(y){var u=I.concat(p),n=r?C(f,r,u):f(u);return p=null,y?n.toString(y):n}}}function s(){var a=[].slice.call(arguments).join(" ");throw new Error([a,"we accept pull requests","http://github.com/dominictarr/crypto-browserify"].join(`
`))}N.createHash=function(a){return g(a)},N.createHmac=function(a,r){return g(a,r)},N.createCredentials=function(){s("sorry,createCredentials is not implemented yet")},N.createCipher=function(){s("sorry,createCipher is not implemented yet")},N.createCipheriv=function(){s("sorry,createCipheriv is not implemented yet")},N.createDecipher=function(){s("sorry,createDecipher is not implemented yet")},N.createDecipheriv=function(){s("sorry,createDecipheriv is not implemented yet")},N.createSign=function(){s("sorry,createSign is not implemented yet")},N.createVerify=function(){s("sorry,createVerify is not implemented yet")},N.createDiffieHellman=function(){s("sorry,createDiffieHellman is not implemented yet")},N.pbkdf2=function(){s("sorry,pbkdf2 is not implemented yet")}},{"./md5":286,"./sha":287,buffer:73}],285:[function(M,ne,N){"use strict";var I=M("buffer").Buffer,h=4,S=I.alloc(h);S.fill(0);var L=8;function T(g,s){if(g.length%h!==0){var a=g.length+(h-g.length%h);g=I.concat([g,S],a)}for(var r=[],f=s?g.readInt32BE:g.readInt32LE,p=0;p<g.length;p+=h)r.push(f.call(g,p));return r}function c(g,s,a){for(var r=I.alloc(s),f=a?r.writeInt32BE:r.writeInt32LE,p=0;p<g.length;p++)f.call(r,g[p],p*4,!0);return r}function C(g,s,a,r){I.isBuffer(g)||(g=I.from(g));var f=s(T(g,r),g.length*L);return c(f,a,r)}ne.exports={hash:C}},{buffer:73}],286:[function(M,ne,N){"use strict";var I=M("./helpers");function h(){return hex_md5("abc")=="900150983cd24fb0d6963f7d28e17f72"}function S(r,f){r[f>>5]|=128<<f%32,r[(f+64>>>9<<4)+14]=f;for(var p=1732584193,m=-271733879,E=-1732584194,y=271733878,u=0;u<r.length;u+=16){var n=p,o=m,l=E,w=y;p=T(p,m,E,y,r[u+0],7,-680876936),y=T(y,p,m,E,r[u+1],12,-389564586),E=T(E,y,p,m,r[u+2],17,606105819),m=T(m,E,y,p,r[u+3],22,-1044525330),p=T(p,m,E,y,r[u+4],7,-176418897),y=T(y,p,m,E,r[u+5],12,1200080426),E=T(E,y,p,m,r[u+6],17,-1473231341),m=T(m,E,y,p,r[u+7],22,-45705983),p=T(p,m,E,y,r[u+8],7,1770035416),y=T(y,p,m,E,r[u+9],12,-1958414417),E=T(E,y,p,m,r[u+10],17,-42063),m=T(m,E,y,p,r[u+11],22,-1990404162),p=T(p,m,E,y,r[u+12],7,1804603682),y=T(y,p,m,E,r[u+13],12,-40341101),E=T(E,y,p,m,r[u+14],17,-1502002290),m=T(m,E,y,p,r[u+15],22,1236535329),p=c(p,m,E,y,r[u+1],5,-165796510),y=c(y,p,m,E,r[u+6],9,-1069501632),E=c(E,y,p,m,r[u+11],14,643717713),m=c(m,E,y,p,r[u+0],20,-373897302),p=c(p,m,E,y,r[u+5],5,-701558691),y=c(y,p,m,E,r[u+10],9,38016083),E=c(E,y,p,m,r[u+15],14,-660478335),m=c(m,E,y,p,r[u+4],20,-405537848),p=c(p,m,E,y,r[u+9],5,568446438),y=c(y,p,m,E,r[u+14],9,-1019803690),E=c(E,y,p,m,r[u+3],14,-187363961),m=c(m,E,y,p,r[u+8],20,1163531501),p=c(p,m,E,y,r[u+13],5,-1444681467),y=c(y,p,m,E,r[u+2],9,-51403784),E=c(E,y,p,m,r[u+7],14,1735328473),m=c(m,E,y,p,r[u+12],20,-1926607734),p=C(p,m,E,y,r[u+5],4,-378558),y=C(y,p,m,E,r[u+8],11,-2022574463),E=C(E,y,p,m,r[u+11],16,1839030562),m=C(m,E,y,p,r[u+14],23,-35309556),p=C(p,m,E,y,r[u+1],4,-1530992060),y=C(y,p,m,E,r[u+4],11,1272893353),E=C(E,y,p,m,r[u+7],16,-155497632),m=C(m,E,y,p,r[u+10],23,-1094730640),p=C(p,m,E,y,r[u+13],4,681279174),y=C(y,p,m,E,r[u+0],11,-358537222),E=C(E,y,p,m,r[u+3],16,-722521979),m=C(m,E,y,p,r[u+6],23,76029189),p=C(p,m,E,y,r[u+9],4,-640364487),y=C(y,p,m,E,r[u+12],11,-421815835),E=C(E,y,p,m,r[u+15],16,530742520),m=C(m,E,y,p,r[u+2],23,-995338651),p=g(p,m,E,y,r[u+0],6,-198630844),y=g(y,p,m,E,r[u+7],10,1126891415),E=g(E,y,p,m,r[u+14],15,-1416354905),m=g(m,E,y,p,r[u+5],21,-57434055),p=g(p,m,E,y,r[u+12],6,1700485571),y=g(y,p,m,E,r[u+3],10,-1894986606),E=g(E,y,p,m,r[u+10],15,-1051523),m=g(m,E,y,p,r[u+1],21,-2054922799),p=g(p,m,E,y,r[u+8],6,1873313359),y=g(y,p,m,E,r[u+15],10,-30611744),E=g(E,y,p,m,r[u+6],15,-1560198380),m=g(m,E,y,p,r[u+13],21,1309151649),p=g(p,m,E,y,r[u+4],6,-145523070),y=g(y,p,m,E,r[u+11],10,-1120210379),E=g(E,y,p,m,r[u+2],15,718787259),m=g(m,E,y,p,r[u+9],21,-343485551),p=s(p,n),m=s(m,o),E=s(E,l),y=s(y,w)}return Array(p,m,E,y)}function L(r,f,p,m,E,y){return s(a(s(s(f,r),s(m,y)),E),p)}function T(r,f,p,m,E,y,u){return L(f&p|~f&m,r,f,E,y,u)}function c(r,f,p,m,E,y,u){return L(f&m|p&~m,r,f,E,y,u)}function C(r,f,p,m,E,y,u){return L(f^p^m,r,f,E,y,u)}function g(r,f,p,m,E,y,u){return L(p^(f|~m),r,f,E,y,u)}function s(r,f){var p=(r&65535)+(f&65535),m=(r>>16)+(f>>16)+(p>>16);return m<<16|p&65535}function a(r,f){return r<<f|r>>>32-f}ne.exports=function(f){return I.hash(f,S,16)}},{"./helpers":285}],287:[function(M,ne,N){"use strict";var I=M("./helpers");function h(C,g){C[g>>5]|=128<<24-g%32,C[(g+64>>9<<4)+15]=g;for(var s=Array(80),a=1732584193,r=-271733879,f=-1732584194,p=271733878,m=-1009589776,E=0;E<C.length;E+=16){for(var y=a,u=r,n=f,o=p,l=m,w=0;w<80;w++){w<16?s[w]=C[E+w]:s[w]=c(s[w-3]^s[w-8]^s[w-14]^s[w-16],1);var v=T(T(c(a,5),S(w,r,f,p)),T(T(m,s[w]),L(w)));m=p,p=f,f=c(r,30),r=a,a=v}a=T(a,y),r=T(r,u),f=T(f,n),p=T(p,o),m=T(m,l)}return Array(a,r,f,p,m)}function S(C,g,s,a){return C<20?g&s|~g&a:C<40?g^s^a:C<60?g&s|g&a|s&a:g^s^a}function L(C){return C<20?1518500249:C<40?1859775393:C<60?-1894007588:-899497514}function T(C,g){var s=(C&65535)+(g&65535),a=(C>>16)+(g>>16)+(s>>16);return a<<16|s&65535}function c(C,g){return C<<g|C>>>32-g}ne.exports=function(g){return I.hash(g,h,20,!0)}},{"./helpers":285}],288:[function(M,ne,N){"use strict";ne.exports=function(){return function(){}}},{}],289:[function(M,ne,N){(function(I){"use strict";var h=M("babel-runtime/helpers/typeof"),S=L(h);function L(a){return a&&a.__esModule?a:{default:a}}var T=M("stream"),c=T.Stream,C=M("../lib/common/utils/isArray"),g=C.isArray;ne.exports.string=function(r){return typeof r=="string"},ne.exports.array=g,ne.exports.buffer=I.isBuffer;function s(a){return a instanceof c}ne.exports.writableStream=function(r){return s(r)&&typeof r._write=="function"&&(0,S.default)(r._writableState)==="object"}}).call(this,{isBuffer:M("../node_modules/is-buffer/index.js")})},{"../lib/common/utils/isArray":42,"../node_modules/is-buffer/index.js":197,"babel-runtime/helpers/typeof":67,stream:230}],290:[function(M,ne,N){"use strict";N.encodeURIComponent=function(I){try{return encodeURIComponent(I)}catch(h){return I}},N.escape=M("escape-html"),N.timestamp=function(h){if(h){var S=h;return typeof S=="string"&&(S=Number(S)),String(h).length===10&&(S*=1e3),new Date(S)}return Math.round(Date.now()/1e3)}},{"escape-html":191}],291:[function(M,ne,N){(function(I,h){"use strict";var S=M("babel-runtime/core-js/json/stringify"),L=C(S),T=M("babel-runtime/helpers/typeof"),c=C(T);function C(w){return w&&w.__esModule?w:{default:w}}var g=M("util"),s=M("url"),a=M("http"),r=M("https"),f=M("debug")("urllib"),p=M("humanize-ms"),m,E=0,y=Math.pow(2,31)-10,u=/^https?:\/\//i;function n(w,v){return w===void 0?v:w}function o(w,v){return function(i,R,k){if(i)return v(i);w({data:R,status:k.statusCode,headers:k.headers,res:k})}}N.TIMEOUTS=[p("300s"),p("300s")];var l=["json","text"];N.request=function(v,i,R){return arguments.length===2&&typeof i=="function"&&(R=i,i=null),typeof R=="function"?N.requestWithCallback(v,i,R):(m||(m=M("any-promise")),new m(function(k,d){N.requestWithCallback(v,i,o(k,d))}))},N.requestWithCallback=function(v,i,R){if(!v||typeof v!="string"&&(typeof v=="undefined"?"undefined":(0,c.default)(v))!=="object"){var k=g.format("expect request url to be a string or a http request options, but got %j",v);throw new Error(k)}arguments.length===2&&typeof i=="function"&&(R=i,i=null),i=i||{},E>=y&&(E=0);var d=++E;i.requestUrls=i.requestUrls||[];var b={requestId:d,url:v,args:i,ctx:i.ctx};i.emitter&&i.emitter.emit("request",b),i.timeout=i.timeout||N.TIMEOUTS,i.maxRedirects=i.maxRedirects||10,i.streaming=i.streaming||i.customResponse;var x=Date.now(),_;typeof v=="string"?(u.test(v)||(v="http://"+v),_=s.parse(v)):_=v;var B=(i.type||i.method||_.method||"GET").toUpperCase(),U=_.port||80,P=a,J=n(i.agent,N.agent),$=i.fixJSONCtlChars;_.protocol==="https:"&&(P=r,J=n(i.httpsAgent,N.httpsAgent),_.port||(U=443));var z={host:_.hostname||_.host||"localhost",path:_.path||"/",method:B,port:U,agent:J,headers:i.headers||{},lookup:i.lookup};Array.isArray(i.timeout)?z.requestTimeout=i.timeout[i.timeout.length-1]:typeof i.timeout!="undefined"&&(z.requestTimeout=i.timeout);for(var V=["pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","secureProtocol","secureOptions"],K=0;K<V.length;K++){var H=V[K];i.hasOwnProperty(H)&&(z[H]=i[H])}z.rejectUnauthorized===!1&&!z.hasOwnProperty("secureOptions")&&(z.secureOptions=M("constants").SSL_OP_NO_TLSv1_2);var G=i.auth||_.auth;G&&(z.auth=G);var ie=i.content||i.data,le=B==="GET"||B==="HEAD"||i.dataAsQueryString;if(!i.content&&(ie&&!(typeof ie=="string"||h.isBuffer(ie))))if(le)ie=i.nestedQuerystring?qs.stringify(ie):querystring.stringify(ie);else{var ue=z.headers["Content-Type"]||z.headers["content-type"];ue||(i.contentType==="json"?ue="application/json":ue="application/x-www-form-urlencoded",z.headers["Content-Type"]=ue),parseContentType(ue).type==="application/json"?ie=(0,L.default)(ie):ie=i.nestedQuerystring?qs.stringify(ie):querystring.stringify(ie)}le&&ie&&(z.path+=(_.query?"&":"?")+ie,ie=null);var be=0;if(ie){var Ce=ie.length;h.isBuffer(ie)||(Ce=h.byteLength(ie)),be=z.headers["Content-Length"]=Ce}i.dataType==="json"&&(z.headers.Accept="application/json"),typeof i.beforeRequest=="function"&&i.beforeRequest(z);var se=null,ce=null,he=null,ae=!1,Q=!1,D=0,F=-1,W=!1,Y="",Z="",te=null;i.timing&&(te={queuing:0,dnslookup:0,connected:0,requestSent:0,waiting:0,contentDownload:0});function q(){se&&(clearTimeout(se),se=null)}function X(){ce&&(clearTimeout(ce),ce=null)}function re(De,Xe,$e){if(X(),!R){console.warn("[urllib:warn] [%s] [%s] [worker:%s] %s %s callback twice!!!",Date(),d,I.pid,z.method,v),De&&console.warn(`[urllib:warn] [%s] [%s] [worker:%s] %s: %s
stack: %s`,Date(),d,I.pid,De.name,De.message,De.stack);return}var we=R;R=null;var fe={};if($e&&(F=$e.statusCode,fe=$e.headers),F===401&&fe["www-authenticate"]&&(!i.headers||!i.headers.Authorization)&&i.digestAuth){var pe=fe["www-authenticate"];if(pe.indexOf("Digest ")>=0)return f("Request#%d %s: got digest auth header WWW-Authenticate: %s",d,v,pe),i.headers=i.headers||{},i.headers.Authorization=digestAuthHeader(z.method,z.path,pe,i.digestAuth),f("Request#%d %s: auth with digest header: %s",d,v,i.headers.Authorization),$e.headers["set-cookie"]&&(i.headers.Cookie=$e.headers["set-cookie"].join(";")),N.requestWithCallback(v,i,we)}var ye=Date.now()-x;te&&(te.contentDownload=ye),f("[%sms] done, %s bytes HTTP %s %s %s %s, keepAliveSocket: %s, timing: %j",ye,D,F,z.method,z.host,z.path,Q,te);var _e={status:F,statusCode:F,headers:fe,size:D,aborted:W,rt:ye,keepAliveSocket:Q,data:Xe,requestUrls:i.requestUrls,timing:te,remoteAddress:Y,remotePort:Z};if(De){var xe="";J&&typeof J.getCurrentStatus=="function"&&(xe=", agent status: "+(0,L.default)(J.getCurrentStatus())),De.message+=", "+z.method+" "+v+" "+F+" (connected: "+ae+", keepalive socket: "+Q+xe+`)
headers: `+(0,L.default)(fe),De.data=Xe,De.path=z.path,De.status=F,De.headers=fe,De.res=_e}we(De,Xe,i.streaming?$e:_e),i.emitter&&(b.url=v,b.socket=Be&&Be.connection,b.options=z,b.size=be,i.emitter.emit("response",{requestId:d,error:De,ctx:i.ctx,req:b,res:_e}))}function me(De){var Xe=null;if(i.followRedirect&&statuses.redirect[De.statusCode]){i._followRedirectCount=(i._followRedirectCount||0)+1;var $e=De.headers.location;if(!$e)Xe=new Error("Got statusCode "+De.statusCode+" but cannot resolve next location from headers"),Xe.name="FollowRedirectError";else if(i._followRedirectCount>i.maxRedirects)Xe=new Error("Exceeded maxRedirects. Probably stuck in a redirect loop "+v),Xe.name="MaxRedirectError";else{var we=i.formatRedirectUrl?i.formatRedirectUrl(v,$e):s.resolve(v,$e);f("Request#%d %s: `redirected` from %s to %s",d,z.path,v,we),X(),i.headers&&i.headers.Host&&u.test($e)&&(i.headers.Host=null);var fe=R;return R=null,N.requestWithCallback(we,i,fe),{redirect:!0,error:null}}}return{redirect:!1,error:Xe}}!z.headers["User-Agent"]&&!z.headers["user-agent"]&&(z.headers["User-Agent"]=navigator.userAgent),i.gzip&&(!z.headers["Accept-Encoding"]&&!z.headers["accept-encoding"]&&(z.headers["Accept-Encoding"]="gzip"));function ve(De,Xe,$e){var we=De.headers["content-encoding"];return $e(null,Xe,we)}var Te=i.writeStream;f("Request#%d %s %s with headers %j, options.path: %s",d,B,v,z.headers,z.path),i.requestUrls.push(v);function Re(De){if(te&&(te.waiting=Date.now()-x),f("Request#%d %s `req response` event emit: status %d, headers: %j",d,v,De.statusCode,De.headers),i.streaming){var Xe=me(De);if(Xe.redirect){De.resume();return}return Xe.error?(De.resume(),re(Xe.error,null,De)):re(null,null,De)}if(De.on("close",function(){f("Request#%d %s: `res close` event emit, total size %d",d,v,D)}),De.on("error",function(){f("Request#%d %s: `res error` event emit, total size %d",d,v,D)}),De.on("aborted",function(){W=!0,f("Request#%d %s: `res aborted` event emit, total size %d",d,v,D)}),Te){var Xe=me(De);if(Xe.redirect){De.resume();return}return Xe.error?(De.resume(),Te.end(),re(Xe.error,null,De)):(i.consumeWriteStream===!1?De.on("end",re.bind(null,null,null,De)):isNode010||isNode012?first([[Te,"close"],[De,"aborted"]],function(fe,pe,ye){f("Request#%d %s: writeStream or res %s event emitted",d,v,ye),re(he||null,null,De)}):Te.on("close",function(){f("Request#%d %s: writeStream close event emitted",d,v),re(he||null,null,De)}),De.pipe(Te))}var $e=[];De.on("data",function(we){f("Request#%d %s: `res data` event emit, size %d",d,v,we.length),D+=we.length,$e.push(we)}),De.on("end",function(){var we=h.concat($e,D);if(f("Request#%d %s: `res end` event emit, total size %d, _dumped: %s",d,v,D,De._dumped),he)return re(he,we,De);var fe=me(De);if(fe.error)return re(fe.error,we,De);if(fe.redirect)return;ve(De,we,function(pe,ye,_e){if(pe)return re(pe,we,De);if(!_e&&l.indexOf(i.dataType)>=0){try{ye=decodeBodyByCharset(ye,De)}catch(Se){return f("decodeBodyByCharset error: %s",Se),re(null,ye,De)}if(i.dataType==="json")if(D===0)ye=null;else{var xe=parseJSON(ye,$);xe.error?pe=xe.error:ye=xe.data}}W&&f("Request#%d %s: Remote socket was terminated before `response.end()` was called",d,v),re(pe,ye,De)})})}var Ie,je;Array.isArray(i.timeout)?(Ie=p(i.timeout[0]),je=p(i.timeout[1])):Ie=je=p(i.timeout),f("ConnectTimeout: %d, ResponseTimeout: %d",Ie,je);function Ne(){f("Connect timer ticking, timeout: %d",Ie),se=setTimeout(function(){se=null,F===-1&&(F=-2);var De="Connect timeout for "+Ie+"ms",Xe="ConnectionTimeoutError";Be.socket||(Xe="SocketAssignTimeoutError",De+=", working sockets is full"),he=new Error(De),he.name=Xe,he.requestId=d,f("ConnectTimeout: Request#%d %s %s: %s, connected: %s",d,v,he.name,De,ae),He()},Ie)}function We(){f("Response timer ticking, timeout: %d",je),ce=setTimeout(function(){ce=null;var De="Response timeout for "+je+"ms",Xe="ResponseTimeoutError";he=new Error(De),he.name=Xe,he.requestId=d,f("ResponseTimeout: Request#%d %s %s: %s, connected: %s",d,v,he.name,De,ae),He()},je)}var Be;z.mode=i.mode?i.mode:"";try{Be=P.request(z,Re)}catch(De){return re(De)}typeof window=="undefined"?Ne():Be.on("requestTimeout",function(){F===-1&&(F=-2);var De="Connect timeout for "+Ie+"ms",Xe="ConnectionTimeoutError";he=new Error(De),he.name=Xe,he.requestId=d,He()});function He(){f("Request#%d %s abort, connected: %s",d,v,ae),Be.socket||(he.noSocket=!0,re(he)),Be.abort()}return te&&Be.on("finish",function(){te.requestSent=Date.now()-x}),Be.once("socket",function(De){te&&(te.queuing=Date.now()-x),isNode010&&De.socket&&(De=De.socket);var Xe=De.readyState;if(Xe==="opening"){De.once("lookup",function($e,we,fe){f("Request#%d %s lookup: %s, %s, %s",d,v,$e,we,fe),te&&(te.dnslookup=Date.now()-x),we&&(Y=we)}),De.once("connect",function(){te&&(te.connected=Date.now()-x),q(),We(),f("Request#%d %s new socket connected",d,v),ae=!0,Y||(Y=De.remoteAddress),Z=De.remotePort});return}f("Request#%d %s reuse socket connected, readyState: %s",d,v,Xe),ae=!0,Q=!0,Y||(Y=De.remoteAddress),Z=De.remotePort,q(),We()}),Be.on("error",function(De){(De.name==="Error"||De.name==="TypeError")&&(De.name=ae?"ResponseError":"RequestError"),De.message+=' (req "error")',f("Request#%d %s `req error` event emit, %s: %s",d,v,De.name,De.message),re(he||De)}),Te&&Te.once("error",function(De){De.message+=' (writeStream "error")',he=De,f("Request#%d %s `writeStream error` event emit, %s: %s",d,v,De.name,De.message),He()}),i.stream?(i.stream.pipe(Be),i.stream.once("error",function(De){De.message+=' (stream "error")',he=De,f("Request#%d %s `readStream error` event emit, %s: %s",d,v,De.name,De.message),He()})):Be.end(ie),Be.requestId=d,Be}}).call(this,M("_process"),M("buffer").Buffer)},{_process:208,"any-promise":49,"babel-runtime/core-js/json/stringify":53,"babel-runtime/helpers/typeof":67,buffer:73,constants:75,debug:288,http:231,https:193,"humanize-ms":194,url:238,util:243}]},{},[1])(1)})}).call(this,__webpack_require__("IyRk"))},nj2k:function(M,ne,N){M.exports=N.p+"static/nodata.c3b0b86c.svg"},oRuE:function(M,ne,N){(function(I,h,S){M.exports=ne=h(N("Ib8C"),N("OLod"))})(this,function(I){return I.pad.Iso10126={pad:function(h,S){var L=S*4,T=L-h.sigBytes%L;h.concat(I.lib.WordArray.random(T-1)).concat(I.lib.WordArray.create([T<<24],1))},unpad:function(h){var S=h.words[h.sigBytes-1>>>2]&255;h.sigBytes-=S}},I.pad.Iso10126})},osHv:function(M,ne,N){(function(I){I(N("VrN/"))})(function(I){"use strict";var h=I.Pos;function S(u,n){return u.line-n.line||u.ch-n.ch}var L="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",T=L+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",c=new RegExp("<(/?)(["+L+"]["+T+"]*)","g");function C(u,n,o,l){this.line=n,this.ch=o,this.cm=u,this.text=u.getLine(n),this.min=l?Math.max(l.from,u.firstLine()):u.firstLine(),this.max=l?Math.min(l.to-1,u.lastLine()):u.lastLine()}function g(u,n){var o=u.cm.getTokenTypeAt(h(u.line,n));return o&&/\btag\b/.test(o)}function s(u){return u.line>=u.max?void 0:(u.ch=0,u.text=u.cm.getLine(++u.line),!0)}function a(u){return u.line<=u.min?void 0:(u.text=u.cm.getLine(--u.line),u.ch=u.text.length,!0)}function r(u){for(;;){var n=u.text.indexOf(">",u.ch);if(n==-1){if(s(u))continue;return}if(!g(u,n+1)){u.ch=n+1;continue}var o=u.text.lastIndexOf("/",n),l=o>-1&&!/\S/.test(u.text.slice(o+1,n));return u.ch=n+1,l?"selfClose":"regular"}}function f(u){for(;;){var n=u.ch?u.text.lastIndexOf("<",u.ch-1):-1;if(n==-1){if(a(u))continue;return}if(!g(u,n+1)){u.ch=n;continue}c.lastIndex=n,u.ch=n;var o=c.exec(u.text);if(o&&o.index==n)return o}}function p(u){for(;;){c.lastIndex=u.ch;var n=c.exec(u.text);if(!n){if(s(u))continue;return}if(!g(u,n.index+1)){u.ch=n.index+1;continue}return u.ch=n.index+n[0].length,n}}function m(u){for(;;){var n=u.ch?u.text.lastIndexOf(">",u.ch-1):-1;if(n==-1){if(a(u))continue;return}if(!g(u,n+1)){u.ch=n;continue}var o=u.text.lastIndexOf("/",n),l=o>-1&&!/\S/.test(u.text.slice(o+1,n));return u.ch=n+1,l?"selfClose":"regular"}}function E(u,n){for(var o=[];;){var l=p(u),w,v=u.line,i=u.ch-(l?l[0].length:0);if(!l||!(w=r(u)))return;if(w=="selfClose")continue;if(l[1]){for(var R=o.length-1;R>=0;--R)if(o[R]==l[2]){o.length=R;break}if(R<0&&(!n||n==l[2]))return{tag:l[2],from:h(v,i),to:h(u.line,u.ch)}}else o.push(l[2])}}function y(u,n){for(var o=[];;){var l=m(u);if(!l)return;if(l=="selfClose"){f(u);continue}var w=u.line,v=u.ch,i=f(u);if(!i)return;if(i[1])o.push(i[2]);else{for(var R=o.length-1;R>=0;--R)if(o[R]==i[2]){o.length=R;break}if(R<0&&(!n||n==i[2]))return{tag:i[2],from:h(u.line,u.ch),to:h(w,v)}}}}I.registerHelper("fold","xml",function(u,n){for(var o=new C(u,n.line,0);;){var l=p(o);if(!l||o.line!=n.line)return;var w=r(o);if(!w)return;if(!l[1]&&w!="selfClose"){var v=h(o.line,o.ch),i=E(o,l[2]);return i&&S(i.from,v)>0?{from:v,to:i.from}:null}}}),I.findMatchingTag=function(u,n,o){var l=new C(u,n.line,n.ch,o);if(l.text.indexOf(">")==-1&&l.text.indexOf("<")==-1)return;var w=r(l),v=w&&h(l.line,l.ch),i=w&&f(l);if(!w||!i||S(l,n)>0)return;var R={from:h(l.line,l.ch),to:v,tag:i[2]};return w=="selfClose"?{open:R,close:null,at:"open"}:i[1]?{open:y(l,i[2]),close:R,at:"close"}:(l=new C(u,v.line,v.ch,o),{open:R,close:E(l,i[2]),at:"open"})},I.findEnclosingTag=function(u,n,o,l){for(var w=new C(u,n.line,n.ch,o);;){var v=y(w,l);if(!v)break;var i=new C(u,n.line,n.ch,o),R=E(i,v.tag);if(R)return{open:v,close:R}}},I.scanForClosingTag=function(u,n,o,l){var w=new C(u,n.line,n.ch,l?{from:0,to:l}:null);return E(w,o)}})},p5ED:function(M,ne,N){"use strict";var I=N("+L6B"),h=N("2/Rp"),S=N("5Dmo"),L=N("3S7+"),T=N("k1fw"),c=N("9og8"),C=N("tJVT"),g=N("WmNS"),s=N.n(g),a=N("q1tI"),r=N.n(a),f=N("vHTk"),p=N.n(f),m=N("yEEn"),E=N("ZW9T"),y=N("1vsH"),u=N("V0Rq"),n=N("m3rI");ne.a=function(o){var l,w,v,i,R,k,d,b=o.editOffice,x=b===void 0?"view":b,_=o.data,B=o.theme,U=o.type,P=o.filename,J=o.monacoEditor,$=o.className,z=o.style,V=o.close,K=o.onClose,H=o.hasMask,G=o.disabledDownload,ie=Object(a.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),le=Object(C.a)(ie,2),ue=le[0],be=le[1],Ce=Object(a.useState)(""),se=Object(C.a)(Ce,2),ce=se[0],he=se[1],ae=Object(a.useState)(),Q=Object(C.a)(ae,2),D=Q[0],F=Q[1],W=window.ENV==="build"?"/react/build":"",Y=n.a.PROXY_SERVER||location.origin,Z,te=1024*1024,q=10*te,X=Object(a.useRef)();(l=_)!==null&&l!==void 0&&l.startsWith("/api")&&U!=="txt"&&(_=(n.a.API_SERVER||location.origin)+_),U==="office"&&(Z=Object(y.T)(_).filesize,Z>q&&(U="other")),P&&J&&(J.filename=P),Object(a.useEffect)(function(){var Te,Re,Ie=(Te=document.cookie)===null||Te===void 0||((Re=Te.replace(/\s/g,""))===null||Re===void 0)?void 0:Re.split(";");Ie==null||Ie.map(function(je){var Ne=je.split("=");Ne[0]==="_educoder_session"&&he(Ne[1])})},[]),Object(a.useEffect)(function(){U==="office"&&re()},[U,_]);var re=function(){var Te=Object(c.a)(s.a.mark(function Re(){var Ie,je,Ne;return s.a.wrap(function(Be){for(;;)switch(Be.prev=Be.next){case 0:return console.log("data:",_),Ie=_,_.startsWith("http")||(Ie=location.origin+Ie),je=new URL(Ie).pathname.split("/").pop(),Be.next=6,Object(u.V)({attachment_id:je});case 6:Ne=Be.sent,F(Ne);case 8:case"end":return Be.stop()}},Re)}));return function(){return Te.apply(this,arguments)}}(),me=function(){if(_.startsWith("http")||_.startsWith("blob:")){ve();return}Object(y.z)(P||"educoder",_,P)},ve=function(){Object(y.x)(P||"educoder",decodeURIComponent(_))};return r.a.createElement("div",{style:Object(T.a)({},z||{}),className:"".concat(H&&p.a.bgBlack," ").concat(U?p.a.wrp:"hide")},V&&r.a.createElement("div",{className:p.a.close,ref:X},!G&&r.a.createElement(L.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return X.current}},r.a.createElement("span",{onClick:ve},r.a.createElement("i",{className:"icon-quxiaozhiding"}))),r.a.createElement(L.a,{title:"\u5173\u95ED",getPopupContainer:function(){return X.current}},r.a.createElement("span",{className:"",onClick:K},r.a.createElement("i",{className:"icon-guanbi1"})))),r.a.createElement("div",{className:"".concat(p.a[$]," ").concat($," ").concat(p.a.monaco," ").concat(U==="txt"?"show":"hide")},U==="txt"&&r.a.createElement(E.b,J)),U==="audio"&&r.a.createElement("audio",{src:"".concat(((w=_)===null||w===void 0?void 0:w.indexOf("http://"))>-1||((v=_)===null||v===void 0?void 0:v.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(_),autoPlay:!0}),U==="video"&&r.a.createElement(r.a.Fragment,null,((i=_)===null||i===void 0?void 0:i.indexOf("http"))>-1?r.a.createElement("video",{controls:!0,src:"".concat(_),autoPlay:!0}):r.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(_),autoPlay:!0})),U==="office"&&D&&r.a.createElement("iframe",{src:"".concat(W,"/office.html?key=").concat(D.key,"&url=").concat(Y+D.url,"&callbackUrl=").concat(Y+D.callbackUrl,"&fileType=").concat(D.fileType,"&title=").concat(D.title,"&model=").concat(x,"&officeServer=").concat(n.a.OFFICE_SERVER,"&disabledDownload=").concat(!!G)}),U==="html"&&r.a.createElement("iframe",{src:_+"&disposition=inline"}),U==="pdf"&&r.a.createElement("iframe",{src:"".concat(W,"/js/pdfview/index.html?url=").concat(_,"&disabledDownload=").concat(!!G)}),U==="image"&&r.a.createElement("img",{src:"".concat(((R=_)===null||R===void 0?void 0:R.indexOf("http://"))>-1||((k=_)===null||k===void 0?void 0:k.indexOf("https://"))>-1||(d=_)!==null&&d!==void 0&&d.startsWith("/api")?"":"data:image/png;base64,").concat(_)}),U==="other"&&r.a.createElement("div",null,r.a.createElement(h.a,{type:"primary",size:"large",onClick:me},r.a.createElement(m.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),U==="download"&&r.a.createElement(h.a,{type:"primary",size:"large",onClick:me},r.a.createElement(m.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(M,ne,N){},pA7S:function(M,ne,N){(function(I,h,S){M.exports=ne=h(N("Ib8C"),N("ETIr"),N("cv67"),N("K3mO"),N("OLod"))})(this,function(I){return function(){var h=I,S=h.lib,L=S.WordArray,T=S.BlockCipher,c=h.algo,C=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],g=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],s=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],a=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],r=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],f=c.DES=T.extend({_doReset:function(){for(var y=this._key,u=y.words,n=[],o=0;o<56;o++){var l=C[o]-1;n[o]=u[l>>>5]>>>31-l%32&1}for(var w=this._subKeys=[],v=0;v<16;v++){for(var i=w[v]=[],R=s[v],o=0;o<24;o++)i[o/6|0]|=n[(g[o]-1+R)%28]<<31-o%6,i[4+(o/6|0)]|=n[28+(g[o+24]-1+R)%28]<<31-o%6;i[0]=i[0]<<1|i[0]>>>31;for(var o=1;o<7;o++)i[o]=i[o]>>>(o-1)*4+3;i[7]=i[7]<<5|i[7]>>>27}for(var k=this._invSubKeys=[],o=0;o<16;o++)k[o]=w[15-o]},encryptBlock:function(y,u){this._doCryptBlock(y,u,this._subKeys)},decryptBlock:function(y,u){this._doCryptBlock(y,u,this._invSubKeys)},_doCryptBlock:function(y,u,n){this._lBlock=y[u],this._rBlock=y[u+1],p.call(this,4,252645135),p.call(this,16,65535),m.call(this,2,858993459),m.call(this,8,16711935),p.call(this,1,1431655765);for(var o=0;o<16;o++){for(var l=n[o],w=this._lBlock,v=this._rBlock,i=0,R=0;R<8;R++)i|=a[R][((v^l[R])&r[R])>>>0];this._lBlock=v,this._rBlock=w^i}var k=this._lBlock;this._lBlock=this._rBlock,this._rBlock=k,p.call(this,1,1431655765),m.call(this,8,16711935),m.call(this,2,858993459),p.call(this,16,65535),p.call(this,4,252645135),y[u]=this._lBlock,y[u+1]=this._rBlock},keySize:64/32,ivSize:64/32,blockSize:64/32});function p(y,u){var n=(this._lBlock>>>y^this._rBlock)&u;this._rBlock^=n,this._lBlock^=n<<y}function m(y,u){var n=(this._rBlock>>>y^this._lBlock)&u;this._lBlock^=n,this._rBlock^=n<<y}h.DES=T._createHelper(f);var E=c.TripleDES=T.extend({_doReset:function(){var y=this._key,u=y.words;if(u.length!==2&&u.length!==4&&u.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var n=u.slice(0,2),o=u.length<4?u.slice(0,2):u.slice(2,4),l=u.length<6?u.slice(0,2):u.slice(4,6);this._des1=f.createEncryptor(L.create(n)),this._des2=f.createEncryptor(L.create(o)),this._des3=f.createEncryptor(L.create(l))},encryptBlock:function(y,u){this._des1.encryptBlock(y,u),this._des2.decryptBlock(y,u),this._des3.encryptBlock(y,u)},decryptBlock:function(y,u){this._des3.decryptBlock(y,u),this._des2.encryptBlock(y,u),this._des1.decryptBlock(y,u)},keySize:192/32,ivSize:64/32,blockSize:64/32});h.TripleDES=T._createHelper(E)}(),I.TripleDES})},qBft:function(M,ne,N){(function(I,h,S){M.exports=ne=h(N("Ib8C"),N("OLod"))})(this,function(I){return I.pad.AnsiX923={pad:function(h,S){var L=h.sigBytes,T=S*4,c=T-L%T,C=L+c-1;h.clamp(),h.words[C>>>2]|=c<<24-C%4*8,h.sigBytes+=c},unpad:function(h){var S=h.words[h.sigBytes-1>>>2]&255;h.sigBytes-=S}},I.pad.Ansix923})},qM6L:function(M,ne,N){(function(I,h){M.exports=ne=h(N("Ib8C"))})(this,function(I){return function(){var h=I,S=h.lib,L=S.WordArray,T=h.enc,c=T.Utf16=T.Utf16BE={stringify:function(g){for(var s=g.words,a=g.sigBytes,r=[],f=0;f<a;f+=2){var p=s[f>>>2]>>>16-f%4*8&65535;r.push(String.fromCharCode(p))}return r.join("")},parse:function(g){for(var s=g.length,a=[],r=0;r<s;r++)a[r>>>1]|=g.charCodeAt(r)<<16-r%2*16;return L.create(a,s*2)}};T.Utf16LE={stringify:function(g){for(var s=g.words,a=g.sigBytes,r=[],f=0;f<a;f+=2){var p=C(s[f>>>2]>>>16-f%4*8&65535);r.push(String.fromCharCode(p))}return r.join("")},parse:function(g){for(var s=g.length,a=[],r=0;r<s;r++)a[r>>>1]|=C(g.charCodeAt(r)<<16-r%2*16);return L.create(a,s*2)}};function C(g){return g<<8&4278255360|g>>>8&16711935}}(),I.enc.Utf16})},qu8F:function(M,ne,N){(function(I,h,S){M.exports=ne=h(N("Ib8C"),N("OLod"))})(this,function(I){/** @preserve
* Counter block mode compatible with Dr Brian Gladman fileenc.c
* derived from CryptoJS.mode.CTR
* Jan Hruby jhruby.web@gmail.com
*/return I.mode.CTRGladman=function(){var h=I.lib.BlockCipherMode.extend();function S(c){if((c>>24&255)===255){var C=c>>16&255,g=c>>8&255,s=c&255;C===255?(C=0,g===255?(g=0,s===255?s=0:++s):++g):++C,c=0,c+=C<<16,c+=g<<8,c+=s}else c+=1<<24;return c}function L(c){return(c[0]=S(c[0]))===0&&(c[1]=S(c[1])),c}var T=h.Encryptor=h.extend({processBlock:function(c,C){var g=this._cipher,s=g.blockSize,a=this._iv,r=this._counter;a&&(r=this._counter=a.slice(0),this._iv=void 0),L(r);var f=r.slice(0);g.encryptBlock(f,0);for(var p=0;p<s;p++)c[C+p]^=f[p]}});return h.Decryptor=T,h}(),I.mode.CTRGladman})},rUJ1:function(M,ne){const N=/[&<>"']/,I=/[&<>"']/g,h=/[<>"']|&(?!#?\w+;)/,S=/[<>"']|&(?!#?\w+;)/g,L={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},T=k=>L[k];function c(k,d){if(d){if(N.test(k))return k.replace(I,T)}else if(h.test(k))return k.replace(S,T);return k}const C=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function g(k){return k.replace(C,(d,b)=>(b=b.toLowerCase(),b==="colon"?":":b.charAt(0)==="#"?b.charAt(1)==="x"?String.fromCharCode(parseInt(b.substring(2),16)):String.fromCharCode(+b.substring(1)):""))}const s=/(^|[^\[])\^/g;function a(k,d){k=k.source||k,d=d||"";const b={replace:(x,_)=>(_=_.source||_,_=_.replace(s,"$1"),k=k.replace(x,_),b),getRegex:()=>new RegExp(k,d)};return b}const r=/[^\w:]/g,f=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function p(k,d,b){if(k){let x;try{x=decodeURIComponent(g(b)).replace(r,"").toLowerCase()}catch(_){return null}if(x.indexOf("javascript:")===0||x.indexOf("vbscript:")===0||x.indexOf("data:")===0)return null}d&&!f.test(b)&&(b=n(d,b));try{b=encodeURI(b).replace(/%25/g,"%")}catch(x){return null}return b}const m={},E=/^[^:]+:\/*[^/]*$/,y=/^([^:]+:)[\s\S]*$/,u=/^([^:]+:\/*[^/]*)[\s\S]*$/;function n(k,d){m[" "+k]||(E.test(k)?m[" "+k]=k+"/":m[" "+k]=v(k,"/",!0)),k=m[" "+k];const b=k.indexOf(":")===-1;return d.substring(0,2)==="//"?b?d:k.replace(y,"$1")+d:d.charAt(0)==="/"?b?d:k.replace(u,"$1")+d:k+d}const o={exec:function(){}};function l(k){let d=1,b,x;for(;d<arguments.length;d++){b=arguments[d];for(x in b)Object.prototype.hasOwnProperty.call(b,x)&&(k[x]=b[x])}return k}function w(k,d){const b=k.replace(/\|/g,(B,U,P)=>{let J=!1,$=U;for(;--$>=0&&P[$]==="\\";)J=!J;return J?"|":" |"}),x=b.split(/ \|/);let _=0;if(x.length>d)x.splice(d);else for(;x.length<d;)x.push("");for(;_<x.length;_++)x[_]=x[_].trim().replace(/\\\|/g,"|");return x}function v(k,d,b){const x=k.length;if(x===0)return"";let _=0;for(;_<x;){const B=k.charAt(x-_-1);if(B===d&&!b)_++;else if(B!==d&&b)_++;else break}return k.substr(0,x-_)}function i(k,d){if(k.indexOf(d[1])===-1)return-1;const b=k.length;let x=0,_=0;for(;_<b;_++)if(k[_]==="\\")_++;else if(k[_]===d[0])x++;else if(k[_]===d[1]&&(x--,x<0))return _;return-1}function R(k){k&&k.sanitize&&!k.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")}M.exports={escape:c,unescape:g,edit:a,cleanUrl:p,resolveUrl:n,noopTest:o,merge:l,splitCells:w,rtrim:v,findClosingBracket:i,checkSanitizeDeprecation:R}},rdUC:function(M,ne,N){var I=N("MFOe"),h=I.Global;M.exports={name:"localStorage",read:L,write:T,each:c,remove:C,clearAll:g};function S(){return h.localStorage}function L(s){return S().getItem(s)}function T(s,a){return S().setItem(s,a)}function c(s){for(var a=S().length-1;a>=0;a--){var r=S().key(a);s(L(r),r)}}function C(s){return S().removeItem(s)}function g(){return S().clear()}},sboe:function(M,ne,N){"use strict";N.d(ne,"a",function(){return S});var I=N("q1tI"),h=N.n(I),S=I.createContext(null)},spXi:function(M,ne,N){M.exports={flex_box_center:"flex_box_center___2B_Y7",flex_space_between:"flex_space_between___2olzC",flex_box_vertical_center:"flex_box_vertical_center___2Z4dV",flex_box_center_end:"flex_box_center_end___3FiwX",flex_box_column:"flex_box_column___8kyK-",customTree:"customTree___1KOYx",name:"name___3pqs4"}},u2Z1:function(M,ne,N){"use strict";N.d(ne,"a",function(){return v});var I=N("miYZ"),h=N("tsqr"),S=N("9og8"),L=N("5NDa"),T=N("5rEg"),c=N("2qtc"),C=N("kLXV"),g=N("oBTY"),s=N("tJVT"),a=N("OaEy"),r=N("2fM7"),f=N("WmNS"),p=N.n(f),m=N("q1tI"),E=N.n(m),y=N("ErOA"),u=N("i58Z"),n=N.n(u),o=N("T1X5"),l=N.n(o),w=r.a.Option,v=function(R){var k=R.subId,d=R.value,b=R.selectvalues,x=R.disabled,_=R.knowledgeOptions,B=_===void 0?[]:_,U=R.onChange,P=U===void 0?function(){}:U,J=R.onAddKnowledgeFinish,$=J===void 0?function(){}:J,z=Object(m.useRef)(),V=Object(m.useState)([]),K=Object(s.a)(V,2),H=K[0],G=K[1];d=d||[];var ie=function(be,Ce){be?(G([Ce.key]),P([Ce.key])):(G([]),P([]))};Object(m.useEffect)(function(){(b==null?void 0:b.length)>0&&(G(Object(g.a)(b)),P(Object(g.a)(b)))},[B]),Object(m.useEffect)(function(){var ue;((ue=d)===null||ue===void 0?void 0:ue.length)>0&&P(Object(g.a)(d))},[B]);var le=function(be){be.preventDefault(),z.current="",C.a.confirm({centered:!0,width:700,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",icon:null,title:"\u65B0\u5EFA\u77E5\u8BC6\u70B9",className:"custom-modal-divider",content:E.a.createElement("div",{className:"font14"},E.a.createElement("div",{style:{display:"flex",marginTop:"48px",marginBottom:"36px"}},E.a.createElement("img",{src:l.a,style:{width:"108px",height:"108px",marginRight:"29px"}}),"\u60A8\u586B\u5199\u7684\u77E5\u8BC6\u70B9\u6682\u65F6\u4EC5\u5BF9\u672C\u4EBA\u53EF\u89C1\uFF0C\u5E73\u53F0\u5BA1\u6838\u901A\u8FC7\u540E\u5C06\u5217\u5165\u516C\u5F00\u77E5\u8BC6\u70B9\uFF0C\u5BF9\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF1B",E.a.createElement("br",null),"\u5E73\u53F0\u5BA1\u6838\u8FC7\u7A0B\u4E2D\u6709\u6743\u5220\u9664\u4E0D\u5408\u9002\u7684\u77E5\u8BC6\u70B9\uFF08\u5305\u62EC\u4F46\u4E0D\u9650\u4E8E\u9519\u8BEF\u3001\u975E\u6CD5\u3001\u4E0D\u96C5\u3001\u4E0D\u5339\u914D\u5F53\u524D\u8BFE\u7A0B\u7B49\u60C5\u5F62\uFF09\uFF0C\u5220\u9664\u540E\u53EF\u80FD\u5F71\u54CD\u60A8\u7684\u8BD5\u9898\u7684\u6B63\u5E38\u4F7F\u7528\u3002",E.a.createElement("br",null),"\u8BF7\u8BA4\u771F\u586B\u5199\u4E0E\u6559\u5B66\u5185\u5BB9\u76F8\u5173\u7684\u771F\u5B9E\u77E5\u8BC6\u70B9 ",E.a.createElement("br",null)),E.a.createElement(T.a,{className:"mt5",maxLength:20,style:{marginBottom:"42px"},placeholder:"\u8BF7\u8F93\u5165\u4E0D\u8D85\u8FC720\u5B57\u7684\u77E5\u8BC6\u70B9\u540D\u79F0",defaultValue:z.current,onChange:function(se){z.current=se.target.value}})),onOk:function(){return new Promise(function(){var se=Object(S.a)(p.a.mark(function ce(he,ae){var Q,D;return p.a.wrap(function(W){for(;;)switch(W.prev=W.next){case 0:if(z.current){W.next=3;break}return h.b.warn("\u8BF7\u8F93\u5165\u77E5\u8BC6\u70B9\u540D\u79F0"),W.abrupt("return",ae());case 3:if(!(z.current.length>20)){W.next=6;break}return h.b.warn("\u8BF7\u8F93\u5165\u4E0D\u8D85\u8FC720\u5B57\u7684\u77E5\u8BC6\u70B9\u540D\u79F0"),W.abrupt("return",ae());case 6:return W.next=8,Object(y.a)("/api/tag_disciplines.json",{method:"post",body:{name:z.current,sub_discipline_id:k}});case 8:return Q=W.sent,(Q==null?void 0:Q.status)===0&&($({id:Q.tag_discipline_id,name:z.current,type:"personal"}),D=[],D.push(Q.tag_discipline_id),P([].concat(D)),G([Q.tag_discipline_id]),P([].concat(D))),W.abrupt("return",he());case 11:case"end":return W.stop()}},ce)}));return function(ce,he){return se.apply(this,arguments)}}())}})};return E.a.createElement("div",{className:n.a.wrap},E.a.createElement(r.a,{disabled:!k||x,className:"mr5",style:{width:"242px"},onChange:ie,showSearch:!0,allowClear:!0,value:B==null?void 0:B.filter(function(ue){return(H==null?void 0:H.includes(ue==null?void 0:ue.id))||(H==null?void 0:H.includes((ue==null?void 0:ue.id)+""))}).map(function(ue){return ue.name})},B==null?void 0:B.map(function(ue){return E.a.createElement(w,{key:ue.id,value:ue.name},E.a.createElement("div",{style:{display:"flex",justifyContent:"space-between"}},E.a.createElement("span",{style:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}},ue.name),E.a.createElement("span",null,ue.type==="personal"?"\uFF08\u81EA\u7528\uFF09":"")))})),E.a.createElement("button",{disabled:!k,className:"".concat(n.a.addKnowledge," ").concat(k?"":n.a.disabled),onClick:le},"\u65B0\u5EFA\u77E5\u8BC6\u70B9"))}},uGsb:function(M,ne,N){(function(I,h,S){M.exports=ne=h(N("Ib8C"),N("MlIO"),N("1uat"))})(this,function(I){return function(){var h=I,S=h.x64,L=S.Word,T=S.WordArray,c=h.algo,C=c.SHA512,g=c.SHA384=C.extend({_doReset:function(){this._hash=new T.init([new L.init(3418070365,3238371032),new L.init(1654270250,914150663),new L.init(2438529370,812702999),new L.init(355462360,4144912697),new L.init(1731405415,4290775857),new L.init(2394180231,1750603025),new L.init(3675008525,1694076839),new L.init(1203062813,3204075428)])},_doFinalize:function(){var s=C._doFinalize.call(this);return s.sigBytes-=16,s}});h.SHA384=C._createHelper(g),h.HmacSHA384=C._createHmacHelper(g)}(),I.SHA384})},uGxW:function(M,ne,N){(function(I,h,S){M.exports=ne=h(N("Ib8C"),N("OLod"))})(this,function(I){return I.pad.NoPadding={pad:function(){},unpad:function(){}},I.pad.NoPadding})},uK0f:function(M,ne,N){(function(I,h){M.exports=h()})(this,function(){"use strict";function I(h,S,L){L=L||{},L.childrenKeyName=L.childrenKeyName||"children";var T=h||[],c=[],C=0;do{var g=T.filter(function(s){return S(s,C)})[0];if(!g)break;c.push(g),T=g[L.childrenKeyName]||[],C+=1}while(T.length>0);return c}return I})},uMZB:function(M,ne,N){M.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(M,ne,N){M.exports=I;function I(){return N("gaXo"),{}}},ulZh:function(M,ne,N){typeof window!="undefined"&&function(h,S){M.exports=S()}(this,function(){return function(I){var h={};function S(L){if(h[L])return h[L].exports;var T=h[L]={i:L,l:!1,exports:{}};return I[L].call(T.exports,T,T.exports,S),T.l=!0,T.exports}return S.m=I,S.c=h,S.d=function(L,T,c){S.o(L,T)||Object.defineProperty(L,T,{enumerable:!0,get:c})},S.r=function(L){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(L,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(L,"__esModule",{value:!0})},S.t=function(L,T){if(T&1&&(L=S(L)),T&8)return L;if(T&4&&typeof L=="object"&&L&&L.__esModule)return L;var c=Object.create(null);if(S.r(c),Object.defineProperty(c,"default",{enumerable:!0,value:L}),T&2&&typeof L!="string")for(var C in L)S.d(c,C,function(g){return L[g]}.bind(null,C));return c},S.n=function(L){var T=L&&L.__esModule?function(){return L.default}:function(){return L};return S.d(T,"a",T),T},S.o=function(L,T){return Object.prototype.hasOwnProperty.call(L,T)},S.p="/dist/",S(S.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(I,h,S){"use strict";var L=Object.prototype.hasOwnProperty,T="~";function c(){}Object.create&&(c.prototype=Object.create(null),new c().__proto__||(T=!1));function C(r,f,p){this.fn=r,this.context=f,this.once=p||!1}function g(r,f,p,m,E){if(typeof p!="function")throw new TypeError("The listener must be a function");var y=new C(p,m||r,E),u=T?T+f:f;return r._events[u]?r._events[u].fn?r._events[u]=[r._events[u],y]:r._events[u].push(y):(r._events[u]=y,r._eventsCount++),r}function s(r,f){--r._eventsCount===0?r._events=new c:delete r._events[f]}function a(){this._events=new c,this._eventsCount=0}a.prototype.eventNames=function(){var f=[],p,m;if(this._eventsCount===0)return f;for(m in p=this._events)L.call(p,m)&&f.push(T?m.slice(1):m);return Object.getOwnPropertySymbols?f.concat(Object.getOwnPropertySymbols(p)):f},a.prototype.listeners=function(f){var p=T?T+f:f,m=this._events[p];if(!m)return[];if(m.fn)return[m.fn];for(var E=0,y=m.length,u=new Array(y);E<y;E++)u[E]=m[E].fn;return u},a.prototype.listenerCount=function(f){var p=T?T+f:f,m=this._events[p];return m?m.fn?1:m.length:0},a.prototype.emit=function(f,p,m,E,y,u){var n=T?T+f:f;if(!this._events[n])return!1;var o=this._events[n],l=arguments.length,w,v;if(o.fn){o.once&&this.removeListener(f,o.fn,void 0,!0);switch(l){case 1:return o.fn.call(o.context),!0;case 2:return o.fn.call(o.context,p),!0;case 3:return o.fn.call(o.context,p,m),!0;case 4:return o.fn.call(o.context,p,m,E),!0;case 5:return o.fn.call(o.context,p,m,E,y),!0;case 6:return o.fn.call(o.context,p,m,E,y,u),!0}for(v=1,w=new Array(l-1);v<l;v++)w[v-1]=arguments[v];o.fn.apply(o.context,w)}else{var i=o.length,R;for(v=0;v<i;v++){o[v].once&&this.removeListener(f,o[v].fn,void 0,!0);switch(l){case 1:o[v].fn.call(o[v].context);break;case 2:o[v].fn.call(o[v].context,p);break;case 3:o[v].fn.call(o[v].context,p,m);break;case 4:o[v].fn.call(o[v].context,p,m,E);break;default:if(!w)for(R=1,w=new Array(l-1);R<l;R++)w[R-1]=arguments[R];o[v].fn.apply(o[v].context,w)}}}return!0},a.prototype.on=function(f,p,m){return g(this,f,p,m,!1)},a.prototype.once=function(f,p,m){return g(this,f,p,m,!0)},a.prototype.removeListener=function(f,p,m,E){var y=T?T+f:f;if(!this._events[y])return this;if(!p)return s(this,y),this;var u=this._events[y];if(u.fn)u.fn===p&&(!E||u.once)&&(!m||u.context===m)&&s(this,y);else{for(var n=0,o=[],l=u.length;n<l;n++)(u[n].fn!==p||E&&!u[n].once||m&&u[n].context!==m)&&o.push(u[n]);o.length?this._events[y]=o.length===1?o[0]:o:s(this,y)}return this},a.prototype.removeAllListeners=function(f){var p;return f?(p=T?T+f:f,this._events[p]&&s(this,p)):(this._events=new c,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=T,a.EventEmitter=a,I.exports=a},"./node_modules/url-toolkit/src/url-toolkit.js":function(I,h,S){(function(L){var T=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,c=/^([^\/?#]*)([^]*)$/,C=/(?:\/|^)\.(?=\/)/g,g=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,s={buildAbsoluteURL:function(a,r,f){if(f=f||{},a=a.trim(),r=r.trim(),!r){if(!f.alwaysNormalize)return a;var p=s.parseURL(a);if(!p)throw new Error("Error trying to parse base URL.");return p.path=s.normalizePath(p.path),s.buildURLFromParts(p)}var m=s.parseURL(r);if(!m)throw new Error("Error trying to parse relative URL.");if(m.scheme)return f.alwaysNormalize?(m.path=s.normalizePath(m.path),s.buildURLFromParts(m)):r;var E=s.parseURL(a);if(!E)throw new Error("Error trying to parse base URL.");if(!E.netLoc&&E.path&&E.path[0]!=="/"){var y=c.exec(E.path);E.netLoc=y[1],E.path=y[2]}E.netLoc&&!E.path&&(E.path="/");var u={scheme:E.scheme,netLoc:m.netLoc,path:null,params:m.params,query:m.query,fragment:m.fragment};if(!m.netLoc&&(u.netLoc=E.netLoc,m.path[0]!=="/"))if(!m.path)u.path=E.path,m.params||(u.params=E.params,m.query||(u.query=E.query));else{var n=E.path,o=n.substring(0,n.lastIndexOf("/")+1)+m.path;u.path=s.normalizePath(o)}return u.path===null&&(u.path=f.alwaysNormalize?s.normalizePath(m.path):m.path),s.buildURLFromParts(u)},parseURL:function(a){var r=T.exec(a);return r?{scheme:r[1]||"",netLoc:r[2]||"",path:r[3]||"",params:r[4]||"",query:r[5]||"",fragment:r[6]||""}:null},normalizePath:function(a){for(a=a.split("").reverse().join("").replace(C,"");a.length!==(a=a.replace(g,"")).length;);return a.split("").reverse().join("")},buildURLFromParts:function(a){return a.scheme+a.netLoc+a.path+a.params+a.query+a.fragment}};I.exports=s})(this)},"./node_modules/webworkify-webpack/index.js":function(I,h,S){function L(f){var p={};function m(y){if(p[y])return p[y].exports;var u=p[y]={i:y,l:!1,exports:{}};return f[y].call(u.exports,u,u.exports,m),u.l=!0,u.exports}m.m=f,m.c=p,m.i=function(y){return y},m.d=function(y,u,n){m.o(y,u)||Object.defineProperty(y,u,{configurable:!1,enumerable:!0,get:n})},m.r=function(y){Object.defineProperty(y,"__esModule",{value:!0})},m.n=function(y){var u=y&&y.__esModule?function(){return y.default}:function(){return y};return m.d(u,"a",u),u},m.o=function(y,u){return Object.prototype.hasOwnProperty.call(y,u)},m.p="/",m.oe=function(y){throw console.error(y),y};var E=m(m.s=ENTRY_MODULE);return E.default||E}var T="[\\.|\\-|\\+|\\w|/|@]+",c="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+T+").*?\\)";function C(f){return(f+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function g(f){return!isNaN(1*f)}function s(f,p,m){var E={};E[m]=[];var y=p.toString(),u=y.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!u)return E;for(var n=u[1],o=new RegExp("(\\\\n|\\W)"+C(n)+c,"g"),l;l=o.exec(y);){if(l[3]==="dll-reference")continue;E[m].push(l[3])}for(o=new RegExp("\\("+C(n)+'\\("(dll-reference\\s('+T+'))"\\)\\)'+c,"g");l=o.exec(y);)f[l[2]]||(E[m].push(l[1]),f[l[2]]=S(l[1]).m),E[l[2]]=E[l[2]]||[],E[l[2]].push(l[4]);for(var w=Object.keys(E),v=0;v<w.length;v++)for(var i=0;i<E[w[v]].length;i++)g(E[w[v]][i])&&(E[w[v]][i]=1*E[w[v]][i]);return E}function a(f){var p=Object.keys(f);return p.reduce(function(m,E){return m||f[E].length>0},!1)}function r(f,p){for(var m={main:[p]},E={main:[]},y={main:{}};a(m);)for(var u=Object.keys(m),n=0;n<u.length;n++){var o=u[n],l=m[o],w=l.pop();if(y[o]=y[o]||{},y[o][w]||!f[o][w])continue;y[o][w]=!0,E[o]=E[o]||[],E[o].push(w);for(var v=s(f,f[o][w],o),i=Object.keys(v),R=0;R<i.length;R++)m[i[R]]=m[i[R]]||[],m[i[R]]=m[i[R]].concat(v[i[R]])}return E}I.exports=function(f,p){p=p||{};var m={main:S.m},E=p.all?{main:Object.keys(m.main)}:r(m,f),y="";Object.keys(E).filter(function(w){return w!=="main"}).forEach(function(w){for(var v=0;E[w][v];)v++;E[w].push(v),m[w][v]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",y=y+"var "+w+" = ("+L.toString().replace("ENTRY_MODULE",JSON.stringify(v))+")({"+E[w].map(function(i){return""+JSON.stringify(i)+": "+m[w][i].toString()}).join(",")+`});
`}),y=y+"new (("+L.toString().replace("ENTRY_MODULE",JSON.stringify(f))+")({"+E.main.map(function(w){return""+JSON.stringify(w)+": "+m.main[w].toString()}).join(",")+"}))(self);";var u=new window.Blob([y],{type:"text/javascript"});if(p.bare)return u;var n=window.URL||window.webkitURL||window.mozURL||window.msURL,o=n.createObjectURL(u),l=new window.Worker(o);return l.objectURL=o,l}},"./src/config.ts":function(I,h,S){"use strict";S.r(h),S.d(h,"hlsDefaultConfig",function(){return R}),S.d(h,"mergeConfig",function(){return d}),S.d(h,"enableStreamingMode",function(){return b});var L=S("./src/controller/abr-controller.ts"),T=S("./src/controller/audio-stream-controller.ts"),c=S("./src/controller/audio-track-controller.ts"),C=S("./src/controller/subtitle-stream-controller.ts"),g=S("./src/controller/subtitle-track-controller.ts"),s=S("./src/controller/buffer-controller.ts"),a=S("./src/controller/timeline-controller.ts"),r=S("./src/controller/cap-level-controller.ts"),f=S("./src/controller/fps-controller.ts"),p=S("./src/controller/eme-controller.ts"),m=S("./src/controller/cmcd-controller.ts"),E=S("./src/utils/xhr-loader.ts"),y=S("./src/utils/fetch-loader.ts"),u=S("./src/utils/cues.ts"),n=S("./src/utils/mediakeys-helper.ts"),o=S("./src/utils/logger.ts");function l(){return l=Object.assign||function(x){for(var _=1;_<arguments.length;_++){var B=arguments[_];for(var U in B)Object.prototype.hasOwnProperty.call(B,U)&&(x[U]=B[U])}return x},l.apply(this,arguments)}function w(x,_){var B=Object.keys(x);if(Object.getOwnPropertySymbols){var U=Object.getOwnPropertySymbols(x);_&&(U=U.filter(function(P){return Object.getOwnPropertyDescriptor(x,P).enumerable})),B.push.apply(B,U)}return B}function v(x){for(var _=1;_<arguments.length;_++){var B=arguments[_]!=null?arguments[_]:{};_%2?w(Object(B),!0).forEach(function(U){i(x,U,B[U])}):Object.getOwnPropertyDescriptors?Object.defineProperties(x,Object.getOwnPropertyDescriptors(B)):w(Object(B)).forEach(function(U){Object.defineProperty(x,U,Object.getOwnPropertyDescriptor(B,U))})}return x}function i(x,_,B){return _ in x?Object.defineProperty(x,_,{value:B,enumerable:!0,configurable:!0,writable:!0}):x[_]=B,x}var R=v(v({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:E.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:L.default,bufferController:s.default,capLevelController:r.default,fpsController:f.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},k()),{},{subtitleStreamController:C.SubtitleStreamController,subtitleTrackController:g.default,timelineController:a.TimelineController,audioStreamController:T.default,audioTrackController:c.default,emeController:p.default,cmcdController:m.default});function k(){return{cueHandler:u.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 d(x,_){if((_.liveSyncDurationCount||_.liveMaxLatencyDurationCount)&&(_.liveSyncDuration||_.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(_.liveMaxLatencyDurationCount!==void 0&&(_.liveSyncDurationCount===void 0||_.liveMaxLatencyDurationCount<=_.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(_.liveMaxLatencyDuration!==void 0&&(_.liveSyncDuration===void 0||_.liveMaxLatencyDuration<=_.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return l({},x,_)}function b(x){var _=x.loader;if(_!==y.default&&_!==E.default)o.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),x.progressive=!1;else{var B=Object(y.fetchSupported)();B&&(x.loader=y.default,x.progressive=!0,x.enableSoftwareAES=!0,o.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(I,h,S){"use strict";S.r(h);var L=S("./src/polyfills/number.ts"),T=S("./src/utils/ewma-bandwidth-estimator.ts"),c=S("./src/events.ts"),C=S("./src/utils/buffer-helper.ts"),g=S("./src/errors.ts"),s=S("./src/types/loader.ts"),a=S("./src/utils/logger.ts");function r(m,E){for(var y=0;y<E.length;y++){var u=E[y];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(m,u.key,u)}}function f(m,E,y){return E&&r(m.prototype,E),y&&r(m,y),m}var p=function(){function m(y){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=y;var u=y.config;this.bwEstimator=new T.default(u.abrEwmaSlowVoD,u.abrEwmaFastVoD,u.abrEwmaDefaultEstimate),this.registerListeners()}var E=m.prototype;return E.registerListeners=function(){var u=this.hls;u.on(c.Events.FRAG_LOADING,this.onFragLoading,this),u.on(c.Events.FRAG_LOADED,this.onFragLoaded,this),u.on(c.Events.FRAG_BUFFERED,this.onFragBuffered,this),u.on(c.Events.LEVEL_LOADED,this.onLevelLoaded,this),u.on(c.Events.ERROR,this.onError,this)},E.unregisterListeners=function(){var u=this.hls;u.off(c.Events.FRAG_LOADING,this.onFragLoading,this),u.off(c.Events.FRAG_LOADED,this.onFragLoaded,this),u.off(c.Events.FRAG_BUFFERED,this.onFragBuffered,this),u.off(c.Events.LEVEL_LOADED,this.onLevelLoaded,this),u.off(c.Events.ERROR,this.onError,this)},E.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},E.onFragLoading=function(u,n){var o=n.frag;if(o.type===s.PlaylistLevelType.MAIN&&!this.timer){var l;this.fragCurrent=o,this.partCurrent=(l=n.part)!=null?l:null,this.timer=self.setInterval(this.onCheck,100)}},E.onLevelLoaded=function(u,n){var o=this.hls.config;n.details.live?this.bwEstimator.update(o.abrEwmaSlowLive,o.abrEwmaFastLive):this.bwEstimator.update(o.abrEwmaSlowVoD,o.abrEwmaFastVoD)},E._abandonRulesCheck=function(){var u=this.fragCurrent,n=this.partCurrent,o=this.hls,l=o.autoLevelEnabled,w=o.config,v=o.media;if(!u||!v)return;var i=n?n.stats:u.stats,R=n?n.duration:u.duration;if(i.aborted){a.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!l||v.paused||!v.playbackRate||!v.readyState)return;var k=performance.now()-i.loading.start,d=Math.abs(v.playbackRate);if(k<=500*R/d)return;var b=o.levels,x=o.minAutoLevel,_=b[u.level],B=i.total||Math.max(i.loaded,Math.round(R*_.maxBitrate/8)),U=Math.max(1,i.bwEstimate?i.bwEstimate/8:i.loaded*1e3/k),P=(B-i.loaded)/U,J=v.currentTime,$=(C.BufferHelper.bufferInfo(v,J,w.maxBufferHole).end-J)/d;if($>=2*R/d||P<=$)return;var z=Number.POSITIVE_INFINITY,V;for(V=u.level-1;V>x;V--){var K=b[V].maxBitrate;if(z=R*K/(8*.8*U),z<$)break}if(z>=P)return;var H=this.bwEstimator.getEstimate();a.logger.warn("Fragment "+u.sn+(n?" part "+n.index:"")+" of level "+u.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+V+`
Current BW estimate: `+(Object(L.isFiniteNumber)(H)?(H/1024).toFixed(3):"Unknown")+` Kb/s
Estimated load time for current fragment: `+P.toFixed(3)+` s
Estimated load time for the next fragment: `+z.toFixed(3)+` s
Time to underbuffer: `+$.toFixed(3)+" s"),o.nextLoadLevel=V,this.bwEstimator.sample(k,i.loaded),this.clearTimer(),u.loader&&(this.fragCurrent=this.partCurrent=null,u.loader.abort()),o.trigger(c.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:u,part:n,stats:i})},E.onFragLoaded=function(u,n){var o=n.frag,l=n.part;if(o.type===s.PlaylistLevelType.MAIN&&Object(L.isFiniteNumber)(o.sn)){var w=l?l.stats:o.stats,v=l?l.duration:o.duration;if(this.clearTimer(),this.lastLoadedFragLevel=o.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var i=this.hls.levels[o.level],R=(i.loaded?i.loaded.bytes:0)+w.loaded,k=(i.loaded?i.loaded.duration:0)+v;i.loaded={bytes:R,duration:k},i.realBitrate=Math.round(8*R/k)}if(o.bitrateTest){var d={stats:w,frag:o,part:l,id:o.type};this.onFragBuffered(c.Events.FRAG_BUFFERED,d),o.bitrateTest=!1}}},E.onFragBuffered=function(u,n){var o=n.frag,l=n.part,w=l?l.stats:o.stats;if(w.aborted)return;if(o.type!==s.PlaylistLevelType.MAIN||o.sn==="initSegment")return;var v=w.parsing.end-w.loading.start;this.bwEstimator.sample(v,w.loaded),w.bwEstimate=this.bwEstimator.getEstimate(),o.bitrateTest?this.bitrateTestDelay=v/1e3:this.bitrateTestDelay=0},E.onError=function(u,n){switch(n.details){case g.ErrorDetails.FRAG_LOAD_ERROR:case g.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},E.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},E.getNextABRAutoLevel=function(){var u=this.fragCurrent,n=this.partCurrent,o=this.hls,l=o.maxAutoLevel,w=o.config,v=o.minAutoLevel,i=o.media,R=n?n.duration:u?u.duration:0,k=i?i.currentTime:0,d=i&&i.playbackRate!==0?Math.abs(i.playbackRate):1,b=this.bwEstimator?this.bwEstimator.getEstimate():w.abrEwmaDefaultEstimate,x=(C.BufferHelper.bufferInfo(i,k,w.maxBufferHole).end-k)/d,_=this.findBestLevel(b,v,l,x,w.abrBandWidthFactor,w.abrBandWidthUpFactor);if(_>=0)return _;a.logger.trace((x?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var B=R?Math.min(R,w.maxStarvationDelay):w.maxStarvationDelay,U=w.abrBandWidthFactor,P=w.abrBandWidthUpFactor;if(!x){var J=this.bitrateTestDelay;if(J){var $=R?Math.min(R,w.maxLoadingDelay):w.maxLoadingDelay;B=$-J,a.logger.trace("bitrate test took "+Math.round(1e3*J)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*B)+" ms"),U=P=1}}return _=this.findBestLevel(b,v,l,x+B,U,P),Math.max(_,0)},E.findBestLevel=function(u,n,o,l,w,v){for(var i,R=this.fragCurrent,k=this.partCurrent,d=this.lastLoadedFragLevel,b=this.hls.levels,x=b[d],_=!!(x!=null&&(i=x.details)!==null&&i!==void 0&&i.live),B=x==null?void 0:x.codecSet,U=k?k.duration:R?R.duration:0,P=o;P>=n;P--){var J=b[P];if(!J||B&&J.codecSet!==B)continue;var $=J.details,z=(k?$==null?void 0:$.partTarget:$==null?void 0:$.averagetargetduration)||U,V=void 0;P<=d?V=w*u:V=v*u;var K=b[P].maxBitrate,H=K*z/V;if(a.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+P+"/"+Math.round(V)+"/"+K+"/"+z+"/"+l+"/"+H),V>K&&(!H||_&&!this.bitrateTestDelay||H<l))return P}return-1},f(m,[{key:"nextAutoLevel",get:function(){var u=this._nextAutoLevel,n=this.bwEstimator;if(u!==-1&&(!n||!n.canEstimate()))return u;var o=this.getNextABRAutoLevel();return u!==-1&&(o=Math.min(u,o)),o},set:function(u){this._nextAutoLevel=u}}]),m}();h.default=p},"./src/controller/audio-stream-controller.ts":function(I,h,S){"use strict";S.r(h);var L=S("./src/polyfills/number.ts"),T=S("./src/controller/base-stream-controller.ts"),c=S("./src/events.ts"),C=S("./src/utils/buffer-helper.ts"),g=S("./src/controller/fragment-tracker.ts"),s=S("./src/types/level.ts"),a=S("./src/types/loader.ts"),r=S("./src/loader/fragment.ts"),f=S("./src/demux/chunk-cache.ts"),p=S("./src/demux/transmuxer-interface.ts"),m=S("./src/types/transmuxer.ts"),E=S("./src/controller/fragment-finders.ts"),y=S("./src/utils/discontinuities.ts"),u=S("./src/errors.ts"),n=S("./src/utils/logger.ts");function o(){return o=Object.assign||function(R){for(var k=1;k<arguments.length;k++){var d=arguments[k];for(var b in d)Object.prototype.hasOwnProperty.call(d,b)&&(R[b]=d[b])}return R},o.apply(this,arguments)}function l(R,k){R.prototype=Object.create(k.prototype),R.prototype.constructor=R,w(R,k)}function w(R,k){return w=Object.setPrototypeOf||function(b,x){return b.__proto__=x,b},w(R,k)}var v=100,i=function(R){l(k,R);function k(b,x){var _;return _=R.call(this,b,x,"[audio-stream-controller]")||this,_.videoBuffer=null,_.videoTrackCC=-1,_.waitingVideoCC=-1,_.audioSwitch=!1,_.trackId=-1,_.waitingData=null,_.mainDetails=null,_.bufferFlushed=!1,_._registerListeners(),_}var d=k.prototype;return d.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},d._registerListeners=function(){var x=this.hls;x.on(c.Events.MEDIA_ATTACHED,this.onMediaAttached,this),x.on(c.Events.MEDIA_DETACHING,this.onMediaDetaching,this),x.on(c.Events.MANIFEST_LOADING,this.onManifestLoading,this),x.on(c.Events.LEVEL_LOADED,this.onLevelLoaded,this),x.on(c.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),x.on(c.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),x.on(c.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),x.on(c.Events.ERROR,this.onError,this),x.on(c.Events.BUFFER_RESET,this.onBufferReset,this),x.on(c.Events.BUFFER_CREATED,this.onBufferCreated,this),x.on(c.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),x.on(c.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),x.on(c.Events.FRAG_BUFFERED,this.onFragBuffered,this)},d._unregisterListeners=function(){var x=this.hls;x.off(c.Events.MEDIA_ATTACHED,this.onMediaAttached,this),x.off(c.Events.MEDIA_DETACHING,this.onMediaDetaching,this),x.off(c.Events.MANIFEST_LOADING,this.onManifestLoading,this),x.off(c.Events.LEVEL_LOADED,this.onLevelLoaded,this),x.off(c.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),x.off(c.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),x.off(c.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),x.off(c.Events.ERROR,this.onError,this),x.off(c.Events.BUFFER_RESET,this.onBufferReset,this),x.off(c.Events.BUFFER_CREATED,this.onBufferCreated,this),x.off(c.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),x.off(c.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),x.off(c.Events.FRAG_BUFFERED,this.onFragBuffered,this)},d.onInitPtsFound=function(x,_){var B=_.frag,U=_.id,P=_.initPTS;if(U==="main"){var J=B.cc;this.initPTS[B.cc]=P,this.log("InitPTS for cc: "+J+" found from main: "+P),this.videoTrackCC=J,this.state===T.State.WAITING_INIT_PTS&&this.tick()}},d.startLoad=function(x){if(!this.levels){this.startPosition=x,this.state=T.State.STOPPED;return}var _=this.lastCurrentTime;this.stopLoad(),this.setInterval(v),this.fragLoadError=0,_>0&&x===-1?(this.log("Override startPosition with lastCurrentTime @"+_.toFixed(3)),this.state=T.State.IDLE):(this.loadedmetadata=!1,this.state=T.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=x,this.tick()},d.doTick=function(){switch(this.state){case T.State.IDLE:this.doTickIdle();break;case T.State.WAITING_TRACK:{var x,_=this.levels,B=this.trackId,U=_==null||((x=_[B])===null||x===void 0)?void 0:x.details;if(U){if(this.waitForCdnTuneIn(U))break;this.state=T.State.WAITING_INIT_PTS}break}case T.State.FRAG_LOADING_WAITING_RETRY:{var P,J=performance.now(),$=this.retryDate;(!$||J>=$||(P=this.media)!==null&&P!==void 0&&P.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=T.State.IDLE);break}case T.State.WAITING_INIT_PTS:{var z=this.waitingData;if(z){var V=z.frag,K=z.part,H=z.cache,G=z.complete;if(this.initPTS[V.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=T.State.FRAG_LOADING;var ie=H.flush(),le={frag:V,part:K,payload:ie,networkDetails:null};this._handleFragmentLoadProgress(le),G&&R.prototype._handleFragmentLoadComplete.call(this,le)}else if(this.videoTrackCC!==this.waitingVideoCC)n.logger.log("Waiting fragment cc ("+V.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var ue=this.getLoadPosition(),be=C.BufferHelper.bufferInfo(this.mediaBuffer,ue,this.config.maxBufferHole),Ce=Object(E.fragmentWithinToleranceTest)(be.end,this.config.maxFragLookUpTolerance,V);Ce<0&&(n.logger.log("Waiting fragment cc ("+V.cc+") @ "+V.start+" cancelled because another fragment at "+be.end+" is needed"),this.clearWaitingFragment())}}else this.state=T.State.IDLE}}this.onTickEnd()},d.clearWaitingFragment=function(){var x=this.waitingData;x&&(this.fragmentTracker.removeFragment(x.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=T.State.IDLE)},d.onTickEnd=function(){var x=this.media;if(!x||!x.readyState)return;var _=this.mediaBuffer?this.mediaBuffer:x,B=_.buffered;!this.loadedmetadata&&B.length&&(this.loadedmetadata=!0),this.lastCurrentTime=x.currentTime},d.doTickIdle=function(){var x,_,B=this.hls,U=this.levels,P=this.media,J=this.trackId,$=B.config;if(!U||!U[J])return;if(!P&&(this.startFragRequested||!$.startFragPrefetch))return;var z=U[J],V=z.details;if(!V||V.live&&this.levelLastLoaded!==J||this.waitForCdnTuneIn(V)){this.state=T.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,r.ElementaryStreamTypes.AUDIO,a.PlaylistLevelType.AUDIO));var K=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,a.PlaylistLevelType.AUDIO);if(K===null)return;var H=K.len,G=this.getMaxBufferLength(),ie=this.audioSwitch;if(H>=G&&!ie)return;if(!ie&&this._streamEnded(K,V)){B.trigger(c.Events.BUFFER_EOS,{type:"audio"}),this.state=T.State.ENDED;return}var le=V.fragments,ue=le[0].start,be=K.end;if(ie){var Ce=this.getLoadPosition();be=Ce,V.PTSKnown&&Ce<ue&&((K.end>ue||K.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),P.currentTime=ue+.05))}var se=this.getNextFragment(be,V);if(!se){this.bufferFlushed=!0;return}((x=se.decryptdata)===null||x===void 0?void 0:x.keyFormat)==="identity"&&!((_=se.decryptdata)!==null&&_!==void 0&&_.key)?this.loadKey(se,V):this.loadFragment(se,V,be)},d.getMaxBufferLength=function(){var x=R.prototype.getMaxBufferLength.call(this),_=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,a.PlaylistLevelType.MAIN);return _===null?x:Math.max(x,_.len)},d.onMediaDetaching=function(){this.videoBuffer=null,R.prototype.onMediaDetaching.call(this)},d.onAudioTracksUpdated=function(x,_){var B=_.audioTracks;this.resetTransmuxer(),this.levels=B.map(function(U){return new s.Level(U)})},d.onAudioTrackSwitching=function(x,_){var B=!!_.url;this.trackId=_.id;var U=this.fragCurrent;U!=null&&U.loader&&U.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),B?this.setInterval(v):this.resetTransmuxer(),B?(this.audioSwitch=!0,this.state=T.State.IDLE):this.state=T.State.STOPPED,this.tick()},d.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},d.onLevelLoaded=function(x,_){this.mainDetails=_.details},d.onAudioTrackLoaded=function(x,_){var B,U=this.levels,P=_.details,J=_.id;if(!U){this.warn("Audio tracks were reset while loading level "+J);return}this.log("Track "+J+" loaded ["+P.startSN+","+P.endSN+"],duration:"+P.totalduration);var $=U[J],z=0;if(P.live||(B=$.details)!==null&&B!==void 0&&B.live){var V=this.mainDetails;if(P.fragments[0]||(P.deltaUpdateFailed=!0),P.deltaUpdateFailed||!V)return;!$.details&&P.hasProgramDateTime&&V.hasProgramDateTime?(Object(y.alignMediaPlaylistByPDT)(P,V),z=P.fragments[0].start):z=this.alignPlaylists(P,$.details)}$.details=P,this.levelLastLoaded=J,!this.startFragRequested&&(this.mainDetails||!P.live)&&this.setStartPosition($.details,z),this.state===T.State.WAITING_TRACK&&!this.waitForCdnTuneIn(P)&&(this.state=T.State.IDLE),this.tick()},d._handleFragmentLoadProgress=function(x){var _,B=x.frag,U=x.part,P=x.payload,J=this.config,$=this.trackId,z=this.levels;if(!z){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+B.sn+" of level "+B.level+" will not be buffered");return}var V=z[$];console.assert(V,"Audio track is defined on fragment load progress");var K=V.details;console.assert(K,"Audio track details are defined on fragment load progress");var H=J.defaultAudioCodec||V.audioCodec||"mp4a.40.2",G=this.transmuxer;G||(G=this.transmuxer=new p.default(this.hls,a.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var ie=this.initPTS[B.cc],le=(_=B.initSegment)===null||_===void 0?void 0:_.data;if(ie!==void 0){var ue=!1,be=U?U.index:-1,Ce=be!==-1,se=new m.ChunkMetadata(B.level,B.sn,B.stats.chunkCount,P.byteLength,be,Ce);G.push(P,le,H,"",B,U,K.totalduration,ue,se,ie)}else{n.logger.log("Unknown video PTS for cc "+B.cc+", waiting for video PTS before demuxing audio frag "+B.sn+" of ["+K.startSN+" ,"+K.endSN+"],track "+$);var ce=this.waitingData=this.waitingData||{frag:B,part:U,cache:new f.default,complete:!1},he=ce.cache;he.push(new Uint8Array(P)),this.waitingVideoCC=this.videoTrackCC,this.state=T.State.WAITING_INIT_PTS}},d._handleFragmentLoadComplete=function(x){if(this.waitingData){this.waitingData.complete=!0;return}R.prototype._handleFragmentLoadComplete.call(this,x)},d.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},d.onBufferCreated=function(x,_){var B=_.tracks.audio;B&&(this.mediaBuffer=B.buffer),_.tracks.video&&(this.videoBuffer=_.tracks.video.buffer)},d.onFragBuffered=function(x,_){var B=_.frag,U=_.part;if(B.type!==a.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(B)){this.warn("Fragment "+B.sn+(U?" p: "+U.index:"")+" of level "+B.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}B.sn!=="initSegment"&&(this.fragPrevious=B,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(c.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(B,U)},d.onError=function(x,_){switch(_.details){case u.ErrorDetails.FRAG_LOAD_ERROR:case u.ErrorDetails.FRAG_LOAD_TIMEOUT:case u.ErrorDetails.KEY_LOAD_ERROR:case u.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(a.PlaylistLevelType.AUDIO,_);break;case u.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case u.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==T.State.ERROR&&this.state!==T.State.STOPPED&&(this.state=_.fatal?T.State.ERROR:T.State.IDLE,this.warn(_.details+" while loading frag, switching to "+this.state+" state"));break;case u.ErrorDetails.BUFFER_FULL_ERROR:if(_.parent==="audio"&&(this.state===T.State.PARSING||this.state===T.State.PARSED)){var B=!0,U=this.getFwdBufferInfo(this.mediaBuffer,a.PlaylistLevelType.AUDIO);U&&U.len>.5&&(B=!this.reduceMaxBufferLength(U.len)),B&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,R.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},d.onBufferFlushed=function(x,_){var B=_.type;B===r.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},d._handleTransmuxComplete=function(x){var _,B="audio",U=this.hls,P=x.remuxResult,J=x.chunkMeta,$=this.getCurrentContext(J);if(!$){this.warn("The loading context changed while buffering fragment "+J.sn+" of level "+J.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(J.level);return}var z=$.frag,V=$.part,K=P.audio,H=P.text,G=P.id3,ie=P.initSegment;if(this.fragContextChanged(z))return;if(this.state=T.State.PARSING,this.audioSwitch&&K&&this.completeAudioSwitch(),ie!=null&&ie.tracks&&(this._bufferInitSegment(ie.tracks,z,J),U.trigger(c.Events.FRAG_PARSING_INIT_SEGMENT,{frag:z,id:B,tracks:ie.tracks})),K){var le=K.startPTS,ue=K.endPTS,be=K.startDTS,Ce=K.endDTS;V&&(V.elementaryStreams[r.ElementaryStreamTypes.AUDIO]={startPTS:le,endPTS:ue,startDTS:be,endDTS:Ce}),z.setElementaryStreamInfo(r.ElementaryStreamTypes.AUDIO,le,ue,be,Ce),this.bufferFragmentData(K,z,V,J)}if(G!=null&&(_=G.samples)!==null&&_!==void 0&&_.length){var se=o({frag:z,id:B},G);U.trigger(c.Events.FRAG_PARSING_METADATA,se)}if(H){var ce=o({frag:z,id:B},H);U.trigger(c.Events.FRAG_PARSING_USERDATA,ce)}},d._bufferInitSegment=function(x,_,B){if(this.state!==T.State.PARSING)return;x.video&&delete x.video;var U=x.audio;if(!U)return;U.levelCodec=U.codec,U.id="audio",this.log("Init audio buffer, container:"+U.container+", codecs[parsed]=["+U.codec+"]"),this.hls.trigger(c.Events.BUFFER_CODECS,x);var P=U.initSegment;if(P!=null&&P.byteLength){var J={type:"audio",frag:_,part:null,chunkMeta:B,parent:_.type,data:P};this.hls.trigger(c.Events.BUFFER_APPENDING,J)}this.tick()},d.loadFragment=function(x,_,B){var U=this.fragmentTracker.getState(x);this.fragCurrent=x,(this.audioSwitch||U===g.FragmentState.NOT_LOADED||U===g.FragmentState.PARTIAL)&&(x.sn==="initSegment"?this._loadInitSegment(x):_.live&&!Object(L.isFiniteNumber)(this.initPTS[x.cc])?(this.log("Waiting for video PTS in continuity counter "+x.cc+" of live stream before loading audio fragment "+x.sn+" of level "+this.trackId),this.state=T.State.WAITING_INIT_PTS):(this.startFragRequested=!0,R.prototype.loadFragment.call(this,x,_,B)))},d.completeAudioSwitch=function(){var x=this.hls,_=this.media,B=this.trackId;_&&(this.log("Switching audio track : flushing all audio"),R.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,x.trigger(c.Events.AUDIO_TRACK_SWITCHED,{id:B})},k}(T.default);h.default=i},"./src/controller/audio-track-controller.ts":function(I,h,S){"use strict";S.r(h);var L=S("./src/events.ts"),T=S("./src/errors.ts"),c=S("./src/controller/base-playlist-controller.ts"),C=S("./src/types/loader.ts");function g(p,m){for(var E=0;E<m.length;E++){var y=m[E];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(p,y.key,y)}}function s(p,m,E){return m&&g(p.prototype,m),E&&g(p,E),p}function a(p,m){p.prototype=Object.create(m.prototype),p.prototype.constructor=p,r(p,m)}function r(p,m){return r=Object.setPrototypeOf||function(y,u){return y.__proto__=u,y},r(p,m)}var f=function(p){a(m,p);function m(y){var u;return u=p.call(this,y,"[audio-track-controller]")||this,u.tracks=[],u.groupId=null,u.tracksInGroup=[],u.trackId=-1,u.trackName="",u.selectDefaultTrack=!0,u.registerListeners(),u}var E=m.prototype;return E.registerListeners=function(){var u=this.hls;u.on(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.on(L.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.on(L.Events.LEVEL_LOADING,this.onLevelLoading,this),u.on(L.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),u.on(L.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),u.on(L.Events.ERROR,this.onError,this)},E.unregisterListeners=function(){var u=this.hls;u.off(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.off(L.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.off(L.Events.LEVEL_LOADING,this.onLevelLoading,this),u.off(L.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),u.off(L.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),u.off(L.Events.ERROR,this.onError,this)},E.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,p.prototype.destroy.call(this)},E.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},E.onManifestParsed=function(u,n){this.tracks=n.audioTracks||[]},E.onAudioTrackLoaded=function(u,n){var o=n.id,l=n.details,w=this.tracksInGroup[o];if(!w){this.warn("Invalid audio track id "+o);return}var v=w.details;w.details=n.details,this.log("audioTrack "+o+" loaded ["+l.startSN+"-"+l.endSN+"]"),o===this.trackId&&(this.retryCount=0,this.playlistLoaded(o,n,v))},E.onLevelLoading=function(u,n){this.switchLevel(n.level)},E.onLevelSwitching=function(u,n){this.switchLevel(n.level)},E.switchLevel=function(u){var n=this.hls.levels[u];if(!(n!=null&&n.audioGroupIds))return;var o=n.audioGroupIds[n.urlId];if(this.groupId!==o){this.groupId=o;var l=this.tracks.filter(function(v){return!o||v.groupId===o});this.selectDefaultTrack&&!l.some(function(v){return v.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=l;var w={audioTracks:l};this.log("Updating audio tracks, "+l.length+' track(s) found in "'+o+'" group-id'),this.hls.trigger(L.Events.AUDIO_TRACKS_UPDATED,w),this.selectInitialTrack()}},E.onError=function(u,n){if(p.prototype.onError.call(this,u,n),n.fatal||!n.context)return;n.context.type===C.PlaylistContextType.AUDIO_TRACK&&n.context.id===this.trackId&&n.context.groupId===this.groupId&&this.retryLoadingOrFail(n)},E.setAudioTrack=function(u){var n=this.tracksInGroup;if(u<0||u>=n.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var o=n[this.trackId];this.log("Now switching to audio-track index "+u);var l=n[u],w=l.id,v=l.groupId,i=v===void 0?"":v,R=l.name,k=l.type,d=l.url;if(this.trackId=u,this.trackName=R,this.selectDefaultTrack=!1,this.hls.trigger(L.Events.AUDIO_TRACK_SWITCHING,{id:w,groupId:i,name:R,type:k,url:d}),l.details&&!l.details.live)return;var b=this.switchParams(l.url,o==null?void 0:o.details);this.loadPlaylist(b)},E.selectInitialTrack=function(){var u=this.tracksInGroup;console.assert(u.length,"Initial audio track should be selected when tracks are known");var n=this.trackName,o=this.findTrackId(n)||this.findTrackId();o!==-1?this.setAudioTrack(o):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(L.Events.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},E.findTrackId=function(u){for(var n=this.tracksInGroup,o=0;o<n.length;o++){var l=n[o];if((!this.selectDefaultTrack||l.default)&&(!u||u===l.name))return l.id}return-1},E.loadPlaylist=function(u){var n=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(n)){var o=n.id,l=n.groupId,w=n.url;if(u)try{w=u.addDirectives(w)}catch(v){this.warn("Could not construct new URL with HLS Delivery Directives: "+v)}this.log("loading audio-track playlist for id: "+o),this.clearTimer(),this.hls.trigger(L.Events.AUDIO_TRACK_LOADING,{url:w,id:o,groupId:l,deliveryDirectives:u||null})}},s(m,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(u){this.selectDefaultTrack=!1,this.setAudioTrack(u)}}]),m}(c.default);h.default=f},"./src/controller/base-playlist-controller.ts":function(I,h,S){"use strict";S.r(h),S.d(h,"default",function(){return s});var L=S("./src/polyfills/number.ts"),T=S("./src/types/level.ts"),c=S("./src/controller/level-helper.ts"),C=S("./src/utils/logger.ts"),g=S("./src/errors.ts"),s=function(){function a(f,p){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=C.logger.log.bind(C.logger,p+":"),this.warn=C.logger.warn.bind(C.logger,p+":"),this.hls=f}var r=a.prototype;return r.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},r.onError=function(p,m){m.fatal&&m.type===g.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},r.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},r.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},r.stopLoad=function(){this.canLoad=!1,this.clearTimer()},r.switchParams=function(p,m){var E=m==null?void 0:m.renditionReports;if(E)for(var y=0;y<E.length;y++){var u=E[y],n=""+u.URI;if(n===p.substr(-n.length)){var o=parseInt(u["LAST-MSN"]),l=parseInt(u["LAST-PART"]);if(m&&this.hls.config.lowLatencyMode){var w=Math.min(m.age-m.partTarget,m.targetduration);l!==void 0&&w>m.partTarget&&(l+=1)}if(Object(L.isFiniteNumber)(o))return new T.HlsUrlParameters(o,Object(L.isFiniteNumber)(l)?l:void 0,T.HlsSkip.No)}}},r.loadPlaylist=function(p){},r.shouldLoadTrack=function(p){return this.canLoad&&p&&!!p.url&&(!p.details||p.details.live)},r.playlistLoaded=function(p,m,E){var y=this,u=m.details,n=m.stats,o=n.loading.end?Math.max(0,self.performance.now()-n.loading.end):0;if(u.advancedDateTime=Date.now()-o,u.live||E!=null&&E.live){if(u.reloaded(E),E&&this.log("live playlist "+p+" "+(u.advanced?"REFRESHED "+u.lastPartSn+"-"+u.lastPartIndex:"MISSED")),E&&u.fragments.length>0&&Object(c.mergeDetails)(E,u),!this.canLoad||!u.live)return;var l,w=void 0,v=void 0;if(u.canBlockReload&&u.endSN&&u.advanced){var i=this.hls.config.lowLatencyMode,R=u.lastPartSn,k=u.endSN,d=u.lastPartIndex,b=d!==-1,x=R===k,_=i?0:d;b?(w=x?k+1:R,v=x?_:d+1):w=k+1;var B=u.age,U=B+u.ageHeader,P=Math.min(U-u.partTarget,u.targetduration*1.5);if(P>0){if(E&&P>E.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+E.tuneInGoal+" to: "+P+" with playlist age: "+u.age),P=0;else{var J=Math.floor(P/u.targetduration);if(w+=J,v!==void 0){var $=Math.round(P%u.targetduration/u.partTarget);v+=$}this.log("CDN Tune-in age: "+u.ageHeader+"s last advanced "+B.toFixed(2)+"s goal: "+P+" skip sn "+J+" to part "+v)}u.tuneInGoal=P}if(l=this.getDeliveryDirectives(u,m.deliveryDirectives,w,v),i||!x){this.loadPlaylist(l);return}}else l=this.getDeliveryDirectives(u,m.deliveryDirectives,w,v);var z=Object(c.computeReloadInterval)(u,n);w!==void 0&&u.canBlockReload&&(z-=u.partTarget||1),this.log("reload live playlist "+p+" in "+Math.round(z)+" ms"),this.timer=self.setTimeout(function(){return y.loadPlaylist(l)},z)}else this.clearTimer()},r.getDeliveryDirectives=function(p,m,E,y){var u=Object(T.getSkipValue)(p,E);return m!=null&&m.skip&&p.deltaUpdateFailed&&(E=m.msn,y=m.part,u=T.HlsSkip.No),new T.HlsUrlParameters(E,y,u)},r.retryLoadingOrFail=function(p){var m=this,E=this.hls.config,y=this.retryCount<E.levelLoadingMaxRetry;if(y){var u;if(this.retryCount++,p.details.indexOf("LoadTimeOut")>-1&&(u=p.context)!==null&&u!==void 0&&u.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+p.details+'"'),this.loadPlaylist();else{var n=Math.min(Math.pow(2,this.retryCount)*E.levelLoadingRetryDelay,E.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return m.loadPlaylist()},n),this.warn("retry playlist loading #"+this.retryCount+" in "+n+' ms after "'+p.details+'"')}}else this.warn('cannot recover from error "'+p.details+'"'),this.clearTimer(),p.fatal=!0;return y},a}()},"./src/controller/base-stream-controller.ts":function(I,h,S){"use strict";S.r(h),S.d(h,"State",function(){return k}),S.d(h,"default",function(){return d});var L=S("./src/polyfills/number.ts"),T=S("./src/task-loop.ts"),c=S("./src/controller/fragment-tracker.ts"),C=S("./src/utils/buffer-helper.ts"),g=S("./src/utils/logger.ts"),s=S("./src/events.ts"),a=S("./src/errors.ts"),r=S("./src/types/transmuxer.ts"),f=S("./src/utils/mp4-tools.ts"),p=S("./src/utils/discontinuities.ts"),m=S("./src/controller/fragment-finders.ts"),E=S("./src/controller/level-helper.ts"),y=S("./src/loader/fragment-loader.ts"),u=S("./src/crypt/decrypter.ts"),n=S("./src/utils/time-ranges.ts"),o=S("./src/types/loader.ts");function l(b,x){for(var _=0;_<x.length;_++){var B=x[_];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(b,B.key,B)}}function w(b,x,_){return x&&l(b.prototype,x),_&&l(b,_),b}function v(b){if(b===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b}function i(b,x){b.prototype=Object.create(x.prototype),b.prototype.constructor=b,R(b,x)}function R(b,x){return R=Object.setPrototypeOf||function(B,U){return B.__proto__=U,B},R(b,x)}var k={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"},d=function(b){i(x,b);function x(B,U,P){var J;return J=b.call(this)||this,J.hls=void 0,J.fragPrevious=null,J.fragCurrent=null,J.fragmentTracker=void 0,J.transmuxer=null,J._state=k.STOPPED,J.media=void 0,J.mediaBuffer=void 0,J.config=void 0,J.bitrateTest=!1,J.lastCurrentTime=0,J.nextLoadPosition=0,J.startPosition=0,J.loadedmetadata=!1,J.fragLoadError=0,J.retryDate=0,J.levels=null,J.fragmentLoader=void 0,J.levelLastLoaded=null,J.startFragRequested=!1,J.decrypter=void 0,J.initPTS=[],J.onvseeking=null,J.onvended=null,J.logPrefix="",J.log=void 0,J.warn=void 0,J.logPrefix=P,J.log=g.logger.log.bind(g.logger,P+":"),J.warn=g.logger.warn.bind(g.logger,P+":"),J.hls=B,J.fragmentLoader=new y.default(B.config),J.fragmentTracker=U,J.config=B.config,J.decrypter=new u.default(B,B.config),B.on(s.Events.KEY_LOADED,J.onKeyLoaded,v(J)),J}var _=x.prototype;return _.doTick=function(){this.onTickEnd()},_.onTickEnd=function(){},_.startLoad=function(U){},_.stopLoad=function(){this.fragmentLoader.abort();var U=this.fragCurrent;U&&this.fragmentTracker.removeFragment(U),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=k.STOPPED},_._streamEnded=function(U,P){var J=this.fragCurrent,$=this.fragmentTracker;if(!P.live&&J&&J.sn===P.endSN&&!U.nextStart){var z=$.getState(J);return z===c.FragmentState.PARTIAL||z===c.FragmentState.OK}return!1},_.onMediaAttached=function(U,P){var J=this.media=this.mediaBuffer=P.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),J.addEventListener("seeking",this.onvseeking),J.addEventListener("ended",this.onvended);var $=this.config;this.levels&&$.autoStartLoad&&this.state===k.STOPPED&&this.startLoad($.startPosition)},_.onMediaDetaching=function(){var U=this.media;U!=null&&U.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),U&&(U.removeEventListener("seeking",this.onvseeking),U.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},_.onMediaSeeking=function(){var U=this.config,P=this.fragCurrent,J=this.media,$=this.mediaBuffer,z=this.state,V=J?J.currentTime:0,K=C.BufferHelper.bufferInfo($||J,V,U.maxBufferHole);if(this.log("media seeking to "+(Object(L.isFiniteNumber)(V)?V.toFixed(3):V)+", state: "+z),z===k.ENDED)this.resetLoadingState();else if(P&&!K.len){var H=U.maxFragLookUpTolerance,G=P.start-H,ie=P.start+P.duration+H,le=V>ie;(V<G||le)&&(le&&P.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),P.loader.abort()),this.resetLoadingState())}J&&(this.lastCurrentTime=V),!this.loadedmetadata&&!K.len&&(this.nextLoadPosition=this.startPosition=V),this.tickImmediate()},_.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},_.onKeyLoaded=function(U,P){if(this.state!==k.KEY_LOADING||P.frag!==this.fragCurrent||!this.levels)return;this.state=k.IDLE;var J=this.levels[P.frag.level].details;J&&this.loadFragment(P.frag,J,P.frag.start)},_.onHandlerDestroying=function(){this.stopLoad(),b.prototype.onHandlerDestroying.call(this)},_.onHandlerDestroyed=function(){this.state=k.STOPPED,this.hls.off(s.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,b.prototype.onHandlerDestroyed.call(this)},_.loadKey=function(U,P){this.log("Loading key for "+U.sn+" of ["+P.startSN+"-"+P.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+U.level),this.state=k.KEY_LOADING,this.fragCurrent=U,this.hls.trigger(s.Events.KEY_LOADING,{frag:U})},_.loadFragment=function(U,P,J){this._loadFragForPlayback(U,P,J)},_._loadFragForPlayback=function(U,P,J){var $=this,z=function(K){if($.fragContextChanged(U)){$.warn("Fragment "+U.sn+(K.part?" p: "+K.part.index:"")+" of level "+U.level+" was dropped during download."),$.fragmentTracker.removeFragment(U);return}U.stats.chunkCount++,$._handleFragmentLoadProgress(K)};this._doFragLoad(U,P,J,z).then(function(V){if(!V)return;$.fragLoadError=0;var K=$.state;if($.fragContextChanged(U)){(K===k.FRAG_LOADING||K===k.BACKTRACKING||!$.fragCurrent&&K===k.PARSING)&&($.fragmentTracker.removeFragment(U),$.state=k.IDLE);return}if("payload"in V&&($.log("Loaded fragment "+U.sn+" of level "+U.level),$.hls.trigger(s.Events.FRAG_LOADED,V),$.state===k.BACKTRACKING)){$.fragmentTracker.backtrack(U,V),$.resetFragmentLoading(U);return}$._handleFragmentLoadComplete(V)}).catch(function(V){$.warn(V),$.resetFragmentLoading(U)})},_.flushMainBuffer=function(U,P,J){if(J===void 0&&(J=null),!(U-P))return;var $={startOffset:U,endOffset:P,type:J};this.fragLoadError=0,this.hls.trigger(s.Events.BUFFER_FLUSHING,$)},_._loadInitSegment=function(U){var P=this;this._doFragLoad(U).then(function(J){if(!J||P.fragContextChanged(U)||!P.levels)throw new Error("init load aborted");return J}).then(function(J){var $=P.hls,z=J.payload,V=U.decryptdata;if(z&&z.byteLength>0&&V&&V.key&&V.iv&&V.method==="AES-128"){var K=self.performance.now();return P.decrypter.webCryptoDecrypt(new Uint8Array(z),V.key.buffer,V.iv.buffer).then(function(H){var G=self.performance.now();return $.trigger(s.Events.FRAG_DECRYPTED,{frag:U,payload:H,stats:{tstart:K,tdecrypt:G}}),J.payload=H,J})}return J}).then(function(J){var $=P.fragCurrent,z=P.hls,V=P.levels;if(!V)throw new Error("init load aborted, missing levels");var K=V[U.level].details;console.assert(K,"Level details are defined when init segment is loaded");var H=U.stats;P.state=k.IDLE,P.fragLoadError=0,U.data=new Uint8Array(J.payload),H.parsing.start=H.buffering.start=self.performance.now(),H.parsing.end=H.buffering.end=self.performance.now(),J.frag===$&&z.trigger(s.Events.FRAG_BUFFERED,{stats:H,frag:$,part:null,id:U.type}),P.tick()}).catch(function(J){P.warn(J),P.resetFragmentLoading(U)})},_.fragContextChanged=function(U){var P=this.fragCurrent;return!U||!P||U.level!==P.level||U.sn!==P.sn||U.urlId!==P.urlId},_.fragBufferedComplete=function(U,P){var J=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+U.type+" sn: "+U.sn+(P?" part: "+P.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+U.level+" "+n.default.toString(C.BufferHelper.getBuffered(J))),this.state=k.IDLE,this.tick()},_._handleFragmentLoadComplete=function(U){var P=this.transmuxer;if(!P)return;var J=U.frag,$=U.part,z=U.partsLoaded,V=!z||z.length===0||z.some(function(H){return!H}),K=new r.ChunkMetadata(J.level,J.sn,J.stats.chunkCount+1,0,$?$.index:-1,!V);P.flush(K)},_._handleFragmentLoadProgress=function(U){},_._doFragLoad=function(U,P,J,$){var z=this;if(J===void 0&&(J=null),!this.levels)throw new Error("frag load aborted, missing levels");if(J=Math.max(U.start,J||0),this.config.lowLatencyMode&&P){var V=P.partList;if(V&&$){J>U.end&&P.fragmentHint&&(U=P.fragmentHint);var K=this.getNextPart(V,U,J);if(K>-1){var H=V[K];return this.log("Loading part sn: "+U.sn+" p: "+H.index+" cc: "+U.cc+" of playlist ["+P.startSN+"-"+P.endSN+"] parts [0-"+K+"-"+(V.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+U.level+", target: "+parseFloat(J.toFixed(3))),this.nextLoadPosition=H.start+H.duration,this.state=k.FRAG_LOADING,this.hls.trigger(s.Events.FRAG_LOADING,{frag:U,part:V[K],targetBufferTime:J}),this.doFragPartsLoad(U,V,K,$).catch(function(G){return z.handleFragLoadError(G)})}else if(!U.url||this.loadedEndOfParts(V,J))return Promise.resolve(null)}}return this.log("Loading fragment "+U.sn+" cc: "+U.cc+" "+(P?"of ["+P.startSN+"-"+P.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+U.level+", target: "+parseFloat(J.toFixed(3))),Object(L.isFiniteNumber)(U.sn)&&!this.bitrateTest&&(this.nextLoadPosition=U.start+U.duration),this.state=k.FRAG_LOADING,this.hls.trigger(s.Events.FRAG_LOADING,{frag:U,targetBufferTime:J}),this.fragmentLoader.load(U,$).catch(function(G){return z.handleFragLoadError(G)})},_.doFragPartsLoad=function(U,P,J,$){var z=this;return new Promise(function(V,K){var H=[],G=function ie(le){var ue=P[le];z.fragmentLoader.loadPart(U,ue,$).then(function(be){H[ue.index]=be;var Ce=be.part;z.hls.trigger(s.Events.FRAG_LOADED,be);var se=P[le+1];if(se&&se.fragment===U)ie(le+1);else return V({frag:U,part:Ce,partsLoaded:H})}).catch(K)};G(J)})},_.handleFragLoadError=function(U){var P=U.data;return P&&P.details===a.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(P.frag,P.part):this.hls.trigger(s.Events.ERROR,P),null},_._handleTransmuxerFlush=function(U){var P=this.getCurrentContext(U);if(!P||this.state!==k.PARSING){this.fragCurrent||(this.state=k.IDLE);return}var J=P.frag,$=P.part,z=P.level,V=self.performance.now();J.stats.parsing.end=V,$&&($.stats.parsing.end=V),this.updateLevelTiming(J,$,z,U.partial)},_.getCurrentContext=function(U){var P=this.levels,J=U.level,$=U.sn,z=U.part;if(!P||!P[J])return this.warn("Levels object was unset while buffering fragment "+$+" of level "+J+". The current chunk will not be buffered."),null;var V=P[J],K=z>-1?Object(E.getPartWith)(V,$,z):null,H=K?K.fragment:Object(E.getFragmentWithSN)(V,$,this.fragCurrent);return H?{frag:H,part:K,level:V}:null},_.bufferFragmentData=function(U,P,J,$){if(!U||this.state!==k.PARSING)return;var z=U.data1,V=U.data2,K=z;if(z&&V&&(K=Object(f.appendUint8Array)(z,V)),!K||!K.length)return;var H={type:U.type,frag:P,part:J,chunkMeta:$,parent:P.type,data:K};this.hls.trigger(s.Events.BUFFER_APPENDING,H),U.dropped&&U.independent&&!J&&this.flushBufferGap(P)},_.flushBufferGap=function(U){var P=this.media;if(!P)return;if(!C.BufferHelper.isBuffered(P,P.currentTime)){this.flushMainBuffer(0,U.start);return}var J=P.currentTime,$=C.BufferHelper.bufferInfo(P,J,0),z=U.duration,V=Math.min(this.config.maxFragLookUpTolerance*2,z*.25),K=Math.max(Math.min(U.start-V,$.end-V),J+V);U.start-K>V&&this.flushMainBuffer(K,U.start)},_.getFwdBufferInfo=function(U,P){var J=this.config,$=this.getLoadPosition();if(!Object(L.isFiniteNumber)($))return null;var z=C.BufferHelper.bufferInfo(U,$,J.maxBufferHole);if(z.len===0&&z.nextStart!==void 0){var V=this.fragmentTracker.getBufferedFrag($,P);if(V&&z.nextStart<V.end)return C.BufferHelper.bufferInfo(U,$,Math.max(z.nextStart,J.maxBufferHole))}return z},_.getMaxBufferLength=function(U){var P=this.config,J;return U?J=Math.max(8*P.maxBufferSize/U,P.maxBufferLength):J=P.maxBufferLength,Math.min(J,P.maxMaxBufferLength)},_.reduceMaxBufferLength=function(U){var P=this.config,J=U||P.maxBufferLength;return P.maxMaxBufferLength>=J?(P.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+P.maxMaxBufferLength+"s"),!0):!1},_.getNextFragment=function(U,P){var J,$,z=P.fragments,V=z.length;if(!V)return null;var K=this.config,H=z[0].start,G;if(P.live){var ie=K.initialLiveManifestSize;if(V<ie)return this.warn("Not enough fragments to start playback (have: "+V+", need: "+ie+")"),null;!P.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(G=this.getInitialLiveFragment(P,z),this.startPosition=G?this.hls.liveSyncPosition||G.start:U)}else U<=H&&(G=z[0]);if(!G){var le=K.lowLatencyMode?P.partEnd:P.fragmentEnd;G=this.getFragmentAtPosition(U,le,P)}return(J=G)!==null&&J!==void 0&&J.initSegment&&!(($=G)!==null&&$!==void 0&&$.initSegment.data)&&!this.bitrateTest&&(G=G.initSegment),G},_.getNextPart=function(U,P,J){for(var $=-1,z=!1,V=!0,K=0,H=U.length;K<H;K++){var G=U[K];if(V=V&&!G.independent,$>-1&&J<G.start)break;var ie=G.loaded;!ie&&(z||G.independent||V)&&G.fragment===P&&($=K),z=ie}return $},_.loadedEndOfParts=function(U,P){var J=U[U.length-1];return J&&P>J.start&&J.loaded},_.getInitialLiveFragment=function(U,P){var J=this.fragPrevious,$=null;if(J){if(U.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+J.programDateTime),$=Object(m.findFragmentByPDT)(P,J.endProgramDateTime,this.config.maxFragLookUpTolerance)),!$){var z=J.sn+1;if(z>=U.startSN&&z<=U.endSN){var V=P[z-U.startSN];J.cc===V.cc&&($=V,this.log("Live playlist, switching playlist, load frag with next SN: "+$.sn))}$||($=Object(m.findFragWithCC)(P,J.cc),$&&this.log("Live playlist, switching playlist, load frag with same CC: "+$.sn))}}else{var K=this.hls.liveSyncPosition;K!==null&&($=this.getFragmentAtPosition(K,this.bitrateTest?U.fragmentEnd:U.edge,U))}return $},_.getFragmentAtPosition=function(U,P,J){var $=this.config,z=this.fragPrevious,V=J.fragments,K=J.endSN,H=J.fragmentHint,G=$.maxFragLookUpTolerance,ie=!!($.lowLatencyMode&&J.partList&&H);ie&&H&&!this.bitrateTest&&(V=V.concat(H),K=H.sn);var le;if(U<P){var ue=U>P-G?0:G;le=Object(m.findFragmentByPTS)(z,V,U,ue)}else le=V[V.length-1];if(le){var be=le.sn-J.startSN,Ce=z&&le.level===z.level,se=V[be+1],ce=this.fragmentTracker.getState(le);if(ce===c.FragmentState.BACKTRACKED){le=null;for(var he=be;V[he]&&this.fragmentTracker.getState(V[he])===c.FragmentState.BACKTRACKED;)z?le=V[he--]:le=V[--he];le||(le=se)}else z&&le.sn===z.sn&&!ie&&(Ce&&(le.sn<K&&this.fragmentTracker.getState(se)!==c.FragmentState.OK?(this.log("SN "+le.sn+" just loaded, load next one: "+se.sn),le=se):le=null))}return le},_.synchronizeToLiveEdge=function(U){var P=this.config,J=this.media;if(!J)return;var $=this.hls.liveSyncPosition,z=J.currentTime,V=U.fragments[0].start,K=U.edge,H=z>=V-P.maxFragLookUpTolerance&&z<=K;if($!==null&&J.duration>$&&(z<$||!H)){var G=P.liveMaxLatencyDuration!==void 0?P.liveMaxLatencyDuration:P.liveMaxLatencyDurationCount*U.targetduration;(!H&&J.readyState<4||z<K-G)&&(this.loadedmetadata||(this.nextLoadPosition=$),J.readyState&&(this.warn("Playback: "+z.toFixed(3)+" is located too far from the end of live sliding playlist: "+K+", reset currentTime to : "+$.toFixed(3)),J.currentTime=$))}},_.alignPlaylists=function(U,P){var J=this.levels,$=this.levelLastLoaded,z=this.fragPrevious,V=$!==null?J[$]:null,K=U.fragments.length;if(!K)return this.warn("No fragments in live playlist"),0;var H=U.fragments[0].start,G=!P,ie=U.alignedSliding&&Object(L.isFiniteNumber)(H);if(G||!ie&&!H){Object(p.alignStream)(z,V,U);var le=U.fragments[0].start;return this.log("Live playlist sliding: "+le.toFixed(2)+" start-sn: "+(P?P.startSN:"na")+"->"+U.startSN+" prev-sn: "+(z?z.sn:"na")+" fragments: "+K),le}return H},_.waitForCdnTuneIn=function(U){var P=3;return U.live&&U.canBlockReload&&U.tuneInGoal>Math.max(U.partHoldBack,U.partTarget*P)},_.setStartPosition=function(U,P){var J=this.startPosition;if(J<P&&(J=-1),J===-1||this.lastCurrentTime===-1){var $=U.startTimeOffset;Object(L.isFiniteNumber)($)?(J=P+$,$<0&&(J+=U.totalduration),J=Math.min(Math.max(P,J),P+U.totalduration),this.log("Start time offset "+$+" found in playlist, adjust startPosition to "+J),this.startPosition=J):U.live?J=this.hls.liveSyncPosition||P:this.startPosition=J=0,this.lastCurrentTime=J}this.nextLoadPosition=J},_.getLoadPosition=function(){var U=this.media,P=0;return this.loadedmetadata&&U?P=U.currentTime:this.nextLoadPosition&&(P=this.nextLoadPosition),P},_.handleFragLoadAborted=function(U,P){this.transmuxer&&U.sn!=="initSegment"&&U.stats.aborted&&(this.warn("Fragment "+U.sn+(P?" part"+P.index:"")+" of level "+U.level+" was aborted"),this.resetFragmentLoading(U))},_.resetFragmentLoading=function(U){(!this.fragCurrent||!this.fragContextChanged(U))&&(this.state=k.IDLE)},_.onFragmentOrKeyLoadError=function(U,P){if(P.fatal)return;var J=P.frag;if(!J||J.type!==U)return;var $=this.fragCurrent;console.assert($&&J.sn===$.sn&&J.level===$.level&&J.urlId===$.urlId,"Frag load error must match current frag to retry");var z=this.config;if(this.fragLoadError+1<=z.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(J.level))return;var V=Math.min(Math.pow(2,this.fragLoadError)*z.fragLoadingRetryDelay,z.fragLoadingMaxRetryTimeout);this.warn("Fragment "+J.sn+" of "+U+" "+J.level+" failed to load, retrying in "+V+"ms"),this.retryDate=self.performance.now()+V,this.fragLoadError++,this.state=k.FRAG_LOADING_WAITING_RETRY}else P.levelRetry?(U===o.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=k.IDLE):(g.logger.error(P.details+" reaches max retry, redispatch as fatal ..."),P.fatal=!0,this.hls.stopLoad(),this.state=k.ERROR)},_.afterBufferFlushed=function(U,P,J){if(!U)return;var $=C.BufferHelper.getBuffered(U);this.fragmentTracker.detectEvictedFragments(P,$,J),this.state===k.ENDED&&this.resetLoadingState()},_.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=k.IDLE},_.resetLiveStartWhenNotLoaded=function(U){if(!this.loadedmetadata){this.startFragRequested=!1;var P=this.levels?this.levels[U].details:null;if(P!=null&&P.live)return this.startPosition=-1,this.setStartPosition(P,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},_.updateLevelTiming=function(U,P,J,$){var z=this,V=J.details;console.assert(!!V,"level.details must be defined");var K=Object.keys(U.elementaryStreams).reduce(function(H,G){var ie=U.elementaryStreams[G];if(ie){var le=ie.endPTS-ie.startPTS;if(le<=0)return z.warn("Could not parse fragment "+U.sn+" "+G+" duration reliably ("+le+") resetting transmuxer to fallback to playlist timing"),z.resetTransmuxer(),H||!1;var ue=$?0:Object(E.updateFragPTSDTS)(V,U,ie.startPTS,ie.endPTS,ie.startDTS,ie.endDTS);return z.hls.trigger(s.Events.LEVEL_PTS_UPDATED,{details:V,level:J,drift:ue,type:G,frag:U,start:ie.startPTS,end:ie.endPTS}),!0}return H},!1);K?(this.state=k.PARSED,this.hls.trigger(s.Events.FRAG_PARSED,{frag:U,part:P})):this.resetLoadingState()},_.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},w(x,[{key:"state",get:function(){return this._state},set:function(U){var P=this._state;P!==U&&(this._state=U,this.log(P+"->"+U))}}]),x}(T.default)},"./src/controller/buffer-controller.ts":function(I,h,S){"use strict";S.r(h),S.d(h,"default",function(){return m});var L=S("./src/polyfills/number.ts"),T=S("./src/events.ts"),c=S("./src/utils/logger.ts"),C=S("./src/errors.ts"),g=S("./src/utils/buffer-helper.ts"),s=S("./src/utils/mediasource-helper.ts"),a=S("./src/loader/fragment.ts"),r=S("./src/controller/buffer-operation-queue.ts"),f=Object(s.getMediaSource)(),p=/([ha]vc.)(?:\.[^.,]+)+/,m=function(){function E(u){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 o=n.hls,l=n.media,w=n.mediaSource;c.logger.log("[buffer-controller]: Media source opened"),l&&(n.updateMediaElementDuration(),o.trigger(T.Events.MEDIA_ATTACHED,{media:l})),w&&w.removeEventListener("sourceopen",n._onMediaSourceOpen),n.checkPendingTracks()},this._onMediaSourceClose=function(){c.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){c.logger.log("[buffer-controller]: Media source ended")},this.hls=u,this._initSourceBuffer(),this.registerListeners()}var y=E.prototype;return y.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},y.destroy=function(){this.unregisterListeners(),this.details=null},y.registerListeners=function(){var n=this.hls;n.on(T.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),n.on(T.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.on(T.Events.MANIFEST_PARSED,this.onManifestParsed,this),n.on(T.Events.BUFFER_RESET,this.onBufferReset,this),n.on(T.Events.BUFFER_APPENDING,this.onBufferAppending,this),n.on(T.Events.BUFFER_CODECS,this.onBufferCodecs,this),n.on(T.Events.BUFFER_EOS,this.onBufferEos,this),n.on(T.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),n.on(T.Events.LEVEL_UPDATED,this.onLevelUpdated,this),n.on(T.Events.FRAG_PARSED,this.onFragParsed,this),n.on(T.Events.FRAG_CHANGED,this.onFragChanged,this)},y.unregisterListeners=function(){var n=this.hls;n.off(T.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),n.off(T.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.off(T.Events.MANIFEST_PARSED,this.onManifestParsed,this),n.off(T.Events.BUFFER_RESET,this.onBufferReset,this),n.off(T.Events.BUFFER_APPENDING,this.onBufferAppending,this),n.off(T.Events.BUFFER_CODECS,this.onBufferCodecs,this),n.off(T.Events.BUFFER_EOS,this.onBufferEos,this),n.off(T.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),n.off(T.Events.LEVEL_UPDATED,this.onLevelUpdated,this),n.off(T.Events.FRAG_PARSED,this.onFragParsed,this),n.off(T.Events.FRAG_CHANGED,this.onFragChanged,this)},y._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new r.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},y.onManifestParsed=function(n,o){var l=2;(o.audio&&!o.video||!o.altAudio)&&(l=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=l,this.details=null,c.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},y.onMediaAttaching=function(n,o){var l=this.media=o.media;if(l&&f){var w=this.mediaSource=new f;w.addEventListener("sourceopen",this._onMediaSourceOpen),w.addEventListener("sourceended",this._onMediaSourceEnded),w.addEventListener("sourceclose",this._onMediaSourceClose),l.src=self.URL.createObjectURL(w),this._objectUrl=l.src}},y.onMediaDetaching=function(){var n=this.media,o=this.mediaSource,l=this._objectUrl;if(o){if(c.logger.log("[buffer-controller]: media source detaching"),o.readyState==="open")try{o.endOfStream()}catch(w){c.logger.warn("[buffer-controller]: onMediaDetaching: "+w.message+" while calling endOfStream")}this.onBufferReset(),o.removeEventListener("sourceopen",this._onMediaSourceOpen),o.removeEventListener("sourceended",this._onMediaSourceEnded),o.removeEventListener("sourceclose",this._onMediaSourceClose),n&&(l&&self.URL.revokeObjectURL(l),n.src===l?(n.removeAttribute("src"),n.load()):c.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(T.Events.MEDIA_DETACHED,void 0)},y.onBufferReset=function(){var n=this;this.getSourceBufferTypes().forEach(function(o){var l=n.sourceBuffer[o];try{l&&(n.removeBufferListeners(o),n.mediaSource&&n.mediaSource.removeSourceBuffer(l),n.sourceBuffer[o]=void 0)}catch(w){c.logger.warn("[buffer-controller]: Failed to reset the "+o+" buffer",w)}}),this._initSourceBuffer()},y.onBufferCodecs=function(n,o){var l=this,w=this.getSourceBufferTypes().length;if(Object.keys(o).forEach(function(v){if(w){var i=l.tracks[v];if(i&&typeof i.buffer.changeType=="function"){var R=o[v],k=R.codec,d=R.levelCodec,b=R.container,x=(i.levelCodec||i.codec).replace(p,"$1"),_=(d||k).replace(p,"$1");if(x!==_){var B=b+";codecs="+(d||k);l.appendChangeType(v,B)}}}else l.pendingTracks[v]=o[v]}),w)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},y.appendChangeType=function(n,o){var l=this,w=this.operationQueue,v={execute:function(){var R=l.sourceBuffer[n];R&&(c.logger.log("[buffer-controller]: changing "+n+" sourceBuffer type to "+o),R.changeType(o)),w.shiftAndExecuteNext(n)},onStart:function(){},onComplete:function(){},onError:function(R){c.logger.warn("[buffer-controller]: Failed to change "+n+" SourceBuffer type",R)}};w.append(v,n)},y.onBufferAppending=function(n,o){var l=this,w=this.hls,v=this.operationQueue,i=this.tracks,R=o.data,k=o.type,d=o.frag,b=o.part,x=o.chunkMeta,_=x.buffering[k],B=self.performance.now();_.start=B;var U=d.stats.buffering,P=b?b.stats.buffering:null;U.start===0&&(U.start=B),P&&P.start===0&&(P.start=B);var J=i.audio,$=k==="audio"&&x.id===1&&(J==null?void 0:J.container)==="audio/mpeg",z={execute:function(){if(_.executeStart=self.performance.now(),$){var K=l.sourceBuffer[k];if(K){var H=d.start-K.timestampOffset;Math.abs(H)>=.1&&(c.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+d.start+" (delta: "+H+") sn: "+d.sn+")"),K.timestampOffset=d.start)}}l.appendExecutor(R,k)},onStart:function(){},onComplete:function(){var K=self.performance.now();_.executeEnd=_.end=K,U.first===0&&(U.first=K),P&&P.first===0&&(P.first=K);var H=l.sourceBuffer,G={};for(var ie in H)G[ie]=g.BufferHelper.getBuffered(H[ie]);l.appendError=0,l.hls.trigger(T.Events.BUFFER_APPENDED,{type:k,frag:d,part:b,chunkMeta:x,parent:d.type,timeRanges:G})},onError:function(K){c.logger.error("[buffer-controller]: Error encountered while trying to append to the "+k+" SourceBuffer",K);var H={type:C.ErrorTypes.MEDIA_ERROR,parent:d.type,details:C.ErrorDetails.BUFFER_APPEND_ERROR,err:K,fatal:!1};K.code===DOMException.QUOTA_EXCEEDED_ERR?H.details=C.ErrorDetails.BUFFER_FULL_ERROR:(l.appendError++,H.details=C.ErrorDetails.BUFFER_APPEND_ERROR,l.appendError>w.config.appendErrorMaxRetry&&(c.logger.error("[buffer-controller]: Failed "+w.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),H.fatal=!0)),w.trigger(T.Events.ERROR,H)}};v.append(z,k)},y.onBufferFlushing=function(n,o){var l=this,w=this.operationQueue,v=function(R){return{execute:l.removeExecutor.bind(l,R,o.startOffset,o.endOffset),onStart:function(){},onComplete:function(){l.hls.trigger(T.Events.BUFFER_FLUSHED,{type:R})},onError:function(d){c.logger.warn("[buffer-controller]: Failed to remove from "+R+" SourceBuffer",d)}}};o.type?w.append(v(o.type),o.type):this.getSourceBufferTypes().forEach(function(i){w.append(v(i),i)})},y.onFragParsed=function(n,o){var l=this,w=o.frag,v=o.part,i=[],R=v?v.elementaryStreams:w.elementaryStreams;R[a.ElementaryStreamTypes.AUDIOVIDEO]?i.push("audiovideo"):(R[a.ElementaryStreamTypes.AUDIO]&&i.push("audio"),R[a.ElementaryStreamTypes.VIDEO]&&i.push("video"));var k=function(){var b=self.performance.now();w.stats.buffering.end=b,v&&(v.stats.buffering.end=b);var x=v?v.stats:w.stats;l.hls.trigger(T.Events.FRAG_BUFFERED,{frag:w,part:v,stats:x,id:w.type})};i.length===0&&c.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+w.type+" level: "+w.level+" sn: "+w.sn),this.blockBuffers(k,i)},y.onFragChanged=function(n,o){this.flushBackBuffer()},y.onBufferEos=function(n,o){var l=this,w=this.getSourceBufferTypes().reduce(function(v,i){var R=l.sourceBuffer[i];return(!o.type||o.type===i)&&(R&&!R.ended&&(R.ended=!0,c.logger.log("[buffer-controller]: "+i+" sourceBuffer now EOS"))),v&&!!(!R||R.ended)},!0);w&&this.blockBuffers(function(){var v=l.mediaSource;if(!v||v.readyState!=="open")return;v.endOfStream()})},y.onLevelUpdated=function(n,o){var l=o.details;if(!l.fragments.length)return;this.details=l,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},y.flushBackBuffer=function(){var n=this.hls,o=this.details,l=this.media,w=this.sourceBuffer;if(!l||o===null)return;var v=this.getSourceBufferTypes();if(!v.length)return;var i=o.live&&n.config.liveBackBufferLength!==null?n.config.liveBackBufferLength:n.config.backBufferLength;if(!Object(L.isFiniteNumber)(i)||i<0)return;var R=l.currentTime,k=o.levelTargetDuration,d=Math.max(i,k),b=Math.floor(R/k)*k-d;v.forEach(function(x){var _=w[x];if(_){var B=g.BufferHelper.getBuffered(_);B.length>0&&b>B.start(0)&&(n.trigger(T.Events.BACK_BUFFER_REACHED,{bufferEnd:b}),o.live&&n.trigger(T.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:b}),n.trigger(T.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:b,type:x}))}})},y.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var n=this.details,o=this.hls,l=this.media,w=this.mediaSource,v=n.fragments[0].start+n.totalduration,i=l.duration,R=Object(L.isFiniteNumber)(w.duration)?w.duration:0;n.live&&o.config.liveDurationInfinity?(c.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),w.duration=Infinity,this.updateSeekableRange(n)):(v>R&&v>i||!Object(L.isFiniteNumber)(i))&&(c.logger.log("[buffer-controller]: Updating Media Source duration to "+v.toFixed(3)),w.duration=v)},y.updateSeekableRange=function(n){var o=this.mediaSource,l=n.fragments,w=l.length;if(w&&n.live&&o!==null&&o!==void 0&&o.setLiveSeekableRange){var v=Math.max(0,l[0].start),i=Math.max(v,v+n.totalduration);o.setLiveSeekableRange(v,i)}},y.checkPendingTracks=function(){var n=this.bufferCodecEventsExpected,o=this.operationQueue,l=this.pendingTracks,w=Object.keys(l).length;if(w&&!n||w===2){this.createSourceBuffers(l),this.pendingTracks={};var v=this.getSourceBufferTypes();if(v.length===0){this.hls.trigger(T.Events.ERROR,{type:C.ErrorTypes.MEDIA_ERROR,details:C.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}v.forEach(function(i){o.executeNext(i)})}},y.createSourceBuffers=function(n){var o=this.sourceBuffer,l=this.mediaSource;if(!l)throw Error("createSourceBuffers called when mediaSource was null");var w=0;for(var v in n)if(!o[v]){var i=n[v];if(!i)throw Error("source buffer exists for track "+v+", however track does not");var R=i.levelCodec||i.codec,k=i.container+";codecs="+R;c.logger.log("[buffer-controller]: creating sourceBuffer("+k+")");try{var d=o[v]=l.addSourceBuffer(k),b=v;this.addBufferListener(b,"updatestart",this._onSBUpdateStart),this.addBufferListener(b,"updateend",this._onSBUpdateEnd),this.addBufferListener(b,"error",this._onSBUpdateError),this.tracks[v]={buffer:d,codec:R,container:i.container,levelCodec:i.levelCodec,id:i.id},w++}catch(x){c.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+x.message),this.hls.trigger(T.Events.ERROR,{type:C.ErrorTypes.MEDIA_ERROR,details:C.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:x,mimeType:k})}}w&&this.hls.trigger(T.Events.BUFFER_CREATED,{tracks:this.tracks})},y._onSBUpdateStart=function(n){var o=this.operationQueue,l=o.current(n);l.onStart()},y._onSBUpdateEnd=function(n){var o=this.operationQueue,l=o.current(n);l.onComplete(),o.shiftAndExecuteNext(n)},y._onSBUpdateError=function(n,o){c.logger.error("[buffer-controller]: "+n+" SourceBuffer error",o),this.hls.trigger(T.Events.ERROR,{type:C.ErrorTypes.MEDIA_ERROR,details:C.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var l=this.operationQueue.current(n);l&&l.onError(o)},y.removeExecutor=function(n,o,l){var w=this.media,v=this.mediaSource,i=this.operationQueue,R=this.sourceBuffer,k=R[n];if(!w||!v||!k){c.logger.warn("[buffer-controller]: Attempting to remove from the "+n+" SourceBuffer, but it does not exist"),i.shiftAndExecuteNext(n);return}var d=Object(L.isFiniteNumber)(w.duration)?w.duration:Infinity,b=Object(L.isFiniteNumber)(v.duration)?v.duration:Infinity,x=Math.max(0,o),_=Math.min(l,d,b);_>x?(c.logger.log("[buffer-controller]: Removing ["+x+","+_+"] from the "+n+" SourceBuffer"),console.assert(!k.updating,n+" sourceBuffer must not be updating"),k.remove(x,_)):i.shiftAndExecuteNext(n)},y.appendExecutor=function(n,o){var l=this.operationQueue,w=this.sourceBuffer,v=w[o];if(!v){c.logger.warn("[buffer-controller]: Attempting to append to the "+o+" SourceBuffer, but it does not exist"),l.shiftAndExecuteNext(o);return}v.ended=!1,console.assert(!v.updating,o+" sourceBuffer must not be updating"),v.appendBuffer(n)},y.blockBuffers=function(n,o){var l=this;if(o===void 0&&(o=this.getSourceBufferTypes()),!o.length){c.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(n);return}var w=this.operationQueue,v=o.map(function(i){return w.appendBlocker(i)});Promise.all(v).then(function(){n(),o.forEach(function(i){var R=l.sourceBuffer[i];(!R||!R.updating)&&w.shiftAndExecuteNext(i)})})},y.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},y.addBufferListener=function(n,o,l){var w=this.sourceBuffer[n];if(!w)return;var v=l.bind(this,n);this.listeners[n].push({event:o,listener:v}),w.addEventListener(o,v)},y.removeBufferListeners=function(n){var o=this.sourceBuffer[n];if(!o)return;this.listeners[n].forEach(function(l){o.removeEventListener(l.event,l.listener)})},E}()},"./src/controller/buffer-operation-queue.ts":function(I,h,S){"use strict";S.r(h),S.d(h,"default",function(){return T});var L=S("./src/utils/logger.ts"),T=function(){function c(g){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=g}var C=c.prototype;return C.append=function(s,a){var r=this.queues[a];r.push(s),r.length===1&&this.buffers[a]&&this.executeNext(a)},C.insertAbort=function(s,a){var r=this.queues[a];r.unshift(s),this.executeNext(a)},C.appendBlocker=function(s){var a,r=new Promise(function(p){a=p}),f={execute:a,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(f,s),r},C.executeNext=function(s){var a=this.buffers,r=this.queues,f=a[s],p=r[s];if(p.length){var m=p[0];try{m.execute()}catch(E){L.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),m.onError(E),(!f||!f.updating)&&(p.shift(),this.executeNext(s))}}},C.shiftAndExecuteNext=function(s){this.queues[s].shift(),this.executeNext(s)},C.current=function(s){return this.queues[s][0]},c}()},"./src/controller/cap-level-controller.ts":function(I,h,S){"use strict";S.r(h);var L=S("./src/events.ts");function T(g,s){for(var a=0;a<s.length;a++){var r=s[a];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(g,r.key,r)}}function c(g,s,a){return s&&T(g.prototype,s),a&&T(g,a),g}var C=function(){function g(a){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=a,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var s=g.prototype;return s.setStreamController=function(r){this.streamController=r},s.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},s.registerListeners=function(){var r=this.hls;r.on(L.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),r.on(L.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),r.on(L.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.on(L.Events.BUFFER_CODECS,this.onBufferCodecs,this),r.on(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},s.unregisterListener=function(){var r=this.hls;r.off(L.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),r.off(L.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),r.off(L.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.off(L.Events.BUFFER_CODECS,this.onBufferCodecs,this),r.off(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},s.onFpsDropLevelCapping=function(r,f){g.isLevelAllowed(f.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(f.droppedLevel)},s.onMediaAttaching=function(r,f){this.media=f.media instanceof HTMLVideoElement?f.media:null},s.onManifestParsed=function(r,f){var p=this.hls;this.restrictedLevels=[],this.firstLevel=f.firstLevel,p.config.capLevelToPlayerSize&&f.video&&this.startCapping()},s.onBufferCodecs=function(r,f){var p=this.hls;p.config.capLevelToPlayerSize&&f.video&&this.startCapping()},s.onMediaDetaching=function(){this.stopCapping()},s.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var r=this.hls.levels;if(r.length){var f=this.hls;f.autoLevelCapping=this.getMaxLevel(r.length-1),f.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=f.autoLevelCapping}}},s.getMaxLevel=function(r){var f=this,p=this.hls.levels;if(!p.length)return-1;var m=p.filter(function(E,y){return g.isLevelAllowed(y,f.restrictedLevels)&&y<=r});return this.clientRect=null,g.getMaxLevelByMediaSize(m,this.mediaWidth,this.mediaHeight)},s.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()},s.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},s.getDimensions=function(){if(this.clientRect)return this.clientRect;var r=this.media,f={width:0,height:0};if(r){var p=r.getBoundingClientRect();f.width=p.width,f.height=p.height,!f.width&&!f.height&&(f.width=p.right-p.left||r.width||0,f.height=p.bottom-p.top||r.height||0)}return this.clientRect=f,f},g.isLevelAllowed=function(r,f){return f===void 0&&(f=[]),f.indexOf(r)===-1},g.getMaxLevelByMediaSize=function(r,f,p){if(!r||!r.length)return-1;for(var m=function(o,l){return l?o.width!==l.width||o.height!==l.height:!0},E=r.length-1,y=0;y<r.length;y+=1){var u=r[y];if((u.width>=f||u.height>=p)&&m(u,r[y+1])){E=y;break}}return E},c(g,[{key:"mediaWidth",get:function(){return this.getDimensions().width*g.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*g.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var r=1;try{r=self.devicePixelRatio}catch(f){}return r}}]),g}();h.default=C},"./src/controller/cmcd-controller.ts":function(I,h,S){"use strict";S.r(h),S.d(h,"default",function(){return m});var L=S("./src/events.ts"),T=S("./src/types/cmcd.ts"),c=S("./src/utils/buffer-helper.ts"),C=S("./src/utils/logger.ts");function g(E,y){for(var u=0;u<y.length;u++){var n=y[u];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(E,n.key,n)}}function s(E,y,u){return y&&g(E.prototype,y),u&&g(E,u),E}function a(E,y){var u=typeof Symbol!="undefined"&&E[Symbol.iterator]||E["@@iterator"];if(u)return(u=u.call(E)).next.bind(u);if(Array.isArray(E)||(u=r(E))||y&&E&&typeof E.length=="number"){u&&(E=u);var n=0;return function(){return n>=E.length?{done:!0}:{done:!1,value:E[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 r(E,y){if(!E)return;if(typeof E=="string")return f(E,y);var u=Object.prototype.toString.call(E).slice(8,-1);if(u==="Object"&&E.constructor&&(u=E.constructor.name),u==="Map"||u==="Set")return Array.from(E);if(u==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(u))return f(E,y)}function f(E,y){(y==null||y>E.length)&&(y=E.length);for(var u=0,n=new Array(y);u<y;u++)n[u]=E[u];return n}function p(){return p=Object.assign||function(E){for(var y=1;y<arguments.length;y++){var u=arguments[y];for(var n in u)Object.prototype.hasOwnProperty.call(u,n)&&(E[n]=u[n])}return E},p.apply(this,arguments)}var m=function(){function E(u){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(w){try{n.apply(w,{ot:T.CMCDObjectType.MANIFEST,su:!n.initialized})}catch(v){C.logger.warn("Could not generate manifest CMCD data.",v)}},this.applyFragmentData=function(w){try{var v=w.frag,i=n.hls.levels[v.level],R=n.getObjectType(v),k={d:v.duration*1e3,ot:R};(R===T.CMCDObjectType.VIDEO||R===T.CMCDObjectType.AUDIO||R==T.CMCDObjectType.MUXED)&&(k.br=i.bitrate/1e3,k.tb=n.getTopBandwidth(R),k.bl=n.getBufferLength(R)),n.apply(w,k)}catch(d){C.logger.warn("Could not generate segment CMCD data.",d)}},this.hls=u;var o=this.config=u.config,l=o.cmcd;l!=null&&(o.pLoader=this.createPlaylistLoader(),o.fLoader=this.createFragmentLoader(),this.sid=l.sessionId||E.uuid(),this.cid=l.contentId,this.useHeaders=l.useHeaders===!0,this.registerListeners())}var y=E.prototype;return y.registerListeners=function(){var n=this.hls;n.on(L.Events.MEDIA_ATTACHED,this.onMediaAttached,this),n.on(L.Events.MEDIA_DETACHED,this.onMediaDetached,this),n.on(L.Events.BUFFER_CREATED,this.onBufferCreated,this)},y.unregisterListeners=function(){var n=this.hls;n.off(L.Events.MEDIA_ATTACHED,this.onMediaAttached,this),n.off(L.Events.MEDIA_DETACHED,this.onMediaDetached,this),n.off(L.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},y.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},y.onMediaAttached=function(n,o){this.media=o.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},y.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},y.onBufferCreated=function(n,o){var l,w;this.audioBuffer=(l=o.tracks.audio)===null||l===void 0?void 0:l.buffer,this.videoBuffer=(w=o.tracks.video)===null||w===void 0?void 0:w.buffer},y.createData=function(){var n;return{v:T.CMCDVersion,sf:T.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}},y.apply=function(n,o){o===void 0&&(o={}),p(o,this.createData());var l=o.ot===T.CMCDObjectType.INIT||o.ot===T.CMCDObjectType.VIDEO||o.ot===T.CMCDObjectType.MUXED;if(this.starved&&l&&(o.bs=!0,o.su=!0,this.starved=!1),o.su==null&&(o.su=this.buffering),this.useHeaders){var w=E.toHeaders(o);if(!Object.keys(w).length)return;n.headers||(n.headers={}),p(n.headers,w)}else{var v=E.toQuery(o);if(!v)return;n.url=E.appendQueryToUri(n.url,v)}},y.getObjectType=function(n){var o=n.type;return o==="subtitle"?T.CMCDObjectType.TIMED_TEXT:n.sn==="initSegment"?T.CMCDObjectType.INIT:o==="audio"?T.CMCDObjectType.AUDIO:o==="main"?this.hls.audioTracks.length?T.CMCDObjectType.VIDEO:T.CMCDObjectType.MUXED:void 0},y.getTopBandwidth=function(n){for(var o=0,l=n===T.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,w=a(l),v;!(v=w()).done;){var i=v.value;i.bitrate>o&&(o=i.bitrate)}return o>0?o:NaN},y.getBufferLength=function(n){var o=this.hls.media,l=n===T.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!l||!o)return NaN;var w=c.BufferHelper.bufferInfo(l,o.currentTime,this.config.maxBufferHole);return w.len*1e3},y.createPlaylistLoader=function(){var n=this.config.pLoader,o=this.applyPlaylistData,l=n||this.config.loader;return function(){function w(i){this.loader=void 0,this.loader=new l(i)}var v=w.prototype;return v.destroy=function(){this.loader.destroy()},v.abort=function(){this.loader.abort()},v.load=function(R,k,d){o(R),this.loader.load(R,k,d)},s(w,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),w}()},y.createFragmentLoader=function(){var n=this.config.fLoader,o=this.applyFragmentData,l=n||this.config.loader;return function(){function w(i){this.loader=void 0,this.loader=new l(i)}var v=w.prototype;return v.destroy=function(){this.loader.destroy()},v.abort=function(){this.loader.abort()},v.load=function(R,k,d){o(R),this.loader.load(R,k,d)},s(w,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),w}()},E.uuid=function(){var n=URL.createObjectURL(new Blob),o=n.toString();return URL.revokeObjectURL(n),o.substr(o.lastIndexOf("/")+1)},E.serialize=function(n){for(var o=[],l=function($){return!Number.isNaN($)&&$!=null&&$!==""&&$!==!1},w=function($){return Math.round($)},v=function($){return w($/100)*100},i=function($){return encodeURIComponent($)},R={br:w,d:w,bl:v,dl:v,mtp:v,nor:i,rtp:v,tb:w},k=Object.keys(n||{}).sort(),d=a(k),b;!(b=d()).done;){var x=b.value,_=n[x];if(!l(_))continue;if(x==="v"&&_===1)continue;if(x=="pr"&&_===1)continue;var B=R[x];B&&(_=B(_));var U=typeof _,P=void 0;x==="ot"||x==="sf"||x==="st"?P=x+"="+_:U==="boolean"?P=x:U==="number"?P=x+"="+_:P=x+"="+JSON.stringify(_),o.push(P)}return o.join(",")},E.toHeaders=function(n){for(var o=Object.keys(n),l={},w=["Object","Request","Session","Status"],v=[{},{},{},{}],i={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},R=0,k=o;R<k.length;R++){var d=k[R],b=i[d]!=null?i[d]:1;v[b][d]=n[d]}for(var x=0;x<v.length;x++){var _=E.serialize(v[x]);_&&(l["CMCD-"+w[x]]=_)}return l},E.toQuery=function(n){return"CMCD="+encodeURIComponent(E.serialize(n))},E.appendQueryToUri=function(n,o){if(!o)return n;var l=n.includes("?")?"&":"?";return""+n+l+o},E}()},"./src/controller/eme-controller.ts":function(I,h,S){"use strict";S.r(h);var L=S("./src/events.ts"),T=S("./src/errors.ts"),c=S("./src/utils/logger.ts"),C=S("./src/utils/mediakeys-helper.ts");function g(m,E){for(var y=0;y<E.length;y++){var u=E[y];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(m,u.key,u)}}function s(m,E,y){return E&&g(m.prototype,E),y&&g(m,y),m}var a=3,r=function(E,y,u){var n={audioCapabilities:[],videoCapabilities:[]};return E.forEach(function(o){n.audioCapabilities.push({contentType:'audio/mp4; codecs="'+o+'"',robustness:u.audioRobustness||""})}),y.forEach(function(o){n.videoCapabilities.push({contentType:'video/mp4; codecs="'+o+'"',robustness:u.videoRobustness||""})}),[n]},f=function(E,y,u,n){switch(E){case C.KeySystems.WIDEVINE:return r(y,u,n);default:throw new Error("Unknown key-system: "+E)}},p=function(){function m(y){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=y,this._config=y.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 E=m.prototype;return E.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},E._registerListeners=function(){this.hls.on(L.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(L.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(L.Events.MANIFEST_PARSED,this.onManifestParsed,this)},E._unregisterListeners=function(){this.hls.off(L.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(L.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(L.Events.MANIFEST_PARSED,this.onManifestParsed,this)},E.getLicenseServerUrl=function(u){switch(u){case C.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+u+'"')},E._attemptKeySystemAccess=function(u,n,o){var l=this,w=f(u,n,o,this._drmSystemOptions);c.logger.log("Requesting encrypted media key-system access");var v=this.requestMediaKeySystemAccess(u,w);this.mediaKeysPromise=v.then(function(i){return l._onMediaKeySystemAccessObtained(u,i)}),v.catch(function(i){c.logger.error('Failed to obtain key-system "'+u+'" access:',i)})},E._onMediaKeySystemAccessObtained=function(u,n){var o=this;c.logger.log('Access for key-system "'+u+'" obtained');var l={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:n,mediaKeySystemDomain:u};this._mediaKeysList.push(l);var w=Promise.resolve().then(function(){return n.createMediaKeys()}).then(function(v){return l.mediaKeys=v,c.logger.log('Media-keys created for key-system "'+u+'"'),o._onMediaKeysCreated(),v});return w.catch(function(v){c.logger.error("Failed to create media-keys:",v)}),w},E._onMediaKeysCreated=function(){var u=this;this._mediaKeysList.forEach(function(n){n.mediaKeysSession||(n.mediaKeysSession=n.mediaKeys.createSession(),u._onNewMediaKeySession(n.mediaKeysSession))})},E._onNewMediaKeySession=function(u){var n=this;c.logger.log("New key-system session "+u.sessionId),u.addEventListener("message",function(o){n._onKeySessionMessage(u,o.message)},!1)},E._onKeySessionMessage=function(u,n){c.logger.log("Got EME message event, creating license request"),this._requestLicense(n,function(o){c.logger.log("Received license data (length: "+(o&&o.byteLength)+"), updating key-session"),u.update(o)})},E.onMediaEncrypted=function(u){var n=this;if(c.logger.log('Media is encrypted using "'+u.initDataType+'" init data type'),!this.mediaKeysPromise){c.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(L.Events.ERROR,{type:T.ErrorTypes.KEY_SYSTEM_ERROR,details:T.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var o=function(w){if(!n._media)return;n._attemptSetMediaKeys(w),n._generateRequestWithPreferredKeySession(u.initDataType,u.initData)};this.mediaKeysPromise.then(o).catch(o)},E._attemptSetMediaKeys=function(u){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){c.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(L.Events.ERROR,{type:T.ErrorTypes.KEY_SYSTEM_ERROR,details:T.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}c.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(n.mediaKeys),this._hasSetMediaKeys=!0}},E._generateRequestWithPreferredKeySession=function(u,n){var o=this,l=this._mediaKeysList[0];if(!l){c.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(L.Events.ERROR,{type:T.ErrorTypes.KEY_SYSTEM_ERROR,details:T.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(l.mediaKeysSessionInitialized){c.logger.warn("Key-Session already initialized but requested again");return}var w=l.mediaKeysSession;if(!w){c.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(L.Events.ERROR,{type:T.ErrorTypes.KEY_SYSTEM_ERROR,details:T.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!n){c.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(L.Events.ERROR,{type:T.ErrorTypes.KEY_SYSTEM_ERROR,details:T.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}c.logger.log('Generating key-session request for "'+u+'" init data type'),l.mediaKeysSessionInitialized=!0,w.generateRequest(u,n).then(function(){c.logger.debug("Key-session generation succeeded")}).catch(function(v){c.logger.error("Error generating key-session request:",v),o.hls.trigger(L.Events.ERROR,{type:T.ErrorTypes.KEY_SYSTEM_ERROR,details:T.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},E._createLicenseXhr=function(u,n,o){var l=new XMLHttpRequest;l.responseType="arraybuffer",l.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,l,u,n,o);var w=this._licenseXhrSetup;if(w)try{w.call(this.hls,l,u),w=void 0}catch(v){c.logger.error(v)}try{l.readyState||l.open("POST",u,!0),w&&w.call(this.hls,l,u)}catch(v){throw new Error("issue setting up KeySystem license XHR "+v)}return l},E._onLicenseRequestReadyStageChange=function(u,n,o,l){switch(u.readyState){case 4:if(u.status===200){this._requestLicenseFailureCount=0,c.logger.log("License request succeeded");var w=u.response,v=this._licenseResponseCallback;if(v)try{w=v.call(this.hls,u,n)}catch(R){c.logger.error(R)}l(w)}else{if(c.logger.error("License Request XHR failed ("+n+"). Status: "+u.status+" ("+u.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>a){this.hls.trigger(L.Events.ERROR,{type:T.ErrorTypes.KEY_SYSTEM_ERROR,details:T.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var i=a-this._requestLicenseFailureCount+1;c.logger.warn("Retrying license request, "+i+" attempts left"),this._requestLicense(o,l)}break}},E._generateLicenseRequestChallenge=function(u,n){switch(u.mediaKeySystemDomain){case C.KeySystems.WIDEVINE:return n}throw new Error("unsupported key-system: "+u.mediaKeySystemDomain)},E._requestLicense=function(u,n){c.logger.log("Requesting content license for key-system");var o=this._mediaKeysList[0];if(!o){c.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(L.Events.ERROR,{type:T.ErrorTypes.KEY_SYSTEM_ERROR,details:T.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var l=this.getLicenseServerUrl(o.mediaKeySystemDomain),w=this._createLicenseXhr(l,u,n);c.logger.log("Sending license request to URL: "+l);var v=this._generateLicenseRequestChallenge(o,u);w.send(v)}catch(i){c.logger.error("Failure requesting DRM license: "+i),this.hls.trigger(L.Events.ERROR,{type:T.ErrorTypes.KEY_SYSTEM_ERROR,details:T.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},E.onMediaAttached=function(u,n){if(!this._emeEnabled)return;var o=n.media;this._media=o,o.addEventListener("encrypted",this._onMediaEncrypted)},E.onMediaDetached=function(){var u=this._media,n=this._mediaKeysList;if(!u)return;u.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(n.map(function(o){if(o.mediaKeysSession)return o.mediaKeysSession.close().catch(function(){})})).then(function(){return u.setMediaKeys(null)}).catch(function(){})},E.onManifestParsed=function(u,n){if(!this._emeEnabled)return;var o=n.levels.map(function(w){return w.audioCodec}).filter(function(w){return!!w}),l=n.levels.map(function(w){return w.videoCodec}).filter(function(w){return!!w});this._attemptKeySystemAccess(C.KeySystems.WIDEVINE,o,l)},s(m,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),m}();h.default=p},"./src/controller/fps-controller.ts":function(I,h,S){"use strict";S.r(h);var L=S("./src/events.ts"),T=S("./src/utils/logger.ts"),c=function(){function C(s){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=s,this.registerListeners()}var g=C.prototype;return g.setStreamController=function(a){this.streamController=a},g.registerListeners=function(){this.hls.on(L.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},g.unregisterListeners=function(){this.hls.off(L.Events.MEDIA_ATTACHING,this.onMediaAttaching)},g.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},g.onMediaAttaching=function(a,r){var f=this.hls.config;if(f.capLevelOnFPSDrop){var p=r.media instanceof self.HTMLVideoElement?r.media:null;this.media=p,p&&typeof p.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),f.fpsDroppedMonitoringPeriod)}},g.checkFPS=function(a,r,f){var p=performance.now();if(r){if(this.lastTime){var m=p-this.lastTime,E=f-this.lastDroppedFrames,y=r-this.lastDecodedFrames,u=1e3*E/m,n=this.hls;if(n.trigger(L.Events.FPS_DROP,{currentDropped:E,currentDecoded:y,totalDroppedFrames:f}),u>0&&E>n.config.fpsDroppedMonitoringThreshold*y){var o=n.currentLevel;T.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+o),o>0&&(n.autoLevelCapping===-1||n.autoLevelCapping>=o)&&(o=o-1,n.trigger(L.Events.FPS_DROP_LEVEL_CAPPING,{level:o,droppedLevel:n.currentLevel}),n.autoLevelCapping=o,this.streamController.nextLevelSwitch())}}this.lastTime=p,this.lastDroppedFrames=f,this.lastDecodedFrames=r}},g.checkFPSInterval=function(){var a=this.media;if(a)if(this.isVideoPlaybackQualityAvailable){var r=a.getVideoPlaybackQuality();this.checkFPS(a,r.totalVideoFrames,r.droppedVideoFrames)}else this.checkFPS(a,a.webkitDecodedFrameCount,a.webkitDroppedFrameCount)},C}();h.default=c},"./src/controller/fragment-finders.ts":function(I,h,S){"use strict";S.r(h),S.d(h,"findFragmentByPDT",function(){return c}),S.d(h,"findFragmentByPTS",function(){return C}),S.d(h,"fragmentWithinToleranceTest",function(){return g}),S.d(h,"pdtWithinToleranceTest",function(){return s}),S.d(h,"findFragWithCC",function(){return a});var L=S("./src/polyfills/number.ts"),T=S("./src/utils/binary-search.ts");function c(r,f,p){if(f===null||!Array.isArray(r)||!r.length||!Object(L.isFiniteNumber)(f))return null;var m=r[0].programDateTime;if(f<(m||0))return null;var E=r[r.length-1].endProgramDateTime;if(f>=(E||0))return null;p=p||0;for(var y=0;y<r.length;++y){var u=r[y];if(s(f,p,u))return u}return null}function C(r,f,p,m){p===void 0&&(p=0),m===void 0&&(m=0);var E=null;if(r?E=f[r.sn-f[0].sn+1]||null:p===0&&f[0].start===0&&(E=f[0]),E&&g(p,m,E)===0)return E;var y=T.default.search(f,g.bind(null,p,m));return y||E}function g(r,f,p){r===void 0&&(r=0),f===void 0&&(f=0);var m=Math.min(f,p.duration+(p.deltaPTS?p.deltaPTS:0));return p.start+p.duration-m<=r?1:p.start-m>r&&p.start?-1:0}function s(r,f,p){var m=Math.min(f,p.duration+(p.deltaPTS?p.deltaPTS:0))*1e3,E=p.endProgramDateTime||0;return E-m>r}function a(r,f){return T.default.search(r,function(p){return p.cc<f?1:p.cc>f?-1:0})}},"./src/controller/fragment-tracker.ts":function(I,h,S){"use strict";S.r(h),S.d(h,"FragmentState",function(){return c}),S.d(h,"FragmentTracker",function(){return C});var L=S("./src/events.ts"),T=S("./src/types/loader.ts"),c;(function(a){a.NOT_LOADED="NOT_LOADED",a.BACKTRACKED="BACKTRACKED",a.APPENDING="APPENDING",a.PARTIAL="PARTIAL",a.OK="OK"})(c||(c={}));var C=function(){function a(f){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=f,this._registerListeners()}var r=a.prototype;return r._registerListeners=function(){var p=this.hls;p.on(L.Events.BUFFER_APPENDED,this.onBufferAppended,this),p.on(L.Events.FRAG_BUFFERED,this.onFragBuffered,this),p.on(L.Events.FRAG_LOADED,this.onFragLoaded,this)},r._unregisterListeners=function(){var p=this.hls;p.off(L.Events.BUFFER_APPENDED,this.onBufferAppended,this),p.off(L.Events.FRAG_BUFFERED,this.onFragBuffered,this),p.off(L.Events.FRAG_LOADED,this.onFragLoaded,this)},r.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},r.getAppendedFrag=function(p,m){if(m===T.PlaylistLevelType.MAIN){var E=this.activeFragment,y=this.activeParts;if(!E)return null;if(y)for(var u=y.length;u--;){var n=y[u],o=n?n.end:E.appendedPTS;if(n.start<=p&&o!==void 0&&p<=o)return u>9&&(this.activeParts=y.slice(u-9)),n}else if(E.start<=p&&E.appendedPTS!==void 0&&p<=E.appendedPTS)return E}return this.getBufferedFrag(p,m)},r.getBufferedFrag=function(p,m){for(var E=this.fragments,y=Object.keys(E),u=y.length;u--;){var n=E[y[u]];if((n==null?void 0:n.body.type)===m&&n.buffered){var o=n.body;if(o.start<=p&&p<=o.end)return o}}return null},r.detectEvictedFragments=function(p,m,E){var y=this;Object.keys(this.fragments).forEach(function(u){var n=y.fragments[u];if(!n)return;if(!n.buffered){n.body.type===E&&y.removeFragment(n.body);return}var o=n.range[p];if(!o)return;o.time.some(function(l){var w=!y.isTimeBuffered(l.startPTS,l.endPTS,m);return w&&y.removeFragment(n.body),w})})},r.detectPartialFragments=function(p){var m=this,E=this.timeRanges,y=p.frag,u=p.part;if(!E||y.sn==="initSegment")return;var n=s(y),o=this.fragments[n];if(!o)return;Object.keys(E).forEach(function(l){var w=y.elementaryStreams[l];if(!w)return;var v=E[l],i=u!==null||w.partial===!0;o.range[l]=m.getBufferedTimes(y,u,i,v)}),o.backtrack=o.loaded=null,Object.keys(o.range).length?o.buffered=!0:this.removeFragment(o.body)},r.fragBuffered=function(p){var m=s(p),E=this.fragments[m];E&&(E.backtrack=E.loaded=null,E.buffered=!0)},r.getBufferedTimes=function(p,m,E,y){for(var u={time:[],partial:E},n=m?m.start:p.start,o=m?m.end:p.end,l=p.minEndPTS||o,w=p.maxStartPTS||n,v=0;v<y.length;v++){var i=y.start(v)-this.bufferPadding,R=y.end(v)+this.bufferPadding;if(w>=i&&l<=R){u.time.push({startPTS:Math.max(n,y.start(v)),endPTS:Math.min(o,y.end(v))});break}else if(n<R&&o>i)u.partial=!0,u.time.push({startPTS:Math.max(n,y.start(v)),endPTS:Math.min(o,y.end(v))});else if(o<=i)break}return u},r.getPartialFragment=function(p){var m=null,E,y,u,n=0,o=this.bufferPadding,l=this.fragments;return Object.keys(l).forEach(function(w){var v=l[w];if(!v)return;g(v)&&(y=v.body.start-o,u=v.body.end+o,p>=y&&p<=u&&(E=Math.min(p-y,u-p),n<=E&&(m=v.body,n=E)))}),m},r.getState=function(p){var m=s(p),E=this.fragments[m];return E?E.buffered?g(E)?c.PARTIAL:c.OK:E.backtrack?c.BACKTRACKED:c.APPENDING:c.NOT_LOADED},r.backtrack=function(p,m){var E=s(p),y=this.fragments[E];if(!y||y.backtrack)return null;var u=y.backtrack=m||y.loaded;return y.loaded=null,u},r.getBacktrackData=function(p){var m=s(p),E=this.fragments[m];if(E){var y,u=E.backtrack;if(u!=null&&(y=u.payload)!==null&&y!==void 0&&y.byteLength)return u;this.removeFragment(p)}return null},r.isTimeBuffered=function(p,m,E){for(var y,u,n=0;n<E.length;n++){if(y=E.start(n)-this.bufferPadding,u=E.end(n)+this.bufferPadding,p>=y&&m<=u)return!0;if(m<=y)return!1}return!1},r.onFragLoaded=function(p,m){var E=m.frag,y=m.part;if(E.sn==="initSegment"||E.bitrateTest||y)return;var u=s(E);this.fragments[u]={body:E,loaded:m,backtrack:null,buffered:!1,range:Object.create(null)}},r.onBufferAppended=function(p,m){var E=this,y=m.frag,u=m.part,n=m.timeRanges;if(y.type===T.PlaylistLevelType.MAIN)if(this.activeFragment=y,u){var o=this.activeParts;o||(this.activeParts=o=[]),o.push(u)}else this.activeParts=null;this.timeRanges=n,Object.keys(n).forEach(function(l){var w=n[l];if(E.detectEvictedFragments(l,w),!u)for(var v=0;v<w.length;v++)y.appendedPTS=Math.max(w.end(v),y.appendedPTS||0)})},r.onFragBuffered=function(p,m){this.detectPartialFragments(m)},r.hasFragment=function(p){var m=s(p);return!!this.fragments[m]},r.removeFragmentsInRange=function(p,m,E){var y=this;Object.keys(this.fragments).forEach(function(u){var n=y.fragments[u];if(!n)return;if(n.buffered){var o=n.body;o.type===E&&o.start<m&&o.end>p&&y.removeFragment(o)}})},r.removeFragment=function(p){var m=s(p);p.stats.loaded=0,p.clearElementaryStreamInfo(),delete this.fragments[m]},r.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},a}();function g(a){var r,f;return a.buffered&&(((r=a.range.video)===null||r===void 0?void 0:r.partial)||((f=a.range.audio)===null||f===void 0?void 0:f.partial))}function s(a){return a.type+"_"+a.level+"_"+a.urlId+"_"+a.sn}},"./src/controller/gap-controller.ts":function(I,h,S){"use strict";S.r(h),S.d(h,"STALL_MINIMUM_DURATION_MS",function(){return g}),S.d(h,"MAX_START_GAP_JUMP",function(){return s}),S.d(h,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return a}),S.d(h,"SKIP_BUFFER_RANGE_START",function(){return r}),S.d(h,"default",function(){return f});var L=S("./src/utils/buffer-helper.ts"),T=S("./src/errors.ts"),c=S("./src/events.ts"),C=S("./src/utils/logger.ts"),g=250,s=2,a=.1,r=.05,f=function(){function p(E,y,u,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=E,this.media=y,this.fragmentTracker=u,this.hls=n}var m=p.prototype;return m.destroy=function(){this.hls=this.fragmentTracker=this.media=null},m.poll=function(y){var u=this.config,n=this.media,o=this.stalled,l=n.currentTime,w=n.seeking,v=this.seeking&&!w,i=!this.seeking&&w;if(this.seeking=w,l!==y){if(this.moved=!0,o!==null){if(this.stallReported){var R=self.performance.now()-o;C.logger.warn("playback not stuck anymore @"+l+", after "+Math.round(R)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((i||v)&&(this.stalled=null),n.paused||n.ended||n.playbackRate===0||!L.BufferHelper.getBuffered(n).length)return;var k=L.BufferHelper.bufferInfo(n,l,0),d=k.len>0,b=k.nextStart||0;if(!d&&!b)return;if(w){var x=k.len>s,_=!b||b-l>s&&!this.fragmentTracker.getPartialFragment(l);if(x||_)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var B,U=Math.max(b,k.start||0)-l,P=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,J=P==null||((B=P.details)===null||B===void 0)?void 0:B.live,$=J?P.details.targetduration*2:s;if(U>0&&U<=$){this._trySkipBufferHole(null);return}}var z=self.performance.now();if(o===null){this.stalled=z;return}var V=z-o;!w&&V>=g&&this._reportStall(k.len);var K=L.BufferHelper.bufferInfo(n,l,u.maxBufferHole);this._tryFixBufferStall(K,V)},m._tryFixBufferStall=function(y,u){var n=this.config,o=this.fragmentTracker,l=this.media,w=l.currentTime,v=o.getPartialFragment(w);if(v){var i=this._trySkipBufferHole(v);if(i)return}y.len>n.maxBufferHole&&u>n.highBufferWatchdogPeriod*1e3&&(C.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},m._reportStall=function(y){var u=this.hls,n=this.media,o=this.stallReported;o||(this.stallReported=!0,C.logger.warn("Playback stalling at @"+n.currentTime+" due to low buffer (buffer="+y+")"),u.trigger(c.Events.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:y}))},m._trySkipBufferHole=function(y){for(var u=this.config,n=this.hls,o=this.media,l=o.currentTime,w=0,v=L.BufferHelper.getBuffered(o),i=0;i<v.length;i++){var R=v.start(i);if(l+u.maxBufferHole>=w&&l<R){var k=Math.max(R+r,o.currentTime+a);return C.logger.warn("skipping hole, adjusting currentTime from "+l+" to "+k),this.moved=!0,this.stalled=null,o.currentTime=k,y&&n.trigger(c.Events.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+l+" to "+k,frag:y}),k}w=v.end(i)}return 0},m._tryNudgeBuffer=function(){var y=this.config,u=this.hls,n=this.media,o=n.currentTime,l=(this.nudgeRetry||0)+1;if(this.nudgeRetry=l,l<y.nudgeMaxRetry){var w=o+l*y.nudgeOffset;C.logger.warn("Nudging 'currentTime' from "+o+" to "+w),n.currentTime=w,u.trigger(c.Events.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else C.logger.error("Playhead still not moving while enough data buffered @"+o+" after "+y.nudgeMaxRetry+" nudges"),u.trigger(c.Events.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},p}()},"./src/controller/id3-track-controller.ts":function(I,h,S){"use strict";S.r(h);var L=S("./src/events.ts"),T=S("./src/utils/texttrack-utils.ts"),c=S("./src/demux/id3.ts"),C=.25,g=function(){function s(r){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=r,this._registerListeners()}var a=s.prototype;return a.destroy=function(){this._unregisterListeners()},a._registerListeners=function(){var f=this.hls;f.on(L.Events.MEDIA_ATTACHED,this.onMediaAttached,this),f.on(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),f.on(L.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),f.on(L.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},a._unregisterListeners=function(){var f=this.hls;f.off(L.Events.MEDIA_ATTACHED,this.onMediaAttached,this),f.off(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),f.off(L.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),f.off(L.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},a.onMediaAttached=function(f,p){this.media=p.media},a.onMediaDetaching=function(){if(!this.id3Track)return;Object(T.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},a.getID3Track=function(f){if(!this.media)return;for(var p=0;p<f.length;p++){var m=f[p];if(m.kind==="metadata"&&m.label==="id3")return Object(T.sendAddTrackEvent)(m,this.media),m}return this.media.addTextTrack("metadata","id3")},a.onFragParsingMetadata=function(f,p){if(!this.media)return;var m=p.frag,E=p.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var y=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,u=0;u<E.length;u++){var n=c.getID3Frames(E[u].data);if(n){var o=E[u].pts,l=u<E.length-1?E[u+1].pts:m.end,w=l-o;w<=0&&(l=o+C);for(var v=0;v<n.length;v++){var i=n[v];if(!c.isTimeStampFrame(i)){var R=new y(o,l,"");R.value=i,this.id3Track.addCue(R)}}}}},a.onBufferFlushing=function(f,p){var m=p.startOffset,E=p.endOffset,y=p.type;if(!y||y==="audio"){var u=this.id3Track;u&&Object(T.removeCuesInRange)(u,m,E)}},s}();h.default=g},"./src/controller/latency-controller.ts":function(I,h,S){"use strict";S.r(h),S.d(h,"default",function(){return s});var L=S("./src/errors.ts"),T=S("./src/events.ts"),c=S("./src/utils/logger.ts");function C(a,r){for(var f=0;f<r.length;f++){var p=r[f];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(a,p.key,p)}}function g(a,r,f){return r&&C(a.prototype,r),f&&C(a,f),a}var s=function(){function a(f){var p=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 p.timeupdate()},this.hls=f,this.config=f.config,this.registerListeners()}var r=a.prototype;return r.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},r.registerListeners=function(){this.hls.on(T.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(T.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(T.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(T.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(T.Events.ERROR,this.onError,this)},r.unregisterListeners=function(){this.hls.off(T.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(T.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(T.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(T.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(T.Events.ERROR,this.onError)},r.onMediaAttached=function(p,m){this.media=m.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},r.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},r.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},r.onLevelUpdated=function(p,m){var E=m.details;this.levelDetails=E,E.advanced&&this.timeupdate(),!E.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},r.onError=function(p,m){if(m.details!==L.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,c.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},r.timeupdate=function(){var p=this.media,m=this.levelDetails;if(!p||!m)return;this.currentTime=p.currentTime;var E=this.computeLatency();if(E===null)return;this._latency=E;var y=this.config,u=y.lowLatencyMode,n=y.maxLiveSyncPlaybackRate;if(!u||n===1)return;var o=this.targetLatency;if(o===null)return;var l=E-o,w=Math.min(this.maxLatency,o+m.targetduration),v=l<w;if(m.live&&v&&l>.05&&this.forwardBufferLength>1){var i=Math.min(2,Math.max(1,n)),R=Math.round(2/(1+Math.exp(-.75*l-this.edgeStalled))*20)/20;p.playbackRate=Math.min(i,Math.max(1,R))}else p.playbackRate!==1&&p.playbackRate!==0&&(p.playbackRate=1)},r.estimateLiveEdge=function(){var p=this.levelDetails;return p===null?null:p.edge+p.age},r.computeLatency=function(){var p=this.estimateLiveEdge();return p===null?null:p-this.currentTime},g(a,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var p=this.config,m=this.levelDetails;return p.liveMaxLatencyDuration!==void 0?p.liveMaxLatencyDuration:m?p.liveMaxLatencyDurationCount*m.targetduration:0}},{key:"targetLatency",get:function(){var p=this.levelDetails;if(p===null)return null;var m=p.holdBack,E=p.partHoldBack,y=p.targetduration,u=this.config,n=u.liveSyncDuration,o=u.liveSyncDurationCount,l=u.lowLatencyMode,w=this.hls.userConfig,v=l&&E||m;(w.liveSyncDuration||w.liveSyncDurationCount||v===0)&&(v=n!==void 0?n:o*y);var i=y,R=1;return v+Math.min(this.stallCount*R,i)}},{key:"liveSyncPosition",get:function(){var p=this.estimateLiveEdge(),m=this.targetLatency,E=this.levelDetails;if(p===null||m===null||E===null)return null;var y=E.edge,u=p-m-this.edgeStalled,n=y-E.totalduration,o=y-(this.config.lowLatencyMode&&E.partTarget||E.targetduration);return Math.min(Math.max(n,u),o)}},{key:"drift",get:function(){var p=this.levelDetails;return p===null?1:p.drift}},{key:"edgeStalled",get:function(){var p=this.levelDetails;if(p===null)return 0;var m=(this.config.lowLatencyMode&&p.partTarget||p.targetduration)*3;return Math.max(p.age-m,0)}},{key:"forwardBufferLength",get:function(){var p=this.media,m=this.levelDetails;if(!p||!m)return 0;var E=p.buffered.length;return E?p.buffered.end(E-1):m.edge-this.currentTime}}]),a}()},"./src/controller/level-controller.ts":function(I,h,S){"use strict";S.r(h),S.d(h,"default",function(){return u});var L=S("./src/types/level.ts"),T=S("./src/events.ts"),c=S("./src/errors.ts"),C=S("./src/utils/codecs.ts"),g=S("./src/controller/level-helper.ts"),s=S("./src/controller/base-playlist-controller.ts"),a=S("./src/types/loader.ts");function r(){return r=Object.assign||function(n){for(var o=1;o<arguments.length;o++){var l=arguments[o];for(var w in l)Object.prototype.hasOwnProperty.call(l,w)&&(n[w]=l[w])}return n},r.apply(this,arguments)}function f(n,o){for(var l=0;l<o.length;l++){var w=o[l];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(n,w.key,w)}}function p(n,o,l){return o&&f(n.prototype,o),l&&f(n,l),n}function m(n,o){n.prototype=Object.create(o.prototype),n.prototype.constructor=n,E(n,o)}function E(n,o){return E=Object.setPrototypeOf||function(w,v){return w.__proto__=v,w},E(n,o)}var y=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),u=function(n){m(o,n);function o(w){var v;return v=n.call(this,w,"[level-controller]")||this,v._levels=[],v._firstLevel=-1,v._startLevel=void 0,v.currentLevelIndex=-1,v.manualLevelIndex=-1,v.onParsedComplete=void 0,v._registerListeners(),v}var l=o.prototype;return l._registerListeners=function(){var v=this.hls;v.on(T.Events.MANIFEST_LOADED,this.onManifestLoaded,this),v.on(T.Events.LEVEL_LOADED,this.onLevelLoaded,this),v.on(T.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),v.on(T.Events.FRAG_LOADED,this.onFragLoaded,this),v.on(T.Events.ERROR,this.onError,this)},l._unregisterListeners=function(){var v=this.hls;v.off(T.Events.MANIFEST_LOADED,this.onManifestLoaded,this),v.off(T.Events.LEVEL_LOADED,this.onLevelLoaded,this),v.off(T.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),v.off(T.Events.FRAG_LOADED,this.onFragLoaded,this),v.off(T.Events.ERROR,this.onError,this)},l.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,n.prototype.destroy.call(this)},l.startLoad=function(){var v=this._levels;v.forEach(function(i){i.loadError=0}),n.prototype.startLoad.call(this)},l.onManifestLoaded=function(v,i){var R=[],k=[],d=[],b,x={},_,B=!1,U=!1,P=!1;if(i.levels.forEach(function(V){var K=V.attrs;B=B||!!(V.width&&V.height),U=U||!!V.videoCodec,P=P||!!V.audioCodec,y&&V.audioCodec&&V.audioCodec.indexOf("mp4a.40.34")!==-1&&(V.audioCodec=void 0);var H=V.bitrate+"-"+V.attrs.RESOLUTION+"-"+V.attrs.CODECS;_=x[H],_?_.url.push(V.url):(_=new L.Level(V),x[H]=_,R.push(_)),K&&(K.AUDIO&&Object(g.addGroupId)(_,"audio",K.AUDIO),K.SUBTITLES&&Object(g.addGroupId)(_,"text",K.SUBTITLES))}),(B||U)&&P&&(R=R.filter(function(V){var K=V.videoCodec,H=V.width,G=V.height;return!!K||!!(H&&G)})),R=R.filter(function(V){var K=V.audioCodec,H=V.videoCodec;return(!K||Object(C.isCodecSupportedInMp4)(K,"audio"))&&(!H||Object(C.isCodecSupportedInMp4)(H,"video"))}),i.audioTracks&&(k=i.audioTracks.filter(function(V){return!V.audioCodec||Object(C.isCodecSupportedInMp4)(V.audioCodec,"audio")}),Object(g.assignTrackIdsByGroup)(k)),i.subtitles&&(d=i.subtitles,Object(g.assignTrackIdsByGroup)(d)),R.length>0){b=R[0].bitrate,R.sort(function(V,K){return V.bitrate-K.bitrate}),this._levels=R;for(var J=0;J<R.length;J++)if(R[J].bitrate===b){this._firstLevel=J,this.log("manifest loaded, "+R.length+" level(s) found, first bitrate: "+b);break}var $=P&&!U,z={levels:R,audioTracks:k,subtitleTracks:d,firstLevel:this._firstLevel,stats:i.stats,audio:P,video:U,altAudio:!$&&k.some(function(V){return!!V.url})};this.hls.trigger(T.Events.MANIFEST_PARSED,z),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(T.Events.ERROR,{type:c.ErrorTypes.MEDIA_ERROR,details:c.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:i.url,reason:"no level with compatible codecs found in manifest"})},l.onError=function(v,i){if(n.prototype.onError.call(this,v,i),i.fatal)return;var R=i.context,k=this._levels[this.currentLevelIndex];if(R&&(R.type===a.PlaylistContextType.AUDIO_TRACK&&k.audioGroupIds&&R.groupId===k.audioGroupIds[k.urlId]||R.type===a.PlaylistContextType.SUBTITLE_TRACK&&k.textGroupIds&&R.groupId===k.textGroupIds[k.urlId])){this.redundantFailover(this.currentLevelIndex);return}var d=!1,b=!0,x;switch(i.details){case c.ErrorDetails.FRAG_LOAD_ERROR:case c.ErrorDetails.FRAG_LOAD_TIMEOUT:case c.ErrorDetails.KEY_LOAD_ERROR:case c.ErrorDetails.KEY_LOAD_TIMEOUT:if(i.frag){var _=this._levels[i.frag.level];_?(_.fragmentError++,_.fragmentError>this.hls.config.fragLoadingMaxRetry&&(x=i.frag.level)):x=i.frag.level}break;case c.ErrorDetails.LEVEL_LOAD_ERROR:case c.ErrorDetails.LEVEL_LOAD_TIMEOUT:R&&(R.deliveryDirectives&&(b=!1),x=R.level),d=!0;break;case c.ErrorDetails.REMUX_ALLOC_ERROR:x=i.level,d=!0;break}x!==void 0&&this.recoverLevel(i,x,d,b)},l.recoverLevel=function(v,i,R,k){var d=v.details,b=this._levels[i];if(b.loadError++,R){var x=this.retryLoadingOrFail(v);if(x)v.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(k){var _=b.url.length;if(_>1&&b.loadError<_)v.levelRetry=!0,this.redundantFailover(i);else if(this.manualLevelIndex===-1){var B=i===0?this._levels.length-1:i-1;this.currentLevelIndex!==B&&this._levels[B].loadError===0&&(this.warn(d+": switch to "+B),v.levelRetry=!0,this.hls.nextAutoLevel=B)}}},l.redundantFailover=function(v){var i=this._levels[v],R=i.url.length;if(R>1){var k=(i.urlId+1)%R;this.warn("Switching to redundant URL-id "+k),this._levels.forEach(function(d){d.urlId=k}),this.level=v}},l.onFragLoaded=function(v,i){var R=i.frag;if(R!==void 0&&R.type===a.PlaylistLevelType.MAIN){var k=this._levels[R.level];k!==void 0&&(k.fragmentError=0,k.loadError=0)}},l.onLevelLoaded=function(v,i){var R,k=i.level,d=i.details,b=this._levels[k];if(!b){var x;this.warn("Invalid level index "+k),(x=i.deliveryDirectives)!==null&&x!==void 0&&x.skip&&(d.deltaUpdateFailed=!0);return}k===this.currentLevelIndex?(b.fragmentError===0&&(b.loadError=0,this.retryCount=0),this.playlistLoaded(k,i,b.details)):(R=i.deliveryDirectives)!==null&&R!==void 0&&R.skip&&(d.deltaUpdateFailed=!0)},l.onAudioTrackSwitched=function(v,i){var R=this.hls.levels[this.currentLevelIndex];if(!R)return;if(R.audioGroupIds){for(var k=-1,d=this.hls.audioTracks[i.id].groupId,b=0;b<R.audioGroupIds.length;b++)if(R.audioGroupIds[b]===d){k=b;break}k!==R.urlId&&(R.urlId=k,this.startLoad())}},l.loadPlaylist=function(v){var i=this.currentLevelIndex,R=this._levels[i];if(this.canLoad&&R&&R.url.length>0){var k=R.urlId,d=R.url[k];if(v)try{d=v.addDirectives(d)}catch(b){this.warn("Could not construct new URL with HLS Delivery Directives: "+b)}this.log("Attempt loading level index "+i+(v?" at sn "+v.msn+" part "+v.part:"")+" with URL-id "+k+" "+d),this.clearTimer(),this.hls.trigger(T.Events.LEVEL_LOADING,{url:d,level:i,id:k,deliveryDirectives:v||null})}},l.removeLevel=function(v,i){var R=function(b,x){return x!==i},k=this._levels.filter(function(d,b){return b!==v?!0:d.url.length>1&&i!==void 0?(d.url=d.url.filter(R),d.audioGroupIds&&(d.audioGroupIds=d.audioGroupIds.filter(R)),d.textGroupIds&&(d.textGroupIds=d.textGroupIds.filter(R)),d.urlId=0,!0):!1}).map(function(d,b){var x=d.details;return x!=null&&x.fragments&&x.fragments.forEach(function(_){_.level=b}),d});this._levels=k,this.hls.trigger(T.Events.LEVELS_UPDATED,{levels:k})},p(o,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(v){var i,R=this._levels;if(R.length===0)return;if(this.currentLevelIndex===v&&(i=R[v])!==null&&i!==void 0&&i.details)return;if(v<0||v>=R.length){var k=v<0;if(this.hls.trigger(T.Events.ERROR,{type:c.ErrorTypes.OTHER_ERROR,details:c.ErrorDetails.LEVEL_SWITCH_ERROR,level:v,fatal:k,reason:"invalid level idx"}),k)return;v=Math.min(v,R.length-1)}this.clearTimer();var d=this.currentLevelIndex,b=R[d],x=R[v];this.log("switching to level "+v+" from "+d),this.currentLevelIndex=v;var _=r({},x,{level:v,maxBitrate:x.maxBitrate,uri:x.uri,urlId:x.urlId});delete _._urlId,this.hls.trigger(T.Events.LEVEL_SWITCHING,_);var B=x.details;if(!B||B.live){var U=this.switchParams(x.uri,b==null?void 0:b.details);this.loadPlaylist(U)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(v){this.manualLevelIndex=v,this._startLevel===void 0&&(this._startLevel=v),v!==-1&&(this.level=v)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(v){this._firstLevel=v}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var v=this.hls.config.startLevel;return v!==void 0?v:this._firstLevel}else return this._startLevel},set:function(v){this._startLevel=v}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(v){this.level=v,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=v)}}]),o}(s.default)},"./src/controller/level-helper.ts":function(I,h,S){"use strict";S.r(h),S.d(h,"addGroupId",function(){return c}),S.d(h,"assignTrackIdsByGroup",function(){return C}),S.d(h,"updatePTS",function(){return g}),S.d(h,"updateFragPTSDTS",function(){return a}),S.d(h,"mergeDetails",function(){return r}),S.d(h,"mapPartIntersection",function(){return f}),S.d(h,"mapFragmentIntersection",function(){return p}),S.d(h,"adjustSliding",function(){return m}),S.d(h,"addSliding",function(){return E}),S.d(h,"computeReloadInterval",function(){return y}),S.d(h,"getFragmentWithSN",function(){return u}),S.d(h,"getPartWith",function(){return n});var L=S("./src/polyfills/number.ts"),T=S("./src/utils/logger.ts");function c(o,l,w){switch(l){case"audio":o.audioGroupIds||(o.audioGroupIds=[]),o.audioGroupIds.push(w);break;case"text":o.textGroupIds||(o.textGroupIds=[]),o.textGroupIds.push(w);break}}function C(o){var l={};o.forEach(function(w){var v=w.groupId||"";w.id=l[v]=l[v]||0,l[v]++})}function g(o,l,w){var v=o[l],i=o[w];s(v,i)}function s(o,l){var w=l.startPTS;if(Object(L.isFiniteNumber)(w)){var v=0,i;l.sn>o.sn?(v=w-o.start,i=o):(v=o.start-w,i=l),i.duration!==v&&(i.duration=v)}else if(l.sn>o.sn){var R=o.cc===l.cc;R&&o.minEndPTS?l.start=o.start+(o.minEndPTS-o.start):l.start=o.start+o.duration}else l.start=Math.max(o.start-l.duration,0)}function a(o,l,w,v,i,R){var k=v-w;k<=0&&(T.logger.warn("Fragment should have a positive duration",l),v=w+l.duration,R=i+l.duration);var d=w,b=v,x=l.startPTS,_=l.endPTS;if(Object(L.isFiniteNumber)(x)){var B=Math.abs(x-w);Object(L.isFiniteNumber)(l.deltaPTS)?l.deltaPTS=Math.max(B,l.deltaPTS):l.deltaPTS=B,d=Math.max(w,x),w=Math.min(w,x),i=Math.min(i,l.startDTS),b=Math.min(v,_),v=Math.max(v,_),R=Math.max(R,l.endDTS)}l.duration=v-w;var U=w-l.start;l.appendedPTS=v,l.start=l.startPTS=w,l.maxStartPTS=d,l.startDTS=i,l.endPTS=v,l.minEndPTS=b,l.endDTS=R;var P=l.sn;if(!o||P<o.startSN||P>o.endSN)return 0;var J,$=P-o.startSN,z=o.fragments;for(z[$]=l,J=$;J>0;J--)s(z[J],z[J-1]);for(J=$;J<z.length-1;J++)s(z[J],z[J+1]);return o.fragmentHint&&s(z[z.length-1],o.fragmentHint),o.PTSKnown=o.alignedSliding=!0,U}function r(o,l){for(var w=null,v=o.fragments,i=v.length-1;i>=0;i--){var R=v[i].initSegment;if(R){w=R;break}}o.fragmentHint&&delete o.fragmentHint.endPTS;var k=0,d;if(p(o,l,function(J,$){J.relurl&&(k=J.cc-$.cc),Object(L.isFiniteNumber)(J.startPTS)&&Object(L.isFiniteNumber)(J.endPTS)&&($.start=$.startPTS=J.startPTS,$.startDTS=J.startDTS,$.appendedPTS=J.appendedPTS,$.maxStartPTS=J.maxStartPTS,$.endPTS=J.endPTS,$.endDTS=J.endDTS,$.minEndPTS=J.minEndPTS,$.duration=J.endPTS-J.startPTS,$.duration&&(d=$),l.PTSKnown=l.alignedSliding=!0),$.elementaryStreams=J.elementaryStreams,$.loader=J.loader,$.stats=J.stats,$.urlId=J.urlId,J.initSegment&&($.initSegment=J.initSegment,w=J.initSegment)}),w){var b=l.fragmentHint?l.fragments.concat(l.fragmentHint):l.fragments;b.forEach(function(J){var $;(!J.initSegment||J.initSegment.relurl===(($=w)===null||$===void 0?void 0:$.relurl))&&(J.initSegment=w)})}if(l.skippedSegments&&(l.deltaUpdateFailed=l.fragments.some(function(J){return!J}),l.deltaUpdateFailed)){T.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var x=l.skippedSegments;x--;)l.fragments.shift();l.startSN=l.fragments[0].sn,l.startCC=l.fragments[0].cc}var _=l.fragments;if(k){T.logger.warn("discontinuity sliding from playlist, take drift into account");for(var B=0;B<_.length;B++)_[B].cc+=k}l.skippedSegments&&(l.startCC=l.fragments[0].cc),f(o.partList,l.partList,function(J,$){$.elementaryStreams=J.elementaryStreams,$.stats=J.stats}),d?a(l,d,d.startPTS,d.endPTS,d.startDTS,d.endDTS):m(o,l),_.length&&(l.totalduration=l.edge-_[0].start),l.driftStartTime=o.driftStartTime,l.driftStart=o.driftStart;var U=l.advancedDateTime;if(l.advanced&&U){var P=l.edge;l.driftStart||(l.driftStartTime=U,l.driftStart=P),l.driftEndTime=U,l.driftEnd=P}else l.driftEndTime=o.driftEndTime,l.driftEnd=o.driftEnd,l.advancedDateTime=o.advancedDateTime}function f(o,l,w){if(o&&l)for(var v=0,i=0,R=o.length;i<=R;i++){var k=o[i],d=l[i+v];k&&d&&k.index===d.index&&k.fragment.sn===d.fragment.sn?w(k,d):v--}}function p(o,l,w){for(var v=l.skippedSegments,i=Math.max(o.startSN,l.startSN)-l.startSN,R=(o.fragmentHint?1:0)+(v?l.endSN:Math.min(o.endSN,l.endSN))-l.startSN,k=l.startSN-o.startSN,d=l.fragmentHint?l.fragments.concat(l.fragmentHint):l.fragments,b=o.fragmentHint?o.fragments.concat(o.fragmentHint):o.fragments,x=i;x<=R;x++){var _=b[k+x],B=d[x];v&&!B&&x<v&&(B=l.fragments[x]=_),_&&B&&w(_,B)}}function m(o,l){var w=l.startSN+l.skippedSegments-o.startSN,v=o.fragments;if(w<0||w>=v.length)return;E(l,v[w].start)}function E(o,l){if(l){for(var w=o.fragments,v=o.skippedSegments;v<w.length;v++)w[v].start+=l;o.fragmentHint&&(o.fragmentHint.start+=l)}}function y(o,l){var w=1e3*o.levelTargetDuration,v=w/2,i=o.age,R=i>0&&i<w*3,k=l.loading.end-l.loading.start,d,b=o.availabilityDelay;if(o.updated===!1)if(R){var x=333*o.misses;d=Math.max(Math.min(v,k*2),x),o.availabilityDelay=(o.availabilityDelay||0)+d}else d=v;else R?(b=Math.min(b||w/2,i),o.availabilityDelay=b,d=b+w-i):d=w-k;return Math.round(d)}function u(o,l,w){if(!o||!o.details)return null;var v=o.details,i=v.fragments[l-v.startSN];return i||(i=v.fragmentHint,i&&i.sn===l?i:l<v.startSN&&w&&w.sn===l?w:null)}function n(o,l,w){if(!o||!o.details)return null;var v=o.details.partList;if(v)for(var i=v.length;i--;){var R=v[i];if(R.index===w&&R.fragment.sn===l)return R}return null}},"./src/controller/stream-controller.ts":function(I,h,S){"use strict";S.r(h),S.d(h,"default",function(){return v});var L=S("./src/polyfills/number.ts"),T=S("./src/controller/base-stream-controller.ts"),c=S("./src/is-supported.ts"),C=S("./src/events.ts"),g=S("./src/utils/buffer-helper.ts"),s=S("./src/controller/fragment-tracker.ts"),a=S("./src/types/loader.ts"),r=S("./src/loader/fragment.ts"),f=S("./src/demux/transmuxer-interface.ts"),p=S("./src/types/transmuxer.ts"),m=S("./src/controller/gap-controller.ts"),E=S("./src/errors.ts"),y=S("./src/utils/logger.ts");function u(i,R){for(var k=0;k<R.length;k++){var d=R[k];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(i,d.key,d)}}function n(i,R,k){return R&&u(i.prototype,R),k&&u(i,k),i}function o(i,R){i.prototype=Object.create(R.prototype),i.prototype.constructor=i,l(i,R)}function l(i,R){return l=Object.setPrototypeOf||function(d,b){return d.__proto__=b,d},l(i,R)}var w=100,v=function(i){o(R,i);function R(d,b){var x;return x=i.call(this,d,b,"[stream-controller]")||this,x.audioCodecSwap=!1,x.gapController=null,x.level=-1,x._forceStartLoad=!1,x.altAudio=!1,x.audioOnly=!1,x.fragPlaying=null,x.onvplaying=null,x.onvseeked=null,x.fragLastKbps=0,x.stalled=!1,x.couldBacktrack=!1,x.audioCodecSwitch=!1,x.videoBuffer=null,x._registerListeners(),x}var k=R.prototype;return k._registerListeners=function(){var b=this.hls;b.on(C.Events.MEDIA_ATTACHED,this.onMediaAttached,this),b.on(C.Events.MEDIA_DETACHING,this.onMediaDetaching,this),b.on(C.Events.MANIFEST_LOADING,this.onManifestLoading,this),b.on(C.Events.MANIFEST_PARSED,this.onManifestParsed,this),b.on(C.Events.LEVEL_LOADING,this.onLevelLoading,this),b.on(C.Events.LEVEL_LOADED,this.onLevelLoaded,this),b.on(C.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),b.on(C.Events.ERROR,this.onError,this),b.on(C.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),b.on(C.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),b.on(C.Events.BUFFER_CREATED,this.onBufferCreated,this),b.on(C.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),b.on(C.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),b.on(C.Events.FRAG_BUFFERED,this.onFragBuffered,this)},k._unregisterListeners=function(){var b=this.hls;b.off(C.Events.MEDIA_ATTACHED,this.onMediaAttached,this),b.off(C.Events.MEDIA_DETACHING,this.onMediaDetaching,this),b.off(C.Events.MANIFEST_LOADING,this.onManifestLoading,this),b.off(C.Events.MANIFEST_PARSED,this.onManifestParsed,this),b.off(C.Events.LEVEL_LOADED,this.onLevelLoaded,this),b.off(C.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),b.off(C.Events.ERROR,this.onError,this),b.off(C.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),b.off(C.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),b.off(C.Events.BUFFER_CREATED,this.onBufferCreated,this),b.off(C.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),b.off(C.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),b.off(C.Events.FRAG_BUFFERED,this.onFragBuffered,this)},k.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},k.startLoad=function(b){if(this.levels){var x=this.lastCurrentTime,_=this.hls;if(this.stopLoad(),this.setInterval(w),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var B=_.startLevel;B===-1&&(_.config.testBandwidth?(B=0,this.bitrateTest=!0):B=_.nextAutoLevel),this.level=_.nextLoadLevel=B,this.loadedmetadata=!1}x>0&&b===-1&&(this.log("Override startPosition with lastCurrentTime @"+x.toFixed(3)),b=x),this.state=T.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=b,this.tick()}else this._forceStartLoad=!0,this.state=T.State.STOPPED},k.stopLoad=function(){this._forceStartLoad=!1,i.prototype.stopLoad.call(this)},k.doTick=function(){switch(this.state){case T.State.IDLE:this.doTickIdle();break;case T.State.WAITING_LEVEL:{var b,x=this.levels,_=this.level,B=x==null||((b=x[_])===null||b===void 0)?void 0:b.details;if(B&&(!B.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(B))break;this.state=T.State.IDLE;break}break}case T.State.FRAG_LOADING_WAITING_RETRY:{var U,P=self.performance.now(),J=this.retryDate;(!J||P>=J||(U=this.media)!==null&&U!==void 0&&U.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=T.State.IDLE)}break;default:break}this.onTickEnd()},k.onTickEnd=function(){i.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},k.doTickIdle=function(){var b,x,_=this.hls,B=this.levelLastLoaded,U=this.levels,P=this.media,J=_.config,$=_.nextLoadLevel;if(B===null||!P&&(this.startFragRequested||!J.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!U||!U[$])return;var z=U[$];this.level=_.nextLoadLevel=$;var V=z.details;if(!V||this.state===T.State.WAITING_LEVEL||V.live&&this.levelLastLoaded!==$){this.state=T.State.WAITING_LEVEL;return}var K=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:P,a.PlaylistLevelType.MAIN);if(K===null)return;var H=K.len,G=this.getMaxBufferLength(z.maxBitrate);if(H>=G)return;if(this._streamEnded(K,V)){var ie={};this.altAudio&&(ie.type="video"),this.hls.trigger(C.Events.BUFFER_EOS,ie),this.state=T.State.ENDED;return}var le=K.end,ue=this.getNextFragment(le,V);if(this.couldBacktrack&&!this.fragPrevious&&ue&&ue.sn!=="initSegment"){var be=ue.sn-V.startSN;be>1&&(ue=V.fragments[be-1],this.fragmentTracker.removeFragment(ue))}if(ue&&this.fragmentTracker.getState(ue)===s.FragmentState.OK&&this.nextLoadPosition>le){var Ce=this.audioOnly&&!this.altAudio?r.ElementaryStreamTypes.AUDIO:r.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(P,Ce,a.PlaylistLevelType.MAIN),ue=this.getNextFragment(this.nextLoadPosition,V)}if(!ue)return;ue.initSegment&&!ue.initSegment.data&&!this.bitrateTest&&(ue=ue.initSegment),((b=ue.decryptdata)===null||b===void 0?void 0:b.keyFormat)==="identity"&&!((x=ue.decryptdata)!==null&&x!==void 0&&x.key)?this.loadKey(ue,V):this.loadFragment(ue,V,le)},k.loadFragment=function(b,x,_){var B,U=this.fragmentTracker.getState(b);if(this.fragCurrent=b,U===s.FragmentState.BACKTRACKED){var P=this.fragmentTracker.getBacktrackData(b);if(P){this._handleFragmentLoadProgress(P),this._handleFragmentLoadComplete(P);return}else U=s.FragmentState.NOT_LOADED}U===s.FragmentState.NOT_LOADED||U===s.FragmentState.PARTIAL?b.sn==="initSegment"?this._loadInitSegment(b):this.bitrateTest?(b.bitrateTest=!0,this.log("Fragment "+b.sn+" of level "+b.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(b)):(this.startFragRequested=!0,i.prototype.loadFragment.call(this,b,x,_)):U===s.FragmentState.APPENDING?this.reduceMaxBufferLength(b.duration)&&this.fragmentTracker.removeFragment(b):((B=this.media)===null||B===void 0?void 0:B.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},k.getAppendedFrag=function(b){var x=this.fragmentTracker.getAppendedFrag(b,a.PlaylistLevelType.MAIN);return x&&"fragment"in x?x.fragment:x},k.getBufferedFrag=function(b){return this.fragmentTracker.getBufferedFrag(b,a.PlaylistLevelType.MAIN)},k.followingBufferedFrag=function(b){return b?this.getBufferedFrag(b.end+.5):null},k.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},k.nextLevelSwitch=function(){var b=this.levels,x=this.media;if(x!=null&&x.readyState){var _,B=this.getAppendedFrag(x.currentTime);if(B&&B.start>1&&this.flushMainBuffer(0,B.start-1),!x.paused&&b){var U=this.hls.nextLoadLevel,P=b[U],J=this.fragLastKbps;J&&this.fragCurrent?_=this.fragCurrent.duration*P.maxBitrate/(1e3*J)+1:_=0}else _=0;var $=this.getBufferedFrag(x.currentTime+_);if($){var z=this.followingBufferedFrag($);if(z){this.abortCurrentFrag();var V=z.maxStartPTS?z.maxStartPTS:z.start,K=z.duration,H=Math.max($.end,V+Math.min(Math.max(K-this.config.maxFragLookUpTolerance,K*.5),K*.75));this.flushMainBuffer(H,Number.POSITIVE_INFINITY)}}}},k.abortCurrentFrag=function(){var b=this.fragCurrent;this.fragCurrent=null,b!=null&&b.loader&&b.loader.abort(),this.state===T.State.KEY_LOADING&&(this.state=T.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},k.flushMainBuffer=function(b,x){i.prototype.flushMainBuffer.call(this,b,x,this.altAudio?"video":null)},k.onMediaAttached=function(b,x){i.prototype.onMediaAttached.call(this,b,x);var _=x.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),_.addEventListener("playing",this.onvplaying),_.addEventListener("seeked",this.onvseeked),this.gapController=new m.default(this.config,_,this.fragmentTracker,this.hls)},k.onMediaDetaching=function(){var b=this.media;b&&(b.removeEventListener("playing",this.onvplaying),b.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),i.prototype.onMediaDetaching.call(this)},k.onMediaPlaying=function(){this.tick()},k.onMediaSeeked=function(){var b=this.media,x=b?b.currentTime:null;Object(L.isFiniteNumber)(x)&&this.log("Media seeked to "+x.toFixed(3)),this.tick()},k.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(C.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},k.onManifestParsed=function(b,x){var _=!1,B=!1,U;x.levels.forEach(function(P){U=P.audioCodec,U&&(U.indexOf("mp4a.40.2")!==-1&&(_=!0),U.indexOf("mp4a.40.5")!==-1&&(B=!0))}),this.audioCodecSwitch=_&&B&&!Object(c.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=x.levels,this.startFragRequested=!1},k.onLevelLoading=function(b,x){var _=this.levels;if(!_||this.state!==T.State.IDLE)return;var B=_[x.level];(!B.details||B.details.live&&this.levelLastLoaded!==x.level||this.waitForCdnTuneIn(B.details))&&(this.state=T.State.WAITING_LEVEL)},k.onLevelLoaded=function(b,x){var _,B=this.levels,U=x.level,P=x.details,J=P.totalduration;if(!B){this.warn("Levels were reset while loading level "+U);return}this.log("Level "+U+" loaded ["+P.startSN+","+P.endSN+"], cc ["+P.startCC+", "+P.endCC+"] duration:"+J);var $=this.fragCurrent;$&&(this.state===T.State.FRAG_LOADING||this.state===T.State.FRAG_LOADING_WAITING_RETRY)&&($.level!==x.level&&$.loader&&(this.state=T.State.IDLE,$.loader.abort()));var z=B[U],V=0;if(P.live||(_=z.details)!==null&&_!==void 0&&_.live){if(P.fragments[0]||(P.deltaUpdateFailed=!0),P.deltaUpdateFailed)return;V=this.alignPlaylists(P,z.details)}if(z.details=P,this.levelLastLoaded=U,this.hls.trigger(C.Events.LEVEL_UPDATED,{details:P,level:U}),this.state===T.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(P))return;this.state=T.State.IDLE}this.startFragRequested?P.live&&this.synchronizeToLiveEdge(P):this.setStartPosition(P,V),this.tick()},k._handleFragmentLoadProgress=function(b){var x,_=b.frag,B=b.part,U=b.payload,P=this.levels;if(!P){this.warn("Levels were reset while fragment load was in progress. Fragment "+_.sn+" of level "+_.level+" will not be buffered");return}var J=P[_.level],$=J.details;if(!$){this.warn("Dropping fragment "+_.sn+" of level "+_.level+" after level details were reset");return}var z=J.videoCodec,V=$.PTSKnown||!$.live,K=(x=_.initSegment)===null||x===void 0?void 0:x.data,H=this._getAudioCodec(J),G=this.transmuxer=this.transmuxer||new f.default(this.hls,a.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),ie=B?B.index:-1,le=ie!==-1,ue=new p.ChunkMetadata(_.level,_.sn,_.stats.chunkCount,U.byteLength,ie,le),be=this.initPTS[_.cc];G.push(U,K,H,z,_,B,$.totalduration,V,ue,be)},k.onAudioTrackSwitching=function(b,x){var _=this.altAudio,B=!!x.url,U=x.id;if(!B){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var P=this.fragCurrent;P!=null&&P.loader&&(this.log("Switching to main audio track, cancel main fragment load"),P.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var J=this.hls;_&&J.trigger(C.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),J.trigger(C.Events.AUDIO_TRACK_SWITCHED,{id:U})}},k.onAudioTrackSwitched=function(b,x){var _=x.id,B=!!this.hls.audioTracks[_].url;if(B){var U=this.videoBuffer;U&&this.mediaBuffer!==U&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=U)}this.altAudio=B,this.tick()},k.onBufferCreated=function(b,x){var _=x.tracks,B,U,P=!1;for(var J in _){var $=_[J];if($.id==="main"){if(U=J,B=$,J==="video"){var z=_[J];z&&(this.videoBuffer=z.buffer)}}else P=!0}P&&B?(this.log("Alternate track found, use "+U+".buffered to schedule main fragment loading"),this.mediaBuffer=B.buffer):this.mediaBuffer=this.media},k.onFragBuffered=function(b,x){var _=x.frag,B=x.part;if(_&&_.type!==a.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(_)){this.warn("Fragment "+_.sn+(B?" p: "+B.index:"")+" of level "+_.level+" finished buffering, but was aborted. state: "+this.state),this.state===T.State.PARSED&&(this.state=T.State.IDLE);return}var U=B?B.stats:_.stats;this.fragLastKbps=Math.round(8*U.total/(U.buffering.end-U.loading.first)),_.sn!=="initSegment"&&(this.fragPrevious=_),this.fragBufferedComplete(_,B)},k.onError=function(b,x){switch(x.details){case E.ErrorDetails.FRAG_LOAD_ERROR:case E.ErrorDetails.FRAG_LOAD_TIMEOUT:case E.ErrorDetails.KEY_LOAD_ERROR:case E.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(a.PlaylistLevelType.MAIN,x);break;case E.ErrorDetails.LEVEL_LOAD_ERROR:case E.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==T.State.ERROR&&(x.fatal?(this.warn(""+x.details),this.state=T.State.ERROR):!x.levelRetry&&this.state===T.State.WAITING_LEVEL&&(this.state=T.State.IDLE));break;case E.ErrorDetails.BUFFER_FULL_ERROR:if(x.parent==="main"&&(this.state===T.State.PARSING||this.state===T.State.PARSED)){var _=!0,B=this.getFwdBufferInfo(this.media,a.PlaylistLevelType.MAIN);B&&B.len>.5&&(_=!this.reduceMaxBufferLength(B.len)),_&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},k.checkBuffer=function(){var b=this.media,x=this.gapController;if(!b||!x||!b.readyState)return;var _=g.BufferHelper.getBuffered(b);!this.loadedmetadata&&_.length?(this.loadedmetadata=!0,this.seekToStartPos()):x.poll(this.lastCurrentTime),this.lastCurrentTime=b.currentTime},k.onFragLoadEmergencyAborted=function(){this.state=T.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},k.onBufferFlushed=function(b,x){var _=x.type;if(_!==r.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var B=(_===r.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(B,_,a.PlaylistLevelType.MAIN)}},k.onLevelsUpdated=function(b,x){this.levels=x.levels},k.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},k.seekToStartPos=function(){var b=this.media,x=b.currentTime,_=this.startPosition;if(_>=0&&x<_){if(b.seeking){y.logger.log("could not seek to "+_+", already seeking at "+x);return}var B=g.BufferHelper.getBuffered(b),U=B.length?B.start(0):0,P=U-_;P>0&&(P<this.config.maxBufferHole||P<this.config.maxFragLookUpTolerance)&&(y.logger.log("adjusting start position by "+P+" to match buffer start"),_+=P,this.startPosition=_),this.log("seek to target start position "+_+" from current time "+x),b.currentTime=_}},k._getAudioCodec=function(b){var x=this.config.defaultAudioCodec||b.audioCodec;return this.audioCodecSwap&&x&&(this.log("Swapping audio codec"),x.indexOf("mp4a.40.5")!==-1?x="mp4a.40.2":x="mp4a.40.5"),x},k._loadBitrateTestFrag=function(b){var x=this;this._doFragLoad(b).then(function(_){var B=x.hls;if(!_||B.nextLoadLevel||x.fragContextChanged(b))return;x.fragLoadError=0,x.state=T.State.IDLE,x.startFragRequested=!1,x.bitrateTest=!1;var U=b.stats;U.parsing.start=U.parsing.end=U.buffering.start=U.buffering.end=self.performance.now(),B.trigger(C.Events.FRAG_LOADED,_)})},k._handleTransmuxComplete=function(b){var x,_="main",B=this.hls,U=b.remuxResult,P=b.chunkMeta,J=this.getCurrentContext(P);if(!J){this.warn("The loading context changed while buffering fragment "+P.sn+" of level "+P.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(P.level);return}var $=J.frag,z=J.part,V=J.level,K=U.video,H=U.text,G=U.id3,ie=U.initSegment,le=this.altAudio?void 0:U.audio;if(this.fragContextChanged($))return;if(this.state=T.State.PARSING,ie){ie.tracks&&(this._bufferInitSegment(V,ie.tracks,$,P),B.trigger(C.Events.FRAG_PARSING_INIT_SEGMENT,{frag:$,id:_,tracks:ie.tracks}));var ue=ie.initPTS,be=ie.timescale;Object(L.isFiniteNumber)(ue)&&(this.initPTS[$.cc]=ue,B.trigger(C.Events.INIT_PTS_FOUND,{frag:$,id:_,initPTS:ue,timescale:be}))}if(K&&U.independent!==!1){if(V.details){var Ce=K.startPTS,se=K.endPTS,ce=K.startDTS,he=K.endDTS;if(z)z.elementaryStreams[K.type]={startPTS:Ce,endPTS:se,startDTS:ce,endDTS:he};else if(K.firstKeyFrame&&K.independent&&(this.couldBacktrack=!0),K.dropped&&K.independent){var ae=this.getLoadPosition()+this.config.maxBufferHole;if(ae<Ce){this.backtrack($);return}$.setElementaryStreamInfo(K.type,$.start,se,$.start,he,!0)}$.setElementaryStreamInfo(K.type,Ce,se,ce,he),this.bufferFragmentData(K,$,z,P)}}else if(U.independent===!1){this.backtrack($);return}if(le){var Q=le.startPTS,D=le.endPTS,F=le.startDTS,W=le.endDTS;z&&(z.elementaryStreams[r.ElementaryStreamTypes.AUDIO]={startPTS:Q,endPTS:D,startDTS:F,endDTS:W}),$.setElementaryStreamInfo(r.ElementaryStreamTypes.AUDIO,Q,D,F,W),this.bufferFragmentData(le,$,z,P)}if(G!=null&&(x=G.samples)!==null&&x!==void 0&&x.length){var Y={frag:$,id:_,samples:G.samples};B.trigger(C.Events.FRAG_PARSING_METADATA,Y)}if(H){var Z={frag:$,id:_,samples:H.samples};B.trigger(C.Events.FRAG_PARSING_USERDATA,Z)}},k._bufferInitSegment=function(b,x,_,B){var U=this;if(this.state!==T.State.PARSING)return;this.audioOnly=!!x.audio&&!x.video,this.altAudio&&!this.audioOnly&&delete x.audio;var P=x.audio,J=x.video,$=x.audiovideo;if(P){var z=b.audioCodec,V=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(z&&(z.indexOf("mp4a.40.5")!==-1?z="mp4a.40.2":z="mp4a.40.5"),P.metadata.channelCount!==1&&V.indexOf("firefox")===-1&&(z="mp4a.40.5")),V.indexOf("android")!==-1&&P.container!=="audio/mpeg"&&(z="mp4a.40.2",this.log("Android: force audio codec to "+z)),b.audioCodec&&b.audioCodec!==z&&this.log('Swapping manifest audio codec "'+b.audioCodec+'" for "'+z+'"'),P.levelCodec=z,P.id="main",this.log("Init audio buffer, container:"+P.container+", codecs[selected/level/parsed]=["+(z||"")+"/"+(b.audioCodec||"")+"/"+P.codec+"]")}J&&(J.levelCodec=b.videoCodec,J.id="main",this.log("Init video buffer, container:"+J.container+", codecs[level/parsed]=["+(b.videoCodec||"")+"/"+J.codec+"]")),$&&this.log("Init audiovideo buffer, container:"+$.container+", codecs[level/parsed]=["+(b.attrs.CODECS||"")+"/"+$.codec+"]"),this.hls.trigger(C.Events.BUFFER_CODECS,x),Object.keys(x).forEach(function(K){var H=x[K],G=H.initSegment;G!=null&&G.byteLength&&U.hls.trigger(C.Events.BUFFER_APPENDING,{type:K,data:G,frag:_,part:null,chunkMeta:B,parent:_.type})}),this.tick()},k.backtrack=function(b){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(b);var x=this.fragmentTracker.backtrack(b);this.fragPrevious=null,this.nextLoadPosition=b.start,x?this.resetFragmentLoading(b):this.state=T.State.BACKTRACKING},k.checkFragmentChanged=function(){var b=this.media,x=null;if(b&&b.readyState>1&&b.seeking===!1){var _=b.currentTime;if(g.BufferHelper.isBuffered(b,_)?x=this.getAppendedFrag(_):g.BufferHelper.isBuffered(b,_+.1)&&(x=this.getAppendedFrag(_+.1)),x){var B=this.fragPlaying,U=x.level;(!B||x.sn!==B.sn||B.level!==U||x.urlId!==B.urlId)&&(this.hls.trigger(C.Events.FRAG_CHANGED,{frag:x}),(!B||B.level!==U)&&this.hls.trigger(C.Events.LEVEL_SWITCHED,{level:U}),this.fragPlaying=x)}}},n(R,[{key:"nextLevel",get:function(){var b=this.nextBufferedFrag;return b?b.level:-1}},{key:"currentLevel",get:function(){var b=this.media;if(b){var x=this.getAppendedFrag(b.currentTime);if(x)return x.level}return-1}},{key:"nextBufferedFrag",get:function(){var b=this.media;if(b){var x=this.getAppendedFrag(b.currentTime);return this.followingBufferedFrag(x)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),R}(T.default)},"./src/controller/subtitle-stream-controller.ts":function(I,h,S){"use strict";S.r(h),S.d(h,"SubtitleStreamController",function(){return o});var L=S("./src/events.ts"),T=S("./src/utils/logger.ts"),c=S("./src/utils/buffer-helper.ts"),C=S("./src/controller/fragment-finders.ts"),g=S("./src/utils/discontinuities.ts"),s=S("./src/controller/level-helper.ts"),a=S("./src/controller/fragment-tracker.ts"),r=S("./src/controller/base-stream-controller.ts"),f=S("./src/types/loader.ts"),p=S("./src/types/level.ts");function m(l,w){for(var v=0;v<w.length;v++){var i=w[v];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(l,i.key,i)}}function E(l,w,v){return w&&m(l.prototype,w),v&&m(l,v),l}function y(l,w){l.prototype=Object.create(w.prototype),l.prototype.constructor=l,u(l,w)}function u(l,w){return u=Object.setPrototypeOf||function(i,R){return i.__proto__=R,i},u(l,w)}var n=500,o=function(l){y(w,l);function w(i,R){var k;return k=l.call(this,i,R,"[subtitle-stream-controller]")||this,k.levels=[],k.currentTrackId=-1,k.tracksBuffered=[],k.mainDetails=null,k._registerListeners(),k}var v=w.prototype;return v.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},v._registerListeners=function(){var R=this.hls;R.on(L.Events.MEDIA_ATTACHED,this.onMediaAttached,this),R.on(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),R.on(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),R.on(L.Events.LEVEL_LOADED,this.onLevelLoaded,this),R.on(L.Events.ERROR,this.onError,this),R.on(L.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),R.on(L.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),R.on(L.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),R.on(L.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),R.on(L.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},v._unregisterListeners=function(){var R=this.hls;R.off(L.Events.MEDIA_ATTACHED,this.onMediaAttached,this),R.off(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),R.off(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),R.off(L.Events.LEVEL_LOADED,this.onLevelLoaded,this),R.off(L.Events.ERROR,this.onError,this),R.off(L.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),R.off(L.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),R.off(L.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),R.off(L.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),R.off(L.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},v.startLoad=function(){this.stopLoad(),this.state=r.State.IDLE,this.setInterval(n),this.tick()},v.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},v.onLevelLoaded=function(R,k){this.mainDetails=k.details},v.onSubtitleFragProcessed=function(R,k){var d=k.frag,b=k.success;if(this.fragPrevious=d,this.state=r.State.IDLE,!b)return;var x=this.tracksBuffered[this.currentTrackId];if(!x)return;for(var _,B=d.start,U=0;U<x.length;U++)if(B>=x[U].start&&B<=x[U].end){_=x[U];break}var P=d.start+d.duration;_?_.end=P:(_={start:B,end:P},x.push(_)),this.fragmentTracker.fragBuffered(d)},v.onBufferFlushing=function(R,k){var d=k.startOffset,b=k.endOffset;if(d===0&&b!==Number.POSITIVE_INFINITY){var x=this.currentTrackId,_=this.levels;if(!_.length||!_[x]||!_[x].details)return;var B=_[x].details,U=B.targetduration,P=b-U;if(P<=0)return;k.endOffsetSubtitles=Math.max(0,P),this.tracksBuffered.forEach(function(J){for(var $=0;$<J.length;){if(J[$].end<=P){J.shift();continue}else if(J[$].start<P)J[$].start=P;else break;$++}}),this.fragmentTracker.removeFragmentsInRange(d,P,f.PlaylistLevelType.SUBTITLE)}},v.onError=function(R,k){var d,b=k.frag;if(!b||b.type!==f.PlaylistLevelType.SUBTITLE)return;(d=this.fragCurrent)!==null&&d!==void 0&&d.loader&&this.fragCurrent.loader.abort(),this.state=r.State.IDLE},v.onSubtitleTracksUpdated=function(R,k){var d=this,b=k.subtitleTracks;this.tracksBuffered=[],this.levels=b.map(function(x){return new p.Level(x)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(x){d.tracksBuffered[x.id]=[]}),this.mediaBuffer=null},v.onSubtitleTrackSwitch=function(R,k){if(this.currentTrackId=k.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var d=this.levels[this.currentTrackId];d!=null&&d.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,d&&this.setInterval(n)},v.onSubtitleTrackLoaded=function(R,k){var d,b=k.details,x=k.id,_=this.currentTrackId,B=this.levels;if(!B.length)return;var U=B[_];if(x>=B.length||x!==_||!U)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,b.live||(d=U.details)!==null&&d!==void 0&&d.live){var P=this.mainDetails;if(b.deltaUpdateFailed||!P)return;var J=P.fragments[0];if(!U.details)b.hasProgramDateTime&&P.hasProgramDateTime?Object(g.alignMediaPlaylistByPDT)(b,P):J&&Object(s.addSliding)(b,J.start);else{var $=this.alignPlaylists(b,U.details);$===0&&J&&Object(s.addSliding)(b,J.start)}}if(U.details=b,this.levelLastLoaded=x,this.tick(),b.live&&!this.fragCurrent&&this.media&&this.state===r.State.IDLE){var z=Object(C.findFragmentByPTS)(null,b.fragments,this.media.currentTime,0);z||(this.warn("Subtitle playlist not aligned with playback"),U.details=void 0)}},v._handleFragmentLoadComplete=function(R){var k=R.frag,d=R.payload,b=k.decryptdata,x=this.hls;if(this.fragContextChanged(k))return;if(d&&d.byteLength>0&&b&&b.key&&b.iv&&b.method==="AES-128"){var _=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(d),b.key.buffer,b.iv.buffer).then(function(B){var U=performance.now();x.trigger(L.Events.FRAG_DECRYPTED,{frag:k,payload:B,stats:{tstart:_,tdecrypt:U}})})}},v.doTick=function(){if(!this.media){this.state=r.State.IDLE;return}if(this.state===r.State.IDLE){var R,k=this.currentTrackId,d=this.levels;if(!d.length||!d[k]||!d[k].details)return;var b=d[k].details,x=b.targetduration,_=this.config,B=this.media,U=c.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,B.currentTime-x,_.maxBufferHole),P=U.end,J=U.len,$=this.getMaxBufferLength()+x;if(J>$)return;console.assert(b,"Subtitle track details are defined on idle subtitle stream controller tick");var z=b.fragments,V=z.length,K=b.edge,H,G=this.fragPrevious;if(P<K){var ie=_.maxFragLookUpTolerance;G&&b.hasProgramDateTime&&(H=Object(C.findFragmentByPDT)(z,G.endProgramDateTime,ie)),H||(H=Object(C.findFragmentByPTS)(G,z,P,ie),!H&&G&&G.start<z[0].start&&(H=z[0]))}else H=z[V-1];(R=H)!==null&&R!==void 0&&R.encrypted?(T.logger.log("Loading key for "+H.sn),this.state=r.State.KEY_LOADING,this.hls.trigger(L.Events.KEY_LOADING,{frag:H})):H&&this.fragmentTracker.getState(H)===a.FragmentState.NOT_LOADED&&this.loadFragment(H,b,P)}},v.loadFragment=function(R,k,d){this.fragCurrent=R,l.prototype.loadFragment.call(this,R,k,d)},E(w,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),w}(r.default)},"./src/controller/subtitle-track-controller.ts":function(I,h,S){"use strict";S.r(h);var L=S("./src/events.ts"),T=S("./src/utils/texttrack-utils.ts"),c=S("./src/controller/base-playlist-controller.ts"),C=S("./src/types/loader.ts");function g(m,E){for(var y=0;y<E.length;y++){var u=E[y];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(m,u.key,u)}}function s(m,E,y){return E&&g(m.prototype,E),y&&g(m,y),m}function a(m,E){m.prototype=Object.create(E.prototype),m.prototype.constructor=m,r(m,E)}function r(m,E){return r=Object.setPrototypeOf||function(u,n){return u.__proto__=n,u},r(m,E)}var f=function(m){a(E,m);function E(u){var n;return n=m.call(this,u,"[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 y=E.prototype;return y.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,m.prototype.destroy.call(this)},y.registerListeners=function(){var n=this.hls;n.on(L.Events.MEDIA_ATTACHED,this.onMediaAttached,this),n.on(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.on(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.on(L.Events.MANIFEST_PARSED,this.onManifestParsed,this),n.on(L.Events.LEVEL_LOADING,this.onLevelLoading,this),n.on(L.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),n.on(L.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),n.on(L.Events.ERROR,this.onError,this)},y.unregisterListeners=function(){var n=this.hls;n.off(L.Events.MEDIA_ATTACHED,this.onMediaAttached,this),n.off(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.off(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.off(L.Events.MANIFEST_PARSED,this.onManifestParsed,this),n.off(L.Events.LEVEL_LOADING,this.onLevelLoading,this),n.off(L.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),n.off(L.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),n.off(L.Events.ERROR,this.onError,this)},y.onMediaAttached=function(n,o){if(this.media=o.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)},y.pollTrackChange=function(n){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,n)},y.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=p(this.media.textTracks);n.forEach(function(o){Object(T.clearCurrentCues)(o)}),this.subtitleTrack=-1,this.media=null},y.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},y.onManifestParsed=function(n,o){this.tracks=o.subtitleTracks},y.onSubtitleTrackLoaded=function(n,o){var l=o.id,w=o.details,v=this.trackId,i=this.tracksInGroup[v];if(!i){this.warn("Invalid subtitle track id "+l);return}var R=i.details;i.details=o.details,this.log("subtitle track "+l+" loaded ["+w.startSN+"-"+w.endSN+"]"),l===this.trackId&&(this.retryCount=0,this.playlistLoaded(l,o,R))},y.onLevelLoading=function(n,o){this.switchLevel(o.level)},y.onLevelSwitching=function(n,o){this.switchLevel(o.level)},y.switchLevel=function(n){var o=this.hls.levels[n];if(!(o!=null&&o.textGroupIds))return;var l=o.textGroupIds[o.urlId];if(this.groupId!==l){var w=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,v=this.tracks.filter(function(k){return!l||k.groupId===l});this.tracksInGroup=v;var i=this.findTrackId(w==null?void 0:w.name)||this.findTrackId();this.groupId=l;var R={subtitleTracks:v};this.log("Updating subtitle tracks, "+v.length+' track(s) found in "'+l+'" group-id'),this.hls.trigger(L.Events.SUBTITLE_TRACKS_UPDATED,R),i!==-1&&this.setSubtitleTrack(i,w)}},y.findTrackId=function(n){for(var o=this.tracksInGroup,l=0;l<o.length;l++){var w=o[l];if((!this.selectDefaultTrack||w.default)&&(!n||n===w.name))return w.id}return-1},y.onError=function(n,o){if(m.prototype.onError.call(this,n,o),o.fatal||!o.context)return;o.context.type===C.PlaylistContextType.SUBTITLE_TRACK&&o.context.id===this.trackId&&o.context.groupId===this.groupId&&this.retryLoadingOrFail(o)},y.loadPlaylist=function(n){var o=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(o)){var l=o.id,w=o.groupId,v=o.url;if(n)try{v=n.addDirectives(v)}catch(i){this.warn("Could not construct new URL with HLS Delivery Directives: "+i)}this.log("Loading subtitle playlist for id "+l),this.hls.trigger(L.Events.SUBTITLE_TRACK_LOADING,{url:v,id:l,groupId:w,deliveryDirectives:n||null})}},y.toggleTrackModes=function(n){var o=this,l=this.media,w=this.subtitleDisplay,v=this.trackId;if(!l)return;var i=p(l.textTracks),R=i.filter(function(b){return b.groupId===o.groupId});if(n===-1)[].slice.call(i).forEach(function(b){b.mode="disabled"});else{var k=R[v];k&&(k.mode="disabled")}var d=R[n];d&&(d.mode=w?"showing":"hidden")},y.setSubtitleTrack=function(n,o){var l,w=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=n;return}if(this.trackId!==n&&this.toggleTrackModes(n),this.trackId===n&&(n===-1||(l=w[n])!==null&&l!==void 0&&l.details)||n<-1||n>=w.length)return;this.clearTimer();var v=w[n];if(this.log("Switching to subtitle track "+n),this.trackId=n,v){var i=v.id,R=v.groupId,k=R===void 0?"":R,d=v.name,b=v.type,x=v.url;this.hls.trigger(L.Events.SUBTITLE_TRACK_SWITCH,{id:i,groupId:k,name:d,type:b,url:x});var _=this.switchParams(v.url,o==null?void 0:o.details);this.loadPlaylist(_)}else this.hls.trigger(L.Events.SUBTITLE_TRACK_SWITCH,{id:n})},y.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var n=-1,o=p(this.media.textTracks),l=0;l<o.length;l++)if(o[l].mode==="hidden")n=l;else if(o[l].mode==="showing"){n=l;break}this.subtitleTrack!==n&&(this.subtitleTrack=n)},s(E,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(n){this.selectDefaultTrack=!1;var o=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(n,o)}}]),E}(c.default);function p(m){for(var E=[],y=0;y<m.length;y++){var u=m[y];u.kind==="subtitles"&&u.label&&E.push(m[y])}return E}h.default=f},"./src/controller/timeline-controller.ts":function(I,h,S){"use strict";S.r(h),S.d(h,"TimelineController",function(){return p});var L=S("./src/polyfills/number.ts"),T=S("./src/events.ts"),c=S("./src/utils/cea-608-parser.ts"),C=S("./src/utils/output-filter.ts"),g=S("./src/utils/webvtt-parser.ts"),s=S("./src/utils/texttrack-utils.ts"),a=S("./src/utils/imsc1-ttml-parser.ts"),r=S("./src/types/loader.ts"),f=S("./src/utils/logger.ts"),p=function(){function u(o){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=y(),this.captionsProperties=void 0,this.hls=o,this.config=o.config,this.Cues=o.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 l=new C.default(this,"textTrack1"),w=new C.default(this,"textTrack2"),v=new C.default(this,"textTrack3"),i=new C.default(this,"textTrack4");this.cea608Parser1=new c.default(1,l,w),this.cea608Parser2=new c.default(3,v,i)}o.on(T.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),o.on(T.Events.MEDIA_DETACHING,this.onMediaDetaching,this),o.on(T.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.on(T.Events.MANIFEST_LOADED,this.onManifestLoaded,this),o.on(T.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),o.on(T.Events.FRAG_LOADING,this.onFragLoading,this),o.on(T.Events.FRAG_LOADED,this.onFragLoaded,this),o.on(T.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),o.on(T.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),o.on(T.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),o.on(T.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),o.on(T.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var n=u.prototype;return n.destroy=function(){var l=this.hls;l.off(T.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),l.off(T.Events.MEDIA_DETACHING,this.onMediaDetaching,this),l.off(T.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.off(T.Events.MANIFEST_LOADED,this.onManifestLoaded,this),l.off(T.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),l.off(T.Events.FRAG_LOADING,this.onFragLoading,this),l.off(T.Events.FRAG_LOADED,this.onFragLoaded,this),l.off(T.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),l.off(T.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),l.off(T.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),l.off(T.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),l.off(T.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},n.addCues=function(l,w,v,i,R){for(var k=!1,d=R.length;d--;){var b=R[d],x=E(b[0],b[1],w,v);if(x>=0&&(b[0]=Math.min(b[0],w),b[1]=Math.max(b[1],v),k=!0,x/(v-w)>.5))return}if(k||R.push([w,v]),this.config.renderTextTracksNatively){var _=this.captionsTracks[l];this.Cues.newCue(_,w,v,i)}else{var B=this.Cues.newCue(null,w,v,i);this.hls.trigger(T.Events.CUES_PARSED,{type:"captions",cues:B,track:l})}},n.onInitPtsFound=function(l,w){var v=this,i=w.frag,R=w.id,k=w.initPTS,d=w.timescale,b=this.unparsedVttFrags;R==="main"&&(this.initPTS[i.cc]=k,this.timescale[i.cc]=d),b.length&&(this.unparsedVttFrags=[],b.forEach(function(x){v.onFragLoaded(T.Events.FRAG_LOADED,x)}))},n.getExistingTrack=function(l){var w=this.media;if(w)for(var v=0;v<w.textTracks.length;v++){var i=w.textTracks[v];if(i[l])return i}return null},n.createCaptionsTrack=function(l){this.config.renderTextTracksNatively?this.createNativeTrack(l):this.createNonNativeTrack(l)},n.createNativeTrack=function(l){if(this.captionsTracks[l])return;var w=this.captionsProperties,v=this.captionsTracks,i=this.media,R=w[l],k=R.label,d=R.languageCode,b=this.getExistingTrack(l);if(b)v[l]=b,Object(s.clearCurrentCues)(v[l]),Object(s.sendAddTrackEvent)(v[l],i);else{var x=this.createTextTrack("captions",k,d);x&&(x[l]=!0,v[l]=x)}},n.createNonNativeTrack=function(l){if(this.nonNativeCaptionsTracks[l])return;var w=this.captionsProperties[l];if(!w)return;var v=w.label,i={_id:l,label:v,kind:"captions",default:w.media?!!w.media.default:!1,closedCaptions:w.media};this.nonNativeCaptionsTracks[l]=i,this.hls.trigger(T.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[i]})},n.createTextTrack=function(l,w,v){var i=this.media;return i?i.addTextTrack(l,w,v):void 0},n.onMediaAttaching=function(l,w){this.media=w.media,this._cleanTracks()},n.onMediaDetaching=function(){var l=this.captionsTracks;Object.keys(l).forEach(function(w){Object(s.clearCurrentCues)(l[w]),delete l[w]}),this.nonNativeCaptionsTracks={}},n.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=y(),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 l=this.media;if(!l)return;var w=l.textTracks;if(w)for(var v=0;v<w.length;v++)Object(s.clearCurrentCues)(w[v])},n.onSubtitleTracksUpdated=function(l,w){var v=this;this.textTracks=[];var i=w.subtitleTracks||[],R=i.some(function(x){return x.textCodec===a.IMSC1_CODEC});if(this.config.enableWebVTT||R&&this.config.enableIMSC1){var k=this.tracks&&i&&this.tracks.length===i.length;if(this.tracks=i||[],this.config.renderTextTracksNatively){var d=this.media?this.media.textTracks:[];this.tracks.forEach(function(x,_){var B;if(_<d.length){for(var U=null,P=0;P<d.length;P++)if(m(d[P],x)){U=d[P];break}U&&(B=U)}B?Object(s.clearCurrentCues)(B):(B=v.createTextTrack("subtitles",x.name,x.lang),B&&(B.mode="disabled")),B&&(B.groupId=x.groupId,v.textTracks.push(B))})}else if(!k&&this.tracks&&this.tracks.length){var b=this.tracks.map(function(x){return{label:x.name,kind:x.type.toLowerCase(),default:x.default,subtitleTrack:x}});this.hls.trigger(T.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:b})}}},n.onManifestLoaded=function(l,w){var v=this;this.config.enableCEA708Captions&&w.captions&&w.captions.forEach(function(i){var R=/(?:CC|SERVICE)([1-4])/.exec(i.instreamId);if(!R)return;var k="textTrack"+R[1],d=v.captionsProperties[k];if(!d)return;d.label=i.name,i.lang&&(d.languageCode=i.lang),d.media=i})},n.onFragLoading=function(l,w){var v=this.cea608Parser1,i=this.cea608Parser2,R=this.lastSn,k=this.lastPartIndex;if(!this.enabled||!(v&&i))return;if(w.frag.type===r.PlaylistLevelType.MAIN){var d,b,x=w.frag.sn,_=(d=w==null||((b=w.part)===null||b===void 0)?void 0:b.index)!=null?d:-1;x===R+1||x===R&&_===k+1||(v.reset(),i.reset()),this.lastSn=x,this.lastPartIndex=_}},n.onFragLoaded=function(l,w){var v=w.frag,i=w.payload,R=this.initPTS,k=this.unparsedVttFrags;if(v.type===r.PlaylistLevelType.SUBTITLE)if(i.byteLength){if(!Object(L.isFiniteNumber)(R[v.cc])){k.push(w),R.length&&this.hls.trigger(T.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:v,error:new Error("Missing initial subtitle PTS")});return}var d=v.decryptdata;if(d==null||d.key==null||d.method!=="AES-128"){var b=this.tracks[v.level],x=this.vttCCs;x[v.cc]||(x[v.cc]={start:v.start,prevCC:this.prevCC,new:!0},this.prevCC=v.cc),b&&b.textCodec===a.IMSC1_CODEC?this._parseIMSC1(v,i):this._parseVTTs(v,i,x)}}else this.hls.trigger(T.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:v,error:new Error("Empty subtitle payload")})},n._parseIMSC1=function(l,w){var v=this,i=this.hls;Object(a.parseIMSC1)(w,this.initPTS[l.cc],this.timescale[l.cc],function(R){v._appendCues(R,l.level),i.trigger(T.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:l})},function(R){f.logger.log("Failed to parse IMSC1: "+R),i.trigger(T.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:l,error:R})})},n._parseVTTs=function(l,w,v){var i=this,R=this.hls;Object(g.parseWebVTT)(w,this.initPTS[l.cc],this.timescale[l.cc],v,l.cc,l.start,function(k){i._appendCues(k,l.level),R.trigger(T.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:l})},function(k){i._fallbackToIMSC1(l,w),f.logger.log("Failed to parse VTT cue: "+k),R.trigger(T.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:l,error:k})})},n._fallbackToIMSC1=function(l,w){var v=this,i=this.tracks[l.level];i.textCodec||Object(a.parseIMSC1)(w,this.initPTS[l.cc],this.timescale[l.cc],function(){i.textCodec=a.IMSC1_CODEC,v._parseIMSC1(l,w)},function(){i.textCodec="wvtt"})},n._appendCues=function(l,w){var v=this.hls;if(this.config.renderTextTracksNatively){var i=this.textTracks[w];if(i.mode==="disabled")return;l.forEach(function(d){return Object(s.addCueToTrack)(i,d)})}else{var R=this.tracks[w],k=R.default?"default":"subtitles"+w;v.trigger(T.Events.CUES_PARSED,{type:"subtitles",cues:l,track:k})}},n.onFragDecrypted=function(l,w){var v=w.frag;if(v.type===r.PlaylistLevelType.SUBTITLE){if(!Object(L.isFiniteNumber)(this.initPTS[v.cc])){this.unparsedVttFrags.push(w);return}this.onFragLoaded(T.Events.FRAG_LOADED,w)}},n.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},n.onFragParsingUserdata=function(l,w){var v=this.cea608Parser1,i=this.cea608Parser2;if(!this.enabled||!(v&&i))return;for(var R=0;R<w.samples.length;R++){var k=w.samples[R].bytes;if(k){var d=this.extractCea608Data(k);v.addData(w.samples[R].pts,d[0]),i.addData(w.samples[R].pts,d[1])}}},n.onBufferFlushing=function(l,w){var v=w.startOffset,i=w.endOffset,R=w.endOffsetSubtitles,k=w.type,d=this.media;if(!d||d.currentTime<i)return;if(!k||k==="video"){var b=this.captionsTracks;Object.keys(b).forEach(function(_){return Object(s.removeCuesInRange)(b[_],v,i)})}if(this.config.renderTextTracksNatively&&(v===0&&R!==void 0)){var x=this.textTracks;Object.keys(x).forEach(function(_){return Object(s.removeCuesInRange)(x[_],v,R)})}},n.extractCea608Data=function(l){for(var w=l[0]&31,v=2,i=[[],[]],R=0;R<w;R++){var k=l[v++],d=127&l[v++],b=127&l[v++],x=(4&k)!==0,_=3&k;if(d===0&&b===0)continue;x&&((_===0||_===1)&&(i[_].push(d),i[_].push(b)))}return i},u}();function m(u,n){return u&&u.label===n.name&&!(u.textTrack1||u.textTrack2)}function E(u,n,o,l){return Math.min(n,l)-Math.max(u,o)}function y(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(I,h,S){"use strict";S.r(h),S.d(h,"default",function(){return L});var L=function(){function T(C,g){this.subtle=void 0,this.aesIV=void 0,this.subtle=C,this.aesIV=g}var c=T.prototype;return c.decrypt=function(g,s){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},s,g)},T}()},"./src/crypt/aes-decryptor.ts":function(I,h,S){"use strict";S.r(h),S.d(h,"removePadding",function(){return T}),S.d(h,"default",function(){return c});var L=S("./src/utils/typed-array.ts");function T(C){var g=C.byteLength,s=g&&new DataView(C.buffer).getUint8(g-1);return s?Object(L.sliceUint8)(C,0,g-s):C}var c=function(){function C(){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 g=C.prototype;return g.uint8ArrayToUint32Array_=function(a){for(var r=new DataView(a),f=new Uint32Array(4),p=0;p<4;p++)f[p]=r.getUint32(p*4);return f},g.initTable=function(){var a=this.sBox,r=this.invSBox,f=this.subMix,p=f[0],m=f[1],E=f[2],y=f[3],u=this.invSubMix,n=u[0],o=u[1],l=u[2],w=u[3],v=new Uint32Array(256),i=0,R=0,k=0;for(k=0;k<256;k++)k<128?v[k]=k<<1:v[k]=k<<1^283;for(k=0;k<256;k++){var d=R^R<<1^R<<2^R<<3^R<<4;d=d>>>8^d&255^99,a[i]=d,r[d]=i;var b=v[i],x=v[b],_=v[x],B=v[d]*257^d*16843008;p[i]=B<<24|B>>>8,m[i]=B<<16|B>>>16,E[i]=B<<8|B>>>24,y[i]=B,B=_*16843009^x*65537^b*257^i*16843008,n[d]=B<<24|B>>>8,o[d]=B<<16|B>>>16,l[d]=B<<8|B>>>24,w[d]=B,i?(i=b^v[v[v[_^b]]],R^=v[v[R]]):i=R=1}},g.expandKey=function(a){for(var r=this.uint8ArrayToUint32Array_(a),f=!0,p=0;p<r.length&&f;)f=r[p]===this.key[p],p++;if(f)return;this.key=r;var m=this.keySize=r.length;if(m!==4&&m!==6&&m!==8)throw new Error("Invalid aes key size="+m);var E=this.ksRows=(m+6+1)*4,y,u,n=this.keySchedule=new Uint32Array(E),o=this.invKeySchedule=new Uint32Array(E),l=this.sBox,w=this.rcon,v=this.invSubMix,i=v[0],R=v[1],k=v[2],d=v[3],b,x;for(y=0;y<E;y++){if(y<m){b=n[y]=r[y];continue}x=b,y%m===0?(x=x<<8|x>>>24,x=l[x>>>24]<<24|l[x>>>16&255]<<16|l[x>>>8&255]<<8|l[x&255],x^=w[y/m|0]<<24):m>6&&y%m===4&&(x=l[x>>>24]<<24|l[x>>>16&255]<<16|l[x>>>8&255]<<8|l[x&255]),n[y]=b=(n[y-m]^x)>>>0}for(u=0;u<E;u++)y=E-u,u&3?x=n[y]:x=n[y-4],u<4||y<=4?o[u]=x:o[u]=i[l[x>>>24]]^R[l[x>>>16&255]]^k[l[x>>>8&255]]^d[l[x&255]],o[u]=o[u]>>>0},g.networkToHostOrderSwap=function(a){return a<<24|(a&65280)<<8|(a&16711680)>>8|a>>>24},g.decrypt=function(a,r,f){for(var p=this.keySize+6,m=this.invKeySchedule,E=this.invSBox,y=this.invSubMix,u=y[0],n=y[1],o=y[2],l=y[3],w=this.uint8ArrayToUint32Array_(f),v=w[0],i=w[1],R=w[2],k=w[3],d=new Int32Array(a),b=new Int32Array(d.length),x,_,B,U,P,J,$,z,V,K,H,G,ie,le,ue=this.networkToHostOrderSwap;r<d.length;){for(V=ue(d[r]),K=ue(d[r+1]),H=ue(d[r+2]),G=ue(d[r+3]),P=V^m[0],J=G^m[1],$=H^m[2],z=K^m[3],ie=4,le=1;le<p;le++)x=u[P>>>24]^n[J>>16&255]^o[$>>8&255]^l[z&255]^m[ie],_=u[J>>>24]^n[$>>16&255]^o[z>>8&255]^l[P&255]^m[ie+1],B=u[$>>>24]^n[z>>16&255]^o[P>>8&255]^l[J&255]^m[ie+2],U=u[z>>>24]^n[P>>16&255]^o[J>>8&255]^l[$&255]^m[ie+3],P=x,J=_,$=B,z=U,ie=ie+4;x=E[P>>>24]<<24^E[J>>16&255]<<16^E[$>>8&255]<<8^E[z&255]^m[ie],_=E[J>>>24]<<24^E[$>>16&255]<<16^E[z>>8&255]<<8^E[P&255]^m[ie+1],B=E[$>>>24]<<24^E[z>>16&255]<<16^E[P>>8&255]<<8^E[J&255]^m[ie+2],U=E[z>>>24]<<24^E[P>>16&255]<<16^E[J>>8&255]<<8^E[$&255]^m[ie+3],b[r]=ue(x^v),b[r+1]=ue(U^i),b[r+2]=ue(B^R),b[r+3]=ue(_^k),v=V,i=K,R=H,k=G,r=r+4}return b.buffer},C}()},"./src/crypt/decrypter.ts":function(I,h,S){"use strict";S.r(h),S.d(h,"default",function(){return r});var L=S("./src/crypt/aes-crypto.ts"),T=S("./src/crypt/fast-aes-key.ts"),c=S("./src/crypt/aes-decryptor.ts"),C=S("./src/utils/logger.ts"),g=S("./src/utils/mp4-tools.ts"),s=S("./src/utils/typed-array.ts"),a=16,r=function(){function f(m,E,y){var u=y===void 0?{}:y,n=u.removePKCS7Padding,o=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=m,this.config=E,this.removePKCS7Padding=o,o)try{var l=self.crypto;l&&(this.subtle=l.subtle||l.webkitSubtle)}catch(w){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var p=f.prototype;return p.destroy=function(){this.observer=null},p.isSync=function(){return this.config.enableSoftwareAES},p.flush=function(){var E=this.currentResult;if(!E){this.reset();return}var y=new Uint8Array(E);return this.reset(),this.removePKCS7Padding?Object(c.removePadding)(y):y},p.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},p.decrypt=function(E,y,u,n){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(E),y,u);var o=this.flush();o&&n(o.buffer)}else this.webCryptoDecrypt(new Uint8Array(E),y,u).then(n)},p.softwareDecrypt=function(E,y,u){var n=this.currentIV,o=this.currentResult,l=this.remainderData;this.logOnce("JS AES decrypt"),l&&(E=Object(g.appendUint8Array)(l,E),this.remainderData=null);var w=this.getValidChunk(E);if(!w.length)return null;n&&(u=n);var v=this.softwareDecrypter;v||(v=this.softwareDecrypter=new c.default),v.expandKey(y);var i=o;return this.currentResult=v.decrypt(w.buffer,0,u),this.currentIV=Object(s.sliceUint8)(w,-16).buffer,i||null},p.webCryptoDecrypt=function(E,y,u){var n=this,o=this.subtle;return(this.key!==y||!this.fastAesKey)&&(this.key=y,this.fastAesKey=new T.default(o,y)),this.fastAesKey.expandKey().then(function(l){if(!o)return Promise.reject(new Error("web crypto not initialized"));var w=new L.default(o,u);return w.decrypt(E.buffer,l)}).catch(function(l){return n.onWebCryptoError(l,E,y,u)})},p.onWebCryptoError=function(E,y,u,n){return C.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",E),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(y,u,n)},p.getValidChunk=function(E){var y=E,u=E.length-E.length%a;return u!==E.length&&(y=Object(s.sliceUint8)(E,0,u),this.remainderData=Object(s.sliceUint8)(E,u)),y},p.logOnce=function(E){if(!this.logEnabled)return;C.logger.log("[decrypter.ts]: "+E),this.logEnabled=!1},f}()},"./src/crypt/fast-aes-key.ts":function(I,h,S){"use strict";S.r(h),S.d(h,"default",function(){return L});var L=function(){function T(C,g){this.subtle=void 0,this.key=void 0,this.subtle=C,this.key=g}var c=T.prototype;return c.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},T}()},"./src/demux/aacdemuxer.ts":function(I,h,S){"use strict";S.r(h);var L=S("./src/demux/base-audio-demuxer.ts"),T=S("./src/demux/adts.ts"),c=S("./src/utils/logger.ts"),C=S("./src/demux/id3.ts");function g(r,f){r.prototype=Object.create(f.prototype),r.prototype.constructor=r,s(r,f)}function s(r,f){return s=Object.setPrototypeOf||function(m,E){return m.__proto__=E,m},s(r,f)}var a=function(r){g(f,r);function f(m,E){var y;return y=r.call(this)||this,y.observer=void 0,y.config=void 0,y.observer=m,y.config=E,y}var p=f.prototype;return p.resetInitSegment=function(E,y,u){r.prototype.resetInitSegment.call(this,E,y,u),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:E,duration:u,inputTimeScale:9e4,dropped:0}},f.probe=function(E){if(!E)return!1;for(var y=C.getID3Data(E,0)||[],u=y.length,n=E.length;u<n;u++)if(T.probe(E,u))return c.logger.log("ADTS sync word found !"),!0;return!1},p.canParse=function(E,y){return T.canParse(E,y)},p.appendFrame=function(E,y,u){T.initTrackConfig(E,this.observer,y,u,E.manifestCodec);var n=T.appendFrame(E,y,u,this.initPTS,this.frameIndex);if(n&&n.missing===0)return n},f}(L.default);a.minProbeByteLength=9,h.default=a},"./src/demux/adts.ts":function(I,h,S){"use strict";S.r(h),S.d(h,"getAudioConfig",function(){return C}),S.d(h,"isHeaderPattern",function(){return g}),S.d(h,"getHeaderLength",function(){return s}),S.d(h,"getFullFrameLength",function(){return a}),S.d(h,"canGetFrameLength",function(){return r}),S.d(h,"isHeader",function(){return f}),S.d(h,"canParse",function(){return p}),S.d(h,"probe",function(){return m}),S.d(h,"initTrackConfig",function(){return E}),S.d(h,"getFrameDuration",function(){return y}),S.d(h,"parseFrameHeader",function(){return u}),S.d(h,"appendFrame",function(){return n});var L=S("./src/utils/logger.ts"),T=S("./src/errors.ts"),c=S("./src/events.ts");function C(o,l,w,v){var i,R,k,d,b=navigator.userAgent.toLowerCase(),x=v,_=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];i=((l[w+2]&192)>>>6)+1;var B=(l[w+2]&60)>>>2;if(B>_.length-1){o.trigger(c.Events.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+B});return}return k=(l[w+2]&1)<<2,k|=(l[w+3]&192)>>>6,L.logger.log("manifest codec:"+v+", ADTS type:"+i+", samplingIndex:"+B),/firefox/i.test(b)?B>=6?(i=5,d=new Array(4),R=B-3):(i=2,d=new Array(2),R=B):b.indexOf("android")!==-1?(i=2,d=new Array(2),R=B):(i=5,d=new Array(4),v&&(v.indexOf("mp4a.40.29")!==-1||v.indexOf("mp4a.40.5")!==-1)||!v&&B>=6?R=B-3:((v&&v.indexOf("mp4a.40.2")!==-1&&(B>=6&&k===1||/vivaldi/i.test(b))||!v&&k===1)&&(i=2,d=new Array(2)),R=B)),d[0]=i<<3,d[0]|=(B&14)>>1,d[1]|=(B&1)<<7,d[1]|=k<<3,i===5&&(d[1]|=(R&14)>>1,d[2]=(R&1)<<7,d[2]|=2<<2,d[3]=0),{config:d,samplerate:_[B],channelCount:k,codec:"mp4a.40."+i,manifestCodec:x}}function g(o,l){return o[l]===255&&(o[l+1]&246)===240}function s(o,l){return o[l+1]&1?7:9}function a(o,l){return(o[l+3]&3)<<11|o[l+4]<<3|(o[l+5]&224)>>>5}function r(o,l){return l+5<o.length}function f(o,l){return l+1<o.length&&g(o,l)}function p(o,l){return r(o,l)&&g(o,l)&&a(o,l)<=o.length-l}function m(o,l){if(f(o,l)){var w=s(o,l);if(l+w>=o.length)return!1;var v=a(o,l);if(v<=w)return!1;var i=l+v;return i===o.length||f(o,i)}return!1}function E(o,l,w,v,i){if(!o.samplerate){var R=C(l,w,v,i);if(!R)return;o.config=R.config,o.samplerate=R.samplerate,o.channelCount=R.channelCount,o.codec=R.codec,o.manifestCodec=R.manifestCodec,L.logger.log("parsed codec:"+o.codec+", rate:"+R.samplerate+", channels:"+R.channelCount)}}function y(o){return 1024*9e4/o}function u(o,l,w,v,i){var R=s(o,l),k=a(o,l);if(k-=R,k>0){var d=w+v*i;return{headerLength:R,frameLength:k,stamp:d}}}function n(o,l,w,v,i){var R=y(o.samplerate),k=u(l,w,v,i,R);if(k){var d=k.frameLength,b=k.headerLength,x=k.stamp,_=b+d,B=Math.max(0,w+_-l.length),U;B?(U=new Uint8Array(_-b),U.set(l.subarray(w+b,l.length),0)):U=l.subarray(w+b,w+_);var P={unit:U,pts:x};return B||o.samples.push(P),{sample:P,length:_,missing:B}}}},"./src/demux/base-audio-demuxer.ts":function(I,h,S){"use strict";S.r(h),S.d(h,"initPTSFn",function(){return a});var L=S("./src/polyfills/number.ts"),T=S("./src/demux/id3.ts"),c=S("./src/demux/dummy-demuxed-track.ts"),C=S("./src/utils/mp4-tools.ts"),g=S("./src/utils/typed-array.ts"),s=function(){function r(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var f=r.prototype;return f.resetInitSegment=function(m,E,y){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},f.resetTimeStamp=function(){},f.resetContiguity=function(){},f.canParse=function(m,E){return!1},f.appendFrame=function(m,E,y){},f.demux=function(m,E){this.cachedData&&(m=Object(C.appendUint8Array)(this.cachedData,m),this.cachedData=null);var y=T.getID3Data(m,0),u=y?y.length:0,n,o,l=this._audioTrack,w=this._id3Track,v=y?T.getTimeStamp(y):void 0,i=m.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=a(v,E)),y&&y.length>0&&w.samples.push({pts:this.initPTS,dts:this.initPTS,data:y}),o=this.initPTS;u<i;){if(this.canParse(m,u)){var R=this.appendFrame(l,m,u);R?(this.frameIndex++,o=R.sample.pts,u+=R.length,n=u):u=i}else T.canParse(m,u)?(y=T.getID3Data(m,u),w.samples.push({pts:o,dts:o,data:y}),u+=y.length,n=u):u++;if(u===i&&n!==i){var k=Object(g.sliceUint8)(m,n);this.cachedData?this.cachedData=Object(C.appendUint8Array)(this.cachedData,k):this.cachedData=k}}return{audioTrack:l,avcTrack:Object(c.dummyTrack)(),id3Track:w,textTrack:Object(c.dummyTrack)()}},f.demuxSampleAes=function(m,E,y){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},f.flush=function(m){var E=this.cachedData;return E&&(this.cachedData=null,this.demux(E,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(c.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(c.dummyTrack)()}},f.destroy=function(){},r}(),a=function(f,p){return Object(L.isFiniteNumber)(f)?f*90:p*9e4};h.default=s},"./src/demux/chunk-cache.ts":function(I,h,S){"use strict";S.r(h),S.d(h,"default",function(){return L});var L=function(){function c(){this.chunks=[],this.dataLength=0}var C=c.prototype;return C.push=function(s){this.chunks.push(s),this.dataLength+=s.length},C.flush=function(){var s=this.chunks,a=this.dataLength,r;if(s.length)s.length===1?r=s[0]:r=T(s,a);else return new Uint8Array(0);return this.reset(),r},C.reset=function(){this.chunks.length=0,this.dataLength=0},c}();function T(c,C){for(var g=new Uint8Array(C),s=0,a=0;a<c.length;a++){var r=c[a];g.set(r,s),s+=r.length}return g}},"./src/demux/dummy-demuxed-track.ts":function(I,h,S){"use strict";S.r(h),S.d(h,"dummyTrack",function(){return L});function L(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(I,h,S){"use strict";S.r(h);var L=S("./src/utils/logger.ts"),T=function(){function c(g){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=g,this.bytesAvailable=g.byteLength,this.word=0,this.bitsAvailable=0}var C=c.prototype;return C.loadWord=function(){var s=this.data,a=this.bytesAvailable,r=s.byteLength-a,f=new Uint8Array(4),p=Math.min(4,a);if(p===0)throw new Error("no bytes available");f.set(s.subarray(r,r+p)),this.word=new DataView(f.buffer).getUint32(0),this.bitsAvailable=p*8,this.bytesAvailable-=p},C.skipBits=function(s){var a;this.bitsAvailable>s?(this.word<<=s,this.bitsAvailable-=s):(s-=this.bitsAvailable,a=s>>3,s-=a>>3,this.bytesAvailable-=a,this.loadWord(),this.word<<=s,this.bitsAvailable-=s)},C.readBits=function(s){var a=Math.min(this.bitsAvailable,s),r=this.word>>>32-a;return s>32&&L.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=a,this.bitsAvailable>0?this.word<<=a:this.bytesAvailable>0&&this.loadWord(),a=s-a,a>0&&this.bitsAvailable?r<<a|this.readBits(a):r},C.skipLZ=function(){var s;for(s=0;s<this.bitsAvailable;++s)if((this.word&2147483648>>>s)!==0)return this.word<<=s,this.bitsAvailable-=s,s;return this.loadWord(),s+this.skipLZ()},C.skipUEG=function(){this.skipBits(1+this.skipLZ())},C.skipEG=function(){this.skipBits(1+this.skipLZ())},C.readUEG=function(){var s=this.skipLZ();return this.readBits(s+1)-1},C.readEG=function(){var s=this.readUEG();return 1&s?1+s>>>1:-1*(s>>>1)},C.readBoolean=function(){return this.readBits(1)===1},C.readUByte=function(){return this.readBits(8)},C.readUShort=function(){return this.readBits(16)},C.readUInt=function(){return this.readBits(32)},C.skipScalingList=function(s){for(var a=8,r=8,f,p=0;p<s;p++)r!==0&&(f=this.readEG(),r=(a+f+256)%256),a=r===0?a:r},C.readSPS=function(){var s=0,a=0,r=0,f=0,p,m,E,y=this.readUByte.bind(this),u=this.readBits.bind(this),n=this.readUEG.bind(this),o=this.readBoolean.bind(this),l=this.skipBits.bind(this),w=this.skipEG.bind(this),v=this.skipUEG.bind(this),i=this.skipScalingList.bind(this);y();var R=y();if(u(5),l(3),y(),v(),R===100||R===110||R===122||R===244||R===44||R===83||R===86||R===118||R===128){var k=n();if(k===3&&l(1),v(),v(),l(1),o())for(m=k!==3?8:12,E=0;E<m;E++)o()&&(E<6?i(16):i(64))}v();var d=n();if(d===0)n();else if(d===1)for(l(1),w(),w(),p=n(),E=0;E<p;E++)w();v(),l(1);var b=n(),x=n(),_=u(1);_===0&&l(1),l(1),o()&&(s=n(),a=n(),r=n(),f=n());var B=[1,1];if(o()&&o()){var U=y();switch(U){case 1:B=[1,1];break;case 2:B=[12,11];break;case 3:B=[10,11];break;case 4:B=[16,11];break;case 5:B=[40,33];break;case 6:B=[24,11];break;case 7:B=[20,11];break;case 8:B=[32,11];break;case 9:B=[80,33];break;case 10:B=[18,11];break;case 11:B=[15,11];break;case 12:B=[64,33];break;case 13:B=[160,99];break;case 14:B=[4,3];break;case 15:B=[3,2];break;case 16:B=[2,1];break;case 255:{B=[y()<<8|y(),y()<<8|y()];break}}}return{width:Math.ceil((b+1)*16-s*2-a*2),height:(2-_)*(x+1)*16-(_?2:4)*(r+f),pixelRatio:B}},C.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},c}();h.default=T},"./src/demux/id3.ts":function(I,h,S){"use strict";S.r(h),S.d(h,"isHeader",function(){return L}),S.d(h,"isFooter",function(){return T}),S.d(h,"getID3Data",function(){return c}),S.d(h,"canParse",function(){return g}),S.d(h,"getTimeStamp",function(){return s}),S.d(h,"isTimeStampFrame",function(){return a}),S.d(h,"getID3Frames",function(){return f}),S.d(h,"decodeFrame",function(){return p}),S.d(h,"utf8ArrayToStr",function(){return n}),S.d(h,"testables",function(){return o});var L=function(i,R){return R+10<=i.length&&(i[R]===73&&i[R+1]===68&&i[R+2]===51&&(i[R+3]<255&&i[R+4]<255&&(i[R+6]<128&&i[R+7]<128&&i[R+8]<128&&i[R+9]<128)))},T=function(i,R){return R+10<=i.length&&(i[R]===51&&i[R+1]===68&&i[R+2]===73&&(i[R+3]<255&&i[R+4]<255&&(i[R+6]<128&&i[R+7]<128&&i[R+8]<128&&i[R+9]<128)))},c=function(i,R){for(var k=R,d=0;L(i,R);){d+=10;var b=C(i,R+6);d+=b,T(i,R+10)&&(d+=10),R+=d}return d>0?i.subarray(k,k+d):void 0},C=function(i,R){var k=0;return k=(i[R]&127)<<21,k|=(i[R+1]&127)<<14,k|=(i[R+2]&127)<<7,k|=i[R+3]&127,k},g=function(i,R){return L(i,R)&&C(i,R+6)+10<=i.length-R},s=function(i){for(var R=f(i),k=0;k<R.length;k++){var d=R[k];if(a(d))return u(d)}return},a=function(i){return i&&i.key==="PRIV"&&i.info==="com.apple.streaming.transportStreamTimestamp"},r=function(i){var R=String.fromCharCode(i[0],i[1],i[2],i[3]),k=C(i,4),d=10;return{type:R,size:k,data:i.subarray(d,d+k)}},f=function(i){for(var R=0,k=[];L(i,R);){var d=C(i,R+6);R+=10;for(var b=R+d;R+8<b;){var x=r(i.subarray(R)),_=p(x);_&&k.push(_),R+=x.size+10}T(i,R)&&(R+=10)}return k},p=function(i){return i.type==="PRIV"?m(i):i.type[0]==="W"?y(i):E(i)},m=function(i){if(i.size<2)return;var R=n(i.data,!0),k=new Uint8Array(i.data.subarray(R.length+1));return{key:i.type,info:R,data:k.buffer}},E=function(i){if(i.size<2)return;if(i.type==="TXXX"){var R=1,k=n(i.data.subarray(R),!0);R+=k.length+1;var d=n(i.data.subarray(R));return{key:i.type,info:k,data:d}}var b=n(i.data.subarray(1));return{key:i.type,data:b}},y=function(i){if(i.type==="WXXX"){if(i.size<2)return;var R=1,k=n(i.data.subarray(R),!0);R+=k.length+1;var d=n(i.data.subarray(R));return{key:i.type,info:k,data:d}}var b=n(i.data);return{key:i.type,data:b}},u=function(i){if(i.data.byteLength===8){var R=new Uint8Array(i.data),k=R[3]&1,d=(R[4]<<23)+(R[5]<<15)+(R[6]<<7)+R[7];return d/=45,k&&(d+=4772185884e-2),Math.round(d)}return},n=function(i,R){R===void 0&&(R=!1);var k=w();if(k){var d=k.decode(i);if(R){var b=d.indexOf("\0");return b!==-1?d.substring(0,b):d}return d.replace(/\0/g,"")}for(var x=i.length,_,B,U,P="",J=0;J<x;){if(_=i[J++],_===0&&R)return P;if(_===0||_===3)continue;switch(_>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:P+=String.fromCharCode(_);break;case 12:case 13:B=i[J++],P+=String.fromCharCode((_&31)<<6|B&63);break;case 14:B=i[J++],U=i[J++],P+=String.fromCharCode((_&15)<<12|(B&63)<<6|(U&63)<<0);break;default:}}return P},o={decodeTextFrame:E},l;function w(){return!l&&typeof self.TextDecoder!="undefined"&&(l=new self.TextDecoder("utf-8")),l}},"./src/demux/mp3demuxer.ts":function(I,h,S){"use strict";S.r(h);var L=S("./src/demux/base-audio-demuxer.ts"),T=S("./src/demux/id3.ts"),c=S("./src/utils/logger.ts"),C=S("./src/demux/mpegaudio.ts");function g(r,f){r.prototype=Object.create(f.prototype),r.prototype.constructor=r,s(r,f)}function s(r,f){return s=Object.setPrototypeOf||function(m,E){return m.__proto__=E,m},s(r,f)}var a=function(r){g(f,r);function f(){return r.apply(this,arguments)||this}var p=f.prototype;return p.resetInitSegment=function(E,y,u){r.prototype.resetInitSegment.call(this,E,y,u),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:E,duration:u,inputTimeScale:9e4,dropped:0}},f.probe=function(E){if(!E)return!1;for(var y=T.getID3Data(E,0)||[],u=y.length,n=E.length;u<n;u++)if(C.probe(E,u))return c.logger.log("MPEG Audio sync word found !"),!0;return!1},p.canParse=function(E,y){return C.canParse(E,y)},p.appendFrame=function(E,y,u){return this.initPTS===null?void 0:C.appendFrame(E,y,u,this.initPTS,this.frameIndex)},f}(L.default);a.minProbeByteLength=4,h.default=a},"./src/demux/mp4demuxer.ts":function(I,h,S){"use strict";S.r(h);var L=S("./src/utils/mp4-tools.ts"),T=S("./src/demux/dummy-demuxed-track.ts"),c=function(){function C(s,a){this.remainderData=null,this.config=void 0,this.config=a}var g=C.prototype;return g.resetTimeStamp=function(){},g.resetInitSegment=function(){},g.resetContiguity=function(){},C.probe=function(a){return Object(L.findBox)({data:a,start:0,end:Math.min(a.length,16384)},["moof"]).length>0},g.demux=function(a){var r=a,f=Object(T.dummyTrack)();if(this.config.progressive){this.remainderData&&(r=Object(L.appendUint8Array)(this.remainderData,a));var p=Object(L.segmentValidRange)(r);this.remainderData=p.remainder,f.samples=p.valid||new Uint8Array}else f.samples=r;return{audioTrack:Object(T.dummyTrack)(),avcTrack:f,id3Track:Object(T.dummyTrack)(),textTrack:Object(T.dummyTrack)()}},g.flush=function(){var a=Object(T.dummyTrack)();return a.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(T.dummyTrack)(),avcTrack:a,id3Track:Object(T.dummyTrack)(),textTrack:Object(T.dummyTrack)()}},g.demuxSampleAes=function(a,r,f){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},g.destroy=function(){},C}();c.minProbeByteLength=1024,h.default=c},"./src/demux/mpegaudio.ts":function(I,h,S){"use strict";S.r(h),S.d(h,"appendFrame",function(){return s}),S.d(h,"parseHeader",function(){return a}),S.d(h,"isHeaderPattern",function(){return r}),S.d(h,"isHeader",function(){return f}),S.d(h,"canParse",function(){return p}),S.d(h,"probe",function(){return m});var L=null,T=[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],c=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],C=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],g=[0,1,1,4];function s(E,y,u,n,o){if(u+24>y.length)return;var l=a(y,u);if(l&&u+l.frameLength<=y.length){var w=l.samplesPerFrame*9e4/l.sampleRate,v=n+o*w,i={unit:y.subarray(u,u+l.frameLength),pts:v,dts:v};return E.config=[],E.channelCount=l.channelCount,E.samplerate=l.sampleRate,E.samples.push(i),{sample:i,length:l.frameLength,missing:0}}}function a(E,y){var u=E[y+1]>>3&3,n=E[y+1]>>1&3,o=E[y+2]>>4&15,l=E[y+2]>>2&3;if(u!==1&&o!==0&&o!==15&&l!==3){var w=E[y+2]>>1&1,v=E[y+3]>>6,i=u===3?3-n:n===3?3:4,R=T[i*14+o-1]*1e3,k=u===3?0:u===2?1:2,d=c[k*3+l],b=v===3?1:2,x=C[u][n],_=g[n],B=x*8*_,U=Math.floor(x*R/d+w)*_;if(L===null){var P=navigator.userAgent||"",J=P.match(/Chrome\/(\d+)/i);L=J?parseInt(J[1]):0}var $=!!L&&L<=87;return $&&n===2&&R>=224e3&&v===0&&(E[y+3]=E[y+3]|128),{sampleRate:d,channelCount:b,frameLength:U,samplesPerFrame:B}}}function r(E,y){return E[y]===255&&(E[y+1]&224)===224&&(E[y+1]&6)!==0}function f(E,y){return y+1<E.length&&r(E,y)}function p(E,y){var u=4;return r(E,y)&&u<=E.length-y}function m(E,y){if(y+1<E.length&&r(E,y)){var u=4,n=a(E,y),o=u;n!=null&&n.frameLength&&(o=n.frameLength);var l=y+o;return l===E.length||f(E,l)}return!1}},"./src/demux/sample-aes.ts":function(I,h,S){"use strict";S.r(h);var L=S("./src/crypt/decrypter.ts"),T=S("./src/demux/tsdemuxer.ts"),c=function(){function C(s,a,r){this.keyData=void 0,this.decrypter=void 0,this.keyData=r,this.decrypter=new L.default(s,a,{removePKCS7Padding:!1})}var g=C.prototype;return g.decryptBuffer=function(a,r){this.decrypter.decrypt(a,this.keyData.key.buffer,this.keyData.iv.buffer,r)},g.decryptAacSample=function(a,r,f,p){var m=a[r].unit,E=m.subarray(16,m.length-m.length%16),y=E.buffer.slice(E.byteOffset,E.byteOffset+E.length),u=this;this.decryptBuffer(y,function(n){var o=new Uint8Array(n);m.set(o,16),p||u.decryptAacSamples(a,r+1,f)})},g.decryptAacSamples=function(a,r,f){for(;;r++){if(r>=a.length){f();return}if(a[r].unit.length<32)continue;var p=this.decrypter.isSync();if(this.decryptAacSample(a,r,f,p),!p)return}},g.getAvcEncryptedData=function(a){for(var r=Math.floor((a.length-48)/160)*16+16,f=new Int8Array(r),p=0,m=32;m<=a.length-16;m+=160,p+=16)f.set(a.subarray(m,m+16),p);return f},g.getAvcDecryptedUnit=function(a,r){for(var f=new Uint8Array(r),p=0,m=32;m<=a.length-16;m+=160,p+=16)a.set(f.subarray(p,p+16),m);return a},g.decryptAvcSample=function(a,r,f,p,m,E){var y=Object(T.discardEPB)(m.data),u=this.getAvcEncryptedData(y),n=this;this.decryptBuffer(u.buffer,function(o){m.data=n.getAvcDecryptedUnit(y,o),E||n.decryptAvcSamples(a,r,f+1,p)})},g.decryptAvcSamples=function(a,r,f,p){if(a instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;r++,f=0){if(r>=a.length){p();return}for(var m=a[r].units;!(f>=m.length);f++){var E=m[f];if(E.data.length<=48||E.type!==1&&E.type!==5)continue;var y=this.decrypter.isSync();if(this.decryptAvcSample(a,r,f,p,E,y),!y)return}}},C}();h.default=c},"./src/demux/transmuxer-interface.ts":function(I,h,S){"use strict";S.r(h),S.d(h,"default",function(){return m});var L=S("./node_modules/webworkify-webpack/index.js"),T=S.n(L),c=S("./src/events.ts"),C=S("./src/demux/transmuxer.ts"),g=S("./src/utils/logger.ts"),s=S("./src/errors.ts"),a=S("./src/utils/mediasource-helper.ts"),r=S("./node_modules/eventemitter3/index.js"),f=S.n(r),p=Object(a.getMediaSource)()||{isTypeSupported:function(){return!1}},m=function(){function E(u,n,o,l){var w=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=u,this.id=n,this.onTransmuxComplete=o,this.onFlush=l;var v=u.config,i=function(x,_){_=_||{},_.frag=w.frag,_.id=w.id,u.trigger(x,_)};this.observer=new r.EventEmitter,this.observer.on(c.Events.FRAG_DECRYPTED,i),this.observer.on(c.Events.ERROR,i);var R={mp4:p.isTypeSupported("video/mp4"),mpeg:p.isTypeSupported("audio/mpeg"),mp3:p.isTypeSupported('audio/mp4; codecs="mp3"')},k=navigator.vendor;if(v.enableWorker&&typeof Worker!="undefined"){g.logger.log("demuxing in webworker");var d;try{d=this.worker=L("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),d.addEventListener("message",this.onwmsg),d.onerror=function(b){u.trigger(c.Events.ERROR,{type:s.ErrorTypes.OTHER_ERROR,details:s.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(b.message+" ("+b.filename+":"+b.lineno+")")})},d.postMessage({cmd:"init",typeSupported:R,vendor:k,id:n,config:JSON.stringify(v)})}catch(b){g.logger.warn("Error in worker:",b),g.logger.error("Error while initializing DemuxerWorker, fallback to inline"),d&&self.URL.revokeObjectURL(d.objectURL),this.transmuxer=new C.default(this.observer,R,v,k,n),this.worker=null}}else this.transmuxer=new C.default(this.observer,R,v,k,n)}var y=E.prototype;return y.destroy=function(){var n=this.worker;if(n)n.removeEventListener("message",this.onwmsg),n.terminate(),this.worker=null;else{var o=this.transmuxer;o&&(o.destroy(),this.transmuxer=null)}var l=this.observer;l&&l.removeAllListeners(),this.observer=null},y.push=function(n,o,l,w,v,i,R,k,d,b){var x=this;d.transmuxing.start=self.performance.now();var _=this.transmuxer,B=this.worker,U=i?i.start:v.start,P=v.decryptdata,J=this.frag,$=!(J&&v.cc===J.cc),z=!(J&&d.level===J.level),V=J?d.sn-J.sn:-1,K=this.part?d.part-this.part.index:1,H=!z&&(V===1||V===0&&K===1),G=self.performance.now();(z||V||v.stats.parsing.start===0)&&(v.stats.parsing.start=G),i&&(K||!H)&&(i.stats.parsing.start=G);var ie=new C.TransmuxState($,H,k,z,U);if(!H||$){g.logger.log("[transmuxer-interface, "+v.type+"]: Starting new transmux session for sn: "+d.sn+" p: "+d.part+" level: "+d.level+" id: "+d.id+`
discontinuity: `+$+`
trackSwitch: `+z+`
contiguous: `+H+`
accurateTimeOffset: `+k+`
timeOffset: `+U);var le=new C.TransmuxConfig(l,w,o,R,b);this.configureTransmuxer(le)}if(this.frag=v,this.part=i,B)B.postMessage({cmd:"demux",data:n,decryptdata:P,chunkMeta:d,state:ie},n instanceof ArrayBuffer?[n]:[]);else if(_){var ue=_.push(n,P,d,ie);Object(C.isPromise)(ue)?ue.then(function(be){x.handleTransmuxComplete(be)}):this.handleTransmuxComplete(ue)}},y.flush=function(n){var o=this;n.transmuxing.start=self.performance.now();var l=this.transmuxer,w=this.worker;if(w)w.postMessage({cmd:"flush",chunkMeta:n});else if(l){var v=l.flush(n);Object(C.isPromise)(v)?v.then(function(i){o.handleFlushResult(i,n)}):this.handleFlushResult(v,n)}},y.handleFlushResult=function(n,o){var l=this;n.forEach(function(w){l.handleTransmuxComplete(w)}),this.onFlush(o)},y.onWorkerMessage=function(n){var o=n.data,l=this.hls;switch(o.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(o.data);break}case"flush":{this.onFlush(o.data);break}default:{o.data=o.data||{},o.data.frag=this.frag,o.data.id=this.id,l.trigger(o.event,o.data);break}}},y.configureTransmuxer=function(n){var o=this.worker,l=this.transmuxer;o?o.postMessage({cmd:"configure",config:n}):l&&l.configure(n)},y.handleTransmuxComplete=function(n){n.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(n)},E}()},"./src/demux/transmuxer-worker.ts":function(I,h,S){"use strict";S.r(h),S.d(h,"default",function(){return s});var L=S("./src/demux/transmuxer.ts"),T=S("./src/events.ts"),c=S("./src/utils/logger.ts"),C=S("./node_modules/eventemitter3/index.js"),g=S.n(C);function s(m){var E=new C.EventEmitter,y=function(n,o){m.postMessage({event:n,data:o})};E.on(T.Events.FRAG_DECRYPTED,y),E.on(T.Events.ERROR,y),m.addEventListener("message",function(u){var n=u.data;switch(n.cmd){case"init":{var o=JSON.parse(n.config);m.transmuxer=new L.default(E,n.typeSupported,o,n.vendor,n.id),Object(c.enableLogs)(o.debug),y("init",null);break}case"configure":{m.transmuxer.configure(n.config);break}case"demux":{var l=m.transmuxer.push(n.data,n.decryptdata,n.chunkMeta,n.state);Object(L.isPromise)(l)?l.then(function(i){a(m,i)}):a(m,l);break}case"flush":{var w=n.chunkMeta,v=m.transmuxer.flush(w);Object(L.isPromise)(v)?v.then(function(i){f(m,i,w)}):f(m,v,w);break}default:break}})}function a(m,E){if(p(E.remuxResult))return;var y=[],u=E.remuxResult,n=u.audio,o=u.video;n&&r(y,n),o&&r(y,o),m.postMessage({event:"transmuxComplete",data:E},y)}function r(m,E){E.data1&&m.push(E.data1.buffer),E.data2&&m.push(E.data2.buffer)}function f(m,E,y){E.forEach(function(u){a(m,u)}),m.postMessage({event:"flush",data:y})}function p(m){return!m.audio&&!m.video&&!m.text&&!m.id3&&!m.initSegment}},"./src/demux/transmuxer.ts":function(I,h,S){"use strict";S.r(h),S.d(h,"default",function(){return o}),S.d(h,"isPromise",function(){return v}),S.d(h,"TransmuxConfig",function(){return i}),S.d(h,"TransmuxState",function(){return R});var L=S("./src/events.ts"),T=S("./src/errors.ts"),c=S("./src/crypt/decrypter.ts"),C=S("./src/demux/aacdemuxer.ts"),g=S("./src/demux/mp4demuxer.ts"),s=S("./src/demux/tsdemuxer.ts"),a=S("./src/demux/mp3demuxer.ts"),r=S("./src/remux/mp4-remuxer.ts"),f=S("./src/remux/passthrough-remuxer.ts"),p=S("./src/demux/chunk-cache.ts"),m=S("./src/utils/mp4-tools.ts"),E=S("./src/utils/logger.ts"),y;try{y=self.performance.now.bind(self.performance)}catch(k){E.logger.debug("Unable to use Performance API on this environment"),y=self.Date.now}var u=[{demux:s.default,remux:r.default},{demux:g.default,remux:f.default},{demux:C.default,remux:r.default},{demux:a.default,remux:r.default}],n=1024;u.forEach(function(k){var d=k.demux;n=Math.max(n,d.minProbeByteLength)});var o=function(){function k(b,x,_,B,U){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 p.default,this.observer=b,this.typeSupported=x,this.config=_,this.vendor=B,this.id=U}var d=k.prototype;return d.configure=function(x){this.transmuxConfig=x,this.decrypter&&this.decrypter.reset()},d.push=function(x,_,B,U){var P=this,J=B.transmuxing;J.executeStart=y();var $=new Uint8Array(x),z=this.cache,V=this.config,K=this.currentTransmuxState,H=this.transmuxConfig;U&&(this.currentTransmuxState=U);var G=l($,_);if(G&&G.method==="AES-128"){var ie=this.getDecrypter();if(V.enableSoftwareAES){var le=ie.softwareDecrypt($,G.key.buffer,G.iv.buffer);if(!le)return J.executeEnd=y(),w(B);$=new Uint8Array(le)}else return this.decryptionPromise=ie.webCryptoDecrypt($,G.key.buffer,G.iv.buffer).then(function(q){var X=P.push(q,null,B);return P.decryptionPromise=null,X}),this.decryptionPromise}var ue=U||K,be=ue.contiguous,Ce=ue.discontinuity,se=ue.trackSwitch,ce=ue.accurateTimeOffset,he=ue.timeOffset,ae=H.audioCodec,Q=H.videoCodec,D=H.defaultInitPts,F=H.duration,W=H.initSegmentData;if((Ce||se)&&this.resetInitSegment(W,ae,Q,F),Ce&&this.resetInitialTimestamp(D),be||this.resetContiguity(),this.needsProbing($,Ce,se)){if(z.dataLength){var Y=z.flush();$=Object(m.appendUint8Array)(Y,$)}this.configureTransmuxer($,H)}var Z=this.transmux($,G,he,ce,B),te=this.currentTransmuxState;return te.contiguous=!0,te.discontinuity=!1,te.trackSwitch=!1,J.executeEnd=y(),Z},d.flush=function(x){var _=this,B=x.transmuxing;B.executeStart=y();var U=this.decrypter,P=this.cache,J=this.currentTransmuxState,$=this.decryptionPromise;if($)return $.then(function(){return _.flush(x)});var z=[],V=J.timeOffset;if(U){var K=U.flush();K&&z.push(this.push(K,null,x))}var H=P.dataLength;P.reset();var G=this.demuxer,ie=this.remuxer;if(!G||!ie)return H>=n&&this.observer.emit(L.Events.ERROR,L.Events.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),B.executeEnd=y(),[w(x)];var le=G.flush(V);return v(le)?le.then(function(ue){return _.flushRemux(z,ue,x),z}):(this.flushRemux(z,le,x),z)},d.flushRemux=function(x,_,B){var U=_.audioTrack,P=_.avcTrack,J=_.id3Track,$=_.textTrack,z=this.currentTransmuxState,V=z.accurateTimeOffset,K=z.timeOffset;E.logger.log("[transmuxer.ts]: Flushed fragment "+B.sn+(B.part>-1?" p: "+B.part:"")+" of level "+B.level);var H=this.remuxer.remux(U,P,J,$,K,V,!0,this.id);x.push({remuxResult:H,chunkMeta:B}),B.transmuxing.executeEnd=y()},d.resetInitialTimestamp=function(x){var _=this.demuxer,B=this.remuxer;if(!_||!B)return;_.resetTimeStamp(x),B.resetTimeStamp(x)},d.resetContiguity=function(){var x=this.demuxer,_=this.remuxer;if(!x||!_)return;x.resetContiguity(),_.resetNextTimestamp()},d.resetInitSegment=function(x,_,B,U){var P=this.demuxer,J=this.remuxer;if(!P||!J)return;P.resetInitSegment(_,B,U),J.resetInitSegment(x,_,B)},d.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},d.transmux=function(x,_,B,U,P){var J;return _&&_.method==="SAMPLE-AES"?J=this.transmuxSampleAes(x,_,B,U,P):J=this.transmuxUnencrypted(x,B,U,P),J},d.transmuxUnencrypted=function(x,_,B,U){var P=this.demuxer.demux(x,_,!1,!this.config.progressive),J=P.audioTrack,$=P.avcTrack,z=P.id3Track,V=P.textTrack,K=this.remuxer.remux(J,$,z,V,_,B,!1,this.id);return{remuxResult:K,chunkMeta:U}},d.transmuxSampleAes=function(x,_,B,U,P){var J=this;return this.demuxer.demuxSampleAes(x,_,B).then(function($){var z=J.remuxer.remux($.audioTrack,$.avcTrack,$.id3Track,$.textTrack,B,U,!1,J.id);return{remuxResult:z,chunkMeta:P}})},d.configureTransmuxer=function(x,_){for(var B=this.config,U=this.observer,P=this.typeSupported,J=this.vendor,$=_.audioCodec,z=_.defaultInitPts,V=_.duration,K=_.initSegmentData,H=_.videoCodec,G,ie=0,le=u.length;ie<le;ie++)if(u[ie].demux.probe(x)){G=u[ie];break}G||(E.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),G={demux:g.default,remux:f.default});var ue=this.demuxer,be=this.remuxer,Ce=G.remux,se=G.demux;(!be||!(be instanceof Ce))&&(this.remuxer=new Ce(U,B,P,J)),(!ue||!(ue instanceof se))&&(this.demuxer=new se(U,B,P),this.probe=se.probe),this.resetInitSegment(K,$,H,V),this.resetInitialTimestamp(z)},d.needsProbing=function(x,_,B){return!this.demuxer||!this.remuxer||_||B},d.getDecrypter=function(){var x=this.decrypter;return x||(x=this.decrypter=new c.default(this.observer,this.config)),x},k}();function l(k,d){var b=null;return k.byteLength>0&&d!=null&&d.key!=null&&d.iv!==null&&d.method!=null&&(b=d),b}var w=function(d){return{remuxResult:{},chunkMeta:d}};function v(k){return"then"in k&&k.then instanceof Function}var i=function(d,b,x,_,B){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=d,this.videoCodec=b,this.initSegmentData=x,this.duration=_,this.defaultInitPts=B},R=function(d,b,x,_,B){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=d,this.contiguous=b,this.accurateTimeOffset=x,this.trackSwitch=_,this.timeOffset=B}},"./src/demux/tsdemuxer.ts":function(I,h,S){"use strict";S.r(h),S.d(h,"discardEPB",function(){return w});var L=S("./src/demux/adts.ts"),T=S("./src/demux/mpegaudio.ts"),c=S("./src/demux/exp-golomb.ts"),C=S("./src/demux/id3.ts"),g=S("./src/demux/sample-aes.ts"),s=S("./src/events.ts"),a=S("./src/utils/mp4-tools.ts"),r=S("./src/utils/logger.ts"),f=S("./src/errors.ts"),p={video:1,audio:2,id3:3,text:4},m=function(){function v(R,k,d){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=R,this.config=k,this.typeSupported=d}v.probe=function(k){var d=v.syncOffset(k);return d<0?!1:(d&&r.logger.warn("MPEG2-TS detected but first sync word found @ offset "+d+", junk ahead ?"),!0)},v.syncOffset=function(k){for(var d=Math.min(1e3,k.length-3*188),b=0;b<d;){if(k[b]===71&&k[b+188]===71&&k[b+2*188]===71)return b;b++}return-1},v.createTrack=function(k,d){return{container:k==="video"||k==="audio"?"video/mp2t":void 0,type:k,id:p[k],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:k==="audio"?d:void 0}};var i=v.prototype;return i.resetInitSegment=function(k,d,b){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=v.createTrack("video",b),this._audioTrack=v.createTrack("audio",b),this._id3Track=v.createTrack("id3",b),this._txtTrack=v.createTrack("text",b),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=k,this.videoCodec=d,this._duration=b},i.resetTimeStamp=function(){},i.resetContiguity=function(){var k=this._audioTrack,d=this._avcTrack,b=this._id3Track;k&&(k.pesData=null),d&&(d.pesData=null),b&&(b.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},i.demux=function(k,d,b,x){b===void 0&&(b=!1),x===void 0&&(x=!1),b||(this.sampleAes=null);var _,B=this._avcTrack,U=this._audioTrack,P=this._id3Track,J=B.pid,$=B.pesData,z=U.pid,V=P.pid,K=U.pesData,H=P.pesData,G=!1,ie=this.pmtParsed,le=this._pmtId,ue=k.length;if(this.remainderData&&(k=Object(a.appendUint8Array)(this.remainderData,k),ue=k.length,this.remainderData=null),ue<188&&!x)return this.remainderData=k,{audioTrack:U,avcTrack:B,id3Track:P,textTrack:this._txtTrack};var be=Math.max(0,v.syncOffset(k));ue-=(ue+be)%188,ue<k.byteLength&&!x&&(this.remainderData=new Uint8Array(k.buffer,ue,k.buffer.byteLength-ue));for(var Ce=be;Ce<ue;Ce+=188)if(k[Ce]===71){var se=!!(k[Ce+1]&64),ce=((k[Ce+1]&31)<<8)+k[Ce+2],he=(k[Ce+3]&48)>>4,ae=void 0;if(he>1){if(ae=Ce+5+k[Ce+4],ae===Ce+188)continue}else ae=Ce+4;switch(ce){case J:se&&($&&(_=n($))&&this.parseAVCPES(_,!1),$={data:[],size:0}),$&&($.data.push(k.subarray(ae,Ce+188)),$.size+=Ce+188-ae);break;case z:se&&(K&&(_=n(K))&&(U.isAAC?this.parseAACPES(_):this.parseMPEGPES(_)),K={data:[],size:0}),K&&(K.data.push(k.subarray(ae,Ce+188)),K.size+=Ce+188-ae);break;case V:se&&(H&&(_=n(H))&&this.parseID3PES(_),H={data:[],size:0}),H&&(H.data.push(k.subarray(ae,Ce+188)),H.size+=Ce+188-ae);break;case 0:se&&(ae+=k[ae]+1),le=this._pmtId=y(k,ae);break;case le:{se&&(ae+=k[ae]+1);var Q=u(k,ae,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,b);J=Q.avc,J>0&&(B.pid=J),z=Q.audio,z>0&&(U.pid=z,U.isAAC=Q.isAAC),V=Q.id3,V>0&&(P.pid=V),G&&!ie&&(r.logger.log("reparse from beginning"),G=!1,Ce=be-188),ie=this.pmtParsed=!0;break}case 17:case 8191:break;default:G=!0;break}}else this.observer.emit(s.Events.ERROR,s.Events.ERROR,{type:f.ErrorTypes.MEDIA_ERROR,details:f.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});B.pesData=$,U.pesData=K,P.pesData=H;var D={audioTrack:U,avcTrack:B,id3Track:P,textTrack:this._txtTrack};return x&&this.extractRemainingSamples(D),D},i.flush=function(){var k=this.remainderData;this.remainderData=null;var d;return k?d=this.demux(k,-1,!1,!0):d={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(d),this.sampleAes?this.decrypt(d,this.sampleAes):d},i.extractRemainingSamples=function(k){var d=k.audioTrack,b=k.avcTrack,x=k.id3Track,_=b.pesData,B=d.pesData,U=x.pesData,P;_&&(P=n(_))?(this.parseAVCPES(P,!0),b.pesData=null):b.pesData=_,B&&(P=n(B))?(d.isAAC?this.parseAACPES(P):this.parseMPEGPES(P),d.pesData=null):(B!=null&&B.size&&r.logger.log("last AAC PES packet truncated,might overlap between fragments"),d.pesData=B),U&&(P=n(U))?(this.parseID3PES(P),x.pesData=null):x.pesData=U},i.demuxSampleAes=function(k,d,b){var x=this.demux(k,b,!0,!this.config.progressive),_=this.sampleAes=new g.default(this.observer,this.config,d);return this.decrypt(x,_)},i.decrypt=function(k,d){return new Promise(function(b){var x=k.audioTrack,_=k.avcTrack;x.samples&&x.isAAC?d.decryptAacSamples(x.samples,0,function(){_.samples?d.decryptAvcSamples(_.samples,0,0,function(){b(k)}):b(k)}):_.samples&&d.decryptAvcSamples(_.samples,0,0,function(){b(k)})})},i.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},i.parseAVCPES=function(k,d){var b=this,x=this._avcTrack,_=this.parseAVCNALu(k.data),B=!1,U=this.avcSample,P,J=!1;k.data=null,U&&_.length&&!x.audFound&&(o(U,x),U=this.avcSample=E(!1,k.pts,k.dts,"")),_.forEach(function($){switch($.type){case 1:{P=!0,U||(U=b.avcSample=E(!0,k.pts,k.dts,"")),B&&(U.debug+="NDR "),U.frame=!0;var z=$.data;if(J&&z.length>4){var V=new c.default(z).readSliceType();(V===2||V===4||V===7||V===9)&&(U.key=!0)}break}case 5:P=!0,U||(U=b.avcSample=E(!0,k.pts,k.dts,"")),B&&(U.debug+="IDR "),U.key=!0,U.frame=!0;break;case 6:{P=!0,B&&U&&(U.debug+="SEI ");var K=new c.default(w($.data));K.readUByte();for(var H=0,G=0,ie=!1,le=0;!ie&&K.bytesAvailable>1;){H=0;do le=K.readUByte(),H+=le;while(le===255);G=0;do le=K.readUByte(),G+=le;while(le===255);if(H===4&&K.bytesAvailable!==0){ie=!0;var ue=K.readUByte();if(ue===181){var be=K.readUShort();if(be===49){var Ce=K.readUInt();if(Ce===1195456820){var se=K.readUByte();if(se===3){for(var ce=K.readUByte(),he=K.readUByte(),ae=31&ce,Q=[ce,he],D=0;D<ae;D++)Q.push(K.readUByte()),Q.push(K.readUByte()),Q.push(K.readUByte());l(b._txtTrack.samples,{type:3,pts:k.pts,bytes:Q})}}}}}else if(H===5&&K.bytesAvailable!==0){if(ie=!0,G>16){for(var F=[],W=0;W<16;W++)F.push(K.readUByte().toString(16)),(W===3||W===5||W===7||W===9)&&F.push("-");for(var Y=G-16,Z=new Uint8Array(Y),te=0;te<Y;te++)Z[te]=K.readUByte();l(b._txtTrack.samples,{pts:k.pts,payloadType:H,uuid:F.join(""),userData:Object(C.utf8ArrayToStr)(Z),userDataBytes:Z})}}else if(G<K.bytesAvailable)for(var q=0;q<G;q++)K.readUByte()}break}case 7:if(P=!0,J=!0,B&&U&&(U.debug+="SPS "),!x.sps){var X=new c.default($.data),re=X.readSPS();x.width=re.width,x.height=re.height,x.pixelRatio=re.pixelRatio,x.sps=[$.data],x.duration=b._duration;for(var me=$.data.subarray(1,4),ve="avc1.",Te=0;Te<3;Te++){var Re=me[Te].toString(16);Re.length<2&&(Re="0"+Re),ve+=Re}x.codec=ve}break;case 8:P=!0,B&&U&&(U.debug+="PPS "),x.pps||(x.pps=[$.data]);break;case 9:P=!1,x.audFound=!0,U&&o(U,x),U=b.avcSample=E(!1,k.pts,k.dts,B?"AUD ":"");break;case 12:P=!1;break;default:P=!1,U&&(U.debug+="unknown NAL "+$.type+" ");break}if(U&&P){var Ie=U.units;Ie.push($)}}),d&&U&&(o(U,x),this.avcSample=null)},i.getLastNalUnit=function(){var k,d=this.avcSample,b;if(!d||d.units.length===0){var x=this._avcTrack.samples;d=x[x.length-1]}if((k=d)!==null&&k!==void 0&&k.units){var _=d.units;b=_[_.length-1]}return b},i.parseAVCNALu=function(k){var d=k.byteLength,b=this._avcTrack,x=b.naluState||0,_=x,B=[],U=0,P,J,$,z=-1,V=0;for(x===-1&&(z=0,V=k[0]&31,x=0,U=1);U<d;){if(P=k[U++],!x){x=P?0:1;continue}if(x===1){x=P?0:2;continue}if(!P)x=3;else if(P===1){if(z>=0){var K={data:k.subarray(z,U-x-1),type:V};B.push(K)}else{var H=this.getLastNalUnit();if(H&&(_&&U<=4-_&&(H.state&&(H.data=H.data.subarray(0,H.data.byteLength-_))),J=U-x-1,J>0)){var G=new Uint8Array(H.data.byteLength+J);G.set(H.data,0),G.set(k.subarray(0,J),H.data.byteLength),H.data=G,H.state=0}}U<d?($=k[U]&31,z=U,V=$,x=0):x=-1}else x=0}if(z>=0&&x>=0){var ie={data:k.subarray(z,d),type:V,state:x};B.push(ie)}if(B.length===0){var le=this.getLastNalUnit();if(le){var ue=new Uint8Array(le.data.byteLength+k.byteLength);ue.set(le.data,0),ue.set(k,le.data.byteLength),le.data=ue}}return b.naluState=x,B},i.parseAACPES=function(k){var d=0,b=this._audioTrack,x=this.aacOverFlow,_=k.data;if(x){this.aacOverFlow=null;var B=x.sample.unit.byteLength,U=Math.min(x.missing,B),P=B-U;x.sample.unit.set(_.subarray(0,U),P),b.samples.push(x.sample),d=x.missing}var J,$;for(J=d,$=_.length;J<$-1&&!L.isHeader(_,J);J++);if(J!==d){var z,V;if(J<$-1?(z="AAC PES did not start with ADTS header,offset:"+J,V=!1):(z="no ADTS header found in AAC PES",V=!0),r.logger.warn("parsing error:"+z),this.observer.emit(s.Events.ERROR,s.Events.ERROR,{type:f.ErrorTypes.MEDIA_ERROR,details:f.ErrorDetails.FRAG_PARSING_ERROR,fatal:V,reason:z}),V)return}L.initTrackConfig(b,this.observer,_,J,this.audioCodec);var K;if(k.pts!==void 0)K=k.pts;else if(x){var H=L.getFrameDuration(b.samplerate);K=x.sample.pts+H}else{r.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var G=0;J<$;)if(L.isHeader(_,J)){if(J+5<$){var ie=L.appendFrame(b,_,J,K,G);if(ie)if(ie.missing)this.aacOverFlow=ie;else{J+=ie.length,G++;continue}}break}else J++},i.parseMPEGPES=function(k){var d=k.data,b=d.length,x=0,_=0,B=k.pts;if(B===void 0){r.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;_<b;)if(T.isHeader(d,_)){var U=T.appendFrame(this._audioTrack,d,_,B,x);if(U)_+=U.length,x++;else break}else _++},i.parseID3PES=function(k){if(k.pts===void 0){r.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(k)},v}();m.minProbeByteLength=188;function E(v,i,R,k){return{key:v,frame:!1,pts:i,dts:R,units:[],debug:k,length:0}}function y(v,i){return(v[i+10]&31)<<8|v[i+11]}function u(v,i,R,k){var d={audio:-1,avc:-1,id3:-1,isAAC:!0},b=(v[i+1]&15)<<8|v[i+2],x=i+3+b-4,_=(v[i+10]&15)<<8|v[i+11];for(i+=12+_;i<x;){var B=(v[i+1]&31)<<8|v[i+2];switch(v[i]){case 207:if(!k){r.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:d.audio===-1&&(d.audio=B);break;case 21:d.id3===-1&&(d.id3=B);break;case 219:if(!k){r.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:d.avc===-1&&(d.avc=B);break;case 3:case 4:R?d.audio===-1&&(d.audio=B,d.isAAC=!1):r.logger.log("MPEG audio found, not supported in this browser");break;case 36:r.logger.warn("Unsupported HEVC stream type found");break;default:break}i+=((v[i+3]&15)<<8|v[i+4])+5}return d}function n(v){var i=0,R,k,d,b,x,_=v.data;if(!v||v.size===0)return null;for(;_[0].length<19&&_.length>1;){var B=new Uint8Array(_[0].length+_[1].length);B.set(_[0]),B.set(_[1],_[0].length),_[0]=B,_.splice(1,1)}R=_[0];var U=(R[0]<<16)+(R[1]<<8)+R[2];if(U===1){if(k=(R[4]<<8)+R[5],k&&k>v.size-6)return null;var P=R[7];P&192&&(b=(R[9]&14)*536870912+(R[10]&255)*4194304+(R[11]&254)*16384+(R[12]&255)*128+(R[13]&254)/2,P&64?(x=(R[14]&14)*536870912+(R[15]&255)*4194304+(R[16]&254)*16384+(R[17]&255)*128+(R[18]&254)/2,b-x>60*9e4&&(r.logger.warn(Math.round((b-x)/9e4)+"s delta between PTS and DTS, align them"),b=x)):x=b),d=R[8];var J=d+9;if(v.size<=J)return null;v.size-=J;for(var $=new Uint8Array(v.size),z=0,V=_.length;z<V;z++){R=_[z];var K=R.byteLength;if(J)if(J>K){J-=K;continue}else R=R.subarray(J),K-=J,J=0;$.set(R,i),i+=K}return k&&(k-=d+3),{data:$,pts:b,dts:x,len:k}}return null}function o(v,i){if(v.units.length&&v.frame){if(v.pts===void 0){var R=i.samples,k=R.length;if(k){var d=R[k-1];v.pts=d.pts,v.dts=d.dts}else{i.dropped++;return}}i.samples.push(v)}v.debug.length&&r.logger.log(v.pts+"/"+v.dts+":"+v.debug)}function l(v,i){var R=v.length;if(R>0){if(i.pts>=v[R-1].pts)v.push(i);else for(var k=R-1;k>=0;k--)if(i.pts<v[k].pts){v.splice(k,0,i);break}}else v.push(i)}function w(v){for(var i=v.byteLength,R=[],k=1;k<i-2;)v[k]===0&&v[k+1]===0&&v[k+2]===3?(R.push(k+2),k+=2):k++;if(R.length===0)return v;var d=i-R.length,b=new Uint8Array(d),x=0;for(k=0;k<d;x++,k++)x===R[0]&&(x++,R.shift()),b[k]=v[x];return b}h.default=m},"./src/errors.ts":function(I,h,S){"use strict";S.r(h),S.d(h,"ErrorTypes",function(){return L}),S.d(h,"ErrorDetails",function(){return T});var L;(function(c){c.NETWORK_ERROR="networkError",c.MEDIA_ERROR="mediaError",c.KEY_SYSTEM_ERROR="keySystemError",c.MUX_ERROR="muxError",c.OTHER_ERROR="otherError"})(L||(L={}));var T;(function(c){c.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",c.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",c.KEY_SYSTEM_NO_SESSION="keySystemNoSession",c.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",c.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",c.MANIFEST_LOAD_ERROR="manifestLoadError",c.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",c.MANIFEST_PARSING_ERROR="manifestParsingError",c.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",c.LEVEL_EMPTY_ERROR="levelEmptyError",c.LEVEL_LOAD_ERROR="levelLoadError",c.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",c.LEVEL_SWITCH_ERROR="levelSwitchError",c.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",c.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",c.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",c.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",c.FRAG_LOAD_ERROR="fragLoadError",c.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",c.FRAG_DECRYPT_ERROR="fragDecryptError",c.FRAG_PARSING_ERROR="fragParsingError",c.REMUX_ALLOC_ERROR="remuxAllocError",c.KEY_LOAD_ERROR="keyLoadError",c.KEY_LOAD_TIMEOUT="keyLoadTimeOut",c.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",c.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",c.BUFFER_APPEND_ERROR="bufferAppendError",c.BUFFER_APPENDING_ERROR="bufferAppendingError",c.BUFFER_STALLED_ERROR="bufferStalledError",c.BUFFER_FULL_ERROR="bufferFullError",c.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",c.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",c.INTERNAL_EXCEPTION="internalException",c.INTERNAL_ABORTED="aborted",c.UNKNOWN="unknown"})(T||(T={}))},"./src/events.ts":function(I,h,S){"use strict";S.r(h),S.d(h,"Events",function(){return L});var L;(function(T){T.MEDIA_ATTACHING="hlsMediaAttaching",T.MEDIA_ATTACHED="hlsMediaAttached",T.MEDIA_DETACHING="hlsMediaDetaching",T.MEDIA_DETACHED="hlsMediaDetached",T.BUFFER_RESET="hlsBufferReset",T.BUFFER_CODECS="hlsBufferCodecs",T.BUFFER_CREATED="hlsBufferCreated",T.BUFFER_APPENDING="hlsBufferAppending",T.BUFFER_APPENDED="hlsBufferAppended",T.BUFFER_EOS="hlsBufferEos",T.BUFFER_FLUSHING="hlsBufferFlushing",T.BUFFER_FLUSHED="hlsBufferFlushed",T.MANIFEST_LOADING="hlsManifestLoading",T.MANIFEST_LOADED="hlsManifestLoaded",T.MANIFEST_PARSED="hlsManifestParsed",T.LEVEL_SWITCHING="hlsLevelSwitching",T.LEVEL_SWITCHED="hlsLevelSwitched",T.LEVEL_LOADING="hlsLevelLoading",T.LEVEL_LOADED="hlsLevelLoaded",T.LEVEL_UPDATED="hlsLevelUpdated",T.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",T.LEVELS_UPDATED="hlsLevelsUpdated",T.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",T.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",T.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",T.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",T.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",T.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",T.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",T.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",T.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",T.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",T.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",T.CUES_PARSED="hlsCuesParsed",T.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",T.INIT_PTS_FOUND="hlsInitPtsFound",T.FRAG_LOADING="hlsFragLoading",T.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",T.FRAG_LOADED="hlsFragLoaded",T.FRAG_DECRYPTED="hlsFragDecrypted",T.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",T.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",T.FRAG_PARSING_METADATA="hlsFragParsingMetadata",T.FRAG_PARSED="hlsFragParsed",T.FRAG_BUFFERED="hlsFragBuffered",T.FRAG_CHANGED="hlsFragChanged",T.FPS_DROP="hlsFpsDrop",T.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",T.ERROR="hlsError",T.DESTROYING="hlsDestroying",T.KEY_LOADING="hlsKeyLoading",T.KEY_LOADED="hlsKeyLoaded",T.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",T.BACK_BUFFER_REACHED="hlsBackBufferReached"})(L||(L={}))},"./src/hls.ts":function(I,h,S){"use strict";S.r(h),S.d(h,"default",function(){return v});var L=S("./node_modules/url-toolkit/src/url-toolkit.js"),T=S.n(L),c=S("./src/loader/playlist-loader.ts"),C=S("./src/loader/key-loader.ts"),g=S("./src/controller/id3-track-controller.ts"),s=S("./src/controller/latency-controller.ts"),a=S("./src/controller/level-controller.ts"),r=S("./src/controller/fragment-tracker.ts"),f=S("./src/controller/stream-controller.ts"),p=S("./src/is-supported.ts"),m=S("./src/utils/logger.ts"),E=S("./src/config.ts"),y=S("./node_modules/eventemitter3/index.js"),u=S.n(y),n=S("./src/events.ts"),o=S("./src/errors.ts");function l(i,R){for(var k=0;k<R.length;k++){var d=R[k];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(i,d.key,d)}}function w(i,R,k){return R&&l(i.prototype,R),k&&l(i,k),i}var v=function(){i.isSupported=function(){return Object(p.isSupported)()};function i(k){k===void 0&&(k={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new y.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 d=this.config=Object(E.mergeConfig)(i.DefaultConfig,k);this.userConfig=k,Object(m.enableLogs)(d.debug),this._autoLevelCapping=-1,d.progressive&&Object(E.enableStreamingMode)(d);var b=d.abrController,x=d.bufferController,_=d.capLevelController,B=d.fpsController,U=this.abrController=new b(this),P=this.bufferController=new x(this),J=this.capLevelController=new _(this),$=new B(this),z=new c.default(this),V=new C.default(this),K=new g.default(this),H=this.levelController=new a.default(this),G=new r.FragmentTracker(this),ie=this.streamController=new f.default(this,G);J.setStreamController(ie),$.setStreamController(ie);var le=[H,ie];this.networkControllers=le;var ue=[z,V,U,P,J,$,K,G];this.audioTrackController=this.createController(d.audioTrackController,null,le),this.createController(d.audioStreamController,G,le),this.subtitleTrackController=this.createController(d.subtitleTrackController,null,le),this.createController(d.subtitleStreamController,G,le),this.createController(d.timelineController,null,ue),this.emeController=this.createController(d.emeController,null,ue),this.cmcdController=this.createController(d.cmcdController,null,ue),this.latencyController=this.createController(s.default,null,ue),this.coreComponents=ue}var R=i.prototype;return R.createController=function(d,b,x){if(d){var _=b?new d(this,b):new d(this);return x&&x.push(_),_}return null},R.on=function(d,b,x){x===void 0&&(x=this),this._emitter.on(d,b,x)},R.once=function(d,b,x){x===void 0&&(x=this),this._emitter.once(d,b,x)},R.removeAllListeners=function(d){this._emitter.removeAllListeners(d)},R.off=function(d,b,x,_){x===void 0&&(x=this),this._emitter.off(d,b,x,_)},R.listeners=function(d){return this._emitter.listeners(d)},R.emit=function(d,b,x){return this._emitter.emit(d,b,x)},R.trigger=function(d,b){if(this.config.debug)return this.emit(d,d,b);try{return this.emit(d,d,b)}catch(x){m.logger.error("An internal error happened while handling event "+d+'. Error message: "'+x.message+'". Here is a stacktrace:',x),this.trigger(n.Events.ERROR,{type:o.ErrorTypes.OTHER_ERROR,details:o.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:d,error:x})}return!1},R.listenerCount=function(d){return this._emitter.listenerCount(d)},R.destroy=function(){m.logger.log("destroy"),this.trigger(n.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(d){return d.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(d){return d.destroy()}),this.coreComponents.length=0},R.attachMedia=function(d){m.logger.log("attachMedia"),this._media=d,this.trigger(n.Events.MEDIA_ATTACHING,{media:d})},R.detachMedia=function(){m.logger.log("detachMedia"),this.trigger(n.Events.MEDIA_DETACHING,void 0),this._media=null},R.loadSource=function(d){this.stopLoad();var b=this.media,x=this.url,_=this.url=L.buildAbsoluteURL(self.location.href,d,{alwaysNormalize:!0});m.logger.log("loadSource:"+_),b&&x&&x!==_&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(b)),this.trigger(n.Events.MANIFEST_LOADING,{url:d})},R.startLoad=function(d){d===void 0&&(d=-1),m.logger.log("startLoad("+d+")"),this.networkControllers.forEach(function(b){b.startLoad(d)})},R.stopLoad=function(){m.logger.log("stopLoad"),this.networkControllers.forEach(function(d){d.stopLoad()})},R.swapAudioCodec=function(){m.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},R.recoverMediaError=function(){m.logger.log("recoverMediaError");var d=this._media;this.detachMedia(),d&&this.attachMedia(d)},R.removeLevel=function(d,b){b===void 0&&(b=0),this.levelController.removeLevel(d,b)},w(i,[{key:"levels",get:function(){var d=this.levelController.levels;return d||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(d){m.logger.log("set currentLevel:"+d),this.loadLevel=d,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(d){m.logger.log("set nextLevel:"+d),this.levelController.manualLevel=d,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(d){m.logger.log("set loadLevel:"+d),this.levelController.manualLevel=d}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(d){this.levelController.nextLoadLevel=d}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(d){m.logger.log("set firstLevel:"+d),this.levelController.firstLevel=d}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(d){m.logger.log("set startLevel:"+d),d!==-1&&(d=Math.max(d,this.minAutoLevel)),this.levelController.startLevel=d}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(d){var b=!!d;b!==this.config.capLevelToPlayerSize&&(b?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=b)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(d){this._autoLevelCapping!==d&&(m.logger.log("set autoLevelCapping:"+d),this._autoLevelCapping=d)}},{key:"bandwidthEstimate",get:function(){var d=this.abrController.bwEstimator;return d?d.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var d=this.levels,b=this.config.minAutoBitrate;if(!d)return 0;for(var x=d.length,_=0;_<x;_++)if(d[_].maxBitrate>b)return _;return 0}},{key:"maxAutoLevel",get:function(){var d=this.levels,b=this.autoLevelCapping,x;return b===-1&&d&&d.length?x=d.length-1:x=b,x}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(d){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,d)}},{key:"audioTracks",get:function(){var d=this.audioTrackController;return d?d.audioTracks:[]}},{key:"audioTrack",get:function(){var d=this.audioTrackController;return d?d.audioTrack:-1},set:function(d){var b=this.audioTrackController;b&&(b.audioTrack=d)}},{key:"subtitleTracks",get:function(){var d=this.subtitleTrackController;return d?d.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var d=this.subtitleTrackController;return d?d.subtitleTrack:-1},set:function(d){var b=this.subtitleTrackController;b&&(b.subtitleTrack=d)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var d=this.subtitleTrackController;return d?d.subtitleDisplay:!1},set:function(d){var b=this.subtitleTrackController;b&&(b.subtitleDisplay=d)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(d){this.config.lowLatencyMode=d}},{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 o.ErrorTypes}},{key:"ErrorDetails",get:function(){return o.ErrorDetails}},{key:"DefaultConfig",get:function(){return i.defaultConfig?i.defaultConfig:E.hlsDefaultConfig},set:function(d){i.defaultConfig=d}}]),i}();v.defaultConfig=void 0},"./src/is-supported.ts":function(I,h,S){"use strict";S.r(h),S.d(h,"isSupported",function(){return c}),S.d(h,"changeTypeSupported",function(){return C});var L=S("./src/utils/mediasource-helper.ts");function T(){return self.SourceBuffer||self.WebKitSourceBuffer}function c(){var g=Object(L.getMediaSource)();if(!g)return!1;var s=T(),a=g&&typeof g.isTypeSupported=="function"&&g.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),r=!s||s.prototype&&typeof s.prototype.appendBuffer=="function"&&typeof s.prototype.remove=="function";return!!a&&!!r}function C(){var g,s=T();return typeof(s==null||((g=s.prototype)===null||g===void 0)?void 0:g.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(I,h,S){"use strict";S.r(h),S.d(h,"default",function(){return m}),S.d(h,"LoadError",function(){return y});var L=S("./src/polyfills/number.ts"),T=S("./src/errors.ts");function c(u,n){u.prototype=Object.create(n.prototype),u.prototype.constructor=u,r(u,n)}function C(u){var n=typeof Map=="function"?new Map:void 0;return C=function(l){if(l===null||!a(l))return l;if(typeof l!="function")throw new TypeError("Super expression must either be null or a function");if(typeof n!="undefined"){if(n.has(l))return n.get(l);n.set(l,w)}function w(){return g(l,arguments,f(this).constructor)}return w.prototype=Object.create(l.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),r(w,l)},C(u)}function g(u,n,o){return s()?g=Reflect.construct:g=function(w,v,i){var R=[null];R.push.apply(R,v);var k=Function.bind.apply(w,R),d=new k;return i&&r(d,i.prototype),d},g.apply(null,arguments)}function s(){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(u){return!1}}function a(u){return Function.toString.call(u).indexOf("[native code]")!==-1}function r(u,n){return r=Object.setPrototypeOf||function(l,w){return l.__proto__=w,l},r(u,n)}function f(u){return f=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},f(u)}var p=Math.pow(2,17),m=function(){function u(o){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=o}var n=u.prototype;return n.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},n.abort=function(){this.loader&&this.loader.abort()},n.load=function(l,w){var v=this,i=l.url;if(!i)return Promise.reject(new y({type:T.ErrorTypes.NETWORK_ERROR,details:T.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:l,networkDetails:null},"Fragment does not have a "+(i?"part list":"url")));this.abort();var R=this.config,k=R.fLoader,d=R.loader;return new Promise(function(b,x){v.loader&&v.loader.destroy();var _=v.loader=l.loader=k?new k(R):new d(R),B=E(l),U={timeout:R.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:R.fragLoadingMaxRetryTimeout,highWaterMark:p};l.stats=_.stats,_.load(B,U,{onSuccess:function(J,$,z,V){v.resetLoader(l,_),b({frag:l,part:null,payload:J.data,networkDetails:V})},onError:function(J,$,z){v.resetLoader(l,_),x(new y({type:T.ErrorTypes.NETWORK_ERROR,details:T.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:l,response:J,networkDetails:z}))},onAbort:function(J,$,z){v.resetLoader(l,_),x(new y({type:T.ErrorTypes.NETWORK_ERROR,details:T.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:l,networkDetails:z}))},onTimeout:function(J,$,z){v.resetLoader(l,_),x(new y({type:T.ErrorTypes.NETWORK_ERROR,details:T.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:l,networkDetails:z}))},onProgress:function(J,$,z,V){w&&w({frag:l,part:null,payload:z,networkDetails:V})}})})},n.loadPart=function(l,w,v){var i=this;this.abort();var R=this.config,k=R.fLoader,d=R.loader;return new Promise(function(b,x){i.loader&&i.loader.destroy();var _=i.loader=l.loader=k?new k(R):new d(R),B=E(l,w),U={timeout:R.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:R.fragLoadingMaxRetryTimeout,highWaterMark:p};w.stats=_.stats,_.load(B,U,{onSuccess:function(J,$,z,V){i.resetLoader(l,_),i.updateStatsFromPart(l,w);var K={frag:l,part:w,payload:J.data,networkDetails:V};v(K),b(K)},onError:function(J,$,z){i.resetLoader(l,_),x(new y({type:T.ErrorTypes.NETWORK_ERROR,details:T.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:l,part:w,response:J,networkDetails:z}))},onAbort:function(J,$,z){l.stats.aborted=w.stats.aborted,i.resetLoader(l,_),x(new y({type:T.ErrorTypes.NETWORK_ERROR,details:T.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:l,part:w,networkDetails:z}))},onTimeout:function(J,$,z){i.resetLoader(l,_),x(new y({type:T.ErrorTypes.NETWORK_ERROR,details:T.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:l,part:w,networkDetails:z}))}})})},n.updateStatsFromPart=function(l,w){var v=l.stats,i=w.stats,R=i.total;if(v.loaded+=i.loaded,R){var k=Math.round(l.duration/w.duration),d=Math.min(Math.round(v.loaded/R),k),b=k-d,x=b*Math.round(v.loaded/d);v.total=v.loaded+x}else v.total=Math.max(v.loaded,v.total);var _=v.loading,B=i.loading;_.start?_.first+=B.first-B.start:(_.start=B.start,_.first=B.first),_.end=B.end},n.resetLoader=function(l,w){l.loader=null,this.loader===w&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),w.destroy()},u}();function E(u,n){n===void 0&&(n=null);var o=n||u,l={frag:u,part:n,responseType:"arraybuffer",url:o.url,headers:{},rangeStart:0,rangeEnd:0},w=o.byteRangeStartOffset,v=o.byteRangeEndOffset;return Object(L.isFiniteNumber)(w)&&Object(L.isFiniteNumber)(v)&&(l.rangeStart=w,l.rangeEnd=v),l}var y=function(u){c(n,u);function n(o){for(var l,w=arguments.length,v=new Array(w>1?w-1:0),i=1;i<w;i++)v[i-1]=arguments[i];return l=u.call.apply(u,[this].concat(v))||this,l.data=void 0,l.data=o,l}return n}(C(Error))},"./src/loader/fragment.ts":function(I,h,S){"use strict";S.r(h),S.d(h,"ElementaryStreamTypes",function(){return m}),S.d(h,"BaseSegment",function(){return E}),S.d(h,"Fragment",function(){return y}),S.d(h,"Part",function(){return u});var L=S("./src/polyfills/number.ts"),T=S("./node_modules/url-toolkit/src/url-toolkit.js"),c=S.n(T),C=S("./src/utils/logger.ts"),g=S("./src/loader/level-key.ts"),s=S("./src/loader/load-stats.ts");function a(n,o){n.prototype=Object.create(o.prototype),n.prototype.constructor=n,r(n,o)}function r(n,o){return r=Object.setPrototypeOf||function(w,v){return w.__proto__=v,w},r(n,o)}function f(n,o){for(var l=0;l<o.length;l++){var w=o[l];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(n,w.key,w)}}function p(n,o,l){return o&&f(n.prototype,o),l&&f(n,l),n}var m;(function(n){n.AUDIO="audio",n.VIDEO="video",n.AUDIOVIDEO="audiovideo"})(m||(m={}));var E=function(){function n(l){var w;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(w={},w[m.AUDIO]=null,w[m.VIDEO]=null,w[m.AUDIOVIDEO]=null,w),this.baseurl=l}var o=n.prototype;return o.setByteRange=function(w,v){var i=w.split("@",2),R=[];i.length===1?R[0]=v?v.byteRangeEndOffset:0:R[0]=parseInt(i[1]),R[1]=parseInt(i[0])+R[0],this._byteRange=R},p(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(T.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(w){this._url=w}}]),n}(),y=function(n){a(o,n);function o(w,v){var i;return i=n.call(this,v)||this,i._decryptdata=null,i.rawProgramDateTime=null,i.programDateTime=null,i.tagList=[],i.duration=0,i.sn=0,i.levelkey=void 0,i.type=void 0,i.loader=null,i.level=-1,i.cc=0,i.startPTS=void 0,i.endPTS=void 0,i.appendedPTS=void 0,i.startDTS=void 0,i.endDTS=void 0,i.start=0,i.deltaPTS=void 0,i.maxStartPTS=void 0,i.minEndPTS=void 0,i.stats=new s.LoadStats,i.urlId=0,i.data=void 0,i.bitrateTest=!1,i.title=null,i.initSegment=null,i.type=w,i}var l=o.prototype;return l.createInitializationVector=function(v){for(var i=new Uint8Array(16),R=12;R<16;R++)i[R]=v>>8*(15-R)&255;return i},l.setDecryptDataFromLevelKey=function(v,i){var R=v;return(v==null?void 0:v.method)==="AES-128"&&v.uri&&!v.iv&&(R=g.LevelKey.fromURI(v.uri),R.method=v.method,R.iv=this.createInitializationVector(i),R.keyFormat="identity"),R},l.setElementaryStreamInfo=function(v,i,R,k,d,b){b===void 0&&(b=!1);var x=this.elementaryStreams,_=x[v];if(!_){x[v]={startPTS:i,endPTS:R,startDTS:k,endDTS:d,partial:b};return}_.startPTS=Math.min(_.startPTS,i),_.endPTS=Math.max(_.endPTS,R),_.startDTS=Math.min(_.startDTS,k),_.endDTS=Math.max(_.endDTS,d)},l.clearElementaryStreamInfo=function(){var v=this.elementaryStreams;v[m.AUDIO]=null,v[m.VIDEO]=null,v[m.AUDIOVIDEO]=null},p(o,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var v=this.sn;typeof v!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&C.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),v=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,v)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(L.isFiniteNumber)(this.programDateTime))return null;var v=Object(L.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+v*1e3}},{key:"encrypted",get:function(){var v;return!!((v=this.decryptdata)!==null&&v!==void 0&&v.keyFormat&&this.decryptdata.uri)}}]),o}(E),u=function(n){a(o,n);function o(l,w,v,i,R){var k;k=n.call(this,v)||this,k.fragOffset=0,k.duration=0,k.gap=!1,k.independent=!1,k.relurl=void 0,k.fragment=void 0,k.index=void 0,k.stats=new s.LoadStats,k.duration=l.decimalFloatingPoint("DURATION"),k.gap=l.bool("GAP"),k.independent=l.bool("INDEPENDENT"),k.relurl=l.enumeratedString("URI"),k.fragment=w,k.index=i;var d=l.enumeratedString("BYTERANGE");return d&&k.setByteRange(d,R),R&&(k.fragOffset=R.fragOffset+R.duration),k}return p(o,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var w=this.elementaryStreams;return!!(w.audio||w.video||w.audiovideo)}}]),o}(E)},"./src/loader/key-loader.ts":function(I,h,S){"use strict";S.r(h),S.d(h,"default",function(){return C});var L=S("./src/events.ts"),T=S("./src/errors.ts"),c=S("./src/utils/logger.ts"),C=function(){function g(a){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=a,this._registerListeners()}var s=g.prototype;return s._registerListeners=function(){this.hls.on(L.Events.KEY_LOADING,this.onKeyLoading,this)},s._unregisterListeners=function(){this.hls.off(L.Events.KEY_LOADING,this.onKeyLoading)},s.destroy=function(){this._unregisterListeners();for(var r in this.loaders){var f=this.loaders[r];f&&f.destroy()}this.loaders={}},s.onKeyLoading=function(r,f){var p=f.frag,m=p.type,E=this.loaders[m];if(!p.decryptdata){c.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var y=p.decryptdata.uri;if(y!==this.decrypturl||this.decryptkey===null){var u=this.hls.config;if(E&&(c.logger.warn("abort previous key loader for type:"+m),E.abort()),!y){c.logger.warn("key uri is falsy");return}var n=u.loader,o=p.loader=this.loaders[m]=new n(u);this.decrypturl=y,this.decryptkey=null;var l={url:y,frag:p,responseType:"arraybuffer"},w={timeout:u.fragLoadingTimeOut,maxRetry:0,retryDelay:u.fragLoadingRetryDelay,maxRetryDelay:u.fragLoadingMaxRetryTimeout,highWaterMark:0},v={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};o.load(l,w,v)}else this.decryptkey&&(p.decryptdata.key=this.decryptkey,this.hls.trigger(L.Events.KEY_LOADED,{frag:p}))},s.loadsuccess=function(r,f,p){var m=p.frag;if(!m.decryptdata){c.logger.error("after key load, decryptdata unset");return}this.decryptkey=m.decryptdata.key=new Uint8Array(r.data),m.loader=null,delete this.loaders[m.type],this.hls.trigger(L.Events.KEY_LOADED,{frag:m})},s.loaderror=function(r,f){var p=f.frag,m=p.loader;m&&m.abort(),delete this.loaders[p.type],this.hls.trigger(L.Events.ERROR,{type:T.ErrorTypes.NETWORK_ERROR,details:T.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:p,response:r})},s.loadtimeout=function(r,f){var p=f.frag,m=p.loader;m&&m.abort(),delete this.loaders[p.type],this.hls.trigger(L.Events.ERROR,{type:T.ErrorTypes.NETWORK_ERROR,details:T.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:p})},g}()},"./src/loader/level-details.ts":function(I,h,S){"use strict";S.r(h),S.d(h,"LevelDetails",function(){return g});var L=S("./src/polyfills/number.ts");function T(s,a){for(var r=0;r<a.length;r++){var f=a[r];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(s,f.key,f)}}function c(s,a,r){return a&&T(s.prototype,a),r&&T(s,r),s}var C=10,g=function(){function s(r){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=r}var a=s.prototype;return a.reloaded=function(f){if(!f){this.advanced=!0,this.updated=!0;return}var p=this.lastPartSn-f.lastPartSn,m=this.lastPartIndex-f.lastPartIndex;this.updated=this.endSN!==f.endSN||!!m||!!p,this.advanced=this.endSN>f.endSN||p>0||p===0&&m>0,this.updated||this.advanced?this.misses=Math.floor(f.misses*.6):this.misses=f.misses+1,this.availabilityDelay=f.availabilityDelay},c(s,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(L.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||C}},{key:"drift",get:function(){var f=this.driftEndTime-this.driftStartTime;if(f>0){var p=this.driftEnd-this.driftStart;return p*1e3/f}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var f;return(f=this.partList)!==null&&f!==void 0&&f.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var f;return(f=this.fragments)!==null&&f!==void 0&&f.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 f;return(f=this.partList)!==null&&f!==void 0&&f.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var f;return(f=this.partList)!==null&&f!==void 0&&f.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),s}()},"./src/loader/level-key.ts":function(I,h,S){"use strict";S.r(h),S.d(h,"LevelKey",function(){return g});var L=S("./node_modules/url-toolkit/src/url-toolkit.js"),T=S.n(L);function c(s,a){for(var r=0;r<a.length;r++){var f=a[r];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(s,f.key,f)}}function C(s,a,r){return a&&c(s.prototype,a),r&&c(s,r),s}var g=function(){s.fromURL=function(r,f){return new s(r,f)},s.fromURI=function(r){return new s(r)};function s(a,r){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,r?this._uri=Object(L.buildAbsoluteURL)(a,r,{alwaysNormalize:!0}):this._uri=a}return C(s,[{key:"uri",get:function(){return this._uri}}]),s}()},"./src/loader/load-stats.ts":function(I,h,S){"use strict";S.r(h),S.d(h,"LoadStats",function(){return L});var L=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(I,h,S){"use strict";S.r(h),S.d(h,"default",function(){return o});var L=S("./src/polyfills/number.ts"),T=S("./node_modules/url-toolkit/src/url-toolkit.js"),c=S.n(T),C=S("./src/loader/fragment.ts"),g=S("./src/loader/level-details.ts"),s=S("./src/loader/level-key.ts"),a=S("./src/utils/attr-list.ts"),r=S("./src/utils/logger.ts"),f=S("./src/utils/codecs.ts"),p=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,m=/#EXT-X-MEDIA:(.*)/g,E=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),y=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("|")),u=/\.(mp4|m4s|m4v|m4a)$/i;function n(R){var k,d;return u.test((k=(d=T.parseURL(R))===null||d===void 0?void 0:d.path)!=null?k:"")}var o=function(){function R(){}return R.findGroup=function(d,b){for(var x=0;x<d.length;x++){var _=d[x];if(_.id===b)return _}},R.convertAVC1ToAVCOTI=function(d){var b=d.split(".");if(b.length>2){var x=b.shift()+".";return x+=parseInt(b.shift()).toString(16),x+=("000"+parseInt(b.shift()).toString(16)).substr(-4),x}return d},R.resolve=function(d,b){return T.buildAbsoluteURL(b,d,{alwaysNormalize:!0})},R.parseMasterPlaylist=function(d,b){var x=[],_={},B=!1;p.lastIndex=0;for(var U;(U=p.exec(d))!=null;)if(U[1]){var P=new a.AttrList(U[1]),J={attrs:P,bitrate:P.decimalInteger("AVERAGE-BANDWIDTH")||P.decimalInteger("BANDWIDTH"),name:P.NAME,url:R.resolve(U[2],b)},$=P.decimalResolution("RESOLUTION");$&&(J.width=$.width,J.height=$.height),l((P.CODECS||"").split(/[ ,]+/).filter(function(V){return V}),J),J.videoCodec&&J.videoCodec.indexOf("avc1")!==-1&&(J.videoCodec=R.convertAVC1ToAVCOTI(J.videoCodec)),x.push(J)}else if(U[3]){var z=new a.AttrList(U[3]);z["DATA-ID"]&&(B=!0,_[z["DATA-ID"]]=z)}return{levels:x,sessionData:B?_:null}},R.parseMasterPlaylistMedia=function(d,b,x,_){_===void 0&&(_=[]);var B,U=[],P=0;for(m.lastIndex=0;(B=m.exec(d))!==null;){var J=new a.AttrList(B[1]);if(J.TYPE===x){var $={attrs:J,bitrate:0,id:P++,groupId:J["GROUP-ID"],instreamId:J["INSTREAM-ID"],name:J.NAME||J.LANGUAGE||"",type:x,default:J.bool("DEFAULT"),autoselect:J.bool("AUTOSELECT"),forced:J.bool("FORCED"),lang:J.LANGUAGE,url:J.URI?R.resolve(J.URI,b):""};if(_.length){var z=R.findGroup(_,$.groupId)||_[0];w($,z,"audioCodec"),w($,z,"textCodec")}U.push($)}}return U},R.parseLevelPlaylist=function(d,b,x,_,B){var U=new g.LevelDetails(b),P=U.fragments,J=null,$=0,z=0,V=0,K=0,H=null,G=new C.Fragment(_,b),ie,le,ue,be=-1,Ce=!1;for(E.lastIndex=0,U.m3u8=d;(ie=E.exec(d))!==null;){Ce&&(Ce=!1,G=new C.Fragment(_,b),G.start=V,G.sn=$,G.cc=K,G.level=x,J&&(G.initSegment=J,G.rawProgramDateTime=J.rawProgramDateTime));var se=ie[1];if(se){G.duration=parseFloat(se);var ce=(" "+ie[2]).slice(1);G.title=ce||null,G.tagList.push(ce?["INF",se,ce]:["INF",se])}else if(ie[3])Object(L.isFiniteNumber)(G.duration)&&(G.start=V,ue&&(G.levelkey=ue),G.sn=$,G.level=x,G.cc=K,G.urlId=B,P.push(G),G.relurl=(" "+ie[3]).slice(1),i(G,H),H=G,V+=G.duration,$++,z=0,Ce=!0);else if(ie[4]){var he=(" "+ie[4]).slice(1);H?G.setByteRange(he,H):G.setByteRange(he)}else if(ie[5])G.rawProgramDateTime=(" "+ie[5]).slice(1),G.tagList.push(["PROGRAM-DATE-TIME",G.rawProgramDateTime]),be===-1&&(be=P.length);else{if(ie=ie[0].match(y),!ie){r.logger.warn("No matches on slow regex match for level playlist!");continue}for(le=1;le<ie.length&&!(typeof ie[le]!="undefined");le++);var ae=(" "+ie[le]).slice(1),Q=(" "+ie[le+1]).slice(1),D=ie[le+2]?(" "+ie[le+2]).slice(1):"";switch(ae){case"PLAYLIST-TYPE":U.type=Q.toUpperCase();break;case"MEDIA-SEQUENCE":$=U.startSN=parseInt(Q);break;case"SKIP":{var F=new a.AttrList(Q),W=F.decimalInteger("SKIPPED-SEGMENTS");if(Object(L.isFiniteNumber)(W)){U.skippedSegments=W;for(var Y=W;Y--;)P.unshift(null);$+=W}var Z=F.enumeratedString("RECENTLY-REMOVED-DATERANGES");Z&&(U.recentlyRemovedDateranges=Z.split(" "));break}case"TARGETDURATION":U.targetduration=parseFloat(Q);break;case"VERSION":U.version=parseInt(Q);break;case"EXTM3U":break;case"ENDLIST":U.live=!1;break;case"#":(Q||D)&&G.tagList.push(D?[Q,D]:[Q]);break;case"DIS":K++;case"GAP":G.tagList.push([ae]);break;case"BITRATE":G.tagList.push([ae,Q]);break;case"DISCONTINUITY-SEQ":K=parseInt(Q);break;case"KEY":{var te,q=new a.AttrList(Q),X=q.enumeratedString("METHOD"),re=q.URI,me=q.hexadecimalInteger("IV"),ve=q.enumeratedString("KEYFORMATVERSIONS"),Te=q.enumeratedString("KEYID"),Re=(te=q.enumeratedString("KEYFORMAT"))!=null?te:"identity",Ie=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(Ie.indexOf(Re)>-1){r.logger.warn("Keyformat "+Re+" is not supported from the manifest");continue}else if(Re!=="identity")continue;X&&(ue=s.LevelKey.fromURL(b,re),re&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(X)>=0&&(ue.method=X,ue.keyFormat=Re,Te&&(ue.keyID=Te),ve&&(ue.keyFormatVersions=ve),ue.iv=me));break}case"START":{var je=new a.AttrList(Q),Ne=je.decimalFloatingPoint("TIME-OFFSET");Object(L.isFiniteNumber)(Ne)&&(U.startTimeOffset=Ne);break}case"MAP":{var We=new a.AttrList(Q);G.relurl=We.URI,We.BYTERANGE&&G.setByteRange(We.BYTERANGE),G.level=x,G.sn="initSegment",ue&&(G.levelkey=ue),G.initSegment=null,J=G,Ce=!0;break}case"SERVER-CONTROL":{var Be=new a.AttrList(Q);U.canBlockReload=Be.bool("CAN-BLOCK-RELOAD"),U.canSkipUntil=Be.optionalFloat("CAN-SKIP-UNTIL",0),U.canSkipDateRanges=U.canSkipUntil>0&&Be.bool("CAN-SKIP-DATERANGES"),U.partHoldBack=Be.optionalFloat("PART-HOLD-BACK",0),U.holdBack=Be.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var He=new a.AttrList(Q);U.partTarget=He.decimalFloatingPoint("PART-TARGET");break}case"PART":{var De=U.partList;De||(De=U.partList=[]);var Xe=z>0?De[De.length-1]:void 0,$e=z++,we=new C.Part(new a.AttrList(Q),G,b,$e,Xe);De.push(we),G.duration+=we.duration;break}case"PRELOAD-HINT":{var fe=new a.AttrList(Q);U.preloadHint=fe;break}case"RENDITION-REPORT":{var pe=new a.AttrList(Q);U.renditionReports=U.renditionReports||[],U.renditionReports.push(pe);break}default:r.logger.warn("line parsed but not handled: "+ie);break}}}H&&!H.relurl?(P.pop(),V-=H.duration,U.partList&&(U.fragmentHint=H)):U.partList&&(i(G,H),G.cc=K,U.fragmentHint=G);var ye=P.length,_e=P[0],xe=P[ye-1];if(V+=U.skippedSegments*U.targetduration,V>0&&ye&&xe){U.averagetargetduration=V/ye;var Se=xe.sn;U.endSN=Se!=="initSegment"?Se:0,_e&&(U.startCC=_e.cc,_e.initSegment||U.fragments.every(function(Ae){return Ae.relurl&&n(Ae.relurl)})&&(r.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),G=new C.Fragment(_,b),G.relurl=xe.relurl,G.level=x,G.sn="initSegment",_e.initSegment=G,U.needSidxRanges=!0))}else U.endSN=0,U.startCC=0;return U.fragmentHint&&(V+=U.fragmentHint.duration),U.totalduration=V,U.endCC=K,be>0&&v(P,be),U},R}();function l(R,k){["video","audio","text"].forEach(function(d){var b=R.filter(function(_){return Object(f.isCodecType)(_,d)});if(b.length){var x=b.filter(function(_){return _.lastIndexOf("avc1",0)===0||_.lastIndexOf("mp4a",0)===0});k[d+"Codec"]=x.length>0?x[0]:b[0],R=R.filter(function(_){return b.indexOf(_)===-1})}}),k.unknownCodecs=R}function w(R,k,d){var b=k[d];b&&(R[d]=b)}function v(R,k){for(var d=R[k],b=k;b--;){var x=R[b];if(!x)return;x.programDateTime=d.programDateTime-x.duration*1e3,d=x}}function i(R,k){R.rawProgramDateTime?R.programDateTime=Date.parse(R.rawProgramDateTime):k!=null&&k.programDateTime&&(R.programDateTime=k.endProgramDateTime),Object(L.isFiniteNumber)(R.programDateTime)||(R.programDateTime=null,R.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(I,h,S){"use strict";S.r(h);var L=S("./src/polyfills/number.ts"),T=S("./src/events.ts"),c=S("./src/errors.ts"),C=S("./src/utils/logger.ts"),g=S("./src/utils/mp4-tools.ts"),s=S("./src/loader/m3u8-parser.ts"),a=S("./src/types/loader.ts"),r=S("./src/utils/attr-list.ts");function f(E){var y=E.type;switch(y){case a.PlaylistContextType.AUDIO_TRACK:return a.PlaylistLevelType.AUDIO;case a.PlaylistContextType.SUBTITLE_TRACK:return a.PlaylistLevelType.SUBTITLE;default:return a.PlaylistLevelType.MAIN}}function p(E,y){var u=E.url;return(u===void 0||u.indexOf("data:")===0)&&(u=y.url),u}var m=function(){function E(u){this.hls=void 0,this.loaders=Object.create(null),this.hls=u,this.registerListeners()}var y=E.prototype;return y.registerListeners=function(){var n=this.hls;n.on(T.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.on(T.Events.LEVEL_LOADING,this.onLevelLoading,this),n.on(T.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),n.on(T.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},y.unregisterListeners=function(){var n=this.hls;n.off(T.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.off(T.Events.LEVEL_LOADING,this.onLevelLoading,this),n.off(T.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),n.off(T.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},y.createInternalLoader=function(n){var o=this.hls.config,l=o.pLoader,w=o.loader,v=l||w,i=new v(o);return n.loader=i,this.loaders[n.type]=i,i},y.getInternalLoader=function(n){return this.loaders[n.type]},y.resetInternalLoader=function(n){this.loaders[n]&&delete this.loaders[n]},y.destroyInternalLoaders=function(){for(var n in this.loaders){var o=this.loaders[n];o&&o.destroy(),this.resetInternalLoader(n)}},y.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},y.onManifestLoading=function(n,o){var l=o.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:a.PlaylistContextType.MANIFEST,url:l,deliveryDirectives:null})},y.onLevelLoading=function(n,o){var l=o.id,w=o.level,v=o.url,i=o.deliveryDirectives;this.load({id:l,groupId:null,level:w,responseType:"text",type:a.PlaylistContextType.LEVEL,url:v,deliveryDirectives:i})},y.onAudioTrackLoading=function(n,o){var l=o.id,w=o.groupId,v=o.url,i=o.deliveryDirectives;this.load({id:l,groupId:w,level:null,responseType:"text",type:a.PlaylistContextType.AUDIO_TRACK,url:v,deliveryDirectives:i})},y.onSubtitleTrackLoading=function(n,o){var l=o.id,w=o.groupId,v=o.url,i=o.deliveryDirectives;this.load({id:l,groupId:w,level:null,responseType:"text",type:a.PlaylistContextType.SUBTITLE_TRACK,url:v,deliveryDirectives:i})},y.load=function(n){var o,l=this.hls.config,w=this.getInternalLoader(n);if(w){var v=w.context;if(v&&v.url===n.url){C.logger.trace("[playlist-loader]: playlist request ongoing");return}C.logger.log("[playlist-loader]: aborting previous loader for type: "+n.type),w.abort()}var i,R,k,d;switch(n.type){case a.PlaylistContextType.MANIFEST:i=l.manifestLoadingMaxRetry,R=l.manifestLoadingTimeOut,k=l.manifestLoadingRetryDelay,d=l.manifestLoadingMaxRetryTimeout;break;case a.PlaylistContextType.LEVEL:case a.PlaylistContextType.AUDIO_TRACK:case a.PlaylistContextType.SUBTITLE_TRACK:i=0,R=l.levelLoadingTimeOut;break;default:i=l.levelLoadingMaxRetry,R=l.levelLoadingTimeOut,k=l.levelLoadingRetryDelay,d=l.levelLoadingMaxRetryTimeout;break}if(w=this.createInternalLoader(n),(o=n.deliveryDirectives)!==null&&o!==void 0&&o.part){var b;if(n.type===a.PlaylistContextType.LEVEL&&n.level!==null?b=this.hls.levels[n.level].details:n.type===a.PlaylistContextType.AUDIO_TRACK&&n.id!==null?b=this.hls.audioTracks[n.id].details:n.type===a.PlaylistContextType.SUBTITLE_TRACK&&n.id!==null&&(b=this.hls.subtitleTracks[n.id].details),b){var x=b.partTarget,_=b.targetduration;x&&_&&(R=Math.min(Math.max(x*3,_*.8)*1e3,R))}}var B={timeout:R,maxRetry:i,retryDelay:k,maxRetryDelay:d,highWaterMark:0},U={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};w.load(n,B,U)},y.loadsuccess=function(n,o,l,w){if(w===void 0&&(w=null),l.isSidxRequest){this.handleSidxRequest(n,l),this.handlePlaylistLoaded(n,o,l,w);return}this.resetInternalLoader(l.type);var v=n.data;if(v.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(n,l,"no EXTM3U delimiter",w);return}o.parsing.start=performance.now(),v.indexOf("#EXTINF:")>0||v.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(n,o,l,w):this.handleMasterPlaylist(n,o,l,w)},y.loaderror=function(n,o,l){l===void 0&&(l=null),this.handleNetworkError(o,l,!1,n)},y.loadtimeout=function(n,o,l){l===void 0&&(l=null),this.handleNetworkError(o,l,!0)},y.handleMasterPlaylist=function(n,o,l,w){var v=this.hls,i=n.data,R=p(n,l),k=s.default.parseMasterPlaylist(i,R),d=k.levels,b=k.sessionData;if(!d.length){this.handleManifestParsingError(n,l,"no level found in manifest",w);return}var x=d.map(function($){return{id:$.attrs.AUDIO,audioCodec:$.audioCodec}}),_=d.map(function($){return{id:$.attrs.SUBTITLES,textCodec:$.textCodec}}),B=s.default.parseMasterPlaylistMedia(i,R,"AUDIO",x),U=s.default.parseMasterPlaylistMedia(i,R,"SUBTITLES",_),P=s.default.parseMasterPlaylistMedia(i,R,"CLOSED-CAPTIONS");if(B.length){var J=B.some(function($){return!$.url});!J&&d[0].audioCodec&&!d[0].attrs.AUDIO&&(C.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),B.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new r.AttrList({}),bitrate:0,url:""}))}v.trigger(T.Events.MANIFEST_LOADED,{levels:d,audioTracks:B,subtitles:U,captions:P,url:R,stats:o,networkDetails:w,sessionData:b})},y.handleTrackOrLevelPlaylist=function(n,o,l,w){var v=this.hls,i=l.id,R=l.level,k=l.type,d=p(n,l),b=Object(L.isFiniteNumber)(i)?i:0,x=Object(L.isFiniteNumber)(R)?R:b,_=f(l),B=s.default.parseLevelPlaylist(n.data,d,x,_,b);if(!B.fragments.length){v.trigger(T.Events.ERROR,{type:c.ErrorTypes.NETWORK_ERROR,details:c.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:d,reason:"no fragments found in level",level:typeof l.level=="number"?l.level:void 0});return}if(k===a.PlaylistContextType.MANIFEST){var U={attrs:new r.AttrList({}),bitrate:0,details:B,name:"",url:d};v.trigger(T.Events.MANIFEST_LOADED,{levels:[U],audioTracks:[],url:d,stats:o,networkDetails:w,sessionData:null})}if(o.parsing.end=performance.now(),B.needSidxRanges){var P,J=(P=B.fragments[0].initSegment)===null||P===void 0?void 0:P.url;this.load({url:J,isSidxRequest:!0,type:k,level:R,levelDetails:B,id:i,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}l.levelDetails=B,this.handlePlaylistLoaded(n,o,l,w)},y.handleSidxRequest=function(n,o){var l=Object(g.parseSegmentIndex)(new Uint8Array(n.data));if(!l)return;var w=l.references,v=o.levelDetails;w.forEach(function(i,R){var k=i.info,d=v.fragments[R];d.byteRange.length===0&&d.setByteRange(String(1+k.end-k.start)+"@"+String(k.start)),d.initSegment&&d.initSegment.setByteRange(String(l.moovEndOffset)+"@0")})},y.handleManifestParsingError=function(n,o,l,w){this.hls.trigger(T.Events.ERROR,{type:c.ErrorTypes.NETWORK_ERROR,details:c.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:o.type===a.PlaylistContextType.MANIFEST,url:n.url,reason:l,response:n,context:o,networkDetails:w})},y.handleNetworkError=function(n,o,l,w){l===void 0&&(l=!1),C.logger.warn("[playlist-loader]: A network "+(l?"timeout":"error")+" occurred while loading "+n.type+" level: "+n.level+" id: "+n.id+' group-id: "'+n.groupId+'"');var v=c.ErrorDetails.UNKNOWN,i=!1,R=this.getInternalLoader(n);switch(n.type){case a.PlaylistContextType.MANIFEST:v=l?c.ErrorDetails.MANIFEST_LOAD_TIMEOUT:c.ErrorDetails.MANIFEST_LOAD_ERROR,i=!0;break;case a.PlaylistContextType.LEVEL:v=l?c.ErrorDetails.LEVEL_LOAD_TIMEOUT:c.ErrorDetails.LEVEL_LOAD_ERROR,i=!1;break;case a.PlaylistContextType.AUDIO_TRACK:v=l?c.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:c.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,i=!1;break;case a.PlaylistContextType.SUBTITLE_TRACK:v=l?c.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:c.ErrorDetails.SUBTITLE_LOAD_ERROR,i=!1;break}R&&this.resetInternalLoader(n.type);var k={type:c.ErrorTypes.NETWORK_ERROR,details:v,fatal:i,url:n.url,loader:R,context:n,networkDetails:o};w&&(k.response=w),this.hls.trigger(T.Events.ERROR,k)},y.handlePlaylistLoaded=function(n,o,l,w){var v=l.type,i=l.level,R=l.id,k=l.groupId,d=l.loader,b=l.levelDetails,x=l.deliveryDirectives;if(!(b!=null&&b.targetduration)){this.handleManifestParsingError(n,l,"invalid target duration",w);return}if(!d)return;b.live&&(d.getCacheAge&&(b.ageHeader=d.getCacheAge()||0),(!d.getCacheAge||isNaN(b.ageHeader))&&(b.ageHeader=0));switch(v){case a.PlaylistContextType.MANIFEST:case a.PlaylistContextType.LEVEL:this.hls.trigger(T.Events.LEVEL_LOADED,{details:b,level:i||0,id:R||0,stats:o,networkDetails:w,deliveryDirectives:x});break;case a.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(T.Events.AUDIO_TRACK_LOADED,{details:b,id:R||0,groupId:k||"",stats:o,networkDetails:w,deliveryDirectives:x});break;case a.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(T.Events.SUBTITLE_TRACK_LOADED,{details:b,id:R||0,groupId:k||"",stats:o,networkDetails:w,deliveryDirectives:x});break}},E}();h.default=m},"./src/polyfills/number.ts":function(I,h,S){"use strict";S.r(h),S.d(h,"isFiniteNumber",function(){return L}),S.d(h,"MAX_SAFE_INTEGER",function(){return T});var L=Number.isFinite||function(c){return typeof c=="number"&&isFinite(c)},T=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(I,h,S){"use strict";S.r(h);var L=function(){function T(){}return T.getSilentFrame=function(C,g){switch(C){case"mp4a.40.2":if(g===1)return new Uint8Array([0,200,0,128,35,128]);if(g===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(g===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(g===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(g===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(g===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(g===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(g===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(g===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},T}();h.default=L},"./src/remux/mp4-generator.ts":function(I,h,S){"use strict";S.r(h);var L=Math.pow(2,32)-1,T=function(){function c(){}return c.init=function(){c.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 g;for(g in c.types)c.types.hasOwnProperty(g)&&(c.types[g]=[g.charCodeAt(0),g.charCodeAt(1),g.charCodeAt(2),g.charCodeAt(3)]);var s=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]),a=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]);c.HDLR_TYPES={video:s,audio:a};var r=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),f=new Uint8Array([0,0,0,0,0,0,0,0]);c.STTS=c.STSC=c.STCO=f,c.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),c.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),c.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),c.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var p=new Uint8Array([105,115,111,109]),m=new Uint8Array([97,118,99,49]),E=new Uint8Array([0,0,0,1]);c.FTYP=c.box(c.types.ftyp,p,E,p,m),c.DINF=c.box(c.types.dinf,c.box(c.types.dref,r))},c.box=function(g){for(var s=8,a=arguments.length,r=new Array(a>1?a-1:0),f=1;f<a;f++)r[f-1]=arguments[f];for(var p=r.length,m=p;p--;)s+=r[p].byteLength;var E=new Uint8Array(s);for(E[0]=s>>24&255,E[1]=s>>16&255,E[2]=s>>8&255,E[3]=s&255,E.set(g,4),p=0,s=8;p<m;p++)E.set(r[p],s),s+=r[p].byteLength;return E},c.hdlr=function(g){return c.box(c.types.hdlr,c.HDLR_TYPES[g])},c.mdat=function(g){return c.box(c.types.mdat,g)},c.mdhd=function(g,s){s*=g;var a=Math.floor(s/(L+1)),r=Math.floor(s%(L+1));return c.box(c.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,g>>24&255,g>>16&255,g>>8&255,g&255,a>>24,a>>16&255,a>>8&255,a&255,r>>24,r>>16&255,r>>8&255,r&255,85,196,0,0]))},c.mdia=function(g){return c.box(c.types.mdia,c.mdhd(g.timescale,g.duration),c.hdlr(g.type),c.minf(g))},c.mfhd=function(g){return c.box(c.types.mfhd,new Uint8Array([0,0,0,0,g>>24,g>>16&255,g>>8&255,g&255]))},c.minf=function(g){return g.type==="audio"?c.box(c.types.minf,c.box(c.types.smhd,c.SMHD),c.DINF,c.stbl(g)):c.box(c.types.minf,c.box(c.types.vmhd,c.VMHD),c.DINF,c.stbl(g))},c.moof=function(g,s,a){return c.box(c.types.moof,c.mfhd(g),c.traf(a,s))},c.moov=function(g){for(var s=g.length,a=[];s--;)a[s]=c.trak(g[s]);return c.box.apply(null,[c.types.moov,c.mvhd(g[0].timescale,g[0].duration)].concat(a).concat(c.mvex(g)))},c.mvex=function(g){for(var s=g.length,a=[];s--;)a[s]=c.trex(g[s]);return c.box.apply(null,[c.types.mvex].concat(a))},c.mvhd=function(g,s){s*=g;var a=Math.floor(s/(L+1)),r=Math.floor(s%(L+1)),f=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,g>>24&255,g>>16&255,g>>8&255,g&255,a>>24,a>>16&255,a>>8&255,a&255,r>>24,r>>16&255,r>>8&255,r&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 c.box(c.types.mvhd,f)},c.sdtp=function(g){var s=g.samples||[],a=new Uint8Array(4+s.length),r,f;for(r=0;r<s.length;r++)f=s[r].flags,a[r+4]=f.dependsOn<<4|f.isDependedOn<<2|f.hasRedundancy;return c.box(c.types.sdtp,a)},c.stbl=function(g){return c.box(c.types.stbl,c.stsd(g),c.box(c.types.stts,c.STTS),c.box(c.types.stsc,c.STSC),c.box(c.types.stsz,c.STSZ),c.box(c.types.stco,c.STCO))},c.avc1=function(g){var s=[],a=[],r,f,p;for(r=0;r<g.sps.length;r++)f=g.sps[r],p=f.byteLength,s.push(p>>>8&255),s.push(p&255),s=s.concat(Array.prototype.slice.call(f));for(r=0;r<g.pps.length;r++)f=g.pps[r],p=f.byteLength,a.push(p>>>8&255),a.push(p&255),a=a.concat(Array.prototype.slice.call(f));var m=c.box(c.types.avcC,new Uint8Array([1,s[3],s[4],s[5],252|3,224|g.sps.length].concat(s).concat([g.pps.length]).concat(a))),E=g.width,y=g.height,u=g.pixelRatio[0],n=g.pixelRatio[1];return c.box(c.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,E>>8&255,E&255,y>>8&255,y&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]),m,c.box(c.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),c.box(c.types.pasp,new Uint8Array([u>>24,u>>16&255,u>>8&255,u&255,n>>24,n>>16&255,n>>8&255,n&255])))},c.esds=function(g){var s=g.config.length;return new Uint8Array([0,0,0,0,3,23+s,0,1,0,4,15+s,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([s]).concat(g.config).concat([6,1,2]))},c.mp4a=function(g){var s=g.samplerate;return c.box(c.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,g.channelCount,0,16,0,0,0,0,s>>8&255,s&255,0,0]),c.box(c.types.esds,c.esds(g)))},c.mp3=function(g){var s=g.samplerate;return c.box(c.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,g.channelCount,0,16,0,0,0,0,s>>8&255,s&255,0,0]))},c.stsd=function(g){return g.type==="audio"?!g.isAAC&&g.codec==="mp3"?c.box(c.types.stsd,c.STSD,c.mp3(g)):c.box(c.types.stsd,c.STSD,c.mp4a(g)):c.box(c.types.stsd,c.STSD,c.avc1(g))},c.tkhd=function(g){var s=g.id,a=g.duration*g.timescale,r=g.width,f=g.height,p=Math.floor(a/(L+1)),m=Math.floor(a%(L+1));return c.box(c.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,s>>24&255,s>>16&255,s>>8&255,s&255,0,0,0,0,p>>24,p>>16&255,p>>8&255,p&255,m>>24,m>>16&255,m>>8&255,m&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,r>>8&255,r&255,0,0,f>>8&255,f&255,0,0]))},c.traf=function(g,s){var a=c.sdtp(g),r=g.id,f=Math.floor(s/(L+1)),p=Math.floor(s%(L+1));return c.box(c.types.traf,c.box(c.types.tfhd,new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,r&255])),c.box(c.types.tfdt,new Uint8Array([1,0,0,0,f>>24,f>>16&255,f>>8&255,f&255,p>>24,p>>16&255,p>>8&255,p&255])),c.trun(g,a.length+16+20+8+16+8+8),a)},c.trak=function(g){return g.duration=g.duration||4294967295,c.box(c.types.trak,c.tkhd(g),c.mdia(g))},c.trex=function(g){var s=g.id;return c.box(c.types.trex,new Uint8Array([0,0,0,0,s>>24,s>>16&255,s>>8&255,s&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},c.trun=function(g,s){var a=g.samples||[],r=a.length,f=12+16*r,p=new Uint8Array(f),m,E,y,u,n,o;for(s+=8+f,p.set([0,0,15,1,r>>>24&255,r>>>16&255,r>>>8&255,r&255,s>>>24&255,s>>>16&255,s>>>8&255,s&255],0),m=0;m<r;m++)E=a[m],y=E.duration,u=E.size,n=E.flags,o=E.cts,p.set([y>>>24&255,y>>>16&255,y>>>8&255,y&255,u>>>24&255,u>>>16&255,u>>>8&255,u&255,n.isLeading<<2|n.dependsOn,n.isDependedOn<<6|n.hasRedundancy<<4|n.paddingValue<<1|n.isNonSync,n.degradPrio&240<<8,n.degradPrio&15,o>>>24&255,o>>>16&255,o>>>8&255,o&255],12+16*m);return c.box(c.types.trun,p)},c.initSegment=function(g){c.types||c.init();var s=c.moov(g),a=new Uint8Array(c.FTYP.byteLength+s.byteLength);return a.set(c.FTYP),a.set(s,c.FTYP.byteLength),a},c}();T.types=void 0,T.HDLR_TYPES=void 0,T.STTS=void 0,T.STSC=void 0,T.STCO=void 0,T.STSZ=void 0,T.VMHD=void 0,T.SMHD=void 0,T.STSD=void 0,T.FTYP=void 0,T.DINF=void 0,h.default=T},"./src/remux/mp4-remuxer.ts":function(I,h,S){"use strict";S.r(h),S.d(h,"default",function(){return o}),S.d(h,"normalizePts",function(){return l});var L=S("./src/polyfills/number.ts"),T=S("./src/remux/aac-helper.ts"),c=S("./src/remux/mp4-generator.ts"),C=S("./src/events.ts"),g=S("./src/errors.ts"),s=S("./src/utils/logger.ts"),a=S("./src/types/loader.ts"),r=S("./src/utils/timescale-conversion.ts");function f(){return f=Object.assign||function(R){for(var k=1;k<arguments.length;k++){var d=arguments[k];for(var b in d)Object.prototype.hasOwnProperty.call(d,b)&&(R[b]=d[b])}return R},f.apply(this,arguments)}var p=10*1e3,m=1024,E=1152,y=null,u=null,n=!1,o=function(){function R(d,b,x,_){if(_===void 0&&(_=""),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=d,this.config=b,this.typeSupported=x,this.ISGenerated=!1,y===null){var B=navigator.userAgent||"",U=B.match(/Chrome\/(\d+)/i);y=U?parseInt(U[1]):0}if(u===null){var P=navigator.userAgent.match(/Safari\/(\d+)/i);u=P?parseInt(P[1]):0}n=!!y&&y<75||!!u&&u<600}var k=R.prototype;return k.destroy=function(){},k.resetTimeStamp=function(b){s.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=b},k.resetNextTimestamp=function(){s.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},k.resetInitSegment=function(){s.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},k.getVideoStartPts=function(b){var x=!1,_=b.reduce(function(B,U){var P=U.pts-B;return P<-4294967296?(x=!0,l(B,U.pts)):P>0?B:U.pts},b[0].pts);return x&&s.logger.debug("PTS rollover detected"),_},k.remux=function(b,x,_,B,U,P,J,$){var z,V,K,H,G,ie,le=U,ue=U,be=b.pid>-1,Ce=x.pid>-1,se=x.samples.length,ce=b.samples.length>0,he=se>1,ae=(!be||ce)&&(!Ce||he)||this.ISGenerated||J;if(ae){this.ISGenerated||(K=this.generateIS(b,x,U));var Q=this.isVideoContiguous,D=-1;if(he&&(D=w(x.samples),!Q&&this.config.forceKeyFrameOnDiscontinuity))if(ie=!0,D>0){s.logger.warn("[mp4-remuxer]: Dropped "+D+" out of "+se+" video samples due to a missing keyframe");var F=this.getVideoStartPts(x.samples);x.samples=x.samples.slice(D),x.dropped+=D,ue+=(x.samples[0].pts-F)/(x.timescale||9e4)}else D===-1&&(s.logger.warn("[mp4-remuxer]: No keyframe found out of "+se+" video samples"),ie=!1);if(this.ISGenerated){if(ce&&he){var W=this.getVideoStartPts(x.samples),Y=l(b.samples[0].pts,W)-W,Z=Y/x.inputTimeScale;le+=Math.max(0,Z),ue+=Math.max(0,-Z)}if(ce){if(b.samplerate||(s.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),K=this.generateIS(b,x,U)),V=this.remuxAudio(b,le,this.isAudioContiguous,P,Ce||he||$===a.PlaylistLevelType.AUDIO?ue:void 0),he){var te=V?V.endPTS-V.startPTS:0;x.inputTimeScale||(s.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),K=this.generateIS(b,x,U)),z=this.remuxVideo(x,ue,Q,te)}}else he&&(z=this.remuxVideo(x,ue,Q,0));z&&(z.firstKeyFrame=D,z.independent=D!==-1)}}return this.ISGenerated&&(_.samples.length&&(G=this.remuxID3(_,U)),B.samples.length&&(H=this.remuxText(B,U))),{audio:V,video:z,initSegment:K,independent:ie,text:H,id3:G}},k.generateIS=function(b,x,_){var B=b.samples,U=x.samples,P=this.typeSupported,J={},$=!Object(L.isFiniteNumber)(this._initPTS),z="audio/mp4",V,K,H;if($&&(V=K=Infinity),b.config&&B.length&&(b.timescale=b.samplerate,b.isAAC||(P.mpeg?(z="audio/mpeg",b.codec=""):P.mp3&&(b.codec="mp3")),J.audio={id:"audio",container:z,codec:b.codec,initSegment:!b.isAAC&&P.mpeg?new Uint8Array(0):c.default.initSegment([b]),metadata:{channelCount:b.channelCount}},$&&(H=b.inputTimeScale,V=K=B[0].pts-Math.round(H*_))),x.sps&&x.pps&&U.length&&(x.timescale=x.inputTimeScale,J.video={id:"main",container:"video/mp4",codec:x.codec,initSegment:c.default.initSegment([x]),metadata:{width:x.width,height:x.height}},$)){H=x.inputTimeScale;var G=this.getVideoStartPts(U),ie=Math.round(H*_);K=Math.min(K,l(U[0].dts,G)-ie),V=Math.min(V,G-ie)}if(Object.keys(J).length)return this.ISGenerated=!0,$&&(this._initPTS=V,this._initDTS=K),{tracks:J,initPTS:V,timescale:H}},k.remuxVideo=function(b,x,_,B){var U=b.inputTimeScale,P=b.samples,J=[],$=P.length,z=this._initPTS,V=this.nextAvcDts,K=8,H,G,ie,le=Number.POSITIVE_INFINITY,ue=Number.NEGATIVE_INFINITY,be=0,Ce=!1;if(!_||V===null){var se=x*U,ce=P[0].pts-l(P[0].dts,P[0].pts);V=se-ce}for(var he=0;he<$;he++){var ae=P[he];if(ae.pts=l(ae.pts-z,V),ae.dts=l(ae.dts-z,V),ae.dts>ae.pts){var Q=9e4*.2;be=Math.max(Math.min(be,ae.pts-ae.dts),-1*Q)}ae.dts<P[he>0?he-1:he].dts&&(Ce=!0)}Ce&&P.sort(function(pt,st){var tt=pt.dts-st.dts,Pt=pt.pts-st.pts;return tt||Pt}),G=P[0].dts,ie=P[P.length-1].dts;var D=Math.round((ie-G)/($-1));if(be<0){if(be<D*-2){s.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(r.toMsFromMpegTsClock)(-D,!0)+" ms");for(var F=be,W=0;W<$;W++)P[W].dts=F=Math.max(F,P[W].pts-D),P[W].pts=Math.max(F,P[W].pts)}else{s.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(r.toMsFromMpegTsClock)(be,!0)+" ms to overcome this issue");for(var Y=0;Y<$;Y++)P[Y].dts=P[Y].dts+be}G=P[0].dts}if(_){var Z=G-V,te=Z>D,q=Z<-1;if(te||q){te?s.logger.warn("AVC: "+Object(r.toMsFromMpegTsClock)(Z,!0)+" ms ("+Z+"dts) hole between fragments detected, filling it"):s.logger.warn("AVC: "+Object(r.toMsFromMpegTsClock)(-Z,!0)+" ms ("+Z+"dts) overlapping between fragments detected"),G=V;var X=P[0].pts-Z;P[0].dts=G,P[0].pts=X,s.logger.log("Video: First PTS/DTS adjusted: "+Object(r.toMsFromMpegTsClock)(X,!0)+"/"+Object(r.toMsFromMpegTsClock)(G,!0)+", delta: "+Object(r.toMsFromMpegTsClock)(Z,!0)+" ms")}}n&&(G=Math.max(0,G));for(var re=0,me=0,ve=0;ve<$;ve++){for(var Te=P[ve],Re=Te.units,Ie=Re.length,je=0,Ne=0;Ne<Ie;Ne++)je+=Re[Ne].data.length;me+=je,re+=Ie,Te.length=je,Te.dts=Math.max(Te.dts,G),Te.pts=Math.max(Te.pts,Te.dts,0),le=Math.min(Te.pts,le),ue=Math.max(Te.pts,ue)}ie=P[$-1].dts;var We=me+4*re+8,Be;try{Be=new Uint8Array(We)}catch(pt){this.observer.emit(C.Events.ERROR,C.Events.ERROR,{type:g.ErrorTypes.MUX_ERROR,details:g.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:We,reason:"fail allocating video mdat "+We});return}var He=new DataView(Be.buffer);He.setUint32(0,We),Be.set(c.default.types.mdat,4);for(var De=0;De<$;De++){for(var Xe=P[De],$e=Xe.units,we=0,fe=0,pe=$e.length;fe<pe;fe++){var ye=$e[fe],_e=ye.data,xe=ye.data.byteLength;He.setUint32(K,xe),K+=4,Be.set(_e,K),K+=xe,we+=4+xe}if(De<$-1)H=P[De+1].dts-Xe.dts;else{var Se=this.config,Ae=Xe.dts-P[De>0?De-1:De].dts;if(Se.stretchShortVideoTrack&&this.nextAudioPts!==null){var Oe=Math.floor(Se.maxBufferHole*U),Le=(B?le+B*U:this.nextAudioPts)-Xe.pts;Le>Oe?(H=Le-Ae,H<0&&(H=Ae),s.logger.log("[mp4-remuxer]: It is approximately "+Le/90+" ms to the next segment; using duration "+H/90+" ms for the last video frame.")):H=Ae}else H=Ae}var Me=Math.round(Xe.pts-Xe.dts);J.push(new v(Xe.key,H,we,Me))}if(J.length&&y&&y<70){var Ke=J[0].flags;Ke.dependsOn=2,Ke.isNonSync=0}console.assert(H!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=V=ie+H,this.isVideoContiguous=!0;var Qe=c.default.moof(b.sequenceNumber++,G,f({},b,{samples:J})),Ye="video",nt={data1:Qe,data2:Be,startPTS:le/U,endPTS:(ue+H)/U,startDTS:G/U,endDTS:V/U,type:Ye,hasAudio:!1,hasVideo:!0,nb:J.length,dropped:b.dropped};return b.samples=[],b.dropped=0,console.assert(Be.length,"MDAT length must not be zero"),nt},k.remuxAudio=function(b,x,_,B,U){var P=b.inputTimeScale,J=b.samplerate?b.samplerate:P,$=P/J,z=b.isAAC?m:E,V=z*$,K=this._initPTS,H=!b.isAAC&&this.typeSupported.mpeg,G=[],ie=b.samples,le=H?0:8,ue=this.nextAudioPts||-1,be=x*P;if(this.isAudioContiguous=_=_||ie.length&&ue>0&&(B&&Math.abs(be-ue)<9e3||Math.abs(l(ie[0].pts-K,be)-ue)<20*V),ie.forEach(function(_e){_e.pts=l(_e.pts-K,be)}),!_||ue<0){if(ie=ie.filter(function(_e){return _e.pts>=0}),!ie.length)return;U===0?ue=0:B?ue=Math.max(0,be):ue=ie[0].pts}if(b.isAAC)for(var Ce=U!==void 0,se=this.config.maxAudioFramesDrift,ce=0,he=ue;ce<ie.length;ce++){var ae=ie[ce],Q=ae.pts,D=Q-he,F=Math.abs(1e3*D/P);if(D<=-se*V&&Ce)ce===0&&(s.logger.warn("Audio frame @ "+(Q/P).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*D/P)+" ms."),this.nextAudioPts=ue=he=Q);else if(D>=se*V&&F<p&&Ce){var W=Math.round(D/V);he=Q-W*V,he<0&&(W--,he+=V),ce===0&&(this.nextAudioPts=ue=he),s.logger.warn("[mp4-remuxer]: Injecting "+W+" audio frame @ "+(he/P).toFixed(3)+"s due to "+Math.round(1e3*D/P)+" ms gap.");for(var Y=0;Y<W;Y++){var Z=Math.max(he,0),te=T.default.getSilentFrame(b.manifestCodec||b.codec,b.channelCount);te||(s.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),te=ae.unit.subarray()),ie.splice(ce,0,{unit:te,pts:Z}),he+=V,ce++}}ae.pts=he,he+=V}for(var q=null,X=null,re,me=0,ve=ie.length;ve--;)me+=ie[ve].unit.byteLength;for(var Te=0,Re=ie.length;Te<Re;Te++){var Ie=ie[Te],je=Ie.unit,Ne=Ie.pts;if(X!==null){var We=G[Te-1];We.duration=Math.round((Ne-X)/$)}else if(_&&b.isAAC&&(Ne=ue),q=Ne,me>0){me+=le;try{re=new Uint8Array(me)}catch(_e){this.observer.emit(C.Events.ERROR,C.Events.ERROR,{type:g.ErrorTypes.MUX_ERROR,details:g.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:me,reason:"fail allocating audio mdat "+me});return}if(!H){var Be=new DataView(re.buffer);Be.setUint32(0,me),re.set(c.default.types.mdat,4)}}else return;re.set(je,le);var He=je.byteLength;le+=He,G.push(new v(!0,z,He,0)),X=Ne}var De=G.length;if(!De)return;var Xe=G[G.length-1];this.nextAudioPts=ue=X+$*Xe.duration;var $e=H?new Uint8Array(0):c.default.moof(b.sequenceNumber++,q/$,f({},b,{samples:G}));b.samples=[];var we=q/P,fe=ue/P,pe="audio",ye={data1:$e,data2:re,startPTS:we,endPTS:fe,startDTS:we,endDTS:fe,type:pe,hasAudio:!0,hasVideo:!1,nb:De};return this.isAudioContiguous=!0,console.assert(re.length,"MDAT length must not be zero"),ye},k.remuxEmptyAudio=function(b,x,_,B){var U=b.inputTimeScale,P=b.samplerate?b.samplerate:U,J=U/P,$=this.nextAudioPts,z=($!==null?$:B.startDTS*U)+this._initDTS,V=B.endDTS*U+this._initDTS,K=J*m,H=Math.ceil((V-z)/K),G=T.default.getSilentFrame(b.manifestCodec||b.codec,b.channelCount);if(s.logger.warn("[mp4-remuxer]: remux empty Audio"),!G){s.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var ie=[],le=0;le<H;le++){var ue=z+le*K;ie.push({unit:G,pts:ue,dts:ue})}return b.samples=ie,this.remuxAudio(b,x,_,!1)},k.remuxID3=function(b,x){var _=b.samples.length;if(!_)return;for(var B=b.inputTimeScale,U=this._initPTS,P=this._initDTS,J=0;J<_;J++){var $=b.samples[J];$.pts=l($.pts-U,x*B)/B,$.dts=l($.dts-P,x*B)/B}var z=b.samples;return b.samples=[],{samples:z}},k.remuxText=function(b,x){var _=b.samples.length;if(!_)return;for(var B=b.inputTimeScale,U=this._initPTS,P=0;P<_;P++){var J=b.samples[P];J.pts=l(J.pts-U,x*B)/B}b.samples.sort(function(z,V){return z.pts-V.pts});var $=b.samples;return b.samples=[],{samples:$}},R}();function l(R,k){var d;if(k===null)return R;for(k<R?d=-8589934592:d=8589934592;Math.abs(R-k)>4294967296;)R+=d;return R}function w(R){for(var k=0;k<R.length;k++)if(R[k].key)return k;return-1}var v=function(k,d,b,x){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=d,this.size=b,this.cts=x,this.flags=new i(k)},i=function(k){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=k?2:1,this.isNonSync=k?0:1}},"./src/remux/passthrough-remuxer.ts":function(I,h,S){"use strict";S.r(h);var L=S("./src/polyfills/number.ts"),T=S("./src/utils/mp4-tools.ts"),c=S("./src/loader/fragment.ts"),C=S("./src/utils/logger.ts"),g=function(){function r(){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 f=r.prototype;return f.destroy=function(){},f.resetTimeStamp=function(m){this.initPTS=m,this.lastEndDTS=null},f.resetNextTimestamp=function(){this.lastEndDTS=null},f.resetInitSegment=function(m,E,y){this.audioCodec=E,this.videoCodec=y,this.generateInitSegment(m),this.emitInitSegment=!0},f.generateInitSegment=function(m){var E=this.audioCodec,y=this.videoCodec;if(!m||!m.byteLength){this.initTracks=void 0,this.initData=void 0;return}var u=this.initData=Object(T.parseInitSegment)(m);E||(E=a(u.audio,c.ElementaryStreamTypes.AUDIO)),y||(y=a(u.video,c.ElementaryStreamTypes.VIDEO));var n={};u.audio&&u.video?n.audiovideo={container:"video/mp4",codec:E+","+y,initSegment:m,id:"main"}:u.audio?n.audio={container:"audio/mp4",codec:E,initSegment:m,id:"audio"}:u.video?n.video={container:"video/mp4",codec:y,initSegment:m,id:"main"}:C.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=n},f.remux=function(m,E,y,u,n){var o=this.initPTS,l=this.lastEndDTS,w={audio:void 0,video:void 0,text:u,id3:y,initSegment:void 0};Object(L.isFiniteNumber)(l)||(l=this.lastEndDTS=n||0);var v=E.samples;if(!v||!v.length)return w;var i={initPTS:void 0,timescale:1},R=this.initData;if((!R||!R.length)&&(this.generateInitSegment(v),R=this.initData),!R||!R.length)return C.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),w;this.emitInitSegment&&(i.tracks=this.initTracks,this.emitInitSegment=!1),Object(L.isFiniteNumber)(o)||(this.initPTS=i.initPTS=o=s(R,v,l));var k=Object(T.getDuration)(v,R),d=l,b=k+d;Object(T.offsetStartDTS)(R,v,o),k>0?this.lastEndDTS=b:(C.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var x=!!R.audio,_=!!R.video,B="";x&&(B+="audio"),_&&(B+="video");var U={data1:v,startPTS:d,startDTS:d,endPTS:b,endDTS:b,type:B,hasAudio:x,hasVideo:_,nb:1,dropped:0};return w.audio=U.type==="audio"?U:void 0,w.video=U.type!=="audio"?U:void 0,w.text=u,w.id3=y,w.initSegment=i,w},r}(),s=function(f,p,m){return Object(T.getStartDTS)(f,p)-m};function a(r,f){var p=r==null?void 0:r.codec;return p&&p.length>4?p:p==="hvc1"?"hvc1.1.c.L120.90":p==="av01"?"av01.0.04M.08":p==="avc1"||f===c.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}h.default=g},"./src/task-loop.ts":function(I,h,S){"use strict";S.r(h),S.d(h,"default",function(){return L});var L=function(){function T(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var c=T.prototype;return c.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},c.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},c.onHandlerDestroyed=function(){},c.hasInterval=function(){return!!this._tickInterval},c.hasNextTick=function(){return!!this._tickTimer},c.setInterval=function(g){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,g),!0)},c.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},c.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},c.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},c.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},c.doTick=function(){},T}()},"./src/types/cmcd.ts":function(I,h,S){"use strict";S.r(h),S.d(h,"CMCDVersion",function(){return L}),S.d(h,"CMCDObjectType",function(){return T}),S.d(h,"CMCDStreamingFormat",function(){return c}),S.d(h,"CMCDStreamType",function(){return C});var L=1,T;(function(g){g.MANIFEST="m",g.AUDIO="a",g.VIDEO="v",g.MUXED="av",g.INIT="i",g.CAPTION="c",g.TIMED_TEXT="tt",g.KEY="k",g.OTHER="o"})(T||(T={}));var c;(function(g){g.DASH="d",g.HLS="h",g.SMOOTH="s",g.OTHER="o"})(c||(c={}));var C;(function(g){g.VOD="v",g.LIVE="l"})(C||(C={}))},"./src/types/level.ts":function(I,h,S){"use strict";S.r(h),S.d(h,"HlsSkip",function(){return c}),S.d(h,"getSkipValue",function(){return C}),S.d(h,"HlsUrlParameters",function(){return g}),S.d(h,"Level",function(){return s});function L(a,r){for(var f=0;f<r.length;f++){var p=r[f];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(a,p.key,p)}}function T(a,r,f){return r&&L(a.prototype,r),f&&L(a,f),a}var c;(function(a){a.No="",a.Yes="YES",a.v2="v2"})(c||(c={}));function C(a,r){var f=a.canSkipUntil,p=a.canSkipDateRanges,m=a.endSN,E=r!==void 0?r-m:0;return f&&E<f?p?c.v2:c.Yes:c.No}var g=function(){function a(f,p,m){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=f,this.part=p,this.skip=m}var r=a.prototype;return r.addDirectives=function(p){var m=new self.URL(p);return this.msn!==void 0&&m.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&m.searchParams.set("_HLS_part",this.part.toString()),this.skip&&m.searchParams.set("_HLS_skip",this.skip),m.toString()},a}(),s=function(){function a(r){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=[r.url],this.attrs=r.attrs,this.bitrate=r.bitrate,r.details&&(this.details=r.details),this.id=r.id||0,this.name=r.name,this.width=r.width||0,this.height=r.height||0,this.audioCodec=r.audioCodec,this.videoCodec=r.videoCodec,this.unknownCodecs=r.unknownCodecs,this.codecSet=[r.videoCodec,r.audioCodec].filter(function(f){return f}).join(",").replace(/\.[^.,]+/g,"")}return T(a,[{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(f){var p=f%this.url.length;this._urlId!==p&&(this.details=void 0,this._urlId=p)}}]),a}()},"./src/types/loader.ts":function(I,h,S){"use strict";S.r(h),S.d(h,"PlaylistContextType",function(){return L}),S.d(h,"PlaylistLevelType",function(){return T});var L;(function(c){c.MANIFEST="manifest",c.LEVEL="level",c.AUDIO_TRACK="audioTrack",c.SUBTITLE_TRACK="subtitleTrack"})(L||(L={}));var T;(function(c){c.MAIN="main",c.AUDIO="audio",c.SUBTITLE="subtitle"})(T||(T={}))},"./src/types/transmuxer.ts":function(I,h,S){"use strict";S.r(h),S.d(h,"ChunkMetadata",function(){return L});var L=function(C,g,s,a,r,f){a===void 0&&(a=0),r===void 0&&(r=-1),f===void 0&&(f=!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=T(),this.buffering={audio:T(),video:T(),audiovideo:T()},this.level=C,this.sn=g,this.id=s,this.size=a,this.part=r,this.partial=f};function T(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(I,h,S){"use strict";S.r(h),S.d(h,"AttrList",function(){return c});var L=/^(\d+)x(\d+)$/,T=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,c=function(){function C(s){typeof s=="string"&&(s=C.parseAttrList(s));for(var a in s)s.hasOwnProperty(a)&&(this[a]=s[a])}var g=C.prototype;return g.decimalInteger=function(a){var r=parseInt(this[a],10);return r>Number.MAX_SAFE_INTEGER?Infinity:r},g.hexadecimalInteger=function(a){if(this[a]){var r=(this[a]||"0x").slice(2);r=(r.length&1?"0":"")+r;for(var f=new Uint8Array(r.length/2),p=0;p<r.length/2;p++)f[p]=parseInt(r.slice(p*2,p*2+2),16);return f}else return null},g.hexadecimalIntegerAsNumber=function(a){var r=parseInt(this[a],16);return r>Number.MAX_SAFE_INTEGER?Infinity:r},g.decimalFloatingPoint=function(a){return parseFloat(this[a])},g.optionalFloat=function(a,r){var f=this[a];return f?parseFloat(f):r},g.enumeratedString=function(a){return this[a]},g.bool=function(a){return this[a]==="YES"},g.decimalResolution=function(a){var r=L.exec(this[a]);return r===null?void 0:{width:parseInt(r[1],10),height:parseInt(r[2],10)}},C.parseAttrList=function(a){var r,f={},p='"';for(T.lastIndex=0;(r=T.exec(a))!==null;){var m=r[2];m.indexOf(p)===0&&m.lastIndexOf(p)===m.length-1&&(m=m.slice(1,-1)),f[r[1]]=m}return f},C}()},"./src/utils/binary-search.ts":function(I,h,S){"use strict";S.r(h);var L={search:function(c,C){for(var g=0,s=c.length-1,a=null,r=null;g<=s;){a=(g+s)/2|0,r=c[a];var f=C(r);if(f>0)g=a+1;else if(f<0)s=a-1;else return r}return null}};h.default=L},"./src/utils/buffer-helper.ts":function(I,h,S){"use strict";S.r(h),S.d(h,"BufferHelper",function(){return c});var L=S("./src/utils/logger.ts"),T={length:0,start:function(){return 0},end:function(){return 0}},c=function(){function C(){}return C.isBuffered=function(s,a){try{if(s){for(var r=C.getBuffered(s),f=0;f<r.length;f++)if(a>=r.start(f)&&a<=r.end(f))return!0}}catch(p){}return!1},C.bufferInfo=function(s,a,r){try{if(s){var f=C.getBuffered(s),p=[],m;for(m=0;m<f.length;m++)p.push({start:f.start(m),end:f.end(m)});return this.bufferedInfo(p,a,r)}}catch(E){}return{len:0,start:a,end:a,nextStart:void 0}},C.bufferedInfo=function(s,a,r){a=Math.max(0,a),s.sort(function(i,R){var k=i.start-R.start;return k||R.end-i.end});var f=[];if(r)for(var p=0;p<s.length;p++){var m=f.length;if(m){var E=f[m-1].end;s[p].start-E<r?s[p].end>E&&(f[m-1].end=s[p].end):f.push(s[p])}else f.push(s[p])}else f=s;for(var y=0,u,n=a,o=a,l=0;l<f.length;l++){var w=f[l].start,v=f[l].end;if(a+r>=w&&a<v)n=w,o=v,y=o-a;else if(a+r<w){u=w;break}}return{len:y,start:n||0,end:o||0,nextStart:u}},C.getBuffered=function(s){try{return s.buffered}catch(a){return L.logger.log("failed to get media.buffered",a),T}},C}()},"./src/utils/cea-608-parser.ts":function(I,h,S){"use strict";S.r(h),S.d(h,"Row",function(){return o}),S.d(h,"CaptionScreen",function(){return l});var L=S("./src/utils/logger.ts"),T={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},c=function(b){var x=b;return T.hasOwnProperty(b)&&(x=T[b]),String.fromCharCode(x)},C=15,g=100,s={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},a={17:2,18:4,21:6,22:8,23:10,19:13,20:15},r={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},f={25:2,26:4,29:6,30:8,31:10,27:13,28:15},p=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],m;(function(d){d[d.ERROR=0]="ERROR",d[d.TEXT=1]="TEXT",d[d.WARNING=2]="WARNING",d[d.INFO=2]="INFO",d[d.DEBUG=3]="DEBUG",d[d.DATA=3]="DATA"})(m||(m={}));var E=function(){function d(){this.time=null,this.verboseLevel=m.ERROR}var b=d.prototype;return b.log=function(_,B){this.verboseLevel>=_&&L.logger.log(this.time+" ["+_+"] "+B)},d}(),y=function(b){for(var x=[],_=0;_<b.length;_++)x.push(b[_].toString(16));return x},u=function(){function d(x,_,B,U,P){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=x||"white",this.underline=_||!1,this.italics=B||!1,this.background=U||"black",this.flash=P||!1}var b=d.prototype;return b.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},b.setStyles=function(_){for(var B=["foreground","underline","italics","background","flash"],U=0;U<B.length;U++){var P=B[U];_.hasOwnProperty(P)&&(this[P]=_[P])}},b.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},b.equals=function(_){return this.foreground===_.foreground&&this.underline===_.underline&&this.italics===_.italics&&this.background===_.background&&this.flash===_.flash},b.copy=function(_){this.foreground=_.foreground,this.underline=_.underline,this.italics=_.italics,this.background=_.background,this.flash=_.flash},b.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},d}(),n=function(){function d(x,_,B,U,P,J){this.uchar=void 0,this.penState=void 0,this.uchar=x||" ",this.penState=new u(_,B,U,P,J)}var b=d.prototype;return b.reset=function(){this.uchar=" ",this.penState.reset()},b.setChar=function(_,B){this.uchar=_,this.penState.copy(B)},b.setPenState=function(_){this.penState.copy(_)},b.equals=function(_){return this.uchar===_.uchar&&this.penState.equals(_.penState)},b.copy=function(_){this.uchar=_.uchar,this.penState.copy(_.penState)},b.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},d}(),o=function(){function d(x){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var _=0;_<g;_++)this.chars.push(new n);this.logger=x,this.pos=0,this.currPenState=new u}var b=d.prototype;return b.equals=function(_){for(var B=!0,U=0;U<g;U++)if(!this.chars[U].equals(_.chars[U])){B=!1;break}return B},b.copy=function(_){for(var B=0;B<g;B++)this.chars[B].copy(_.chars[B])},b.isEmpty=function(){for(var _=!0,B=0;B<g;B++)if(!this.chars[B].isEmpty()){_=!1;break}return _},b.setCursor=function(_){this.pos!==_&&(this.pos=_),this.pos<0?(this.logger.log(m.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>g&&(this.logger.log(m.DEBUG,"Too large cursor position "+this.pos),this.pos=g)},b.moveCursor=function(_){var B=this.pos+_;if(_>1)for(var U=this.pos+1;U<B+1;U++)this.chars[U].setPenState(this.currPenState);this.setCursor(B)},b.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},b.insertChar=function(_){_>=144&&this.backSpace();var B=c(_);if(this.pos>=g){this.logger.log(m.ERROR,"Cannot insert "+_.toString(16)+" ("+B+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(B,this.currPenState),this.moveCursor(1)},b.clearFromPos=function(_){var B;for(B=_;B<g;B++)this.chars[B].reset()},b.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},b.clearToEndOfRow=function(){this.clearFromPos(this.pos)},b.getTextString=function(){for(var _=[],B=!0,U=0;U<g;U++){var P=this.chars[U].uchar;P!==" "&&(B=!1),_.push(P)}return B?"":_.join("")},b.setPenStyles=function(_){this.currPenState.setStyles(_);var B=this.chars[this.pos];B.setPenState(this.currPenState)},d}(),l=function(){function d(x){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var _=0;_<C;_++)this.rows.push(new o(x));this.logger=x,this.currRow=C-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var b=d.prototype;return b.reset=function(){for(var _=0;_<C;_++)this.rows[_].clear();this.currRow=C-1},b.equals=function(_){for(var B=!0,U=0;U<C;U++)if(!this.rows[U].equals(_.rows[U])){B=!1;break}return B},b.copy=function(_){for(var B=0;B<C;B++)this.rows[B].copy(_.rows[B])},b.isEmpty=function(){for(var _=!0,B=0;B<C;B++)if(!this.rows[B].isEmpty()){_=!1;break}return _},b.backSpace=function(){var _=this.rows[this.currRow];_.backSpace()},b.clearToEndOfRow=function(){var _=this.rows[this.currRow];_.clearToEndOfRow()},b.insertChar=function(_){var B=this.rows[this.currRow];B.insertChar(_)},b.setPen=function(_){var B=this.rows[this.currRow];B.setPenStyles(_)},b.moveCursor=function(_){var B=this.rows[this.currRow];B.moveCursor(_)},b.setCursor=function(_){this.logger.log(m.INFO,"setCursor: "+_);var B=this.rows[this.currRow];B.setCursor(_)},b.setPAC=function(_){this.logger.log(m.INFO,"pacData = "+JSON.stringify(_));var B=_.row-1;if(this.nrRollUpRows&&B<this.nrRollUpRows-1&&(B=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==B){for(var U=0;U<C;U++)this.rows[U].clear();var P=this.currRow+1-this.nrRollUpRows,J=this.lastOutputScreen;if(J){var $=J.rows[P].cueStartTime,z=this.logger.time;if($&&z!==null&&$<z)for(var V=0;V<this.nrRollUpRows;V++)this.rows[B-this.nrRollUpRows+V+1].copy(J.rows[P+V])}}this.currRow=B;var K=this.rows[this.currRow];if(_.indent!==null){var H=_.indent,G=Math.max(H-1,0);K.setCursor(_.indent),_.color=K.chars[G].penState.foreground}var ie={foreground:_.color,underline:_.underline,italics:_.italics,background:"black",flash:!1};this.setPen(ie)},b.setBkgData=function(_){this.logger.log(m.INFO,"bkgData = "+JSON.stringify(_)),this.backSpace(),this.setPen(_),this.insertChar(32)},b.setRollUpRows=function(_){this.nrRollUpRows=_},b.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(m.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(m.TEXT,this.getDisplayText());var _=this.currRow+1-this.nrRollUpRows,B=this.rows.splice(_,1)[0];B.clear(),this.rows.splice(this.currRow,0,B),this.logger.log(m.INFO,"Rolling up")},b.getDisplayText=function(_){_=_||!1;for(var B=[],U="",P=-1,J=0;J<C;J++){var $=this.rows[J].getTextString();$&&(P=J+1,_?B.push("Row "+P+": '"+$+"'"):B.push($.trim()))}return B.length>0&&(_?U="["+B.join(" | ")+"]":U=B.join(`
`)),U},b.getTextAndFormat=function(){return this.rows},d}(),w=function(){function d(x,_,B){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=x,this.outputFilter=_,this.mode=null,this.verbose=0,this.displayedMemory=new l(B),this.nonDisplayedMemory=new l(B),this.lastOutputScreen=new l(B),this.currRollUpRow=this.displayedMemory.rows[C-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=B}var b=d.prototype;return b.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[C-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},b.getHandler=function(){return this.outputFilter},b.setHandler=function(_){this.outputFilter=_},b.setPAC=function(_){this.writeScreen.setPAC(_)},b.setBkgData=function(_){this.writeScreen.setBkgData(_)},b.setMode=function(_){if(_===this.mode)return;this.mode=_,this.logger.log(m.INFO,"MODE="+_),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=_},b.insertChars=function(_){for(var B=0;B<_.length;B++)this.writeScreen.insertChar(_[B]);var U=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(m.INFO,U+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(m.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},b.ccRCL=function(){this.logger.log(m.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},b.ccBS=function(){if(this.logger.log(m.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},b.ccAOF=function(){},b.ccAON=function(){},b.ccDER=function(){this.logger.log(m.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},b.ccRU=function(_){this.logger.log(m.INFO,"RU("+_+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(_)},b.ccFON=function(){this.logger.log(m.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},b.ccRDC=function(){this.logger.log(m.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},b.ccTR=function(){this.logger.log(m.INFO,"TR"),this.setMode("MODE_TEXT")},b.ccRTD=function(){this.logger.log(m.INFO,"RTD"),this.setMode("MODE_TEXT")},b.ccEDM=function(){this.logger.log(m.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},b.ccCR=function(){this.logger.log(m.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},b.ccENM=function(){this.logger.log(m.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},b.ccEOC=function(){if(this.logger.log(m.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var _=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=_,this.writeScreen=this.nonDisplayedMemory,this.logger.log(m.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},b.ccTO=function(_){this.logger.log(m.INFO,"TO("+_+") - Tab Offset"),this.writeScreen.moveCursor(_)},b.ccMIDROW=function(_){var B={flash:!1};if(B.underline=_%2===1,B.italics=_>=46,B.italics)B.foreground="white";else{var U=Math.floor(_/2)-16,P=["white","green","blue","cyan","red","yellow","magenta"];B.foreground=P[U]}this.logger.log(m.INFO,"MIDROW: "+JSON.stringify(B)),this.writeScreen.setPen(B)},b.outputDataUpdate=function(_){_===void 0&&(_=!1);var B=this.logger.time;if(B===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=B:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,B,this.lastOutputScreen),_&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:B),this.lastOutputScreen.copy(this.displayedMemory))},b.cueSplitAtTime=function(_){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,_,this.displayedMemory),this.cueStartTime=_))},d}(),v=function(){function d(x,_,B){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var U=new E;this.channels=[null,new w(x,_,U),new w(x+1,B,U)],this.cmdHistory=k(),this.logger=U}var b=d.prototype;return b.getHandler=function(_){return this.channels[_].getHandler()},b.setHandler=function(_,B){this.channels[_].setHandler(B)},b.addData=function(_,B){var U,P,J,$=!1;this.logger.time=_;for(var z=0;z<B.length;z+=2){if(P=B[z]&127,J=B[z+1]&127,P===0&&J===0)continue;if(this.logger.log(m.DATA,"["+y([B[z],B[z+1]])+"] -> ("+y([P,J])+")"),U=this.parseCmd(P,J),U||(U=this.parseMidrow(P,J)),U||(U=this.parsePAC(P,J)),U||(U=this.parseBackgroundAttributes(P,J)),!U&&($=this.parseChars(P,J),$)){var V=this.currentChannel;if(V&&V>0){var K=this.channels[V];K.insertChars($)}else this.logger.log(m.WARNING,"No channel found yet. TEXT-MODE?")}!U&&!$&&this.logger.log(m.WARNING,"Couldn't parse cleaned data "+y([P,J])+" orig: "+y([B[z],B[z+1]]))}},b.parseCmd=function(_,B){var U=this.cmdHistory,P=(_===20||_===28||_===21||_===29)&&B>=32&&B<=47,J=(_===23||_===31)&&B>=33&&B<=35;if(!(P||J))return!1;if(R(_,B,U))return i(null,null,U),this.logger.log(m.DEBUG,"Repeated command ("+y([_,B])+") is dropped"),!0;var $=_===20||_===21||_===23?1:2,z=this.channels[$];return _===20||_===21||_===28||_===29?B===32?z.ccRCL():B===33?z.ccBS():B===34?z.ccAOF():B===35?z.ccAON():B===36?z.ccDER():B===37?z.ccRU(2):B===38?z.ccRU(3):B===39?z.ccRU(4):B===40?z.ccFON():B===41?z.ccRDC():B===42?z.ccTR():B===43?z.ccRTD():B===44?z.ccEDM():B===45?z.ccCR():B===46?z.ccENM():B===47&&z.ccEOC():z.ccTO(B-32),i(_,B,U),this.currentChannel=$,!0},b.parseMidrow=function(_,B){var U=0;if((_===17||_===25)&&B>=32&&B<=47){if(_===17?U=1:U=2,U!==this.currentChannel)return this.logger.log(m.ERROR,"Mismatch channel in midrow parsing"),!1;var P=this.channels[U];return P?(P.ccMIDROW(B),this.logger.log(m.DEBUG,"MIDROW ("+y([_,B])+")"),!0):!1}return!1},b.parsePAC=function(_,B){var U,P=this.cmdHistory,J=(_>=17&&_<=23||_>=25&&_<=31)&&B>=64&&B<=127,$=(_===16||_===24)&&B>=64&&B<=95;if(!(J||$))return!1;if(R(_,B,P))return i(null,null,P),!0;var z=_<=23?1:2;B>=64&&B<=95?U=z===1?s[_]:r[_]:U=z===1?a[_]:f[_];var V=this.channels[z];return V?(V.setPAC(this.interpretPAC(U,B)),i(_,B,P),this.currentChannel=z,!0):!1},b.interpretPAC=function(_,B){var U,P={color:null,italics:!1,indent:null,underline:!1,row:_};return B>95?U=B-96:U=B-64,P.underline=(U&1)===1,U<=13?P.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(U/2)]:U<=15?(P.italics=!0,P.color="white"):P.indent=Math.floor((U-16)/2)*4,P},b.parseChars=function(_,B){var U,P=null,J=null;if(_>=25?(U=2,J=_-8):(U=1,J=_),J>=17&&J<=19){var $;J===17?$=B+80:J===18?$=B+112:$=B+144,this.logger.log(m.INFO,"Special char '"+c($)+"' in channel "+U),P=[$]}else _>=32&&_<=127&&(P=B===0?[_]:[_,B]);if(P){var z=y(P);this.logger.log(m.DEBUG,"Char codes = "+z.join(",")),i(_,B,this.cmdHistory)}return P},b.parseBackgroundAttributes=function(_,B){var U=(_===16||_===24)&&B>=32&&B<=47,P=(_===23||_===31)&&B>=45&&B<=47;if(!(U||P))return!1;var J,$={};_===16||_===24?(J=Math.floor((B-32)/2),$.background=p[J],B%2===1&&($.background=$.background+"_semi")):B===45?$.background="transparent":($.foreground="black",B===47&&($.underline=!0));var z=_<=23?1:2,V=this.channels[z];return V.setBkgData($),i(_,B,this.cmdHistory),!0},b.reset=function(){for(var _=0;_<Object.keys(this.channels).length;_++){var B=this.channels[_];B&&B.reset()}this.cmdHistory=k()},b.cueSplitAtTime=function(_){for(var B=0;B<this.channels.length;B++){var U=this.channels[B];U&&U.cueSplitAtTime(_)}},d}();function i(d,b,x){x.a=d,x.b=b}function R(d,b,x){return x.a===d&&x.b===b}function k(){return{a:null,b:null}}h.default=v},"./src/utils/codecs.ts":function(I,h,S){"use strict";S.r(h),S.d(h,"isCodecType",function(){return T}),S.d(h,"isCodecSupportedInMp4",function(){return c});var L={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 T(C,g){var s=L[g];return!!s&&s[C.slice(0,4)]===!0}function c(C,g){return MediaSource.isTypeSupported((g||"video")+'/mp4;codecs="'+C+'"')}},"./src/utils/cues.ts":function(I,h,S){"use strict";S.r(h);var L=S("./src/utils/vttparser.ts"),T=S("./src/utils/webvtt-parser.ts"),c=S("./src/utils/texttrack-utils.ts"),C=/\s/,g={newCue:function(a,r,f,p){for(var m=[],E,y,u,n,o,l=self.VTTCue||self.TextTrackCue,w=0;w<p.rows.length;w++)if(E=p.rows[w],u=!0,n=0,o="",!E.isEmpty()){for(var v=0;v<E.chars.length;v++)C.test(E.chars[v].uchar)&&u?n++:(o+=E.chars[v].uchar,u=!1);E.cueStartTime=r,r===f&&(f+=1e-4),n>=16?n--:n++;var i=Object(L.fixLineBreaks)(o.trim()),R=Object(T.generateCueId)(r,f,i);(!a||!a.cues||!a.cues.getCueById(R))&&(y=new l(r,f,i),y.id=R,y.line=w+1,y.align="left",y.position=10+Math.min(80,Math.floor(n*8/32)*10),m.push(y))}return a&&m.length&&(m.sort(function(k,d){return k.line==="auto"||d.line==="auto"?0:k.line>8&&d.line>8?d.line-k.line:k.line-d.line}),m.forEach(function(k){return Object(c.addCueToTrack)(a,k)})),m}};h.default=g},"./src/utils/discontinuities.ts":function(I,h,S){"use strict";S.r(h),S.d(h,"findFirstFragWithCC",function(){return C}),S.d(h,"shouldAlignOnDiscontinuities",function(){return g}),S.d(h,"findDiscontinuousReferenceFrag",function(){return s}),S.d(h,"adjustSlidingStart",function(){return r}),S.d(h,"alignStream",function(){return f}),S.d(h,"alignPDT",function(){return m}),S.d(h,"alignFragmentByPDTDelta",function(){return E}),S.d(h,"alignMediaPlaylistByPDT",function(){return y});var L=S("./src/polyfills/number.ts"),T=S("./src/utils/logger.ts"),c=S("./src/controller/level-helper.ts");function C(u,n){for(var o=null,l=0,w=u.length;l<w;l++){var v=u[l];if(v&&v.cc===n){o=v;break}}return o}function g(u,n,o){return!!(n.details&&(o.endCC>o.startCC||u&&u.cc<o.startCC))}function s(u,n){var o=u.fragments,l=n.fragments;if(!l.length||!o.length){T.logger.log("No fragments to align");return}var w=C(o,l[0].cc);if(!w||w&&!w.startPTS){T.logger.log("No frag in previous level to align on");return}return w}function a(u,n){if(u){var o=u.start+n;u.start=u.startPTS=o,u.endPTS=o+u.duration}}function r(u,n){for(var o=n.fragments,l=0,w=o.length;l<w;l++)a(o[l],u);n.fragmentHint&&a(n.fragmentHint,u),n.alignedSliding=!0}function f(u,n,o){if(!n)return;p(u,o,n),!o.alignedSliding&&n.details&&m(o,n.details),!o.alignedSliding&&n.details&&!o.skippedSegments&&Object(c.adjustSliding)(n.details,o)}function p(u,n,o){if(g(u,o,n)){var l=s(o.details,n);l&&Object(L.isFiniteNumber)(l.start)&&(T.logger.log("Adjusting PTS using last level due to CC increase within current level "+n.url),r(l.start,n))}}function m(u,n){if(!n.fragments.length||!u.hasProgramDateTime||!n.hasProgramDateTime)return;var o=n.fragments[0].programDateTime,l=u.fragments[0].programDateTime,w=(l-o)/1e3+n.fragments[0].start;w&&Object(L.isFiniteNumber)(w)&&(T.logger.log("Adjusting PTS using programDateTime delta "+(l-o)+"ms, sliding:"+w.toFixed(3)+" "+u.url+" "),r(w,u))}function E(u,n){var o=u.programDateTime;if(!o)return;var l=(o-n)/1e3;u.start=u.startPTS=l,u.endPTS=l+u.duration}function y(u,n){if(!n.fragments.length||!u.hasProgramDateTime||!n.hasProgramDateTime)return;var o=n.fragments[0].programDateTime,l=n.fragments[0].start,w=o-l*1e3;u.fragments.forEach(function(v){E(v,w)}),u.fragmentHint&&E(u.fragmentHint,w),u.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(I,h,S){"use strict";S.r(h);var L=S("./src/utils/ewma.ts"),T=function(){function c(g,s,a){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=a,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new L.default(g),this.fast_=new L.default(s)}var C=c.prototype;return C.update=function(s,a){var r=this.slow_,f=this.fast_;this.slow_.halfLife!==s&&(this.slow_=new L.default(s,r.getEstimate(),r.getTotalWeight())),this.fast_.halfLife!==a&&(this.fast_=new L.default(a,f.getEstimate(),f.getTotalWeight()))},C.sample=function(s,a){s=Math.max(s,this.minDelayMs_);var r=8*a,f=s/1e3,p=r/f;this.fast_.sample(f,p),this.slow_.sample(f,p)},C.canEstimate=function(){var s=this.fast_;return s&&s.getTotalWeight()>=this.minWeight_},C.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},C.destroy=function(){},c}();h.default=T},"./src/utils/ewma.ts":function(I,h,S){"use strict";S.r(h);var L=function(){function T(C,g,s){g===void 0&&(g=0),s===void 0&&(s=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=C,this.alpha_=C?Math.exp(Math.log(.5)/C):0,this.estimate_=g,this.totalWeight_=s}var c=T.prototype;return c.sample=function(g,s){var a=Math.pow(this.alpha_,g);this.estimate_=s*(1-a)+a*this.estimate_,this.totalWeight_+=g},c.getTotalWeight=function(){return this.totalWeight_},c.getEstimate=function(){if(this.alpha_){var g=1-Math.pow(this.alpha_,this.totalWeight_);if(g)return this.estimate_/g}return this.estimate_},T}();h.default=L},"./src/utils/fetch-loader.ts":function(I,h,S){"use strict";S.r(h),S.d(h,"fetchSupported",function(){return E});var L=S("./src/polyfills/number.ts"),T=S("./src/loader/load-stats.ts"),c=S("./src/demux/chunk-cache.ts");function C(l,w){l.prototype=Object.create(w.prototype),l.prototype.constructor=l,f(l,w)}function g(l){var w=typeof Map=="function"?new Map:void 0;return g=function(i){if(i===null||!r(i))return i;if(typeof i!="function")throw new TypeError("Super expression must either be null or a function");if(typeof w!="undefined"){if(w.has(i))return w.get(i);w.set(i,R)}function R(){return s(i,arguments,p(this).constructor)}return R.prototype=Object.create(i.prototype,{constructor:{value:R,enumerable:!1,writable:!0,configurable:!0}}),f(R,i)},g(l)}function s(l,w,v){return a()?s=Reflect.construct:s=function(R,k,d){var b=[null];b.push.apply(b,k);var x=Function.bind.apply(R,b),_=new x;return d&&f(_,d.prototype),_},s.apply(null,arguments)}function a(){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(l){return!1}}function r(l){return Function.toString.call(l).indexOf("[native code]")!==-1}function f(l,w){return f=Object.setPrototypeOf||function(i,R){return i.__proto__=R,i},f(l,w)}function p(l){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(v){return v.__proto__||Object.getPrototypeOf(v)},p(l)}function m(){return m=Object.assign||function(l){for(var w=1;w<arguments.length;w++){var v=arguments[w];for(var i in v)Object.prototype.hasOwnProperty.call(v,i)&&(l[i]=v[i])}return l},m.apply(this,arguments)}function E(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(l){}return!1}var y=function(){function l(v){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=v.fetchSetup||n,this.controller=new self.AbortController,this.stats=new T.LoadStats}var w=l.prototype;return w.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},w.abortInternal=function(){var i=this.response;(!i||!i.ok)&&(this.stats.aborted=!0,this.controller.abort())},w.abort=function(){var i;this.abortInternal(),(i=this.callbacks)!==null&&i!==void 0&&i.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},w.load=function(i,R,k){var d=this,b=this.stats;if(b.loading.start)throw new Error("Loader can only be used once.");b.loading.start=self.performance.now();var x=u(i,this.controller.signal),_=k.onProgress,B=i.responseType==="arraybuffer",U=B?"byteLength":"length";this.context=i,this.config=R,this.callbacks=k,this.request=this.fetchSetup(i,x),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){d.abortInternal(),k.onTimeout(b,i,d.response)},R.timeout),self.fetch(this.request).then(function(P){if(d.response=d.loader=P,!P.ok){var J=P.status,$=P.statusText;throw new o($||"fetch, bad network response",J,P)}return b.loading.first=Math.max(self.performance.now(),b.loading.start),b.total=parseInt(P.headers.get("Content-Length")||"0"),_&&Object(L.isFiniteNumber)(R.highWaterMark)?d.loadProgressively(P,b,i,R.highWaterMark,_):B?P.arrayBuffer():P.text()}).then(function(P){var J=d.response;self.clearTimeout(d.requestTimeout),b.loading.end=Math.max(self.performance.now(),b.loading.first),b.loaded=b.total=P[U];var $={url:J.url,data:P};_&&!Object(L.isFiniteNumber)(R.highWaterMark)&&_(b,i,P,J),k.onSuccess($,b,i,J)}).catch(function(P){if(self.clearTimeout(d.requestTimeout),b.aborted)return;var J=P.code||0;k.onError({code:J,text:P.message},i,P.details)})},w.getCacheAge=function(){var i=null;if(this.response){var R=this.response.headers.get("age");i=R?parseFloat(R):null}return i},w.loadProgressively=function(i,R,k,d,b){d===void 0&&(d=0);var x=new c.default,_=i.body.getReader(),B=function U(){return _.read().then(function(P){if(P.done)return x.dataLength&&b(R,k,x.flush(),i),Promise.resolve(new ArrayBuffer(0));var J=P.value,$=J.length;return R.loaded+=$,$<d||x.dataLength?(x.push(J),x.dataLength>=d&&b(R,k,x.flush(),i)):b(R,k,J,i),U()}).catch(function(){return Promise.reject()})};return B()},l}();function u(l,w){var v={method:"GET",mode:"cors",credentials:"same-origin",signal:w,headers:new self.Headers(m({},l.headers))};return l.rangeEnd&&v.headers.set("Range","bytes="+l.rangeStart+"-"+String(l.rangeEnd-1)),v}function n(l,w){return new self.Request(l.url,w)}var o=function(l){C(w,l);function w(v,i,R){var k;return k=l.call(this,v)||this,k.code=void 0,k.details=void 0,k.code=i,k.details=R,k}return w}(g(Error));h.default=y},"./src/utils/imsc1-ttml-parser.ts":function(I,h,S){"use strict";S.r(h),S.d(h,"IMSC1_CODEC",function(){return r}),S.d(h,"parseIMSC1",function(){return E});var L=S("./src/utils/mp4-tools.ts"),T=S("./src/utils/vttparser.ts"),c=S("./src/utils/vttcue.ts"),C=S("./src/demux/id3.ts"),g=S("./src/utils/timescale-conversion.ts"),s=S("./src/utils/webvtt-parser.ts");function a(){return a=Object.assign||function(d){for(var b=1;b<arguments.length;b++){var x=arguments[b];for(var _ in x)Object.prototype.hasOwnProperty.call(x,_)&&(d[_]=x[_])}return d},a.apply(this,arguments)}var r="stpp.ttml.im1t",f=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,p=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,m={left:"start",center:"center",right:"end",start:"start",end:"end"};function E(d,b,x,_,B){var U=Object(L.findBox)(new Uint8Array(d),["mdat"]);if(U.length===0){B(new Error("Could not parse IMSC1 mdat"));return}var P=U[0],J=Object(C.utf8ArrayToStr)(new Uint8Array(d,P.start,P.end-P.start)),$=Object(g.toTimescaleFromScale)(b,1,x);try{_(y(J,$))}catch(z){B(z)}}function y(d,b){var x=new DOMParser,_=x.parseFromString(d,"text/xml"),B=_.getElementsByTagName("tt")[0];if(!B)throw new Error("Invalid ttml");var U={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},P=Object.keys(U).reduce(function(K,H){return K[H]=B.getAttribute("ttp:"+H)||U[H],K},{}),J=B.getAttribute("xml:space")!=="preserve",$=n(u(B,"styling","style")),z=n(u(B,"layout","region")),V=u(B,"body","[begin]");return[].map.call(V,function(K){var H=o(K,J);if(!H||!K.hasAttribute("begin"))return null;var G=i(K.getAttribute("begin"),P),ie=i(K.getAttribute("dur"),P),le=i(K.getAttribute("end"),P);if(G===null)throw v(K);if(le===null){if(ie===null)throw v(K);le=G+ie}var ue=new c.default(G-b,le-b,H);ue.id=Object(s.generateCueId)(ue.startTime,ue.endTime,ue.text);var be=z[K.getAttribute("region")],Ce=$[K.getAttribute("style")];ue.position=10,ue.size=80;var se=l(be,Ce),ce=se.textAlign;if(ce){var he=m[ce];he&&(ue.lineAlign=he),ue.align=ce}return a(ue,se),ue}).filter(function(K){return K!==null})}function u(d,b,x){var _=d.getElementsByTagName(b)[0];return _?[].slice.call(_.querySelectorAll(x)):[]}function n(d){return d.reduce(function(b,x){var _=x.getAttribute("xml:id");return _&&(b[_]=x),b},{})}function o(d,b){return[].slice.call(d.childNodes).reduce(function(x,_,B){var U;return _.nodeName==="br"&&B?x+`
`:(U=_.childNodes)!==null&&U!==void 0&&U.length?o(_,b):b?x+_.textContent.trim().replace(/\s+/g," "):x+_.textContent},"")}function l(d,b){var x="http://www.w3.org/ns/ttml#styling",_=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return _.reduce(function(B,U){var P=w(b,x,U)||w(d,x,U);return P&&(B[U]=P),B},{})}function w(d,b,x){return d.hasAttributeNS(b,x)?d.getAttributeNS(b,x):null}function v(d){return new Error("Could not parse ttml timestamp "+d)}function i(d,b){if(!d)return null;var x=Object(T.parseTimeStamp)(d);return x===null&&(f.test(d)?x=R(d,b):p.test(d)&&(x=k(d,b))),x}function R(d,b){var x=f.exec(d),_=(x[4]|0)+(x[5]|0)/b.subFrameRate;return(x[1]|0)*3600+(x[2]|0)*60+(x[3]|0)+_/b.frameRate}function k(d,b){var x=p.exec(d),_=Number(x[1]),B=x[2];switch(B){case"h":return _*3600;case"m":return _*60;case"ms":return _*1e3;case"f":return _/b.frameRate;case"t":return _/b.tickRate}return _}},"./src/utils/logger.ts":function(I,h,S){"use strict";S.r(h),S.d(h,"enableLogs",function(){return s}),S.d(h,"logger",function(){return a});var L=function(){},T={trace:L,debug:L,log:L,warn:L,info:L,error:L},c=T;function C(r){var f=self.console[r];return f?f.bind(self.console,"["+r+"] >"):L}function g(r){for(var f=arguments.length,p=new Array(f>1?f-1:0),m=1;m<f;m++)p[m-1]=arguments[m];p.forEach(function(E){c[E]=r[E]?r[E].bind(r):C(E)})}function s(r){if(self.console&&r===!0||typeof r=="object"){g(r,"debug","log","info","warn","error");try{c.log()}catch(f){c=T}}else c=T}var a=c},"./src/utils/mediakeys-helper.ts":function(I,h,S){"use strict";S.r(h),S.d(h,"KeySystems",function(){return L}),S.d(h,"requestMediaKeySystemAccess",function(){return T});var L;(function(c){c.WIDEVINE="com.widevine.alpha",c.PLAYREADY="com.microsoft.playready"})(L||(L={}));var T=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(I,h,S){"use strict";S.r(h),S.d(h,"getMediaSource",function(){return L});function L(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(I,h,S){"use strict";S.r(h),S.d(h,"bin2str",function(){return g}),S.d(h,"readUint16",function(){return s}),S.d(h,"readUint32",function(){return a}),S.d(h,"writeUint32",function(){return r}),S.d(h,"findBox",function(){return f}),S.d(h,"parseSegmentIndex",function(){return p}),S.d(h,"parseInitSegment",function(){return m}),S.d(h,"getStartDTS",function(){return E}),S.d(h,"getDuration",function(){return y}),S.d(h,"computeRawDurationFromSamples",function(){return u}),S.d(h,"offsetStartDTS",function(){return n}),S.d(h,"segmentValidRange",function(){return o}),S.d(h,"appendUint8Array",function(){return l});var L=S("./src/utils/typed-array.ts"),T=S("./src/loader/fragment.ts"),c=Math.pow(2,32)-1,C=[].push;function g(w){return String.fromCharCode.apply(null,w)}function s(w,v){"data"in w&&(v+=w.start,w=w.data);var i=w[v]<<8|w[v+1];return i<0?65536+i:i}function a(w,v){"data"in w&&(v+=w.start,w=w.data);var i=w[v]<<24|w[v+1]<<16|w[v+2]<<8|w[v+3];return i<0?4294967296+i:i}function r(w,v,i){"data"in w&&(v+=w.start,w=w.data),w[v]=i>>24,w[v+1]=i>>16&255,w[v+2]=i>>8&255,w[v+3]=i&255}function f(w,v){var i=[];if(!v.length)return i;var R,k,d;"data"in w?(R=w.data,k=w.start,d=w.end):(R=w,k=0,d=R.byteLength);for(var b=k;b<d;){var x=a(R,b),_=g(R.subarray(b+4,b+8)),B=x>1?b+x:d;if(_===v[0])if(v.length===1)i.push({data:R,start:b+8,end:B});else{var U=f({data:R,start:b+8,end:B},v.slice(1));U.length&&C.apply(i,U)}b=B}return i}function p(w){var v=f(w,["moov"]),i=v[0],R=i?i.end:null,k=f(w,["sidx"]);if(!k||!k[0])return null;var d=[],b=k[0],x=b.data[0],_=x===0?8:16,B=a(b,_);_+=4;var U=0,P=0;x===0?_+=8:_+=16,_+=2;var J=b.end+P,$=s(b,_);_+=2;for(var z=0;z<$;z++){var V=_,K=a(b,V);V+=4;var H=K&2147483647,G=(K&2147483648)>>>31;if(G===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var ie=a(b,V);V+=4,d.push({referenceSize:H,subsegmentDuration:ie,info:{duration:ie/B,start:J,end:J+H-1}}),J+=H,V+=4,_=V}return{earliestPresentationTime:U,timescale:B,version:x,referencesCount:$,references:d,moovEndOffset:R}}function m(w){for(var v=[],i=f(w,["moov","trak"]),R=0;R<i.length;R++){var k=i[R],d=f(k,["tkhd"])[0];if(d){var b=d.data[d.start],x=b===0?12:20,_=a(d,x),B=f(k,["mdia","mdhd"])[0];if(B){b=B.data[B.start],x=b===0?12:20;var U=a(B,x),P=f(k,["mdia","hdlr"])[0];if(P){var J=g(P.data.subarray(P.start+8,P.start+12)),$={soun:T.ElementaryStreamTypes.AUDIO,vide:T.ElementaryStreamTypes.VIDEO}[J];if($){var z=f(k,["mdia","minf","stbl","stsd"])[0],V=void 0;z&&(V=g(z.data.subarray(z.start+12,z.start+16))),v[_]={timescale:U,type:$},v[$]={timescale:U,id:_,codec:V}}}}}}var K=f(w,["moov","mvex","trex"]);return K.forEach(function(H){var G=a(H,4),ie=v[G];ie&&(ie.default={duration:a(H,12),flags:a(H,20)})}),v}function E(w,v){return f(v,["moof","traf"]).reduce(function(i,R){var k=f(R,["tfdt"])[0],d=k.data[k.start],b=f(R,["tfhd"]).reduce(function(x,_){var B=a(_,4),U=w[B];if(U){var P=a(k,4);d===1&&(P*=Math.pow(2,32),P+=a(k,8));var J=U.timescale||9e4,$=P/J;if(isFinite($)&&(x===null||$<x))return $}return x},null);return b!==null&&isFinite(b)&&(i===null||b<i)?b:i},null)||0}function y(w,v){for(var i=0,R=0,k=0,d=f(w,["moof","traf"]),b=0;b<d.length;b++){var x=d[b],_=f(x,["tfhd"])[0],B=a(_,4),U=v[B];if(!U)continue;var P=U.default,J=a(_,0)|(P==null?void 0:P.flags),$=P==null?void 0:P.duration;J&8&&(J&2?$=a(_,12):$=a(_,8));for(var z=U.timescale||9e4,V=f(x,["trun"]),K=0;K<V.length;K++){if($){var H=a(V[K],4);i=$*H}else i=u(V[K]);U.type===T.ElementaryStreamTypes.VIDEO?R+=i/z:U.type===T.ElementaryStreamTypes.AUDIO&&(k+=i/z)}}if(R===0&&k===0){var G=p(w);if(G!=null&&G.references)return G.references.reduce(function(ie,le){return ie+le.info.duration||0},0)}return R||k}function u(w){var v=a(w,0),i=8;v&1&&(i+=4),v&4&&(i+=4);for(var R=0,k=a(w,4),d=0;d<k;d++){if(v&256){var b=a(w,i);R+=b,i+=4}v&512&&(i+=4),v&1024&&(i+=4),v&2048&&(i+=4)}return R}function n(w,v,i){f(v,["moof","traf"]).forEach(function(R){f(R,["tfhd"]).forEach(function(k){var d=a(k,4),b=w[d];if(!b)return;var x=b.timescale||9e4;f(R,["tfdt"]).forEach(function(_){var B=_.data[_.start],U=a(_,4);if(B===0)r(_,4,U-i*x);else{U*=Math.pow(2,32),U+=a(_,8),U-=i*x,U=Math.max(U,0);var P=Math.floor(U/(c+1)),J=Math.floor(U%(c+1));r(_,4,P),r(_,8,J)}})})})}function o(w){var v={valid:null,remainder:null},i=f(w,["moof"]);if(i){if(i.length<2)return v.remainder=w,v}else return v;var R=i[i.length-1];return v.valid=Object(L.sliceUint8)(w,0,R.start-8),v.remainder=Object(L.sliceUint8)(w,R.start-8),v}function l(w,v){var i=new Uint8Array(w.length+v.length);return i.set(w),i.set(v,w.length),i}},"./src/utils/output-filter.ts":function(I,h,S){"use strict";S.r(h),S.d(h,"default",function(){return L});var L=function(){function T(C,g){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=C,this.trackName=g}var c=T.prototype;return c.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},c.newCue=function(g,s,a){(this.startTime===null||this.startTime>g)&&(this.startTime=g),this.endTime=s,this.screen=a,this.timelineController.createCaptionsTrack(this.trackName)},c.reset=function(){this.cueRanges=[]},T}()},"./src/utils/texttrack-utils.ts":function(I,h,S){"use strict";S.r(h),S.d(h,"sendAddTrackEvent",function(){return T}),S.d(h,"addCueToTrack",function(){return c}),S.d(h,"clearCurrentCues",function(){return C}),S.d(h,"removeCuesInRange",function(){return g}),S.d(h,"getCuesInRange",function(){return a});var L=S("./src/utils/logger.ts");function T(r,f){var p;try{p=new Event("addtrack")}catch(m){p=document.createEvent("Event"),p.initEvent("addtrack",!1,!1)}p.track=r,f.dispatchEvent(p)}function c(r,f){var p=r.mode;if(p==="disabled"&&(r.mode="hidden"),r.cues&&!r.cues.getCueById(f.id))try{if(r.addCue(f),!r.cues.getCueById(f.id))throw new Error("addCue is failed for: "+f)}catch(E){L.logger.debug("[texttrack-utils]: "+E);var m=new self.TextTrackCue(f.startTime,f.endTime,f.text);m.id=f.id,r.addCue(m)}p==="disabled"&&(r.mode=p)}function C(r){var f=r.mode;if(f==="disabled"&&(r.mode="hidden"),r.cues)for(var p=r.cues.length;p--;)r.removeCue(r.cues[p]);f==="disabled"&&(r.mode=f)}function g(r,f,p){var m=r.mode;if(m==="disabled"&&(r.mode="hidden"),r.cues&&r.cues.length>0)for(var E=a(r.cues,f,p),y=0;y<E.length;y++)r.removeCue(E[y]);m==="disabled"&&(r.mode=m)}function s(r,f){if(f<r[0].startTime)return 0;var p=r.length-1;if(f>r[p].endTime)return-1;for(var m=0,E=p;m<=E;){var y=Math.floor((E+m)/2);if(f<r[y].startTime)E=y-1;else if(f>r[y].startTime&&m<p)m=y+1;else return y}return r[m].startTime-f<f-r[E].startTime?m:E}function a(r,f,p){var m=[],E=s(r,f);if(E>-1)for(var y=E,u=r.length;y<u;y++){var n=r[y];if(n.startTime>=f&&n.endTime<=p)m.push(n);else if(n.startTime>p)return m}return m}},"./src/utils/time-ranges.ts":function(I,h,S){"use strict";S.r(h);var L={toString:function(c){for(var C="",g=c.length,s=0;s<g;s++)C+="["+c.start(s).toFixed(3)+","+c.end(s).toFixed(3)+"]";return C}};h.default=L},"./src/utils/timescale-conversion.ts":function(I,h,S){"use strict";S.r(h),S.d(h,"toTimescaleFromBase",function(){return T}),S.d(h,"toTimescaleFromScale",function(){return c}),S.d(h,"toMsFromMpegTsClock",function(){return C}),S.d(h,"toMpegTsClockFromTimescale",function(){return g});var L=9e4;function T(s,a,r,f){r===void 0&&(r=1),f===void 0&&(f=!1);var p=s*a*r;return f?Math.round(p):p}function c(s,a,r,f){return r===void 0&&(r=1),f===void 0&&(f=!1),T(s,a,1/r,f)}function C(s,a){return a===void 0&&(a=!1),T(s,1e3,1/L,a)}function g(s,a){return a===void 0&&(a=1),T(s,L,1/a)}},"./src/utils/typed-array.ts":function(I,h,S){"use strict";S.r(h),S.d(h,"sliceUint8",function(){return L});function L(T,c,C){return Uint8Array.prototype.slice?T.slice(c,C):new Uint8Array(Array.prototype.slice.call(T,c,C))}},"./src/utils/vttcue.ts":function(I,h,S){"use strict";S.r(h),h.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var L=["","lr","rl"],T=["start","middle","end","left","right"];function c(r,f){if(typeof f!="string")return!1;if(!Array.isArray(r))return!1;var p=f.toLowerCase();return~r.indexOf(p)?p:!1}function C(r){return c(L,r)}function g(r){return c(T,r)}function s(r){for(var f=arguments.length,p=new Array(f>1?f-1:0),m=1;m<f;m++)p[m-1]=arguments[m];for(var E=1;E<arguments.length;E++){var y=arguments[E];for(var u in y)r[u]=y[u]}return r}function a(r,f,p){var m=this,E={enumerable:!0};m.hasBeenReset=!1;var y="",u=!1,n=r,o=f,l=p,w=null,v="",i=!0,R="auto",k="start",d=50,b="middle",x=50,_="middle";Object.defineProperty(m,"id",s({},E,{get:function(){return y},set:function(U){y=""+U}})),Object.defineProperty(m,"pauseOnExit",s({},E,{get:function(){return u},set:function(U){u=!!U}})),Object.defineProperty(m,"startTime",s({},E,{get:function(){return n},set:function(U){if(typeof U!="number")throw new TypeError("Start time must be set to a number.");n=U,this.hasBeenReset=!0}})),Object.defineProperty(m,"endTime",s({},E,{get:function(){return o},set:function(U){if(typeof U!="number")throw new TypeError("End time must be set to a number.");o=U,this.hasBeenReset=!0}})),Object.defineProperty(m,"text",s({},E,{get:function(){return l},set:function(U){l=""+U,this.hasBeenReset=!0}})),Object.defineProperty(m,"region",s({},E,{get:function(){return w},set:function(U){w=U,this.hasBeenReset=!0}})),Object.defineProperty(m,"vertical",s({},E,{get:function(){return v},set:function(U){var P=C(U);if(P===!1)throw new SyntaxError("An invalid or illegal string was specified.");v=P,this.hasBeenReset=!0}})),Object.defineProperty(m,"snapToLines",s({},E,{get:function(){return i},set:function(U){i=!!U,this.hasBeenReset=!0}})),Object.defineProperty(m,"line",s({},E,{get:function(){return R},set:function(U){if(typeof U!="number"&&U!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");R=U,this.hasBeenReset=!0}})),Object.defineProperty(m,"lineAlign",s({},E,{get:function(){return k},set:function(U){var P=g(U);if(!P)throw new SyntaxError("An invalid or illegal string was specified.");k=P,this.hasBeenReset=!0}})),Object.defineProperty(m,"position",s({},E,{get:function(){return d},set:function(U){if(U<0||U>100)throw new Error("Position must be between 0 and 100.");d=U,this.hasBeenReset=!0}})),Object.defineProperty(m,"positionAlign",s({},E,{get:function(){return b},set:function(U){var P=g(U);if(!P)throw new SyntaxError("An invalid or illegal string was specified.");b=P,this.hasBeenReset=!0}})),Object.defineProperty(m,"size",s({},E,{get:function(){return x},set:function(U){if(U<0||U>100)throw new Error("Size must be between 0 and 100.");x=U,this.hasBeenReset=!0}})),Object.defineProperty(m,"align",s({},E,{get:function(){return _},set:function(U){var P=g(U);if(!P)throw new SyntaxError("An invalid or illegal string was specified.");_=P,this.hasBeenReset=!0}})),m.displayState=void 0}return a.prototype.getCueAsHTML=function(){var r=self.WebVTT;return r.convertCueToDOMTree(self,this.text)},a}()},"./src/utils/vttparser.ts":function(I,h,S){"use strict";S.r(h),S.d(h,"parseTimeStamp",function(){return c}),S.d(h,"fixLineBreaks",function(){return f}),S.d(h,"VTTParser",function(){return p});var L=S("./src/utils/vttcue.ts"),T=function(){function m(){}var E=m.prototype;return E.decode=function(u,n){if(!u)return"";if(typeof u!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(u))},m}();function c(m){function E(u,n,o,l){return(u|0)*3600+(n|0)*60+(o|0)+parseFloat(l||0)}var y=m.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return y?parseFloat(y[2])>59?E(y[2],y[3],0,y[4]):E(y[1],y[2],y[3],y[4]):null}var C=function(){function m(){this.values=Object.create(null)}var E=m.prototype;return E.set=function(u,n){!this.get(u)&&n!==""&&(this.values[u]=n)},E.get=function(u,n,o){return o?this.has(u)?this.values[u]:n[o]:this.has(u)?this.values[u]:n},E.has=function(u){return u in this.values},E.alt=function(u,n,o){for(var l=0;l<o.length;++l)if(n===o[l]){this.set(u,n);break}},E.integer=function(u,n){/^-?\d+$/.test(n)&&this.set(u,parseInt(n,10))},E.percent=function(u,n){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(n)){var o=parseFloat(n);if(o>=0&&o<=100)return this.set(u,o),!0}return!1},m}();function g(m,E,y,u){var n=u?m.split(u):[m];for(var o in n){if(typeof n[o]!="string")continue;var l=n[o].split(y);if(l.length!==2)continue;var w=l[0],v=l[1];E(w,v)}}var s=new L.default(0,0,""),a=s.align==="middle"?"middle":"center";function r(m,E,y){var u=m;function n(){var w=c(m);if(w===null)throw new Error("Malformed timestamp: "+u);return m=m.replace(/^[^\sa-zA-Z-]+/,""),w}function o(w,v){var i=new C;g(w,function(d,b){var x;switch(d){case"region":for(var _=y.length-1;_>=0;_--)if(y[_].id===b){i.set(d,y[_].region);break}break;case"vertical":i.alt(d,b,["rl","lr"]);break;case"line":x=b.split(","),i.integer(d,x[0]),i.percent(d,x[0])&&i.set("snapToLines",!1),i.alt(d,x[0],["auto"]),x.length===2&&i.alt("lineAlign",x[1],["start",a,"end"]);break;case"position":x=b.split(","),i.percent(d,x[0]),x.length===2&&i.alt("positionAlign",x[1],["start",a,"end","line-left","line-right","auto"]);break;case"size":i.percent(d,b);break;case"align":i.alt(d,b,["start",a,"end","left","right"]);break}},/:/,/\s/),v.region=i.get("region",null),v.vertical=i.get("vertical","");var R=i.get("line","auto");R==="auto"&&s.line===-1&&(R=-1),v.line=R,v.lineAlign=i.get("lineAlign","start"),v.snapToLines=i.get("snapToLines",!0),v.size=i.get("size",100),v.align=i.get("align",a);var k=i.get("position","auto");k==="auto"&&s.position===50&&(k=v.align==="start"||v.align==="left"?0:v.align==="end"||v.align==="right"?100:50),v.position=k}function l(){m=m.replace(/^\s+/,"")}if(l(),E.startTime=n(),l(),m.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+u);m=m.substr(3),l(),E.endTime=n(),l(),o(m,E)}function f(m){return m.replace(/<br(?: \/)?>/gi,`
`)}var p=function(){function m(){this.state="INITIAL",this.buffer="",this.decoder=new T,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var E=m.prototype;return E.parse=function(u){var n=this;u&&(n.buffer+=n.decoder.decode(u,{stream:!0}));function o(){var k=n.buffer,d=0;for(k=f(k);d<k.length&&k[d]!=="\r"&&k[d]!==`
`;)++d;var b=k.substr(0,d);return k[d]==="\r"&&++d,k[d]===`
`&&++d,n.buffer=k.substr(d),b}function l(k){g(k,function(d,b){},/:/)}try{var w="";if(n.state==="INITIAL"){if(!/\r\n|\n/.test(n.buffer))return this;w=o();var v=w.match(/^()?WEBVTT([ \t].*)?$/);if(!v||!v[0])throw new Error("Malformed WebVTT signature.");n.state="HEADER"}for(var i=!1;n.buffer;){if(!/\r\n|\n/.test(n.buffer))return this;i?i=!1:w=o();switch(n.state){case"HEADER":/:/.test(w)?l(w):w||(n.state="ID");continue;case"NOTE":w||(n.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(w)){n.state="NOTE";break}if(!w)continue;if(n.cue=new L.default(0,0,""),n.state="CUE",w.indexOf("-->")===-1){n.cue.id=w;continue}case"CUE":if(!n.cue){n.state="BADCUE";continue}try{r(w,n.cue,n.regionList)}catch(k){n.cue=null,n.state="BADCUE";continue}n.state="CUETEXT";continue;case"CUETEXT":{var R=w.indexOf("-->")!==-1;if(!w||R&&(i=!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+=w}continue;case"BADCUE":w||(n.state="ID")}}}catch(k){n.state==="CUETEXT"&&n.cue&&n.oncue&&n.oncue(n.cue),n.cue=null,n.state=n.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},E.flush=function(){var u=this;try{if((u.cue||u.state==="HEADER")&&(u.buffer+=`
`,u.parse()),u.state==="INITIAL"||u.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(n){u.onparsingerror&&u.onparsingerror(n)}return u.onflush&&u.onflush(),this},m}()},"./src/utils/webvtt-parser.ts":function(I,h,S){"use strict";S.r(h),S.d(h,"generateCueId",function(){return p}),S.d(h,"parseWebVTT",function(){return E});var L=S("./src/polyfills/number.ts"),T=S("./src/utils/vttparser.ts"),c=S("./src/demux/id3.ts"),C=S("./src/utils/timescale-conversion.ts"),g=S("./src/remux/mp4-remuxer.ts"),s=/\r\n|\n\r|\n|\r/g,a=function(u,n,o){return o===void 0&&(o=0),u.substr(o,n.length)===n},r=function(u){var n=parseInt(u.substr(-3)),o=parseInt(u.substr(-6,2)),l=parseInt(u.substr(-9,2)),w=u.length>9?parseInt(u.substr(0,u.indexOf(":"))):0;if(!Object(L.isFiniteNumber)(n)||!Object(L.isFiniteNumber)(o)||!Object(L.isFiniteNumber)(l)||!Object(L.isFiniteNumber)(w))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+u);return n+=1e3*o,n+=60*1e3*l,n+=60*60*1e3*w,n},f=function(u){for(var n=5381,o=u.length;o;)n=n*33^u.charCodeAt(--o);return(n>>>0).toString()};function p(y,u,n){return f(y.toString())+f(u.toString())+f(n)}var m=function(u,n,o){var l=u[n],w=u[l.prevCC];if(!w||!w.new&&l.new){u.ccOffset=u.presentationOffset=l.start,l.new=!1;return}for(;(v=w)!==null&&v!==void 0&&v.new;){var v;u.ccOffset+=l.start-w.start,l.new=!1,l=w,w=u[l.prevCC]}u.presentationOffset=o};function E(y,u,n,o,l,w,v,i){var R=new T.VTTParser,k=Object(c.utf8ArrayToStr)(new Uint8Array(y)).trim().replace(s,`
`).split(`
`),d=[],b=Object(C.toMpegTsClockFromTimescale)(u,n),x="00:00.000",_=0,B=0,U,P=!0,J=!1;R.oncue=function($){var z=o[l],V=o.ccOffset,K=(_-b)/9e4;if(z!=null&&z.new&&(B!==void 0?V=o.ccOffset=z.start:m(o,l,K)),K&&(V=K-o.presentationOffset),J){var H=$.endTime-$.startTime,G=Object(g.normalizePts)(($.startTime+V-B)*9e4,w*9e4)/9e4;$.startTime=G,$.endTime=G+H}var ie=$.text.trim();$.text=decodeURIComponent(encodeURIComponent(ie)),$.id||($.id=p($.startTime,$.endTime,ie)),$.endTime>0&&d.push($)},R.onparsingerror=function($){U=$},R.onflush=function(){if(U){i(U);return}v(d)},k.forEach(function($){if(P)if(a($,"X-TIMESTAMP-MAP=")){P=!1,J=!0,$.substr(16).split(",").forEach(function(z){a(z,"LOCAL:")?x=z.substr(6):a(z,"MPEGTS:")&&(_=parseInt(z.substr(7)))});try{B=r(x)/1e3}catch(z){J=!1,U=z}return}else $===""&&(P=!1);R.parse($+`
`)}),R.flush()}},"./src/utils/xhr-loader.ts":function(I,h,S){"use strict";S.r(h);var L=S("./src/utils/logger.ts"),T=S("./src/loader/load-stats.ts"),c=/^age:\s*[\d.]+\s*$/m,C=function(){function g(a){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=a?a.xhrSetup:null,this.stats=new T.LoadStats,this.retryDelay=0}var s=g.prototype;return s.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},s.abortInternal=function(){var r=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),r&&(r.onreadystatechange=null,r.onprogress=null,r.readyState!==4&&(this.stats.aborted=!0,r.abort()))},s.abort=function(){var r;this.abortInternal(),(r=this.callbacks)!==null&&r!==void 0&&r.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},s.load=function(r,f,p){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=r,this.config=f,this.callbacks=p,this.retryDelay=f.retryDelay,this.loadInternal()},s.loadInternal=function(){var r=this.config,f=this.context;if(!r)return;var p=this.loader=new self.XMLHttpRequest,m=this.stats;m.loading.first=0,m.loaded=0;var E=this.xhrSetup;try{if(E)try{E(p,f.url)}catch(n){p.open("GET",f.url,!0),E(p,f.url)}p.readyState||p.open("GET",f.url,!0);var y=this.context.headers;if(y)for(var u in y)p.setRequestHeader(u,y[u])}catch(n){this.callbacks.onError({code:p.status,text:n.message},f,p);return}f.rangeEnd&&p.setRequestHeader("Range","bytes="+f.rangeStart+"-"+(f.rangeEnd-1)),p.onreadystatechange=this.readystatechange.bind(this),p.onprogress=this.loadprogress.bind(this),p.responseType=f.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),r.timeout),p.send()},s.readystatechange=function(){var r=this.context,f=this.loader,p=this.stats;if(!r||!f)return;var m=f.readyState,E=this.config;if(p.aborted)return;if(m>=2)if(self.clearTimeout(this.requestTimeout),p.loading.first===0&&(p.loading.first=Math.max(self.performance.now(),p.loading.start)),m===4){f.onreadystatechange=null,f.onprogress=null;var y=f.status;if(y>=200&&y<300){p.loading.end=Math.max(self.performance.now(),p.loading.first);var u,n;if(r.responseType==="arraybuffer"?(u=f.response,n=u.byteLength):(u=f.responseText,n=u.length),p.loaded=p.total=n,!this.callbacks)return;var o=this.callbacks.onProgress;if(o&&o(p,r,u,f),!this.callbacks)return;var l={url:f.responseURL,data:u};this.callbacks.onSuccess(l,p,r,f)}else p.retry>=E.maxRetry||y>=400&&y<499?(L.logger.error(y+" while loading "+r.url),this.callbacks.onError({code:y,text:f.statusText},r,f)):(L.logger.warn(y+" while loading "+r.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,E.maxRetryDelay),p.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),E.timeout)},s.loadtimeout=function(){L.logger.warn("timeout while loading "+this.context.url);var r=this.callbacks;r&&(this.abortInternal(),r.onTimeout(this.stats,this.context,this.loader))},s.loadprogress=function(r){var f=this.stats;f.loaded=r.loaded,r.lengthComputable&&(f.total=r.total)},s.getCacheAge=function(){var r=null;if(this.loader&&c.test(this.loader.getAllResponseHeaders())){var f=this.loader.getResponseHeader("age");r=f?parseFloat(f):null}return r},g}();h.default=C}}).default})},vHTk:function(M,ne,N){M.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},w7YG:function(M,ne,N){(function(I,h,S){M.exports=ne=h(N("Ib8C"),N("ETIr"),N("cv67"),N("K3mO"),N("OLod"))})(this,function(I){return function(){var h=I,S=h.lib,L=S.StreamCipher,T=h.algo,c=T.RC4=L.extend({_doReset:function(){for(var s=this._key,a=s.words,r=s.sigBytes,f=this._S=[],p=0;p<256;p++)f[p]=p;for(var p=0,m=0;p<256;p++){var E=p%r,y=a[E>>>2]>>>24-E%4*8&255;m=(m+f[p]+y)%256;var u=f[p];f[p]=f[m],f[m]=u}this._i=this._j=0},_doProcessBlock:function(s,a){s[a]^=C.call(this)},keySize:256/32,ivSize:0});function C(){for(var s=this._S,a=this._i,r=this._j,f=0,p=0;p<4;p++){a=(a+1)%256,r=(r+s[a])%256;var m=s[a];s[a]=s[r],s[r]=m,f|=s[(s[a]+s[r])%256]<<24-p*8}return this._i=a,this._j=r,f}h.RC4=L._createHelper(c);var g=T.RC4Drop=c.extend({cfg:c.cfg.extend({drop:192}),_doReset:function(){c._doReset.call(this);for(var s=this.cfg.drop;s>0;s--)C.call(this)}});h.RC4Drop=L._createHelper(g)}(),I.RC4})},wZgz:function(M,ne,N){(function(I,h,S){M.exports=ne=h(N("Ib8C"),N("ETIr"),N("cv67"),N("K3mO"),N("OLod"))})(this,function(I){return function(){var h=I,S=h.lib,L=S.BlockCipher,T=h.algo,c=[],C=[],g=[],s=[],a=[],r=[],f=[],p=[],m=[],E=[];(function(){for(var n=[],o=0;o<256;o++)o<128?n[o]=o<<1:n[o]=o<<1^283;for(var l=0,w=0,o=0;o<256;o++){var v=w^w<<1^w<<2^w<<3^w<<4;v=v>>>8^v&255^99,c[l]=v,C[v]=l;var i=n[l],R=n[i],k=n[R],d=n[v]*257^v*16843008;g[l]=d<<24|d>>>8,s[l]=d<<16|d>>>16,a[l]=d<<8|d>>>24,r[l]=d;var d=k*16843009^R*65537^i*257^l*16843008;f[v]=d<<24|d>>>8,p[v]=d<<16|d>>>16,m[v]=d<<8|d>>>24,E[v]=d,l?(l=i^n[n[n[k^i]]],w^=n[n[w]]):l=w=1}})();var y=[0,1,2,4,8,16,32,64,128,27,54],u=T.AES=L.extend({_doReset:function(){var n;if(this._nRounds&&this._keyPriorReset===this._key)return;for(var o=this._keyPriorReset=this._key,l=o.words,w=o.sigBytes/4,v=this._nRounds=w+6,i=(v+1)*4,R=this._keySchedule=[],k=0;k<i;k++)k<w?R[k]=l[k]:(n=R[k-1],k%w?w>6&&k%w==4&&(n=c[n>>>24]<<24|c[n>>>16&255]<<16|c[n>>>8&255]<<8|c[n&255]):(n=n<<8|n>>>24,n=c[n>>>24]<<24|c[n>>>16&255]<<16|c[n>>>8&255]<<8|c[n&255],n^=y[k/w|0]<<24),R[k]=R[k-w]^n);for(var d=this._invKeySchedule=[],b=0;b<i;b++){var k=i-b;if(b%4)var n=R[k];else var n=R[k-4];b<4||k<=4?d[b]=n:d[b]=f[c[n>>>24]]^p[c[n>>>16&255]]^m[c[n>>>8&255]]^E[c[n&255]]}},encryptBlock:function(n,o){this._doCryptBlock(n,o,this._keySchedule,g,s,a,r,c)},decryptBlock:function(n,o){var l=n[o+1];n[o+1]=n[o+3],n[o+3]=l,this._doCryptBlock(n,o,this._invKeySchedule,f,p,m,E,C);var l=n[o+1];n[o+1]=n[o+3],n[o+3]=l},_doCryptBlock:function(n,o,l,w,v,i,R,k){for(var d=this._nRounds,b=n[o]^l[0],x=n[o+1]^l[1],_=n[o+2]^l[2],B=n[o+3]^l[3],U=4,P=1;P<d;P++){var J=w[b>>>24]^v[x>>>16&255]^i[_>>>8&255]^R[B&255]^l[U++],$=w[x>>>24]^v[_>>>16&255]^i[B>>>8&255]^R[b&255]^l[U++],z=w[_>>>24]^v[B>>>16&255]^i[b>>>8&255]^R[x&255]^l[U++],V=w[B>>>24]^v[b>>>16&255]^i[x>>>8&255]^R[_&255]^l[U++];b=J,x=$,_=z,B=V}var J=(k[b>>>24]<<24|k[x>>>16&255]<<16|k[_>>>8&255]<<8|k[B&255])^l[U++],$=(k[x>>>24]<<24|k[_>>>16&255]<<16|k[B>>>8&255]<<8|k[b&255])^l[U++],z=(k[_>>>24]<<24|k[B>>>16&255]<<16|k[b>>>8&255]<<8|k[x&255])^l[U++],V=(k[B>>>24]<<24|k[b>>>16&255]<<16|k[x>>>8&255]<<8|k[_&255])^l[U++];n[o]=J,n[o+1]=$,n[o+2]=z,n[o+3]=V},keySize:256/32});h.AES=L._createHelper(u)}(),I.AES})},wbyO:function(M,ne,N){(function(I,h){M.exports=ne=h(N("Ib8C"))})(this,function(I){return function(){var h=I,S=h.lib,L=S.WordArray,T=h.enc,c=T.Base64url={stringify:function(g,s=!0){var a=g.words,r=g.sigBytes,f=s?this._safe_map:this._map;g.clamp();for(var p=[],m=0;m<r;m+=3)for(var E=a[m>>>2]>>>24-m%4*8&255,y=a[m+1>>>2]>>>24-(m+1)%4*8&255,u=a[m+2>>>2]>>>24-(m+2)%4*8&255,n=E<<16|y<<8|u,o=0;o<4&&m+o*.75<r;o++)p.push(f.charAt(n>>>6*(3-o)&63));var l=f.charAt(64);if(l)for(;p.length%4;)p.push(l);return p.join("")},parse:function(g,s=!0){var a=g.length,r=s?this._safe_map:this._map,f=this._reverseMap;if(!f){f=this._reverseMap=[];for(var p=0;p<r.length;p++)f[r.charCodeAt(p)]=p}var m=r.charAt(64);if(m){var E=g.indexOf(m);E!==-1&&(a=E)}return C(g,a,f)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"};function C(g,s,a){for(var r=[],f=0,p=0;p<s;p++)if(p%4){var m=a[g.charCodeAt(p-1)]<<p%4*2,E=a[g.charCodeAt(p)]>>>6-p%4*2,y=m|E;r[f>>>2]|=y<<24-f%4*8,f++}return L.create(r,f)}}(),I.enc.Base64url})},ynwM:function(M,ne,N){var I=N("MFOe"),h=I.Global;M.exports={name:"oldFF-globalStorage",read:L,write:T,each:c,remove:C,clearAll:g};var S=h.globalStorage;function L(s){return S[s]}function T(s,a){S[s]=a}function c(s){for(var a=S.length-1;a>=0;a--){var r=S.key(a);s(S[r],r)}}function C(s){return S.removeItem(s)}function g(){c(function(s,a){delete S[s]})}}}]);